@commercetools/nimbus 2.0.1-rc3 → 2.0.1-rc4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{DateField-DZwn3cIj.es.js → DateField-DmPAxSnT.es.js} +8 -8
- package/dist/chunks/{DateField-DZwn3cIj.es.js.map → DateField-DmPAxSnT.es.js.map} +1 -1
- package/dist/chunks/{DatePicker-B2Nf_0Sq.es.js → DatePicker-D8m8YbnD.es.js} +6 -6
- package/dist/chunks/{DatePicker-B2Nf_0Sq.es.js.map → DatePicker-D8m8YbnD.es.js.map} +1 -1
- package/dist/chunks/{Heading-DFiVmZUR.es.js → Heading-lYSFVV4F.es.js} +2 -2
- package/dist/chunks/{Heading-DFiVmZUR.es.js.map → Heading-lYSFVV4F.es.js.map} +1 -1
- package/dist/chunks/accordion-B2FLWAh5.cjs.js.map +1 -1
- package/dist/chunks/accordion-CKDnNkVv.es.js.map +1 -1
- package/dist/chunks/{calendar-lD6G93R9.es.js → calendar-BkGJAIae.es.js} +3 -3
- package/dist/chunks/calendar-BkGJAIae.es.js.map +1 -0
- package/dist/chunks/calendar-V0KeNCQ3.cjs.js.map +1 -1
- package/dist/chunks/collapsible-motion-C7M_CLNI.cjs.js.map +1 -1
- package/dist/chunks/collapsible-motion-CSrKjF8X.es.js.map +1 -1
- package/dist/chunks/combobox-B5UxZWSX.cjs.js.map +1 -1
- package/dist/chunks/combobox-D_7gr3DY.es.js.map +1 -1
- package/dist/chunks/{date-input-Cap8-3zj.es.js → date-input-B_EuP5sc.es.js} +2 -2
- package/dist/chunks/{date-input-Cap8-3zj.es.js.map → date-input-B_EuP5sc.es.js.map} +1 -1
- package/dist/chunks/{date-picker-ChZ8H-MT.es.js → date-picker-DFpgLG1U.es.js} +6 -6
- package/dist/chunks/{date-picker-ChZ8H-MT.es.js.map → date-picker-DFpgLG1U.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-DGWMdcAN.es.js → date-range-picker-DVuIeQQd.es.js} +6 -6
- package/dist/chunks/{date-range-picker-DGWMdcAN.es.js.map → date-range-picker-DVuIeQQd.es.js.map} +1 -1
- package/dist/chunks/group-BqUFlw5R.cjs.js.map +1 -1
- package/dist/chunks/group-CWADf2vF.es.js.map +1 -1
- package/dist/chunks/icon-CenxuChf.es.js.map +1 -1
- package/dist/chunks/icon-D39U--jA.cjs.js.map +1 -1
- package/dist/chunks/kbd-BaeV_DL-.cjs.js.map +1 -1
- package/dist/chunks/kbd-CH9rYghB.es.js.map +1 -1
- package/dist/chunks/menu-D-vE6ZpM.es.js.map +1 -1
- package/dist/chunks/menu-DIepV2KZ.cjs.js.map +1 -1
- package/dist/chunks/popover-CfEq5G5-.cjs.js.map +1 -1
- package/dist/chunks/popover-DNaC7CwB.es.js.map +1 -1
- package/dist/chunks/{range-calendar-DBpl6y5i.es.js → range-calendar-D55DTDbA.es.js} +3 -3
- package/dist/chunks/range-calendar-D55DTDbA.es.js.map +1 -0
- package/dist/chunks/range-calendar-_dZfAsdG.cjs.js.map +1 -1
- package/dist/chunks/rich-text-input-BC8CBVio.es.js.map +1 -1
- package/dist/chunks/rich-text-input-Da5WFZ3l.cjs.js.map +1 -1
- package/dist/chunks/separator-CvRn_J0r.cjs.js.map +1 -1
- package/dist/chunks/separator-DJGUFG-o.es.js.map +1 -1
- package/dist/chunks/split-button-BO52sL7h.cjs.js.map +1 -1
- package/dist/chunks/split-button-BxyZmuNi.es.js.map +1 -1
- package/dist/chunks/switch-01hEhL9A.es.js.map +1 -1
- package/dist/chunks/switch-CdLhBEPq.cjs.js.map +1 -1
- package/dist/chunks/tabs-CJ0OAUSR.cjs.js.map +1 -1
- package/dist/chunks/tabs-Dhte-RCe.es.js.map +1 -1
- package/dist/chunks/tag-group-Btt0egzG.cjs.js.map +1 -1
- package/dist/chunks/tag-group-D2dgXSsV.es.js.map +1 -1
- package/dist/chunks/{time-input--a_qv-Jk.es.js → time-input-CUEnTp-4.es.js} +2 -2
- package/dist/chunks/{time-input--a_qv-Jk.es.js.map → time-input-CUEnTp-4.es.js.map} +1 -1
- package/dist/chunks/tooltip-BPTOkK7W.cjs.js.map +1 -1
- package/dist/chunks/tooltip-sgakxhiy.es.js.map +1 -1
- package/dist/chunks/{useDateFormatter-C4zVAL_K.es.js → useDateFormatter-4Wq50fMI.es.js} +3 -3
- package/dist/chunks/{useDateFormatter-C4zVAL_K.es.js.map → useDateFormatter-4Wq50fMI.es.js.map} +1 -1
- package/dist/components/accordion/accordion.slots.d.ts +1 -1
- package/dist/components/accordion/accordion.types.d.ts +4 -4
- package/dist/components/calendar/calendar.slots.d.ts +1 -1
- package/dist/components/calendar.es.js +1 -1
- package/dist/components/collapsible-motion/collapsible-motion.slots.d.ts +1 -1
- package/dist/components/combobox/combobox.slots.d.ts +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/group/group.slots.d.ts +1 -1
- package/dist/components/icon/icon.slots.d.ts +1 -1
- package/dist/components/kbd/kbd.slots.d.ts +1 -1
- package/dist/components/menu/menu.slots.d.ts +1 -1
- package/dist/components/popover/popover.slots.d.ts +1 -1
- package/dist/components/range-calendar/range-calendar.slots.d.ts +1 -1
- package/dist/components/range-calendar.es.js +1 -1
- package/dist/components/rich-text-input/rich-text-input.slots.d.ts +1 -1
- package/dist/components/separator/separator.slots.d.ts +1 -1
- package/dist/components/split-button/split-button.slots.d.ts +1 -1
- package/dist/components/switch/switch.slots.d.ts +1 -1
- package/dist/components/tabs/tabs.slots.d.ts +1 -1
- package/dist/components/tag-group/tag-group.slots.d.ts +1 -1
- package/dist/components/time-input.es.js +1 -1
- package/dist/components/tooltip/tooltip.slots.d.ts +1 -1
- package/dist/components/tooltip/tooltip.types.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +196 -201
- package/dist/index.es.js.map +1 -1
- package/dist/type-utils/index.d.ts +2 -0
- package/dist/{components/utils/type-helpers.d.ts → type-utils/omit-props.d.ts} +5 -5
- package/dist/utils/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/chunks/calendar-lD6G93R9.es.js.map +0 -1
- package/dist/chunks/range-calendar-DBpl6y5i.es.js.map +0 -1
- package/dist/components/utils/index.d.ts +0 -4
- /package/dist/{utils → type-utils}/slot-types.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-DIepV2KZ.cjs.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n MenuRootSlotProps,\n MenuTriggerSlotProps,\n MenuPopoverSlotProps,\n MenuContentSlotProps,\n MenuItemSlotProps,\n MenuSectionSlotProps,\n MenuSectionLabelSlotProps,\n MenuSubmenuSlotProps,\n} from \"./menu.types\";\nimport type { SlotComponent } from \"@/utils/slot-types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"menu\",\n});\n\n// Menu Root\nexport const MenuRootSlot: SlotComponent<HTMLDivElement, MenuRootSlotProps> =\n withProvider<HTMLDivElement, MenuRootSlotProps>(\"div\", \"root\");\n\n// Menu Trigger\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Section\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport const MenuSubmenuSlot = withContext<\n HTMLDivElement,\n MenuSubmenuSlotProps\n>(\"div\", \"submenu\");\n","import { createContext, useContext } from \"react\";\nimport type { MenuRootProps } from \"./../menu.types\";\nimport type { MenuTriggerProps as RaMenuTriggerProps } from \"react-aria-components\";\n\n// Context should contain all Menu props (excluding MenuTrigger-specific props)\nexport type MenuContextValue = Omit<\n MenuRootProps,\n keyof RaMenuTriggerProps | \"children\" | \"trigger\"\n>;\n\nconst MenuContext = createContext<MenuContextValue | undefined>(undefined);\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = () => {\n const context = useContext(MenuContext);\n return context;\n};\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { MenuTrigger as RaMenuTrigger } from \"react-aria-components\";\nimport type { MenuRootProps } from \"../menu.types\";\nimport { MenuRootSlot } from \"../menu.slots\";\nimport { MenuProvider } from \"./menu.context\";\n\nexport const MenuRoot = (props: MenuRootProps) => {\n const recipe = useSlotRecipe({ key: \"menu\" });\n const [recipeProps, functionalProps] = recipe.splitVariantProps(props);\n\n // Separate MenuTrigger props from Menu props\n const {\n children,\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n ...menuContextProps\n } = functionalProps;\n\n const menuTriggerProps = {\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n };\n\n return (\n <MenuRootSlot {...recipeProps} asChild>\n <RaMenuTrigger {...menuTriggerProps}>\n <MenuProvider value={menuContextProps}>{children}</MenuProvider>\n </RaMenuTrigger>\n </MenuRootSlot>\n );\n};\n\nMenuRoot.displayName = \"Menu.Root\";\n","import { Button } from \"react-aria-components\";\nimport { MenuTriggerSlot } from \"../menu.slots\";\nimport type { MenuTriggerProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuTrigger = ({\n children,\n asChild,\n ref,\n ...props\n}: MenuTriggerProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n /**\n * The user supplied a Button as the trigger\n */\n if (asChild) {\n // When asChild is true, apply styles to the child element\n return (\n <MenuTriggerSlot ref={ref} asChild {...styleProps}>\n {children as ReactNode}\n </MenuTriggerSlot>\n );\n }\n\n /**\n * The user did not supply a Button as trigger, use an unstyled button\n * to wrap which ever element the user supplied and make it a trigger\n */\n return (\n <MenuTriggerSlot asChild {...styleProps}>\n <Button ref={ref} {...restProps}>\n {children}\n </Button>\n </MenuTriggerSlot>\n );\n};\n\nMenuTrigger.displayName = \"Menu.Trigger\";\n","import { createContext, useContext } from \"react\";\n\nexport type MenuSectionContextValue = {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n};\n/**\n * Why is a second context (MenuSectionContext) needed?\n *\n * MenuSectionContext enables section-level config for menu items, such as\n * selection mode, which may differ from the global menu context. This allows\n * advanced menus where each section can have its own selection behavior\n * (e.g., one section is single-select, another is multi-select).\n * By scoping context to a section, menu items inherit settings from their\n * nearest section, falling back to the global menu context if not present.\n * This pattern improves flexibility and composability for complex menus,\n * and avoids prop drilling or awkward prop merging.\n */\n\nconst MenuSectionContext = createContext<MenuSectionContextValue | undefined>(\n undefined\n);\n\nexport const MenuSectionProvider = MenuSectionContext.Provider;\n\nexport const useMenuSectionContext = () => {\n return useContext(MenuSectionContext);\n};\n","import { Menu, Popover } from \"react-aria-components\";\nimport { MenuContentSlot, MenuPopoverSlot } from \"../menu.slots\";\nimport type { MenuContentProps } from \"../menu.types\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\n\nexport const MenuContent = ({\n children,\n placement: placementOverride,\n ref,\n}: MenuContentProps) => {\n const contextProps = useMenuContext();\n\n if (!contextProps) {\n throw new Error(\"Menu.Content must be used within Menu.Root\");\n }\n\n // Separate placement from other props since it's handled by Popover\n const { placement, ...menuProps } = contextProps;\n const finalPlacement = placementOverride || placement || \"bottom start\";\n\n return (\n <MenuSectionProvider value={{ selectionMode: menuProps.selectionMode }}>\n <MenuPopoverSlot asChild>\n <Popover placement={finalPlacement} offset={4} shouldFlip>\n <MenuContentSlot asChild>\n <Menu ref={ref} shouldFocusWrap autoFocus=\"first\" {...menuProps}>\n {children}\n </Menu>\n </MenuContentSlot>\n </Popover>\n </MenuPopoverSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuContent.displayName = \"Menu.Content\";\n","import { MenuItem as RaMenuItem } from \"react-aria-components\";\nimport { MenuItemSlot } from \"../menu.slots\";\nimport type { MenuItemProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { ChevronRight } from \"@commercetools/nimbus-icons\";\nimport { Icon } from \"@/components/icon\";\n\nexport const MenuItem = ({\n children,\n isCritical,\n ref,\n ...props\n}: MenuItemProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuItemSlot\n asChild\n {...styleProps}\n data-critical={isCritical ? \"\" : undefined}\n >\n <RaMenuItem ref={ref} {...restProps}>\n {({ hasSubmenu }) => (\n <>\n {children}\n {hasSubmenu && (\n <Icon slot=\"caretIcon\">\n <ChevronRight />\n </Icon>\n )}\n </>\n )}\n </RaMenuItem>\n </MenuItemSlot>\n );\n};\n\nMenuItem.displayName = \"Menu.Item\";\n","import { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","menuTriggerProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":"gbAaM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,MACP,CAAC,EAGYC,EACXH,EAAgD,MAAO,MAAM,EAGlDI,EAAkBH,EAG7B,SAAU,SAAS,EAGRI,EAAkBJ,EAG7B,MAAO,SAAS,EAGLK,EAAkBL,EAG7B,MAAO,SAAS,EAGLM,EAAeN,EAC1B,MACA,MACF,EAGaO,EAAkBP,EAG7B,MAAO,SAAS,EAGLQ,EAAuBR,EAGlC,MAAO,cAAc,EC7CjBS,EAAcC,EAAAA,cAA4C,MAAS,EAE5DC,EAAeF,EAAY,SAE3BG,EAAiB,IACZC,EAAAA,WAAWJ,CAAW,ECT3BK,EAAYC,GAAyB,CAChD,MAAMC,EAASC,EAAAA,cAAc,CAAE,IAAK,OAAQ,EACtC,CAACC,EAAaC,CAAe,EAAIH,EAAO,kBAAkBD,CAAK,EAG/D,CACJ,SAAAK,EACA,QAAAC,EACA,OAAAC,EACA,YAAAC,EACA,aAAAC,EACA,GAAGC,CAAA,EACDN,EAEEO,EAAmB,CACvB,QAAAL,EACA,OAAAC,EACA,YAAAC,EACA,aAAAC,CAAA,EAGF,aACGtB,EAAA,CAAc,GAAGgB,EAAa,QAAO,GACpC,SAAAS,EAAAA,IAACC,4CAAA,CAAe,GAAGF,EACjB,eAACf,EAAA,CAAa,MAAOc,EAAmB,SAAAL,CAAA,CAAS,EACnD,EACF,CAEJ,EAEAN,EAAS,YAAc,Y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AAAhC,EAAAA,IAACpB,EAAA,CAAgB,QAAO,GAAE,GAAGyB,EAC3B,SAAAkB,EAAAA,KAACe,EAAAA,0CAAA,CACC,IAAAlC,EACA,cAAA4B,EACA,aAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,uBAAAC,EACC,GAAGC,EAEJ,SAAA,CAAArC,EAAAA,IAAC2B,GAAkB,SAAAG,CAAA,CAAM,EACxBC,EACC/B,EAAAA,IAACuC,EAAAA,0CAAA,CAAW,MAAAR,EAAe,SAAAtC,EAAS,EAEnCA,CAAA,CAAA,CAAA,EAGP,CAAA,CACF,CAEJ,EAEAoC,EAAY,YAAc,eCtDnB,MAAMW,EAAqB,CAAC,CACjC,SAAA/C,EACA,GAAGL,CACL,IACSY,EAAAA,IAACyC,EAAAA,0CAAA,CAAkB,GAAGrD,EAAQ,SAAAK,CAAA,CAAS,EAGhD+C,EAAmB,YAAc,sBCP1B,MAAME,EAAc,CAAC,CAAE,SAAAjD,EAAU,GAAGL,WAEtCuB,EAAA,CAAa,GAAGvB,EAAO,UAAU,MAC/B,SAAAK,EACH,EAIJiD,EAAY,YAAc,eCAnB,MAAMxB,EAAO,CAClB,KAAM/B,EACN,QAASe,EACT,QAASS,EACT,KAAMQ,EACN,QAASU,EACT,QAASa,EACT,eAAgBF,CAClB"}
|
|
1
|
+
{"version":3,"file":"menu-DIepV2KZ.cjs.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type {\n MenuRootSlotProps,\n MenuTriggerSlotProps,\n MenuPopoverSlotProps,\n MenuContentSlotProps,\n MenuItemSlotProps,\n MenuSectionSlotProps,\n MenuSectionLabelSlotProps,\n MenuSubmenuSlotProps,\n} from \"./menu.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"menu\",\n});\n\n// Menu Root\nexport const MenuRootSlot: SlotComponent<HTMLDivElement, MenuRootSlotProps> =\n withProvider<HTMLDivElement, MenuRootSlotProps>(\"div\", \"root\");\n\n// Menu Trigger\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Section\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport const MenuSubmenuSlot = withContext<\n HTMLDivElement,\n MenuSubmenuSlotProps\n>(\"div\", \"submenu\");\n","import { createContext, useContext } from \"react\";\nimport type { MenuRootProps } from \"./../menu.types\";\nimport type { MenuTriggerProps as RaMenuTriggerProps } from \"react-aria-components\";\n\n// Context should contain all Menu props (excluding MenuTrigger-specific props)\nexport type MenuContextValue = Omit<\n MenuRootProps,\n keyof RaMenuTriggerProps | \"children\" | \"trigger\"\n>;\n\nconst MenuContext = createContext<MenuContextValue | undefined>(undefined);\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = () => {\n const context = useContext(MenuContext);\n return context;\n};\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { MenuTrigger as RaMenuTrigger } from \"react-aria-components\";\nimport type { MenuRootProps } from \"../menu.types\";\nimport { MenuRootSlot } from \"../menu.slots\";\nimport { MenuProvider } from \"./menu.context\";\n\nexport const MenuRoot = (props: MenuRootProps) => {\n const recipe = useSlotRecipe({ key: \"menu\" });\n const [recipeProps, functionalProps] = recipe.splitVariantProps(props);\n\n // Separate MenuTrigger props from Menu props\n const {\n children,\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n ...menuContextProps\n } = functionalProps;\n\n const menuTriggerProps = {\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n };\n\n return (\n <MenuRootSlot {...recipeProps} asChild>\n <RaMenuTrigger {...menuTriggerProps}>\n <MenuProvider value={menuContextProps}>{children}</MenuProvider>\n </RaMenuTrigger>\n </MenuRootSlot>\n );\n};\n\nMenuRoot.displayName = \"Menu.Root\";\n","import { Button } from \"react-aria-components\";\nimport { MenuTriggerSlot } from \"../menu.slots\";\nimport type { MenuTriggerProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuTrigger = ({\n children,\n asChild,\n ref,\n ...props\n}: MenuTriggerProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n /**\n * The user supplied a Button as the trigger\n */\n if (asChild) {\n // When asChild is true, apply styles to the child element\n return (\n <MenuTriggerSlot ref={ref} asChild {...styleProps}>\n {children as ReactNode}\n </MenuTriggerSlot>\n );\n }\n\n /**\n * The user did not supply a Button as trigger, use an unstyled button\n * to wrap which ever element the user supplied and make it a trigger\n */\n return (\n <MenuTriggerSlot asChild {...styleProps}>\n <Button ref={ref} {...restProps}>\n {children}\n </Button>\n </MenuTriggerSlot>\n );\n};\n\nMenuTrigger.displayName = \"Menu.Trigger\";\n","import { createContext, useContext } from \"react\";\n\nexport type MenuSectionContextValue = {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n};\n/**\n * Why is a second context (MenuSectionContext) needed?\n *\n * MenuSectionContext enables section-level config for menu items, such as\n * selection mode, which may differ from the global menu context. This allows\n * advanced menus where each section can have its own selection behavior\n * (e.g., one section is single-select, another is multi-select).\n * By scoping context to a section, menu items inherit settings from their\n * nearest section, falling back to the global menu context if not present.\n * This pattern improves flexibility and composability for complex menus,\n * and avoids prop drilling or awkward prop merging.\n */\n\nconst MenuSectionContext = createContext<MenuSectionContextValue | undefined>(\n undefined\n);\n\nexport const MenuSectionProvider = MenuSectionContext.Provider;\n\nexport const useMenuSectionContext = () => {\n return useContext(MenuSectionContext);\n};\n","import { Menu, Popover } from \"react-aria-components\";\nimport { MenuContentSlot, MenuPopoverSlot } from \"../menu.slots\";\nimport type { MenuContentProps } from \"../menu.types\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\n\nexport const MenuContent = ({\n children,\n placement: placementOverride,\n ref,\n}: MenuContentProps) => {\n const contextProps = useMenuContext();\n\n if (!contextProps) {\n throw new Error(\"Menu.Content must be used within Menu.Root\");\n }\n\n // Separate placement from other props since it's handled by Popover\n const { placement, ...menuProps } = contextProps;\n const finalPlacement = placementOverride || placement || \"bottom start\";\n\n return (\n <MenuSectionProvider value={{ selectionMode: menuProps.selectionMode }}>\n <MenuPopoverSlot asChild>\n <Popover placement={finalPlacement} offset={4} shouldFlip>\n <MenuContentSlot asChild>\n <Menu ref={ref} shouldFocusWrap autoFocus=\"first\" {...menuProps}>\n {children}\n </Menu>\n </MenuContentSlot>\n </Popover>\n </MenuPopoverSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuContent.displayName = \"Menu.Content\";\n","import { MenuItem as RaMenuItem } from \"react-aria-components\";\nimport { MenuItemSlot } from \"../menu.slots\";\nimport type { MenuItemProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { ChevronRight } from \"@commercetools/nimbus-icons\";\nimport { Icon } from \"@/components/icon\";\n\nexport const MenuItem = ({\n children,\n isCritical,\n ref,\n ...props\n}: MenuItemProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuItemSlot\n asChild\n {...styleProps}\n data-critical={isCritical ? \"\" : undefined}\n >\n <RaMenuItem ref={ref} {...restProps}>\n {({ hasSubmenu }) => (\n <>\n {children}\n {hasSubmenu && (\n <Icon slot=\"caretIcon\">\n <ChevronRight />\n </Icon>\n )}\n </>\n )}\n </RaMenuItem>\n </MenuItemSlot>\n );\n};\n\nMenuItem.displayName = \"Menu.Item\";\n","import { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","menuTriggerProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":"gbAaM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,MACP,CAAC,EAGYC,EACXH,EAAgD,MAAO,MAAM,EAGlDI,EAAkBH,EAG7B,SAAU,SAAS,EAGRI,EAAkBJ,EAG7B,MAAO,SAAS,EAGLK,EAAkBL,EAG7B,MAAO,SAAS,EAGLM,EAAeN,EAC1B,MACA,MACF,EAGaO,EAAkBP,EAG7B,MAAO,SAAS,EAGLQ,EAAuBR,EAGlC,MAAO,cAAc,EC7CjBS,EAAcC,EAAAA,cAA4C,MAAS,EAE5DC,EAAeF,EAAY,SA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EAAO,CAClB,KAAM/B,EACN,QAASe,EACT,QAASS,EACT,KAAMQ,EACN,QAASU,EACT,QAASa,EACT,eAAgBF,CAClB"}
|
|
@@ -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 {
|
|
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 { SlotComponent } from \"@/type-utils\";\nimport type { PopoverProps } from \"./popover.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 +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 {
|
|
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 { SlotComponent } from \"@/type-utils\";\nimport type { PopoverProps } from \"./popover.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;"}
|
|
@@ -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-lYSFVV4F.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-4Wq50fMI.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";
|
|
@@ -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-D55DTDbA.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-calendar-D55DTDbA.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 { SlotComponent } from \"@/type-utils\";\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\";\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,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAEYC,IAGT,gBAAAH,EAAyD,OAAO,MAAM,GAE7DI,IAA0B,gBAAAH,EAGrC,OAAO,QAAQ,GAEJI,IAAyB,gBAAAJ,EAGpC,OAAO,OAAO,GAEHK,IAA8B,gBAAAL,EAGzC,OAAO,YAAY,GAERM,IAAwB,gBAAAN,EAGnC,SAAS,MAAM,GAEJO,IAA8B,gBAAAP,EAGzC,SAAS,YAAY,GAEVQ,IAA8B,gBAAAR,EAGzC,MAAM,YAAY,GAEPS,IAA4B,gBAAAT,EAGvC,SAAS,UAAU,GAERU,IAAwB,gBAAAV,EAGnC,MAAM,UAAU,GCpCLW,KAAqB,MAAM;AACtC,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAUC,EAAkBC,CAAoB,GAEhDC,IAAgBC,EAAWC,CAAyB,GACpDC,IAAqBN,GAAS,iBAAiB,UAAU,GACzDO,IAAYC,EAAMC,GAAkB,GACpCC,IAAkBJ,IAAqB;AAE7C,SACE,gBAAAK,EAACrB,GAAA,EACE,UAAA,MAAM,KAAK,EAAE,QAAQgB,EAAA,GAAsB,CAACM,GAAGC,MAAU;AACxD,UAAMC,IAAWX,EAAc,aAAa,MAAM,IAAI;AAAA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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,EAA8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,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 { SlotComponent } from \"@/type-utils\";\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\";\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,EA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