@choco-vanille/components 0.1.0-dev.1 → 0.1.0-dev.2

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.
Files changed (53) hide show
  1. package/README.md +19 -5
  2. package/dist/components/{navigation/_common/link-base/utils/getLinkBaseSlotChild.utils.cjs → _common/utils/get-label-slot-child/getLabelSlotChild.utils.cjs} +2 -2
  3. package/dist/components/_common/utils/get-label-slot-child/getLabelSlotChild.utils.cjs.map +1 -0
  4. package/dist/components/{navigation/_common/link-base/utils/getLinkBaseSlotChild.utils.js → _common/utils/get-label-slot-child/getLabelSlotChild.utils.js} +3 -3
  5. package/dist/components/_common/utils/get-label-slot-child/getLabelSlotChild.utils.js.map +1 -0
  6. package/dist/components/actions/_common/button-base/utils/getButtonBaseProps.utils.cjs +1 -1
  7. package/dist/components/actions/_common/button-base/utils/getButtonBaseProps.utils.cjs.map +1 -1
  8. package/dist/components/actions/_common/button-base/utils/getButtonBaseProps.utils.js +17 -11
  9. package/dist/components/actions/_common/button-base/utils/getButtonBaseProps.utils.js.map +1 -1
  10. package/dist/components/actions/button/Button.cjs +1 -1
  11. package/dist/components/actions/button/Button.cjs.map +1 -1
  12. package/dist/components/actions/button/Button.js +32 -28
  13. package/dist/components/actions/button/Button.js.map +1 -1
  14. package/dist/components/actions/button/utils/getButtonParts.utils.cjs +2 -0
  15. package/dist/components/actions/button/utils/getButtonParts.utils.cjs.map +1 -0
  16. package/dist/components/actions/button/utils/getButtonParts.utils.js +31 -0
  17. package/dist/components/actions/button/utils/getButtonParts.utils.js.map +1 -0
  18. package/dist/components/actions/icon-button/IconButton.cjs.map +1 -1
  19. package/dist/components/actions/icon-button/IconButton.js.map +1 -1
  20. package/dist/components/navigation/_common/link-base/utils/getLinkBaseParts.utils.cjs +1 -1
  21. package/dist/components/navigation/_common/link-base/utils/getLinkBaseParts.utils.cjs.map +1 -1
  22. package/dist/components/navigation/_common/link-base/utils/getLinkBaseParts.utils.js +6 -6
  23. package/dist/components/navigation/_common/link-base/utils/getLinkBaseParts.utils.js.map +1 -1
  24. package/dist/components/navigation/drawer/components/drawer-item/DrawerItem.cjs +1 -1
  25. package/dist/components/navigation/drawer/components/drawer-item/DrawerItem.cjs.map +1 -1
  26. package/dist/components/navigation/drawer/components/drawer-item/DrawerItem.css.cjs +1 -1
  27. package/dist/components/navigation/drawer/components/drawer-item/DrawerItem.css.js +3 -3
  28. package/dist/components/navigation/drawer/components/drawer-item/DrawerItem.js +12 -12
  29. package/dist/components/navigation/drawer/components/drawer-item/DrawerItem.js.map +1 -1
  30. package/dist/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils.cjs.map +1 -1
  31. package/dist/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils.js.map +1 -1
  32. package/dist/components/navigation/drawer/constants/index.cjs.map +1 -1
  33. package/dist/components/navigation/drawer/constants/index.js.map +1 -1
  34. package/dist/components/navigation/link/Link.cjs +1 -1
  35. package/dist/components/navigation/link/Link.cjs.map +1 -1
  36. package/dist/components/navigation/link/Link.js +9 -9
  37. package/dist/components/navigation/link/Link.js.map +1 -1
  38. package/dist/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.cjs +1 -1
  39. package/dist/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.cjs.map +1 -1
  40. package/dist/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.js +4 -4
  41. package/dist/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.js.map +1 -1
  42. package/dist/components/overlays/dropdown-menu/components/dropdown-menu-content/DropdownMenuContent.cjs +1 -1
  43. package/dist/components/overlays/dropdown-menu/components/dropdown-menu-content/DropdownMenuContent.cjs.map +1 -1
  44. package/dist/components/overlays/dropdown-menu/components/dropdown-menu-content/DropdownMenuContent.js +10 -10
  45. package/dist/components/overlays/tooltip/Tooltip.cjs +1 -1
  46. package/dist/components/overlays/tooltip/Tooltip.cjs.map +1 -1
  47. package/dist/components/overlays/tooltip/Tooltip.js +9 -9
  48. package/dist/index.d.cts +69 -20
  49. package/dist/index.d.ts +69 -20
  50. package/dist/styles.css +1 -1
  51. package/package.json +5 -5
  52. package/dist/components/navigation/_common/link-base/utils/getLinkBaseSlotChild.utils.cjs.map +0 -1
  53. package/dist/components/navigation/_common/link-base/utils/getLinkBaseSlotChild.utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerItem.cjs","names":["drawerPartNames","getDrawerItemParts","_Fragment","DecorativeIcon","drawerItemStyles","hasRenderableContent","VisuallyHidden","Box","cloneElement","require_DecorativeIcon","require_hasRenderableContent_utils","require_DrawerItem_css","require_getDrawerItemParts_utils","require_index","require_useDrawerContext_hook","_choco_vanille_primitives","react_jsx_runtime","react","DrawerItem","parts","props","children","content"],"sources":["../../../../../../src/components/navigation/drawer/components/drawer-item/DrawerItem.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { hasRenderableContent } from '@components/components/_common/utils/hasRenderableContent.utils';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemLinkProps,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { getDrawerItemParts } from '@components/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { useDrawerContext } from '@components/components/navigation/drawer/hooks/useDrawerContext.hook';\n\n/**\n * Renders an entry of a `Drawer`: its `label`, which names it, between an\n * optional decorative `startIcon` and `endIcon`, hidden from assistive\n * technologies, then an optional `endSlot`, such as a `Badge`, part of its\n * name. Its start icon sits in a column as wide as the item is high, where\n * a dot stands for a missing one in a collapsed `mini` drawer, every icon\n * being `1rem` high: in the rail, the item narrows to the square of that\n * column, centered, so its highlight and focus ring are squares around\n * the icon, which keeps its place while the drawer collapses; the label,\n * on one line, shrinks to nothing and fades out but stays in the DOM as\n * its name, and the `endIcon` and `endSlot` fade out, then are hidden,\n * the `endSlot` leaving its name; the fades follow the width of the\n * drawer, or are instant when reduced motion is preferred.\n *\n * Given an `href`, it is a link that behaves as a `Link`: a native `a`\n * whose `onClick`, on a plain click, Enter included, replaces the\n * navigation to `href`, a modified or middle click being left to the\n * browser; `external` opens it in a new tab, adds `noopener noreferrer` to\n * `rel`, ends it with the external icon unless `endIcon` is given, and\n * appends `externalLabel`, required with it, as visually hidden text to its\n * name; `disabled` drops `href`, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, and cancels its clicks. With `asChild`, it renders its\n * single child instead, an element without content such as a router link,\n * merging its props, classes, `ref` and content onto it, as a `Link` does.\n * Otherwise, it is a native `button`, of type `button` unless given,\n * natively disabled by `disabled`, calling `onClick` when pressed.\n *\n * `active` marks the item of the current page with `aria-current=\"page\"`,\n * a tinted primary fill and a heavier label. Hover tints apply on devices\n * that hover, without transition; the focus ring shows on keyboard focus\n * only. An item is at least `2.25rem` (36px) high, as the `md` controls:\n * a target above the 24px minimum of WCAG 2.2 AA but below the 44px of its\n * AAA level.\n * Every other prop (attributes, events, `ref`) goes to the element;\n * `className` comes after the generated classes, in the `cv.components`\n * cascade layers. Render it inside a `Drawer.Body`, a `Drawer.Group` or a\n * `Drawer.Footer`.\n *\n * @param props Label, icons, end slot, state, destination or single child,\n * and native props of the item.\n * @returns The item of the drawer.\n * @throws {Error} When rendered outside a `Drawer`, or with `asChild` when\n * the children are not a single element without content.\n */\nconst DrawerItem: FC<\n DrawerItemAsChildProps | DrawerItemLinkProps | DrawerItemProps\n> = (props) => {\n useDrawerContext(drawerPartNames.item);\n\n const parts = getDrawerItemParts(props);\n const { content } = parts;\n const children = (\n <>\n <DecorativeIcon\n className={\n content.isDot\n ? drawerItemStyles.dot\n : drawerItemStyles.startIcon\n }\n icon={content.startIcon}\n />\n <span className={drawerItemStyles.label}>{content.label}</span>\n {content.endIcon ? (\n <DecorativeIcon\n className={drawerItemStyles.endIcon}\n icon={content.endIcon}\n />\n ) : null}\n {hasRenderableContent(content.endSlot) ? (\n <span className={drawerItemStyles.endSlot}>\n {content.endSlot}\n </span>\n ) : null}\n {content.externalLabel === undefined ? null : (\n <VisuallyHidden> {content.externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n if (parts.element === 'button') {\n return (\n <Box as={'button'} {...parts.elementProps}>\n {children}\n </Box>\n );\n }\n\n return parts.child === undefined ? (\n <Box as={'a'} {...parts.elementProps}>\n {children}\n </Box>\n ) : (\n <Box asChild={true} {...parts.elementProps}>\n {cloneElement(parts.child.element, parts.child.props, children)}\n </Box>\n );\n};\n\nexport default DrawerItem;\n"],"mappings":"A,saA4DA,IAAMkB,EAED,GAAU,CACXJ,EAAA,iBAAiBd,EAAAA,gBAAgB,IAAI,EAErC,IAAMmB,EAAQlB,EAAAA,mBAAmBmB,CAAK,EAChC,CAAE,WAAYD,EACdE,GACF,EAAAL,EAAA,KAAA,CAAAd,EAAAA,SAAA,CAAA,SAAA,EACI,EAAAc,EAAA,IAAA,CAACb,EAAAA,QAAD,CACI,UACImB,EAAQ,MACFlB,EAAAA,iBAAiB,IACjBA,EAAAA,iBAAiB,UAE3B,KAAMkB,EAAQ,SACjB,CAAA,GACD,EAAAN,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWZ,EAAAA,iBAAiB,MAAQ,SAAAkB,EAAQ,KAAY,CAAA,EAC7DA,EAAQ,SACL,EAAAN,EAAA,IAAA,CAACb,EAAAA,QAAD,CACI,UAAWC,EAAAA,iBAAiB,QAC5B,KAAMkB,EAAQ,OACjB,CAAA,EACD,KACHjB,EAAAA,qBAAqBiB,EAAQ,OAAO,GACjC,EAAAN,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWZ,EAAAA,iBAAiB,QAC7B,SAAAkB,EAAQ,OACP,CAAA,EACN,KACHA,EAAQ,gBAAkB,IAAA,GAAY,MACnC,EAAAN,EAAA,KAAA,CAACV,EAAAA,eAAD,CAAA,SAAA,CAAgB,IAAEgB,EAAQ,aAA8B,CAAA,CAAA,CAE9D,CAAA,CAAA,EAWN,OARIH,EAAM,UAAY,UAEd,EAAAH,EAAA,IAAA,CAACT,EAAAA,IAAD,CAAK,GAAI,SAAU,GAAIY,EAAM,aACxB,UACA,CAAA,EAINA,EAAM,QAAU,IAAA,IACnB,EAAAH,EAAA,IAAA,CAACT,EAAAA,IAAD,CAAK,GAAI,IAAK,GAAIY,EAAM,aACnB,UACA,CAAA,GAEL,EAAAH,EAAA,IAAA,CAACT,EAAAA,IAAD,CAAK,QAAS,GAAM,GAAIY,EAAM,aACzB,UAAA,EAAAX,EAAAA,aAAAA,CAAaW,EAAM,MAAM,QAASA,EAAM,MAAM,MAAOE,CAAQ,CAC7D,CAAA,CAEb,E"}
1
+ {"version":3,"file":"DrawerItem.cjs","names":["drawerPartNames","getDrawerItemParts","_Fragment","DecorativeIcon","drawerItemStyles","hasRenderableContent","VisuallyHidden","Box","cloneElement","require_DecorativeIcon","require_hasRenderableContent_utils","require_DrawerItem_css","require_getDrawerItemParts_utils","require_index","require_useDrawerContext_hook","_choco_vanille_primitives","react","react_jsx_runtime","DrawerItem","parts","props","children","content"],"sources":["../../../../../../src/components/navigation/drawer/components/drawer-item/DrawerItem.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { hasRenderableContent } from '@components/components/_common/utils/hasRenderableContent.utils';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemLinkProps,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { getDrawerItemParts } from '@components/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { useDrawerContext } from '@components/components/navigation/drawer/hooks/useDrawerContext.hook';\n\n/**\n * Renders an entry of a `Drawer`: its `label`, which names it, between an\n * optional decorative `startIcon` and `endIcon`, hidden from assistive\n * technologies, then an optional `endSlot`, such as a `Badge`, part of its\n * name. Its start icon sits in a column as wide as the item is high, every\n * icon being `1rem` high; without one, a `mini` drawer shows a dot in that\n * column, expanded as collapsed, while any other drawer leaves no column,\n * the label starting the item: in the rail, the item narrows to the square\n * of that column, centered, so its highlight and focus ring are squares\n * around the icon, which keeps its place while the drawer collapses; the\n * label, on one line, shrinks to nothing and fades out but stays in the DOM\n * as its name, and the `endIcon` and `endSlot` fade out, then are hidden,\n * the `endSlot` leaving its name; the fades follow the width of the\n * drawer, or are instant when reduced motion is preferred.\n *\n * Given an `href`, it is a link that behaves as a `Link`: a native `a`\n * whose `onClick`, on a plain click, Enter included, replaces the\n * navigation to `href`, a modified or middle click being left to the\n * browser; `external` opens it in a new tab, adds `noopener noreferrer` to\n * `rel`, ends it with the external icon unless `endIcon` is given, and\n * appends `externalLabel`, required with it, as visually hidden text to its\n * name; `disabled` drops `href`, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, and cancels its clicks. With `asChild`, it renders its\n * single child instead, an element without content such as a router link,\n * merging its props, classes, `ref` and content onto it, as a `Link` does.\n * Otherwise, it is a native `button`, of type `button` unless given,\n * natively disabled by `disabled`, calling `onClick` when pressed.\n *\n * `active` marks the item of the current page with `aria-current=\"page\"`,\n * a tinted primary fill and a heavier label. Hover tints apply on devices\n * that hover, without transition; the focus ring shows on keyboard focus\n * only. An item is at least `2.25rem` (36px) high, as the `md` controls:\n * a target above the 24px minimum of WCAG 2.2 AA but below the 44px of its\n * AAA level.\n * Every other prop (attributes, events, `ref`) goes to the element;\n * `className` comes after the generated classes, in the `cv.components`\n * cascade layers. Render it inside a `Drawer.Body`, a `Drawer.Group` or a\n * `Drawer.Footer`.\n *\n * @param props Label, icons, end slot, state, destination or single child,\n * and native props of the item.\n * @returns The item of the drawer.\n * @throws {Error} When rendered outside a `Drawer`, or with `asChild` when\n * the children are not a single element without content.\n */\nconst DrawerItem: FC<\n DrawerItemAsChildProps | DrawerItemLinkProps | DrawerItemProps\n> = (props) => {\n useDrawerContext(drawerPartNames.item);\n\n const parts = getDrawerItemParts(props);\n const { content } = parts;\n const children = (\n <>\n <DecorativeIcon\n className={\n content.isDot\n ? drawerItemStyles.dot\n : drawerItemStyles.startIcon\n }\n icon={content.startIcon}\n />\n <span className={drawerItemStyles.label}>{content.label}</span>\n {content.endIcon ? (\n <DecorativeIcon\n className={drawerItemStyles.endIcon}\n icon={content.endIcon}\n />\n ) : null}\n {hasRenderableContent(content.endSlot) ? (\n <span className={drawerItemStyles.endSlot}>\n {content.endSlot}\n </span>\n ) : null}\n {content.externalLabel === undefined ? null : (\n <VisuallyHidden> {content.externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n if (parts.element === 'button') {\n return (\n <Box as={'button'} {...parts.elementProps}>\n {children}\n </Box>\n );\n }\n\n return parts.child === undefined ? (\n <Box as={'a'} {...parts.elementProps}>\n {children}\n </Box>\n ) : (\n <Box asChild={true} {...parts.elementProps}>\n {cloneElement(parts.child.element, parts.child.props, children)}\n </Box>\n );\n};\n\nexport default DrawerItem;\n"],"mappings":"A,saA6DA,IAAMkB,EAED,GAAU,CACXJ,EAAA,iBAAiBd,EAAAA,gBAAgB,IAAI,EAErC,IAAMmB,EAAQlB,EAAAA,mBAAmBmB,CAAK,EAChC,CAAE,WAAYD,EACdE,GACF,EAAAJ,EAAA,KAAA,CAAAf,EAAAA,SAAA,CAAA,SAAA,EACI,EAAAe,EAAA,IAAA,CAACd,EAAAA,QAAD,CACI,UACImB,EAAQ,MACFlB,EAAAA,iBAAiB,IACjBA,EAAAA,iBAAiB,UAE3B,KAAMkB,EAAQ,SACjB,CAAA,GACD,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWb,EAAAA,iBAAiB,MAAQ,SAAAkB,EAAQ,KAAY,CAAA,EAC7DA,EAAQ,SACL,EAAAL,EAAA,IAAA,CAACd,EAAAA,QAAD,CACI,UAAWC,EAAAA,iBAAiB,QAC5B,KAAMkB,EAAQ,OACjB,CAAA,EACD,KACHjB,EAAAA,qBAAqBiB,EAAQ,OAAO,GACjC,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWb,EAAAA,iBAAiB,QAC7B,SAAAkB,EAAQ,OACP,CAAA,EACN,KACHA,EAAQ,gBAAkB,IAAA,GAAY,MACnC,EAAAL,EAAA,KAAA,CAACX,EAAAA,eAAD,CAAA,SAAA,CAAgB,IAAEgB,EAAQ,aAA8B,CAAA,CAAA,CAE9D,CAAA,CAAA,EAWN,OARIH,EAAM,UAAY,UAEd,EAAAF,EAAA,IAAA,CAACV,EAAAA,IAAD,CAAK,GAAI,SAAU,GAAIY,EAAM,aACxB,UACA,CAAA,EAINA,EAAM,QAAU,IAAA,IACnB,EAAAF,EAAA,IAAA,CAACV,EAAAA,IAAD,CAAK,GAAI,IAAK,GAAIY,EAAM,aACnB,UACA,CAAA,GAEL,EAAAF,EAAA,IAAA,CAACV,EAAAA,IAAD,CAAK,QAAS,GAAM,GAAIY,EAAM,aACzB,UAAA,EAAAX,EAAAA,aAAAA,CAAaW,EAAM,MAAM,QAASA,EAAM,MAAM,MAAOE,CAAQ,CAC7D,CAAA,CAEb,E"}
@@ -1,2 +1,2 @@
1
- /* empty css *//* empty css */;/* empty css */var e={dot:`kvi9b32`,endIcon:`kvi9b34`,endSlot:`kvi9b35`,label:`kvi9b33`,root:`kvi9b30`,startIcon:`kvi9b31`};exports.drawerItemStyles=e;
1
+ /* empty css *//* empty css */;/* empty css */var e={dot:`kvi9b31`,endIcon:`kvi9b34`,endSlot:`kvi9b35`,label:`kvi9b33`,root:`kvi9b32`,startIcon:`kvi9b30`};exports.drawerItemStyles=e;
2
2
  //# sourceMappingURL=DrawerItem.css.cjs.map
@@ -3,12 +3,12 @@
3
3
  /* empty css */
4
4
  // src/components/navigation/drawer/components/drawer-item/DrawerItem.css.ts
5
5
  var e = {
6
- dot: "kvi9b32",
6
+ dot: "kvi9b31",
7
7
  endIcon: "kvi9b34",
8
8
  endSlot: "kvi9b35",
9
9
  label: "kvi9b33",
10
- root: "kvi9b30",
11
- startIcon: "kvi9b31"
10
+ root: "kvi9b32",
11
+ startIcon: "kvi9b30"
12
12
  };
13
13
  export { e as drawerItemStyles };
14
14
 
@@ -5,42 +5,42 @@ import { getDrawerItemParts as r } from "./utils/getDrawerItemParts.utils.js";
5
5
  import { drawerPartNames as i } from "../../constants/index.js";
