@commercetools/nimbus 2.0.1-rc2 → 2.0.1-rc4
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-DmPAxSnT.es.js} +8 -8
- package/dist/chunks/{DateField-B-4ymU5i.es.js.map → DateField-DmPAxSnT.es.js.map} +1 -1
- package/dist/chunks/{DatePicker-ByxT1sNF.es.js → DatePicker-D8m8YbnD.es.js} +6 -6
- package/dist/chunks/{DatePicker-ByxT1sNF.es.js.map → DatePicker-D8m8YbnD.es.js.map} +1 -1
- package/dist/chunks/{Heading-DFiVmZUR.es.js → Heading-lYSFVV4F.es.js} +2 -2
- package/dist/chunks/{Heading-DFiVmZUR.es.js.map → Heading-lYSFVV4F.es.js.map} +1 -1
- package/dist/chunks/accordion-B2FLWAh5.cjs.js.map +1 -1
- package/dist/chunks/accordion-CKDnNkVv.es.js.map +1 -1
- package/dist/chunks/{calendar-lD6G93R9.es.js → calendar-BkGJAIae.es.js} +3 -3
- package/dist/chunks/calendar-BkGJAIae.es.js.map +1 -0
- package/dist/chunks/calendar-V0KeNCQ3.cjs.js.map +1 -1
- package/dist/chunks/collapsible-motion-C7M_CLNI.cjs.js.map +1 -1
- package/dist/chunks/collapsible-motion-CSrKjF8X.es.js.map +1 -1
- package/dist/chunks/combobox-B5UxZWSX.cjs.js.map +1 -1
- package/dist/chunks/combobox-D_7gr3DY.es.js.map +1 -1
- package/dist/chunks/{date-input-Do1wXp3t.es.js → date-input-B_EuP5sc.es.js} +2 -2
- package/dist/chunks/{date-input-Do1wXp3t.es.js.map → date-input-B_EuP5sc.es.js.map} +1 -1
- package/dist/chunks/{date-picker-ClYge74a.es.js → date-picker-DFpgLG1U.es.js} +6 -6
- package/dist/chunks/{date-picker-ClYge74a.es.js.map → date-picker-DFpgLG1U.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-KRcGUZW-.es.js → date-range-picker-DVuIeQQd.es.js} +6 -6
- package/dist/chunks/{date-range-picker-KRcGUZW-.es.js.map → date-range-picker-DVuIeQQd.es.js.map} +1 -1
- package/dist/chunks/group-BqUFlw5R.cjs.js.map +1 -1
- package/dist/chunks/group-CWADf2vF.es.js.map +1 -1
- package/dist/chunks/icon-CenxuChf.es.js.map +1 -1
- package/dist/chunks/icon-D39U--jA.cjs.js.map +1 -1
- package/dist/chunks/kbd-BaeV_DL-.cjs.js.map +1 -1
- package/dist/chunks/kbd-CH9rYghB.es.js.map +1 -1
- package/dist/chunks/menu-D-vE6ZpM.es.js.map +1 -1
- package/dist/chunks/menu-DIepV2KZ.cjs.js.map +1 -1
- package/dist/chunks/popover-CfEq5G5-.cjs.js.map +1 -1
- package/dist/chunks/popover-DNaC7CwB.es.js.map +1 -1
- package/dist/chunks/{range-calendar-DBpl6y5i.es.js → range-calendar-D55DTDbA.es.js} +3 -3
- package/dist/chunks/range-calendar-D55DTDbA.es.js.map +1 -0
- package/dist/chunks/range-calendar-_dZfAsdG.cjs.js.map +1 -1
- package/dist/chunks/rich-text-input-BC8CBVio.es.js.map +1 -1
- package/dist/chunks/rich-text-input-Da5WFZ3l.cjs.js.map +1 -1
- package/dist/chunks/separator-CvRn_J0r.cjs.js.map +1 -1
- package/dist/chunks/separator-DJGUFG-o.es.js.map +1 -1
- package/dist/chunks/split-button-BO52sL7h.cjs.js.map +1 -1
- package/dist/chunks/split-button-BxyZmuNi.es.js.map +1 -1
- package/dist/chunks/switch-01hEhL9A.es.js.map +1 -1
- package/dist/chunks/switch-CdLhBEPq.cjs.js.map +1 -1
- package/dist/chunks/tabs-CJ0OAUSR.cjs.js.map +1 -1
- package/dist/chunks/tabs-Dhte-RCe.es.js.map +1 -1
- package/dist/chunks/tag-group-Btt0egzG.cjs.js.map +1 -1
- package/dist/chunks/tag-group-D2dgXSsV.es.js.map +1 -1
- package/dist/chunks/{time-input-DDrB_c0M.es.js → time-input-CUEnTp-4.es.js} +2 -2
- package/dist/chunks/{time-input-DDrB_c0M.es.js.map → time-input-CUEnTp-4.es.js.map} +1 -1
- package/dist/chunks/tooltip-BPTOkK7W.cjs.js.map +1 -1
- package/dist/chunks/tooltip-sgakxhiy.es.js.map +1 -1
- package/dist/chunks/{useDateFormatter-C4zVAL_K.es.js → useDateFormatter-4Wq50fMI.es.js} +3 -3
- package/dist/chunks/{useDateFormatter-C4zVAL_K.es.js.map → useDateFormatter-4Wq50fMI.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/calendar.es.js +1 -1
- 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/range-calendar.es.js +1 -1
- 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/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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -347
- package/dist/index.es.js +196 -201
- package/dist/index.es.js.map +1 -1
- 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/type-utils/index.d.ts +2 -0
- package/dist/type-utils/omit-props.d.ts +29 -0
- package/dist/type-utils/slot-types.d.ts +22 -0
- package/dist/utils/extractStyleProps.d.ts +6 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/noop.d.ts +12 -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/chunks/calendar-lD6G93R9.es.js.map +0 -1
- package/dist/chunks/range-calendar-DBpl6y5i.es.js.map +0 -1
- 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,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m, Fragment as u } from "react/jsx-runtime";
|
|
2
2
|
import { createSlotRecipeContext as f } from "@chakra-ui/react";
|
|
3
|
-
import { c as h, a as g, b as S } from "./DateField-
|
|
3
|
+
import { c as h, a as g, b as S } from "./DateField-DmPAxSnT.es.js";
|
|
4
4
|
import { useRecipe as x } from "@chakra-ui/react/styled-system";
|
|
5
5
|
import { d as I } from "./index-CtB71yr7.es.js";
|
|
6
6
|
import { e as $ } from "./extractStyleProps-DYXEhLtq.es.js";
|
|
@@ -18,4 +18,4 @@ y.displayName = "DateInput";
|
|
|
18
18
|
export {
|
|
19
19
|
y as D
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=date-input-
|
|
21
|
+
//# sourceMappingURL=date-input-B_EuP5sc.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input-
|
|
1
|
+
{"version":3,"file":"date-input-B_EuP5sc.es.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DateInputRootSlotProps } from \"./date-input.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dateInput\",\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const DateInputLeadingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"leadingElement\");\n\nexport const DateInputTrailingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trailingElement\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputLeadingElementSlot,\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n DateInputTrailingElementSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * # DateInput\n *\n * allows entering a date\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/dateinput}\n */\nexport const DateInput = (props: DateInputProps) => {\n const recipe = useRecipe({ recipe: dateInputSlotRecipe });\n const { leadingElement, trailingElement, ...rest } = props;\n const [recipeProps, recipeFreeProps] = recipe.splitVariantProps({ ...rest });\n const [styleProps, functionalProps] = extractStyleProps(recipeFreeProps);\n\n return (\n <DateInputRootSlot {...recipeProps} {...styleProps} asChild>\n <DateField {...functionalProps}>\n <>\n {leadingElement && (\n <DateInputLeadingElementSlot>\n {leadingElement}\n </DateInputLeadingElementSlot>\n )}\n <DateInputSegmentGroupSlot asChild>\n <DateInputField>\n {(segment) => (\n <DateInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </DateInputSegmentSlot>\n )}\n </DateInputField>\n </DateInputSegmentGroupSlot>\n {trailingElement && (\n <DateInputTrailingElementSlot>\n {trailingElement}\n </DateInputTrailingElementSlot>\n )}\n </>\n </DateField>\n </DateInputRootSlot>\n );\n};\n\nDateInput.displayName = \"DateInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DateInputRootSlot","DateInputLeadingElementSlot","DateInputTrailingElementSlot","DateInputSegmentGroupSlot","DateInputSegmentSlot","DateInput","props","recipe","useRecipe","dateInputSlotRecipe","leadingElement","trailingElement","rest","recipeProps","recipeFreeProps","styleProps","functionalProps","extractStyleProps","jsx","DateField","jsxs","Fragment","DateInputField","segment","DateSegment"],"mappings":";;;;;;AAOA,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,GCnBLO,IAAY,CAACC,MAA0B;AAClD,QAAMC,IAASC,EAAU,EAAE,QAAQC,GAAqB,GAClD,EAAE,gBAAAC,GAAgB,iBAAAC,GAAiB,GAAGC,MAASN,GAC/C,CAACO,GAAaC,CAAe,IAAIP,EAAO,kBAAkB,EAAE,GAAGK,GAAM,GACrE,CAACG,GAAYC,CAAe,IAAIC,EAAkBH,CAAe;AAEvE,SACE,gBAAAI,EAAClB,GAAA,EAAmB,GAAGa,GAAc,GAAGE,GAAY,SAAO,IACzD,UAAA,gBAAAG,EAACC,GAAA,EAAW,GAAGH,GACb,UAAA,gBAAAI,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAX,KACC,gBAAAQ,EAACjB,KACE,UAAAS,EAAA,CACH;AAAA,sBAEDP,GAAA,EAA0B,SAAO,IAChC,UAAA,gBAAAe,EAACI,KACE,UAAA,CAACC,MACA,gBAAAL,EAACd,GAAA,EAAqB,SAAO,IAC3B,UAAA,gBAAAc,EAACM,KAAY,SAAAD,EAAA,CAAkB,GACjC,GAEJ,EAAA,CACF;AAAA,IACCZ,KACC,gBAAAO,EAAChB,GAAA,EACE,UAAAS,EAAA,CACH;AAAA,EAAA,EAAA,CAEJ,GACF,GACF;AAEJ;AAEAN,EAAU,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { createSlotRecipeContext as S } from "@chakra-ui/react";
|
|
3
3
|
import { Close as y, CalendarMonth as D } from "@commercetools/nimbus-icons";
|
|
4
|
-
import { b as k, c as v } from "./DatePicker-
|
|
4
|
+
import { b as k, c as v } from "./DatePicker-D8m8YbnD.es.js";
|
|
5
5
|
import { $ as C, h as M } from "./Dialog-Qpq4hk89.es.js";
|
|
6
6
|
import { $ as I } from "./Group-BBaUrRF9.es.js";
|
|
7
7
|
import { useSlotRecipe as E } from "@chakra-ui/react/styled-system";
|
|
@@ -9,14 +9,14 @@ import { h as H } from "./index-CtB71yr7.es.js";
|
|
|
9
9
|
import { e as N } from "./extractStyleProps-DYXEhLtq.es.js";
|
|
10
10
|
import { useContext as x, useRef as T, useEffect as R } from "react";
|
|
11
11
|
import { defineMessages as V, FormattedMessage as w, useIntl as z } from "react-intl";
|
|
12
|
-
import { T as B } from "./time-input-
|
|
12
|
+
import { T as B } from "./time-input-CUEnTp-4.es.js";
|
|
13
13
|
import { Flex as F } from "@chakra-ui/react/flex";
|
|
14
14
|
import { T as j } from "./text-BgiP8ZB6.es.js";
|
|
15
15
|
import { $ as P } from "./Button-Dx3xzN8n.es.js";
|
|
16
16
|
import { e as A, d as G } from "./utils-Cyja2WdR.es.js";
|
|
17
|
-
import { d as L } from "./DateField-
|
|
18
|
-
import { D as O } from "./date-input-
|
|
19
|
-
import { C as q } from "./calendar-
|
|
17
|
+
import { d as L } from "./DateField-DmPAxSnT.es.js";
|
|
18
|
+
import { D as O } from "./date-input-B_EuP5sc.es.js";
|
|
19
|
+
import { C as q } from "./calendar-BkGJAIae.es.js";
|
|
20
20
|
import { B as W } from "./box-DuBoAZvq.es.js";
|
|
21
21
|
import { I as $ } from "./icon-button-DQS2apw-.es.js";
|
|
22
22
|
const { withProvider: Z, withContext: h } = /* @__PURE__ */ S({
|
|
@@ -217,4 +217,4 @@ _.displayName = "DatePicker";
|
|
|
217
217
|
export {
|
|
218
218
|
_ as D
|
|
219
219
|
};
|
|
220
|
-
//# sourceMappingURL=date-picker-
|
|
220
|
+
//# sourceMappingURL=date-picker-DFpgLG1U.es.js.map
|
|
@@ -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,gB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B,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-DFpgLG1U.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,g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AA,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-D8m8YbnD.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-CUEnTp-4.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-
|
|
17
|
-
import { R as L } from "./range-calendar-
|
|
18
|
-
import { D } from "./date-input-
|
|
16
|
+
import { d as H } from "./DateField-DmPAxSnT.es.js";
|
|
17
|
+
import { R as L } from "./range-calendar-D55DTDbA.es.js";
|
|
18
|
+
import { D } from "./date-input-B_EuP5sc.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-DVuIeQQd.es.js.map
|
package/dist/chunks/{date-range-picker-KRcGUZW-.es.js.map → date-range-picker-DVuIeQQd.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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AA,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-DVuIeQQd.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,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GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA2C,EAAgB,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-BqUFlw5R.cjs.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type {
|
|
1
|
+
{"version":3,"file":"group-BqUFlw5R.cjs.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { GroupRootSlotProps } from \"./group.types\";\n\nconst { withContext } = createRecipeContext({\n key: \"group\",\n});\n\n/**\n * Slot component that provides the styling context for the Group component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const GroupSlot: SlotComponent<typeof RaGroup, GroupRootSlotProps> =\n withContext<typeof RaGroup, GroupRootSlotProps>(RaGroup);\n","import { GroupSlot } from \"./group.slots\";\nimport type { GroupComponent } from \"./group.types\";\n\nexport const Group: GroupComponent = (props) => {\n const { ref, children, ...rest } = props;\n return (\n <GroupSlot ref={ref} {...rest}>\n {children}\n </GroupSlot>\n );\n};\n"],"names":["withContext","createRecipeContext","GroupSlot","RaGroup","Group","props","ref","children","rest","jsx"],"mappings":"qHAKM,CAAE,YAAAA,CAAA,EAAgBC,sBAAoB,CAC1C,IAAK,OACP,CAAC,EAMYC,EACXF,EAAgDG,2CAAO,ECX5CC,EAAyBC,GAAU,CAC9C,KAAM,CAAE,IAAAC,EAAK,SAAAC,EAAU,GAAGC,GAASH,EACnC,OACEI,EAAAA,IAACP,EAAA,CAAU,IAAAI,EAAW,GAAGE,EACtB,SAAAD,EACH,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-CWADf2vF.es.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type {
|
|
1
|
+
{"version":3,"file":"group-CWADf2vF.es.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { GroupRootSlotProps } from \"./group.types\";\n\nconst { withContext } = createRecipeContext({\n key: \"group\",\n});\n\n/**\n * Slot component that provides the styling context for the Group component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const GroupSlot: SlotComponent<typeof RaGroup, GroupRootSlotProps> =\n withContext<typeof RaGroup, GroupRootSlotProps>(RaGroup);\n","import { GroupSlot } from \"./group.slots\";\nimport type { GroupComponent } from \"./group.types\";\n\nexport const Group: GroupComponent = (props) => {\n const { ref, children, ...rest } = props;\n return (\n <GroupSlot ref={ref} {...rest}>\n {children}\n </GroupSlot>\n );\n};\n"],"names":["withContext","createRecipeContext","GroupSlot","RaGroup","Group","props","ref","children","rest","jsx"],"mappings":";;;AAKA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB;AAAA,EAC1C,KAAK;AACP,CAAC,GAMYC,IACX,gBAAAF,EAAgDG,CAAO,GCX5CC,IAAwB,CAACC,MAAU;AAC9C,QAAM,EAAE,KAAAC,GAAK,UAAAC,GAAU,GAAGC,MAASH;AACnC,SACE,gBAAAI,EAACP,GAAA,EAAU,KAAAI,GAAW,GAAGE,GACtB,UAAAD,GACH;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-CenxuChf.es.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type {
|
|
1
|
+
{"version":3,"file":"icon-CenxuChf.es.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { IconRootSlotProps } from \"./icon.types\";\n\nconst { withContext } = createRecipeContext({ key: \"icon\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const IconRootSlot: SlotComponent<SVGSVGElement, IconRootSlotProps> =\n withContext<SVGSVGElement, IconRootSlotProps>(\"svg\");\n","import { IconRootSlot } from \"./icon.slots\";\nimport type { IconProps } from \"./icon.types\";\n\n/**\n * # Icon\n *\n * displays icon components\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/icon}\n */\nexport const Icon = (props: IconProps) => {\n const { ref, ...restProps } = props;\n return <IconRootSlot ref={ref} asChild={!restProps.as} {...restProps} />;\n};\n\nIcon.displayName = \"Icon\";\n"],"names":["withContext","createRecipeContext","IconRootSlot","Icon","props","ref","restProps","jsx"],"mappings":";;AAIA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB,EAAE,KAAK,QAAQ,GAM9CC,IACX,gBAAAF,EAA8C,KAAK,GCDxCG,IAAO,CAACC,MAAqB;AACxC,QAAM,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAcF;AAC9B,SAAO,gBAAAG,EAACL,KAAa,KAAAG,GAAU,SAAS,CAACC,EAAU,IAAK,GAAGA,GAAW;AACxE;AAEAH,EAAK,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-D39U--jA.cjs.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type {
|
|
1
|
+
{"version":3,"file":"icon-D39U--jA.cjs.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { IconRootSlotProps } from \"./icon.types\";\n\nconst { withContext } = createRecipeContext({ key: \"icon\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const IconRootSlot: SlotComponent<SVGSVGElement, IconRootSlotProps> =\n withContext<SVGSVGElement, IconRootSlotProps>(\"svg\");\n","import { IconRootSlot } from \"./icon.slots\";\nimport type { IconProps } from \"./icon.types\";\n\n/**\n * # Icon\n *\n * displays icon components\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/icon}\n */\nexport const Icon = (props: IconProps) => {\n const { ref, ...restProps } = props;\n return <IconRootSlot ref={ref} asChild={!restProps.as} {...restProps} />;\n};\n\nIcon.displayName = \"Icon\";\n"],"names":["withContext","createRecipeContext","IconRootSlot","Icon","props","ref","restProps","jsx"],"mappings":"gFAIM,CAAE,YAAAA,CAAA,EAAgBC,EAAAA,oBAAoB,CAAE,IAAK,OAAQ,EAM9CC,EACXF,EAA8C,KAAK,ECDxCG,EAAQC,GAAqB,CACxC,KAAM,CAAE,IAAAC,EAAK,GAAGC,CAAA,EAAcF,EAC9B,OAAOG,EAAAA,IAACL,GAAa,IAAAG,EAAU,QAAS,CAACC,EAAU,GAAK,GAAGA,EAAW,CACxE,EAEAH,EAAK,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd-BaeV_DL-.cjs.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/utils
|
|
1
|
+
{"version":3,"file":"kbd-BaeV_DL-.cjs.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n */\ntype KbdRecipeProps = RecipeProps<\"kbd\"> & UnstyledProp;\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\nexport type KbdRootSlotProps = HTMLChakraProps<\"kbd\", KbdRecipeProps>;\n\nconst { withContext } = createRecipeContext({ key: \"kbd\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const KbdRootSlot: SlotComponent<HTMLElement, KbdRootSlotProps> =\n withContext<HTMLElement, KbdRootSlotProps>(\"kbd\");\n","import { KeyboardContext, useContextProps } from \"react-aria-components\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { type KbdProps as ChakraKbdProps } from \"@chakra-ui/react/kbd\";\nimport { useRef } from \"react\";\nimport type React from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { KbdRootSlot } from \"./kbd.slots\";\n\nexport type KbdProps = Omit<ChakraKbdProps, \"slot\"> & {\n ref?: React.Ref<HTMLElement>;\n slot?: string | null | undefined;\n};\n\n/**\n * # Kbd\n *\n * Renders a keyboard shortcut or key combination, styled for visual clarity.\n * Typically used to visually represent keyboard keys.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/typography/kbd}\n */\nexport const Kbd = ({ ref: forwardedRef, slot, ...props }: KbdProps) => {\n const localRef = useRef<HTMLElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n const [rest] = useContextProps(props, ref, KeyboardContext);\n\n return <KbdRootSlot ref={ref} slot={slot || undefined} {...rest} />;\n};\n"],"names":["withContext","createRecipeContext","KbdRootSlot","Kbd","forwardedRef","slot","props","localRef","useRef","ref","useObjectRef","mergeRefs","rest","useContextProps","KeyboardContext"],"mappings":"kQAqBM,CAAE,YAAAA,CAAA,EAAgBC,EAAAA,oBAAoB,CAAE,IAAK,MAAO,EAM7CC,EACXF,EAA2C,KAAK,ECPrCG,EAAM,CAAC,CAAE,IAAKC,EAAc,KAAAC,EAAM,GAAGC,KAAsB,CACtE,MAAMC,EAAWC,EAAAA,OAAoB,IAAI,EACnCC,EAAMC,EAAAA,0CAAaC,EAAAA,UAAUJ,EAAUH,CAAY,CAAC,EACpD,CAACQ,CAAI,EAAIC,EAAAA,0CAAgBP,EAAOG,EAAKK,EAAAA,yCAAe,EAE1D,aAAQZ,EAAA,CAAY,IAAAO,EAAU,KAAMJ,GAAQ,OAAY,GAAGO,EAAM,CACnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd-CH9rYghB.es.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/utils
|
|
1
|
+
{"version":3,"file":"kbd-CH9rYghB.es.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n */\ntype KbdRecipeProps = RecipeProps<\"kbd\"> & UnstyledProp;\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\nexport type KbdRootSlotProps = HTMLChakraProps<\"kbd\", KbdRecipeProps>;\n\nconst { withContext } = createRecipeContext({ key: \"kbd\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const KbdRootSlot: SlotComponent<HTMLElement, KbdRootSlotProps> =\n withContext<HTMLElement, KbdRootSlotProps>(\"kbd\");\n","import { KeyboardContext, useContextProps } from \"react-aria-components\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { type KbdProps as ChakraKbdProps } from \"@chakra-ui/react/kbd\";\nimport { useRef } from \"react\";\nimport type React from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { KbdRootSlot } from \"./kbd.slots\";\n\nexport type KbdProps = Omit<ChakraKbdProps, \"slot\"> & {\n ref?: React.Ref<HTMLElement>;\n slot?: string | null | undefined;\n};\n\n/**\n * # Kbd\n *\n * Renders a keyboard shortcut or key combination, styled for visual clarity.\n * Typically used to visually represent keyboard keys.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/typography/kbd}\n */\nexport const Kbd = ({ ref: forwardedRef, slot, ...props }: KbdProps) => {\n const localRef = useRef<HTMLElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n const [rest] = useContextProps(props, ref, KeyboardContext);\n\n return <KbdRootSlot ref={ref} slot={slot || undefined} {...rest} />;\n};\n"],"names":["withContext","createRecipeContext","KbdRootSlot","Kbd","forwardedRef","slot","props","localRef","useRef","ref","useObjectRef","mergeRefs","rest","useContextProps","KeyboardContext"],"mappings":";;;;;;;AAqBA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB,EAAE,KAAK,OAAO,GAM7CC,IACX,gBAAAF,EAA2C,KAAK,GCPrCG,IAAM,CAAC,EAAE,KAAKC,GAAc,MAAAC,GAAM,GAAGC,QAAsB;AACtE,QAAMC,IAAWC,EAAoB,IAAI,GACnCC,IAAMC,EAAaC,EAAUJ,GAAUH,CAAY,CAAC,GACpD,CAACQ,CAAI,IAAIC,EAAgBP,GAAOG,GAAKK,CAAe;AAE1D,2BAAQZ,GAAA,EAAY,KAAAO,GAAU,MAAMJ,KAAQ,QAAY,GAAGO,GAAM;AACnE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-D-vE6ZpM.es.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n MenuRootSlotProps,\n MenuTriggerSlotProps,\n MenuPopoverSlotProps,\n MenuContentSlotProps,\n MenuItemSlotProps,\n MenuSectionSlotProps,\n MenuSectionLabelSlotProps,\n MenuSubmenuSlotProps,\n} from \"./menu.types\";\nimport type { SlotComponent } from \"@/utils/slot-types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"menu\",\n});\n\n// Menu Root\nexport const MenuRootSlot: SlotComponent<HTMLDivElement, MenuRootSlotProps> =\n withProvider<HTMLDivElement, MenuRootSlotProps>(\"div\", \"root\");\n\n// Menu Trigger\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Section\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport const MenuSubmenuSlot = withContext<\n HTMLDivElement,\n MenuSubmenuSlotProps\n>(\"div\", \"submenu\");\n","import { createContext, useContext } from \"react\";\nimport type { MenuRootProps } from \"./../menu.types\";\nimport type { MenuTriggerProps as RaMenuTriggerProps } from \"react-aria-components\";\n\n// Context should contain all Menu props (excluding MenuTrigger-specific props)\nexport type MenuContextValue = Omit<\n MenuRootProps,\n keyof RaMenuTriggerProps | \"children\" | \"trigger\"\n>;\n\nconst MenuContext = createContext<MenuContextValue | undefined>(undefined);\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = () => {\n const context = useContext(MenuContext);\n return context;\n};\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { MenuTrigger as RaMenuTrigger } from \"react-aria-components\";\nimport type { MenuRootProps } from \"../menu.types\";\nimport { MenuRootSlot } from \"../menu.slots\";\nimport { MenuProvider } from \"./menu.context\";\n\nexport const MenuRoot = (props: MenuRootProps) => {\n const recipe = useSlotRecipe({ key: \"menu\" });\n const [recipeProps, functionalProps] = recipe.splitVariantProps(props);\n\n // Separate MenuTrigger props from Menu props\n const {\n children,\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n ...menuContextProps\n } = functionalProps;\n\n const menuTriggerProps = {\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n };\n\n return (\n <MenuRootSlot {...recipeProps} asChild>\n <RaMenuTrigger {...menuTriggerProps}>\n <MenuProvider value={menuContextProps}>{children}</MenuProvider>\n </RaMenuTrigger>\n </MenuRootSlot>\n );\n};\n\nMenuRoot.displayName = \"Menu.Root\";\n","import { Button } from \"react-aria-components\";\nimport { MenuTriggerSlot } from \"../menu.slots\";\nimport type { MenuTriggerProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuTrigger = ({\n children,\n asChild,\n ref,\n ...props\n}: MenuTriggerProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n /**\n * The user supplied a Button as the trigger\n */\n if (asChild) {\n // When asChild is true, apply styles to the child element\n return (\n <MenuTriggerSlot ref={ref} asChild {...styleProps}>\n {children as ReactNode}\n </MenuTriggerSlot>\n );\n }\n\n /**\n * The user did not supply a Button as trigger, use an unstyled button\n * to wrap which ever element the user supplied and make it a trigger\n */\n return (\n <MenuTriggerSlot asChild {...styleProps}>\n <Button ref={ref} {...restProps}>\n {children}\n </Button>\n </MenuTriggerSlot>\n );\n};\n\nMenuTrigger.displayName = \"Menu.Trigger\";\n","import { createContext, useContext } from \"react\";\n\nexport type MenuSectionContextValue = {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n};\n/**\n * Why is a second context (MenuSectionContext) needed?\n *\n * MenuSectionContext enables section-level config for menu items, such as\n * selection mode, which may differ from the global menu context. This allows\n * advanced menus where each section can have its own selection behavior\n * (e.g., one section is single-select, another is multi-select).\n * By scoping context to a section, menu items inherit settings from their\n * nearest section, falling back to the global menu context if not present.\n * This pattern improves flexibility and composability for complex menus,\n * and avoids prop drilling or awkward prop merging.\n */\n\nconst MenuSectionContext = createContext<MenuSectionContextValue | undefined>(\n undefined\n);\n\nexport const MenuSectionProvider = MenuSectionContext.Provider;\n\nexport const useMenuSectionContext = () => {\n return useContext(MenuSectionContext);\n};\n","import { Menu, Popover } from \"react-aria-components\";\nimport { MenuContentSlot, MenuPopoverSlot } from \"../menu.slots\";\nimport type { MenuContentProps } from \"../menu.types\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\n\nexport const MenuContent = ({\n children,\n placement: placementOverride,\n ref,\n}: MenuContentProps) => {\n const contextProps = useMenuContext();\n\n if (!contextProps) {\n throw new Error(\"Menu.Content must be used within Menu.Root\");\n }\n\n // Separate placement from other props since it's handled by Popover\n const { placement, ...menuProps } = contextProps;\n const finalPlacement = placementOverride || placement || \"bottom start\";\n\n return (\n <MenuSectionProvider value={{ selectionMode: menuProps.selectionMode }}>\n <MenuPopoverSlot asChild>\n <Popover placement={finalPlacement} offset={4} shouldFlip>\n <MenuContentSlot asChild>\n <Menu ref={ref} shouldFocusWrap autoFocus=\"first\" {...menuProps}>\n {children}\n </Menu>\n </MenuContentSlot>\n </Popover>\n </MenuPopoverSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuContent.displayName = \"Menu.Content\";\n","import { MenuItem as RaMenuItem } from \"react-aria-components\";\nimport { MenuItemSlot } from \"../menu.slots\";\nimport type { MenuItemProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { ChevronRight } from \"@commercetools/nimbus-icons\";\nimport { Icon } from \"@/components/icon\";\n\nexport const MenuItem = ({\n children,\n isCritical,\n ref,\n ...props\n}: MenuItemProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuItemSlot\n asChild\n {...styleProps}\n data-critical={isCritical ? \"\" : undefined}\n >\n <RaMenuItem ref={ref} {...restProps}>\n {({ hasSubmenu }) => (\n <>\n {children}\n {hasSubmenu && (\n <Icon slot=\"caretIcon\">\n <ChevronRight />\n </Icon>\n )}\n </>\n )}\n </RaMenuItem>\n </MenuItemSlot>\n );\n};\n\nMenuItem.displayName = \"Menu.Item\";\n","import { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallow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AAO,EAAE,eAAAsB,EAAA,GAC5B,UAAA,gBAAAhC,EAACnB,GAAA,EAAgB,SAAO,IAAE,GAAGwB,GAC3B,UAAA,gBAAAkB;AAAA,IAACe;AAAAA,IAAA;AAAA,MACC,KAAAlC;AAAA,MACA,eAAA4B;AAAA,MACA,cAAAC;AAAA,MACA,qBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,wBAAAC;AAAA,MACC,GAAGC;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAArC,EAAC2B,KAAkB,UAAAG,EAAA,CAAM;AAAA,QACxBC,IACC,gBAAA/B,EAACuC,GAAA,EAAW,OAAAR,GAAe,UAAArC,GAAS,IAEnCA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGP,EAAA,CACF;AAEJ;AAEAmC,EAAY,cAAc;ACtDnB,MAAMW,IAAqB,CAAC;AAAA,EACjC,UAAA9C;AAAA,EACA,GAAGL;AACL,MACS,gBAAAW,EAACyC,GAAA,EAAkB,GAAGpD,GAAQ,UAAAK,EAAA,CAAS;AAGhD8C,EAAmB,cAAc;ACP1B,MAAME,IAAc,CAAC,EAAE,UAAAhD,GAAU,GAAGL,0BAEtCsB,GAAA,EAAa,GAAGtB,GAAO,WAAU,OAC/B,UAAAK,GACH;AAIJgD,EAAY,cAAc;ACAnB,MAAMxB,KAAO;AAAA,EAClB,MAAM9B;AAAA,EACN,SAASc;AAAA,EACT,SAASS;AAAA,EACT,MAAMQ;AAAA,EACN,SAASU;AAAA,EACT,SAASa;AAAA,EACT,gBAAgBF;AAClB;"}
|
|
1
|
+
{"version":3,"file":"menu-D-vE6ZpM.es.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type {\n MenuRootSlotProps,\n MenuTriggerSlotProps,\n MenuPopoverSlotProps,\n MenuContentSlotProps,\n MenuItemSlotProps,\n MenuSectionSlotProps,\n MenuSectionLabelSlotProps,\n MenuSubmenuSlotProps,\n} from \"./menu.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"menu\",\n});\n\n// Menu Root\nexport const MenuRootSlot: SlotComponent<HTMLDivElement, MenuRootSlotProps> =\n withProvider<HTMLDivElement, MenuRootSlotProps>(\"div\", \"root\");\n\n// Menu Trigger\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Section\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport const MenuSubmenuSlot = withContext<\n HTMLDivElement,\n MenuSubmenuSlotProps\n>(\"div\", \"submenu\");\n","import { createContext, useContext } from \"react\";\nimport type { MenuRootProps } from \"./../menu.types\";\nimport type { MenuTriggerProps as RaMenuTriggerProps } from \"react-aria-components\";\n\n// Context should contain all Menu props (excluding MenuTrigger-specific props)\nexport type MenuContextValue = Omit<\n MenuRootProps,\n keyof RaMenuTriggerProps | \"children\" | \"trigger\"\n>;\n\nconst MenuContext = createContext<MenuContextValue | undefined>(undefined);\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = () => {\n const context = useContext(MenuContext);\n return context;\n};\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { MenuTrigger as RaMenuTrigger } from \"react-aria-components\";\nimport type { MenuRootProps } from \"../menu.types\";\nimport { MenuRootSlot } from \"../menu.slots\";\nimport { MenuProvider } from \"./menu.context\";\n\nexport const MenuRoot = (props: MenuRootProps) => {\n const recipe = useSlotRecipe({ key: \"menu\" });\n const [recipeProps, functionalProps] = recipe.splitVariantProps(props);\n\n // Separate MenuTrigger props from Menu props\n const {\n children,\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n ...menuContextProps\n } = functionalProps;\n\n const menuTriggerProps = {\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n };\n\n return (\n <MenuRootSlot {...recipeProps} asChild>\n <RaMenuTrigger {...menuTriggerProps}>\n <MenuProvider value={menuContextProps}>{children}</MenuProvider>\n </RaMenuTrigger>\n </MenuRootSlot>\n );\n};\n\nMenuRoot.displayName = \"Menu.Root\";\n","import { Button } from \"react-aria-components\";\nimport { MenuTriggerSlot } from \"../menu.slots\";\nimport type { MenuTriggerProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuTrigger = ({\n children,\n asChild,\n ref,\n ...props\n}: MenuTriggerProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n /**\n * The user supplied a Button as the trigger\n */\n if (asChild) {\n // When asChild is true, apply styles to the child element\n return (\n <MenuTriggerSlot ref={ref} asChild {...styleProps}>\n {children as ReactNode}\n </MenuTriggerSlot>\n );\n }\n\n /**\n * The user did not supply a Button as trigger, use an unstyled button\n * to wrap which ever element the user supplied and make it a trigger\n */\n return (\n <MenuTriggerSlot asChild {...styleProps}>\n <Button ref={ref} {...restProps}>\n {children}\n </Button>\n </MenuTriggerSlot>\n );\n};\n\nMenuTrigger.displayName = \"Menu.Trigger\";\n","import { createContext, useContext } from \"react\";\n\nexport type MenuSectionContextValue = {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n};\n/**\n * Why is a second context (MenuSectionContext) needed?\n *\n * MenuSectionContext enables section-level config for menu items, such as\n * selection mode, which may differ from the global menu context. This allows\n * advanced menus where each section can have its own selection behavior\n * (e.g., one section is single-select, another is multi-select).\n * By scoping context to a section, menu items inherit settings from their\n * nearest section, falling back to the global menu context if not present.\n * This pattern improves flexibility and composability for complex menus,\n * and avoids prop drilling or awkward prop merging.\n */\n\nconst MenuSectionContext = createContext<MenuSectionContextValue | undefined>(\n undefined\n);\n\nexport const MenuSectionProvider = MenuSectionContext.Provider;\n\nexport const useMenuSectionContext = () => {\n return useContext(MenuSectionContext);\n};\n","import { Menu, Popover } from \"react-aria-components\";\nimport { MenuContentSlot, MenuPopoverSlot } from \"../menu.slots\";\nimport type { MenuContentProps } from \"../menu.types\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\n\nexport const MenuContent = ({\n children,\n placement: placementOverride,\n ref,\n}: MenuContentProps) => {\n const contextProps = useMenuContext();\n\n if (!contextProps) {\n throw new Error(\"Menu.Content must be used within Menu.Root\");\n }\n\n // Separate placement from other props since it's handled by Popover\n const { placement, ...menuProps } = contextProps;\n const finalPlacement = placementOverride || placement || \"bottom start\";\n\n return (\n <MenuSectionProvider value={{ selectionMode: menuProps.selectionMode }}>\n <MenuPopoverSlot asChild>\n <Popover placement={finalPlacement} offset={4} shouldFlip>\n <MenuContentSlot asChild>\n <Menu ref={ref} shouldFocusWrap autoFocus=\"first\" {...menuProps}>\n {children}\n </Menu>\n </MenuContentSlot>\n </Popover>\n </MenuPopoverSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuContent.displayName = \"Menu.Content\";\n","import { MenuItem as RaMenuItem } from \"react-aria-components\";\nimport { MenuItemSlot } from \"../menu.slots\";\nimport type { MenuItemProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { ChevronRight } from \"@commercetools/nimbus-icons\";\nimport { Icon } from \"@/components/icon\";\n\nexport const MenuItem = ({\n children,\n isCritical,\n ref,\n ...props\n}: MenuItemProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuItemSlot\n asChild\n {...styleProps}\n data-critical={isCritical ? \"\" : undefined}\n >\n <RaMenuItem ref={ref} {...restProps}>\n {({ hasSubmenu }) => (\n <>\n {children}\n {hasSubmenu && (\n <Icon slot=\"caretIcon\">\n <ChevronRight />\n </Icon>\n )}\n </>\n )}\n </RaMenuItem>\n </MenuItemSlot>\n );\n};\n\nMenuItem.displayName = \"Menu.Item\";\n","import { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":";;;;;;;;;;;AAaA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAGYC,IACX,gBAAAH,EAAgD,OAAO,MAAM,GAGlDI,IAAkB,gBAAAH,EAG7B,UAAU,SAAS,GAGRI,IAAkB,gBAAAJ,EAG7B,OAAO,SAAS,GAGL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