@traefik-labs/faency 13.4.0 → 13.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/components/AriaTable/AriaTable.cjs +13 -5
  2. package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
  3. package/dist/components/AriaTable/AriaTable.constants.cjs +5 -0
  4. package/dist/components/AriaTable/AriaTable.constants.cjs.map +1 -0
  5. package/dist/components/AriaTable/AriaTable.constants.js +5 -0
  6. package/dist/components/AriaTable/AriaTable.constants.js.map +1 -0
  7. package/dist/components/AriaTable/AriaTable.js +13 -5
  8. package/dist/components/AriaTable/AriaTable.js.map +1 -1
  9. package/dist/components/AriaTable/AriaTable.vanilla.cjs +194 -0
  10. package/dist/components/AriaTable/AriaTable.vanilla.cjs.map +1 -0
  11. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs +28 -0
  12. package/dist/components/AriaTable/AriaTable.vanilla.css.cjs.map +1 -0
  13. package/dist/components/AriaTable/AriaTable.vanilla.css.js +17 -0
  14. package/dist/components/AriaTable/AriaTable.vanilla.css.js.map +1 -0
  15. package/dist/components/AriaTable/AriaTable.vanilla.js +185 -0
  16. package/dist/components/AriaTable/AriaTable.vanilla.js.map +1 -0
  17. package/dist/components/Badge/Badge.vanilla.cjs +2 -1
  18. package/dist/components/Badge/Badge.vanilla.cjs.map +1 -1
  19. package/dist/components/Badge/Badge.vanilla.js +2 -1
  20. package/dist/components/Badge/Badge.vanilla.js.map +1 -1
  21. package/dist/components/Blockquote/Blockquote.vanilla.cjs +2 -1
  22. package/dist/components/Blockquote/Blockquote.vanilla.cjs.map +1 -1
  23. package/dist/components/Blockquote/Blockquote.vanilla.js +2 -1
  24. package/dist/components/Blockquote/Blockquote.vanilla.js.map +1 -1
  25. package/dist/components/Box/Box.vanilla.cjs +2 -1
  26. package/dist/components/Box/Box.vanilla.cjs.map +1 -1
  27. package/dist/components/Box/Box.vanilla.js +2 -1
  28. package/dist/components/Box/Box.vanilla.js.map +1 -1
  29. package/dist/components/Bubble/Bubble.vanilla.cjs +2 -1
  30. package/dist/components/Bubble/Bubble.vanilla.cjs.map +1 -1
  31. package/dist/components/Bubble/Bubble.vanilla.js +2 -1
  32. package/dist/components/Bubble/Bubble.vanilla.js.map +1 -1
  33. package/dist/components/Button/Button.vanilla.cjs +2 -1
  34. package/dist/components/Button/Button.vanilla.cjs.map +1 -1
  35. package/dist/components/Button/Button.vanilla.js +2 -1
  36. package/dist/components/Button/Button.vanilla.js.map +1 -1
  37. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs +5 -4
  38. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.cjs.map +1 -1
  39. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js +5 -4
  40. package/dist/components/ButtonSwitch/ButtonSwitch.vanilla.js.map +1 -1
  41. package/dist/components/Card/Card.vanilla.cjs +2 -1
  42. package/dist/components/Card/Card.vanilla.cjs.map +1 -1
  43. package/dist/components/Card/Card.vanilla.js +2 -1
  44. package/dist/components/Card/Card.vanilla.js.map +1 -1
  45. package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
  46. package/dist/components/CodeBlock/CodeBlock.js +2 -2
  47. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +6 -14
  48. package/dist/components/CodeBlock/CodeBlock.vanilla.cjs.map +1 -1
  49. package/dist/components/CodeBlock/CodeBlock.vanilla.js +6 -14
  50. package/dist/components/CodeBlock/CodeBlock.vanilla.js.map +1 -1
  51. package/dist/components/Combobox/Combobox.vanilla.cjs +2 -2
  52. package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -1
  53. package/dist/components/Combobox/Combobox.vanilla.js +2 -2
  54. package/dist/components/Combobox/Combobox.vanilla.js.map +1 -1
  55. package/dist/components/Container/Container.vanilla.cjs +2 -1
  56. package/dist/components/Container/Container.vanilla.cjs.map +1 -1
  57. package/dist/components/Container/Container.vanilla.js +2 -1
  58. package/dist/components/Container/Container.vanilla.js.map +1 -1
  59. package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
  60. package/dist/components/DateTimePicker/DateTimePicker.js +1 -1
  61. package/dist/components/Dialog/Dialog.cjs +1 -1
  62. package/dist/components/Dialog/Dialog.js +1 -1
  63. package/dist/components/Elevation/Elevation.vanilla.cjs +2 -1
  64. package/dist/components/Elevation/Elevation.vanilla.cjs.map +1 -1
  65. package/dist/components/Elevation/Elevation.vanilla.css.cjs.map +1 -1
  66. package/dist/components/Elevation/Elevation.vanilla.css.js.map +1 -1
  67. package/dist/components/Elevation/Elevation.vanilla.js +2 -1
  68. package/dist/components/Elevation/Elevation.vanilla.js.map +1 -1
  69. package/dist/components/Field/Field.cjs +80 -33
  70. package/dist/components/Field/Field.cjs.map +1 -1
  71. package/dist/components/Field/Field.js +80 -33
  72. package/dist/components/Field/Field.js.map +1 -1
  73. package/dist/components/Field/Field.vanilla.cjs +62 -32
  74. package/dist/components/Field/Field.vanilla.cjs.map +1 -1
  75. package/dist/components/Field/Field.vanilla.css.cjs +6 -0
  76. package/dist/components/Field/Field.vanilla.css.cjs.map +1 -1
  77. package/dist/components/Field/Field.vanilla.css.js +4 -1
  78. package/dist/components/Field/Field.vanilla.css.js.map +1 -1
  79. package/dist/components/Field/Field.vanilla.js +63 -33
  80. package/dist/components/Field/Field.vanilla.js.map +1 -1
  81. package/dist/components/Field/FieldContext.cjs +48 -10
  82. package/dist/components/Field/FieldContext.cjs.map +1 -1
  83. package/dist/components/Field/FieldContext.js +48 -10
  84. package/dist/components/Field/FieldContext.js.map +1 -1
  85. package/dist/components/Flex/Flex.vanilla.cjs +2 -1
  86. package/dist/components/Flex/Flex.vanilla.cjs.map +1 -1
  87. package/dist/components/Flex/Flex.vanilla.js +2 -1
  88. package/dist/components/Flex/Flex.vanilla.js.map +1 -1
  89. package/dist/components/Grid/Grid.vanilla.cjs +2 -1
  90. package/dist/components/Grid/Grid.vanilla.cjs.map +1 -1
  91. package/dist/components/Grid/Grid.vanilla.js +2 -1
  92. package/dist/components/Grid/Grid.vanilla.js.map +1 -1
  93. package/dist/components/IconButton/IconButton.vanilla.cjs +2 -1
  94. package/dist/components/IconButton/IconButton.vanilla.cjs.map +1 -1
  95. package/dist/components/IconButton/IconButton.vanilla.js +2 -1
  96. package/dist/components/IconButton/IconButton.vanilla.js.map +1 -1
  97. package/dist/components/Image/Image.vanilla.cjs +2 -1
  98. package/dist/components/Image/Image.vanilla.cjs.map +1 -1
  99. package/dist/components/Image/Image.vanilla.js +2 -1
  100. package/dist/components/Image/Image.vanilla.js.map +1 -1
  101. package/dist/components/Input/Input.vanilla.cjs +2 -1
  102. package/dist/components/Input/Input.vanilla.cjs.map +1 -1
  103. package/dist/components/Input/Input.vanilla.js +2 -1
  104. package/dist/components/Input/Input.vanilla.js.map +1 -1
  105. package/dist/components/Label/Label.vanilla.cjs +2 -1
  106. package/dist/components/Label/Label.vanilla.cjs.map +1 -1
  107. package/dist/components/Label/Label.vanilla.js +2 -1
  108. package/dist/components/Label/Label.vanilla.js.map +1 -1
  109. package/dist/components/List/List.cjs +1 -1
  110. package/dist/components/List/List.js +1 -1
  111. package/dist/components/Meter/Meter.vanilla.cjs +3 -2
  112. package/dist/components/Meter/Meter.vanilla.cjs.map +1 -1
  113. package/dist/components/Meter/Meter.vanilla.js +3 -2
  114. package/dist/components/Meter/Meter.vanilla.js.map +1 -1
  115. package/dist/components/NavigationTree/NavigationTreeItem.cjs +2 -2
  116. package/dist/components/NavigationTree/NavigationTreeItem.js +2 -2
  117. package/dist/components/Panel/Panel.vanilla.cjs +2 -1
  118. package/dist/components/Panel/Panel.vanilla.cjs.map +1 -1
  119. package/dist/components/Panel/Panel.vanilla.js +2 -1
  120. package/dist/components/Panel/Panel.vanilla.js.map +1 -1
  121. package/dist/components/Paragraph/Paragraph.vanilla.cjs +2 -1
  122. package/dist/components/Paragraph/Paragraph.vanilla.cjs.map +1 -1
  123. package/dist/components/Paragraph/Paragraph.vanilla.js +2 -1
  124. package/dist/components/Paragraph/Paragraph.vanilla.js.map +1 -1
  125. package/dist/components/RowLink/RowLink.cjs +18 -46
  126. package/dist/components/RowLink/RowLink.cjs.map +1 -1
  127. package/dist/components/RowLink/RowLink.constants.cjs +7 -0
  128. package/dist/components/RowLink/RowLink.constants.cjs.map +1 -0
  129. package/dist/components/RowLink/RowLink.constants.js +6 -0
  130. package/dist/components/RowLink/RowLink.constants.js.map +1 -0
  131. package/dist/components/RowLink/RowLink.js +15 -45
  132. package/dist/components/RowLink/RowLink.js.map +1 -1
  133. package/dist/components/RowLink/RowLink.utils.cjs +87 -0
  134. package/dist/components/RowLink/RowLink.utils.cjs.map +1 -0
  135. package/dist/components/RowLink/RowLink.utils.js +83 -0
  136. package/dist/components/RowLink/RowLink.utils.js.map +1 -0
  137. package/dist/components/RowLink/RowLink.vanilla.cjs +21 -0
  138. package/dist/components/RowLink/RowLink.vanilla.cjs.map +1 -0
  139. package/dist/components/RowLink/RowLink.vanilla.css.cjs +10 -0
  140. package/dist/components/RowLink/RowLink.vanilla.css.cjs.map +1 -0
  141. package/dist/components/RowLink/RowLink.vanilla.css.js +8 -0
  142. package/dist/components/RowLink/RowLink.vanilla.css.js.map +1 -0
  143. package/dist/components/RowLink/RowLink.vanilla.js +19 -0
  144. package/dist/components/RowLink/RowLink.vanilla.js.map +1 -0
  145. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +3 -3
  146. package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -1
  147. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +3 -3
  148. package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -1
  149. package/dist/components/Select/Select.cjs +1 -1
  150. package/dist/components/Select/Select.js +1 -1
  151. package/dist/components/Skeleton/Skeleton.vanilla.cjs +2 -1
  152. package/dist/components/Skeleton/Skeleton.vanilla.cjs.map +1 -1
  153. package/dist/components/Skeleton/Skeleton.vanilla.js +2 -1
  154. package/dist/components/Skeleton/Skeleton.vanilla.js.map +1 -1
  155. package/dist/components/Spinner/Spinner.vanilla.cjs +3 -2
  156. package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -1
  157. package/dist/components/Spinner/Spinner.vanilla.js +3 -2
  158. package/dist/components/Spinner/Spinner.vanilla.js.map +1 -1
  159. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +4 -3
  160. package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -1
  161. package/dist/components/SplitLayout/SplitLayout.vanilla.js +4 -3
  162. package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -1
  163. package/dist/components/Table/ExpandToggle.vanilla.cjs +30 -0
  164. package/dist/components/Table/ExpandToggle.vanilla.cjs.map +1 -0
  165. package/dist/components/Table/ExpandToggle.vanilla.js +27 -0
  166. package/dist/components/Table/ExpandToggle.vanilla.js.map +1 -0
  167. package/dist/components/Table/SortButton.vanilla.cjs +38 -0
  168. package/dist/components/Table/SortButton.vanilla.cjs.map +1 -0
  169. package/dist/components/Table/SortButton.vanilla.js +35 -0
  170. package/dist/components/Table/SortButton.vanilla.js.map +1 -0
  171. package/dist/components/Table/Table.cjs +11 -4
  172. package/dist/components/Table/Table.cjs.map +1 -1
  173. package/dist/components/Table/Table.js +11 -4
  174. package/dist/components/Table/Table.js.map +1 -1
  175. package/dist/components/Table/Table.vanilla.cjs +142 -0
  176. package/dist/components/Table/Table.vanilla.cjs.map +1 -0
  177. package/dist/components/Table/Table.vanilla.css.cjs +178 -0
  178. package/dist/components/Table/Table.vanilla.css.cjs.map +1 -0
  179. package/dist/components/Table/Table.vanilla.css.js +161 -0
  180. package/dist/components/Table/Table.vanilla.css.js.map +1 -0
  181. package/dist/components/Table/Table.vanilla.js +133 -0
  182. package/dist/components/Table/Table.vanilla.js.map +1 -0
  183. package/dist/components/Table/useTableSort.cjs +60 -0
  184. package/dist/components/Table/useTableSort.cjs.map +1 -0
  185. package/dist/components/Table/useTableSort.js +59 -0
  186. package/dist/components/Table/useTableSort.js.map +1 -0
  187. package/dist/components/Text/Text.vanilla.cjs +2 -1
  188. package/dist/components/Text/Text.vanilla.cjs.map +1 -1
  189. package/dist/components/Text/Text.vanilla.js +2 -1
  190. package/dist/components/Text/Text.vanilla.js.map +1 -1
  191. package/dist/components/TextField/TextField.cjs +1 -1
  192. package/dist/components/TextField/TextField.js +1 -1
  193. package/dist/components/TextField/TextField.vanilla.cjs +1 -1
  194. package/dist/components/TextField/TextField.vanilla.js +1 -1
  195. package/dist/components/Textarea/Textarea.cjs +2 -2
  196. package/dist/components/Textarea/Textarea.js +2 -2
  197. package/dist/components/Textarea/Textarea.vanilla.cjs +4 -3
  198. package/dist/components/Textarea/Textarea.vanilla.cjs.map +1 -1
  199. package/dist/components/Textarea/Textarea.vanilla.js +4 -3
  200. package/dist/components/Textarea/Textarea.vanilla.js.map +1 -1
  201. package/dist/components/Toast/Toast.vanilla.cjs +5 -5
  202. package/dist/components/Toast/Toast.vanilla.cjs.map +1 -1
  203. package/dist/components/Toast/Toast.vanilla.js +5 -5
  204. package/dist/components/Toast/Toast.vanilla.js.map +1 -1
  205. package/dist/components/Toast/ToastProvider.vanilla.cjs +1 -1
  206. package/dist/components/Toast/ToastProvider.vanilla.js +1 -1
  207. package/dist/faency.css +3001 -2303
  208. package/dist/index.cjs +50 -29
  209. package/dist/index.d.ts +570 -24
  210. package/dist/index.js +33 -30
  211. package/dist/styles/cx.cjs +5 -0
  212. package/dist/styles/cx.cjs.map +1 -0
  213. package/dist/styles/cx.js +5 -0
  214. package/dist/styles/cx.js.map +1 -0
  215. package/dist/styles/themes.css.cjs.map +1 -1
  216. package/dist/styles/themes.css.js.map +1 -1
  217. package/dist/styles/tokens.css.cjs +55 -44
  218. package/dist/styles/tokens.css.cjs.map +1 -1
  219. package/dist/styles/tokens.css.js +55 -44
  220. package/dist/styles/tokens.css.js.map +1 -1
  221. package/dist/styles/useInlineStyle.cjs +16 -0
  222. package/dist/styles/useInlineStyle.cjs.map +1 -0
  223. package/dist/styles/useInlineStyle.js +16 -0
  224. package/dist/styles/useInlineStyle.js.map +1 -0
  225. package/dist/utils/warnOnce.cjs +13 -0
  226. package/dist/utils/warnOnce.cjs.map +1 -0
  227. package/dist/utils/warnOnce.js +13 -0
  228. package/dist/utils/warnOnce.js.map +1 -0
  229. package/package.json +10 -17
