@commercetools/nimbus 2.0.1-rc2 → 2.0.1-rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{DateField-B-4ymU5i.es.js → DateField-DZwn3cIj.es.js} +2 -2
- package/dist/chunks/{DateField-B-4ymU5i.es.js.map → DateField-DZwn3cIj.es.js.map} +1 -1
- package/dist/chunks/{DatePicker-ByxT1sNF.es.js → DatePicker-B2Nf_0Sq.es.js} +2 -2
- package/dist/chunks/{DatePicker-ByxT1sNF.es.js.map → DatePicker-B2Nf_0Sq.es.js.map} +1 -1
- package/dist/chunks/{date-input-Do1wXp3t.es.js → date-input-Cap8-3zj.es.js} +2 -2
- package/dist/chunks/{date-input-Do1wXp3t.es.js.map → date-input-Cap8-3zj.es.js.map} +1 -1
- package/dist/chunks/{date-picker-ClYge74a.es.js → date-picker-ChZ8H-MT.es.js} +5 -5
- package/dist/chunks/{date-picker-ClYge74a.es.js.map → date-picker-ChZ8H-MT.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-KRcGUZW-.es.js → date-range-picker-DGWMdcAN.es.js} +5 -5
- package/dist/chunks/{date-range-picker-KRcGUZW-.es.js.map → date-range-picker-DGWMdcAN.es.js.map} +1 -1
- package/dist/chunks/{time-input-DDrB_c0M.es.js → time-input--a_qv-Jk.es.js} +2 -2
- package/dist/chunks/{time-input-DDrB_c0M.es.js.map → time-input--a_qv-Jk.es.js.map} +1 -1
- package/dist/components/accordion/accordion.d.ts +13 -0
- package/dist/components/accordion/accordion.recipe.d.ts +36 -0
- package/dist/components/accordion/accordion.slots.d.ts +8 -0
- package/dist/components/accordion/accordion.types.d.ts +48 -0
- package/dist/components/accordion/components/accordion-content.d.ts +2 -0
- package/dist/components/accordion/components/accordion-header.d.ts +2 -0
- package/dist/components/accordion/components/accordion-item.d.ts +2 -0
- package/dist/components/accordion/components/accordion-root.d.ts +9 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/alert/alert.d.ts +30 -0
- package/dist/components/alert/alert.i18n.d.ts +7 -0
- package/dist/components/alert/alert.recipe.d.ts +40 -0
- package/dist/components/alert/alert.slots.d.ts +16 -0
- package/dist/components/alert/alert.types.d.ts +48 -0
- package/dist/components/alert/components/alert.actions.d.ts +5 -0
- package/dist/components/alert/components/alert.description.d.ts +5 -0
- package/dist/components/alert/components/alert.dismiss-button.d.ts +5 -0
- package/dist/components/alert/components/alert.root.d.ts +18 -0
- package/dist/components/alert/components/alert.title.d.ts +5 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +5 -0
- package/dist/components/avatar/avatar.recipe.d.ts +19 -0
- package/dist/components/avatar/avatar.slots.d.ts +3 -0
- package/dist/{avatar.d.ts → components/avatar/avatar.types.d.ts} +42 -63
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/badge/badge.d.ts +12 -0
- package/dist/components/badge/badge.recipe.d.ts +41 -0
- package/dist/components/badge/badge.slots.d.ts +3 -0
- package/dist/components/badge/badge.types.d.ts +24 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/{box.d.ts → components/box/box.d.ts} +16 -30
- package/dist/components/box/index.d.ts +1 -0
- package/dist/components/button/button.d.ts +12 -0
- package/dist/components/button/button.recipe.d.ts +107 -0
- package/dist/components/button/button.slots.d.ts +11 -0
- package/dist/components/button/button.types.d.ts +36 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/calendar/calendar.d.ts +10 -0
- package/dist/components/calendar/calendar.recipe.d.ts +1 -0
- package/dist/components/calendar/calendar.slots.d.ts +11 -0
- package/dist/components/calendar/calendar.types.d.ts +16 -0
- package/dist/components/calendar/components/calendar.custom-context.d.ts +3 -0
- package/dist/components/calendar/components/calendar.grids.d.ts +1 -0
- package/dist/components/calendar/components/calendar.header.d.ts +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/card/card.d.ts +18 -0
- package/dist/components/card/card.recipe.d.ts +52 -0
- package/dist/components/card/card.slots.d.ts +12 -0
- package/dist/components/card/card.types.d.ts +28 -0
- package/dist/components/card/components/card.content.d.ts +5 -0
- package/dist/components/card/components/card.header.d.ts +5 -0
- package/dist/components/card/components/card.root.d.ts +18 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox.d.ts +12 -0
- package/dist/components/checkbox/checkbox.recipe.d.ts +27 -0
- package/dist/components/checkbox/checkbox.slots.d.ts +5 -0
- package/dist/components/checkbox/checkbox.types.d.ts +24 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/code/code.d.ts +10 -0
- package/dist/components/code/code.recipe.d.ts +48 -0
- package/dist/components/code/index.d.ts +1 -0
- package/dist/components/collapsible-motion/collapsible-motion.d.ts +10 -0
- package/dist/components/collapsible-motion/collapsible-motion.recipe.d.ts +1 -0
- package/dist/components/collapsible-motion/collapsible-motion.slots.d.ts +5 -0
- package/dist/components/collapsible-motion/collapsible-motion.types.d.ts +59 -0
- package/dist/components/collapsible-motion/components/collapsible-motion-content.d.ts +9 -0
- package/dist/components/collapsible-motion/components/collapsible-motion-context.d.ts +9 -0
- package/dist/components/collapsible-motion/components/collapsible-motion-root.d.ts +8 -0
- package/dist/components/collapsible-motion/components/collapsible-motion-trigger.d.ts +10 -0
- package/dist/components/collapsible-motion/index.d.ts +2 -0
- package/dist/components/combobox/combobox.d.ts +18 -0
- package/dist/components/combobox/combobox.recipe.d.ts +96 -0
- package/dist/components/combobox/combobox.slots.d.ts +27 -0
- package/dist/components/combobox/combobox.types.d.ts +152 -0
- package/dist/components/combobox/components/combobox.leading-element.d.ts +11 -0
- package/dist/components/combobox/components/combobox.multi-select-button-group.d.ts +2 -0
- package/dist/components/combobox/components/combobox.multi-select-root.d.ts +2 -0
- package/dist/components/combobox/components/combobox.multi-select-tag-group.d.ts +2 -0
- package/dist/components/combobox/components/combobox.option-group.d.ts +6 -0
- package/dist/components/combobox/components/combobox.option.d.ts +5 -0
- package/dist/components/combobox/components/combobox.options.d.ts +5 -0
- package/dist/components/combobox/components/combobox.root.d.ts +12 -0
- package/dist/components/combobox/components/combobox.single-select-button-group.d.ts +2 -0
- package/dist/components/combobox/components/combobox.single-select-input.d.ts +2 -0
- package/dist/components/combobox/components/combobox.single-select-root.d.ts +2 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/data-table/components/data-table.body.d.ts +5 -0
- package/dist/components/data-table/components/data-table.cell.d.ts +2 -0
- package/dist/components/data-table/components/data-table.column.d.ts +2 -0
- package/dist/components/data-table/components/data-table.context.d.ts +3 -0
- package/dist/components/data-table/components/data-table.footer.d.ts +11 -0
- package/dist/components/data-table/components/data-table.header.d.ts +5 -0
- package/dist/components/data-table/components/data-table.root.d.ts +5 -0
- package/dist/components/data-table/components/data-table.row.d.ts +5 -0
- package/dist/components/data-table/components/data-table.table.d.ts +5 -0
- package/dist/components/data-table/data-table.d.ts +52 -0
- package/dist/components/data-table/data-table.recipe.d.ts +32 -0
- package/dist/components/data-table/data-table.slots.d.ts +21 -0
- package/dist/components/data-table/data-table.types.d.ts +154 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/test-data.d.ts +58 -0
- package/dist/components/data-table/utils/rows.utils.d.ts +4 -0
- package/dist/components/date-input/date-input.d.ts +12 -0
- package/dist/components/date-input/date-input.recipe.d.ts +71 -0
- package/dist/components/date-input/date-input.slots.d.ts +18 -0
- package/dist/components/date-input/date-input.types.d.ts +20 -0
- package/dist/components/date-input/index.d.ts +2 -0
- package/dist/components/date-input.es.js +1 -1
- package/dist/components/date-picker/components/date-picker.custom-context.d.ts +3 -0
- package/dist/components/date-picker/components/date-picker.time-input.d.ts +2 -0
- package/dist/components/date-picker/date-picker.d.ts +12 -0
- package/dist/components/date-picker/date-picker.i18n.d.ts +33 -0
- package/dist/components/date-picker/date-picker.recipe.d.ts +14 -0
- package/dist/components/date-picker/date-picker.slots.d.ts +30 -0
- package/dist/components/date-picker/date-picker.types.d.ts +43 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker.es.js +1 -1
- package/dist/components/date-range-picker/components/date-range-picker.custom-context.d.ts +4 -0
- package/dist/components/date-range-picker/components/date-range-picker.time-input.d.ts +2 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +11 -0
- package/dist/components/date-range-picker/date-range-picker.recipe.d.ts +34 -0
- package/dist/components/date-range-picker/date-range-picker.slots.d.ts +36 -0
- package/dist/components/date-range-picker/date-range-picker.types.d.ts +44 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker.es.js +1 -1
- package/dist/components/dialog/components/dialog.body.d.ts +5 -0
- package/dist/components/dialog/components/dialog.close-trigger.d.ts +5 -0
- package/dist/components/dialog/components/dialog.content.d.ts +5 -0
- package/dist/components/dialog/components/dialog.context.d.ts +19 -0
- package/dist/components/dialog/components/dialog.footer.d.ts +5 -0
- package/dist/components/dialog/components/dialog.header.d.ts +5 -0
- package/dist/components/dialog/components/dialog.root.d.ts +5 -0
- package/dist/components/dialog/components/dialog.title.d.ts +5 -0
- package/dist/components/dialog/components/dialog.trigger.d.ts +5 -0
- package/dist/components/dialog/components/index.d.ts +8 -0
- package/dist/components/dialog/dialog.d.ts +229 -0
- package/dist/components/dialog/dialog.i18n.d.ts +7 -0
- package/dist/components/dialog/dialog.recipe.d.ts +54 -0
- package/dist/components/dialog/dialog.slots.d.ts +28 -0
- package/dist/components/dialog/dialog.types.d.ts +189 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/draggable-list/components/draggable-list.field.d.ts +2 -0
- package/dist/components/draggable-list/components/draggable-list.item.d.ts +2 -0
- package/dist/components/draggable-list/components/draggable-list.root.d.ts +2 -0
- package/dist/components/draggable-list/draggable-list.d.ts +107 -0
- package/dist/components/draggable-list/draggable-list.i18n.d.ts +12 -0
- package/dist/components/draggable-list/draggable-list.recipe.d.ts +14 -0
- package/dist/components/draggable-list/draggable-list.slots.d.ts +6 -0
- package/dist/components/draggable-list/draggable-list.types.d.ts +141 -0
- package/dist/components/draggable-list/index.d.ts +2 -0
- package/dist/components/draggable-list/utils/draggable-list.test-data.d.ts +3 -0
- package/dist/components/draggable-list/utils/draggable-list.test-utils.d.ts +1 -0
- package/dist/components/drawer/components/drawer.body.d.ts +5 -0
- package/dist/components/drawer/components/drawer.close-trigger.d.ts +5 -0
- package/dist/components/drawer/components/drawer.content.d.ts +5 -0
- package/dist/components/drawer/components/drawer.context.d.ts +19 -0
- package/dist/components/drawer/components/drawer.footer.d.ts +5 -0
- package/dist/components/drawer/components/drawer.header.d.ts +5 -0
- package/dist/components/drawer/components/drawer.root.d.ts +5 -0
- package/dist/components/drawer/components/drawer.title.d.ts +5 -0
- package/dist/components/drawer/components/drawer.trigger.d.ts +5 -0
- package/dist/components/drawer/components/index.d.ts +8 -0
- package/dist/components/drawer/drawer.d.ts +228 -0
- package/dist/components/drawer/drawer.i18n.d.ts +7 -0
- package/dist/components/drawer/drawer.recipe.d.ts +98 -0
- package/dist/components/drawer/drawer.slots.d.ts +21 -0
- package/dist/components/drawer/drawer.types.d.ts +175 -0
- package/dist/components/drawer/index.d.ts +3 -0
- package/dist/components/field-errors/field-errors.d.ts +34 -0
- package/dist/components/field-errors/field-errors.i18n.d.ts +77 -0
- package/dist/components/field-errors/field-errors.recipe.d.ts +1 -0
- package/dist/components/field-errors/field-errors.slots.d.ts +6 -0
- package/dist/{field-errors.d.ts → components/field-errors/field-errors.types.d.ts} +95 -144
- package/dist/components/field-errors/index.d.ts +3 -0
- package/dist/components/flex/flex.d.ts +8 -0
- package/dist/components/flex/index.d.ts +1 -0
- package/dist/components/form-field/components/form-field.context.d.ts +22 -0
- package/dist/components/form-field/components/form-field.description.d.ts +2 -0
- package/dist/components/form-field/components/form-field.error.d.ts +2 -0
- package/dist/components/form-field/components/form-field.info-box.d.ts +9 -0
- package/dist/components/form-field/components/form-field.input.d.ts +2 -0
- package/dist/components/form-field/components/form-field.label.d.ts +2 -0
- package/dist/components/form-field/components/form-field.root.d.ts +9 -0
- package/dist/components/form-field/form-field.d.ts +17 -0
- package/dist/components/form-field/form-field.recipe.d.ts +49 -0
- package/dist/components/form-field/form-field.slots.d.ts +15 -0
- package/dist/components/form-field/form-field.types.d.ts +54 -0
- package/dist/components/form-field/index.d.ts +2 -0
- package/dist/components/grid/grid.d.ts +18 -0
- package/dist/components/grid/index.d.ts +1 -0
- package/dist/components/group/group.d.ts +2 -0
- package/dist/components/group/group.recipe.d.ts +5 -0
- package/dist/components/group/group.slots.d.ts +8 -0
- package/dist/components/group/group.types.d.ts +17 -0
- package/dist/components/group/index.d.ts +2 -0
- package/dist/{heading.d.ts → components/heading/heading.d.ts} +41 -55
- package/dist/components/heading/heading.recipe.d.ts +37 -0
- package/dist/components/heading/index.d.ts +1 -0
- package/dist/components/icon/icon.d.ts +12 -0
- package/dist/components/icon/icon.recipe.d.ts +29 -0
- package/dist/components/icon/icon.slots.d.ts +7 -0
- package/dist/components/icon/icon.types.d.ts +29 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon-button/icon-button.d.ts +12 -0
- package/dist/components/icon-button/icon-button.types.d.ts +11 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-toggle-button/icon-toggle-button.d.ts +12 -0
- package/dist/components/icon-toggle-button/icon-toggle-button.types.d.ts +11 -0
- package/dist/components/icon-toggle-button/index.d.ts +2 -0
- package/dist/components/image/image.d.ts +13 -0
- package/dist/components/image/index.d.ts +1 -0
- package/dist/components/index.d.ts +65 -0
- package/dist/components/inline-svg/constants/index.d.ts +1 -0
- package/dist/{constants.d.ts → components/inline-svg/constants/sanitization.constants.d.ts} +8 -20
- package/dist/components/inline-svg/hooks/index.d.ts +1 -0
- package/dist/{hooks.d.ts → components/inline-svg/hooks/use-inline-svg.d.ts} +10 -21
- package/dist/components/inline-svg/index.d.ts +2 -0
- package/dist/components/inline-svg/inline-svg.d.ts +23 -0
- package/dist/components/inline-svg/inline-svg.slots.d.ts +22 -0
- package/dist/components/inline-svg/inline-svg.types.d.ts +12 -0
- package/dist/components/inline-svg/utils/index.d.ts +1 -0
- package/dist/{utils.d.ts → components/inline-svg/utils/sanitize-svg.d.ts} +32 -44
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/kbd.d.ts +15 -0
- package/dist/components/kbd/kbd.recipe.d.ts +1 -0
- package/dist/components/kbd/kbd.slots.d.ts +19 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/link/link.d.ts +12 -0
- package/dist/components/link/link.recipe.d.ts +28 -0
- package/dist/components/link/link.slots.d.ts +8 -0
- package/dist/components/link/link.types.d.ts +27 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/list.d.ts +18 -0
- package/dist/components/list/list.recipe.d.ts +38 -0
- package/dist/components/loading-spinner/index.d.ts +2 -0
- package/dist/components/loading-spinner/loading-spinner.d.ts +12 -0
- package/dist/components/loading-spinner/loading-spinner.i18n.d.ts +8 -0
- package/dist/components/loading-spinner/loading-spinner.recipe.d.ts +36 -0
- package/dist/components/loading-spinner/loading-spinner.slots.d.ts +6 -0
- package/dist/components/loading-spinner/loading-spinner.types.d.ts +24 -0
- package/dist/components/localized-field/components/localized-field.locale-field.d.ts +2 -0
- package/dist/components/localized-field/components/localized-field.root.d.ts +2 -0
- package/dist/components/localized-field/index.d.ts +2 -0
- package/dist/components/localized-field/localized-field.d.ts +17 -0
- package/dist/components/localized-field/localized-field.i18n.d.ts +33 -0
- package/dist/components/localized-field/localized-field.recipe.d.ts +22 -0
- package/dist/components/localized-field/localized-field.slots.d.ts +19 -0
- package/dist/components/localized-field/localized-field.types.d.ts +188 -0
- package/dist/components/localized-field/utils/localized-field.story-component.d.ts +39 -0
- package/dist/components/localized-field/utils/localized-field.utils.d.ts +34 -0
- package/dist/components/localized-field/utils/test-data.d.ts +340 -0
- package/dist/components/localized-field/utils/test-utils.d.ts +22 -0
- package/dist/components/menu/components/menu.content.d.ts +5 -0
- package/dist/components/menu/components/menu.context.d.ts +5 -0
- package/dist/components/menu/components/menu.item.d.ts +5 -0
- package/dist/components/menu/components/menu.root.d.ts +5 -0
- package/dist/components/menu/components/menu.section-context.d.ts +5 -0
- package/dist/components/menu/components/menu.section-label.d.ts +8 -0
- package/dist/components/menu/components/menu.section.d.ts +5 -0
- package/dist/components/menu/components/menu.submenu-trigger.d.ts +5 -0
- package/dist/components/menu/components/menu.submenu.d.ts +5 -0
- package/dist/components/menu/components/menu.trigger.d.ts +5 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +39 -0
- package/dist/components/menu/menu.recipe.d.ts +5 -0
- package/dist/components/menu/menu.slots.d.ts +10 -0
- package/dist/components/menu/menu.types.d.ts +62 -0
- package/dist/components/money-input/index.d.ts +2 -0
- package/dist/components/money-input/money-input.d.ts +77 -0
- package/dist/components/money-input/money-input.i18n.d.ts +18 -0
- package/dist/components/money-input/money-input.recipe.d.ts +40 -0
- package/dist/components/money-input/money-input.slots.d.ts +8 -0
- package/dist/components/money-input/money-input.types.d.ts +102 -0
- package/dist/{money-input.d.ts → components/money-input/utils/currencies.d.ts} +666 -879
- package/dist/components/money-input/utils/index.d.ts +2 -0
- package/dist/components/money-input/utils/parsing-utilities.d.ts +22 -0
- package/dist/components/money-input/utils/static-methods.d.ts +6 -0
- package/dist/components/multiline-text-input/hooks/index.d.ts +1 -0
- package/dist/components/multiline-text-input/hooks/use-autogrow.d.ts +16 -0
- package/dist/components/multiline-text-input/index.d.ts +2 -0
- package/dist/components/multiline-text-input/multiline-text-input.d.ts +12 -0
- package/dist/components/multiline-text-input/multiline-text-input.recipe.d.ts +64 -0
- package/dist/components/multiline-text-input/multiline-text-input.slots.d.ts +16 -0
- package/dist/components/multiline-text-input/multiline-text-input.types.d.ts +42 -0
- package/dist/components/nimbus-provider/components/nimbus-provider.color-mode-provider.d.ts +2 -0
- package/dist/components/nimbus-provider/index.d.ts +2 -0
- package/dist/components/nimbus-provider/nimbus-provider.d.ts +9 -0
- package/dist/{nimbus-provider.d.ts → components/nimbus-provider/nimbus-provider.types.d.ts} +92 -119
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-input/number-input.d.ts +11 -0
- package/dist/components/number-input/number-input.i18n.d.ts +13 -0
- package/dist/components/number-input/number-input.recipe.d.ts +113 -0
- package/dist/components/number-input/number-input.slots.d.ts +42 -0
- package/dist/components/number-input/number-input.types.d.ts +40 -0
- package/dist/components/pagination/hooks/use-pagination.d.ts +72 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination.d.ts +13 -0
- package/dist/{pagination.d.ts → components/pagination/pagination.types.d.ts} +44 -70
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/password-input.d.ts +12 -0
- package/dist/components/password-input/password-input.i18n.d.ts +13 -0
- package/dist/components/password-input/password-input.types.d.ts +2 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +12 -0
- package/dist/components/popover/popover.recipe.d.ts +5 -0
- package/dist/components/popover/popover.slots.d.ts +4 -0
- package/dist/components/popover/popover.types.d.ts +6 -0
- package/dist/components/progress-bar/index.d.ts +2 -0
- package/dist/components/progress-bar/progress-bar.d.ts +22 -0
- package/dist/components/progress-bar/progress-bar.recipe.d.ts +91 -0
- package/dist/components/progress-bar/progress-bar.slots.d.ts +20 -0
- package/dist/components/progress-bar/progress-bar.types.d.ts +53 -0
- package/dist/components/radio-input/components/radio-input.option.d.ts +5 -0
- package/dist/components/radio-input/components/radio-input.root.d.ts +12 -0
- package/dist/components/radio-input/index.d.ts +2 -0
- package/dist/components/radio-input/radio-input.d.ts +13 -0
- package/dist/components/radio-input/radio-input.recipe.d.ts +21 -0
- package/dist/components/radio-input/radio-input.slots.d.ts +6 -0
- package/dist/components/radio-input/radio-input.types.d.ts +18 -0
- package/dist/components/range-calendar/components/range-calendar.custom-context.d.ts +3 -0
- package/dist/components/range-calendar/components/range-calendar.grids.d.ts +1 -0
- package/dist/components/range-calendar/components/range-calendar.header.d.ts +1 -0
- package/dist/components/range-calendar/index.d.ts +2 -0
- package/dist/components/range-calendar/range-calendar.d.ts +3 -0
- package/dist/components/range-calendar/range-calendar.recipe.d.ts +1 -0
- package/dist/components/range-calendar/range-calendar.slots.d.ts +11 -0
- package/dist/components/range-calendar/range-calendar.types.d.ts +20 -0
- package/dist/components/rich-text-input/components/formatting-menu.d.ts +4 -0
- package/dist/components/rich-text-input/components/rich-text-editor.d.ts +25 -0
- package/dist/components/rich-text-input/components/rich-text-toolbar.d.ts +7 -0
- package/dist/components/rich-text-input/constants/editor-constants.d.ts +65 -0
- package/dist/components/rich-text-input/constants/index.d.ts +2 -0
- package/dist/components/rich-text-input/constants/text-styles.d.ts +32 -0
- package/dist/components/rich-text-input/hooks/index.d.ts +4 -0
- package/dist/components/rich-text-input/hooks/use-formatting-state.d.ts +10 -0
- package/dist/components/rich-text-input/hooks/use-keyboard-shortcuts.d.ts +7 -0
- package/dist/components/rich-text-input/hooks/use-preserved-selection.d.ts +11 -0
- package/dist/components/rich-text-input/hooks/use-toolbar-state.d.ts +15 -0
- package/dist/components/rich-text-input/index.d.ts +2 -0
- package/dist/components/rich-text-input/rich-text-input.d.ts +8 -0
- package/dist/components/rich-text-input/rich-text-input.recipe.d.ts +1 -0
- package/dist/components/rich-text-input/rich-text-input.slots.d.ts +5 -0
- package/dist/components/rich-text-input/rich-text-input.types.d.ts +54 -0
- package/dist/components/rich-text-input/utils/html-serialization.d.ts +4 -0
- package/dist/components/rich-text-input/utils/index.d.ts +5 -0
- package/dist/components/rich-text-input/utils/is-empty.d.ts +4 -0
- package/dist/components/rich-text-input/utils/slate-helpers.d.ts +19 -0
- package/dist/components/rich-text-input/utils/text-style-utils.d.ts +33 -0
- package/dist/components/rich-text-input/utils/types.d.ts +28 -0
- package/dist/components/scoped-search-input/index.d.ts +2 -0
- package/dist/components/scoped-search-input/scoped-search-input.d.ts +6 -0
- package/dist/components/scoped-search-input/scoped-search-input.i18n.d.ts +23 -0
- package/dist/components/scoped-search-input/scoped-search-input.recipe.d.ts +6 -0
- package/dist/components/scoped-search-input/scoped-search-input.slots.d.ts +6 -0
- package/dist/{scoped-search-input.d.ts → components/scoped-search-input/scoped-search-input.types.d.ts} +72 -94
- package/dist/components/scoped-search-input/utils/helpers.d.ts +5 -0
- package/dist/components/search-input/index.d.ts +2 -0
- package/dist/components/search-input/search-input.d.ts +11 -0
- package/dist/components/search-input/search-input.i18n.d.ts +8 -0
- package/dist/components/search-input/search-input.recipe.d.ts +44 -0
- package/dist/components/search-input/search-input.slots.d.ts +12 -0
- package/dist/components/search-input/search-input.types.d.ts +28 -0
- package/dist/components/select/components/select.clear-button.d.ts +4 -0
- package/dist/components/select/components/select.option-group.d.ts +7 -0
- package/dist/components/select/components/select.option.d.ts +5 -0
- package/dist/components/select/components/select.options.d.ts +7 -0
- package/dist/components/select/components/select.root.d.ts +12 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +135 -0
- package/dist/components/select/select.i18n.d.ts +8 -0
- package/dist/components/select/select.recipe.d.ts +69 -0
- package/dist/components/select/select.slots.d.ts +16 -0
- package/dist/components/select/select.types.d.ts +59 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.d.ts +19 -0
- package/dist/components/separator/separator.recipe.d.ts +16 -0
- package/dist/components/separator/separator.slots.d.ts +3 -0
- package/dist/components/separator/separator.types.d.ts +14 -0
- package/dist/components/simple-grid/index.d.ts +1 -0
- package/dist/components/simple-grid/simple-grid.d.ts +18 -0
- package/dist/components/spacer/index.d.ts +2 -0
- package/dist/components/spacer/spacer.d.ts +17 -0
- package/dist/components/spacer/spacer.types.d.ts +11 -0
- package/dist/components/split-button/index.d.ts +2 -0
- package/dist/components/split-button/split-button.d.ts +18 -0
- package/dist/components/split-button/split-button.recipe.d.ts +21 -0
- package/dist/components/split-button/split-button.slots.d.ts +6 -0
- package/dist/components/split-button/split-button.types.d.ts +26 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/stack.d.ts +16 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.d.ts +12 -0
- package/dist/components/switch/switch.recipe.d.ts +32 -0
- package/dist/components/switch/switch.slots.d.ts +6 -0
- package/dist/components/switch/switch.types.d.ts +19 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.d.ts +8 -0
- package/dist/components/table/table.recipe.d.ts +121 -0
- package/dist/components/tabs/components/tabs.list.d.ts +10 -0
- package/dist/components/tabs/components/tabs.panel.d.ts +7 -0
- package/dist/components/tabs/components/tabs.panels.d.ts +10 -0
- package/dist/components/tabs/components/tabs.root.d.ts +12 -0
- package/dist/components/tabs/components/tabs.tab.d.ts +10 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tabs.d.ts +31 -0
- package/dist/components/tabs/tabs.recipe.d.ts +67 -0
- package/dist/components/tabs/tabs.slots.d.ts +58 -0
- package/dist/components/tabs/tabs.types.d.ts +112 -0
- package/dist/components/tag-group/components/tag-group.root.d.ts +9 -0
- package/dist/components/tag-group/components/tag-group.tag-list.d.ts +6 -0
- package/dist/components/tag-group/components/tag-group.tag.d.ts +2 -0
- package/dist/components/tag-group/index.d.ts +2 -0
- package/dist/components/tag-group/tag-group.d.ts +14 -0
- package/dist/components/tag-group/tag-group.recipe.d.ts +29 -0
- package/dist/components/tag-group/tag-group.slots.d.ts +7 -0
- package/dist/components/tag-group/tag-group.types.d.ts +27 -0
- package/dist/components/text/index.d.ts +1 -0
- package/dist/components/text/text.d.ts +16 -0
- package/dist/components/text-input/index.d.ts +2 -0
- package/dist/components/text-input/text-input.d.ts +12 -0
- package/dist/components/text-input/text-input.recipe.d.ts +54 -0
- package/dist/components/text-input/text-input.slots.d.ts +13 -0
- package/dist/components/text-input/text-input.types.d.ts +39 -0
- package/dist/components/time-input/index.d.ts +2 -0
- package/dist/components/time-input/time-input.d.ts +10 -0
- package/dist/components/time-input/time-input.recipe.d.ts +67 -0
- package/dist/components/time-input/time-input.slots.d.ts +24 -0
- package/dist/components/time-input/time-input.types.d.ts +21 -0
- package/dist/components/time-input.es.js +1 -1
- package/dist/components/toggle-button/index.d.ts +2 -0
- package/dist/components/toggle-button/toggle-button.d.ts +13 -0
- package/dist/components/toggle-button/toggle-button.recipe.d.ts +95 -0
- package/dist/components/toggle-button/toggle-button.slots.d.ts +17 -0
- package/dist/components/toggle-button/toggle-button.types.d.ts +28 -0
- package/dist/components/toggle-button-group/components/toggle-button-group.button.d.ts +2 -0
- package/dist/components/toggle-button-group/components/toggle-button-group.root.d.ts +9 -0
- package/dist/components/toggle-button-group/index.d.ts +2 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +12 -0
- package/dist/components/toggle-button-group/toggle-button-group.recipe.d.ts +54 -0
- package/dist/components/toggle-button-group/toggle-button-group.slots.d.ts +3 -0
- package/dist/components/toggle-button-group/toggle-button-group.types.d.ts +32 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/toolbar.d.ts +2 -0
- package/dist/components/toolbar/toolbar.recipe.d.ts +34 -0
- package/dist/components/toolbar/toolbar.slots.d.ts +11 -0
- package/dist/components/toolbar/toolbar.types.d.ts +20 -0
- package/dist/components/tooltip/components/tooltip.content.d.ts +21 -0
- package/dist/components/tooltip/components/tooltip.root.d.ts +12 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/make-element-focusable.d.ts +32 -0
- package/dist/components/tooltip/tooltip.d.ts +7 -0
- package/dist/components/tooltip/tooltip.recipe.d.ts +5 -0
- package/dist/components/tooltip/tooltip.slots.d.ts +7 -0
- package/dist/components/tooltip/tooltip.types.d.ts +9 -0
- package/dist/components/utils/index.d.ts +4 -0
- package/dist/components/utils/type-helpers.d.ts +29 -0
- package/dist/components/visually-hidden/index.d.ts +1 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +17 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/use-color-mode/index.d.ts +1 -0
- package/dist/hooks/use-color-mode/use-color-mode.d.ts +31 -0
- package/dist/hooks/use-color-mode-value/index.d.ts +1 -0
- package/dist/hooks/use-color-mode-value/use-color-mode-value.d.ts +10 -0
- package/dist/hooks/use-color-scheme/index.d.ts +1 -0
- package/dist/hooks/use-color-scheme/use-color-scheme.d.ts +15 -0
- package/dist/hooks/use-copy-to-clipboard/index.d.ts +1 -0
- package/dist/hooks/use-copy-to-clipboard/use-copy-to-clipboard.d.ts +1 -0
- package/dist/hooks/use-hotkeys/index.d.ts +1 -0
- package/dist/hooks/use-hotkeys/use-hotkeys.d.ts +1 -0
- package/dist/index.d.ts +4 -347
- package/dist/index.es.js +4 -4
- package/dist/theme/animation-styles.d.ts +4 -0
- package/dist/theme/breakpoints.d.ts +5 -0
- package/dist/theme/conditions.d.ts +16 -0
- package/dist/theme/global-css.d.ts +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/keyframes.d.ts +207 -0
- package/dist/theme/layer-styles.d.ts +4 -0
- package/dist/theme/recipes/index.d.ts +490 -0
- package/dist/theme/semantic-tokens/colors.d.ts +12478 -0
- package/dist/theme/semantic-tokens/index.d.ts +6262 -0
- package/dist/theme/semantic-tokens/radii.d.ts +1 -0
- package/dist/theme/semantic-tokens/shadows.d.ts +20 -0
- package/dist/theme/slot-recipes/index.d.ts +1489 -0
- package/dist/theme/text-styles.d.ts +4 -0
- package/dist/theme/tokens/animations.d.ts +14 -0
- package/dist/theme/tokens/aspect-ratios.d.ts +20 -0
- package/dist/theme/tokens/blurs.d.ts +26 -0
- package/dist/theme/tokens/borders.d.ts +14 -0
- package/dist/theme/tokens/colors.d.ts +168 -0
- package/dist/theme/tokens/cursor.d.ts +26 -0
- package/dist/theme/tokens/durations.d.ts +29 -0
- package/dist/theme/tokens/easings.d.ts +17 -0
- package/dist/theme/tokens/font-sizes.d.ts +44 -0
- package/dist/theme/tokens/font-weights.d.ts +29 -0
- package/dist/theme/tokens/fonts.d.ts +11 -0
- package/dist/theme/tokens/index.d.ts +1642 -0
- package/dist/theme/tokens/letter-spacings.d.ts +3 -0
- package/dist/theme/tokens/line-heights.d.ts +80 -0
- package/dist/theme/tokens/radii.d.ts +29 -0
- package/dist/theme/tokens/sizes.d.ts +278 -0
- package/dist/theme/tokens/spacing.d.ts +74 -0
- package/dist/theme/tokens/z-index.d.ts +41 -0
- package/dist/utils/extractStyleProps.d.ts +6 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/noop.d.ts +12 -0
- package/dist/utils/slot-types.d.ts +22 -0
- package/package.json +1 -1
- package/dist/accordion.d.ts +0 -135
- package/dist/alert.d.ts +0 -172
- package/dist/badge.d.ts +0 -52
- package/dist/button.d.ts +0 -64
- package/dist/calendar.d.ts +0 -50
- package/dist/card.d.ts +0 -88
- package/dist/checkbox.d.ts +0 -54
- package/dist/code.d.ts +0 -25
- package/dist/collapsible-motion.d.ts +0 -125
- package/dist/combobox.d.ts +0 -236
- package/dist/components.d.ts +0 -299
- package/dist/data-table.d.ts +0 -302
- package/dist/date-input.d.ts +0 -51
- package/dist/date-picker.d.ts +0 -92
- package/dist/date-range-picker.d.ts +0 -73
- package/dist/dialog.d.ts +0 -499
- package/dist/draggable-list.d.ts +0 -331
- package/dist/drawer.d.ts +0 -590
- package/dist/flex.d.ts +0 -14
- package/dist/form-field.d.ts +0 -118
- package/dist/grid.d.ts +0 -35
- package/dist/group.d.ts +0 -38
- package/dist/icon-button.d.ts +0 -75
- package/dist/icon-toggle-button.d.ts +0 -67
- package/dist/icon.d.ts +0 -58
- package/dist/image.d.ts +0 -28
- package/dist/inline-svg.d.ts +0 -81
- package/dist/kbd.d.ts +0 -29
- package/dist/link.d.ts +0 -56
- package/dist/list.d.ts +0 -35
- package/dist/loading-spinner.d.ts +0 -53
- package/dist/localized-field.d.ts +0 -935
- package/dist/multiline-text-input.d.ts +0 -73
- package/dist/number-input.d.ts +0 -63
- package/dist/password-input.d.ts +0 -65
- package/dist/popover.d.ts +0 -34
- package/dist/progress-bar.d.ts +0 -96
- package/dist/radio-input.d.ts +0 -67
- package/dist/range-calendar.d.ts +0 -47
- package/dist/rich-text-input.d.ts +0 -82
- package/dist/search-input.d.ts +0 -56
- package/dist/select.d.ts +0 -246
- package/dist/separator.d.ts +0 -49
- package/dist/setup-jsdom-polyfills.d.ts +0 -10
- package/dist/simple-grid.d.ts +0 -35
- package/dist/spacer.d.ts +0 -41
- package/dist/split-button.d.ts +0 -99
- package/dist/stack.d.ts +0 -30
- package/dist/switch.d.ts +0 -44
- package/dist/table.d.ts +0 -14
- package/dist/tabs.d.ts +0 -213
- package/dist/tag-group.d.ts +0 -75
- package/dist/text-input.d.ts +0 -69
- package/dist/text.d.ts +0 -31
- package/dist/time-input.d.ts +0 -51
- package/dist/toggle-button-group.d.ts +0 -76
- package/dist/toggle-button.d.ts +0 -57
- package/dist/toolbar.d.ts +0 -40
- package/dist/tooltip.d.ts +0 -131
- package/dist/visually-hidden.d.ts +0 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-ClYge74a.es.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DatePickerRootSlotProps } from \"./date-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"datePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","datePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","Box","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAAqB,gBAAAH,EAGhC,OAAO,MAAM,GAKFI,IAAsB,gBAAAH,EAGjC,OAAO,OAAO,GAKHI,IAAwB,gBAAAJ,EAGnC,OAAO,SAAS,GAKLK,IAAyB,gBAAAL,EAGpC,OAAO,UAAU,GCxCnBM,IAAe,gBAAAC,EAAe;AAAA,EAC5B,YAAY;AAAA,IACV,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,WAAW;AAAA,IACT,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,qBAAqB;AAAA,IACnB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,2BAA2B;AAAA,IACzB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,WAAW;AAAA,IACT,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAEpB,CAAC,GC1BYC,IAAsB,CAAC;AAAA,EAClC,cAAAC;AAAA,EACA,WAAAC;AACF,MAAgC;AAC9B,QAAMC,IAAkBC,EAAWC,CAAsB,GACnD,EAAE,aAAAC,GAAa,WAAAC,EAAA,IAAcJ,GAC7BK,IAAeC,EAAuB,IAAI,GAC1CC,IAAkBD,EAAOF,CAAS;AA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cAAA;AAAA,YACjB,EAAA,CACF;AAAA,UAAA;AAAA,QAAA,GAGN,EAAA,CACF;AAAA,QACA,gBAAA1C,EAACrB,KAAsB,SAAO,IAC5B,4BAACgE,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAA7C,EAAC8C,GAAA,EACC,UAAA;AAAA,UAAA,gBAAA5C,EAACpB,GAAA,EACC,UAAA,gBAAAoB,EAAC6C,GAAA,CAAA,CAAS,GACZ;AAAA,UACA,gBAAA7C;AAAA,YAACjB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAqC,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"date-picker-ChZ8H-MT.es.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DatePickerRootSlotProps } from \"./date-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"datePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","datePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactA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AsB,SAAO,IAC5B,4BAACgE,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAA7C,EAAC8C,GAAA,EACC,UAAA;AAAA,UAAA,gBAAA5C,EAACpB,GAAA,EACC,UAAA,gBAAAoB,EAAC6C,GAAA,CAAA,CAAS,GACZ;AAAA,UACA,gBAAA7C;AAAA,YAACjB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAqC,EAAW,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as p, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { createSlotRecipeContext as k } from "@chakra-ui/react";
|
|
3
3
|
import { Close as V, CalendarMonth as z } from "@commercetools/nimbus-icons";
|
|
4
|
-
import { $ as T, a as E } from "./DatePicker-
|
|
4
|
+
import { $ as T, a as E } from "./DatePicker-B2Nf_0Sq.es.js";
|
|
5
5
|
import { $ as w, h as W } from "./Dialog-Qpq4hk89.es.js";
|
|
6
6
|
import { $ as j } from "./Group-BBaUrRF9.es.js";
|
|
7
7
|
import { useSlotRecipe as F } from "@chakra-ui/react/styled-system";
|
|
@@ -10,12 +10,12 @@ import { e as B } from "./extractStyleProps-DYXEhLtq.es.js";
|
|
|
10
10
|
import { useContext as I, useRef as S, useEffect as G } from "react";
|
|
11
11
|
import { Flex as x } from "@chakra-ui/react/flex";
|
|
12
12
|
import { T as y } from "./text-BgiP8ZB6.es.js";
|
|
13
|
-
import { T as P } from "./time-input-
|
|
13
|
+
import { T as P } from "./time-input--a_qv-Jk.es.js";
|
|
14
14
|
import { $ as C } from "./Button-Dx3xzN8n.es.js";
|
|
15
15
|
import { e as O, d as q } from "./utils-Cyja2WdR.es.js";
|
|
16
|
-
import { d as H } from "./DateField-
|
|
16
|
+
import { d as H } from "./DateField-DZwn3cIj.es.js";
|
|
17
17
|
import { R as L } from "./range-calendar-DBpl6y5i.es.js";
|
|
18
|
-
import { D } from "./date-input-
|
|
18
|
+
import { D } from "./date-input-Cap8-3zj.es.js";
|
|
19
19
|
import { I as R } from "./icon-button-DQS2apw-.es.js";
|
|
20
20
|
const { withProvider: M, withContext: $ } = /* @__PURE__ */ k({
|
|
21
21
|
key: "dateRangePicker"
|
|
@@ -278,4 +278,4 @@ Z.displayName = "DateRangePicker";
|
|
|
278
278
|
export {
|
|
279
279
|
Z as D
|
|
280
280
|
};
|
|
281
|
-
//# sourceMappingURL=date-range-picker-
|
|
281
|
+
//# sourceMappingURL=date-range-picker-DGWMdcAN.es.js.map
|
package/dist/chunks/{date-range-picker-KRcGUZW-.es.js.map → date-range-picker-DGWMdcAN.es.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-range-picker-KRcGUZW-.es.js","sources":["../../src/components/date-range-picker/date-range-picker.slots.tsx","../../src/components/date-range-picker/components/date-range-picker.time-input.tsx","../../src/components/date-range-picker/components/date-range-picker.custom-context.tsx","../../src/components/date-range-picker/date-range-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DateRangePickerRootSlotProps } from \"./date-range-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dateRangePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DateRangePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateRangePickerRootSlot = withProvider<\n HTMLDivElement,\n DateRangePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DateRangePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DateRangePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DateRangePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DateRangePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DateRangePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DateRangePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DateRangePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DateRangePickerStateContext } from \"react-aria-components\";\nimport type { DateRangePickerTimeInputProps } from \"../date-range-picker.types\";\n\nexport const DateRangePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DateRangePickerTimeInputProps) => {\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n const { granularity, value } = dateRangePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousValueRef = useRef(value);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date range changes (user selects dates from calendar)\n useEffect(() => {\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // Check if date range changed by comparing start and end dates\n const hasValueChanged =\n (value?.start &&\n previousValueRef.current?.start?.compare(value.start) !== 0) ||\n (value?.end && previousValueRef.current?.end?.compare(value.end) !== 0);\n\n if (hasValueChanged) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n }\n\n previousValueRef.current = value;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [value]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* Start DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n Start time\n </Text>\n <TimeInput\n slot=\"startTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n\n {/* End DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n End time\n </Text>\n <TimeInput\n slot=\"endTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n </Flex>\n );\n};\n","import { useContext, type ReactNode } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DateRangePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DateRangePickerCustomContext = ({\n children,\n}: {\n children: ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n\n // Check if all 6 segments (start: day, month, year; end: day, month, year) have values\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const hasCompleteRangeDate = (date: any) =>\n date?.day && date?.month && date?.year;\n\n const incompleteValue =\n !dateRangePickerState?.value ||\n !hasCompleteRangeDate(dateRangePickerState.value.start) ||\n !hasCompleteRangeDate(dateRangePickerState.value.end);\n\n const { granularity } = dateRangePickerState!;\n\n // Extract time values from start and end dates separately\n const startTimeValue =\n dateRangePickerState?.value?.start &&\n \"hour\" in dateRangePickerState.value.start\n ? dateRangePickerState.value.start\n : null;\n const endTimeValue =\n dateRangePickerState?.value?.end && \"hour\" in dateRangePickerState.value.end\n ? dateRangePickerState.value.end\n : null;\n\n // Try to get disabled state from the button context\n const isDateRangePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = (type: \"start\" | \"end\") => {\n const prefix = type === \"start\" ? \"Start\" : \"End\";\n switch (granularity) {\n case \"hour\":\n return `${prefix} time (hour)`;\n case \"minute\":\n return `${prefix} time (hour and minute)`;\n case \"second\":\n return `${prefix} time (hour, minute, and second)`;\n default:\n return `${prefix} time`;\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n // Clear both start and end values\n onPress: () => dateRangePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDateRangePickerDisabled,\n // Hide the button when there's no value\n style: incompleteValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": incompleteValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n // Separate time input slots for start and end times\n const timeInputSlots = {\n startTimeInput: {\n value: startTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.start) {\n // Update the start date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newStartDate = startDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: newStartDate,\n end: endDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"start\"),\n },\n endTimeInput: {\n value: endTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.end) {\n // Update the end date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newEndDate = endDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: startDate,\n end: newEndDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"end\"),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DateRangePickerRootSlot,\n DateRangePickerGroupSlot,\n DateRangePickerTriggerSlot,\n DateRangePickerPopoverSlot,\n DateRangePickerCalendarSlot,\n} from \"./date-range-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DateRangePicker as ReactAriaDateRangePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateRangePickerSlotRecipe } from \"./date-range-picker.recipe\";\nimport type { DateRangePickerProps } from \"./date-range-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, RangeCalendar, IconButton, Text } from \"@/components\";\nimport { DateRangePickerTimeInput } from \"./components/date-range-picker.time-input\";\nimport { DateRangePickerCustomContext } from \"./components/date-range-picker.custom-context\";\n\n/**\n * DateRangePicker\n * ============================================================\n * Combines a DateInput with a RangeCalendar popover for date range selection.\n * Users can either type a date range directly or select from the calendar.\n */\nexport const DateRangePicker = (props: DateRangePickerProps) => {\n // Forward hideTimeZone and hourCycle to child components (footer time inputs)\n const { granularity = \"day\", hideTimeZone, hourCycle } = props;\n const recipe = useSlotRecipe({ recipe: dateRangePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // Extract size and variant from recipe props to pass to DateInputs\n const { size = \"md\" } = recipeProps;\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DateRangePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDateRangePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DateRangePickerCustomContext>\n <DateRangePickerGroupSlot asChild>\n <Group>\n <DateInput\n slot=\"start\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <Text\n as=\"span\"\n px=\"150\"\n color=\"neutral.11\"\n userSelect=\"none\"\n aria-hidden=\"true\"\n slot={null}\n >\n –\n </Text>\n <DateInput\n slot=\"end\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DateRangePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DateRangePickerTriggerSlot>\n </Group>\n </DateRangePickerGroupSlot>\n <DateRangePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DateRangePickerCalendarSlot>\n <RangeCalendar />\n </DateRangePickerCalendarSlot>\n <DateRangePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DateRangePickerPopoverSlot>\n </DateRangePickerCustomContext>\n </ReactAriaDateRangePicker>\n </DateRangePickerRootSlot>\n );\n};\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DateRangePickerRootSlot","DateRangePickerGroupSlot","DateRangePickerTriggerSlot","DateRangePickerPopoverSlot","DateRangePickerCalendarSlot","DateRangePickerTimeInput","hideTimeZone","hourCycle","dateRangePickerState","useContext","DateRangePickerStateContext","granularity","value","timeInputRef","useRef","previousValueRef","useEffect","timeoutId","container","activeElement","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DateRangePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","hasCompleteRangeDate","date","incompleteValue","startTimeValue","endTimeValue","isDateRangePickerDisabled","getDefaultTimeInputAriaLabel","type","prefix","buttonSlots","event","timeInputSlots","currentValue","startDate","endDate","newStartDate","newEndDate","Provider","TimeFieldContext","DateRangePicker","props","recipe","useSlotRecipe","dateRangePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","size","overlayButtonSize","shouldCloseOnSelect","ReactAriaDateRangePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","RangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAA0B,gBAAAH,EAGrC,OAAO,MAAM,GAKFI,IAA2B,gBAAAH,EAGtC,OAAO,OAAO,GAKHI,IAA6B,gBAAAJ,EAGxC,OAAO,SAAS,GAKLK,IAA6B,gBAAAL,EAGxC,OAAO,SAAS,GAKLM,IAA8B,gBAAAN,EAGzC,OAAO,UAAU,GC7CNO,IAA2B,CAAC;AAAA,EACvC,cAAAC;AAAA,EACA,WAAAC;AACF,MAAqC;AACnC,QAAMC,IAAuBC,EAAWC,CAA2B,GAC7D,EAAE,aAAAC,GAAa,OAAAC,EAAA,IAAUJ,GACzBK,IAAeC,EAAuB,IAAI,GAC1CC,IAAmBD,EAAOF,CAAK;AAGrC,SAAID,MAAgB,QACX,QAITK,EAAU,MAAM;AACd,QAAIC;AAQJ,QAJGL,GAAO,SACNG,EAAiB,SAAS,OAAO,QAAQH,EAAM,KAAK,MAAM,KAC3DA,GAAO,OAAOG,EAAiB,SAAS,KAAK,QAAQH,EAAM,GAAG,MAAM,GAElD;AAGnB,YAAMM,IAAYL,EAAa,SACzBM,IAAgB,SAAS;AAK/B,MAHED,GAAW,SAASC,CAAa,KACjCA,GAAe,aAAa,MAAM,MAAM,iBAIxCF,IAAY,WAAW,MAAM;AAE3B,YAAIC,GAAW;AACb,gBAAME,IAAeF,EAAU;AAAA,YAC7B;AAAA,UAAA;AAGF,UAAIE,KACFA,EAAa,MAAA;AAAA,QAEjB;AAAA,M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AA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAMd,EAAM;AAAA,cACZ,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,cAAA7C;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEDL,GAAA,EAEC,UAAA;AAAA,YAAA,gBAAAqB;AAAA,cAAC2C;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,MAAML;AAAA,gBACN,MAAK;AAAA,gBAEL,4BAACM,GAAA,CAAA,CAAM;AAAA,cAAA;AAAA,YAAA;AAAA,YAGT,gBAAA5C;AAAA,cAAC2C;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,MAAML;AAAA,gBACN,MAAK;AAAA,gBAEL,4BAACO,GAAA,CAAA,CAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UACjB,EAAA,CACF;AAAA,QAAA,EAAA,CACF,EAAA,CACF;AAAA,QACA,gBAAA7C,EAACpB,KAA2B,SAAO,IACjC,4BAACkE,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAAhD,EAACiD,GAAA,EACC,UAAA;AAAA,UAAA,gBAAA/C,EAACnB,GAAA,EACC,UAAA,gBAAAmB,EAACgD,GAAA,CAAA,CAAc,GACjB;AAAA,UACA,gBAAAhD;AAAA,YAAClB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA2C,EAAgB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"date-range-picker-DGWMdcAN.es.js","sources":["../../src/components/date-range-picker/date-range-picker.slots.tsx","../../src/components/date-range-picker/components/date-range-picker.time-input.tsx","../../src/components/date-range-picker/components/date-range-picker.custom-context.tsx","../../src/components/date-range-picker/date-range-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DateRangePickerRootSlotProps } from \"./date-range-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dateRangePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DateRangePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateRangePickerRootSlot = withProvider<\n HTMLDivElement,\n DateRangePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DateRangePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DateRangePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DateRangePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DateRangePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DateRangePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DateRangePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DateRangePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DateRangePickerStateContext } from \"react-aria-components\";\nimport type { DateRangePickerTimeInputProps } from \"../date-range-picker.types\";\n\nexport const DateRangePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DateRangePickerTimeInputProps) => {\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n const { granularity, value } = dateRangePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousValueRef = useRef(value);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date range changes (user selects dates from calendar)\n useEffect(() => {\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // Check if date range changed by comparing start and end dates\n const hasValueChanged =\n (value?.start &&\n previousValueRef.current?.start?.compare(value.start) !== 0) ||\n (value?.end && previousValueRef.current?.end?.compare(value.end) !== 0);\n\n if (hasValueChanged) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n }\n\n previousValueRef.current = value;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [value]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* Start DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n Start time\n </Text>\n <TimeInput\n slot=\"startTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n\n {/* End DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n End time\n </Text>\n <TimeInput\n slot=\"endTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n </Flex>\n );\n};\n","import { useContext, type ReactNode } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DateRangePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DateRangePickerCustomContext = ({\n children,\n}: {\n children: ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n\n // Check if all 6 segments (start: day, month, year; end: day, month, year) have values\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const hasCompleteRangeDate = (date: any) =>\n date?.day && date?.month && date?.year;\n\n const incompleteValue =\n !dateRangePickerState?.value ||\n !hasCompleteRangeDate(dateRangePickerState.value.start) ||\n !hasCompleteRangeDate(dateRangePickerState.value.end);\n\n const { granularity } = dateRangePickerState!;\n\n // Extract time values from start and end dates separately\n const startTimeValue =\n dateRangePickerState?.value?.start &&\n \"hour\" in dateRangePickerState.value.start\n ? dateRangePickerState.value.start\n : null;\n const endTimeValue =\n dateRangePickerState?.value?.end && \"hour\" in dateRangePickerState.value.end\n ? dateRangePickerState.value.end\n : null;\n\n // Try to get disabled state from the button context\n const isDateRangePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = (type: \"start\" | \"end\") => {\n const prefix = type === \"start\" ? \"Start\" : \"End\";\n switch (granularity) {\n case \"hour\":\n return `${prefix} time (hour)`;\n case \"minute\":\n return `${prefix} time (hour and minute)`;\n case \"second\":\n return `${prefix} time (hour, minute, and second)`;\n default:\n return `${prefix} time`;\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n // Clear both start and end values\n onPress: () => dateRangePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDateRangePickerDisabled,\n // Hide the button when there's no value\n style: incompleteValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": incompleteValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n // Separate time input slots for start and end times\n const timeInputSlots = {\n startTimeInput: {\n value: startTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.start) {\n // Update the start date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newStartDate = startDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: newStartDate,\n end: endDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"start\"),\n },\n endTimeInput: {\n value: endTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.end) {\n // Update the end date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newEndDate = endDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: startDate,\n end: newEndDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"end\"),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DateRangePickerRootSlot,\n DateRangePickerGroupSlot,\n DateRangePickerTriggerSlot,\n DateRangePickerPopoverSlot,\n DateRangePickerCalendarSlot,\n} from \"./date-range-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DateRangePicker as ReactAriaDateRangePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateRangePickerSlotRecipe } from \"./date-range-picker.recipe\";\nimport type { DateRangePickerProps } from \"./date-range-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, RangeCalendar, IconButton, Text } from \"@/components\";\nimport { DateRangePickerTimeInput } from \"./components/date-range-picker.time-input\";\nimport { DateRangePickerCustomContext } from \"./components/date-range-picker.custom-context\";\n\n/**\n * DateRangePicker\n * ============================================================\n * Combines a DateInput with a RangeCalendar popover for date range selection.\n * Users can either type a date range directly or select from the calendar.\n */\nexport const DateRangePicker = (props: DateRangePickerProps) => {\n // Forward hideTimeZone and hourCycle to child components (footer time inputs)\n const { granularity = \"day\", hideTimeZone, hourCycle } = props;\n const recipe = useSlotRecipe({ recipe: dateRangePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // Extract size and variant from recipe props to pass to DateInputs\n const { size = \"md\" } = recipeProps;\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DateRangePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDateRangePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DateRangePickerCustomContext>\n <DateRangePickerGroupSlot asChild>\n <Group>\n <DateInput\n slot=\"start\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <Text\n as=\"span\"\n px=\"150\"\n color=\"neutral.11\"\n userSelect=\"none\"\n aria-hidden=\"true\"\n slot={null}\n >\n –\n </Text>\n <DateInput\n slot=\"end\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DateRangePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DateRangePickerTriggerSlot>\n </Group>\n </DateRangePickerGroupSlot>\n <DateRangePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DateRangePickerCalendarSlot>\n <RangeCalendar />\n </DateRangePickerCalendarSlot>\n <DateRangePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DateRangePickerPopoverSlot>\n </DateRangePickerCustomContext>\n </ReactAriaDateRangePicker>\n </DateRangePickerRootSlot>\n );\n};\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DateRangePickerRootSlot","DateRangePickerGroupSlot","DateRangePickerTriggerSlot","DateRangePickerPopoverSlot","DateRangePickerCalendarSlot","DateRangePickerTimeInput","hideTimeZone","hourCycle","dateRangePickerState","useContext","DateRangePickerStateContext","granularity","value","timeInputRef","useRef","previousValueRef","useEffect","timeoutId","container","activeElement","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DateRangePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","hasCompleteRangeDate","date","incompleteValue","startTimeValue","endTimeValue","isDateRangePickerDisabled","getDefaultTimeInputAriaLabel","type","prefix","buttonSlots","event","timeInputSlots","currentValue","startDate","endDate","newStartDate","newEndDate","Provider","TimeFieldContext","DateRangePicker","props","recipe","useSlotRecipe","dateRangePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","size","overlayButtonSize","shouldCloseOnSelect","ReactAriaDateRangePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","RangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAA0B,gBAAAH,EAGrC,OAAO,MAAM,GAKFI,IAA2B,gBAAAH,EAGtC,OAAO,OAAO,GAKHI,IAA6B,gBAAAJ,EAGxC,OAAO,SAAS,GAKLK,IAA6B,gBAAAL,EAGxC,OAAO,SAAS,GAKLM,IAA8B,gBAAAN,EAGzC,OAAO,UAAU,GC7CNO,IAA2B,CAAC;AAAA,EACvC,cAAAC;AAAA,EACA,WAAAC;AACF,MAAqC;AACnC,QAAMC,IAAuBC,EAAWC,CAA2B,GAC7D,EAAE,aAAAC,GAAa,OAAAC,EAAA,IAAUJ,GACzBK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AAA;AAAA,UAAA,gBAAA/C,EAACnB,GAAA,EACC,UAAA,gBAAAmB,EAACgD,GAAA,CAAA,CAAc,GACjB;AAAA,UACA,gBAAAhD;AAAA,YAAClB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA2C,EAAgB,cAAc;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { createSlotRecipeContext as u } from "@chakra-ui/react";
|
|
3
|
-
import { $ as f, a as h, b as g } from "./DateField-
|
|
3
|
+
import { $ as f, a as h, b as g } from "./DateField-DZwn3cIj.es.js";
|
|
4
4
|
import { useRecipe as $ } from "@chakra-ui/react/styled-system";
|
|
5
5
|
import { t as x } from "./index-CtB71yr7.es.js";
|
|
6
6
|
import { e as I } from "./extractStyleProps-DYXEhLtq.es.js";
|
|
@@ -18,4 +18,4 @@ C.displayName = "TimeInput";
|
|
|
18
18
|
export {
|
|
19
19
|
C as T
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=time-input-
|
|
21
|
+
//# sourceMappingURL=time-input--a_qv-Jk.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-input-
|
|
1
|
+
{"version":3,"file":"time-input--a_qv-Jk.es.js","sources":["../../src/components/time-input/time-input.slots.tsx","../../src/components/time-input/time-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type {\n TimeInputRootSlotProps,\n TimeInputLeadingElementSlotProps,\n TimeInputTrailingElementSlotProps,\n} from \"./time-input.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"timeInput\",\n});\n\n/**\n * Root component that provides the styling context for the TimeInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const TimeInputRootSlot = withProvider<\n HTMLDivElement,\n TimeInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const TimeInputLeadingElementSlot = withContext<\n HTMLDivElement,\n TimeInputLeadingElementSlotProps\n>(\"div\", \"leadingElement\");\n\nexport const TimeInputTrailingElementSlot = withContext<\n HTMLDivElement,\n TimeInputTrailingElementSlotProps\n>(\"div\", \"trailingElement\");\n\n/**\n * Slot component for the TimeField part of the TimeInput.\n */\nexport const TimeInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the TimeField part of the TimeInput.\n */\nexport const TimeInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n TimeInputRootSlot,\n TimeInputLeadingElementSlot,\n TimeInputTrailingElementSlot,\n TimeInputSegmentGroupSlot,\n TimeInputSegmentSlot,\n} from \"./time-input.slots\";\n\nimport { TimeField, DateInput, DateSegment } from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { timeInputRecipe } from \"./time-input.recipe\";\nimport type { TimeInputProps } from \"./time-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n/**\n * TimeInput\n * ============================================================\n * allows entering a time in the currently selected locale\n */\nexport const TimeInput = (props: TimeInputProps) => {\n const recipe = useRecipe({ recipe: timeInputRecipe });\n const { leadingElement, trailingElement, ...rest } = props;\n const [recipeProps, remainingProps] = recipe.splitVariantProps({ ...rest });\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <TimeInputRootSlot asChild {...recipeProps} {...styleProps}>\n <TimeField {...otherProps}>\n {leadingElement && (\n <TimeInputLeadingElementSlot>\n {leadingElement}\n </TimeInputLeadingElementSlot>\n )}\n <TimeInputSegmentGroupSlot asChild>\n <DateInput>\n {(segment) => (\n <TimeInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </TimeInputSegmentSlot>\n )}\n </DateInput>\n </TimeInputSegmentGroupSlot>\n {trailingElement && (\n <TimeInputTrailingElementSlot>\n {trailingElement}\n </TimeInputTrailingElementSlot>\n )}\n </TimeField>\n </TimeInputRootSlot>\n );\n};\n\nTimeInput.displayName = \"TimeInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","TimeInputRootSlot","TimeInputLeadingElementSlot","TimeInputTrailingElementSlot","TimeInputSegmentGroupSlot","TimeInputSegmentSlot","TimeInput","props","recipe","useRecipe","timeInputRecipe","leadingElement","trailingElement","rest","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","jsx","jsxs","TimeField","DateInput","segment","DateSegment"],"mappings":";;;;;;AAWA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAAoB,gBAAAH,EAG/B,OAAO,MAAM,GAEFI,IAA8B,gBAAAH,EAGzC,OAAO,gBAAgB,GAEZI,IAA+B,gBAAAJ,EAG1C,OAAO,iBAAiB,GAKbK,IAA4B,gBAAAL,EAGvC,OAAO,cAAc,GAKVM,IAAuB,gBAAAN,EAGlC,OAAO,SAAS,GC9BLO,IAAY,CAACC,MAA0B;AAClD,QAAMC,IAASC,EAAU,EAAE,QAAQC,GAAiB,GAC9C,EAAE,gBAAAC,GAAgB,iBAAAC,GAAiB,GAAGC,MAASN,GAC/C,CAACO,GAAaC,CAAc,IAAIP,EAAO,kBAAkB,EAAE,GAAGK,GAAM,GACpE,CAACG,GAAYC,CAAU,IAAIC,EAAkBH,CAAc;AAEjE,SACE,gBAAAI,EAAClB,GAAA,EAAkB,SAAO,IAAE,GAAGa,GAAc,GAAGE,GAC9C,UAAA,gBAAAI,EAACC,GAAA,EAAW,GAAGJ,GACZ,UAAA;AAAA,IAAAN,KACC,gBAAAQ,EAACjB,KACE,UAAAS,EAAA,CACH;AAAA,sBAEDP,GAAA,EAA0B,SAAO,IAChC,UAAA,gBAAAe,EAACG,KACE,UAAA,CAACC,MACA,gBAAAJ,EAACd,GAAA,EAAqB,SAAO,IAC3B,UAAA,gBAAAc,EAACK,KAAY,SAAAD,EAAA,CAAkB,GACjC,GAEJ,EAAA,CACF;AAAA,IACCX,KACC,gBAAAO,EAAChB,GAAA,EACE,UAAAS,EAAA,CACH;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;AAEAN,EAAU,cAAc;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AccordionHeaderRightContentSlot } from './accordion.slots';
|
|
2
|
+
import { AccordionRoot } from './components/accordion-root';
|
|
3
|
+
import { AccordionHeader } from './components/accordion-header';
|
|
4
|
+
import { AccordionContent } from './components/accordion-content';
|
|
5
|
+
import { AccordionItem } from './components/accordion-item';
|
|
6
|
+
export declare const Accordion: {
|
|
7
|
+
Root: (props: import('./accordion.types').AccordionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Item: ({ children, value, ref, ...props }: import('./accordion.types').AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Header: ({ children, ref, ...props }: import('./accordion.types').AccordionHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Content: ({ children, ref, ...props }: import('./accordion.types').AccordionContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
HeaderRightContent: import('react').ForwardRefExoticComponent<Omit<import('@chakra-ui/react').PatchHtmlProps<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">>, "page" | "container" | "_hover" | "_active" | "_focus" | "_focusWithin" | "_focusVisible" | "_disabled" | "_visited" | "_target" | "_readOnly" | "_readWrite" | "_empty" | "_checked" | "_enabled" | "_expanded" | "_highlighted" | "_complete" | "_incomplete" | "_dragging" | "_before" | "_after" | "_firstLetter" | "_firstLine" | "_marker" | "_selection" | "_file" | "_backdrop" | "_first" | "_last" | "_notFirst" | "_notLast" | "_only" | "_even" | "_odd" | "_peerFocus" | "_peerHover" | "_peerActive" | "_peerFocusWithin" | "_peerFocusVisible" | "_peerDisabled" | "_peerChecked" | "_peerInvalid" | "_peerExpanded" | "_peerPlaceholderShown" | "_groupFocus" | "_groupHover" | "_groupActive" | "_groupFocusWithin" | "_groupFocusVisible" | "_groupDisabled" | "_groupChecked" | "_groupExpanded" | "_groupInvalid" | "_indeterminate" | "_required" | "_valid" | "_invalid" | "_autofill" | "_inRange" | "_outOfRange" | "_placeholder" | "_placeholderShown" | "_pressed" | "_selected" | "_grabbed" | "_underValue" | "_overValue" | "_atValue" | "_default" | "_optional" | "_open" | "_closed" | "_fullscreen" | "_loading" | "_hidden" | "_current" | "_currentPage" | "_currentStep" | "_today" | "_unavailable" | "_rangeStart" | "_rangeEnd" | "_now" | "_topmost" | "_motionReduce" | "_motionSafe" | "_print" | "_landscape" | "_portrait" | "_dark" | "_light" | "_osDark" | "_osLight" | "_highContrast" | "_lessContrast" | "_moreContrast" | "_ltr" | "_rtl" | "_scrollbar" | "_scrollbarThumb" | "_scrollbarTrack" | "_horizontal" | "_vertical" | "_icon" | "_starting" | "sm" | "smOnly" | "smDown" | "md" | "mdOnly" | "mdDown" | "lg" | "lgOnly" | "lgDown" | "xl" | "xlOnly" | "xlDown" | "2xl" | "2xlOnly" | "2xlDown" | "smToMd" | "smToLg" | "smToXl" | "smTo2xl" | "mdToLg" | "mdToXl" | "mdTo2xl" | "lgToXl" | "lgTo2xl" | "xlTo2xl" | "base" | "borderRadius" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationRangeEnd" | "animationRangeStart" | "animationTimeline" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockSize" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipPath" | "color" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "containerName" | "containerType" | "content" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "filter" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontPalette" | "fontSize" | "fontSizeAdjust" | "fontSmooth" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontSynthesisPosition" | "fontSynthesisSmallCaps" | "fontSynthesisStyle" | "fontSynthesisWeight" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantEmoji" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "fontWeight" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "height" | "hyphenateCharacter" | "hyphenateLimitChars" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "inlineSize" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "left" | "letterSpacing" | "lineBreak" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflowAnchor" | "overflowBlock" | "overflowClipBox" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overlay" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "printColorAdjust" | "quotes" | "resize" | "right" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "scale" | "scrollBehavior" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginBottom" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapMarginBottom" | "scrollSnapMarginLeft" | "scrollSnapMarginRight" | "scrollSnapMarginTop" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "textWrap" | "timelineScope" | "top" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionBehavior" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "viewTimelineAxis" | "viewTimelineInset" | "viewTimelineName" | "viewTransitionName" | "visibility" | "whiteSpace" | "whiteSpaceCollapse" | "widows" | "width" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex" | "zoom" | "all" | "animation" | "animationRange" | "background" | "backgroundPosition" | "border" | "borderBlock" | "borderBlockEnd" | "borderBlockStart" | "borderBottom" | "borderColor" | "borderImage" | "borderInline" | "borderInlineEnd" | "borderInlineStart" | "borderLeft" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "caret" | "columnRule" | "columns" | "containIntrinsicSize" | "flex" | "flexFlow" | "font" | "gap" | "grid" | "gridArea" | "gridColumn" | "gridRow" | "gridTemplate" | "inset" | "insetBlock" | "insetInline" | "lineClamp" | "listStyle" | "margin" | "marginBlock" | "marginInline" | "mask" | "maskBorder" | "offset" | "outline" | "overflow" | "overscrollBehavior" | "padding" | "paddingBlock" | "paddingInline" | "placeContent" | "placeItems" | "placeSelf" | "scrollMargin" | "scrollMarginBlock" | "scrollMarginInline" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingInline" | "scrollSnapMargin" | "scrollTimeline" | "textDecoration" | "textEmphasis" | "transition" | "viewTimeline" | "WebkitAppearance" | "WebkitBorderBeforeColor" | "WebkitBorderBeforeStyle" | "WebkitBorderBeforeWidth" | "WebkitBoxReflect" | "WebkitLineClamp" | "WebkitMaskAttachment" | "WebkitMaskClip" | "WebkitMaskComposite" | "WebkitMaskImage" | "WebkitMaskOrigin" | "WebkitMaskPosition" | "WebkitMaskPositionX" | "WebkitMaskPositionY" | "WebkitMaskRepeat" | "WebkitMaskRepeatX" | "WebkitMaskRepeatY" | "WebkitMaskSize" | "WebkitOverflowScrolling" | "WebkitTapHighlightColor" | "WebkitTextFillColor" | "WebkitTextStrokeColor" | "WebkitTextStrokeWidth" | "WebkitTouchCallout" | "WebkitUserModify" | "WebkitUserSelect" | "WebkitBorderBefore" | "WebkitMask" | "WebkitTextStroke" | "boxAlign" | "boxDirection" | "boxFlex" | "boxFlexGroup" | "boxLines" | "boxOrdinalGroup" | "boxOrient" | "boxPack" | "clip" | "gridColumnGap" | "gridGap" | "gridRowGap" | "imeMode" | "scrollSnapCoordinate" | "scrollSnapDestination" | "scrollSnapPointsX" | "scrollSnapPointsY" | "scrollSnapTypeX" | "scrollSnapTypeY" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "marker" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "bg" | "colorPalette" | "invert" | "focusVisibleRing" | "layerStyle" | "focusRing" | "h" | "minW" | "px" | "anchorName" | "anchorScope" | "colorInterpolationFilters" | "cx" | "cy" | "d" | "fieldSizing" | "initialLetterAlign" | "interpolateSize" | "positionAnchor" | "positionArea" | "positionTry" | "positionTryFallbacks" | "positionTryOrder" | "positionVisibility" | "r" | "rx" | "ry" | "textBox" | "textBoxEdge" | "textBoxTrim" | "textSpacingTrim" | "textWrapMode" | "textWrapStyle" | "x" | "y" | "bgColor" | "bgSize" | "bgPos" | "bgRepeat" | "bgAttachment" | "bgClip" | "bgGradient" | "bgImg" | "bgImage" | "borderStart" | "borderEnd" | "borderX" | "borderY" | "borderStartColor" | "borderEndColor" | "borderStartStyle" | "borderEndStyle" | "rounded" | "roundedTopLeft" | "roundedStartStart" | "borderTopStartRadius" | "roundedEndStart" | "borderBottomStartRadius" | "roundedTopRight" | "roundedStartEnd" | "borderTopEndRadius" | "roundedEndEnd" | "borderBottomEndRadius" | "roundedBottomLeft" | "roundedBottomRight" | "roundedStart" | "borderStartRadius" | "roundedEnd" | "borderEndRadius" | "roundedTop" | "roundedBottom" | "roundedLeft" | "roundedRight" | "borderXWidth" | "borderStartWidth" | "borderEndWidth" | "borderYWidth" | "shadow" | "shadowColor" | "blendMode" | "bgBlendMode" | "gapY" | "gapX" | "flexDir" | "w" | "minH" | "maxW" | "maxH" | "overscroll" | "overscrollX" | "overscrollY" | "scrollPaddingX" | "scrollPaddingY" | "listStylePos" | "listStyleImg" | "pos" | "insetX" | "insetY" | "insetStart" | "insetEnd" | "m" | "mt" | "mr" | "mb" | "ml" | "ms" | "marginStart" | "me" | "marginEnd" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "ps" | "paddingStart" | "pe" | "paddingEnd" | "paddingX" | "py" | "paddingY" | "textDecor" | "backgroundGradient" | "gradientFrom" | "gradientTo" | "gradientVia" | "borderInlineStartRadius" | "borderInlineEndRadius" | "borderTopRadius" | "borderBottomRadius" | "borderLeftRadius" | "borderRightRadius" | "divideX" | "divideY" | "divideColor" | "divideStyle" | "boxShadowColor" | "blur" | "brightness" | "contrast" | "grayscale" | "hueRotate" | "saturate" | "sepia" | "dropShadow" | "backdropBlur" | "backdropBrightness" | "backdropContrast" | "backdropGrayscale" | "backdropHueRotate" | "backdropInvert" | "backdropOpacity" | "backdropSaturate" | "backdropSepia" | "focusRingColor" | "focusRingOffset" | "focusRingWidth" | "focusRingStyle" | "boxSize" | "hideFrom" | "hideBelow" | "scrollbar" | "scrollMarginX" | "scrollMarginY" | "scrollSnapStrictness" | "ring" | "ringColor" | "ringOffset" | "ringOffsetColor" | "ringInset" | "skewX" | "skewY" | "scaleX" | "scaleY" | "spaceXReverse" | "spaceX" | "spaceYReverse" | "spaceY" | "rotateX" | "rotateY" | "translateX" | "translateY" | "truncate" | "borderSpacingX" | "borderSpacingY" | "srOnly" | "debug" | "textStyle" | "animationStyle" | "css" | keyof import('@chakra-ui/react').PolymorphicProps> & Omit<import('@chakra-ui/react').JsxStyleProps, never> & import('@chakra-ui/react').PolymorphicProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
};
|
|
13
|
+
export { AccordionRoot as _AccordionRoot, AccordionItem as _AccordionItem, AccordionHeader as _AccordionHeader, AccordionContent as _AccordionContent, AccordionHeaderRightContentSlot as _AccordionHeaderRightContent, };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recipe configuration for the Accordion component.
|
|
3
|
+
* Defines the styling variants and base styles using Chakra UI's recipe system.
|
|
4
|
+
*/
|
|
5
|
+
export declare const accordionSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"root" | "disclosure" | "trigger" | "panel" | "accordionTitle" | "headerContentRight", {
|
|
6
|
+
size: {
|
|
7
|
+
md: {
|
|
8
|
+
trigger: {
|
|
9
|
+
"--font-size": "fontSizes.500";
|
|
10
|
+
"& svg": {
|
|
11
|
+
"--width": "sizes.600";
|
|
12
|
+
"--height": "sizes.600";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
panel: {
|
|
16
|
+
"--padding-top": "spacing.600";
|
|
17
|
+
"--padding-bottom": "spacing.800";
|
|
18
|
+
"--padding-left": "spacing.800";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
sm: {
|
|
22
|
+
trigger: {
|
|
23
|
+
"--font-size": "fontSizes.400";
|
|
24
|
+
"& svg": {
|
|
25
|
+
"--width": "sizes.500";
|
|
26
|
+
"--height": "sizes.500";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
panel: {
|
|
30
|
+
"--padding-top": "spacing.400";
|
|
31
|
+
"--padding-bottom": "spacing.600";
|
|
32
|
+
"--padding-left": "spacing.700";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}>;
|