@you-agent-factory/components 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +38 -7
  3. package/dist/category-paths.d.ts +3 -0
  4. package/dist/charts/chart-state-panel.d.ts +11 -0
  5. package/dist/charts/chart.d.ts +35 -0
  6. package/dist/charts/index.d.ts +5 -0
  7. package/dist/charts/index.js +287 -0
  8. package/dist/chunks/action-row.js +39 -0
  9. package/dist/chunks/alert-panel.js +182 -0
  10. package/dist/chunks/button.js +193 -0
  11. package/dist/chunks/cn.js +6 -0
  12. package/dist/chunks/factory-emulator-controls.js +123 -0
  13. package/dist/chunks/package-form-field.js +546 -0
  14. package/dist/chunks/scroll-area.js +261 -0
  15. package/dist/chunks/surface-panel.js +73 -0
  16. package/dist/chunks/table-layout.js +292 -0
  17. package/dist/chunks/typography-roles.js +26 -0
  18. package/dist/chunks/typography.js +129 -0
  19. package/dist/chunks/widget-frame.js +344 -0
  20. package/dist/data-display/code-panel.d.ts +12 -0
  21. package/dist/data-display/data-table.d.ts +27 -0
  22. package/dist/data-display/description-list.d.ts +4 -0
  23. package/{src/data-display/index.ts → dist/data-display/index.d.ts} +4 -26
  24. package/dist/data-display/index.js +20 -0
  25. package/dist/data-display/table-layout.d.ts +8 -0
  26. package/dist/data-display/table.d.ts +14 -0
  27. package/dist/factory-emulator/factory-emulator-controls.d.ts +23 -0
  28. package/dist/factory-emulator/index.d.ts +6 -0
  29. package/dist/factory-emulator/index.js +6 -0
  30. package/dist/feedback/alert-panel-semantics.d.ts +11 -0
  31. package/dist/feedback/alert-panel.d.ts +29 -0
  32. package/dist/feedback/index.d.ts +6 -0
  33. package/dist/feedback/index.js +10 -0
  34. package/dist/feedback/skeleton.d.ts +2 -0
  35. package/dist/forms/index.d.ts +19 -0
  36. package/dist/forms/index.js +37 -0
  37. package/dist/forms/package-checkbox.d.ts +3 -0
  38. package/dist/forms/package-enum-select.d.ts +42 -0
  39. package/dist/forms/package-file-input.d.ts +3 -0
  40. package/dist/forms/package-form-field.d.ts +49 -0
  41. package/dist/forms/package-input.d.ts +6 -0
  42. package/dist/forms/package-native-select.d.ts +3 -0
  43. package/dist/forms/package-select.d.ts +32 -0
  44. package/dist/forms/package-textarea.d.ts +10 -0
  45. package/dist/forms/select-icons.d.ts +3 -0
  46. package/dist/graphs/graph-edge-path.d.ts +18 -0
  47. package/dist/graphs/graph-edge.d.ts +15 -0
  48. package/dist/graphs/graph-node-button.d.ts +11 -0
  49. package/dist/graphs/graph-node-handle-badge.d.ts +5 -0
  50. package/dist/graphs/graph-node-handle.d.ts +18 -0
  51. package/dist/graphs/graph-node-shell.d.ts +13 -0
  52. package/dist/graphs/graph-node-state-indicator.d.ts +6 -0
  53. package/dist/graphs/graph-node-state.d.ts +23 -0
  54. package/dist/graphs/graph-viewport-surface.d.ts +5 -0
  55. package/dist/graphs/index.d.ts +13 -0
  56. package/dist/graphs/index.js +614 -0
  57. package/{src/icons/index.ts → dist/icons/index.d.ts} +1 -2
  58. package/dist/icons/index.js +4 -0
  59. package/dist/index.d.ts +26 -0
  60. package/dist/index.js +145 -0
  61. package/dist/layout/action-row.d.ts +8 -0
  62. package/{src/layout/index.ts → dist/layout/index.d.ts} +1 -3
  63. package/dist/layout/index.js +9 -0
  64. package/dist/layout/surface-panel.d.ts +15 -0
  65. package/{src/navigation/index.ts → dist/navigation/index.d.ts} +1 -2
  66. package/dist/navigation/index.js +4 -0
  67. package/dist/overlays/collapsible.d.ts +5 -0
  68. package/dist/overlays/dialog.d.ts +16 -0
  69. package/dist/overlays/index.d.ts +10 -0
  70. package/dist/overlays/index.js +27 -0
  71. package/dist/overlays/overlay-layout.d.ts +6 -0
  72. package/dist/overlays/popover.d.ts +6 -0
  73. package/dist/overlays/scroll-area.d.ts +9 -0
  74. package/dist/primitives/button-link.d.ts +5 -0
  75. package/dist/primitives/button.d.ts +9 -0
  76. package/dist/primitives/icon-button-shell.d.ts +10 -0
  77. package/{src/primitives/index.ts → dist/primitives/index.d.ts} +2 -19
  78. package/dist/primitives/index.js +49 -0
  79. package/dist/primitives/package-text.d.ts +6 -0
  80. package/dist/primitives/typography-roles.d.ts +12 -0
  81. package/dist/primitives/typography.d.ts +36 -0
  82. package/dist/recipes/index.d.ts +14 -0
  83. package/dist/recipes/index.js +32 -0
  84. package/dist/recipes/widget-frame-content.d.ts +24 -0
  85. package/dist/recipes/widget-frame-disclosure.d.ts +33 -0
  86. package/dist/recipes/widget-frame-layout.d.ts +12 -0
  87. package/dist/recipes/widget-frame-skeleton.d.ts +2 -0
  88. package/dist/recipes/widget-frame-states.d.ts +15 -0
  89. package/dist/recipes/widget-frame-typography.d.ts +10 -0
  90. package/dist/recipes/widget-frame.d.ts +12 -0
  91. package/{src → dist}/styles.css +36 -0
  92. package/dist/testing/index.d.ts +4 -0
  93. package/dist/testing/index.js +16 -0
  94. package/dist/testing/render.d.ts +5 -0
  95. package/{src/tokens/index.ts → dist/tokens/index.d.ts} +1 -2
  96. package/dist/tokens/index.js +4 -0
  97. package/dist/utilities/cn.d.ts +1 -0
  98. package/{src/utilities/index.ts → dist/utilities/index.d.ts} +1 -3
  99. package/dist/utilities/index.js +6 -0
  100. package/package.json +65 -64
  101. package/docs/README.md +0 -83
  102. package/docs/button.md +0 -119
  103. package/docs/charts.md +0 -325
  104. package/docs/data-display-code-panel.md +0 -120
  105. package/docs/feedback-alert-panel.md +0 -117
  106. package/docs/feedback-skeleton.md +0 -54
  107. package/docs/forms-form-field.md +0 -490
  108. package/docs/forms-input-primitives.md +0 -311
  109. package/docs/forms-select-primitives.md +0 -362
  110. package/docs/graphs.md +0 -250
  111. package/docs/layout-display-primitives.md +0 -211
  112. package/docs/overlays.md +0 -414
  113. package/docs/table-data-table.md +0 -331
  114. package/docs/typography-roles.md +0 -182
  115. package/docs/widget-frame-recipes.md +0 -273
  116. package/src/category-paths.ts +0 -20
  117. package/src/charts/chart-state-panel.tsx +0 -103
  118. package/src/charts/chart.tsx +0 -287
  119. package/src/charts/index.ts +0 -21
  120. package/src/data-display/code-panel.tsx +0 -67
  121. package/src/data-display/data-table.tsx +0 -180
  122. package/src/data-display/description-list.tsx +0 -24
  123. package/src/data-display/table-layout.ts +0 -12
  124. package/src/data-display/table.tsx +0 -131
  125. package/src/feedback/alert-panel-semantics.ts +0 -75
  126. package/src/feedback/alert-panel.tsx +0 -187
  127. package/src/feedback/index.ts +0 -21
  128. package/src/feedback/skeleton.tsx +0 -16
  129. package/src/forms/index.ts +0 -73
  130. package/src/forms/package-checkbox.tsx +0 -50
  131. package/src/forms/package-enum-select.tsx +0 -185
  132. package/src/forms/package-file-input.tsx +0 -25
  133. package/src/forms/package-form-field.tsx +0 -202
  134. package/src/forms/package-input.tsx +0 -25
  135. package/src/forms/package-native-select.tsx +0 -25
  136. package/src/forms/package-select.tsx +0 -209
  137. package/src/forms/package-textarea.tsx +0 -35
  138. package/src/forms/select-icons.tsx +0 -35
  139. package/src/graphs/graph-edge-path.ts +0 -241
  140. package/src/graphs/graph-edge.tsx +0 -130
  141. package/src/graphs/graph-interactive-example.tsx +0 -187
  142. package/src/graphs/graph-node-button.tsx +0 -51
  143. package/src/graphs/graph-node-handle-badge.tsx +0 -108
  144. package/src/graphs/graph-node-handle.ts +0 -28
  145. package/src/graphs/graph-node-shell.tsx +0 -111
  146. package/src/graphs/graph-node-state-indicator.tsx +0 -47
  147. package/src/graphs/graph-node-state.ts +0 -111
  148. package/src/graphs/graph-viewport-surface.tsx +0 -27
  149. package/src/graphs/index.ts +0 -41
  150. package/src/index.ts +0 -209
  151. package/src/layout/action-row.tsx +0 -53
  152. package/src/layout/surface-panel.tsx +0 -91
  153. package/src/overlays/collapsible.tsx +0 -22
  154. package/src/overlays/dialog.tsx +0 -148
  155. package/src/overlays/index.ts +0 -31
  156. package/src/overlays/overlay-layout.ts +0 -9
  157. package/src/overlays/popover.tsx +0 -29
  158. package/src/overlays/scroll-area.tsx +0 -78
  159. package/src/primitives/button-link.tsx +0 -22
  160. package/src/primitives/button.tsx +0 -258
  161. package/src/primitives/icon-button-shell.tsx +0 -49
  162. package/src/primitives/package-text.tsx +0 -29
  163. package/src/primitives/typography-roles.ts +0 -12
  164. package/src/primitives/typography.tsx +0 -165
  165. package/src/recipes/index.ts +0 -61
  166. package/src/recipes/widget-frame-content.tsx +0 -114
  167. package/src/recipes/widget-frame-disclosure.tsx +0 -161
  168. package/src/recipes/widget-frame-layout.ts +0 -40
  169. package/src/recipes/widget-frame-skeleton.tsx +0 -16
  170. package/src/recipes/widget-frame-states.tsx +0 -99
  171. package/src/recipes/widget-frame-typography.ts +0 -19
  172. package/src/recipes/widget-frame.tsx +0 -84
  173. package/src/testing/index.ts +0 -13
  174. package/src/testing/render.tsx +0 -16
  175. package/src/utilities/cn.ts +0 -5
  176. /package/{src → dist}/styles/color-palette-presets.css +0 -0
  177. /package/{src → dist}/styles/color-role-tokens.css +0 -0
  178. /package/{src → dist}/styles/layout-role-tokens.css +0 -0
  179. /package/{src → dist}/styles/text-color-role-tokens.css +0 -0
  180. /package/{src → dist}/styles/typography-role-tokens.css +0 -0
  181. /package/{src → dist}/styles/typography-role-utilities.css +0 -0
  182. /package/{src → dist}/styles/typography-roles.css +0 -0
