@commercetools/nimbus 0.0.0-canary-20250916130207 → 0.0.0-canary-20250918091239
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/icon-BHx0r3NL.cjs.js +2 -0
- package/dist/chunks/icon-BHx0r3NL.cjs.js.map +1 -0
- package/dist/chunks/icon-DHu0zrOb.es.js +14 -0
- package/dist/chunks/icon-DHu0zrOb.es.js.map +1 -0
- package/dist/chunks/icon.recipe-ClxbhW0Q.cjs.js +2 -0
- package/dist/chunks/icon.recipe-ClxbhW0Q.cjs.js.map +1 -0
- package/dist/chunks/icon.recipe-DjkjodUn.es.js +24 -0
- package/dist/chunks/icon.recipe-DjkjodUn.es.js.map +1 -0
- package/dist/chunks/inline-svg-DTleUhZq.es.js +21 -0
- package/dist/chunks/inline-svg-DTleUhZq.es.js.map +1 -0
- package/dist/chunks/inline-svg-DbvmiSw9.cjs.js +2 -0
- package/dist/chunks/inline-svg-DbvmiSw9.cjs.js.map +1 -0
- package/dist/chunks/{menu-bzi7WVh0.cjs.js → menu-CQYhHGbS.cjs.js} +2 -2
- package/dist/chunks/{menu-bzi7WVh0.cjs.js.map → menu-CQYhHGbS.cjs.js.map} +1 -1
- package/dist/chunks/{menu-DZVU5Z-r.es.js → menu-DnbrSKhK.es.js} +2 -2
- package/dist/chunks/{menu-DZVU5Z-r.es.js.map → menu-DnbrSKhK.es.js.map} +1 -1
- package/dist/chunks/rich-text-input-BbCjT_Nf.es.js +7916 -0
- package/dist/chunks/rich-text-input-BbCjT_Nf.es.js.map +1 -0
- package/dist/chunks/rich-text-input-BwrGY2EU.cjs.js +24 -0
- package/dist/chunks/rich-text-input-BwrGY2EU.cjs.js.map +1 -0
- package/dist/chunks/{split-button-BR8DktKd.es.js → split-button-ClVaxLZ7.es.js} +3 -3
- package/dist/chunks/{split-button-BR8DktKd.es.js.map → split-button-ClVaxLZ7.es.js.map} +1 -1
- package/dist/chunks/{split-button-1uPesHKO.cjs.js → split-button-D-3pT-LA.cjs.js} +2 -2
- package/dist/chunks/{split-button-1uPesHKO.cjs.js.map → split-button-D-3pT-LA.cjs.js.map} +1 -1
- package/dist/chunks/use-inline-svg-C2ko8Bcq.cjs.js +2 -0
- package/dist/chunks/use-inline-svg-C2ko8Bcq.cjs.js.map +1 -0
- package/dist/chunks/use-inline-svg-Cua0623E.es.js +47 -0
- package/dist/chunks/use-inline-svg-Cua0623E.es.js.map +1 -0
- package/dist/components/components.cjs +1 -1
- package/dist/components/components.es.js +79 -77
- package/dist/components/components.es.js.map +1 -1
- package/dist/components/constants.cjs +1 -1
- package/dist/components/constants.cjs.map +1 -1
- package/dist/components/constants.es.js +13 -122
- package/dist/components/constants.es.js.map +1 -1
- package/dist/components/hooks.cjs +1 -1
- package/dist/components/hooks.es.js +2 -5
- package/dist/components/icon.cjs +1 -1
- package/dist/components/icon.es.js +1 -1
- package/dist/components/inline-svg.cjs +2 -0
- package/dist/components/inline-svg.cjs.map +1 -0
- package/dist/components/inline-svg.es.js +5 -0
- package/dist/components/inline-svg.es.js.map +1 -0
- package/dist/components/rich-text-input.cjs +1 -1
- package/dist/components/rich-text-input.es.js +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/split-button.es.js +1 -1
- package/dist/components/utils.cjs +2 -1
- package/dist/components/utils.cjs.map +1 -1
- package/dist/components/utils.es.js +543 -65
- package/dist/components/utils.es.js.map +1 -1
- package/dist/components.d.ts +34 -0
- package/dist/constants.d.ts +4 -113
- package/dist/hooks.d.ts +7 -46
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +41 -45
- package/dist/index.es.js +121 -119
- package/dist/index.es.js.map +1 -1
- package/dist/inline-svg.d.ts +139 -0
- package/dist/utils.d.ts +28 -148
- package/package.json +6 -5
- package/dist/chunks/icon-BoRbJStV.es.js +0 -31
- package/dist/chunks/icon-BoRbJStV.es.js.map +0 -1
- package/dist/chunks/icon-Cny8ZtnX.cjs.js +0 -2
- package/dist/chunks/icon-Cny8ZtnX.cjs.js.map +0 -1
- package/dist/chunks/rich-text-input-B3s6cy-T.cjs.js +0 -2
- package/dist/chunks/rich-text-input-B3s6cy-T.cjs.js.map +0 -1
- package/dist/chunks/rich-text-input-D4cP13Oo.es.js +0 -691
- package/dist/chunks/rich-text-input-D4cP13Oo.es.js.map +0 -1
- package/dist/chunks/slate-helpers-BwRHJO4o.es.js +0 -6919
- package/dist/chunks/slate-helpers-BwRHJO4o.es.js.map +0 -1
- package/dist/chunks/slate-helpers-CMAwCMk0.cjs.js +0 -24
- package/dist/chunks/slate-helpers-CMAwCMk0.cjs.js.map +0 -1
- package/dist/chunks/use-formatting-state-Denpy3Zo.cjs.js +0 -2
- package/dist/chunks/use-formatting-state-Denpy3Zo.cjs.js.map +0 -1
- package/dist/chunks/use-formatting-state-RJvSR-Zg.es.js +0 -247
- package/dist/chunks/use-formatting-state-RJvSR-Zg.es.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),n=require("@chakra-ui/react/styled-system"),r=require("./icon.recipe-ClxbhW0Q.cjs.js"),{withContext:i}=n.createRecipeContext({recipe:r.iconRecipe}),p=i("svg"),t=c=>{const{ref:o,...e}=c;return s.jsx(p,{ref:o,asChild:!e.as,...e})};t.displayName="Icon";exports.Icon=t;
|
|
2
|
+
//# sourceMappingURL=icon-BHx0r3NL.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-BHx0r3NL.cjs.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { iconRecipe } from \"./icon.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n */\ninterface IconRecipeProps extends RecipeProps<\"svg\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface IconRootSlotProps\n extends HTMLChakraProps<\"svg\", IconRecipeProps> {}\n\nconst { withContext } = createRecipeContext({ recipe: iconRecipe });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const IconRootSlot = withContext<SVGSVGElement, IconRootSlotProps>(\n \"svg\"\n);\n","import { IconRootSlot } from \"./icon.slots\";\nimport type { IconProps } from \"./icon.types\";\n\n/**\n * # Icon\n *\n * displays icon components\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/icon}\n */\nexport const Icon = (props: IconProps) => {\n const { ref, ...restProps } = props;\n return <IconRootSlot ref={ref} asChild={!restProps.as} {...restProps} />;\n};\n\nIcon.displayName = \"Icon\";\n"],"names":["withContext","createRecipeContext","iconRecipe","IconRootSlot","Icon","props","ref","restProps","jsx"],"mappings":"yIAwBM,CAAE,YAAAA,CAAA,EAAgBC,EAAAA,oBAAoB,CAAE,OAAQC,EAAAA,WAAY,EAMrDC,EAAeH,EAC1B,KACF,ECtBaI,EAAQC,GAAqB,CACxC,KAAM,CAAE,IAAAC,EAAK,GAAGC,CAAA,EAAcF,EAC9B,OAAOG,EAAAA,IAACL,GAAa,IAAAG,EAAU,QAAS,CAACC,EAAU,GAAK,GAAGA,EAAW,CACxE,EAEAH,EAAK,YAAc"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createRecipeContext as s } from "@chakra-ui/react/styled-system";
|
|
3
|
+
import { i as c } from "./icon.recipe-DjkjodUn.es.js";
|
|
4
|
+
const { withContext: i } = /* @__PURE__ */ s({ recipe: c }), n = /* @__PURE__ */ i(
|
|
5
|
+
"svg"
|
|
6
|
+
), p = (t) => {
|
|
7
|
+
const { ref: e, ...o } = t;
|
|
8
|
+
return /* @__PURE__ */ r(n, { ref: e, asChild: !o.as, ...o });
|
|
9
|
+
};
|
|
10
|
+
p.displayName = "Icon";
|
|
11
|
+
export {
|
|
12
|
+
p as I
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=icon-DHu0zrOb.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-DHu0zrOb.es.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { iconRecipe } from \"./icon.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n */\ninterface IconRecipeProps extends RecipeProps<\"svg\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface IconRootSlotProps\n extends HTMLChakraProps<\"svg\", IconRecipeProps> {}\n\nconst { withContext } = createRecipeContext({ recipe: iconRecipe });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const IconRootSlot = withContext<SVGSVGElement, IconRootSlotProps>(\n \"svg\"\n);\n","import { IconRootSlot } from \"./icon.slots\";\nimport type { IconProps } from \"./icon.types\";\n\n/**\n * # Icon\n *\n * displays icon components\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/icon}\n */\nexport const Icon = (props: IconProps) => {\n const { ref, ...restProps } = props;\n return <IconRootSlot ref={ref} asChild={!restProps.as} {...restProps} />;\n};\n\nIcon.displayName = \"Icon\";\n"],"names":["withContext","createRecipeContext","iconRecipe","IconRootSlot","Icon","props","ref","restProps","jsx"],"mappings":";;;AAwBA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB,EAAE,QAAQC,GAAY,GAMrDC,IAAe,gBAAAH;AAAA,EAC1B;AACF,GCtBaI,IAAO,CAACC,MAAqB;AACxC,QAAM,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAcF;AAC9B,SAAO,gBAAAG,EAACL,KAAa,KAAAG,GAAU,SAAS,CAACC,EAAU,IAAK,GAAGA,GAAW;AACxE;AAEAH,EAAK,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("@chakra-ui/react/styled-system"),i=e.defineRecipe({className:"nimbus-icon",base:{display:"inline-block"},variants:{size:{"2xs":{boxSize:"600"},xs:{boxSize:"800"},sm:{boxSize:"900"},md:{boxSize:"1000"},lg:{boxSize:"1200"},xl:{boxSize:"1400"}}}});exports.iconRecipe=i;
|
|
2
|
+
//# sourceMappingURL=icon.recipe-ClxbhW0Q.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.recipe-ClxbhW0Q.cjs.js","sources":["../../src/components/icon/icon.recipe.tsx"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\n\n/**\n * Recipe configuration for the Icon component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const iconRecipe = defineRecipe({\n className: \"nimbus-icon\",\n base: {\n display: \"inline-block\",\n },\n\n variants: {\n /**\n * allows applying a predefined size to the icon\n */\n size: {\n \"2xs\": { boxSize: \"600\" },\n xs: { boxSize: \"800\" },\n sm: { boxSize: \"900\" },\n md: { boxSize: \"1000\" },\n lg: { boxSize: \"1200\" },\n xl: { boxSize: \"1400\" },\n },\n },\n});\n"],"names":["iconRecipe","defineRecipe"],"mappings":"+DAMaA,EAAaC,EAAAA,aAAa,CACrC,UAAW,cACX,KAAM,CACJ,QAAS,cAAA,EAGX,SAAU,CAIR,KAAM,CACJ,MAAO,CAAE,QAAS,KAAA,EAClB,GAAI,CAAE,QAAS,KAAA,EACf,GAAI,CAAE,QAAS,KAAA,EACf,GAAI,CAAE,QAAS,MAAA,EACf,GAAI,CAAE,QAAS,MAAA,EACf,GAAI,CAAE,QAAS,MAAA,CAAO,CACxB,CAEJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineRecipe as i } from "@chakra-ui/react/styled-system";
|
|
2
|
+
const o = /* @__PURE__ */ i({
|
|
3
|
+
className: "nimbus-icon",
|
|
4
|
+
base: {
|
|
5
|
+
display: "inline-block"
|
|
6
|
+
},
|
|
7
|
+
variants: {
|
|
8
|
+
/**
|
|
9
|
+
* allows applying a predefined size to the icon
|
|
10
|
+
*/
|
|
11
|
+
size: {
|
|
12
|
+
"2xs": { boxSize: "600" },
|
|
13
|
+
xs: { boxSize: "800" },
|
|
14
|
+
sm: { boxSize: "900" },
|
|
15
|
+
md: { boxSize: "1000" },
|
|
16
|
+
lg: { boxSize: "1200" },
|
|
17
|
+
xl: { boxSize: "1400" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
o as i
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=icon.recipe-DjkjodUn.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.recipe-DjkjodUn.es.js","sources":["../../src/components/icon/icon.recipe.tsx"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\n\n/**\n * Recipe configuration for the Icon component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const iconRecipe = defineRecipe({\n className: \"nimbus-icon\",\n base: {\n display: \"inline-block\",\n },\n\n variants: {\n /**\n * allows applying a predefined size to the icon\n */\n size: {\n \"2xs\": { boxSize: \"600\" },\n xs: { boxSize: \"800\" },\n sm: { boxSize: \"900\" },\n md: { boxSize: \"1000\" },\n lg: { boxSize: \"1200\" },\n xl: { boxSize: \"1400\" },\n },\n },\n});\n"],"names":["iconRecipe","defineRecipe"],"mappings":";AAMO,MAAMA,IAAa,gBAAAC,EAAa;AAAA,EACrC,WAAW;AAAA,EACX,MAAM;AAAA,IACJ,SAAS;AAAA,EAAA;AAAA,EAGX,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,MAAM;AAAA,MACJ,OAAO,EAAE,SAAS,MAAA;AAAA,MAClB,IAAI,EAAE,SAAS,MAAA;AAAA,MACf,IAAI,EAAE,SAAS,MAAA;AAAA,MACf,IAAI,EAAE,SAAS,OAAA;AAAA,MACf,IAAI,EAAE,SAAS,OAAA;AAAA,MACf,IAAI,EAAE,SAAS,OAAA;AAAA,IAAO;AAAA,EACxB;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { createRecipeContext as a } from "@chakra-ui/react/styled-system";
|
|
3
|
+
import { i as c } from "./icon.recipe-DjkjodUn.es.js";
|
|
4
|
+
import { u as m } from "./use-inline-svg-Cua0623E.es.js";
|
|
5
|
+
const { withContext: p } = /* @__PURE__ */ a({ recipe: c }), g = /* @__PURE__ */ p("svg"), u = (t) => {
|
|
6
|
+
const { data: n, ref: r, ...o } = t, { isValid: i, svgAttributes: s, innerSvgContent: l } = m(n);
|
|
7
|
+
return i ? /* @__PURE__ */ e(g, { asChild: !0, ...o, children: /* @__PURE__ */ e(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
ref: r,
|
|
11
|
+
role: "presentation",
|
|
12
|
+
...s,
|
|
13
|
+
dangerouslySetInnerHTML: { __html: l }
|
|
14
|
+
}
|
|
15
|
+
) }) : null;
|
|
16
|
+
};
|
|
17
|
+
u.displayName = "InlineSvg";
|
|
18
|
+
export {
|
|
19
|
+
u as I
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=inline-svg-DTleUhZq.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-svg-DTleUhZq.es.js","sources":["../../src/components/inline-svg/inline-svg.slots.tsx","../../src/components/inline-svg/inline-svg.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { iconRecipe } from \"../icon/icon.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n * We reuse the icon recipe for consistent styling with Icon component.\n */\ninterface InlineSvgRecipeProps extends RecipeProps<\"svg\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface InlineSvgRootSlotProps\n extends HTMLChakraProps<\"svg\", InlineSvgRecipeProps> {}\n\nconst { withContext } = createRecipeContext({ recipe: iconRecipe });\n\n/**\n * Root component that provides the styling context for the InlineSvg component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n * Reuses the icon recipe to maintain consistency with the Icon component.\n */\nexport const InlineSvgRootSlot = withContext<\n SVGSVGElement,\n InlineSvgRootSlotProps\n>(\"svg\");\n","import type { InlineSvgProps } from \"./inline-svg.types\";\nimport { InlineSvgRootSlot } from \"./inline-svg.slots\";\nimport { useInlineSvg } from \"./hooks\";\n\n/**\n * # InlineSvg\n *\n * Renders arbitrary SVG markup as an icon with built-in XSS protection.\n * The component sanitizes the provided SVG string to remove potentially\n * dangerous elements and attributes before rendering.\n *\n * @example\n * ```tsx\n * <InlineSvg\n * data='<svg viewBox=\"0 0 24 24\"><path d=\"M12 2L2 7v10c0 5.55 3.84 10.74 9 12...\"/></svg>'\n * size=\"md\"\n * color=\"primary.9\"\n * />\n * ```\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/inline-svg}\n */\nexport const InlineSvg = (props: InlineSvgProps) => {\n const { data, ref, ...rest } = props;\n\n const { isValid, svgAttributes, innerSvgContent } = useInlineSvg(data);\n\n // Don't render if sanitization failed\n if (!isValid) {\n return null;\n }\n\n // Always render as SVG - no asChild support\n return (\n <InlineSvgRootSlot asChild {...rest}>\n <svg\n ref={ref}\n role=\"presentation\"\n {...svgAttributes}\n dangerouslySetInnerHTML={{ __html: innerSvgContent }}\n />\n </InlineSvgRootSlot>\n );\n};\n\nInlineSvg.displayName = \"InlineSvg\";\n"],"names":["withContext","createRecipeContext","iconRecipe","InlineSvgRootSlot","InlineSvg","props","data","ref","rest","isValid","svgAttributes","innerSvgContent","useInlineSvg","jsx"],"mappings":";;;;AAyBA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB,EAAE,QAAQC,GAAY,GAOrDC,IAAoB,gBAAAH,EAG/B,KAAK,GCbMI,IAAY,CAACC,MAA0B;AAClD,QAAM,EAAE,MAAAC,GAAM,KAAAC,GAAK,GAAGC,MAASH,GAEzB,EAAE,SAAAI,GAAS,eAAAC,GAAe,iBAAAC,EAAA,IAAoBC,EAAaN,CAAI;AAGrE,SAAKG,IAMH,gBAAAI,EAACV,GAAA,EAAkB,SAAO,IAAE,GAAGK,GAC7B,UAAA,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAK;AAAA,MACJ,GAAGG;AAAA,MACJ,yBAAyB,EAAE,QAAQC,EAAA;AAAA,IAAgB;AAAA,EAAA,GAEvD,IAZO;AAcX;AAEAP,EAAU,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),u=require("@chakra-ui/react/styled-system"),g=require("./icon.recipe-ClxbhW0Q.cjs.js"),v=require("./use-inline-svg-C2ko8Bcq.cjs.js"),{withContext:S}=u.createRecipeContext({recipe:g.iconRecipe}),a=S("svg"),n=t=>{const{data:i,ref:s,...r}=t,{isValid:o,svgAttributes:c,innerSvgContent:l}=v.useInlineSvg(i);return o?e.jsx(a,{asChild:!0,...r,children:e.jsx("svg",{ref:s,role:"presentation",...c,dangerouslySetInnerHTML:{__html:l}})}):null};n.displayName="InlineSvg";exports.InlineSvg=n;
|
|
2
|
+
//# sourceMappingURL=inline-svg-DbvmiSw9.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-svg-DbvmiSw9.cjs.js","sources":["../../src/components/inline-svg/inline-svg.slots.tsx","../../src/components/inline-svg/inline-svg.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { iconRecipe } from \"../icon/icon.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n * We reuse the icon recipe for consistent styling with Icon component.\n */\ninterface InlineSvgRecipeProps extends RecipeProps<\"svg\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface InlineSvgRootSlotProps\n extends HTMLChakraProps<\"svg\", InlineSvgRecipeProps> {}\n\nconst { withContext } = createRecipeContext({ recipe: iconRecipe });\n\n/**\n * Root component that provides the styling context for the InlineSvg component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n * Reuses the icon recipe to maintain consistency with the Icon component.\n */\nexport const InlineSvgRootSlot = withContext<\n SVGSVGElement,\n InlineSvgRootSlotProps\n>(\"svg\");\n","import type { InlineSvgProps } from \"./inline-svg.types\";\nimport { InlineSvgRootSlot } from \"./inline-svg.slots\";\nimport { useInlineSvg } from \"./hooks\";\n\n/**\n * # InlineSvg\n *\n * Renders arbitrary SVG markup as an icon with built-in XSS protection.\n * The component sanitizes the provided SVG string to remove potentially\n * dangerous elements and attributes before rendering.\n *\n * @example\n * ```tsx\n * <InlineSvg\n * data='<svg viewBox=\"0 0 24 24\"><path d=\"M12 2L2 7v10c0 5.55 3.84 10.74 9 12...\"/></svg>'\n * size=\"md\"\n * color=\"primary.9\"\n * />\n * ```\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/inline-svg}\n */\nexport const InlineSvg = (props: InlineSvgProps) => {\n const { data, ref, ...rest } = props;\n\n const { isValid, svgAttributes, innerSvgContent } = useInlineSvg(data);\n\n // Don't render if sanitization failed\n if (!isValid) {\n return null;\n }\n\n // Always render as SVG - no asChild support\n return (\n <InlineSvgRootSlot asChild {...rest}>\n <svg\n ref={ref}\n role=\"presentation\"\n {...svgAttributes}\n dangerouslySetInnerHTML={{ __html: innerSvgContent }}\n />\n </InlineSvgRootSlot>\n );\n};\n\nInlineSvg.displayName = \"InlineSvg\";\n"],"names":["withContext","createRecipeContext","iconRecipe","InlineSvgRootSlot","InlineSvg","props","data","ref","rest","isValid","svgAttributes","innerSvgContent","useInlineSvg","jsx"],"mappings":"uLAyBM,CAAE,YAAAA,CAAA,EAAgBC,EAAAA,oBAAoB,CAAE,OAAQC,EAAAA,WAAY,EAOrDC,EAAoBH,EAG/B,KAAK,ECbMI,EAAaC,GAA0B,CAClD,KAAM,CAAE,KAAAC,EAAM,IAAAC,EAAK,GAAGC,GAASH,EAEzB,CAAE,QAAAI,EAAS,cAAAC,EAAe,gBAAAC,CAAA,EAAoBC,EAAAA,aAAaN,CAAI,EAGrE,OAAKG,EAMHI,EAAAA,IAACV,EAAA,CAAkB,QAAO,GAAE,GAAGK,EAC7B,SAAAK,EAAAA,IAAC,MAAA,CACC,IAAAN,EACA,KAAK,eACJ,GAAGG,EACJ,wBAAyB,CAAE,OAAQC,CAAA,CAAgB,CAAA,EAEvD,EAZO,IAcX,EAEAP,EAAU,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),y=require("@chakra-ui/react/styled-system"),u=require("./Dialog-K19USc7c.cjs.js"),w=require("./index-QBeUpHcK.cjs.js"),S=require("react"),F=require("./Button-BtJHe9xY.cjs.js"),a=require("./extractStyleProps-CDKV7i5o.cjs.js"),K=require("@commercetools/nimbus-icons"),L=require("./icon-
|
|
2
|
-
//# sourceMappingURL=menu-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),y=require("@chakra-ui/react/styled-system"),u=require("./Dialog-K19USc7c.cjs.js"),w=require("./index-QBeUpHcK.cjs.js"),S=require("react"),F=require("./Button-BtJHe9xY.cjs.js"),a=require("./extractStyleProps-CDKV7i5o.cjs.js"),K=require("@commercetools/nimbus-icons"),L=require("./icon-BHx0r3NL.cjs.js"),E=require("./Separator-CTkcgvBE.cjs.js"),O=require("./Header-zz3aj0c7.cjs.js"),{withProvider:k,withContext:l}=y.createSlotRecipeContext({recipe:w.menuSlotRecipe}),B=k("div","root"),j=l("button","trigger"),D=l("div","popover"),H=l("div","content"),V=l("div","item"),W=l("div","section"),z=l("div","sectionLabel"),f=S.createContext(void 0),A=f.Provider,v=()=>S.useContext(f),m=t=>{const n=y.useSlotRecipe({key:"menu"}),[c,r]=n.splitVariantProps(t),{children:s,trigger:o,isOpen:i,defaultOpen:p,onOpenChange:x,...b}=r,M={trigger:o,isOpen:i,defaultOpen:p,onOpenChange:x};return e.jsx(B,{...c,asChild:!0,children:e.jsx(u.$3674c52c6b3c5bce$export$27d2ad3c5815583e,{...M,children:e.jsx(A,{value:b,children:s})})})};m.displayName="Menu.Root";const h=({children:t,asChild:n,ref:c,...r})=>{const[s,o]=a.extractStyleProps(r);return n?e.jsx(j,{ref:c,asChild:!0,...s,children:t}):e.jsx(j,{asChild:!0,...s,children:e.jsx(F.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,{ref:c,...o,children:t})})};h.displayName="Menu.Trigger";const G=S.createContext(void 0),R=G.Provider,d=({children:t,placement:n,ref:c})=>{const r=v();if(!r)throw new Error("Menu.Content must be used within Menu.Root");const{placement:s,...o}=r,i=n||s||"bottom start";return e.jsx(R,{value:{selectionMode:o.selectionMode},children:e.jsx(D,{asChild:!0,children:e.jsx(u.$07b14b47974efb58$export$5b6b19405a83ff9d,{placement:i,offset:4,shouldFlip:!0,children:e.jsx(H,{asChild:!0,children:e.jsx(u.$3674c52c6b3c5bce$export$d9b273488cd8ce6f,{ref:c,shouldFocusWrap:!0,autoFocus:"first",...o,children:t})})})})})};d.displayName="Menu.Content";const g=({children:t,isCritical:n,ref:c,...r})=>{const[s,o]=a.extractStyleProps(r);return e.jsx(V,{asChild:!0,...s,"data-critical":n?"":void 0,children:e.jsx(u.$3674c52c6b3c5bce$export$2ce376c2cc3355c8,{ref:c,...o,children:({hasSubmenu:i})=>e.jsxs(e.Fragment,{children:[t,i&&e.jsx(L.Icon,{slot:"caretIcon",children:e.jsx(K.ChevronRight,{})})]})})})};g.displayName="Menu.Item";const q=({children:t,ref:n,...c})=>{const[r,s]=a.extractStyleProps(c);return e.jsx(z,{asChild:!0,...r,children:e.jsx(O.$72a5793c14baf454$export$8b251419efc915eb,{ref:n,...s,children:t})})};q.displayName="Menu.SectionLabel";const P=({children:t,ref:n,label:c,items:r,...s})=>{const o=v(),{selectionMode:i=o?.selectionMode,selectedKeys:p=o?.selectedKeys,defaultSelectedKeys:x=o?.defaultSelectedKeys,onSelectionChange:b=o?.onSelectionChange,disallowEmptySelection:M=o?.disallowEmptySelection,...T}=s,[I,N]=a.extractStyleProps(T);return e.jsx(R,{value:{selectionMode:i},children:e.jsx(W,{asChild:!0,...I,children:e.jsxs(u.$3674c52c6b3c5bce$export$4b1545b4f2016d26,{ref:n,selectionMode:i,selectedKeys:p,defaultSelectedKeys:x,onSelectionChange:b,disallowEmptySelection:M,...N,children:[e.jsx(q,{children:c}),r?e.jsx(E.$e1995378a142960e$export$fb8073518f34e6ec,{items:r,children:t}):t]})})})};P.displayName="Menu.Section";const C=({children:t,...n})=>e.jsx(u.$3674c52c6b3c5bce$export$ecabc99eeffab7ca,{...n,children:t});C.displayName="Menu.SubmenuTrigger";const $=({children:t,...n})=>e.jsx(d,{...n,placement:"end",children:t});$.displayName="Menu.Submenu";const J={Root:m,Trigger:h,Content:d,Item:g,Section:P,Submenu:$,SubmenuTrigger:C};exports.Menu=J;exports.MenuContent=d;exports.MenuItem=g;exports.MenuRoot=m;exports.MenuSection=P;exports.MenuSubmenu=$;exports.MenuSubmenuTrigger=C;exports.MenuTrigger=h;
|
|
2
|
+
//# sourceMappingURL=menu-CQYhHGbS.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-bzi7WVh0.cjs.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import {\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 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 { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","menuSlotRecipe","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","menuTriggerProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":"+aAMM,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,EAAkBR,EAG7B,MAAO,SAAS,EAILS,EAAuBT,EAGlC,MAAO,cAAc,EC/CjBU,EAAcC,EAAAA,cAA4C,MAAS,EAE5DC,EAAeF,EAAY,SAE3BG,EAAiB,IACZC,EAAAA,WAAWJ,CAAW,ECT3BK,EAAYC,GAAyB,CAChD,MAAMC,EAASC,EAAAA,cAAc,CAAE,IAAK,OAAQ,EACtC,CAACC,EAAaC,CAAe,EAAIH,EAAO,kBAAkBD,CAAK,EAG/D,CACJ,SAAAK,EACA,QAAAC,EACA,OAAAC,EACA,YAAAC,EACA,aAAAC,EACA,GAAGC,CAAA,EACDN,EAEEO,EAAmB,CACvB,QAAAL,EACA,OAAAC,EACA,YAAAC,EACA,aAAAC,CAAA,EAGF,aACGtB,EAAA,CA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GAAc,uBACvC,GAAGP,CAAA,EACDlB,EAEE,CAACiB,EAAYgC,CAAU,EAAI9B,EAAAA,kBAAkBD,CAAS,EAE5D,OACEN,EAAAA,IAACU,EAAA,CAAoB,MAAO,CAAE,cAAAsB,CAAA,EAC5B,SAAAhC,EAAAA,IAACpB,EAAA,CAAgB,QAAO,GAAE,GAAGyB,EAC3B,SAAAkB,EAAAA,KAACe,EAAAA,0CAAA,CACC,IAAAlC,EACA,cAAA4B,EACA,aAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,uBAAAC,EACC,GAAGC,EAEJ,SAAA,CAAArC,EAAAA,IAAC2B,GAAkB,SAAAG,CAAA,CAAM,EACxBC,EACC/B,EAAAA,IAACuC,EAAAA,0CAAA,CAAW,MAAAR,EAAe,SAAAtC,EAAS,EAEnCA,CAAA,CAAA,CAAA,EAGP,CAAA,CACF,CAEJ,EAEAoC,EAAY,YAAc,eCtDnB,MAAMW,EAAqB,CAAC,CACjC,SAAA/C,EACA,GAAGL,CACL,IACSY,EAAAA,IAACyC,EAAAA,0CAAA,CAAkB,GAAGrD,EAAQ,SAAAK,CAAA,CAAS,EAGhD+C,EAAmB,YAAc,sBCP1B,MAAME,EAAc,CAAC,CAAE,SAAAjD,EAAU,GAAGL,WAEtCuB,EAAA,CAAa,GAAGvB,EAAO,UAAU,MAC/B,SAAAK,EACH,EAIJiD,EAAY,YAAc,eCAnB,MAAMxB,EAAO,CAClB,KAAM/B,EACN,QAASe,EACT,QAASS,EACT,KAAMQ,EACN,QAASU,EACT,QAASa,EACT,eAAgBF,CAClB"}
|
|
1
|
+
{"version":3,"file":"menu-CQYhHGbS.cjs.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import {\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 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 { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","menuSlotRecipe","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","menuTriggerProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":"+aAMM,CAAE,aAAAA,EAAc,YAAAC,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GP,CAAA,CACF,CAEJ,EAEAoC,EAAY,YAAc,eCtDnB,MAAMW,EAAqB,CAAC,CACjC,SAAA/C,EACA,GAAGL,CACL,IACSY,EAAAA,IAACyC,EAAAA,0CAAA,CAAkB,GAAGrD,EAAQ,SAAAK,CAAA,CAAS,EAGhD+C,EAAmB,YAAc,sBCP1B,MAAME,EAAc,CAAC,CAAE,SAAAjD,EAAU,GAAGL,WAEtCuB,EAAA,CAAa,GAAGvB,EAAO,UAAU,MAC/B,SAAAK,EACH,EAIJiD,EAAY,YAAc,eCAnB,MAAMxB,EAAO,CAClB,KAAM/B,EACN,QAASe,EACT,QAASS,EACT,KAAMQ,EACN,QAASU,EACT,QAASa,EACT,eAAgBF,CAClB"}
|
|
@@ -6,7 +6,7 @@ import { createContext as f, useContext as z } from "react";
|
|
|
6
6
|
import { a as A } from "./Button-BVaauB-c.es.js";
|
|
7
7
|
import { e as u } from "./extractStyleProps-vXiS8lCp.es.js";
|
|
8
8
|
import { ChevronRight as B } from "@commercetools/nimbus-icons";
|
|
9
|
-
import { I as D } from "./icon-
|
|
9
|
+
import { I as D } from "./icon-DHu0zrOb.es.js";
|
|
10
10
|
import { g as G } from "./Separator-D9Sio9QB.es.js";
|
|
11
11
|
import { c as H } from "./Header-Cfm2XlNT.es.js";
|
|
12
12
|
const { withProvider: J, withContext: a } = /* @__PURE__ */ K({
|
|
@@ -147,4 +147,4 @@ export {
|
|
|
147
147
|
R as f,
|
|
148
148
|
T as g
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=menu-
|
|
150
|
+
//# sourceMappingURL=menu-DnbrSKhK.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-DZVU5Z-r.es.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import {\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 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 { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","menuSlotRecipe","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings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,SAAO,IAAE,GAAGwB,GAC3B,UAAA,gBAAAkB;AAAA,IAACe;AAAAA,IAAA;AAAA,MACC,KAAAlC;AAAA,MACA,eAAA4B;AAAA,MACA,cAAAC;AAAA,MACA,qBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,wBAAAC;AAAA,MACC,GAAGC;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAArC,EAAC2B,KAAkB,UAAAG,EAAA,CAAM;AAAA,QACxBC,IACC,gBAAA/B,EAACuC,GAAA,EAAW,OAAAR,GAAe,UAAArC,GAAS,IAEnCA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGP,EAAA,CACF;AAEJ;AAEAmC,EAAY,cAAc;ACtDnB,MAAMW,IAAqB,CAAC;AAAA,EACjC,UAAA9C;AAAA,EACA,GAAGL;AACL,MACS,gBAAAW,EAACyC,GAAA,EAAkB,GAAGpD,GAAQ,UAAAK,EAAA,CAAS;AAGhD8C,EAAmB,cAAc;ACP1B,MAAME,IAAc,CAAC,EAAE,UAAAhD,GAAU,GAAGL,0BAEtCsB,GAAA,EAAa,GAAGtB,GAAO,WAAU,OAC/B,UAAAK,GACH;AAIJgD,EAAY,cAAc;ACAnB,MAAMxB,KAAO;AAAA,EAClB,MAAM9B;AAAA,EACN,SAASc;AAAA,EACT,SAASS;AAAA,EACT,MAAMQ;AAAA,EACN,SAASU;AAAA,EACT,SAASa;AAAA,EACT,gBAAgBF;AAClB;"}
|
|
1
|
+
{"version":3,"file":"menu-DnbrSKhK.es.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import {\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 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 { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","menuSlotRecipe","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":";;;;;;;;;;;AAMA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAIYC,IAAe,gB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