@choco-vanille/primitives 0.0.0-stage → 0.1.0-dev.1

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 @@
1
+ {"version":3,"file":"getSlotChild.utils.cjs","names":["isValidElement","Fragment","react","getSlotChild","children"],"sources":["../../../../../../src/components/_common/components/slot/utils/getSlotChild.utils.ts"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Fragment, isValidElement } from 'react';\n\n/**\n * Checks that the children of a `Slot` are a single element able to receive\n * props: no text, number, list, `null` or fragment, whose props would be\n * lost.\n *\n * @param children Children given to the component rendered with `asChild`.\n * @returns The single child element.\n * @throws {Error} When the children are not a single element, or are a\n * fragment.\n */\nexport const getSlotChild = (\n children: ReactNode,\n): ReactElement<Readonly<Record<string, unknown>>> => {\n if (\n !isValidElement<Readonly<Record<string, unknown>>>(children) ||\n children.type === Fragment\n ) {\n throw new Error(\n '`asChild` expects a single React element as child, such as a link: not a text, a list, a fragment or nothing.',\n );\n }\n\n return children;\n};\n"],"mappings":"A,uBAaA,IAAaG,EACT,GACkD,CAClD,GACI,EAAA,EAACH,EAAAA,eAAAA,CAAkDI,CAAQ,GAC3DA,EAAS,OAASH,EAAAA,SAElB,MAAU,MACN,+GACJ,EAGJ,OAAOG,CACX,E"}
@@ -0,0 +1,9 @@
1
+ import { Fragment as e, isValidElement as t } from "react";
2
+ // src/components/_common/components/slot/utils/getSlotChild.utils.ts
3
+ var n = (n) => {
4
+ if (!t(n) || n.type === e) throw Error("`asChild` expects a single React element as child, such as a link: not a text, a list, a fragment or nothing.");
5
+ return n;
6
+ };
7
+ export { n as getSlotChild };
8
+
9
+ //# sourceMappingURL=getSlotChild.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSlotChild.utils.js","names":["getSlotChild","isValidElement","children","Fragment"],"sources":["../../../../../../src/components/_common/components/slot/utils/getSlotChild.utils.ts"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Fragment, isValidElement } from 'react';\n\n/**\n * Checks that the children of a `Slot` are a single element able to receive\n * props: no text, number, list, `null` or fragment, whose props would be\n * lost.\n *\n * @param children Children given to the component rendered with `asChild`.\n * @returns The single child element.\n * @throws {Error} When the children are not a single element, or are a\n * fragment.\n */\nexport const getSlotChild = (\n children: ReactNode,\n): ReactElement<Readonly<Record<string, unknown>>> => {\n if (\n !isValidElement<Readonly<Record<string, unknown>>>(children) ||\n children.type === Fragment\n ) {\n throw new Error(\n '`asChild` expects a single React element as child, such as a link: not a text, a list, a fragment or nothing.',\n );\n }\n\n return children;\n};\n"],"mappings":";;AAaA,IAAaA,KACT,MACkD;CAClD,IACI,CAACC,EAAkDC,CAAQ,KAC3DA,EAAS,SAASC,GAElB,MAAU,MACN,+GACJ;CAGJ,OAAOD;AACX"}
@@ -0,0 +1,2 @@
1
+ var e=(e,t)=>{let n=(...n)=>[typeof e==`function`?e(...n):e,typeof t==`function`?t(...n):t].filter(e=>typeof e==`string`&&e!==``).join(` `);return typeof e==`function`||typeof t==`function`?n:n()};exports.mergeClassNames=e;
2
+ //# sourceMappingURL=mergeClassNames.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeClassNames.utils.cjs","names":["mergeClassNames","getClassName","args","slotClassName","childClassName","className"],"sources":["../../../../../../src/components/_common/components/slot/utils/mergeClassNames.utils.ts"],"sourcesContent":["/**\n * Joins the `className` of a `Slot` and the one of its child, the slot's\n * classes first. Either value may be a string or a function of the child's\n * state, such as the `className` of a router `NavLink`: when one is a\n * function, the result is a function too, which the child calls with its\n * own arguments; it calls each function value with them and joins what they\n * return. Only non-empty strings add classes: an empty string, `undefined`\n * or `null`, given or returned, adds nothing, not even a space.\n *\n * @param slotClassName `className` of the slot: a string or a function.\n * @param childClassName `className` of the child: a string or a function.\n * @returns The joined classes; a function returning them when either value\n * is a function.\n */\nexport const mergeClassNames = (\n slotClassName: unknown,\n childClassName: unknown,\n): string | ((...args: unknown[]) => string) => {\n const getClassName = (...args: unknown[]): string => {\n const classNames: unknown[] = [\n typeof slotClassName === 'function'\n ? slotClassName(...args)\n : slotClassName,\n typeof childClassName === 'function'\n ? childClassName(...args)\n : childClassName,\n ];\n\n return classNames\n .filter(\n (className) =>\n typeof className === 'string' && className !== '',\n )\n .join(' ');\n };\n\n const isFunction =\n typeof slotClassName === 'function' ||\n typeof childClassName === 'function';\n\n return isFunction ? getClassName : getClassName();\n};\n"],"mappings":"AAcA,IAAaA,GACT,EACA,IAC4C,CAC5C,IAAMC,GAAgB,GAAGC,IAUd,CARH,OAAOC,GAAkB,WACnBA,EAAc,GAAGD,CAAI,EACrBC,EACN,OAAOC,GAAmB,WACpBA,EAAe,GAAGF,CAAI,EACtBE,CAGH,CAAA,CACF,OACI,GACG,OAAOC,GAAc,UAAYA,IAAc,EACvD,CAAC,CACA,KAAK,GAAG,EAOjB,OAHI,OAAOF,GAAkB,YACzB,OAAOC,GAAmB,WAEVH,EAAeA,EAAa,CACpD,E"}
@@ -0,0 +1,8 @@
1
+ // src/components/_common/components/slot/utils/mergeClassNames.utils.ts
2
+ var e = (e, t) => {
3
+ let n = (...n) => [typeof e == "function" ? e(...n) : e, typeof t == "function" ? t(...n) : t].filter((e) => typeof e == "string" && e !== "").join(" ");
4
+ return typeof e == "function" || typeof t == "function" ? n : n();
5
+ };
6
+ export { e as mergeClassNames };
7
+
8
+ //# sourceMappingURL=mergeClassNames.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeClassNames.utils.js","names":["mergeClassNames","getClassName","args","slotClassName","childClassName","className"],"sources":["../../../../../../src/components/_common/components/slot/utils/mergeClassNames.utils.ts"],"sourcesContent":["/**\n * Joins the `className` of a `Slot` and the one of its child, the slot's\n * classes first. Either value may be a string or a function of the child's\n * state, such as the `className` of a router `NavLink`: when one is a\n * function, the result is a function too, which the child calls with its\n * own arguments; it calls each function value with them and joins what they\n * return. Only non-empty strings add classes: an empty string, `undefined`\n * or `null`, given or returned, adds nothing, not even a space.\n *\n * @param slotClassName `className` of the slot: a string or a function.\n * @param childClassName `className` of the child: a string or a function.\n * @returns The joined classes; a function returning them when either value\n * is a function.\n */\nexport const mergeClassNames = (\n slotClassName: unknown,\n childClassName: unknown,\n): string | ((...args: unknown[]) => string) => {\n const getClassName = (...args: unknown[]): string => {\n const classNames: unknown[] = [\n typeof slotClassName === 'function'\n ? slotClassName(...args)\n : slotClassName,\n typeof childClassName === 'function'\n ? childClassName(...args)\n : childClassName,\n ];\n\n return classNames\n .filter(\n (className) =>\n typeof className === 'string' && className !== '',\n )\n .join(' ');\n };\n\n const isFunction =\n typeof slotClassName === 'function' ||\n typeof childClassName === 'function';\n\n return isFunction ? getClassName : getClassName();\n};\n"],"mappings":";AAcA,IAAaA,KACT,GACA,MAC4C;CAC5C,IAAMC,KAAgB,GAAGC,MAUd,CARH,OAAOC,KAAkB,aACnBA,EAAc,GAAGD,CAAI,IACrBC,GACN,OAAOC,KAAmB,aACpBA,EAAe,GAAGF,CAAI,IACtBE,CAGH,CAAA,CACF,QACI,MACG,OAAOC,KAAc,YAAYA,MAAc,EACvD,CAAC,CACA,KAAK,GAAG;CAOjB,OAHI,OAAOF,KAAkB,cACzB,OAAOC,KAAmB,aAEVH,IAAeA,EAAa;AACpD"}
@@ -0,0 +1,2 @@
1
+ const e=require("./mergeClassNames.utils.cjs"),t=require("./mergeStyles.utils.cjs");var n=(n,r)=>{let i={};for(let a in n){let o=n[a],s=r[a];s===void 0?i[a]=o:a===`className`&&(typeof o==`string`||typeof o==`function`)&&(typeof s==`string`||typeof s==`function`)?i[a]=e.mergeClassNames(o,s):a===`style`&&(typeof o==`object`||typeof o==`function`)&&(typeof s==`object`||typeof s==`function`)?i[a]=t.mergeStyles(o,s):/^on[A-Z]/.test(a)&&typeof o==`function`&&typeof s==`function`&&(i[a]=(...e)=>{s(...e),o(...e)})}return i};exports.mergeSlotProps=n;
2
+ //# sourceMappingURL=mergeSlotProps.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeSlotProps.utils.cjs","names":["mergeClassNames","mergeStyles","require_mergeClassNames_utils","require_mergeStyles_utils","mergeSlotProps","mergedProps","key","slotProps","slotValue","childValue","childProps","args"],"sources":["../../../../../../src/components/_common/components/slot/utils/mergeSlotProps.utils.ts"],"sourcesContent":["import { mergeClassNames } from '@primitives/components/_common/components/slot/utils/mergeClassNames.utils';\nimport { mergeStyles } from '@primitives/components/_common/components/slot/utils/mergeStyles.utils';\n\n/**\n * Merges the props of a `Slot` with those of its child, as the props to\n * clone the child with. Classes are joined, the slot's first, without empty\n * ones; inline styles are merged, the child's prevailing. A `className` or\n * a `style` may be a function of the child's state, as on a router\n * `NavLink`: the merged prop is then a function, which resolves both sides\n * with the arguments the child calls it with. When both give an event\n * handler (`on` followed by a capital), the child's runs first, then the\n * slot's, each with the same arguments and whatever the other did. For any\n * other prop, or a `className` or `style` that is neither a string, an\n * object nor a function, the child's own value prevails: it is left out of\n * the result, which cloning keeps. The ref and the children are not merged\n * here.\n *\n * @param slotProps Props of the slot, without its ref and children.\n * @param childProps Props of the child element.\n * @returns The props overriding those of the child.\n */\nexport const mergeSlotProps = (\n slotProps: Readonly<Record<string, unknown>>,\n childProps: Readonly<Record<string, unknown>>,\n): Readonly<Record<string, unknown>> => {\n const mergedProps: Record<string, unknown> = {};\n\n for (const key in slotProps) {\n const slotValue = slotProps[key];\n const childValue = childProps[key];\n\n if (childValue === undefined) {\n mergedProps[key] = slotValue;\n } else if (\n key === 'className' &&\n (typeof slotValue === 'string' ||\n typeof slotValue === 'function') &&\n (typeof childValue === 'string' || typeof childValue === 'function')\n ) {\n mergedProps[key] = mergeClassNames(slotValue, childValue);\n } else if (\n key === 'style' &&\n (typeof slotValue === 'object' ||\n typeof slotValue === 'function') &&\n (typeof childValue === 'object' || typeof childValue === 'function')\n ) {\n mergedProps[key] = mergeStyles(slotValue, childValue);\n } else if (\n /^on[A-Z]/.test(key) &&\n typeof slotValue === 'function' &&\n typeof childValue === 'function'\n ) {\n mergedProps[key] = (...args: unknown[]): void => {\n childValue(...args);\n slotValue(...args);\n };\n }\n }\n\n return mergedProps;\n};\n"],"mappings":"A,oFAqBA,IAAaI,GACT,EACA,IACoC,CACpC,IAAMC,EAAuC,CAAC,EAE9C,IAAK,IAAMC,KAAOC,EAAW,CACzB,IAAMC,EAAYD,EAAUD,GACtBG,EAAaC,EAAWJ,GAE1BG,IAAe,IAAA,GACf,EAAYH,GAAOE,EAEnBF,IAAQ,cACP,OAAOE,GAAc,UAClB,OAAOA,GAAc,cACxB,OAAOC,GAAe,UAAY,OAAOA,GAAe,YAEzD,EAAYH,GAAON,EAAAA,gBAAgBQ,EAAWC,CAAU,EAExDH,IAAQ,UACP,OAAOE,GAAc,UAClB,OAAOA,GAAc,cACxB,OAAOC,GAAe,UAAY,OAAOA,GAAe,YAEzD,EAAYH,GAAOL,EAAAA,YAAYO,EAAWC,CAAU,EAEpD,WAAW,KAAKH,CAAG,GACnB,OAAOE,GAAc,YACrB,OAAOC,GAAe,aAEtB,EAAYH,IAAQ,GAAGK,IAA0B,CAC7CF,EAAW,GAAGE,CAAI,EAClBH,EAAU,GAAGG,CAAI,CACrB,EAER,CAEA,OAAON,CACX,E"}
@@ -0,0 +1,16 @@
1
+ import { mergeClassNames as e } from "./mergeClassNames.utils.js";
2
+ import { mergeStyles as t } from "./mergeStyles.utils.js";
3
+ // src/components/_common/components/slot/utils/mergeSlotProps.utils.ts
4
+ var n = (n, r) => {
5
+ let i = {};
6
+ for (let a in n) {
7
+ let o = n[a], s = r[a];
8
+ s === void 0 ? i[a] = o : a === "className" && (typeof o == "string" || typeof o == "function") && (typeof s == "string" || typeof s == "function") ? i[a] = e(o, s) : a === "style" && (typeof o == "object" || typeof o == "function") && (typeof s == "object" || typeof s == "function") ? i[a] = t(o, s) : /^on[A-Z]/.test(a) && typeof o == "function" && typeof s == "function" && (i[a] = (...e) => {
9
+ s(...e), o(...e);
10
+ });
11
+ }
12
+ return i;
13
+ };
14
+ export { n as mergeSlotProps };
15
+
16
+ //# sourceMappingURL=mergeSlotProps.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeSlotProps.utils.js","names":["mergeSlotProps","mergedProps","key","slotProps","slotValue","childValue","childProps","mergeClassNames","mergeStyles","args"],"sources":["../../../../../../src/components/_common/components/slot/utils/mergeSlotProps.utils.ts"],"sourcesContent":["import { mergeClassNames } from '@primitives/components/_common/components/slot/utils/mergeClassNames.utils';\nimport { mergeStyles } from '@primitives/components/_common/components/slot/utils/mergeStyles.utils';\n\n/**\n * Merges the props of a `Slot` with those of its child, as the props to\n * clone the child with. Classes are joined, the slot's first, without empty\n * ones; inline styles are merged, the child's prevailing. A `className` or\n * a `style` may be a function of the child's state, as on a router\n * `NavLink`: the merged prop is then a function, which resolves both sides\n * with the arguments the child calls it with. When both give an event\n * handler (`on` followed by a capital), the child's runs first, then the\n * slot's, each with the same arguments and whatever the other did. For any\n * other prop, or a `className` or `style` that is neither a string, an\n * object nor a function, the child's own value prevails: it is left out of\n * the result, which cloning keeps. The ref and the children are not merged\n * here.\n *\n * @param slotProps Props of the slot, without its ref and children.\n * @param childProps Props of the child element.\n * @returns The props overriding those of the child.\n */\nexport const mergeSlotProps = (\n slotProps: Readonly<Record<string, unknown>>,\n childProps: Readonly<Record<string, unknown>>,\n): Readonly<Record<string, unknown>> => {\n const mergedProps: Record<string, unknown> = {};\n\n for (const key in slotProps) {\n const slotValue = slotProps[key];\n const childValue = childProps[key];\n\n if (childValue === undefined) {\n mergedProps[key] = slotValue;\n } else if (\n key === 'className' &&\n (typeof slotValue === 'string' ||\n typeof slotValue === 'function') &&\n (typeof childValue === 'string' || typeof childValue === 'function')\n ) {\n mergedProps[key] = mergeClassNames(slotValue, childValue);\n } else if (\n key === 'style' &&\n (typeof slotValue === 'object' ||\n typeof slotValue === 'function') &&\n (typeof childValue === 'object' || typeof childValue === 'function')\n ) {\n mergedProps[key] = mergeStyles(slotValue, childValue);\n } else if (\n /^on[A-Z]/.test(key) &&\n typeof slotValue === 'function' &&\n typeof childValue === 'function'\n ) {\n mergedProps[key] = (...args: unknown[]): void => {\n childValue(...args);\n slotValue(...args);\n };\n }\n }\n\n return mergedProps;\n};\n"],"mappings":";;;AAqBA,IAAaA,KACT,GACA,MACoC;CACpC,IAAMC,IAAuC,CAAC;CAE9C,KAAK,IAAMC,KAAOC,GAAW;EACzB,IAAMC,IAAYD,EAAUD,IACtBG,IAAaC,EAAWJ;EAE9B,AAAIG,MAAe,KAAA,IACf,EAAYH,KAAOE,IAEnBF,MAAQ,gBACP,OAAOE,KAAc,YAClB,OAAOA,KAAc,gBACxB,OAAOC,KAAe,YAAY,OAAOA,KAAe,cAEzD,EAAYH,KAAOK,EAAgBH,GAAWC,CAAU,IAExDH,MAAQ,YACP,OAAOE,KAAc,YAClB,OAAOA,KAAc,gBACxB,OAAOC,KAAe,YAAY,OAAOA,KAAe,cAEzD,EAAYH,KAAOM,EAAYJ,GAAWC,CAAU,IAEpD,WAAW,KAAKH,CAAG,KACnB,OAAOE,KAAc,cACrB,OAAOC,KAAe,eAEtB,EAAYH,MAAQ,GAAGO,MAA0B;GAE7C,AADAJ,EAAW,GAAGI,CAAI,GAClBL,EAAU,GAAGK,CAAI;EACrB;CAER;CAEA,OAAOR;AACX"}
@@ -0,0 +1,2 @@
1
+ var e=(e,t)=>{let n=(...n)=>{let r=typeof e==`function`?e(...n):e,i=typeof t==`function`?t(...n):t;return{...typeof r==`object`?r:void 0,...typeof i==`object`?i:void 0}};return typeof e==`function`||typeof t==`function`?n:n()};exports.mergeStyles=e;
2
+ //# sourceMappingURL=mergeStyles.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeStyles.utils.cjs","names":["mergeStyles","getStyle","args","slotStyles","slotStyle","childStyles","childStyle"],"sources":["../../../../../../src/components/_common/components/slot/utils/mergeStyles.utils.ts"],"sourcesContent":["/**\n * Merges the inline `style` of a `Slot` and the one of its child into one\n * object, the child's values prevailing for a property both set. Either\n * value may be an object or a function of the child's state, such as the\n * `style` of a router `NavLink`: when one is a function, the result is a\n * function too, which the child calls with its own arguments; it calls each\n * function value with them and merges what they return. A value that is not\n * an object, such as `null` or `undefined`, adds no property.\n *\n * @param slotStyle `style` of the slot: an object or a function.\n * @param childStyle `style` of the child: an object or a function.\n * @returns The merged styles; a function returning them when either value\n * is a function.\n */\nexport const mergeStyles = (\n slotStyle: unknown,\n childStyle: unknown,\n):\n | Readonly<Record<string, unknown>>\n | ((...args: unknown[]) => Readonly<Record<string, unknown>>) => {\n const getStyle = (\n ...args: unknown[]\n ): Readonly<Record<string, unknown>> => {\n const slotStyles: unknown =\n typeof slotStyle === 'function' ? slotStyle(...args) : slotStyle;\n const childStyles: unknown =\n typeof childStyle === 'function' ? childStyle(...args) : childStyle;\n\n return {\n ...(typeof slotStyles === 'object' ? slotStyles : undefined),\n ...(typeof childStyles === 'object' ? childStyles : undefined),\n };\n };\n\n const isFunction =\n typeof slotStyle === 'function' || typeof childStyle === 'function';\n\n return isFunction ? getStyle : getStyle();\n};\n"],"mappings":"AAcA,IAAaA,GACT,EACA,IAGiE,CACjE,IAAMC,GACF,GAAGC,IACiC,CACpC,IAAMC,EACF,OAAOC,GAAc,WAAaA,EAAU,GAAGF,CAAI,EAAIE,EACrDC,EACF,OAAOC,GAAe,WAAaA,EAAW,GAAGJ,CAAI,EAAII,EAE7D,MAAO,CACH,GAAI,OAAOH,GAAe,SAAWA,EAAa,IAAA,GAClD,GAAI,OAAOE,GAAgB,SAAWA,EAAc,IAAA,EACxD,CACJ,EAKA,OAFI,OAAOD,GAAc,YAAc,OAAOE,GAAe,WAEzCL,EAAWA,EAAS,CAC5C,E"}
@@ -0,0 +1,14 @@
1
+ // src/components/_common/components/slot/utils/mergeStyles.utils.ts
2
+ var e = (e, t) => {
3
+ let n = (...n) => {
4
+ let r = typeof e == "function" ? e(...n) : e, i = typeof t == "function" ? t(...n) : t;
5
+ return {
6
+ ...typeof r == "object" ? r : void 0,
7
+ ...typeof i == "object" ? i : void 0
8
+ };
9
+ };
10
+ return typeof e == "function" || typeof t == "function" ? n : n();
11
+ };
12
+ export { e as mergeStyles };
13
+
14
+ //# sourceMappingURL=mergeStyles.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeStyles.utils.js","names":["mergeStyles","getStyle","args","slotStyles","slotStyle","childStyles","childStyle"],"sources":["../../../../../../src/components/_common/components/slot/utils/mergeStyles.utils.ts"],"sourcesContent":["/**\n * Merges the inline `style` of a `Slot` and the one of its child into one\n * object, the child's values prevailing for a property both set. Either\n * value may be an object or a function of the child's state, such as the\n * `style` of a router `NavLink`: when one is a function, the result is a\n * function too, which the child calls with its own arguments; it calls each\n * function value with them and merges what they return. A value that is not\n * an object, such as `null` or `undefined`, adds no property.\n *\n * @param slotStyle `style` of the slot: an object or a function.\n * @param childStyle `style` of the child: an object or a function.\n * @returns The merged styles; a function returning them when either value\n * is a function.\n */\nexport const mergeStyles = (\n slotStyle: unknown,\n childStyle: unknown,\n):\n | Readonly<Record<string, unknown>>\n | ((...args: unknown[]) => Readonly<Record<string, unknown>>) => {\n const getStyle = (\n ...args: unknown[]\n ): Readonly<Record<string, unknown>> => {\n const slotStyles: unknown =\n typeof slotStyle === 'function' ? slotStyle(...args) : slotStyle;\n const childStyles: unknown =\n typeof childStyle === 'function' ? childStyle(...args) : childStyle;\n\n return {\n ...(typeof slotStyles === 'object' ? slotStyles : undefined),\n ...(typeof childStyles === 'object' ? childStyles : undefined),\n };\n };\n\n const isFunction =\n typeof slotStyle === 'function' || typeof childStyle === 'function';\n\n return isFunction ? getStyle : getStyle();\n};\n"],"mappings":";AAcA,IAAaA,KACT,GACA,MAGiE;CACjE,IAAMC,KACF,GAAGC,MACiC;EACpC,IAAMC,IACF,OAAOC,KAAc,aAAaA,EAAU,GAAGF,CAAI,IAAIE,GACrDC,IACF,OAAOC,KAAe,aAAaA,EAAW,GAAGJ,CAAI,IAAII;EAE7D,OAAO;GACH,GAAI,OAAOH,KAAe,WAAWA,IAAa,KAAA;GAClD,GAAI,OAAOE,KAAgB,WAAWA,IAAc,KAAA;EACxD;CACJ;CAKA,OAFI,OAAOD,KAAc,cAAc,OAAOE,KAAe,aAEzCL,IAAWA,EAAS;AAC5C"}
@@ -0,0 +1,2 @@
1
+ /* empty css */;/* empty css */var e={classTable:{prefix:`_14hor4`,suffixes:{display:{none:`1`,block:`2`,inline:`3`,"inline-block":`4`,flex:`5`,"inline-flex":`6`,grid:`7`,"inline-grid":`8`,contents:`9`},overflowX:{visible:`a`,hidden:`b`,clip:`c`,scroll:`d`,auto:`e`},overflowY:{visible:`f`,hidden:`g`,clip:`h`,scroll:`i`,auto:`j`},paddingTop:{0:`k`,1:`l`,2:`m`,4:`n`,6:`o`,8:`p`,10:`q`,12:`r`,14:`s`,16:`t`,18:`u`,20:`v`,24:`w`,28:`x`,32:`y`,36:`z`,40:`10`,44:`11`,48:`12`,56:`13`,64:`14`,80:`15`,96:`16`,112:`17`,128:`18`},paddingRight:{0:`19`,1:`1a`,2:`1b`,4:`1c`,6:`1d`,8:`1e`,10:`1f`,12:`1g`,14:`1h`,16:`1i`,18:`1j`,20:`1k`,24:`1l`,28:`1m`,32:`1n`,36:`1o`,40:`1p`,44:`1q`,48:`1r`,56:`1s`,64:`1t`,80:`1u`,96:`1v`,112:`1w`,128:`1x`},paddingBottom:{0:`1y`,1:`1z`,2:`20`,4:`21`,6:`22`,8:`23`,10:`24`,12:`25`,14:`26`,16:`27`,18:`28`,20:`29`,24:`2a`,28:`2b`,32:`2c`,36:`2d`,40:`2e`,44:`2f`,48:`2g`,56:`2h`,64:`2i`,80:`2j`,96:`2k`,112:`2l`,128:`2m`},paddingLeft:{0:`2n`,1:`2o`,2:`2p`,4:`2q`,6:`2r`,8:`2s`,10:`2t`,12:`2u`,14:`2v`,16:`2w`,18:`2x`,20:`2y`,24:`2z`,28:`30`,32:`31`,36:`32`,40:`33`,44:`34`,48:`35`,56:`36`,64:`37`,80:`38`,96:`39`,112:`3a`,128:`3b`},marginTop:{0:`3c`,1:`3d`,2:`3e`,4:`3f`,6:`3g`,8:`3h`,10:`3i`,12:`3j`,14:`3k`,16:`3l`,18:`3m`,20:`3n`,24:`3o`,28:`3p`,32:`3q`,36:`3r`,40:`3s`,44:`3t`,48:`3u`,56:`3v`,64:`3w`,80:`3x`,96:`3y`,112:`3z`,128:`40`,auto:`41`},marginRight:{0:`42`,1:`43`,2:`44`,4:`45`,6:`46`,8:`47`,10:`48`,12:`49`,14:`4a`,16:`4b`,18:`4c`,20:`4d`,24:`4e`,28:`4f`,32:`4g`,36:`4h`,40:`4i`,44:`4j`,48:`4k`,56:`4l`,64:`4m`,80:`4n`,96:`4o`,112:`4p`,128:`4q`,auto:`4r`},marginBottom:{0:`4s`,1:`4t`,2:`4u`,4:`4v`,6:`4w`,8:`4x`,10:`4y`,12:`4z`,14:`50`,16:`51`,18:`52`,20:`53`,24:`54`,28:`55`,32:`56`,36:`57`,40:`58`,44:`59`,48:`5a`,56:`5b`,64:`5c`,80:`5d`,96:`5e`,112:`5f`,128:`5g`,auto:`5h`},marginLeft:{0:`5i`,1:`5j`,2:`5k`,4:`5l`,6:`5m`,8:`5n`,10:`5o`,12:`5p`,14:`5q`,16:`5r`,18:`5s`,20:`5t`,24:`5u`,28:`5v`,32:`5w`,36:`5x`,40:`5y`,44:`5z`,48:`60`,56:`61`,64:`62`,80:`63`,96:`64`,112:`65`,128:`66`,auto:`67`},flex:{1:`68`,auto:`69`,initial:`6a`,none:`6b`},flexGrow:{0:`6c`,1:`6d`},flexShrink:{0:`6e`,1:`6f`},flexBasis:{0:`6g`,"100%":`6h`,auto:`6i`},alignSelf:{auto:`6j`,stretch:`6k`,"flex-start":`6l`,center:`6m`,"flex-end":`6n`,baseline:`6o`},justifySelf:{auto:`6p`,stretch:`6q`,start:`6r`,center:`6s`,end:`6t`},gridColumn:{auto:`6u`,"1 / -1":`6v`,"span 1":`6w`,"span 2":`6x`,"span 3":`6y`,"span 4":`6z`,"span 5":`70`,"span 6":`71`,"span 7":`72`,"span 8":`73`,"span 9":`74`,"span 10":`75`,"span 11":`76`,"span 12":`77`},gridRow:{auto:`78`,"1 / -1":`79`,"span 1":`7a`,"span 2":`7b`,"span 3":`7c`,"span 4":`7d`,"span 5":`7e`,"span 6":`7f`},opacity:{hidden:`7g`,disabled:`7h`,muted:`7i`,visible:`7j`},scrollbar:{thin:`0`}},shorthands:{overflow:[[`overflowX`],[`overflowY`]],padding:[[`paddingTop`,`paddingY`],[`paddingRight`,`paddingX`],[`paddingBottom`,`paddingY`],[`paddingLeft`,`paddingX`]],paddingX:[[`paddingLeft`],[`paddingRight`]],paddingY:[[`paddingTop`],[`paddingBottom`]],margin:[[`marginTop`,`marginY`],[`marginRight`,`marginX`],[`marginBottom`,`marginY`],[`marginLeft`,`marginX`]],marginX:[[`marginLeft`],[`marginRight`]],marginY:[[`marginTop`],[`marginBottom`]]}},colors:{backgroundColor:`_14hor47z`,borderColor:`_14hor480`,color:`_14hor481`},colorVars:{backgroundColor:`var(--_14hor47w)`,borderColor:`var(--_14hor47x)`,color:`var(--_14hor47y)`},sizes:{width:`_14hor47q`,minWidth:`_14hor47r`,maxWidth:`_14hor47s`,height:`_14hor47t`,minHeight:`_14hor47u`,maxHeight:`_14hor47v`},sizeVars:{width:`var(--_14hor47k)`,minWidth:`var(--_14hor47l)`,maxWidth:`var(--_14hor47m)`,height:`var(--_14hor47n)`,minHeight:`var(--_14hor47o)`,maxHeight:`var(--_14hor47p)`}};exports.stylePropsStyles=e;
2
+ //# sourceMappingURL=styleProps.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleProps.css.cjs","names":["stylePropsStyles"],"sources":[],"mappings":""}
@@ -0,0 +1,370 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ // src/components/_common/styles/style-props/styleProps.css.ts
4
+ var e = {
5
+ classTable: {
6
+ prefix: "_14hor4",
7
+ suffixes: {
8
+ display: {
9
+ none: "1",
10
+ block: "2",
11
+ inline: "3",
12
+ "inline-block": "4",
13
+ flex: "5",
14
+ "inline-flex": "6",
15
+ grid: "7",
16
+ "inline-grid": "8",
17
+ contents: "9"
18
+ },
19
+ overflowX: {
20
+ visible: "a",
21
+ hidden: "b",
22
+ clip: "c",
23
+ scroll: "d",
24
+ auto: "e"
25
+ },
26
+ overflowY: {
27
+ visible: "f",
28
+ hidden: "g",
29
+ clip: "h",
30
+ scroll: "i",
31
+ auto: "j"
32
+ },
33
+ paddingTop: {
34
+ 0: "k",
35
+ 1: "l",
36
+ 2: "m",
37
+ 4: "n",
38
+ 6: "o",
39
+ 8: "p",
40
+ 10: "q",
41
+ 12: "r",
42
+ 14: "s",
43
+ 16: "t",
44
+ 18: "u",
45
+ 20: "v",
46
+ 24: "w",
47
+ 28: "x",
48
+ 32: "y",
49
+ 36: "z",
50
+ 40: "10",
51
+ 44: "11",
52
+ 48: "12",
53
+ 56: "13",
54
+ 64: "14",
55
+ 80: "15",
56
+ 96: "16",
57
+ 112: "17",
58
+ 128: "18"
59
+ },
60
+ paddingRight: {
61
+ 0: "19",
62
+ 1: "1a",
63
+ 2: "1b",
64
+ 4: "1c",
65
+ 6: "1d",
66
+ 8: "1e",
67
+ 10: "1f",
68
+ 12: "1g",
69
+ 14: "1h",
70
+ 16: "1i",
71
+ 18: "1j",
72
+ 20: "1k",
73
+ 24: "1l",
74
+ 28: "1m",
75
+ 32: "1n",
76
+ 36: "1o",
77
+ 40: "1p",
78
+ 44: "1q",
79
+ 48: "1r",
80
+ 56: "1s",
81
+ 64: "1t",
82
+ 80: "1u",
83
+ 96: "1v",
84
+ 112: "1w",
85
+ 128: "1x"
86
+ },
87
+ paddingBottom: {
88
+ 0: "1y",
89
+ 1: "1z",
90
+ 2: "20",
91
+ 4: "21",
92
+ 6: "22",
93
+ 8: "23",
94
+ 10: "24",
95
+ 12: "25",
96
+ 14: "26",
97
+ 16: "27",
98
+ 18: "28",
99
+ 20: "29",
100
+ 24: "2a",
101
+ 28: "2b",
102
+ 32: "2c",
103
+ 36: "2d",
104
+ 40: "2e",
105
+ 44: "2f",
106
+ 48: "2g",
107
+ 56: "2h",
108
+ 64: "2i",
109
+ 80: "2j",
110
+ 96: "2k",
111
+ 112: "2l",
112
+ 128: "2m"
113
+ },
114
+ paddingLeft: {
115
+ 0: "2n",
116
+ 1: "2o",
117
+ 2: "2p",
118
+ 4: "2q",
119
+ 6: "2r",
120
+ 8: "2s",
121
+ 10: "2t",
122
+ 12: "2u",
123
+ 14: "2v",
124
+ 16: "2w",
125
+ 18: "2x",
126
+ 20: "2y",
127
+ 24: "2z",
128
+ 28: "30",
129
+ 32: "31",
130
+ 36: "32",
131
+ 40: "33",
132
+ 44: "34",
133
+ 48: "35",
134
+ 56: "36",
135
+ 64: "37",
136
+ 80: "38",
137
+ 96: "39",
138
+ 112: "3a",
139
+ 128: "3b"
140
+ },
141
+ marginTop: {
142
+ 0: "3c",
143
+ 1: "3d",
144
+ 2: "3e",
145
+ 4: "3f",
146
+ 6: "3g",
147
+ 8: "3h",
148
+ 10: "3i",
149
+ 12: "3j",
150
+ 14: "3k",
151
+ 16: "3l",
152
+ 18: "3m",
153
+ 20: "3n",
154
+ 24: "3o",
155
+ 28: "3p",
156
+ 32: "3q",
157
+ 36: "3r",
158
+ 40: "3s",
159
+ 44: "3t",
160
+ 48: "3u",
161
+ 56: "3v",
162
+ 64: "3w",
163
+ 80: "3x",
164
+ 96: "3y",
165
+ 112: "3z",
166
+ 128: "40",
167
+ auto: "41"
168
+ },
169
+ marginRight: {
170
+ 0: "42",
171
+ 1: "43",
172
+ 2: "44",
173
+ 4: "45",
174
+ 6: "46",
175
+ 8: "47",
176
+ 10: "48",
177
+ 12: "49",
178
+ 14: "4a",
179
+ 16: "4b",
180
+ 18: "4c",
181
+ 20: "4d",
182
+ 24: "4e",
183
+ 28: "4f",
184
+ 32: "4g",
185
+ 36: "4h",
186
+ 40: "4i",
187
+ 44: "4j",
188
+ 48: "4k",
189
+ 56: "4l",
190
+ 64: "4m",
191
+ 80: "4n",
192
+ 96: "4o",
193
+ 112: "4p",
194
+ 128: "4q",
195
+ auto: "4r"
196
+ },
197
+ marginBottom: {
198
+ 0: "4s",
199
+ 1: "4t",
200
+ 2: "4u",
201
+ 4: "4v",
202
+ 6: "4w",
203
+ 8: "4x",
204
+ 10: "4y",
205
+ 12: "4z",
206
+ 14: "50",
207
+ 16: "51",
208
+ 18: "52",
209
+ 20: "53",
210
+ 24: "54",
211
+ 28: "55",
212
+ 32: "56",
213
+ 36: "57",
214
+ 40: "58",
215
+ 44: "59",
216
+ 48: "5a",
217
+ 56: "5b",
218
+ 64: "5c",
219
+ 80: "5d",
220
+ 96: "5e",
221
+ 112: "5f",
222
+ 128: "5g",
223
+ auto: "5h"
224
+ },
225
+ marginLeft: {
226
+ 0: "5i",
227
+ 1: "5j",
228
+ 2: "5k",
229
+ 4: "5l",
230
+ 6: "5m",
231
+ 8: "5n",
232
+ 10: "5o",
233
+ 12: "5p",
234
+ 14: "5q",
235
+ 16: "5r",
236
+ 18: "5s",
237
+ 20: "5t",
238
+ 24: "5u",
239
+ 28: "5v",
240
+ 32: "5w",
241
+ 36: "5x",
242
+ 40: "5y",
243
+ 44: "5z",
244
+ 48: "60",
245
+ 56: "61",
246
+ 64: "62",
247
+ 80: "63",
248
+ 96: "64",
249
+ 112: "65",
250
+ 128: "66",
251
+ auto: "67"
252
+ },
253
+ flex: {
254
+ 1: "68",
255
+ auto: "69",
256
+ initial: "6a",
257
+ none: "6b"
258
+ },
259
+ flexGrow: {
260
+ 0: "6c",
261
+ 1: "6d"
262
+ },
263
+ flexShrink: {
264
+ 0: "6e",
265
+ 1: "6f"
266
+ },
267
+ flexBasis: {
268
+ 0: "6g",
269
+ "100%": "6h",
270
+ auto: "6i"
271
+ },
272
+ alignSelf: {
273
+ auto: "6j",
274
+ stretch: "6k",
275
+ "flex-start": "6l",
276
+ center: "6m",
277
+ "flex-end": "6n",
278
+ baseline: "6o"
279
+ },
280
+ justifySelf: {
281
+ auto: "6p",
282
+ stretch: "6q",
283
+ start: "6r",
284
+ center: "6s",
285
+ end: "6t"
286
+ },
287
+ gridColumn: {
288
+ auto: "6u",
289
+ "1 / -1": "6v",
290
+ "span 1": "6w",
291
+ "span 2": "6x",
292
+ "span 3": "6y",
293
+ "span 4": "6z",
294
+ "span 5": "70",
295
+ "span 6": "71",
296
+ "span 7": "72",
297
+ "span 8": "73",
298
+ "span 9": "74",
299
+ "span 10": "75",
300
+ "span 11": "76",
301
+ "span 12": "77"
302
+ },
303
+ gridRow: {
304
+ auto: "78",
305
+ "1 / -1": "79",
306
+ "span 1": "7a",
307
+ "span 2": "7b",
308
+ "span 3": "7c",
309
+ "span 4": "7d",
310
+ "span 5": "7e",
311
+ "span 6": "7f"
312
+ },
313
+ opacity: {
314
+ hidden: "7g",
315
+ disabled: "7h",
316
+ muted: "7i",
317
+ visible: "7j"
318
+ },
319
+ scrollbar: { thin: "0" }
320
+ },
321
+ shorthands: {
322
+ overflow: [["overflowX"], ["overflowY"]],
323
+ padding: [
324
+ ["paddingTop", "paddingY"],
325
+ ["paddingRight", "paddingX"],
326
+ ["paddingBottom", "paddingY"],
327
+ ["paddingLeft", "paddingX"]
328
+ ],
329
+ paddingX: [["paddingLeft"], ["paddingRight"]],
330
+ paddingY: [["paddingTop"], ["paddingBottom"]],
331
+ margin: [
332
+ ["marginTop", "marginY"],
333
+ ["marginRight", "marginX"],
334
+ ["marginBottom", "marginY"],
335
+ ["marginLeft", "marginX"]
336
+ ],
337
+ marginX: [["marginLeft"], ["marginRight"]],
338
+ marginY: [["marginTop"], ["marginBottom"]]
339
+ }
340
+ },
341
+ colors: {
342
+ backgroundColor: "_14hor47z",
343
+ borderColor: "_14hor480",
344
+ color: "_14hor481"
345
+ },
346
+ colorVars: {
347
+ backgroundColor: "var(--_14hor47w)",
348
+ borderColor: "var(--_14hor47x)",
349
+ color: "var(--_14hor47y)"
350
+ },
351
+ sizes: {
352
+ width: "_14hor47q",
353
+ minWidth: "_14hor47r",
354
+ maxWidth: "_14hor47s",
355
+ height: "_14hor47t",
356
+ minHeight: "_14hor47u",
357
+ maxHeight: "_14hor47v"
358
+ },
359
+ sizeVars: {
360
+ width: "var(--_14hor47k)",
361
+ minWidth: "var(--_14hor47l)",
362
+ maxWidth: "var(--_14hor47m)",
363
+ height: "var(--_14hor47n)",
364
+ minHeight: "var(--_14hor47o)",
365
+ maxHeight: "var(--_14hor47p)"
366
+ }
367
+ };
368
+ export { e as stylePropsStyles };
369
+
370
+ //# sourceMappingURL=styleProps.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleProps.css.js","names":["stylePropsStyles"],"sources":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ var e=e=>e instanceof ReferenceError||e instanceof TypeError;exports.isProcessUnavailableError=e;
2
+ //# sourceMappingURL=isProcessUnavailableError.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isProcessUnavailableError.utils.cjs","names":["isProcessUnavailableError","error"],"sources":["../../../../../src/components/_common/utils/environment/isProcessUnavailableError.utils.ts"],"sourcesContent":["/**\n * Tells an error raised by reading `process.env` where Node.js globals do\n * not exist, as in a browser loading the modules without bundler: an\n * undeclared `process` raises a `ReferenceError`, a `process` without `env`\n * a `TypeError`.\n *\n * Only meaningful for an error caught around that read alone: any other\n * code in the same `try` could raise the same error types.\n *\n * @param error Error caught around a read of `process.env`.\n * @returns Whether the error comes from an unavailable `process`.\n */\nexport const isProcessUnavailableError = (error: unknown): boolean =>\n error instanceof ReferenceError || error instanceof TypeError;\n"],"mappings":"AAYA,IAAaA,EAA6B,GACtCC,aAAiB,gBAAkBA,aAAiB,U"}
@@ -0,0 +1,5 @@
1
+ // src/components/_common/utils/environment/isProcessUnavailableError.utils.ts
2
+ var e = (e) => e instanceof ReferenceError || e instanceof TypeError;
3
+ export { e as isProcessUnavailableError };
4
+
5
+ //# sourceMappingURL=isProcessUnavailableError.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isProcessUnavailableError.utils.js","names":["isProcessUnavailableError","error"],"sources":["../../../../../src/components/_common/utils/environment/isProcessUnavailableError.utils.ts"],"sourcesContent":["/**\n * Tells an error raised by reading `process.env` where Node.js globals do\n * not exist, as in a browser loading the modules without bundler: an\n * undeclared `process` raises a `ReferenceError`, a `process` without `env`\n * a `TypeError`.\n *\n * Only meaningful for an error caught around that read alone: any other\n * code in the same `try` could raise the same error types.\n *\n * @param error Error caught around a read of `process.env`.\n * @returns Whether the error comes from an unavailable `process`.\n */\nexport const isProcessUnavailableError = (error: unknown): boolean =>\n error instanceof ReferenceError || error instanceof TypeError;\n"],"mappings":";AAYA,IAAaA,KAA6B,MACtCC,aAAiB,kBAAkBA,aAAiB"}
@@ -0,0 +1,2 @@
1
+ var e=(e,t=[])=>{let n=new Map;for(let t of e){for(let e in t.suffixes)n.set(e,t);for(let e in t.shorthands)n.set(e,t)}for(let e of t)n.set(e,null);return n};exports.createStyleSet=e;
2
+ //# sourceMappingURL=createStyleSet.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStyleSet.utils.cjs","names":["createStyleSet","styleSet","table","tables","property","shorthand","prop","ignoredProps"],"sources":["../../../../../src/components/_common/utils/style-props/createStyleSet.utils.ts"],"sourcesContent":["import type {\n ClassTable,\n StyleSet,\n} from '@primitives/components/_common/types';\n\n/**\n * Indexes the class tables a component draws its token style props from,\n * once at module load: a single lookup then tells a token style prop from a\n * native one and gives its table. Style props of the library the component\n * does not accept are marked as ignored, so they are neither resolved nor\n * forwarded to the element; an ignored prop prevails over any table holding\n * it.\n *\n * @param tables Class tables of the component, whose props do not overlap.\n * @param ignoredProps Style props of the library the component ignores,\n * token, sizing or color props; none when omitted.\n * @returns The table of each longhand and shorthand prop, or `null` for an\n * ignored prop, keyed by prop.\n */\nexport const createStyleSet = (\n tables: readonly ClassTable[],\n ignoredProps: readonly string[] = [],\n): StyleSet => {\n const styleSet = new Map<string, ClassTable | null>();\n\n for (const table of tables) {\n for (const property in table.suffixes) {\n styleSet.set(property, table);\n }\n\n for (const shorthand in table.shorthands) {\n styleSet.set(shorthand, table);\n }\n }\n\n for (const prop of ignoredProps) {\n styleSet.set(prop, null);\n }\n\n return styleSet;\n};\n"],"mappings":"AAmBA,IAAaA,GACT,EACA,EAAkC,CAAC,IACxB,CACX,IAAMC,EAAW,IAAI,IAErB,IAAK,IAAMC,KAASC,EAAQ,CACxB,IAAK,IAAMC,KAAYF,EAAM,SACzBD,EAAS,IAAIG,EAAUF,CAAK,EAGhC,IAAK,IAAMG,KAAaH,EAAM,WAC1BD,EAAS,IAAII,EAAWH,CAAK,CAErC,CAEA,IAAK,IAAMI,KAAQC,EACfN,EAAS,IAAIK,EAAM,IAAI,EAG3B,OAAOL,CACX,E"}
@@ -0,0 +1,13 @@
1
+ // src/components/_common/utils/style-props/createStyleSet.utils.ts
2
+ var e = (e, t = []) => {
3
+ let n = /* @__PURE__ */ new Map();
4
+ for (let t of e) {
5
+ for (let e in t.suffixes) n.set(e, t);
6
+ for (let e in t.shorthands) n.set(e, t);
7
+ }
8
+ for (let e of t) n.set(e, null);
9
+ return n;
10
+ };
11
+ export { e as createStyleSet };
12
+
13
+ //# sourceMappingURL=createStyleSet.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStyleSet.utils.js","names":["createStyleSet","styleSet","table","tables","property","shorthand","prop","ignoredProps"],"sources":["../../../../../src/components/_common/utils/style-props/createStyleSet.utils.ts"],"sourcesContent":["import type {\n ClassTable,\n StyleSet,\n} from '@primitives/components/_common/types';\n\n/**\n * Indexes the class tables a component draws its token style props from,\n * once at module load: a single lookup then tells a token style prop from a\n * native one and gives its table. Style props of the library the component\n * does not accept are marked as ignored, so they are neither resolved nor\n * forwarded to the element; an ignored prop prevails over any table holding\n * it.\n *\n * @param tables Class tables of the component, whose props do not overlap.\n * @param ignoredProps Style props of the library the component ignores,\n * token, sizing or color props; none when omitted.\n * @returns The table of each longhand and shorthand prop, or `null` for an\n * ignored prop, keyed by prop.\n */\nexport const createStyleSet = (\n tables: readonly ClassTable[],\n ignoredProps: readonly string[] = [],\n): StyleSet => {\n const styleSet = new Map<string, ClassTable | null>();\n\n for (const table of tables) {\n for (const property in table.suffixes) {\n styleSet.set(property, table);\n }\n\n for (const shorthand in table.shorthands) {\n styleSet.set(shorthand, table);\n }\n }\n\n for (const prop of ignoredProps) {\n styleSet.set(prop, null);\n }\n\n return styleSet;\n};\n"],"mappings":";AAmBA,IAAaA,KACT,GACA,IAAkC,CAAC,MACxB;CACX,IAAMC,oBAAW,IAAI,IAA+B;CAEpD,KAAK,IAAMC,KAASC,GAAQ;EACxB,KAAK,IAAMC,KAAYF,EAAM,UACzB,EAAS,IAAIE,GAAUF,CAAK;EAGhC,KAAK,IAAMG,KAAaH,EAAM,YAC1B,EAAS,IAAIG,GAAWH,CAAK;CAErC;CAEA,KAAK,IAAMI,KAAQC,GACf,EAAS,IAAID,GAAM,IAAI;CAG3B,OAAOL;AACX"}
@@ -0,0 +1,2 @@
1
+ var e=e=>{try{return JSON.stringify(e)??String(e)}catch{return String(e)}};exports.formatStyleValue=e;
2
+ //# sourceMappingURL=formatStyleValue.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatStyleValue.utils.cjs","names":["formatStyleValue","value"],"sources":["../../../../../src/components/_common/utils/style-props/formatStyleValue.utils.ts"],"sourcesContent":["/**\n * Formats a style prop value for an error message: as JSON when possible,\n * so strings show their quotes, otherwise through `String`, for values\n * `JSON.stringify` rejects, such as a `BigInt` or a circular structure, or\n * leaves undefined, such as `undefined` or a function. Never throws.\n *\n * @param value Value given to the prop.\n * @returns The value as text.\n */\nexport const formatStyleValue = (value: unknown): string => {\n try {\n const json: string | undefined = JSON.stringify(value);\n\n return json ?? String(value);\n } catch {\n return String(value);\n }\n};\n"],"mappings":"AASA,IAAaA,EAAoB,GAA2B,CACxD,GAAI,CAGA,OAFiC,KAAK,UAAUC,CAEzC,GAAQ,OAAOA,CAAK,CAC/B,MAAQ,CACJ,OAAO,OAAOA,CAAK,CACvB,CACJ,E"}
@@ -0,0 +1,11 @@
1
+ // src/components/_common/utils/style-props/formatStyleValue.utils.ts
2
+ var e = (e) => {
3
+ try {
4
+ return JSON.stringify(e) ?? String(e);
5
+ } catch {
6
+ return String(e);
7
+ }
8
+ };
9
+ export { e as formatStyleValue };
10
+
11
+ //# sourceMappingURL=formatStyleValue.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatStyleValue.utils.js","names":["formatStyleValue","value"],"sources":["../../../../../src/components/_common/utils/style-props/formatStyleValue.utils.ts"],"sourcesContent":["/**\n * Formats a style prop value for an error message: as JSON when possible,\n * so strings show their quotes, otherwise through `String`, for values\n * `JSON.stringify` rejects, such as a `BigInt` or a circular structure, or\n * leaves undefined, such as `undefined` or a function. Never throws.\n *\n * @param value Value given to the prop.\n * @returns The value as text.\n */\nexport const formatStyleValue = (value: unknown): string => {\n try {\n const json: string | undefined = JSON.stringify(value);\n\n return json ?? String(value);\n } catch {\n return String(value);\n }\n};\n"],"mappings":";AASA,IAAaA,KAAoB,MAA2B;CACxD,IAAI;EAGA,OAFiC,KAAK,UAAUC,CAEzC,KAAQ,OAAOA,CAAK;CAC/B,QAAQ;EACJ,OAAO,OAAOA,CAAK;CACvB;AACJ"}
@@ -0,0 +1,2 @@
1
+ const e=require("../environment/isProcessUnavailableError.utils.cjs"),t=require("./logUnknownStyleValue.utils.cjs");var n=()=>{try{return process.env.NODE_ENV!==`production`}catch(t){if(e.isProcessUnavailableError(t))return!0;throw t}},r=(e,r,i,a)=>{let o=e.suffixes[r];if(o!==void 0&&(typeof i==`string`||typeof i==`number`)){let t=o[i];if(typeof t==`string`)return` ${e.prefix}${t}`}return n()&&t.logUnknownStyleValue(e,r,i,a),``};exports.getClassName=r;
2
+ //# sourceMappingURL=getClassName.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClassName.utils.cjs","names":["isProcessUnavailableError","require_isProcessUnavailableError_utils","require_logUnknownStyleValue_utils","isUnknownValueReported","error","getClassName","propertySuffixes","table","property","value","suffix","prop"],"sources":["../../../../../src/components/_common/utils/style-props/getClassName.utils.ts"],"sourcesContent":["import type { ClassTable } from '@primitives/components/_common/types';\nimport { isProcessUnavailableError } from '@primitives/components/_common/utils/environment/isProcessUnavailableError.utils';\nimport { logUnknownStyleValue } from '@primitives/components/_common/utils/style-props/logUnknownStyleValue.utils';\n\n/**\n * Tells whether an unknown style value must be reported, reading\n * `process.env.NODE_ENV` verbatim so bundlers replace it and production\n * builds drop the report. Only this read sits in the `try`, so an error\n * raised while logging is never taken for an unavailable `process`. Without\n * `process`, the environment is unknown and the value is reported.\n *\n * @returns Whether the environment is not production.\n * @throws {Error} When the read fails for another reason than an unavailable\n * `process`.\n */\nconst isUnknownValueReported = (): boolean => {\n try {\n return process.env.NODE_ENV !== 'production';\n } catch (error) {\n if (isProcessUnavailableError(error)) {\n return true;\n }\n\n throw error;\n }\n};\n\n/**\n * Looks up the atomic class of one value of a longhand property. The class\n * comes with a leading space, ready to be appended to a class list. A value\n * outside the property's set, which the prop types forbid, yields no class\n * and is ignored: outside production, an error naming the prop, the value\n * and the possible values is logged to the console, without interrupting\n * the render.\n *\n * The check reads `process.env.NODE_ENV` verbatim, right where it reports,\n * so bundlers replace it and production builds drop the report. Without\n * bundler, where `process` does not exist, the environment is unknown and\n * the value is reported.\n *\n * @param table Class table holding the property.\n * @param property Longhand property the class belongs to.\n * @param value Value given to the prop.\n * @param prop Prop the value was given to, named in the logged error: the\n * property itself or one of its shorthands.\n * @returns The class preceded by a space, or an empty string when the value\n * has no class.\n * @throws {Error} When reading `process.env.NODE_ENV` fails for another\n * reason than an unavailable `process`, or when the console fails.\n */\nexport const getClassName = (\n table: ClassTable,\n property: string,\n value: unknown,\n prop: string,\n): string => {\n const propertySuffixes = table.suffixes[property];\n\n if (\n propertySuffixes !== undefined &&\n (typeof value === 'string' || typeof value === 'number')\n ) {\n // The type check also rejects members inherited from `Object`.\n const suffix: unknown = propertySuffixes[value];\n\n if (typeof suffix === 'string') {\n return ` ${table.prefix}${suffix}`;\n }\n }\n\n if (isUnknownValueReported()) {\n logUnknownStyleValue(table, property, value, prop);\n }\n\n return '';\n};\n"],"mappings":"A,oHAeA,IAAMG,MAAwC,CAC1C,GAAI,CACA,OAAA,QAAA,IAAA,WAAgC,YACpC,OAASC,EAAO,CACZ,GAAIJ,EAAAA,0BAA0BI,CAAK,EAC/B,MAAO,GAGX,MAAMA,CACV,CACJ,EAyBaC,GACT,EACA,EACA,EACA,IACS,CACT,IAAMC,EAAmBC,EAAM,SAASC,GAExC,GACIF,IAAqB,IAAA,KACpB,OAAOG,GAAU,UAAY,OAAOA,GAAU,UACjD,CAEE,IAAMC,EAAkBJ,EAAiBG,GAEzC,GAAI,OAAOC,GAAW,SAClB,MAAO,IAAIH,EAAM,SAASG,GAElC,CAMA,OAJIP,EAAuB,GACvBD,EAAA,qBAAqBK,EAAOC,EAAUC,EAAOE,CAAI,EAG9C,EACX,E"}
@@ -0,0 +1,21 @@
1
+ import { isProcessUnavailableError as e } from "../environment/isProcessUnavailableError.utils.js";
2
+ import { logUnknownStyleValue as t } from "./logUnknownStyleValue.utils.js";
3
+ // src/components/_common/utils/style-props/getClassName.utils.ts
4
+ var n = () => {
5
+ try {
6
+ return process.env.NODE_ENV !== "production";
7
+ } catch (t) {
8
+ if (e(t)) return !0;
9
+ throw t;
10
+ }
11
+ }, r = (e, r, i, a) => {
12
+ let o = e.suffixes[r];
13
+ if (o !== void 0 && (typeof i == "string" || typeof i == "number")) {
14
+ let t = o[i];
15
+ if (typeof t == "string") return ` ${e.prefix}${t}`;
16
+ }
17
+ return n() && t(e, r, i, a), "";
18
+ };
19
+ export { r as getClassName };
20
+
21
+ //# sourceMappingURL=getClassName.utils.js.map