@traefik-labs/faency 13.7.1 → 13.8.0

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 (175) hide show
  1. package/README.md +1 -2
  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.js +8 -4
  9. package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -1
  10. package/dist/components/Avatar/Avatar.vanilla.cjs +5 -2
  11. package/dist/components/Avatar/Avatar.vanilla.cjs.map +1 -1
  12. package/dist/components/Avatar/Avatar.vanilla.js +5 -2
  13. package/dist/components/Avatar/Avatar.vanilla.js.map +1 -1
  14. package/dist/components/Badge/Badge.vanilla.cjs +2 -10
  15. package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
  16. package/dist/components/Badge/Badge.vanilla.js +2 -10
  17. package/dist/components/Badge/Badge.vanilla.js.map +1 -1
  18. package/dist/components/Blockquote/Blockquote.vanilla.cjs +5 -11
  19. package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
  20. package/dist/components/Blockquote/Blockquote.vanilla.js +5 -11
  21. package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
  22. package/dist/components/Box/Box.vanilla.cjs +2 -10
  23. package/dist/components/Box/Box.vanilla.cjs.map +1 -1
  24. package/dist/components/Box/Box.vanilla.js +2 -10
  25. package/dist/components/Box/Box.vanilla.js.map +1 -1
  26. package/dist/components/Bubble/Bubble.vanilla.cjs +2 -10
  27. package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
  28. package/dist/components/Bubble/Bubble.vanilla.js +2 -10
  29. package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
  30. package/dist/components/Button/Button.vanilla.cjs +2 -10
  31. package/dist/components/Button/Button.vanilla.cjs.map +1 -1
  32. package/dist/components/Button/Button.vanilla.js +2 -10
  33. package/dist/components/Button/Button.vanilla.js.map +1 -1
  34. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +3 -17
  35. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
  36. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +3 -17
  37. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
  38. package/dist/components/Card/Card.vanilla.cjs +6 -11
  39. package/dist/components/Card/Card.vanilla.cjs.map +1 -1
  40. package/dist/components/Card/Card.vanilla.js +6 -11
  41. package/dist/components/Card/Card.vanilla.js.map +1 -1
  42. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -6
  43. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
  44. package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -6
  45. package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
  46. package/dist/components/Combobox/Combobox.vanilla.cjs +3 -10
  47. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
  48. package/dist/components/Combobox/Combobox.vanilla.js +3 -10
  49. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
  50. package/dist/components/Container/Container.vanilla.cjs +5 -11
  51. package/dist/components/Container/Container.vanilla.cjs.map +1 -1
  52. package/dist/components/Container/Container.vanilla.js +5 -11
  53. package/dist/components/Container/Container.vanilla.js.map +1 -1
  54. package/dist/components/Elevation/Elevation.vanilla.cjs +5 -11
  55. package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
  56. package/dist/components/Elevation/Elevation.vanilla.js +5 -11
  57. package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
  58. package/dist/components/Field/Field.vanilla.cjs +3 -9
  59. package/dist/components/Field/Field.vanilla.cjs.map +1 -1
  60. package/dist/components/Field/Field.vanilla.js +3 -9
  61. package/dist/components/Field/Field.vanilla.js.map +1 -1
  62. package/dist/components/Flex/Flex.vanilla.cjs +5 -11
  63. package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
  64. package/dist/components/Flex/Flex.vanilla.js +5 -11
  65. package/dist/components/Flex/Flex.vanilla.js.map +1 -1
  66. package/dist/components/Grid/Grid.vanilla.cjs +7 -11
  67. package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
  68. package/dist/components/Grid/Grid.vanilla.js +7 -11
  69. package/dist/components/Grid/Grid.vanilla.js.map +1 -1
  70. package/dist/components/Heading/Heading.vanilla.cjs +35 -0
  71. package/dist/components/Heading/Heading.vanilla.cjs.map +1 -0
  72. package/dist/components/Heading/Heading.vanilla.css.cjs +85 -0
  73. package/dist/components/Heading/Heading.vanilla.css.cjs.map +1 -0
  74. package/dist/components/Heading/Heading.vanilla.css.js +74 -0
  75. package/dist/components/Heading/Heading.vanilla.css.js.map +1 -0
  76. package/dist/components/Heading/Heading.vanilla.js +30 -0
  77. package/dist/components/Heading/Heading.vanilla.js.map +1 -0
  78. package/dist/components/IconButton/IconButton.vanilla.cjs +5 -11
  79. package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
  80. package/dist/components/IconButton/IconButton.vanilla.js +5 -11
  81. package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
  82. package/dist/components/Image/Image.vanilla.cjs +2 -10
  83. package/dist/components/Image/Image.vanilla.cjs.map +1 -1
  84. package/dist/components/Image/Image.vanilla.js +2 -10
  85. package/dist/components/Image/Image.vanilla.js.map +1 -1
  86. package/dist/components/Input/Input.vanilla.cjs +2 -10
  87. package/dist/components/Input/Input.vanilla.cjs.map +1 -1
  88. package/dist/components/Input/Input.vanilla.js +2 -10
  89. package/dist/components/Input/Input.vanilla.js.map +1 -1
  90. package/dist/components/Label/Label.vanilla.cjs +5 -11
  91. package/dist/components/Label/Label.vanilla.cjs.map +1 -1
  92. package/dist/components/Label/Label.vanilla.js +5 -11
  93. package/dist/components/Label/Label.vanilla.js.map +1 -1
  94. package/dist/components/List/List.vanilla.cjs +10 -18
  95. package/dist/components/List/List.vanilla.cjs.map +1 -1
  96. package/dist/components/List/List.vanilla.js +7 -15
  97. package/dist/components/List/List.vanilla.js.map +1 -1
  98. package/dist/components/Meter/Meter.vanilla.cjs +3 -8
  99. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
  100. package/dist/components/Meter/Meter.vanilla.js +3 -8
  101. package/dist/components/Meter/Meter.vanilla.js.map +1 -1
  102. package/dist/components/Panel/Panel.vanilla.cjs +2 -10
  103. package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
  104. package/dist/components/Panel/Panel.vanilla.js +2 -10
  105. package/dist/components/Panel/Panel.vanilla.js.map +1 -1
  106. package/dist/components/Paragraph/Paragraph.vanilla.cjs +5 -11
  107. package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
  108. package/dist/components/Paragraph/Paragraph.vanilla.js +5 -11
  109. package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
  110. package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -1
  111. package/dist/components/RowLink/RowLink.vanilla.js.map +1 -1
  112. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -14
  113. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
  114. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -14
  115. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
  116. package/dist/components/Select/Select.vanilla.cjs +136 -0
  117. package/dist/components/Select/Select.vanilla.cjs.map +1 -0
  118. package/dist/components/Select/Select.vanilla.css.cjs +69 -0
  119. package/dist/components/Select/Select.vanilla.css.cjs.map +1 -0
  120. package/dist/components/Select/Select.vanilla.css.js +58 -0
  121. package/dist/components/Select/Select.vanilla.css.js.map +1 -0
  122. package/dist/components/Select/Select.vanilla.js +129 -0
  123. package/dist/components/Select/Select.vanilla.js.map +1 -0
  124. package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -10
  125. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  126. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -10
  127. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  128. package/dist/components/Spinner/Spinner.vanilla.cjs +3 -6
  129. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  130. package/dist/components/Spinner/Spinner.vanilla.js +3 -6
  131. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  132. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +3 -10
  133. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  134. package/dist/components/SplitLayout/SplitLayout.vanilla.js +3 -10
  135. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  136. package/dist/components/Switch/Switch.vanilla.cjs +70 -0
  137. package/dist/components/Switch/Switch.vanilla.cjs.map +1 -0
  138. package/dist/components/Switch/Switch.vanilla.css.cjs +17 -0
  139. package/dist/components/Switch/Switch.vanilla.css.cjs.map +1 -0
  140. package/dist/components/Switch/Switch.vanilla.css.js +17 -0
  141. package/dist/components/Switch/Switch.vanilla.css.js.map +1 -0
  142. package/dist/components/Switch/Switch.vanilla.js +68 -0
  143. package/dist/components/Switch/Switch.vanilla.js.map +1 -0
  144. package/dist/components/Table/Table.vanilla.cjs +8 -4
  145. package/dist/components/Table/Table.vanilla.cjs.map +1 -1
  146. package/dist/components/Table/Table.vanilla.js +8 -4
  147. package/dist/components/Table/Table.vanilla.js.map +1 -1
  148. package/dist/components/Text/Text.vanilla.cjs +5 -11
  149. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  150. package/dist/components/Text/Text.vanilla.js +5 -11
  151. package/dist/components/Text/Text.vanilla.js.map +1 -1
  152. package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
  153. package/dist/components/TextField/TextField.vanilla.js.map +1 -1
  154. package/dist/components/Textarea/Textarea.vanilla.cjs +2 -10
  155. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  156. package/dist/components/Textarea/Textarea.vanilla.js +2 -10
  157. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  158. package/dist/components/Toast/Toast.vanilla.cjs +4 -15
  159. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  160. package/dist/components/Toast/Toast.vanilla.js +4 -15
  161. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  162. package/dist/faency.css +3098 -2517
  163. package/dist/index.cjs +17 -0
  164. package/dist/index.d.cts +36968 -0
  165. package/dist/index.d.ts +416 -94
  166. package/dist/index.js +5 -1
  167. package/dist/styles/recipeVariants.cjs +15 -0
  168. package/dist/styles/recipeVariants.cjs.map +1 -0
  169. package/dist/styles/recipeVariants.js +15 -0
  170. package/dist/styles/recipeVariants.js.map +1 -0
  171. package/dist/styles/themeContext.cjs.map +1 -1
  172. package/dist/styles/themeContext.js.map +1 -1
  173. package/dist/styles/tokens.css.cjs +146 -133
  174. package/dist/styles/tokens.css.js +146 -133
  175. package/package.json +18 -7