@@ -0,0 +1,546 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useState } from "react";
3
+ import { c as cn } from "./cn.js";
4
+ import * as SelectPrimitive from "@radix-ui/react-select";
5
+ const CHECKBOX_ROOT_CLASS = "relative inline-flex size-4 shrink-0 items-center justify-center [&:has(:disabled)]:cursor-not-allowed";
6
+ function CheckboxCheckIcon() {
7
+ return /* @__PURE__ */ jsx(
8
+ "svg",
9
+ {
10
+ "aria-hidden": "true",
11
+ className: "size-3 opacity-0",
12
+ fill: "none",
13
+ stroke: "currentColor",
14
+ strokeLinecap: "round",
15
+ strokeLinejoin: "round",
16
+ strokeWidth: 2.5,
17
+ viewBox: "0 0 24 24",
18
+ children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
19
+ }
20
+ );
21
+ }
22
+ const PackageCheckbox = forwardRef(function PackageCheckbox2({ className, ...props }, ref) {
23
+ return /* @__PURE__ */ jsxs("span", { className: cn(CHECKBOX_ROOT_CLASS, className), children: [
24
+ /* @__PURE__ */ jsx(
25
+ "input",
26
+ {
27
+ className: "peer sr-only",
28
+ ref,
29
+ type: "checkbox",
30
+ ...props
31
+ }
32
+ ),
33
+ /* @__PURE__ */ jsx(
34
+ "span",
35
+ {
36
+ "aria-hidden": "true",
37
+ className: "pointer-events-none flex size-4 items-center justify-center rounded border border-outline bg-surface-container-high text-on-primary transition-colors peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-af-focus-ring peer-disabled:border-outline peer-disabled:bg-surface-container-low peer-checked:border-primary peer-checked:bg-primary peer-aria-invalid:ring-2 peer-aria-invalid:ring-af-danger-border peer-checked:[&_svg]:opacity-100",
38
+ children: /* @__PURE__ */ jsx(CheckboxCheckIcon, {})
39
+ }
40
+ )
41
+ ] });
42
+ });
43
+ const INPUT_CLASS = "flex min-h-11 w-full rounded-xl border border-outline bg-surface-container-high px-3 py-2.5 text-sm text-on-surface outline-none transition-colors placeholder:text-on-surface-disabled focus-visible:border-outline-variant focus-visible:ring-2 focus-visible:ring-af-focus-ring aria-invalid:border-af-danger-border aria-invalid:ring-2 aria-invalid:ring-af-danger-border disabled:cursor-not-allowed disabled:border-outline disabled:bg-surface-container-low disabled:text-on-surface-disabled";
44
+ function inputVariants({ className } = {}) {
45
+ return cn(INPUT_CLASS, className);
46
+ }
47
+ const PackageInput = forwardRef(
48
+ function PackageInput2({ className, type = "text", ...props }, ref) {
49
+ return /* @__PURE__ */ jsx(
50
+ "input",
51
+ {
52
+ className: inputVariants({ className }),
53
+ ref,
54
+ type,
55
+ ...props
56
+ }
57
+ );
58
+ }
59
+ );
60
+ function SelectChevronDownIcon(props) {
61
+ return /* @__PURE__ */ jsx(
62
+ "svg",
63
+ {
64
+ "aria-hidden": "true",
65
+ fill: "none",
66
+ stroke: "currentColor",
67
+ strokeLinecap: "round",
68
+ strokeLinejoin: "round",
69
+ strokeWidth: 1.8,
70
+ viewBox: "0 0 24 24",
71
+ ...props,
72
+ children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
73
+ }
74
+ );
75
+ }
76
+ function SelectCheckIcon(props) {
77
+ return /* @__PURE__ */ jsx(
78
+ "svg",
79
+ {
80
+ "aria-hidden": "true",
81
+ fill: "none",
82
+ stroke: "currentColor",
83
+ strokeLinecap: "round",
84
+ strokeLinejoin: "round",
85
+ strokeWidth: 2,
86
+ viewBox: "0 0 24 24",
87
+ ...props,
88
+ children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
89
+ }
90
+ );
91
+ }
92
+ const Select = SelectPrimitive.Root;
93
+ const SelectGroup = SelectPrimitive.Group;
94
+ const SelectValue = SelectPrimitive.Value;
95
+ const SelectTrigger = forwardRef(function SelectTrigger2({ className, children, ...props }, ref) {
96
+ return /* @__PURE__ */ jsxs(
97
+ SelectPrimitive.Trigger,
98
+ {
99
+ className: cn(
100
+ inputVariants({
101
+ className: "flex items-center justify-between gap-2 text-left data-[placeholder]:text-on-surface-disabled [&>span]:line-clamp-1"
102
+ }),
103
+ className
104
+ ),
105
+ ref,
106
+ ...props,
107
+ children: [
108
+ children,
109
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(SelectChevronDownIcon, { className: "h-4 w-4 shrink-0 text-af-text-subtle" }) })
110
+ ]
111
+ }
112
+ );
113
+ });
114
+ const SELECT_CONTENT_POPPER_CLASS = "min-w-[var(--radix-select-trigger-width)]";
115
+ const SELECT_VIEWPORT_POPPER_CLASS = "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]";
116
+ function SelectContent({
117
+ children,
118
+ className,
119
+ onCloseAutoFocus,
120
+ position = "popper",
121
+ ...props
122
+ }) {
123
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(
124
+ SelectPrimitive.Content,
125
+ {
126
+ className: cn(
127
+ "relative z-50 max-h-72 overflow-hidden rounded-xl border border-outline bg-surface-container-high text-on-surface shadow-af-panel data-[state=closed]:animate-out data-[state=open]:animate-in",
128
+ position === "popper" && SELECT_CONTENT_POPPER_CLASS,
129
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
130
+ className
131
+ ),
132
+ onCloseAutoFocus,
133
+ position,
134
+ ...props,
135
+ children: /* @__PURE__ */ jsx(
136
+ SelectPrimitive.Viewport,
137
+ {
138
+ className: cn(
139
+ "p-1",
140
+ position === "popper" && SELECT_VIEWPORT_POPPER_CLASS
141
+ ),
142
+ children
143
+ }
144
+ )
145
+ }
146
+ ) });
147
+ }
148
+ function SelectLabel({ className, ...props }) {
149
+ return /* @__PURE__ */ jsx(
150
+ SelectPrimitive.Label,
151
+ {
152
+ className: cn(
153
+ "px-2 py-1.5 text-xs font-semibold uppercase tracking-[0.08em] text-on-surface-subtle",
154
+ className
155
+ ),
156
+ ...props
157
+ }
158
+ );
159
+ }
160
+ const SELECT_EMPTY_STATE_VALUE = "__select-empty-state__";
161
+ const SelectItem = forwardRef(function SelectItem2({ children, className, ...props }, ref) {
162
+ return /* @__PURE__ */ jsxs(
163
+ SelectPrimitive.Item,
164
+ {
165
+ className: cn(
166
+ "relative flex w-full min-w-0 cursor-default select-none items-center rounded-lg py-2 pl-8 pr-2 text-sm outline-none focus:bg-surface-container-highest data-[disabled]:pointer-events-none data-[disabled]:text-on-surface-disabled data-[highlighted]:bg-surface-container-highest",
167
+ className
168
+ ),
169
+ ref,
170
+ ...props,
171
+ children: [
172
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(SelectCheckIcon, { className: "h-4 w-4" }) }) }),
173
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { className: "line-clamp-2 break-words", children })
174
+ ]
175
+ }
176
+ );
177
+ });
178
+ function SelectEmpty({ children, className }) {
179
+ return /* @__PURE__ */ jsx(
180
+ SelectPrimitive.Item,
181
+ {
182
+ className: cn(
183
+ "relative flex w-full min-w-0 cursor-default select-none items-center rounded-lg px-2 py-2 text-sm text-on-surface-disabled data-[disabled]:pointer-events-none data-[disabled]:text-on-surface-disabled",
184
+ className
185
+ ),
186
+ disabled: true,
187
+ value: SELECT_EMPTY_STATE_VALUE,
188
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { className: "line-clamp-2 break-words", children })
189
+ }
190
+ );
191
+ }
192
+ function SelectSeparator({ className, ...props }) {
193
+ return /* @__PURE__ */ jsx(
194
+ SelectPrimitive.Separator,
195
+ {
196
+ className: cn("-mx-1 my-1 h-px bg-outline", className),
197
+ ...props
198
+ }
199
+ );
200
+ }
201
+ function SelectField({
202
+ children,
203
+ className,
204
+ description,
205
+ descriptionId,
206
+ error,
207
+ errorId,
208
+ inputId,
209
+ label
210
+ }) {
211
+ return /* @__PURE__ */ jsxs("div", { className: cn("grid gap-2", className), children: [
212
+ /* @__PURE__ */ jsx(
213
+ "label",
214
+ {
215
+ className: "text-xs font-bold uppercase tracking-[0.08em] text-af-text-subtle",
216
+ htmlFor: inputId,
217
+ children: label
218
+ }
219
+ ),
220
+ children,
221
+ description ? /* @__PURE__ */ jsx("p", { className: "m-0 text-sm text-af-text-muted", id: descriptionId, children: description }) : null,
222
+ error ? /* @__PURE__ */ jsx(
223
+ "p",
224
+ {
225
+ className: "m-0 text-sm font-medium text-on-error-container",
226
+ id: errorId,
227
+ role: "alert",
228
+ children: error
229
+ }
230
+ ) : null
231
+ ] });
232
+ }
233
+ const ENUM_SELECT_EMPTY_VALUE = "__enum-select-empty__";
234
+ function EnumSelect({
235
+ className,
236
+ disabled,
237
+ emptyOptionsLabel = "No options available",
238
+ id,
239
+ loading = false,
240
+ loadingLabel = "Loading options...",
241
+ onValueChange,
242
+ options,
243
+ placeholder,
244
+ value,
245
+ ...aria
246
+ }) {
247
+ const isEmpty = !loading && options.length === 0;
248
+ const resolvedPlaceholder = loading ? loadingLabel : placeholder;
249
+ return /* @__PURE__ */ jsxs(
250
+ Select,
251
+ {
252
+ disabled: disabled || loading,
253
+ onValueChange,
254
+ value: loading ? SELECT_EMPTY_STATE_VALUE : value,
255
+ children: [
256
+ /* @__PURE__ */ jsx(
257
+ SelectTrigger,
258
+ {
259
+ "aria-busy": loading || void 0,
260
+ className,
261
+ id,
262
+ ...aria,
263
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder: resolvedPlaceholder })
264
+ }
265
+ ),
266
+ /* @__PURE__ */ jsx(SelectContent, { children: loading ? /* @__PURE__ */ jsx(SelectEmpty, { children: loadingLabel }) : isEmpty ? /* @__PURE__ */ jsx(SelectEmpty, { children: emptyOptionsLabel }) : options.map((option) => /* @__PURE__ */ jsx(
267
+ SelectItem,
268
+ {
269
+ disabled: option.disabled,
270
+ value: option.value,
271
+ children: option.label
272
+ },
273
+ option.value
274
+ )) })
275
+ ]
276
+ }
277
+ );
278
+ }
279
+ function OptionalEnumSelect({
280
+ className,
281
+ disabled,
282
+ emptyOptionLabel,
283
+ id,
284
+ onValueChange,
285
+ options,
286
+ value,
287
+ ...aria
288
+ }) {
289
+ return /* @__PURE__ */ jsxs(
290
+ Select,
291
+ {
292
+ disabled,
293
+ onValueChange: (nextValue) => onValueChange(nextValue === ENUM_SELECT_EMPTY_VALUE ? null : nextValue),
294
+ value: value ?? ENUM_SELECT_EMPTY_VALUE,
295
+ children: [
296
+ /* @__PURE__ */ jsx(SelectTrigger, { className, id, ...aria, children: /* @__PURE__ */ jsx(SelectValue, { placeholder: emptyOptionLabel }) }),
297
+ /* @__PURE__ */ jsxs(SelectContent, { children: [
298
+ /* @__PURE__ */ jsx(SelectItem, { value: ENUM_SELECT_EMPTY_VALUE, children: emptyOptionLabel }),
299
+ options.map((option) => /* @__PURE__ */ jsx(
300
+ SelectItem,
301
+ {
302
+ disabled: option.disabled,
303
+ value: option.value,
304
+ children: option.label
305
+ },
306
+ option.value
307
+ ))
308
+ ] })
309
+ ]
310
+ }
311
+ );
312
+ }
313
+ function ResetEnumSelect({
314
+ className,
315
+ disabled,
316
+ id,
317
+ onValueChange,
318
+ options,
319
+ placeholder,
320
+ ...aria
321
+ }) {
322
+ const [instanceKey, setInstanceKey] = useState(0);
323
+ return /* @__PURE__ */ jsxs(
324
+ Select,
325
+ {
326
+ disabled,
327
+ onValueChange: (nextValue) => {
328
+ onValueChange(nextValue);
329
+ setInstanceKey((current) => current + 1);
330
+ },
331
+ value: void 0,
332
+ children: [
333
+ /* @__PURE__ */ jsx(SelectTrigger, { className, id, ...aria, children: /* @__PURE__ */ jsx(SelectValue, { placeholder }) }),
334
+ /* @__PURE__ */ jsx(SelectContent, { children: options.map((option) => /* @__PURE__ */ jsx(
335
+ SelectItem,
336
+ {
337
+ disabled: option.disabled,
338
+ value: option.value,
339
+ children: option.label
340
+ },
341
+ option.value
342
+ )) })
343
+ ]
344
+ },
345
+ instanceKey
346
+ );
347
+ }
348
+ const FILE_INPUT_CLASS = "block w-full rounded-xl px-3 py-3 text-sm text-on-surface-variant outline-none focus-visible:ring-2 focus-visible:ring-af-focus-ring file:mr-3 file:rounded-lg file:border-0 file:bg-surface-container-high file:px-3 file:py-2 file:text-sm file:font-semibold file:text-on-surface hover:bg-af-overlay aria-invalid:border-af-danger-border aria-invalid:ring-2 aria-invalid:ring-af-danger-border disabled:cursor-not-allowed disabled:bg-surface-container-low disabled:text-on-surface-disabled";
349
+ const PackageFileInput = forwardRef(function PackageFileInput2({ className, ...props }, ref) {
350
+ return /* @__PURE__ */ jsx(
351
+ "input",
352
+ {
353
+ className: cn(FILE_INPUT_CLASS, className),
354
+ ref,
355
+ type: "file",
356
+ ...props
357
+ }
358
+ );
359
+ });
360
+ const NativeSelect = forwardRef(
361
+ function NativeSelect2({ children, className, ...props }, ref) {
362
+ return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
363
+ /* @__PURE__ */ jsx(
364
+ "select",
365
+ {
366
+ className: inputVariants({
367
+ className: `appearance-none pr-10 ${className ?? ""}`
368
+ }),
369
+ ref,
370
+ ...props,
371
+ children
372
+ }
373
+ ),
374
+ /* @__PURE__ */ jsx(SelectChevronDownIcon, { className: "pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-af-text-subtle" })
375
+ ] });
376
+ }
377
+ );
378
+ const TEXTAREA_PLAIN_CLASS = "m-0 w-full resize-none border-0 bg-transparent p-0 text-sm leading-6 text-on-surface outline-none";
379
+ const TEXTAREA_FIELD_CLASS = "min-h-28 max-h-52 resize-none overflow-y-auto py-3";
380
+ function textareaVariants({ className } = {}) {
381
+ return inputVariants({ className: cn(TEXTAREA_FIELD_CLASS, className) });
382
+ }
383
+ const PackageTextarea = forwardRef(function PackageTextarea2({ className, variant = "field", ...props }, ref) {
384
+ return /* @__PURE__ */ jsx(
385
+ "textarea",
386
+ {
387
+ className: variant === "plain" ? cn(TEXTAREA_PLAIN_CLASS, className) : textareaVariants({ className }),
388
+ ref,
389
+ ...props
390
+ }
391
+ );
392
+ });
393
+ function buildFormFieldAriaDescribedBy(messageIds) {
394
+ const ids = [
395
+ messageIds.descriptionId,
396
+ messageIds.helperId,
397
+ messageIds.warningId,
398
+ messageIds.errorId,
399
+ messageIds.successId
400
+ ].filter((id) => Boolean(id));
401
+ return ids.length > 0 ? ids.join(" ") : void 0;
402
+ }
403
+ const FormField = forwardRef(
404
+ function FormField2({ className, ...props }, ref) {
405
+ return /* @__PURE__ */ jsx("div", { className: cn("space-y-2", className), ref, ...props });
406
+ }
407
+ );
408
+ const FORM_LABEL_CLASS = "block text-sm font-semibold text-on-surface";
409
+ const FormLabel = forwardRef(
410
+ function FormLabel2({ as: Component = "label", className, ...props }, ref) {
411
+ return /* @__PURE__ */ jsx(
412
+ Component,
413
+ {
414
+ className: cn(FORM_LABEL_CLASS, className),
415
+ ref,
416
+ ...props
417
+ }
418
+ );
419
+ }
420
+ );
421
+ const FORM_BODY_TEXT_CLASS = "m-0 text-body-medium text-on-surface";
422
+ const FORM_SUPPORTING_TEXT_CLASS = "m-0 text-body-small text-on-surface-variant";
423
+ const FormDescription = forwardRef(
424
+ function FormDescription2({ as: Component = "p", className, variant = "supporting", ...props }, ref) {
425
+ return /* @__PURE__ */ jsx(
426
+ Component,
427
+ {
428
+ className: cn(
429
+ variant === "body" ? FORM_BODY_TEXT_CLASS : FORM_SUPPORTING_TEXT_CLASS,
430
+ className
431
+ ),
432
+ ref,
433
+ ...props
434
+ }
435
+ );
436
+ }
437
+ );
438
+ const FormHelperText = forwardRef(
439
+ function FormHelperText2({ as: Component = "p", className, ...props }, ref) {
440
+ return /* @__PURE__ */ jsx(
441
+ Component,
442
+ {
443
+ className: cn(FORM_SUPPORTING_TEXT_CLASS, className),
444
+ ref,
445
+ ...props
446
+ }
447
+ );
448
+ }
449
+ );
450
+ const FormError = forwardRef(
451
+ function FormError2({ as: Component = "p", className, role = "alert", ...props }, ref) {
452
+ return /* @__PURE__ */ jsx(
453
+ Component,
454
+ {
455
+ className: cn(
456
+ "m-0 text-body-small font-medium text-on-error-container",
457
+ className
458
+ ),
459
+ ref,
460
+ role,
461
+ ...props
462
+ }
463
+ );
464
+ }
465
+ );
466
+ const FormWarning = forwardRef(
467
+ function FormWarning2({ as: Component = "p", className, role, ...props }, ref) {
468
+ return /* @__PURE__ */ jsx(
469
+ Component,
470
+ {
471
+ className: cn(
472
+ "m-0 text-body-small font-medium text-on-warning-container",
473
+ className
474
+ ),
475
+ ref,
476
+ role,
477
+ ...props
478
+ }
479
+ );
480
+ }
481
+ );
482
+ const FormSuccess = forwardRef(
483
+ function FormSuccess2({ as: Component = "p", className, role = "status", ...props }, ref) {
484
+ return /* @__PURE__ */ jsx(
485
+ Component,
486
+ {
487
+ className: cn(
488
+ "m-0 text-body-small font-medium text-on-success-container",
489
+ className
490
+ ),
491
+ ref,
492
+ role,
493
+ ...props
494
+ }
495
+ );
496
+ }
497
+ );
498
+ const FormFieldGroup = forwardRef(
499
+ function FormFieldGroup2({ className, ...props }, ref) {
500
+ return /* @__PURE__ */ jsx(
501
+ "fieldset",
502
+ {
503
+ className: cn("m-0 space-y-2 border-0 p-0", className),
504
+ ref,
505
+ ...props
506
+ }
507
+ );
508
+ }
509
+ );
510
+ const FormFieldGroupLabel = forwardRef(function FormFieldGroupLabel2({ className, ...props }, ref) {
511
+ return /* @__PURE__ */ jsx("legend", { className: cn(FORM_LABEL_CLASS, "px-0", className), ref, ...props });
512
+ });
513
+ export {
514
+ ENUM_SELECT_EMPTY_VALUE as E,
515
+ FormDescription as F,
516
+ NativeSelect as N,
517
+ OptionalEnumSelect as O,
518
+ PackageCheckbox as P,
519
+ ResetEnumSelect as R,
520
+ SELECT_EMPTY_STATE_VALUE as S,
521
+ EnumSelect as a,
522
+ FormError as b,
523
+ FormField as c,
524
+ FormFieldGroup as d,
525
+ FormFieldGroupLabel as e,
526
+ FormHelperText as f,
527
+ FormLabel as g,
528
+ FormSuccess as h,
529
+ FormWarning as i,
530
+ PackageFileInput as j,
531
+ PackageInput as k,
532
+ PackageTextarea as l,
533
+ Select as m,
534
+ SelectContent as n,
535
+ SelectEmpty as o,
536
+ SelectField as p,
537
+ SelectGroup as q,
538
+ SelectItem as r,
539
+ SelectLabel as s,
540
+ SelectSeparator as t,
541
+ SelectTrigger as u,
542
+ SelectValue as v,
543
+ buildFormFieldAriaDescribedBy as w,
544
+ inputVariants as x,
545
+ textareaVariants as y
546
+ };