{"_id":"@edux-design/date-picker","name":"@edux-design/date-picker","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@edux-design/date-picker","version":"0.1.0","private":false,"sideEffects":["**/*.css"],"types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"lint":"eslint . --max-warnings 0","build":"tsup src/index.js --format esm,cjs --dts","dev":"tsup src/index.js --watch --format esm,cjs --dts","generate:component":"turbo gen react-component","check-types":"tsc --noEmit"},"devDependencies":{"typescript":"^5.9.2","tailwindcss":"^4.1.12","postcss":"^8.5.6","tsup":"^8.5.0","@tailwindcss/cli":"^4.1.12","@tailwindcss/postcss":"^4.1.12"},"dependencies":{"@edux-design/buttons":"*","@edux-design/forms":"*","@edux-design/icons":"*","@edux-design/popovers":"*","@edux-design/utils":"*"},"peerDependencies":{"react":"^19.1.0","react-dom":"^19.1.0"},"_id":"@edux-design/date-picker@0.1.0","gitHead":"ddc5150ed815560c3816421a5364a1478f7d7b00","description":"Date selection primitives for choosing a single date or a date range from editable text fields and a shared calendar popup. The package is being built in milestones: this release includes both single-date and range foundations, while more advanced date-gr","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-BSxSXJf8xuidpHSEZsYr/+Rrceb7Gk9J+2lXpI92qb7CjJvex66qvFmprMee/JNxkw/Oz+Gvv1ausEVHz/F51g==","shasum":"ee32bc26959710e9a22555947f5338bae1731579","tarball":"https://registry.npmjs.org/@edux-design/date-picker/-/date-picker-0.1.0.tgz","fileCount":34,"unpackedSize":159046,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC3EK7xztCeWUdxkwYVe+FujGu2mtRoUD1+txwypnuYsgIhAP7LvHbyRcWGgGmfpCdd4r8lGmdYrZ03gJOwuHp3X/15"}]},"_npmUser":{"name":"vjdalsanto26","email":"viraj.gunawardana@cambridge.org"},"directories":{},"maintainers":[{"name":"vjdalsanto26","email":"viraj.gunawardana@cambridge.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/date-picker_0.1.0_1783587778463_0.6607092028239292"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-09T09:02:58.276Z","0.1.0":"2026-07-09T09:02:58.663Z","modified":"2026-07-09T09:02:58.856Z"},"maintainers":[{"name":"vjdalsanto26","email":"viraj.gunawardana@cambridge.org"}],"description":"Date selection primitives for choosing a single date or a date range from editable text fields and a shared calendar popup. The package is being built in milestones: this release includes both single-date and range foundations, while more advanced date-gr","readme":"# @edux-design/date-picker\n\nDate selection primitives for choosing a single date or a date range from editable text fields and a shared calendar popup. The package is being built in milestones: this release includes both single-date and range foundations, while more advanced date-grid keyboard work is still planned.\n\n## Installation\n\n```bash\nnpm install @edux-design/date-picker @edux-design/forms @edux-design/icons @edux-design/popovers @edux-design/utils\n```\n\nThe package ships React components and depends on `react@^19.1.0` / `react-dom@^19.1.0`.\n\n## Usage\n\n```jsx\nimport { DatePicker } from \"@edux-design/date-picker\";\n\nexport function PublishDateField() {\n  return (\n    <DatePicker\n      label=\"Publish date\"\n      placeholder=\"Select a date\"\n      defaultValue={new Date(2026, 6, 8)}\n    />\n  );\n}\n```\n\n```jsx\nimport { DateRangePicker } from \"@edux-design/date-picker\";\n\nexport function AvailabilityField() {\n  return (\n    <DateRangePicker\n      label=\"Availability\"\n      defaultValue={{\n        startDate: new Date(2026, 6, 8),\n        endDate: new Date(2026, 6, 12),\n      }}\n    />\n  );\n}\n```\n\n## Key Props\n\n| Prop | Description |\n| ---- | ----------- |\n| `value` / `defaultValue` | Controlled or uncontrolled selected date. |\n| `onChange` | Called with the selected `Date` when a day is chosen or parsed from input. |\n| `locale` | Locale used for month and date formatting. |\n| `formatDate` | Custom formatter for the input and trigger labels. |\n| `customParseDate` | Custom parser for manual text input. |\n| `minValue` / `maxValue` | Disable dates outside the allowed time window. |\n| `weekStartsOn` | Overrides the first day of the week in the calendar grid. |\n| `isCompact` | Applies the smaller input size. |\n| `portalContainer` | Overrides the popover portal container when used inside other overlays. |\n| `trigger` | Optional custom trigger element that toggles the calendar popover. |\n\n`DateRangePicker` accepts the same formatting, parsing, locale, compact, and min/max props, but its `value` shape is `{ startDate, endDate }`.\n\nBy default, focusing the input opens the popover. No calendar icon button is rendered unless you pass a custom `trigger`.\n\n## Accessibility\n\n- The text input remains the primary field control and exposes `aria-haspopup=\"dialog\"`, `aria-expanded`, and `aria-controls` when the calendar is available.\n- If you pass a custom trigger, it is enhanced with the popover wiring, and the picker only falls back to an `aria-label` when the trigger does not already expose one.\n- `DateRangePicker` keeps the same combobox and trigger semantics while exposing a two-click range selection model in the shared calendar.\n- If you provide helper or error text, the component wires it through `Field.Feedback` so `aria-describedby` stays attached to the input.\n\nMilestone 1 does not yet include the full WAI-ARIA date-grid keyboard model. That work is planned for the next implementation milestone before the component should be treated as production-ready.\n\n## Development\n\n```bash\nnpm run build --workspace @edux-design/date-picker\nnpm test -- packages/date-picker/src/elements/DatePicker.test.jsx packages/date-picker/src/elements/DatePicker.a11y.test.jsx packages/date-picker/src/elements/DateRangePicker.test.jsx packages/date-picker/src/elements/DateRangePicker.a11y.test.jsx\n```\n\nStories live under `src/demos/DatePicker.stories.jsx`.\n","readmeFilename":"README.md","_rev":"1-78142eed389de051ee2ce0e4b7557a4a"}