@traefik-labs/faency 13.7.1 → 13.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) 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/Skeleton/Skeleton.vanilla.cjs +2 -10
  117. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  118. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -10
  119. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  120. package/dist/components/Spinner/Spinner.vanilla.cjs +3 -6
  121. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  122. package/dist/components/Spinner/Spinner.vanilla.js +3 -6
  123. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  124. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +3 -10
  125. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  126. package/dist/components/SplitLayout/SplitLayout.vanilla.js +3 -10
  127. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  128. package/dist/components/Table/Table.vanilla.cjs +8 -4
  129. package/dist/components/Table/Table.vanilla.cjs.map +1 -1
  130. package/dist/components/Table/Table.vanilla.js +8 -4
  131. package/dist/components/Table/Table.vanilla.js.map +1 -1
  132. package/dist/components/Text/Text.vanilla.cjs +5 -11
  133. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  134. package/dist/components/Text/Text.vanilla.js +5 -11
  135. package/dist/components/Text/Text.vanilla.js.map +1 -1
  136. package/dist/components/TextField/TextField.vanilla.cjs.map +1 -1
  137. package/dist/components/TextField/TextField.vanilla.js.map +1 -1
  138. package/dist/components/Textarea/Textarea.vanilla.cjs +2 -10
  139. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  140. package/dist/components/Textarea/Textarea.vanilla.js +2 -10
  141. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  142. package/dist/components/Toast/Toast.vanilla.cjs +4 -15
  143. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  144. package/dist/components/Toast/Toast.vanilla.js +4 -15
  145. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  146. package/dist/faency.css +118 -2
  147. package/dist/index.cjs +9 -0
  148. package/dist/index.d.cts +36800 -0
  149. package/dist/index.d.ts +248 -94
  150. package/dist/index.js +3 -1
  151. package/dist/styles/recipeVariants.cjs +15 -0
  152. package/dist/styles/recipeVariants.cjs.map +1 -0
  153. package/dist/styles/recipeVariants.js +15 -0
  154. package/dist/styles/recipeVariants.js.map +1 -0
  155. package/dist/styles/themeContext.cjs.map +1 -1
  156. package/dist/styles/themeContext.js.map +1 -1
  157. package/package.json +17 -7
@@ -1,32 +1,24 @@
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_recipeVariants = require("../../styles/recipeVariants.cjs");
4
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
5
5
  const require_warnOnce = require("../../utils/warnOnce.cjs");
6
6
  const require_Flex_vanilla_css = require("../Flex/Flex.vanilla.css.cjs");
7
7
  const require_List_vanilla_css = require("./List.vanilla.css.cjs");
8
8
  let react = require("react");
9
9
  react = require_runtime.__toESM(react, 1);
10
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
11
10
  let react_jsx_runtime = require("react/jsx-runtime");
12
11
  // components/List/List.vanilla.tsx
12
+ var flexClass = require_recipeVariants.withVariantKeys(require_Flex_vanilla_css.flexRecipe);
13
+ var liClass = require_recipeVariants.withVariantKeys(require_List_vanilla_css.liRecipe);
13
14
  var ListVanillaContext = (0, react.createContext)({ interactive: false });
14
- var useInlineStyle = (css, style) => {
15
- const { colors } = require_themeContext.useVanillaExtractTheme();
16
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
17
- return {
18
- ...cssStyles,
19
- ...style,
20
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
21
- };
22
- };
23
15
  var useListContextValue = (interactive) => {
24
16
  const parent = (0, react.useContext)(ListVanillaContext);
25
17
  return (0, react.useMemo)(() => ({ interactive: interactive ?? parent.interactive }), [interactive, parent.interactive]);
26
18
  };