6
6
  import { useDrawerContext as a } from "../../hooks/useDrawerContext.hook.js";
7
7
  import { Box as o, VisuallyHidden as s } from "@choco-vanille/primitives";
8
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
9
- import { cloneElement as d } from "react";
8
+ import { cloneElement as c } from "react";
9
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
10
10
  // src/components/navigation/drawer/components/drawer-item/DrawerItem.tsx
11
11
  var f = (f) => {
12
12
  a(i.item);
13
- let p = r(f), { content: m } = p, h = /* @__PURE__ */ u(c, { children: [
14
- /* @__PURE__ */ l(e, {
13
+ let p = r(f), { content: m } = p, h = /* @__PURE__ */ d(l, { children: [
14
+ /* @__PURE__ */ u(e, {
15
15
  className: m.isDot ? n.dot : n.startIcon,
16
16
  icon: m.startIcon
17
17
  }),
18
- /* @__PURE__ */ l("span", {
18
+ /* @__PURE__ */ u("span", {
19
19
  className: n.label,
20
20
  children: m.label
21
21
  }),
22
- m.endIcon ? /* @__PURE__ */ l(e, {
22
+ m.endIcon ? /* @__PURE__ */ u(e, {
23
23
  className: n.endIcon,
24
24
  icon: m.endIcon
25
25
  }) : null,
26
- t(m.endSlot) ? /* @__PURE__ */ l("span", {
26
+ t(m.endSlot) ? /* @__PURE__ */ u("span", {
27
27
  className: n.endSlot,
28
28
  children: m.endSlot
29
29
  }) : null,
30
- m.externalLabel === void 0 ? null : /* @__PURE__ */ u(s, { children: [" ", m.externalLabel] })
30
+ m.externalLabel === void 0 ? null : /* @__PURE__ */ d(s, { children: [" ", m.externalLabel] })
31
31
  ] });
32
- return p.element === "button" ? /* @__PURE__ */ l(o, {
32
+ return p.element === "button" ? /* @__PURE__ */ u(o, {
33
33
  as: "button",
34
34
  ...p.elementProps,
35
35
  children: h
36
- }) : p.child === void 0 ? /* @__PURE__ */ l(o, {
36
+ }) : p.child === void 0 ? /* @__PURE__ */ u(o, {
37
37
  as: "a",
38
38
  ...p.elementProps,
39
39
  children: h
40
- }) : /* @__PURE__ */ l(o, {
40
+ }) : /* @__PURE__ */ u(o, {
41
41
  asChild: !0,
42
42
  ...p.elementProps,
43
- children: d(p.child.element, p.child.props, h)
43
+ children: c(p.child.element, p.child.props, h)
44
44
  });
45
45
  };
46
46
  export { f as default };
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerItem.js","names":["_Fragment","DecorativeIcon","DrawerItem","drawerPartNames","parts","getDrawerItemParts","props","children","Fragment","content","drawerItemStyles","hasRenderableContent","VisuallyHidden","Box","cloneElement"],"sources":["../../../../../../src/components/navigation/drawer/components/drawer-item/DrawerItem.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { hasRenderableContent } from '@components/components/_common/utils/hasRenderableContent.utils';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemLinkProps,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { getDrawerItemParts } from '@components/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { useDrawerContext } from '@components/components/navigation/drawer/hooks/useDrawerContext.hook';\n\n/**\n * Renders an entry of a `Drawer`: its `label`, which names it, between an\n * optional decorative `startIcon` and `endIcon`, hidden from assistive\n * technologies, then an optional `endSlot`, such as a `Badge`, part of its\n * name. Its start icon sits in a column as wide as the item is high, where\n * a dot stands for a missing one in a collapsed `mini` drawer, every icon\n * being `1rem` high: in the rail, the item narrows to the square of that\n * column, centered, so its highlight and focus ring are squares around\n * the icon, which keeps its place while the drawer collapses; the label,\n * on one line, shrinks to nothing and fades out but stays in the DOM as\n * its name, and the `endIcon` and `endSlot` fade out, then are hidden,\n * the `endSlot` leaving its name; the fades follow the width of the\n * drawer, or are instant when reduced motion is preferred.\n *\n * Given an `href`, it is a link that behaves as a `Link`: a native `a`\n * whose `onClick`, on a plain click, Enter included, replaces the\n * navigation to `href`, a modified or middle click being left to the\n * browser; `external` opens it in a new tab, adds `noopener noreferrer` to\n * `rel`, ends it with the external icon unless `endIcon` is given, and\n * appends `externalLabel`, required with it, as visually hidden text to its\n * name; `disabled` drops `href`, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, and cancels its clicks. With `asChild`, it renders its\n * single child instead, an element without content such as a router link,\n * merging its props, classes, `ref` and content onto it, as a `Link` does.\n * Otherwise, it is a native `button`, of type `button` unless given,\n * natively disabled by `disabled`, calling `onClick` when pressed.\n *\n * `active` marks the item of the current page with `aria-current=\"page\"`,\n * a tinted primary fill and a heavier label. Hover tints apply on devices\n * that hover, without transition; the focus ring shows on keyboard focus\n * only. An item is at least `2.25rem` (36px) high, as the `md` controls:\n * a target above the 24px minimum of WCAG 2.2 AA but below the 44px of its\n * AAA level.\n * Every other prop (attributes, events, `ref`) goes to the element;\n * `className` comes after the generated classes, in the `cv.components`\n * cascade layers. Render it inside a `Drawer.Body`, a `Drawer.Group` or a\n * `Drawer.Footer`.\n *\n * @param props Label, icons, end slot, state, destination or single child,\n * and native props of the item.\n * @returns The item of the drawer.\n * @throws {Error} When rendered outside a `Drawer`, or with `asChild` when\n * the children are not a single element without content.\n */\nconst DrawerItem: FC<\n DrawerItemAsChildProps | DrawerItemLinkProps | DrawerItemProps\n> = (props) => {\n useDrawerContext(drawerPartNames.item);\n\n const parts = getDrawerItemParts(props);\n const { content } = parts;\n const children = (\n <>\n <DecorativeIcon\n className={\n content.isDot\n ? drawerItemStyles.dot\n : drawerItemStyles.startIcon\n }\n icon={content.startIcon}\n />\n <span className={drawerItemStyles.label}>{content.label}</span>\n {content.endIcon ? (\n <DecorativeIcon\n className={drawerItemStyles.endIcon}\n icon={content.endIcon}\n />\n ) : null}\n {hasRenderableContent(content.endSlot) ? (\n <span className={drawerItemStyles.endSlot}>\n {content.endSlot}\n </span>\n ) : null}\n {content.externalLabel === undefined ? null : (\n <VisuallyHidden> {content.externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n if (parts.element === 'button') {\n return (\n <Box as={'button'} {...parts.elementProps}>\n {children}\n </Box>\n );\n }\n\n return parts.child === undefined ? (\n <Box as={'a'} {...parts.elementProps}>\n {children}\n </Box>\n ) : (\n <Box asChild={true} {...parts.elementProps}>\n {cloneElement(parts.child.element, parts.child.props, children)}\n </Box>\n );\n};\n\nexport default DrawerItem;\n"],"mappings":";;;;;;;;;;AA4DA,IAAME,KAED,MAAU;CACX,EAAiBC,EAAgB,IAAI;CAErC,IAAMC,IAAQC,EAAmBC,CAAK,GAChC,EAAE,eAAYF,GACdG,IACF,kBAAAP,GAAA,EAAA,UAAA;EACI,kBAACC,GAAD;GACI,WACIQ,EAAQ,QACFC,EAAiB,MACjBA,EAAiB;GAE3B,MAAMD,EAAQ;EACjB,CAAA;EACD,kBAAC,QAAD;GAAM,WAAWC,EAAiB;GAAQ,UAAAD,EAAQ;EAAY,CAAA;EAC7DA,EAAQ,UACL,kBAACR,GAAD;GACI,WAAWS,EAAiB;GAC5B,MAAMD,EAAQ;EACjB,CAAA,IACD;EACHE,EAAqBF,EAAQ,OAAO,IACjC,kBAAC,QAAD;GAAM,WAAWC,EAAiB;GAC7B,UAAAD,EAAQ;EACP,CAAA,IACN;EACHA,EAAQ,kBAAkB,KAAA,IAAY,OACnC,kBAACG,GAAD,EAAA,UAAA,CAAgB,KAAEH,EAAQ,aAA8B,EAAA,CAAA;CAE9D,EAAA,CAAA;CAWN,OARIL,EAAM,YAAY,WAEd,kBAACS,GAAD;EAAK,IAAI;EAAU,GAAIT,EAAM;EACxB;CACA,CAAA,IAINA,EAAM,UAAU,KAAA,IACnB,kBAACS,GAAD;EAAK,IAAI;EAAK,GAAIT,EAAM;EACnB;CACA,CAAA,IAEL,kBAACS,GAAD;EAAK,SAAS;EAAM,GAAIT,EAAM;EACzB,UAAAU,EAAaV,EAAM,MAAM,SAASA,EAAM,MAAM,OAAOG,CAAQ;CAC7D,CAAA;AAEb"}
1
+ {"version":3,"file":"DrawerItem.js","names":["_Fragment","DecorativeIcon","Fragment$1","DrawerItem","drawerPartNames","parts","getDrawerItemParts","props","children","content","drawerItemStyles","hasRenderableContent","VisuallyHidden","Box","cloneElement"],"sources":["../../../../../../src/components/navigation/drawer/components/drawer-item/DrawerItem.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { hasRenderableContent } from '@components/components/_common/utils/hasRenderableContent.utils';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemLinkProps,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { getDrawerItemParts } from '@components/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { useDrawerContext } from '@components/components/navigation/drawer/hooks/useDrawerContext.hook';\n\n/**\n * Renders an entry of a `Drawer`: its `label`, which names it, between an\n * optional decorative `startIcon` and `endIcon`, hidden from assistive\n * technologies, then an optional `endSlot`, such as a `Badge`, part of its\n * name. Its start icon sits in a column as wide as the item is high, every\n * icon being `1rem` high; without one, a `mini` drawer shows a dot in that\n * column, expanded as collapsed, while any other drawer leaves no column,\n * the label starting the item: in the rail, the item narrows to the square\n * of that column, centered, so its highlight and focus ring are squares\n * around the icon, which keeps its place while the drawer collapses; the\n * label, on one line, shrinks to nothing and fades out but stays in the DOM\n * as its name, and the `endIcon` and `endSlot` fade out, then are hidden,\n * the `endSlot` leaving its name; the fades follow the width of the\n * drawer, or are instant when reduced motion is preferred.\n *\n * Given an `href`, it is a link that behaves as a `Link`: a native `a`\n * whose `onClick`, on a plain click, Enter included, replaces the\n * navigation to `href`, a modified or middle click being left to the\n * browser; `external` opens it in a new tab, adds `noopener noreferrer` to\n * `rel`, ends it with the external icon unless `endIcon` is given, and\n * appends `externalLabel`, required with it, as visually hidden text to its\n * name; `disabled` drops `href`, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, and cancels its clicks. With `asChild`, it renders its\n * single child instead, an element without content such as a router link,\n * merging its props, classes, `ref` and content onto it, as a `Link` does.\n * Otherwise, it is a native `button`, of type `button` unless given,\n * natively disabled by `disabled`, calling `onClick` when pressed.\n *\n * `active` marks the item of the current page with `aria-current=\"page\"`,\n * a tinted primary fill and a heavier label. Hover tints apply on devices\n * that hover, without transition; the focus ring shows on keyboard focus\n * only. An item is at least `2.25rem` (36px) high, as the `md` controls:\n * a target above the 24px minimum of WCAG 2.2 AA but below the 44px of its\n * AAA level.\n * Every other prop (attributes, events, `ref`) goes to the element;\n * `className` comes after the generated classes, in the `cv.components`\n * cascade layers. Render it inside a `Drawer.Body`, a `Drawer.Group` or a\n * `Drawer.Footer`.\n *\n * @param props Label, icons, end slot, state, destination or single child,\n * and native props of the item.\n * @returns The item of the drawer.\n * @throws {Error} When rendered outside a `Drawer`, or with `asChild` when\n * the children are not a single element without content.\n */\nconst DrawerItem: FC<\n DrawerItemAsChildProps | DrawerItemLinkProps | DrawerItemProps\n> = (props) => {\n useDrawerContext(drawerPartNames.item);\n\n const parts = getDrawerItemParts(props);\n const { content } = parts;\n const children = (\n <>\n <DecorativeIcon\n className={\n content.isDot\n ? drawerItemStyles.dot\n : drawerItemStyles.startIcon\n }\n icon={content.startIcon}\n />\n <span className={drawerItemStyles.label}>{content.label}</span>\n {content.endIcon ? (\n <DecorativeIcon\n className={drawerItemStyles.endIcon}\n icon={content.endIcon}\n />\n ) : null}\n {hasRenderableContent(content.endSlot) ? (\n <span className={drawerItemStyles.endSlot}>\n {content.endSlot}\n </span>\n ) : null}\n {content.externalLabel === undefined ? null : (\n <VisuallyHidden> {content.externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n if (parts.element === 'button') {\n return (\n <Box as={'button'} {...parts.elementProps}>\n {children}\n </Box>\n );\n }\n\n return parts.child === undefined ? (\n <Box as={'a'} {...parts.elementProps}>\n {children}\n </Box>\n ) : (\n <Box asChild={true} {...parts.elementProps}>\n {cloneElement(parts.child.element, parts.child.props, children)}\n </Box>\n );\n};\n\nexport default DrawerItem;\n"],"mappings":";;;;;;;;;;AA6DA,IAAMG,KAED,MAAU;CACX,EAAiBC,EAAgB,IAAI;CAErC,IAAMC,IAAQC,EAAmBC,CAAK,GAChC,EAAE,eAAYF,GACdG,IACF,kBAAAR,GAAA,EAAA,UAAA;EACI,kBAACC,GAAD;GACI,WACIQ,EAAQ,QACFC,EAAiB,MACjBA,EAAiB;GAE3B,MAAMD,EAAQ;EACjB,CAAA;EACD,kBAAC,QAAD;GAAM,WAAWC,EAAiB;GAAQ,UAAAD,EAAQ;EAAY,CAAA;EAC7DA,EAAQ,UACL,kBAACR,GAAD;GACI,WAAWS,EAAiB;GAC5B,MAAMD,EAAQ;EACjB,CAAA,IACD;EACHE,EAAqBF,EAAQ,OAAO,IACjC,kBAAC,QAAD;GAAM,WAAWC,EAAiB;GAC7B,UAAAD,EAAQ;EACP,CAAA,IACN;EACHA,EAAQ,kBAAkB,KAAA,IAAY,OACnC,kBAACG,GAAD,EAAA,UAAA,CAAgB,KAAEH,EAAQ,aAA8B,EAAA,CAAA;CAE9D,EAAA,CAAA;CAWN,OARIJ,EAAM,YAAY,WAEd,kBAACQ,GAAD;EAAK,IAAI;EAAU,GAAIR,EAAM;EACxB;CACA,CAAA,IAINA,EAAM,UAAU,KAAA,IACnB,kBAACQ,GAAD;EAAK,IAAI;EAAK,GAAIR,EAAM;EACnB;CACA,CAAA,IAEL,kBAACQ,GAAD;EAAK,SAAS;EAAM,GAAIR,EAAM;EACzB,UAAAS,EAAaT,EAAM,MAAM,SAASA,EAAM,MAAM,OAAOG,CAAQ;CAC7D,CAAA;AAEb"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDrawerItemParts.utils.cjs","names":["iconRegistry","drawerItemDefaults","mergeClassNames","drawerItemStyles","getLinkBaseParts","drawerPartNames","getStateFlagAttributes","require_getStateFlagAttributes_utils","require_mergeClassNames_utils","require_getLinkBaseParts_utils","require_index","require_DrawerItem_css","require_index$1","require_iconRegistry_const","resolveDrawerItemContent","content","startIcon","getDrawerItemParts","props","generatedClassName","className","ariaCurrent","active","buttonProps"],"sources":["../../../../../../../src/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils.ts"],"sourcesContent":["import { getStateFlagAttributes } from '@components/components/_common/utils/get-state-flag-attributes/getStateFlagAttributes.utils';\nimport { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { getLinkBaseParts } from '@components/components/navigation/_common/link-base/utils/getLinkBaseParts.utils';\nimport { drawerItemDefaults } from '@components/components/navigation/drawer/components/drawer-item/constants';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemContent,\n DrawerItemContentInput,\n DrawerItemLinkProps,\n DrawerItemParts,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { iconRegistry } from '@components/constants/iconRegistry.const';\n\n/**\n * Resolves the content of a `Drawer.Item`, the same whatever the state of\n * its drawer, whose styles fade its parts: its start icon, or the dot\n * standing for a missing one, shown only in a collapsed drawer, then its\n * label, its end icon, its end slot and the hidden label of an external\n * link.\n *\n * @param content Content of the item, its end icon resolved.\n * @param content.startIcon Data of the start icon; none when absent.\n * @returns The content to render.\n */\nconst resolveDrawerItemContent = ({\n startIcon,\n ...content\n}: DrawerItemContentInput): DrawerItemContent => ({\n ...content,\n isDot: startIcon === undefined,\n startIcon: startIcon ?? iconRegistry.iconPlaceholder,\n});\n\n/**\n * Resolves what a `Drawer.Item` renders from its props. Given an `href` or\n * `asChild`, it is a link of the navigation, resolved as a `Link` (see\n * `getLinkBaseParts`): `onClick` replaces the navigation on a plain click\n * of its own `a`, `external` opens it in a new tab with `externalLabel`\n * hidden in its name and the external icon unless `endIcon` is given,\n * `disabled` drops its destination and cancels its clicks, and `asChild`\n * merges it onto its single child. Otherwise, it is a `button`, of type\n * `button` unless given, natively disabled by `disabled`. Both are flagged\n * by `data-disabled` while disabled, take `aria-current=\"page\"` while\n * `active`, or keep the `aria-current` given, and take the generated class,\n * then the consumer's `className`.\n *\n * @param props Props of the item.\n * @param props.active Whether the item is the current page; `false` when\n * absent.\n * @param props.className Classes added after the generated ones.\n * @param props.endSlot Content at the end of the item; none when absent.\n * @returns The element, its props and the content of the item.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, are a fragment, or have content of their own.\n */\nexport const getDrawerItemParts = ({\n active = drawerItemDefaults.active,\n className,\n endSlot,\n ...props\n}:\n | DrawerItemAsChildProps\n | DrawerItemLinkProps\n | DrawerItemProps): DrawerItemParts => {\n const generatedClassName = mergeClassNames(\n drawerItemStyles.root,\n className,\n );\n const ariaCurrent = active\n ? drawerItemDefaults.ariaCurrent\n : props['aria-current'];\n\n if (props.asChild === true || props.href !== undefined) {\n const {\n child,\n elementProps,\n endIcon,\n externalLabel,\n label,\n startIcon,\n } = getLinkBaseParts(\n { ...props, 'aria-current': ariaCurrent },\n { className: generatedClassName, partName: drawerPartNames.item },\n );\n\n return {\n child,\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n externalLabel,\n label,\n startIcon,\n }),\n element: 'link',\n elementProps,\n };\n }\n\n const {\n disabled = drawerItemDefaults.disabled,\n endIcon,\n label,\n startIcon,\n type = drawerItemDefaults.type,\n ...buttonProps\n } = props;\n\n return {\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n label,\n startIcon,\n }),\n element: 'button',\n elementProps: {\n ...buttonProps,\n ...getStateFlagAttributes({ disabled }),\n 'aria-current': ariaCurrent,\n className: generatedClassName,\n disabled,\n type,\n },\n };\n};\n"],"mappings":"A,4aA2BA,IAAMc,GAA4B,CAC9B,YACA,GAAGC,MAC2C,CAC9C,GAAGA,EACH,MAAOC,IAAc,IAAA,GACrB,UAAWA,GAAahB,EAAAA,aAAa,eACzC,GAwBaiB,GAAsB,CAC/B,SAAShB,EAAAA,mBAAmB,OAC5B,YACA,UACA,GAAGiB,KAIoC,CACvC,IAAMC,EAAqBjB,EAAAA,gBACvBC,EAAAA,iBAAiB,KACjBiB,CACJ,EACMC,EAAcC,EACdrB,EAAAA,mBAAmB,YACnBiB,EAAM,gBAEZ,GAAIA,EAAM,UAAY,IAAQA,EAAM,OAAS,IAAA,GAAW,CACpD,GAAM,CACF,QACA,eACA,UACA,gBACA,QACA,aACAd,EAAAA,iBACA,CAAE,GAAGc,EAAO,eAAgBG,CAAY,EACxC,CAAE,UAAWF,EAAoB,SAAUd,EAAAA,gBAAgB,IAAK,CACpE,EAEA,MAAO,CACH,QACA,QAASS,EAAyB,CAC9B,UACA,UACA,gBACA,QACA,WACJ,CAAC,EACD,QAAS,OACT,cACJ,CACJ,CAEA,GAAM,CACF,WAAWb,EAAAA,mBAAmB,SAC9B,UACA,QACA,YACA,OAAOA,EAAAA,mBAAmB,KAC1B,GAAGsB,GACHL,EAEJ,MAAO,CACH,QAASJ,EAAyB,CAC9B,UACA,UACA,QACA,WACJ,CAAC,EACD,QAAS,SACT,aAAc,CACV,GAAGS,EACH,GAAGjB,EAAAA,uBAAuB,CAAE,UAAS,CAAC,EACtC,eAAgBe,EAChB,UAAWF,EACX,WACA,MACJ,CACJ,CACJ,E"}
1
+ {"version":3,"file":"getDrawerItemParts.utils.cjs","names":["iconRegistry","drawerItemDefaults","mergeClassNames","drawerItemStyles","getLinkBaseParts","drawerPartNames","getStateFlagAttributes","require_getStateFlagAttributes_utils","require_mergeClassNames_utils","require_getLinkBaseParts_utils","require_index","require_DrawerItem_css","require_index$1","require_iconRegistry_const","resolveDrawerItemContent","content","startIcon","getDrawerItemParts","props","generatedClassName","className","ariaCurrent","active","buttonProps"],"sources":["../../../../../../../src/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils.ts"],"sourcesContent":["import { getStateFlagAttributes } from '@components/components/_common/utils/get-state-flag-attributes/getStateFlagAttributes.utils';\nimport { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { getLinkBaseParts } from '@components/components/navigation/_common/link-base/utils/getLinkBaseParts.utils';\nimport { drawerItemDefaults } from '@components/components/navigation/drawer/components/drawer-item/constants';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemContent,\n DrawerItemContentInput,\n DrawerItemLinkProps,\n DrawerItemParts,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { iconRegistry } from '@components/constants/iconRegistry.const';\n\n/**\n * Resolves the content of a `Drawer.Item`, the same whatever the state of\n * its drawer, whose styles fade its parts: its start icon, or the dot\n * standing for a missing one, shown only in a `mini` drawer, expanded as\n * collapsed, and taking no room elsewhere, then its label, its end icon,\n * its end slot and the hidden label of an external link.\n *\n * @param content Content of the item, its end icon resolved.\n * @param content.startIcon Data of the start icon; none when absent.\n * @returns The content to render.\n */\nconst resolveDrawerItemContent = ({\n startIcon,\n ...content\n}: DrawerItemContentInput): DrawerItemContent => ({\n ...content,\n isDot: startIcon === undefined,\n startIcon: startIcon ?? iconRegistry.iconPlaceholder,\n});\n\n/**\n * Resolves what a `Drawer.Item` renders from its props. Given an `href` or\n * `asChild`, it is a link of the navigation, resolved as a `Link` (see\n * `getLinkBaseParts`): `onClick` replaces the navigation on a plain click\n * of its own `a`, `external` opens it in a new tab with `externalLabel`\n * hidden in its name and the external icon unless `endIcon` is given,\n * `disabled` drops its destination and cancels its clicks, and `asChild`\n * merges it onto its single child. Otherwise, it is a `button`, of type\n * `button` unless given, natively disabled by `disabled`. Both are flagged\n * by `data-disabled` while disabled, take `aria-current=\"page\"` while\n * `active`, or keep the `aria-current` given, and take the generated class,\n * then the consumer's `className`.\n *\n * @param props Props of the item.\n * @param props.active Whether the item is the current page; `false` when\n * absent.\n * @param props.className Classes added after the generated ones.\n * @param props.endSlot Content at the end of the item; none when absent.\n * @returns The element, its props and the content of the item.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, are a fragment, or have content of their own.\n */\nexport const getDrawerItemParts = ({\n active = drawerItemDefaults.active,\n className,\n endSlot,\n ...props\n}:\n | DrawerItemAsChildProps\n | DrawerItemLinkProps\n | DrawerItemProps): DrawerItemParts => {\n const generatedClassName = mergeClassNames(\n drawerItemStyles.root,\n className,\n );\n const ariaCurrent = active\n ? drawerItemDefaults.ariaCurrent\n : props['aria-current'];\n\n if (props.asChild === true || props.href !== undefined) {\n const {\n child,\n elementProps,\n endIcon,\n externalLabel,\n label,\n startIcon,\n } = getLinkBaseParts(\n { ...props, 'aria-current': ariaCurrent },\n { className: generatedClassName, partName: drawerPartNames.item },\n );\n\n return {\n child,\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n externalLabel,\n label,\n startIcon,\n }),\n element: 'link',\n elementProps,\n };\n }\n\n const {\n disabled = drawerItemDefaults.disabled,\n endIcon,\n label,\n startIcon,\n type = drawerItemDefaults.type,\n ...buttonProps\n } = props;\n\n return {\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n label,\n startIcon,\n }),\n element: 'button',\n elementProps: {\n ...buttonProps,\n ...getStateFlagAttributes({ disabled }),\n 'aria-current': ariaCurrent,\n className: generatedClassName,\n disabled,\n type,\n },\n };\n};\n"],"mappings":"A,4aA2BA,IAAMc,GAA4B,CAC9B,YACA,GAAGC,MAC2C,CAC9C,GAAGA,EACH,MAAOC,IAAc,IAAA,GACrB,UAAWA,GAAahB,EAAAA,aAAa,eACzC,GAwBaiB,GAAsB,CAC/B,SAAShB,EAAAA,mBAAmB,OAC5B,YACA,UACA,GAAGiB,KAIoC,CACvC,IAAMC,EAAqBjB,EAAAA,gBACvBC,EAAAA,iBAAiB,KACjBiB,CACJ,EACMC,EAAcC,EACdrB,EAAAA,mBAAmB,YACnBiB,EAAM,gBAEZ,GAAIA,EAAM,UAAY,IAAQA,EAAM,OAAS,IAAA,GAAW,CACpD,GAAM,CACF,QACA,eACA,UACA,gBACA,QACA,aACAd,EAAAA,iBACA,CAAE,GAAGc,EAAO,eAAgBG,CAAY,EACxC,CAAE,UAAWF,EAAoB,SAAUd,EAAAA,gBAAgB,IAAK,CACpE,EAEA,MAAO,CACH,QACA,QAASS,EAAyB,CAC9B,UACA,UACA,gBACA,QACA,WACJ,CAAC,EACD,QAAS,OACT,cACJ,CACJ,CAEA,GAAM,CACF,WAAWb,EAAAA,mBAAmB,SAC9B,UACA,QACA,YACA,OAAOA,EAAAA,mBAAmB,KAC1B,GAAGsB,GACHL,EAEJ,MAAO,CACH,QAASJ,EAAyB,CAC9B,UACA,UACA,QACA,WACJ,CAAC,EACD,QAAS,SACT,aAAc,CACV,GAAGS,EACH,GAAGjB,EAAAA,uBAAuB,CAAE,UAAS,CAAC,EACtC,eAAgBe,EAChB,UAAWF,EACX,WACA,MACJ,CACJ,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDrawerItemParts.utils.js","names":["resolveDrawerItemContent","content","startIcon","iconRegistry","getDrawerItemParts","drawerItemDefaults","props","generatedClassName","mergeClassNames","drawerItemStyles","className","ariaCurrent","active","getLinkBaseParts","drawerPartNames","buttonProps","getStateFlagAttributes"],"sources":["../../../../../../../src/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils.ts"],"sourcesContent":["import { getStateFlagAttributes } from '@components/components/_common/utils/get-state-flag-attributes/getStateFlagAttributes.utils';\nimport { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { getLinkBaseParts } from '@components/components/navigation/_common/link-base/utils/getLinkBaseParts.utils';\nimport { drawerItemDefaults } from '@components/components/navigation/drawer/components/drawer-item/constants';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemContent,\n DrawerItemContentInput,\n DrawerItemLinkProps,\n DrawerItemParts,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { iconRegistry } from '@components/constants/iconRegistry.const';\n\n/**\n * Resolves the content of a `Drawer.Item`, the same whatever the state of\n * its drawer, whose styles fade its parts: its start icon, or the dot\n * standing for a missing one, shown only in a collapsed drawer, then its\n * label, its end icon, its end slot and the hidden label of an external\n * link.\n *\n * @param content Content of the item, its end icon resolved.\n * @param content.startIcon Data of the start icon; none when absent.\n * @returns The content to render.\n */\nconst resolveDrawerItemContent = ({\n startIcon,\n ...content\n}: DrawerItemContentInput): DrawerItemContent => ({\n ...content,\n isDot: startIcon === undefined,\n startIcon: startIcon ?? iconRegistry.iconPlaceholder,\n});\n\n/**\n * Resolves what a `Drawer.Item` renders from its props. Given an `href` or\n * `asChild`, it is a link of the navigation, resolved as a `Link` (see\n * `getLinkBaseParts`): `onClick` replaces the navigation on a plain click\n * of its own `a`, `external` opens it in a new tab with `externalLabel`\n * hidden in its name and the external icon unless `endIcon` is given,\n * `disabled` drops its destination and cancels its clicks, and `asChild`\n * merges it onto its single child. Otherwise, it is a `button`, of type\n * `button` unless given, natively disabled by `disabled`. Both are flagged\n * by `data-disabled` while disabled, take `aria-current=\"page\"` while\n * `active`, or keep the `aria-current` given, and take the generated class,\n * then the consumer's `className`.\n *\n * @param props Props of the item.\n * @param props.active Whether the item is the current page; `false` when\n * absent.\n * @param props.className Classes added after the generated ones.\n * @param props.endSlot Content at the end of the item; none when absent.\n * @returns The element, its props and the content of the item.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, are a fragment, or have content of their own.\n */\nexport const getDrawerItemParts = ({\n active = drawerItemDefaults.active,\n className,\n endSlot,\n ...props\n}:\n | DrawerItemAsChildProps\n | DrawerItemLinkProps\n | DrawerItemProps): DrawerItemParts => {\n const generatedClassName = mergeClassNames(\n drawerItemStyles.root,\n className,\n );\n const ariaCurrent = active\n ? drawerItemDefaults.ariaCurrent\n : props['aria-current'];\n\n if (props.asChild === true || props.href !== undefined) {\n const {\n child,\n elementProps,\n endIcon,\n externalLabel,\n label,\n startIcon,\n } = getLinkBaseParts(\n { ...props, 'aria-current': ariaCurrent },\n { className: generatedClassName, partName: drawerPartNames.item },\n );\n\n return {\n child,\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n externalLabel,\n label,\n startIcon,\n }),\n element: 'link',\n elementProps,\n };\n }\n\n const {\n disabled = drawerItemDefaults.disabled,\n endIcon,\n label,\n startIcon,\n type = drawerItemDefaults.type,\n ...buttonProps\n } = props;\n\n return {\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n label,\n startIcon,\n }),\n element: 'button',\n elementProps: {\n ...buttonProps,\n ...getStateFlagAttributes({ disabled }),\n 'aria-current': ariaCurrent,\n className: generatedClassName,\n disabled,\n type,\n },\n };\n};\n"],"mappings":";;;;;;;;AA2BA,IAAMA,KAA4B,EAC9B,cACA,GAAGC,SAC2C;CAC9C,GAAGA;CACH,OAAOC,MAAc,KAAA;CACrB,WAAWA,KAAaC,EAAa;AACzC,IAwBaC,KAAsB,EAC/B,YAASC,EAAmB,QAC5B,cACA,YACA,GAAGC,QAIoC;CACvC,IAAMC,IAAqBC,EACvBC,EAAiB,MACjBC,CACJ,GACMC,IAAcC,IACdP,EAAmB,cACnBC,EAAM;CAEZ,IAAIA,EAAM,YAAY,MAAQA,EAAM,SAAS,KAAA,GAAW;EACpD,IAAM,EACF,UACA,iBACA,YACA,kBACA,UACA,iBACAO,EACA;GAAE,GAAGP;GAAO,gBAAgBK;EAAY,GACxC;GAAE,WAAWJ;GAAoB,UAAUO,EAAgB;EAAK,CACpE;EAEA,OAAO;GACH;GACA,SAASd,EAAyB;IAC9B;IACA;IACA;IACA;IACA;GACJ,CAAC;GACD,SAAS;GACT;EACJ;CACJ;CAEA,IAAM,EACF,cAAWK,EAAmB,UAC9B,YACA,UACA,cACA,UAAOA,EAAmB,MAC1B,GAAGU,MACHT;CAEJ,OAAO;EACH,SAASN,EAAyB;GAC9B;GACA;GACA;GACA;EACJ,CAAC;EACD,SAAS;EACT,cAAc;GACV,GAAGe;GACH,GAAGC,EAAuB,EAAE,YAAS,CAAC;GACtC,gBAAgBL;GAChB,WAAWJ;GACX;GACA;EACJ;CACJ;AACJ"}
1
+ {"version":3,"file":"getDrawerItemParts.utils.js","names":["resolveDrawerItemContent","content","startIcon","iconRegistry","getDrawerItemParts","drawerItemDefaults","props","generatedClassName","mergeClassNames","drawerItemStyles","className","ariaCurrent","active","getLinkBaseParts","drawerPartNames","buttonProps","getStateFlagAttributes"],"sources":["../../../../../../../src/components/navigation/drawer/components/drawer-item/utils/getDrawerItemParts.utils.ts"],"sourcesContent":["import { getStateFlagAttributes } from '@components/components/_common/utils/get-state-flag-attributes/getStateFlagAttributes.utils';\nimport { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { getLinkBaseParts } from '@components/components/navigation/_common/link-base/utils/getLinkBaseParts.utils';\nimport { drawerItemDefaults } from '@components/components/navigation/drawer/components/drawer-item/constants';\nimport { drawerItemStyles } from '@components/components/navigation/drawer/components/drawer-item/DrawerItem.css';\nimport type {\n DrawerItemAsChildProps,\n DrawerItemContent,\n DrawerItemContentInput,\n DrawerItemLinkProps,\n DrawerItemParts,\n DrawerItemProps,\n} from '@components/components/navigation/drawer/components/drawer-item/types';\nimport { drawerPartNames } from '@components/components/navigation/drawer/constants';\nimport { iconRegistry } from '@components/constants/iconRegistry.const';\n\n/**\n * Resolves the content of a `Drawer.Item`, the same whatever the state of\n * its drawer, whose styles fade its parts: its start icon, or the dot\n * standing for a missing one, shown only in a `mini` drawer, expanded as\n * collapsed, and taking no room elsewhere, then its label, its end icon,\n * its end slot and the hidden label of an external link.\n *\n * @param content Content of the item, its end icon resolved.\n * @param content.startIcon Data of the start icon; none when absent.\n * @returns The content to render.\n */\nconst resolveDrawerItemContent = ({\n startIcon,\n ...content\n}: DrawerItemContentInput): DrawerItemContent => ({\n ...content,\n isDot: startIcon === undefined,\n startIcon: startIcon ?? iconRegistry.iconPlaceholder,\n});\n\n/**\n * Resolves what a `Drawer.Item` renders from its props. Given an `href` or\n * `asChild`, it is a link of the navigation, resolved as a `Link` (see\n * `getLinkBaseParts`): `onClick` replaces the navigation on a plain click\n * of its own `a`, `external` opens it in a new tab with `externalLabel`\n * hidden in its name and the external icon unless `endIcon` is given,\n * `disabled` drops its destination and cancels its clicks, and `asChild`\n * merges it onto its single child. Otherwise, it is a `button`, of type\n * `button` unless given, natively disabled by `disabled`. Both are flagged\n * by `data-disabled` while disabled, take `aria-current=\"page\"` while\n * `active`, or keep the `aria-current` given, and take the generated class,\n * then the consumer's `className`.\n *\n * @param props Props of the item.\n * @param props.active Whether the item is the current page; `false` when\n * absent.\n * @param props.className Classes added after the generated ones.\n * @param props.endSlot Content at the end of the item; none when absent.\n * @returns The element, its props and the content of the item.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, are a fragment, or have content of their own.\n */\nexport const getDrawerItemParts = ({\n active = drawerItemDefaults.active,\n className,\n endSlot,\n ...props\n}:\n | DrawerItemAsChildProps\n | DrawerItemLinkProps\n | DrawerItemProps): DrawerItemParts => {\n const generatedClassName = mergeClassNames(\n drawerItemStyles.root,\n className,\n );\n const ariaCurrent = active\n ? drawerItemDefaults.ariaCurrent\n : props['aria-current'];\n\n if (props.asChild === true || props.href !== undefined) {\n const {\n child,\n elementProps,\n endIcon,\n externalLabel,\n label,\n startIcon,\n } = getLinkBaseParts(\n { ...props, 'aria-current': ariaCurrent },\n { className: generatedClassName, partName: drawerPartNames.item },\n );\n\n return {\n child,\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n externalLabel,\n label,\n startIcon,\n }),\n element: 'link',\n elementProps,\n };\n }\n\n const {\n disabled = drawerItemDefaults.disabled,\n endIcon,\n label,\n startIcon,\n type = drawerItemDefaults.type,\n ...buttonProps\n } = props;\n\n return {\n content: resolveDrawerItemContent({\n endIcon,\n endSlot,\n label,\n startIcon,\n }),\n element: 'button',\n elementProps: {\n ...buttonProps,\n ...getStateFlagAttributes({ disabled }),\n 'aria-current': ariaCurrent,\n className: generatedClassName,\n disabled,\n type,\n },\n };\n};\n"],"mappings":";;;;;;;;AA2BA,IAAMA,KAA4B,EAC9B,cACA,GAAGC,SAC2C;CAC9C,GAAGA;CACH,OAAOC,MAAc,KAAA;CACrB,WAAWA,KAAaC,EAAa;AACzC,IAwBaC,KAAsB,EAC/B,YAASC,EAAmB,QAC5B,cACA,YACA,GAAGC,QAIoC;CACvC,IAAMC,IAAqBC,EACvBC,EAAiB,MACjBC,CACJ,GACMC,IAAcC,IACdP,EAAmB,cACnBC,EAAM;CAEZ,IAAIA,EAAM,YAAY,MAAQA,EAAM,SAAS,KAAA,GAAW;EACpD,IAAM,EACF,UACA,iBACA,YACA,kBACA,UACA,iBACAO,EACA;GAAE,GAAGP;GAAO,gBAAgBK;EAAY,GACxC;GAAE,WAAWJ;GAAoB,UAAUO,EAAgB;EAAK,CACpE;EAEA,OAAO;GACH;GACA,SAASd,EAAyB;IAC9B;IACA;IACA;IACA;IACA;GACJ,CAAC;GACD,SAAS;GACT;EACJ;CACJ;CAEA,IAAM,EACF,cAAWK,EAAmB,UAC9B,YACA,UACA,cACA,UAAOA,EAAmB,MAC1B,GAAGU,MACHT;CAEJ,OAAO;EACH,SAASN,EAAyB;GAC9B;GACA;GACA;GACA;EACJ,CAAC;EACD,SAAS;EACT,cAAc;GACV,GAAGe;GACH,GAAGC,EAAuB,EAAE,YAAS,CAAC;GACtC,gBAAgBL;GAChB,WAAWJ;GACX;GACA;EACJ;CACJ;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["vars","controlSizeTokens","boxMarginStylePropNames","require_boxMarginStylePropNames_const","require_controlSizes_const","_choco_vanille_theme","drawerDefaults","drawerBorderWidthPropNames","drawerBoxStylePropNames","drawerBorderDefaults","drawerSwipeDirections","drawerPartNames"],"sources":["../../../../../src/components/navigation/drawer/constants/index.ts"],"sourcesContent":["import type { Drawer } from '@base-ui/react/drawer';\nimport type { BoxStyleProps } from '@choco-vanille/primitives';\nimport { vars } from '@choco-vanille/theme';\n\nimport { boxMarginStylePropNames } from '@components/constants/boxMarginStylePropNames.const';\nimport { controlSizeTokens } from '@components/constants/controlSizes.const';\n\n/**\n * Variants of a `Drawer`, the first being the default: `inline`, a panel\n * in the layout, shown while open and removed while closed; `modal`, a\n * panel sliding over the page from its edge, in a dialog, while open;\n * `mini`, an inline panel that collapses into a narrow rail showing the\n * icons of its items while closed.\n */\nexport const drawerVariants = ['inline', 'modal', 'mini'] as const;\n\n/** Sides of the page or of the layout a `Drawer` stands on, the first being the default. */\nexport const drawerSides = ['left', 'right'] as const;\n\n/**\n * Transition of a `Drawer` opening, closing, collapsing and expanding,\n * shared by the width of a `mini` panel, the slide of a `modal` one, its\n * backdrop, and the fades of the labels, dots and dashes of its items and\n * groups, so they move together: the slow duration of the theme (`240ms`\n * by default) with its standard easing. No transition runs when reduced\n * motion is preferred.\n */\nexport const drawerTransition = {\n duration: vars.duration.slow,\n easing: vars.easing.standard,\n} as const;\n\n/**\n * Values a `Drawer` and its `Drawer.Content` apply when the matching prop\n * is absent: `inline`, on the left, closed until opened, as Base UI,\n * `16rem` (256px) wide, and `3.25rem` (52px) wide as the rail of a closed\n * `mini` drawer, the `2.25rem` icon column of its items between the\n * `0.5rem` paddings of its body, so their icons keep their place while it\n * collapses. Raw lengths, not steps of the space scale, which spaces\n * content rather than sizing panels.\n */\nexport const drawerDefaults = {\n defaultOpen: false,\n collapsedWidth: '3.25rem',\n side: 'left',\n variant: 'inline',\n width: '16rem',\n} as const;\n\n/**\n * Dimensions of the items of a `Drawer`, as theme variables or raw lengths,\n * on the scale of the items of a `DropdownMenu`, read by the styles of its\n * items and group labels. Each one gives:\n * - `height`: minimum height of an item, the `md` height of the controls\n * (`2.25rem`, 36px), as a `DropdownMenu.Item` or a `Button` of that size;\n * - `iconColumnWidth`: width of the column holding the start icon or the\n * dot at the start of every item, as wide as an item is high, so its icon\n * keeps its place, alone in the rail, while the drawer collapses;\n * - `borderRadius`: corner radius of an item, the `md` radius of the\n * controls, as the buttons of that size;\n * - `paddingInline`: padding after the label and the end parts of an item,\n * and before the label of a group, the room left on each side of a start\n * icon centered in its column (`2.25rem` minus `1rem`, halved), so the\n * label of a group lines up with the icons of the items;\n * - `gap`: gap between the icon column, the label and the end parts;\n * - `fontSize`: font size of the label;\n * - `iconSize`: size of every `1em` icon of an item, `1rem` (16px): its\n * start icon, the placeholder dot standing for a missing one, drawn in a\n * box of the same size, and its end icon, the external icon of a link\n * included.\n *\n * Items touch, without gap, as those of a `DropdownMenu`.\n */\nexport const drawerItemTokens = {\n height: controlSizeTokens.md.height,\n iconColumnWidth: controlSizeTokens.md.height,\n borderRadius: controlSizeTokens.md.borderRadius,\n paddingInline: vars.space[10],\n gap: vars.space[4],\n fontSize: vars.fontSize[14],\n iconSize: vars.fontSize[16],\n} as const;\n\n/**\n * Border width props of `Box` a `Drawer` accepts: given any of them, the\n * drawer drops its default border, so the props given are the only ones.\n */\nexport const drawerBorderWidthPropNames = [\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'borderWidth',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Style props of `Box` a `Drawer` accepts on its panel, in alphabetical\n * order within each group: its margins, its paddings and its borders\n * (widths, style, color and corner radii), which take the theme tokens as\n * `Box` does, but `borderColor`, which takes any CSS color.\n */\nexport const drawerBoxStylePropNames = [\n ...boxMarginStylePropNames,\n 'padding',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingX',\n 'paddingY',\n ...drawerBorderWidthPropNames,\n 'borderBottomLeftRadius',\n 'borderBottomRightRadius',\n 'borderColor',\n 'borderRadius',\n 'borderStyle',\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Border a `Drawer` draws unless the consumer gives a border width: one\n * thin solid line of the subtle border color of the theme, on the edge\n * facing the content, the right one for a drawer on the left and the left\n * one for a drawer on the right. Props of `Box`, not styles of the\n * `cv.components` layers, which outrank those of `Box`, so a border given\n * replaces it.\n */\nexport const drawerBorderDefaults = {\n left: {\n borderColor: vars.color.border.subtle,\n borderRightWidth: 1,\n borderStyle: 'solid',\n },\n right: {\n borderColor: vars.color.border.subtle,\n borderLeftWidth: 1,\n borderStyle: 'solid',\n },\n} as const satisfies Readonly<\n // `DrawerSide`, derived here to keep types and constants acyclic.\n Record<(typeof drawerSides)[number], BoxStyleProps>\n>;\n\n/**\n * Swipe direction of the `Drawer` of Base UI dismissing a `modal` drawer,\n * by side: towards the edge it slides in from.\n */\nexport const drawerSwipeDirections = {\n left: 'left',\n right: 'right',\n} as const satisfies Readonly<\n Record<\n (typeof drawerSides)[number],\n NonNullable<Drawer.Root.Props['swipeDirection']>\n >\n>;\n\n/**\n * Placement of a `modal` drawer by side, read by its styles:\n * - `justifyContent`: alignment of the popup in its viewport, against the\n * edge of its side;\n * - `hiddenTransform`: shift of the popup before it opens and while it\n * closes, its own width towards that edge, which it slides from and to.\n */\nexport const drawerModalSidePlacements = {\n left: {\n justifyContent: 'flex-start',\n hiddenTransform: 'translateX(-100%)',\n },\n right: { justifyContent: 'flex-end', hiddenTransform: 'translateX(100%)' },\n} as const satisfies Readonly<\n Record<(typeof drawerSides)[number], Readonly<Record<string, string>>>\n>;\n\n/**\n * Widest a `modal` drawer grows, whatever its `width`: the viewport but a\n * `3rem` (48px) strip of the backdrop, which stays visible and pressable to\n * close it.\n */\nexport const drawerModalMaxWidth = 'calc(100% - 3rem)';\n\n/**\n * Attribute selectors of the states Base UI writes on the panel of a\n * drawer, its `Collapsible.Panel` or the popup and backdrop of its\n * `Drawer`, to append to a selector of their styles: closed\n * (`data-closed`), the rail of a `mini` drawer, in the frame before it\n * opens (`data-starting-style`), while it closes (`data-ending-style`), and\n * while a `modal` one is swiped (`data-swiping`).\n */\nexport const drawerStateSelectors = {\n closed: '[data-closed]',\n starting: '[data-starting-style]',\n ending: '[data-ending-style]',\n swiping: '[data-swiping]',\n} as const;\n\n/**\n * CSS variable Base UI sets on the popup of a `modal` drawer while it is\n * swiped: its horizontal shift, which its transform follows.\n */\nexport const drawerSwipeMovementX = 'var(--drawer-swipe-movement-x, 0px)';\n\n/**\n * Name of each part of a `Drawer` that checks it is rendered inside one,\n * as the consumer writes it, given in the error raised otherwise.\n */\nexport const drawerPartNames = {\n body: 'Drawer.Body',\n close: 'Drawer.Close',\n content: 'Drawer.Content',\n footer: 'Drawer.Footer',\n group: 'Drawer.Group',\n header: 'Drawer.Header',\n item: 'Drawer.Item',\n trigger: 'Drawer.Trigger',\n} as const;\n"],"mappings":"A,2KA4BcA,EAAAA,KAAK,SAAS,KAChBA,EAAAA,KAAK,OAAO,SAYxB,IAAaM,EAAiB,CAC1B,YAAa,GACb,eAAgB,UAChB,KAAM,OACN,QAAS,SACT,MAAO,OACX,EA2BYL,EAAAA,kBAAkB,GAAG,OACZA,EAAAA,kBAAkB,GAAG,OACxBA,EAAAA,kBAAkB,GAAG,aACpBD,EAAAA,KAAK,MAAM,IACrBA,EAAAA,KAAK,MAAM,GACNA,EAAAA,KAAK,SAAS,IACdA,EAAAA,KAAK,SAAS,IAO5B,IAAaO,EAA6B,CACtC,oBACA,kBACA,mBACA,iBACA,aACJ,EAQaC,EAA0B,CACnC,GAAGN,EAAAA,wBACH,UACA,gBACA,cACA,eACA,aACA,WACA,WACA,GAAGK,EACH,yBACA,0BACA,cACA,eACA,cACA,sBACA,sBACJ,EAUaE,EAAuB,CAChC,KAAM,CACF,YAAaT,EAAAA,KAAK,MAAM,OAAO,OAC/B,iBAAkB,EAClB,YAAa,OACjB,EACA,MAAO,CACH,YAAaA,EAAAA,KAAK,MAAM,OAAO,OAC/B,gBAAiB,EACjB,YAAa,OACjB,CACJ,EASaU,EAAwB,CACjC,KAAM,OACN,MAAO,OACX,EAwDaC,EAAkB,CAC3B,KAAM,cACN,MAAO,eACP,QAAS,iBACT,OAAQ,gBACR,MAAO,eACP,OAAQ,gBACR,KAAM,cACN,QAAS,gBACb,E"}
1
+ {"version":3,"file":"index.cjs","names":["vars","controlSizeTokens","boxMarginStylePropNames","require_boxMarginStylePropNames_const","require_controlSizes_const","_choco_vanille_theme","drawerDefaults","drawerBorderWidthPropNames","drawerBoxStylePropNames","drawerBorderDefaults","drawerSwipeDirections","drawerPartNames"],"sources":["../../../../../src/components/navigation/drawer/constants/index.ts"],"sourcesContent":["import type { Drawer } from '@base-ui/react/drawer';\nimport type { BoxStyleProps } from '@choco-vanille/primitives';\nimport { vars } from '@choco-vanille/theme';\n\nimport { boxMarginStylePropNames } from '@components/constants/boxMarginStylePropNames.const';\nimport { controlSizeTokens } from '@components/constants/controlSizes.const';\n\n/**\n * Variants of a `Drawer`, the first being the default: `inline`, a panel\n * in the layout, shown while open and removed while closed; `modal`, a\n * panel sliding over the page from its edge, in a dialog, while open;\n * `mini`, an inline panel that collapses into a narrow rail showing the\n * icons of its items while closed.\n */\nexport const drawerVariants = ['inline', 'modal', 'mini'] as const;\n\n/** Sides of the page or of the layout a `Drawer` stands on, the first being the default. */\nexport const drawerSides = ['left', 'right'] as const;\n\n/**\n * Transition of a `Drawer` opening, closing, collapsing and expanding,\n * shared by the width of a `mini` panel, the slide of a `modal` one, its\n * backdrop, and the fades of the labels of its items and of the labels\n * and dashes of its groups, so they move together: the slow duration of the theme (`240ms`\n * by default) with its standard easing. No transition runs when reduced\n * motion is preferred.\n */\nexport const drawerTransition = {\n duration: vars.duration.slow,\n easing: vars.easing.standard,\n} as const;\n\n/**\n * Values a `Drawer` and its `Drawer.Content` apply when the matching prop\n * is absent: `inline`, on the left, closed until opened, as Base UI,\n * `16rem` (256px) wide, and `3.25rem` (52px) wide as the rail of a closed\n * `mini` drawer, the `2.25rem` icon column of its items between the\n * `0.5rem` paddings of its body, so their icons keep their place while it\n * collapses. Raw lengths, not steps of the space scale, which spaces\n * content rather than sizing panels.\n */\nexport const drawerDefaults = {\n defaultOpen: false,\n collapsedWidth: '3.25rem',\n side: 'left',\n variant: 'inline',\n width: '16rem',\n} as const;\n\n/**\n * Dimensions of the items of a `Drawer`, as theme variables or raw lengths,\n * on the scale of the items of a `DropdownMenu`, read by the styles of its\n * items and group labels. Each one gives:\n * - `height`: minimum height of an item, the `md` height of the controls\n * (`2.25rem`, 36px), as a `DropdownMenu.Item` or a `Button` of that size;\n * - `iconColumnWidth`: width of the column holding the start icon of an\n * item, or the dot standing for a missing one in a `mini` drawer, as wide\n * as an item is high, so its icon keeps its place, alone in the rail,\n * while the drawer collapses;\n * - `borderRadius`: corner radius of an item, the `md` radius of the\n * controls, as the buttons of that size;\n * - `paddingInline`: padding after the label and the end parts of an item,\n * before the label of an item without icon column and before the label of\n * a group, the room left on each side of a start\n * icon centered in its column (`2.25rem` minus `1rem`, halved), so the\n * label of a group lines up with the icons of the items;\n * - `gap`: gap between the icon column, the label and the end parts;\n * - `fontSize`: font size of the label;\n * - `iconSize`: size of every `1em` icon of an item, `1rem` (16px): its\n * start icon, the placeholder dot standing for a missing one, drawn in a\n * box of the same size, and its end icon, the external icon of a link\n * included.\n *\n * Items touch, without gap, as those of a `DropdownMenu`.\n */\nexport const drawerItemTokens = {\n height: controlSizeTokens.md.height,\n iconColumnWidth: controlSizeTokens.md.height,\n borderRadius: controlSizeTokens.md.borderRadius,\n paddingInline: vars.space[10],\n gap: vars.space[4],\n fontSize: vars.fontSize[14],\n iconSize: vars.fontSize[16],\n} as const;\n\n/**\n * Border width props of `Box` a `Drawer` accepts: given any of them, the\n * drawer drops its default border, so the props given are the only ones.\n */\nexport const drawerBorderWidthPropNames = [\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'borderWidth',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Style props of `Box` a `Drawer` accepts on its panel, in alphabetical\n * order within each group: its margins, its paddings and its borders\n * (widths, style, color and corner radii), which take the theme tokens as\n * `Box` does, but `borderColor`, which takes any CSS color.\n */\nexport const drawerBoxStylePropNames = [\n ...boxMarginStylePropNames,\n 'padding',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingX',\n 'paddingY',\n ...drawerBorderWidthPropNames,\n 'borderBottomLeftRadius',\n 'borderBottomRightRadius',\n 'borderColor',\n 'borderRadius',\n 'borderStyle',\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Border a `Drawer` draws unless the consumer gives a border width: one\n * thin solid line of the subtle border color of the theme, on the edge\n * facing the content, the right one for a drawer on the left and the left\n * one for a drawer on the right. Props of `Box`, not styles of the\n * `cv.components` layers, which outrank those of `Box`, so a border given\n * replaces it.\n */\nexport const drawerBorderDefaults = {\n left: {\n borderColor: vars.color.border.subtle,\n borderRightWidth: 1,\n borderStyle: 'solid',\n },\n right: {\n borderColor: vars.color.border.subtle,\n borderLeftWidth: 1,\n borderStyle: 'solid',\n },\n} as const satisfies Readonly<\n // `DrawerSide`, derived here to keep types and constants acyclic.\n Record<(typeof drawerSides)[number], BoxStyleProps>\n>;\n\n/**\n * Swipe direction of the `Drawer` of Base UI dismissing a `modal` drawer,\n * by side: towards the edge it slides in from.\n */\nexport const drawerSwipeDirections = {\n left: 'left',\n right: 'right',\n} as const satisfies Readonly<\n Record<\n (typeof drawerSides)[number],\n NonNullable<Drawer.Root.Props['swipeDirection']>\n >\n>;\n\n/**\n * Placement of a `modal` drawer by side, read by its styles:\n * - `justifyContent`: alignment of the popup in its viewport, against the\n * edge of its side;\n * - `hiddenTransform`: shift of the popup before it opens and while it\n * closes, its own width towards that edge, which it slides from and to.\n */\nexport const drawerModalSidePlacements = {\n left: {\n justifyContent: 'flex-start',\n hiddenTransform: 'translateX(-100%)',\n },\n right: { justifyContent: 'flex-end', hiddenTransform: 'translateX(100%)' },\n} as const satisfies Readonly<\n Record<(typeof drawerSides)[number], Readonly<Record<string, string>>>\n>;\n\n/**\n * Widest a `modal` drawer grows, whatever its `width`: the viewport but a\n * `3rem` (48px) strip of the backdrop, which stays visible and pressable to\n * close it.\n */\nexport const drawerModalMaxWidth = 'calc(100% - 3rem)';\n\n/**\n * Attribute selectors of the states Base UI writes on the panel of a\n * drawer, its `Collapsible.Panel` or the popup and backdrop of its\n * `Drawer`, to append to a selector of their styles: closed\n * (`data-closed`), the rail of a `mini` drawer, in the frame before it\n * opens (`data-starting-style`), while it closes (`data-ending-style`), and\n * while a `modal` one is swiped (`data-swiping`).\n */\nexport const drawerStateSelectors = {\n closed: '[data-closed]',\n starting: '[data-starting-style]',\n ending: '[data-ending-style]',\n swiping: '[data-swiping]',\n} as const;\n\n/**\n * CSS variable Base UI sets on the popup of a `modal` drawer while it is\n * swiped: its horizontal shift, which its transform follows.\n */\nexport const drawerSwipeMovementX = 'var(--drawer-swipe-movement-x, 0px)';\n\n/**\n * Name of each part of a `Drawer` that checks it is rendered inside one,\n * as the consumer writes it, given in the error raised otherwise.\n */\nexport const drawerPartNames = {\n body: 'Drawer.Body',\n close: 'Drawer.Close',\n content: 'Drawer.Content',\n footer: 'Drawer.Footer',\n group: 'Drawer.Group',\n header: 'Drawer.Header',\n item: 'Drawer.Item',\n trigger: 'Drawer.Trigger',\n} as const;\n"],"mappings":"A,2KA4BcA,EAAAA,KAAK,SAAS,KAChBA,EAAAA,KAAK,OAAO,SAYxB,IAAaM,EAAiB,CAC1B,YAAa,GACb,eAAgB,UAChB,KAAM,OACN,QAAS,SACT,MAAO,OACX,EA6BYL,EAAAA,kBAAkB,GAAG,OACZA,EAAAA,kBAAkB,GAAG,OACxBA,EAAAA,kBAAkB,GAAG,aACpBD,EAAAA,KAAK,MAAM,IACrBA,EAAAA,KAAK,MAAM,GACNA,EAAAA,KAAK,SAAS,IACdA,EAAAA,KAAK,SAAS,IAO5B,IAAaO,EAA6B,CACtC,oBACA,kBACA,mBACA,iBACA,aACJ,EAQaC,EAA0B,CACnC,GAAGN,EAAAA,wBACH,UACA,gBACA,cACA,eACA,aACA,WACA,WACA,GAAGK,EACH,yBACA,0BACA,cACA,eACA,cACA,sBACA,sBACJ,EAUaE,EAAuB,CAChC,KAAM,CACF,YAAaT,EAAAA,KAAK,MAAM,OAAO,OAC/B,iBAAkB,EAClB,YAAa,OACjB,EACA,MAAO,CACH,YAAaA,EAAAA,KAAK,MAAM,OAAO,OAC/B,gBAAiB,EACjB,YAAa,OACjB,CACJ,EASaU,EAAwB,CACjC,KAAM,OACN,MAAO,OACX,EAwDaC,EAAkB,CAC3B,KAAM,cACN,MAAO,eACP,QAAS,iBACT,OAAQ,gBACR,MAAO,eACP,OAAQ,gBACR,KAAM,cACN,QAAS,gBACb,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["vars","drawerDefaults","controlSizeTokens","drawerBorderWidthPropNames","drawerBoxStylePropNames","boxMarginStylePropNames","drawerBorderDefaults","drawerSwipeDirections","drawerPartNames"],"sources":["../../../../../src/components/navigation/drawer/constants/index.ts"],"sourcesContent":["import type { Drawer } from '@base-ui/react/drawer';\nimport type { BoxStyleProps } from '@choco-vanille/primitives';\nimport { vars } from '@choco-vanille/theme';\n\nimport { boxMarginStylePropNames } from '@components/constants/boxMarginStylePropNames.const';\nimport { controlSizeTokens } from '@components/constants/controlSizes.const';\n\n/**\n * Variants of a `Drawer`, the first being the default: `inline`, a panel\n * in the layout, shown while open and removed while closed; `modal`, a\n * panel sliding over the page from its edge, in a dialog, while open;\n * `mini`, an inline panel that collapses into a narrow rail showing the\n * icons of its items while closed.\n */\nexport const drawerVariants = ['inline', 'modal', 'mini'] as const;\n\n/** Sides of the page or of the layout a `Drawer` stands on, the first being the default. */\nexport const drawerSides = ['left', 'right'] as const;\n\n/**\n * Transition of a `Drawer` opening, closing, collapsing and expanding,\n * shared by the width of a `mini` panel, the slide of a `modal` one, its\n * backdrop, and the fades of the labels, dots and dashes of its items and\n * groups, so they move together: the slow duration of the theme (`240ms`\n * by default) with its standard easing. No transition runs when reduced\n * motion is preferred.\n */\nexport const drawerTransition = {\n duration: vars.duration.slow,\n easing: vars.easing.standard,\n} as const;\n\n/**\n * Values a `Drawer` and its `Drawer.Content` apply when the matching prop\n * is absent: `inline`, on the left, closed until opened, as Base UI,\n * `16rem` (256px) wide, and `3.25rem` (52px) wide as the rail of a closed\n * `mini` drawer, the `2.25rem` icon column of its items between the\n * `0.5rem` paddings of its body, so their icons keep their place while it\n * collapses. Raw lengths, not steps of the space scale, which spaces\n * content rather than sizing panels.\n */\nexport const drawerDefaults = {\n defaultOpen: false,\n collapsedWidth: '3.25rem',\n side: 'left',\n variant: 'inline',\n width: '16rem',\n} as const;\n\n/**\n * Dimensions of the items of a `Drawer`, as theme variables or raw lengths,\n * on the scale of the items of a `DropdownMenu`, read by the styles of its\n * items and group labels. Each one gives:\n * - `height`: minimum height of an item, the `md` height of the controls\n * (`2.25rem`, 36px), as a `DropdownMenu.Item` or a `Button` of that size;\n * - `iconColumnWidth`: width of the column holding the start icon or the\n * dot at the start of every item, as wide as an item is high, so its icon\n * keeps its place, alone in the rail, while the drawer collapses;\n * - `borderRadius`: corner radius of an item, the `md` radius of the\n * controls, as the buttons of that size;\n * - `paddingInline`: padding after the label and the end parts of an item,\n * and before the label of a group, the room left on each side of a start\n * icon centered in its column (`2.25rem` minus `1rem`, halved), so the\n * label of a group lines up with the icons of the items;\n * - `gap`: gap between the icon column, the label and the end parts;\n * - `fontSize`: font size of the label;\n * - `iconSize`: size of every `1em` icon of an item, `1rem` (16px): its\n * start icon, the placeholder dot standing for a missing one, drawn in a\n * box of the same size, and its end icon, the external icon of a link\n * included.\n *\n * Items touch, without gap, as those of a `DropdownMenu`.\n */\nexport const drawerItemTokens = {\n height: controlSizeTokens.md.height,\n iconColumnWidth: controlSizeTokens.md.height,\n borderRadius: controlSizeTokens.md.borderRadius,\n paddingInline: vars.space[10],\n gap: vars.space[4],\n fontSize: vars.fontSize[14],\n iconSize: vars.fontSize[16],\n} as const;\n\n/**\n * Border width props of `Box` a `Drawer` accepts: given any of them, the\n * drawer drops its default border, so the props given are the only ones.\n */\nexport const drawerBorderWidthPropNames = [\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'borderWidth',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Style props of `Box` a `Drawer` accepts on its panel, in alphabetical\n * order within each group: its margins, its paddings and its borders\n * (widths, style, color and corner radii), which take the theme tokens as\n * `Box` does, but `borderColor`, which takes any CSS color.\n */\nexport const drawerBoxStylePropNames = [\n ...boxMarginStylePropNames,\n 'padding',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingX',\n 'paddingY',\n ...drawerBorderWidthPropNames,\n 'borderBottomLeftRadius',\n 'borderBottomRightRadius',\n 'borderColor',\n 'borderRadius',\n 'borderStyle',\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Border a `Drawer` draws unless the consumer gives a border width: one\n * thin solid line of the subtle border color of the theme, on the edge\n * facing the content, the right one for a drawer on the left and the left\n * one for a drawer on the right. Props of `Box`, not styles of the\n * `cv.components` layers, which outrank those of `Box`, so a border given\n * replaces it.\n */\nexport const drawerBorderDefaults = {\n left: {\n borderColor: vars.color.border.subtle,\n borderRightWidth: 1,\n borderStyle: 'solid',\n },\n right: {\n borderColor: vars.color.border.subtle,\n borderLeftWidth: 1,\n borderStyle: 'solid',\n },\n} as const satisfies Readonly<\n // `DrawerSide`, derived here to keep types and constants acyclic.\n Record<(typeof drawerSides)[number], BoxStyleProps>\n>;\n\n/**\n * Swipe direction of the `Drawer` of Base UI dismissing a `modal` drawer,\n * by side: towards the edge it slides in from.\n */\nexport const drawerSwipeDirections = {\n left: 'left',\n right: 'right',\n} as const satisfies Readonly<\n Record<\n (typeof drawerSides)[number],\n NonNullable<Drawer.Root.Props['swipeDirection']>\n >\n>;\n\n/**\n * Placement of a `modal` drawer by side, read by its styles:\n * - `justifyContent`: alignment of the popup in its viewport, against the\n * edge of its side;\n * - `hiddenTransform`: shift of the popup before it opens and while it\n * closes, its own width towards that edge, which it slides from and to.\n */\nexport const drawerModalSidePlacements = {\n left: {\n justifyContent: 'flex-start',\n hiddenTransform: 'translateX(-100%)',\n },\n right: { justifyContent: 'flex-end', hiddenTransform: 'translateX(100%)' },\n} as const satisfies Readonly<\n Record<(typeof drawerSides)[number], Readonly<Record<string, string>>>\n>;\n\n/**\n * Widest a `modal` drawer grows, whatever its `width`: the viewport but a\n * `3rem` (48px) strip of the backdrop, which stays visible and pressable to\n * close it.\n */\nexport const drawerModalMaxWidth = 'calc(100% - 3rem)';\n\n/**\n * Attribute selectors of the states Base UI writes on the panel of a\n * drawer, its `Collapsible.Panel` or the popup and backdrop of its\n * `Drawer`, to append to a selector of their styles: closed\n * (`data-closed`), the rail of a `mini` drawer, in the frame before it\n * opens (`data-starting-style`), while it closes (`data-ending-style`), and\n * while a `modal` one is swiped (`data-swiping`).\n */\nexport const drawerStateSelectors = {\n closed: '[data-closed]',\n starting: '[data-starting-style]',\n ending: '[data-ending-style]',\n swiping: '[data-swiping]',\n} as const;\n\n/**\n * CSS variable Base UI sets on the popup of a `modal` drawer while it is\n * swiped: its horizontal shift, which its transform follows.\n */\nexport const drawerSwipeMovementX = 'var(--drawer-swipe-movement-x, 0px)';\n\n/**\n * Name of each part of a `Drawer` that checks it is rendered inside one,\n * as the consumer writes it, given in the error raised otherwise.\n */\nexport const drawerPartNames = {\n body: 'Drawer.Body',\n close: 'Drawer.Close',\n content: 'Drawer.Content',\n footer: 'Drawer.Footer',\n group: 'Drawer.Group',\n header: 'Drawer.Header',\n item: 'Drawer.Item',\n trigger: 'Drawer.Trigger',\n} as const;\n"],"mappings":";;;AA4BcA,EAAK,SAAS,MAChBA,EAAK,OAAO;AAYxB,IAAaC,IAAiB;CAC1B,aAAa;CACb,gBAAgB;CAChB,MAAM;CACN,SAAS;CACT,OAAO;AACX;AA2BYC,EAAkB,GAAG,QACZA,EAAkB,GAAG,QACxBA,EAAkB,GAAG,cACpBF,EAAK,MAAM,KACrBA,EAAK,MAAM,IACNA,EAAK,SAAS,KACdA,EAAK,SAAS;AAO5B,IAAaG,IAA6B;CACtC;CACA;CACA;CACA;CACA;AACJ,GAQaC,IAA0B;CACnC,GAAGC;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAGF;CACH;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,GAUaG,IAAuB;CAChC,MAAM;EACF,aAAaN,EAAK,MAAM,OAAO;EAC/B,kBAAkB;EAClB,aAAa;CACjB;CACA,OAAO;EACH,aAAaA,EAAK,MAAM,OAAO;EAC/B,iBAAiB;EACjB,aAAa;CACjB;AACJ,GASaO,IAAwB;CACjC,MAAM;CACN,OAAO;AACX,GAwDaC,IAAkB;CAC3B,MAAM;CACN,OAAO;CACP,SAAS;CACT,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,MAAM;CACN,SAAS;AACb"}
1
+ {"version":3,"file":"index.js","names":["vars","drawerDefaults","controlSizeTokens","drawerBorderWidthPropNames","drawerBoxStylePropNames","boxMarginStylePropNames","drawerBorderDefaults","drawerSwipeDirections","drawerPartNames"],"sources":["../../../../../src/components/navigation/drawer/constants/index.ts"],"sourcesContent":["import type { Drawer } from '@base-ui/react/drawer';\nimport type { BoxStyleProps } from '@choco-vanille/primitives';\nimport { vars } from '@choco-vanille/theme';\n\nimport { boxMarginStylePropNames } from '@components/constants/boxMarginStylePropNames.const';\nimport { controlSizeTokens } from '@components/constants/controlSizes.const';\n\n/**\n * Variants of a `Drawer`, the first being the default: `inline`, a panel\n * in the layout, shown while open and removed while closed; `modal`, a\n * panel sliding over the page from its edge, in a dialog, while open;\n * `mini`, an inline panel that collapses into a narrow rail showing the\n * icons of its items while closed.\n */\nexport const drawerVariants = ['inline', 'modal', 'mini'] as const;\n\n/** Sides of the page or of the layout a `Drawer` stands on, the first being the default. */\nexport const drawerSides = ['left', 'right'] as const;\n\n/**\n * Transition of a `Drawer` opening, closing, collapsing and expanding,\n * shared by the width of a `mini` panel, the slide of a `modal` one, its\n * backdrop, and the fades of the labels of its items and of the labels\n * and dashes of its groups, so they move together: the slow duration of the theme (`240ms`\n * by default) with its standard easing. No transition runs when reduced\n * motion is preferred.\n */\nexport const drawerTransition = {\n duration: vars.duration.slow,\n easing: vars.easing.standard,\n} as const;\n\n/**\n * Values a `Drawer` and its `Drawer.Content` apply when the matching prop\n * is absent: `inline`, on the left, closed until opened, as Base UI,\n * `16rem` (256px) wide, and `3.25rem` (52px) wide as the rail of a closed\n * `mini` drawer, the `2.25rem` icon column of its items between the\n * `0.5rem` paddings of its body, so their icons keep their place while it\n * collapses. Raw lengths, not steps of the space scale, which spaces\n * content rather than sizing panels.\n */\nexport const drawerDefaults = {\n defaultOpen: false,\n collapsedWidth: '3.25rem',\n side: 'left',\n variant: 'inline',\n width: '16rem',\n} as const;\n\n/**\n * Dimensions of the items of a `Drawer`, as theme variables or raw lengths,\n * on the scale of the items of a `DropdownMenu`, read by the styles of its\n * items and group labels. Each one gives:\n * - `height`: minimum height of an item, the `md` height of the controls\n * (`2.25rem`, 36px), as a `DropdownMenu.Item` or a `Button` of that size;\n * - `iconColumnWidth`: width of the column holding the start icon of an\n * item, or the dot standing for a missing one in a `mini` drawer, as wide\n * as an item is high, so its icon keeps its place, alone in the rail,\n * while the drawer collapses;\n * - `borderRadius`: corner radius of an item, the `md` radius of the\n * controls, as the buttons of that size;\n * - `paddingInline`: padding after the label and the end parts of an item,\n * before the label of an item without icon column and before the label of\n * a group, the room left on each side of a start\n * icon centered in its column (`2.25rem` minus `1rem`, halved), so the\n * label of a group lines up with the icons of the items;\n * - `gap`: gap between the icon column, the label and the end parts;\n * - `fontSize`: font size of the label;\n * - `iconSize`: size of every `1em` icon of an item, `1rem` (16px): its\n * start icon, the placeholder dot standing for a missing one, drawn in a\n * box of the same size, and its end icon, the external icon of a link\n * included.\n *\n * Items touch, without gap, as those of a `DropdownMenu`.\n */\nexport const drawerItemTokens = {\n height: controlSizeTokens.md.height,\n iconColumnWidth: controlSizeTokens.md.height,\n borderRadius: controlSizeTokens.md.borderRadius,\n paddingInline: vars.space[10],\n gap: vars.space[4],\n fontSize: vars.fontSize[14],\n iconSize: vars.fontSize[16],\n} as const;\n\n/**\n * Border width props of `Box` a `Drawer` accepts: given any of them, the\n * drawer drops its default border, so the props given are the only ones.\n */\nexport const drawerBorderWidthPropNames = [\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'borderWidth',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Style props of `Box` a `Drawer` accepts on its panel, in alphabetical\n * order within each group: its margins, its paddings and its borders\n * (widths, style, color and corner radii), which take the theme tokens as\n * `Box` does, but `borderColor`, which takes any CSS color.\n */\nexport const drawerBoxStylePropNames = [\n ...boxMarginStylePropNames,\n 'padding',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingX',\n 'paddingY',\n ...drawerBorderWidthPropNames,\n 'borderBottomLeftRadius',\n 'borderBottomRightRadius',\n 'borderColor',\n 'borderRadius',\n 'borderStyle',\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n] as const satisfies readonly (keyof BoxStyleProps)[];\n\n/**\n * Border a `Drawer` draws unless the consumer gives a border width: one\n * thin solid line of the subtle border color of the theme, on the edge\n * facing the content, the right one for a drawer on the left and the left\n * one for a drawer on the right. Props of `Box`, not styles of the\n * `cv.components` layers, which outrank those of `Box`, so a border given\n * replaces it.\n */\nexport const drawerBorderDefaults = {\n left: {\n borderColor: vars.color.border.subtle,\n borderRightWidth: 1,\n borderStyle: 'solid',\n },\n right: {\n borderColor: vars.color.border.subtle,\n borderLeftWidth: 1,\n borderStyle: 'solid',\n },\n} as const satisfies Readonly<\n // `DrawerSide`, derived here to keep types and constants acyclic.\n Record<(typeof drawerSides)[number], BoxStyleProps>\n>;\n\n/**\n * Swipe direction of the `Drawer` of Base UI dismissing a `modal` drawer,\n * by side: towards the edge it slides in from.\n */\nexport const drawerSwipeDirections = {\n left: 'left',\n right: 'right',\n} as const satisfies Readonly<\n Record<\n (typeof drawerSides)[number],\n NonNullable<Drawer.Root.Props['swipeDirection']>\n >\n>;\n\n/**\n * Placement of a `modal` drawer by side, read by its styles:\n * - `justifyContent`: alignment of the popup in its viewport, against the\n * edge of its side;\n * - `hiddenTransform`: shift of the popup before it opens and while it\n * closes, its own width towards that edge, which it slides from and to.\n */\nexport const drawerModalSidePlacements = {\n left: {\n justifyContent: 'flex-start',\n hiddenTransform: 'translateX(-100%)',\n },\n right: { justifyContent: 'flex-end', hiddenTransform: 'translateX(100%)' },\n} as const satisfies Readonly<\n Record<(typeof drawerSides)[number], Readonly<Record<string, string>>>\n>;\n\n/**\n * Widest a `modal` drawer grows, whatever its `width`: the viewport but a\n * `3rem` (48px) strip of the backdrop, which stays visible and pressable to\n * close it.\n */\nexport const drawerModalMaxWidth = 'calc(100% - 3rem)';\n\n/**\n * Attribute selectors of the states Base UI writes on the panel of a\n * drawer, its `Collapsible.Panel` or the popup and backdrop of its\n * `Drawer`, to append to a selector of their styles: closed\n * (`data-closed`), the rail of a `mini` drawer, in the frame before it\n * opens (`data-starting-style`), while it closes (`data-ending-style`), and\n * while a `modal` one is swiped (`data-swiping`).\n */\nexport const drawerStateSelectors = {\n closed: '[data-closed]',\n starting: '[data-starting-style]',\n ending: '[data-ending-style]',\n swiping: '[data-swiping]',\n} as const;\n\n/**\n * CSS variable Base UI sets on the popup of a `modal` drawer while it is\n * swiped: its horizontal shift, which its transform follows.\n */\nexport const drawerSwipeMovementX = 'var(--drawer-swipe-movement-x, 0px)';\n\n/**\n * Name of each part of a `Drawer` that checks it is rendered inside one,\n * as the consumer writes it, given in the error raised otherwise.\n */\nexport const drawerPartNames = {\n body: 'Drawer.Body',\n close: 'Drawer.Close',\n content: 'Drawer.Content',\n footer: 'Drawer.Footer',\n group: 'Drawer.Group',\n header: 'Drawer.Header',\n item: 'Drawer.Item',\n trigger: 'Drawer.Trigger',\n} as const;\n"],"mappings":";;;AA4BcA,EAAK,SAAS,MAChBA,EAAK,OAAO;AAYxB,IAAaC,IAAiB;CAC1B,aAAa;CACb,gBAAgB;CAChB,MAAM;CACN,SAAS;CACT,OAAO;AACX;AA6BYC,EAAkB,GAAG,QACZA,EAAkB,GAAG,QACxBA,EAAkB,GAAG,cACpBF,EAAK,MAAM,KACrBA,EAAK,MAAM,IACNA,EAAK,SAAS,KACdA,EAAK,SAAS;AAO5B,IAAaG,IAA6B;CACtC;CACA;CACA;CACA;CACA;AACJ,GAQaC,IAA0B;CACnC,GAAGC;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAGF;CACH;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,GAUaG,IAAuB;CAChC,MAAM;EACF,aAAaN,EAAK,MAAM,OAAO;EAC/B,kBAAkB;EAClB,aAAa;CACjB;CACA,OAAO;EACH,aAAaA,EAAK,MAAM,OAAO;EAC/B,iBAAiB;EACjB,aAAa;CACjB;AACJ,GASaO,IAAwB;CACjC,MAAM;CACN,OAAO;AACX,GAwDaC,IAAkB;CAC3B,MAAM;CACN,OAAO;CACP,SAAS;CACT,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,MAAM;CACN,SAAS;AACb"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_common/components/decorative-icon/DecorativeIcon.cjs"),t=require("./Link.css.cjs"),n=require("./utils/getLinkParts.utils.cjs");let r=require("@choco-vanille/primitives"),i=require("react/jsx-runtime"),a=require("react");var o=o=>{let{child:s,elementProps:c,endIcon:l,externalLabel:u,label:d,startIcon:f}=n.getLinkParts(o),p=(0,i.jsxs)(i.Fragment,{children:[f?(0,i.jsx)(e.default,{className:t.linkStyles.startIcon,icon:f}):null,d,l?(0,i.jsx)(e.default,{className:t.linkStyles.endIcon,icon:l}):null,u===void 0?null:(0,i.jsxs)(r.VisuallyHidden,{children:[` `,u]})]});return s===void 0?(0,i.jsx)(r.Box,{as:`a`,...c,children:p}):(0,i.jsx)(r.Box,{asChild:!0,...c,children:(0,a.cloneElement)(s.element,s.props,p)})};exports.default=o;
1
+ const e=require("../../_common/components/decorative-icon/DecorativeIcon.cjs"),t=require("./Link.css.cjs"),n=require("./utils/getLinkParts.utils.cjs");let r=require("@choco-vanille/primitives"),i=require("react"),a=require("react/jsx-runtime");var o=o=>{let{child:s,elementProps:c,endIcon:l,externalLabel:u,label:d,startIcon:f}=n.getLinkParts(o),p=(0,a.jsxs)(a.Fragment,{children:[f?(0,a.jsx)(e.default,{className:t.linkStyles.startIcon,icon:f}):null,d,l?(0,a.jsx)(e.default,{className:t.linkStyles.endIcon,icon:l}):null,u===void 0?null:(0,a.jsxs)(r.VisuallyHidden,{children:[` `,u]})]});return s===void 0?(0,a.jsx)(r.Box,{as:`a`,...c,children:p}):(0,a.jsx)(r.Box,{asChild:!0,...c,children:(0,i.cloneElement)(s.element,s.props,p)})};exports.default=o;
2
2
  //# sourceMappingURL=Link.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.cjs","names":["getLinkParts","_Fragment","DecorativeIcon","linkStyles","VisuallyHidden","Box","cloneElement","require_DecorativeIcon","require_Link_css","require_getLinkParts_utils","_choco_vanille_primitives","react_jsx_runtime","react","Link","props","content","startIcon","label","endIcon","externalLabel","child","elementProps"],"sources":["../../../../src/components/navigation/link/Link.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { linkStyles } from '@components/components/navigation/link/Link.css';\nimport type {\n LinkAsChildProps,\n LinkProps,\n} from '@components/components/navigation/link/types';\nimport { getLinkParts } from '@components/components/navigation/link/utils/getLinkParts.utils';\n\n/**\n * Renders a text link: a native `a` (a `Box`) with its `href`, showing its\n * `label`, which names it, or `aria-label` when the label is empty, between\n * optional decorative icons hidden from assistive technologies.\n *\n * With `onClick`, a plain click, Enter included, cancels the default action,\n * then calls it, so `href` is never followed, even if `onClick` throws, but\n * still gives the link its role, its preview and its context\n * menu. A modified or middle click, a `target` other than `_self` or a\n * `download` is left to the browser, without calling `onClick`.\n *\n * `external` sets `target=\"_blank\"` unless given, adds `noopener noreferrer`\n * to `rel`, ends the link with an external icon unless `endIcon` is given,\n * and, when it opens in a new tab, appends `externalLabel`, required with\n * `external`, as visually hidden text to its name. `disabled` drops `href`,\n * and with it `target`, `rel` and the hidden `externalLabel`, so the link\n * leaves the tab order, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, flags it with `data-disabled` and cancels its clicks and\n * middle clicks without calling `onClick` or `onAuxClick`.\n *\n * With `asChild`, it renders its single child instead, an element without\n * content such as a router link, which carries the destination: the props,\n * classes, `ref` and handlers of the link are merged onto it, the child's\n * handlers running first and its own values prevailing for any other prop,\n * and the label and icons become its content. Its `target` and `rel` are\n * resolved as those of the link: external, it opens in a new tab unless its\n * `target` says otherwise, and its `rel` gets `noopener noreferrer`\n * added. `onClick` runs as given,\n * without cancelling the navigation of the child; disabled, the child keeps\n * its `href` and stays focusable, but its clicks and middle clicks are\n * cancelled, which router links honor.\n *\n * The margin props of `Box` space it from its siblings; on an inline link,\n * only the horizontal ones apply. Every other prop (attributes, events,\n * `ref`) goes to the `a`, except its\n * content and the legacy `color` attribute; `className` comes after the\n * generated classes and `style` is applied as given.\n *\n * @param props Label, single child with `asChild`, presentation, icons,\n * external and disabled states, and native props of the `a`.\n * @returns The link.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, or have content of their own.\n */\nconst Link: FC<LinkAsChildProps | LinkProps> = (props) => {\n const { child, elementProps, endIcon, externalLabel, label, startIcon } =\n getLinkParts(props);\n const content = (\n <>\n {startIcon ? (\n <DecorativeIcon\n className={linkStyles.startIcon}\n icon={startIcon}\n />\n ) : null}\n {label}\n {endIcon ? (\n <DecorativeIcon className={linkStyles.endIcon} icon={endIcon} />\n ) : null}\n {externalLabel === undefined ? null : (\n <VisuallyHidden> {externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n return child === undefined ? (\n <Box as={'a'} {...elementProps}>\n {content}\n </Box>\n ) : (\n <Box asChild={true} {...elementProps}>\n {cloneElement(child.element, child.props, content)}\n </Box>\n );\n};\n\nexport default Link;\n"],"mappings":"A,oPAwDA,IAAMa,EAA0C,GAAU,CACtD,GAAM,CAAE,QAAO,eAAc,UAAS,gBAAe,QAAO,aACxDb,EAAAA,aAAac,CAAK,EAChBC,GACF,EAAAJ,EAAA,KAAA,CAAAV,EAAAA,SAAA,CAAA,SAAA,CACKe,GACG,EAAAL,EAAA,IAAA,CAACT,EAAAA,QAAD,CACI,UAAWC,EAAAA,WAAW,UACtB,KAAMa,CACT,CAAA,EACD,KACHC,EACAC,GACG,EAAAP,EAAA,IAAA,CAACT,EAAAA,QAAD,CAAgB,UAAWC,EAAAA,WAAW,QAAS,KAAMe,CAAU,CAAA,EAC/D,KACHC,IAAkB,IAAA,GAAY,MAC3B,EAAAR,EAAA,KAAA,CAACP,EAAAA,eAAD,CAAA,SAAA,CAAgB,IAAEe,CAA8B,CAAA,CAAA,CAEtD,CAAA,CAAA,EAGN,OAAOC,IAAU,IAAA,IACb,EAAAT,EAAA,IAAA,CAACN,EAAAA,IAAD,CAAK,GAAI,IAAK,GAAIgB,EACb,SAAAN,CACA,CAAA,GAEL,EAAAJ,EAAA,IAAA,CAACN,EAAAA,IAAD,CAAK,QAAS,GAAM,GAAIgB,EACnB,UAAA,EAAAf,EAAAA,aAAAA,CAAac,EAAM,QAASA,EAAM,MAAOL,CAAO,CAChD,CAAA,CAEb,E"}
1
+ {"version":3,"file":"Link.cjs","names":["getLinkParts","_Fragment","DecorativeIcon","linkStyles","VisuallyHidden","Box","cloneElement","require_DecorativeIcon","require_Link_css","require_getLinkParts_utils","_choco_vanille_primitives","react","react_jsx_runtime","Link","props","content","startIcon","label","endIcon","externalLabel","child","elementProps"],"sources":["../../../../src/components/navigation/link/Link.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { linkStyles } from '@components/components/navigation/link/Link.css';\nimport type {\n LinkAsChildProps,\n LinkProps,\n} from '@components/components/navigation/link/types';\nimport { getLinkParts } from '@components/components/navigation/link/utils/getLinkParts.utils';\n\n/**\n * Renders a text link: a native `a` (a `Box`) with its `href`, showing its\n * `label`, which names it, or `aria-label` when the label is empty, between\n * optional decorative icons hidden from assistive technologies.\n *\n * With `onClick`, a plain click, Enter included, cancels the default action,\n * then calls it, so `href` is never followed, even if `onClick` throws, but\n * still gives the link its role, its preview and its context\n * menu. A modified or middle click, a `target` other than `_self` or a\n * `download` is left to the browser, without calling `onClick`.\n *\n * `external` sets `target=\"_blank\"` unless given, adds `noopener noreferrer`\n * to `rel`, ends the link with an external icon unless `endIcon` is given,\n * and, when it opens in a new tab, appends `externalLabel`, required with\n * `external`, as visually hidden text to its name. `disabled` drops `href`,\n * and with it `target`, `rel` and the hidden `externalLabel`, so the link\n * leaves the tab order, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, flags it with `data-disabled` and cancels its clicks and\n * middle clicks without calling `onClick` or `onAuxClick`.\n *\n * With `asChild`, it renders its single child instead, an element without\n * content such as a router link, which carries the destination: the props,\n * classes, `ref` and handlers of the link are merged onto it, the child's\n * handlers running first and its own values prevailing for any other prop,\n * and the label and icons become its content. Its `target` and `rel` are\n * resolved as those of the link: external, it opens in a new tab unless its\n * `target` says otherwise, and its `rel` gets `noopener noreferrer`\n * added. `onClick` runs as given,\n * without cancelling the navigation of the child; disabled, the child keeps\n * its `href` and stays focusable, but its clicks and middle clicks are\n * cancelled, which router links honor.\n *\n * The margin props of `Box` space it from its siblings; on an inline link,\n * only the horizontal ones apply. Every other prop (attributes, events,\n * `ref`) goes to the `a`, except its\n * content and the legacy `color` attribute; `className` comes after the\n * generated classes and `style` is applied as given.\n *\n * @param props Label, single child with `asChild`, presentation, icons,\n * external and disabled states, and native props of the `a`.\n * @returns The link.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, or have content of their own.\n */\nconst Link: FC<LinkAsChildProps | LinkProps> = (props) => {\n const { child, elementProps, endIcon, externalLabel, label, startIcon } =\n getLinkParts(props);\n const content = (\n <>\n {startIcon ? (\n <DecorativeIcon\n className={linkStyles.startIcon}\n icon={startIcon}\n />\n ) : null}\n {label}\n {endIcon ? (\n <DecorativeIcon className={linkStyles.endIcon} icon={endIcon} />\n ) : null}\n {externalLabel === undefined ? null : (\n <VisuallyHidden> {externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n return child === undefined ? (\n <Box as={'a'} {...elementProps}>\n {content}\n </Box>\n ) : (\n <Box asChild={true} {...elementProps}>\n {cloneElement(child.element, child.props, content)}\n </Box>\n );\n};\n\nexport default Link;\n"],"mappings":"A,oPAwDA,IAAMa,EAA0C,GAAU,CACtD,GAAM,CAAE,QAAO,eAAc,UAAS,gBAAe,QAAO,aACxDb,EAAAA,aAAac,CAAK,EAChBC,GACF,EAAAH,EAAA,KAAA,CAAAX,EAAAA,SAAA,CAAA,SAAA,CACKe,GACG,EAAAJ,EAAA,IAAA,CAACV,EAAAA,QAAD,CACI,UAAWC,EAAAA,WAAW,UACtB,KAAMa,CACT,CAAA,EACD,KACHC,EACAC,GACG,EAAAN,EAAA,IAAA,CAACV,EAAAA,QAAD,CAAgB,UAAWC,EAAAA,WAAW,QAAS,KAAMe,CAAU,CAAA,EAC/D,KACHC,IAAkB,IAAA,GAAY,MAC3B,EAAAP,EAAA,KAAA,CAACR,EAAAA,eAAD,CAAA,SAAA,CAAgB,IAAEe,CAA8B,CAAA,CAAA,CAEtD,CAAA,CAAA,EAGN,OAAOC,IAAU,IAAA,IACb,EAAAR,EAAA,IAAA,CAACP,EAAAA,IAAD,CAAK,GAAI,IAAK,GAAIgB,EACb,SAAAN,CACA,CAAA,GAEL,EAAAH,EAAA,IAAA,CAACP,EAAAA,IAAD,CAAK,QAAS,GAAM,GAAIgB,EACnB,UAAA,EAAAf,EAAAA,aAAAA,CAAac,EAAM,QAASA,EAAM,MAAOL,CAAO,CAChD,CAAA,CAEb,E"}
@@ -2,30 +2,30 @@ import e from "../../_common/components/decorative-icon/DecorativeIcon.js";
2
2
  import { linkStyles as t } from "./Link.css.js";
3
3
  import { getLinkParts as n } from "./utils/getLinkParts.utils.js";
4
4
  import { Box as r, VisuallyHidden as i } from "@choco-vanille/primitives";
5
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import { cloneElement as c } from "react";
5
+ import { cloneElement as a } from "react";
6
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  // src/components/navigation/link/Link.tsx
8
8
  var l = (l) => {
9
- let { child: u, elementProps: d, endIcon: f, externalLabel: p, label: m, startIcon: h } = n(l), g = /* @__PURE__ */ s(a, { children: [
10
- h ? /* @__PURE__ */ o(e, {
9
+ let { child: u, elementProps: d, endIcon: f, externalLabel: p, label: m, startIcon: h } = n(l), g = /* @__PURE__ */ c(o, { children: [
10
+ h ? /* @__PURE__ */ s(e, {
11
11
  className: t.startIcon,
12
12
  icon: h
13
13
  }) : null,
14
14
  m,
15
- f ? /* @__PURE__ */ o(e, {
15
+ f ? /* @__PURE__ */ s(e, {
16
16
  className: t.endIcon,
17
17
  icon: f
18
18
  }) : null,
19
- p === void 0 ? null : /* @__PURE__ */ s(i, { children: [" ", p] })
19
+ p === void 0 ? null : /* @__PURE__ */ c(i, { children: [" ", p] })
20
20
  ] });
21
- return u === void 0 ? /* @__PURE__ */ o(r, {
21
+ return u === void 0 ? /* @__PURE__ */ s(r, {
22
22
  as: "a",
23
23
  ...d,
24
24
  children: g
25
- }) : /* @__PURE__ */ o(r, {
25
+ }) : /* @__PURE__ */ s(r, {
26
26
  asChild: !0,
27
27
  ...d,
28
- children: c(u.element, u.props, g)
28
+ children: a(u.element, u.props, g)
29
29
  });
30
30
  };
31
31
  export { l as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","names":["_Fragment","DecorativeIcon","Link","getLinkParts","props","content","Fragment","startIcon","linkStyles","label","endIcon","externalLabel","VisuallyHidden","child","Box","elementProps","cloneElement"],"sources":["../../../../src/components/navigation/link/Link.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { linkStyles } from '@components/components/navigation/link/Link.css';\nimport type {\n LinkAsChildProps,\n LinkProps,\n} from '@components/components/navigation/link/types';\nimport { getLinkParts } from '@components/components/navigation/link/utils/getLinkParts.utils';\n\n/**\n * Renders a text link: a native `a` (a `Box`) with its `href`, showing its\n * `label`, which names it, or `aria-label` when the label is empty, between\n * optional decorative icons hidden from assistive technologies.\n *\n * With `onClick`, a plain click, Enter included, cancels the default action,\n * then calls it, so `href` is never followed, even if `onClick` throws, but\n * still gives the link its role, its preview and its context\n * menu. A modified or middle click, a `target` other than `_self` or a\n * `download` is left to the browser, without calling `onClick`.\n *\n * `external` sets `target=\"_blank\"` unless given, adds `noopener noreferrer`\n * to `rel`, ends the link with an external icon unless `endIcon` is given,\n * and, when it opens in a new tab, appends `externalLabel`, required with\n * `external`, as visually hidden text to its name. `disabled` drops `href`,\n * and with it `target`, `rel` and the hidden `externalLabel`, so the link\n * leaves the tab order, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, flags it with `data-disabled` and cancels its clicks and\n * middle clicks without calling `onClick` or `onAuxClick`.\n *\n * With `asChild`, it renders its single child instead, an element without\n * content such as a router link, which carries the destination: the props,\n * classes, `ref` and handlers of the link are merged onto it, the child's\n * handlers running first and its own values prevailing for any other prop,\n * and the label and icons become its content. Its `target` and `rel` are\n * resolved as those of the link: external, it opens in a new tab unless its\n * `target` says otherwise, and its `rel` gets `noopener noreferrer`\n * added. `onClick` runs as given,\n * without cancelling the navigation of the child; disabled, the child keeps\n * its `href` and stays focusable, but its clicks and middle clicks are\n * cancelled, which router links honor.\n *\n * The margin props of `Box` space it from its siblings; on an inline link,\n * only the horizontal ones apply. Every other prop (attributes, events,\n * `ref`) goes to the `a`, except its\n * content and the legacy `color` attribute; `className` comes after the\n * generated classes and `style` is applied as given.\n *\n * @param props Label, single child with `asChild`, presentation, icons,\n * external and disabled states, and native props of the `a`.\n * @returns The link.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, or have content of their own.\n */\nconst Link: FC<LinkAsChildProps | LinkProps> = (props) => {\n const { child, elementProps, endIcon, externalLabel, label, startIcon } =\n getLinkParts(props);\n const content = (\n <>\n {startIcon ? (\n <DecorativeIcon\n className={linkStyles.startIcon}\n icon={startIcon}\n />\n ) : null}\n {label}\n {endIcon ? (\n <DecorativeIcon className={linkStyles.endIcon} icon={endIcon} />\n ) : null}\n {externalLabel === undefined ? null : (\n <VisuallyHidden> {externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n return child === undefined ? (\n <Box as={'a'} {...elementProps}>\n {content}\n </Box>\n ) : (\n <Box asChild={true} {...elementProps}>\n {cloneElement(child.element, child.props, content)}\n </Box>\n );\n};\n\nexport default Link;\n"],"mappings":";;;;;;;AAwDA,IAAME,KAA0C,MAAU;CACtD,IAAM,EAAE,UAAO,iBAAc,YAAS,kBAAe,UAAO,iBACxDC,EAAaC,CAAK,GAChBC,IACF,kBAAAL,GAAA,EAAA,UAAA;EACKO,IACG,kBAACN,GAAD;GACI,WAAWO,EAAW;GACtB,MAAMD;EACT,CAAA,IACD;EACHE;EACAC,IACG,kBAACT,GAAD;GAAgB,WAAWO,EAAW;GAAS,MAAME;EAAU,CAAA,IAC/D;EACHC,MAAkB,KAAA,IAAY,OAC3B,kBAACC,GAAD,EAAA,UAAA,CAAgB,KAAED,CAA8B,EAAA,CAAA;CAEtD,EAAA,CAAA;CAGN,OAAOE,MAAU,KAAA,IACb,kBAACC,GAAD;EAAK,IAAI;EAAK,GAAIC;EACb,UAAAV;CACA,CAAA,IAEL,kBAACS,GAAD;EAAK,SAAS;EAAM,GAAIC;EACnB,UAAAC,EAAaH,EAAM,SAASA,EAAM,OAAOR,CAAO;CAChD,CAAA;AAEb"}
1
+ {"version":3,"file":"Link.js","names":["_Fragment","DecorativeIcon","Fragment$1","Link","getLinkParts","props","content","startIcon","linkStyles","label","endIcon","externalLabel","VisuallyHidden","child","Box","elementProps","cloneElement"],"sources":["../../../../src/components/navigation/link/Link.tsx"],"sourcesContent":["import { Box, VisuallyHidden } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { cloneElement } from 'react';\n\nimport { DecorativeIcon } from '@components/components/_common/components';\nimport { linkStyles } from '@components/components/navigation/link/Link.css';\nimport type {\n LinkAsChildProps,\n LinkProps,\n} from '@components/components/navigation/link/types';\nimport { getLinkParts } from '@components/components/navigation/link/utils/getLinkParts.utils';\n\n/**\n * Renders a text link: a native `a` (a `Box`) with its `href`, showing its\n * `label`, which names it, or `aria-label` when the label is empty, between\n * optional decorative icons hidden from assistive technologies.\n *\n * With `onClick`, a plain click, Enter included, cancels the default action,\n * then calls it, so `href` is never followed, even if `onClick` throws, but\n * still gives the link its role, its preview and its context\n * menu. A modified or middle click, a `target` other than `_self` or a\n * `download` is left to the browser, without calling `onClick`.\n *\n * `external` sets `target=\"_blank\"` unless given, adds `noopener noreferrer`\n * to `rel`, ends the link with an external icon unless `endIcon` is given,\n * and, when it opens in a new tab, appends `externalLabel`, required with\n * `external`, as visually hidden text to its name. `disabled` drops `href`,\n * and with it `target`, `rel` and the hidden `externalLabel`, so the link\n * leaves the tab order, keeps it exposed with `role=\"link\"` and\n * `aria-disabled`, flags it with `data-disabled` and cancels its clicks and\n * middle clicks without calling `onClick` or `onAuxClick`.\n *\n * With `asChild`, it renders its single child instead, an element without\n * content such as a router link, which carries the destination: the props,\n * classes, `ref` and handlers of the link are merged onto it, the child's\n * handlers running first and its own values prevailing for any other prop,\n * and the label and icons become its content. Its `target` and `rel` are\n * resolved as those of the link: external, it opens in a new tab unless its\n * `target` says otherwise, and its `rel` gets `noopener noreferrer`\n * added. `onClick` runs as given,\n * without cancelling the navigation of the child; disabled, the child keeps\n * its `href` and stays focusable, but its clicks and middle clicks are\n * cancelled, which router links honor.\n *\n * The margin props of `Box` space it from its siblings; on an inline link,\n * only the horizontal ones apply. Every other prop (attributes, events,\n * `ref`) goes to the `a`, except its\n * content and the legacy `color` attribute; `className` comes after the\n * generated classes and `style` is applied as given.\n *\n * @param props Label, single child with `asChild`, presentation, icons,\n * external and disabled states, and native props of the `a`.\n * @returns The link.\n * @throws {Error} With `asChild`, when the children are not a single\n * element, or have content of their own.\n */\nconst Link: FC<LinkAsChildProps | LinkProps> = (props) => {\n const { child, elementProps, endIcon, externalLabel, label, startIcon } =\n getLinkParts(props);\n const content = (\n <>\n {startIcon ? (\n <DecorativeIcon\n className={linkStyles.startIcon}\n icon={startIcon}\n />\n ) : null}\n {label}\n {endIcon ? (\n <DecorativeIcon className={linkStyles.endIcon} icon={endIcon} />\n ) : null}\n {externalLabel === undefined ? null : (\n <VisuallyHidden> {externalLabel}</VisuallyHidden>\n )}\n </>\n );\n\n return child === undefined ? (\n <Box as={'a'} {...elementProps}>\n {content}\n </Box>\n ) : (\n <Box asChild={true} {...elementProps}>\n {cloneElement(child.element, child.props, content)}\n </Box>\n );\n};\n\nexport default Link;\n"],"mappings":";;;;;;;AAwDA,IAAMG,KAA0C,MAAU;CACtD,IAAM,EAAE,UAAO,iBAAc,YAAS,kBAAe,UAAO,iBACxDC,EAAaC,CAAK,GAChBC,IACF,kBAAAN,GAAA,EAAA,UAAA;EACKO,IACG,kBAACN,GAAD;GACI,WAAWO,EAAW;GACtB,MAAMD;EACT,CAAA,IACD;EACHE;EACAC,IACG,kBAACT,GAAD;GAAgB,WAAWO,EAAW;GAAS,MAAME;EAAU,CAAA,IAC/D;EACHC,MAAkB,KAAA,IAAY,OAC3B,kBAACC,GAAD,EAAA,UAAA,CAAgB,KAAED,CAA8B,EAAA,CAAA;CAEtD,EAAA,CAAA;CAGN,OAAOE,MAAU,KAAA,IACb,kBAACC,GAAD;EAAK,IAAI;EAAK,GAAIC;EACb,UAAAT;CACA,CAAA,IAEL,kBAACQ,GAAD;EAAK,SAAS;EAAM,GAAIC;EACnB,UAAAC,EAAaH,EAAM,SAASA,EAAM,OAAOP,CAAO;CAChD,CAAA;AAEb"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../../../_common/utils/mergeClassNames.utils.cjs"),t=require("../../../../_common/link-base/utils/getLinkBaseSlotChild.utils.cjs"),n=require("../TabsTab.css.cjs"),r=require("../../../constants/index.cjs");var i=({asChild:i,children:a,className:o,endIcon:s,icon:c,label:l,startIcon:u,...d},f)=>{let p=e.mergeClassNames(n.tabsTabStyles.root,n.tabsTabStyles.variants[f],c===void 0?void 0:n.tabsTabStyles.iconOnly,o),m={endIcon:s,label:l,startIcon:c??u};return i===!0?{content:m,elementProps:{...d,className:p,nativeButton:!1,render:t.getLinkBaseSlotChild(a,r.tabsPartNames.tab)}}:{content:m,elementProps:{...d,className:p}}};exports.getTabsTabParts=i;
1
+ const e=require("../../../../../_common/utils/get-label-slot-child/getLabelSlotChild.utils.cjs"),t=require("../../../../../_common/utils/mergeClassNames.utils.cjs"),n=require("../TabsTab.css.cjs"),r=require("../../../constants/index.cjs");var i=({asChild:i,children:a,className:o,endIcon:s,icon:c,label:l,startIcon:u,...d},f)=>{let p=t.mergeClassNames(n.tabsTabStyles.root,n.tabsTabStyles.variants[f],c===void 0?void 0:n.tabsTabStyles.iconOnly,o),m={endIcon:s,label:l,startIcon:c??u};return i===!0?{content:m,elementProps:{...d,className:p,nativeButton:!1,render:e.getLabelSlotChild(a,r.tabsPartNames.tab)}}:{content:m,elementProps:{...d,className:p}}};exports.getTabsTabParts=i;
2
2
  //# sourceMappingURL=getTabsTabParts.utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getTabsTabParts.utils.cjs","names":["mergeClassNames","tabsTabStyles","getLinkBaseSlotChild","tabsPartNames","require_mergeClassNames_utils","require_getLinkBaseSlotChild_utils","require_TabsTab_css","require_index","getTabsTabParts","props","generatedClassName","variant","icon","className","content","startIcon","asChild","children"],"sources":["../../../../../../../src/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.ts"],"sourcesContent":["import { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { getLinkBaseSlotChild } from '@components/components/navigation/_common/link-base/utils/getLinkBaseSlotChild.utils';\nimport { tabsTabStyles } from '@components/components/navigation/tabs/components/tabs-tab/TabsTab.css';\nimport type {\n TabsTabAsChildProps,\n TabsTabParts,\n TabsTabProps,\n} from '@components/components/navigation/tabs/components/tabs-tab/types';\nimport { tabsPartNames } from '@components/components/navigation/tabs/constants';\nimport type { TabsVariant } from '@components/components/navigation/tabs/types';\n\n/**\n * Resolves what a `Tabs.Tab` renders: its content, an icon alone taking\n * the place of the start icon, and the props of the tab of Base UI, with\n * the classes of its variant, of an icon alone, then those of the consumer.\n * With `asChild`, the checked child is rendered as a non-native button,\n * Base UI merging the props of the tab onto it.\n *\n * @param props Props of the tab; the others go to the tab of Base UI.\n * @param props.asChild Whether the single child is rendered instead.\n * @param props.children Child rendered with `asChild`.\n * @param props.className Classes added after the generated ones.\n * @param props.endIcon Data of the icon after the label.\n * @param props.icon Data of the icon shown alone.\n * @param props.label Visible text of the tab.\n * @param props.startIcon Data of the icon before the label.\n * @param variant Variant of the enclosing `Tabs`.\n * @returns The props of the tab of Base UI and the content of the tab.\n * @throws {Error} With `asChild`, when the children are not a single\n * element without content.\n */\nexport const getTabsTabParts = (\n {\n asChild,\n children,\n className,\n endIcon,\n icon,\n label,\n startIcon,\n ...props\n }: TabsTabAsChildProps | TabsTabProps,\n variant: TabsVariant,\n): TabsTabParts => {\n const generatedClassName = mergeClassNames(\n tabsTabStyles.root,\n tabsTabStyles.variants[variant],\n icon === undefined ? undefined : tabsTabStyles.iconOnly,\n className,\n );\n const content = { endIcon, label, startIcon: icon ?? startIcon };\n\n if (asChild === true) {\n return {\n content,\n elementProps: {\n ...props,\n className: generatedClassName,\n nativeButton: false,\n render: getLinkBaseSlotChild(children, tabsPartNames.tab),\n },\n };\n }\n\n return {\n content,\n elementProps: { ...props, className: generatedClassName },\n };\n};\n"],"mappings":"A,oOA+BA,IAAaQ,GACT,CACI,UACA,WACA,YACA,UACA,OACA,QACA,YACA,GAAGC,GAEP,IACe,CACf,IAAMC,EAAqBV,EAAAA,gBACvBC,EAAAA,cAAc,KACdA,EAAAA,cAAc,SAASU,GACvBC,IAAS,IAAA,GAAY,IAAA,GAAYX,EAAAA,cAAc,SAC/CY,CACJ,EACMC,EAAU,CAAE,UAAS,QAAO,UAAWF,GAAQG,CAAU,EAc/D,OAZIC,IAAY,GACL,CACH,UACA,aAAc,CACV,GAAGP,EACH,UAAWC,EACX,aAAc,GACd,OAAQR,EAAAA,qBAAqBe,EAAUd,EAAAA,cAAc,GAAG,CAC5D,CACJ,EAGG,CACH,UACA,aAAc,CAAE,GAAGM,EAAO,UAAWC,CAAmB,CAC5D,CACJ,E"}
1
+ {"version":3,"file":"getTabsTabParts.utils.cjs","names":["mergeClassNames","tabsTabStyles","getLabelSlotChild","tabsPartNames","require_getLabelSlotChild_utils","require_mergeClassNames_utils","require_TabsTab_css","require_index","getTabsTabParts","props","generatedClassName","variant","icon","className","content","startIcon","asChild","children"],"sources":["../../../../../../../src/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.ts"],"sourcesContent":["import { getLabelSlotChild } from '@components/components/_common/utils/get-label-slot-child/getLabelSlotChild.utils';\nimport { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { tabsTabStyles } from '@components/components/navigation/tabs/components/tabs-tab/TabsTab.css';\nimport type {\n TabsTabAsChildProps,\n TabsTabParts,\n TabsTabProps,\n} from '@components/components/navigation/tabs/components/tabs-tab/types';\nimport { tabsPartNames } from '@components/components/navigation/tabs/constants';\nimport type { TabsVariant } from '@components/components/navigation/tabs/types';\n\n/**\n * Resolves what a `Tabs.Tab` renders: its content, an icon alone taking\n * the place of the start icon, and the props of the tab of Base UI, with\n * the classes of its variant, of an icon alone, then those of the consumer.\n * With `asChild`, the checked child is rendered as a non-native button,\n * Base UI merging the props of the tab onto it.\n *\n * @param props Props of the tab; the others go to the tab of Base UI.\n * @param props.asChild Whether the single child is rendered instead.\n * @param props.children Child rendered with `asChild`.\n * @param props.className Classes added after the generated ones.\n * @param props.endIcon Data of the icon after the label.\n * @param props.icon Data of the icon shown alone.\n * @param props.label Visible text of the tab.\n * @param props.startIcon Data of the icon before the label.\n * @param variant Variant of the enclosing `Tabs`.\n * @returns The props of the tab of Base UI and the content of the tab.\n * @throws {Error} With `asChild`, when the children are not a single\n * element without content.\n */\nexport const getTabsTabParts = (\n {\n asChild,\n children,\n className,\n endIcon,\n icon,\n label,\n startIcon,\n ...props\n }: TabsTabAsChildProps | TabsTabProps,\n variant: TabsVariant,\n): TabsTabParts => {\n const generatedClassName = mergeClassNames(\n tabsTabStyles.root,\n tabsTabStyles.variants[variant],\n icon === undefined ? undefined : tabsTabStyles.iconOnly,\n className,\n );\n const content = { endIcon, label, startIcon: icon ?? startIcon };\n\n if (asChild === true) {\n return {\n content,\n elementProps: {\n ...props,\n className: generatedClassName,\n nativeButton: false,\n render: getLabelSlotChild(children, tabsPartNames.tab),\n },\n };\n }\n\n return {\n content,\n elementProps: { ...props, className: generatedClassName },\n };\n};\n"],"mappings":"A,+OA+BA,IAAaQ,GACT,CACI,UACA,WACA,YACA,UACA,OACA,QACA,YACA,GAAGC,GAEP,IACe,CACf,IAAMC,EAAqBV,EAAAA,gBACvBC,EAAAA,cAAc,KACdA,EAAAA,cAAc,SAASU,GACvBC,IAAS,IAAA,GAAY,IAAA,GAAYX,EAAAA,cAAc,SAC/CY,CACJ,EACMC,EAAU,CAAE,UAAS,QAAO,UAAWF,GAAQG,CAAU,EAc/D,OAZIC,IAAY,GACL,CACH,UACA,aAAc,CACV,GAAGP,EACH,UAAWC,EACX,aAAc,GACd,OAAQR,EAAAA,kBAAkBe,EAAUd,EAAAA,cAAc,GAAG,CACzD,CACJ,EAGG,CACH,UACA,aAAc,CAAE,GAAGM,EAAO,UAAWC,CAAmB,CAC5D,CACJ,E"}
@@ -1,10 +1,10 @@
1
- import { mergeClassNames as e } from "../../../../../_common/utils/mergeClassNames.utils.js";
2
- import { getLinkBaseSlotChild as t } from "../../../../_common/link-base/utils/getLinkBaseSlotChild.utils.js";
1
+ import { getLabelSlotChild as e } from "../../../../../_common/utils/get-label-slot-child/getLabelSlotChild.utils.js";
2
+ import { mergeClassNames as t } from "../../../../../_common/utils/mergeClassNames.utils.js";
3
3
  import { tabsTabStyles as n } from "../TabsTab.css.js";
4
4
  import { tabsPartNames as r } from "../../../constants/index.js";
5
5
  // src/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.ts
6
6
  var i = ({ asChild: i, children: a, className: o, endIcon: s, icon: c, label: l, startIcon: u, ...d }, f) => {
7
- let p = e(n.root, n.variants[f], c === void 0 ? void 0 : n.iconOnly, o), m = {
7
+ let p = t(n.root, n.variants[f], c === void 0 ? void 0 : n.iconOnly, o), m = {
8
8
  endIcon: s,
9
9
  label: l,
10
10
  startIcon: c ?? u
@@ -15,7 +15,7 @@ var i = ({ asChild: i, children: a, className: o, endIcon: s, icon: c, label: l,
15
15
  ...d,
16
16
  className: p,
17
17
  nativeButton: !1,
18
- render: t(a, r.tab)
18
+ render: e(a, r.tab)
19
19
  }
20
20
  } : {
21
21
  content: m,
@@ -1 +1 @@
1
- {"version":3,"file":"getTabsTabParts.utils.js","names":["getTabsTabParts","props","generatedClassName","mergeClassNames","tabsTabStyles","variant","icon","className","content","startIcon","asChild","getLinkBaseSlotChild","children","tabsPartNames"],"sources":["../../../../../../../src/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.ts"],"sourcesContent":["import { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { getLinkBaseSlotChild } from '@components/components/navigation/_common/link-base/utils/getLinkBaseSlotChild.utils';\nimport { tabsTabStyles } from '@components/components/navigation/tabs/components/tabs-tab/TabsTab.css';\nimport type {\n TabsTabAsChildProps,\n TabsTabParts,\n TabsTabProps,\n} from '@components/components/navigation/tabs/components/tabs-tab/types';\nimport { tabsPartNames } from '@components/components/navigation/tabs/constants';\nimport type { TabsVariant } from '@components/components/navigation/tabs/types';\n\n/**\n * Resolves what a `Tabs.Tab` renders: its content, an icon alone taking\n * the place of the start icon, and the props of the tab of Base UI, with\n * the classes of its variant, of an icon alone, then those of the consumer.\n * With `asChild`, the checked child is rendered as a non-native button,\n * Base UI merging the props of the tab onto it.\n *\n * @param props Props of the tab; the others go to the tab of Base UI.\n * @param props.asChild Whether the single child is rendered instead.\n * @param props.children Child rendered with `asChild`.\n * @param props.className Classes added after the generated ones.\n * @param props.endIcon Data of the icon after the label.\n * @param props.icon Data of the icon shown alone.\n * @param props.label Visible text of the tab.\n * @param props.startIcon Data of the icon before the label.\n * @param variant Variant of the enclosing `Tabs`.\n * @returns The props of the tab of Base UI and the content of the tab.\n * @throws {Error} With `asChild`, when the children are not a single\n * element without content.\n */\nexport const getTabsTabParts = (\n {\n asChild,\n children,\n className,\n endIcon,\n icon,\n label,\n startIcon,\n ...props\n }: TabsTabAsChildProps | TabsTabProps,\n variant: TabsVariant,\n): TabsTabParts => {\n const generatedClassName = mergeClassNames(\n tabsTabStyles.root,\n tabsTabStyles.variants[variant],\n icon === undefined ? undefined : tabsTabStyles.iconOnly,\n className,\n );\n const content = { endIcon, label, startIcon: icon ?? startIcon };\n\n if (asChild === true) {\n return {\n content,\n elementProps: {\n ...props,\n className: generatedClassName,\n nativeButton: false,\n render: getLinkBaseSlotChild(children, tabsPartNames.tab),\n },\n };\n }\n\n return {\n content,\n elementProps: { ...props, className: generatedClassName },\n };\n};\n"],"mappings":";;;;;AA+BA,IAAaA,KACT,EACI,YACA,aACA,cACA,YACA,SACA,UACA,cACA,GAAGC,KAEP,MACe;CACf,IAAMC,IAAqBC,EACvBC,EAAc,MACdA,EAAc,SAASC,IACvBC,MAAS,KAAA,IAAY,KAAA,IAAYF,EAAc,UAC/CG,CACJ,GACMC,IAAU;EAAE;EAAS;EAAO,WAAWF,KAAQG;CAAU;CAc/D,OAZIC,MAAY,KACL;EACH;EACA,cAAc;GACV,GAAGT;GACH,WAAWC;GACX,cAAc;GACd,QAAQS,EAAqBC,GAAUC,EAAc,GAAG;EAC5D;CACJ,IAGG;EACH;EACA,cAAc;GAAE,GAAGZ;GAAO,WAAWC;EAAmB;CAC5D;AACJ"}
1
+ {"version":3,"file":"getTabsTabParts.utils.js","names":["getTabsTabParts","props","generatedClassName","mergeClassNames","tabsTabStyles","variant","icon","className","content","startIcon","asChild","getLabelSlotChild","children","tabsPartNames"],"sources":["../../../../../../../src/components/navigation/tabs/components/tabs-tab/utils/getTabsTabParts.utils.ts"],"sourcesContent":["import { getLabelSlotChild } from '@components/components/_common/utils/get-label-slot-child/getLabelSlotChild.utils';\nimport { mergeClassNames } from '@components/components/_common/utils/mergeClassNames.utils';\nimport { tabsTabStyles } from '@components/components/navigation/tabs/components/tabs-tab/TabsTab.css';\nimport type {\n TabsTabAsChildProps,\n TabsTabParts,\n TabsTabProps,\n} from '@components/components/navigation/tabs/components/tabs-tab/types';\nimport { tabsPartNames } from '@components/components/navigation/tabs/constants';\nimport type { TabsVariant } from '@components/components/navigation/tabs/types';\n\n/**\n * Resolves what a `Tabs.Tab` renders: its content, an icon alone taking\n * the place of the start icon, and the props of the tab of Base UI, with\n * the classes of its variant, of an icon alone, then those of the consumer.\n * With `asChild`, the checked child is rendered as a non-native button,\n * Base UI merging the props of the tab onto it.\n *\n * @param props Props of the tab; the others go to the tab of Base UI.\n * @param props.asChild Whether the single child is rendered instead.\n * @param props.children Child rendered with `asChild`.\n * @param props.className Classes added after the generated ones.\n * @param props.endIcon Data of the icon after the label.\n * @param props.icon Data of the icon shown alone.\n * @param props.label Visible text of the tab.\n * @param props.startIcon Data of the icon before the label.\n * @param variant Variant of the enclosing `Tabs`.\n * @returns The props of the tab of Base UI and the content of the tab.\n * @throws {Error} With `asChild`, when the children are not a single\n * element without content.\n */\nexport const getTabsTabParts = (\n {\n asChild,\n children,\n className,\n endIcon,\n icon,\n label,\n startIcon,\n ...props\n }: TabsTabAsChildProps | TabsTabProps,\n variant: TabsVariant,\n): TabsTabParts => {\n const generatedClassName = mergeClassNames(\n tabsTabStyles.root,\n tabsTabStyles.variants[variant],\n icon === undefined ? undefined : tabsTabStyles.iconOnly,\n className,\n );\n const content = { endIcon, label, startIcon: icon ?? startIcon };\n\n if (asChild === true) {\n return {\n content,\n elementProps: {\n ...props,\n className: generatedClassName,\n nativeButton: false,\n render: getLabelSlotChild(children, tabsPartNames.tab),\n },\n };\n }\n\n return {\n content,\n elementProps: { ...props, className: generatedClassName },\n };\n};\n"],"mappings":";;;;;AA+BA,IAAaA,KACT,EACI,YACA,aACA,cACA,YACA,SACA,UACA,cACA,GAAGC,KAEP,MACe;CACf,IAAMC,IAAqBC,EACvBC,EAAc,MACdA,EAAc,SAASC,IACvBC,MAAS,KAAA,IAAY,KAAA,IAAYF,EAAc,UAC/CG,CACJ,GACMC,IAAU;EAAE;EAAS;EAAO,WAAWF,KAAQG;CAAU;CAc/D,OAZIC,MAAY,KACL;EACH;EACA,cAAc;GACV,GAAGT;GACH,WAAWC;GACX,cAAc;GACd,QAAQS,EAAkBC,GAAUC,EAAc,GAAG;EACzD;CACJ,IAGG;EACH;EACA,cAAc;GAAE,GAAGZ;GAAO,WAAWC;EAAmB;CAC5D;AACJ"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../../layout/scroll-area/ScrollArea.cjs"),t=require("../../../_common/popup-base/constants/index.cjs"),n=require("../../../_common/popup-base/popupBase.css.cjs"),r=require("../../../_common/popup-base/utils/getPopupBaseParts.utils.cjs"),i=require("./DropdownMenuContent.css.cjs"),a=require("../../constants/index.cjs"),o=require("../../contexts/DropdownMenuSubMenuContext.cjs"),s=require("../../hooks/useAssertInsideDropdownMenu.hook.cjs");let c=require("@choco-vanille/primitives"),l=require("react/jsx-runtime"),u=require("react"),d=require("@base-ui/react/menu");var f=({children:f,...p})=>{s.useAssertInsideDropdownMenu(a.dropdownMenuPartNames.content);let m=(0,u.use)(o.DropdownMenuSubMenuContext),{boxProps:h,hasArrow:g,popupProps:_,portalProps:v,positionerProps:y}=r.getPopupBaseParts({...p,layer:`dropdown`,transitionClassName:m?i.dropdownMenuContentStyles.subMenuEnter:n.popupBaseStyles.fade});return(0,l.jsx)(d.Menu.Portal,{...v,children:(0,l.jsx)(d.Menu.Positioner,{...y,children:(0,l.jsxs)(d.Menu.Popup,{..._,render:(0,l.jsx)(c.Box,{...h}),children:[g?(0,l.jsx)(d.Menu.Arrow,{className:n.popupBaseStyles.arrow}):null,(0,l.jsx)(e.default,{className:n.popupBaseStyles.scrollArea,tabIndex:void 0,children:(0,l.jsx)(c.Box,{padding:t.popupBaseFrame.padding,children:(0,l.jsx)(o.DropdownMenuSubMenuContext,{value:!1,children:f})})})]})})})};exports.default=f;
1
+ const e=require("../../../../layout/scroll-area/ScrollArea.cjs"),t=require("../../../_common/popup-base/constants/index.cjs"),n=require("../../../_common/popup-base/popupBase.css.cjs"),r=require("../../../_common/popup-base/utils/getPopupBaseParts.utils.cjs"),i=require("./DropdownMenuContent.css.cjs"),a=require("../../constants/index.cjs"),o=require("../../contexts/DropdownMenuSubMenuContext.cjs"),s=require("../../hooks/useAssertInsideDropdownMenu.hook.cjs");let c=require("@choco-vanille/primitives"),l=require("react"),u=require("react/jsx-runtime"),d=require("@base-ui/react/menu");var f=({children:f,...p})=>{s.useAssertInsideDropdownMenu(a.dropdownMenuPartNames.content);let m=(0,l.use)(o.DropdownMenuSubMenuContext),{boxProps:h,hasArrow:g,popupProps:_,portalProps:v,positionerProps:y}=r.getPopupBaseParts({...p,layer:`dropdown`,transitionClassName:m?i.dropdownMenuContentStyles.subMenuEnter:n.popupBaseStyles.fade});return(0,u.jsx)(d.Menu.Portal,{...v,children:(0,u.jsx)(d.Menu.Positioner,{...y,children:(0,u.jsxs)(d.Menu.Popup,{..._,render:(0,u.jsx)(c.Box,{...h}),children:[g?(0,u.jsx)(d.Menu.Arrow,{className:n.popupBaseStyles.arrow}):null,(0,u.jsx)(e.default,{className:n.popupBaseStyles.scrollArea,tabIndex:void 0,children:(0,u.jsx)(c.Box,{padding:t.popupBaseFrame.padding,children:(0,u.jsx)(o.DropdownMenuSubMenuContext,{value:!1,children:f})})})]})})})};exports.default=f;
2
2
  //# sourceMappingURL=DropdownMenuContent.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuContent.cjs","names":["dropdownMenuPartNames","use","DropdownMenuSubMenuContext","getPopupBaseParts","dropdownMenuContentStyles","popupBaseStyles","Menu","Box","ScrollArea","popupBaseFrame","require_ScrollArea","require_index","require_popupBase_css","require_getPopupBaseParts_utils","require_DropdownMenuContent_css","require_index$1","require_DropdownMenuSubMenuContext","require_useAssertInsideDropdownMenu_hook","_choco_vanille_primitives","react_jsx_runtime","react","_base_ui_react_menu","DropdownMenuContent","props","isSubMenu","portalProps","positionerProps","popupProps","boxProps","hasArrow"],"sources":["../../../../../../src/components/overlays/dropdown-menu/components/dropdown-menu-content/DropdownMenuContent.tsx"],"sourcesContent":["import { Menu } from '@base-ui/react/menu';\nimport { Box } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { use } from 'react';\n\nimport { ScrollArea } from '@components/components/layout/scroll-area';\nimport { popupBaseFrame } from '@components/components/overlays/_common/popup-base/constants';\nimport { popupBaseStyles } from '@components/components/overlays/_common/popup-base/popupBase.css';\nimport { getPopupBaseParts } from '@components/components/overlays/_common/popup-base/utils/getPopupBaseParts.utils';\nimport { dropdownMenuContentStyles } from '@components/components/overlays/dropdown-menu/components/dropdown-menu-content/DropdownMenuContent.css';\nimport type { DropdownMenuContentProps } from '@components/components/overlays/dropdown-menu/components/dropdown-menu-content/types';\nimport { dropdownMenuPartNames } from '@components/components/overlays/dropdown-menu/constants';\nimport { DropdownMenuSubMenuContext } from '@components/components/overlays/dropdown-menu/contexts/DropdownMenuSubMenuContext';\nimport { useAssertInsideDropdownMenu } from '@components/components/overlays/dropdown-menu/hooks/useAssertInsideDropdownMenu.hook';\n\n/**\n * Renders the open menu of its `DropdownMenu` in a portal at the end of the\n * `body`, or of `container` when given, unmounted once closed: a `div` with\n * the `menu` role, named by the trigger, placed against it by `side`,\n * `align`, `alignOffset` and `sideOffset`, and moved to stay in the\n * viewport, `collisionPadding` away from its edges. With `arrow`, an arrow\n * points from it to the trigger, following its side and alignment, and it\n * casts a drop shadow following the arrow. Being in a portal, it\n * takes the theme of the document, not that of a nested `ThemeProvider`,\n * unless `container` renders it elsewhere, such as in the element of a\n * nested `ThemeProvider` or in a shadow root, whose theme it then takes.\n *\n * Opening it from the keyboard highlights its first item; Escape, a click\n * outside or the choice of an item closes it and gives the focus back to\n * the trigger. The sizing props of `Box` size the popup as `Box` does.\n * Unless given, `minWidth` is the width of the trigger, but never under\n * `12rem` (192px), and `maxWidth` and `maxHeight` the space left in the\n * viewport, the items scrolling beyond in a `ScrollArea`, inside the\n * padding and rounded border of the popup: its thin scrollbar shows over\n * the items while the pointer is over them or they scroll, and the\n * highlighted item scrolls into view. The scrolling viewport stays out of\n * the tab order, so Tab still closes the menu.\n *\n * Every other prop (attributes, events, `ref`) goes to the popup;\n * `className` comes after the generated classes. Its styles sit in the\n * `cv.components` cascade layers, below any unlayered style of the\n * consumer. Render it inside a `DropdownMenu`, after its trigger; a\n * `DropdownMenu.SubMenu` takes a `DropdownMenu.SubMenuContent` instead.\n *\n * @param props Items, placement and native props of the popup.\n * @param props.align Alignment along the side of the trigger; `start` when\n * absent.\n * @param props.alignOffset Shift along the side of the trigger, in pixels,\n * from the alignment; `0` when absent.\n * @param props.arrow Whether an arrow points to the trigger; `false` when\n * absent.\n * @param props.children Items of the menu.\n * @param props.className Classes added after the generated ones.\n * @param props.collisionPadding Space kept from the edges of the viewport,\n * in pixels, one number or one per side; `5` when absent, as in Base UI.\n * @param props.container Element, shadow root or ref to one the portal is\n * rendered into; the `body` when absent.\n * @param props.height Height of the popup; none when absent.\n * @param props.maxHeight Maximum height of the popup; the space left in the\n * viewport when absent.\n * @param props.maxWidth Maximum width of the popup; the space left in the\n * viewport when absent.\n * @param props.minHeight Minimum height of the popup; none when absent.\n * @param props.minWidth Minimum width of the popup; the width of the\n * trigger, but at least `12rem` (192px), when absent.\n * @param props.side Side of the trigger; `bottom` when absent.\n * @param props.sideOffset Distance from the trigger, in pixels; `4` when\n * absent, `10` with an arrow, whose tip then stands 4 pixels away.\n * @param props.width Width of the popup; that of its content when absent.\n * @returns The portal holding the positioned menu.\n * @throws {Error} When rendered outside a `DropdownMenu`.\n */\nconst DropdownMenuContent: FC<DropdownMenuContentProps> = ({\n children,\n ...props\n}) => {\n useAssertInsideDropdownMenu(dropdownMenuPartNames.content);\n\n // Inside a `DropdownMenu.SubMenu`, it is the content of that submenu.\n const isSubMenu = use(DropdownMenuSubMenuContext);\n\n const { boxProps, hasArrow, popupProps, portalProps, positionerProps } =\n getPopupBaseParts({\n ...props,\n layer: 'dropdown',\n transitionClassName: isSubMenu\n ? dropdownMenuContentStyles.subMenuEnter\n : popupBaseStyles.fade,\n });\n\n return (\n <Menu.Portal {...portalProps}>\n <Menu.Positioner {...positionerProps}>\n <Menu.Popup\n {...popupProps}\n // A `Box`, which applies the sizing props as it does.\n render={<Box {...boxProps} />}\n >\n {hasArrow ? (\n <Menu.Arrow className={popupBaseStyles.arrow} />\n ) : null}\n <ScrollArea\n className={popupBaseStyles.scrollArea}\n // Given as undefined, which removes the tab stop Base\n // UI sets on an overflowing viewport: a menu holds\n // no focusable element but its items, which the\n // arrow keys reach, and Tab leaves it, closing it.\n tabIndex={undefined}\n >\n {/* The padding leaves room for the focus ring of the items. */}\n <Box padding={popupBaseFrame.padding}>\n {/* Its items are outside any submenu until they nest one. */}\n <DropdownMenuSubMenuContext value={false}>\n {children}\n </DropdownMenuSubMenuContext>\n </Box>\n </ScrollArea>\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n );\n};\n\nexport default DropdownMenuContent;\n"],"mappings":"A,6kBAwEA,IAAMsB,GAAqD,CACvD,WACA,GAAGC,KACD,CACFN,EAAA,4BAA4BjB,EAAAA,sBAAsB,OAAO,EAGzD,IAAMwB,GAAA,EAAYvB,EAAAA,IAAAA,CAAIC,EAAAA,0BAA0B,EAE1C,CAAE,WAAU,WAAU,aAAY,cAAa,mBACjDC,EAAAA,kBAAkB,CACd,GAAGoB,EACH,MAAO,WACP,oBAAqBC,EACfpB,EAAAA,0BAA0B,aAC1BC,EAAAA,gBAAgB,IAC1B,CAAC,EAEL,OACI,EAAAc,EAAA,IAAA,CAACb,EAAAA,KAAK,OAAN,CAAa,GAAImB,EACb,UAAA,EAAAN,EAAA,IAAA,CAACb,EAAAA,KAAK,WAAN,CAAiB,GAAIoB,EACjB,UAAA,EAAAP,EAAA,KAAA,CAACb,EAAAA,KAAK,MAAN,CACI,GAAIqB,EAEJ,QAAQ,EAAAR,EAAA,IAAA,CAACZ,EAAAA,IAAD,CAAK,GAAIqB,CAAW,CAAA,EAHhC,SAAA,CAKKC,GACG,EAAAV,EAAA,IAAA,CAACb,EAAAA,KAAK,MAAN,CAAY,UAAWD,EAAAA,gBAAgB,KAAQ,CAAA,EAC/C,MACJ,EAAAc,EAAA,IAAA,CAACX,EAAAA,QAAD,CACI,UAAWH,EAAAA,gBAAgB,WAK3B,SAAU,IAAA,GAGV,UAAA,EAAAc,EAAA,IAAA,CAACZ,EAAAA,IAAD,CAAK,QAASE,EAAAA,eAAe,QAEzB,UAAA,EAAAU,EAAA,IAAA,CAACjB,EAAAA,2BAAD,CAA4B,MAAO,GAC9B,UACuB,CAAA,CAC3B,CAAA,CACG,CAAA,CACJ,C,EACC,CAAA,CACR,CAAA,CAErB,E"}
1
+ {"version":3,"file":"DropdownMenuContent.cjs","names":["dropdownMenuPartNames","use","DropdownMenuSubMenuContext","getPopupBaseParts","dropdownMenuContentStyles","popupBaseStyles","Menu","Box","ScrollArea","popupBaseFrame","require_ScrollArea","require_index","require_popupBase_css","require_getPopupBaseParts_utils","require_DropdownMenuContent_css","require_index$1","require_DropdownMenuSubMenuContext","require_useAssertInsideDropdownMenu_hook","_choco_vanille_primitives","react","react_jsx_runtime","_base_ui_react_menu","DropdownMenuContent","props","isSubMenu","portalProps","positionerProps","popupProps","boxProps","hasArrow"],"sources":["../../../../../../src/components/overlays/dropdown-menu/components/dropdown-menu-content/DropdownMenuContent.tsx"],"sourcesContent":["import { Menu } from '@base-ui/react/menu';\nimport { Box } from '@choco-vanille/primitives';\nimport type { FC } from 'react';\nimport { use } from 'react';\n\nimport { ScrollArea } from '@components/components/layout/scroll-area';\nimport { popupBaseFrame } from '@components/components/overlays/_common/popup-base/constants';\nimport { popupBaseStyles } from '@components/components/overlays/_common/popup-base/popupBase.css';\nimport { getPopupBaseParts } from '@components/components/overlays/_common/popup-base/utils/getPopupBaseParts.utils';\nimport { dropdownMenuContentStyles } from '@components/components/overlays/dropdown-menu/components/dropdown-menu-content/DropdownMenuContent.css';\nimport type { DropdownMenuContentProps } from '@components/components/overlays/dropdown-menu/components/dropdown-menu-content/types';\nimport { dropdownMenuPartNames } from '@components/components/overlays/dropdown-menu/constants';\nimport { DropdownMenuSubMenuContext } from '@components/components/overlays/dropdown-menu/contexts/DropdownMenuSubMenuContext';\nimport { useAssertInsideDropdownMenu } from '@components/components/overlays/dropdown-menu/hooks/useAssertInsideDropdownMenu.hook';\n\n/**\n * Renders the open menu of its `DropdownMenu` in a portal at the end of the\n * `body`, or of `container` when given, unmounted once closed: a `div` with\n * the `menu` role, named by the trigger, placed against it by `side`,\n * `align`, `alignOffset` and `sideOffset`, and moved to stay in the\n * viewport, `collisionPadding` away from its edges. With `arrow`, an arrow\n * points from it to the trigger, following its side and alignment, and it\n * casts a drop shadow following the arrow. Being in a portal, it\n * takes the theme of the document, not that of a nested `ThemeProvider`,\n * unless `container` renders it elsewhere, such as in the element of a\n * nested `ThemeProvider` or in a shadow root, whose theme it then takes.\n *\n * Opening it from the keyboard highlights its first item; Escape, a click\n * outside or the choice of an item closes it and gives the focus back to\n * the trigger. The sizing props of `Box` size the popup as `Box` does.\n * Unless given, `minWidth` is the width of the trigger, but never under\n * `12rem` (192px), and `maxWidth` and `maxHeight` the space left in the\n * viewport, the items scrolling beyond in a `ScrollArea`, inside the\n * padding and rounded border of the popup: its thin scrollbar shows over\n * the items while the pointer is over them or they scroll, and the\n * highlighted item scrolls into view. The scrolling viewport stays out of\n * the tab order, so Tab still closes the menu.\n *\n * Every other prop (attributes, events, `ref`) goes to the popup;\n * `className` comes after the generated classes. Its styles sit in the\n * `cv.components` cascade layers, below any unlayered style of the\n * consumer. Render it inside a `DropdownMenu`, after its trigger; a\n * `DropdownMenu.SubMenu` takes a `DropdownMenu.SubMenuContent` instead.\n *\n * @param props Items, placement and native props of the popup.\n * @param props.align Alignment along the side of the trigger; `start` when\n * absent.\n * @param props.alignOffset Shift along the side of the trigger, in pixels,\n * from the alignment; `0` when absent.\n * @param props.arrow Whether an arrow points to the trigger; `false` when\n * absent.\n * @param props.children Items of the menu.\n * @param props.className Classes added after the generated ones.\n * @param props.collisionPadding Space kept from the edges of the viewport,\n * in pixels, one number or one per side; `5` when absent, as in Base UI.\n * @param props.container Element, shadow root or ref to one the portal is\n * rendered into; the `body` when absent.\n * @param props.height Height of the popup; none when absent.\n * @param props.maxHeight Maximum height of the popup; the space left in the\n * viewport when absent.\n * @param props.maxWidth Maximum width of the popup; the space left in the\n * viewport when absent.\n * @param props.minHeight Minimum height of the popup; none when absent.\n * @param props.minWidth Minimum width of the popup; the width of the\n * trigger, but at least `12rem` (192px), when absent.\n * @param props.side Side of the trigger; `bottom` when absent.\n * @param props.sideOffset Distance from the trigger, in pixels; `4` when\n * absent, `10` with an arrow, whose tip then stands 4 pixels away.\n * @param props.width Width of the popup; that of its content when absent.\n * @returns The portal holding the positioned menu.\n * @throws {Error} When rendered outside a `DropdownMenu`.\n */\nconst DropdownMenuContent: FC<DropdownMenuContentProps> = ({\n children,\n ...props\n}) => {\n useAssertInsideDropdownMenu(dropdownMenuPartNames.content);\n\n // Inside a `DropdownMenu.SubMenu`, it is the content of that submenu.\n const isSubMenu = use(DropdownMenuSubMenuContext);\n\n const { boxProps, hasArrow, popupProps, portalProps, positionerProps } =\n getPopupBaseParts({\n ...props,\n layer: 'dropdown',\n transitionClassName: isSubMenu\n ? dropdownMenuContentStyles.subMenuEnter\n : popupBaseStyles.fade,\n });\n\n return (\n <Menu.Portal {...portalProps}>\n <Menu.Positioner {...positionerProps}>\n <Menu.Popup\n {...popupProps}\n // A `Box`, which applies the sizing props as it does.\n render={<Box {...boxProps} />}\n >\n {hasArrow ? (\n <Menu.Arrow className={popupBaseStyles.arrow} />\n ) : null}\n <ScrollArea\n className={popupBaseStyles.scrollArea}\n // Given as undefined, which removes the tab stop Base\n // UI sets on an overflowing viewport: a menu holds\n // no focusable element but its items, which the\n // arrow keys reach, and Tab leaves it, closing it.\n tabIndex={undefined}\n >\n {/* The padding leaves room for the focus ring of the items. */}\n <Box padding={popupBaseFrame.padding}>\n {/* Its items are outside any submenu until they nest one. */}\n <DropdownMenuSubMenuContext value={false}>\n {children}\n </DropdownMenuSubMenuContext>\n </Box>\n </ScrollArea>\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n );\n};\n\nexport default DropdownMenuContent;\n"],"mappings":"A,6kBAwEA,IAAMsB,GAAqD,CACvD,WACA,GAAGC,KACD,CACFN,EAAA,4BAA4BjB,EAAAA,sBAAsB,OAAO,EAGzD,IAAMwB,GAAA,EAAYvB,EAAAA,IAAAA,CAAIC,EAAAA,0BAA0B,EAE1C,CAAE,WAAU,WAAU,aAAY,cAAa,mBACjDC,EAAAA,kBAAkB,CACd,GAAGoB,EACH,MAAO,WACP,oBAAqBC,EACfpB,EAAAA,0BAA0B,aAC1BC,EAAAA,gBAAgB,IAC1B,CAAC,EAEL,OACI,EAAAe,EAAA,IAAA,CAACd,EAAAA,KAAK,OAAN,CAAa,GAAImB,EACb,UAAA,EAAAL,EAAA,IAAA,CAACd,EAAAA,KAAK,WAAN,CAAiB,GAAIoB,EACjB,UAAA,EAAAN,EAAA,KAAA,CAACd,EAAAA,KAAK,MAAN,CACI,GAAIqB,EAEJ,QAAQ,EAAAP,EAAA,IAAA,CAACb,EAAAA,IAAD,CAAK,GAAIqB,CAAW,CAAA,EAHhC,SAAA,CAKKC,GACG,EAAAT,EAAA,IAAA,CAACd,EAAAA,KAAK,MAAN,CAAY,UAAWD,EAAAA,gBAAgB,KAAQ,CAAA,EAC/C,MACJ,EAAAe,EAAA,IAAA,CAACZ,EAAAA,QAAD,CACI,UAAWH,EAAAA,gBAAgB,WAK3B,SAAU,IAAA,GAGV,UAAA,EAAAe,EAAA,IAAA,CAACb,EAAAA,IAAD,CAAK,QAASE,EAAAA,eAAe,QAEzB,UAAA,EAAAW,EAAA,IAAA,CAAClB,EAAAA,2BAAD,CAA4B,MAAO,GAC9B,UACuB,CAAA,CAC3B,CAAA,CACG,CAAA,CACJ,C,EACC,CAAA,CACR,CAAA,CAErB,E"}