@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.
- package/LICENSE.md +21 -0
- package/README.md +38 -7
- package/dist/category-paths.d.ts +3 -0
- package/dist/charts/chart-state-panel.d.ts +11 -0
- package/dist/charts/chart.d.ts +35 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/index.js +287 -0
- package/dist/chunks/action-row.js +39 -0
- package/dist/chunks/alert-panel.js +182 -0
- package/dist/chunks/button.js +193 -0
- package/dist/chunks/cn.js +6 -0
- package/dist/chunks/factory-emulator-controls.js +123 -0
- package/dist/chunks/package-form-field.js +546 -0
- package/dist/chunks/scroll-area.js +261 -0
- package/dist/chunks/surface-panel.js +73 -0
- package/dist/chunks/table-layout.js +292 -0
- package/dist/chunks/typography-roles.js +26 -0
- package/dist/chunks/typography.js +129 -0
- package/dist/chunks/widget-frame.js +344 -0
- package/dist/data-display/code-panel.d.ts +12 -0
- package/dist/data-display/data-table.d.ts +27 -0
- package/dist/data-display/description-list.d.ts +4 -0
- package/{src/data-display/index.ts → dist/data-display/index.d.ts} +4 -26
- package/dist/data-display/index.js +20 -0
- package/dist/data-display/table-layout.d.ts +8 -0
- package/dist/data-display/table.d.ts +14 -0
- package/dist/factory-emulator/factory-emulator-controls.d.ts +23 -0
- package/dist/factory-emulator/index.d.ts +6 -0
- package/dist/factory-emulator/index.js +6 -0
- package/dist/feedback/alert-panel-semantics.d.ts +11 -0
- package/dist/feedback/alert-panel.d.ts +29 -0
- package/dist/feedback/index.d.ts +6 -0
- package/dist/feedback/index.js +10 -0
- package/dist/feedback/skeleton.d.ts +2 -0
- package/dist/forms/index.d.ts +19 -0
- package/dist/forms/index.js +37 -0
- package/dist/forms/package-checkbox.d.ts +3 -0
- package/dist/forms/package-enum-select.d.ts +42 -0
- package/dist/forms/package-file-input.d.ts +3 -0
- package/dist/forms/package-form-field.d.ts +49 -0
- package/dist/forms/package-input.d.ts +6 -0
- package/dist/forms/package-native-select.d.ts +3 -0
- package/dist/forms/package-select.d.ts +32 -0
- package/dist/forms/package-textarea.d.ts +10 -0
- package/dist/forms/select-icons.d.ts +3 -0
- package/dist/graphs/graph-edge-path.d.ts +18 -0
- package/dist/graphs/graph-edge.d.ts +15 -0
- package/dist/graphs/graph-node-button.d.ts +11 -0
- package/dist/graphs/graph-node-handle-badge.d.ts +5 -0
- package/dist/graphs/graph-node-handle.d.ts +18 -0
- package/dist/graphs/graph-node-shell.d.ts +13 -0
- package/dist/graphs/graph-node-state-indicator.d.ts +6 -0
- package/dist/graphs/graph-node-state.d.ts +23 -0
- package/dist/graphs/graph-viewport-surface.d.ts +5 -0
- package/dist/graphs/index.d.ts +13 -0
- package/dist/graphs/index.js +614 -0
- package/{src/icons/index.ts → dist/icons/index.d.ts} +1 -2
- package/dist/icons/index.js +4 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +145 -0
- package/dist/layout/action-row.d.ts +8 -0
- package/{src/layout/index.ts → dist/layout/index.d.ts} +1 -3
- package/dist/layout/index.js +9 -0
- package/dist/layout/surface-panel.d.ts +15 -0
- package/{src/navigation/index.ts → dist/navigation/index.d.ts} +1 -2
- package/dist/navigation/index.js +4 -0
- package/dist/overlays/collapsible.d.ts +5 -0
- package/dist/overlays/dialog.d.ts +16 -0
- package/dist/overlays/index.d.ts +10 -0
- package/dist/overlays/index.js +27 -0
- package/dist/overlays/overlay-layout.d.ts +6 -0
- package/dist/overlays/popover.d.ts +6 -0
- package/dist/overlays/scroll-area.d.ts +9 -0
- package/dist/primitives/button-link.d.ts +5 -0
- package/dist/primitives/button.d.ts +9 -0
- package/dist/primitives/icon-button-shell.d.ts +10 -0
- package/{src/primitives/index.ts → dist/primitives/index.d.ts} +2 -19
- package/dist/primitives/index.js +49 -0
- package/dist/primitives/package-text.d.ts +6 -0
- package/dist/primitives/typography-roles.d.ts +12 -0
- package/dist/primitives/typography.d.ts +36 -0
- package/dist/recipes/index.d.ts +14 -0
- package/dist/recipes/index.js +32 -0
- package/dist/recipes/widget-frame-content.d.ts +24 -0
- package/dist/recipes/widget-frame-disclosure.d.ts +33 -0
- package/dist/recipes/widget-frame-layout.d.ts +12 -0
- package/dist/recipes/widget-frame-skeleton.d.ts +2 -0
- package/dist/recipes/widget-frame-states.d.ts +15 -0
- package/dist/recipes/widget-frame-typography.d.ts +10 -0
- package/dist/recipes/widget-frame.d.ts +12 -0
- package/{src → dist}/styles.css +36 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.js +16 -0
- package/dist/testing/render.d.ts +5 -0
- package/{src/tokens/index.ts → dist/tokens/index.d.ts} +1 -2
- package/dist/tokens/index.js +4 -0
- package/dist/utilities/cn.d.ts +1 -0
- package/{src/utilities/index.ts → dist/utilities/index.d.ts} +1 -3
- package/dist/utilities/index.js +6 -0
- package/package.json +65 -64
- package/docs/README.md +0 -83
- package/docs/button.md +0 -119
- package/docs/charts.md +0 -325
- package/docs/data-display-code-panel.md +0 -120
- package/docs/feedback-alert-panel.md +0 -117
- package/docs/feedback-skeleton.md +0 -54
- package/docs/forms-form-field.md +0 -490
- package/docs/forms-input-primitives.md +0 -311
- package/docs/forms-select-primitives.md +0 -362
- package/docs/graphs.md +0 -250
- package/docs/layout-display-primitives.md +0 -211
- package/docs/overlays.md +0 -414
- package/docs/table-data-table.md +0 -331
- package/docs/typography-roles.md +0 -182
- package/docs/widget-frame-recipes.md +0 -273
- package/src/category-paths.ts +0 -20
- package/src/charts/chart-state-panel.tsx +0 -103
- package/src/charts/chart.tsx +0 -287
- package/src/charts/index.ts +0 -21
- package/src/data-display/code-panel.tsx +0 -67
- package/src/data-display/data-table.tsx +0 -180
- package/src/data-display/description-list.tsx +0 -24
- package/src/data-display/table-layout.ts +0 -12
- package/src/data-display/table.tsx +0 -131
- package/src/feedback/alert-panel-semantics.ts +0 -75
- package/src/feedback/alert-panel.tsx +0 -187
- package/src/feedback/index.ts +0 -21
- package/src/feedback/skeleton.tsx +0 -16
- package/src/forms/index.ts +0 -73
- package/src/forms/package-checkbox.tsx +0 -50
- package/src/forms/package-enum-select.tsx +0 -185
- package/src/forms/package-file-input.tsx +0 -25
- package/src/forms/package-form-field.tsx +0 -202
- package/src/forms/package-input.tsx +0 -25
- package/src/forms/package-native-select.tsx +0 -25
- package/src/forms/package-select.tsx +0 -209
- package/src/forms/package-textarea.tsx +0 -35
- package/src/forms/select-icons.tsx +0 -35
- package/src/graphs/graph-edge-path.ts +0 -241
- package/src/graphs/graph-edge.tsx +0 -130
- package/src/graphs/graph-interactive-example.tsx +0 -187
- package/src/graphs/graph-node-button.tsx +0 -51
- package/src/graphs/graph-node-handle-badge.tsx +0 -108
- package/src/graphs/graph-node-handle.ts +0 -28
- package/src/graphs/graph-node-shell.tsx +0 -111
- package/src/graphs/graph-node-state-indicator.tsx +0 -47
- package/src/graphs/graph-node-state.ts +0 -111
- package/src/graphs/graph-viewport-surface.tsx +0 -27
- package/src/graphs/index.ts +0 -41
- package/src/index.ts +0 -209
- package/src/layout/action-row.tsx +0 -53
- package/src/layout/surface-panel.tsx +0 -91
- package/src/overlays/collapsible.tsx +0 -22
- package/src/overlays/dialog.tsx +0 -148
- package/src/overlays/index.ts +0 -31
- package/src/overlays/overlay-layout.ts +0 -9
- package/src/overlays/popover.tsx +0 -29
- package/src/overlays/scroll-area.tsx +0 -78
- package/src/primitives/button-link.tsx +0 -22
- package/src/primitives/button.tsx +0 -258
- package/src/primitives/icon-button-shell.tsx +0 -49
- package/src/primitives/package-text.tsx +0 -29
- package/src/primitives/typography-roles.ts +0 -12
- package/src/primitives/typography.tsx +0 -165
- package/src/recipes/index.ts +0 -61
- package/src/recipes/widget-frame-content.tsx +0 -114
- package/src/recipes/widget-frame-disclosure.tsx +0 -161
- package/src/recipes/widget-frame-layout.ts +0 -40
- package/src/recipes/widget-frame-skeleton.tsx +0 -16
- package/src/recipes/widget-frame-states.tsx +0 -99
- package/src/recipes/widget-frame-typography.ts +0 -19
- package/src/recipes/widget-frame.tsx +0 -84
- package/src/testing/index.ts +0 -13
- package/src/testing/render.tsx +0 -16
- package/src/utilities/cn.ts +0 -5
- /package/{src → dist}/styles/color-palette-presets.css +0 -0
- /package/{src → dist}/styles/color-role-tokens.css +0 -0
- /package/{src → dist}/styles/layout-role-tokens.css +0 -0
- /package/{src → dist}/styles/text-color-role-tokens.css +0 -0
- /package/{src → dist}/styles/typography-role-tokens.css +0 -0
- /package/{src → dist}/styles/typography-role-utilities.css +0 -0
- /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
|
+
};
|