@@ -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,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;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,WAAWH,WAAAA,GAAGO,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
+ {"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,SA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AO,KAAA;EACtB,UAAU;EACV,OAAM;EACN,WAAA;EACe;EACA;EACJ;EAEX,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAA,YAAwB,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,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;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,S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AiB,eAAe,MAAM;EAC7C,OAAO,iBAAiB,aAAa,IAAI;EACzC,OAAO,iBAAiB,iBAAiB,IAAI;CAC/C,GACA,CAAC,QAAQ,OAAO,CAClB;CAEA,MAAM,gBAAgB,kBAAkB;EACtC,UAAU,IAAI;EACd,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
+ {"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,aAAa,QAAQ,YAAY,GAAG,GAAG,OAAO,KAAK,CAAC;CAClE,QAAQ,CAER;AACF;AAEA,IAAM,eAAe,OAAe;CAClC,MAAM,QAAQ,eAAe,GAAG;CAChC,MAAM,YAAY,aACf,aAAyB;EACxB,MAAM,KAAK,OAAO,WAAW,KAAK;EAClC,GAAG,iBAAiB,UAAU,QAAQ;EACtC,aAAa,GAAG,oBAAoB,UAAU,QAAQ;CACxD,GACA,CAAC,KAAK,CACR;CAEA,OAAO,qBACL,iBACM,OAAO,WAAW,KAAK,CAAC,CAAC,eACzB,KACR;AACF;AASA,IAAM,eAAe,cAAwC,IA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A,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"}
@@ -0,0 +1,70 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_cx = require("../../styles/cx.cjs");
3
+ const require_recipeVariants = require("../../styles/recipeVariants.cjs");
4
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
5
+ const require_FieldContext = require("../Field/FieldContext.cjs");
6
+ const require_Switch_vanilla_css = require("./Switch.vanilla.css.cjs");
7
+ let react = require("react");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ let _radix_ui_react_switch = require("@radix-ui/react-switch");
10
+ _radix_ui_react_switch = require_runtime.__toESM(_radix_ui_react_switch, 1);
11
+ // components/Switch/Switch.vanilla.tsx
12
+ var switchClass = require_recipeVariants.withVariantKeys(require_Switch_vanilla_css.switchRecipe);
13
+ var SwitchVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, style, size, id, checked, defaultChecked, onCheckedChange, disabled, required, name, value, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-labelledby": ariaLabelledBy, ...props }, ref) => {
14
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
15
+ const recipeClass = switchClass({ size });
16
+ const control = require_FieldContext.useFieldControl({
17
+ id,
18
+ disabled,
19
+ "aria-describedby": ariaDescribedBy,
20
+ "aria-invalid": ariaInvalid,
21
+ labelable: !as
22
+ });
23
+ if (as) {
24
+ const Component = as;
25
+ const state = checked ?? defaultChecked ? "checked" : "unchecked";
26
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
27
+ ...props,
28
+ ref,
29
+ id: control.id,
30
+ role: "switch",
31
+ "aria-checked": state === "checked",
32
+ "aria-readonly": true,
33
+ "aria-disabled": control.disabled,
34
+ "aria-labelledby": ariaLabelledBy ?? control.labelId,
35
+ "aria-describedby": control["aria-describedby"],
36
+ "aria-invalid": control["aria-invalid"],
37
+ "data-state": state,
38
+ "data-disabled": control.disabled ? "" : void 0,
39
+ className: require_cx.cx(recipeClass, className),
40
+ style: mergedStyles,
41
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
42
+ "data-state": state,
43
+ className: require_Switch_vanilla_css.switchThumb
44
+ })
45
+ });
46
+ }
47
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_switch.Root, {
48
+ ...props,
49
+ ref,
50
+ id: control.id,
51
+ checked,
52
+ defaultChecked,
53
+ onCheckedChange,
54
+ disabled: control.disabled,
55
+ required,
56
+ name,
57
+ value,
58
+ "aria-labelledby": ariaLabelledBy,
59
+ "aria-describedby": control["aria-describedby"],
60
+ "aria-invalid": control["aria-invalid"],
61
+ className: require_cx.cx(recipeClass, className),
62
+ style: mergedStyles,
63
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_switch.Thumb, { className: require_Switch_vanilla_css.switchThumb })
64
+ });
65
+ });
66
+ SwitchVanillaComponentImpl.displayName = "SwitchVanilla";
67
+ var SwitchVanilla = SwitchVanillaComponentImpl;
68
+ exports.SwitchVanilla = SwitchVanilla;
69
+
70
+ //# sourceMappingURL=Switch.vanilla.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.vanilla.cjs","names":["withVariantKeys","switchRecipe","forwardRef","useInlineStyle","useFieldControl","cx","switchThumb","SwitchPrimitive"],"sources":["../../../components/Switch/Switch.vanilla.tsx"],"sourcesContent":["import * as SwitchPrimitive from '@radix-ui/react-switch';\nimport { 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 { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { useFieldControl } from '@/components/Field/FieldContext';\n\nimport { switchRecipe, switchThumb } from './Switch.vanilla.css';\n\nconst switchClass = withVariantKeys(switchRecipe);\n\ntype SwitchRecipeVariants = RecipeVariantProps<typeof switchRecipe>;\n\ninterface SwitchVanillaOwnProps extends SwitchRecipeVariants, CSSProps {\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n value?: string;\n}\n\nexport type SwitchVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n SwitchVanillaOwnProps\n>;\n\ntype SwitchVanillaComponent = PolymorphicComponent<'button', SwitchVanillaProps<ElementType>>;\n\nconst SwitchVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n {\n as,\n className,\n css,\n style,\n size,\n id,\n checked,\n defaultChecked,\n onCheckedChange,\n disabled,\n required,\n name,\n value,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n }: SwitchVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const mergedStyles = useInlineStyle(css, style);\n const recipeClass = switchClass({ size });\n\n const control = useFieldControl({\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n labelable: !as,\n });\n\n // With `as`, the switch is a read-only indicator of `checked`, not a control.\n if (as) {\n const Component = as as ElementType;\n const state = (checked ?? defaultChecked) ? 'checked' : 'unchecked';\n\n return (\n <Component\n {...props}\n ref={ref}\n id={control.id}\n role=\"switch\"\n aria-checked={state === 'checked'}\n aria-readonly\n aria-disabled={control.disabled}\n aria-labelledby={ariaLabelledBy ?? control.labelId}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n data-state={state}\n data-disabled={control.disabled ? '' : undefined}\n className={cx(recipeClass, className)}\n style={mergedStyles}\n >\n <span data-state={state} className={switchThumb} />\n </Component>\n );\n }\n\n return (\n <SwitchPrimitive.Root\n {...props}\n ref={ref}\n id={control.id}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange}\n disabled={control.disabled}\n required={required}\n name={name}\n value={value}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n className={cx(recipeClass, className)}\n style={mergedStyles}\n >\n <SwitchPrimitive.Thumb className={switchThumb} />\n </SwitchPrimitive.Root>\n );\n },\n);\n\nSwitchVanillaComponentImpl.displayName = 'SwitchVanilla';\n\nexport const SwitchVanilla = SwitchVanillaComponentImpl as SwitchVanillaComponent;\n"],"mappings":";;;;;;;;;;;AAiBA,IAAM,cAAcA,uBAAAA,gBAAgBC,2BAAAA,YAAY;AAqBhD,IAAM,8BAAA,GAA6BC,MAAAA,WAAAA,EAE/B,EACE,IACA,WACA,KACA,OACA,MACA,IACA,SACA,gBACA,iBACA,UACA,UACA,MACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,mBAAmB,gBACnB,GAAG,SAEL,QACG;CACH,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAC9C,MAAM,cAAc,YAAY,EAAE,KAAK,CAAC;CAExC,MAAM,UAAUC,qBAAAA,gBAAgB;EAC9B;EACA;EACA,oBAAoB;EACpB,gBAAgB;EAChB,WAAW,CAAC;CACd,CAAC;CAGD,IAAI,IAAI;EACN,MAAM,YAAY;EAClB,MAAM,QAAS,WAAW,iBAAkB,YAAY;EAExD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;GACE,GAAI;GACC;GACL,IAAI,QAAQ;GACZ,MAAK;GACL,gBAAc,UAAU;GACxB,iBAAA;GACA,iBAAe,QAAQ;GACvB,mBAAiB,kBAAkB,QAAQ;GAC3C,oBAAkB,QAAQ;GAC1B,gBAAc,QAAQ;GACtB,cAAY;GACZ,iBAAe,QAAQ,WAAW,KAAK,KAAA;GACvC,WAAWC,WAAAA,GAAG,aAAa,SAAS;GACpC,OAAO;GAEP,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,cAAY;IAAO,WAAWC,2BAAAA;GAAc,CAAA;EACzC,CAAA;CAEf;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAgB,MAAjB;EACE,GAAI;EACC;EACL,IAAI,QAAQ;EACH;EACO;EACC;EACjB,UAAU,QAAQ;EACR;EACJ;EACC;EACP,mBAAiB;EACjB,oBAAkB,QAAQ;EAC1B,gBAAc,QAAQ;EACtB,WAAWF,WAAAA,GAAG,aAAa,SAAS;EACpC,OAAO;EAEP,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACE,uBAAgB,OAAjB,EAAuB,WAAWD,2BAAAA,YAAc,CAAA;CAC5B,CAAA;AAE1B,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
@@ -0,0 +1,17 @@
1
+ ;/* empty css */
2
+ ;/* empty css */
3
+ // components/Switch/Switch.vanilla.css.ts
4
+ var switchRecipe = (0, require("@vanilla-extract/recipes/createRuntimeFn").createRuntimeFn)({
5
+ defaultClassName: "_43j34p3",
6
+ variantClassNames: { size: {
7
+ "1": "_43j34p4",
8
+ "2": "_43j34p5"
9
+ } },
10
+ defaultVariants: { size: "1" },
11
+ compoundVariants: []
12
+ });
13
+ var switchThumb = "_43j34p6";
14
+ exports.switchRecipe = switchRecipe;
15
+ exports.switchThumb = switchThumb;
16
+
17
+ //# sourceMappingURL=Switch.vanilla.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.vanilla.css.cjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
4
+ // components/Switch/Switch.vanilla.css.ts
5
+ var switchRecipe = createRuntimeFn({
6
+ defaultClassName: "_43j34p3",
7
+ variantClassNames: { size: {
8
+ "1": "_43j34p4",
9
+ "2": "_43j34p5"
10
+ } },
11
+ defaultVariants: { size: "1" },
12
+ compoundVariants: []
13
+ });
14
+ var switchThumb = "_43j34p6";
15
+ export { switchRecipe, switchThumb };
16
+
17
+ //# sourceMappingURL=Switch.vanilla.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.vanilla.css.js","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,68 @@
1
+ import { cx } from "../../styles/cx.js";
2
+ import { withVariantKeys } from "../../styles/recipeVariants.js";
3
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
+ import { useFieldControl } from "../Field/FieldContext.js";
5
+ import { switchRecipe, switchThumb } from "./Switch.vanilla.css.js";
6
+ import { forwardRef } from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import * as SwitchPrimitive from "@radix-ui/react-switch";
9
+ // components/Switch/Switch.vanilla.tsx
10
+ var switchClass = withVariantKeys(switchRecipe);
11
+ var SwitchVanillaComponentImpl = forwardRef(({ as, className, css, style, size, id, checked, defaultChecked, onCheckedChange, disabled, required, name, value, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-labelledby": ariaLabelledBy, ...props }, ref) => {
12
+ const mergedStyles = useInlineStyle(css, style);
13
+ const recipeClass = switchClass({ size });
14
+ const control = useFieldControl({
15
+ id,
16
+ disabled,
17
+ "aria-describedby": ariaDescribedBy,
18
+ "aria-invalid": ariaInvalid,
19
+ labelable: !as
20
+ });
21
+ if (as) {
22
+ const Component = as;
23
+ const state = checked ?? defaultChecked ? "checked" : "unchecked";
24
+ return /* @__PURE__ */ jsx(Component, {
25
+ ...props,
26
+ ref,
27
+ id: control.id,
28
+ role: "switch",
29
+ "aria-checked": state === "checked",
30
+ "aria-readonly": true,
31
+ "aria-disabled": control.disabled,
32
+ "aria-labelledby": ariaLabelledBy ?? control.labelId,
33
+ "aria-describedby": control["aria-describedby"],
34
+ "aria-invalid": control["aria-invalid"],
35
+ "data-state": state,
36
+ "data-disabled": control.disabled ? "" : void 0,
37
+ className: cx(recipeClass, className),
38
+ style: mergedStyles,
39
+ children: /* @__PURE__ */ jsx("span", {
40
+ "data-state": state,
41
+ className: switchThumb
42
+ })
43
+ });
44
+ }
45
+ return /* @__PURE__ */ jsx(SwitchPrimitive.Root, {
46
+ ...props,
47
+ ref,
48
+ id: control.id,
49
+ checked,
50
+ defaultChecked,
51
+ onCheckedChange,
52
+ disabled: control.disabled,
53
+ required,
54
+ name,
55
+ value,
56
+ "aria-labelledby": ariaLabelledBy,
57
+ "aria-describedby": control["aria-describedby"],
58
+ "aria-invalid": control["aria-invalid"],
59
+ className: cx(recipeClass, className),
60
+ style: mergedStyles,
61
+ children: /* @__PURE__ */ jsx(SwitchPrimitive.Thumb, { className: switchThumb })
62
+ });
63
+ });
64
+ SwitchVanillaComponentImpl.displayName = "SwitchVanilla";
65
+ var SwitchVanilla = SwitchVanillaComponentImpl;
66
+ export { SwitchVanilla };
67
+
68
+ //# sourceMappingURL=Switch.vanilla.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.vanilla.js","names":[],"sources":["../../../components/Switch/Switch.vanilla.tsx"],"sourcesContent":["import * as SwitchPrimitive from '@radix-ui/react-switch';\nimport { 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 { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { useFieldControl } from '@/components/Field/FieldContext';\n\nimport { switchRecipe, switchThumb } from './Switch.vanilla.css';\n\nconst switchClass = withVariantKeys(switchRecipe);\n\ntype SwitchRecipeVariants = RecipeVariantProps<typeof switchRecipe>;\n\ninterface SwitchVanillaOwnProps extends SwitchRecipeVariants, CSSProps {\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n value?: string;\n}\n\nexport type SwitchVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n SwitchVanillaOwnProps\n>;\n\ntype SwitchVanillaComponent = PolymorphicComponent<'button', SwitchVanillaProps<ElementType>>;\n\nconst SwitchVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n {\n as,\n className,\n css,\n style,\n size,\n id,\n checked,\n defaultChecked,\n onCheckedChange,\n disabled,\n required,\n name,\n value,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n }: SwitchVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const mergedStyles = useInlineStyle(css, style);\n const recipeClass = switchClass({ size });\n\n const control = useFieldControl({\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n labelable: !as,\n });\n\n // With `as`, the switch is a read-only indicator of `checked`, not a control.\n if (as) {\n const Component = as as ElementType;\n const state = (checked ?? defaultChecked) ? 'checked' : 'unchecked';\n\n return (\n <Component\n {...props}\n ref={ref}\n id={control.id}\n role=\"switch\"\n aria-checked={state === 'checked'}\n aria-readonly\n aria-disabled={control.disabled}\n aria-labelledby={ariaLabelledBy ?? control.labelId}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n data-state={state}\n data-disabled={control.disabled ? '' : undefined}\n className={cx(recipeClass, className)}\n style={mergedStyles}\n >\n <span data-state={state} className={switchThumb} />\n </Component>\n );\n }\n\n return (\n <SwitchPrimitive.Root\n {...props}\n ref={ref}\n id={control.id}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange}\n disabled={control.disabled}\n required={required}\n name={name}\n value={value}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n className={cx(recipeClass, className)}\n style={mergedStyles}\n >\n <SwitchPrimitive.Thumb className={switchThumb} />\n </SwitchPrimitive.Root>\n );\n },\n);\n\nSwitchVanillaComponentImpl.displayName = 'SwitchVanilla';\n\nexport const SwitchVanilla = SwitchVanillaComponentImpl as SwitchVanillaComponent;\n"],"mappings":";;;;;;;;;AAiBA,IAAM,cAAc,gBAAgB,YAAY;AAqBhD,IAAM,6BAA6B,YAE/B,EACE,IACA,WACA,KACA,OACA,MACA,IACA,SACA,gBACA,iBACA,UACA,UACA,MACA,OACA,oBAAoB,iBACpB,gBAAgB,aAChB,mBAAmB,gBACnB,GAAG,SAEL,QACG;CACH,MAAM,eAAe,eAAe,KAAK,KAAK;CAC9C,MAAM,cAAc,YAAY,EAAE,KAAK,CAAC;CAExC,MAAM,UAAU,gBAAgB;EAC9B;EACA;EACA,oBAAoB;EACpB,gBAAgB;EAChB,WAAW,CAAC;CACd,CAAC;CAGD,IAAI,IAAI;EACN,MAAM,YAAY;EAClB,MAAM,QAAS,WAAW,iBAAkB,YAAY;EAExD,OACE,oBAAC,WAAD;GACE,GAAI;GACC;GACL,IAAI,QAAQ;GACZ,MAAK;GACL,gBAAc,UAAU;GACxB,iBAAA;GACA,iBAAe,QAAQ;GACvB,mBAAiB,kBAAkB,QAAQ;GAC3C,oBAAkB,QAAQ;GAC1B,gBAAc,QAAQ;GACtB,cAAY;GACZ,iBAAe,QAAQ,WAAW,KAAK,KAAA;GACvC,WAAW,GAAG,aAAa,SAAS;GACpC,OAAO;GAEP,UAAA,oBAAC,QAAD;IAAM,cAAY;IAAO,WAAW;GAAc,CAAA;EACzC,CAAA;CAEf;CAEA,OACE,oBAAC,gBAAgB,MAAjB;EACE,GAAI;EACC;EACL,IAAI,QAAQ;EACH;EACO;EACC;EACjB,UAAU,QAAQ;EACR;EACJ;EACC;EACP,mBAAiB;EACjB,oBAAkB,QAAQ;EAC1B,gBAAc,QAAQ;EACtB,WAAW,GAAG,aAAa,SAAS;EACpC,OAAO;EAEP,UAAA,oBAAC,gBAAgB,OAAjB,EAAuB,WAAW,YAAc,CAAA;CAC5B,CAAA;AAE1B,CACF;AAEA,2BAA2B,cAAc;AAEzC,IAAa,gBAAgB"}
@@ -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,