@traefik-labs/faency 13.7.0 → 13.7.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 (233) hide show
  1. package/README.md +12 -5
  2. package/dist/components/AriaTable/AriaTable.cjs +48 -22
  3. package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
  4. package/dist/components/AriaTable/AriaTable.js +49 -23
  5. package/dist/components/AriaTable/AriaTable.js.map +1 -1
  6. package/dist/components/AriaTable/AriaTable.vanilla.cjs +8 -4
  7. package/dist/components/AriaTable/AriaTable.vanilla.cjs.map +1 -1
  8. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs.map +1 -1
  9. package/dist/components/AriaTable/AriaTable.vanilla.css.js.map +1 -1
  10. package/dist/components/AriaTable/AriaTable.vanilla.js +8 -4
  11. package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -1
  12. package/dist/components/Avatar/Avatar.vanilla.cjs +5 -2
  13. package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -1
  14. package/dist/components/Avatar/Avatar.vanilla.css.cjs.map +1 -1
  15. package/dist/components/Avatar/Avatar.vanilla.css.js.map +1 -1
  16. package/dist/components/Avatar/Avatar.vanilla.js +5 -2
  17. package/dist/components/Avatar/Avatar.vanilla.js.map +1 -1
  18. package/dist/components/Badge/Badge.vanilla.cjs +2 -10
  19. package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
  20. package/dist/components/Badge/Badge.vanilla.css.cjs.map +1 -1
  21. package/dist/components/Badge/Badge.vanilla.css.js.map +1 -1
  22. package/dist/components/Badge/Badge.vanilla.js +2 -10
  23. package/dist/components/Badge/Badge.vanilla.js.map +1 -1
  24. package/dist/components/Blockquote/Blockquote.vanilla.cjs +5 -11
  25. package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
  26. package/dist/components/Blockquote/Blockquote.vanilla.css.cjs.map +1 -1
  27. package/dist/components/Blockquote/Blockquote.vanilla.css.js.map +1 -1
  28. package/dist/components/Blockquote/Blockquote.vanilla.js +5 -11
  29. package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
  30. package/dist/components/Box/Box.vanilla.cjs +2 -10
  31. package/dist/components/Box/Box.vanilla.cjs.map +1 -1
  32. package/dist/components/Box/Box.vanilla.css.cjs.map +1 -1
  33. package/dist/components/Box/Box.vanilla.css.js.map +1 -1
  34. package/dist/components/Box/Box.vanilla.js +2 -10
  35. package/dist/components/Box/Box.vanilla.js.map +1 -1
  36. package/dist/components/Bubble/Bubble.vanilla.cjs +2 -10
  37. package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
  38. package/dist/components/Bubble/Bubble.vanilla.css.cjs.map +1 -1
  39. package/dist/components/Bubble/Bubble.vanilla.css.js.map +1 -1
  40. package/dist/components/Bubble/Bubble.vanilla.js +2 -10
  41. package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
  42. package/dist/components/Button/Button.vanilla.cjs +2 -10
  43. package/dist/components/Button/Button.vanilla.cjs.map +1 -1
  44. package/dist/components/Button/Button.vanilla.css.cjs.map +1 -1
  45. package/dist/components/Button/Button.vanilla.css.js.map +1 -1
  46. package/dist/components/Button/Button.vanilla.js +2 -10
  47. package/dist/components/Button/Button.vanilla.js.map +1 -1
  48. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +3 -17
  49. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
  50. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.css.cjs.map +1 -1
  51. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.css.js.map +1 -1
  52. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +3 -17
  53. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
  54. package/dist/components/Card/Card.vanilla.cjs +6 -11
  55. package/dist/components/Card/Card.vanilla.cjs.map +1 -1
  56. package/dist/components/Card/Card.vanilla.css.cjs.map +1 -1
  57. package/dist/components/Card/Card.vanilla.css.js.map +1 -1
  58. package/dist/components/Card/Card.vanilla.js +6 -11
  59. package/dist/components/Card/Card.vanilla.js.map +1 -1
  60. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -6
  61. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
  62. package/dist/components/CodeBlock/CodeBlock.vanilla.css.cjs.map +1 -1
  63. package/dist/components/CodeBlock/CodeBlock.vanilla.css.js.map +1 -1
  64. package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -6
  65. package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
  66. package/dist/components/Combobox/Combobox.vanilla.cjs +3 -10
  67. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
  68. package/dist/components/Combobox/Combobox.vanilla.css.cjs.map +1 -1
  69. package/dist/components/Combobox/Combobox.vanilla.css.js.map +1 -1
  70. package/dist/components/Combobox/Combobox.vanilla.js +3 -10
  71. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
  72. package/dist/components/Container/Container.vanilla.cjs +5 -11
  73. package/dist/components/Container/Container.vanilla.cjs.map +1 -1
  74. package/dist/components/Container/Container.vanilla.css.cjs.map +1 -1
  75. package/dist/components/Container/Container.vanilla.css.js.map +1 -1
  76. package/dist/components/Container/Container.vanilla.js +5 -11
  77. package/dist/components/Container/Container.vanilla.js.map +1 -1
  78. package/dist/components/Elevation/Elevation.vanilla.cjs +5 -11
  79. package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
  80. package/dist/components/Elevation/Elevation.vanilla.css.cjs.map +1 -1
  81. package/dist/components/Elevation/Elevation.vanilla.css.js.map +1 -1
  82. package/dist/components/Elevation/Elevation.vanilla.js +5 -11
  83. package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
  84. package/dist/components/Field/Field.vanilla.cjs +3 -9
  85. package/dist/components/Field/Field.vanilla.cjs.map +1 -1
  86. package/dist/components/Field/Field.vanilla.css.cjs.map +1 -1
  87. package/dist/components/Field/Field.vanilla.css.js.map +1 -1
  88. package/dist/components/Field/Field.vanilla.js +3 -9
  89. package/dist/components/Field/Field.vanilla.js.map +1 -1
  90. package/dist/components/Flex/Flex.vanilla.cjs +5 -11
  91. package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
  92. package/dist/components/Flex/Flex.vanilla.css.cjs.map +1 -1
  93. package/dist/components/Flex/Flex.vanilla.css.js.map +1 -1
  94. package/dist/components/Flex/Flex.vanilla.js +5 -11
  95. package/dist/components/Flex/Flex.vanilla.js.map +1 -1
  96. package/dist/components/Grid/Grid.vanilla.cjs +7 -11
  97. package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
  98. package/dist/components/Grid/Grid.vanilla.css.cjs.map +1 -1
  99. package/dist/components/Grid/Grid.vanilla.css.js.map +1 -1
  100. package/dist/components/Grid/Grid.vanilla.js +7 -11
  101. package/dist/components/Grid/Grid.vanilla.js.map +1 -1
  102. package/dist/components/Heading/Heading.vanilla.cjs +35 -0
  103. package/dist/components/Heading/Heading.vanilla.cjs.map +1 -0
  104. package/dist/components/Heading/Heading.vanilla.css.cjs +85 -0
  105. package/dist/components/Heading/Heading.vanilla.css.cjs.map +1 -0
  106. package/dist/components/Heading/Heading.vanilla.css.js +74 -0
  107. package/dist/components/Heading/Heading.vanilla.css.js.map +1 -0
  108. package/dist/components/Heading/Heading.vanilla.js +30 -0
  109. package/dist/components/Heading/Heading.vanilla.js.map +1 -0
  110. package/dist/components/IconButton/IconButton.vanilla.cjs +5 -11
  111. package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
  112. package/dist/components/IconButton/IconButton.vanilla.css.cjs.map +1 -1
  113. package/dist/components/IconButton/IconButton.vanilla.css.js.map +1 -1
  114. package/dist/components/IconButton/IconButton.vanilla.js +5 -11
  115. package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
  116. package/dist/components/Image/Image.vanilla.cjs +2 -10
  117. package/dist/components/Image/Image.vanilla.cjs.map +1 -1
  118. package/dist/components/Image/Image.vanilla.css.cjs.map +1 -1
  119. package/dist/components/Image/Image.vanilla.css.js.map +1 -1
  120. package/dist/components/Image/Image.vanilla.js +2 -10
  121. package/dist/components/Image/Image.vanilla.js.map +1 -1
  122. package/dist/components/Input/Input.vanilla.cjs +2 -10
  123. package/dist/components/Input/Input.vanilla.cjs.map +1 -1
  124. package/dist/components/Input/Input.vanilla.css.cjs.map +1 -1
  125. package/dist/components/Input/Input.vanilla.css.js.map +1 -1
  126. package/dist/components/Input/Input.vanilla.js +2 -10
  127. package/dist/components/Input/Input.vanilla.js.map +1 -1
  128. package/dist/components/Label/Label.vanilla.cjs +5 -11
  129. package/dist/components/Label/Label.vanilla.cjs.map +1 -1
  130. package/dist/components/Label/Label.vanilla.css.cjs.map +1 -1
  131. package/dist/components/Label/Label.vanilla.css.js.map +1 -1
  132. package/dist/components/Label/Label.vanilla.js +5 -11
  133. package/dist/components/Label/Label.vanilla.js.map +1 -1
  134. package/dist/components/List/List.vanilla.cjs +10 -18
  135. package/dist/components/List/List.vanilla.cjs.map +1 -1
  136. package/dist/components/List/List.vanilla.css.cjs.map +1 -1
  137. package/dist/components/List/List.vanilla.css.js.map +1 -1
  138. package/dist/components/List/List.vanilla.js +7 -15
  139. package/dist/components/List/List.vanilla.js.map +1 -1
  140. package/dist/components/Meter/Meter.vanilla.cjs +3 -8
  141. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
  142. package/dist/components/Meter/Meter.vanilla.css.cjs.map +1 -1
  143. package/dist/components/Meter/Meter.vanilla.css.js.map +1 -1
  144. package/dist/components/Meter/Meter.vanilla.js +3 -8
  145. package/dist/components/Meter/Meter.vanilla.js.map +1 -1
  146. package/dist/components/Panel/Panel.vanilla.cjs +2 -10
  147. package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
  148. package/dist/components/Panel/Panel.vanilla.css.cjs.map +1 -1
  149. package/dist/components/Panel/Panel.vanilla.css.js.map +1 -1
  150. package/dist/components/Panel/Panel.vanilla.js +2 -10
  151. package/dist/components/Panel/Panel.vanilla.js.map +1 -1
  152. package/dist/components/Paragraph/Paragraph.vanilla.cjs +5 -11
  153. package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
  154. package/dist/components/Paragraph/Paragraph.vanilla.css.cjs.map +1 -1
  155. package/dist/components/Paragraph/Paragraph.vanilla.css.js.map +1 -1
  156. package/dist/components/Paragraph/Paragraph.vanilla.js +5 -11
  157. package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
  158. package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -1
  159. package/dist/components/RowLink/RowLink.vanilla.css.cjs.map +1 -1
  160. package/dist/components/RowLink/RowLink.vanilla.css.js.map +1 -1
  161. package/dist/components/RowLink/RowLink.vanilla.js.map +1 -1
  162. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -14
  163. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
  164. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.cjs.map +1 -1
  165. package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.js.map +1 -1
  166. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -14
  167. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
  168. package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -10
  169. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  170. package/dist/components/Skeleton/Skeleton.vanilla.css.cjs.map +1 -1
  171. package/dist/components/Skeleton/Skeleton.vanilla.css.js.map +1 -1
  172. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -10
  173. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  174. package/dist/components/Spinner/Spinner.vanilla.cjs +3 -6
  175. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  176. package/dist/components/Spinner/Spinner.vanilla.css.cjs.map +1 -1
  177. package/dist/components/Spinner/Spinner.vanilla.css.js.map +1 -1
  178. package/dist/components/Spinner/Spinner.vanilla.js +3 -6
  179. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  180. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +3 -10
  181. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  182. package/dist/components/SplitLayout/SplitLayout.vanilla.css.cjs.map +1 -1
  183. package/dist/components/SplitLayout/SplitLayout.vanilla.css.js.map +1 -1
  184. package/dist/components/SplitLayout/SplitLayout.vanilla.js +3 -10
  185. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  186. package/dist/components/Table/Table.vanilla.cjs +8 -4
  187. package/dist/components/Table/Table.vanilla.cjs.map +1 -1
  188. package/dist/components/Table/Table.vanilla.css.cjs.map +1 -1
  189. package/dist/components/Table/Table.vanilla.css.js.map +1 -1
  190. package/dist/components/Table/Table.vanilla.js +8 -4
  191. package/dist/components/Table/Table.vanilla.js.map +1 -1
  192. package/dist/components/Text/Text.vanilla.cjs +5 -11
  193. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  194. package/dist/components/Text/Text.vanilla.css.cjs.map +1 -1
  195. package/dist/components/Text/Text.vanilla.css.js.map +1 -1
  196. package/dist/components/Text/Text.vanilla.js +5 -11
  197. package/dist/components/Text/Text.vanilla.js.map +1 -1
  198. package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
  199. package/dist/components/TextField/TextField.vanilla.css.cjs.map +1 -1
  200. package/dist/components/TextField/TextField.vanilla.css.js.map +1 -1
  201. package/dist/components/TextField/TextField.vanilla.js.map +1 -1
  202. package/dist/components/Textarea/Textarea.vanilla.cjs +2 -10
  203. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  204. package/dist/components/Textarea/Textarea.vanilla.css.cjs.map +1 -1
  205. package/dist/components/Textarea/Textarea.vanilla.css.js.map +1 -1
  206. package/dist/components/Textarea/Textarea.vanilla.js +2 -10
  207. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  208. package/dist/components/Toast/Toast.vanilla.cjs +4 -15
  209. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  210. package/dist/components/Toast/Toast.vanilla.css.cjs.map +1 -1
  211. package/dist/components/Toast/Toast.vanilla.css.js.map +1 -1
  212. package/dist/components/Toast/Toast.vanilla.js +4 -15
  213. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  214. package/dist/faency.css +118 -2
  215. package/dist/index.cjs +9 -0
  216. package/dist/index.d.cts +36800 -0
  217. package/dist/index.d.ts +248 -94
  218. package/dist/index.js +3 -1
  219. package/dist/styles/recipeVariants.cjs +15 -0
  220. package/dist/styles/recipeVariants.cjs.map +1 -0
  221. package/dist/styles/recipeVariants.js +15 -0
  222. package/dist/styles/recipeVariants.js.map +1 -0
  223. package/dist/styles/themeContext.cjs.map +1 -1
  224. package/dist/styles/themeContext.js.map +1 -1
  225. package/dist/styles/themes.css.cjs.map +1 -1
  226. package/dist/styles/themes.css.js.map +1 -1
  227. package/dist/styles/tokens.css.cjs.map +1 -1
  228. package/dist/styles/tokens.css.js.map +1 -1
  229. package/dist/utils/warnOnce.cjs +8 -1
  230. package/dist/utils/warnOnce.cjs.map +1 -1
  231. package/dist/utils/warnOnce.js +8 -1
  232. package/dist/utils/warnOnce.js.map +1 -1
  233. package/package.json +32 -22