27
19
  var UlVanilla = (0, react.forwardRef)(({ interactive, className, css, style, ...props }, ref) => {
28
20
  const contextValue = useListContextValue(interactive);
29
- const inlineStyle = useInlineStyle(css, style);
21
+ const inlineStyle = require_useInlineStyle.useInlineStyle(css, style);
30
22
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListVanillaContext.Provider, {
31
23
  value: contextValue,
32
24
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
@@ -41,7 +33,7 @@ var UlVanilla = (0, react.forwardRef)(({ interactive, className, css, style, ...
41
33
  UlVanilla.displayName = "UlVanilla";
42
34
  var OlVanilla = (0, react.forwardRef)(({ interactive, className, css, style, ...props }, ref) => {
43
35
  const contextValue = useListContextValue(interactive);
44
- const inlineStyle = useInlineStyle(css, style);
36
+ const inlineStyle = require_useInlineStyle.useInlineStyle(css, style);
45
37
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListVanillaContext.Provider, {
46
38
  value: contextValue,
47
39
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
@@ -74,7 +66,7 @@ var splitNestedLists = (children) => {
74
66
  };
75
67
  var LiVanilla = (0, react.forwardRef)(({ controls, disabled, elevation, align, justify, direction, gap, wrap, className, css, style, children, ...props }, ref) => {
76
68
  const { interactive } = (0, react.useContext)(ListVanillaContext);
77
- const inlineStyle = useInlineStyle(css, style);
69
+ const inlineStyle = require_useInlineStyle.useInlineStyle(css, style);
78
70
  const { content, nestedLists } = splitNestedLists(children);
79
71
  const contentRef = (0, react.useRef)(null);
80
72
  const setContentRef = (0, react.useCallback)((node) => {
@@ -85,7 +77,7 @@ var LiVanilla = (0, react.forwardRef)(({ controls, disabled, elevation, align, j
85
77
  });
86
78
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
87
79
  ref,
88
- className: require_cx.cx(require_List_vanilla_css.liRecipe({ elevation }), className),
80
+ className: require_cx.cx(liClass({ elevation }), className),
89
81
  style: inlineStyle,
90
82
  ...props,
91
83
  children: [
@@ -93,7 +85,7 @@ var LiVanilla = (0, react.forwardRef)(({ controls, disabled, elevation, align, j
93
85
  ref: setContentRef,
94
86
  type: "button",
95
87
  disabled,
96
- className: require_cx.cx(require_Flex_vanilla_css.flexRecipe({
88
+ className: require_cx.cx(flexClass({
97
89
  align,
98
90
  justify,
99
91
  direction,
@@ -103,7 +95,7 @@ var LiVanilla = (0, react.forwardRef)(({ controls, disabled, elevation, align, j
103
95
  children: content
104
96
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
105
97
  ref: setContentRef,
106
- className: require_cx.cx(require_Flex_vanilla_css.flexRecipe({
98
+ className: require_cx.cx(flexClass({
107
99
  align: align ?? "center",
108
100
  justify,
109
101
  direction,
@@ -1 +1 @@
1
- {"version":3,"file":"List.vanilla.cjs","names":["createContext","useVanillaExtractTheme","processCSSProp","assignInlineVars","useContext","useMemo","forwardRef","cx","ul","ol","isValidElement","Fragment","useRef","useCallback","liRecipe","flexRecipe","itemButton","itemText"],"sources":["../../../components/List/List.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, {\n Children,\n createContext,\n CSSProperties,\n forwardRef,\n Fragment,\n isValidElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { warnOnce } from '../../utils/warnOnce';\nimport { flexRecipe } from '../Flex/Flex.vanilla.css';\nimport { controlsWrapper, itemButton, itemText, liRecipe, ol, ul } from './List.vanilla.css';\n\nconst ListVanillaContext = createContext({ interactive: false });\n\nconst useInlineStyle = (css: CSSProps['css'], style?: CSSProperties) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n return { ...cssStyles, ...style, ...assignInlineVars(vars) };\n};\n\nconst useListContextValue = (interactive?: boolean) => {\n const parent = useContext(ListVanillaContext);\n return useMemo(\n () => ({ interactive: interactive ?? parent.interactive }),\n [interactive, parent.interactive],\n );\n};\n\ntype ListOwnProps = CSSProps & {\n /** Renders the items as buttons. Nested lists inherit it. */\n interactive?: boolean;\n};\n\nexport type UlVanillaProps = React.HTMLAttributes<HTMLUListElement> & ListOwnProps;\n\nexport const UlVanilla = forwardRef<HTMLUListElement, UlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ul ref={ref} role=\"list\" className={cx(ul, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nUlVanilla.displayName = 'UlVanilla';\n\nexport type OlVanillaProps = React.OlHTMLAttributes<HTMLOListElement> & ListOwnProps;\n\nexport const OlVanilla = forwardRef<HTMLOListElement, OlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ol ref={ref} role=\"list\" className={cx(ol, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nOlVanilla.displayName = 'OlVanilla';\n\ntype LiRecipeVariants = NonNullable<RecipeVariants<typeof liRecipe>>;\n\nexport type LiVanillaProps = React.LiHTMLAttributes<HTMLLIElement> &\n CSSProps &\n LiRecipeVariants & {\n /** Shown on the right of the item, outside its button. */\n controls?: ReactNode;\n /** Disables the item's button. Only applies in an interactive list. */\n disabled?: boolean;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n direction?: FlexDirection;\n gap?: Gap;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n };\n\nconst NESTED_LIST_WARNING =\n 'LiVanilla: a nested list is rendered inside the item content, so it ends up in its button or span. ' +\n 'Make UlVanilla or OlVanilla a direct child of LiVanilla, and wrap only its items in your component.';\n\n// Looks into fragments, but not into components: what they render is unknown at this point.\nconst splitNestedLists = (children: ReactNode) => {\n const content: ReactNode[] = [];\n const nestedLists: ReactNode[] = [];\n\n // eslint-disable-next-line @eslint-react/no-children-to-array\n Children.toArray(children).forEach((child) => {\n if (!isValidElement<{ children?: ReactNode }>(child)) {\n content.push(child);\n } else if (child.type === UlVanilla || child.type === OlVanilla) {\n nestedLists.push(child);\n } else if (child.type === Fragment) {\n const inner = splitNestedLists(child.props.children);\n content.push(<Fragment key={child.key}>{inner.content}</Fragment>);\n if (inner.nestedLists.length) {\n nestedLists.push(<Fragment key={child.key}>{inner.nestedLists}</Fragment>);\n }\n } else {\n content.push(child);\n }\n });\n\n return { content, nestedLists };\n};\n\nexport const LiVanilla = forwardRef<HTMLLIElement, LiVanillaProps>(\n (\n {\n controls,\n disabled,\n elevation,\n align,\n justify,\n direction,\n gap,\n wrap,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const { interactive } = useContext(ListVanillaContext);\n const inlineStyle = useInlineStyle(css, style);\n const { content, nestedLists } = splitNestedLists(children);\n\n const contentRef = useRef<HTMLElement | null>(null);\n const setContentRef = useCallback((node: HTMLElement | null) => {\n contentRef.current = node;\n }, []);\n\n // A list rendered by a wrapper component can't be detected before render.\n useEffect(() => {\n if (contentRef.current?.querySelector('ul, ol')) {\n warnOnce(NESTED_LIST_WARNING);\n }\n });\n\n return (\n <li\n ref={ref}\n className={cx(liRecipe({ elevation }), className)}\n style={inlineStyle}\n {...props}\n >\n {interactive ? (\n <button\n ref={setContentRef}\n type=\"button\"\n disabled={disabled}\n className={cx(flexRecipe({ align, justify, direction, gap, wrap }), itemButton)}\n >\n {content}\n </button>\n ) : (\n <span\n ref={setContentRef}\n className={cx(\n flexRecipe({ align: align ?? 'center', justify, direction, gap: gap ?? 1, wrap }),\n itemText,\n )}\n >\n {content}\n </span>\n )}\n {nestedLists}\n {!!controls && <div className={controlsWrapper}>{controls}</div>}\n </li>\n );\n },\n);\n\nLiVanilla.displayName = 'LiVanilla';\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAM,sBAAA,GAAqBA,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UAAU;CACvB,GAAG,CAAC,CAAC;CAGL,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,IAAI,WAAW,SAAS,cAAc,QAAQ,GAC5C,iBAAA,SAAS,mBAAmB;CAEhC,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,MAAD;EACO;EACL,WAAWN,WAAAA,GAAGO,yBAAAA,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS;EAChD,OAAO;EACP,GAAI;EAJN,UAAA;GAMG,cACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;IACE,KAAK;IACL,MAAK;IACK;IACV,WAAWP,WAAAA,GAAGQ,yBAAAA,WAAW;KAAE;KAAO;KAAS;KAAW;KAAK;IAAK,CAAC,GAAGC,yBAAAA,UAAU;IAE7E,UAAA;GACK,CAAA,IAER,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IACE,KAAK;IACL,WAAWT,WAAAA,GACTQ,yBAAAA,WAAW;KAAE,OAAO,SAAS;KAAU;KAAS;KAAW,KAAK,OAAO;KAAG;IAAK,CAAC,GAChFE,yBAAAA,QACF;IAEC,UAAA;GACG,CAAA;GAEP;GACA,CAAC,CAAC,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAA;IAA6B,UAAA;GAAc,CAAA;EAC7D;;AAER,CACF;AAEA,UAAU,cAAc"}
1
+ {"version":3,"file":"List.vanilla.cjs","names":["withVariantKeys","flexRecipe","liRecipe","createContext","useContext","useMemo","forwardRef","useInlineStyle","cx","ul","ol","isValidElement","Fragment","useRef","useCallback","itemButton","itemText"],"sources":["../../../components/List/List.vanilla.tsx"],"sourcesContent":["import React, {\n Children,\n createContext,\n forwardRef,\n Fragment,\n isValidElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '@/styles/types';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\nimport { warnOnce } from '@/utils/warnOnce';\n\nimport { flexRecipe } from '@/components/Flex/Flex.vanilla.css';\n\nimport { controlsWrapper, itemButton, itemText, liRecipe, ol, ul } from './List.vanilla.css';\n\nconst flexClass = withVariantKeys(flexRecipe);\nconst liClass = withVariantKeys(liRecipe);\n\nconst ListVanillaContext = createContext({ interactive: false });\n\nconst useListContextValue = (interactive?: boolean) => {\n const parent = useContext(ListVanillaContext);\n return useMemo(\n () => ({ interactive: interactive ?? parent.interactive }),\n [interactive, parent.interactive],\n );\n};\n\ntype ListOwnProps = CSSProps & {\n /** Renders the items as buttons. Nested lists inherit it. */\n interactive?: boolean;\n};\n\nexport type UlVanillaProps = React.HTMLAttributes<HTMLUListElement> & ListOwnProps;\n\nexport const UlVanilla = forwardRef<HTMLUListElement, UlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ul ref={ref} role=\"list\" className={cx(ul, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nUlVanilla.displayName = 'UlVanilla';\n\nexport type OlVanillaProps = React.OlHTMLAttributes<HTMLOListElement> & ListOwnProps;\n\nexport const OlVanilla = forwardRef<HTMLOListElement, OlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ol ref={ref} role=\"list\" className={cx(ol, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nOlVanilla.displayName = 'OlVanilla';\n\ntype LiRecipeVariants = RecipeVariantProps<typeof liRecipe>;\n\nexport type LiVanillaProps = React.LiHTMLAttributes<HTMLLIElement> &\n CSSProps &\n LiRecipeVariants & {\n /** Shown on the right of the item, outside its button. */\n controls?: ReactNode;\n /** Disables the item's button. Only applies in an interactive list. */\n disabled?: boolean;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n direction?: FlexDirection;\n gap?: Gap;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n };\n\nconst NESTED_LIST_WARNING =\n 'LiVanilla: a nested list is rendered inside the item content, so it ends up in its button or span. ' +\n 'Make UlVanilla or OlVanilla a direct child of LiVanilla, and wrap only its items in your component.';\n\n// Looks into fragments, but not into components: what they render is unknown at this point.\nconst splitNestedLists = (children: ReactNode) => {\n const content: ReactNode[] = [];\n const nestedLists: ReactNode[] = [];\n\n // eslint-disable-next-line @eslint-react/no-children-to-array\n Children.toArray(children).forEach((child) => {\n if (!isValidElement<{ children?: ReactNode }>(child)) {\n content.push(child);\n } else if (child.type === UlVanilla || child.type === OlVanilla) {\n nestedLists.push(child);\n } else if (child.type === Fragment) {\n const inner = splitNestedLists(child.props.children);\n content.push(<Fragment key={child.key}>{inner.content}</Fragment>);\n if (inner.nestedLists.length) {\n nestedLists.push(<Fragment key={child.key}>{inner.nestedLists}</Fragment>);\n }\n } else {\n content.push(child);\n }\n });\n\n return { content, nestedLists };\n};\n\nexport const LiVanilla = forwardRef<HTMLLIElement, LiVanillaProps>(\n (\n {\n controls,\n disabled,\n elevation,\n align,\n justify,\n direction,\n gap,\n wrap,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const { interactive } = useContext(ListVanillaContext);\n const inlineStyle = useInlineStyle(css, style);\n const { content, nestedLists } = splitNestedLists(children);\n\n const contentRef = useRef<HTMLElement | null>(null);\n const setContentRef = useCallback((node: HTMLElement | null) => {\n contentRef.current = node;\n }, []);\n\n // A list rendered by a wrapper component can't be detected before render.\n useEffect(() => {\n if (contentRef.current?.querySelector('ul, ol')) {\n warnOnce(NESTED_LIST_WARNING);\n }\n });\n\n return (\n <li\n ref={ref}\n className={cx(liClass({ elevation }), className)}\n style={inlineStyle}\n {...props}\n >\n {interactive ? (\n <button\n ref={setContentRef}\n type=\"button\"\n disabled={disabled}\n className={cx(flexClass({ align, justify, direction, gap, wrap }), itemButton)}\n >\n {content}\n </button>\n ) : (\n <span\n ref={setContentRef}\n className={cx(\n flexClass({ align: align ?? 'center', justify, direction, gap: gap ?? 1, wrap }),\n itemText,\n )}\n >\n {content}\n </span>\n )}\n {nestedLists}\n {!!controls && <div className={controlsWrapper}>{controls}</div>}\n </li>\n );\n },\n);\n\nLiVanilla.displayName = 'LiVanilla';\n"],"mappings":";;;;;;;;;;;AA8BA,IAAM,YAAYA,uBAAAA,gBAAgBC,yBAAAA,UAAU;AAC5C,IAAM,UAAUD,uBAAAA,gBAAgBE,yBAAAA,QAAQ;AAExC,IAAM,sBAAA,GAAqBC,MAAAA,cAAAA,CAAc,EAAE,aAAa,MAAM,CAAC;AAE/D,IAAM,uBAAuB,gBAA0B;CACrD,MAAM,UAAA,GAASC,MAAAA,WAAAA,CAAW,kBAAkB;CAC5C,QAAA,GAAOC,MAAAA,QAAAA,QACE,EAAE,aAAa,eAAe,OAAO,YAAY,IACxD,CAAC,aAAa,OAAO,WAAW,CAClC;AACF;AASA,IAAa,aAAA,GAAYC,MAAAA,WAAAA,EACtB,EAAE,aAAa,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CACzD,MAAM,eAAe,oBAAoB,WAAW;CACpD,MAAM,cAAcC,uBAAAA,eAAe,KAAK,KAAK;CAE7C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAmB,UAApB;EAA6B,OAAO;EAClC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;GAAS;GAAK,MAAK;GAAO,WAAWC,WAAAA,GAAGC,yBAAAA,IAAI,SAAS;GAAG,OAAO;GAAa,GAAI;EAAQ,CAAA;CAC7D,CAAA;AAEjC,CACF;AAEA,UAAU,cAAc;AAIxB,IAA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cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { withVariantKeys } from "../../styles/recipeVariants.js";
3
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
4
  import { warnOnce } from "../../utils/warnOnce.js";
5
5
  import { flexRecipe } from "../Flex/Flex.vanilla.css.js";
6
6
  import { itemButton, itemText, liRecipe, ol, ul } from "./List.vanilla.css.js";
7
7
  import { Children, Fragment, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useMemo, useRef } from "react";
8
- import { assignInlineVars } from "@vanilla-extract/dynamic";
9
8
  import { jsx, jsxs } from "react/jsx-runtime";
10
9
  // components/List/List.vanilla.tsx
10
+ var flexClass = withVariantKeys(flexRecipe);
11
+ var liClass = withVariantKeys(liRecipe);
11
12
  var ListVanillaContext = createContext({ interactive: false });
12
- var useInlineStyle = (css, style) => {
13
- const { colors } = useVanillaExtractTheme();
14
- const { style: cssStyles, vars } = processCSSProp(css, colors);
15
- return {
16
- ...cssStyles,
17
- ...style,
18
- ...assignInlineVars(vars)
19
- };
20
- };
21
13
  var useListContextValue = (interactive) => {
22
14
  const parent = useContext(ListVanillaContext);
23
15
  return useMemo(() => ({ interactive: interactive ?? parent.interactive }), [interactive, parent.interactive]);
@@ -83,7 +75,7 @@ var LiVanilla = forwardRef(({ controls, disabled, elevation, align, justify, dir
83
75
  });
84
76
  return /* @__PURE__ */ jsxs("li", {
85
77
  ref,
86
- className: cx(liRecipe({ elevation }), className),
78
+ className: cx(liClass({ elevation }), className),
87
79
  style: inlineStyle,
88
80
  ...props,
89
81
  children: [
@@ -91,7 +83,7 @@ var LiVanilla = forwardRef(({ controls, disabled, elevation, align, justify, dir
91
83
  ref: setContentRef,
92
84
  type: "button",
93
85
  disabled,
94
- className: cx(flexRecipe({
86
+ className: cx(flexClass({
95
87
  align,
96
88
  justify,
97
89
  direction,
@@ -101,7 +93,7 @@ var LiVanilla = forwardRef(({ controls, disabled, elevation, align, justify, dir
101
93
  children: content
102
94
  }) : /* @__PURE__ */ jsx("span", {
103
95
  ref: setContentRef,
104
- className: cx(flexRecipe({
96
+ className: cx(flexClass({
105
97
  align: align ?? "center",
106
98
  justify,
107
99
  direction,
@@ -1 +1 @@
1
- {"version":3,"file":"List.vanilla.js","names":[],"sources":["../../../components/List/List.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React, {\n Children,\n createContext,\n CSSProperties,\n forwardRef,\n Fragment,\n isValidElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { warnOnce } from '../../utils/warnOnce';\nimport { flexRecipe } from '../Flex/Flex.vanilla.css';\nimport { controlsWrapper, itemButton, itemText, liRecipe, ol, ul } from './List.vanilla.css';\n\nconst ListVanillaContext = createContext({ interactive: false });\n\nconst useInlineStyle = (css: CSSProps['css'], style?: CSSProperties) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n return { ...cssStyles, ...style, ...assignInlineVars(vars) };\n};\n\nconst useListContextValue = (interactive?: boolean) => {\n const parent = useContext(ListVanillaContext);\n return useMemo(\n () => ({ interactive: interactive ?? parent.interactive }),\n [interactive, parent.interactive],\n );\n};\n\ntype ListOwnProps = CSSProps & {\n /** Renders the items as buttons. Nested lists inherit it. */\n interactive?: boolean;\n};\n\nexport type UlVanillaProps = React.HTMLAttributes<HTMLUListElement> & ListOwnProps;\n\nexport const UlVanilla = forwardRef<HTMLUListElement, UlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ul ref={ref} role=\"list\" className={cx(ul, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nUlVanilla.displayName = 'UlVanilla';\n\nexport type OlVanillaProps = React.OlHTMLAttributes<HTMLOListElement> & ListOwnProps;\n\nexport const OlVanilla = forwardRef<HTMLOListElement, OlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ol ref={ref} role=\"list\" className={cx(ol, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nOlVanilla.displayName = 'OlVanilla';\n\ntype LiRecipeVariants = NonNullable<RecipeVariants<typeof liRecipe>>;\n\nexport type LiVanillaProps = React.LiHTMLAttributes<HTMLLIElement> &\n CSSProps &\n LiRecipeVariants & {\n /** Shown on the right of the item, outside its button. */\n controls?: ReactNode;\n /** Disables the item's button. Only applies in an interactive list. */\n disabled?: boolean;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n direction?: FlexDirection;\n gap?: Gap;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n };\n\nconst NESTED_LIST_WARNING =\n 'LiVanilla: a nested list is rendered inside the item content, so it ends up in its button or span. ' +\n 'Make UlVanilla or OlVanilla a direct child of LiVanilla, and wrap only its items in your component.';\n\n// Looks into fragments, but not into components: what they render is unknown at this point.\nconst splitNestedLists = (children: ReactNode) => {\n const content: ReactNode[] = [];\n const nestedLists: ReactNode[] = [];\n\n // eslint-disable-next-line @eslint-react/no-children-to-array\n Children.toArray(children).forEach((child) => {\n if (!isValidElement<{ children?: ReactNode }>(child)) {\n content.push(child);\n } else if (child.type === UlVanilla || child.type === OlVanilla) {\n nestedLists.push(child);\n } else if (child.type === Fragment) {\n const inner = splitNestedLists(child.props.children);\n content.push(<Fragment key={child.key}>{inner.content}</Fragment>);\n if (inner.nestedLists.length) {\n nestedLists.push(<Fragment key={child.key}>{inner.nestedLists}</Fragment>);\n }\n } else {\n content.push(child);\n }\n });\n\n return { content, nestedLists };\n};\n\nexport const LiVanilla = forwardRef<HTMLLIElement, LiVanillaProps>(\n (\n {\n controls,\n disabled,\n elevation,\n align,\n justify,\n direction,\n gap,\n wrap,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const { interactive } = useContext(ListVanillaContext);\n const inlineStyle = useInlineStyle(css, style);\n const { content, nestedLists } = splitNestedLists(children);\n\n const contentRef = useRef<HTMLElement | null>(null);\n const setContentRef = useCallback((node: HTMLElement | null) => {\n contentRef.current = node;\n }, []);\n\n // A list rendered by a wrapper component can't be detected before render.\n useEffect(() => {\n if (contentRef.current?.querySelector('ul, ol')) {\n warnOnce(NESTED_LIST_WARNING);\n }\n });\n\n return (\n <li\n ref={ref}\n className={cx(liRecipe({ elevation }), className)}\n style={inlineStyle}\n {...props}\n >\n {interactive ? (\n <button\n ref={setContentRef}\n type=\"button\"\n disabled={disabled}\n className={cx(flexRecipe({ align, justify, direction, gap, wrap }), itemButton)}\n >\n {content}\n </button>\n ) : (\n <span\n ref={setContentRef}\n className={cx(\n flexRecipe({ align: align ?? 'center', justify, direction, gap: gap ?? 1, wrap }),\n itemText,\n )}\n >\n {content}\n </span>\n )}\n {nestedLists}\n {!!controls && <div className={controlsWrapper}>{controls}</div>}\n </li>\n );\n },\n);\n\nLiVanilla.displayName = 'LiVanilla';\n"],"mappings":";;;;;;;;;;AA8BA,IAAM,qBAAqB,cAAc,EAAE,aAAa,MAAM,CAAC;AAE/D,IAAM,kBAAkB,KAAsB,UAA0B;CACtE,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,OAAO;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;AAC7D;AAEA,IAAM,uBAAuB,gBAA0B;CACrD,MAA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C;GACjE,IAAI,MAAM,YAAY,QACpB,YAAY,KAAK,oBAAC,UAAD,EAAA,UAA2B,MAAM,YAAsB,GAAxC,MAAM,GAAkC,CAAC;EAE7E,OACE,QAAQ,KAAK,KAAK;CAEtB,CAAC;CAED,OAAO;EAAE;EAAS;CAAY;AAChC;AAEA,IAAa,YAAY,YAErB,EACE,UACA,UACA,WACA,OACA,SACA,WACA,KACA,MACA,WACA,KACA,OACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,gBAAgB,WAAW,kBAAkB;CACrD,MAAM,cAAc,eAAe,KAAK,KAAK;CAC7C,MAAM,EAAE,SAAS,gBAAgB,iBAAiB,QAAQ;CAE1D,MAAM,aAAa,OAA2B,IAAI;CAClD,MAAM,gBAAgB,aAAa,SAA6B;EAC9D,WAAW,UAAU;CACvB,GAAG,CAAC,CAAC;CAGL,gBAAgB;EACd,IAAI,WAAW,SAAS,cAAc,QAAQ,GAC5C,SAAS,mBAAmB;CAEhC,CAAC;CAED,OACE,qBAAC,MAAD;EACO;EACL,WAAW,GAAG,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS;EAChD,OAAO;EACP,GAAI;EAJN,UAAA;GAMG,cACC,oBAAC,UAAD;IACE,KAAK;IACL,MAAK;IACK;IACV,WAAW,GAAG,WAAW;KAAE;KAAO;KAAS;KAAW;KAAK;IAAK,CAAC,GAAG,UAAU;IAE7E,UAAA;GACK,CAAA,IAER,oBAAC,QAAD;IACE,KAAK;IACL,WAAW,GACT,WAAW;KAAE,OAAO,SAAS;KAAU;KAAS;KAAW,KAAK,OAAO;KAAG;IAAK,CAAC,GAChF,QACF;IAEC,UAAA;GACG,CAAA;GAEP;GACA,CAAC,CAAC,YAAY,oBAAC,OAAD;IAAK,WAAA;IAA6B,UAAA;GAAc,CAAA;EAC7D;;AAER,CACF;AAEA,UAAU,cAAc"}
1
+ {"version":3,"file":"List.vanilla.js","names":[],"sources":["../../../components/List/List.vanilla.tsx"],"sourcesContent":["import React, {\n Children,\n createContext,\n forwardRef,\n Fragment,\n isValidElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '@/styles/types';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\nimport { warnOnce } from '@/utils/warnOnce';\n\nimport { flexRecipe } from '@/components/Flex/Flex.vanilla.css';\n\nimport { controlsWrapper, itemButton, itemText, liRecipe, ol, ul } from './List.vanilla.css';\n\nconst flexClass = withVariantKeys(flexRecipe);\nconst liClass = withVariantKeys(liRecipe);\n\nconst ListVanillaContext = createContext({ interactive: false });\n\nconst useListContextValue = (interactive?: boolean) => {\n const parent = useContext(ListVanillaContext);\n return useMemo(\n () => ({ interactive: interactive ?? parent.interactive }),\n [interactive, parent.interactive],\n );\n};\n\ntype ListOwnProps = CSSProps & {\n /** Renders the items as buttons. Nested lists inherit it. */\n interactive?: boolean;\n};\n\nexport type UlVanillaProps = React.HTMLAttributes<HTMLUListElement> & ListOwnProps;\n\nexport const UlVanilla = forwardRef<HTMLUListElement, UlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ul ref={ref} role=\"list\" className={cx(ul, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nUlVanilla.displayName = 'UlVanilla';\n\nexport type OlVanillaProps = React.OlHTMLAttributes<HTMLOListElement> & ListOwnProps;\n\nexport const OlVanilla = forwardRef<HTMLOListElement, OlVanillaProps>(\n ({ interactive, className, css, style, ...props }, ref) => {\n const contextValue = useListContextValue(interactive);\n const inlineStyle = useInlineStyle(css, style);\n\n return (\n <ListVanillaContext.Provider value={contextValue}>\n <ol ref={ref} role=\"list\" className={cx(ol, className)} style={inlineStyle} {...props} />\n </ListVanillaContext.Provider>\n );\n },\n);\n\nOlVanilla.displayName = 'OlVanilla';\n\ntype LiRecipeVariants = RecipeVariantProps<typeof liRecipe>;\n\nexport type LiVanillaProps = React.LiHTMLAttributes<HTMLLIElement> &\n CSSProps &\n LiRecipeVariants & {\n /** Shown on the right of the item, outside its button. */\n controls?: ReactNode;\n /** Disables the item's button. Only applies in an interactive list. */\n disabled?: boolean;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n direction?: FlexDirection;\n gap?: Gap;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n };\n\nconst NESTED_LIST_WARNING =\n 'LiVanilla: a nested list is rendered inside the item content, so it ends up in its button or span. ' +\n 'Make UlVanilla or OlVanilla a direct child of LiVanilla, and wrap only its items in your component.';\n\n// Looks into fragments, but not into components: what they render is unknown at this point.\nconst splitNestedLists = (children: ReactNode) => {\n const content: ReactNode[] = [];\n const nestedLists: ReactNode[] = [];\n\n // eslint-disable-next-line @eslint-react/no-children-to-array\n Children.toArray(children).forEach((child) => {\n if (!isValidElement<{ children?: ReactNode }>(child)) {\n content.push(child);\n } else if (child.type === UlVanilla || child.type === OlVanilla) {\n nestedLists.push(child);\n } else if (child.type === Fragment) {\n const inner = splitNestedLists(child.props.children);\n content.push(<Fragment key={child.key}>{inner.content}</Fragment>);\n if (inner.nestedLists.length) {\n nestedLists.push(<Fragment key={child.key}>{inner.nestedLists}</Fragment>);\n }\n } else {\n content.push(child);\n }\n });\n\n return { content, nestedLists };\n};\n\nexport const LiVanilla = forwardRef<HTMLLIElement, LiVanillaProps>(\n (\n {\n controls,\n disabled,\n elevation,\n align,\n justify,\n direction,\n gap,\n wrap,\n className,\n css,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const { interactive } = useContext(ListVanillaContext);\n const inlineStyle = useInlineStyle(css, style);\n const { content, nestedLists } = splitNestedLists(children);\n\n const contentRef = useRef<HTMLElement | null>(null);\n const setContentRef = useCallback((node: HTMLElement | null) => {\n contentRef.current = node;\n }, []);\n\n // A list rendered by a wrapper component can't be detected before render.\n useEffect(() => {\n if (contentRef.current?.querySelector('ul, ol')) {\n warnOnce(NESTED_LIST_WARNING);\n }\n });\n\n return (\n <li\n ref={ref}\n className={cx(liClass({ elevation }), className)}\n style={inlineStyle}\n {...props}\n >\n {interactive ? (\n <button\n ref={setContentRef}\n type=\"button\"\n disabled={disabled}\n className={cx(flexClass({ align, justify, direction, gap, wrap }), itemButton)}\n >\n {content}\n </button>\n ) : (\n <span\n ref={setContentRef}\n className={cx(\n flexClass({ align: align ?? 'center', justify, direction, gap: gap ?? 1, wrap }),\n itemText,\n )}\n >\n {content}\n </span>\n )}\n {nestedLists}\n {!!controls && <div className={controlsWrapper}>{controls}</div>}\n </li>\n );\n },\n);\n\nLiVanilla.displayName = 'LiVanilla';\n"],"mappings":";;;;;;;;;AA8BA,IAAM,YAAY,gBAAgB,UAAU;AAC5C,IAAM,UAAU,gBAAgB,QAAQ;AAExC,IAAM,qBAAqB,cAAc,EAAE,aAAa,MAAM,CAAC;AAE/D,IAAM,uBAAuB,gBAA0B;CACrD,MAAM,SAAS,WAAW,kBAAkB;CAC5C,OAAO,eACE,EAAE,aAAa,eAAe,OAAO,YAAY,IACxD,CAAC,aAAa,OAAO,WAAW,CAClC;AACF;AASA,IAAa,YAAY,YACtB,EAAE,aAAa,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CACzD,MAAM,eAAe,oBAAoB,WAAW;CACpD,MAAM,cAAc,eAAe,KAAK,KAAK;CAE7C,OACE,oBAAC,mBAAmB,UAApB;EAA6B,OAAO;EAClC,UAAA,oBAAC,MAAD;GAAS;GAAK,MAAK;GAAO,WAAW,GAAG,IAAI,SAAS;GAAG,OAAO;GAAa,GAAI;EAAQ,CAAA;CAC7D,CAAA;AAEjC,CACF;AAEA,UAAU,cAAc;AAIxB,IAAa,YAAY,YACtB,EAAE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;EAC9D,WAAW,UAAU;CACvB,GAAG,CAAC,CAAC;CAGL,gBAAgB;EACd,IAAI,WAAW,SAAS,cAAc,QAAQ,GAC5C,SAAS,mBAAmB;CAEhC,CAAC;CAED,OACE,qBAAC,MAAD;EACO;EACL,WAAW,GAAG,QAAQ,EAAE,UAAU,CAAC,GAAG,SAAS;EAC/C,OAAO;EACP,GAAI;EAJN,UAAA;GAMG,cACC,oBAAC,UAAD;IACE,KAAK;IACL,MAAK;IACK;IACV,WAAW,GAAG,UAAU;KAAE;KAAO;KAAS;KAAW;KAAK;IAAK,CAAC,GAAG,UAAU;IAE5E,UAAA;GACK,CAAA,IAER,oBAAC,QAAD;IACE,KAAK;IACL,WAAW,GACT,UAAU;KAAE,OAAO,SAAS;KAAU;KAAS;KAAW,KAAK,OAAO;KAAG;IAAK,CAAC,GAC/E,QACF;IAEC,UAAA;GACG,CAAA;GAEP;GACA,CAAC,CAAC,YAAY,oBAAC,OAAD;IAAK,WAAA;IAA6B,UAAA;GAAc,CAAA;EAC7D;;AAER,CACF;AAEA,UAAU,cAAc"}
@@ -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_Meter_vanilla_css = require("./Meter.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/Meter/Meter.vanilla.tsx
12
11
  var MeterVanilla = (0, react.forwardRef)(({ value, color, segments, max, label, valueLabel, size, className, css, style, "aria-label": ariaLabel, ...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 items = segments ?? [{
16
15
  value: value ?? 0,
17
16
  color
@@ -39,11 +38,7 @@ var MeterVanilla = (0, react.forwardRef)(({ value, color, segments, max, label,
39
38
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
40
39
  ref,
41
40
  className: require_cx.cx(require_Meter_vanilla_css.root, className),
42
- style: {
43
- ...cssStyles,
44
- ...style,
45
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
46
- },
41
+ style: inlineStyle,
47
42
  ...props,
48
43
  children: [(label || valueLabel) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
49
44
  className: "sfokyy1",
@@ -1 +1 @@
1
- {"version":3,"file":"Meter.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","cx","root","assignInlineVars","trackRecipe","segment","resolveColor"],"sources":["../../../components/Meter/Meter.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 {\n caption,\n captionLabel,\n captionValue,\n root,\n segment,\n trackRecipe,\n} from './Meter.vanilla.css';\n\nexport type MeterSegmentVanilla = {\n value: number;\n /** A color token such as `$chartStatusGood`, or any CSS color. Defaults to the chart series colors. */\n color?: string;\n /** Shown as a tooltip and read with the meter, e.g. \"404: 30\". */\n label?: string;\n};\n\ntype MeterValueProps = Omit<MeterSegmentVanilla, 'label'> & { segments?: never };\ntype MeterSegmentsProps = { segments: MeterSegmentVanilla[]; value?: never; color?: never };\n\nexport type MeterVanillaProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'color'> &\n CSSProps &\n (MeterValueProps | MeterSegmentsProps) & {\n /** Defaults to 100 with `value`, and to the sum of the values with `segments`. */\n max?: number;\n /** Caption above the bar, on the left. Also the meter's accessible name. */\n label?: string;\n /** Caption above the bar, on the right, e.g. \"42 GB / 100 GB\". */\n valueLabel?: string;\n size?: 'small' | 'medium' | 'large';\n };\n\n// TODO: replace the native `title` on segments with TooltipVanilla once it exists.\nexport const MeterVanilla = forwardRef<HTMLDivElement, MeterVanillaProps>(\n (\n {\n value,\n color,\n segments,\n max,\n label,\n valueLabel,\n size,\n className,\n css,\n style,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const items: MeterSegmentVanilla[] = segments ?? [{ value: value ?? 0, color }];\n const values = items.map((s) => Math.max(0, s.value));\n const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);\n\n let remaining = total;\n const widths = values.map((v) => {\n const shown = Math.min(v, Math.max(0, remaining));\n remaining -= shown;\n return total > 0 ? (shown / total) * 100 : 0;\n });\n\n const name = ariaLabel ?? label;\n const ariaProps =\n items.length === 1\n ? {\n role: 'meter',\n 'aria-valuenow': Math.min(values[0], total),\n 'aria-valuemin': 0,\n 'aria-valuemax': total,\n 'aria-valuetext': valueLabel ?? items[0].label,\n 'aria-label': name ?? items[0].label,\n }\n : {\n role: 'img',\n 'aria-label':\n ariaLabel ??\n [label, items.map((s) => s.label ?? String(s.value)).join(', ')]\n .filter(Boolean)\n .join(': '),\n };\n\n return (\n <div\n ref={ref}\n className={cx(root, className)}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n {(label || valueLabel) && (\n // Hidden from assistive tech: the meter's name and value text already carry it.\n <div className={caption} aria-hidden>\n {label && <span className={captionLabel}>{label}</span>}\n {valueLabel && <span className={captionValue}>{valueLabel}</span>}\n </div>\n )}\n <div className={trackRecipe({ size })} {...ariaProps}>\n {items.map((s, i) => (\n <div\n key={i}\n className={segment}\n title={s.label}\n style={{\n width: `${widths[i]}%`,\n backgroundColor: s.color && resolveColor(s.color, colors),\n }}\n />\n ))}\n </div>\n </div>\n );\n },\n);\n\nMeterVanilla.displayName = 'MeterVanilla';\n"],"mappings":";;;;;;;;;;;AAwCA,IAAa,gBAAA,GAAeA,MAAAA,WAAAA,EAExB,EACE,OACA,OACA,UACA,KACA,OACA,YACA,MACA,WACA,KACA,OACA,cAAc,WACd,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,QAA+B,YAAY,CAAC;EAAE,OAAO,SAAS;EAAG;CAAM,CAAC;CAC9E,MAAM,SAAS,MAAM,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,KAAK,CAAC;CACpD,MAAM,QAAQ,QAAQ,WAAW,OAAO,QAAQ,KAAK,MAAM,MAAM,GAAG,CAAC,IAAI;CAEzE,IAAI,YAAY;CAChB,MAAM,SAAS,OAAO,KAAK,MAAM;EAC/B,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,SAAS,CAAC;EAChD,aAAa;EACb,OAAO,QAAQ,IAAK,QAAQ,QAAS,MAAM;CAC7C,CAAC;CAED,MAAM,OAAO,aAAa;CAC1B,MAAM,YACJ,MAAM,WAAW,IACb;EACE,MAAM;EACN,iBAAiB,KAAK,IAAI,OAAO,IAAI,KAAK;EAC1C,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB,cAAc,MAAM,EAAE,CAAC;EACzC,cAAc,QAAQ,MAAM,EAAE,CAAC;CACjC,IACA;EACE,MAAM;EACN,cACE,aACA,CAAC,OAAO,MAAM,KAAK,MAAM,EAAE,SAAS,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAC7D,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;CAChB;CAEN,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EACO;EACL,WAAWC,WAAAA,GAAGC,0BAAAA,MAAM,SAAS;EAC7B,OAAO;GAAE,GAAG;GAAW,GAAG;GAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;EAAE;EAC3D,GAAI;EAJN,UAAA,EAMI,SAAS,eAET,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAA;GAAoB,eAAA;GAAzB,UAAA,CACG,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAY,CAAA,GACrD,cAAc,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAiB,CAAA,CAC7D;EAEP,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAWC,0BAAAA,YAAY,EAAE,KAAK,CAAC;GAAG,GAAI;GACxC,UAAA,MAAM,KAAK,GAAG,MACb,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAEE,WAAWC,0BAAAA;IACX,OAAO,EAAE;IACT,OAAO;KACL,OAAO,GAAG,OAAO,GAAG;KACpB,iBAAiB,EAAE,SAASC,qBAAAA,aAAa,EAAE,OAAO,MAAM;IAC1D;GACD,GAPM,CAON,CACF;EACE,CAAA,CACF;;AAET,CACF;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"Meter.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","useInlineStyle","cx","root","trackRecipe","segment","resolveColor"],"sources":["../../../components/Meter/Meter.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 {\n caption,\n captionLabel,\n captionValue,\n root,\n segment,\n trackRecipe,\n} from './Meter.vanilla.css';\n\nexport type MeterSegmentVanilla = {\n value: number;\n /** A color token such as `$chartStatusGood`, or any CSS color. Defaults to the chart series colors. */\n color?: string;\n /** Shown as a tooltip and read with the meter, e.g. \"404: 30\". */\n label?: string;\n};\n\ntype MeterValueProps = Omit<MeterSegmentVanilla, 'label'> & { segments?: never };\ntype MeterSegmentsProps = { segments: MeterSegmentVanilla[]; value?: never; color?: never };\n\nexport type MeterVanillaProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'color'> &\n CSSProps &\n (MeterValueProps | MeterSegmentsProps) & {\n /** Defaults to 100 with `value`, and to the sum of the values with `segments`. */\n max?: number;\n /** Caption above the bar, on the left. Also the meter's accessible name. */\n label?: string;\n /** Caption above the bar, on the right, e.g. \"42 GB / 100 GB\". */\n valueLabel?: string;\n size?: 'small' | 'medium' | 'large';\n };\n\n// TODO: replace the native `title` on segments with TooltipVanilla once it exists.\nexport const MeterVanilla = forwardRef<HTMLDivElement, MeterVanillaProps>(\n (\n {\n value,\n color,\n segments,\n max,\n label,\n valueLabel,\n size,\n className,\n css,\n style,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const inlineStyle = useInlineStyle(css, style);\n\n const items: MeterSegmentVanilla[] = segments ?? [{ value: value ?? 0, color }];\n const values = items.map((s) => Math.max(0, s.value));\n const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);\n\n let remaining = total;\n const widths = values.map((v) => {\n const shown = Math.min(v, Math.max(0, remaining));\n remaining -= shown;\n return total > 0 ? (shown / total) * 100 : 0;\n });\n\n const name = ariaLabel ?? label;\n const ariaProps =\n items.length === 1\n ? {\n role: 'meter',\n 'aria-valuenow': Math.min(values[0], total),\n 'aria-valuemin': 0,\n 'aria-valuemax': total,\n 'aria-valuetext': valueLabel ?? items[0].label,\n 'aria-label': name ?? items[0].label,\n }\n : {\n role: 'img',\n 'aria-label':\n ariaLabel ??\n [label, items.map((s) => s.label ?? String(s.value)).join(', ')]\n .filter(Boolean)\n .join(': '),\n };\n\n return (\n <div ref={ref} className={cx(root, className)} style={inlineStyle} {...props}>\n {(label || valueLabel) && (\n // Hidden from assistive tech: the meter's name and value text already carry it.\n <div className={caption} aria-hidden>\n {label && <span className={captionLabel}>{label}</span>}\n {valueLabel && <span className={captionValue}>{valueLabel}</span>}\n </div>\n )}\n <div className={trackRecipe({ size })} {...ariaProps}>\n {items.map((s, i) => (\n <div\n key={i}\n className={segment}\n title={s.label}\n style={{\n width: `${widths[i]}%`,\n backgroundColor: s.color && resolveColor(s.color, colors),\n }}\n />\n ))}\n </div>\n </div>\n );\n },\n);\n\nMeterVanilla.displayName = 'MeterVanilla';\n"],"mappings":";;;;;;;;;;AAyCA,IAAa,gBAAA,GAAeA,MAAAA,WAAAA,EAExB,EACE,OACA,OACA,UACA,KACA,OACA,YACA,MACA,WACA,KACA,OACA,cAAc,WACd,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,cAAcC,uBAAAA,eAAe,KAAK,KAAK;CAE7C,MAAM,QAA+B,YAAY,CAAC;EAAE,OAAO,SAAS;EAAG;CAAM,CAAC;CAC9E,MAAM,SAAS,MAAM,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,KAAK,CAAC;CACpD,MAAM,QAAQ,QAAQ,WAAW,OAAO,QAAQ,KAAK,MAAM,MAAM,GAAG,CAAC,IAAI;CAEzE,IAAI,YAAY;CAChB,MAAM,SAAS,OAAO,KAAK,MAAM;EAC/B,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,SAAS,CAAC;EAChD,aAAa;EACb,OAAO,QAAQ,IAAK,QAAQ,QAAS,MAAM;CAC7C,CAAC;CAED,MAAM,OAAO,aAAa;CAC1B,MAAM,YACJ,MAAM,WAAW,IACb;EACE,MAAM;EACN,iBAAiB,KAAK,IAAI,OAAO,IAAI,KAAK;EAC1C,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB,cAAc,MAAM,EAAE,CAAC;EACzC,cAAc,QAAQ,MAAM,EAAE,CAAC;CACjC,IACA;EACE,MAAM;EACN,cACE,aACA,CAAC,OAAO,MAAM,KAAK,MAAM,EAAE,SAAS,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAC7D,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;CAChB;CAEN,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAU;EAAK,WAAWC,WAAAA,GAAGC,0BAAAA,MAAM,SAAS;EAAG,OAAO;EAAa,GAAI;EAAvE,UAAA,EACI,SAAS,eAET,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAA;GAAoB,eAAA;GAAzB,UAAA,CACG,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAY,CAAA,GACrD,cAAc,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAiB,CAAA,CAC7D;EAEP,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAWC,0BAAAA,YAAY,EAAE,KAAK,CAAC;GAAG,GAAI;GACxC,UAAA,MAAM,KAAK,GAAG,MACb,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAEE,WAAWC,0BAAAA;IACX,OAAO,EAAE;IACT,OAAO;KACL,OAAO,GAAG,OAAO,GAAG;KACpB,iBAAiB,EAAE,SAASC,qBAAAA,aAAa,EAAE,OAAO,MAAM;IAC1D;GACD,GAPM,CAON,CACF;EACE,CAAA,CACF;;AAET,CACF;AAEA,aAAa,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 { root, segment, trackRecipe } from "./Meter.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/Meter/Meter.vanilla.tsx
10
9
  var MeterVanilla = forwardRef(({ value, color, segments, max, label, valueLabel, size, className, css, style, "aria-label": ariaLabel, ...props }, ref) => {
11
10
  const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
11
+ const inlineStyle = useInlineStyle(css, style);
13
12
  const items = segments ?? [{
14
13
  value: value ?? 0,
15
14
  color
@@ -37,11 +36,7 @@ var MeterVanilla = forwardRef(({ value, color, segments, max, label, valueLabel,
37
36
  return /* @__PURE__ */ jsxs("div", {
38
37
  ref,
39
38
  className: cx(root, className),
40
- style: {
41
- ...cssStyles,
42
- ...style,
43
- ...assignInlineVars(vars)
44
- },
39
+ style: inlineStyle,
45
40
  ...props,
46
41
  children: [(label || valueLabel) && /* @__PURE__ */ jsxs("div", {
47
42
  className: "sfokyy1",
@@ -1 +1 @@
1
- {"version":3,"file":"Meter.vanilla.js","names":[],"sources":["../../../components/Meter/Meter.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 {\n caption,\n captionLabel,\n captionValue,\n root,\n segment,\n trackRecipe,\n} from './Meter.vanilla.css';\n\nexport type MeterSegmentVanilla = {\n value: number;\n /** A color token such as `$chartStatusGood`, or any CSS color. Defaults to the chart series colors. */\n color?: string;\n /** Shown as a tooltip and read with the meter, e.g. \"404: 30\". */\n label?: string;\n};\n\ntype MeterValueProps = Omit<MeterSegmentVanilla, 'label'> & { segments?: never };\ntype MeterSegmentsProps = { segments: MeterSegmentVanilla[]; value?: never; color?: never };\n\nexport type MeterVanillaProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'color'> &\n CSSProps &\n (MeterValueProps | MeterSegmentsProps) & {\n /** Defaults to 100 with `value`, and to the sum of the values with `segments`. */\n max?: number;\n /** Caption above the bar, on the left. Also the meter's accessible name. */\n label?: string;\n /** Caption above the bar, on the right, e.g. \"42 GB / 100 GB\". */\n valueLabel?: string;\n size?: 'small' | 'medium' | 'large';\n };\n\n// TODO: replace the native `title` on segments with TooltipVanilla once it exists.\nexport const MeterVanilla = forwardRef<HTMLDivElement, MeterVanillaProps>(\n (\n {\n value,\n color,\n segments,\n max,\n label,\n valueLabel,\n size,\n className,\n css,\n style,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const items: MeterSegmentVanilla[] = segments ?? [{ value: value ?? 0, color }];\n const values = items.map((s) => Math.max(0, s.value));\n const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);\n\n let remaining = total;\n const widths = values.map((v) => {\n const shown = Math.min(v, Math.max(0, remaining));\n remaining -= shown;\n return total > 0 ? (shown / total) * 100 : 0;\n });\n\n const name = ariaLabel ?? label;\n const ariaProps =\n items.length === 1\n ? {\n role: 'meter',\n 'aria-valuenow': Math.min(values[0], total),\n 'aria-valuemin': 0,\n 'aria-valuemax': total,\n 'aria-valuetext': valueLabel ?? items[0].label,\n 'aria-label': name ?? items[0].label,\n }\n : {\n role: 'img',\n 'aria-label':\n ariaLabel ??\n [label, items.map((s) => s.label ?? String(s.value)).join(', ')]\n .filter(Boolean)\n .join(': '),\n };\n\n return (\n <div\n ref={ref}\n className={cx(root, className)}\n style={{ ...cssStyles, ...style, ...assignInlineVars(vars) }}\n {...props}\n >\n {(label || valueLabel) && (\n // Hidden from assistive tech: the meter's name and value text already carry it.\n <div className={caption} aria-hidden>\n {label && <span className={captionLabel}>{label}</span>}\n {valueLabel && <span className={captionValue}>{valueLabel}</span>}\n </div>\n )}\n <div className={trackRecipe({ size })} {...ariaProps}>\n {items.map((s, i) => (\n <div\n key={i}\n className={segment}\n title={s.label}\n style={{\n width: `${widths[i]}%`,\n backgroundColor: s.color && resolveColor(s.color, colors),\n }}\n />\n ))}\n </div>\n </div>\n );\n },\n);\n\nMeterVanilla.displayName = 'MeterVanilla';\n"],"mappings":";;;;;;;;;AAwCA,IAAa,eAAe,YAExB,EACE,OACA,OACA,UACA,KACA,OACA,YACA,MACA,WACA,KACA,OACA,cAAc,WACd,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,QAA+B,YAAY,CAAC;EAAE,OAAO,SAAS;EAAG;CAAM,CAAC;CAC9E,MAAM,SAAS,MAAM,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,KAAK,CAAC;CACpD,MAAM,QAAQ,QAAQ,WAAW,OAAO,QAAQ,KAAK,MAAM,MAAM,GAAG,CAAC,IAAI;CAEzE,IAAI,YAAY;CAChB,MAAM,SAAS,OAAO,KAAK,MAAM;EAC/B,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,SAAS,CAAC;EAChD,aAAa;EACb,OAAO,QAAQ,IAAK,QAAQ,QAAS,MAAM;CAC7C,CAAC;CAED,MAAM,OAAO,aAAa;CAC1B,MAAM,YACJ,MAAM,WAAW,IACb;EACE,MAAM;EACN,iBAAiB,KAAK,IAAI,OAAO,IAAI,KAAK;EAC1C,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB,cAAc,MAAM,EAAE,CAAC;EACzC,cAAc,QAAQ,MAAM,EAAE,CAAC;CACjC,IACA;EACE,MAAM;EACN,cACE,aACA,CAAC,OAAO,MAAM,KAAK,MAAM,EAAE,SAAS,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAC7D,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;CAChB;CAEN,OACE,qBAAC,OAAD;EACO;EACL,WAAW,GAAG,MAAM,SAAS;EAC7B,OAAO;GAAE,GAAG;GAAW,GAAG;GAAO,GAAG,iBAAiB,IAAI;EAAE;EAC3D,GAAI;EAJN,UAAA,EAMI,SAAS,eAET,qBAAC,OAAD;GAAK,WAAA;GAAoB,eAAA;GAAzB,UAAA,CACG,SAAS,oBAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAY,CAAA,GACrD,cAAc,oBAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAiB,CAAA,CAC7D;EAEP,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAW,YAAY,EAAE,KAAK,CAAC;GAAG,GAAI;GACxC,UAAA,MAAM,KAAK,GAAG,MACb,oBAAC,OAAD;IAEE,WAAW;IACX,OAAO,EAAE;IACT,OAAO;KACL,OAAO,GAAG,OAAO,GAAG;KACpB,iBAAiB,EAAE,SAAS,aAAa,EAAE,OAAO,MAAM;IAC1D;GACD,GAPM,CAON,CACF;EACE,CAAA,CACF;;AAET,CACF;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"Meter.vanilla.js","names":[],"sources":["../../../components/Meter/Meter.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 {\n caption,\n captionLabel,\n captionValue,\n root,\n segment,\n trackRecipe,\n} from './Meter.vanilla.css';\n\nexport type MeterSegmentVanilla = {\n value: number;\n /** A color token such as `$chartStatusGood`, or any CSS color. Defaults to the chart series colors. */\n color?: string;\n /** Shown as a tooltip and read with the meter, e.g. \"404: 30\". */\n label?: string;\n};\n\ntype MeterValueProps = Omit<MeterSegmentVanilla, 'label'> & { segments?: never };\ntype MeterSegmentsProps = { segments: MeterSegmentVanilla[]; value?: never; color?: never };\n\nexport type MeterVanillaProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'color'> &\n CSSProps &\n (MeterValueProps | MeterSegmentsProps) & {\n /** Defaults to 100 with `value`, and to the sum of the values with `segments`. */\n max?: number;\n /** Caption above the bar, on the left. Also the meter's accessible name. */\n label?: string;\n /** Caption above the bar, on the right, e.g. \"42 GB / 100 GB\". */\n valueLabel?: string;\n size?: 'small' | 'medium' | 'large';\n };\n\n// TODO: replace the native `title` on segments with TooltipVanilla once it exists.\nexport const MeterVanilla = forwardRef<HTMLDivElement, MeterVanillaProps>(\n (\n {\n value,\n color,\n segments,\n max,\n label,\n valueLabel,\n size,\n className,\n css,\n style,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const { colors } = useVanillaExtractTheme();\n const inlineStyle = useInlineStyle(css, style);\n\n const items: MeterSegmentVanilla[] = segments ?? [{ value: value ?? 0, color }];\n const values = items.map((s) => Math.max(0, s.value));\n const total = max ?? (segments ? values.reduce((sum, v) => sum + v, 0) : 100);\n\n let remaining = total;\n const widths = values.map((v) => {\n const shown = Math.min(v, Math.max(0, remaining));\n remaining -= shown;\n return total > 0 ? (shown / total) * 100 : 0;\n });\n\n const name = ariaLabel ?? label;\n const ariaProps =\n items.length === 1\n ? {\n role: 'meter',\n 'aria-valuenow': Math.min(values[0], total),\n 'aria-valuemin': 0,\n 'aria-valuemax': total,\n 'aria-valuetext': valueLabel ?? items[0].label,\n 'aria-label': name ?? items[0].label,\n }\n : {\n role: 'img',\n 'aria-label':\n ariaLabel ??\n [label, items.map((s) => s.label ?? String(s.value)).join(', ')]\n .filter(Boolean)\n .join(': '),\n };\n\n return (\n <div ref={ref} className={cx(root, className)} style={inlineStyle} {...props}>\n {(label || valueLabel) && (\n // Hidden from assistive tech: the meter's name and value text already carry it.\n <div className={caption} aria-hidden>\n {label && <span className={captionLabel}>{label}</span>}\n {valueLabel && <span className={captionValue}>{valueLabel}</span>}\n </div>\n )}\n <div className={trackRecipe({ size })} {...ariaProps}>\n {items.map((s, i) => (\n <div\n key={i}\n className={segment}\n title={s.label}\n style={{\n width: `${widths[i]}%`,\n backgroundColor: s.color && resolveColor(s.color, colors),\n }}\n />\n ))}\n </div>\n </div>\n );\n },\n);\n\nMeterVanilla.displayName = 'MeterVanilla';\n"],"mappings":";;;;;;;;AAyCA,IAAa,eAAe,YAExB,EACE,OACA,OACA,UACA,KACA,OACA,YACA,MACA,WACA,KACA,OACA,cAAc,WACd,GAAG,SAEL,QACG;CACH,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,cAAc,eAAe,KAAK,KAAK;CAE7C,MAAM,QAA+B,YAAY,CAAC;EAAE,OAAO,SAAS;EAAG;CAAM,CAAC;CAC9E,MAAM,SAAS,MAAM,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,KAAK,CAAC;CACpD,MAAM,QAAQ,QAAQ,WAAW,OAAO,QAAQ,KAAK,MAAM,MAAM,GAAG,CAAC,IAAI;CAEzE,IAAI,YAAY;CAChB,MAAM,SAAS,OAAO,KAAK,MAAM;EAC/B,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,SAAS,CAAC;EAChD,aAAa;EACb,OAAO,QAAQ,IAAK,QAAQ,QAAS,MAAM;CAC7C,CAAC;CAED,MAAM,OAAO,aAAa;CAC1B,MAAM,YACJ,MAAM,WAAW,IACb;EACE,MAAM;EACN,iBAAiB,KAAK,IAAI,OAAO,IAAI,KAAK;EAC1C,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB,cAAc,MAAM,EAAE,CAAC;EACzC,cAAc,QAAQ,MAAM,EAAE,CAAC;CACjC,IACA;EACE,MAAM;EACN,cACE,aACA,CAAC,OAAO,MAAM,KAAK,MAAM,EAAE,SAAS,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAC7D,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;CAChB;CAEN,OACE,qBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,MAAM,SAAS;EAAG,OAAO;EAAa,GAAI;EAAvE,UAAA,EACI,SAAS,eAET,qBAAC,OAAD;GAAK,WAAA;GAAoB,eAAA;GAAzB,UAAA,CACG,SAAS,oBAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAY,CAAA,GACrD,cAAc,oBAAC,QAAD;IAAM,WAAA;IAA0B,UAAA;GAAiB,CAAA,CAC7D;EAEP,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAW,YAAY,EAAE,KAAK,CAAC;GAAG,GAAI;GACxC,UAAA,MAAM,KAAK,GAAG,MACb,oBAAC,OAAD;IAEE,WAAW;IACX,OAAO,EAAE;IACT,OAAO;KACL,OAAO,GAAG,OAAO,GAAG;KACpB,iBAAiB,EAAE,SAAS,aAAa,EAAE,OAAO,MAAM;IAC1D;GACD,GAPM,CAON,CACF;EACE,CAAA,CACF;;AAET,CACF;AAEA,aAAa,cAAc"}
@@ -1,20 +1,12 @@
1
- const require_cssProps = require("../../styles/cssProps.cjs");
2
1
  const require_cx = require("../../styles/cx.cjs");
3
- const require_themeContext = require("../../styles/themeContext.cjs");
2
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
4
3
  const require_Panel_vanilla_css = require("./Panel.vanilla.css.cjs");
5
4
  let react = require("react");
6
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
7
5
  let react_jsx_runtime = require("react/jsx-runtime");
8
6
  // components/Panel/Panel.vanilla.tsx
9
7
  var PanelVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, style, ...props }, ref) => {
10
8
  const Component = as || "div";
11
- const { colors } = require_themeContext.useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
17
- };
9
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
18
10
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
19
11
  ref,
20
12
  className: require_cx.cx(require_Panel_vanilla_css.panelStyle, className),
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","cx","panelStyle"],"sources":["../../../components/Panel/Panel.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { panelStyle } from './Panel.vanilla.css';\n\nexport type PanelVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype PanelVanillaComponent = PolymorphicComponent<'div', PanelVanillaProps<ElementType>>;\n\nconst PanelVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, ...props }: PanelVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n return (\n <Component ref={ref} className={cx(panelStyle, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nPanelVanillaComponentImpl.displayName = 'PanelVanilla';\n\nexport const PanelVanilla = PanelVanillaComponentImpl as PanelVanillaComponent;\n"],"mappings":";;;;;;;;AAoBA,IAAM,6BAAA,GAA4BA,MAAAA,WAAAA,EAE9B,EAAE,IAAI,WAAW,KAAK,OAAO,GAAG,SAChC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAAE;CAEzE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAGC,0BAAAA,YAAY,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEhG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,eAAe"}
1
+ {"version":3,"file":"Panel.vanilla.cjs","names":["forwardRef","useInlineStyle","cx","panelStyle"],"sources":["../../../components/Panel/Panel.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { panelStyle } from './Panel.vanilla.css';\n\nexport type PanelVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype PanelVanillaComponent = PolymorphicComponent<'div', PanelVanillaProps<ElementType>>;\n\nconst PanelVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, ...props }: PanelVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const mergedStyles = useInlineStyle(css, style);\n\n return (\n <Component ref={ref} className={cx(panelStyle, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nPanelVanillaComponentImpl.displayName = 'PanelVanilla';\n\nexport const PanelVanilla = PanelVanillaComponentImpl as PanelVanillaComponent;\n"],"mappings":";;;;;;AAoBA,IAAM,6BAAA,GAA4BA,MAAAA,WAAAA,EAE9B,EAAE,IAAI,WAAW,KAAK,OAAO,GAAG,SAChC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAGC,0BAAAA,YAAY,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEhG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,eAAe"}
@@ -1,20 +1,12 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
3
  import { panelStyle } from "./Panel.vanilla.css.js";
5
4
  import { forwardRef } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
5
  import { jsx } from "react/jsx-runtime";
8
6
  // components/Panel/Panel.vanilla.tsx
9
7
  var PanelVanillaComponentImpl = forwardRef(({ as, className, css, style, ...props }, ref) => {
10
8
  const Component = as || "div";
11
- const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...assignInlineVars(vars)
17
- };
9
+ const mergedStyles = useInlineStyle(css, style);
18
10
  return /* @__PURE__ */ jsx(Component, {
19
11
  ref,
20
12
  className: cx(panelStyle, className),
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.vanilla.js","names":[],"sources":["../../../components/Panel/Panel.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { panelStyle } from './Panel.vanilla.css';\n\nexport type PanelVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype PanelVanillaComponent = PolymorphicComponent<'div', PanelVanillaProps<ElementType>>;\n\nconst PanelVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, ...props }: PanelVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n return (\n <Component ref={ref} className={cx(panelStyle, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nPanelVanillaComponentImpl.displayName = 'PanelVanilla';\n\nexport const PanelVanilla = PanelVanillaComponentImpl as PanelVanillaComponent;\n"],"mappings":";;;;;;;;AAoBA,IAAM,4BAA4B,YAE9B,EAAE,IAAI,WAAW,KAAK,OAAO,GAAG,SAChC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,MAAM,eAAe;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;CAEzE,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,YAAY,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEhG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,eAAe"}
1
+ {"version":3,"file":"Panel.vanilla.js","names":[],"sources":["../../../components/Panel/Panel.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { panelStyle } from './Panel.vanilla.css';\n\nexport type PanelVanillaProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype PanelVanillaComponent = PolymorphicComponent<'div', PanelVanillaProps<ElementType>>;\n\nconst PanelVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, ...props }: PanelVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n const mergedStyles = useInlineStyle(css, style);\n\n return (\n <Component ref={ref} className={cx(panelStyle, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nPanelVanillaComponentImpl.displayName = 'PanelVanilla';\n\nexport const PanelVanilla = PanelVanillaComponentImpl as PanelVanillaComponent;\n"],"mappings":";;;;;;AAoBA,IAAM,4BAA4B,YAE9B,EAAE,IAAI,WAAW,KAAK,OAAO,GAAG,SAChC,QACG;CACH,MAAM,YAAY,MAAM;CACxB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,YAAY,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEhG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,eAAe"}
@@ -1,21 +1,15 @@
1
- const require_cssProps = require("../../styles/cssProps.cjs");
2
1
  const require_cx = require("../../styles/cx.cjs");
3
- const require_themeContext = require("../../styles/themeContext.cjs");
2
+ const require_recipeVariants = require("../../styles/recipeVariants.cjs");
3
+ const require_useInlineStyle = require("../../styles/useInlineStyle.cjs");
4
4
  const require_Paragraph_vanilla_css = require("./Paragraph.vanilla.css.cjs");
5
5
  let react = require("react");
6
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
7
6
  let react_jsx_runtime = require("react/jsx-runtime");
8
7
  // components/Paragraph/Paragraph.vanilla.tsx
8
+ var paragraphClass = require_recipeVariants.withVariantKeys(require_Paragraph_vanilla_css.paragraphRecipe);
9
9
  var ParagraphVanillaComponentImpl = (0, react.forwardRef)(({ as, size, className, css, style, ...props }, ref) => {
10
10
  const Component = as || "p";
11
- const { colors } = require_themeContext.useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
17
- };
18
- const recipeClass = require_Paragraph_vanilla_css.paragraphRecipe({ size });
11
+ const mergedStyles = require_useInlineStyle.useInlineStyle(css, style);
12
+ const recipeClass = paragraphClass({ size });
19
13
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
20
14
  ref,
21
15
  className: require_cx.cx(recipeClass, className),
@@ -1 +1 @@
1
- {"version":3,"file":"Paragraph.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","paragraphRecipe","cx"],"sources":["../../../components/Paragraph/Paragraph.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { paragraphRecipe } from './Paragraph.vanilla.css';\n\ntype ParagraphRecipeVariants = RecipeVariants<typeof paragraphRecipe>;\n\ninterface ParagraphOwnProps extends Omit<ParagraphRecipeVariants, never>, CSSProps {}\n\nexport type ParagraphVanillaProps<C extends ElementType = 'p'> = PolymorphicComponentProps<\n C,\n ParagraphOwnProps\n>;\n\ntype ParagraphVanillaComponent = PolymorphicComponent<'p', ParagraphVanillaProps<ElementType>>;\n\nconst ParagraphVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'p'>(\n { as, size, className, css, style, ...props }: ParagraphVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'p';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = paragraphRecipe({ size });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nParagraphVanillaComponentImpl.displayName = 'ParagraphVanilla';\n\nexport const ParagraphVanilla = ParagraphVanillaComponentImpl as ParagraphVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,iCAAA,GAAgCA,MAAAA,WAAAA,EAElC,EAAE,IAAI,MAAM,WAAW,KAAK,OAAO,GAAG,SACtC,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,cAAcC,8BAAAA,gBAAgB,EAAE,KAAK,CAAC;CAE5C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
1
+ {"version":3,"file":"Paragraph.vanilla.cjs","names":["withVariantKeys","paragraphRecipe","forwardRef","useInlineStyle","cx"],"sources":["../../../components/Paragraph/Paragraph.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { paragraphRecipe } from './Paragraph.vanilla.css';\n\nconst paragraphClass = withVariantKeys(paragraphRecipe);\n\ntype ParagraphRecipeVariants = RecipeVariantProps<typeof paragraphRecipe>;\n\ninterface ParagraphOwnProps extends ParagraphRecipeVariants, CSSProps {}\n\nexport type ParagraphVanillaProps<C extends ElementType = 'p'> = PolymorphicComponentProps<\n C,\n ParagraphOwnProps\n>;\n\ntype ParagraphVanillaComponent = PolymorphicComponent<'p', ParagraphVanillaProps<ElementType>>;\n\nconst ParagraphVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'p'>(\n { as, size, className, css, style, ...props }: ParagraphVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'p';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = paragraphClass({ size });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nParagraphVanillaComponentImpl.displayName = 'ParagraphVanilla';\n\nexport const ParagraphVanilla = ParagraphVanillaComponentImpl as ParagraphVanillaComponent;\n"],"mappings":";;;;;;;AAcA,IAAM,iBAAiBA,uBAAAA,gBAAgBC,8BAAAA,eAAe;AAatD,IAAM,iCAAA,GAAgCC,MAAAA,WAAAA,EAElC,EAAE,IAAI,MAAM,WAAW,KAAK,OAAO,GAAG,SACtC,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAeC,uBAAAA,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,eAAe,EAAE,KAAK,CAAC;CAE3C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
@@ -1,21 +1,15 @@
1
- import { processCSSProp } from "../../styles/cssProps.js";
2
1
  import { cx } from "../../styles/cx.js";
3
- import { useVanillaExtractTheme } from "../../styles/themeContext.js";
2
+ import { withVariantKeys } from "../../styles/recipeVariants.js";
3
+ import { useInlineStyle } from "../../styles/useInlineStyle.js";
4
4
  import { paragraphRecipe } from "./Paragraph.vanilla.css.js";
5
5
  import { forwardRef } from "react";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
6
  import { jsx } from "react/jsx-runtime";
8
7
  // components/Paragraph/Paragraph.vanilla.tsx
8
+ var paragraphClass = withVariantKeys(paragraphRecipe);
9
9
  var ParagraphVanillaComponentImpl = forwardRef(({ as, size, className, css, style, ...props }, ref) => {
10
10
  const Component = as || "p";
11
- const { colors } = useVanillaExtractTheme();
12
- const { style: cssStyles, vars } = processCSSProp(css, colors);
13
- const mergedStyles = {
14
- ...cssStyles,
15
- ...style,
16
- ...assignInlineVars(vars)
17
- };
18
- const recipeClass = paragraphRecipe({ size });
11
+ const mergedStyles = useInlineStyle(css, style);
12
+ const recipeClass = paragraphClass({ size });
19
13
  return /* @__PURE__ */ jsx(Component, {
20
14
  ref,
21
15
  className: cx(recipeClass, className),
@@ -1 +1 @@
1
- {"version":3,"file":"Paragraph.vanilla.js","names":[],"sources":["../../../components/Paragraph/Paragraph.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { paragraphRecipe } from './Paragraph.vanilla.css';\n\ntype ParagraphRecipeVariants = RecipeVariants<typeof paragraphRecipe>;\n\ninterface ParagraphOwnProps extends Omit<ParagraphRecipeVariants, never>, CSSProps {}\n\nexport type ParagraphVanillaProps<C extends ElementType = 'p'> = PolymorphicComponentProps<\n C,\n ParagraphOwnProps\n>;\n\ntype ParagraphVanillaComponent = PolymorphicComponent<'p', ParagraphVanillaProps<ElementType>>;\n\nconst ParagraphVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'p'>(\n { as, size, className, css, style, ...props }: ParagraphVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'p';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = paragraphRecipe({ size });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nParagraphVanillaComponentImpl.displayName = 'ParagraphVanilla';\n\nexport const ParagraphVanilla = ParagraphVanillaComponentImpl as ParagraphVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,gCAAgC,YAElC,EAAE,IAAI,MAAM,WAAW,KAAK,OAAO,GAAG,SACtC,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,gBAAgB,EAAE,KAAK,CAAC;CAE5C,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
1
+ {"version":3,"file":"Paragraph.vanilla.js","names":[],"sources":["../../../components/Paragraph/Paragraph.vanilla.tsx"],"sourcesContent":["import { ElementType, forwardRef } from 'react';\n\nimport { CSSProps } from '@/styles/cssProps';\nimport { cx } from '@/styles/cx';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '@/styles/polymorphic';\nimport { RecipeVariantProps, withVariantKeys } from '@/styles/recipeVariants';\nimport { useInlineStyle } from '@/styles/useInlineStyle';\n\nimport { paragraphRecipe } from './Paragraph.vanilla.css';\n\nconst paragraphClass = withVariantKeys(paragraphRecipe);\n\ntype ParagraphRecipeVariants = RecipeVariantProps<typeof paragraphRecipe>;\n\ninterface ParagraphOwnProps extends ParagraphRecipeVariants, CSSProps {}\n\nexport type ParagraphVanillaProps<C extends ElementType = 'p'> = PolymorphicComponentProps<\n C,\n ParagraphOwnProps\n>;\n\ntype ParagraphVanillaComponent = PolymorphicComponent<'p', ParagraphVanillaProps<ElementType>>;\n\nconst ParagraphVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'p'>(\n { as, size, className, css, style, ...props }: ParagraphVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'p';\n\n const mergedStyles = useInlineStyle(css, style);\n\n const recipeClass = paragraphClass({ size });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nParagraphVanillaComponentImpl.displayName = 'ParagraphVanilla';\n\nexport const ParagraphVanilla = ParagraphVanillaComponentImpl as ParagraphVanillaComponent;\n"],"mappings":";;;;;;;AAcA,IAAM,iBAAiB,gBAAgB,eAAe;AAatD,IAAM,gCAAgC,YAElC,EAAE,IAAI,MAAM,WAAW,KAAK,OAAO,GAAG,SACtC,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,eAAe,eAAe,KAAK,KAAK;CAE9C,MAAM,cAAc,eAAe,EAAE,KAAK,CAAC;CAE3C,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,8BAA8B,cAAc;AAE5C,IAAa,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"RowLink.vanilla.cjs","names":["forwardRef","Slot","ROW_LINK_ATTRIBUTE","cx","rowLink"],"sources":["../../../components/RowLink/RowLink.vanilla.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { cx } from '../../styles/cx';\nimport { ROW_LINK_ATTRIBUTE } from './RowLink.constants';\nimport { rowLink } from './RowLink.vanilla.css';\n\ntype RowLinkVanillaProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n asChild?: boolean;\n /** With `false`, the link does not cover the row, and the row opens it on a click instead. */\n overlay?: boolean;\n};\n\nexport const RowLinkVanilla = forwardRef<HTMLAnchorElement, RowLinkVanillaProps>(\n ({ asChild, overlay = true, className, ...props }, ref) => {\n const Component = asChild ? Slot : 'a';\n\n return (\n <Component\n ref={ref}\n {...{ [ROW_LINK_ATTRIBUTE]: overlay ? '' : 'click' }}\n className={cx(rowLink, className)}\n {...props}\n />\n );\n },\n);\n\nRowLinkVanilla.displayName = 'RowLinkVanilla';\n"],"mappings":";;;;;;;;;AAaA,IAAa,kBAAA,GAAiBA,MAAAA,WAAAA,EAC3B,EAAE,SAAS,UAAU,MAAM,WAAW,GAAG,SAAS,QAAQ;CAGzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAHgB,UAAUC,qBAAAA,OAAO,KAGjC;EACO;GACEC,0BAAAA,qBAAqB,UAAU,KAAK;EAC3C,WAAWC,WAAAA,GAAGC,4BAAAA,SAAS,SAAS;EAChC,GAAI;CACL,CAAA;AAEL,CACF;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"RowLink.vanilla.cjs","names":["forwardRef","Slot","ROW_LINK_ATTRIBUTE","cx","rowLink"],"sources":["../../../components/RowLink/RowLink.vanilla.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { cx } from '@/styles/cx';\n\nimport { ROW_LINK_ATTRIBUTE } from './RowLink.constants';\nimport { rowLink } from './RowLink.vanilla.css';\n\ntype RowLinkVanillaProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n asChild?: boolean;\n /** With `false`, the link does not cover the row, and the row opens it on a click instead. */\n overlay?: boolean;\n};\n\nexport const RowLinkVanilla = forwardRef<HTMLAnchorElement, RowLinkVanillaProps>(\n ({ asChild, overlay = true, className, ...props }, ref) => {\n const Component = asChild ? Slot : 'a';\n\n return (\n <Component\n ref={ref}\n {...{ [ROW_LINK_ATTRIBUTE]: overlay ? '' : 'click' }}\n className={cx(rowLink, className)}\n {...props}\n />\n );\n },\n);\n\nRowLinkVanilla.displayName = 'RowLinkVanilla';\n"],"mappings":";;;;;;;;;AAcA,IAAa,kBAAA,GAAiBA,MAAAA,WAAAA,EAC3B,EAAE,SAAS,UAAU,MAAM,WAAW,GAAG,SAAS,QAAQ;CAGzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAHgB,UAAUC,qBAAAA,OAAO,KAGjC;EACO;GACEC,0BAAAA,qBAAqB,UAAU,KAAK;EAC3C,WAAWC,WAAAA,GAAGC,4BAAAA,SAAS,SAAS;EAChC,GAAI;CACL,CAAA;AAEL,CACF;AAEA,eAAe,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RowLink.vanilla.js","names":[],"sources":["../../../components/RowLink/RowLink.vanilla.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { cx } from '../../styles/cx';\nimport { ROW_LINK_ATTRIBUTE } from './RowLink.constants';\nimport { rowLink } from './RowLink.vanilla.css';\n\ntype RowLinkVanillaProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n asChild?: boolean;\n /** With `false`, the link does not cover the row, and the row opens it on a click instead. */\n overlay?: boolean;\n};\n\nexport const RowLinkVanilla = forwardRef<HTMLAnchorElement, RowLinkVanillaProps>(\n ({ asChild, overlay = true, className, ...props }, ref) => {\n const Component = asChild ? Slot : 'a';\n\n return (\n <Component\n ref={ref}\n {...{ [ROW_LINK_ATTRIBUTE]: overlay ? '' : 'click' }}\n className={cx(rowLink, className)}\n {...props}\n />\n );\n },\n);\n\nRowLinkVanilla.displayName = 'RowLinkVanilla';\n"],"mappings":";;;;;;;AAaA,IAAa,iBAAiB,YAC3B,EAAE,SAAS,UAAU,MAAM,WAAW,GAAG,SAAS,QAAQ;CAGzD,OACE,oBAHgB,UAAU,OAAO,KAGjC;EACO;GACE,qBAAqB,UAAU,KAAK;EAC3C,WAAW,GAAG,SAAS,SAAS;EAChC,GAAI;CACL,CAAA;AAEL,CACF;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"RowLink.vanilla.js","names":[],"sources":["../../../components/RowLink/RowLink.vanilla.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { cx } from '@/styles/cx';\n\nimport { ROW_LINK_ATTRIBUTE } from './RowLink.constants';\nimport { rowLink } from './RowLink.vanilla.css';\n\ntype RowLinkVanillaProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n asChild?: boolean;\n /** With `false`, the link does not cover the row, and the row opens it on a click instead. */\n overlay?: boolean;\n};\n\nexport const RowLinkVanilla = forwardRef<HTMLAnchorElement, RowLinkVanillaProps>(\n ({ asChild, overlay = true, className, ...props }, ref) => {\n const Component = asChild ? Slot : 'a';\n\n return (\n <Component\n ref={ref}\n {...{ [ROW_LINK_ATTRIBUTE]: overlay ? '' : 'click' }}\n className={cx(rowLink, className)}\n {...props}\n />\n );\n },\n);\n\nRowLinkVanilla.displayName = 'RowLinkVanilla';\n"],"mappings":";;;;;;;AAcA,IAAa,iBAAiB,YAC3B,EAAE,SAAS,UAAU,MAAM,WAAW,GAAG,SAAS,QAAQ;CAGzD,OACE,oBAHgB,UAAU,OAAO,KAGjC;EACO;GACE,qBAAqB,UAAU,KAAK;EAC3C,WAAW,GAAG,SAAS,SAAS;EAChC,GAAI;CACL,CAAA;AAEL,CACF;AAEA,eAAe,cAAc"}
@@ -1,24 +1,13 @@
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_SegmentedControl_vanilla_css = require("./SegmentedControl.vanilla.css.cjs");
6
5
  let react = require("react");
7
6
  react = require_runtime.__toESM(react, 1);
8
- let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
9
7
  let react_jsx_runtime = require("react/jsx-runtime");
10
8
  let _radix_ui_react_radio_group = require("@radix-ui/react-radio-group");
11
9
  _radix_ui_react_radio_group = require_runtime.__toESM(_radix_ui_react_radio_group, 1);
12
10
  // components/SegmentedControl/SegmentedControl.vanilla.tsx
13
- var useCssProp = (css, style) => {
14
- const { colors } = require_themeContext.useVanillaExtractTheme();
15
- const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
16
- return {
17
- ...cssStyles,
18
- ...style,
19
- ...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
20
- };
21
- };
22
11
  var SegmentedControlContext = (0, react.createContext)({
23
12
  size: "medium",
24
13
  fullWidth: false
@@ -32,7 +21,7 @@ var SegmentedControlVanilla = (0, react.forwardRef)(({ size = "medium", fullWidt
32
21
  ref,
33
22
  orientation: "horizontal",
34
23
  className: require_cx.cx(require_SegmentedControl_vanilla_css.segmentedControlRecipe({ fullWidth }), className),
35
- style: useCssProp(css, style),
24
+ style: require_useInlineStyle.useInlineStyle(css, style),
36
25
  ...props,
37
26
  children
38
27
  })
@@ -46,7 +35,7 @@ var SegmentedControlItemVanilla = (0, react.forwardRef)(({ className, css, style
46
35
  size,
47
36
  fullWidth
48
37
  }), className),
49
- style: useCssProp(css, style),
38
+ style: require_useInlineStyle.useInlineStyle(css, style),
50
39
  ...props
51
40
  });
52
41
  });