@choco-vanille/primitives 0.0.0-stage → 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 (160) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +482 -2
  3. package/dist/components/_common/components/slot/Slot.cjs +2 -0
  4. package/dist/components/_common/components/slot/Slot.cjs.map +1 -0
  5. package/dist/components/_common/components/slot/Slot.js +10 -0
  6. package/dist/components/_common/components/slot/Slot.js.map +1 -0
  7. package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.cjs +2 -0
  8. package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.cjs.map +1 -0
  9. package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.js +18 -0
  10. package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.js.map +1 -0
  11. package/dist/components/_common/components/slot/utils/attachRef.utils.cjs +2 -0
  12. package/dist/components/_common/components/slot/utils/attachRef.utils.cjs.map +1 -0
  13. package/dist/components/_common/components/slot/utils/attachRef.utils.js +18 -0
  14. package/dist/components/_common/components/slot/utils/attachRef.utils.js.map +1 -0
  15. package/dist/components/_common/components/slot/utils/composeRefs.utils.cjs +2 -0
  16. package/dist/components/_common/components/slot/utils/composeRefs.utils.cjs.map +1 -0
  17. package/dist/components/_common/components/slot/utils/composeRefs.utils.js +13 -0
  18. package/dist/components/_common/components/slot/utils/composeRefs.utils.js.map +1 -0
  19. package/dist/components/_common/components/slot/utils/getSlotChild.utils.cjs +2 -0
  20. package/dist/components/_common/components/slot/utils/getSlotChild.utils.cjs.map +1 -0
  21. package/dist/components/_common/components/slot/utils/getSlotChild.utils.js +9 -0
  22. package/dist/components/_common/components/slot/utils/getSlotChild.utils.js.map +1 -0
  23. package/dist/components/_common/components/slot/utils/mergeClassNames.utils.cjs +2 -0
  24. package/dist/components/_common/components/slot/utils/mergeClassNames.utils.cjs.map +1 -0
  25. package/dist/components/_common/components/slot/utils/mergeClassNames.utils.js +8 -0
  26. package/dist/components/_common/components/slot/utils/mergeClassNames.utils.js.map +1 -0
  27. package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.cjs +2 -0
  28. package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.cjs.map +1 -0
  29. package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.js +16 -0
  30. package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.js.map +1 -0
  31. package/dist/components/_common/components/slot/utils/mergeStyles.utils.cjs +2 -0
  32. package/dist/components/_common/components/slot/utils/mergeStyles.utils.cjs.map +1 -0
  33. package/dist/components/_common/components/slot/utils/mergeStyles.utils.js +14 -0
  34. package/dist/components/_common/components/slot/utils/mergeStyles.utils.js.map +1 -0
  35. package/dist/components/_common/styles/style-props/styleProps.css.cjs +2 -0
  36. package/dist/components/_common/styles/style-props/styleProps.css.cjs.map +1 -0
  37. package/dist/components/_common/styles/style-props/styleProps.css.js +370 -0
  38. package/dist/components/_common/styles/style-props/styleProps.css.js.map +1 -0
  39. package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.cjs +2 -0
  40. package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.cjs.map +1 -0
  41. package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.js +5 -0
  42. package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.js.map +1 -0
  43. package/dist/components/_common/utils/style-props/createStyleSet.utils.cjs +2 -0
  44. package/dist/components/_common/utils/style-props/createStyleSet.utils.cjs.map +1 -0
  45. package/dist/components/_common/utils/style-props/createStyleSet.utils.js +13 -0
  46. package/dist/components/_common/utils/style-props/createStyleSet.utils.js.map +1 -0
  47. package/dist/components/_common/utils/style-props/formatStyleValue.utils.cjs +2 -0
  48. package/dist/components/_common/utils/style-props/formatStyleValue.utils.cjs.map +1 -0
  49. package/dist/components/_common/utils/style-props/formatStyleValue.utils.js +11 -0
  50. package/dist/components/_common/utils/style-props/formatStyleValue.utils.js.map +1 -0
  51. package/dist/components/_common/utils/style-props/getClassName.utils.cjs +2 -0
  52. package/dist/components/_common/utils/style-props/getClassName.utils.cjs.map +1 -0
  53. package/dist/components/_common/utils/style-props/getClassName.utils.js +21 -0
  54. package/dist/components/_common/utils/style-props/getClassName.utils.js.map +1 -0
  55. package/dist/components/_common/utils/style-props/getElementProps.utils.cjs +2 -0
  56. package/dist/components/_common/utils/style-props/getElementProps.utils.cjs.map +1 -0
  57. package/dist/components/_common/utils/style-props/getElementProps.utils.js +39 -0
  58. package/dist/components/_common/utils/style-props/getElementProps.utils.js.map +1 -0
  59. package/dist/components/_common/utils/style-props/getTokenClassNames.utils.cjs +2 -0
  60. package/dist/components/_common/utils/style-props/getTokenClassNames.utils.cjs.map +1 -0
  61. package/dist/components/_common/utils/style-props/getTokenClassNames.utils.js +21 -0
  62. package/dist/components/_common/utils/style-props/getTokenClassNames.utils.js.map +1 -0
  63. package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.cjs +2 -0
  64. package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.cjs.map +1 -0
  65. package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.js +9 -0
  66. package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.js.map +1 -0
  67. package/dist/components/_common/utils/style-props/resolveSizeValue.utils.cjs +2 -0
  68. package/dist/components/_common/utils/style-props/resolveSizeValue.utils.cjs.map +1 -0
  69. package/dist/components/_common/utils/style-props/resolveSizeValue.utils.js +5 -0
  70. package/dist/components/_common/utils/style-props/resolveSizeValue.utils.js.map +1 -0
  71. package/dist/components/accessibility/visually-hidden/VisuallyHidden.cjs +2 -0
  72. package/dist/components/accessibility/visually-hidden/VisuallyHidden.cjs.map +1 -0
  73. package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.cjs +2 -0
  74. package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.cjs.map +1 -0
  75. package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.js +10 -0
  76. package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.js.map +1 -0
  77. package/dist/components/accessibility/visually-hidden/VisuallyHidden.js +11 -0
  78. package/dist/components/accessibility/visually-hidden/VisuallyHidden.js.map +1 -0
  79. package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.cjs +2 -0
  80. package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.cjs.map +1 -0
  81. package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.js +17 -0
  82. package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.js.map +1 -0
  83. package/dist/components/foundation/icon/Icon.cjs +2 -0
  84. package/dist/components/foundation/icon/Icon.cjs.map +1 -0
  85. package/dist/components/foundation/icon/Icon.css.cjs +2 -0
  86. package/dist/components/foundation/icon/Icon.css.cjs.map +1 -0
  87. package/dist/components/foundation/icon/Icon.css.js +29 -0
  88. package/dist/components/foundation/icon/Icon.css.js.map +1 -0
  89. package/dist/components/foundation/icon/Icon.js +8 -0
  90. package/dist/components/foundation/icon/Icon.js.map +1 -0
  91. package/dist/components/foundation/icon/utils/getIconElementProps.utils.cjs +2 -0
  92. package/dist/components/foundation/icon/utils/getIconElementProps.utils.cjs.map +1 -0
  93. package/dist/components/foundation/icon/utils/getIconElementProps.utils.js +26 -0
  94. package/dist/components/foundation/icon/utils/getIconElementProps.utils.js.map +1 -0
  95. package/dist/components/foundation/typography/Typography.cjs +2 -0
  96. package/dist/components/foundation/typography/Typography.cjs.map +1 -0
  97. package/dist/components/foundation/typography/Typography.css.cjs +2 -0
  98. package/dist/components/foundation/typography/Typography.css.cjs.map +1 -0
  99. package/dist/components/foundation/typography/Typography.css.js +149 -0
  100. package/dist/components/foundation/typography/Typography.css.js.map +1 -0
  101. package/dist/components/foundation/typography/Typography.js +11 -0
  102. package/dist/components/foundation/typography/Typography.js.map +1 -0
  103. package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.cjs +2 -0
  104. package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.cjs.map +1 -0
  105. package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.js +9 -0
  106. package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.js.map +1 -0
  107. package/dist/components/layout/box/Box.cjs +2 -0
  108. package/dist/components/layout/box/Box.cjs.map +1 -0
  109. package/dist/components/layout/box/Box.css.cjs +2 -0
  110. package/dist/components/layout/box/Box.css.cjs.map +1 -0
  111. package/dist/components/layout/box/Box.css.js +418 -0
  112. package/dist/components/layout/box/Box.css.js.map +1 -0
  113. package/dist/components/layout/box/Box.js +11 -0
  114. package/dist/components/layout/box/Box.js.map +1 -0
  115. package/dist/components/layout/box/utils/getBoxElementProps.utils.cjs +2 -0
  116. package/dist/components/layout/box/utils/getBoxElementProps.utils.cjs.map +1 -0
  117. package/dist/components/layout/box/utils/getBoxElementProps.utils.js +9 -0
  118. package/dist/components/layout/box/utils/getBoxElementProps.utils.js.map +1 -0
  119. package/dist/components/layout/flex/Flex.cjs +2 -0
  120. package/dist/components/layout/flex/Flex.cjs.map +1 -0
  121. package/dist/components/layout/flex/Flex.js +11 -0
  122. package/dist/components/layout/flex/Flex.js.map +1 -0
  123. package/dist/components/layout/flex/constants/index.cjs +2 -0
  124. package/dist/components/layout/flex/constants/index.cjs.map +1 -0
  125. package/dist/components/layout/flex/constants/index.js +5 -0
  126. package/dist/components/layout/flex/constants/index.js.map +1 -0
  127. package/dist/components/layout/flex/utils/getFlexElementProps.utils.cjs +2 -0
  128. package/dist/components/layout/flex/utils/getFlexElementProps.utils.cjs.map +1 -0
  129. package/dist/components/layout/flex/utils/getFlexElementProps.utils.js +9 -0
  130. package/dist/components/layout/flex/utils/getFlexElementProps.utils.js.map +1 -0
  131. package/dist/components/layout/grid/Grid.cjs +2 -0
  132. package/dist/components/layout/grid/Grid.cjs.map +1 -0
  133. package/dist/components/layout/grid/Grid.js +11 -0
  134. package/dist/components/layout/grid/Grid.js.map +1 -0
  135. package/dist/components/layout/grid/constants/index.cjs +2 -0
  136. package/dist/components/layout/grid/constants/index.cjs.map +1 -0
  137. package/dist/components/layout/grid/constants/index.js +5 -0
  138. package/dist/components/layout/grid/constants/index.js.map +1 -0
  139. package/dist/components/layout/grid/utils/getGridElementProps.utils.cjs +2 -0
  140. package/dist/components/layout/grid/utils/getGridElementProps.utils.cjs.map +1 -0
  141. package/dist/components/layout/grid/utils/getGridElementProps.utils.js +9 -0
  142. package/dist/components/layout/grid/utils/getGridElementProps.utils.js.map +1 -0
  143. package/dist/components/layout/separator/Separator.cjs +2 -0
  144. package/dist/components/layout/separator/Separator.cjs.map +1 -0
  145. package/dist/components/layout/separator/Separator.css.cjs +2 -0
  146. package/dist/components/layout/separator/Separator.css.cjs.map +1 -0
  147. package/dist/components/layout/separator/Separator.css.js +32 -0
  148. package/dist/components/layout/separator/Separator.css.js.map +1 -0
  149. package/dist/components/layout/separator/Separator.js +10 -0
  150. package/dist/components/layout/separator/Separator.js.map +1 -0
  151. package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.cjs +2 -0
  152. package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.cjs.map +1 -0
  153. package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.js +22 -0
  154. package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.js.map +1 -0
  155. package/dist/index.cjs +1 -0
  156. package/dist/index.d.cts +1427 -0
  157. package/dist/index.d.ts +1427 -0
  158. package/dist/index.js +8 -0
  159. package/dist/styles.css +2 -0
  160. package/package.json +89 -3
