{
  "purpose": "Select actual local calendar dates with distinct selected value, keyboard focus and displayed month. Compose the date calendar inside an independently controlled named Popover.",
  "avoid": "Do not infer date parsing or locale from an example.",
  "classification": "source-bound-reference-with-explicit-decisions",
  "basis": "Pinned React/primitive sources lead API, lifecycle and semantics; native visual observations and explicit reference decisions are mapped in figma/traceability.json.",
  "profile": "interactive-control/1",
  "profileRationale": "The family presents controls or navigation; static depictions do not establish an interactive contract.",
  "componentId": "shadcn:DatePicker",
  "sourceRule": "Calendar forwards the full React DayPicker 9.14.0 discriminated prop union (mode absent|single|multiple|range, required variants) plus buttonVariant. shadcn defaults showOutsideDays=true, captionLayout=label, buttonVariant=ghost; locale, formatters, classNames and components are explicit overrides. CalendarDayButton is the exported native shadcn Button adapter, attempting to synchronize focus when modifiers.focused changes, but the pinned wrapper omits attaching its ref: raw keyboard focus is broken while internal focused modifiers advance; data-day is locale-formatted, never a stable ISO identifier. DayPicker selection is Date|Date[]|DateRange|undefined according to mode/required. Supplying onSelect makes the selected prop authoritative even when undefined; without onSelect the primitive owns internal selection. onSelect(selected,triggerDate,modifiers,event) is separate from onDayClick(date,modifiers,event); the source calls selection first, onDayClick afterward. DayPicker itself prevents default and propagation on day click; defaultPrevented is not a generic veto/cancellable eventDetails API. Optional single may clear by selecting the same date; required single does not clear. Multiple min/max and range min/max/excludeDisabled/resetOnSelect are source algorithms, not assumed to be the same toggle. excludeDisabled resets a candidate range crossing a disabled date to its new start. disabled is a Matcher or Matcher[], hidden differs from disabled, and no synthetic root disabled boolean is invented. Displayed month/defaultMonth/onMonthChange is independent from selected date; startMonth/endMonth bound month navigation, not selection by themselves. Selection need not submit a form. Root is a named div by default, each month table is the source named grid, with native day buttons, registered roving tabIndex and labelled selected/today dates. Noninteractive mode omits day buttons. Footer is the primitive polite status; essential validation instructions remain persistent outside it. Date Picker is explicitly the documented Popover + Calendar composition, with no upstream DatePicker root. The basic official onSelect only sets date and leaves the popup open; no automatic close-on-select is invented. Trigger text includes the current formatted date or Pick a date. Popover nonmodal dialog naming, Escape, outside dismissal, controlled cancellation, Presence and focus restoration retain the already complete Popover contract. Range and date-of-birth presets are optional Calendar compositions, not a new Root value type.",
  "keyboardAndFocus": "The explicit reference components.DayButton adapter forwards an attached ref through exported CalendarDayButton rest props and focuses it on modifiers.focused, preserving original styling and handlers. This repairs the observed pinned source omission; raw wrapper behavior is preserved as a negative browser regression. The active day has one tabIndex=0; source focus navigation skips disabled/hidden dates. Left/Right move a day (RTL reverses), Up/Down a week; Shift+Left/Right move a month and Shift+Up/Down a year. PageUp/PageDown move month, Shift adds year; Home/End move to week boundaries. Native Enter/Space selects the focused eligible day. Keyboard focus can move without selection. Navigation arrows have source native disabled boundaries. Calendar alone has no Escape dismissal or focus trap. Caller-provided components/labels must preserve the source refs, event handlers, names and native semantics.",
  "referenceDecision": "Reference locale is en-US with local dates (no UTC string conversion), fixed November2026 and today November21, selected November12, disabled November13, November–December navigation bounds. The attached focus-ref components.DayButton adapter is an explicit caller repair, not falsely attributed to unchanged upstream. These concrete values and Delivery date name are chosen reference usage, separate from native FIG visual samples. Single and range are exercised, required/multiple remain exact source-described API variants. A typed date input, time, natural-language parsing, remote availability and submit persistence are separate optional application compositions, not promised Calendar or DatePicker exports.",
  "sourceCommit": "45bbf9ba23c9c0f63d38887947e5fb06f59c7da3",
  "sourceFiles": [
    "sources/shadcn/apps/v4/content/docs/components/base/date-picker.mdx.source"
  ],
  "visualContract": {
    "layoutPolicy": "DatePicker is a documented caller composition, not an invented exported Root. Stable caller data-part marks the recipe and the Button rendered by PopoverTrigger; source Popover slot and Calendar slot delegate exact visual/behavioral parts to those complete contracts through explicit CSS imports. Native 32px trigger minimum is retained but localized date text can wrap. Preferred intrinsic popup with zero wrapper padding lets Calendar own 8px inset; explicit data-date-picker-popup marker applies the same surface rule to the actual portal. Compact native 28px Calendar cells are chosen in this recipe to fit narrow viewports. Trigger text names the current date; persistent availability instructions and actual dialog labelledby retain semantic relationships. Selection does not implicitly close the official basic recipe, Escape restores trigger focus, and popup open authority remains separate from Date selection. No coordinate-based selector or fixed native preview box remains.",
    "parts": "component.json#/partBindings",
    "tokenBindings": "component.json#/visualContract/tokens",
    "sourceEvidence": "figma/traceability.json"
  }
}
