{
  "version": "0.2.0-preview.1",
  "content_digest": "70ac710f4d22dce040e7ac593379ba8aca9dcb59a0b9c0f839819cae0e2bb721",
  "status": "preview",
  "authority": {
    "repository": "cloakedinc/design",
    "path": "packages/design-system",
    "catalog": "packages/design-system/catalog.json",
    "status": "preview"
  },
  "provenance": {
    "repo": "cloakedinc/automation",
    "commit": "f96f416e1c3bfbfaffcd155a88b87b18b8bb25f1",
    "path": "packages/design-system",
    "imported_spec_status": "approved"
  },
  "adaptations": [
    {
      "id": "button-content-gap",
      "status": "preview",
      "description": "Use the specification's 4px content gap instead of the inherited 8px implementation gap."
    },
    {
      "id": "keyboard-focus",
      "status": "preview",
      "description": "Add visible Button and Input keyboard focus and an overridable inset focus default for shared button resets, including FAQ cards and ListItem rows."
    },
    {
      "id": "supporting-text-contrast",
      "status": "preview",
      "description": "Map light secondary text to the existing grey-04-strong primitive for readable helper text on white and cream."
    },
    {
      "id": "danger-text-contrast",
      "status": "preview",
      "description": "Separate readable danger text/borders from destructive fills; preserve the primary danger-button fill and label pair."
    },
    {
      "id": "preview-status",
      "status": "preview",
      "description": "Local components, specs and token adaptations await human sign-off; upstream approved status is provenance only."
    },
    {
      "id": "motion-comparison-accessibility",
      "status": "preview",
      "description": "Preserve the original MotionShowcase comparisons while requiring explicit replay, responding to live reduced-motion changes, and keeping duration tracks usable on small screens."
    },
    {
      "id": "list-item-ownership",
      "status": "preview",
      "description": "List owns listitem wrappers for its content rows, while section labels stay outside the row count and standalone rows retain their existing semantics."
    },
    {
      "id": "card-delta-text-contrast",
      "status": "preview",
      "description": "Mix Card.Delta foregrounds from 60% existing tone solid and 40% primary text for readable contrast in both themes; preserve the four original tone fills."
    },
    {
      "id": "carousel-keyboard-access",
      "status": "preview",
      "description": "Keep all native-scrolling carousel slide controls exposed to assistive technology and keyboard navigation; pause autoplay while focus is inside the carousel."
    }
  ],
  "id": "datepicker",
  "name": "DatePicker",
  "category": "Forms",
  "contract_status": "preview",
  "contract_kind": "source-derived",
  "review": {
    "local_status": "not-reviewed",
    "source_approval": null,
    "imported_spec_status": "approved",
    "spec_origin": "imported-adapted",
    "local_spec_source_status": "approved",
    "imported_source_revision": "f96f416e1c3bfbfaffcd155a88b87b18b8bb25f1",
    "note": "Inherited specification status is provenance, not approval of the current local implementation or extracted contract."
  },
  "approval": "required",
  "visual_reference": {
    "stories": [
      {
        "id": "cloaked-design-system-forms-datepicker--playground",
        "name": "Playground",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "Playground",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--playground&viewMode=story"
      },
      {
        "id": "cloaked-design-system-forms-datepicker--selected",
        "name": "Selected",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "Selected",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--selected&viewMode=story"
      },
      {
        "id": "cloaked-design-system-forms-datepicker--with-field",
        "name": "With Field",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "WithField",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--with-field&viewMode=story"
      },
      {
        "id": "cloaked-design-system-forms-datepicker--invalid-in-field",
        "name": "Invalid In Field",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "InvalidInField",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--invalid-in-field&viewMode=story"
      },
      {
        "id": "cloaked-design-system-forms-datepicker--disabled",
        "name": "Disabled",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "Disabled",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--disabled&viewMode=story"
      },
      {
        "id": "cloaked-design-system-forms-datepicker--narrow-range",
        "name": "Narrow Range",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "NarrowRange",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--narrow-range&viewMode=story"
      },
      {
        "id": "cloaked-design-system-forms-datepicker--state-matrix",
        "name": "State Matrix",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "StateMatrix",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--state-matrix&viewMode=story"
      },
      {
        "id": "cloaked-design-system-forms-datepicker--dark-theme",
        "name": "Dark Theme",
        "title": "Cloaked Design System/Forms/DatePicker",
        "exportName": "DarkTheme",
        "source_path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
        "source_digest": "2f50c5ab99c6600143d57b3d9134730ebbea12c4fa61a6c7e55bb1dcf0193e13",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-forms-datepicker--dark-theme&viewMode=story"
      }
    ],
    "name": "DatePicker",
    "id": "datepicker",
    "category": "Forms"
  },
  "stories_source": {
    "path": "packages/design-system/src/components/forms/DatePicker/DatePicker.stories.tsx",
    "code": "import React, { useEffect, useState } from 'react';\nimport type { Meta, StoryObj } from '@storybook/react-vite';\n\nimport { VStack } from '../../layout/VStack/VStack';\nimport { Icon } from '../../primitives/Icon/Icon';\nimport { disabledControl, hapticArgType } from '../../../storybook/controlOptions';\nimport { Field } from '../Field/Field';\nimport { DatePicker, type DatePickerProps } from './DatePicker';\n\nconst CALENDAR_ICON = <Icon name='clock' size='small' />;\n\nconst meta: Meta<typeof DatePicker> = {\n    title: 'Cloaked Design System/Forms/DatePicker',\n    component: DatePicker,\n    parameters: {\n        a11y: { test: 'error' },\n        stage: 'form-control',\n        docs: {\n            description: {\n                component:\n                    'A date field that opens a mobile bottom sheet of month/day/year scroll wheels, mirroring how ' +\n                    '`Select` presents one choice. Dates cross the boundary as ISO `\"YYYY-MM-DD\"` strings — `value`, ' +\n                    '`min`, `max`, and `placeholderValue` are all ISO, and `onChange` emits ISO. Bound the range with ' +\n                    '`min`/`max` (default `1900-01-01` → today) and set `placeholderValue` to control where empty ' +\n                    'wheels open (e.g. a plausible birth year). A stored value outside the range is clamped for ' +\n                    'display. Pair with `Field` for a label; only pass the standalone `error` prop outside `Field`. ' +\n                    'The sheet, confirm button, and wheels derive their test ids from the trigger `testId` ' +\n                    '(suffixes like `-sheet` and `-confirm`).',\n            },\n        },\n    },\n    args: {\n        value: '',\n        ariaLabel: 'Date of birth',\n        sheetTitle: 'Date of birth',\n        placeholderValue: '1990-01-01',\n        icon: CALENDAR_ICON,\n        testId: 'date-picker-story',\n    },\n    argTypes: {\n        onChange: {\n            ...disabledControl,\n            description: 'Called with the confirmed date as an ISO `\"YYYY-MM-DD\"` string.',\n        },\n        icon: { ...disabledControl, description: 'Trailing affordance in the trigger, usually a calendar Icon.' },\n        haptic: {\n            ...hapticArgType,\n            description: 'Haptic fired as the wheels cross a value. Defaults to `true` (`selection`).',\n        },\n        value: { control: 'text', description: 'Selected date as ISO `\"YYYY-MM-DD\"`, or `\"\"` when unset.' },\n        min: { control: 'text', description: 'Earliest selectable date (ISO). Defaults to `1900-01-01`.' },\n        max: { control: 'text', description: 'Latest selectable date (ISO). Defaults to today.' },\n        placeholderValue: { control: 'text', description: 'ISO date the wheels open to while `value` is empty.' },\n        placeholder: { control: 'text', description: 'Trigger text shown while `value` is empty.' },\n        invalid: {\n            control: 'boolean',\n            description: 'Paints the invalid ring. A parent Field sets this from its own `error`.',\n        },\n        disabled: { control: 'boolean', description: 'Blocks opening the sheet and dims the trigger.' },\n    },\n};\nexport default meta;\ntype Story = StoryObj<typeof DatePicker>;\n\nfunction ControlledDatePicker(args: DatePickerProps) {\n    const [value, setValue] = useState(args.value);\n    useEffect(() => setValue(args.value), [args.value]);\n    return <DatePicker {...args} value={value} onChange={setValue} />;\n}\n\nexport const Playground: Story = {\n    render: args => <ControlledDatePicker {...args} />,\n};\n\nexport const Selected: Story = {\n    parameters: { docs: { description: { story: 'Trigger showing a confirmed ISO date formatted for display.' } } },\n    render: args => <ControlledDatePicker {...args} />,\n    args: { value: '1990-04-15' },\n};\n\nexport const WithField: Story = {\n    parameters: {\n        docs: { description: { story: 'Wrapped in `Field` so the label and aria wiring come from the field.' } },\n    },\n    render: function WithFieldStory() {\n        const [value, setValue] = useState('');\n        return (\n            <Field label='Date of birth'>\n                <DatePicker\n                    value={value}\n                    onChange={setValue}\n                    placeholderValue='1990-01-01'\n                    icon={CALENDAR_ICON}\n                    testId='date-picker-with-field'\n                />\n            </Field>\n        );\n    },\n};\n\nexport const InvalidInField: Story = {\n    parameters: {\n        docs: { description: { story: 'Field owns the message; the trigger turns red through context.' } },\n    },\n    render: args => (\n        <Field label='Date of birth' error='Enter your date of birth.'>\n            <ControlledDatePicker {...args} />\n        </Field>\n    ),\n    args: { value: '', testId: 'date-picker-error' },\n};\n\nexport const Disabled: Story = {\n    parameters: { docs: { description: { story: 'Disabled trigger cannot open the wheel sheet.' } } },\n    args: { value: '1990-04-15', disabled: true, testId: 'date-picker-disabled' },\n};\n\nexport const NarrowRange: Story = {\n    parameters: {\n        docs: {\n            description: {\n                story: '`min`/`max` bound the wheels to a tight window; `placeholderValue` opens inside it.',\n            },\n        },\n    },\n    render: args => <ControlledDatePicker {...args} />,\n    args: {\n        value: '',\n        ariaLabel: 'Appointment date',\n        sheetTitle: 'Appointment date',\n        min: '2024-03-10',\n        max: '2024-09-20',\n        placeholderValue: '2024-06-01',\n        testId: 'date-picker-narrow-range',\n    },\n};\n\nexport const StateMatrix: Story = {\n    parameters: { docs: { description: { story: 'Empty, selected, error, and disabled triggers side by side.' } } },\n    render: () => (\n        <VStack gap={16}>\n            <DatePicker\n                value=''\n                ariaLabel='Empty picker'\n                placeholderValue='1990-01-01'\n                icon={CALENDAR_ICON}\n                testId='date-picker-matrix-empty'\n            />\n            <DatePicker\n                value='1990-04-15'\n                ariaLabel='Selected picker'\n                icon={CALENDAR_ICON}\n                testId='date-picker-matrix-selected'\n            />\n            <DatePicker\n                value=''\n                ariaLabel='Error picker'\n                invalid\n                icon={CALENDAR_ICON}\n                testId='date-picker-matrix-error'\n            />\n            <DatePicker\n                value='1990-04-15'\n                ariaLabel='Disabled picker'\n                disabled\n                icon={CALENDAR_ICON}\n                testId='date-picker-matrix-disabled'\n            />\n        </VStack>\n    ),\n};\n\nexport const DarkTheme: Story = {\n    globals: { theme: 'dark' },\n    parameters: { docs: { description: { story: 'Trigger and error tokens on the dark theme.' } } },\n    render: () => (\n        <VStack gap={16}>\n            <DatePicker\n                value='1990-04-15'\n                ariaLabel='Selected picker'\n                icon={CALENDAR_ICON}\n                testId='date-picker-dark-selected'\n            />\n            <DatePicker\n                value=''\n                ariaLabel='Error picker'\n                invalid\n                icon={CALENDAR_ICON}\n                testId='date-picker-dark-error'\n            />\n        </VStack>\n    ),\n};\n"
  },
  "specification": {
    "$schema": "../../../specs/component-spec.schema.json",
    "identity": {
      "name": "DatePicker",
      "status": "preview",
      "version": "2.0.0",
      "summary": "A form trigger that presents bounded month, day, and year wheels and commits one ISO calendar date on confirmation."
    },
    "parts": [
      {
        "id": "root",
        "label": "Root",
        "description": "Carries the caller's class around the trigger."
      },
      {
        "id": "trigger",
        "label": "Trigger",
        "description": "Displays the placeholder or formatted date and opens the picker dialog."
      },
      {
        "id": "trigger-icon",
        "label": "Trigger icon",
        "description": "Optional trailing calendar affordance that does not replace the accessible name."
      },
      {
        "id": "sheet",
        "label": "Picker sheet",
        "description": "Modal surface containing the date wheels and confirm action."
      },
      {
        "id": "wheel-group",
        "label": "Wheel group",
        "description": "Groups month, day, and year listboxes under the field name."
      },
      {
        "id": "wheel-column",
        "label": "Wheel column",
        "description": "Scrollable, keyboard-operable listbox for one date part."
      },
      {
        "id": "selection-band",
        "label": "Selection band",
        "description": "Visually marks the centered row shared by all wheel columns."
      },
      {
        "id": "confirm-action",
        "label": "Confirm action",
        "description": "Commits the working date and closes the sheet."
      }
    ],
    "allowedDesignChoices": {
      "variants": {
        "wheel-sheet": {
          "label": "Wheel sheet",
          "description": "The trigger opens three bounded scroll wheels in a modal sheet."
        }
      },
      "sizes": {}
    },
    "variants": [
      {
        "id": "wheel-sheet",
        "label": "Wheel sheet",
        "description": "Single approved date-picking flow with separate working and committed dates.",
        "platforms": [
          "ios",
          "android",
          "web"
        ]
      }
    ],
    "sizes": [],
    "measurements": [
      {
        "id": "trigger-min-height",
        "label": "Trigger minimum height",
        "kind": "exact",
        "token": "--cds-size-48",
        "value": 48,
        "unit": "px",
        "appliesTo": [
          "trigger"
        ]
      },
      {
        "id": "trigger-horizontal-padding",
        "label": "Trigger horizontal padding",
        "kind": "exact",
        "token": "--cds-space-16",
        "value": 16,
        "unit": "px",
        "appliesTo": [
          "trigger"
        ]
      },
      {
        "id": "wheel-row-height",
        "label": "Wheel row height",
        "kind": "exact",
        "token": "--cds-size-40",
        "value": 40,
        "unit": "px",
        "appliesTo": [
          "wheel-column",
          "selection-band"
        ]
      }
    ],
    "layout": {
      "alignment": "Trigger text fills the available row while the optional icon remains trailing; wheel columns share one centered selection band.",
      "flow": "Trigger opens a modal, wheels edit a working date, and the full-width confirm action commits it.",
      "notes": [
        "Clamp display and working dates to the inclusive minimum and maximum range.",
        "Keep the committed value unchanged until confirmation."
      ]
    },
    "typographyAndColor": {
      "typography": [
        {
          "label": "Trigger and wheel text",
          "description": "Use the body ramp for the selected date and wheel options.",
          "token": "--cds-type-body-size"
        }
      ],
      "colors": [
        {
          "label": "Trigger and selection band",
          "description": "Use the semantic input container.",
          "token": "--cds-input-container"
        },
        {
          "label": "Selected text",
          "description": "Use primary text emphasis for dates and active wheel rows.",
          "token": "--cds-text-primary"
        },
        {
          "label": "Placeholder",
          "description": "Use secondary text emphasis while no date is committed.",
          "token": "--cds-text-secondary"
        },
        {
          "label": "Validation",
          "description": "Use the solid danger role for invalid indication and copy.",
          "token": "--cds-status-danger-solid"
        }
      ]
    },
    "states": [
      {
        "id": "empty",
        "label": "Empty",
        "description": "Shows the placeholder and opens wheels at the clamped placeholder date."
      },
      {
        "id": "selected",
        "label": "Selected",
        "description": "Shows the committed ISO date in human-readable display format."
      },
      {
        "id": "open",
        "label": "Open",
        "description": "Exposes expanded state and presents the working date in the modal wheels."
      },
      {
        "id": "invalid",
        "label": "Invalid",
        "description": "Shows the danger border and invalid semantics. The corrective message belongs to the enclosing Field."
      },
      {
        "id": "disabled",
        "label": "Disabled",
        "description": "Blocks opening the sheet and dims the trigger."
      }
    ],
    "behavior": [
      {
        "label": "ISO boundary",
        "description": "Accept and emit calendar dates as YYYY-MM-DD strings without time-zone conversion."
      },
      {
        "label": "Bounded wheels",
        "description": "Trim month, day, and year options so no visible combination falls outside the range."
      },
      {
        "label": "Confirmation",
        "description": "Commit the working date only when the confirm action is pressed; dismissal preserves the prior value."
      },
      {
        "label": "Keyboard wheel input",
        "description": "Support ArrowUp, ArrowDown, Home, and End on each wheel column."
      }
    ],
    "accessibility": [
      {
        "label": "Trigger name and state",
        "description": "Associate a visible Field label or accessible label and expose dialog popup, expanded, required, invalid, and described-by states."
      },
      {
        "label": "Wheel names",
        "description": "Expose the date as a group containing independently named Month, Day, and Year listboxes."
      },
      {
        "label": "Active options",
        "description": "Expose the centered wheel option through selected and active-descendant semantics."
      }
    ],
    "contentAdaptation": [
      {
        "label": "Trigger truncation",
        "description": "Truncate a long localized display date on one line without displacing the icon."
      },
      {
        "label": "Localized labels",
        "description": "Allow product surfaces to provide localized sheet and confirm labels while preserving the ISO data contract."
      }
    ],
    "motionHaptics": {
      "motion": [
        {
          "label": "Sheet presentation",
          "description": "Delegate opening and dismissal motion to Modal and keep wheel snapping within each column."
        }
      ],
      "haptics": [
        {
          "label": "Wheel feedback",
          "description": "Request the selection haptic once per user-driven wheel row crossed."
        }
      ]
    },
    "platformDifferences": [
      {
        "platforms": [
          "web"
        ],
        "description": "The web implementation emulates a native wheel with scroll snapping and keyboard listboxes.",
        "rationale": "HTML has no interoperable month/day/year wheel control, so the webview preserves the native interaction contract with explicit semantics."
      }
    ]
  },
  "specification_source": "packages/design-system/src/components/forms/DatePicker/DatePicker.spec.json",
  "guidance": {
    "summary": "A form trigger that presents bounded month, day, and year wheels and commits one ISO calendar date on confirmation.",
    "guidance": [
      {
        "heading": "Overview",
        "body": "A date field whose trigger opens a mobile bottom sheet of month/day/year scroll wheels. Dates\ncross the boundary as ISO `\"YYYY-MM-DD\"` strings."
      },
      {
        "heading": "When to use",
        "body": "Reach for `DatePicker` when the user picks a single calendar date on mobile — a date of birth,\nan appointment day — and you want the native-feeling wheel sheet rather than a raw native\n`<input type=\"date\">`. Bound the range with `min`/`max` (default `1900-01-01` → today) and set\n`placeholderValue` so empty wheels open somewhere plausible (e.g. a likely birth year).\n\n-   Wrap it in `Field` for a label and aria wiring. The Field's `error` turns this trigger red on\n    its own; `invalid` is the escape hatch for a picker with no `Field` around it.\n-   Need a plain, unstyled OS date box with no sheet (a desktop-style form)? A bare\n    `Input`/native `type=\"date\"` is lighter — but on this mobile surface the wheel sheet is the\n    house style.\n\nIn-app it powers the data-removal date-of-birth field (`DobField`)."
      }
    ],
    "usage": [],
    "examples": [],
    "source": "packages/design-system/src/components/forms/DatePicker/DatePicker.mdx",
    "status": "local-preview",
    "note": "Guidance is read from local documentation, originally imported from the frozen source. Platform assertions in guidance are not parity verification."
  },
  "links": {
    "human": "/component-datepicker",
    "json": "/data/visual/components/datepicker.json",
    "storybook": "/storybook/?path=/story/cloaked-design-system-forms-datepicker--playground"
  }
}
