@commercetools/nimbus 2.0.1-rc1 → 2.0.1-rc2
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/{Button-CrgZzRm9.es.js → Button-Dx3xzN8n.es.js} +2 -2
- package/dist/chunks/{Button-CrgZzRm9.es.js.map → Button-Dx3xzN8n.es.js.map} +1 -1
- package/dist/chunks/{DateField-qGypjFaJ.es.js → DateField-B-4ymU5i.es.js} +3 -3
- package/dist/chunks/{DateField-qGypjFaJ.es.js.map → DateField-B-4ymU5i.es.js.map} +1 -1
- package/dist/chunks/{DatePicker-Dn0LNd7V.es.js → DatePicker-ByxT1sNF.es.js} +6 -6
- package/dist/chunks/{DatePicker-Dn0LNd7V.es.js.map → DatePicker-ByxT1sNF.es.js.map} +1 -1
- package/dist/chunks/{Dialog-B2hCMJnM.es.js → Dialog-Qpq4hk89.es.js} +6 -6
- package/dist/chunks/{Dialog-B2hCMJnM.es.js.map → Dialog-Qpq4hk89.es.js.map} +1 -1
- package/dist/chunks/{Header-B4V0zxSN.es.js → Header-DFcQWjkP.es.js} +3 -3
- package/dist/chunks/{Header-B4V0zxSN.es.js.map → Header-DFcQWjkP.es.js.map} +1 -1
- package/dist/chunks/{Heading-CfiWDgRZ.es.js → Heading-DFiVmZUR.es.js} +4 -4
- package/dist/chunks/{Heading-CfiWDgRZ.es.js.map → Heading-DFiVmZUR.es.js.map} +1 -1
- package/dist/chunks/{ListBox-DAcVFwWW.es.js → ListBox-_1Uk-5-7.es.js} +6 -6
- package/dist/chunks/{ListBox-DAcVFwWW.es.js.map → ListBox-_1Uk-5-7.es.js.map} +1 -1
- package/dist/chunks/{ListKeyboardDelegate-D-k0fIME.es.js → ListKeyboardDelegate-ByRdSpOe.es.js} +2 -2
- package/dist/chunks/{ListKeyboardDelegate-D-k0fIME.es.js.map → ListKeyboardDelegate-ByRdSpOe.es.js.map} +1 -1
- package/dist/chunks/{Modal-D91zBjIP.es.js → Modal-DZrVgGsJ.es.js} +3 -3
- package/dist/chunks/{Modal-D91zBjIP.es.js.map → Modal-DZrVgGsJ.es.js.map} +1 -1
- package/dist/chunks/{SelectionManager-2q7N4psD.es.js → SelectionManager-DMLLo5N3.es.js} +3 -3
- package/dist/chunks/{SelectionManager-2q7N4psD.es.js.map → SelectionManager-DMLLo5N3.es.js.map} +1 -1
- package/dist/chunks/{ToggleButton-Cj9AtHpY.es.js → ToggleButton-881iW8P_.es.js} +2 -2
- package/dist/chunks/{ToggleButton-Cj9AtHpY.es.js.map → ToggleButton-881iW8P_.es.js.map} +1 -1
- package/dist/chunks/accordion-B2FLWAh5.cjs.js.map +1 -1
- package/dist/chunks/{accordion-DSLccfDW.es.js → accordion-CKDnNkVv.es.js} +2 -2
- package/dist/chunks/accordion-CKDnNkVv.es.js.map +1 -0
- package/dist/chunks/{alert-Cz2mnKir.es.js → alert-lNg0Rz2w.es.js} +2 -2
- package/dist/chunks/{alert-Cz2mnKir.es.js.map → alert-lNg0Rz2w.es.js.map} +1 -1
- package/dist/chunks/{button-Cnui897Z.es.js → button-IZUJaJku.es.js} +3 -3
- package/dist/chunks/{button-Cnui897Z.es.js.map → button-IZUJaJku.es.js.map} +1 -1
- package/dist/chunks/calendar-V0KeNCQ3.cjs.js.map +1 -1
- package/dist/chunks/{calendar-BTdHdh7y.es.js → calendar-lD6G93R9.es.js} +5 -5
- package/dist/chunks/calendar-lD6G93R9.es.js.map +1 -0
- package/dist/chunks/{checkbox-Bm4Yqa_0.es.js → checkbox-BB-WJdal.es.js} +3 -3
- package/dist/chunks/{checkbox-Bm4Yqa_0.es.js.map → checkbox-BB-WJdal.es.js.map} +1 -1
- package/dist/chunks/collapsible-motion-C7M_CLNI.cjs.js.map +1 -1
- package/dist/chunks/{collapsible-motion-OOUmjdKw.es.js → collapsible-motion-CSrKjF8X.es.js} +2 -2
- package/dist/chunks/collapsible-motion-CSrKjF8X.es.js.map +1 -0
- package/dist/chunks/combobox-B5UxZWSX.cjs.js.map +1 -1
- package/dist/chunks/{combobox-Ch4VokC9.es.js → combobox-D_7gr3DY.es.js} +13 -13
- package/dist/chunks/{combobox-Ch4VokC9.es.js.map → combobox-D_7gr3DY.es.js.map} +1 -1
- package/dist/chunks/{data-table-DC369pb3.es.js → data-table-ClMivKY1.es.js} +8 -8
- package/dist/chunks/{data-table-DC369pb3.es.js.map → data-table-ClMivKY1.es.js.map} +1 -1
- package/dist/chunks/{date-input-KVuRsFzs.es.js → date-input-Do1wXp3t.es.js} +2 -2
- package/dist/chunks/{date-input-KVuRsFzs.es.js.map → date-input-Do1wXp3t.es.js.map} +1 -1
- package/dist/chunks/{date-picker-C304WfAN.es.js → date-picker-ClYge74a.es.js} +9 -9
- package/dist/chunks/{date-picker-C304WfAN.es.js.map → date-picker-ClYge74a.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-CkRgcwfm.es.js → date-range-picker-KRcGUZW-.es.js} +9 -9
- package/dist/chunks/{date-range-picker-CkRgcwfm.es.js.map → date-range-picker-KRcGUZW-.es.js.map} +1 -1
- package/dist/chunks/{dialog-gTeRW6GK.es.js → dialog-BwtIcIvd.es.js} +2 -2
- package/dist/chunks/{dialog-gTeRW6GK.es.js.map → dialog-BwtIcIvd.es.js.map} +1 -1
- package/dist/chunks/{dialog.title-B9cEUH8w.es.js → dialog.title-CP_ZeiK4.es.js} +5 -5
- package/dist/chunks/{dialog.title-B9cEUH8w.es.js.map → dialog.title-CP_ZeiK4.es.js.map} +1 -1
- package/dist/chunks/{draggable-list-BIJ7t5ou.es.js → draggable-list-s43baxoM.es.js} +11 -11
- package/dist/chunks/{draggable-list-BIJ7t5ou.es.js.map → draggable-list-s43baxoM.es.js.map} +1 -1
- package/dist/chunks/{drawer-DKF34Nfc.es.js → drawer-BJ4qvGnj.es.js} +5 -5
- package/dist/chunks/{drawer-DKF34Nfc.es.js.map → drawer-BJ4qvGnj.es.js.map} +1 -1
- package/dist/chunks/{form-field-cRZo4WSf.es.js → form-field-BYlpCXdY.es.js} +3 -3
- package/dist/chunks/{form-field-cRZo4WSf.es.js.map → form-field-BYlpCXdY.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/{icon-button-9Ni8-hO7.es.js → icon-button-DQS2apw-.es.js} +2 -2
- package/dist/chunks/{icon-button-9Ni8-hO7.es.js.map → icon-button-DQS2apw-.es.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-Db8CLmE5.es.js → icon-toggle-button-Bi-9Obfx.es.js} +2 -2
- package/dist/chunks/{icon-toggle-button-Db8CLmE5.es.js.map → icon-toggle-button-Bi-9Obfx.es.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/{link-QwdgCWJd.es.js → link-BEhlSTUU.es.js} +3 -3
- package/dist/chunks/{link-QwdgCWJd.es.js.map → link-BEhlSTUU.es.js.map} +1 -1
- package/dist/chunks/{localized-field-pJSLdod5.es.js → localized-field-D3G0Uy7Z.es.js} +8 -8
- package/dist/chunks/{localized-field-pJSLdod5.es.js.map → localized-field-D3G0Uy7Z.es.js.map} +1 -1
- package/dist/chunks/{menu-4QTf2m-7.es.js → menu-D-vE6ZpM.es.js} +4 -4
- package/dist/chunks/menu-D-vE6ZpM.es.js.map +1 -0
- package/dist/chunks/menu-DIepV2KZ.cjs.js.map +1 -1
- package/dist/chunks/{money-input-BJpffXRR.es.js → money-input-sk0Slpeu.es.js} +3 -3
- package/dist/chunks/{money-input-BJpffXRR.es.js.map → money-input-sk0Slpeu.es.js.map} +1 -1
- package/dist/chunks/{nimbus-provider-BfpEKy6w.es.js → nimbus-provider-BHNFDQ0f.es.js} +5 -5
- package/dist/chunks/{nimbus-provider-BfpEKy6w.es.js.map → nimbus-provider-BHNFDQ0f.es.js.map} +1 -1
- package/dist/chunks/{number-input-DXiwgboS.es.js → number-input-CktMxOdZ.es.js} +2 -2
- package/dist/chunks/{number-input-DXiwgboS.es.js.map → number-input-CktMxOdZ.es.js.map} +1 -1
- package/dist/chunks/{openLink-DT8XzqFh.es.js → openLink-CY66vjvW.es.js} +3 -3
- package/dist/chunks/{openLink-DT8XzqFh.es.js.map → openLink-CY66vjvW.es.js.map} +1 -1
- package/dist/chunks/{pagination-Sq1twv0k.es.js → pagination-Bcq69Nv3.es.js} +4 -4
- package/dist/chunks/{pagination-Sq1twv0k.es.js.map → pagination-Bcq69Nv3.es.js.map} +1 -1
- package/dist/chunks/{password-input-CBhC_e5Z.es.js → password-input-6MO4I-2j.es.js} +2 -2
- package/dist/chunks/{password-input-CBhC_e5Z.es.js.map → password-input-6MO4I-2j.es.js.map} +1 -1
- package/dist/chunks/popover-CfEq5G5-.cjs.js.map +1 -1
- package/dist/chunks/{popover-Cz6TnNt_.es.js → popover-DNaC7CwB.es.js} +2 -2
- package/dist/chunks/popover-DNaC7CwB.es.js.map +1 -0
- package/dist/chunks/{radio-input-DhqS9ipf.es.js → radio-input-4jw6HUjC.es.js} +2 -2
- package/dist/chunks/{radio-input-DhqS9ipf.es.js.map → radio-input-4jw6HUjC.es.js.map} +1 -1
- package/dist/chunks/{range-calendar-RBEpLQJb.es.js → range-calendar-DBpl6y5i.es.js} +5 -5
- package/dist/chunks/range-calendar-DBpl6y5i.es.js.map +1 -0
- package/dist/chunks/range-calendar-_dZfAsdG.cjs.js.map +1 -1
- package/dist/chunks/{rich-text-input-CrjP71KM.es.js → rich-text-input-BC8CBVio.es.js} +5 -5
- package/dist/chunks/rich-text-input-BC8CBVio.es.js.map +1 -0
- package/dist/chunks/rich-text-input-Da5WFZ3l.cjs.js.map +1 -1
- package/dist/chunks/{search-input-DCpjVXVS.es.js → search-input-DJy2NHYW.es.js} +3 -3
- package/dist/chunks/{search-input-DCpjVXVS.es.js.map → search-input-DJy2NHYW.es.js.map} +1 -1
- package/dist/chunks/{select-xlqMXZuO.es.js → select-BmMhTBo-.es.js} +9 -9
- package/dist/chunks/{select-xlqMXZuO.es.js.map → select-BmMhTBo-.es.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-C5MmKuVW.es.js → split-button-BxyZmuNi.es.js} +4 -4
- package/dist/chunks/split-button-BxyZmuNi.es.js.map +1 -0
- package/dist/chunks/{switch-B5bEl91n.es.js → switch-01hEhL9A.es.js} +2 -2
- package/dist/chunks/switch-01hEhL9A.es.js.map +1 -0
- package/dist/chunks/switch-CdLhBEPq.cjs.js.map +1 -1
- package/dist/chunks/tabs-CJ0OAUSR.cjs.js.map +1 -1
- package/dist/chunks/{tabs-DGzmzlun.es.js → tabs-Dhte-RCe.es.js} +4 -4
- package/dist/chunks/{tabs-DGzmzlun.es.js.map → tabs-Dhte-RCe.es.js.map} +1 -1
- package/dist/chunks/tag-group-Btt0egzG.cjs.js.map +1 -1
- package/dist/chunks/{tag-group-pJFnuRoJ.es.js → tag-group-D2dgXSsV.es.js} +9 -9
- package/dist/chunks/{tag-group-pJFnuRoJ.es.js.map → tag-group-D2dgXSsV.es.js.map} +1 -1
- package/dist/chunks/{time-input-BUej1BjY.es.js → time-input-DDrB_c0M.es.js} +2 -2
- package/dist/chunks/{time-input-BUej1BjY.es.js.map → time-input-DDrB_c0M.es.js.map} +1 -1
- package/dist/chunks/{toggle-button-CPzjUSI_.es.js → toggle-button-awb1jBf8.es.js} +2 -2
- package/dist/chunks/{toggle-button-CPzjUSI_.es.js.map → toggle-button-awb1jBf8.es.js.map} +1 -1
- package/dist/chunks/{toggle-button-group-DOxjowig.es.js → toggle-button-group-Ce7ezOED.es.js} +2 -2
- package/dist/chunks/{toggle-button-group-DOxjowig.es.js.map → toggle-button-group-Ce7ezOED.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/{useButton-DkQVxdIF.es.js → useButton-_sJ3_8ha.es.js} +2 -2
- package/dist/chunks/{useButton-DkQVxdIF.es.js.map → useButton-_sJ3_8ha.es.js.map} +1 -1
- package/dist/chunks/{useDateFormatter-BkKCXbud.es.js → useDateFormatter-C4zVAL_K.es.js} +2 -2
- package/dist/chunks/{useDateFormatter-BkKCXbud.es.js.map → useDateFormatter-C4zVAL_K.es.js.map} +1 -1
- package/dist/chunks/{useGridListItem-Cosrmt8g.es.js → useGridListItem--iMluO7K.es.js} +4 -4
- package/dist/chunks/{useGridListItem-Cosrmt8g.es.js.map → useGridListItem--iMluO7K.es.js.map} +1 -1
- package/dist/chunks/{useListState-CUO8Wibt.es.js → useListState-Cf8n791-.es.js} +2 -2
- package/dist/chunks/{useListState-CUO8Wibt.es.js.map → useListState-Cf8n791-.es.js.map} +1 -1
- package/dist/chunks/{usePress-Bxb2-xLP.es.js → usePress-Dc6amhnJ.es.js} +2 -2
- package/dist/chunks/{usePress-Bxb2-xLP.es.js.map → usePress-Dc6amhnJ.es.js.map} +1 -1
- package/dist/chunks/{useSingleSelectListState-CnVWWOJD.es.js → useSingleSelectListState-DLY6K_dU.es.js} +2 -2
- package/dist/chunks/{useSingleSelectListState-CnVWWOJD.es.js.map → useSingleSelectListState-DLY6K_dU.es.js.map} +1 -1
- package/dist/chunks/{useToggle-CUMQAGyE.es.js → useToggle-CKEhqMIa.es.js} +2 -2
- package/dist/chunks/{useToggle-CUMQAGyE.es.js.map → useToggle-CKEhqMIa.es.js.map} +1 -1
- package/dist/components/accordion.es.js +1 -1
- package/dist/components/alert.es.js +1 -1
- package/dist/components/button.es.js +1 -1
- package/dist/components/calendar.es.js +1 -1
- package/dist/components/checkbox.es.js +1 -1
- package/dist/components/collapsible-motion.es.js +1 -1
- package/dist/components/combobox.es.js +1 -1
- package/dist/components/components.es.js +1 -1
- package/dist/components/data-table.es.js +1 -1
- package/dist/components/date-input.es.js +1 -1
- package/dist/components/date-picker.es.js +1 -1
- package/dist/components/date-range-picker.es.js +1 -1
- package/dist/components/dialog.es.js +1 -1
- package/dist/components/draggable-list.es.js +1 -1
- package/dist/components/drawer.es.js +1 -1
- package/dist/components/form-field.es.js +1 -1
- package/dist/components/icon-button.es.js +1 -1
- package/dist/components/icon-toggle-button.es.js +1 -1
- package/dist/components/link.es.js +1 -1
- package/dist/components/localized-field.es.js +1 -1
- package/dist/components/money-input.es.js +1 -1
- package/dist/components/nimbus-provider.es.js +1 -1
- package/dist/components/number-input.es.js +1 -1
- package/dist/components/pagination.es.js +1 -1
- package/dist/components/password-input.es.js +1 -1
- package/dist/components/popover.es.js +1 -1
- package/dist/components/radio-input.es.js +1 -1
- package/dist/components/range-calendar.es.js +1 -1
- package/dist/components/rich-text-input.es.js +1 -1
- package/dist/components/scoped-search-input.es.js +2 -2
- package/dist/components/search-input.es.js +1 -1
- package/dist/components/select.es.js +1 -1
- package/dist/components/split-button.es.js +1 -1
- package/dist/components/switch.es.js +1 -1
- package/dist/components/tabs.es.js +1 -1
- package/dist/components/tag-group.es.js +1 -1
- package/dist/components/time-input.es.js +1 -1
- package/dist/components/toggle-button-group.es.js +1 -1
- package/dist/components/toggle-button.es.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +34 -0
- package/dist/index.es.js +203 -198
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/accordion-DSLccfDW.es.js.map +0 -1
- package/dist/chunks/calendar-BTdHdh7y.es.js.map +0 -1
- package/dist/chunks/collapsible-motion-OOUmjdKw.es.js.map +0 -1
- package/dist/chunks/menu-4QTf2m-7.es.js.map +0 -1
- package/dist/chunks/popover-Cz6TnNt_.es.js.map +0 -1
- package/dist/chunks/range-calendar-RBEpLQJb.es.js.map +0 -1
- package/dist/chunks/rich-text-input-CrjP71KM.es.js.map +0 -1
- package/dist/chunks/split-button-C5MmKuVW.es.js.map +0 -1
- package/dist/chunks/switch-B5bEl91n.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-Sq1twv0k.es.js","sources":["../../src/components/pagination/hooks/use-pagination.ts","../../src/components/pagination/pagination.tsx"],"sourcesContent":["import { useState, useCallback, useMemo } from \"react\";\n\nexport type PaginationState = {\n /** Total number of items across all pages */\n totalItems: number;\n /** Current active page (1-based) */\n currentPage: number;\n /** Number of items displayed per page */\n pageSize: number;\n /** Total number of pages available */\n totalPages: number;\n /** Index of the first item on current page (1-based) */\n startItem: number;\n /** Index of the last item on current page (1-based) */\n endItem: number;\n /** Whether there is a previous page available */\n hasPreviousPage: boolean;\n /** Whether there is a next page available */\n hasNextPage: boolean;\n};\n\nexport type UsePaginationProps = {\n /** Total number of items to paginate */\n totalItems: number;\n /** Initial current page (1-based), defaults to 1 */\n currentPage?: number;\n /** Initial number of items per page, defaults to 10 */\n pageSize?: number;\n /** Callback fired when the current page changes */\n onPageChange?: (page: number) => void;\n /** Callback fired when the page size changes */\n onPageSizeChange?: (pageSize: number) => void;\n};\n\nexport type UsePaginationReturn = PaginationState & {\n /** Navigate to a specific page number (1-based) */\n goToPage: (page: number) => void;\n /** Navigate to the previous page, if available */\n goToPreviousPage: () => void;\n /** Navigate to the next page, if available */\n goToNextPage: () => void;\n /** Change the number of items displayed per page */\n setPageSize: (pageSize: number) => void;\n};\n\n/**\n * # usePagination\n *\n * Custom hook that provides pagination state management and navigation controls.\n *\n * Supports both controlled and uncontrolled modes:\n * - Controlled: Parent component manages currentPage state via props and callbacks\n * - Uncontrolled: Hook manages internal currentPage state automatically\n *\n * @param props - Configuration object for pagination behavior\n * @param props.totalItems - Total number of items to paginate\n * @param props.currentPage - Current page number (controlled mode). If undefined, uses uncontrolled mode\n * @param props.pageSize - Number of items per page (defaults to 20)\n * @param props.onPageChange - Callback fired when page changes\n * @param props.onPageSizeChange - Callback fired when page size changes\n *\n * @returns Object containing pagination state and navigation functions:\n * - totalItems: Total number of items\n * - currentPage: Current active page number (1-based)\n * - pageSize: Number of items per page\n * - totalPages: Total number of pages\n * - startItem: First item number on current page\n * - endItem: Last item number on current page\n * - hasPreviousPage: Whether previous page exists\n * - hasNextPage: Whether next page exists\n * - goToPage: Function to navigate to specific page\n * - goToPreviousPage: Function to navigate to previous page\n * - goToNextPage: Function to navigate to next page\n * - setPageSize: Function to change page size\n *\n */\nexport function usePagination({\n totalItems,\n currentPage: controlledCurrentPage,\n pageSize: controlledPageSize = 20,\n onPageChange,\n onPageSizeChange,\n}: UsePaginationProps): UsePaginationReturn {\n // Internal state for uncontrolled mode\n const [internalCurrentPage, setInternalCurrentPage] = useState(1);\n const [internalPageSize, setInternalPageSize] = useState(controlledPageSize);\n\n // Determine if controlled or uncontrolled\n const isControlled = controlledCurrentPage !== undefined;\n const currentPage = isControlled\n ? controlledCurrentPage\n : internalCurrentPage;\n const pageSize = controlledPageSize ?? internalPageSize;\n\n // Calculate pagination values\n const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));\n\n // Ensure currentPage is within valid bounds\n const validCurrentPage = Math.max(1, Math.min(currentPage, totalPages));\n\n const startItem = Math.min((validCurrentPage - 1) * pageSize + 1, totalItems);\n const endItem = Math.min(validCurrentPage * pageSize, totalItems);\n\n const hasPreviousPage = validCurrentPage > 1;\n const hasNextPage = validCurrentPage < totalPages;\n\n // Page navigation functions\n const goToPage = useCallback(\n (page: number) => {\n const newPage = Math.max(1, Math.min(page, totalPages));\n\n if (!isControlled) {\n setInternalCurrentPage(newPage);\n }\n\n onPageChange?.(newPage);\n },\n [totalPages, isControlled, onPageChange]\n );\n\n const goToPreviousPage = useCallback(() => {\n if (hasPreviousPage) {\n goToPage(validCurrentPage - 1);\n }\n }, [hasPreviousPage, validCurrentPage, goToPage]);\n\n const goToNextPage = useCallback(() => {\n if (hasNextPage) {\n goToPage(validCurrentPage + 1);\n }\n }, [hasNextPage, validCurrentPage, goToPage]);\n\n const setPageSize = useCallback(\n (newPageSize: number) => {\n const newTotalPages = Math.ceil(totalItems / newPageSize);\n const newPage = Math.min(validCurrentPage, newTotalPages);\n\n setInternalPageSize(newPageSize);\n\n if (!isControlled && newPage !== validCurrentPage) {\n setInternalCurrentPage(newPage);\n }\n\n onPageSizeChange?.(newPageSize);\n\n if (newPage !== validCurrentPage) {\n onPageChange?.(newPage);\n }\n },\n [totalItems, validCurrentPage, isControlled, onPageChange, onPageSizeChange]\n );\n\n return useMemo(\n () => ({\n totalItems,\n currentPage: validCurrentPage,\n pageSize,\n totalPages,\n startItem,\n endItem,\n hasPreviousPage,\n hasNextPage,\n goToPage,\n goToPreviousPage,\n goToNextPage,\n setPageSize,\n }),\n [\n totalItems,\n validCurrentPage,\n pageSize,\n totalPages,\n startItem,\n endItem,\n hasPreviousPage,\n hasNextPage,\n goToPage,\n goToPreviousPage,\n goToNextPage,\n setPageSize,\n ]\n );\n}\n","import { useMemo } from \"react\";\nimport { ChevronLeft, ChevronRight } from \"@commercetools/nimbus-icons\";\nimport {\n Flex,\n IconButton,\n NumberInput,\n Select,\n Stack,\n Text,\n} from \"@/components\";\nimport { usePagination } from \"./hooks/use-pagination\";\nimport type { PaginationProps } from \"./pagination.types\";\n\n/**\n * # Pagination\n *\n * A component that allows users to navigate through pages and control page size.\n * Combines a page size selector and page navigator for comprehensive pagination control.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/pagination}\n */\nexport const Pagination = (props: PaginationProps) => {\n const {\n totalItems,\n currentPage,\n pageSize,\n pageSizeOptions = [10, 20, 50, 100],\n onPageChange,\n onPageSizeChange,\n \"aria-label\": ariaLabel = \"Pagination\",\n enablePageInput = true,\n enablePageSizeSelector = true,\n } = props;\n\n const pagination = usePagination({\n totalItems,\n currentPage,\n pageSize,\n onPageChange,\n onPageSizeChange,\n });\n\n // Prepare page size options for select\n const pageSizeSelectOptions = useMemo(\n () =>\n pageSizeOptions.map((size) => ({\n id: size.toString(),\n name: `${size}`,\n })),\n [pageSizeOptions]\n );\n\n const handlePageSizeChange = (key: React.Key | null) => {\n if (key) {\n const newPageSize = parseInt(key.toString(), 10);\n pagination.setPageSize(newPageSize);\n }\n };\n\n return (\n <Stack gap=\"400\" direction={{ base: \"column\", sm: \"row\" }} align=\"center\">\n {/* Page Size Selector */}\n {enablePageSizeSelector && (\n <Flex align=\"center\" gap=\"200\">\n <Select.Root\n isClearable={false}\n selectedKey={pagination.pageSize.toString()}\n onSelectionChange={handlePageSizeChange}\n aria-label=\"Items per page\"\n >\n <Select.Options>\n {pageSizeSelectOptions.map((option) => (\n <Select.Option key={option.id} id={option.id}>\n {option.name}\n </Select.Option>\n ))}\n </Select.Options>\n </Select.Root>\n <Text color=\"neutral.12\">items per page</Text>\n </Flex>\n )}\n <Flex flexGrow=\"1\" />\n {/* Page Navigator */}\n <Flex align=\"center\" gap=\"200\" role=\"navigation\" aria-label={ariaLabel}>\n <IconButton\n onClick={pagination.goToPreviousPage}\n isDisabled={!pagination.hasPreviousPage}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label=\"Go to previous page\"\n >\n <ChevronLeft />\n </IconButton>\n\n <Flex align=\"center\" gap=\"200\">\n <Text color=\"neutral.12\">Page</Text>\n {enablePageInput ? (\n <NumberInput\n value={pagination.currentPage}\n onChange={(value: number | undefined) =>\n pagination.goToPage(value || 1)\n }\n minValue={1}\n maxValue={pagination.totalPages}\n step={1}\n isDisabled={false}\n width=\"9ch\"\n aria-label=\"Current page\"\n aria-current=\"page\"\n />\n ) : (\n <Text fontWeight=\"semibold\" color=\"neutral.12\" aria-current=\"page\">\n {pagination.currentPage}\n </Text>\n )}\n <Text color=\"neutral.12\">\n of {pagination.totalPages.toLocaleString()}\n </Text>\n </Flex>\n\n <IconButton\n onClick={pagination.goToNextPage}\n isDisabled={!pagination.hasNextPage}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label=\"Go to next page\"\n >\n <ChevronRight />\n </IconButton>\n </Flex>\n </Stack>\n );\n};\n\n// Manually assign a displayName for debugging purposes\nPagination.displayName = \"Pagination\";\n"],"names":["usePagination","totalItems","controlledCurrentPage","controlledPageSize","onPageChange","onPageSizeChange","internalCurrentPage","setInternalCurrentPage","useState","internalPageSize","setInternalPageSize","isControlled","currentPage","pageSize","totalPages","validCurrentPage","startItem","endItem","hasPreviousPage","hasNextPage","goToPage","useCallback","page","newPage","goToPreviousPage","goToNextPage","setPageSize","newPageSize","newTotalPages","useMemo","Pagination","props","pageSizeOptions","ariaLabel","enablePageInput","enablePageSizeSelector","pagination","pageSizeSelectOptions","size","handlePageSizeChange","key","jsxs","Stack","Flex","jsx","Select","option","Text","IconButton","ChevronLeft","NumberInput","value","ChevronRight"],"mappings":";;;;;;;;;AA4EO,SAASA,EAAc;AAAA,EAC5B,YAAAC;AAAA,EACA,aAAaC;AAAA,EACb,UAAUC,IAAqB;AAAA,EAC/B,cAAAC;AAAA,EACA,kBAAAC;AACF,GAA4C;AAE1C,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAS,CAAC,GAC1D,CAACC,GAAkBC,CAAmB,IAAIF,EAASL,CAAkB,GAGrEQ,IAAeT,MAA0B,QACzCU,IAAcD,IAChBT,IACAI,GACEO,IAAWV,KAAsBM,GAGjCK,IAAa,KAAK,IAAI,GAAG,KAAK,KAAKb,IAAaY,CAAQ,CAAC,GAGzDE,IAAmB,KAAK,IAAI,GAAG,KAAK,IAAIH,GAAaE,CAAU,CAAC,GAEhEE,IAAY,KAAK,KAAKD,IAAmB,KAAKF,IAAW,GAAGZ,CAAU,GACtEgB,IAAU,KAAK,IAAIF,IAAmBF,GAAUZ,CAAU,GAE1DiB,IAAkBH,IAAmB,GACrCI,IAAcJ,IAAmBD,GAGjCM,IAAWC;AAAA,IACf,CAACC,MAAiB;AAChB,YAAMC,IAAU,KAAK,IAAI,GAAG,KAAK,IAAID,GAAMR,CAAU,CAAC;AAEtD,MAAKH,KACHJ,EAA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AW;AAAA,UAEX,4BAACgB,GAAA,CAAA,CAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AAGAtB,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"pagination-Bcq69Nv3.es.js","sources":["../../src/components/pagination/hooks/use-pagination.ts","../../src/components/pagination/pagination.tsx"],"sourcesContent":["import { useState, useCallback, useMemo } from \"react\";\n\nexport type PaginationState = {\n /** Total number of items across all pages */\n totalItems: number;\n /** Current active page (1-based) */\n currentPage: number;\n /** Number of items displayed per page */\n pageSize: number;\n /** Total number of pages available */\n totalPages: number;\n /** Index of the first item on current page (1-based) */\n startItem: number;\n /** Index of the last item on current page (1-based) */\n endItem: number;\n /** Whether there is a previous page available */\n hasPreviousPage: boolean;\n /** Whether there is a next page available */\n hasNextPage: boolean;\n};\n\nexport type UsePaginationProps = {\n /** Total number of items to paginate */\n totalItems: number;\n /** Initial current page (1-based), defaults to 1 */\n currentPage?: number;\n /** Initial number of items per page, defaults to 10 */\n pageSize?: number;\n /** Callback fired when the current page changes */\n onPageChange?: (page: number) => void;\n /** Callback fired when the page size changes */\n onPageSizeChange?: (pageSize: number) => void;\n};\n\nexport type UsePaginationReturn = PaginationState & {\n /** Navigate to a specific page number (1-based) */\n goToPage: (page: number) => void;\n /** Navigate to the previous page, if available */\n goToPreviousPage: () => void;\n /** Navigate to the next page, if available */\n goToNextPage: () => void;\n /** Change the number of items displayed per page */\n setPageSize: (pageSize: number) => void;\n};\n\n/**\n * # usePagination\n *\n * Custom hook that provides pagination state management and navigation controls.\n *\n * Supports both controlled and uncontrolled modes:\n * - Controlled: Parent component manages currentPage state via props and callbacks\n * - Uncontrolled: Hook manages internal currentPage state automatically\n *\n * @param props - Configuration object for pagination behavior\n * @param props.totalItems - Total number of items to paginate\n * @param props.currentPage - Current page number (controlled mode). If undefined, uses uncontrolled mode\n * @param props.pageSize - Number of items per page (defaults to 20)\n * @param props.onPageChange - Callback fired when page changes\n * @param props.onPageSizeChange - Callback fired when page size changes\n *\n * @returns Object containing pagination state and navigation functions:\n * - totalItems: Total number of items\n * - currentPage: Current active page number (1-based)\n * - pageSize: Number of items per page\n * - totalPages: Total number of pages\n * - startItem: First item number on current page\n * - endItem: Last item number on current page\n * - hasPreviousPage: Whether previous page exists\n * - hasNextPage: Whether next page exists\n * - goToPage: Function to navigate to specific page\n * - goToPreviousPage: Function to navigate to previous page\n * - goToNextPage: Function to navigate to next page\n * - setPageSize: Function to change page size\n *\n */\nexport function usePagination({\n totalItems,\n currentPage: controlledCurrentPage,\n pageSize: controlledPageSize = 20,\n onPageChange,\n onPageSizeChange,\n}: UsePaginationProps): UsePaginationReturn {\n // Internal state for uncontrolled mode\n const [internalCurrentPage, setInternalCurrentPage] = useState(1);\n const [internalPageSize, setInternalPageSize] = useState(controlledPageSize);\n\n // Determine if controlled or uncontrolled\n const isControlled = controlledCurrentPage !== undefined;\n const currentPage = isControlled\n ? controlledCurrentPage\n : internalCurrentPage;\n const pageSize = controlledPageSize ?? internalPageSize;\n\n // Calculate pagination values\n const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));\n\n // Ensure currentPage is within valid bounds\n const validCurrentPage = Math.max(1, Math.min(currentPage, totalPages));\n\n const startItem = Math.min((validCurrentPage - 1) * pageSize + 1, totalItems);\n const endItem = Math.min(validCurrentPage * pageSize, totalItems);\n\n const hasPreviousPage = validCurrentPage > 1;\n const hasNextPage = validCurrentPage < totalPages;\n\n // Page navigation functions\n const goToPage = useCallback(\n (page: number) => {\n const newPage = Math.max(1, Math.min(page, totalPages));\n\n if (!isControlled) {\n setInternalCurrentPage(newPage);\n }\n\n onPageChange?.(newPage);\n },\n [totalPages, isControlled, onPageChange]\n );\n\n const goToPreviousPage = useCallback(() => {\n if (hasPreviousPage) {\n goToPage(validCurrentPage - 1);\n }\n }, [hasPreviousPage, validCurrentPage, goToPage]);\n\n const goToNextPage = useCallback(() => {\n if (hasNextPage) {\n goToPage(validCurrentPage + 1);\n }\n }, [hasNextPage, validCurrentPage, goToPage]);\n\n const setPageSize = useCallback(\n (newPageSize: number) => {\n const newTotalPages = Math.ceil(totalItems / newPageSize);\n const newPage = Math.min(validCurrentPage, newTotalPages);\n\n setInternalPageSize(newPageSize);\n\n if (!isControlled && newPage !== validCurrentPage) {\n setInternalCurrentPage(newPage);\n }\n\n onPageSizeChange?.(newPageSize);\n\n if (newPage !== validCurrentPage) {\n onPageChange?.(newPage);\n }\n },\n [totalItems, validCurrentPage, isControlled, onPageChange, onPageSizeChange]\n );\n\n return useMemo(\n () => ({\n totalItems,\n currentPage: validCurrentPage,\n pageSize,\n totalPages,\n startItem,\n endItem,\n hasPreviousPage,\n hasNextPage,\n goToPage,\n goToPreviousPage,\n goToNextPage,\n setPageSize,\n }),\n [\n totalItems,\n validCurrentPage,\n pageSize,\n totalPages,\n startItem,\n endItem,\n hasPreviousPage,\n hasNextPage,\n goToPage,\n goToPreviousPage,\n goToNextPage,\n setPageSize,\n ]\n );\n}\n","import { useMemo } from \"react\";\nimport { ChevronLeft, ChevronRight } from \"@commercetools/nimbus-icons\";\nimport {\n Flex,\n IconButton,\n NumberInput,\n Select,\n Stack,\n Text,\n} from \"@/components\";\nimport { usePagination } from \"./hooks/use-pagination\";\nimport type { PaginationProps } from \"./pagination.types\";\n\n/**\n * # Pagination\n *\n * A component that allows users to navigate through pages and control page size.\n * Combines a page size selector and page navigator for comprehensive pagination control.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/pagination}\n */\nexport const Pagination = (props: PaginationProps) => {\n const {\n totalItems,\n currentPage,\n pageSize,\n pageSizeOptions = [10, 20, 50, 100],\n onPageChange,\n onPageSizeChange,\n \"aria-label\": ariaLabel = \"Pagination\",\n enablePageInput = true,\n enablePageSizeSelector = true,\n } = props;\n\n const pagination = usePagination({\n totalItems,\n currentPage,\n pageSize,\n onPageChange,\n onPageSizeChange,\n });\n\n // Prepare page size options for select\n const pageSizeSelectOptions = useMemo(\n () =>\n pageSizeOptions.map((size) => ({\n id: size.toString(),\n name: `${size}`,\n })),\n [pageSizeOptions]\n );\n\n const handlePageSizeChange = (key: React.Key | null) => {\n if (key) {\n const newPageSize = parseInt(key.toString(), 10);\n pagination.setPageSize(newPageSize);\n }\n };\n\n return (\n <Stack gap=\"400\" direction={{ base: \"column\", sm: \"row\" }} align=\"center\">\n {/* Page Size Selector */}\n {enablePageSizeSelector && (\n <Flex align=\"center\" gap=\"200\">\n <Select.Root\n isClearable={false}\n selectedKey={pagination.pageSize.toString()}\n onSelectionChange={handlePageSizeChange}\n aria-label=\"Items per page\"\n >\n <Select.Options>\n {pageSizeSelectOptions.map((option) => (\n <Select.Option key={option.id} id={option.id}>\n {option.name}\n </Select.Option>\n ))}\n </Select.Options>\n </Select.Root>\n <Text color=\"neutral.12\">items per page</Text>\n </Flex>\n )}\n <Flex flexGrow=\"1\" />\n {/* Page Navigator */}\n <Flex align=\"center\" gap=\"200\" role=\"navigation\" aria-label={ariaLabel}>\n <IconButton\n onClick={pagination.goToPreviousPage}\n isDisabled={!pagination.hasPreviousPage}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label=\"Go to previous page\"\n >\n <ChevronLeft />\n </IconButton>\n\n <Flex align=\"center\" gap=\"200\">\n <Text color=\"neutral.12\">Page</Text>\n {enablePageInput ? (\n <NumberInput\n value={pagination.currentPage}\n onChange={(value: number | undefined) =>\n pagination.goToPage(value || 1)\n }\n minValue={1}\n maxValue={pagination.totalPages}\n step={1}\n isDisabled={false}\n width=\"9ch\"\n aria-label=\"Current page\"\n aria-current=\"page\"\n />\n ) : (\n <Text fontWeight=\"semibold\" color=\"neutral.12\" aria-current=\"page\">\n {pagination.currentPage}\n </Text>\n )}\n <Text color=\"neutral.12\">\n of {pagination.totalPages.toLocaleString()}\n </Text>\n </Flex>\n\n <IconButton\n onClick={pagination.goToNextPage}\n isDisabled={!pagination.hasNextPage}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label=\"Go to next page\"\n >\n <ChevronRight />\n </IconButton>\n </Flex>\n </Stack>\n );\n};\n\n// Manually assign a displayName for debugging purposes\nPagination.displayName = \"Pagination\";\n"],"names":["usePagination","totalItems","controlledCurrentPage","controlledPageSize","onPageChange","onPageSizeChange","internalCurrentPage","setInternalCurrentPage","useState","internalPageSize","setInternalPageSize","isControlled","currentPage","pageSize","totalPages","validCurrentPage","startItem","endItem","hasPreviousPage","hasNextPage","goToPage","useCallback","page","newPage","goToPreviousPage","goToNextPage","setPageSize","newPageSize","newTotalPages","useMemo","Pagination","props","pageSizeOptions","ariaLabel","enablePageInput","enablePageSizeSelector","pagination","pageSizeSelectOptions","size","handlePageSizeChange","key","jsxs","Stack","Flex","jsx","Select","option","Text","IconButton","ChevronLeft","NumberInput","value","ChevronRight"],"mappings":";;;;;;;;;AA4EO,SAASA,EAAc;AAAA,EAC5B,YAAAC;AAAA,EACA,aAAaC;AAAA,EACb,UAAUC,IAAqB;AAAA,EAC/B,cAAAC;AAAA,EACA,kBAAAC;AACF,GAA4C;AAE1C,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAS,CAAC,GAC1D,CAACC,GAAkBC,CAAmB,IAAIF,EAASL,CAAkB,GAGrEQ,IAAeT,MAA0B,QACzCU,IAAcD,IAChBT,IACAI,GACEO,IAAWV,KAAsBM,GAGjCK,IAAa,KAAK,IAAI,GAAG,KAAK,KAAKb,IAAaY,CAAQ,CAAC,GAGzDE,IAAmB,KAAK,IAAI,GAAG,KAAK,IAAIH,GAAaE,CAAU,CAAC,GAEhEE,IAAY,KAAK,KAAKD,IAAmB,KAAKF,IAAW,GAAGZ,CAAU,GACtEgB,IAAU,KAAK,IAAIF,IAAmBF,GAAUZ,CAAU,GAE1DiB,IAAkBH,IAAmB,GACrCI,IAAcJ,IAAmBD,GAGjCM,IAAWC;AAAA,IACf,CAACC,MAAiB;AAChB,YAAMC,IAAU,KAAK,IAAI,GAAG,KAAK,IAAID,GAAMR,CAAU,CAAC;AAEtD,MAAKH,KACHJ,EAAuBgB,C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A,UAEX,4BAACgB,GAAA,CAAA,CAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AAGAtB,EAAW,cAAc;"}
|
|
@@ -4,7 +4,7 @@ import { T as f } from "./text-input-CSAODlCw.es.js";
|
|
|
4
4
|
import { VisibilityOff as h, Visibility as u } from "@commercetools/nimbus-icons";
|
|
5
5
|
import { defineMessages as b, useIntl as c, FormattedMessage as g } from "react-intl";
|
|
6
6
|
import { b as r } from "./tooltip-sgakxhiy.es.js";
|
|
7
|
-
import { I } from "./icon-button-
|
|
7
|
+
import { I } from "./icon-button-DQS2apw-.es.js";
|
|
8
8
|
const t = /* @__PURE__ */ b({
|
|
9
9
|
hide: {
|
|
10
10
|
id: "Nimbus.PasswordInput.hide",
|
|
@@ -51,4 +51,4 @@ P.displayName = "PasswordInput";
|
|
|
51
51
|
export {
|
|
52
52
|
P
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=password-input-
|
|
54
|
+
//# sourceMappingURL=password-input-6MO4I-2j.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-input-
|
|
1
|
+
{"version":3,"file":"password-input-6MO4I-2j.es.js","sources":["../../src/components/password-input/password-input.i18n.ts","../../src/components/password-input/password-input.tsx"],"sourcesContent":["import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n hide: {\n id: \"Nimbus.PasswordInput.hide\",\n description: \"aria-label & tooltip for hide password button\",\n defaultMessage: \"Hide password\",\n },\n show: {\n id: \"Nimbus.PasswordInput.show\",\n description: \"aria-label & tooltip for show password button\",\n defaultMessage: \"Show password\",\n },\n});\n","import { useState } from \"react\";\nimport { IconButton, Tooltip } from \"@/components\";\nimport { TextInput } from \"@/components/text-input\";\nimport { Visibility, VisibilityOff } from \"@commercetools/nimbus-icons\";\nimport type { PasswordInputProps } from \"./password-input.types\";\nimport { FormattedMessage, useIntl } from \"react-intl\";\nimport messages from \"./password-input.i18n\";\n\n/**\n * # PasswordInput\n *\n * A password input is a text field that hides entered characters for secure password entry.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/passwordinput}\n */\nexport const PasswordInput = (props: PasswordInputProps) => {\n const { ref, size = \"md\", isDisabled } = props;\n\n const intl = useIntl();\n const [showPassword, setShowPassword] = useState(false);\n\n const toggleVisibility = () => setShowPassword(!showPassword);\n\n return (\n <TextInput\n ref={ref}\n {...props}\n trailingElement={\n <Tooltip.Root>\n <IconButton\n size={size === \"md\" ? \"xs\" : \"2xs\"}\n variant=\"ghost\"\n tone=\"primary\"\n aria-label={\n showPassword\n ? intl.formatMessage(messages.hide)\n : intl.formatMessage(messages.show)\n }\n onPress={toggleVisibility}\n isDisabled={isDisabled}\n >\n {showPassword ? <VisibilityOff /> : <Visibility />}\n </IconButton>\n <Tooltip.Content>\n <FormattedMessage\n {...(showPassword ? messages.hide : messages.show)}\n />\n </Tooltip.Content>\n </Tooltip.Root>\n }\n type={showPassword ? \"text\" : \"password\"}\n />\n );\n};\n\nPasswordInput.displayName = \"PasswordInput\";\n"],"names":["messages","defineMessages","PasswordInput","props","ref","size","isDisabled","intl","useIntl","showPassword","setShowPassword","useState","toggleVisibility","jsx","TextInput","jsxs","Tooltip","IconButton","VisibilityOff","Visibility","FormattedMessage"],"mappings":";;;;;;;AAEA,MAAAA,IAAe,gBAAAC,EAAe;AAAA,EAC5B,MAAM;AAAA,IACJ,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,MAAM;AAAA,IACJ,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAEpB,CAAC,GCEYC,IAAgB,CAACC,MAA8B;AAC1D,QAAM,EAAE,KAAAC,GAAK,MAAAC,IAAO,MAAM,YAAAC,MAAeH,GAEnCI,IAAOC,EAAA,GACP,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK,GAEhDC,IAAmB,MAAMF,EAAgB,CAACD,CAAY;AAE5D,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAV;AAAA,MACC,GAAGD;AAAA,MACJ,iBACE,gBAAAY,EAACC,EAAQ,MAAR,EACC,UAAA;AAAA,QAAA,gBAAAH;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAMZ,MAAS,OAAO,OAAO;AAAA,YAC7B,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,cACEI,IACIF,EAAK,cAAcP,EAAS,IAAI,IAChCO,EAAK,cAAcP,EAAS,IAAI;AAAA,YAEtC,SAASY;AAAA,YACT,YAAAN;AAAA,YAEC,UAAAG,IAAe,gBAAAI,EAACK,GAAA,CAAA,CAAc,sBAAMC,GAAA,CAAA,CAAW;AAAA,UAAA;AAAA,QAAA;AAAA,QAElD,gBAAAN,EAACG,EAAQ,SAAR,EACC,UAAA,gBAAAH;AAAA,UAACO;AAAA,UAAA;AAAA,YACE,GAAIX,IAAeT,EAAS,OAAOA,EAAS;AAAA,UAAA;AAAA,QAAA,EAC/C,CACF;AAAA,MAAA,GACF;AAAA,MAEF,MAAMS,IAAe,SAAS;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAP,EAAc,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-CfEq5G5-.cjs.js","sources":["../../src/components/popover/popover.slots.tsx","../../src/components/popover/popover.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Popover as RaPopover } from \"react-aria-components\";\nimport type { PopoverProps } from \"./popover.types\";\nimport type { SlotComponent } from \"
|
|
1
|
+
{"version":3,"file":"popover-CfEq5G5-.cjs.js","sources":["../../src/components/popover/popover.slots.tsx","../../src/components/popover/popover.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Popover as RaPopover } from \"react-aria-components\";\nimport type { PopoverProps } from \"./popover.types\";\nimport type { SlotComponent } from \"@/utils/slot-types\";\n\nconst { withContext } = createRecipeContext({\n key: \"popover\",\n});\n\nexport const PopoverRootSlot: SlotComponent<typeof RaPopover, PopoverProps> =\n withContext<typeof RaPopover, PopoverProps>(RaPopover);\n","import { PopoverRootSlot } from \"./popover.slots\";\nimport type { PopoverProps } from \"./popover.types\";\n\n/**\n * # Popover\n *\n * A component that displays floating content in relation to a trigger element.\n *\n * Note this component is only used internally.\n */\nexport const Popover = (props: PopoverProps) => {\n const { children, ...rest } = props;\n\n return <PopoverRootSlot {...rest}>{children}</PopoverRootSlot>;\n};\n\nPopover.displayName = \"Popover\";\n"],"names":["withContext","createRecipeContext","PopoverRootSlot","RaPopover","Popover","props","children","rest","jsx"],"mappings":"sHAKM,CAAE,YAAAA,CAAA,EAAgBC,sBAAoB,CAC1C,IAAK,SACP,CAAC,EAEYC,EACXF,EAA4CG,2CAAS,ECA1CC,EAAWC,GAAwB,CAC9C,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAA,EAASF,EAE9B,OAAOG,EAAAA,IAACN,EAAA,CAAiB,GAAGK,EAAO,SAAAD,CAAA,CAAS,CAC9C,EAEAF,EAAQ,YAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { createRecipeContext as p } from "@chakra-ui/react";
|
|
3
|
-
import { $ as s } from "./Dialog-
|
|
3
|
+
import { $ as s } from "./Dialog-Qpq4hk89.es.js";
|
|
4
4
|
const { withContext: n } = /* @__PURE__ */ p({
|
|
5
5
|
key: "popover"
|
|
6
6
|
}), c = /* @__PURE__ */ n(s), i = (o) => {
|
|
@@ -11,4 +11,4 @@ i.displayName = "Popover";
|
|
|
11
11
|
export {
|
|
12
12
|
i as P
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=popover-
|
|
14
|
+
//# sourceMappingURL=popover-DNaC7CwB.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-DNaC7CwB.es.js","sources":["../../src/components/popover/popover.slots.tsx","../../src/components/popover/popover.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Popover as RaPopover } from \"react-aria-components\";\nimport type { PopoverProps } from \"./popover.types\";\nimport type { SlotComponent } from \"@/utils/slot-types\";\n\nconst { withContext } = createRecipeContext({\n key: \"popover\",\n});\n\nexport const PopoverRootSlot: SlotComponent<typeof RaPopover, PopoverProps> =\n withContext<typeof RaPopover, PopoverProps>(RaPopover);\n","import { PopoverRootSlot } from \"./popover.slots\";\nimport type { PopoverProps } from \"./popover.types\";\n\n/**\n * # Popover\n *\n * A component that displays floating content in relation to a trigger element.\n *\n * Note this component is only used internally.\n */\nexport const Popover = (props: PopoverProps) => {\n const { children, ...rest } = props;\n\n return <PopoverRootSlot {...rest}>{children}</PopoverRootSlot>;\n};\n\nPopover.displayName = \"Popover\";\n"],"names":["withContext","createRecipeContext","PopoverRootSlot","RaPopover","Popover","props","children","rest","jsx"],"mappings":";;;AAKA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB;AAAA,EAC1C,KAAK;AACP,CAAC,GAEYC,IACX,gBAAAF,EAA4CG,CAAS,GCA1CC,IAAU,CAACC,MAAwB;AAC9C,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAA,IAASF;AAE9B,SAAO,gBAAAG,EAACN,GAAA,EAAiB,GAAGK,GAAO,UAAAD,EAAA,CAAS;AAC9C;AAEAF,EAAQ,cAAc;"}
|
|
@@ -12,7 +12,7 @@ import { $ as F } from "./filterDOMProps-BSVCO5jK.es.js";
|
|
|
12
12
|
import { $ as ue } from "./useObjectRef-CaJ5pgjX.es.js";
|
|
13
13
|
import R, { useMemo as E, useState as q, forwardRef as L, createContext as M } from "react";
|
|
14
14
|
import { $ as $e } from "./useFormReset-D_wskGk5.es.js";
|
|
15
|
-
import { $ as w } from "./usePress-
|
|
15
|
+
import { $ as w } from "./usePress-Dc6amhnJ.es.js";
|
|
16
16
|
import { $ as be } from "./useFocusable-D1mzTlxa.es.js";
|
|
17
17
|
import { a as pe, $ as ve } from "./useFormValidation-DR5NgZ9j.es.js";
|
|
18
18
|
import { g as me } from "./utils-Cjs5h3ad.es.js";
|
|
@@ -347,4 +347,4 @@ export {
|
|
|
347
347
|
G as a,
|
|
348
348
|
H as b
|
|
349
349
|
};
|
|
350
|
-
//# sourceMappingURL=radio-input-
|
|
350
|
+
//# sourceMappingURL=radio-input-4jw6HUjC.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-input-DhqS9ipf.es.js","sources":["../../../../node_modules/.pnpm/@react-aria+radio@3.12.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/radio/dist/utils.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/radio/dist/useRadio.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/radio/dist/useRadioGroup.mjs","../../../../node_modules/.pnpm/@react-stately+radio@3.11.2_react@19.1.0/node_modules/@react-stately/radio/dist/useRadioGroupState.mjs","../../../../node_modules/.pnpm/react-aria-components@1.13.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-aria-components/dist/RadioGroup.mjs","../../src/components/radio-input/radio-input.slots.tsx","../../src/components/radio-input/components/radio-input.root.tsx","../../src/components/radio-input/components/radio-input.option.tsx","../../src/components/radio-input/radio-input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ const $884aeceb3d67f00f$export$37b65e5b5444d35c = new WeakMap();\n\n\nexport {$884aeceb3d67f00f$export$37b65e5b5444d35c as radioGroupData};\n//# sourceMappingURL=utils.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {mergeProps as $5jJ3f$mergeProps, filterDOMProps as $5jJ3f$filterDOMProps, useFormReset as $5jJ3f$useFormReset} from \"@react-aria/utils\";\nimport {useMemo as $5jJ3f$useMemo} from \"react\";\nimport {usePress as $5jJ3f$usePress, useFocusable as $5jJ3f$useFocusable} from \"@react-aria/interactions\";\nimport {useFormValidation as $5jJ3f$useFormValidation} from \"@react-aria/form\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\nfunction $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {\n let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressChange: onPressChange, onPress: onPress, onPressUp: onPressUp, onClick: onClick } = props;\n const isDisabled = props.isDisabled || state.isDisabled;\n let hasChildren = children != null;\n let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;\n if (!hasChildren && !hasAriaLabel && process.env.NODE_ENV !== 'production') console.warn('If you do not provide children, you must specify an aria-label for accessibility');\n let checked = state.selectedValue === value;\n let onChange = (e)=>{\n e.stopPropagation();\n state.setSelectedValue(value);\n };\n // Handle press state for keyboard interactions and cases where labelProps is not used.\n let { pressProps: pressProps, isPressed: isPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPress: onPress,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled\n });\n // Handle press state on the label.\n let { pressProps: labelProps, isPressed: isLabelPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled,\n onPress (e) {\n var _ref_current;\n onPress === null || onPress === void 0 ? void 0 : onPress(e);\n state.setSelectedValue(value);\n (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n }\n });\n let { focusableProps: focusableProps } = (0, $5jJ3f$useFocusable)((0, $5jJ3f$mergeProps)(props, {\n onFocus: ()=>state.setLastFocusedValue(value)\n }), ref);\n let interactions = (0, $5jJ3f$mergeProps)(pressProps, focusableProps);\n let domProps = (0, $5jJ3f$filterDOMProps)(props, {\n labelable: true\n });\n let tabIndex = -1;\n if (state.selectedValue != null) {\n if (state.selectedValue === value) tabIndex = 0;\n } else if (state.lastFocusedValue === value || state.lastFocusedValue == null) tabIndex = 0;\n if (isDisabled) tabIndex = undefined;\n let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).get(state);\n (0, $5jJ3f$useFormReset)(ref, state.defaultSelectedValue, state.setSelectedValue);\n (0, $5jJ3f$useFormValidation)({\n validationBehavior: validationBehavior\n }, state, ref);\n return {\n labelProps: (0, $5jJ3f$mergeProps)(labelProps, (0, $5jJ3f$useMemo)(()=>({\n onClick: (e)=>e.preventDefault(),\n // Prevent label from being focused when mouse down on it.\n // Note, this does not prevent the input from being focused in the `click` event.\n onMouseDown: (e)=>e.preventDefault()\n }), [])),\n inputProps: (0, $5jJ3f$mergeProps)(domProps, {\n ...interactions,\n type: 'radio',\n name: name,\n form: form,\n tabIndex: tabIndex,\n disabled: isDisabled,\n required: state.isRequired && validationBehavior === 'native',\n checked: checked,\n value: value,\n onChange: onChange,\n 'aria-describedby': [\n props['aria-describedby'],\n state.isInvalid ? errorMessageId : null,\n descriptionId\n ].filter(Boolean).join(' ') || undefined\n }),\n isDisabled: isDisabled,\n isSelected: checked,\n isPressed: isPressed || isLabelPressed\n };\n}\n\n\nexport {$0d5c49892c1215da$export$37b0961d2f4751e2 as useRadio};\n//# sourceMappingURL=useRadio.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {filterDOMProps as $czmJy$filterDOMProps, getOwnerWindow as $czmJy$getOwnerWindow, useId as $czmJy$useId, mergeProps as $czmJy$mergeProps} from \"@react-aria/utils\";\nimport {getFocusableTreeWalker as $czmJy$getFocusableTreeWalker} from \"@react-aria/focus\";\nimport {useField as $czmJy$useField} from \"@react-aria/label\";\nimport {useFocusWithin as $czmJy$useFocusWithin} from \"@react-aria/interactions\";\nimport {useLocale as $czmJy$useLocale} from \"@react-aria/i18n\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {\n let { name: name, form: form, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = 'vertical', validationBehavior: validationBehavior = 'aria' } = props;\n let { direction: direction } = (0, $czmJy$useLocale)();\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;\n let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $czmJy$useField)({\n ...props,\n // Radio group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span',\n isInvalid: state.isInvalid,\n errorMessage: props.errorMessage || validationErrors\n });\n let domProps = (0, $czmJy$filterDOMProps)(props, {\n labelable: true\n });\n // When the radio group loses focus, reset the focusable radio to null if\n // there is no selection. This allows tabbing into the group from either\n // direction to go to the first or last radio.\n let { focusWithinProps: focusWithinProps } = (0, $czmJy$useFocusWithin)({\n onBlurWithin (e) {\n var _props_onBlur;\n (_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);\n if (!state.selectedValue) state.setLastFocusedValue(null);\n },\n onFocusWithin: props.onFocus,\n onFocusWithinChange: props.onFocusChange\n });\n let onKeyDown = (e)=>{\n let nextDir;\n switch(e.key){\n case 'ArrowRight':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'prev';\n else nextDir = 'next';\n break;\n case 'ArrowLeft':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'next';\n else nextDir = 'prev';\n break;\n case 'ArrowDown':\n nextDir = 'next';\n break;\n case 'ArrowUp':\n nextDir = 'prev';\n break;\n default:\n return;\n }\n e.preventDefault();\n let walker = (0, $czmJy$getFocusableTreeWalker)(e.currentTarget, {\n from: e.target,\n accept: (node)=>node instanceof (0, $czmJy$getOwnerWindow)(node).HTMLInputElement && node.type === 'radio'\n });\n let nextElem;\n if (nextDir === 'next') {\n nextElem = walker.nextNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.firstChild();\n }\n } else {\n nextElem = walker.previousNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.lastChild();\n }\n }\n if (nextElem) {\n // Call focus on nextElem so that keyboard navigation scrolls the radio into view\n nextElem.focus();\n state.setSelectedValue(nextElem.value);\n }\n };\n let groupName = (0, $czmJy$useId)(name);\n (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).set(state, {\n name: groupName,\n form: form,\n descriptionId: descriptionProps.id,\n errorMessageId: errorMessageProps.id,\n validationBehavior: validationBehavior\n });\n return {\n radioGroupProps: (0, $czmJy$mergeProps)(domProps, {\n // https://www.w3.org/TR/wai-aria-1.2/#radiogroup\n role: 'radiogroup',\n onKeyDown: onKeyDown,\n 'aria-invalid': state.isInvalid || undefined,\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-readonly': isReadOnly || undefined,\n 'aria-required': isRequired || undefined,\n 'aria-disabled': isDisabled || undefined,\n 'aria-orientation': orientation,\n ...fieldProps,\n ...focusWithinProps\n }),\n labelProps: labelProps,\n descriptionProps: descriptionProps,\n errorMessageProps: errorMessageProps,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails\n };\n}\n\n\nexport {$430f30ed08ec25fa$export$62b9571f283ff5c2 as useRadioGroup};\n//# sourceMappingURL=useRadioGroup.module.js.map\n","import {useFormValidationState as $l55kx$useFormValidationState} from \"@react-stately/form\";\nimport {useControlledState as $l55kx$useControlledState} from \"@react-stately/utils\";\nimport {useMemo as $l55kx$useMemo, useState as $l55kx$useState} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nlet $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 10000000000);\nlet $a54cdc5c1942b639$var$i = 0;\nfunction $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = (0, $l55kx$useMemo)(()=>props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [\n props.name\n ]);\n var _props_defaultValue;\n let [selectedValue, setSelected] = (0, $l55kx$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);\n let [initialValue] = (0, $l55kx$useState)(selectedValue);\n let [lastFocusedValue, setLastFocusedValue] = (0, $l55kx$useState)(null);\n let validation = (0, $l55kx$useFormValidationState)({\n ...props,\n value: selectedValue\n });\n let setSelectedValue = (value)=>{\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n validation.commitValidation();\n }\n };\n let isInvalid = validation.displayValidation.isInvalid;\n var _props_defaultValue1;\n return {\n ...validation,\n name: name,\n selectedValue: selectedValue,\n defaultSelectedValue: props.value !== undefined ? initialValue : (_props_defaultValue1 = props.defaultValue) !== null && _props_defaultValue1 !== void 0 ? _props_defaultValue1 : null,\n setSelectedValue: setSelectedValue,\n lastFocusedValue: lastFocusedValue,\n setLastFocusedValue: setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n validationState: props.validationState || (isInvalid ? 'invalid' : null),\n isInvalid: isInvalid\n };\n}\n\n\nexport {$a54cdc5c1942b639$export$bca9d026f8e704eb as useRadioGroupState};\n//# sourceMappingURL=useRadioGroupState.module.js.map\n","import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from \"./utils.mjs\";\nimport {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from \"./FieldError.mjs\";\nimport {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from \"./Form.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0} from \"./SelectionIndicator.mjs\";\nimport {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from \"./SharedElementTransition.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useRadioGroup as $3sixo$useRadioGroup, useRadio as $3sixo$useRadio, useFocusRing as $3sixo$useFocusRing, useHover as $3sixo$useHover, VisuallyHidden as $3sixo$VisuallyHidden} from \"react-aria\";\nimport {filterDOMProps as $3sixo$filterDOMProps, mergeProps as $3sixo$mergeProps, useObjectRef as $3sixo$useObjectRef, mergeRefs as $3sixo$mergeRefs} from \"@react-aria/utils\";\nimport {useRadioGroupState as $3sixo$useRadioGroupState} from \"react-stately\";\nimport $3sixo$react, {createContext as $3sixo$createContext, forwardRef as $3sixo$forwardRef, useMemo as $3sixo$useMemo} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\n\n\n\n\nconst $b6c3ddc6086f204d$export$a79eda4ff50e30b6 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$b118023277d4a5c3 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$29d84393af70866c = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function RadioGroup(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $b6c3ddc6086f204d$export$a79eda4ff50e30b6);\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let state = (0, $3sixo$useRadioGroupState)({\n ...props,\n validationBehavior: validationBehavior\n });\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { radioGroupProps: radioGroupProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $3sixo$useRadioGroup)({\n ...props,\n label: label,\n validationBehavior: validationBehavior\n }, state);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state: state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"div\", {\n ...(0, $3sixo$mergeProps)(DOMProps, renderProps, radioGroupProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-orientation\": props.orientation || 'vertical',\n \"data-invalid\": state.isInvalid || undefined,\n \"data-disabled\": state.isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $b6c3ddc6086f204d$export$29d84393af70866c,\n state\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea),\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [\n (0, $ee014567cb39d3f0$export$ff05c3ac10437e03),\n validation\n ]\n ]\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $c8a5a149f625efcf$export$758399f318e6385a), null, renderProps.children)));\n});\nconst $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function Radio(props, ref) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, $b6c3ddc6086f204d$export$b118023277d4a5c3);\n let state = (0, $3sixo$react).useContext($b6c3ddc6086f204d$export$29d84393af70866c);\n let inputRef = (0, $3sixo$useObjectRef)((0, $3sixo$useMemo)(()=>(0, $3sixo$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [\n userProvidedInputRef,\n props.inputRef\n ]));\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isPressed: isPressed } = (0, $3sixo$useRadio)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $3sixo$useFocusRing)();\n let interactionDisabled = isDisabled || state.isReadOnly;\n let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3sixo$useHover)({\n ...props,\n isDisabled: interactionDisabled\n });\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected: isSelected,\n isPressed: isPressed,\n isHovered: isHovered,\n isFocused: isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n delete DOMProps.onClick;\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"label\", {\n ...(0, $3sixo$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),\n ref: ref,\n \"data-selected\": isSelected || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-invalid\": state.isInvalid || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $3sixo$VisuallyHidden), {\n elementType: \"span\"\n }, /*#__PURE__*/ (0, $3sixo$react).createElement(\"input\", {\n ...(0, $3sixo$mergeProps)(inputProps, focusProps),\n ref: inputRef\n })), /*#__PURE__*/ (0, $3sixo$react).createElement((0, $1d5b8b8664671ef2$export$c9549807523555e0).Provider, {\n value: {\n isSelected: isSelected\n }\n }, renderProps.children));\n});\n\n\nexport {$b6c3ddc6086f204d$export$a79eda4ff50e30b6 as RadioGroupContext, $b6c3ddc6086f204d$export$b118023277d4a5c3 as RadioContext, $b6c3ddc6086f204d$export$29d84393af70866c as RadioGroupStateContext, $b6c3ddc6086f204d$export$a98f0dcb43a68a25 as RadioGroup, $b6c3ddc6086f204d$export$d7b12c4107be0d61 as Radio};\n//# sourceMappingURL=RadioGroup.module.js.map\n","import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n RadioInputOptionSlotProps,\n RadioInputRootSlotProps,\n} from \"./radio-input.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"radioInput\",\n});\n\nexport const RadioInputRootSlot = withProvider<\n HTMLDivElement,\n RadioInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const RadioInputOptionSlot = withContext<\n HTMLSpanElement,\n RadioInputOptionSlotProps\n>(\"span\", \"option\");\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { radioInputSlotRecipe } from \"../radio-input.recipe\";\nimport { RadioGroup as RaRadioGroup } from \"react-aria-components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputRootProps } from \"../radio-input.types\";\nimport { RadioInputRootSlot } from \"../radio-input.slots\";\n\n/**\n * # RadioInput\n *\n * A set of closely related, mutually exclusive or complementary actions that are important enough to be displayed directly in the interface for quick access.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/radio-input}\n */\nexport const RadioInputRoot = (props: RadioInputRootProps) => {\n const recipe = useSlotRecipe({ recipe: radioInputSlotRecipe });\n const [recipeProps, restRecipeProps] = recipe.splitVariantProps(props);\n const [styleProps, restProps] = extractStyleProps(restRecipeProps);\n\n return (\n <RadioInputRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRadioGroup {...restProps}>{props.children}</RaRadioGroup>\n </RadioInputRootSlot>\n );\n};\n\nRadioInputRoot.displayName = \"RadioInputRoot\";\n","import { Radio as RaRadio } from \"react-aria-components\";\nimport {\n RadioButtonChecked,\n RadioButtonUnchecked,\n} from \"@commercetools/nimbus-icons\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputOptionProps } from \"../radio-input.types\";\nimport { RadioInputOptionSlot } from \"../radio-input.slots\";\nimport { useFocusRing } from \"react-aria\";\n\nexport const RadioInputOption = ({\n children,\n value,\n ...rest\n}: RadioInputOptionProps) => {\n const [styleProps, restProps] = extractStyleProps(rest);\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <RadioInputOptionSlot\n {...styleProps}\n {...focusProps}\n data-focus={isFocused || undefined}\n asChild\n >\n <RaRadio value={value} {...restProps}>\n {(renderProps) => {\n const content =\n typeof children === \"function\"\n ? children({\n ...renderProps,\n })\n : children;\n return (\n <>\n {renderProps.isSelected ? (\n <RadioButtonChecked />\n ) : (\n <RadioButtonUnchecked />\n )}\n {content}\n </>\n );\n }}\n </RaRadio>\n </RadioInputOptionSlot>\n );\n};\n\nRadioInputOption.displayName = \"RadioInputOption\";\n","import { RadioInputRoot as _RadioInputRoot } from \"./components/radio-input.root\";\nimport { RadioInputOption as _RadioInputOption } from \"./components/radio-input.option\";\n\nexport const RadioInput = {\n Root: _RadioInputRoot,\n Option: _RadioInputOption,\n};\n\nexport { _RadioInputRoot, _RadioInputOption };\n"],"names":["$884aeceb3d67f00f$export$37b65e5b5444d35c","$0d5c49892c1215da$export$37b0961d2f4751e2","props","state","ref","value","children","ariaLabel","ariaLabelledby","onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick","isDisabled","hasChildren","hasAriaLabel","checked","onChange","e","pressProps","isPressed","$5jJ3f$usePress","labelProps","isLabelPressed","_ref_current","focusableProps","$5jJ3f$useFocusable","$5jJ3f$mergeProps","interactions","domProps","$5jJ3f$filterDOMProps","tabIndex","name","form","descriptionId","errorMessageId","validationBehavior","$5jJ3f$useFormReset","$5jJ3f$useFormValidation","$5jJ3f$useMemo","$430f30ed08ec25fa$export$62b9571f283ff5c2","isReadOnly","isRequired","orientation","direction","$czmJy$useLocale","isInvalid","validationErrors","validationDetails","fieldProps","descriptionProps","errorMessageProps","$czmJy$useField","$czmJy$filterDOMProps","focusWithinProps","$czmJy$useFocusWithin","_props_onBlur","onKeyDown","nextDir","walker","$czmJy$getFocusableTreeWalker","node","$czmJy$getOwnerWindow","nextElem","groupName","$czmJy$useId","$czmJy$mergeProps","$a54cdc5c1942b639$var$instance","$a54cdc5c1942b639$var$i","$a54cdc5c1942b639$export$bca9d026f8e704eb","$l55kx$useMemo","_props_defaultValue","selectedValue","setSelected","$l55kx$useControlledState","initialValue","$l55kx$useState","lastFocusedValue","setLastFocusedValue","validation","$l55kx$useFormValidationState","setSelectedValue","_props_defaultValue1","$b6c3ddc6086f204d$export$a79eda4ff50e30b6","$3sixo$createContext","$b6c3ddc6086f204d$export$b118023277d4a5c3","$b6c3ddc6086f204d$export$29d84393af70866c","$b6c3ddc6086f204d$export$a98f0dcb43a68a25","$3sixo$forwardRef","$64fa3d84918910a7$export$29f1550f4b0d4415","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_props_validationBehavior","_ref","$3sixo$useRadioGroupState","labelRef","label","$64fa3d84918910a7$export$9d4c57ee4c6ffdd8","radioGroupProps","$3sixo$useRadioGroup","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$3sixo$filterDOMProps","$3sixo$react","$3sixo$mergeProps","$64fa3d84918910a7$export$2881499e37b75b9a","$01b77f81d0f07f68$export$75b6ee27786ba447","$514c0188e459b4c0$export$9afb8bc826b033ea","$ee014567cb39d3f0$export$ff05c3ac10437e03","$c8a5a149f625efcf$export$758399f318e6385a","$b6c3ddc6086f204d$export$d7b12c4107be0d61","userProvidedInputRef","otherProps","inputRef","$3sixo$useObjectRef","$3sixo$useMemo","$3sixo$mergeRefs","inputProps","isSelected","$3sixo$useRadio","$64fa3d84918910a7$export$ef03459518577ad4","isFocused","isFocusVisible","focusProps","$3sixo$useFocusRing","interactionDisabled","hoverProps","isHovered","$3sixo$useHover","$3sixo$VisuallyHidden","$1d5b8b8664671ef2$export$c9549807523555e0","withProvider","withContext","createSlotRecipeContext","RadioInputRootSlot","RadioInputOptionSlot","RadioInputRoot","recipe","useSlotRecipe","radioInputSlotRecipe","recipeProps","restRecipeProps","styleProps","restProps","extractStyleProps","jsx","RaRadioGroup","RadioInputOption","rest","useFocusRing","RaRadio","content","jsxs","Fragment","RadioButtonChecked","RadioButtonUnchecked","RadioInput","_RadioInputRoot","_RadioInputOption"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUI,MAAMA,IAA4C,oBAAI,QAAO;ACWjE,SAASC,GAA0CC,GAAOC,GAAOC,GAA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MAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAJ,EAAiB,cAAc;AC9CxB,MAAMS,KAAa;AAAA,EACxB,MAAMC;AAAAA,EACN,QAAQC;AACV;","x_google_ignoreList":[0,1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"radio-input-4jw6HUjC.es.js","sources":["../../../../node_modules/.pnpm/@react-aria+radio@3.12.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/radio/dist/utils.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/radio/dist/useRadio.mjs","../../../../node_modules/.pnpm/@react-aria+radio@3.12.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/radio/dist/useRadioGroup.mjs","../../../../node_modules/.pnpm/@react-stately+radio@3.11.2_react@19.1.0/node_modules/@react-stately/radio/dist/useRadioGroupState.mjs","../../../../node_modules/.pnpm/react-aria-components@1.13.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-aria-components/dist/RadioGroup.mjs","../../src/components/radio-input/radio-input.slots.tsx","../../src/components/radio-input/components/radio-input.root.tsx","../../src/components/radio-input/components/radio-input.option.tsx","../../src/components/radio-input/radio-input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ const $884aeceb3d67f00f$export$37b65e5b5444d35c = new WeakMap();\n\n\nexport {$884aeceb3d67f00f$export$37b65e5b5444d35c as radioGroupData};\n//# sourceMappingURL=utils.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {mergeProps as $5jJ3f$mergeProps, filterDOMProps as $5jJ3f$filterDOMProps, useFormReset as $5jJ3f$useFormReset} from \"@react-aria/utils\";\nimport {useMemo as $5jJ3f$useMemo} from \"react\";\nimport {usePress as $5jJ3f$usePress, useFocusable as $5jJ3f$useFocusable} from \"@react-aria/interactions\";\nimport {useFormValidation as $5jJ3f$useFormValidation} from \"@react-aria/form\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\nfunction $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {\n let { value: value, children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressChange: onPressChange, onPress: onPress, onPressUp: onPressUp, onClick: onClick } = props;\n const isDisabled = props.isDisabled || state.isDisabled;\n let hasChildren = children != null;\n let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;\n if (!hasChildren && !hasAriaLabel && process.env.NODE_ENV !== 'production') console.warn('If you do not provide children, you must specify an aria-label for accessibility');\n let checked = state.selectedValue === value;\n let onChange = (e)=>{\n e.stopPropagation();\n state.setSelectedValue(value);\n };\n // Handle press state for keyboard interactions and cases where labelProps is not used.\n let { pressProps: pressProps, isPressed: isPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPress: onPress,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled\n });\n // Handle press state on the label.\n let { pressProps: labelProps, isPressed: isLabelPressed } = (0, $5jJ3f$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled,\n onPress (e) {\n var _ref_current;\n onPress === null || onPress === void 0 ? void 0 : onPress(e);\n state.setSelectedValue(value);\n (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n }\n });\n let { focusableProps: focusableProps } = (0, $5jJ3f$useFocusable)((0, $5jJ3f$mergeProps)(props, {\n onFocus: ()=>state.setLastFocusedValue(value)\n }), ref);\n let interactions = (0, $5jJ3f$mergeProps)(pressProps, focusableProps);\n let domProps = (0, $5jJ3f$filterDOMProps)(props, {\n labelable: true\n });\n let tabIndex = -1;\n if (state.selectedValue != null) {\n if (state.selectedValue === value) tabIndex = 0;\n } else if (state.lastFocusedValue === value || state.lastFocusedValue == null) tabIndex = 0;\n if (isDisabled) tabIndex = undefined;\n let { name: name, form: form, descriptionId: descriptionId, errorMessageId: errorMessageId, validationBehavior: validationBehavior } = (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).get(state);\n (0, $5jJ3f$useFormReset)(ref, state.defaultSelectedValue, state.setSelectedValue);\n (0, $5jJ3f$useFormValidation)({\n validationBehavior: validationBehavior\n }, state, ref);\n return {\n labelProps: (0, $5jJ3f$mergeProps)(labelProps, (0, $5jJ3f$useMemo)(()=>({\n onClick: (e)=>e.preventDefault(),\n // Prevent label from being focused when mouse down on it.\n // Note, this does not prevent the input from being focused in the `click` event.\n onMouseDown: (e)=>e.preventDefault()\n }), [])),\n inputProps: (0, $5jJ3f$mergeProps)(domProps, {\n ...interactions,\n type: 'radio',\n name: name,\n form: form,\n tabIndex: tabIndex,\n disabled: isDisabled,\n required: state.isRequired && validationBehavior === 'native',\n checked: checked,\n value: value,\n onChange: onChange,\n 'aria-describedby': [\n props['aria-describedby'],\n state.isInvalid ? errorMessageId : null,\n descriptionId\n ].filter(Boolean).join(' ') || undefined\n }),\n isDisabled: isDisabled,\n isSelected: checked,\n isPressed: isPressed || isLabelPressed\n };\n}\n\n\nexport {$0d5c49892c1215da$export$37b0961d2f4751e2 as useRadio};\n//# sourceMappingURL=useRadio.module.js.map\n","import {radioGroupData as $884aeceb3d67f00f$export$37b65e5b5444d35c} from \"./utils.mjs\";\nimport {filterDOMProps as $czmJy$filterDOMProps, getOwnerWindow as $czmJy$getOwnerWindow, useId as $czmJy$useId, mergeProps as $czmJy$mergeProps} from \"@react-aria/utils\";\nimport {getFocusableTreeWalker as $czmJy$getFocusableTreeWalker} from \"@react-aria/focus\";\nimport {useField as $czmJy$useField} from \"@react-aria/label\";\nimport {useFocusWithin as $czmJy$useFocusWithin} from \"@react-aria/interactions\";\nimport {useLocale as $czmJy$useLocale} from \"@react-aria/i18n\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\nfunction $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {\n let { name: name, form: form, isReadOnly: isReadOnly, isRequired: isRequired, isDisabled: isDisabled, orientation: orientation = 'vertical', validationBehavior: validationBehavior = 'aria' } = props;\n let { direction: direction } = (0, $czmJy$useLocale)();\n let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;\n let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $czmJy$useField)({\n ...props,\n // Radio group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span',\n isInvalid: state.isInvalid,\n errorMessage: props.errorMessage || validationErrors\n });\n let domProps = (0, $czmJy$filterDOMProps)(props, {\n labelable: true\n });\n // When the radio group loses focus, reset the focusable radio to null if\n // there is no selection. This allows tabbing into the group from either\n // direction to go to the first or last radio.\n let { focusWithinProps: focusWithinProps } = (0, $czmJy$useFocusWithin)({\n onBlurWithin (e) {\n var _props_onBlur;\n (_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);\n if (!state.selectedValue) state.setLastFocusedValue(null);\n },\n onFocusWithin: props.onFocus,\n onFocusWithinChange: props.onFocusChange\n });\n let onKeyDown = (e)=>{\n let nextDir;\n switch(e.key){\n case 'ArrowRight':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'prev';\n else nextDir = 'next';\n break;\n case 'ArrowLeft':\n if (direction === 'rtl' && orientation !== 'vertical') nextDir = 'next';\n else nextDir = 'prev';\n break;\n case 'ArrowDown':\n nextDir = 'next';\n break;\n case 'ArrowUp':\n nextDir = 'prev';\n break;\n default:\n return;\n }\n e.preventDefault();\n let walker = (0, $czmJy$getFocusableTreeWalker)(e.currentTarget, {\n from: e.target,\n accept: (node)=>node instanceof (0, $czmJy$getOwnerWindow)(node).HTMLInputElement && node.type === 'radio'\n });\n let nextElem;\n if (nextDir === 'next') {\n nextElem = walker.nextNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.firstChild();\n }\n } else {\n nextElem = walker.previousNode();\n if (!nextElem) {\n walker.currentNode = e.currentTarget;\n nextElem = walker.lastChild();\n }\n }\n if (nextElem) {\n // Call focus on nextElem so that keyboard navigation scrolls the radio into view\n nextElem.focus();\n state.setSelectedValue(nextElem.value);\n }\n };\n let groupName = (0, $czmJy$useId)(name);\n (0, $884aeceb3d67f00f$export$37b65e5b5444d35c).set(state, {\n name: groupName,\n form: form,\n descriptionId: descriptionProps.id,\n errorMessageId: errorMessageProps.id,\n validationBehavior: validationBehavior\n });\n return {\n radioGroupProps: (0, $czmJy$mergeProps)(domProps, {\n // https://www.w3.org/TR/wai-aria-1.2/#radiogroup\n role: 'radiogroup',\n onKeyDown: onKeyDown,\n 'aria-invalid': state.isInvalid || undefined,\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-readonly': isReadOnly || undefined,\n 'aria-required': isRequired || undefined,\n 'aria-disabled': isDisabled || undefined,\n 'aria-orientation': orientation,\n ...fieldProps,\n ...focusWithinProps\n }),\n labelProps: labelProps,\n descriptionProps: descriptionProps,\n errorMessageProps: errorMessageProps,\n isInvalid: isInvalid,\n validationErrors: validationErrors,\n validationDetails: validationDetails\n };\n}\n\n\nexport {$430f30ed08ec25fa$export$62b9571f283ff5c2 as useRadioGroup};\n//# sourceMappingURL=useRadioGroup.module.js.map\n","import {useFormValidationState as $l55kx$useFormValidationState} from \"@react-stately/form\";\nimport {useControlledState as $l55kx$useControlledState} from \"@react-stately/utils\";\nimport {useMemo as $l55kx$useMemo, useState as $l55kx$useState} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nlet $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 10000000000);\nlet $a54cdc5c1942b639$var$i = 0;\nfunction $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {\n // Preserved here for backward compatibility. React Aria now generates the name instead of stately.\n let name = (0, $l55kx$useMemo)(()=>props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [\n props.name\n ]);\n var _props_defaultValue;\n let [selectedValue, setSelected] = (0, $l55kx$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);\n let [initialValue] = (0, $l55kx$useState)(selectedValue);\n let [lastFocusedValue, setLastFocusedValue] = (0, $l55kx$useState)(null);\n let validation = (0, $l55kx$useFormValidationState)({\n ...props,\n value: selectedValue\n });\n let setSelectedValue = (value)=>{\n if (!props.isReadOnly && !props.isDisabled) {\n setSelected(value);\n validation.commitValidation();\n }\n };\n let isInvalid = validation.displayValidation.isInvalid;\n var _props_defaultValue1;\n return {\n ...validation,\n name: name,\n selectedValue: selectedValue,\n defaultSelectedValue: props.value !== undefined ? initialValue : (_props_defaultValue1 = props.defaultValue) !== null && _props_defaultValue1 !== void 0 ? _props_defaultValue1 : null,\n setSelectedValue: setSelectedValue,\n lastFocusedValue: lastFocusedValue,\n setLastFocusedValue: setLastFocusedValue,\n isDisabled: props.isDisabled || false,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false,\n validationState: props.validationState || (isInvalid ? 'invalid' : null),\n isInvalid: isInvalid\n };\n}\n\n\nexport {$a54cdc5c1942b639$export$bca9d026f8e704eb as useRadioGroupState};\n//# sourceMappingURL=useRadioGroupState.module.js.map\n","import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from \"./utils.mjs\";\nimport {FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from \"./FieldError.mjs\";\nimport {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from \"./Form.mjs\";\nimport {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from \"./Label.mjs\";\nimport {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0} from \"./SelectionIndicator.mjs\";\nimport {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from \"./SharedElementTransition.mjs\";\nimport {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from \"./Text.mjs\";\nimport {useRadioGroup as $3sixo$useRadioGroup, useRadio as $3sixo$useRadio, useFocusRing as $3sixo$useFocusRing, useHover as $3sixo$useHover, VisuallyHidden as $3sixo$VisuallyHidden} from \"react-aria\";\nimport {filterDOMProps as $3sixo$filterDOMProps, mergeProps as $3sixo$mergeProps, useObjectRef as $3sixo$useObjectRef, mergeRefs as $3sixo$mergeRefs} from \"@react-aria/utils\";\nimport {useRadioGroupState as $3sixo$useRadioGroupState} from \"react-stately\";\nimport $3sixo$react, {createContext as $3sixo$createContext, forwardRef as $3sixo$forwardRef, useMemo as $3sixo$useMemo} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\n\n\n\n\nconst $b6c3ddc6086f204d$export$a79eda4ff50e30b6 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$b118023277d4a5c3 = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$29d84393af70866c = /*#__PURE__*/ (0, $3sixo$createContext)(null);\nconst $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function RadioGroup(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $b6c3ddc6086f204d$export$a79eda4ff50e30b6);\n let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};\n var _props_validationBehavior, _ref;\n let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';\n let state = (0, $3sixo$useRadioGroupState)({\n ...props,\n validationBehavior: validationBehavior\n });\n let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);\n let { radioGroupProps: radioGroupProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $3sixo$useRadioGroup)({\n ...props,\n label: label,\n validationBehavior: validationBehavior\n }, state);\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state: state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"div\", {\n ...(0, $3sixo$mergeProps)(DOMProps, renderProps, radioGroupProps),\n ref: ref,\n slot: props.slot || undefined,\n \"data-orientation\": props.orientation || 'vertical',\n \"data-invalid\": state.isInvalid || undefined,\n \"data-disabled\": state.isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $b6c3ddc6086f204d$export$29d84393af70866c,\n state\n ],\n [\n (0, $01b77f81d0f07f68$export$75b6ee27786ba447),\n {\n ...labelProps,\n ref: labelRef,\n elementType: 'span'\n }\n ],\n [\n (0, $514c0188e459b4c0$export$9afb8bc826b033ea),\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [\n (0, $ee014567cb39d3f0$export$ff05c3ac10437e03),\n validation\n ]\n ]\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $c8a5a149f625efcf$export$758399f318e6385a), null, renderProps.children)));\n});\nconst $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $3sixo$forwardRef)(function Radio(props, ref) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(otherProps, ref, $b6c3ddc6086f204d$export$b118023277d4a5c3);\n let state = (0, $3sixo$react).useContext($b6c3ddc6086f204d$export$29d84393af70866c);\n let inputRef = (0, $3sixo$useObjectRef)((0, $3sixo$useMemo)(()=>(0, $3sixo$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [\n userProvidedInputRef,\n props.inputRef\n ]));\n let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isPressed: isPressed } = (0, $3sixo$useRadio)({\n ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $3sixo$useFocusRing)();\n let interactionDisabled = isDisabled || state.isReadOnly;\n let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3sixo$useHover)({\n ...props,\n isDisabled: interactionDisabled\n });\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected: isSelected,\n isPressed: isPressed,\n isHovered: isHovered,\n isFocused: isFocused,\n isFocusVisible: isFocusVisible,\n isDisabled: isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n let DOMProps = (0, $3sixo$filterDOMProps)(props, {\n global: true\n });\n delete DOMProps.id;\n delete DOMProps.onClick;\n return /*#__PURE__*/ (0, $3sixo$react).createElement(\"label\", {\n ...(0, $3sixo$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),\n ref: ref,\n \"data-selected\": isSelected || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-readonly\": state.isReadOnly || undefined,\n \"data-invalid\": state.isInvalid || undefined,\n \"data-required\": state.isRequired || undefined\n }, /*#__PURE__*/ (0, $3sixo$react).createElement((0, $3sixo$VisuallyHidden), {\n elementType: \"span\"\n }, /*#__PURE__*/ (0, $3sixo$react).createElement(\"input\", {\n ...(0, $3sixo$mergeProps)(inputProps, focusProps),\n ref: inputRef\n })), /*#__PURE__*/ (0, $3sixo$react).createElement((0, $1d5b8b8664671ef2$export$c9549807523555e0).Provider, {\n value: {\n isSelected: isSelected\n }\n }, renderProps.children));\n});\n\n\nexport {$b6c3ddc6086f204d$export$a79eda4ff50e30b6 as RadioGroupContext, $b6c3ddc6086f204d$export$b118023277d4a5c3 as RadioContext, $b6c3ddc6086f204d$export$29d84393af70866c as RadioGroupStateContext, $b6c3ddc6086f204d$export$a98f0dcb43a68a25 as RadioGroup, $b6c3ddc6086f204d$export$d7b12c4107be0d61 as Radio};\n//# sourceMappingURL=RadioGroup.module.js.map\n","import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n RadioInputOptionSlotProps,\n RadioInputRootSlotProps,\n} from \"./radio-input.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"radioInput\",\n});\n\nexport const RadioInputRootSlot = withProvider<\n HTMLDivElement,\n RadioInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const RadioInputOptionSlot = withContext<\n HTMLSpanElement,\n RadioInputOptionSlotProps\n>(\"span\", \"option\");\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { radioInputSlotRecipe } from \"../radio-input.recipe\";\nimport { RadioGroup as RaRadioGroup } from \"react-aria-components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputRootProps } from \"../radio-input.types\";\nimport { RadioInputRootSlot } from \"../radio-input.slots\";\n\n/**\n * # RadioInput\n *\n * A set of closely related, mutually exclusive or complementary actions that are important enough to be displayed directly in the interface for quick access.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/radio-input}\n */\nexport const RadioInputRoot = (props: RadioInputRootProps) => {\n const recipe = useSlotRecipe({ recipe: radioInputSlotRecipe });\n const [recipeProps, restRecipeProps] = recipe.splitVariantProps(props);\n const [styleProps, restProps] = extractStyleProps(restRecipeProps);\n\n return (\n <RadioInputRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRadioGroup {...restProps}>{props.children}</RaRadioGroup>\n </RadioInputRootSlot>\n );\n};\n\nRadioInputRoot.displayName = \"RadioInputRoot\";\n","import { Radio as RaRadio } from \"react-aria-components\";\nimport {\n RadioButtonChecked,\n RadioButtonUnchecked,\n} from \"@commercetools/nimbus-icons\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { RadioInputOptionProps } from \"../radio-input.types\";\nimport { RadioInputOptionSlot } from \"../radio-input.slots\";\nimport { useFocusRing } from \"react-aria\";\n\nexport const RadioInputOption = ({\n children,\n value,\n ...rest\n}: RadioInputOptionProps) => {\n const [styleProps, restProps] = extractStyleProps(rest);\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <RadioInputOptionSlot\n {...styleProps}\n {...focusProps}\n data-focus={isFocused || undefined}\n asChild\n >\n <RaRadio value={value} {...restProps}>\n {(renderProps) => {\n const content =\n typeof children === \"function\"\n ? children({\n ...renderProps,\n })\n : children;\n return (\n <>\n {renderProps.isSelected ? (\n <RadioButtonChecked />\n ) : (\n <RadioButtonUnchecked />\n )}\n {content}\n </>\n );\n }}\n </RaRadio>\n </RadioInputOptionSlot>\n );\n};\n\nRadioInputOption.displayName = \"RadioInputOption\";\n","import { RadioInputRoot as _RadioInputRoot } from \"./components/radio-input.root\";\nimport { RadioInputOption as _RadioInputOption } from \"./components/radio-input.option\";\n\nexport const RadioInput = {\n Root: _RadioInputRoot,\n Option: _RadioInputOption,\n};\n\nexport { _RadioInputRoot, _RadioInputOption };\n"],"names":["$884aeceb3d67f00f$export$37b65e5b5444d35c","$0d5c49892c1215da$export$37b0961d2f4751e2","props","state","ref","value","children","ariaLabel","ariaLabelledby","onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick","isDisabled","hasChildren","hasAriaLabel","checked","onChange","e","pressProps","isPressed","$5jJ3f$usePress","labelProps","isLabelPressed","_ref_current","focusableProps","$5jJ3f$useFocusable","$5jJ3f$mergeProps","interactions","domProps","$5jJ3f$filterDOMProps","tabIndex","name","form","descriptionId","errorMessageId","validationBehavior","$5jJ3f$useFormReset","$5jJ3f$useFormValidation","$5jJ3f$useMemo","$430f30ed08ec25fa$export$62b9571f283ff5c2","isReadOnly","isRequired","orientation","direction","$czmJy$useLocale","isInvalid","validationErrors","validationDetails","fieldProps","descriptionProps","errorMessageProps","$czmJy$useField","$czmJy$filterDOMProps","focusWithinProps","$czmJy$useFocusWithin","_props_onBlur","onKeyDown","nextDir","walker","$czmJy$getFocusableTreeWalker","node","$czmJy$getOwnerWindow","nextElem","groupName","$czmJy$useId","$czmJy$mergeProps","$a54cdc5c1942b639$var$instance","$a54cdc5c1942b639$var$i","$a54cdc5c1942b639$export$bca9d026f8e704eb","$l55kx$useMemo","_props_defaultValue","selectedValue","setSelected","$l55kx$useControlledState","initialValue","$l55kx$useState","lastFocusedValue","setLastFocusedValue","validation","$l55kx$useFormValidationState","setSelectedValue","_props_defaultValue1","$b6c3ddc6086f204d$export$a79eda4ff50e30b6","$3sixo$createContext","$b6c3ddc6086f204d$export$b118023277d4a5c3","$b6c3ddc6086f204d$export$29d84393af70866c","$b6c3ddc6086f204d$export$a98f0dcb43a68a25","$3sixo$forwardRef","$64fa3d84918910a7$export$29f1550f4b0d4415","formValidationBehavior","$64fa3d84918910a7$export$fabf2dc03a41866e","$d3e0e05bdfcf66bd$export$c24727297075ec6a","_props_validationBehavior","_ref","$3sixo$useRadioGroupState","labelRef","label","$64fa3d84918910a7$export$9d4c57ee4c6ffdd8","radioGroupProps","$3sixo$useRadioGroup","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","DOMProps","$3sixo$filterDOMProps","$3sixo$react","$3sixo$mergeProps","$64fa3d84918910a7$export$2881499e37b75b9a","$01b77f81d0f07f68$export$75b6ee27786ba447","$514c0188e459b4c0$export$9afb8bc826b033ea","$ee014567cb39d3f0$export$ff05c3ac10437e03","$c8a5a149f625efcf$export$758399f318e6385a","$b6c3ddc6086f204d$export$d7b12c4107be0d61","userProvidedInputRef","otherProps","inputRef","$3sixo$useObjectRef","$3sixo$useMemo","$3sixo$mergeRefs","inputProps","isSelected","$3sixo$useRadio","$64fa3d84918910a7$export$ef03459518577ad4","isFocused","isFocusVisible","focusProps","$3sixo$useFocusRing","interactionDisabled","hoverProps","isHovered","$3sixo$useHover","$3sixo$VisuallyHidden","$1d5b8b8664671ef2$export$c9549807523555e0","withProvider","withContext","createSlotRecipeContext","RadioInputRootSlot","RadioInputOptionSlot","RadioInputRoot","recipe","useSlotRecipe","radioInputSlotRecipe","recipeProps","restRecipeProps","styleProps","restProps","extractStyleProps","jsx","RaRadioGroup","RadioInputOption","rest","useFocusRing","RaRadio","content","jsxs","Fragment","RadioButtonChecked","RadioButtonUnchecked","RadioInput","_RadioInputRoot","_RadioInputOption"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUI,MAAMA,IAA4C,oBAAI,QAAO;ACWjE,SAASC,GAA0CC,GAAOC,GAAOC,GAAK;AAClE,MAAI,EAAE,OAAOC,GAAO,UAAUC,GAAU,cAAcC,GAAW,mBAAmBC,GAAgB,cAAcC,GAAc,YAAYC,GAAY,eAAeC,GAAe,SAASC,GAAS,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;AACV;","x_google_ignoreList":[0,1,2,3,4]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { $ as R, a as I, b as F, c as G, d as H, e as j, f as S, g as A, h as B } from "./Heading-
|
|
2
|
+
import { $ as R, a as I, b as F, c as G, d as H, e as j, f as S, g as A, h as B } from "./Heading-DFiVmZUR.es.js";
|
|
3
3
|
import { createSlotRecipeContext as L } from "@chakra-ui/react";
|
|
4
4
|
import { useContext as p } from "react";
|
|
5
|
-
import { $ as M, a as i } from "./useDateFormatter-
|
|
5
|
+
import { $ as M, a as i } from "./useDateFormatter-C4zVAL_K.es.js";
|
|
6
6
|
import { e as w, d as N } from "./utils-Cyja2WdR.es.js";
|
|
7
7
|
import { $ as D } from "./context-R4YUlO9Y.es.js";
|
|
8
8
|
import { B as P } from "./box-DuBoAZvq.es.js";
|
|
@@ -10,12 +10,12 @@ import { KeyboardArrowLeft as u, KeyboardArrowRight as x } from "@commercetools/
|
|
|
10
10
|
import { Flex as z } from "@chakra-ui/react/flex";
|
|
11
11
|
import { S as g } from "./stack-CoNreM7B.es.js";
|
|
12
12
|
import { V as k } from "./visually-hidden-CVUszTlg.es.js";
|
|
13
|
-
import { I as h } from "./icon-button-
|
|
13
|
+
import { I as h } from "./icon-button-DQS2apw-.es.js";
|
|
14
14
|
import { T as C } from "./text-BgiP8ZB6.es.js";
|
|
15
15
|
import { r as V } from "./index-CtB71yr7.es.js";
|
|
16
16
|
import { useRecipe as K } from "@chakra-ui/react/styled-system";
|
|
17
17
|
import { e as W } from "./extractStyleProps-DYXEhLtq.es.js";
|
|
18
|
-
import { $ as y } from "./Button-
|
|
18
|
+
import { $ as y } from "./Button-Dx3xzN8n.es.js";
|
|
19
19
|
import { $ as v } from "./Text-DOcU1ycg.es.js";
|
|
20
20
|
const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
|
|
21
21
|
key: "rangeCalendar"
|
|
@@ -184,4 +184,4 @@ const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
|
|
|
184
184
|
export {
|
|
185
185
|
ve as R
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=range-calendar-
|
|
187
|
+
//# sourceMappingURL=range-calendar-DBpl6y5i.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-calendar-DBpl6y5i.es.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n RangeCalendarRootSlotProps,\n RangeCalendarHeaderSlotProps,\n RangeCalendarGridsSlotProps,\n RangeCalendarMonthTitleSlotProps,\n RangeCalendarGridSlotProps,\n RangeCalendarGridHeaderSlotProps,\n RangeCalendarHeaderCellSlotProps,\n RangeCalendarGridBodySlotProps,\n RangeCalendarCellSlotProps,\n} from \"./range-calendar.types\";\nimport type { SlotComponent } from \"@/utils/slot-types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport const RangeCalendarRootSlot: SlotComponent<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n> = withProvider<HTMLDivElement, RangeCalendarRootSlotProps>(\"div\", \"root\");\n\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAcA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,E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AAA,cACL,GAAIA,KACJ,OAAOA,KAAkB,YACzB,WAAWA,IACPA,EAAc,QACd,CAAA;AAAA,cACJ,GAAGI;AAAA,YAAA;AAAA,UACL;AAAA,QACF;AAAA,QAEF;AAAA,UACED;AAAAA,UACA;AAAA,YACE,GAAGD;AAAA,YACH,OAAO;AAAA,cACL,GAAIA,KACJ,OAAOA,KAAgB,YACvB,WAAWA,IACPA,EAAY,QACZ,CAAA;AAAA,cACJ,GAAGM;AAAA,YAAA;AAAA,UACL;AAAA,QACF;AAAA,MACF;AAAA,MAGD,UAAAT;AAAA,IAAA;AAAA,EAAA;AAGP,GC7FaW,KAAgB,CAACC,MAAyC;AACrE,QAAMC,IAASC,EAAU,EAAE,QAAQC,GAAyB,GACtD,CAACC,GAAaC,CAAc,IAAIJ,EAAO,kBAAkBD,CAAK,GAC9D,CAACM,GAAYC,CAAU,IAAIC,EAAkBH,CAAc;AAEjE,SACE,gBAAA3C,EAACvB,GAAA,EAAuB,GAAGiE,GAAc,GAAGE,GAAY,SAAO,IAC7D,UAAA,gBAAA5C,EAAC+C,GAAA,EAAiB,GAAGF,GACnB,4BAACpB,IAAA,EACC,UAAA;AAAA,IAAA,gBAAAzB,EAACe,IAAA,EAAoB;AAAA,sBACpB7B,IAAA,CAAA,CAAmB;AAAA,EAAA,EAAA,CACtB,GACF,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-calendar-_dZfAsdG.cjs.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n RangeCalendarRootSlotProps,\n RangeCalendarHeaderSlotProps,\n RangeCalendarGridsSlotProps,\n RangeCalendarMonthTitleSlotProps,\n RangeCalendarGridSlotProps,\n RangeCalendarGridHeaderSlotProps,\n RangeCalendarHeaderCellSlotProps,\n RangeCalendarGridBodySlotProps,\n RangeCalendarCellSlotProps,\n} from \"./range-calendar.types\";\nimport type { SlotComponent } from \"../utils/slot-types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport const RangeCalendarRootSlot: SlotComponent<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n> = withProvider<HTMLDivElement, RangeCalendarRootSlotProps>(\"div\", \"root\");\n\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":"ouBAcM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,eACP,CAAC,EAEYC,EAGTH,EAAyD,MAAO,MAAM,EAE7DI,EAA0BH,EAGrC,MAAO,QAAQ,EAEJI,EAAyBJ,EAGpC,MAAO,OAAO,EAEHK,EAA8BL,EAGzC,MAAO,YAAY,EAERM,EAAwBN,EAGnC,QAAS,MAAM,EAEJO,EAA8BP,EAGzC,QAAS,YAAY,EAEVQ,EAA8BR,EAGzC,KAAM,YAAY,EAEPS,EAA4BT,EAGvC,QAAS,UAAU,EAERU,EAAwBV,EAGnC,KAAM,UAAU,ECpCLW,EAAqB,IAAM,CACtC,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAUC,EAAAA,0CAAkBC,2CAAoB,EAEhDC,EAAgBC,EAAAA,WAAWC,2CAAyB,EACpDC,EAAqBN,GAAS,iBAAiB,QAAU,EACzDO,EAAYC,4CAAMC,EAAAA,2CAAkB,EACpCC,EAAkBJ,EAAqB,EAE7C,O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ACElC,EAAAA,IAACoC,EAAAA,0CAAA,CACC,OAAQ,CACN,CACER,EAAAA,0CACA,CACE,GAAGD,EACH,MAAO,CACL,GAAIA,GACJ,OAAOA,GAAkB,UACzB,UAAWA,EACPA,EAAc,MACd,CAAA,EACJ,GAAGI,CAAA,CACL,CACF,EAEF,CACED,EAAAA,0CACA,CACE,GAAGD,EACH,MAAO,CACL,GAAIA,GACJ,OAAOA,GAAgB,UACvB,UAAWA,EACPA,EAAY,MACZ,CAAA,EACJ,GAAGM,CAAA,CACL,CACF,CACF,EAGD,SAAAT,CAAA,CAAA,CAGP,EC7FaW,EAAiBC,GAAyC,CACrE,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQC,EAAAA,wBAAyB,EACtD,CAACC,EAAaC,CAAc,EAAIJ,EAAO,kBAAkBD,CAAK,EAC9D,CAACM,EAAYC,CAAU,EAAIC,EAAAA,kBAAkBH,CAAc,EAEjE,OACE3C,EAAAA,IAACvB,EAAA,CAAuB,GAAGiE,EAAc,GAAGE,EAAY,QAAO,GAC7D,SAAA5C,EAAAA,IAAC+C,EAAAA,0CAAA,CAAiB,GAAGF,EACnB,gBAACpB,EAAA,CACC,SAAA,CAAAzB,EAAAA,IAACe,EAAA,EAAoB,QACpB7B,EAAA,CAAA,CAAmB,CAAA,CAAA,CACtB,EACF,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"range-calendar-_dZfAsdG.cjs.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n RangeCalendarRootSlotProps,\n RangeCalendarHeaderSlotProps,\n RangeCalendarGridsSlotProps,\n RangeCalendarMonthTitleSlotProps,\n RangeCalendarGridSlotProps,\n RangeCalendarGridHeaderSlotProps,\n RangeCalendarHeaderCellSlotProps,\n RangeCalendarGridBodySlotProps,\n RangeCalendarCellSlotProps,\n} from \"./range-calendar.types\";\nimport type { SlotComponent } from \"@/utils/slot-types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport const RangeCalendarRootSlot: SlotComponent<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n> = withProvider<HTMLDivElement, RangeCalendarRootSlotProps>(\"div\", \"root\");\n\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":"ouBAcM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,eACP,CAAC,EAEYC,EAGTH,EAAyD,MAAO,MAAM,EAE7DI,EAA0BH,EAGrC,MAAO,QAAQ,EAEJI,EAAyBJ,EAGpC,MAAO,OAAO,EAEHK,EAA8BL,EAGzC,MAAO,YAAY,EAERM,EAAwBN,EAGnC,QAAS,MAAM,EAEJO,EAA8BP,EAGzC,QAAS,YAAY,EAEVQ,EAA8BR,EAGzC,KAAM,YAAY,EAEPS,EAA4BT,EAGvC,QAAS,UAAU,EAERU,EAAwBV,EAGnC,KAAM,UAAU,ECpCLW,EAAqB,IAAM,CACtC,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAUC,EAAAA,0CAAkBC,2CAAoB,EAEhDC,EAAgBC,EAAAA,WAAWC,2CAAyB,EACpDC,EAAqBN,GAAS,iBAAiB,QAAU,EACzDO,EAAYC,4CAAMC,EAAAA,2CAAkB,EACpCC,EAAkBJ,EAAqB,EAE7C,OACEK,MAACrB,EAAA,CACE,SAAA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