@@ -1,21 +1,10 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
3
  import { segmentedControlItemRecipe, segmentedControlRecipe } from "./SegmentedControl.vanilla.css.js";
5
4
  import { createContext, forwardRef, useContext } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
5
  import { jsx } from "react/jsx-runtime";
8
6
  import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
9
7
  // components/SegmentedControl/SegmentedControl.vanilla.tsx
10
- var useCssProp = (css, style) => {
11
- const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
13
- return {
14
- ...cssStyles,
15
- ...style,
16
- ...assignInlineVars(vars)
17
- };
18
- };
19
8
  var SegmentedControlContext = createContext({
20
9
  size: "medium",
21
10
  fullWidth: false
@@ -29,7 +18,7 @@ var SegmentedControlVanilla = forwardRef(({ size = "medium", fullWidth = false,
29
18
  ref,
30
19
  orientation: "horizontal",
31
20
  className: cx(segmentedControlRecipe({ fullWidth }), className),
32
- style: useCssProp(css, style),
21
+ style: useInlineStyle(css, style),
33
22
  ...props,
34
23
  children
35
24
  })
@@ -43,7 +32,7 @@ var SegmentedControlItemVanilla = forwardRef(({ className, css, style, ...props
43
32
  size,
44
33
  fullWidth
45
34
  }), className),
46
- style: useCssProp(css, style),
35
+ style: useInlineStyle(css, style),
47
36
  ...props
48
37
  });
49
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.vanilla.js","names":[],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ComponentPropsWithoutRef, createContext, forwardRef, useContext } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport {\n segmentedControlItemRecipe,\n segmentedControlRecipe,\n SegmentedControlSize,\n} from './SegmentedControl.vanilla.css';\n\nexport type { SegmentedControlSize };\n\nconst useCssProp = (css: CSSProps['css'], style?: React.CSSProperties) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n return { ...cssStyles, ...style, ...assignInlineVars(vars) };\n};\n\nconst SegmentedControlContext = createContext<{\n size: SegmentedControlSize;\n fullWidth: boolean;\n}>({ size: 'medium', fullWidth: false });\n\nexport interface SegmentedControlVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'asChild'>, CSSProps {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}\n\nexport const SegmentedControlVanilla = forwardRef<HTMLDivElement, SegmentedControlVanillaProps>(\n ({ size = 'medium', fullWidth = false, className, css, style, children, ...props }, ref) => (\n <SegmentedControlContext.Provider value={{ size, fullWidth }}>\n <RadioGroupPrimitive.Root\n ref={ref}\n orientation=\"horizontal\"\n className={cx(segmentedControlRecipe({ fullWidth }), className)}\n style={useCssProp(css, style)}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n </SegmentedControlContext.Provider>\n ),\n);\n\nSegmentedControlVanilla.displayName = 'SegmentedControlVanilla';\n\nexport interface SegmentedControlItemVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'>, CSSProps {}\n\nexport const SegmentedControlItemVanilla = forwardRef<\n HTMLButtonElement,\n SegmentedControlItemVanillaProps\n>(({ className, css, style, ...props }, ref) => {\n const { size, fullWidth } = useContext(SegmentedControlContext);\n\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cx(segmentedControlItemRecipe({ size, fullWidth }), className)}\n style={useCssProp(css, style)}\n {...props}\n />\n );\n});\n\nSegmentedControlItemVanilla.displayName = 'SegmentedControlItemVanilla';\n"],"mappings":";;;;;;;;;AAeA,IAAM,cAAc,KAAsB,UAAgC;CACxE,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,OAAO;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;AAC7D;AAEA,IAAM,0BAA0B,cAG7B;CAAE,MAAM;CAAU,WAAW;AAAM,CAAC;AAQvC,IAAa,0BAA0B,YACpC,EAAE,OAAO,UAAU,YAAY,OAAO,WAAW,KAAK,OAAO,UAAU,GAAG,SAAS,QAClF,oBAAC,wBAAwB,UAAzB;CAAkC,OAAO;EAAE;EAAM;CAAU;CACzD,UAAA,oBAAC,oBAAoB,MAArB;EACO;EACL,aAAY;EACZ,WAAW,GAAG,uBAAuB,EAAE,UAAU,CAAC,GAAG,SAAS;EAC9D,OAAO,WAAW,KAAK,KAAK;EAC5B,GAAI;EAEH;CACuB,CAAA;AACM,CAAA,CAEtC;AAEA,wBAAwB,cAAc;AAKtC,IAAa,8BAA8B,YAGxC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC9C,MAAM,EAAE,MAAM,cAAc,WAAW,uBAAuB;CAE9D,OACE,oBAAC,oBAAoB,MAArB;EACO;EACL,WAAW,GAAG,2BAA2B;GAAE;GAAM;EAAU,CAAC,GAAG,SAAS;EACxE,OAAO,WAAW,KAAK,KAAK;EAC5B,GAAI;CACL,CAAA;AAEL,CAAC;AAED,4BAA4B,cAAc"}
1
+ {"version":3,"file":"SegmentedControl.vanilla.js","names":[],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport React, { ComponentPropsWithoutRef, createContext, forwardRef, useContext } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport {\n segmentedControlItemRecipe,\n segmentedControlRecipe,\n SegmentedControlSize,\n} from './SegmentedControl.vanilla.css';\n\nexport type { SegmentedControlSize };\n\nconst SegmentedControlContext = createContext<{\n size: SegmentedControlSize;\n fullWidth: boolean;\n}>({ size: 'medium', fullWidth: false });\n\nexport interface SegmentedControlVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'asChild'>, CSSProps {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}\n\nexport const SegmentedControlVanilla = forwardRef<HTMLDivElement, SegmentedControlVanillaProps>(\n ({ size = 'medium', fullWidth = false, className, css, style, children, ...props }, ref) => (\n <SegmentedControlContext.Provider value={{ size, fullWidth }}>\n <RadioGroupPrimitive.Root\n ref={ref}\n orientation=\"horizontal\"\n className={cx(segmentedControlRecipe({ fullWidth }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n </SegmentedControlContext.Provider>\n ),\n);\n\nSegmentedControlVanilla.displayName = 'SegmentedControlVanilla';\n\nexport interface SegmentedControlItemVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'>, CSSProps {}\n\nexport const SegmentedControlItemVanilla = forwardRef<\n HTMLButtonElement,\n SegmentedControlItemVanillaProps\n>(({ className, css, style, ...props }, ref) => {\n const { size, fullWidth } = useContext(SegmentedControlContext);\n\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cx(segmentedControlItemRecipe({ size, fullWidth }), className)}\n style={useInlineStyle(css, style)}\n {...props}\n />\n );\n});\n\nSegmentedControlItemVanilla.displayName = 'SegmentedControlItemVanilla';\n"],"mappings":";;;;;;;AAeA,IAAM,0BAA0B,cAG7B;CAAE,MAAM;CAAU,WAAW;AAAM,CAAC;AAQvC,IAAa,0BAA0B,YACpC,EAAE,OAAO,UAAU,YAAY,OAAO,WAAW,KAAK,OAAO,UAAU,GAAG,SAAS,QAClF,oBAAC,wBAAwB,UAAzB;CAAkC,OAAO;EAAE;EAAM;CAAU;CACzD,UAAA,oBAAC,oBAAoB,MAArB;EACO;EACL,aAAY;EACZ,WAAW,GAAG,uBAAuB,EAAE,UAAU,CAAC,GAAG,SAAS;EAC9D,OAAO,eAAe,KAAK,KAAK;EAChC,GAAI;EAEH;CACuB,CAAA;AACM,CAAA,CAEtC;AAEA,wBAAwB,cAAc;AAKtC,IAAa,8BAA8B,YAGxC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC9C,MAAM,EAAE,MAAM,cAAc,WAAW,uBAAuB;CAE9D,OACE,oBAAC,oBAAoB,MAArB;EACO;EACL,WAAW,GAAG,2BAA2B;GAAE;GAAM;EAAU,CAAC,GAAG,SAAS;EACxE,OAAO,eAAe,KAAK,KAAK;EAChC,GAAI;CACL,CAAA;AAEL,CAAC;AAED,4BAA4B,cAAc"}
@@ -1,20 +1,12 @@
1
- const require_cssProps = require("../../styles/cssProps.cjs");
2
1
  const require_cx = require("../../styles/cx.cjs");
3
- const require_themeContext = require("../../styles/themeContext.cjs");
2
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
4
3
  const require_Skeleton_vanilla_css = require("./Skeleton.vanilla.css.cjs");
5
4
  let react = require("react");
6
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
7
5
  let react_jsx_runtime = require("react/jsx-runtime");
8
6
  // components/Skeleton/Skeleton.vanilla.tsx
9
7
  var SkeletonVanillaImpl = (0, react.forwardRef)(({ as, className, css, style, variant, ...props }, ref) => {
10
8
  const Component = as || "div";
11
- const { colors } = require_themeContext.useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
17
- };
9
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
18
10
  const recipeClass = require_Skeleton_vanilla_css.skeletonRecipe({ variant });
19
11
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
20
12
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","skeletonRecipe","cx"],"sources":["../../../components/Skeleton/Skeleton.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { skeletonRecipe } from './Skeleton.vanilla.css';\n\ntype SkeletonRecipeVariants = NonNullable<RecipeVariants<typeof skeletonRecipe>>;\n\ninterface SkeletonVanillaOwnProps extends SkeletonRecipeVariants, CSSProps {}\n\nexport type SkeletonVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SkeletonVanillaOwnProps\n>;\n\ntype SkeletonVanillaComponent = PolymorphicComponent<'div', SkeletonVanillaProps<ElementType>>;\n\nconst SkeletonVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: SkeletonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = skeletonRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nSkeletonVanillaImpl.displayName = 'SkeletonVanilla';\n\nexport const SkeletonVanilla = SkeletonVanillaImpl as SkeletonVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,uBAAA,GAAsBA,MAAAA,WAAAA,EAExB,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,cAAcC,6BAAAA,eAAe,EAAE,QAAQ,CAAC;CAE9C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,oBAAoB,cAAc;AAElC,IAAa,kBAAkB"}
1
+ {"version":3,"file":"Skeleton.vanilla.cjs","names":["forwardRef","useInlineStyle","skeletonRecipe","cx"],"sources":["../../../components/Skeleton/Skeleton.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { skeletonRecipe } from './Skeleton.vanilla.css';\n\ntype SkeletonRecipeVariants = RecipeVariantProps<typeof skeletonRecipe>;\n\ninterface SkeletonVanillaOwnProps extends SkeletonRecipeVariants, CSSProps {}\n\nexport type SkeletonVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SkeletonVanillaOwnProps\n>;\n\ntype SkeletonVanillaComponent = PolymorphicComponent<'div', SkeletonVanillaProps<ElementType>>;\n\nconst SkeletonVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: SkeletonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = skeletonRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nSkeletonVanillaImpl.displayName = 'SkeletonVanilla';\n\nexport const SkeletonVanilla = SkeletonVanillaImpl as SkeletonVanillaComponent;\n"],"mappings":";;;;;;AAyBA,IAAM,uBAAA,GAAsBA,MAAAA,WAAAA,EAExB,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAcC,6BAAAA,eAAe,EAAE,QAAQ,CAAC;CAE9C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,oBAAoB,cAAc;AAElC,IAAa,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Skeleton/Skeleton.vanilla.css.ts"],"sourcesContent":["import { globalStyle, keyframes, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\nconst pulse = keyframes({\n '0%': { opacity: 0 },\n '100%': { opacity: 1 },\n});\n\nconst skeletonBase = style({\n backgroundColor: tokens.colors.skeletonBackground,\n position: 'relative',\n overflow: 'hidden',\n borderRadius: '3px',\n height: 'auto',\n width: 'auto',\n\n selectors: {\n '&:not(:empty)': {\n maxWidth: 'fit-content',\n },\n },\n\n '::after': {\n animationName: pulse,\n animationDuration: '500ms',\n animationDirection: 'alternate',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'ease-in-out',\n backgroundColor: tokens.colors.skeletonAnimation,\n borderRadius: 'inherit',\n bottom: 0,\n content: '\"\"',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n});\n\nglobalStyle(`${skeletonBase}::after`, {\n '@media': {\n [breakpoints.motion]: {\n animation: 'none',\n opacity: 0,\n },\n },\n});\n\n// Global styles for child elements inside skeleton\nglobalStyle(`${skeletonBase}:not(:empty) > *`, {\n visibility: 'hidden',\n display: 'block',\n});\n\nexport const skeletonRecipe = recipe({\n base: skeletonBase,\n\n variants: {\n variant: {\n square: {\n borderRadius: tokens.radii['2'],\n },\n circle: {\n borderRadius: tokens.radii.round,\n },\n badge: {\n borderRadius: tokens.radii.pill,\n display: 'inline-flex',\n },\n button: {\n borderRadius: tokens.radii['3'],\n display: 'inline-flex',\n },\n text: {\n selectors: {\n '&:empty::before': {\n content: '\"\\\\00a0\"',\n },\n },\n },\n },\n },\n\n defaultVariants: {\n variant: 'text',\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Skeleton.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Skeleton/Skeleton.vanilla.css.ts"],"sourcesContent":["import { globalStyle, keyframes, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\nconst pulse = keyframes({\n '0%': { opacity: 0 },\n '100%': { opacity: 1 },\n});\n\nconst skeletonBase = style({\n backgroundColor: tokens.colors.skeletonBackground,\n position: 'relative',\n overflow: 'hidden',\n borderRadius: '3px',\n height: 'auto',\n width: 'auto',\n\n selectors: {\n '&:not(:empty)': {\n maxWidth: 'fit-content',\n },\n },\n\n '::after': {\n animationName: pulse,\n animationDuration: '500ms',\n animationDirection: 'alternate',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'ease-in-out',\n backgroundColor: tokens.colors.skeletonAnimation,\n borderRadius: 'inherit',\n bottom: 0,\n content: '\"\"',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n});\n\nglobalStyle(`${skeletonBase}::after`, {\n '@media': {\n [breakpoints.motion]: {\n animation: 'none',\n opacity: 0,\n },\n },\n});\n\n// Global styles for child elements inside skeleton\nglobalStyle(`${skeletonBase}:not(:empty) > *`, {\n visibility: 'hidden',\n display: 'block',\n});\n\nexport const skeletonRecipe = recipe({\n base: skeletonBase,\n\n variants: {\n variant: {\n square: {\n borderRadius: tokens.radii['2'],\n },\n circle: {\n borderRadius: tokens.radii.round,\n },\n badge: {\n borderRadius: tokens.radii.pill,\n display: 'inline-flex',\n },\n button: {\n borderRadius: tokens.radii['3'],\n display: 'inline-flex',\n },\n text: {\n selectors: {\n '&:empty::before': {\n content: '\"\\\\00a0\"',\n },\n },\n },\n },\n },\n\n defaultVariants: {\n variant: 'text',\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Skeleton.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,20 +1,12 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
3
  import { skeletonRecipe } from "./Skeleton.vanilla.css.js";
5
4
  import { forwardRef } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
5
  import { jsx } from "react/jsx-runtime";
8
6
  // components/Skeleton/Skeleton.vanilla.tsx
9
7
  var SkeletonVanillaImpl = forwardRef(({ as, className, css, style, variant, ...props }, ref) => {
10
8
  const Component = as || "div";
11
- const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...assignInlineVars(vars)
17
- };
9
+ const mergedStyles = useInlineStyle(css, style);
18
10
  const recipeClass = skeletonRecipe({ variant });
19
11
  return /* @__PURE__ */ jsx(Component, {
20
12
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.vanilla.js","names":[],"sources":["../../../components/Skeleton/Skeleton.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { skeletonRecipe } from './Skeleton.vanilla.css';\n\ntype SkeletonRecipeVariants = NonNullable<RecipeVariants<typeof skeletonRecipe>>;\n\ninterface SkeletonVanillaOwnProps extends SkeletonRecipeVariants, CSSProps {}\n\nexport type SkeletonVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SkeletonVanillaOwnProps\n>;\n\ntype SkeletonVanillaComponent = PolymorphicComponent<'div', SkeletonVanillaProps<ElementType>>;\n\nconst SkeletonVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: SkeletonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = skeletonRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nSkeletonVanillaImpl.displayName = 'SkeletonVanilla';\n\nexport const SkeletonVanilla = SkeletonVanillaImpl as SkeletonVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,sBAAsB,YAExB,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,eAAe,EAAE,QAAQ,CAAC;CAE9C,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,oBAAoB,cAAc;AAElC,IAAa,kBAAkB"}
1
+ {"version":3,"file":"Skeleton.vanilla.js","names":[],"sources":["../../../components/Skeleton/Skeleton.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport type { RecipeVariantProps } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { skeletonRecipe } from './Skeleton.vanilla.css';\n\ntype SkeletonRecipeVariants = RecipeVariantProps<typeof skeletonRecipe>;\n\ninterface SkeletonVanillaOwnProps extends SkeletonRecipeVariants, CSSProps {}\n\nexport type SkeletonVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SkeletonVanillaOwnProps\n>;\n\ntype SkeletonVanillaComponent = PolymorphicComponent<'div', SkeletonVanillaProps<ElementType>>;\n\nconst SkeletonVanillaImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, variant, ...props }: SkeletonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = skeletonRecipe({ variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nSkeletonVanillaImpl.displayName = 'SkeletonVanilla';\n\nexport const SkeletonVanilla = SkeletonVanillaImpl as SkeletonVanillaComponent;\n"],"mappings":";;;;;;AAyBA,IAAM,sBAAsB,YAExB,EAAE,IAAI,WAAW,KAAK,OAAO,SAAS,GAAG,SACzC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,eAAe,EAAE,QAAQ,CAAC;CAE9C,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,oBAAoB,cAAc;AAElC,IAAa,kBAAkB"}
@@ -1,17 +1,16 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
- const require_cssProps = require("../../styles/cssProps.cjs");
3
2
  const require_cx = require("../../styles/cx.cjs");
4
3
  const require_resolveColor = require("../../styles/resolveColor.cjs");
5
4
  const require_themeContext = require("../../styles/themeContext.cjs");
5
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
6
6
  const require_Spinner_vanilla_css = require("./Spinner.vanilla.css.cjs");
7
7
  let react = require("react");
8
8
  react = require_runtime.__toESM(react, 1);
9
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
10
9
  let react_jsx_runtime = require("react/jsx-runtime");
11
10
  // components/Spinner/Spinner.vanilla.tsx
12
11
  var SpinnerVanilla = (0, react.forwardRef)(({ size, color, label = "Loading", className, css, style, ...props }, ref) => {
13
12
  const { colors } = require_themeContext.useVanillaExtractTheme();
14
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
13
+ const inlineStyle = require_useInlineStyle.useInlineStyle(css, style);
15
14
  const colorStyle = color ? { color: require_resolveColor.resolveColor(color, colors) } : void 0;
16
15
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
17
16
  ref,
@@ -19,9 +18,7 @@ var SpinnerVanilla = (0, react.forwardRef)(({ size, color, label = "Loading", cl
19
18
  className: require_cx.cx(require_Spinner_vanilla_css.spinnerRecipe({ size }), className),
20
19
  style: {
21
20
  ...colorStyle,
22
- ...cssStyles,
23
- ...style,
24
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
21
+ ...inlineStyle
25
22
  },
26
23
  ...props,
27
24
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","resolveColor","cx","spinnerRecipe","assignInlineVars","svg","track","hiddenLabel"],"sources":["../../../components/Spinner/Spinner.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { resolveColor } from '../../styles/resolveColor';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { hiddenLabel, spinnerRecipe, svg, track } from './Spinner.vanilla.css';\n\nexport type SpinnerVanillaProps = Omit<\n React.HTMLAttributes<HTMLSpanElement>,\n 'children' | 'color'\n> &\n CSSProps & {\n size?: 'small' | 'medium' | 'large';\n /** A color token such as `$toneSuccessSolid` or `$gray11`, any CSS color, or `currentColor`. Defaults to primary. */\n color?: string;\n /** Announced to screen readers. */\n label?: string;\n };\n\nexport const SpinnerVanilla = forwardRef<HTMLSpanElement, SpinnerVanillaProps>(\n ({ size, color, label = 'Loading', className, css, style, ...props }, ref) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const colorStyle = color ? { color: resolveColor(color, colors) } : undefined;\n\n return (\n <span\n ref={ref}\n role=\"status\"\n className={cx(spinnerRecipe({ size }), className)}\n style={{ ...colorStyle, ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n <svg\n className={svg}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n <circle className={track} cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 1 9 9\" />\n </svg>\n <span className={hiddenLabel}>{label}</span>\n </span>\n );\n },\n);\n\nSpinnerVanilla.displayName = 'SpinnerVanilla';\n"],"mappings":";;;;;;;;;;;AAqBA,IAAa,kBAAA,GAAiBA,MAAAA,WAAAA,EAC3B,EAAE,MAAM,OAAO,QAAQ,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC5E,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,aAAa,QAAQ,EAAE,OAAOC,qBAAAA,aAAa,OAAO,MAAM,EAAE,IAAI,KAAA;CAEpE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EACO;EACL,MAAK;EACL,WAAWC,WAAAA,GAAGC,4BAAAA,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS;EAChD,OAAO;GAAE,GAAG;GAAY,GAAG;GAAW,GAAG;GAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;EAAE;EAC1E,GAAI;EALN,UAAA,CAOE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GACE,WAAWC,4BAAAA;GACX,SAAQ;GACR,MAAK;GACL,QAAO;GACP,aAAa;GACb,eAAc;GACd,eAAA;GACA,WAAU;GARZ,UAAA,CAUE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,WAAWC,4BAAAA;IAAO,IAAG;IAAK,IAAG;IAAK,GAAE;GAAK,CAAA,GACjD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,GAAE,sBAAuB,CAAA,CAC5B;EACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAWC,4BAAAA;GAAc,UAAA;EAAY,CAAA,CACvC;;AAEV,CACF;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"Spinner.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","useInlineStyle","resolveColor","cx","spinnerRecipe","svg","track","hiddenLabel"],"sources":["../../../components/Spinner/Spinner.vanilla.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { resolveColor } from '@/styles/resolveColor';\nimport { useVanillaExtractTheme } from '@/styles/themeContext';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { hiddenLabel, spinnerRecipe, svg, track } from './Spinner.vanilla.css';\n\nexport type SpinnerVanillaProps = Omit<\n React.HTMLAttributes<HTMLSpanElement>,\n 'children' | 'color'\n> &\n CSSProps & {\n size?: 'small' | 'medium' | 'large';\n /** A color token such as `$toneSuccessSolid` or `$gray11`, any CSS color, or `currentColor`. Defaults to primary. */\n color?: string;\n /** Announced to screen readers. */\n label?: string;\n };\n\nexport const SpinnerVanilla = forwardRef<HTMLSpanElement, SpinnerVanillaProps>(\n ({ size, color, label = 'Loading', className, css, style, ...props }, ref) => {\n const { colors } = useVanillaExtractTheme();\n const inlineStyle = useInlineStyle(css, style);\n const colorStyle = color ? { color: resolveColor(color, colors) } : undefined;\n\n return (\n <span\n ref={ref}\n role=\"status\"\n className={cx(spinnerRecipe({ size }), className)}\n style={{ ...colorStyle, ...inlineStyle }}\n {...props}\n >\n <svg\n className={svg}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n <circle className={track} cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 1 9 9\" />\n </svg>\n <span className={hiddenLabel}>{label}</span>\n </span>\n );\n },\n);\n\nSpinnerVanilla.displayName = 'SpinnerVanilla';\n"],"mappings":";;;;;;;;;;AAsBA,IAAa,kBAAA,GAAiBA,MAAAA,WAAAA,EAC3B,EAAE,MAAM,OAAO,QAAQ,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC5E,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,cAAcC,uBAAAA,eAAe,KAAK,KAAK;CAC7C,MAAM,aAAa,QAAQ,EAAE,OAAOC,qBAAAA,aAAa,OAAO,MAAM,EAAE,IAAI,KAAA;CAEpE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EACO;EACL,MAAK;EACL,WAAWC,WAAAA,GAAGC,4BAAAA,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS;EAChD,OAAO;GAAE,GAAG;GAAY,GAAG;EAAY;EACvC,GAAI;EALN,UAAA,CAOE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GACE,WAAWC,4BAAAA;GACX,SAAQ;GACR,MAAK;GACL,QAAO;GACP,aAAa;GACb,eAAc;GACd,eAAA;GACA,WAAU;GARZ,UAAA,CAUE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IAAQ,WAAWC,4BAAAA;IAAO,IAAG;IAAK,IAAG;IAAK,GAAE;GAAK,CAAA,GACjD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,GAAE,sBAAuB,CAAA,CAC5B;EACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAWC,4BAAAA;GAAc,UAAA;EAAY,CAAA,CACvC;;AAEV,CACF;AAEA,eAAe,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/Spinner/Spinner.vanilla.css.ts"],"sourcesContent":["import { keyframes, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\nconst spin = keyframes({\n to: { transform: 'rotate(360deg)' },\n});\n\nexport const spinnerRecipe = recipe({\n base: {\n display: 'inline-flex',\n flexShrink: 0,\n verticalAlign: 'middle',\n color: tokens.colors.primary,\n },\n variants: {\n size: {\n small: { width: tokens.sizes['3'], height: tokens.sizes['3'] },\n medium: { width: tokens.sizes['5'], height: tokens.sizes['5'] },\n large: { width: tokens.sizes['6'], height: tokens.sizes['6'] },\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\n\nexport const svg = style({\n width: '100%',\n height: '100%',\n animation: `${spin} 1s linear infinite`,\n '@media': {\n // Slowed rather than stopped, so it still reads as busy.\n [breakpoints.motion]: { animationDuration: '3s' },\n },\n});\n\nexport const track = style({\n opacity: 0.25,\n});\n\nexport const hiddenLabel = style({\n position: 'absolute',\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n border: 0,\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Spinner.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.vanilla.css.js","names":["_7a468"],"sources":["../../../components/Spinner/Spinner.vanilla.css.ts"],"sourcesContent":["import { keyframes, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\nconst spin = keyframes({\n to: { transform: 'rotate(360deg)' },\n});\n\nexport const spinnerRecipe = recipe({\n base: {\n display: 'inline-flex',\n flexShrink: 0,\n verticalAlign: 'middle',\n color: tokens.colors.primary,\n },\n variants: {\n size: {\n small: { width: tokens.sizes['3'], height: tokens.sizes['3'] },\n medium: { width: tokens.sizes['5'], height: tokens.sizes['5'] },\n large: { width: tokens.sizes['6'], height: tokens.sizes['6'] },\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\n\nexport const svg = style({\n width: '100%',\n height: '100%',\n animation: `${spin} 1s linear infinite`,\n '@media': {\n // Slowed rather than stopped, so it still reads as busy.\n [breakpoints.motion]: { animationDuration: '3s' },\n },\n});\n\nexport const track = style({\n opacity: 0.25,\n});\n\nexport const hiddenLabel = style({\n position: 'absolute',\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n border: 0,\n});\n"],"mappings":""}
1
+ {"version":3,"file":"Spinner.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,15 +1,14 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
2
  import { resolveColor } from "../../styles/resolveColor.js";
4
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
4
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
5
5
  import { hiddenLabel, spinnerRecipe, svg, track } from "./Spinner.vanilla.css.js";
6
6
  import { forwardRef } from "react";
7
- import { assignInlineVars } from "@vanilla-extract/dynamic";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  // components/Spinner/Spinner.vanilla.tsx
10
9
  var SpinnerVanilla = forwardRef(({ size, color, label = "Loading", className, css, style, ...props }, ref) => {
11
10
  const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
11
+ const inlineStyle = useInlineStyle(css, style);
13
12
  const colorStyle = color ? { color: resolveColor(color, colors) } : void 0;
14
13
  return /* @__PURE__ */ jsxs("span", {
15
14
  ref,
@@ -17,9 +16,7 @@ var SpinnerVanilla = forwardRef(({ size, color, label = "Loading", className, cs
17
16
  className: cx(spinnerRecipe({ size }), className),
18
17
  style: {
19
18
  ...colorStyle,
20
- ...cssStyles,
21
- ...style,
22
- ...assignInlineVars(vars)
19
+ ...inlineStyle
23
20
  },
24
21
  ...props,
25
22
  children: [/* @__PURE__ */ jsxs("svg", {
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.vanilla.js","names":[],"sources":["../../../components/Spinner/Spinner.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { resolveColor } from '../../styles/resolveColor';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { hiddenLabel, spinnerRecipe, svg, track } from './Spinner.vanilla.css';\n\nexport type SpinnerVanillaProps = Omit<\n React.HTMLAttributes<HTMLSpanElement>,\n 'children' | 'color'\n> &\n CSSProps & {\n size?: 'small' | 'medium' | 'large';\n /** A color token such as `$toneSuccessSolid` or `$gray11`, any CSS color, or `currentColor`. Defaults to primary. */\n color?: string;\n /** Announced to screen readers. */\n label?: string;\n };\n\nexport const SpinnerVanilla = forwardRef<HTMLSpanElement, SpinnerVanillaProps>(\n ({ size, color, label = 'Loading', className, css, style, ...props }, ref) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const colorStyle = color ? { color: resolveColor(color, colors) } : undefined;\n\n return (\n <span\n ref={ref}\n role=\"status\"\n className={cx(spinnerRecipe({ size }), className)}\n style={{ ...colorStyle, ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n <svg\n className={svg}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n <circle className={track} cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 1 9 9\" />\n </svg>\n <span className={hiddenLabel}>{label}</span>\n </span>\n );\n },\n);\n\nSpinnerVanilla.displayName = 'SpinnerVanilla';\n"],"mappings":";;;;;;;;;AAqBA,IAAa,iBAAiB,YAC3B,EAAE,MAAM,OAAO,QAAQ,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC5E,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,aAAa,QAAQ,EAAE,OAAO,aAAa,OAAO,MAAM,EAAE,IAAI,KAAA;CAEpE,OACE,qBAAC,QAAD;EACO;EACL,MAAK;EACL,WAAW,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS;EAChD,OAAO;GAAE,GAAG;GAAY,GAAG;GAAW,GAAG;GAAO,GAAG,iBAAiB,IAAI;EAAE;EAC1E,GAAI;EALN,UAAA,CAOE,qBAAC,OAAD;GACE,WAAW;GACX,SAAQ;GACR,MAAK;GACL,QAAO;GACP,aAAa;GACb,eAAc;GACd,eAAA;GACA,WAAU;GARZ,UAAA,CAUE,oBAAC,UAAD;IAAQ,WAAW;IAAO,IAAG;IAAK,IAAG;IAAK,GAAE;GAAK,CAAA,GACjD,oBAAC,QAAD,EAAM,GAAE,sBAAuB,CAAA,CAC5B;EACL,CAAA,GAAA,oBAAC,QAAD;GAAM,WAAW;GAAc,UAAA;EAAY,CAAA,CACvC;;AAEV,CACF;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"Spinner.vanilla.js","names":[],"sources":["../../../components/Spinner/Spinner.vanilla.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { resolveColor } from '@/styles/resolveColor';\nimport { useVanillaExtractTheme } from '@/styles/themeContext';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { hiddenLabel, spinnerRecipe, svg, track } from './Spinner.vanilla.css';\n\nexport type SpinnerVanillaProps = Omit<\n React.HTMLAttributes<HTMLSpanElement>,\n 'children' | 'color'\n> &\n CSSProps & {\n size?: 'small' | 'medium' | 'large';\n /** A color token such as `$toneSuccessSolid` or `$gray11`, any CSS color, or `currentColor`. Defaults to primary. */\n color?: string;\n /** Announced to screen readers. */\n label?: string;\n };\n\nexport const SpinnerVanilla = forwardRef<HTMLSpanElement, SpinnerVanillaProps>(\n ({ size, color, label = 'Loading', className, css, style, ...props }, ref) => {\n const { colors } = useVanillaExtractTheme();\n const inlineStyle = useInlineStyle(css, style);\n const colorStyle = color ? { color: resolveColor(color, colors) } : undefined;\n\n return (\n <span\n ref={ref}\n role=\"status\"\n className={cx(spinnerRecipe({ size }), className)}\n style={{ ...colorStyle, ...inlineStyle }}\n {...props}\n >\n <svg\n className={svg}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n aria-hidden\n focusable=\"false\"\n >\n <circle className={track} cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 3a9 9 0 0 1 9 9\" />\n </svg>\n <span className={hiddenLabel}>{label}</span>\n </span>\n );\n },\n);\n\nSpinnerVanilla.displayName = 'SpinnerVanilla';\n"],"mappings":";;;;;;;;AAsBA,IAAa,iBAAiB,YAC3B,EAAE,MAAM,OAAO,QAAQ,WAAW,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC5E,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,cAAc,eAAe,KAAK,KAAK;CAC7C,MAAM,aAAa,QAAQ,EAAE,OAAO,aAAa,OAAO,MAAM,EAAE,IAAI,KAAA;CAEpE,OACE,qBAAC,QAAD;EACO;EACL,MAAK;EACL,WAAW,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS;EAChD,OAAO;GAAE,GAAG;GAAY,GAAG;EAAY;EACvC,GAAI;EALN,UAAA,CAOE,qBAAC,OAAD;GACE,WAAW;GACX,SAAQ;GACR,MAAK;GACL,QAAO;GACP,aAAa;GACb,eAAc;GACd,eAAA;GACA,WAAU;GARZ,UAAA,CAUE,oBAAC,UAAD;IAAQ,WAAW;IAAO,IAAG;IAAK,IAAG;IAAK,GAAE;GAAK,CAAA,GACjD,oBAAC,QAAD,EAAM,GAAE,sBAAuB,CAAA,CAC5B;EACL,CAAA,GAAA,oBAAC,QAAD;GAAM,WAAW;GAAc,UAAA;EAAY,CAAA,CACvC;;AAEV,CACF;AAEA,eAAe,cAAc"}
@@ -1,12 +1,10 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
- const require_cssProps = require("../../styles/cssProps.cjs");
3
2
  const require_cx = require("../../styles/cx.cjs");
4
- const require_themeContext = require("../../styles/themeContext.cjs");
3
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
5
4
  const require_Flex_vanilla = require("../Flex/Flex.vanilla.cjs");
6
5
  const require_SplitLayout_vanilla_css = require("./SplitLayout.vanilla.css.cjs");
7
6
  let react = require("react");
8
7
  react = require_runtime.__toESM(react, 1);
9
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
10
8
  let react_jsx_runtime = require("react/jsx-runtime");
11
9
  // components/SplitLayout/SplitLayout.vanilla.tsx
12
10
  var KEY_STEP = 16;
@@ -48,8 +46,7 @@ var stickyCss = (stacked, stickyTop) => !stacked && stickyTop != null ? {
48
46
  top: stickyTop
49
47
  } : {};
50
48
  var SplitLayoutVanilla = (0, react.forwardRef)(({ breakpoint = 1024, className, css, style, children, ...props }, ref) => {
51
- const { colors } = require_themeContext.useVanillaExtractTheme();
52
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
49
+ const inlineStyle = require_useInlineStyle.useInlineStyle(css, style);
53
50
  const containerRef = (0, react.useRef)(null);
54
51
  const setRefs = (0, react.useCallback)((el) => {
55
52
  containerRef.current = el;
@@ -78,11 +75,7 @@ var SplitLayoutVanilla = (0, react.forwardRef)(({ breakpoint = 1024, className,
78
75
  ref: setRefs,
79
76
  className: require_cx.cx(require_SplitLayout_vanilla_css.root, className),
80
77
  "data-stacked": stacked ? "" : void 0,
81
- style: {
82
- ...cssStyles,
83
- ...style,
84
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
85
- },
78
+ style: inlineStyle,
86
79
  ...props,
87
80
  children
88
81
  })
@@ -1 +1 @@
1
- {"version":3,"file":"SplitLayout.vanilla.cjs","names":["useLayoutEffect","useEffect","useCallback","useSyncExternalStore","createContext","useContext","forwardRef","useVanillaExtractTheme","processCSSProp","useRef","useState","cx","root","assignInlineVars","FlexVanilla","main","useId","_Fragment","aside"],"sources":["../../../components/SplitLayout/SplitLayout.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type { Gap } from '../../styles/types';\nimport { FlexVanilla } from '../Flex/Flex.vanilla';\nimport { HANDLE_WIDTH } from './SplitLayout.constants';\nimport { aside, handle, handleLine, main, root } from './SplitLayout.vanilla.css';\n\n/** Pixels, or a share of the layout such as `'25%'`. */\nexport type SplitLayoutWidth = number | `${number}%`;\n\nconst KEY_STEP = 16;\nconst DEFAULT_MIN_WIDTH: SplitLayoutWidth = '25%';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst toPx = (width: SplitLayoutWidth, layoutWidth: number) =>\n typeof width === 'number' ? width : (parseFloat(width) / 100) * layoutWidth;\n\nconst storageName = (key: string) => `split:${key}`;\n\nconst readSaved = (key: string): number | null => {\n try {\n const saved = Number(window.localStorage.getItem(storageName(key)));\n return saved > 0 ? saved : null;\n } catch {\n return null;\n }\n};\n\nconst writeSaved = (key: string, width: number | null) => {\n try {\n if (width == null) window.localStorage.removeItem(storageName(key));\n else window.localStorage.setItem(storageName(key), String(width));\n } catch {\n // Storage can be unavailable (private mode, blocked); remembering is only a convenience.\n }\n};\n\nconst useMaxWidth = (px: number) => {\n const query = `(max-width: ${px}px)`;\n const subscribe = useCallback(\n (onChange: () => void) => {\n const mq = window.matchMedia(query);\n mq.addEventListener('change', onChange);\n return () => mq.removeEventListener('change', onChange);\n },\n [query],\n );\n\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(query).matches,\n () => false,\n );\n};\n\ntype SplitContextValue = {\n stacked: boolean;\n layoutWidth: number;\n mainMinWidth: SplitLayoutWidth;\n setMainMinWidth: (width: SplitLayoutWidth) => void;\n};\n\nconst SplitContext = createContext<SplitContextValue | null>(null);\n\nconst useSplit = (component: string) => {\n const split = useContext(SplitContext);\n if (!split) throw new Error(`${component} must be used inside SplitLayoutVanilla`);\n return split;\n};\n\nconst stickyCss = (stacked: boolean, stickyTop?: string | number) =>\n !stacked && stickyTop != null ? { position: 'sticky', top: stickyTop } : {};\n\nexport type SplitLayoutVanillaProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n /** The panes stack at this viewport width (px) and below. */\n breakpoint?: number;\n };\n\nexport const SplitLayoutVanilla = forwardRef<HTMLDivElement, SplitLayoutVanillaProps>(\n ({ breakpoint = 1024, className, css, style, children, ...props }, ref) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const setRefs = useCallback(\n (el: HTMLDivElement | null) => {\n containerRef.current = el;\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n },\n [ref],\n );\n\n const stacked = useMaxWidth(breakpoint);\n const [layoutWidth, setLayoutWidth] = useState(0);\n const [mainMinWidth, setMainMinWidth] = useState<SplitLayoutWidth>(DEFAULT_MIN_WIDTH);\n\n useIsomorphicLayoutEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n setLayoutWidth(el.clientWidth);\n const observer = new ResizeObserver(() => setLayoutWidth(el.clientWidth));\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n return (\n <SplitContext.Provider value={{ stacked, layoutWidth, mainMinWidth, setMainMinWidth }}>\n <div\n ref={setRefs}\n className={cx(root, className)}\n data-stacked={stacked ? '' : undefined}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n {children}\n </div>\n </SplitContext.Provider>\n );\n },\n);\n\nSplitLayoutVanilla.displayName = 'SplitLayoutVanilla';\n\ntype PaneProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n gap?: Gap;\n /** Keeps the pane in view while the page scrolls, this far from the top. Off when stacked. */\n stickyTop?: string | number;\n /** The pane never gets narrower than this while resizing. */\n minWidth?: SplitLayoutWidth;\n };\n\nexport type SplitLayoutMainVanillaProps = PaneProps;\n\nexport const SplitLayoutMainVanilla = forwardRef<HTMLDivElement, SplitLayoutMainVanillaProps>(\n ({ stickyTop, minWidth = DEFAULT_MIN_WIDTH, className, css, ...props }, ref) => {\n const { stacked, setMainMinWidth } = useSplit('SplitLayoutMainVanilla');\n\n useIsomorphicLayoutEffect(() => {\n setMainMinWidth(minWidth);\n return () => setMainMinWidth(DEFAULT_MIN_WIDTH);\n }, [minWidth, setMainMinWidth]);\n\n return (\n <FlexVanilla\n ref={ref}\n direction=\"column\"\n className={cx(main, className)}\n css={{ ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n );\n },\n);\n\nSplitLayoutMainVanilla.displayName = 'SplitLayoutMainVanilla';\n\nexport type SplitLayoutAsideVanillaProps = PaneProps & {\n /** Starting width in px. */\n defaultWidth?: number;\n /** Starting width as a share of the layout, e.g. 0.3. Overrides `defaultWidth`. */\n defaultFraction?: number;\n /** Remembers the width in localStorage under `split:<storageKey>`. */\n storageKey?: string;\n /** Accessible name of the divider. */\n resizeLabel?: string;\n};\n\nexport const SplitLayoutAsideVanilla = forwardRef<HTMLDivElement, SplitLayoutAsideVanillaProps>(\n (\n {\n defaultWidth = 360,\n defaultFraction,\n minWidth = DEFAULT_MIN_WIDTH,\n storageKey,\n resizeLabel = 'Resize',\n stickyTop,\n className,\n css,\n id,\n ...props\n },\n ref,\n ) => {\n const { stacked, layoutWidth, mainMinWidth } = useSplit('SplitLayoutAsideVanilla');\n const generatedId = useId();\n const paneId = id ?? generatedId;\n\n // null means \"use the default\", which may depend on the measured layout width.\n const [wanted, setWanted] = useState<number | null>(() =>\n storageKey ? readSaved(storageKey) : null,\n );\n\n const measured = layoutWidth > 0;\n const min = Math.round(toPx(minWidth, layoutWidth));\n // The aside's own minimum wins when both minimums don't fit.\n const max = measured\n ? Math.round(Math.max(layoutWidth - HANDLE_WIDTH - toPx(mainMinWidth, layoutWidth), min))\n : null;\n const clamp = (w: number) => Math.round(Math.min(Math.max(w, min), max ?? Infinity));\n\n const startWidth =\n defaultFraction != null && measured ? layoutWidth * defaultFraction : defaultWidth;\n const width = clamp(wanted ?? startWidth);\n\n // Handlers read the latest render through this ref so they stay stable during a drag.\n const latestRef = useRef({ width, min, max, clamp, storageKey });\n latestRef.current = { width, min, max, clamp, storageKey };\n\n const resize = useCallback((next: number) => {\n const w = latestRef.current.clamp(next);\n setWanted(w);\n return w;\n }, []);\n\n const persist = useCallback((w: number | null) => {\n const key = latestRef.current.storageKey;\n if (key) writeSaved(key, w);\n }, []);\n\n const onPointerDown = useCallback(\n (e: React.PointerEvent) => {\n if (e.button !== 0) return;\n e.preventDefault();\n const startX = e.clientX;\n const from = latestRef.current.width;\n let last = from;\n\n const onMove = (ev: PointerEvent) => {\n last = resize(from - (ev.clientX - startX));\n };\n const onUp = () => {\n window.removeEventListener('pointermove', onMove);\n window.removeEventListener('pointerup', onUp);\n window.removeEventListener('pointercancel', onUp);\n document.body.style.userSelect = '';\n document.body.style.cursor = '';\n // A click without a drag must not replace a defaultFraction with a fixed width.\n if (last !== from) persist(last);\n };\n\n document.body.style.userSelect = 'none';\n document.body.style.cursor = 'col-resize';\n window.addEventListener('pointermove', onMove);\n window.addEventListener('pointerup', onUp);\n window.addEventListener('pointercancel', onUp);\n },\n [resize, persist],\n );\n\n const onDoubleClick = useCallback(() => {\n setWanted(null);\n persist(null);\n }, [persist]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const { width: current, min: lo, max: hi } = latestRef.current;\n let next: number;\n if (e.key === 'ArrowLeft') next = current + KEY_STEP;\n else if (e.key === 'ArrowRight') next = current - KEY_STEP;\n else if (e.key === 'Home') next = lo;\n else if (e.key === 'End' && hi != null) next = hi;\n else return;\n e.preventDefault();\n persist(resize(next));\n },\n [resize, persist],\n );\n\n return (\n <>\n {!stacked && (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={resizeLabel}\n aria-controls={paneId}\n aria-valuenow={width}\n aria-valuemin={min}\n aria-valuemax={max ?? undefined}\n tabIndex={0}\n title=\"Drag to resize, double-click to reset\"\n className={handle}\n onPointerDown={onPointerDown}\n onDoubleClick={onDoubleClick}\n onKeyDown={onKeyDown}\n >\n <span className={handleLine} />\n </div>\n )}\n <FlexVanilla\n ref={ref}\n id={paneId}\n direction=\"column\"\n className={cx(aside, className)}\n css={{ ...(stacked ? {} : { width }), ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n </>\n );\n },\n);\n\nSplitLayoutAsideVanilla.displayName = 'SplitLayoutAsideVanilla';\n"],"mappings":";;;;;;;;;;;AAyBA,IAAM,WAAW;AACjB,IAAM,oBAAsC;AAE5C,IAAM,4BAA4B,OAAO,WAAW,cAAcA,MAAAA,kBAAkBC,MAAAA;AAEpF,IAAM,QAAQ,OAAyB,gBACrC,OAAO,UAAU,WAAW,QAAS,WAAW,KAAK,IAAI,MAAO;AAElE,IAAM,eAAe,QAAgB,SAAS;AAE9C,IAAM,aAAa,QAA+B;CAChD,IAAI;EACF,MAAM,QAAQ,OAAO,OAAO,aAAa,QAAQ,YAAY,GAAG,CAAC,CAAC;EAClE,OAAO,QAAQ,IAAI,QAAQ;CAC7B,QAAQ;EACN,OAAO;CACT;AACF;AAEA,IAAM,cAAc,KAAa,UAAyB;CACxD,IAAI;EACF,IAAI,SAAS,MAAM,OAAO,aAAa,WAAW,YAAY,GAAG,CAAC;OAC7D,OAAO,aAAa,QAAQ,YAAY,GAAG,GAAG,OAAO,KAAK,CAAC;CAClE,QAAQ,CAER;AACF;AAEA,IAAM,eAAe,OAAe;CAClC,MAAM,QAAQ,eAAe,GAAG;CAChC,MAAM,aAAA,GAAYC,MAAAA,YAAAA,EACf,aAAyB;EACxB,MAAM,KAAK,OAAO,WAAW,KAAK;EAClC,GAAG,iBAAiB,UAAU,QAAQ;EACtC,aAAa,GAAG,oBAAoB,UAAU,QAAQ;CACxD,GACA,CAAC,KAAK,CACR;CAEA,QAAA,GAAOC,MAAAA,qBAAAA,CACL,iBACM,OAAO,WAAW,KAAK,CAAC,CAAC,eACzB,KACR;AACF;AASA,IAAM,gBAAA,GAAeC,MAAAA,c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AS;GAAG,GAAG;EAAI;EAC/E,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CACF;AAEA,wBAAwB,cAAc"}
1
+ {"version":3,"file":"SplitLayout.vanilla.cjs","names":["useLayoutEffect","useEffect","useCallback","useSyncExternalStore","createContext","useContext","forwardRef","useInlineStyle","useRef","useState","cx","root","FlexVanilla","main","useId","_Fragment","aside"],"sources":["../../../components/SplitLayout/SplitLayout.vanilla.tsx"],"sourcesContent":["import React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport type { Gap } from '@/styles/types';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { FlexVanilla } from '@/components/Flex/Flex.vanilla';\n\nimport { HANDLE_WIDTH } from './SplitLayout.constants';\nimport { aside, handle, handleLine, main, root } from './SplitLayout.vanilla.css';\n\n/** Pixels, or a share of the layout such as `'25%'`. */\nexport type SplitLayoutWidth = number | `${number}%`;\n\nconst KEY_STEP = 16;\nconst DEFAULT_MIN_WIDTH: SplitLayoutWidth = '25%';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst toPx = (width: SplitLayoutWidth, layoutWidth: number) =>\n typeof width === 'number' ? width : (parseFloat(width) / 100) * layoutWidth;\n\nconst storageName = (key: string) => `split:${key}`;\n\nconst readSaved = (key: string): number | null => {\n try {\n const saved = Number(window.localStorage.getItem(storageName(key)));\n return saved > 0 ? saved : null;\n } catch {\n return null;\n }\n};\n\nconst writeSaved = (key: string, width: number | null) => {\n try {\n if (width == null) window.localStorage.removeItem(storageName(key));\n else window.localStorage.setItem(storageName(key), String(width));\n } catch {\n // Storage can be unavailable (private mode, blocked); remembering is only a convenience.\n }\n};\n\nconst useMaxWidth = (px: number) => {\n const query = `(max-width: ${px}px)`;\n const subscribe = useCallback(\n (onChange: () => void) => {\n const mq = window.matchMedia(query);\n mq.addEventListener('change', onChange);\n return () => mq.removeEventListener('change', onChange);\n },\n [query],\n );\n\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(query).matches,\n () => false,\n );\n};\n\ntype SplitContextValue = {\n stacked: boolean;\n layoutWidth: number;\n mainMinWidth: SplitLayoutWidth;\n setMainMinWidth: (width: SplitLayoutWidth) => void;\n};\n\nconst SplitContext = createContext<SplitContextValue | null>(null);\n\nconst useSplit = (component: string) => {\n const split = useContext(SplitContext);\n if (!split) throw new Error(`${component} must be used inside SplitLayoutVanilla`);\n return split;\n};\n\nconst stickyCss = (stacked: boolean, stickyTop?: string | number) =>\n !stacked && stickyTop != null ? { position: 'sticky', top: stickyTop } : {};\n\nexport type SplitLayoutVanillaProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n /** The panes stack at this viewport width (px) and below. */\n breakpoint?: number;\n };\n\nexport const SplitLayoutVanilla = forwardRef<HTMLDivElement, SplitLayoutVanillaProps>(\n ({ breakpoint = 1024, className, css, style, children, ...props }, ref) => {\n const inlineStyle = useInlineStyle(css, style);\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const setRefs = useCallback(\n (el: HTMLDivElement | null) => {\n containerRef.current = el;\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n },\n [ref],\n );\n\n const stacked = useMaxWidth(breakpoint);\n const [layoutWidth, setLayoutWidth] = useState(0);\n const [mainMinWidth, setMainMinWidth] = useState<SplitLayoutWidth>(DEFAULT_MIN_WIDTH);\n\n useIsomorphicLayoutEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n setLayoutWidth(el.clientWidth);\n const observer = new ResizeObserver(() => setLayoutWidth(el.clientWidth));\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n return (\n <SplitContext.Provider value={{ stacked, layoutWidth, mainMinWidth, setMainMinWidth }}>\n <div\n ref={setRefs}\n className={cx(root, className)}\n data-stacked={stacked ? '' : undefined}\n style={inlineStyle}\n {...props}\n >\n {children}\n </div>\n </SplitContext.Provider>\n );\n },\n);\n\nSplitLayoutVanilla.displayName = 'SplitLayoutVanilla';\n\ntype PaneProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n gap?: Gap;\n /** Keeps the pane in view while the page scrolls, this far from the top. Off when stacked. */\n stickyTop?: string | number;\n /** The pane never gets narrower than this while resizing. */\n minWidth?: SplitLayoutWidth;\n };\n\nexport type SplitLayoutMainVanillaProps = PaneProps;\n\nexport const SplitLayoutMainVanilla = forwardRef<HTMLDivElement, SplitLayoutMainVanillaProps>(\n ({ stickyTop, minWidth = DEFAULT_MIN_WIDTH, className, css, ...props }, ref) => {\n const { stacked, setMainMinWidth } = useSplit('SplitLayoutMainVanilla');\n\n useIsomorphicLayoutEffect(() => {\n setMainMinWidth(minWidth);\n return () => setMainMinWidth(DEFAULT_MIN_WIDTH);\n }, [minWidth, setMainMinWidth]);\n\n return (\n <FlexVanilla\n ref={ref}\n direction=\"column\"\n className={cx(main, className)}\n css={{ ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n );\n },\n);\n\nSplitLayoutMainVanilla.displayName = 'SplitLayoutMainVanilla';\n\nexport type SplitLayoutAsideVanillaProps = PaneProps & {\n /** Starting width in px. */\n defaultWidth?: number;\n /** Starting width as a share of the layout, e.g. 0.3. Overrides `defaultWidth`. */\n defaultFraction?: number;\n /** Remembers the width in localStorage under `split:<storageKey>`. */\n storageKey?: string;\n /** Accessible name of the divider. */\n resizeLabel?: string;\n};\n\nexport const SplitLayoutAsideVanilla = forwardRef<HTMLDivElement, SplitLayoutAsideVanillaProps>(\n (\n {\n defaultWidth = 360,\n defaultFraction,\n minWidth = DEFAULT_MIN_WIDTH,\n storageKey,\n resizeLabel = 'Resize',\n stickyTop,\n className,\n css,\n id,\n ...props\n },\n ref,\n ) => {\n const { stacked, layoutWidth, mainMinWidth } = useSplit('SplitLayoutAsideVanilla');\n const generatedId = useId();\n const paneId = id ?? generatedId;\n\n // null means \"use the default\", which may depend on the measured layout width.\n const [wanted, setWanted] = useState<number | null>(() =>\n storageKey ? readSaved(storageKey) : null,\n );\n\n const measured = layoutWidth > 0;\n const min = Math.round(toPx(minWidth, layoutWidth));\n // The aside's own minimum wins when both minimums don't fit.\n const max = measured\n ? Math.round(Math.max(layoutWidth - HANDLE_WIDTH - toPx(mainMinWidth, layoutWidth), min))\n : null;\n const clamp = (w: number) => Math.round(Math.min(Math.max(w, min), max ?? Infinity));\n\n const startWidth =\n defaultFraction != null && measured ? layoutWidth * defaultFraction : defaultWidth;\n const width = clamp(wanted ?? startWidth);\n\n // Handlers read the latest render through this ref so they stay stable during a drag.\n const latestRef = useRef({ width, min, max, clamp, storageKey });\n latestRef.current = { width, min, max, clamp, storageKey };\n\n const resize = useCallback((next: number) => {\n const w = latestRef.current.clamp(next);\n setWanted(w);\n return w;\n }, []);\n\n const persist = useCallback((w: number | null) => {\n const key = latestRef.current.storageKey;\n if (key) writeSaved(key, w);\n }, []);\n\n const onPointerDown = useCallback(\n (e: React.PointerEvent) => {\n if (e.button !== 0) return;\n e.preventDefault();\n const startX = e.clientX;\n const from = latestRef.current.width;\n let last = from;\n\n const onMove = (ev: PointerEvent) => {\n last = resize(from - (ev.clientX - startX));\n };\n const onUp = () => {\n window.removeEventListener('pointermove', onMove);\n window.removeEventListener('pointerup', onUp);\n window.removeEventListener('pointercancel', onUp);\n document.body.style.userSelect = '';\n document.body.style.cursor = '';\n // A click without a drag must not replace a defaultFraction with a fixed width.\n if (last !== from) persist(last);\n };\n\n document.body.style.userSelect = 'none';\n document.body.style.cursor = 'col-resize';\n window.addEventListener('pointermove', onMove);\n window.addEventListener('pointerup', onUp);\n window.addEventListener('pointercancel', onUp);\n },\n [resize, persist],\n );\n\n const onDoubleClick = useCallback(() => {\n setWanted(null);\n persist(null);\n }, [persist]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const { width: current, min: lo, max: hi } = latestRef.current;\n let next: number;\n if (e.key === 'ArrowLeft') next = current + KEY_STEP;\n else if (e.key === 'ArrowRight') next = current - KEY_STEP;\n else if (e.key === 'Home') next = lo;\n else if (e.key === 'End' && hi != null) next = hi;\n else return;\n e.preventDefault();\n persist(resize(next));\n },\n [resize, persist],\n );\n\n return (\n <>\n {!stacked && (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={resizeLabel}\n aria-controls={paneId}\n aria-valuenow={width}\n aria-valuemin={min}\n aria-valuemax={max ?? undefined}\n tabIndex={0}\n title=\"Drag to resize, double-click to reset\"\n className={handle}\n onPointerDown={onPointerDown}\n onDoubleClick={onDoubleClick}\n onKeyDown={onKeyDown}\n >\n <span className={handleLine} />\n </div>\n )}\n <FlexVanilla\n ref={ref}\n id={paneId}\n direction=\"column\"\n className={cx(aside, className)}\n css={{ ...(stacked ? {} : { width }), ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n </>\n );\n },\n);\n\nSplitLayoutAsideVanilla.displayName = 'SplitLayoutAsideVanilla';\n"],"mappings":";;;;;;;;;AA0BA,IAAM,WAAW;AACjB,IAAM,oBAAsC;AAE5C,IAAM,4BAA4B,OAAO,WAAW,cAAcA,MAAAA,kBAAkBC,MAAAA;AAEpF,IAAM,QAAQ,OAAyB,gBACrC,OAAO,UAAU,WAAW,QAAS,WAAW,KAAK,IAAI,MAAO;AAElE,IAAM,eAAe,QAAgB,SAAS;AAE9C,IAAM,aAAa,QAA+B;CAChD,IAAI;EACF,MAAM,QAAQ,OAAO,OAAO,aAAa,QAAQ,YAAY,GAAG,CAAC,CAAC;EAClE,OAAO,QAAQ,IAAI,QAAQ;CAC7B,QAAQ;EACN,OAAO;CACT;AACF;AAEA,IAAM,cAAc,KAAa,UAAyB;CACxD,IAAI;EACF,IAAI,SAAS,MAAM,OAAO,aAAa,WAAW,YAAY,GAAG,CAAC;OAC7D,OAAO,aAAa,QAAQ,YAAY,GAAG,GAAG,OAAO,KAAK,CAAC;CAClE,QAAQ,CAER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wB,CAAA;CAC3B,CAAA,GAEP,iBAAA,GAAA,kBAAA,IAAA,CAACH,qBAAAA,aAAD;EACO;EACL,IAAI;EACJ,WAAU;EACV,WAAWF,WAAAA,GAAGM,gCAAAA,OAAO,SAAS;EAC9B,KAAK;GAAE,GAAI,UAAU,CAAC,IAAI,EAAE,MAAM;GAAI,GAAG,UAAU,SAAS,SAAS;GAAG,GAAG;EAAI;EAC/E,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CACF;AAEA,wBAAwB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"SplitLayout.vanilla.css.cjs","names":[],"sources":["../../../components/SplitLayout/SplitLayout.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\nimport { HANDLE_WIDTH } from './SplitLayout.constants';\n\nexport const root = style({\n display: 'flex',\n alignItems: 'flex-start',\n minWidth: 0,\n selectors: {\n '&[data-stacked]': { display: 'block' },\n },\n});\n\nexport const main = style({\n flex: 1,\n minWidth: 0,\n});\n\nexport const aside = style({\n flexShrink: 0,\n minWidth: 0,\n selectors: {\n [`${root}[data-stacked] &`]: { marginTop: tokens.space['6'] },\n },\n});\n\nexport const handle = style({\n flexShrink: 0,\n alignSelf: 'stretch',\n width: HANDLE_WIDTH,\n display: 'flex',\n justifyContent: 'center',\n cursor: 'col-resize',\n touchAction: 'none',\n outline: 'none',\n});\n\nexport const handleLine = style({\n width: 1,\n borderRadius: 2,\n backgroundColor: tokens.colors.divider,\n transition: 'width 120ms ease, background-color 120ms ease',\n selectors: {\n [`${handle}:hover &, ${handle}:focus-visible &`]: {\n width: 3,\n backgroundColor: tokens.colors.primary,\n },\n },\n '@media': {\n [breakpoints.motion]: { transition: 'none' },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"SplitLayout.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"SplitLayout.vanilla.css.js","names":[],"sources":["../../../components/SplitLayout/SplitLayout.vanilla.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\nimport { HANDLE_WIDTH } from './SplitLayout.constants';\n\nexport const root = style({\n display: 'flex',\n alignItems: 'flex-start',\n minWidth: 0,\n selectors: {\n '&[data-stacked]': { display: 'block' },\n },\n});\n\nexport const main = style({\n flex: 1,\n minWidth: 0,\n});\n\nexport const aside = style({\n flexShrink: 0,\n minWidth: 0,\n selectors: {\n [`${root}[data-stacked] &`]: { marginTop: tokens.space['6'] },\n },\n});\n\nexport const handle = style({\n flexShrink: 0,\n alignSelf: 'stretch',\n width: HANDLE_WIDTH,\n display: 'flex',\n justifyContent: 'center',\n cursor: 'col-resize',\n touchAction: 'none',\n outline: 'none',\n});\n\nexport const handleLine = style({\n width: 1,\n borderRadius: 2,\n backgroundColor: tokens.colors.divider,\n transition: 'width 120ms ease, background-color 120ms ease',\n selectors: {\n [`${handle}:hover &, ${handle}:focus-visible &`]: {\n width: 3,\n backgroundColor: tokens.colors.primary,\n },\n },\n '@media': {\n [breakpoints.motion]: { transition: 'none' },\n },\n});\n"],"mappings":""}
1
+ {"version":3,"file":"SplitLayout.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -1,10 +1,8 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
3
  import { FlexVanilla } from "../Flex/Flex.vanilla.js";
5
4
  import { aside, main, root } from "./SplitLayout.vanilla.css.js";
6
5
  import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
7
- import { assignInlineVars } from "@vanilla-extract/dynamic";
8
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
7
  // components/SplitLayout/SplitLayout.vanilla.tsx
10
8
  var KEY_STEP = 16;
@@ -46,8 +44,7 @@ var stickyCss = (stacked, stickyTop) => !stacked && stickyTop != null ? {
46
44
  top: stickyTop
47
45
  } : {};
48
46
  var SplitLayoutVanilla = forwardRef(({ breakpoint = 1024, className, css, style, children, ...props }, ref) => {
49
- const { colors } = useVanillaExtractTheme();
50
- const { style: cssStyles, vars } = processCSSProp(css, colors);
47
+ const inlineStyle = useInlineStyle(css, style);
51
48
  const containerRef = useRef(null);
52
49
  const setRefs = useCallback((el) => {
53
50
  containerRef.current = el;
@@ -76,11 +73,7 @@ var SplitLayoutVanilla = forwardRef(({ breakpoint = 1024, className, css, style,
76
73
  ref: setRefs,
77
74
  className: cx(root, className),
78
75
  "data-stacked": stacked ? "" : void 0,
79
- style: {
80
- ...cssStyles,
81
- ...style,
82
- ...assignInlineVars(vars)
83
- },
76
+ style: inlineStyle,
84
77
  ...props,
85
78
  children
86
79
  })
@@ -1 +1 @@
1
- {"version":3,"file":"SplitLayout.vanilla.js","names":["_Fragment"],"sources":["../../../components/SplitLayout/SplitLayout.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type { Gap } from '../../styles/types';\nimport { FlexVanilla } from '../Flex/Flex.vanilla';\nimport { HANDLE_WIDTH } from './SplitLayout.constants';\nimport { aside, handle, handleLine, main, root } from './SplitLayout.vanilla.css';\n\n/** Pixels, or a share of the layout such as `'25%'`. */\nexport type SplitLayoutWidth = number | `${number}%`;\n\nconst KEY_STEP = 16;\nconst DEFAULT_MIN_WIDTH: SplitLayoutWidth = '25%';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst toPx = (width: SplitLayoutWidth, layoutWidth: number) =>\n typeof width === 'number' ? width : (parseFloat(width) / 100) * layoutWidth;\n\nconst storageName = (key: string) => `split:${key}`;\n\nconst readSaved = (key: string): number | null => {\n try {\n const saved = Number(window.localStorage.getItem(storageName(key)));\n return saved > 0 ? saved : null;\n } catch {\n return null;\n }\n};\n\nconst writeSaved = (key: string, width: number | null) => {\n try {\n if (width == null) window.localStorage.removeItem(storageName(key));\n else window.localStorage.setItem(storageName(key), String(width));\n } catch {\n // Storage can be unavailable (private mode, blocked); remembering is only a convenience.\n }\n};\n\nconst useMaxWidth = (px: number) => {\n const query = `(max-width: ${px}px)`;\n const subscribe = useCallback(\n (onChange: () => void) => {\n const mq = window.matchMedia(query);\n mq.addEventListener('change', onChange);\n return () => mq.removeEventListener('change', onChange);\n },\n [query],\n );\n\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(query).matches,\n () => false,\n );\n};\n\ntype SplitContextValue = {\n stacked: boolean;\n layoutWidth: number;\n mainMinWidth: SplitLayoutWidth;\n setMainMinWidth: (width: SplitLayoutWidth) => void;\n};\n\nconst SplitContext = createContext<SplitContextValue | null>(null);\n\nconst useSplit = (component: string) => {\n const split = useContext(SplitContext);\n if (!split) throw new Error(`${component} must be used inside SplitLayoutVanilla`);\n return split;\n};\n\nconst stickyCss = (stacked: boolean, stickyTop?: string | number) =>\n !stacked && stickyTop != null ? { position: 'sticky', top: stickyTop } : {};\n\nexport type SplitLayoutVanillaProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n /** The panes stack at this viewport width (px) and below. */\n breakpoint?: number;\n };\n\nexport const SplitLayoutVanilla = forwardRef<HTMLDivElement, SplitLayoutVanillaProps>(\n ({ breakpoint = 1024, className, css, style, children, ...props }, ref) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const setRefs = useCallback(\n (el: HTMLDivElement | null) => {\n containerRef.current = el;\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n },\n [ref],\n );\n\n const stacked = useMaxWidth(breakpoint);\n const [layoutWidth, setLayoutWidth] = useState(0);\n const [mainMinWidth, setMainMinWidth] = useState<SplitLayoutWidth>(DEFAULT_MIN_WIDTH);\n\n useIsomorphicLayoutEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n setLayoutWidth(el.clientWidth);\n const observer = new ResizeObserver(() => setLayoutWidth(el.clientWidth));\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n return (\n <SplitContext.Provider value={{ stacked, layoutWidth, mainMinWidth, setMainMinWidth }}>\n <div\n ref={setRefs}\n className={cx(root, className)}\n data-stacked={stacked ? '' : undefined}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n {children}\n </div>\n </SplitContext.Provider>\n );\n },\n);\n\nSplitLayoutVanilla.displayName = 'SplitLayoutVanilla';\n\ntype PaneProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n gap?: Gap;\n /** Keeps the pane in view while the page scrolls, this far from the top. Off when stacked. */\n stickyTop?: string | number;\n /** The pane never gets narrower than this while resizing. */\n minWidth?: SplitLayoutWidth;\n };\n\nexport type SplitLayoutMainVanillaProps = PaneProps;\n\nexport const SplitLayoutMainVanilla = forwardRef<HTMLDivElement, SplitLayoutMainVanillaProps>(\n ({ stickyTop, minWidth = DEFAULT_MIN_WIDTH, className, css, ...props }, ref) => {\n const { stacked, setMainMinWidth } = useSplit('SplitLayoutMainVanilla');\n\n useIsomorphicLayoutEffect(() => {\n setMainMinWidth(minWidth);\n return () => setMainMinWidth(DEFAULT_MIN_WIDTH);\n }, [minWidth, setMainMinWidth]);\n\n return (\n <FlexVanilla\n ref={ref}\n direction=\"column\"\n className={cx(main, className)}\n css={{ ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n );\n },\n);\n\nSplitLayoutMainVanilla.displayName = 'SplitLayoutMainVanilla';\n\nexport type SplitLayoutAsideVanillaProps = PaneProps & {\n /** Starting width in px. */\n defaultWidth?: number;\n /** Starting width as a share of the layout, e.g. 0.3. Overrides `defaultWidth`. */\n defaultFraction?: number;\n /** Remembers the width in localStorage under `split:<storageKey>`. */\n storageKey?: string;\n /** Accessible name of the divider. */\n resizeLabel?: string;\n};\n\nexport const SplitLayoutAsideVanilla = forwardRef<HTMLDivElement, SplitLayoutAsideVanillaProps>(\n (\n {\n defaultWidth = 360,\n defaultFraction,\n minWidth = DEFAULT_MIN_WIDTH,\n storageKey,\n resizeLabel = 'Resize',\n stickyTop,\n className,\n css,\n id,\n ...props\n },\n ref,\n ) => {\n const { stacked, layoutWidth, mainMinWidth } = useSplit('SplitLayoutAsideVanilla');\n const generatedId = useId();\n const paneId = id ?? generatedId;\n\n // null means \"use the default\", which may depend on the measured layout width.\n const [wanted, setWanted] = useState<number | null>(() =>\n storageKey ? readSaved(storageKey) : null,\n );\n\n const measured = layoutWidth > 0;\n const min = Math.round(toPx(minWidth, layoutWidth));\n // The aside's own minimum wins when both minimums don't fit.\n const max = measured\n ? Math.round(Math.max(layoutWidth - HANDLE_WIDTH - toPx(mainMinWidth, layoutWidth), min))\n : null;\n const clamp = (w: number) => Math.round(Math.min(Math.max(w, min), max ?? Infinity));\n\n const startWidth =\n defaultFraction != null && measured ? layoutWidth * defaultFraction : defaultWidth;\n const width = clamp(wanted ?? startWidth);\n\n // Handlers read the latest render through this ref so they stay stable during a drag.\n const latestRef = useRef({ width, min, max, clamp, storageKey });\n latestRef.current = { width, min, max, clamp, storageKey };\n\n const resize = useCallback((next: number) => {\n const w = latestRef.current.clamp(next);\n setWanted(w);\n return w;\n }, []);\n\n const persist = useCallback((w: number | null) => {\n const key = latestRef.current.storageKey;\n if (key) writeSaved(key, w);\n }, []);\n\n const onPointerDown = useCallback(\n (e: React.PointerEvent) => {\n if (e.button !== 0) return;\n e.preventDefault();\n const startX = e.clientX;\n const from = latestRef.current.width;\n let last = from;\n\n const onMove = (ev: PointerEvent) => {\n last = resize(from - (ev.clientX - startX));\n };\n const onUp = () => {\n window.removeEventListener('pointermove', onMove);\n window.removeEventListener('pointerup', onUp);\n window.removeEventListener('pointercancel', onUp);\n document.body.style.userSelect = '';\n document.body.style.cursor = '';\n // A click without a drag must not replace a defaultFraction with a fixed width.\n if (last !== from) persist(last);\n };\n\n document.body.style.userSelect = 'none';\n document.body.style.cursor = 'col-resize';\n window.addEventListener('pointermove', onMove);\n window.addEventListener('pointerup', onUp);\n window.addEventListener('pointercancel', onUp);\n },\n [resize, persist],\n );\n\n const onDoubleClick = useCallback(() => {\n setWanted(null);\n persist(null);\n }, [persist]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const { width: current, min: lo, max: hi } = latestRef.current;\n let next: number;\n if (e.key === 'ArrowLeft') next = current + KEY_STEP;\n else if (e.key === 'ArrowRight') next = current - KEY_STEP;\n else if (e.key === 'Home') next = lo;\n else if (e.key === 'End' && hi != null) next = hi;\n else return;\n e.preventDefault();\n persist(resize(next));\n },\n [resize, persist],\n );\n\n return (\n <>\n {!stacked && (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={resizeLabel}\n aria-controls={paneId}\n aria-valuenow={width}\n aria-valuemin={min}\n aria-valuemax={max ?? undefined}\n tabIndex={0}\n title=\"Drag to resize, double-click to reset\"\n className={handle}\n onPointerDown={onPointerDown}\n onDoubleClick={onDoubleClick}\n onKeyDown={onKeyDown}\n >\n <span className={handleLine} />\n </div>\n )}\n <FlexVanilla\n ref={ref}\n id={paneId}\n direction=\"column\"\n className={cx(aside, className)}\n css={{ ...(stacked ? {} : { width }), ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n </>\n );\n },\n);\n\nSplitLayoutAsideVanilla.displayName = 'SplitLayoutAsideVanilla';\n"],"mappings":";;;;;;;;;AAyBA,IAAM,WAAW;AACjB,IAAM,oBAAsC;AAE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B,CAAA;CAC3B,CAAA,GAEP,oBAAC,aAAD;EACO;EACL,IAAI;EACJ,WAAU;EACV,WAAW,GAAG,OAAO,SAAS;EAC9B,KAAK;GAAE,GAAI,UAAU,CAAC,IAAI,EAAE,MAAM;GAAI,GAAG,UAAU,SAAS,SAAS;GAAG,GAAG;EAAI;EAC/E,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CACF;AAEA,wBAAwB,cAAc"}
1
+ {"version":3,"file":"SplitLayout.vanilla.js","names":["_Fragment"],"sources":["../../../components/SplitLayout/SplitLayout.vanilla.tsx"],"sourcesContent":["import React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport type { Gap } from '@/styles/types';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { FlexVanilla } from '@/components/Flex/Flex.vanilla';\n\nimport { HANDLE_WIDTH } from './SplitLayout.constants';\nimport { aside, handle, handleLine, main, root } from './SplitLayout.vanilla.css';\n\n/** Pixels, or a share of the layout such as `'25%'`. */\nexport type SplitLayoutWidth = number | `${number}%`;\n\nconst KEY_STEP = 16;\nconst DEFAULT_MIN_WIDTH: SplitLayoutWidth = '25%';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst toPx = (width: SplitLayoutWidth, layoutWidth: number) =>\n typeof width === 'number' ? width : (parseFloat(width) / 100) * layoutWidth;\n\nconst storageName = (key: string) => `split:${key}`;\n\nconst readSaved = (key: string): number | null => {\n try {\n const saved = Number(window.localStorage.getItem(storageName(key)));\n return saved > 0 ? saved : null;\n } catch {\n return null;\n }\n};\n\nconst writeSaved = (key: string, width: number | null) => {\n try {\n if (width == null) window.localStorage.removeItem(storageName(key));\n else window.localStorage.setItem(storageName(key), String(width));\n } catch {\n // Storage can be unavailable (private mode, blocked); remembering is only a convenience.\n }\n};\n\nconst useMaxWidth = (px: number) => {\n const query = `(max-width: ${px}px)`;\n const subscribe = useCallback(\n (onChange: () => void) => {\n const mq = window.matchMedia(query);\n mq.addEventListener('change', onChange);\n return () => mq.removeEventListener('change', onChange);\n },\n [query],\n );\n\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(query).matches,\n () => false,\n );\n};\n\ntype SplitContextValue = {\n stacked: boolean;\n layoutWidth: number;\n mainMinWidth: SplitLayoutWidth;\n setMainMinWidth: (width: SplitLayoutWidth) => void;\n};\n\nconst SplitContext = createContext<SplitContextValue | null>(null);\n\nconst useSplit = (component: string) => {\n const split = useContext(SplitContext);\n if (!split) throw new Error(`${component} must be used inside SplitLayoutVanilla`);\n return split;\n};\n\nconst stickyCss = (stacked: boolean, stickyTop?: string | number) =>\n !stacked && stickyTop != null ? { position: 'sticky', top: stickyTop } : {};\n\nexport type SplitLayoutVanillaProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n /** The panes stack at this viewport width (px) and below. */\n breakpoint?: number;\n };\n\nexport const SplitLayoutVanilla = forwardRef<HTMLDivElement, SplitLayoutVanillaProps>(\n ({ breakpoint = 1024, className, css, style, children, ...props }, ref) => {\n const inlineStyle = useInlineStyle(css, style);\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const setRefs = useCallback(\n (el: HTMLDivElement | null) => {\n containerRef.current = el;\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n },\n [ref],\n );\n\n const stacked = useMaxWidth(breakpoint);\n const [layoutWidth, setLayoutWidth] = useState(0);\n const [mainMinWidth, setMainMinWidth] = useState<SplitLayoutWidth>(DEFAULT_MIN_WIDTH);\n\n useIsomorphicLayoutEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n setLayoutWidth(el.clientWidth);\n const observer = new ResizeObserver(() => setLayoutWidth(el.clientWidth));\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n return (\n <SplitContext.Provider value={{ stacked, layoutWidth, mainMinWidth, setMainMinWidth }}>\n <div\n ref={setRefs}\n className={cx(root, className)}\n data-stacked={stacked ? '' : undefined}\n style={inlineStyle}\n {...props}\n >\n {children}\n </div>\n </SplitContext.Provider>\n );\n },\n);\n\nSplitLayoutVanilla.displayName = 'SplitLayoutVanilla';\n\ntype PaneProps = React.HTMLAttributes<HTMLDivElement> &\n CSSProps & {\n gap?: Gap;\n /** Keeps the pane in view while the page scrolls, this far from the top. Off when stacked. */\n stickyTop?: string | number;\n /** The pane never gets narrower than this while resizing. */\n minWidth?: SplitLayoutWidth;\n };\n\nexport type SplitLayoutMainVanillaProps = PaneProps;\n\nexport const SplitLayoutMainVanilla = forwardRef<HTMLDivElement, SplitLayoutMainVanillaProps>(\n ({ stickyTop, minWidth = DEFAULT_MIN_WIDTH, className, css, ...props }, ref) => {\n const { stacked, setMainMinWidth } = useSplit('SplitLayoutMainVanilla');\n\n useIsomorphicLayoutEffect(() => {\n setMainMinWidth(minWidth);\n return () => setMainMinWidth(DEFAULT_MIN_WIDTH);\n }, [minWidth, setMainMinWidth]);\n\n return (\n <FlexVanilla\n ref={ref}\n direction=\"column\"\n className={cx(main, className)}\n css={{ ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n );\n },\n);\n\nSplitLayoutMainVanilla.displayName = 'SplitLayoutMainVanilla';\n\nexport type SplitLayoutAsideVanillaProps = PaneProps & {\n /** Starting width in px. */\n defaultWidth?: number;\n /** Starting width as a share of the layout, e.g. 0.3. Overrides `defaultWidth`. */\n defaultFraction?: number;\n /** Remembers the width in localStorage under `split:<storageKey>`. */\n storageKey?: string;\n /** Accessible name of the divider. */\n resizeLabel?: string;\n};\n\nexport const SplitLayoutAsideVanilla = forwardRef<HTMLDivElement, SplitLayoutAsideVanillaProps>(\n (\n {\n defaultWidth = 360,\n defaultFraction,\n minWidth = DEFAULT_MIN_WIDTH,\n storageKey,\n resizeLabel = 'Resize',\n stickyTop,\n className,\n css,\n id,\n ...props\n },\n ref,\n ) => {\n const { stacked, layoutWidth, mainMinWidth } = useSplit('SplitLayoutAsideVanilla');\n const generatedId = useId();\n const paneId = id ?? generatedId;\n\n // null means \"use the default\", which may depend on the measured layout width.\n const [wanted, setWanted] = useState<number | null>(() =>\n storageKey ? readSaved(storageKey) : null,\n );\n\n const measured = layoutWidth > 0;\n const min = Math.round(toPx(minWidth, layoutWidth));\n // The aside's own minimum wins when both minimums don't fit.\n const max = measured\n ? Math.round(Math.max(layoutWidth - HANDLE_WIDTH - toPx(mainMinWidth, layoutWidth), min))\n : null;\n const clamp = (w: number) => Math.round(Math.min(Math.max(w, min), max ?? Infinity));\n\n const startWidth =\n defaultFraction != null && measured ? layoutWidth * defaultFraction : defaultWidth;\n const width = clamp(wanted ?? startWidth);\n\n // Handlers read the latest render through this ref so they stay stable during a drag.\n const latestRef = useRef({ width, min, max, clamp, storageKey });\n latestRef.current = { width, min, max, clamp, storageKey };\n\n const resize = useCallback((next: number) => {\n const w = latestRef.current.clamp(next);\n setWanted(w);\n return w;\n }, []);\n\n const persist = useCallback((w: number | null) => {\n const key = latestRef.current.storageKey;\n if (key) writeSaved(key, w);\n }, []);\n\n const onPointerDown = useCallback(\n (e: React.PointerEvent) => {\n if (e.button !== 0) return;\n e.preventDefault();\n const startX = e.clientX;\n const from = latestRef.current.width;\n let last = from;\n\n const onMove = (ev: PointerEvent) => {\n last = resize(from - (ev.clientX - startX));\n };\n const onUp = () => {\n window.removeEventListener('pointermove', onMove);\n window.removeEventListener('pointerup', onUp);\n window.removeEventListener('pointercancel', onUp);\n document.body.style.userSelect = '';\n document.body.style.cursor = '';\n // A click without a drag must not replace a defaultFraction with a fixed width.\n if (last !== from) persist(last);\n };\n\n document.body.style.userSelect = 'none';\n document.body.style.cursor = 'col-resize';\n window.addEventListener('pointermove', onMove);\n window.addEventListener('pointerup', onUp);\n window.addEventListener('pointercancel', onUp);\n },\n [resize, persist],\n );\n\n const onDoubleClick = useCallback(() => {\n setWanted(null);\n persist(null);\n }, [persist]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const { width: current, min: lo, max: hi } = latestRef.current;\n let next: number;\n if (e.key === 'ArrowLeft') next = current + KEY_STEP;\n else if (e.key === 'ArrowRight') next = current - KEY_STEP;\n else if (e.key === 'Home') next = lo;\n else if (e.key === 'End' && hi != null) next = hi;\n else return;\n e.preventDefault();\n persist(resize(next));\n },\n [resize, persist],\n );\n\n return (\n <>\n {!stacked && (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={resizeLabel}\n aria-controls={paneId}\n aria-valuenow={width}\n aria-valuemin={min}\n aria-valuemax={max ?? undefined}\n tabIndex={0}\n title=\"Drag to resize, double-click to reset\"\n className={handle}\n onPointerDown={onPointerDown}\n onDoubleClick={onDoubleClick}\n onKeyDown={onKeyDown}\n >\n <span className={handleLine} />\n </div>\n )}\n <FlexVanilla\n ref={ref}\n id={paneId}\n direction=\"column\"\n className={cx(aside, className)}\n css={{ ...(stacked ? {} : { width }), ...stickyCss(stacked, stickyTop), ...css }}\n {...props}\n />\n </>\n );\n },\n);\n\nSplitLayoutAsideVanilla.displayName = 'SplitLayoutAsideVanilla';\n"],"mappings":";;;;;;;AA0BA,IAAM,WAAW;AACjB,IAAM,oBAAsC;AAE5C,IAAM,4BAA4B,OAAO,WAAW,cAAc,kBAAkB;AAEpF,IAAM,QAAQ,OAAyB,gBACrC,OAAO,UAAU,WAAW,QAAS,WAAW,KAAK,IAAI,MAAO;AAElE,IAAM,eAAe,QAAgB,SAAS;AAE9C,IAAM,aAAa,QAA+B;CAChD,IAAI;EACF,MAAM,QAAQ,OAAO,OAAO,aAAa,QAAQ,YAAY,GAAG,CAAC,CAAC;EAClE,OAAO,QAAQ,IAAI,QAAQ;CAC7B,QAAQ;EACN,OAAO;CACT;AACF;AAEA,IAAM,cAAc,KAAa,UAAyB;CACxD,IAAI;EACF,IAAI,SAAS,MAAM,OAAO,aAAa,WAAW,YAAY,GAAG,CAAC;OAC7D,OAAO,aAA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QAAQ,IAAI;CACd,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,YAAY,aACf,MAA2B;EAC1B,MAAM,EAAE,OAAO,SAAS,KAAK,IAAI,KAAK,OAAO,UAAU;EACvD,IAAI;EACJ,IAAI,EAAE,QAAQ,aAAa,OAAO,UAAU;OACvC,IAAI,EAAE,QAAQ,cAAc,OAAO,UAAU;OAC7C,IAAI,EAAE,QAAQ,QAAQ,OAAO;OAC7B,IAAI,EAAE,QAAQ,SAAS,MAAM,MAAM,OAAO;OAC1C;EACL,EAAE,eAAe;EACjB,QAAQ,OAAO,IAAI,CAAC;CACtB,GACA,CAAC,QAAQ,OAAO,CAClB;CAEA,OACE,qBAAAA,YAAA,EAAA,UAAA,CACG,CAAC,WACA,oBAAC,OAAD;EACE,MAAK;EACL,oBAAiB;EACjB,cAAY;EACZ,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,iBAAe,OAAO,KAAA;EACtB,UAAU;EACV,OAAM;EACN,WAAA;EACe;EACA;EACJ;EAEX,UAAA,oBAAC,QAAD,EAAM,WAAA,YAAwB,CAAA;CAC3B,CAAA,GAEP,oBAAC,aAAD;EACO;EACL,IAAI;EACJ,WAAU;EACV,WAAW,GAAG,OAAO,SAAS;EAC9B,KAAK;GAAE,GAAI,UAAU,CAAC,IAAI,EAAE,MAAM;GAAI,GAAG,UAAU,SAAS,SAAS;GAAG,GAAG;EAAI;EAC/E,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CACF;AAEA,wBAAwB,cAAc"}
@@ -1,5 +1,6 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cx = require("../../styles/cx.cjs");
3
+ const require_recipeVariants = require("../../styles/recipeVariants.cjs");
3
4
  const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
4
5
  const require_RowLink_utils = require("../RowLink/RowLink.utils.cjs");
5
6
  const require_RowLink_vanilla = require("../RowLink/RowLink.vanilla.cjs");
@@ -11,16 +12,19 @@ let react = require("react");
11
12
  react = require_runtime.__toESM(react, 1);
12
13
  let react_jsx_runtime = require("react/jsx-runtime");
13
14
  // components/Table/Table.vanilla.tsx
15
+ var captionClass = require_recipeVariants.withVariantKeys(require_Table_vanilla_css.captionRecipe);
16
+ var tableClass = require_recipeVariants.withVariantKeys(require_Table_vanilla_css.tableRecipe);
17
+ var thClass = require_recipeVariants.withVariantKeys(require_Table_vanilla_css.thRecipe);
14
18
  var TableVanilla = (0, react.forwardRef)(({ elevation, className, css, style, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {
15
19
  ref,
16
- className: require_cx.cx(require_Table_vanilla_css.tableRecipe({ elevation }), require_RowLink_vanilla_css.rowLinkTable, className),
20
+ className: require_cx.cx(tableClass({ elevation }), require_RowLink_vanilla_css.rowLinkTable, className),
17
21
  style: require_useInlineStyle.useInlineStyle(css, style),
18
22
  ...props
19
23
  }));
20
24
  TableVanilla.displayName = "TableVanilla";
21
25
  var CaptionVanilla = (0, react.forwardRef)(({ size, weight, variant, gradient, transform, noWrap, className, css, style, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("caption", {
22
26
  ref,
23
- className: require_cx.cx(require_Table_vanilla_css.captionRecipe({
27
+ className: require_cx.cx(captionClass({
24
28
  size,
25
29
  weight,
26
30
  variant,
@@ -48,7 +52,7 @@ var TfootVanilla = section("tfoot", require_Table_vanilla_css.tfoot, "TfootVanil
48
52
  var ThVanilla = (0, react.forwardRef)(({ size, weight, variant, gradient, transform, noWrap, align, sort, onSort, className, css, style, children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
49
53
  ref,
50
54
  "aria-sort": sort && require_SortButton_vanilla.ARIA_SORT[sort],
51
- className: require_cx.cx(require_Table_vanilla_css.thRecipe({
55
+ className: require_cx.cx(thClass({
52
56
  size,
53
57
  weight,
54
58
  variant,
@@ -96,7 +100,7 @@ var TrVanilla = (0, react.forwardRef)(({ collapsedContent: collapsedContent$1, c
96
100
  },
97
101
  ...props,
98
102
  children: [
99
- emptyFirstColumn && (tableHead ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { className: require_cx.cx(require_Table_vanilla_css.thRecipe(), "_1aa2xbm2e") }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TdVanilla, {})),
103
+ emptyFirstColumn && (tableHead ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { className: require_cx.cx(thClass(), "_1aa2xbm2e") }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TdVanilla, {})),
100
104
  collapsible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TdVanilla, {
101
105
  className: "_1aa2xbm2l",
102
106
  onClick: require_ExpandToggle_vanilla.stopEvent,