@@ -0,0 +1,11 @@
1
+ import e from "../../_common/components/slot/Slot.js";
2
+ import { getGridElementProps as t } from "./utils/getGridElementProps.utils.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ // src/components/layout/grid/Grid.tsx
5
+ var r = (r) => {
6
+ let i = r.asChild === !0 ? e : r.as ?? "div";
7
+ return /* @__PURE__ */ n(i, { ...t(r) });
8
+ };
9
+ export { r as default };
10
+
11
+ //# sourceMappingURL=Grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.js","names":["Slot","Grid","Element","props","getGridElementProps"],"sources":["../../../../src/components/layout/grid/Grid.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from 'react';\n\nimport { Slot } from '@primitives/components/_common/components/slot';\nimport type { BoxTag } from '@primitives/components/layout/box/types';\nimport type {\n GridAsChildProps,\n GridProps,\n} from '@primitives/components/layout/grid/types';\nimport { getGridElementProps } from '@primitives/components/layout/grid/utils/getGridElementProps.utils';\n\n/**\n * A `Box` laid out as a grid container by default. Only the\n * default differs: `display` takes every value a `Box` accepts, an explicit\n * one replaces the default (to hide the container or make it a block, for\n * instance) and `undefined` keeps it. It renders the same tags, a `div` by\n * default, takes every style prop of a `Box` and reuses the same atomic\n * classes, flex container props included, which apply once `display`\n * makes it a flex container. Item props stay available, since a `Grid` can itself be the\n * child of a flex or grid container. Style props never reach the DOM, and every other prop\n * (attributes, events, `ref`) is typed after the tag and forwarded to the\n * element.\n *\n * With `asChild`, nothing is rendered of its own: the single child is,\n * with the classes, styles, other props and `ref` merged onto it (see\n * `AsChildProps`), for instance to style a router link.\n *\n * @param props Style props, `as` or `asChild`, and the native props of the\n * rendered tag.\n * @returns The grid container.\n * @throws {Error} With `asChild`, when the children are not a single\n * element.\n */\nconst Grid = <Tag extends BoxTag = 'div'>(\n props: GridProps<Tag> | GridAsChildProps,\n): ReactElement => {\n const Element: ElementType =\n props.asChild === true ? Slot : (props.as ?? 'div');\n\n return <Element {...getGridElementProps(props)} />;\n};\n\nexport default Grid;\n"],"mappings":";;;;AAgCA,IAAMC,KACF,MACe;CACf,IAAMC,IACFC,EAAM,YAAY,KAAOH,IAAQG,EAAM,MAAM;CAEjD,OAAO,kBAACD,GAAD,EAAS,GAAIE,EAAoBD,CAAK,EAAI,CAAA;AACrD"}
@@ -0,0 +1,2 @@
1
+ var e=`grid`;exports.defaultGridDisplay=e;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["defaultGridDisplay"],"sources":["../../../../../src/components/layout/grid/constants/index.ts"],"sourcesContent":["/** Value of `display` a `Grid` takes when the prop is not set. */\nexport const defaultGridDisplay = 'grid';\n"],"mappings":"AACA,IAAaA,EAAqB,O"}
@@ -0,0 +1,5 @@
1
+ // src/components/layout/grid/constants/index.ts
2
+ var e = "grid";
3
+ export { e as defaultGridDisplay };
4
+
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["defaultGridDisplay"],"sources":["../../../../../src/components/layout/grid/constants/index.ts"],"sourcesContent":["/** Value of `display` a `Grid` takes when the prop is not set. */\nexport const defaultGridDisplay = 'grid';\n"],"mappings":";AACA,IAAaA,IAAqB"}
@@ -0,0 +1,2 @@
1
+ const e=require("../../../_common/styles/style-props/styleProps.css.cjs"),t=require("../../../_common/utils/style-props/getClassName.utils.cjs"),n=require("../../box/utils/getBoxElementProps.utils.cjs"),r=require("../constants/index.cjs");var i=t.getClassName(e.stylePropsStyles.classTable,`display`,r.defaultGridDisplay,`display`).slice(1),a=e=>n.getBoxElementProps(e,e.display===void 0?i:``);exports.getGridElementProps=a;
2
+ //# sourceMappingURL=getGridElementProps.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGridElementProps.utils.cjs","names":["getClassName","stylePropsStyles","defaultGridDisplay","getBoxElementProps","require_styleProps_css","require_getClassName_utils","require_getBoxElementProps_utils","require_index","defaultGridClassName","getGridElementProps","props"],"sources":["../../../../../src/components/layout/grid/utils/getGridElementProps.utils.ts"],"sourcesContent":["import { stylePropsStyles } from '@primitives/components/_common/styles/style-props/styleProps.css';\nimport type { StyledProps } from '@primitives/components/_common/types';\nimport { getClassName } from '@primitives/components/_common/utils/style-props/getClassName.utils';\nimport type { BoxOwnProps } from '@primitives/components/layout/box/types';\nimport { getBoxElementProps } from '@primitives/components/layout/box/utils/getBoxElementProps.utils';\nimport { defaultGridDisplay } from '@primitives/components/layout/grid/constants';\n\nconst defaultGridClassName = getClassName(\n stylePropsStyles.classTable,\n 'display',\n defaultGridDisplay,\n 'display',\n).slice(1);\n\n/**\n * Turns the props of a `Grid` into the props of its element, like a\n * `Box`, in the same single pass: the class of the default `display` only\n * applies while the `display` prop is absent or undefined; any explicit\n * value replaces it.\n *\n * @param props Props received by the `Grid`, native ones included.\n * @returns The props to spread on the rendered element.\n */\nexport const getGridElementProps = (\n props: BoxOwnProps & StyledProps,\n): Record<string, unknown> =>\n getBoxElementProps(\n props,\n props.display === undefined ? defaultGridClassName : '',\n );\n"],"mappings":"A,+OAOA,IAAMQ,EAAuBR,EAAAA,aACzBC,EAAAA,iBAAiB,WACjB,UACAC,EAAAA,mBACA,SACJ,CAAC,CAAC,MAAM,CAAC,EAWIO,EACT,GAEAN,EAAAA,mBACIO,EACAA,EAAM,UAAY,IAAA,GAAYF,EAAuB,EACzD,E"}
@@ -0,0 +1,9 @@
1
+ import { stylePropsStyles as e } from "../../../_common/styles/style-props/styleProps.css.js";
2
+ import { getClassName as t } from "../../../_common/utils/style-props/getClassName.utils.js";
3
+ import { getBoxElementProps as n } from "../../box/utils/getBoxElementProps.utils.js";
4
+ import { defaultGridDisplay as r } from "../constants/index.js";
5
+ // src/components/layout/grid/utils/getGridElementProps.utils.ts
6
+ var i = t(e.classTable, "display", r, "display").slice(1), a = (e) => n(e, e.display === void 0 ? i : "");
7
+ export { a as getGridElementProps };
8
+
9
+ //# sourceMappingURL=getGridElementProps.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGridElementProps.utils.js","names":["defaultGridClassName","getClassName","stylePropsStyles","defaultGridDisplay","getGridElementProps","getBoxElementProps","props"],"sources":["../../../../../src/components/layout/grid/utils/getGridElementProps.utils.ts"],"sourcesContent":["import { stylePropsStyles } from '@primitives/components/_common/styles/style-props/styleProps.css';\nimport type { StyledProps } from '@primitives/components/_common/types';\nimport { getClassName } from '@primitives/components/_common/utils/style-props/getClassName.utils';\nimport type { BoxOwnProps } from '@primitives/components/layout/box/types';\nimport { getBoxElementProps } from '@primitives/components/layout/box/utils/getBoxElementProps.utils';\nimport { defaultGridDisplay } from '@primitives/components/layout/grid/constants';\n\nconst defaultGridClassName = getClassName(\n stylePropsStyles.classTable,\n 'display',\n defaultGridDisplay,\n 'display',\n).slice(1);\n\n/**\n * Turns the props of a `Grid` into the props of its element, like a\n * `Box`, in the same single pass: the class of the default `display` only\n * applies while the `display` prop is absent or undefined; any explicit\n * value replaces it.\n *\n * @param props Props received by the `Grid`, native ones included.\n * @returns The props to spread on the rendered element.\n */\nexport const getGridElementProps = (\n props: BoxOwnProps & StyledProps,\n): Record<string, unknown> =>\n getBoxElementProps(\n props,\n props.display === undefined ? defaultGridClassName : '',\n );\n"],"mappings":";;;;;AAOA,IAAMA,IAAuBC,EACzBC,EAAiB,YACjB,WACAC,GACA,SACJ,CAAC,CAAC,MAAM,CAAC,GAWIC,KACT,MAEAC,EACIC,GACAA,EAAM,YAAY,KAAA,IAAYN,IAAuB,EACzD"}
@@ -0,0 +1,2 @@
1
+ const e=require("./utils/getSeparatorElementProps.utils.cjs");let t=require("react/jsx-runtime");var n=n=>{let r=n.orientation===`vertical`?`div`:`hr`;return(0,t.jsx)(r,{...e.getSeparatorElementProps(n)})};exports.default=n;
2
+ //# sourceMappingURL=Separator.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.cjs","names":["getSeparatorElementProps","require_getSeparatorElementProps_utils","react_jsx_runtime","Separator","Element","props"],"sources":["../../../../src/components/layout/separator/Separator.tsx"],"sourcesContent":["import type { ElementType, FC } from 'react';\n\nimport type { SeparatorProps } from '@primitives/components/layout/separator/types';\nimport { getSeparatorElementProps } from '@primitives/components/layout/separator/utils/getSeparatorElementProps.utils';\n\n/**\n * Draws a line between groups of content, one space unit thick, in the\n * border color of the theme, and without margins: space it with the margin\n * props or with the `gap` of its container.\n *\n * Horizontal by default, it renders an `hr`, whose default margins and\n * borders are reset, stretched along the width of a flex column even when\n * its items are aligned otherwise; with `orientation={'vertical'}`, it\n * renders a `div`, stretched along the height of the flex row holding it\n * (outside a flex row, give it a `height`). `alignSelf` overrides both.\n *\n * It is decorative by default: `role=\"none\"` and `aria-hidden=\"true\"` hide\n * it from assistive technologies, without `aria-orientation`. With\n * `decorative={false}`, it is announced as a separator, for groups of\n * content or of menu items that screen readers must tell apart: the\n * horizontal `hr` keeps its implicit role, and the vertical `div` gets\n * `role=\"separator\"` and `aria-orientation=\"vertical\"`.\n *\n * The margin, sizing and placement props of `Box` apply, with the same values\n * and classes: the sizing props accept any CSS value, a number being a\n * length in pixels. `color`, which accepts any CSS value, colors the line:\n * the line is drawn in the current color, so a class of the consumer\n * setting `color` colors it too. Every other prop (attributes, events, `ref`) is forwarded to the\n * element, and the consumer's `className` and `style` are merged with the\n * generated ones. There is no `asChild`: the element and its role follow\n * the orientation, and a separator has no content a child could provide.\n *\n * @param props Orientation, style props and native props of the element.\n * @param props.orientation Direction of the line; `horizontal` when absent.\n * @returns The separator.\n */\nconst Separator: FC<SeparatorProps> = (props) => {\n const Element: ElementType =\n props.orientation === 'vertical' ? 'div' : 'hr';\n\n return <Element {...getSeparatorElementProps(props)} />;\n};\n\nexport default Separator;\n"],"mappings":"A,iGAoCA,IAAMG,EAAiC,GAAU,CAC7C,IAAMC,EACFC,EAAM,cAAgB,WAAa,MAAQ,KAE/C,OAAO,EAAAH,EAAA,IAAA,CAACE,EAAD,CAAS,GAAIJ,EAAAA,yBAAyBK,CAAK,CAAI,CAAA,CAC1D,E"}
@@ -0,0 +1,2 @@
1
+ /* empty css *//* empty css */;/* empty css */var e={horizontal:`_1k29oex0`,ignoredProps:[`display`,`overflowX`,`overflowY`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`flex`,`flexGrow`,`flexShrink`,`flexBasis`,`opacity`,`scrollbar`,`overflow`,`padding`,`paddingX`,`paddingY`,`backgroundColor`,`borderColor`],vertical:`_1k29oex1`};exports.separatorStyles=e;
2
+ //# sourceMappingURL=Separator.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.css.cjs","names":["separatorStyles"],"sources":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
+ // src/components/layout/separator/Separator.css.ts
5
+ var e = {
6
+ horizontal: "_1k29oex0",
7
+ ignoredProps: [
8
+ "display",
9
+ "overflowX",
10
+ "overflowY",
11
+ "paddingTop",
12
+ "paddingRight",
13
+ "paddingBottom",
14
+ "paddingLeft",
15
+ "flex",
16
+ "flexGrow",
17
+ "flexShrink",
18
+ "flexBasis",
19
+ "opacity",
20
+ "scrollbar",
21
+ "overflow",
22
+ "padding",
23
+ "paddingX",
24
+ "paddingY",
25
+ "backgroundColor",
26
+ "borderColor"
27
+ ],
28
+ vertical: "_1k29oex1"
29
+ };
30
+ export { e as separatorStyles };
31
+
32
+ //# sourceMappingURL=Separator.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.css.js","names":["separatorStyles"],"sources":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { getSeparatorElementProps as e } from "./utils/getSeparatorElementProps.utils.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ // src/components/layout/separator/Separator.tsx
4
+ var n = (n) => {
5
+ let r = n.orientation === "vertical" ? "div" : "hr";
6
+ return /* @__PURE__ */ t(r, { ...e(n) });
7
+ };
8
+ export { n as default };
9
+
10
+ //# sourceMappingURL=Separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.js","names":["Separator","Element","props","getSeparatorElementProps"],"sources":["../../../../src/components/layout/separator/Separator.tsx"],"sourcesContent":["import type { ElementType, FC } from 'react';\n\nimport type { SeparatorProps } from '@primitives/components/layout/separator/types';\nimport { getSeparatorElementProps } from '@primitives/components/layout/separator/utils/getSeparatorElementProps.utils';\n\n/**\n * Draws a line between groups of content, one space unit thick, in the\n * border color of the theme, and without margins: space it with the margin\n * props or with the `gap` of its container.\n *\n * Horizontal by default, it renders an `hr`, whose default margins and\n * borders are reset, stretched along the width of a flex column even when\n * its items are aligned otherwise; with `orientation={'vertical'}`, it\n * renders a `div`, stretched along the height of the flex row holding it\n * (outside a flex row, give it a `height`). `alignSelf` overrides both.\n *\n * It is decorative by default: `role=\"none\"` and `aria-hidden=\"true\"` hide\n * it from assistive technologies, without `aria-orientation`. With\n * `decorative={false}`, it is announced as a separator, for groups of\n * content or of menu items that screen readers must tell apart: the\n * horizontal `hr` keeps its implicit role, and the vertical `div` gets\n * `role=\"separator\"` and `aria-orientation=\"vertical\"`.\n *\n * The margin, sizing and placement props of `Box` apply, with the same values\n * and classes: the sizing props accept any CSS value, a number being a\n * length in pixels. `color`, which accepts any CSS value, colors the line:\n * the line is drawn in the current color, so a class of the consumer\n * setting `color` colors it too. Every other prop (attributes, events, `ref`) is forwarded to the\n * element, and the consumer's `className` and `style` are merged with the\n * generated ones. There is no `asChild`: the element and its role follow\n * the orientation, and a separator has no content a child could provide.\n *\n * @param props Orientation, style props and native props of the element.\n * @param props.orientation Direction of the line; `horizontal` when absent.\n * @returns The separator.\n */\nconst Separator: FC<SeparatorProps> = (props) => {\n const Element: ElementType =\n props.orientation === 'vertical' ? 'div' : 'hr';\n\n return <Element {...getSeparatorElementProps(props)} />;\n};\n\nexport default Separator;\n"],"mappings":";;;AAoCA,IAAMA,KAAiC,MAAU;CAC7C,IAAMC,IACFC,EAAM,gBAAgB,aAAa,QAAQ;CAE/C,OAAO,kBAACD,GAAD,EAAS,GAAIE,EAAyBD,CAAK,EAAI,CAAA;AAC1D"}
@@ -0,0 +1,2 @@
1
+ const e=require("../../../_common/styles/style-props/styleProps.css.cjs"),t=require("../../../_common/utils/style-props/createStyleSet.utils.cjs"),n=require("../../../_common/utils/style-props/getElementProps.utils.cjs"),r=require("../Separator.css.cjs");var i=t.createStyleSet([e.stylePropsStyles.classTable],r.separatorStyles.ignoredProps),a=({decorative:e,orientation:t,...a})=>{let o=t===`vertical`,s=n.getElementProps(a,i,o?r.separatorStyles.vertical:r.separatorStyles.horizontal);return e===!1?{...s,"aria-hidden":void 0,"aria-orientation":o?`vertical`:void 0,role:o?`separator`:void 0}:{...s,"aria-hidden":!0,"aria-orientation":void 0,role:`none`}};exports.getSeparatorElementProps=a;
2
+ //# sourceMappingURL=getSeparatorElementProps.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSeparatorElementProps.utils.cjs","names":["createStyleSet","stylePropsStyles","separatorStyles","getElementProps","require_styleProps_css","require_createStyleSet_utils","require_getElementProps_utils","require_Separator_css","separatorStyleSet","getSeparatorElementProps","props","isVertical","orientation","elementProps","decorative"],"sources":["../../../../../src/components/layout/separator/utils/getSeparatorElementProps.utils.ts"],"sourcesContent":["import { stylePropsStyles } from '@primitives/components/_common/styles/style-props/styleProps.css';\nimport type { StyledProps } from '@primitives/components/_common/types';\nimport { createStyleSet } from '@primitives/components/_common/utils/style-props/createStyleSet.utils';\nimport { getElementProps } from '@primitives/components/_common/utils/style-props/getElementProps.utils';\nimport { separatorStyles } from '@primitives/components/layout/separator/Separator.css';\nimport type { SeparatorOwnProps } from '@primitives/components/layout/separator/types';\n\nconst separatorStyleSet = createStyleSet(\n [stylePropsStyles.classTable],\n separatorStyles.ignoredProps,\n);\n\n/**\n * Turns the props of a `Separator` into the props of the element it\n * renders, in a single pass: the default class of the orientation comes\n * first, style props become classes, and the sizing props and the color of\n * the line variables set inline, and every native prop is forwarded as is.\n * The shared style props a `Separator` does not accept, such as `padding`,\n * `display` or `borderColor`, have no effect: neither class, variable nor\n * attribute.\n *\n * The accessibility attributes follow the props and prevail over any given\n * ones: a decorative separator, the default, gets `role=\"none\"` and\n * `aria-hidden=\"true\"`, without orientation. With `decorative` set to\n * `false`, a horizontal separator keeps the implicit role of its `hr`, and a\n * vertical one gets `role=\"separator\"` and `aria-orientation=\"vertical\"`.\n *\n * @param props Props received by the `Separator`, native ones included.\n * @param props.decorative Whether the separator is hidden from assistive\n * technologies; hidden unless `false`.\n * @param props.orientation Direction of the line; `horizontal` when absent.\n * @returns The props to spread on the rendered element.\n */\nexport const getSeparatorElementProps = ({\n decorative,\n orientation,\n ...props\n}: SeparatorOwnProps & StyledProps): Record<string, unknown> => {\n const isVertical = orientation === 'vertical';\n const elementProps = getElementProps(\n props,\n separatorStyleSet,\n isVertical ? separatorStyles.vertical : separatorStyles.horizontal,\n );\n\n if (decorative === false) {\n return {\n ...elementProps,\n 'aria-hidden': undefined,\n 'aria-orientation': isVertical ? 'vertical' : undefined,\n role: isVertical ? 'separator' : undefined,\n };\n }\n\n return {\n ...elementProps,\n 'aria-hidden': true,\n 'aria-orientation': undefined,\n role: 'none',\n };\n};\n"],"mappings":"A,+PAOA,IAAMQ,EAAoBR,EAAAA,eACtB,CAACC,EAAAA,iBAAiB,UAAU,EAC5BC,EAAAA,gBAAgB,YACpB,EAuBaO,GAA4B,CACrC,aACA,cACA,GAAGC,KACyD,CAC5D,IAAMC,EAAaC,IAAgB,WAC7BC,EAAeV,EAAAA,gBACjBO,EACAF,EACAG,EAAaT,EAAAA,gBAAgB,SAAWA,EAAAA,gBAAgB,UAC5D,EAWA,OATIY,IAAe,GACR,CACH,GAAGD,EACH,cAAe,IAAA,GACf,mBAAoBF,EAAa,WAAa,IAAA,GAC9C,KAAMA,EAAa,YAAc,IAAA,EACrC,EAGG,CACH,GAAGE,EACH,cAAe,GACf,mBAAoB,IAAA,GACpB,KAAM,MACV,CACJ,E"}
@@ -0,0 +1,22 @@
1
+ import { stylePropsStyles as e } from "../../../_common/styles/style-props/styleProps.css.js";
2
+ import { createStyleSet as t } from "../../../_common/utils/style-props/createStyleSet.utils.js";
3
+ import { getElementProps as n } from "../../../_common/utils/style-props/getElementProps.utils.js";
4
+ import { separatorStyles as r } from "../Separator.css.js";
5
+ // src/components/layout/separator/utils/getSeparatorElementProps.utils.ts
6
+ var i = t([e.classTable], r.ignoredProps), a = ({ decorative: e, orientation: t, ...a }) => {
7
+ let o = t === "vertical", s = n(a, i, o ? r.vertical : r.horizontal);
8
+ return e === !1 ? {
9
+ ...s,
10
+ "aria-hidden": void 0,
11
+ "aria-orientation": o ? "vertical" : void 0,
12
+ role: o ? "separator" : void 0
13
+ } : {
14
+ ...s,
15
+ "aria-hidden": !0,
16
+ "aria-orientation": void 0,
17
+ role: "none"
18
+ };
19
+ };
20
+ export { a as getSeparatorElementProps };
21
+
22
+ //# sourceMappingURL=getSeparatorElementProps.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSeparatorElementProps.utils.js","names":["separatorStyleSet","createStyleSet","stylePropsStyles","separatorStyles","getSeparatorElementProps","props","isVertical","orientation","elementProps","getElementProps","decorative"],"sources":["../../../../../src/components/layout/separator/utils/getSeparatorElementProps.utils.ts"],"sourcesContent":["import { stylePropsStyles } from '@primitives/components/_common/styles/style-props/styleProps.css';\nimport type { StyledProps } from '@primitives/components/_common/types';\nimport { createStyleSet } from '@primitives/components/_common/utils/style-props/createStyleSet.utils';\nimport { getElementProps } from '@primitives/components/_common/utils/style-props/getElementProps.utils';\nimport { separatorStyles } from '@primitives/components/layout/separator/Separator.css';\nimport type { SeparatorOwnProps } from '@primitives/components/layout/separator/types';\n\nconst separatorStyleSet = createStyleSet(\n [stylePropsStyles.classTable],\n separatorStyles.ignoredProps,\n);\n\n/**\n * Turns the props of a `Separator` into the props of the element it\n * renders, in a single pass: the default class of the orientation comes\n * first, style props become classes, and the sizing props and the color of\n * the line variables set inline, and every native prop is forwarded as is.\n * The shared style props a `Separator` does not accept, such as `padding`,\n * `display` or `borderColor`, have no effect: neither class, variable nor\n * attribute.\n *\n * The accessibility attributes follow the props and prevail over any given\n * ones: a decorative separator, the default, gets `role=\"none\"` and\n * `aria-hidden=\"true\"`, without orientation. With `decorative` set to\n * `false`, a horizontal separator keeps the implicit role of its `hr`, and a\n * vertical one gets `role=\"separator\"` and `aria-orientation=\"vertical\"`.\n *\n * @param props Props received by the `Separator`, native ones included.\n * @param props.decorative Whether the separator is hidden from assistive\n * technologies; hidden unless `false`.\n * @param props.orientation Direction of the line; `horizontal` when absent.\n * @returns The props to spread on the rendered element.\n */\nexport const getSeparatorElementProps = ({\n decorative,\n orientation,\n ...props\n}: SeparatorOwnProps & StyledProps): Record<string, unknown> => {\n const isVertical = orientation === 'vertical';\n const elementProps = getElementProps(\n props,\n separatorStyleSet,\n isVertical ? separatorStyles.vertical : separatorStyles.horizontal,\n );\n\n if (decorative === false) {\n return {\n ...elementProps,\n 'aria-hidden': undefined,\n 'aria-orientation': isVertical ? 'vertical' : undefined,\n role: isVertical ? 'separator' : undefined,\n };\n }\n\n return {\n ...elementProps,\n 'aria-hidden': true,\n 'aria-orientation': undefined,\n role: 'none',\n };\n};\n"],"mappings":";;;;;AAOA,IAAMA,IAAoBC,EACtB,CAACC,EAAiB,UAAU,GAC5BC,EAAgB,YACpB,GAuBaC,KAA4B,EACrC,eACA,gBACA,GAAGC,QACyD;CAC5D,IAAMC,IAAaC,MAAgB,YAC7BC,IAAeC,EACjBJ,GACAL,GACAM,IAAaH,EAAgB,WAAWA,EAAgB,UAC5D;CAWA,OATIO,MAAe,KACR;EACH,GAAGF;EACH,eAAe,KAAA;EACf,oBAAoBF,IAAa,aAAa,KAAA;EAC9C,MAAMA,IAAa,cAAc,KAAA;CACrC,IAGG;EACH,GAAGE;EACH,eAAe;EACf,oBAAoB,KAAA;EACpB,MAAM;CACV;AACJ"}
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./components/accessibility/visually-hidden/VisuallyHidden.cjs"),t=require("./components/foundation/icon/Icon.cjs"),n=require("./components/foundation/typography/Typography.cjs"),r=require("./components/layout/box/Box.cjs"),i=require("./components/layout/flex/Flex.cjs"),a=require("./components/layout/grid/Grid.cjs"),o=require("./components/layout/separator/Separator.cjs");exports.Box=r.default,exports.Flex=i.default,exports.Grid=a.default,exports.Icon=t.default,exports.Separator=o.default,exports.Typography=n.default,exports.VisuallyHidden=e.default;