@you-agent-factory/components 0.0.2 → 0.0.6
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/dist/charts/chart-state-panel.d.ts +1 -1
- package/dist/charts/chart.d.ts +3 -3
- package/dist/charts/index.d.ts +1 -1
- package/dist/charts/index.js +6 -1
- package/dist/chunks/alert-panel.js +10 -12
- package/dist/chunks/button.js +3 -1
- package/dist/chunks/{package-form-field.js → package-textarea.js} +51 -54
- package/dist/chunks/table-layout.js +22 -25
- package/dist/chunks/typography-roles.js +2 -2
- package/dist/chunks/typography.js +1 -1
- package/dist/chunks/{widget-frame.js → widget-frame-states.js} +144 -140
- package/dist/data-display/data-table.d.ts +1 -1
- package/dist/data-display/index.d.ts +5 -5
- package/dist/factory-emulator/factory-emulator-controls.d.ts +1 -1
- package/dist/factory-emulator/index.d.ts +1 -1
- package/dist/feedback/index.d.ts +1 -1
- package/dist/feedback/skeleton.d.ts +1 -1
- package/dist/forms/index.d.ts +9 -9
- package/dist/forms/index.js +1 -1
- package/dist/forms/package-enum-select.d.ts +3 -3
- package/dist/forms/package-select.d.ts +5 -5
- package/dist/forms/select-icons.d.ts +2 -2
- package/dist/graphs/graph-edge.d.ts +1 -1
- package/dist/graphs/graph-node-handle-badge.d.ts +1 -1
- package/dist/graphs/graph-node-shell.d.ts +1 -1
- package/dist/graphs/graph-node-state-indicator.d.ts +1 -1
- package/dist/graphs/index.d.ts +5 -5
- package/dist/graphs/index.js +483 -483
- package/dist/index.d.ts +16 -16
- package/dist/index.js +87 -87
- package/dist/layout/action-row.d.ts +1 -1
- package/dist/layout/index.d.ts +2 -2
- package/dist/overlays/collapsible.d.ts +1 -1
- package/dist/overlays/dialog.d.ts +6 -6
- package/dist/overlays/index.d.ts +3 -3
- package/dist/overlays/popover.d.ts +1 -1
- package/dist/primitives/index.d.ts +5 -5
- package/dist/primitives/index.js +3 -3
- package/dist/primitives/package-text.d.ts +1 -1
- package/dist/recipes/index.d.ts +7 -7
- package/dist/recipes/index.js +1 -1
- package/dist/recipes/widget-frame-content.d.ts +5 -5
- package/dist/recipes/widget-frame-disclosure.d.ts +3 -3
- package/dist/recipes/widget-frame-skeleton.d.ts +1 -1
- package/dist/recipes/widget-frame-states.d.ts +3 -3
- package/dist/recipes/widget-frame.d.ts +1 -1
- package/dist/testing/render.d.ts +1 -1
- package/package.json +1 -2
|
@@ -8,4 +8,4 @@ export interface ChartStatePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
status: ChartStateStatus;
|
|
9
9
|
title: string;
|
|
10
10
|
}
|
|
11
|
-
export declare function ChartStatePanel({ action, className, description, presentation, status, title, ...props }: ChartStatePanelProps): import("react").JSX.Element;
|
|
11
|
+
export declare function ChartStatePanel({ action, className, description, presentation, status, title, ...props }: ChartStatePanelProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/charts/chart.d.ts
CHANGED
|
@@ -19,12 +19,12 @@ export declare function ChartContainer({ children, className, config, footer, in
|
|
|
19
19
|
rootAttributes?: Record<string, string>;
|
|
20
20
|
style?: CSSProperties;
|
|
21
21
|
title: string;
|
|
22
|
-
}): import("react").JSX.Element;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export declare const ChartTooltip: typeof RechartsTooltip;
|
|
24
24
|
export declare const ChartLegend: import("react").MemoExoticComponent<(outsideProps: import("recharts").LegendProps) => React.ReactPortal | null>;
|
|
25
25
|
export declare function ChartTooltipContent({ active, className, label, payload, }: TooltipContentProps<ValueType, NameType> & {
|
|
26
26
|
className?: string;
|
|
27
|
-
}): import("react").JSX.Element | null;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
28
28
|
export declare function ChartLegendContent({ className, getToggleLabel, hiddenSeries, itemClassName, onToggleSeries, payload, swatchClassName, }: RechartsLegendContentProps & {
|
|
29
29
|
className?: string;
|
|
30
30
|
getToggleLabel?: (label: string, hidden: boolean) => string;
|
|
@@ -32,4 +32,4 @@ export declare function ChartLegendContent({ className, getToggleLabel, hiddenSe
|
|
|
32
32
|
itemClassName?: string;
|
|
33
33
|
onToggleSeries?: (key: string) => void;
|
|
34
34
|
swatchClassName?: string;
|
|
35
|
-
}): import("react").JSX.Element | null;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/charts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Stable category path for `@you-agent-factory/components/charts`. */
|
|
2
2
|
export declare const COMPONENTS_CATEGORY: "charts";
|
|
3
3
|
export type ComponentsCategory = typeof COMPONENTS_CATEGORY;
|
|
4
|
-
export {
|
|
4
|
+
export { type ChartConfig, type ChartConfigEntry, ChartContainer, ChartLegend, ChartLegendContent, type ChartPresentation, ChartTooltip, ChartTooltipContent, } from "./chart";
|
|
5
5
|
export { ChartStatePanel, type ChartStatePanelProps, type ChartStateStatus, } from "./chart-state-panel";
|
package/dist/charts/index.js
CHANGED
|
@@ -232,7 +232,12 @@ function ChartStatePanel({
|
|
|
232
232
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
233
233
|
loading ? /* @__PURE__ */ jsxs("div", { "aria-hidden": "true", className: "grid w-full gap-3", children: [
|
|
234
234
|
/* @__PURE__ */ jsx("div", { className: cn(CHART_STATE_PANEL_SKELETON_CLASS, "h-4 w-32") }),
|
|
235
|
-
/* @__PURE__ */ jsx(
|
|
235
|
+
/* @__PURE__ */ jsx(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
className: cn(CHART_STATE_PANEL_SKELETON_CLASS, "h-28 w-full")
|
|
239
|
+
}
|
|
240
|
+
)
|
|
236
241
|
] }) : null,
|
|
237
242
|
/* @__PURE__ */ jsx("h3", { className: CHART_STATE_PANEL_TITLE_CLASS, children: title }),
|
|
238
243
|
/* @__PURE__ */ jsx("p", { className: CHART_STATE_PANEL_DESCRIPTION_CLASS, children: description }),
|
|
@@ -144,18 +144,16 @@ const AlertPanelStatusLabel = forwardRef(function AlertPanelStatusLabel2({ class
|
|
|
144
144
|
}
|
|
145
145
|
);
|
|
146
146
|
});
|
|
147
|
-
const AlertPanelTitle = forwardRef(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
);
|
|
147
|
+
const AlertPanelTitle = forwardRef(function AlertPanelTitle2({ className, ...props }, ref) {
|
|
148
|
+
return /* @__PURE__ */ jsx(
|
|
149
|
+
"h3",
|
|
150
|
+
{
|
|
151
|
+
className: cn("m-0 text-body-medium !text-current", className),
|
|
152
|
+
ref,
|
|
153
|
+
...props
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
});
|
|
159
157
|
const ALERT_PANEL_SUPPORTING_TEXT_CLASS = "text-body-small text-on-surface-variant";
|
|
160
158
|
const AlertPanelText = forwardRef(
|
|
161
159
|
function AlertPanelText2({ as: Component = "p", className, variant = "body", ...props }, ref) {
|
package/dist/chunks/button.js
CHANGED
|
@@ -118,7 +118,9 @@ function renderBlockedAsChildButton({
|
|
|
118
118
|
}) {
|
|
119
119
|
const child = Children.only(children);
|
|
120
120
|
if (!isValidElement(child)) {
|
|
121
|
-
throw new Error(
|
|
121
|
+
throw new Error(
|
|
122
|
+
"Button with asChild requires a single React element child."
|
|
123
|
+
);
|
|
122
124
|
}
|
|
123
125
|
return cloneElement(child, {
|
|
124
126
|
...props,
|
|
@@ -21,15 +21,7 @@ function CheckboxCheckIcon() {
|
|
|
21
21
|
}
|
|
22
22
|
const PackageCheckbox = forwardRef(function PackageCheckbox2({ className, ...props }, ref) {
|
|
23
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
|
-
),
|
|
24
|
+
/* @__PURE__ */ jsx("input", { className: "peer sr-only", ref, type: "checkbox", ...props }),
|
|
33
25
|
/* @__PURE__ */ jsx(
|
|
34
26
|
"span",
|
|
35
27
|
{
|
|
@@ -357,39 +349,6 @@ const PackageFileInput = forwardRef(function PackageFileInput2({ className, ...p
|
|
|
357
349
|
}
|
|
358
350
|
);
|
|
359
351
|
});
|
|
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
352
|
function buildFormFieldAriaDescribedBy(messageIds) {
|
|
394
353
|
const ids = [
|
|
395
354
|
messageIds.descriptionId,
|
|
@@ -495,20 +454,58 @@ const FormSuccess = forwardRef(
|
|
|
495
454
|
);
|
|
496
455
|
}
|
|
497
456
|
);
|
|
498
|
-
const FormFieldGroup = forwardRef(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
457
|
+
const FormFieldGroup = forwardRef(function FormFieldGroup2({ className, ...props }, ref) {
|
|
458
|
+
return /* @__PURE__ */ jsx(
|
|
459
|
+
"fieldset",
|
|
460
|
+
{
|
|
461
|
+
className: cn("m-0 space-y-2 border-0 p-0", className),
|
|
462
|
+
ref,
|
|
463
|
+
...props
|
|
464
|
+
}
|
|
465
|
+
);
|
|
466
|
+
});
|
|
467
|
+
const FormFieldGroupLabel = forwardRef(function FormFieldGroupLabel2({ className, ...props }, ref) {
|
|
468
|
+
return /* @__PURE__ */ jsx(
|
|
469
|
+
"legend",
|
|
470
|
+
{
|
|
471
|
+
className: cn(FORM_LABEL_CLASS, "px-0", className),
|
|
472
|
+
ref,
|
|
473
|
+
...props
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
});
|
|
477
|
+
const NativeSelect = forwardRef(
|
|
478
|
+
function NativeSelect2({ children, className, ...props }, ref) {
|
|
479
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
480
|
+
/* @__PURE__ */ jsx(
|
|
481
|
+
"select",
|
|
482
|
+
{
|
|
483
|
+
className: inputVariants({
|
|
484
|
+
className: `appearance-none pr-10 ${className ?? ""}`
|
|
485
|
+
}),
|
|
486
|
+
ref,
|
|
487
|
+
...props,
|
|
488
|
+
children
|
|
489
|
+
}
|
|
490
|
+
),
|
|
491
|
+
/* @__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" })
|
|
492
|
+
] });
|
|
508
493
|
}
|
|
509
494
|
);
|
|
510
|
-
const
|
|
511
|
-
|
|
495
|
+
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";
|
|
496
|
+
const TEXTAREA_FIELD_CLASS = "min-h-28 max-h-52 resize-none overflow-y-auto py-3";
|
|
497
|
+
function textareaVariants({ className } = {}) {
|
|
498
|
+
return inputVariants({ className: cn(TEXTAREA_FIELD_CLASS, className) });
|
|
499
|
+
}
|
|
500
|
+
const PackageTextarea = forwardRef(function PackageTextarea2({ className, variant = "field", ...props }, ref) {
|
|
501
|
+
return /* @__PURE__ */ jsx(
|
|
502
|
+
"textarea",
|
|
503
|
+
{
|
|
504
|
+
className: variant === "plain" ? cn(TEXTAREA_PLAIN_CLASS, className) : textareaVariants({ className }),
|
|
505
|
+
ref,
|
|
506
|
+
...props
|
|
507
|
+
}
|
|
508
|
+
);
|
|
512
509
|
});
|
|
513
510
|
export {
|
|
514
511
|
ENUM_SELECT_EMPTY_VALUE as E,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { c as cn } from "./cn.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as BODY_TEXT_CLASS } from "./typography-roles.js";
|
|
5
5
|
const CODE_PANEL_PADDING_CLASS = {
|
|
6
6
|
compact: "p-2",
|
|
7
7
|
default: "p-3"
|
|
@@ -39,7 +39,12 @@ const CodePanel = forwardRef(
|
|
|
39
39
|
return /* @__PURE__ */ jsx(
|
|
40
40
|
"pre",
|
|
41
41
|
{
|
|
42
|
-
className: codePanelVariants({
|
|
42
|
+
className: codePanelVariants({
|
|
43
|
+
className,
|
|
44
|
+
maxHeight,
|
|
45
|
+
padding,
|
|
46
|
+
surface
|
|
47
|
+
}),
|
|
43
48
|
ref,
|
|
44
49
|
tabIndex: tabIndex ?? (isScrollable ? 0 : void 0),
|
|
45
50
|
...props
|
|
@@ -47,20 +52,6 @@ const CodePanel = forwardRef(
|
|
|
47
52
|
);
|
|
48
53
|
}
|
|
49
54
|
);
|
|
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
55
|
const Table = forwardRef(function Table2({ className, containerClassName, containerProps, size = "default", ...props }, ref) {
|
|
65
56
|
return /* @__PURE__ */ jsx(
|
|
66
57
|
"div",
|
|
@@ -173,15 +164,7 @@ function DataTableStatusRow({
|
|
|
173
164
|
ariaLive,
|
|
174
165
|
cellClassName
|
|
175
166
|
}) {
|
|
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
|
-
) }) });
|
|
167
|
+
return /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { className: cellClassName, colSpan, children: /* @__PURE__ */ jsx("div", { "aria-busy": ariaBusy || void 0, "aria-live": ariaLive, role, children }) }) });
|
|
185
168
|
}
|
|
186
169
|
function DataTable({
|
|
187
170
|
columns,
|
|
@@ -269,6 +252,20 @@ function DataTable({
|
|
|
269
252
|
}
|
|
270
253
|
);
|
|
271
254
|
}
|
|
255
|
+
const DescriptionList = forwardRef(function DescriptionList2({ className, ...props }, ref) {
|
|
256
|
+
return /* @__PURE__ */ jsx(
|
|
257
|
+
"dl",
|
|
258
|
+
{
|
|
259
|
+
className: cn(
|
|
260
|
+
"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",
|
|
261
|
+
BODY_TEXT_CLASS,
|
|
262
|
+
className
|
|
263
|
+
),
|
|
264
|
+
ref,
|
|
265
|
+
...props
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
});
|
|
272
269
|
const tableCellWrapClassName = "min-w-0 [overflow-wrap:anywhere]";
|
|
273
270
|
const tableCellTruncateClassName = "block min-w-0 max-w-full truncate whitespace-nowrap";
|
|
274
271
|
const tableMinWidthWideClassName = "min-w-2xl";
|
|
@@ -11,14 +11,14 @@ const SUPPORTING_CODE_CLASS = "af-supporting-code";
|
|
|
11
11
|
const TEXT_TRUNCATE_CLASS = "af-text-truncate";
|
|
12
12
|
const TEXT_WRAP_CLASS = "af-text-wrap";
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
BODY_CODE_CLASS as B,
|
|
15
15
|
CAPTION_TEXT_CLASS as C,
|
|
16
16
|
DENSE_BODY_TEXT_CLASS as D,
|
|
17
17
|
MUTED_TEXT_CLASS as M,
|
|
18
18
|
PAGE_HEADING_CLASS as P,
|
|
19
19
|
SECTION_HEADING_CLASS as S,
|
|
20
20
|
TEXT_TRUNCATE_CLASS as T,
|
|
21
|
-
|
|
21
|
+
BODY_TEXT_CLASS as a,
|
|
22
22
|
SUPPORTING_CODE_CLASS as b,
|
|
23
23
|
SUPPORTING_LABEL_CLASS as c,
|
|
24
24
|
SUPPORTING_TEXT_CLASS as d,
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { B as Button } from "./button.js";
|
|
4
4
|
import { c as cn } from "./cn.js";
|
|
5
|
-
import {
|
|
5
|
+
import { B as BODY_CODE_CLASS, b as SUPPORTING_CODE_CLASS, P as PAGE_HEADING_CLASS, S as SECTION_HEADING_CLASS, c as SUPPORTING_LABEL_CLASS, D as DENSE_BODY_TEXT_CLASS, C as CAPTION_TEXT_CLASS, M as MUTED_TEXT_CLASS, d as SUPPORTING_TEXT_CLASS, a as BODY_TEXT_CLASS, T as TEXT_TRUNCATE_CLASS, e as TEXT_WRAP_CLASS } from "./typography-roles.js";
|
|
6
6
|
const ButtonLink = forwardRef(
|
|
7
7
|
function ButtonLink2({ children, className, size = "default", tone = "default", ...props }, ref) {
|
|
8
8
|
return /* @__PURE__ */ jsx(Button, { asChild: true, className, size, tone, children: /* @__PURE__ */ jsx("a", { ref, ...props, children }) });
|
|
@@ -1,11 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from "react";
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
3
2
|
import { c as cn } from "./cn.js";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
const WIDGET_FRAME_SECTION_HEADING_CLASS = "text-title-large uppercase text-on-surface";
|
|
5
5
|
const WIDGET_FRAME_BODY_TEXT_CLASS = "text-body-medium text-on-surface-variant";
|
|
6
6
|
const WIDGET_FRAME_SUBTITLE_CLASS = "font-mono text-display-small text-on-surface-variant [overflow-wrap:anywhere]";
|
|
7
7
|
const WIDGET_FRAME_SUPPORTING_LABEL_CLASS = "text-label-medium uppercase text-on-surface-subtle";
|
|
8
8
|
const WIDGET_FRAME_SUPPORTING_LABELS_CLASS = "[&_dt]:text-label-medium [&_dt]:uppercase [&_dt]:text-on-surface-subtle";
|
|
9
|
+
const WIDGET_FRAME_MIN_WIDTH_CLASS = "min-w-0";
|
|
10
|
+
const WIDGET_FRAME_WIDE_BODY_CLASS = "min-h-72";
|
|
11
|
+
const WIDGET_FRAME_RESPONSIVE_SHELL_CLASS = "min-w-0 w-full";
|
|
12
|
+
const WIDGET_FRAME_STORY_SHELL_DATA_ATTR = "data-widget-frame-story-shell";
|
|
13
|
+
const WIDGET_FRAME_OVERFLOW_TOLERANCE_PX = 1;
|
|
14
|
+
const widgetFrameDetailCardClass = cn(
|
|
15
|
+
"[&_dd]:m-0 [&_dl]:m-0 [&_dl]:grid [&_dl]:gap-3 [&_dl_div:first-child]:border-t-0 [&_dl_div:first-child]:pt-0 [&_dl_div]:border-t [&_dl_div]:border-outline [&_dl_div]:pt-3 [&_dt]:mb-1 [&_h3]:mt-0",
|
|
16
|
+
WIDGET_FRAME_SUPPORTING_LABELS_CLASS
|
|
17
|
+
);
|
|
18
|
+
function widgetFrameStoryShellStyle(maxWidth) {
|
|
19
|
+
return {
|
|
20
|
+
style: {
|
|
21
|
+
maxWidth,
|
|
22
|
+
padding: "1rem",
|
|
23
|
+
width: "100%"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function widgetFrameHasNoHorizontalOverflow(element, tolerancePx = WIDGET_FRAME_OVERFLOW_TOLERANCE_PX) {
|
|
28
|
+
return element.scrollWidth <= element.clientWidth + tolerancePx;
|
|
29
|
+
}
|
|
30
|
+
const WIDGET_FRAME_SHELL_CLASS = "flex min-w-0 flex-col rounded-lg border border-outline bg-surface-container-high text-on-surface shadow-af-card";
|
|
31
|
+
const WIDGET_FRAME_SCROLL_CLASS = "overflow-hidden";
|
|
32
|
+
const WIDGET_FRAME_HEADER_CLASS = "relative z-10 flex min-h-13 shrink-0 items-center justify-between gap-3 border-b border-outline bg-surface-container-high px-3.5 py-3";
|
|
33
|
+
const WIDGET_FRAME_HEADER_TOOLS_CLASS = "flex min-w-0 shrink-0 items-center gap-2";
|
|
34
|
+
const WIDGET_FRAME_BODY_SCROLL_CLASS = "min-h-0 flex-1 overflow-auto";
|
|
35
|
+
const WIDGET_FRAME_BODY_CLASS = cn(
|
|
36
|
+
"grid min-h-0 gap-2.5 px-3.5 pt-3.5 pb-4 [&>*]:pb-1 [&_p]:m-0",
|
|
37
|
+
WIDGET_FRAME_BODY_TEXT_CLASS
|
|
38
|
+
);
|
|
39
|
+
function WidgetFrame({
|
|
40
|
+
bodyClassName,
|
|
41
|
+
bodyProps,
|
|
42
|
+
bodyScroll = true,
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
headerAction,
|
|
46
|
+
title,
|
|
47
|
+
wide = false
|
|
48
|
+
}) {
|
|
49
|
+
const cardClassName = cn(
|
|
50
|
+
WIDGET_FRAME_SHELL_CLASS,
|
|
51
|
+
WIDGET_FRAME_MIN_WIDTH_CLASS,
|
|
52
|
+
widgetFrameDetailCardClass,
|
|
53
|
+
wide && WIDGET_FRAME_WIDE_BODY_CLASS,
|
|
54
|
+
bodyScroll && WIDGET_FRAME_SCROLL_CLASS,
|
|
55
|
+
className
|
|
56
|
+
);
|
|
57
|
+
const cardBodyClassName = cn(WIDGET_FRAME_BODY_CLASS, bodyClassName);
|
|
58
|
+
const bodyClassNames = cn(
|
|
59
|
+
"min-h-0 flex-1",
|
|
60
|
+
bodyScroll && WIDGET_FRAME_BODY_SCROLL_CLASS,
|
|
61
|
+
cardBodyClassName
|
|
62
|
+
);
|
|
63
|
+
return /* @__PURE__ */ jsxs("article", { "aria-label": title, className: cardClassName, children: [
|
|
64
|
+
/* @__PURE__ */ jsxs("header", { className: WIDGET_FRAME_HEADER_CLASS, children: [
|
|
65
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx("h3", { className: "m-0 min-w-0 flex-1 text-title-large uppercase text-on-surface [overflow-wrap:anywhere]", children: title }) }),
|
|
66
|
+
/* @__PURE__ */ jsx("div", { className: WIDGET_FRAME_HEADER_TOOLS_CLASS, children: headerAction ?? /* @__PURE__ */ jsx(
|
|
67
|
+
"span",
|
|
68
|
+
{
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
className: "block h-10 w-10 shrink-0",
|
|
71
|
+
"data-widget-frame-header-action-spacer": "true"
|
|
72
|
+
}
|
|
73
|
+
) })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: bodyClassNames, ...bodyProps, children })
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
const WIDGET_SUBTITLE_CLASS = cn("mt-0", WIDGET_FRAME_SUBTITLE_CLASS);
|
|
79
|
+
const DETAIL_COPY_CLASS = cn("m-0", WIDGET_FRAME_BODY_TEXT_CLASS);
|
|
80
|
+
const EMPTY_STATE_CLASS = "grid min-h-60 items-start gap-1.5 rounded-2xl border border-dashed border-outline-variant bg-surface-container-low p-5 [&_h3]:m-0";
|
|
81
|
+
const EMPTY_STATE_COMPACT_CLASS = "min-h-0";
|
|
82
|
+
function WidgetSubtitle({
|
|
83
|
+
as: Component = "p",
|
|
84
|
+
children,
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}) {
|
|
88
|
+
return /* @__PURE__ */ jsx(Component, { className: cn(WIDGET_SUBTITLE_CLASS, className), ...props, children });
|
|
89
|
+
}
|
|
90
|
+
function WidgetDetailCopy({
|
|
91
|
+
children,
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */ jsx("p", { className: cn(DETAIL_COPY_CLASS, className), ...props, children });
|
|
96
|
+
}
|
|
97
|
+
function WidgetEmptyState({
|
|
98
|
+
children,
|
|
99
|
+
className,
|
|
100
|
+
compact = false,
|
|
101
|
+
...props
|
|
102
|
+
}) {
|
|
103
|
+
return /* @__PURE__ */ jsx(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: cn(
|
|
107
|
+
EMPTY_STATE_CLASS,
|
|
108
|
+
compact && EMPTY_STATE_COMPACT_CLASS,
|
|
109
|
+
className
|
|
110
|
+
),
|
|
111
|
+
...props,
|
|
112
|
+
children
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function WidgetEmptyStateTitle({
|
|
117
|
+
as: Component = "h3",
|
|
118
|
+
children,
|
|
119
|
+
className,
|
|
120
|
+
...props
|
|
121
|
+
}) {
|
|
122
|
+
return /* @__PURE__ */ jsx(
|
|
123
|
+
Component,
|
|
124
|
+
{
|
|
125
|
+
className: cn(WIDGET_FRAME_SECTION_HEADING_CLASS, className),
|
|
126
|
+
...props,
|
|
127
|
+
children
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function WidgetEmptyStateText({
|
|
132
|
+
children,
|
|
133
|
+
className,
|
|
134
|
+
...props
|
|
135
|
+
}) {
|
|
136
|
+
return /* @__PURE__ */ jsx(
|
|
137
|
+
"p",
|
|
138
|
+
{
|
|
139
|
+
className: cn("m-0", WIDGET_FRAME_BODY_TEXT_CLASS, className),
|
|
140
|
+
...props,
|
|
141
|
+
children
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
9
145
|
const WIDGET_FRAME_DISCLOSURE_CLASS = "grid min-w-0 gap-2.5";
|
|
10
146
|
const WIDGET_FRAME_DISCLOSURE_TRIGGER_CLASS = cn(
|
|
11
147
|
"inline-flex min-h-9 shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-lg border border-outline bg-surface-container-high px-2.5 py-2 text-on-surface-variant transition hover:border-outline-variant hover:bg-af-overlay hover:text-on-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-af-accent disabled:cursor-not-allowed disabled:border-outline disabled:bg-surface-container-low disabled:text-on-surface-disabled",
|
|
@@ -100,66 +236,6 @@ function WidgetFrameDisclosurePanel({
|
|
|
100
236
|
}
|
|
101
237
|
);
|
|
102
238
|
}
|
|
103
|
-
const WIDGET_SUBTITLE_CLASS = cn("mt-0", WIDGET_FRAME_SUBTITLE_CLASS);
|
|
104
|
-
const DETAIL_COPY_CLASS = cn("m-0", WIDGET_FRAME_BODY_TEXT_CLASS);
|
|
105
|
-
const EMPTY_STATE_CLASS = "grid min-h-60 items-start gap-1.5 rounded-2xl border border-dashed border-outline-variant bg-surface-container-low p-5 [&_h3]:m-0";
|
|
106
|
-
const EMPTY_STATE_COMPACT_CLASS = "min-h-0";
|
|
107
|
-
function WidgetSubtitle({
|
|
108
|
-
as: Component = "p",
|
|
109
|
-
children,
|
|
110
|
-
className,
|
|
111
|
-
...props
|
|
112
|
-
}) {
|
|
113
|
-
return /* @__PURE__ */ jsx(Component, { className: cn(WIDGET_SUBTITLE_CLASS, className), ...props, children });
|
|
114
|
-
}
|
|
115
|
-
function WidgetDetailCopy({
|
|
116
|
-
children,
|
|
117
|
-
className,
|
|
118
|
-
...props
|
|
119
|
-
}) {
|
|
120
|
-
return /* @__PURE__ */ jsx("p", { className: cn(DETAIL_COPY_CLASS, className), ...props, children });
|
|
121
|
-
}
|
|
122
|
-
function WidgetEmptyState({
|
|
123
|
-
children,
|
|
124
|
-
className,
|
|
125
|
-
compact = false,
|
|
126
|
-
...props
|
|
127
|
-
}) {
|
|
128
|
-
return /* @__PURE__ */ jsx(
|
|
129
|
-
"div",
|
|
130
|
-
{
|
|
131
|
-
className: cn(
|
|
132
|
-
EMPTY_STATE_CLASS,
|
|
133
|
-
compact && EMPTY_STATE_COMPACT_CLASS,
|
|
134
|
-
className
|
|
135
|
-
),
|
|
136
|
-
...props,
|
|
137
|
-
children
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
function WidgetEmptyStateTitle({
|
|
142
|
-
as: Component = "h3",
|
|
143
|
-
children,
|
|
144
|
-
className,
|
|
145
|
-
...props
|
|
146
|
-
}) {
|
|
147
|
-
return /* @__PURE__ */ jsx(
|
|
148
|
-
Component,
|
|
149
|
-
{
|
|
150
|
-
className: cn(WIDGET_FRAME_SECTION_HEADING_CLASS, className),
|
|
151
|
-
...props,
|
|
152
|
-
children
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
function WidgetEmptyStateText({
|
|
157
|
-
children,
|
|
158
|
-
className,
|
|
159
|
-
...props
|
|
160
|
-
}) {
|
|
161
|
-
return /* @__PURE__ */ jsx("p", { className: cn("m-0", WIDGET_FRAME_BODY_TEXT_CLASS, className), ...props, children });
|
|
162
|
-
}
|
|
163
239
|
function WidgetFrameSkeleton({
|
|
164
240
|
className,
|
|
165
241
|
...props
|
|
@@ -198,14 +274,7 @@ function WidgetLoadingState({
|
|
|
198
274
|
...props,
|
|
199
275
|
children: [
|
|
200
276
|
children,
|
|
201
|
-
resolvedPlaceholder ? /* @__PURE__ */ jsx(
|
|
202
|
-
"div",
|
|
203
|
-
{
|
|
204
|
-
"aria-hidden": "true",
|
|
205
|
-
className: WIDGET_LOADING_PLACEHOLDER_CLASS,
|
|
206
|
-
children: resolvedPlaceholder
|
|
207
|
-
}
|
|
208
|
-
) : null
|
|
277
|
+
resolvedPlaceholder ? /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: WIDGET_LOADING_PLACEHOLDER_CLASS, children: resolvedPlaceholder }) : null
|
|
209
278
|
]
|
|
210
279
|
}
|
|
211
280
|
);
|
|
@@ -218,7 +287,11 @@ function WidgetErrorState({
|
|
|
218
287
|
return /* @__PURE__ */ jsx(
|
|
219
288
|
"div",
|
|
220
289
|
{
|
|
221
|
-
className: cn(
|
|
290
|
+
className: cn(
|
|
291
|
+
WIDGET_ERROR_STATE_CLASS,
|
|
292
|
+
WIDGET_STATE_PANEL_CLASS,
|
|
293
|
+
className
|
|
294
|
+
),
|
|
222
295
|
role: "alert",
|
|
223
296
|
...props,
|
|
224
297
|
children
|
|
@@ -244,75 +317,6 @@ function WidgetSuccessState({
|
|
|
244
317
|
}
|
|
245
318
|
);
|
|
246
319
|
}
|
|
247
|
-
const WIDGET_FRAME_MIN_WIDTH_CLASS = "min-w-0";
|
|
248
|
-
const WIDGET_FRAME_WIDE_BODY_CLASS = "min-h-72";
|
|
249
|
-
const WIDGET_FRAME_RESPONSIVE_SHELL_CLASS = "min-w-0 w-full";
|
|
250
|
-
const WIDGET_FRAME_STORY_SHELL_DATA_ATTR = "data-widget-frame-story-shell";
|
|
251
|
-
const WIDGET_FRAME_OVERFLOW_TOLERANCE_PX = 1;
|
|
252
|
-
const widgetFrameDetailCardClass = cn(
|
|
253
|
-
"[&_dd]:m-0 [&_dl]:m-0 [&_dl]:grid [&_dl]:gap-3 [&_dl_div:first-child]:border-t-0 [&_dl_div:first-child]:pt-0 [&_dl_div]:border-t [&_dl_div]:border-outline [&_dl_div]:pt-3 [&_dt]:mb-1 [&_h3]:mt-0",
|
|
254
|
-
WIDGET_FRAME_SUPPORTING_LABELS_CLASS
|
|
255
|
-
);
|
|
256
|
-
function widgetFrameStoryShellStyle(maxWidth) {
|
|
257
|
-
return {
|
|
258
|
-
style: {
|
|
259
|
-
maxWidth,
|
|
260
|
-
padding: "1rem",
|
|
261
|
-
width: "100%"
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
function widgetFrameHasNoHorizontalOverflow(element, tolerancePx = WIDGET_FRAME_OVERFLOW_TOLERANCE_PX) {
|
|
266
|
-
return element.scrollWidth <= element.clientWidth + tolerancePx;
|
|
267
|
-
}
|
|
268
|
-
const WIDGET_FRAME_SHELL_CLASS = "flex min-w-0 flex-col rounded-lg border border-outline bg-surface-container-high text-on-surface shadow-af-card";
|
|
269
|
-
const WIDGET_FRAME_SCROLL_CLASS = "overflow-hidden";
|
|
270
|
-
const WIDGET_FRAME_HEADER_CLASS = "relative z-10 flex min-h-13 shrink-0 items-center justify-between gap-3 border-b border-outline bg-surface-container-high px-3.5 py-3";
|
|
271
|
-
const WIDGET_FRAME_HEADER_TOOLS_CLASS = "flex min-w-0 shrink-0 items-center gap-2";
|
|
272
|
-
const WIDGET_FRAME_BODY_SCROLL_CLASS = "min-h-0 flex-1 overflow-auto";
|
|
273
|
-
const WIDGET_FRAME_BODY_CLASS = cn(
|
|
274
|
-
"grid min-h-0 gap-2.5 px-3.5 pt-3.5 pb-4 [&>*]:pb-1 [&_p]:m-0",
|
|
275
|
-
WIDGET_FRAME_BODY_TEXT_CLASS
|
|
276
|
-
);
|
|
277
|
-
function WidgetFrame({
|
|
278
|
-
bodyClassName,
|
|
279
|
-
bodyProps,
|
|
280
|
-
bodyScroll = true,
|
|
281
|
-
children,
|
|
282
|
-
className,
|
|
283
|
-
headerAction,
|
|
284
|
-
title,
|
|
285
|
-
wide = false
|
|
286
|
-
}) {
|
|
287
|
-
const cardClassName = cn(
|
|
288
|
-
WIDGET_FRAME_SHELL_CLASS,
|
|
289
|
-
WIDGET_FRAME_MIN_WIDTH_CLASS,
|
|
290
|
-
widgetFrameDetailCardClass,
|
|
291
|
-
wide && WIDGET_FRAME_WIDE_BODY_CLASS,
|
|
292
|
-
bodyScroll && WIDGET_FRAME_SCROLL_CLASS,
|
|
293
|
-
className
|
|
294
|
-
);
|
|
295
|
-
const cardBodyClassName = cn(WIDGET_FRAME_BODY_CLASS, bodyClassName);
|
|
296
|
-
const bodyClassNames = cn(
|
|
297
|
-
"min-h-0 flex-1",
|
|
298
|
-
bodyScroll && WIDGET_FRAME_BODY_SCROLL_CLASS,
|
|
299
|
-
cardBodyClassName
|
|
300
|
-
);
|
|
301
|
-
return /* @__PURE__ */ jsxs("article", { "aria-label": title, className: cardClassName, children: [
|
|
302
|
-
/* @__PURE__ */ jsxs("header", { className: WIDGET_FRAME_HEADER_CLASS, children: [
|
|
303
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx("h3", { className: "m-0 min-w-0 flex-1 text-title-large uppercase text-on-surface [overflow-wrap:anywhere]", children: title }) }),
|
|
304
|
-
/* @__PURE__ */ jsx("div", { className: WIDGET_FRAME_HEADER_TOOLS_CLASS, children: headerAction ?? /* @__PURE__ */ jsx(
|
|
305
|
-
"span",
|
|
306
|
-
{
|
|
307
|
-
"aria-hidden": "true",
|
|
308
|
-
className: "block h-10 w-10 shrink-0",
|
|
309
|
-
"data-widget-frame-header-action-spacer": "true"
|
|
310
|
-
}
|
|
311
|
-
) })
|
|
312
|
-
] }),
|
|
313
|
-
/* @__PURE__ */ jsx("div", { className: bodyClassNames, ...bodyProps, children })
|
|
314
|
-
] });
|
|
315
|
-
}
|
|
316
320
|
export {
|
|
317
321
|
WIDGET_FRAME_BODY_TEXT_CLASS as W,
|
|
318
322
|
WIDGET_FRAME_MIN_WIDTH_CLASS as a,
|
|
@@ -24,4 +24,4 @@ export interface DataTableProps<Row> {
|
|
|
24
24
|
state?: DataTableState;
|
|
25
25
|
tableClassName?: string;
|
|
26
26
|
}
|
|
27
|
-
export declare function DataTable<Row>({ columns, data, getRowKey, ariaLabel, caption, containerClassName, containerProps, emptyMessage, errorMessage, loadingMessage, rowClassName, size, state, tableClassName, }: DataTableProps<Row>): import("react").JSX.Element;
|
|
27
|
+
export declare function DataTable<Row>({ columns, data, getRowKey, ariaLabel, caption, containerClassName, containerProps, emptyMessage, errorMessage, loadingMessage, rowClassName, size, state, tableClassName, }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** Stable category path for `@you-agent-factory/components/data-display`. */
|
|
2
2
|
export declare const COMPONENTS_CATEGORY: "data-display";
|
|
3
3
|
export type ComponentsCategory = typeof COMPONENTS_CATEGORY;
|
|
4
|
-
export { CodePanel, codePanelVariants } from "./code-panel";
|
|
5
4
|
export type { CodePanelProps } from "./code-panel";
|
|
6
|
-
export {
|
|
7
|
-
export type { DescriptionListProps } from "./description-list";
|
|
8
|
-
export { DataTable } from "./data-table";
|
|
5
|
+
export { CodePanel, codePanelVariants } from "./code-panel";
|
|
9
6
|
export type { DataTableColumn, DataTableProps, DataTableState, } from "./data-table";
|
|
10
|
-
export {
|
|
7
|
+
export { DataTable } from "./data-table";
|
|
8
|
+
export type { DescriptionListProps } from "./description-list";
|
|
9
|
+
export { DescriptionList } from "./description-list";
|
|
11
10
|
export type { TableProps, TableSize } from "./table";
|
|
11
|
+
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from "./table";
|
|
12
12
|
export { tableCellTruncateClassName, tableCellWrapClassName, tableMinWidthWideClassName, tableNarrowContainerClassName, } from "./table-layout";
|