@@ -1,31 +1,43 @@
1
+ import { warnOnce } from "../../utils/warnOnce.js";
1
2
  import React from "react";
2
3
  // components/Field/FieldContext.ts
3
4
  var FieldContext = React.createContext(null);
4
5
  var useFieldContext = () => React.useContext(FieldContext);
5
6
  var hasContent = (node) => node !== void 0 && node !== null && node !== false && node !== "";
6
- var useFieldRoot = ({ id, label, description, error, invalid, disabled }) => {
7
+ var noop = () => {};
8
+ var MULTIPLE_CONTROLS_WARNING = "Field: more than one control is in this Field, and its label points to one of them only. Use group, or one Field per control.";
9
+ var useFieldRoot = ({ id, label, hint, description, error, invalid, disabled, messageSize, group = false }) => {
7
10
  const outerContext = useFieldContext();
8
11
  const generatedId = React.useId();
9
12
  const hasLabel = typeof label === "function" || hasContent(label);
13
+ const hasHint = hasContent(hint);
14
+ const resolvedMessageSize = messageSize ?? outerContext?.messageSize ?? "0";
10
15
  const hasDescription = hasContent(description);
11
16
  const hasError = hasContent(error);
12
17
  const isInvalid = Boolean(invalid) || hasError;
18
+ const isDisabled = Boolean(disabled) || Boolean(outerContext?.disabled);
13
19
  const [control, setControl] = React.useState(null);
14
- const registerControl = React.useCallback((next) => {
20
+ const controlsRef = React.useRef(/* @__PURE__ */ new Map());
21
+ const registerControl = React.useCallback((key, state) => {
22
+ const controls = controlsRef.current;
23
+ if (state) controls.set(key, state);
24
+ else controls.delete(key);
25
+ if (controls.size > 1) warnOnce(MULTIPLE_CONTROLS_WARNING);
26
+ const next = controls.values().next().value ?? null;
15
27
  setControl((prev) => prev?.id === next?.id && prev?.disabled === next?.disabled && prev?.invalid === next?.invalid && prev?.labelable === next?.labelable ? prev : next);
16
28
  }, []);
17
29
  const controlId = control?.id ?? id ?? (hasLabel ? `${generatedId}-control` : void 0);
18
- const labelFor = control?.labelable === false ? void 0 : controlId;
30
+ const labelFor = group ? void 0 : control ? control.labelable === false ? void 0 : controlId : id;
19
31
  const [hasFocus, setHasFocus] = React.useState(false);
20
32
  const onFocus = React.useCallback(() => setHasFocus(true), []);
21
33
  const onBlur = React.useCallback(() => setHasFocus(false), []);
22
34
  const labelVariant = React.useMemo(() => {
23
- if (disabled || control?.disabled) return "subtle";
35
+ if (isDisabled || control?.disabled) return "subtle";
24
36
  if (isInvalid || control?.invalid) return "invalid";
25
37
  if (hasFocus) return "contrast";
26
38
  return "default";
27
39
  }, [
28
- disabled,
40
+ isDisabled,
29
41
  isInvalid,
30
42
  hasFocus,
31
43
  control?.disabled,
@@ -36,8 +48,10 @@ var useFieldRoot = ({ id, label, description, error, invalid, disabled }) => {
36
48
  labelId: hasLabel ? `${generatedId}-label` : void 0,
37
49
  descriptionId: hasDescription ? `${generatedId}-description` : void 0,
38
50
  errorId: hasError ? `${generatedId}-error` : void 0,
51
+ hintId: hasHint ? `${generatedId}-hint` : void 0,
52
+ messageSize: resolvedMessageSize,
39
53
  invalid: isInvalid,
40
- disabled: Boolean(disabled),
54
+ disabled: isDisabled,
41
55
  registerControl
42
56
  }), [
43
57
  controlId,
@@ -45,15 +59,36 @@ var useFieldRoot = ({ id, label, description, error, invalid, disabled }) => {
45
59
  hasLabel,
46
60
  hasDescription,
47
61
  hasError,
62
+ hasHint,
63
+ resolvedMessageSize,
48
64
  isInvalid,
49
- disabled,
65
+ isDisabled,
50
66
  registerControl
51
67
  ]);
68
+ const groupContext = React.useMemo(() => ({
69
+ messageSize: resolvedMessageSize,
70
+ invalid: false,
71
+ disabled: isDisabled,
72
+ registerControl: noop
73
+ }), [resolvedMessageSize, isDisabled]);
74
+ const groupProps = group ? {
75
+ role: "group",
76
+ "aria-labelledby": ownContext.labelId,
77
+ "aria-describedby": [
78
+ ownContext.errorId,
79
+ ownContext.descriptionId,
80
+ ownContext.hintId
81
+ ].filter(Boolean).join(" ") || void 0
82
+ } : {};
52
83
  return {
53
- context: outerContext && !hasLabel && !hasDescription && !hasError ? outerContext : ownContext,
84
+ context: group ? groupContext : outerContext && !hasLabel && !hasHint && !hasDescription && !hasError ? outerContext : ownContext,
85
+ ids: ownContext,
86
+ groupProps,
87
+ messageSize: resolvedMessageSize,
54
88
  labelFor,
55
89
  labelVariant,
56
90
  hasLabel,
91
+ hasHint,
57
92
  hasDescription,
58
93
  hasError,
59
94
  onFocus,
@@ -67,20 +102,22 @@ var useFieldRoot = ({ id, label, description, error, invalid, disabled }) => {
67
102
  */
68
103
  var useFieldControl = ({ id, invalid, disabled, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, labelable = true }) => {
69
104
  const field = useFieldContext();
105
+ const registrationId = React.useId();
70
106
  const ownInvalid = Boolean(invalid || ariaInvalid === true || ariaInvalid === "true");
71
107
  const isInvalid = ownInvalid || Boolean(field?.invalid);
72
108
  const registerControl = field?.registerControl;
73
109
  React.useEffect(() => {
74
110
  if (!registerControl) return;
75
- registerControl({
111
+ registerControl(registrationId, {
76
112
  id,
77
113
  disabled: Boolean(disabled),
78
114
  invalid: ownInvalid,
79
115
  labelable
80
116
  });
81
- return () => registerControl(null);
117
+ return () => registerControl(registrationId, null);
82
118
  }, [
83
119
  registerControl,
120
+ registrationId,
84
121
  id,
85
122
  disabled,
86
123
  ownInvalid,
@@ -89,6 +126,7 @@ var useFieldControl = ({ id, invalid, disabled, "aria-describedby": describedBy,
89
126
  const describedByIds = [
90
127
  field?.errorId,
91
128
  field?.descriptionId,
129
+ field?.hintId,
92
130
  describedBy
93
131
  ].filter(Boolean).join(" ") || void 0;
94
132
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"FieldContext.js","names":[],"sources":["../../../components/Field/FieldContext.ts"],"sourcesContent":["import React from 'react';\n\ntype FieldControlState = { id?: string; disabled: boolean; invalid: boolean; labelable: boolean };\n\nexport type FieldContextValue = {\n controlId?: string;\n labelId?: string;\n descriptionId?: string;\n errorId?: string;\n invalid: boolean;\n disabled: boolean;\n registerControl: (state: FieldControlState | null) => void;\n};\n\nexport const FieldContext = React.createContext<FieldContextValue | null>(null);\n\nexport const useFieldContext = () => React.useContext(FieldContext);\n\nexport type FieldControlOptions = {\n id?: string;\n invalid?: boolean;\n disabled?: boolean;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n /** Set to false when the control is not a labelable element, such as a radio group. */\n labelable?: boolean;\n};\n\nexport type FieldLabelVariant = 'invalid' | 'subtle' | 'contrast' | 'default';\n\nexport type FieldLabelProps = {\n variant: FieldLabelVariant;\n htmlFor?: string;\n id: string;\n};\n\nexport type FieldBaseProps = {\n id?: string;\n label?: React.ReactNode | ((props: FieldLabelProps) => React.ReactNode);\n description?: React.ReactNode;\n error?: React.ReactNode;\n invalid?: boolean;\n disabled?: boolean;\n announceError?: boolean;\n labelPosition?: 'top' | 'end';\n children?: React.ReactNode;\n};\n\nconst hasContent = (node: React.ReactNode) =>\n node !== undefined && node !== null && node !== false && node !== '';\n\nexport const useFieldRoot = ({\n id,\n label,\n description,\n error,\n invalid,\n disabled,\n}: FieldBaseProps) => {\n const outerContext = useFieldContext();\n const generatedId = React.useId();\n const hasLabel = typeof label === 'function' || hasContent(label);\n const hasDescription = hasContent(description);\n const hasError = hasContent(error);\n const isInvalid = Boolean(invalid) || hasError;\n\n const [control, setControl] = React.useState<FieldControlState | null>(null);\n const registerControl = React.useCallback((next: FieldControlState | null) => {\n setControl((prev) =>\n prev?.id === next?.id &&\n prev?.disabled === next?.disabled &&\n prev?.invalid === next?.invalid &&\n prev?.labelable === next?.labelable\n ? prev\n : next,\n );\n }, []);\n const controlId = control?.id ?? id ?? (hasLabel ? `${generatedId}-control` : undefined);\n const labelFor = control?.labelable === false ? undefined : controlId;\n\n const [hasFocus, setHasFocus] = React.useState(false);\n const onFocus = React.useCallback(() => setHasFocus(true), []);\n const onBlur = React.useCallback(() => setHasFocus(false), []);\n\n const labelVariant: FieldLabelVariant = React.useMemo(() => {\n if (disabled || control?.disabled) {\n return 'subtle';\n }\n if (isInvalid || control?.invalid) {\n return 'invalid';\n }\n if (hasFocus) {\n return 'contrast';\n }\n return 'default';\n }, [disabled, isInvalid, hasFocus, control?.disabled, control?.invalid]);\n\n const ownContext: FieldContextValue = React.useMemo(\n () => ({\n controlId,\n labelId: hasLabel ? `${generatedId}-label` : undefined,\n descriptionId: hasDescription ? `${generatedId}-description` : undefined,\n errorId: hasError ? `${generatedId}-error` : undefined,\n invalid: isInvalid,\n disabled: Boolean(disabled),\n registerControl,\n }),\n [\n controlId,\n generatedId,\n hasLabel,\n hasDescription,\n hasError,\n isInvalid,\n disabled,\n registerControl,\n ],\n );\n\n // A Field with no label, description or error inside another Field keeps the outer one.\n const context =\n outerContext && !hasLabel && !hasDescription && !hasError ? outerContext : ownContext;\n\n return { context, labelFor, labelVariant, hasLabel, hasDescription, hasError, onFocus, onBlur };\n};\n\n/**\n * Gives a form control the id, `aria-describedby`, `aria-invalid` and `disabled` of the `Field` around it,\n * and gives its own id, `disabled` and invalid state to that `Field`.\n * Outside a `Field`, it only sets `aria-invalid` from `invalid`.\n */\nexport const useFieldControl = ({\n id,\n invalid,\n disabled,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n labelable = true,\n}: FieldControlOptions) => {\n const field = useFieldContext();\n const ownInvalid = Boolean(invalid || ariaInvalid === true || ariaInvalid === 'true');\n const isInvalid = ownInvalid || Boolean(field?.invalid);\n const registerControl = field?.registerControl;\n\n React.useEffect(() => {\n if (!registerControl) {\n return undefined;\n }\n registerControl({ id, disabled: Boolean(disabled), invalid: ownInvalid, labelable });\n return () => registerControl(null);\n }, [registerControl, id, disabled, ownInvalid, labelable]);\n const describedByIds =\n [field?.errorId, field?.descriptionId, describedBy].filter(Boolean).join(' ') || undefined;\n\n return {\n id: id ?? field?.controlId,\n labelId: field?.labelId,\n invalid: isInvalid,\n disabled: disabled || field?.disabled || undefined,\n 'aria-describedby': describedByIds,\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n };\n};\n\nconst ANNOUNCE_DELAY = 1000;\n\n/**\n * Returns the text of the error, after the text of the label when there is one, once it has not\n * changed for a short time, so that a screen reader reads it after the echo of the typed text.\n */\nexport const useAnnouncedError = (enabled: boolean, errorId?: string, labelId?: string) => {\n const [announcedError, setAnnouncedError] = React.useState<string | null>(null);\n const lastTextRef = React.useRef<string | null | undefined>(undefined);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>();\n\n // Compares the rendered text, so that a new JSX error with the same text does not restart the delay.\n React.useEffect(() => {\n const text =\n (enabled && errorId && document.getElementById(errorId)?.textContent?.trim()) || null;\n if (text === lastTextRef.current) {\n return;\n }\n lastTextRef.current = text;\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(\n () => {\n const fieldName = labelId\n ? document.getElementById(labelId)?.textContent?.trim()\n : undefined;\n setAnnouncedError(text !== null && fieldName ? `${fieldName}: ${text}` : text);\n },\n text === null ? 0 : ANNOUNCE_DELAY,\n );\n });\n\n React.useEffect(\n () => () => {\n clearTimeout(timeoutRef.current);\n lastTextRef.current = undefined;\n },\n [],\n );\n\n return announcedError;\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"FieldContext.js","names":[],"sources":["../../../components/Field/FieldContext.ts"],"sourcesContent":["import React from 'react';\n\nimport { warnOnce } from '../../utils/warnOnce';\n\ntype MessageSize = '0' | '1' | '2' | '3';\n\ntype FieldControlState = { id?: string; disabled: boolean; invalid: boolean; labelable: boolean };\n\nexport type FieldContextValue = {\n controlId?: string;\n labelId?: string;\n descriptionId?: string;\n errorId?: string;\n hintId?: string;\n messageSize: MessageSize;\n invalid: boolean;\n disabled: boolean;\n registerControl: (key: string, state: FieldControlState | null) => void;\n};\n\nexport const FieldContext = React.createContext<FieldContextValue | null>(null);\n\nexport const useFieldContext = () => React.useContext(FieldContext);\n\nexport type FieldControlOptions = {\n id?: string;\n invalid?: boolean;\n disabled?: boolean;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n /** Set to false when the control is not a labelable element, such as a radio group. */\n labelable?: boolean;\n};\n\nexport type FieldLabelVariant = 'invalid' | 'subtle' | 'contrast' | 'default';\n\nexport type FieldLabelProps = {\n variant: FieldLabelVariant;\n htmlFor?: string;\n id: string;\n};\n\nexport type FieldBaseProps = {\n id?: string;\n label?: React.ReactNode | ((props: FieldLabelProps) => React.ReactNode);\n /** Text under the label, for what the field is for. */\n hint?: React.ReactNode;\n description?: React.ReactNode;\n error?: React.ReactNode;\n invalid?: boolean;\n disabled?: boolean;\n announceError?: boolean;\n /** `start` puts the label and the hint in a column before the control, and wraps under it when space is short. */\n labelPosition?: 'top' | 'start' | 'end';\n /** The text size of the hint, the description and the error. A Field inside another Field takes its size. */\n messageSize?: MessageSize;\n /**\n * For a field of more than one control: the field becomes a group named by the label and described by\n * the hint, the description and the error. Give each control its own name, and its own error with an inner Field.\n */\n group?: boolean;\n children?: React.ReactNode;\n};\n\nconst hasContent = (node: React.ReactNode) =>\n node !== undefined && node !== null && node !== false && node !== '';\n\nconst noop = () => {};\n\nconst MULTIPLE_CONTROLS_WARNING =\n 'Field: more than one control is in this Field, and its label points to one of them only. Use group, or one Field per control.';\n\nexport const useFieldRoot = ({\n id,\n label,\n hint,\n description,\n error,\n invalid,\n disabled,\n messageSize,\n group = false,\n}: FieldBaseProps) => {\n const outerContext = useFieldContext();\n const generatedId = React.useId();\n const hasLabel = typeof label === 'function' || hasContent(label);\n const hasHint = hasContent(hint);\n const resolvedMessageSize = messageSize ?? outerContext?.messageSize ?? '0';\n const hasDescription = hasContent(description);\n const hasError = hasContent(error);\n const isInvalid = Boolean(invalid) || hasError;\n const isDisabled = Boolean(disabled) || Boolean(outerContext?.disabled);\n\n const [control, setControl] = React.useState<FieldControlState | null>(null);\n const controlsRef = React.useRef(new Map<string, FieldControlState>());\n const registerControl = React.useCallback((key: string, state: FieldControlState | null) => {\n const controls = controlsRef.current;\n if (state) {\n controls.set(key, state);\n } else {\n controls.delete(key);\n }\n if (controls.size > 1) {\n warnOnce(MULTIPLE_CONTROLS_WARNING);\n }\n const next = controls.values().next().value ?? null;\n setControl((prev) =>\n prev?.id === next?.id &&\n prev?.disabled === next?.disabled &&\n prev?.invalid === next?.invalid &&\n prev?.labelable === next?.labelable\n ? prev\n : next,\n );\n }, []);\n const controlId = control?.id ?? id ?? (hasLabel ? `${generatedId}-control` : undefined);\n // The label points to a control only once one is there, so it never points to a missing id.\n const labelFor = group\n ? undefined\n : control\n ? control.labelable === false\n ? undefined\n : controlId\n : id;\n\n const [hasFocus, setHasFocus] = React.useState(false);\n const onFocus = React.useCallback(() => setHasFocus(true), []);\n const onBlur = React.useCallback(() => setHasFocus(false), []);\n\n const labelVariant: FieldLabelVariant = React.useMemo(() => {\n if (isDisabled || control?.disabled) {\n return 'subtle';\n }\n if (isInvalid || control?.invalid) {\n return 'invalid';\n }\n if (hasFocus) {\n return 'contrast';\n }\n return 'default';\n }, [isDisabled, isInvalid, hasFocus, control?.disabled, control?.invalid]);\n\n const ownContext: FieldContextValue = React.useMemo(\n () => ({\n controlId,\n labelId: hasLabel ? `${generatedId}-label` : undefined,\n descriptionId: hasDescription ? `${generatedId}-description` : undefined,\n errorId: hasError ? `${generatedId}-error` : undefined,\n hintId: hasHint ? `${generatedId}-hint` : undefined,\n messageSize: resolvedMessageSize,\n invalid: isInvalid,\n disabled: isDisabled,\n registerControl,\n }),\n [\n controlId,\n generatedId,\n hasLabel,\n hasDescription,\n hasError,\n hasHint,\n resolvedMessageSize,\n isInvalid,\n isDisabled,\n registerControl,\n ],\n );\n\n // The controls of a group get only its disabled state: the group itself carries the name and the messages.\n const groupContext: FieldContextValue = React.useMemo(\n () => ({\n messageSize: resolvedMessageSize,\n invalid: false,\n disabled: isDisabled,\n registerControl: noop,\n }),\n [resolvedMessageSize, isDisabled],\n );\n\n const groupProps = group\n ? {\n role: 'group',\n 'aria-labelledby': ownContext.labelId,\n 'aria-describedby':\n [ownContext.errorId, ownContext.descriptionId, ownContext.hintId]\n .filter(Boolean)\n .join(' ') || undefined,\n }\n : {};\n\n // A Field with no label, hint, description or error inside another Field keeps the outer one.\n const context = group\n ? groupContext\n : outerContext && !hasLabel && !hasHint && !hasDescription && !hasError\n ? outerContext\n : ownContext;\n\n return {\n context,\n ids: ownContext,\n groupProps,\n messageSize: resolvedMessageSize,\n labelFor,\n labelVariant,\n hasLabel,\n hasHint,\n hasDescription,\n hasError,\n onFocus,\n onBlur,\n };\n};\n\n/**\n * Gives a form control the id, `aria-describedby`, `aria-invalid` and `disabled` of the `Field` around it,\n * and gives its own id, `disabled` and invalid state to that `Field`.\n * Outside a `Field`, it only sets `aria-invalid` from `invalid`.\n */\nexport const useFieldControl = ({\n id,\n invalid,\n disabled,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n labelable = true,\n}: FieldControlOptions) => {\n const field = useFieldContext();\n const registrationId = React.useId();\n const ownInvalid = Boolean(invalid || ariaInvalid === true || ariaInvalid === 'true');\n const isInvalid = ownInvalid || Boolean(field?.invalid);\n const registerControl = field?.registerControl;\n\n React.useEffect(() => {\n if (!registerControl) {\n return undefined;\n }\n registerControl(registrationId, {\n id,\n disabled: Boolean(disabled),\n invalid: ownInvalid,\n labelable,\n });\n return () => registerControl(registrationId, null);\n }, [registerControl, registrationId, id, disabled, ownInvalid, labelable]);\n const describedByIds =\n [field?.errorId, field?.descriptionId, field?.hintId, describedBy].filter(Boolean).join(' ') ||\n undefined;\n\n return {\n id: id ?? field?.controlId,\n labelId: field?.labelId,\n invalid: isInvalid,\n disabled: disabled || field?.disabled || undefined,\n 'aria-describedby': describedByIds,\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n };\n};\n\nconst ANNOUNCE_DELAY = 1000;\n\n/**\n * Returns the text of the error, after the text of the label when there is one, once it has not\n * changed for a short time, so that a screen reader reads it after the echo of the typed text.\n */\nexport const useAnnouncedError = (enabled: boolean, errorId?: string, labelId?: string) => {\n const [announcedError, setAnnouncedError] = React.useState<string | null>(null);\n const lastTextRef = React.useRef<string | null | undefined>(undefined);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>();\n\n // Compares the rendered text, so that a new JSX error with the same text does not restart the delay.\n React.useEffect(() => {\n const text =\n (enabled && errorId && document.getElementById(errorId)?.textContent?.trim()) || null;\n if (text === lastTextRef.current) {\n return;\n }\n lastTextRef.current = text;\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(\n () => {\n const fieldName = labelId\n ? document.getElementById(labelId)?.textContent?.trim()\n : undefined;\n setAnnouncedError(text !== null && fieldName ? `${fieldName}: ${text}` : text);\n },\n text === null ? 0 : ANNOUNCE_DELAY,\n );\n });\n\n React.useEffect(\n () => () => {\n clearTimeout(timeoutRef.current);\n lastTextRef.current = undefined;\n },\n [],\n );\n\n return announcedError;\n};\n"],"mappings":"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"}
@@ -1,5 +1,6 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cssProps = require("../../styles/cssProps.cjs");
3
+ const require_cx = require("../../styles/cx.cjs");
3
4
  const require_themeContext = require("../../styles/themeContext.cjs");
4
5
  const require_Flex_vanilla_css = require("./Flex.vanilla.css.cjs");
5
6
  let react = require("react");
@@ -25,7 +26,7 @@ var FlexVanillaComponent = react.default.forwardRef(({ as, className, css, style
25
26
  });
26
27
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
27
28
  ref,
28
- className: `${recipeClass} ${className || ""}`.trim(),
29
+ className: require_cx.cx(recipeClass, className),
29
30
  style: mergedStyles,
30
31
  ...props
31
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.vanilla.cjs","names":["React","useVanillaExtractTheme","processCSSProp","assignInlineVars","flexRecipe"],"sources":["../../../components/Flex/Flex.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { flexRecipe } from './Flex.vanilla.css';\n\ninterface FlexOwnProps extends CSSProps {\n direction?: FlexDirection;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n gap?: Gap;\n}\n\nexport type FlexProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FlexOwnProps>;\ntype FlexComponent = PolymorphicComponent<'div', FlexProps<ElementType>>;\n\nexport const FlexVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, direction, align, justify, wrap, gap, ...props }: FlexProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\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 = flexRecipe({ direction, align, justify, wrap, gap });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nFlexVanillaComponent.displayName = 'FlexVanilla';\n\nexport const FlexVanilla = FlexVanillaComponent as FlexComponent;\n"],"mappings":";;;;;;;;;AA6BA,IAAa,uBAAuBA,MAAAA,QAAM,YAEtC,EAAE,IAAI,WAAW,KAAK,OAAO,WAAW,OAAO,SAAS,MAAM,KAAK,GAAG,SACtE,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,yBAAAA,WAAW;EAAE;EAAW;EAAO;EAAS;EAAM;CAAI,CAAC;CAEvE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
1
+ {"version":3,"file":"Flex.vanilla.cjs","names":["React","useVanillaExtractTheme","processCSSProp","assignInlineVars","flexRecipe","cx"],"sources":["../../../components/Flex/Flex.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } 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 type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { flexRecipe } from './Flex.vanilla.css';\n\ninterface FlexOwnProps extends CSSProps {\n direction?: FlexDirection;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n gap?: Gap;\n}\n\nexport type FlexProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FlexOwnProps>;\ntype FlexComponent = PolymorphicComponent<'div', FlexProps<ElementType>>;\n\nexport const FlexVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, direction, align, justify, wrap, gap, ...props }: FlexProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\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 = flexRecipe({ direction, align, justify, wrap, gap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nFlexVanillaComponent.displayName = 'FlexVanilla';\n\nexport const FlexVanilla = FlexVanillaComponent as FlexComponent;\n"],"mappings":";;;;;;;;;;AA8BA,IAAa,uBAAuBA,MAAAA,QAAM,YAEtC,EAAE,IAAI,WAAW,KAAK,OAAO,WAAW,OAAO,SAAS,MAAM,KAAK,GAAG,SACtE,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,yBAAAA,WAAW;EAAE;EAAW;EAAO;EAAS;EAAM;CAAI,CAAC;CAEvE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { flexRecipe } from "./Flex.vanilla.css.js";
4
5
  import React from "react";
@@ -23,7 +24,7 @@ var FlexVanillaComponent = React.forwardRef(({ as, className, css, style, direct
23
24
  });
24
25
  return /* @__PURE__ */ jsx(Component, {
25
26
  ref,
26
- className: `${recipeClass} ${className || ""}`.trim(),
27
+ className: cx(recipeClass, className),
27
28
  style: mergedStyles,
28
29
  ...props
29
30
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.vanilla.js","names":[],"sources":["../../../components/Flex/Flex.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { flexRecipe } from './Flex.vanilla.css';\n\ninterface FlexOwnProps extends CSSProps {\n direction?: FlexDirection;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n gap?: Gap;\n}\n\nexport type FlexProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FlexOwnProps>;\ntype FlexComponent = PolymorphicComponent<'div', FlexProps<ElementType>>;\n\nexport const FlexVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, direction, align, justify, wrap, gap, ...props }: FlexProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\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 = flexRecipe({ direction, align, justify, wrap, gap });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nFlexVanillaComponent.displayName = 'FlexVanilla';\n\nexport const FlexVanilla = FlexVanillaComponent as FlexComponent;\n"],"mappings":";;;;;;;AA6BA,IAAa,uBAAuB,MAAM,YAEtC,EAAE,IAAI,WAAW,KAAK,OAAO,WAAW,OAAO,SAAS,MAAM,KAAK,GAAG,SACtE,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,WAAW;EAAE;EAAW;EAAO;EAAS;EAAM;CAAI,CAAC;CAEvE,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
1
+ {"version":3,"file":"Flex.vanilla.js","names":[],"sources":["../../../components/Flex/Flex.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } 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 type {\n FlexAlignSimplified,\n FlexDirection,\n FlexJustifySimplified,\n Gap,\n} from '../../styles/types';\nimport { flexRecipe } from './Flex.vanilla.css';\n\ninterface FlexOwnProps extends CSSProps {\n direction?: FlexDirection;\n align?: FlexAlignSimplified;\n justify?: FlexJustifySimplified;\n wrap?: 'wrap' | 'noWrap' | 'wrapReverse';\n gap?: Gap;\n}\n\nexport type FlexProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FlexOwnProps>;\ntype FlexComponent = PolymorphicComponent<'div', FlexProps<ElementType>>;\n\nexport const FlexVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n { as, className, css, style, direction, align, justify, wrap, gap, ...props }: FlexProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\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 = flexRecipe({ direction, align, justify, wrap, gap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nFlexVanillaComponent.displayName = 'FlexVanilla';\n\nexport const FlexVanilla = FlexVanillaComponent as FlexComponent;\n"],"mappings":";;;;;;;;AA8BA,IAAa,uBAAuB,MAAM,YAEtC,EAAE,IAAI,WAAW,KAAK,OAAO,WAAW,OAAO,SAAS,MAAM,KAAK,GAAG,SACtE,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,WAAW;EAAE;EAAW;EAAO;EAAS;EAAM;CAAI,CAAC;CAEvE,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
@@ -1,5 +1,6 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cssProps = require("../../styles/cssProps.cjs");
3
+ const require_cx = require("../../styles/cx.cjs");
3
4
  const require_themeContext = require("../../styles/themeContext.cjs");
4
5
  const require_Grid_vanilla_css = require("./Grid.vanilla.css.cjs");
5
6
  let react = require("react");
@@ -29,7 +30,7 @@ var GridVanillaComponent = react.default.forwardRef(({ as, className, css, style
29
30
  });
30
31
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
31
32
  ref,
32
- className: `${recipeClass} ${className || ""}`.trim(),
33
+ className: require_cx.cx(recipeClass, className),
33
34
  style: mergedStyles,
34
35
  ...props
35
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.vanilla.cjs","names":["React","useVanillaExtractTheme","processCSSProp","assignInlineVars","gridRecipe"],"sources":["../../../components/Grid/Grid.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type { Gap, GridAlign, GridFlow, GridJustify } from '../../styles/types';\nimport { gridRecipe } from './Grid.vanilla.css';\n\ninterface GridOwnProps extends CSSProps {\n align?: GridAlign;\n justify?: GridJustify;\n flow?: GridFlow;\n columns?: number;\n gap?: Gap;\n gapX?: Gap;\n gapY?: Gap;\n}\n\nexport type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps>;\ntype GridComponent = PolymorphicComponent<'div', GridProps<ElementType>>;\n\nexport const GridVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n align,\n justify,\n flow,\n columns,\n gap,\n gapX,\n gapY,\n ...props\n }: GridProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const dynamicStyles: React.CSSProperties = {};\n\n // To support any value on the columns props\n if (columns !== undefined) {\n dynamicStyles.gridTemplateColumns = `repeat(${columns}, 1fr)`;\n }\n\n const mergedStyles = {\n ...cssStyles,\n ...dynamicStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = gridRecipe({ align, justify, flow, gap, gapX, gapY });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nGridVanillaComponent.displayName = 'GridVanilla';\n\nexport const GridVanilla = GridVanillaComponent as GridComponent;\n"],"mappings":";;;;;;;;;AA0BA,IAAa,uBAAuBA,MAAAA,QAAM,YAEtC,EACE,IACA,WACA,KACA,OACA,OACA,SACA,MACA,SACA,KACA,MACA,MACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,gBAAqC,CAAC;CAG5C,IAAI,YAAY,KAAA,GACd,cAAc,sBAAsB,UAAU,QAAQ;CAGxD,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,cAAcC,yBAAAA,WAAW;EAAE;EAAO;EAAS;EAAM;EAAK;EAAM;CAAK,CAAC;CAExE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
1
+ {"version":3,"file":"Grid.vanilla.cjs","names":["React","useVanillaExtractTheme","processCSSProp","assignInlineVars","gridRecipe","cx"],"sources":["../../../components/Grid/Grid.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } 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 type { Gap, GridAlign, GridFlow, GridJustify } from '../../styles/types';\nimport { gridRecipe } from './Grid.vanilla.css';\n\ninterface GridOwnProps extends CSSProps {\n align?: GridAlign;\n justify?: GridJustify;\n flow?: GridFlow;\n columns?: number;\n gap?: Gap;\n gapX?: Gap;\n gapY?: Gap;\n}\n\nexport type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps>;\ntype GridComponent = PolymorphicComponent<'div', GridProps<ElementType>>;\n\nexport const GridVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n align,\n justify,\n flow,\n columns,\n gap,\n gapX,\n gapY,\n ...props\n }: GridProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const dynamicStyles: React.CSSProperties = {};\n\n // To support any value on the columns props\n if (columns !== undefined) {\n dynamicStyles.gridTemplateColumns = `repeat(${columns}, 1fr)`;\n }\n\n const mergedStyles = {\n ...cssStyles,\n ...dynamicStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = gridRecipe({ align, justify, flow, gap, gapX, gapY });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nGridVanillaComponent.displayName = 'GridVanilla';\n\nexport const GridVanilla = GridVanillaComponent as GridComponent;\n"],"mappings":";;;;;;;;;;AA2BA,IAAa,uBAAuBA,MAAAA,QAAM,YAEtC,EACE,IACA,WACA,KACA,OACA,OACA,SACA,MACA,SACA,KACA,MACA,MACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAWC,qBAAAA,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAE7D,MAAM,gBAAqC,CAAC;CAG5C,IAAI,YAAY,KAAA,GACd,cAAc,sBAAsB,UAAU,QAAQ;CAGxD,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,MAAM,cAAcC,yBAAAA,WAAW;EAAE;EAAO;EAAS;EAAM;EAAK;EAAM;CAAK,CAAC;CAExE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { gridRecipe } from "./Grid.vanilla.css.js";
4
5
  import React from "react";
@@ -27,7 +28,7 @@ var GridVanillaComponent = React.forwardRef(({ as, className, css, style, align,
27
28
  });
28
29
  return /* @__PURE__ */ jsx(Component, {
29
30
  ref,
30
- className: `${recipeClass} ${className || ""}`.trim(),
31
+ className: cx(recipeClass, className),
31
32
  style: mergedStyles,
32
33
  ...props
33
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.vanilla.js","names":[],"sources":["../../../components/Grid/Grid.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport type { Gap, GridAlign, GridFlow, GridJustify } from '../../styles/types';\nimport { gridRecipe } from './Grid.vanilla.css';\n\ninterface GridOwnProps extends CSSProps {\n align?: GridAlign;\n justify?: GridJustify;\n flow?: GridFlow;\n columns?: number;\n gap?: Gap;\n gapX?: Gap;\n gapY?: Gap;\n}\n\nexport type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps>;\ntype GridComponent = PolymorphicComponent<'div', GridProps<ElementType>>;\n\nexport const GridVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n align,\n justify,\n flow,\n columns,\n gap,\n gapX,\n gapY,\n ...props\n }: GridProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const dynamicStyles: React.CSSProperties = {};\n\n // To support any value on the columns props\n if (columns !== undefined) {\n dynamicStyles.gridTemplateColumns = `repeat(${columns}, 1fr)`;\n }\n\n const mergedStyles = {\n ...cssStyles,\n ...dynamicStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = gridRecipe({ align, justify, flow, gap, gapX, gapY });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nGridVanillaComponent.displayName = 'GridVanilla';\n\nexport const GridVanilla = GridVanillaComponent as GridComponent;\n"],"mappings":";;;;;;;AA0BA,IAAa,uBAAuB,MAAM,YAEtC,EACE,IACA,WACA,KACA,OACA,OACA,SACA,MACA,SACA,KACA,MACA,MACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,gBAAqC,CAAC;CAG5C,IAAI,YAAY,KAAA,GACd,cAAc,sBAAsB,UAAU,QAAQ;CAGxD,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,WAAW;EAAE;EAAO;EAAS;EAAM;EAAK;EAAM;CAAK,CAAC;CAExE,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
1
+ {"version":3,"file":"Grid.vanilla.js","names":[],"sources":["../../../components/Grid/Grid.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ElementType } 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 type { Gap, GridAlign, GridFlow, GridJustify } from '../../styles/types';\nimport { gridRecipe } from './Grid.vanilla.css';\n\ninterface GridOwnProps extends CSSProps {\n align?: GridAlign;\n justify?: GridJustify;\n flow?: GridFlow;\n columns?: number;\n gap?: Gap;\n gapX?: Gap;\n gapY?: Gap;\n}\n\nexport type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps>;\ntype GridComponent = PolymorphicComponent<'div', GridProps<ElementType>>;\n\nexport const GridVanillaComponent = React.forwardRef(\n <C extends ElementType = 'div'>(\n {\n as,\n className,\n css,\n style,\n align,\n justify,\n flow,\n columns,\n gap,\n gapX,\n gapY,\n ...props\n }: GridProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'div';\n\n const { colors } = useVanillaExtractTheme();\n\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const dynamicStyles: React.CSSProperties = {};\n\n // To support any value on the columns props\n if (columns !== undefined) {\n dynamicStyles.gridTemplateColumns = `repeat(${columns}, 1fr)`;\n }\n\n const mergedStyles = {\n ...cssStyles,\n ...dynamicStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n const recipeClass = gridRecipe({ align, justify, flow, gap, gapX, gapY });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nGridVanillaComponent.displayName = 'GridVanilla';\n\nexport const GridVanilla = GridVanillaComponent as GridComponent;\n"],"mappings":";;;;;;;;AA2BA,IAAa,uBAAuB,MAAM,YAEtC,EACE,IACA,WACA,KACA,OACA,OACA,SACA,MACA,SACA,KACA,MACA,MACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,WAAW,uBAAuB;CAE1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAE7D,MAAM,gBAAqC,CAAC;CAG5C,IAAI,YAAY,KAAA,GACd,cAAc,sBAAsB,UAAU,QAAQ;CAGxD,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,MAAM,cAAc,WAAW;EAAE;EAAO;EAAS;EAAM;EAAK;EAAM;CAAK,CAAC;CAExE,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,qBAAqB,cAAc;AAEnC,IAAa,cAAc"}
@@ -1,4 +1,5 @@
1
1
  const require_cssProps = require("../../styles/cssProps.cjs");
2
+ const require_cx = require("../../styles/cx.cjs");
2
3
  const require_themeContext = require("../../styles/themeContext.cjs");
3
4
  const require_IconButton_vanilla_css = require("./IconButton.vanilla.css.cjs");
4
5
  let react = require("react");
@@ -20,7 +21,7 @@ var IconButtonVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css
20
21
  });
21
22
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
22
23
  ref,
23
- className: `${recipeClass} ${className || ""}`.trim(),
24
+ className: require_cx.cx(recipeClass, className),
24
25
  style: mergedStyles,
25
26
  ...props
26
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","iconButtonRecipe"],"sources":["../../../components/IconButton/IconButton.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 {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { iconButtonRecipe } from './IconButton.vanilla.css';\n\ntype IconButtonRecipeVariants = RecipeVariants<typeof iconButtonRecipe>;\n\ninterface IconButtonOwnProps extends Omit<IconButtonRecipeVariants, never>, CSSProps {}\n\nexport type IconButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n IconButtonOwnProps\n>;\n\ntype IconButtonVanillaComponent = PolymorphicComponent<\n 'button',\n IconButtonVanillaProps<ElementType>\n>;\n\nconst IconButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, size, variant, ...props }: IconButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\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 = iconButtonRecipe({ size, variant });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nIconButtonVanillaComponentImpl.displayName = 'IconButtonVanilla';\n\nexport const IconButtonVanilla = IconButtonVanillaComponentImpl as IconButtonVanillaComponent;\n"],"mappings":";;;;;;;AA2BA,IAAM,kCAAA,GAAiCA,MAAAA,WAAAA,EAEnC,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,GAAG,SAC/C,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,+BAAAA,iBAAiB;EAAE;EAAM;CAAQ,CAAC;CAEtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,+BAA+B,cAAc;AAE7C,IAAa,oBAAoB"}
1
+ {"version":3,"file":"IconButton.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","iconButtonRecipe","cx"],"sources":["../../../components/IconButton/IconButton.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 { iconButtonRecipe } from './IconButton.vanilla.css';\n\ntype IconButtonRecipeVariants = RecipeVariants<typeof iconButtonRecipe>;\n\ninterface IconButtonOwnProps extends Omit<IconButtonRecipeVariants, never>, CSSProps {}\n\nexport type IconButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n IconButtonOwnProps\n>;\n\ntype IconButtonVanillaComponent = PolymorphicComponent<\n 'button',\n IconButtonVanillaProps<ElementType>\n>;\n\nconst IconButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, size, variant, ...props }: IconButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\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 = iconButtonRecipe({ size, variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nIconButtonVanillaComponentImpl.displayName = 'IconButtonVanilla';\n\nexport const IconButtonVanilla = IconButtonVanillaComponentImpl as IconButtonVanillaComponent;\n"],"mappings":";;;;;;;;AA4BA,IAAM,kCAAA,GAAiCA,MAAAA,WAAAA,EAEnC,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,GAAG,SAC/C,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,+BAAAA,iBAAiB;EAAE;EAAM;CAAQ,CAAC;CAEtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,+BAA+B,cAAc;AAE7C,IAAa,oBAAoB"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { iconButtonRecipe } from "./IconButton.vanilla.css.js";
4
5
  import { forwardRef } from "react";
@@ -20,7 +21,7 @@ var IconButtonVanillaComponentImpl = forwardRef(({ as, className, css, style, si
20
21
  });
21
22
  return /* @__PURE__ */ jsx(Component, {
22
23
  ref,
23
- className: `${recipeClass} ${className || ""}`.trim(),
24
+ className: cx(recipeClass, className),
24
25
  style: mergedStyles,
25
26
  ...props
26
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.vanilla.js","names":[],"sources":["../../../components/IconButton/IconButton.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 {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { iconButtonRecipe } from './IconButton.vanilla.css';\n\ntype IconButtonRecipeVariants = RecipeVariants<typeof iconButtonRecipe>;\n\ninterface IconButtonOwnProps extends Omit<IconButtonRecipeVariants, never>, CSSProps {}\n\nexport type IconButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n IconButtonOwnProps\n>;\n\ntype IconButtonVanillaComponent = PolymorphicComponent<\n 'button',\n IconButtonVanillaProps<ElementType>\n>;\n\nconst IconButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, size, variant, ...props }: IconButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\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 = iconButtonRecipe({ size, variant });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nIconButtonVanillaComponentImpl.displayName = 'IconButtonVanilla';\n\nexport const IconButtonVanilla = IconButtonVanillaComponentImpl as IconButtonVanillaComponent;\n"],"mappings":";;;;;;;AA2BA,IAAM,iCAAiC,YAEnC,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,GAAG,SAC/C,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,iBAAiB;EAAE;EAAM;CAAQ,CAAC;CAEtD,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,+BAA+B,cAAc;AAE7C,IAAa,oBAAoB"}
1
+ {"version":3,"file":"IconButton.vanilla.js","names":[],"sources":["../../../components/IconButton/IconButton.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 { iconButtonRecipe } from './IconButton.vanilla.css';\n\ntype IconButtonRecipeVariants = RecipeVariants<typeof iconButtonRecipe>;\n\ninterface IconButtonOwnProps extends Omit<IconButtonRecipeVariants, never>, CSSProps {}\n\nexport type IconButtonVanillaProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n IconButtonOwnProps\n>;\n\ntype IconButtonVanillaComponent = PolymorphicComponent<\n 'button',\n IconButtonVanillaProps<ElementType>\n>;\n\nconst IconButtonVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'button'>(\n { as, className, css, style, size, variant, ...props }: IconButtonVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'button';\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 = iconButtonRecipe({ size, variant });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nIconButtonVanillaComponentImpl.displayName = 'IconButtonVanilla';\n\nexport const IconButtonVanilla = IconButtonVanillaComponentImpl as IconButtonVanillaComponent;\n"],"mappings":";;;;;;;;AA4BA,IAAM,iCAAiC,YAEnC,EAAE,IAAI,WAAW,KAAK,OAAO,MAAM,SAAS,GAAG,SAC/C,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,iBAAiB;EAAE;EAAM;CAAQ,CAAC;CAEtD,OACE,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,+BAA+B,cAAc;AAE7C,IAAa,oBAAoB"}
@@ -1,4 +1,5 @@
1
1
  const require_cssProps = require("../../styles/cssProps.cjs");
2
+ const require_cx = require("../../styles/cx.cjs");
2
3
  const require_themeContext = require("../../styles/themeContext.cjs");
3
4
  const require_Image_vanilla_css = require("./Image.vanilla.css.cjs");
4
5
  let react = require("react");
@@ -16,7 +17,7 @@ var ImageVanillaImpl = (0, react.forwardRef)(({ as, className, css, style, ...pr
16
17
  };
17
18
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
18
19
  ref,
19
- className: `${require_Image_vanilla_css.image} ${className || ""}`.trim(),
20
+ className: require_cx.cx(require_Image_vanilla_css.image, className),
20
21
  style: mergedStyles,
21
22
  ...props
22
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Image.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","image"],"sources":["../../../components/Image/Image.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { image } from './Image.vanilla.css';\n\nexport type ImageVanillaProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype ImageVanillaComponent = PolymorphicComponent<'img', ImageVanillaProps<ElementType>>;\n\nconst ImageVanillaImpl = forwardRef(\n <C extends ElementType = 'img'>(\n { as, className, css, style, ...props }: ImageVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'img';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n return (\n <Component\n ref={ref}\n className={`${image} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nImageVanillaImpl.displayName = 'ImageVanilla';\n\nexport const ImageVanilla = ImageVanillaImpl as ImageVanillaComponent;\n"],"mappings":";;;;;;;AAmBA,IAAM,oBAAA,GAAmBA,MAAAA,WAAAA,EAErB,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;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAGC,0BAAAA,MAAM,GAAG,aAAa,KAAK,KAAK;EAC9C,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,iBAAiB,cAAc;AAE/B,IAAa,eAAe"}
1
+ {"version":3,"file":"Image.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","cx","image"],"sources":["../../../components/Image/Image.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 { image } from './Image.vanilla.css';\n\nexport type ImageVanillaProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype ImageVanillaComponent = PolymorphicComponent<'img', ImageVanillaProps<ElementType>>;\n\nconst ImageVanillaImpl = forwardRef(\n <C extends ElementType = 'img'>(\n { as, className, css, style, ...props }: ImageVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'img';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n return <Component ref={ref} className={cx(image, className)} style={mergedStyles} {...props} />;\n },\n);\n\nImageVanillaImpl.displayName = 'ImageVanilla';\n\nexport const ImageVanilla = ImageVanillaImpl as ImageVanillaComponent;\n"],"mappings":";;;;;;;;AAoBA,IAAM,oBAAA,GAAmBA,MAAAA,WAAAA,EAErB,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;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAC1B;CAEA,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAGC,0BAAAA,OAAO,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAChG,CACF;AAEA,iBAAiB,cAAc;AAE/B,IAAa,eAAe"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { image } from "./Image.vanilla.css.js";
4
5
  import { forwardRef } from "react";
@@ -16,7 +17,7 @@ var ImageVanillaImpl = forwardRef(({ as, className, css, style, ...props }, ref)
16
17
  };
17
18
  return /* @__PURE__ */ jsx(Component, {
18
19
  ref,
19
- className: `${image} ${className || ""}`.trim(),
20
+ className: cx(image, className),
20
21
  style: mergedStyles,
21
22
  ...props
22
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Image.vanilla.js","names":[],"sources":["../../../components/Image/Image.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { ElementType, forwardRef } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { image } from './Image.vanilla.css';\n\nexport type ImageVanillaProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype ImageVanillaComponent = PolymorphicComponent<'img', ImageVanillaProps<ElementType>>;\n\nconst ImageVanillaImpl = forwardRef(\n <C extends ElementType = 'img'>(\n { as, className, css, style, ...props }: ImageVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'img';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n return (\n <Component\n ref={ref}\n className={`${image} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nImageVanillaImpl.displayName = 'ImageVanilla';\n\nexport const ImageVanilla = ImageVanillaImpl as ImageVanillaComponent;\n"],"mappings":";;;;;;;AAmBA,IAAM,mBAAmB,YAErB,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;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GAAG,MAAM,GAAG,aAAa,KAAK,KAAK;EAC9C,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,iBAAiB,cAAc;AAE/B,IAAa,eAAe"}
1
+ {"version":3,"file":"Image.vanilla.js","names":[],"sources":["../../../components/Image/Image.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 { image } from './Image.vanilla.css';\n\nexport type ImageVanillaProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n CSSProps\n>;\n\ntype ImageVanillaComponent = PolymorphicComponent<'img', ImageVanillaProps<ElementType>>;\n\nconst ImageVanillaImpl = forwardRef(\n <C extends ElementType = 'img'>(\n { as, className, css, style, ...props }: ImageVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'img';\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n\n const mergedStyles = {\n ...cssStyles,\n ...style,\n ...assignInlineVars(vars),\n };\n\n return <Component ref={ref} className={cx(image, className)} style={mergedStyles} {...props} />;\n },\n);\n\nImageVanillaImpl.displayName = 'ImageVanilla';\n\nexport const ImageVanilla = ImageVanillaImpl as ImageVanillaComponent;\n"],"mappings":";;;;;;;;AAoBA,IAAM,mBAAmB,YAErB,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;CAE7D,MAAM,eAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG,iBAAiB,IAAI;CAC1B;CAEA,OAAO,oBAAC,WAAD;EAAgB;EAAK,WAAW,GAAG,OAAO,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAChG,CACF;AAEA,iBAAiB,cAAc;AAE/B,IAAa,eAAe"}
@@ -1,5 +1,6 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_cssProps = require("../../styles/cssProps.cjs");
3
+ const require_cx = require("../../styles/cx.cjs");
3
4
  const require_themeContext = require("../../styles/themeContext.cjs");
4
5
  const require_FieldContext = require("../Field/FieldContext.cjs");
5
6
  const require_Input_vanilla_css = require("./Input.vanilla.css.cjs");
@@ -56,7 +57,7 @@ var InputVanilla = react.default.forwardRef(({ size, startAdornment, endAdornmen
56
57
  variant: "end"
57
58
  });
58
59
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
59
- className: `${inputWrapperClass} ${className || ""}`.trim(),
60
+ className: require_cx.cx(inputWrapperClass, className),
60
61
  style: mergedStyles,
61
62
  children: [
62
63
  hasStartAdornment && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.vanilla.cjs","names":["React","useFieldControl","useVanillaExtractTheme","processCSSProp","assignInlineVars","inputWrapperRecipe","styledInputRecipe","adornmentWrapperRecipe"],"sources":["../../../components/Input/Input.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useFieldControl } from '../Field/FieldContext';\nimport { adornmentWrapperRecipe, inputWrapperRecipe, styledInputRecipe } from './Input.vanilla.css';\n\ntype StyledInputRecipeVariants = NonNullable<RecipeVariants<typeof styledInputRecipe>>;\n\nexport interface InputVanillaOwnProps extends CSSProps {\n size?: StyledInputRecipeVariants['size'];\n variant?: StyledInputRecipeVariants['variant'];\n state?: StyledInputRecipeVariants['state'];\n cursor?: StyledInputRecipeVariants['cursor'];\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n type?: string;\n}\n\nexport type InputVanillaProps = Omit<React.InputHTMLAttributes<any>, 'size'> & InputVanillaOwnProps;\n\nexport interface InputVanillaHandle extends HTMLInputElement {\n clear: () => void;\n}\n\nexport const InputVanilla = React.forwardRef<InputVanillaHandle, InputVanillaProps>(\n (\n {\n size,\n startAdornment,\n endAdornment,\n css,\n variant,\n state,\n cursor,\n className,\n style,\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle>(null);\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const resolvedState = control.invalid ? 'invalid' : state;\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n React.useImperativeHandle(forwardedRef, () => {\n const { current } = inputRef;\n if (current) {\n current.clear = () => {\n current.value = '';\n };\n }\n return current as InputVanillaHandle;\n }, [inputRef]);\n\n const hasStartAdornment = React.useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = React.useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n const inputWrapperClass = inputWrapperRecipe({\n disabled: control.disabled,\n state: resolvedState,\n size,\n });\n\n const styledInputClass = styledInputRecipe({\n size,\n variant,\n state: resolvedState,\n cursor,\n startAdornment: hasStartAdornment,\n endAdornment: hasEndAdornment,\n });\n\n const adornmentWrapperStartClass = adornmentWrapperRecipe({\n size,\n variant: 'start',\n });\n\n const adornmentWrapperEndClass = adornmentWrapperRecipe({\n size,\n variant: 'end',\n });\n\n return (\n <div className={`${inputWrapperClass} ${className || ''}`.trim()} style={mergedStyles}>\n {hasStartAdornment && <div className={adornmentWrapperStartClass}>{startAdornment}</div>}\n\n <input\n ref={inputRef}\n className={styledInputClass}\n id={control.id}\n disabled={control.disabled}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n {...props}\n />\n\n {hasEndAdornment && <div className={adornmentWrapperEndClass}>{endAdornment}</div>}\n </div>\n );\n },\n);\n\nInputVanilla.displayName = 'InputVanilla';\n"],"mappings":";;;;;;;;;;AA2BA,IAAa,eAAeA,MAAAA,QAAM,YAE9B,EACE,MACA,gBACA,cACA,KACA,SACA,OACA,QACA,WACA,OACA,IACA,UACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,WAAWA,MAAAA,QAAM,OAA2B,IAAI;CACtD,MAAM,UAAUC,qBAAAA,gBAAgB;EAC9B;EACA;EACA,SAAS,UAAU;EACnB,oBAAoB;EACpB,gBAAgB;CAClB,CAAC;CACD,MAAM,gBAAgB,QAAQ,UAAU,YAAY;CACpD,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,MAAA,QAAM,oBAAoB,oBAAoB;EAC5C,MAAM,EAAE,YAAY;EACpB,IAAI,SACF,QAAQ,cAAc;GACpB,QAAQ,QAAQ;EAClB;EAEF,OAAO;CACT,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,oBAAoBJ,MAAAA,QAAM,cAAc,QAAQ,cAAc,GAAG,CAAC,cAAc,CAAC;CACvF,MAAM,kBAAkBA,MAAAA,QAAM,cAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAEjF,MAAM,oBAAoBK,0BAAAA,mBAAmB;EAC3C,UAAU,QAAQ;EAClB,OAAO;EACP;CACF,CAAC;CAED,MAAM,mBAAmBC,0BAAAA,kBAAkB;EACzC;EACA;EACA,OAAO;EACP;EACA,gBAAgB;EAChB,cAAc;CAChB,CAAC;CAED,MAAM,6BAA6BC,0BAAAA,uBAAuB;EACxD;EACA,SAAS;CACX,CAAC;CAED,MAAM,2BAA2BA,0BAAAA,uBAAuB;EACtD;EACA,SAAS;CACX,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAW,GAAG,kBAAkB,GAAG,aAAa,KAAK,KAAK;EAAG,OAAO;EAAzE,UAAA;GACG,qBAAqB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAW;IAA6B,UAAA;GAAoB,CAAA;GAEvF,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;IACE,KAAK;IACL,WAAW;IACX,IAAI,QAAQ;IACZ,UAAU,QAAQ;IAClB,oBAAkB,QAAQ;IAC1B,gBAAc,QAAQ;IACtB,GAAI;GACL,CAAA;GAEA,mBAAmB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAW;IAA2B,UAAA;GAAkB,CAAA;EAC9E;;AAET,CACF;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"Input.vanilla.cjs","names":["React","useFieldControl","useVanillaExtractTheme","processCSSProp","assignInlineVars","inputWrapperRecipe","styledInputRecipe","adornmentWrapperRecipe","cx"],"sources":["../../../components/Input/Input.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useFieldControl } from '../Field/FieldContext';\nimport { adornmentWrapperRecipe, inputWrapperRecipe, styledInputRecipe } from './Input.vanilla.css';\n\ntype StyledInputRecipeVariants = NonNullable<RecipeVariants<typeof styledInputRecipe>>;\n\nexport interface InputVanillaOwnProps extends CSSProps {\n size?: StyledInputRecipeVariants['size'];\n variant?: StyledInputRecipeVariants['variant'];\n state?: StyledInputRecipeVariants['state'];\n cursor?: StyledInputRecipeVariants['cursor'];\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n type?: string;\n}\n\nexport type InputVanillaProps = Omit<React.InputHTMLAttributes<any>, 'size'> & InputVanillaOwnProps;\n\nexport interface InputVanillaHandle extends HTMLInputElement {\n clear: () => void;\n}\n\nexport const InputVanilla = React.forwardRef<InputVanillaHandle, InputVanillaProps>(\n (\n {\n size,\n startAdornment,\n endAdornment,\n css,\n variant,\n state,\n cursor,\n className,\n style,\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle>(null);\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const resolvedState = control.invalid ? 'invalid' : state;\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n React.useImperativeHandle(forwardedRef, () => {\n const { current } = inputRef;\n if (current) {\n current.clear = () => {\n current.value = '';\n };\n }\n return current as InputVanillaHandle;\n }, [inputRef]);\n\n const hasStartAdornment = React.useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = React.useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n const inputWrapperClass = inputWrapperRecipe({\n disabled: control.disabled,\n state: resolvedState,\n size,\n });\n\n const styledInputClass = styledInputRecipe({\n size,\n variant,\n state: resolvedState,\n cursor,\n startAdornment: hasStartAdornment,\n endAdornment: hasEndAdornment,\n });\n\n const adornmentWrapperStartClass = adornmentWrapperRecipe({\n size,\n variant: 'start',\n });\n\n const adornmentWrapperEndClass = adornmentWrapperRecipe({\n size,\n variant: 'end',\n });\n\n return (\n <div className={cx(inputWrapperClass, className)} style={mergedStyles}>\n {hasStartAdornment && <div className={adornmentWrapperStartClass}>{startAdornment}</div>}\n\n <input\n ref={inputRef}\n className={styledInputClass}\n id={control.id}\n disabled={control.disabled}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n {...props}\n />\n\n {hasEndAdornment && <div className={adornmentWrapperEndClass}>{endAdornment}</div>}\n </div>\n );\n },\n);\n\nInputVanilla.displayName = 'InputVanilla';\n"],"mappings":";;;;;;;;;;;AA4BA,IAAa,eAAeA,MAAAA,QAAM,YAE9B,EACE,MACA,gBACA,cACA,KACA,SACA,OACA,QACA,WACA,OACA,IACA,UACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,WAAWA,MAAAA,QAAM,OAA2B,IAAI;CACtD,MAAM,UAAUC,qBAAAA,gBAAgB;EAC9B;EACA;EACA,SAAS,UAAU;EACnB,oBAAoB;EACpB,gBAAgB;CAClB,CAAC;CACD,MAAM,gBAAgB,QAAQ,UAAU,YAAY;CACpD,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,MAAA,QAAM,oBAAoB,oBAAoB;EAC5C,MAAM,EAAE,YAAY;EACpB,IAAI,SACF,QAAQ,cAAc;GACpB,QAAQ,QAAQ;EAClB;EAEF,OAAO;CACT,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,oBAAoBJ,MAAAA,QAAM,cAAc,QAAQ,cAAc,GAAG,CAAC,cAAc,CAAC;CACvF,MAAM,kBAAkBA,MAAAA,QAAM,cAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAEjF,MAAM,oBAAoBK,0BAAAA,mBAAmB;EAC3C,UAAU,QAAQ;EAClB,OAAO;EACP;CACF,CAAC;CAED,MAAM,mBAAmBC,0BAAAA,kBAAkB;EACzC;EACA;EACA,OAAO;EACP;EACA,gBAAgB;EAChB,cAAc;CAChB,CAAC;CAED,MAAM,6BAA6BC,0BAAAA,uBAAuB;EACxD;EACA,SAAS;CACX,CAAC;CAED,MAAM,2BAA2BA,0BAAAA,uBAAuB;EACtD;EACA,SAAS;CACX,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAWC,WAAAA,GAAG,mBAAmB,SAAS;EAAG,OAAO;EAAzD,UAAA;GACG,qBAAqB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAW;IAA6B,UAAA;GAAoB,CAAA;GAEvF,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;IACE,KAAK;IACL,WAAW;IACX,IAAI,QAAQ;IACZ,UAAU,QAAQ;IAClB,oBAAkB,QAAQ;IAC1B,gBAAc,QAAQ;IACtB,GAAI;GACL,CAAA;GAEA,mBAAmB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAW;IAA2B,UAAA;GAAkB,CAAA;EAC9E;;AAET,CACF;AAEA,aAAa,cAAc"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { useFieldControl } from "../Field/FieldContext.js";
4
5
  import { adornmentWrapperRecipe, inputWrapperRecipe, styledInputRecipe } from "./Input.vanilla.css.js";
@@ -54,7 +55,7 @@ var InputVanilla = React.forwardRef(({ size, startAdornment, endAdornment, css,
54
55
  variant: "end"
55
56
  });
56
57
  return /* @__PURE__ */ jsxs("div", {
57
- className: `${inputWrapperClass} ${className || ""}`.trim(),
58
+ className: cx(inputWrapperClass, className),
58
59
  style: mergedStyles,
59
60
  children: [
60
61
  hasStartAdornment && /* @__PURE__ */ jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.vanilla.js","names":[],"sources":["../../../components/Input/Input.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useFieldControl } from '../Field/FieldContext';\nimport { adornmentWrapperRecipe, inputWrapperRecipe, styledInputRecipe } from './Input.vanilla.css';\n\ntype StyledInputRecipeVariants = NonNullable<RecipeVariants<typeof styledInputRecipe>>;\n\nexport interface InputVanillaOwnProps extends CSSProps {\n size?: StyledInputRecipeVariants['size'];\n variant?: StyledInputRecipeVariants['variant'];\n state?: StyledInputRecipeVariants['state'];\n cursor?: StyledInputRecipeVariants['cursor'];\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n type?: string;\n}\n\nexport type InputVanillaProps = Omit<React.InputHTMLAttributes<any>, 'size'> & InputVanillaOwnProps;\n\nexport interface InputVanillaHandle extends HTMLInputElement {\n clear: () => void;\n}\n\nexport const InputVanilla = React.forwardRef<InputVanillaHandle, InputVanillaProps>(\n (\n {\n size,\n startAdornment,\n endAdornment,\n css,\n variant,\n state,\n cursor,\n className,\n style,\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle>(null);\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const resolvedState = control.invalid ? 'invalid' : state;\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n React.useImperativeHandle(forwardedRef, () => {\n const { current } = inputRef;\n if (current) {\n current.clear = () => {\n current.value = '';\n };\n }\n return current as InputVanillaHandle;\n }, [inputRef]);\n\n const hasStartAdornment = React.useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = React.useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n const inputWrapperClass = inputWrapperRecipe({\n disabled: control.disabled,\n state: resolvedState,\n size,\n });\n\n const styledInputClass = styledInputRecipe({\n size,\n variant,\n state: resolvedState,\n cursor,\n startAdornment: hasStartAdornment,\n endAdornment: hasEndAdornment,\n });\n\n const adornmentWrapperStartClass = adornmentWrapperRecipe({\n size,\n variant: 'start',\n });\n\n const adornmentWrapperEndClass = adornmentWrapperRecipe({\n size,\n variant: 'end',\n });\n\n return (\n <div className={`${inputWrapperClass} ${className || ''}`.trim()} style={mergedStyles}>\n {hasStartAdornment && <div className={adornmentWrapperStartClass}>{startAdornment}</div>}\n\n <input\n ref={inputRef}\n className={styledInputClass}\n id={control.id}\n disabled={control.disabled}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n {...props}\n />\n\n {hasEndAdornment && <div className={adornmentWrapperEndClass}>{endAdornment}</div>}\n </div>\n );\n },\n);\n\nInputVanilla.displayName = 'InputVanilla';\n"],"mappings":";;;;;;;;AA2BA,IAAa,eAAe,MAAM,YAE9B,EACE,MACA,gBACA,cACA,KACA,SACA,OACA,QACA,WACA,OACA,IACA,UACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,WAAW,MAAM,OAA2B,IAAI;CACtD,MAAM,UAAU,gBAAgB;EAC9B;EACA;EACA,SAAS,UAAU;EACnB,oBAAoB;EACpB,gBAAgB;CAClB,CAAC;CACD,MAAM,gBAAgB,QAAQ,UAAU,YAAY;CACpD,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,MAAM,oBAAoB,oBAAoB;EAC5C,MAAM,EAAE,YAAY;EACpB,IAAI,SACF,QAAQ,cAAc;GACpB,QAAQ,QAAQ;EAClB;EAEF,OAAO;CACT,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,oBAAoB,MAAM,cAAc,QAAQ,cAAc,GAAG,CAAC,cAAc,CAAC;CACvF,MAAM,kBAAkB,MAAM,cAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAEjF,MAAM,oBAAoB,mBAAmB;EAC3C,UAAU,QAAQ;EAClB,OAAO;EACP;CACF,CAAC;CAED,MAAM,mBAAmB,kBAAkB;EACzC;EACA;EACA,OAAO;EACP;EACA,gBAAgB;EAChB,cAAc;CAChB,CAAC;CAED,MAAM,6BAA6B,uBAAuB;EACxD;EACA,SAAS;CACX,CAAC;CAED,MAAM,2BAA2B,uBAAuB;EACtD;EACA,SAAS;CACX,CAAC;CAED,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,kBAAkB,GAAG,aAAa,KAAK,KAAK;EAAG,OAAO;EAAzE,UAAA;GACG,qBAAqB,oBAAC,OAAD;IAAK,WAAW;IAA6B,UAAA;GAAoB,CAAA;GAEvF,oBAAC,SAAD;IACE,KAAK;IACL,WAAW;IACX,IAAI,QAAQ;IACZ,UAAU,QAAQ;IAClB,oBAAkB,QAAQ;IAC1B,gBAAc,QAAQ;IACtB,GAAI;GACL,CAAA;GAEA,mBAAmB,oBAAC,OAAD;IAAK,WAAW;IAA2B,UAAA;GAAkB,CAAA;EAC9E;;AAET,CACF;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"Input.vanilla.js","names":[],"sources":["../../../components/Input/Input.vanilla.tsx"],"sourcesContent":["import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { RecipeVariants } from '@vanilla-extract/recipes';\nimport React from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { cx } from '../../styles/cx';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { useFieldControl } from '../Field/FieldContext';\nimport { adornmentWrapperRecipe, inputWrapperRecipe, styledInputRecipe } from './Input.vanilla.css';\n\ntype StyledInputRecipeVariants = NonNullable<RecipeVariants<typeof styledInputRecipe>>;\n\nexport interface InputVanillaOwnProps extends CSSProps {\n size?: StyledInputRecipeVariants['size'];\n variant?: StyledInputRecipeVariants['variant'];\n state?: StyledInputRecipeVariants['state'];\n cursor?: StyledInputRecipeVariants['cursor'];\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n type?: string;\n}\n\nexport type InputVanillaProps = Omit<React.InputHTMLAttributes<any>, 'size'> & InputVanillaOwnProps;\n\nexport interface InputVanillaHandle extends HTMLInputElement {\n clear: () => void;\n}\n\nexport const InputVanilla = React.forwardRef<InputVanillaHandle, InputVanillaProps>(\n (\n {\n size,\n startAdornment,\n endAdornment,\n css,\n variant,\n state,\n cursor,\n className,\n style,\n id,\n disabled,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n forwardedRef,\n ) => {\n const inputRef = React.useRef<InputVanillaHandle>(null);\n const control = useFieldControl({\n id,\n disabled,\n invalid: state === 'invalid',\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n });\n const resolvedState = control.invalid ? 'invalid' : state;\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n const mergedStyles = { ...cssStyles, ...style, ...assignInlineVars(vars) };\n\n React.useImperativeHandle(forwardedRef, () => {\n const { current } = inputRef;\n if (current) {\n current.clear = () => {\n current.value = '';\n };\n }\n return current as InputVanillaHandle;\n }, [inputRef]);\n\n const hasStartAdornment = React.useMemo(() => Boolean(startAdornment), [startAdornment]);\n const hasEndAdornment = React.useMemo(() => Boolean(endAdornment), [endAdornment]);\n\n const inputWrapperClass = inputWrapperRecipe({\n disabled: control.disabled,\n state: resolvedState,\n size,\n });\n\n const styledInputClass = styledInputRecipe({\n size,\n variant,\n state: resolvedState,\n cursor,\n startAdornment: hasStartAdornment,\n endAdornment: hasEndAdornment,\n });\n\n const adornmentWrapperStartClass = adornmentWrapperRecipe({\n size,\n variant: 'start',\n });\n\n const adornmentWrapperEndClass = adornmentWrapperRecipe({\n size,\n variant: 'end',\n });\n\n return (\n <div className={cx(inputWrapperClass, className)} style={mergedStyles}>\n {hasStartAdornment && <div className={adornmentWrapperStartClass}>{startAdornment}</div>}\n\n <input\n ref={inputRef}\n className={styledInputClass}\n id={control.id}\n disabled={control.disabled}\n aria-describedby={control['aria-describedby']}\n aria-invalid={control['aria-invalid']}\n {...props}\n />\n\n {hasEndAdornment && <div className={adornmentWrapperEndClass}>{endAdornment}</div>}\n </div>\n );\n },\n);\n\nInputVanilla.displayName = 'InputVanilla';\n"],"mappings":";;;;;;;;;AA4BA,IAAa,eAAe,MAAM,YAE9B,EACE,MACA,gBACA,cACA,KACA,SACA,OACA,QACA,WACA,OACA,IACA,UACA,oBAAoB,iBACpB,gBAAgB,aAChB,GAAG,SAEL,iBACG;CACH,MAAM,WAAW,MAAM,OAA2B,IAAI;CACtD,MAAM,UAAU,gBAAgB;EAC9B;EACA;EACA,SAAS,UAAU;EACnB,oBAAoB;EACpB,gBAAgB;CAClB,CAAC;CACD,MAAM,gBAAgB,QAAQ,UAAU,YAAY;CACpD,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,MAAM,oBAAoB,oBAAoB;EAC5C,MAAM,EAAE,YAAY;EACpB,IAAI,SACF,QAAQ,cAAc;GACpB,QAAQ,QAAQ;EAClB;EAEF,OAAO;CACT,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,oBAAoB,MAAM,cAAc,QAAQ,cAAc,GAAG,CAAC,cAAc,CAAC;CACvF,MAAM,kBAAkB,MAAM,cAAc,QAAQ,YAAY,GAAG,CAAC,YAAY,CAAC;CAEjF,MAAM,oBAAoB,mBAAmB;EAC3C,UAAU,QAAQ;EAClB,OAAO;EACP;CACF,CAAC;CAED,MAAM,mBAAmB,kBAAkB;EACzC;EACA;EACA,OAAO;EACP;EACA,gBAAgB;EAChB,cAAc;CAChB,CAAC;CAED,MAAM,6BAA6B,uBAAuB;EACxD;EACA,SAAS;CACX,CAAC;CAED,MAAM,2BAA2B,uBAAuB;EACtD;EACA,SAAS;CACX,CAAC;CAED,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,mBAAmB,SAAS;EAAG,OAAO;EAAzD,UAAA;GACG,qBAAqB,oBAAC,OAAD;IAAK,WAAW;IAA6B,UAAA;GAAoB,CAAA;GAEvF,oBAAC,SAAD;IACE,KAAK;IACL,WAAW;IACX,IAAI,QAAQ;IACZ,UAAU,QAAQ;IAClB,oBAAkB,QAAQ;IAC1B,gBAAc,QAAQ;IACtB,GAAI;GACL,CAAA;GAEA,mBAAmB,oBAAC,OAAD;IAAK,WAAW;IAA2B,UAAA;GAAkB,CAAA;EAC9E;;AAET,CACF;AAEA,aAAa,cAAc"}
@@ -1,4 +1,5 @@
1
1
  const require_cssProps = require("../../styles/cssProps.cjs");
2
+ const require_cx = require("../../styles/cx.cjs");
2
3
  const require_themeContext = require("../../styles/themeContext.cjs");
3
4
  const require_Label_vanilla_css = require("./Label.vanilla.css.cjs");
4
5
  let react = require("react");
@@ -24,7 +25,7 @@ var LabelVanillaComponentImpl = (0, react.forwardRef)(({ as, className, css, sty
24
25
  });
25
26
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
26
27
  ref,
27
- className: `${recipeClass} ${className || ""}`.trim(),
28
+ className: require_cx.cx(recipeClass, className),
28
29
  style: mergedStyles,
29
30
  ...props
30
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Label.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","labelRecipe"],"sources":["../../../components/Label/Label.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 {\n PolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n} from '../../styles/polymorphic';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport { labelRecipe } from './Label.vanilla.css';\n\ntype LabelRecipeVariants = NonNullable<RecipeVariants<typeof labelRecipe>>;\n\ninterface LabelOwnProps extends LabelRecipeVariants, CSSProps {}\n\nexport type LabelVanillaProps<C extends ElementType = 'label'> = PolymorphicComponentProps<\n C,\n LabelOwnProps\n>;\n\ntype LabelVanillaComponent = PolymorphicComponent<'label', LabelVanillaProps<ElementType>>;\n\nconst LabelVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'label'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: LabelVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'label';\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 = labelRecipe({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component\n ref={ref}\n className={`${recipeClass} ${className || ''}`.trim()}\n style={mergedStyles}\n {...props}\n />\n );\n },\n);\n\nLabelVanillaComponentImpl.displayName = 'LabelVanilla';\n\nexport const LabelVanilla = LabelVanillaComponentImpl as LabelVanillaComponent;\n"],"mappings":";;;;;;;AAwBA,IAAM,6BAAA,GAA4BA,MAAAA,WAAAA,EAE9B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CACxB,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,0BAAAA,YAAY;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAEtF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACO;EACL,WAAW,GAAG,YAAY,GAAG,aAAa,KAAK,KAAK;EACpD,OAAO;EACP,GAAI;CACL,CAAA;AAEL,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,eAAe"}
1
+ {"version":3,"file":"Label.vanilla.cjs","names":["forwardRef","useVanillaExtractTheme","processCSSProp","assignInlineVars","labelRecipe","cx"],"sources":["../../../components/Label/Label.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 { labelRecipe } from './Label.vanilla.css';\n\ntype LabelRecipeVariants = NonNullable<RecipeVariants<typeof labelRecipe>>;\n\ninterface LabelOwnProps extends LabelRecipeVariants, CSSProps {}\n\nexport type LabelVanillaProps<C extends ElementType = 'label'> = PolymorphicComponentProps<\n C,\n LabelOwnProps\n>;\n\ntype LabelVanillaComponent = PolymorphicComponent<'label', LabelVanillaProps<ElementType>>;\n\nconst LabelVanillaComponentImpl = forwardRef(\n <C extends ElementType = 'label'>(\n {\n as,\n className,\n css,\n style,\n size,\n weight,\n variant,\n gradient,\n transform,\n noWrap,\n ...props\n }: LabelVanillaProps<C>,\n ref?: PolymorphicRef<C>,\n ) => {\n const Component = as || 'label';\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 = labelRecipe({ size, weight, variant, gradient, transform, noWrap });\n\n return (\n <Component ref={ref} className={cx(recipeClass, className)} style={mergedStyles} {...props} />\n );\n },\n);\n\nLabelVanillaComponentImpl.displayName = 'LabelVanilla';\n\nexport const LabelVanilla = LabelVanillaComponentImpl as LabelVanillaComponent;\n"],"mappings":";;;;;;;;AAyBA,IAAM,6BAAA,GAA4BA,MAAAA,WAAAA,EAE9B,EACE,IACA,WACA,KACA,OACA,MACA,QACA,SACA,UACA,WACA,QACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,MAAM;CACxB,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,0BAAAA,YAAY;EAAE;EAAM;EAAQ;EAAS;EAAU;EAAW;CAAO,CAAC;CAEtF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAgB;EAAK,WAAWC,WAAAA,GAAG,aAAa,SAAS;EAAG,OAAO;EAAc,GAAI;CAAQ,CAAA;AAEjG,CACF;AAEA,0BAA0B,cAAc;AAExC,IAAa,eAAe"}
@@ -1,4 +1,5 @@
1
1
  import { processCSSProp } from "../../styles/cssProps.js";
2
+ import { cx } from "../../styles/cx.js";
2
3
  import { useVanillaExtractTheme } from "../../styles/themeContext.js";
3
4
  import { labelRecipe } from "./Label.vanilla.css.js";
4
5
  import { forwardRef } from "react";
@@ -24,7 +25,7 @@ var LabelVanillaComponentImpl = forwardRef(({ as, className, css, style, size, w
24
25
  });
25
26
  return /* @__PURE__ */ jsx(Component, {
26
27
  ref,
27
- className: `${recipeClass} ${className || ""}`.trim(),
28
+ className: cx(recipeClass, className),
28
29
  style: mergedStyles,
29
30
  ...props
30
31
  });