@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,261 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
3
+ import { c as cn } from "./cn.js";
4
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
5
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
6
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
7
+ import { forwardRef } from "react";
8
+ const Collapsible = CollapsiblePrimitive.Root;
9
+ const CollapsibleTrigger = CollapsiblePrimitive.Trigger;
10
+ function CollapsibleContent({
11
+ className,
12
+ ...props
13
+ }) {
14
+ return /* @__PURE__ */ jsx(
15
+ CollapsiblePrimitive.Content,
16
+ {
17
+ className: cn(
18
+ "overflow-hidden data-[state=closed]:animate-[overlay-collapsible-up_160ms_ease-out] data-[state=open]:animate-[overlay-collapsible-down_200ms_ease-out]",
19
+ className
20
+ ),
21
+ ...props
22
+ }
23
+ );
24
+ }
25
+ const OVERLAY_FORM_GROUP_CLASS = "grid gap-layout-tight";
26
+ const OVERLAY_DIALOG_BODY_CLASS = "grid gap-layout-group";
27
+ const OVERLAY_DIALOG_CONTENT_SHELL_CLASS = "grid gap-layout-group p-layout-inset-dialog";
28
+ const DIALOG_CLOSE_BUTTON_CLASS = "absolute right-4 top-4 inline-flex min-h-9 w-9 items-center justify-center rounded-full border border-outline bg-transparent p-0 text-on-surface transition-colors hover:bg-surface-container-low disabled:pointer-events-none disabled:opacity-50";
29
+ function DialogCloseIcon() {
30
+ return /* @__PURE__ */ jsx(
31
+ "svg",
32
+ {
33
+ "aria-hidden": "true",
34
+ fill: "none",
35
+ height: "18",
36
+ viewBox: "0 0 24 24",
37
+ width: "18",
38
+ children: /* @__PURE__ */ jsx(
39
+ "path",
40
+ {
41
+ d: "M6 6l12 12M18 6L6 18",
42
+ stroke: "currentColor",
43
+ strokeLinecap: "round",
44
+ strokeLinejoin: "round",
45
+ strokeWidth: "1.8"
46
+ }
47
+ )
48
+ }
49
+ );
50
+ }
51
+ const Dialog = DialogPrimitive.Root;
52
+ const DialogTrigger = DialogPrimitive.Trigger;
53
+ const DialogPortal = DialogPrimitive.Portal;
54
+ const DialogClose = DialogPrimitive.Close;
55
+ function DialogOverlay({
56
+ className,
57
+ ...props
58
+ }) {
59
+ return /* @__PURE__ */ jsx(
60
+ DialogPrimitive.Overlay,
61
+ {
62
+ className: cn(
63
+ "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in",
64
+ className
65
+ ),
66
+ ...props
67
+ }
68
+ );
69
+ }
70
+ function DialogContent({
71
+ children,
72
+ className,
73
+ closeDisabled = false,
74
+ closeLabel = "Close",
75
+ ...props
76
+ }) {
77
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [
78
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
79
+ /* @__PURE__ */ jsxs(
80
+ DialogPrimitive.Content,
81
+ {
82
+ className: cn(
83
+ "fixed inset-x-4 top-1/2 z-50 mx-auto max-h-dvh max-w-2xl -translate-y-1/2 overflow-y-auto rounded-2xl border border-outline bg-surface-container-high text-on-surface shadow-xl",
84
+ OVERLAY_DIALOG_CONTENT_SHELL_CLASS,
85
+ className
86
+ ),
87
+ ...props,
88
+ children: [
89
+ children,
90
+ closeDisabled ? /* @__PURE__ */ jsx(
91
+ "button",
92
+ {
93
+ "aria-label": closeLabel,
94
+ className: DIALOG_CLOSE_BUTTON_CLASS,
95
+ disabled: true,
96
+ type: "button",
97
+ children: /* @__PURE__ */ jsx(DialogCloseIcon, {})
98
+ }
99
+ ) : /* @__PURE__ */ jsx(
100
+ DialogPrimitive.Close,
101
+ {
102
+ "aria-label": closeLabel,
103
+ className: DIALOG_CLOSE_BUTTON_CLASS,
104
+ children: /* @__PURE__ */ jsx(DialogCloseIcon, {})
105
+ }
106
+ )
107
+ ]
108
+ }
109
+ )
110
+ ] });
111
+ }
112
+ function DialogHeader({
113
+ className,
114
+ ...props
115
+ }) {
116
+ return /* @__PURE__ */ jsx(
117
+ "div",
118
+ {
119
+ className: cn(OVERLAY_FORM_GROUP_CLASS, "text-left", className),
120
+ ...props
121
+ }
122
+ );
123
+ }
124
+ function DialogFooter({
125
+ className,
126
+ ...props
127
+ }) {
128
+ return /* @__PURE__ */ jsx(
129
+ "div",
130
+ {
131
+ className: cn("flex flex-wrap justify-end gap-layout-element", className),
132
+ ...props
133
+ }
134
+ );
135
+ }
136
+ function DialogTitle({
137
+ className,
138
+ ...props
139
+ }) {
140
+ return /* @__PURE__ */ jsx(
141
+ DialogPrimitive.Title,
142
+ {
143
+ className: cn(
144
+ "font-display text-2xl leading-tight tracking-[-0.03em] text-on-surface",
145
+ className
146
+ ),
147
+ ...props
148
+ }
149
+ );
150
+ }
151
+ function DialogDescription({
152
+ className,
153
+ ...props
154
+ }) {
155
+ return /* @__PURE__ */ jsx(
156
+ DialogPrimitive.Description,
157
+ {
158
+ className: cn("text-sm leading-6 text-on-surface-variant", className),
159
+ ...props
160
+ }
161
+ );
162
+ }
163
+ const Popover = PopoverPrimitive.Root;
164
+ const PopoverTrigger = PopoverPrimitive.Trigger;
165
+ const PopoverAnchor = PopoverPrimitive.Anchor;
166
+ function PopoverContent({
167
+ align = "center",
168
+ className,
169
+ sideOffset = 10,
170
+ ...props
171
+ }) {
172
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
173
+ PopoverPrimitive.Content,
174
+ {
175
+ align,
176
+ className: cn(
177
+ "z-50 w-72 rounded-2xl border border-outline bg-surface-container-high p-3 text-on-surface shadow-xl outline-none data-[state=closed]:animate-out data-[state=open]:animate-in sm:w-80",
178
+ className
179
+ ),
180
+ sideOffset,
181
+ ...props
182
+ }
183
+ ) });
184
+ }
185
+ const SCROLL_AREA_VIEWPORT_CLASS = cn(
186
+ "size-full outline-none",
187
+ "[&>div]:!block [&>div]:size-full",
188
+ "[scrollbar-width:none] [-ms-overflow-style:none]",
189
+ "[&::-webkit-scrollbar]:hidden"
190
+ );
191
+ const ScrollArea = forwardRef(function ScrollArea2({
192
+ children,
193
+ className,
194
+ type = "auto",
195
+ viewportClassName,
196
+ viewportProps,
197
+ ...props
198
+ }, ref) {
199
+ return /* @__PURE__ */ jsxs(
200
+ ScrollAreaPrimitive.Root,
201
+ {
202
+ className: cn("relative overflow-hidden", className),
203
+ ref,
204
+ type,
205
+ ...props,
206
+ children: [
207
+ /* @__PURE__ */ jsx(
208
+ ScrollAreaPrimitive.Viewport,
209
+ {
210
+ className: cn(SCROLL_AREA_VIEWPORT_CLASS, viewportClassName),
211
+ ...viewportProps,
212
+ children
213
+ }
214
+ ),
215
+ /* @__PURE__ */ jsx(ScrollBar, {}),
216
+ /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
217
+ ]
218
+ }
219
+ );
220
+ });
221
+ const ScrollBar = forwardRef(function ScrollBar2({ className, orientation = "vertical", ...props }, ref) {
222
+ return /* @__PURE__ */ jsx(
223
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
224
+ {
225
+ className: cn(
226
+ "flex touch-none select-none bg-transparent p-px transition-colors",
227
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
228
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
229
+ className
230
+ ),
231
+ orientation,
232
+ ref,
233
+ ...props,
234
+ children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-outline-variant transition-colors hover:bg-on-surface-variant" })
235
+ }
236
+ );
237
+ });
238
+ export {
239
+ Collapsible as C,
240
+ Dialog as D,
241
+ OVERLAY_DIALOG_BODY_CLASS as O,
242
+ Popover as P,
243
+ ScrollArea as S,
244
+ CollapsibleContent as a,
245
+ CollapsibleTrigger as b,
246
+ DialogClose as c,
247
+ DialogContent as d,
248
+ DialogDescription as e,
249
+ DialogFooter as f,
250
+ DialogHeader as g,
251
+ DialogOverlay as h,
252
+ DialogPortal as i,
253
+ DialogTitle as j,
254
+ DialogTrigger as k,
255
+ OVERLAY_DIALOG_CONTENT_SHELL_CLASS as l,
256
+ OVERLAY_FORM_GROUP_CLASS as m,
257
+ PopoverAnchor as n,
258
+ PopoverContent as o,
259
+ PopoverTrigger as p,
260
+ ScrollBar as q
261
+ };
@@ -0,0 +1,73 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { forwardRef } from "react";
4
+ import { c as cn } from "./cn.js";
5
+ const SURFACE_PANEL_BASE_CLASS = "border border-outline";
6
+ const SURFACE_PANEL_PADDING_CLASS = {
7
+ compact: "p-2",
8
+ default: "p-3",
9
+ none: ""
10
+ };
11
+ const SURFACE_PANEL_RADIUS_CLASS = {
12
+ lg: "rounded-lg",
13
+ xl: "rounded-xl",
14
+ "2xl": "rounded-2xl",
15
+ "3xl": "rounded-3xl",
16
+ full: "rounded-full"
17
+ };
18
+ const SURFACE_PANEL_SURFACE_CLASS = {
19
+ high: "bg-surface-container-high",
20
+ low: "bg-surface-container-low"
21
+ };
22
+ const SURFACE_PANEL_TONE_CLASS = {
23
+ default: "",
24
+ accent: "border-primary text-on-surface",
25
+ selected: "border-primary bg-primary-container text-on-primary-container"
26
+ };
27
+ function surfacePanelVariants({
28
+ className,
29
+ padding = "default",
30
+ radius = "xl",
31
+ surface = "high",
32
+ tone = "default"
33
+ }) {
34
+ return cn(
35
+ SURFACE_PANEL_BASE_CLASS,
36
+ SURFACE_PANEL_PADDING_CLASS[padding],
37
+ SURFACE_PANEL_RADIUS_CLASS[radius],
38
+ SURFACE_PANEL_SURFACE_CLASS[surface],
39
+ SURFACE_PANEL_TONE_CLASS[tone],
40
+ className
41
+ );
42
+ }
43
+ const SurfacePanel = forwardRef(
44
+ function SurfacePanel2({
45
+ asChild = false,
46
+ className,
47
+ padding = "default",
48
+ radius = "xl",
49
+ surface = "high",
50
+ tone = "default",
51
+ ...props
52
+ }, ref) {
53
+ const Component = asChild ? Slot : "div";
54
+ return /* @__PURE__ */ jsx(
55
+ Component,
56
+ {
57
+ className: surfacePanelVariants({
58
+ className,
59
+ padding,
60
+ radius,
61
+ surface,
62
+ tone
63
+ }),
64
+ ref,
65
+ ...props
66
+ }
67
+ );
68
+ }
69
+ );
70
+ export {
71
+ SurfacePanel as S,
72
+ surfacePanelVariants as s
73
+ };
@@ -0,0 +1,292 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { c as cn } from "./cn.js";
4
+ import { B as BODY_TEXT_CLASS } from "./typography-roles.js";
5
+ const CODE_PANEL_PADDING_CLASS = {
6
+ compact: "p-2",
7
+ default: "p-3"
8
+ };
9
+ const CODE_PANEL_SURFACE_CLASS = {
10
+ high: "bg-surface-container-high",
11
+ low: "bg-surface-container-low"
12
+ };
13
+ const CODE_PANEL_MAX_HEIGHT_CLASS = {
14
+ none: "",
15
+ sm: "max-h-48 overflow-y-auto",
16
+ md: "max-h-72 overflow-y-auto",
17
+ lg: "max-h-96 overflow-y-auto"
18
+ };
19
+ const CODE_PANEL_BODY_CODE_CLASS = "font-mono text-code-medium text-code";
20
+ const CODE_PANEL_CONTAINMENT_CLASS = "m-0 min-w-0 w-full max-w-full overflow-x-auto whitespace-pre-wrap rounded-lg border border-outline [overflow-wrap:anywhere] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
21
+ function codePanelVariants({
22
+ className,
23
+ maxHeight = "none",
24
+ padding = "compact",
25
+ surface = "high"
26
+ }) {
27
+ return cn(
28
+ CODE_PANEL_CONTAINMENT_CLASS,
29
+ CODE_PANEL_PADDING_CLASS[padding],
30
+ CODE_PANEL_SURFACE_CLASS[surface],
31
+ CODE_PANEL_MAX_HEIGHT_CLASS[maxHeight],
32
+ CODE_PANEL_BODY_CODE_CLASS,
33
+ className
34
+ );
35
+ }
36
+ const CodePanel = forwardRef(
37
+ function CodePanel2({ className, maxHeight = "none", padding, surface, tabIndex, ...props }, ref) {
38
+ const isScrollable = maxHeight !== "none";
39
+ return /* @__PURE__ */ jsx(
40
+ "pre",
41
+ {
42
+ className: codePanelVariants({ className, maxHeight, padding, surface }),
43
+ ref,
44
+ tabIndex: tabIndex ?? (isScrollable ? 0 : void 0),
45
+ ...props
46
+ }
47
+ );
48
+ }
49
+ );
50
+ const DescriptionList = forwardRef(function DescriptionList2({ className, ...props }, ref) {
51
+ return /* @__PURE__ */ jsx(
52
+ "dl",
53
+ {
54
+ className: cn(
55
+ "m-0 grid min-w-0 gap-1.5 [&_dd]:m-0 [&_dd]:min-w-0 [&_div]:grid [&_div]:min-w-0 [&_div]:gap-2",
56
+ BODY_TEXT_CLASS,
57
+ className
58
+ ),
59
+ ref,
60
+ ...props
61
+ }
62
+ );
63
+ });
64
+ const Table = forwardRef(function Table2({ className, containerClassName, containerProps, size = "default", ...props }, ref) {
65
+ return /* @__PURE__ */ jsx(
66
+ "div",
67
+ {
68
+ className: cn(
69
+ "group/table w-full overflow-x-auto overflow-y-clip rounded-2xl border border-outline",
70
+ containerClassName
71
+ ),
72
+ "data-size": size,
73
+ ...containerProps,
74
+ children: /* @__PURE__ */ jsx(
75
+ "table",
76
+ {
77
+ className: cn("w-full caption-bottom text-sm", className),
78
+ ref,
79
+ ...props
80
+ }
81
+ )
82
+ }
83
+ );
84
+ });
85
+ const TableHeader = forwardRef(function TableHeader2({ className, ...props }, ref) {
86
+ return /* @__PURE__ */ jsx(
87
+ "thead",
88
+ {
89
+ className: cn("[&_tr]:border-b [&_tr]:border-outline", className),
90
+ ref,
91
+ ...props
92
+ }
93
+ );
94
+ });
95
+ const TableBody = forwardRef(function TableBody2({ className, ...props }, ref) {
96
+ return /* @__PURE__ */ jsx(
97
+ "tbody",
98
+ {
99
+ className: cn(
100
+ "[&_tr:last-child]:border-0 [&_tr]:border-b [&_tr]:border-outline",
101
+ className
102
+ ),
103
+ ref,
104
+ ...props
105
+ }
106
+ );
107
+ });
108
+ const TableRow = forwardRef(function TableRow2({ className, ...props }, ref) {
109
+ return /* @__PURE__ */ jsx(
110
+ "tr",
111
+ {
112
+ className: cn(
113
+ "transition-colors hover:bg-af-overlay data-[state=selected]:bg-af-overlay",
114
+ className
115
+ ),
116
+ ref,
117
+ ...props
118
+ }
119
+ );
120
+ });
121
+ const TableHead = forwardRef(function TableHead2({ className, ...props }, ref) {
122
+ return /* @__PURE__ */ jsx(
123
+ "th",
124
+ {
125
+ className: cn(
126
+ "h-11 px-4 text-left align-middle text-xs font-bold uppercase tracking-[0.08em] text-af-text-subtle",
127
+ "group-data-[size=dense]/table:h-8 group-data-[size=dense]/table:px-3 group-data-[size=dense]/table:py-2",
128
+ className
129
+ ),
130
+ ref,
131
+ ...props
132
+ }
133
+ );
134
+ });
135
+ const TableCell = forwardRef(function TableCell2({ className, ...props }, ref) {
136
+ return /* @__PURE__ */ jsx(
137
+ "td",
138
+ {
139
+ className: cn(
140
+ "min-w-0 px-4 py-3 align-middle text-on-surface",
141
+ "group-data-[size=dense]/table:px-3 group-data-[size=dense]/table:py-2",
142
+ className
143
+ ),
144
+ ref,
145
+ ...props
146
+ }
147
+ );
148
+ });
149
+ const TableCaption = forwardRef(function TableCaption2({ className, ...props }, ref) {
150
+ return /* @__PURE__ */ jsx(
151
+ "caption",
152
+ {
153
+ className: cn("mt-4 text-sm text-af-text-subtle", className),
154
+ ref,
155
+ ...props
156
+ }
157
+ );
158
+ });
159
+ function DataTablePlaceholderBar({ className }) {
160
+ return /* @__PURE__ */ jsx(
161
+ "div",
162
+ {
163
+ "aria-hidden": "true",
164
+ className: cn("animate-pulse rounded-xl bg-af-overlay", className)
165
+ }
166
+ );
167
+ }
168
+ function DataTableStatusRow({
169
+ children,
170
+ colSpan,
171
+ role,
172
+ ariaBusy,
173
+ ariaLive,
174
+ cellClassName
175
+ }) {
176
+ return /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { className: cellClassName, colSpan, children: /* @__PURE__ */ jsx(
177
+ "div",
178
+ {
179
+ "aria-busy": ariaBusy || void 0,
180
+ "aria-live": ariaLive,
181
+ role,
182
+ children
183
+ }
184
+ ) }) });
185
+ }
186
+ function DataTable({
187
+ columns,
188
+ data,
189
+ getRowKey,
190
+ ariaLabel,
191
+ caption,
192
+ containerClassName,
193
+ containerProps,
194
+ emptyMessage,
195
+ errorMessage,
196
+ loadingMessage,
197
+ rowClassName,
198
+ size,
199
+ state = "success",
200
+ tableClassName
201
+ }) {
202
+ const renderBody = () => {
203
+ if (state === "loading") {
204
+ return /* @__PURE__ */ jsx(
205
+ DataTableStatusRow,
206
+ {
207
+ ariaBusy: true,
208
+ ariaLive: "polite",
209
+ colSpan: columns.length,
210
+ role: "status",
211
+ children: /* @__PURE__ */ jsxs("div", { className: "grid gap-3 py-1", children: [
212
+ loadingMessage,
213
+ /* @__PURE__ */ jsxs("div", { "aria-hidden": "true", className: "grid gap-2", children: [
214
+ /* @__PURE__ */ jsx(DataTablePlaceholderBar, { className: "h-4 w-full max-w-48" }),
215
+ /* @__PURE__ */ jsx(DataTablePlaceholderBar, { className: "h-8 w-full" }),
216
+ /* @__PURE__ */ jsx(DataTablePlaceholderBar, { className: "h-4 w-full max-w-48" })
217
+ ] })
218
+ ] })
219
+ }
220
+ );
221
+ }
222
+ if (state === "error") {
223
+ return /* @__PURE__ */ jsx(
224
+ DataTableStatusRow,
225
+ {
226
+ ariaLive: "assertive",
227
+ cellClassName: "text-af-text-subtle",
228
+ colSpan: columns.length,
229
+ role: "alert",
230
+ children: errorMessage
231
+ }
232
+ );
233
+ }
234
+ if (state === "empty" || state === "success" && data.length === 0) {
235
+ return /* @__PURE__ */ jsx(
236
+ DataTableStatusRow,
237
+ {
238
+ ariaLive: "polite",
239
+ cellClassName: "text-af-text-subtle",
240
+ colSpan: columns.length,
241
+ role: "status",
242
+ children: emptyMessage
243
+ }
244
+ );
245
+ }
246
+ return data.map((row) => /* @__PURE__ */ jsx(TableRow, { className: rowClassName?.(row), children: columns.map((column) => /* @__PURE__ */ jsx(TableCell, { className: column.cellClassName, children: column.cell(row) }, column.id)) }, getRowKey(row)));
247
+ };
248
+ return /* @__PURE__ */ jsxs(
249
+ Table,
250
+ {
251
+ "aria-label": ariaLabel,
252
+ className: tableClassName,
253
+ containerClassName,
254
+ containerProps,
255
+ size,
256
+ children: [
257
+ caption ? /* @__PURE__ */ jsx(TableCaption, { children: caption }) : null,
258
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx(
259
+ TableHead,
260
+ {
261
+ className: column.headerClassName,
262
+ scope: "col",
263
+ children: column.header
264
+ },
265
+ column.id
266
+ )) }) }),
267
+ /* @__PURE__ */ jsx(TableBody, { children: renderBody() })
268
+ ]
269
+ }
270
+ );
271
+ }
272
+ const tableCellWrapClassName = "min-w-0 [overflow-wrap:anywhere]";
273
+ const tableCellTruncateClassName = "block min-w-0 max-w-full truncate whitespace-nowrap";
274
+ const tableMinWidthWideClassName = "min-w-2xl";
275
+ const tableNarrowContainerClassName = "min-w-0 overscroll-x-contain";
276
+ export {
277
+ CodePanel as C,
278
+ DataTable as D,
279
+ Table as T,
280
+ DescriptionList as a,
281
+ TableBody as b,
282
+ TableCaption as c,
283
+ TableCell as d,
284
+ TableHead as e,
285
+ TableHeader as f,
286
+ TableRow as g,
287
+ codePanelVariants as h,
288
+ tableCellWrapClassName as i,
289
+ tableMinWidthWideClassName as j,
290
+ tableNarrowContainerClassName as k,
291
+ tableCellTruncateClassName as t
292
+ };
@@ -0,0 +1,26 @@
1
+ const PAGE_HEADING_CLASS = "af-page-heading";
2
+ const SECTION_HEADING_CLASS = "af-section-heading";
3
+ const BODY_TEXT_CLASS = "af-body-text";
4
+ const SUPPORTING_TEXT_CLASS = "af-supporting-text";
5
+ const MUTED_TEXT_CLASS = "af-muted-text";
6
+ const CAPTION_TEXT_CLASS = "af-caption-text";
7
+ const DENSE_BODY_TEXT_CLASS = "af-dense-body-text";
8
+ const SUPPORTING_LABEL_CLASS = "af-supporting-label";
9
+ const BODY_CODE_CLASS = "af-body-code";
10
+ const SUPPORTING_CODE_CLASS = "af-supporting-code";
11
+ const TEXT_TRUNCATE_CLASS = "af-text-truncate";
12
+ const TEXT_WRAP_CLASS = "af-text-wrap";
13
+ export {
14
+ BODY_TEXT_CLASS as B,
15
+ CAPTION_TEXT_CLASS as C,
16
+ DENSE_BODY_TEXT_CLASS as D,
17
+ MUTED_TEXT_CLASS as M,
18
+ PAGE_HEADING_CLASS as P,
19
+ SECTION_HEADING_CLASS as S,
20
+ TEXT_TRUNCATE_CLASS as T,
21
+ BODY_CODE_CLASS as a,
22
+ SUPPORTING_CODE_CLASS as b,
23
+ SUPPORTING_LABEL_CLASS as c,
24
+ SUPPORTING_TEXT_CLASS as d,
25
+ TEXT_WRAP_CLASS as e
26
+ };