@commercetools/nimbus 0.0.12-rc2 → 0.0.12-rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{alert-DF3J6Yj7.cjs.js → alert-CsJON6h-.cjs.js} +2 -2
- package/dist/chunks/{alert-DF3J6Yj7.cjs.js.map → alert-CsJON6h-.cjs.js.map} +1 -1
- package/dist/chunks/{button-BfmWlfwH.cjs.js → button-CihUSHJo.cjs.js} +2 -2
- package/dist/chunks/{button-BfmWlfwH.cjs.js.map → button-CihUSHJo.cjs.js.map} +1 -1
- package/dist/chunks/{calendar-BgHBd6Dh.cjs.js → calendar-C-YasyPe.cjs.js} +2 -2
- package/dist/chunks/{calendar-BgHBd6Dh.cjs.js.map → calendar-C-YasyPe.cjs.js.map} +1 -1
- package/dist/chunks/{checkbox-BbdENF1i.cjs.js → checkbox-6DkVAh4W.cjs.js} +2 -2
- package/dist/chunks/{checkbox-BbdENF1i.cjs.js.map → checkbox-6DkVAh4W.cjs.js.map} +1 -1
- package/dist/chunks/{combobox-DIKvq4tw.cjs.js → combobox-CLGVlx_7.cjs.js} +2 -2
- package/dist/chunks/{combobox-DIKvq4tw.cjs.js.map → combobox-CLGVlx_7.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-Cenvhz5D.cjs.js → data-table-B8hn0UVI.cjs.js} +2 -2
- package/dist/chunks/{data-table-Cenvhz5D.cjs.js.map → data-table-B8hn0UVI.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-CWSmm1Cq.es.js → data-table-BmhYF5gH.es.js} +1 -2
- package/dist/chunks/{data-table-CWSmm1Cq.es.js.map → data-table-BmhYF5gH.es.js.map} +1 -1
- package/dist/chunks/{date-input-CKu2_a2x.cjs.js → date-input-VXO92NPV.cjs.js} +2 -2
- package/dist/chunks/{date-input-CKu2_a2x.cjs.js.map → date-input-VXO92NPV.cjs.js.map} +1 -1
- package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js → date-picker-DNaxpmgh.cjs.js} +2 -2
- package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js.map → date-picker-DNaxpmgh.cjs.js.map} +1 -1
- package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js → date-range-picker-B5s-AFSY.cjs.js} +2 -2
- package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js.map → date-range-picker-B5s-AFSY.cjs.js.map} +1 -1
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js → extractStyleProps-BsLft3q1.cjs.js} +2 -2
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js.map → extractStyleProps-BsLft3q1.cjs.js.map} +1 -1
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js → form-field-BjT4m4AE.cjs.js} +2 -2
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js.map → form-field-BjT4m4AE.cjs.js.map} +1 -1
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js → icon-button-DOo2GUqd.cjs.js} +2 -2
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js.map → icon-button-DOo2GUqd.cjs.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js → icon-toggle-button-DmYB27yi.cjs.js} +2 -2
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js.map → icon-toggle-button-DmYB27yi.cjs.js.map} +1 -1
- package/dist/chunks/{index-sFOzzmTG.cjs.js → index-BsmdMT4w.cjs.js} +2 -2
- package/dist/chunks/{index-sFOzzmTG.cjs.js.map → index-BsmdMT4w.cjs.js.map} +1 -1
- package/dist/chunks/index-Dvel3Oj5.es.js.map +1 -1
- package/dist/chunks/{menu-CImIQ6uJ.cjs.js → menu-C8il9--K.cjs.js} +2 -2
- package/dist/chunks/{menu-CImIQ6uJ.cjs.js.map → menu-C8il9--K.cjs.js.map} +1 -1
- package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js → multiline-text-input-D28clI-o.cjs.js} +2 -2
- package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js.map → multiline-text-input-D28clI-o.cjs.js.map} +1 -1
- package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js → nimbus-provider-BlfO5_bi.cjs.js} +2 -2
- package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js.map → nimbus-provider-BlfO5_bi.cjs.js.map} +1 -1
- package/dist/chunks/{number-input-CnOvkmap.cjs.js → number-input-CCEiz-4P.cjs.js} +2 -2
- package/dist/chunks/{number-input-CnOvkmap.cjs.js.map → number-input-CCEiz-4P.cjs.js.map} +1 -1
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js → password-input-DY4slQHQ.cjs.js} +2 -2
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js.map → password-input-DY4slQHQ.cjs.js.map} +1 -1
- package/dist/chunks/{progress-bar-CByPgKbP.cjs.js → progress-bar-0RRIR4ef.cjs.js} +2 -2
- package/dist/chunks/{progress-bar-CByPgKbP.cjs.js.map → progress-bar-0RRIR4ef.cjs.js.map} +1 -1
- package/dist/chunks/{radio-input-VMfD6a_K.cjs.js → radio-input-B40xSi6r.cjs.js} +2 -2
- package/dist/chunks/{radio-input-VMfD6a_K.cjs.js.map → radio-input-B40xSi6r.cjs.js.map} +1 -1
- package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js → range-calendar-BiNek1C7.cjs.js} +2 -2
- package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js.map → range-calendar-BiNek1C7.cjs.js.map} +1 -1
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js → rich-text-input-gNWvLb4m.cjs.js} +2 -2
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js.map → rich-text-input-gNWvLb4m.cjs.js.map} +1 -1
- package/dist/chunks/{select-DT9EbJgb.cjs.js → select-BuXA5VgT.cjs.js} +2 -2
- package/dist/chunks/{select-DT9EbJgb.cjs.js.map → select-BuXA5VgT.cjs.js.map} +1 -1
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js → split-button-CgQYMeH7.cjs.js} +2 -2
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js.map → split-button-CgQYMeH7.cjs.js.map} +1 -1
- package/dist/chunks/{switch-kNksAQM3.cjs.js → switch-BQXiI02l.cjs.js} +2 -2
- package/dist/chunks/{switch-kNksAQM3.cjs.js.map → switch-BQXiI02l.cjs.js.map} +1 -1
- package/dist/chunks/{tag-group-iRBYcxt6.cjs.js → tag-group-DwTq8DeA.cjs.js} +2 -2
- package/dist/chunks/{tag-group-iRBYcxt6.cjs.js.map → tag-group-DwTq8DeA.cjs.js.map} +1 -1
- package/dist/chunks/{text-input-D7SdSWpG.cjs.js → text-input-DJUpcp3k.cjs.js} +2 -2
- package/dist/chunks/{text-input-D7SdSWpG.cjs.js.map → text-input-DJUpcp3k.cjs.js.map} +1 -1
- package/dist/chunks/{time-input-BqTsxXMD.cjs.js → time-input-B5oRiIpu.cjs.js} +2 -2
- package/dist/chunks/{time-input-BqTsxXMD.cjs.js.map → time-input-B5oRiIpu.cjs.js.map} +1 -1
- package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js → toggle-button-C_7Evcn3.cjs.js} +2 -2
- package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js.map → toggle-button-C_7Evcn3.cjs.js.map} +1 -1
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js → toolbar-BUYkQMPz.cjs.js} +2 -2
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js.map → toolbar-BUYkQMPz.cjs.js.map} +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/components.cjs +1 -1
- package/dist/components/components.es.js +1 -1
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.es.js +1 -1
- package/dist/components/date-input.cjs +1 -1
- package/dist/components/date-picker.cjs +1 -1
- package/dist/components/date-range-picker.cjs +1 -1
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/icon-button.cjs +1 -1
- package/dist/components/icon-toggle-button.cjs +1 -1
- package/dist/components/multiline-text-input.cjs +1 -1
- package/dist/components/nimbus-provider.cjs +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/password-input.cjs +1 -1
- package/dist/components/progress-bar.cjs +1 -1
- package/dist/components/radio-input.cjs +1 -1
- package/dist/components/range-calendar.cjs +1 -1
- package/dist/components/rich-text-input.cjs +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/switch.cjs +1 -1
- package/dist/components/tag-group.cjs +1 -1
- package/dist/components/text-input.cjs +1 -1
- package/dist/components/time-input.cjs +1 -1
- package/dist/components/toggle-button.cjs +1 -1
- package/dist/components/toolbar.cjs +1 -1
- package/dist/components.d.ts +35 -35
- package/dist/data-table.d.ts +35 -35
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.es.js +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("./Dialog-CYa26HlL.cjs.js"),K=require("./index-
|
|
2
|
-
//# sourceMappingURL=menu-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("./Dialog-CYa26HlL.cjs.js"),K=require("./index-BsmdMT4w.cjs.js"),f=require("./create-slot-recipe-context-CimocFDH.cjs.js"),b=require("react"),L=require("./Button-BtJHe9xY.cjs.js"),l=require("./extractStyleProps-BsLft3q1.cjs.js"),E=require("@commercetools/nimbus-icons"),O=require("./icon-DHoLo7_S.cjs.js"),v=require("./Separator-CAOg-vqY.cjs.js"),k=require("./SelectionManager-Mrwf4SFv.cjs.js"),{withProvider:B,withContext:u}=f.createSlotRecipeContext({recipe:K.menuSlotRecipe}),D=B("div","root"),y=u("button","trigger"),V=u("div","popover"),W=u("div","content"),z=u("div","item"),A=u("div","separator"),G=u("div","section"),H=u("div","sectionLabel"),R=b.createContext(void 0),J=R.Provider,q=()=>b.useContext(R),m=t=>{const n=f.useSlotRecipe({key:"menu"}),[r,o]=n.splitVariantProps(t),{children:s,trigger:c,isOpen:i,defaultOpen:p,onOpenChange:x,...S}=o,M={trigger:c,isOpen:i,defaultOpen:p,onOpenChange:x};return e.jsx(D,{...r,asChild:!0,children:e.jsx(a.$3674c52c6b3c5bce$export$27d2ad3c5815583e,{...M,children:e.jsx(J,{value:S,children:s})})})};m.displayName="Menu.Root";const h=({children:t,asChild:n,ref:r,...o})=>{const[s,c]=l.extractStyleProps(o);return n?e.jsx(y,{ref:r,asChild:!0,...s,children:t}):e.jsx(y,{asChild:!0,...s,children:e.jsx(L.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,{ref:r,...c,children:t})})};h.displayName="Menu.Trigger";const Q=b.createContext(void 0),T=Q.Provider,d=({children:t,placement:n,ref:r})=>{const o=q();if(!o)throw new Error("Menu.Content must be used within Menu.Root");const{placement:s,...c}=o,i=n||s||"bottom start";return e.jsx(T,{value:{selectionMode:c.selectionMode},children:e.jsx(V,{asChild:!0,children:e.jsx(a.$07b14b47974efb58$export$5b6b19405a83ff9d,{placement:i,offset:4,shouldFlip:!0,children:e.jsx(W,{asChild:!0,children:e.jsx(a.$3674c52c6b3c5bce$export$d9b273488cd8ce6f,{ref:r,shouldFocusWrap:!0,autoFocus:"first",...c,children:t})})})})})};d.displayName="Menu.Content";const P=({children:t,isCritical:n,ref:r,...o})=>{const[s,c]=l.extractStyleProps(o);return e.jsx(z,{asChild:!0,...s,"data-critical":n?"":void 0,children:e.jsx(a.$3674c52c6b3c5bce$export$2ce376c2cc3355c8,{ref:r,...c,children:({hasSubmenu:i})=>e.jsxs(e.Fragment,{children:[t,i&&e.jsx(O.Icon,{slot:"caretIcon",children:e.jsx(E.ChevronRight,{})})]})})})};P.displayName="Menu.Item";const g=({ref:t,...n})=>{const[r,o]=l.extractStyleProps(n);return e.jsx(A,{asChild:!0,...r,children:e.jsx(v.$431f98aba6844401$export$1ff3c3f08ae963c0,{ref:t,...o})})};g.displayName="Menu.Separator";const N=({children:t,ref:n,...r})=>{const[o,s]=l.extractStyleProps(r);return e.jsx(H,{asChild:!0,...o,children:e.jsx(v.$72a5793c14baf454$export$8b251419efc915eb,{ref:n,...s,children:t})})};N.displayName="Menu.SectionLabel";const $=({children:t,ref:n,label:r,items:o,...s})=>{const c=q(),{selectionMode:i=c?.selectionMode,selectedKeys:p=c?.selectedKeys,defaultSelectedKeys:x=c?.defaultSelectedKeys,onSelectionChange:S=c?.onSelectionChange,disallowEmptySelection:M=c?.disallowEmptySelection,...I}=s,[w,F]=l.extractStyleProps(I);return e.jsx(T,{value:{selectionMode:i},children:e.jsx(G,{asChild:!0,...w,children:e.jsxs(a.$3674c52c6b3c5bce$export$4b1545b4f2016d26,{ref:n,selectionMode:i,selectedKeys:p,defaultSelectedKeys:x,onSelectionChange:S,disallowEmptySelection:M,...F,children:[e.jsx(N,{children:r}),o?e.jsx(k.$e1995378a142960e$export$fb8073518f34e6ec,{items:o,children:t}):t]})})})};$.displayName="Menu.Section";const C=({children:t,...n})=>e.jsx(a.$3674c52c6b3c5bce$export$ecabc99eeffab7ca,{...n,children:t});C.displayName="Menu.SubmenuTrigger";const j=({children:t,...n})=>e.jsx(d,{...n,placement:"end",children:t});j.displayName="Menu.Submenu";const U={Root:m,Trigger:h,Content:d,Item:P,Separator:g,Section:$,Submenu:j,SubmenuTrigger:C};exports.Menu=U;exports.MenuContent=d;exports.MenuItem=P;exports.MenuRoot=m;exports.MenuSection=$;exports.MenuSeparator=g;exports.MenuSubmenu=j;exports.MenuSubmenuTrigger=C;exports.MenuTrigger=h;
|
|
2
|
+
//# sourceMappingURL=menu-C8il9--K.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-CImIQ6uJ.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.separator.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 {\n createSlotRecipeContext,\n type HTMLChakraProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { menuSlotRecipe } from \"./menu.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: menuSlotRecipe,\n});\n\n// Menu Root\nexport type MenuRootSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuRootSlot = withProvider<HTMLDivElement, MenuRootSlotProps>(\n \"div\",\n \"root\"\n);\n\n// Menu Trigger\nexport type MenuTriggerSlotProps = HTMLChakraProps<\"button\">;\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport type MenuPopoverSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport type MenuContentSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport type MenuItemSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Separator\nexport type MenuSeparatorSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuSeparatorSlot = withContext<\n HTMLDivElement,\n MenuSeparatorSlotProps\n>(\"div\", \"separator\");\n\n// Menu Section\nexport type MenuSectionSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport type MenuSectionLabelSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport type MenuSubmenuSlotProps = HTMLChakraProps<\"div\">;\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 interface 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 { Separator } from \"react-aria-components\";\nimport { MenuSeparatorSlot } from \"../menu.slots\";\nimport type { MenuSeparatorProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\nexport const MenuSeparator = ({ ref, ...props }: MenuSeparatorProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSeparatorSlot asChild {...styleProps}>\n <Separator ref={ref} {...restProps} />\n </MenuSeparatorSlot>\n );\n};\n\nMenuSeparator.displayName = \"Menu.Separator\";\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 { MenuSeparator } from \"./components/menu.separator\";\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 Separator: MenuSeparator,\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 MenuSeparator as _MenuSeparator,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","menuSlotRecipe","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSeparatorSlot","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","MenuSeparator","Separator","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":"ucAMM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,cACV,CAAC,EAIYC,EAAeJ,EAC1B,MACA,MACF,EAIaK,EAAkBJ,EAG7B,SAAU,SAAS,EAIRK,EAAkBL,EAG7B,MAAO,SAAS,EAILM,EAAkBN,EAG7B,MAAO,SAAS,EAILO,EAAeP,EAC1B,MACA,MACF,EAIaQ,EAAoBR,EAG/B,MAAO,WAAW,EAIPS,EAAkBT,EAG7B,MAAO,SAAS,EAILU,EAAuBV,EAGlC,MAAO,cAAc,ECtDjBW,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,CAA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EAGhDiD,EAAmB,YAAc,sBCP1B,MAAME,EAAc,CAAC,CAAE,SAAAnD,EAAU,GAAGL,WAEtCuB,EAAA,CAAa,GAAGvB,EAAO,UAAU,MAC/B,SAAAK,EACH,EAIJmD,EAAY,YAAc,eCCnB,MAAM1B,EAAO,CAClB,KAAM/B,EACN,QAASe,EACT,QAASS,EACT,KAAMQ,EACN,UAAWQ,EACX,QAASI,EACT,QAASa,EACT,eAAgBF,CAClB"}
|
|
1
|
+
{"version":3,"file":"menu-C8il9--K.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.separator.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 {\n createSlotRecipeContext,\n type HTMLChakraProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { menuSlotRecipe } from \"./menu.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: menuSlotRecipe,\n});\n\n// Menu Root\nexport type MenuRootSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuRootSlot = withProvider<HTMLDivElement, MenuRootSlotProps>(\n \"div\",\n \"root\"\n);\n\n// Menu Trigger\nexport type MenuTriggerSlotProps = HTMLChakraProps<\"button\">;\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport type MenuPopoverSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport type MenuContentSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport type MenuItemSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Separator\nexport type MenuSeparatorSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuSeparatorSlot = withContext<\n HTMLDivElement,\n MenuSeparatorSlotProps\n>(\"div\", \"separator\");\n\n// Menu Section\nexport type MenuSectionSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport type MenuSectionLabelSlotProps = HTMLChakraProps<\"div\">;\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport type MenuSubmenuSlotProps = HTMLChakraProps<\"div\">;\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 interface 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 { Separator } from \"react-aria-components\";\nimport { MenuSeparatorSlot } from \"../menu.slots\";\nimport type { MenuSeparatorProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\nexport const MenuSeparator = ({ ref, ...props }: MenuSeparatorProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSeparatorSlot asChild {...styleProps}>\n <Separator ref={ref} {...restProps} />\n </MenuSeparatorSlot>\n );\n};\n\nMenuSeparator.displayName = \"Menu.Separator\";\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 { MenuSeparator } from \"./components/menu.separator\";\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 Separator: MenuSeparator,\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 MenuSeparator as _MenuSeparator,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","menuSlotRecipe","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSeparatorSlot","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","MenuSeparator","Separator","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":"ucAMM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,cACV,CAAC,EAIYC,EAAeJ,EAC1B,MACA,MACF,EAIaK,EAAkBJ,EAG7B,SAAU,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aAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,uBAAAC,EACC,GAAGC,EAEJ,SAAA,CAAAvC,EAAAA,IAAC6B,GAAkB,SAAAG,CAAA,CAAM,EACxBC,EACCjC,EAAAA,IAACyC,EAAAA,0CAAA,CAAW,MAAAR,EAAe,SAAAxC,EAAS,EAEnCA,CAAA,CAAA,CAAA,EAGP,CAAA,CACF,CAEJ,EAEAsC,EAAY,YAAc,eCtDnB,MAAMW,EAAqB,CAAC,CACjC,SAAAjD,EACA,GAAGL,CACL,IACSY,EAAAA,IAAC2C,EAAAA,0CAAA,CAAkB,GAAGvD,EAAQ,SAAAK,CAAA,CAAS,EAGhDiD,EAAmB,YAAc,sBCP1B,MAAME,EAAc,CAAC,CAAE,SAAAnD,EAAU,GAAGL,WAEtCuB,EAAA,CAAa,GAAGvB,EAAO,UAAU,MAC/B,SAAAK,EACH,EAIJmD,EAAY,YAAc,eCCnB,MAAM1B,EAAO,CAClB,KAAM/B,EACN,QAASe,EACT,QAASS,EACT,KAAMQ,EACN,UAAWQ,EACX,QAASI,EACT,QAASa,EACT,eAAgBF,CAClB"}
|
package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js → multiline-text-input-D28clI-o.cjs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("react/jsx-runtime"),n=require("react"),C=require("@chakra-ui/react"),P=require("./TextArea-D3FFXnUy.cjs.js"),$=require("./extractStyleProps-
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),n=require("react"),C=require("@chakra-ui/react"),P=require("./TextArea-D3FFXnUy.cjs.js"),$=require("./extractStyleProps-BsLft3q1.cjs.js"),q=require("@commercetools/nimbus-tokens"),S=require("./config-Mt8_uyhI.cjs.js"),H=require("./create-recipe-context-bXYFTZLs.cjs.js"),I=require("./use-recipe-pbWWLWIq.cjs.js"),T=require("./useObjectRef-dXOJdONs.cjs.js"),_=require("./useTextField-BcthGRd8.cjs.js"),l=S.defineRecipe({className:"nimbus-multiline-text-input",base:{display:"block",overflowY:"auto",borderRadius:"200",colorPalette:"neutral",focusVisibleRing:"outside",bg:"transparent",outline:"none",boxShadow:"inset 0 0 0 var(--border-width) var(--border-color)",resize:"vertical",fontFamily:"inherit",_placeholder:{opacity:.5,color:"currentColor"},_disabled:{layerStyle:"disabled",bg:"neutral.3"},"&[data-invalid='true']":{"--border-width":"sizes.50","--border-color":"colors.critical.7",color:"critical.11"},"&::-webkit-resizer":{backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(`
|
|
2
2
|
<svg width="8" height="8" viewBox="0 0 8 8" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<mask id="mask0_4610_25787" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="-1" y="-1" width="9" height="9">
|
|
4
4
|
<rect width="1.03391" height="4.13563" transform="matrix(0.716449 0.69764 -0.716449 0.69764 6.92578 4.05362)" fill="currentColor"/>
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
</g>
|
|
10
10
|
</svg>
|
|
11
11
|
`)}")`,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"200 200",width:"400",height:"400"}},variants:{size:{sm:{minH:800,textStyle:"sm",px:300,py:100},md:{minH:1e3,textStyle:"md",px:400,py:200}},variant:{solid:{"--border-width":"sizes.25","--border-color":"colors.neutral.7",backgroundColor:"neutral.1",_hover:{backgroundColor:"primary.2"}},ghost:{_hover:{backgroundColor:"primary.2"}}}},defaultVariants:{size:"md",variant:"solid"}}),{withContext:z}=H.createRecipeContext({recipe:l}),j=z("textarea"),u=d=>{const{ref:p,rows:h=1,autoGrow:r=!1,...m}=d,g=I.useRecipe({recipe:l}),x=n.useRef(null),t=T.$df56164dff5785e2$export$4338b53315abf666(C.mergeRefs(x,p)),[f,b]=g.splitVariantProps(m),[w,y]=$.extractStyleProps(b),{inputProps:k}=_.$2d73ec29415bd339$export$712718f7aec83d5(y,t),o=n.useCallback(()=>{const e=t.current;if(!e||!r)return;e.style.height="auto";const s=e.scrollHeight,v=window.getComputedStyle(e),a=parseInt(v.maxHeight),R=a?Math.min(s,a):s;e.style.height=`${R}px`},[r,t]);return n.useEffect(()=>{const e=t.current;if(!e||!r)return;o();const i=()=>{o()};return e.addEventListener("input",i),()=>{e.removeEventListener("input",i)}},[o,r,t]),c.jsx(j,{...f,...w,asChild:!0,children:c.jsx(P.$216918bed6669f72$export$f5c9f3c2c4054eec,{ref:t,rows:h,...k})})};u.displayName="MultilineTextInput";exports.MultilineTextInput=u;
|
|
12
|
-
//# sourceMappingURL=multiline-text-input-
|
|
12
|
+
//# sourceMappingURL=multiline-text-input-D28clI-o.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiline-text-input-
|
|
1
|
+
{"version":3,"file":"multiline-text-input-D28clI-o.cjs.js","sources":["../../src/components/multiline-text-input/multiline-text-input.recipe.tsx","../../src/components/multiline-text-input/multiline-text-input.slots.tsx","../../src/components/multiline-text-input/multiline-text-input.tsx"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\nimport { designTokens } from \"@commercetools/nimbus-tokens\";\n\n/**\n * Recipe configuration for the MultilineTextInput component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const multilineTextInputRecipe = defineRecipe({\n // Unique class name prefix for the component\n className: \"nimbus-multiline-text-input\",\n\n // Base styles applied to all instances of the component\n base: {\n display: \"block\",\n overflowY: \"auto\",\n borderRadius: \"200\",\n colorPalette: \"neutral\",\n focusVisibleRing: \"outside\",\n bg: \"transparent\",\n outline: \"none\",\n boxShadow: \"inset 0 0 0 var(--border-width) var(--border-color)\",\n resize: \"vertical\",\n fontFamily: \"inherit\",\n _placeholder: {\n opacity: 0.5,\n color: \"currentColor\",\n },\n _disabled: {\n layerStyle: \"disabled\",\n bg: \"neutral.3\",\n },\n \"&[data-invalid='true']\": {\n \"--border-width\": \"sizes.50\",\n \"--border-color\": \"colors.critical.7\",\n color: \"critical.11\",\n },\n \"&::-webkit-resizer\": {\n backgroundImage: `url(\"data:image/svg+xml,${encodeURIComponent(`\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <mask id=\"mask0_4610_25787\" style=\"mask-type:alpha\" maskUnits=\"userSpaceOnUse\" x=\"-1\" y=\"-1\" width=\"9\" height=\"9\">\n <rect width=\"1.03391\" height=\"4.13563\" transform=\"matrix(0.716449 0.69764 -0.716449 0.69764 6.92578 4.05362)\" fill=\"currentColor\"/>\n <rect width=\"1.03391\" height=\"8.27125\" transform=\"matrix(0.716448 0.69764 -0.716448 0.69764 5.87891 -0.0262451)\" fill=\"currentColor\"/>\n </mask>\n <g mask=\"url(#mask0_4610_25787)\">\n <rect width=\"8\" height=\"8\" fill=\"${designTokens.color[\"semantic-palettes\"].primary.light[9]}\"/>\n </g>\n </svg>\n `)}\")`,\n backgroundRepeat: \"no-repeat\",\n backgroundPosition: \"center\",\n backgroundSize: \"200 200\",\n width: \"400\",\n height: \"400\",\n },\n },\n\n variants: {\n size: {\n sm: {\n minH: 800,\n textStyle: \"sm\",\n px: 300,\n py: 100,\n },\n md: {\n minH: 1000,\n textStyle: \"md\",\n px: 400,\n py: 200,\n },\n },\n\n variant: {\n solid: {\n \"--border-width\": \"sizes.25\",\n \"--border-color\": \"colors.neutral.7\",\n backgroundColor: \"neutral.1\",\n _hover: {\n backgroundColor: \"primary.2\",\n },\n },\n ghost: {\n _hover: {\n backgroundColor: \"primary.2\",\n },\n },\n },\n },\n\n defaultVariants: {\n size: \"md\",\n variant: \"solid\",\n },\n});\n","import {\n type HTMLChakraProps,\n type RecipeVariantProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { multilineTextInputRecipe } from \"./multiline-text-input.recipe\";\n\nexport interface MultilineTextInputRecipeProps\n extends RecipeVariantProps<typeof multilineTextInputRecipe>,\n UnstyledProp {}\n\nexport type MultilineTextInputRootSlotProps = HTMLChakraProps<\n \"textarea\",\n MultilineTextInputRecipeProps\n>;\n\nconst { withContext } = createRecipeContext({\n recipe: multilineTextInputRecipe,\n});\n\n/**\n * Root component that provides the styling context for the MultilineTextInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const MultilineTextInputRootSlot = withContext<\n HTMLTextAreaElement,\n MultilineTextInputRootSlotProps\n>(\"textarea\");\n","import { useRef, useEffect, useCallback } from \"react\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { useObjectRef, useTextField } from \"react-aria\";\nimport { TextArea } from \"react-aria-components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\nimport { MultilineTextInputRootSlot } from \"./multiline-text-input.slots\";\nimport type { MultilineTextInputProps } from \"./multiline-text-input.types\";\nimport { multilineTextInputRecipe } from \"./multiline-text-input.recipe\";\n\n/**\n * # Multiline Text Input\n *\n * A multiline text input component for capturing longer text content.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/forms/multiline-text-input}\n */\nexport const MultilineTextInput = (props: MultilineTextInputProps) => {\n const { ref: forwardedRef, rows = 1, autoGrow = false, ...restProps } = props; // The default `rows` attribute for a textarea is 2, so we need to override it\n const recipe = useRecipe({ recipe: multilineTextInputRecipe });\n\n const localRef = useRef<HTMLTextAreaElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n\n const [recipeProps, remainingProps] = recipe.splitVariantProps(restProps);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n const { inputProps } = useTextField<\"textarea\">(otherProps, ref);\n\n // Auto-grow functionality\n const adjustHeight = useCallback(() => {\n const textarea = ref.current;\n if (!textarea || !autoGrow) return;\n\n // Reset height to auto to get the correct scrollHeight\n textarea.style.height = \"auto\";\n\n // Calculate the new height based on content\n const contentHeight = textarea.scrollHeight;\n\n // Always resize to fit content (both growing and shrinking)\n // This ensures the textarea always fits the content exactly\n const newHeight = contentHeight;\n\n // Apply maxHeight constraint if specified\n const computedStyle = window.getComputedStyle(textarea);\n const maxHeightPxValue = parseInt(computedStyle.maxHeight);\n const finalHeight = maxHeightPxValue\n ? Math.min(newHeight, maxHeightPxValue)\n : newHeight;\n\n // Set the new height\n textarea.style.height = `${finalHeight}px`;\n }, [autoGrow, ref]);\n\n // Set up auto-grow behavior with event listeners\n useEffect(() => {\n const textarea = ref.current;\n if (!textarea || !autoGrow) return;\n\n // Initial adjustment\n adjustHeight();\n\n // Add input event listener for real-time adjustments\n const handleInput = () => {\n adjustHeight();\n };\n\n textarea.addEventListener(\"input\", handleInput);\n\n // Cleanup\n return () => {\n textarea.removeEventListener(\"input\", handleInput);\n };\n }, [adjustHeight, autoGrow, ref]);\n\n return (\n <MultilineTextInputRootSlot {...recipeProps} {...styleProps} asChild>\n <TextArea ref={ref} rows={rows} {...inputProps} />\n </MultilineTextInputRootSlot>\n );\n};\n\nMultilineTextInput.displayName = \"MultilineTextInput\";\n"],"names":["multilineTextInputRecipe","defineRecipe","designTokens","withContext","createRecipeContext","MultilineTextInputRootSlot","MultilineTextInput","props","forwardedRef","rows","autoGrow","restProps","recipe","useRecipe","localRef","useRef","ref","useObjectRef","mergeRefs","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","inputProps","useTextField","adjustHeight","useCallback","textarea","newHeight","computedStyle","maxHeightPxValue","finalHeight","useEffect","handleInput","jsx","TextArea"],"mappings":"mcAOaA,EAA2BC,EAAAA,aAAa,CAEnD,UAAW,8BAGX,KAAM,CACJ,QAAS,QACT,UAAW,OACX,aAAc,MACd,aAAc,UACd,iBAAkB,UAClB,GAAI,cACJ,QAAS,OACT,UAAW,sDACX,OAAQ,WACR,WAAY,UACZ,aAAc,CACZ,QAAS,GACT,MAAO,cAAA,EAET,UAAW,CACT,WAAY,WACZ,GAAI,WAAA,EAEN,yBAA0B,CACxB,iBAAkB,WAClB,iBAAkB,oBAClB,MAAO,aAAA,EAET,qBAAsB,CACpB,gBAAiB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AU,OAG5BkB,EAAS,MAAM,OAAS,OAOxB,MAAMC,EAJgBD,EAAS,aAOzBE,EAAgB,OAAO,iBAAiBF,CAAQ,EAChDG,EAAmB,SAASD,EAAc,SAAS,EACnDE,EAAcD,EAChB,KAAK,IAAIF,EAAWE,CAAgB,EACpCF,EAGJD,EAAS,MAAM,OAAS,GAAGI,CAAW,IACxC,EAAG,CAACtB,EAAUM,CAAG,CAAC,EAGlBiB,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAML,EAAWZ,EAAI,QACrB,GAAI,CAACY,GAAY,CAAClB,EAAU,OAG5BgB,EAAA,EAGA,MAAMQ,EAAc,IAAM,CACxBR,EAAA,CACF,EAEA,OAAAE,EAAS,iBAAiB,QAASM,CAAW,EAGvC,IAAM,CACXN,EAAS,oBAAoB,QAASM,CAAW,CACnD,CACF,EAAG,CAACR,EAAchB,EAAUM,CAAG,CAAC,EAG9BmB,EAAAA,IAAC9B,EAAA,CAA4B,GAAGc,EAAc,GAAGE,EAAY,QAAO,GAClE,SAAAc,EAAAA,IAACC,EAAAA,0CAAA,CAAS,IAAApB,EAAU,KAAAP,EAAa,GAAGe,EAAY,EAClD,CAEJ,EAEAlB,EAAmB,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const w=require("react/jsx-runtime"),q=require("./index-
|
|
2
|
-
//# sourceMappingURL=nimbus-provider-
|
|
1
|
+
"use strict";const w=require("react/jsx-runtime"),q=require("./index-BsmdMT4w.cjs.js"),_=require("react"),I=require("./provider-DFlBEH6q.cjs.js"),z=require("./context-OoV8SSWX.cjs.js"),R=require("./openLink-DkCJYbzq.cjs.js");function D(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const r=D(_);var H=(e,n,t,c,u,l,d,f)=>{let m=document.documentElement,p=["light","dark"];function h(o){(Array.isArray(e)?e:[e]).forEach(b=>{let C=b==="class",x=C&&l?u.map(v=>l[v]||v):u;C?(m.classList.remove(...x),m.classList.add(l&&l[o]?l[o]:o)):m.setAttribute(b,o)}),E(o)}function E(o){f&&p.includes(o)&&(m.style.colorScheme=o)}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(c)h(c);else try{let o=localStorage.getItem(n)||t,b=d&&o==="system"?i():o;h(b)}catch{}},A=["light","dark"],M="(prefers-color-scheme: dark)",K=typeof window>"u",L=r.createContext(void 0),V={setTheme:e=>{},themes:[]},W=()=>{var e;return(e=r.useContext(L))!=null?e:V},J=e=>r.useContext(L)?r.createElement(r.Fragment,null,e.children):r.createElement(Q,{...e}),F=["light","dark"],Q=({forcedTheme:e,disableTransitionOnChange:n=!1,enableSystem:t=!0,enableColorScheme:c=!0,storageKey:u="theme",themes:l=F,defaultTheme:d=t?"system":"light",attribute:f="data-theme",value:m,children:p,nonce:h,scriptProps:E})=>{let[i,o]=r.useState(()=>B(u,d)),[b,C]=r.useState(()=>i==="system"?j():i),x=m?Object.values(m):l,v=r.useCallback(s=>{let a=s;if(!a)return;s==="system"&&t&&(a=j());let g=m?m[a]:a,P=n?G(h):null,S=document.documentElement,O=y=>{y==="class"?(S.classList.remove(...x),g&&S.classList.add(g)):y.startsWith("data-")&&(g?S.setAttribute(y,g):S.removeAttribute(y))};if(Array.isArray(f)?f.forEach(O):O(f),c){let y=A.includes(d)?d:null,N=A.includes(a)?a:y;S.style.colorScheme=N}P?.()},[h]),T=r.useCallback(s=>{let a=typeof s=="function"?s(i):s;o(a);try{localStorage.setItem(u,a)}catch{}},[i]),k=r.useCallback(s=>{let a=j(s);C(a),i==="system"&&t&&!e&&v("system")},[i,e]);r.useEffect(()=>{let s=window.matchMedia(M);return s.addListener(k),k(s),()=>s.removeListener(k)},[k]),r.useEffect(()=>{let s=a=>{a.key===u&&(a.newValue?o(a.newValue):T(d))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[T]),r.useEffect(()=>{v(e??i)},[e,i]);let $=r.useMemo(()=>({theme:i,setTheme:T,forcedTheme:e,resolvedTheme:i==="system"?b:i,themes:t?[...l,"system"]:l,systemTheme:t?b:void 0}),[i,T,e,b,t,l]);return r.createElement(L.Provider,{value:$},r.createElement(U,{forcedTheme:e,storageKey:u,attribute:f,enableSystem:t,enableColorScheme:c,defaultTheme:d,value:m,themes:l,nonce:h,scriptProps:E}),p)},U=r.memo(({forcedTheme:e,storageKey:n,attribute:t,enableSystem:c,enableColorScheme:u,defaultTheme:l,value:d,themes:f,nonce:m,scriptProps:p})=>{let h=JSON.stringify([t,n,l,e,f,d,c,u]).slice(1,-1);return r.createElement("script",{...p,suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(${H.toString()})(${h})`}})}),B=(e,n)=>{if(K)return;let t;try{t=localStorage.getItem(e)||void 0}catch{}return t||n},G=e=>{let n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(n),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(n)},1)}},j=e=>(e||(e=window.matchMedia(M)),e.matches?"dark":"light");const X=e=>w.jsx(J,{attribute:"class",disableTransitionOnChange:!0,...e});function Y({children:e,locale:n,router:t,...c}){const u=w.jsx(I.ChakraProvider,{value:q.system,children:w.jsx(X,{enableSystem:!1,...c,children:w.jsx(z.$18f2051aff69b9bf$export$a54013f0d02a8f82,{locale:n,children:e})})});return t?w.jsx(R.$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb,{...t,children:u}):u}exports.NimbusProvider=Y;exports.z=W;
|
|
2
|
+
//# sourceMappingURL=nimbus-provider-BlfO5_bi.cjs.js.map
|
package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js.map → nimbus-provider-BlfO5_bi.cjs.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nimbus-provider-CBZCiFEH.cjs.js","sources":["../../../../node_modules/.pnpm/next-themes@0.4.6_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next-themes/dist/index.mjs","../../src/components/nimbus-provider/components/nimbus-provider.color-mode-provider.tsx","../../src/components/nimbus-provider/nimbus-provider.tsx"],"sourcesContent":["\"use client\";import*as t from\"react\";var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=[\"light\",\"dark\"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y===\"class\",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n===\"system\"?c():n;p(y)}catch(n){}};var b=[\"light\",\"dark\"],I=\"(prefers-color-scheme: dark)\",O=typeof window==\"undefined\",x=t.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return(e=t.useContext(x))!=null?e:U},J=e=>t.useContext(x)?t.createElement(t.Fragment,null,e.children):t.createElement(V,{...e}),N=[\"light\",\"dark\"],V=({forcedTheme:e,disableTransitionOnChange:i=!1,enableSystem:s=!0,enableColorScheme:u=!0,storageKey:m=\"theme\",themes:a=N,defaultTheme:l=s?\"system\":\"light\",attribute:h=\"data-theme\",value:d,children:w,nonce:p,scriptProps:R})=>{let[c,n]=t.useState(()=>H(m,l)),[T,y]=t.useState(()=>c===\"system\"?E():c),k=d?Object.values(d):a,S=t.useCallback(o=>{let r=o;if(!r)return;o===\"system\"&&s&&(r=E());let v=d?d[r]:r,C=i?W(p):null,P=document.documentElement,L=g=>{g===\"class\"?(P.classList.remove(...k),v&&P.classList.add(v)):g.startsWith(\"data-\")&&(v?P.setAttribute(g,v):P.removeAttribute(g))};if(Array.isArray(h)?h.forEach(L):L(h),u){let g=b.includes(l)?l:null,D=b.includes(r)?r:g;P.style.colorScheme=D}C==null||C()},[p]),f=t.useCallback(o=>{let r=typeof o==\"function\"?o(c):o;n(r);try{localStorage.setItem(m,r)}catch(v){}},[c]),A=t.useCallback(o=>{let r=E(o);y(r),c===\"system\"&&s&&!e&&S(\"system\")},[c,e]);t.useEffect(()=>{let o=window.matchMedia(I);return o.addListener(A),A(o),()=>o.removeListener(A)},[A]),t.useEffect(()=>{let o=r=>{r.key===m&&(r.newValue?n(r.newValue):f(l))};return window.addEventListener(\"storage\",o),()=>window.removeEventListener(\"storage\",o)},[f]),t.useEffect(()=>{S(e!=null?e:c)},[e,c]);let Q=t.useMemo(()=>({theme:c,setTheme:f,forcedTheme:e,resolvedTheme:c===\"system\"?T:c,themes:s?[...a,\"system\"]:a,systemTheme:s?T:void 0}),[c,f,e,T,s,a]);return t.createElement(x.Provider,{value:Q},t.createElement(_,{forcedTheme:e,storageKey:m,attribute:h,enableSystem:s,enableColorScheme:u,defaultTheme:l,value:d,themes:a,nonce:p,scriptProps:R}),w)},_=t.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return t.createElement(\"script\",{...w,suppressHydrationWarning:!0,nonce:typeof window==\"undefined\"?d:\"\",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})}),H=(e,i)=>{if(O)return;let s;try{s=localStorage.getItem(e)||void 0}catch(u){}return s||i},W=e=>{let i=document.createElement(\"style\");return e&&i.setAttribute(\"nonce\",e),i.appendChild(document.createTextNode(\"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\")),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(i)},1)}},E=e=>(e||(e=window.matchMedia(I)),e.matches?\"dark\":\"light\");export{J as ThemeProvider,z as useTheme};\n","import { ThemeProvider } from \"next-themes\";\nimport type { ColorModeProviderProps } from \"../nimbus-provider.types\";\n\nexport const NimbusColorModeProvider = (props: ColorModeProviderProps) => {\n return (\n <ThemeProvider attribute=\"class\" disableTransitionOnChange {...props} />\n );\n};\n","import { ChakraProvider } from \"@chakra-ui/react/styled-system\";\nimport { I18nProvider, RouterProvider } from \"react-aria\";\nimport { system } from \"@/theme\";\nimport type { NimbusProviderProps } from \"./nimbus-provider.types\";\nimport { NimbusColorModeProvider } from \"./components/nimbus-provider.color-mode-provider\";\n\n/**\n * # NimbusProvider\n *\n * provides an environment for the rest of the components to work in\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/utilities/nimbusprovider}\n */\nexport function NimbusProvider({\n children,\n locale,\n router,\n ...props\n}: NimbusProviderProps) {\n // Inner content with all the existing providers\n const content = (\n <ChakraProvider value={system}>\n <NimbusColorModeProvider enableSystem={false} {...props}>\n <I18nProvider locale={locale}>{children}</I18nProvider>\n </NimbusColorModeProvider>\n </ChakraProvider>\n );\n\n // If router config is provided, wrap with RouterProvider for client-side routing\n if (router) {\n return <RouterProvider {...router}>{content}</RouterProvider>;\n }\n\n // Default behavior when no router is configured\n return content;\n}\n"],"names":["M","i","s","u","m","a","l","h","d","w","p","n","y","k","S","f","R","c","b","I","O","x","t","U","z","V","N","H","T","E","o","r","v","C","W","P","L","g","D","A","Q","_","NimbusColorModeProvider","props","ThemeProvider","NimbusProvider","children","locale","router","content","jsx","ChakraProvider","system","I18nProvider","RouterProvider"],"mappings":"2fAAqC,IAAIA,EAAE,CAAC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,IAAI,CAAC,IAAIC,EAAE,SAAS,gBAAgBC,EAAE,CAAC,QAAQ,MAAM,EAAE,SAASC,EAAEC,EAAE,EAAE,MAAM,QAAQ,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OAAAC,EACA,GAAGL,CACL,EAAwB,CAEtB,MAAMM,EACJC,MAACC,EAAAA,eAAA,CAAe,MAAOC,EAAAA,OACrB,eAACV,EAAA,CAAwB,aAAc,GAAQ,GAAGC,EAChD,SAAAO,MAACG,EAAAA,0CAAA,CAAa,OAAAN,EAAiB,SAAAD,CAAA,CAAS,EAC1C,EACF,EAIF,OAAIE,EACKE,EAAAA,IAACI,EAAAA,0CAAA,CAAgB,GAAGN,EAAS,SAAAC,EAAQ,EAIvCA,CACT","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"nimbus-provider-BlfO5_bi.cjs.js","sources":["../../../../node_modules/.pnpm/next-themes@0.4.6_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next-themes/dist/index.mjs","../../src/components/nimbus-provider/components/nimbus-provider.color-mode-provider.tsx","../../src/components/nimbus-provider/nimbus-provider.tsx"],"sourcesContent":["\"use client\";import*as t from\"react\";var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=[\"light\",\"dark\"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y===\"class\",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n===\"system\"?c():n;p(y)}catch(n){}};var b=[\"light\",\"dark\"],I=\"(prefers-color-scheme: dark)\",O=typeof window==\"undefined\",x=t.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return(e=t.useContext(x))!=null?e:U},J=e=>t.useContext(x)?t.createElement(t.Fragment,null,e.children):t.createElement(V,{...e}),N=[\"light\",\"dark\"],V=({forcedTheme:e,disableTransitionOnChange:i=!1,enableSystem:s=!0,enableColorScheme:u=!0,storageKey:m=\"theme\",themes:a=N,defaultTheme:l=s?\"system\":\"light\",attribute:h=\"data-theme\",value:d,children:w,nonce:p,scriptProps:R})=>{let[c,n]=t.useState(()=>H(m,l)),[T,y]=t.useState(()=>c===\"system\"?E():c),k=d?Object.values(d):a,S=t.useCallback(o=>{let r=o;if(!r)return;o===\"system\"&&s&&(r=E());let v=d?d[r]:r,C=i?W(p):null,P=document.documentElement,L=g=>{g===\"class\"?(P.classList.remove(...k),v&&P.classList.add(v)):g.startsWith(\"data-\")&&(v?P.setAttribute(g,v):P.removeAttribute(g))};if(Array.isArray(h)?h.forEach(L):L(h),u){let g=b.includes(l)?l:null,D=b.includes(r)?r:g;P.style.colorScheme=D}C==null||C()},[p]),f=t.useCallback(o=>{let r=typeof o==\"function\"?o(c):o;n(r);try{localStorage.setItem(m,r)}catch(v){}},[c]),A=t.useCallback(o=>{let r=E(o);y(r),c===\"system\"&&s&&!e&&S(\"system\")},[c,e]);t.useEffect(()=>{let o=window.matchMedia(I);return o.addListener(A),A(o),()=>o.removeListener(A)},[A]),t.useEffect(()=>{let o=r=>{r.key===m&&(r.newValue?n(r.newValue):f(l))};return window.addEventListener(\"storage\",o),()=>window.removeEventListener(\"storage\",o)},[f]),t.useEffect(()=>{S(e!=null?e:c)},[e,c]);let Q=t.useMemo(()=>({theme:c,setTheme:f,forcedTheme:e,resolvedTheme:c===\"system\"?T:c,themes:s?[...a,\"system\"]:a,systemTheme:s?T:void 0}),[c,f,e,T,s,a]);return t.createElement(x.Provider,{value:Q},t.createElement(_,{forcedTheme:e,storageKey:m,attribute:h,enableSystem:s,enableColorScheme:u,defaultTheme:l,value:d,themes:a,nonce:p,scriptProps:R}),w)},_=t.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return t.createElement(\"script\",{...w,suppressHydrationWarning:!0,nonce:typeof window==\"undefined\"?d:\"\",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})}),H=(e,i)=>{if(O)return;let s;try{s=localStorage.getItem(e)||void 0}catch(u){}return s||i},W=e=>{let i=document.createElement(\"style\");return e&&i.setAttribute(\"nonce\",e),i.appendChild(document.createTextNode(\"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\")),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(i)},1)}},E=e=>(e||(e=window.matchMedia(I)),e.matches?\"dark\":\"light\");export{J as ThemeProvider,z as useTheme};\n","import { ThemeProvider } from \"next-themes\";\nimport type { ColorModeProviderProps } from \"../nimbus-provider.types\";\n\nexport const NimbusColorModeProvider = (props: ColorModeProviderProps) => {\n return (\n <ThemeProvider attribute=\"class\" disableTransitionOnChange {...props} />\n );\n};\n","import { ChakraProvider } from \"@chakra-ui/react/styled-system\";\nimport { I18nProvider, RouterProvider } from \"react-aria\";\nimport { system } from \"@/theme\";\nimport type { NimbusProviderProps } from \"./nimbus-provider.types\";\nimport { NimbusColorModeProvider } from \"./components/nimbus-provider.color-mode-provider\";\n\n/**\n * # NimbusProvider\n *\n * provides an environment for the rest of the components to work in\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/utilities/nimbusprovider}\n */\nexport function NimbusProvider({\n children,\n locale,\n router,\n ...props\n}: NimbusProviderProps) {\n // Inner content with all the existing providers\n const content = (\n <ChakraProvider value={system}>\n <NimbusColorModeProvider enableSystem={false} {...props}>\n <I18nProvider locale={locale}>{children}</I18nProvider>\n </NimbusColorModeProvider>\n </ChakraProvider>\n );\n\n // If router config is provided, wrap with RouterProvider for client-side routing\n if (router) {\n return <RouterProvider {...router}>{content}</RouterProvider>;\n }\n\n // Default behavior when no router is configured\n return content;\n}\n"],"names":["M","i","s","u","m","a","l","h","d","w","p","n","y","k","S","f","R","c","b","I","O","x","t","U","z","V","N","H","T","E","o","r","v","C","W","P","L","g","D","A","Q","_","NimbusColorModeProvider","props","ThemeProvider","NimbusProvider","children","locale","router","content","jsx","ChakraProvider","system","I18nProvider","RouterProvider"],"mappings":"2fAAqC,IAAIA,EAAE,CAAC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,IAAI,CAAC,IAAIC,EAAE,SAAS,gBAAgBC,EAAE,CAAC,QAAQ,MAAM,EAAE,SAASC,EAAEC,EAAE,EAAE,MAAM,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,QAAQC,GAAG,CAAC,IAAIC,EAAED,IAAI,QAAQE,EAAED,GAAGR,EAAED,EAAE,IAAIW,GAAGV,EAAEU,CAAC,GAAGA,CAAC,EAAEX,EAAES,GAAGL,EAAE,UAAU,OAAO,GAAGM,CAAC,EAAEN,EAAE,UAAU,IAAIH,GAAGA,EAAEM,CAAC,EAAEN,EAAEM,CAAC,EAAEA,CAAC,GAAGH,EAAE,aAAaI,EAAED,CAAC,CAAC,CAAC,EAAEK,EAAEL,CAAC,CAAC,CAAC,SAASK,EAAEL,EAAE,CAACJ,GAAGE,EAAE,SAASE,CAAC,IAAIH,EAAE,MAAM,YAAYG,EAAE,CAAC,SAASM,GAAG,CAAC,OAAO,OAAO,WAAW,8BAA8B,EAAE,QAAQ,OAAO,OAAO,CAAC,GAAGd,EAAEO,EAAEP,CAAC,MAAO,IAAG,CAAC,IAAIQ,EAAE,aAAa,QAAQV,CAAC,GAAGC,EAAEU,EAAEN,GAAGK,IAAI,SAASM,IAAIN,EAAED,EAAEE,CAAC,CAAC,MAAS,CAAC,CAAC,EAAMM,EAAE,CAAC,QAAQ,MAAM,EAAEC,EAAE,+BAA+BC,EAAE,OAAO,OAAQ,IAAYC,EAAEC,EAAE,cAAc,MAAM,EAAEC,EAAE,CAAC,SAAS,GAAG,CAAC,EAAE,OAAO,CAAA,CAAE,EAAEC,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAEF,EAAE,WAAWD,CAAC,IAAI,KAAK,EA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AW,IAAI,CAAC,SAAS,KAAK,YAAYA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE4B,EAAE,IAAI,IAAI,EAAE,OAAO,WAAWV,CAAC,GAAG,EAAE,QAAQ,OAAO,SCGtuG,MAAMuB,EAA2BC,SAEnCC,EAAA,CAAc,UAAU,QAAQ,0BAAyB,GAAE,GAAGD,EAAO,ECQnE,SAASE,EAAe,CAC7B,SAAAC,EACA,OAAAC,EACA,OAAAC,EACA,GAAGL,CACL,EAAwB,CAEtB,MAAMM,EACJC,MAACC,EAAAA,eAAA,CAAe,MAAOC,EAAAA,OACrB,eAACV,EAAA,CAAwB,aAAc,GAAQ,GAAGC,EAChD,SAAAO,MAACG,EAAAA,0CAAA,CAAa,OAAAN,EAAiB,SAAAD,CAAA,CAAS,EAC1C,EACF,EAIF,OAAIE,EACKE,EAAAA,IAACI,EAAAA,0CAAA,CAAgB,GAAGN,EAAS,SAAAC,EAAQ,EAIvCA,CACT","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const E=require("react/jsx-runtime"),o=require("react"),ba=require("@chakra-ui/react"),fa=require("./box-BwCVnAwb.cjs.js"),de=require("@commercetools/nimbus-icons"),$a=require("./extractStyleProps-BFdEZDYW.cjs.js"),me=require("./Button-BtJHe9xY.cjs.js"),pe=require("./create-slot-recipe-context-CimocFDH.cjs.js"),ma=require("./index-sFOzzmTG.cjs.js"),pa=require("./context-OoV8SSWX.cjs.js"),xa=require("./useObjectRef-dXOJdONs.cjs.js"),va=require("./useControlledState-D0L6S_5r.cjs.js"),x=require("./number-DHvo-MDe.cjs.js"),xe=require("./useFormValidation-BEaCuNx1.cjs.js"),be=require("./NumberFormatter-DewVDY5w.cjs.js"),ve=require("./useSpinButton-DA7sVP3T.cjs.js"),S=require("./mergeProps-BA5Cwf5w.cjs.js"),La=require("./filterDOMProps-WUskt27c.cjs.js"),J=require("./platform-BDLy2vDY.cjs.js"),Da=require("./useFormReset--wPlnEOl.cjs.js"),Fa=require("./useFocus-BtJ38vev.cjs.js"),Pa=require("./useFocusWithin-BDSWp3rw.cjs.js"),Na=require("./useEvent-CuUOU5WV.cjs.js"),Sa=require("./useTextField-BcthGRd8.cjs.js"),Ba=require("./useLocalizedStringFormatter-sB0mFYtL.cjs.js"),fe=require("./useProgressBar-DWH4I0qR.cjs.js");function Ca(e,a){let{onScroll:r,isDisabled:i}=e,c=o.useCallback(n=>{n.ctrlKey||(n.preventDefault(),n.stopPropagation(),r&&r({deltaX:n.deltaX,deltaY:n.deltaY}))},[r]);Na.$e9faafb641e167db$export$90fc3a17d93f704c(a,"wheel",i?void 0:c)}function ga(e){let{minValue:a,maxValue:r,step:i,formatOptions:c,value:n,defaultValue:s=NaN,onChange:v,locale:d,isDisabled:F,isReadOnly:L}=e;n===null&&(n=NaN),n!==void 0&&!isNaN(n)&&(i!==void 0&&!isNaN(i)?n=x.$9446cca9a3875146$export$cb6e0bb50bc19463(n,a,r,i):n=x.$9446cca9a3875146$export$7d15b64cf5a3a4c4(n,a,r)),isNaN(s)||(i!==void 0&&!isNaN(i)?s=x.$9446cca9a3875146$export$cb6e0bb50bc19463(s,a,r,i):s=x.$9446cca9a3875146$export$7d15b64cf5a3a4c4(s,a,r));let[l,t]=va.$458b0a5536c1a7cf$export$40bfa8c7b0832715(n,isNaN(s)?NaN:s,v),[f]=o.useState(l),[P,D]=o.useState(()=>isNaN(l)?"":new be.$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(d,c).format(l)),p=o.useMemo(()=>new ve.$6c7bd7858deea686$export$cd11ab140839f11d(d,c),[d,c]),M=o.useMemo(()=>p.getNumberingSystem(P),[p,P]),h=o.useMemo(()=>new be.$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(d,{...c,numberingSystem:M}),[d,c,M]),K=o.useMemo(()=>h.resolvedOptions(),[h]),N=o.useCallback(u=>isNaN(u)||u===null?"":h.format(u),[h]),B=xe.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:l}),$=i!==void 0&&!isNaN(i)?i:1;K.style==="percent"&&(i===void 0||isNaN(i))&&($=.01);let[w,W]=o.useState(l),[q,z]=o.useState(d),[y,U]=o.useState(c);(!Object.is(l,w)||d!==q||c!==y)&&(D(N(l)),W(l),z(d),U(c));let b=o.useMemo(()=>p.parse(P),[p,P]),R=()=>{if(!P.length){t(NaN),D(n===void 0?"":N(l));return}if(isNaN(b)){D(N(l));return}let u;i===void 0||isNaN(i)?u=x.$9446cca9a3875146$export$7d15b64cf5a3a4c4(b,a,r):u=x.$9446cca9a3875146$export$cb6e0bb50bc19463(b,a,r,i),u=p.parse(N(u)),t(u),D(N(n===void 0?u:l)),B.commitValidation()},I=(u,A=0)=>{let C=b;if(isNaN(C)){let g=isNaN(A)?0:A;return x.$9446cca9a3875146$export$cb6e0bb50bc19463(g,a,r,$)}else{let g=x.$9446cca9a3875146$export$cb6e0bb50bc19463(C,a,r,$);return u==="+"&&g>C||u==="-"&&g<C?g:x.$9446cca9a3875146$export$cb6e0bb50bc19463(Q(u,C,$),a,r,$)}},k=()=>{let u=I("+",a);u===l&&D(N(u)),t(u),B.commitValidation()},Z=()=>{let u=I("-",r);u===l&&D(N(u)),t(u),B.commitValidation()},T=()=>{r!=null&&(t(x.$9446cca9a3875146$export$cb6e0bb50bc19463(r,a,r,$)),B.commitValidation())},_=()=>{a!=null&&(t(a),B.commitValidation())},j=o.useMemo(()=>!F&&!L&&(isNaN(b)||r===void 0||isNaN(r)||x.$9446cca9a3875146$export$cb6e0bb50bc19463(b,a,r,$)>b||Q("+",b,$)<=r),[F,L,a,r,$,b]),Y=o.useMemo(()=>!F&&!L&&(isNaN(b)||a===void 0||isNaN(a)||x.$9446cca9a3875146$export$cb6e0bb50bc19463(b,a,r,$)<b||Q("-",b,$)>=a),[F,L,a,r,$,b]);return{...B,validate:u=>p.isValidPartialNumber(u,a,r),increment:k,incrementToMax:T,decrement:Z,decrementToMin:_,canIncrement:j,canDecrement:Y,minValue:a,maxValue:r,numberValue:b,defaultNumberValue:isNaN(s)?f:s,setNumberValue:t,setInputValue:D,inputValue:P,commit:R}}function Q(e,a,r){let i=e==="+"?a+r:a-r;if(a%1!==0||r%1!==0){const c=a.toString().split("."),n=r.toString().split("."),s=c[1]&&c[1].length||0,v=n[1]&&n[1].length||0,d=Math.pow(10,Math.max(s,v));a=Math.round(a*d),r=Math.round(r*d),i=e==="+"?a+r:a-r,i/=d}return i}function $e(){return typeof window<"u"&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"}function Va(e,a,r){let i=S.$8ae05eaa5c114e9c$export$7f54fc3180508a52(l=>{let t=r.current;if(!t)return;let f=null;switch(l.inputType){case"historyUndo":case"historyRedo":return;case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":f=t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteContentForward":f=t.selectionEnd===t.selectionStart?t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd+1):t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteContentBackward":f=t.selectionEnd===t.selectionStart?t.value.slice(0,t.selectionStart-1)+t.value.slice(t.selectionStart):t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":f=t.value.slice(t.selectionStart);break;default:l.data!=null&&(f=t.value.slice(0,t.selectionStart)+l.data+t.value.slice(t.selectionEnd));break}(f==null||!a.validate(f))&&l.preventDefault()});o.useEffect(()=>{if(!$e()||!r.current)return;let l=r.current;return l.addEventListener("beforeinput",i,!1),()=>{l.removeEventListener("beforeinput",i,!1)}},[r,i]);let c=$e()?null:l=>{let t=l.target.value.slice(0,l.target.selectionStart)+l.data+l.target.value.slice(l.target.selectionEnd);a.validate(t)||l.preventDefault()},{labelProps:n,inputProps:s,descriptionProps:v,errorMessageProps:d,...F}=Sa.$2d73ec29415bd339$export$712718f7aec83d5(e,r),L=o.useRef(null);return{inputProps:S.$3ef42575df84b30b$export$9d1611c77c2fe928(s,{onBeforeInput:c,onCompositionStart(){let{value:l,selectionStart:t,selectionEnd:f}=r.current;L.current={value:l,selectionStart:t,selectionEnd:f}},onCompositionEnd(){if(r.current&&!a.validate(r.current.value)){let{value:l,selectionStart:t,selectionEnd:f}=L.current;r.current.value=l,r.current.setSelectionRange(t,f),a.setInputValue(l)}}}),labelProps:n,descriptionProps:v,errorMessageProps:d,...F}}var Le={};Le={decrease:e=>`خفض ${e.fieldLabel}`,increase:e=>`زيادة ${e.fieldLabel}`,numberField:"حقل رقمي"};var De={};De={decrease:e=>`Намаляване ${e.fieldLabel}`,increase:e=>`Усилване ${e.fieldLabel}`,numberField:"Номер на полето"};var Fe={};Fe={decrease:e=>`Snížit ${e.fieldLabel}`,increase:e=>`Zvýšit ${e.fieldLabel}`,numberField:"Číselné pole"};var Pe={};Pe={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`Øg ${e.fieldLabel}`,numberField:"Talfelt"};var Ne={};Ne={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erhöhen`,numberField:"Nummernfeld"};var Se={};Se={decrease:e=>`Μείωση ${e.fieldLabel}`,increase:e=>`Αύξηση ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"};var Be={};Be={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"};var Ce={};Ce={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de número"};var ge={};ge={decrease:e=>`Vähenda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri väli"};var Ve={};Ve={decrease:e=>`Vähennä ${e.fieldLabel}`,increase:e=>`Lisää ${e.fieldLabel}`,numberField:"Numerokenttä"};var Ee={};Ee={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"};var he={};he={decrease:e=>`הקטן ${e.fieldLabel}`,increase:e=>`הגדל ${e.fieldLabel}`,numberField:"שדה מספר"};var ye={};ye={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Povećaj ${e.fieldLabel}`,numberField:"Polje broja"};var Ie={};Ie={decrease:e=>`${e.fieldLabel} csökkentése`,increase:e=>`${e.fieldLabel} növelése`,numberField:"Számmező"};var Me={};Me={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"};var we={};we={decrease:e=>`${e.fieldLabel}を縮小`,increase:e=>`${e.fieldLabel}を拡大`,numberField:"数値フィールド"};var qe={};qe={decrease:e=>`${e.fieldLabel} 감소`,increase:e=>`${e.fieldLabel} 증가`,numberField:"번호 필드"};var ke={};ke={decrease:e=>`Sumažinti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"};var Oe={};Oe={decrease:e=>`Samazināšana ${e.fieldLabel}`,increase:e=>`Palielināšana ${e.fieldLabel}`,numberField:"Skaitļu lauks"};var Re={};Re={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`Øk ${e.fieldLabel}`,numberField:"Tallfelt"};var Te={};Te={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"};var je={};je={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwiększ ${e.fieldLabel}`,numberField:"Pole numeru"};var Ae={};Ae={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de número"};var Ke={};Ke={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo numérico"};var We={};We={decrease:e=>`Scădere ${e.fieldLabel}`,increase:e=>`Creștere ${e.fieldLabel}`,numberField:"Câmp numeric"};var ze={};ze={decrease:e=>`Уменьшение ${e.fieldLabel}`,increase:e=>`Увеличение ${e.fieldLabel}`,numberField:"Числовое поле"};var Ue={};Ue={decrease:e=>`Znížiť ${e.fieldLabel}`,increase:e=>`Zvýšiť ${e.fieldLabel}`,numberField:"Číselné pole"};var Ze={};Ze={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Povečajte ${e.fieldLabel}`,numberField:"Številčno polje"};var _e={};_e={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Povećaj ${e.fieldLabel}`,numberField:"Polje broja"};var Ye={};Ye={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`Öka ${e.fieldLabel}`,numberField:"Nummerfält"};var He={};He={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} arttır`,numberField:"Sayı alanı"};var Ge={};Ge={decrease:e=>`Зменшити ${e.fieldLabel}`,increase:e=>`Збільшити ${e.fieldLabel}`,numberField:"Поле номера"};var Xe={};Xe={decrease:e=>`降低 ${e.fieldLabel}`,increase:e=>`提高 ${e.fieldLabel}`,numberField:"数字字段"};var Je={};Je={decrease:e=>`縮小 ${e.fieldLabel}`,increase:e=>`放大 ${e.fieldLabel}`,numberField:"數字欄位"};var Qe={};Qe={"ar-AE":Le,"bg-BG":De,"cs-CZ":Fe,"da-DK":Pe,"de-DE":Ne,"el-GR":Se,"en-US":Be,"es-ES":Ce,"et-EE":ge,"fi-FI":Ve,"fr-FR":Ee,"he-IL":he,"hr-HR":ye,"hu-HU":Ie,"it-IT":Me,"ja-JP":we,"ko-KR":qe,"lt-LT":ke,"lv-LV":Oe,"nb-NO":Re,"nl-NL":Te,"pl-PL":je,"pt-BR":Ae,"pt-PT":Ke,"ro-RO":We,"ru-RU":ze,"sk-SK":Ue,"sl-SI":Ze,"sr-SP":_e,"sv-SE":Ye,"tr-TR":He,"uk-UA":Ge,"zh-CN":Xe,"zh-TW":Je};function Ea(e){return e&&e.__esModule?e.default:e}function ha(e,a,r){let{id:i,decrementAriaLabel:c,incrementAriaLabel:n,isDisabled:s,isReadOnly:v,isRequired:d,minValue:F,maxValue:L,autoFocus:l,label:t,formatOptions:f,onBlur:P=()=>{},onFocus:D,onFocusChange:p,onKeyDown:M,onKeyUp:h,description:K,errorMessage:N,isWheelDisabled:B,...$}=e,{increment:w,incrementToMax:W,decrement:q,decrementToMin:z,numberValue:y,inputValue:U,commit:b,commitValidation:R}=a;const I=Ba.$fca6afa0e843324b$export$f12b703ca79dfbb1(Ea(Qe),"@react-aria/numberfield");let k=S.$bdb11010cef70236$export$f680877a34711e37(i),{focusProps:Z}=Fa.$a1ea59d68270f0dd$export$f8168d8dd8fd66e6({onBlur(){b()}}),T=fe.$a916eb452884faea$export$b7a616150fdb9f44(f),_=o.useMemo(()=>T.resolvedOptions(),[T]),j=fe.$a916eb452884faea$export$b7a616150fdb9f44({...f,currencySign:void 0}),Y=o.useMemo(()=>isNaN(y)?"":j.format(y),[j,y]),{spinButtonProps:ae,incrementButtonProps:u,decrementButtonProps:A}=ve.$d2e8511e6f209edf$export$e908e06f4b8e3402({isDisabled:s,isReadOnly:v,isRequired:d,maxValue:L,minValue:F,onIncrement:w,onIncrementToMax:W,onDecrement:q,onDecrementToMin:z,value:y,textValue:Y}),[C,g]=o.useState(!1),{focusWithinProps:aa}=Pa.$9ab94262bd0047c7$export$420e68273165f4ec({isDisabled:s,onFocusWithinChange:g}),ra=o.useCallback(m=>{Math.abs(m.deltaY)<=Math.abs(m.deltaX)||(m.deltaY>0?w():m.deltaY<0&&q())},[q,w]);Ca({onScroll:ra,isDisabled:B||s||v||!C},r);var H;let re=((H=_.maximumFractionDigits)!==null&&H!==void 0?H:0)>0,te=a.minValue===void 0||isNaN(a.minValue)||a.minValue<0,O="numeric";J.$c87311424ea30a05$export$186c6964ca17d99()?te?O="text":re&&(O="decimal"):J.$c87311424ea30a05$export$a11b0059900ceec8()&&(te?O="numeric":re&&(O="decimal"));let ta=m=>{a.validate(m)&&a.setInputValue(m)},la=La.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e),le=o.useCallback(m=>{m.nativeEvent.isComposing||(m.key==="Enter"?(b(),R()):m.continuePropagation())},[b,R]),{isInvalid:ie,validationErrors:ia,validationDetails:na}=a.displayValidation,{labelProps:ne,inputProps:ua,descriptionProps:oa,errorMessageProps:sa}=Va({...$,...la,name:void 0,form:void 0,label:t,autoFocus:l,isDisabled:s,isReadOnly:v,isRequired:d,validate:void 0,[xe.$e5be200c675c3b3a$export$a763b9476acd3eb]:a,value:U,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:k,type:"text",inputMode:O,onChange:ta,onBlur:P,onFocus:D,onFocusChange:p,onKeyDown:o.useMemo(()=>S.$ff5963eb1fccf552$export$e08e3b67e392101e(le,M),[le,M]),onKeyUp:h,description:K,errorMessage:N},a,r);Da.$99facab73266f662$export$5add1d006293d136(r,a.defaultNumberValue,a.setNumberValue);let ue=S.$3ef42575df84b30b$export$9d1611c77c2fe928(ae,Z,ua,{role:null,"aria-roledescription":J.$c87311424ea30a05$export$fedb369cb70207f1()?null:I.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});e.validationBehavior==="native"&&(ue["aria-required"]=void 0);let oe=m=>{var X;document.activeElement!==r.current&&(m.pointerType==="mouse"?(X=r.current)===null||X===void 0||X.focus():m.target.focus())},G=e["aria-label"]||(typeof e.label=="string"?e.label:""),V;G||(V=e.label!=null?ne.id:e["aria-labelledby"]);let se=S.$bdb11010cef70236$export$f680877a34711e37(),ce=S.$bdb11010cef70236$export$f680877a34711e37(),ca=S.$3ef42575df84b30b$export$9d1611c77c2fe928(u,{"aria-label":n||I.format("increase",{fieldLabel:G}).trim(),id:V&&!n?se:null,"aria-labelledby":V&&!n?`${se} ${V}`:null,"aria-controls":k,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!a.canIncrement,onPressStart:oe}),da=S.$3ef42575df84b30b$export$9d1611c77c2fe928(A,{"aria-label":c||I.format("decrease",{fieldLabel:G}).trim(),id:V&&!c?ce:null,"aria-labelledby":V&&!c?`${ce} ${V}`:null,"aria-controls":k,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!a.canDecrement,onPressStart:oe});return{groupProps:{...aa,role:"group","aria-disabled":s,"aria-invalid":ie?"true":void 0},labelProps:ne,inputProps:ue,incrementButtonProps:ca,decrementButtonProps:da,errorMessageProps:sa,descriptionProps:oa,isInvalid:ie,validationErrors:ia,validationDetails:na}}const{withContext:ee,withProvider:ya}=pe.createSlotRecipeContext({key:"numberInput"}),Ia=ya("div","root"),Ma=ee("input","input"),wa=ee(me.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,"incrementButton"),qa=ee(me.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,"decrementButton"),ea=e=>{const{size:a,ref:r,...i}=e,{locale:c}=pa.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),n=o.useRef(null),s=xa.$df56164dff5785e2$export$4338b53315abf666(ba.mergeRefs(n,r)),v=pe.useSlotRecipe({recipe:ma.numberInputRecipe}),[d,F]=v.splitVariantProps(i),[L,l]=$a.extractStyleProps(F),t=ga({locale:c,...l}),{inputProps:f,incrementButtonProps:P,decrementButtonProps:D}=ha(l,t,s),p={"data-invalid":e.isInvalid,"data-disabled":e.isDisabled};return E.jsxs(Ia,{...d,...L,size:a,children:[E.jsx(Ma,{ref:s,...f,...p,size:a}),E.jsxs(fa.Box,{position:"absolute",top:"0",right:"0",display:"flex",flexDirection:"column",height:"full",children:[E.jsx(wa,{"aria-label":"Increment",...P,...p,children:E.jsx(de.KeyboardArrowUp,{})}),E.jsx(qa,{"aria-label":"Decrement",...D,...p,children:E.jsx(de.KeyboardArrowDown,{})})]})]})};ea.displayName="NumberInput";exports.NumberInput=ea;
|
|
2
|
-
//# sourceMappingURL=number-input-
|
|
1
|
+
"use strict";const E=require("react/jsx-runtime"),o=require("react"),ba=require("@chakra-ui/react"),fa=require("./box-BwCVnAwb.cjs.js"),de=require("@commercetools/nimbus-icons"),$a=require("./extractStyleProps-BsLft3q1.cjs.js"),me=require("./Button-BtJHe9xY.cjs.js"),pe=require("./create-slot-recipe-context-CimocFDH.cjs.js"),ma=require("./index-BsmdMT4w.cjs.js"),pa=require("./context-OoV8SSWX.cjs.js"),xa=require("./useObjectRef-dXOJdONs.cjs.js"),va=require("./useControlledState-D0L6S_5r.cjs.js"),x=require("./number-DHvo-MDe.cjs.js"),xe=require("./useFormValidation-BEaCuNx1.cjs.js"),be=require("./NumberFormatter-DewVDY5w.cjs.js"),ve=require("./useSpinButton-DA7sVP3T.cjs.js"),S=require("./mergeProps-BA5Cwf5w.cjs.js"),La=require("./filterDOMProps-WUskt27c.cjs.js"),J=require("./platform-BDLy2vDY.cjs.js"),Da=require("./useFormReset--wPlnEOl.cjs.js"),Fa=require("./useFocus-BtJ38vev.cjs.js"),Pa=require("./useFocusWithin-BDSWp3rw.cjs.js"),Na=require("./useEvent-CuUOU5WV.cjs.js"),Sa=require("./useTextField-BcthGRd8.cjs.js"),Ba=require("./useLocalizedStringFormatter-sB0mFYtL.cjs.js"),fe=require("./useProgressBar-DWH4I0qR.cjs.js");function Ca(e,a){let{onScroll:r,isDisabled:i}=e,c=o.useCallback(n=>{n.ctrlKey||(n.preventDefault(),n.stopPropagation(),r&&r({deltaX:n.deltaX,deltaY:n.deltaY}))},[r]);Na.$e9faafb641e167db$export$90fc3a17d93f704c(a,"wheel",i?void 0:c)}function ga(e){let{minValue:a,maxValue:r,step:i,formatOptions:c,value:n,defaultValue:s=NaN,onChange:v,locale:d,isDisabled:F,isReadOnly:L}=e;n===null&&(n=NaN),n!==void 0&&!isNaN(n)&&(i!==void 0&&!isNaN(i)?n=x.$9446cca9a3875146$export$cb6e0bb50bc19463(n,a,r,i):n=x.$9446cca9a3875146$export$7d15b64cf5a3a4c4(n,a,r)),isNaN(s)||(i!==void 0&&!isNaN(i)?s=x.$9446cca9a3875146$export$cb6e0bb50bc19463(s,a,r,i):s=x.$9446cca9a3875146$export$7d15b64cf5a3a4c4(s,a,r));let[l,t]=va.$458b0a5536c1a7cf$export$40bfa8c7b0832715(n,isNaN(s)?NaN:s,v),[f]=o.useState(l),[P,D]=o.useState(()=>isNaN(l)?"":new be.$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(d,c).format(l)),p=o.useMemo(()=>new ve.$6c7bd7858deea686$export$cd11ab140839f11d(d,c),[d,c]),M=o.useMemo(()=>p.getNumberingSystem(P),[p,P]),h=o.useMemo(()=>new be.$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(d,{...c,numberingSystem:M}),[d,c,M]),K=o.useMemo(()=>h.resolvedOptions(),[h]),N=o.useCallback(u=>isNaN(u)||u===null?"":h.format(u),[h]),B=xe.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:l}),$=i!==void 0&&!isNaN(i)?i:1;K.style==="percent"&&(i===void 0||isNaN(i))&&($=.01);let[w,W]=o.useState(l),[q,z]=o.useState(d),[y,U]=o.useState(c);(!Object.is(l,w)||d!==q||c!==y)&&(D(N(l)),W(l),z(d),U(c));let b=o.useMemo(()=>p.parse(P),[p,P]),R=()=>{if(!P.length){t(NaN),D(n===void 0?"":N(l));return}if(isNaN(b)){D(N(l));return}let u;i===void 0||isNaN(i)?u=x.$9446cca9a3875146$export$7d15b64cf5a3a4c4(b,a,r):u=x.$9446cca9a3875146$export$cb6e0bb50bc19463(b,a,r,i),u=p.parse(N(u)),t(u),D(N(n===void 0?u:l)),B.commitValidation()},I=(u,A=0)=>{let C=b;if(isNaN(C)){let g=isNaN(A)?0:A;return x.$9446cca9a3875146$export$cb6e0bb50bc19463(g,a,r,$)}else{let g=x.$9446cca9a3875146$export$cb6e0bb50bc19463(C,a,r,$);return u==="+"&&g>C||u==="-"&&g<C?g:x.$9446cca9a3875146$export$cb6e0bb50bc19463(Q(u,C,$),a,r,$)}},k=()=>{let u=I("+",a);u===l&&D(N(u)),t(u),B.commitValidation()},Z=()=>{let u=I("-",r);u===l&&D(N(u)),t(u),B.commitValidation()},T=()=>{r!=null&&(t(x.$9446cca9a3875146$export$cb6e0bb50bc19463(r,a,r,$)),B.commitValidation())},_=()=>{a!=null&&(t(a),B.commitValidation())},j=o.useMemo(()=>!F&&!L&&(isNaN(b)||r===void 0||isNaN(r)||x.$9446cca9a3875146$export$cb6e0bb50bc19463(b,a,r,$)>b||Q("+",b,$)<=r),[F,L,a,r,$,b]),Y=o.useMemo(()=>!F&&!L&&(isNaN(b)||a===void 0||isNaN(a)||x.$9446cca9a3875146$export$cb6e0bb50bc19463(b,a,r,$)<b||Q("-",b,$)>=a),[F,L,a,r,$,b]);return{...B,validate:u=>p.isValidPartialNumber(u,a,r),increment:k,incrementToMax:T,decrement:Z,decrementToMin:_,canIncrement:j,canDecrement:Y,minValue:a,maxValue:r,numberValue:b,defaultNumberValue:isNaN(s)?f:s,setNumberValue:t,setInputValue:D,inputValue:P,commit:R}}function Q(e,a,r){let i=e==="+"?a+r:a-r;if(a%1!==0||r%1!==0){const c=a.toString().split("."),n=r.toString().split("."),s=c[1]&&c[1].length||0,v=n[1]&&n[1].length||0,d=Math.pow(10,Math.max(s,v));a=Math.round(a*d),r=Math.round(r*d),i=e==="+"?a+r:a-r,i/=d}return i}function $e(){return typeof window<"u"&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"}function Va(e,a,r){let i=S.$8ae05eaa5c114e9c$export$7f54fc3180508a52(l=>{let t=r.current;if(!t)return;let f=null;switch(l.inputType){case"historyUndo":case"historyRedo":return;case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":f=t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteContentForward":f=t.selectionEnd===t.selectionStart?t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd+1):t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteContentBackward":f=t.selectionEnd===t.selectionStart?t.value.slice(0,t.selectionStart-1)+t.value.slice(t.selectionStart):t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":f=t.value.slice(t.selectionStart);break;default:l.data!=null&&(f=t.value.slice(0,t.selectionStart)+l.data+t.value.slice(t.selectionEnd));break}(f==null||!a.validate(f))&&l.preventDefault()});o.useEffect(()=>{if(!$e()||!r.current)return;let l=r.current;return l.addEventListener("beforeinput",i,!1),()=>{l.removeEventListener("beforeinput",i,!1)}},[r,i]);let c=$e()?null:l=>{let t=l.target.value.slice(0,l.target.selectionStart)+l.data+l.target.value.slice(l.target.selectionEnd);a.validate(t)||l.preventDefault()},{labelProps:n,inputProps:s,descriptionProps:v,errorMessageProps:d,...F}=Sa.$2d73ec29415bd339$export$712718f7aec83d5(e,r),L=o.useRef(null);return{inputProps:S.$3ef42575df84b30b$export$9d1611c77c2fe928(s,{onBeforeInput:c,onCompositionStart(){let{value:l,selectionStart:t,selectionEnd:f}=r.current;L.current={value:l,selectionStart:t,selectionEnd:f}},onCompositionEnd(){if(r.current&&!a.validate(r.current.value)){let{value:l,selectionStart:t,selectionEnd:f}=L.current;r.current.value=l,r.current.setSelectionRange(t,f),a.setInputValue(l)}}}),labelProps:n,descriptionProps:v,errorMessageProps:d,...F}}var Le={};Le={decrease:e=>`خفض ${e.fieldLabel}`,increase:e=>`زيادة ${e.fieldLabel}`,numberField:"حقل رقمي"};var De={};De={decrease:e=>`Намаляване ${e.fieldLabel}`,increase:e=>`Усилване ${e.fieldLabel}`,numberField:"Номер на полето"};var Fe={};Fe={decrease:e=>`Snížit ${e.fieldLabel}`,increase:e=>`Zvýšit ${e.fieldLabel}`,numberField:"Číselné pole"};var Pe={};Pe={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`Øg ${e.fieldLabel}`,numberField:"Talfelt"};var Ne={};Ne={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erhöhen`,numberField:"Nummernfeld"};var Se={};Se={decrease:e=>`Μείωση ${e.fieldLabel}`,increase:e=>`Αύξηση ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"};var Be={};Be={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"};var Ce={};Ce={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de número"};var ge={};ge={decrease:e=>`Vähenda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri väli"};var Ve={};Ve={decrease:e=>`Vähennä ${e.fieldLabel}`,increase:e=>`Lisää ${e.fieldLabel}`,numberField:"Numerokenttä"};var Ee={};Ee={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"};var he={};he={decrease:e=>`הקטן ${e.fieldLabel}`,increase:e=>`הגדל ${e.fieldLabel}`,numberField:"שדה מספר"};var ye={};ye={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Povećaj ${e.fieldLabel}`,numberField:"Polje broja"};var Ie={};Ie={decrease:e=>`${e.fieldLabel} csökkentése`,increase:e=>`${e.fieldLabel} növelése`,numberField:"Számmező"};var Me={};Me={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"};var we={};we={decrease:e=>`${e.fieldLabel}を縮小`,increase:e=>`${e.fieldLabel}を拡大`,numberField:"数値フィールド"};var qe={};qe={decrease:e=>`${e.fieldLabel} 감소`,increase:e=>`${e.fieldLabel} 증가`,numberField:"번호 필드"};var ke={};ke={decrease:e=>`Sumažinti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"};var Oe={};Oe={decrease:e=>`Samazināšana ${e.fieldLabel}`,increase:e=>`Palielināšana ${e.fieldLabel}`,numberField:"Skaitļu lauks"};var Re={};Re={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`Øk ${e.fieldLabel}`,numberField:"Tallfelt"};var Te={};Te={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"};var je={};je={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwiększ ${e.fieldLabel}`,numberField:"Pole numeru"};var Ae={};Ae={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de número"};var Ke={};Ke={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo numérico"};var We={};We={decrease:e=>`Scădere ${e.fieldLabel}`,increase:e=>`Creștere ${e.fieldLabel}`,numberField:"Câmp numeric"};var ze={};ze={decrease:e=>`Уменьшение ${e.fieldLabel}`,increase:e=>`Увеличение ${e.fieldLabel}`,numberField:"Числовое поле"};var Ue={};Ue={decrease:e=>`Znížiť ${e.fieldLabel}`,increase:e=>`Zvýšiť ${e.fieldLabel}`,numberField:"Číselné pole"};var Ze={};Ze={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Povečajte ${e.fieldLabel}`,numberField:"Številčno polje"};var _e={};_e={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Povećaj ${e.fieldLabel}`,numberField:"Polje broja"};var Ye={};Ye={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`Öka ${e.fieldLabel}`,numberField:"Nummerfält"};var He={};He={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} arttır`,numberField:"Sayı alanı"};var Ge={};Ge={decrease:e=>`Зменшити ${e.fieldLabel}`,increase:e=>`Збільшити ${e.fieldLabel}`,numberField:"Поле номера"};var Xe={};Xe={decrease:e=>`降低 ${e.fieldLabel}`,increase:e=>`提高 ${e.fieldLabel}`,numberField:"数字字段"};var Je={};Je={decrease:e=>`縮小 ${e.fieldLabel}`,increase:e=>`放大 ${e.fieldLabel}`,numberField:"數字欄位"};var Qe={};Qe={"ar-AE":Le,"bg-BG":De,"cs-CZ":Fe,"da-DK":Pe,"de-DE":Ne,"el-GR":Se,"en-US":Be,"es-ES":Ce,"et-EE":ge,"fi-FI":Ve,"fr-FR":Ee,"he-IL":he,"hr-HR":ye,"hu-HU":Ie,"it-IT":Me,"ja-JP":we,"ko-KR":qe,"lt-LT":ke,"lv-LV":Oe,"nb-NO":Re,"nl-NL":Te,"pl-PL":je,"pt-BR":Ae,"pt-PT":Ke,"ro-RO":We,"ru-RU":ze,"sk-SK":Ue,"sl-SI":Ze,"sr-SP":_e,"sv-SE":Ye,"tr-TR":He,"uk-UA":Ge,"zh-CN":Xe,"zh-TW":Je};function Ea(e){return e&&e.__esModule?e.default:e}function ha(e,a,r){let{id:i,decrementAriaLabel:c,incrementAriaLabel:n,isDisabled:s,isReadOnly:v,isRequired:d,minValue:F,maxValue:L,autoFocus:l,label:t,formatOptions:f,onBlur:P=()=>{},onFocus:D,onFocusChange:p,onKeyDown:M,onKeyUp:h,description:K,errorMessage:N,isWheelDisabled:B,...$}=e,{increment:w,incrementToMax:W,decrement:q,decrementToMin:z,numberValue:y,inputValue:U,commit:b,commitValidation:R}=a;const I=Ba.$fca6afa0e843324b$export$f12b703ca79dfbb1(Ea(Qe),"@react-aria/numberfield");let k=S.$bdb11010cef70236$export$f680877a34711e37(i),{focusProps:Z}=Fa.$a1ea59d68270f0dd$export$f8168d8dd8fd66e6({onBlur(){b()}}),T=fe.$a916eb452884faea$export$b7a616150fdb9f44(f),_=o.useMemo(()=>T.resolvedOptions(),[T]),j=fe.$a916eb452884faea$export$b7a616150fdb9f44({...f,currencySign:void 0}),Y=o.useMemo(()=>isNaN(y)?"":j.format(y),[j,y]),{spinButtonProps:ae,incrementButtonProps:u,decrementButtonProps:A}=ve.$d2e8511e6f209edf$export$e908e06f4b8e3402({isDisabled:s,isReadOnly:v,isRequired:d,maxValue:L,minValue:F,onIncrement:w,onIncrementToMax:W,onDecrement:q,onDecrementToMin:z,value:y,textValue:Y}),[C,g]=o.useState(!1),{focusWithinProps:aa}=Pa.$9ab94262bd0047c7$export$420e68273165f4ec({isDisabled:s,onFocusWithinChange:g}),ra=o.useCallback(m=>{Math.abs(m.deltaY)<=Math.abs(m.deltaX)||(m.deltaY>0?w():m.deltaY<0&&q())},[q,w]);Ca({onScroll:ra,isDisabled:B||s||v||!C},r);var H;let re=((H=_.maximumFractionDigits)!==null&&H!==void 0?H:0)>0,te=a.minValue===void 0||isNaN(a.minValue)||a.minValue<0,O="numeric";J.$c87311424ea30a05$export$186c6964ca17d99()?te?O="text":re&&(O="decimal"):J.$c87311424ea30a05$export$a11b0059900ceec8()&&(te?O="numeric":re&&(O="decimal"));let ta=m=>{a.validate(m)&&a.setInputValue(m)},la=La.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e),le=o.useCallback(m=>{m.nativeEvent.isComposing||(m.key==="Enter"?(b(),R()):m.continuePropagation())},[b,R]),{isInvalid:ie,validationErrors:ia,validationDetails:na}=a.displayValidation,{labelProps:ne,inputProps:ua,descriptionProps:oa,errorMessageProps:sa}=Va({...$,...la,name:void 0,form:void 0,label:t,autoFocus:l,isDisabled:s,isReadOnly:v,isRequired:d,validate:void 0,[xe.$e5be200c675c3b3a$export$a763b9476acd3eb]:a,value:U,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:k,type:"text",inputMode:O,onChange:ta,onBlur:P,onFocus:D,onFocusChange:p,onKeyDown:o.useMemo(()=>S.$ff5963eb1fccf552$export$e08e3b67e392101e(le,M),[le,M]),onKeyUp:h,description:K,errorMessage:N},a,r);Da.$99facab73266f662$export$5add1d006293d136(r,a.defaultNumberValue,a.setNumberValue);let ue=S.$3ef42575df84b30b$export$9d1611c77c2fe928(ae,Z,ua,{role:null,"aria-roledescription":J.$c87311424ea30a05$export$fedb369cb70207f1()?null:I.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});e.validationBehavior==="native"&&(ue["aria-required"]=void 0);let oe=m=>{var X;document.activeElement!==r.current&&(m.pointerType==="mouse"?(X=r.current)===null||X===void 0||X.focus():m.target.focus())},G=e["aria-label"]||(typeof e.label=="string"?e.label:""),V;G||(V=e.label!=null?ne.id:e["aria-labelledby"]);let se=S.$bdb11010cef70236$export$f680877a34711e37(),ce=S.$bdb11010cef70236$export$f680877a34711e37(),ca=S.$3ef42575df84b30b$export$9d1611c77c2fe928(u,{"aria-label":n||I.format("increase",{fieldLabel:G}).trim(),id:V&&!n?se:null,"aria-labelledby":V&&!n?`${se} ${V}`:null,"aria-controls":k,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!a.canIncrement,onPressStart:oe}),da=S.$3ef42575df84b30b$export$9d1611c77c2fe928(A,{"aria-label":c||I.format("decrease",{fieldLabel:G}).trim(),id:V&&!c?ce:null,"aria-labelledby":V&&!c?`${ce} ${V}`:null,"aria-controls":k,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!a.canDecrement,onPressStart:oe});return{groupProps:{...aa,role:"group","aria-disabled":s,"aria-invalid":ie?"true":void 0},labelProps:ne,inputProps:ue,incrementButtonProps:ca,decrementButtonProps:da,errorMessageProps:sa,descriptionProps:oa,isInvalid:ie,validationErrors:ia,validationDetails:na}}const{withContext:ee,withProvider:ya}=pe.createSlotRecipeContext({key:"numberInput"}),Ia=ya("div","root"),Ma=ee("input","input"),wa=ee(me.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,"incrementButton"),qa=ee(me.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,"decrementButton"),ea=e=>{const{size:a,ref:r,...i}=e,{locale:c}=pa.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),n=o.useRef(null),s=xa.$df56164dff5785e2$export$4338b53315abf666(ba.mergeRefs(n,r)),v=pe.useSlotRecipe({recipe:ma.numberInputRecipe}),[d,F]=v.splitVariantProps(i),[L,l]=$a.extractStyleProps(F),t=ga({locale:c,...l}),{inputProps:f,incrementButtonProps:P,decrementButtonProps:D}=ha(l,t,s),p={"data-invalid":e.isInvalid,"data-disabled":e.isDisabled};return E.jsxs(Ia,{...d,...L,size:a,children:[E.jsx(Ma,{ref:s,...f,...p,size:a}),E.jsxs(fa.Box,{position:"absolute",top:"0",right:"0",display:"flex",flexDirection:"column",height:"full",children:[E.jsx(wa,{"aria-label":"Increment",...P,...p,children:E.jsx(de.KeyboardArrowUp,{})}),E.jsx(qa,{"aria-label":"Decrement",...D,...p,children:E.jsx(de.KeyboardArrowDown,{})})]})]})};ea.displayName="NumberInput";exports.NumberInput=ea;
|
|
2
|
+
//# sourceMappingURL=number-input-CCEiz-4P.cjs.js.map
|