@godxjp/ui 18.15.4 → 19.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/app-provider.d.ts +1 -1
- package/dist/app/app-provider.js +3 -0
- package/dist/app/date-format-labels.d.ts +1 -1
- package/dist/app/time-format-labels.d.ts +1 -1
- package/dist/components/data-display/badge.d.ts +1 -1
- package/dist/components/data-display/card.d.ts +4 -13
- package/dist/components/data-display/card.js +2 -15
- package/dist/components/data-display/data-table.d.ts +3 -8
- package/dist/components/data-display/data-table.js +106 -68
- package/dist/components/data-display/descriptions.js +34 -5
- package/dist/components/data-display/empty-state.js +1 -1
- package/dist/components/data-display/permission-matrix.js +7 -7
- package/dist/components/data-display/popover.js +2 -9
- package/dist/components/data-display/qr-code.d.ts +1 -1
- package/dist/components/data-display/scroll-area.d.ts +3 -1
- package/dist/components/data-display/scroll-area.js +150 -16
- package/dist/components/data-display/table.js +12 -3
- package/dist/components/data-entry/branch-scope-picker.js +4 -4
- package/dist/components/data-entry/calendar.js +15 -24
- package/dist/components/data-entry/cascader.js +70 -72
- package/dist/components/data-entry/checkbox-group.js +12 -5
- package/dist/components/data-entry/checkbox.js +30 -13
- package/dist/components/data-entry/command.d.ts +6 -6
- package/dist/components/data-entry/date-picker.js +34 -17
- package/dist/components/data-entry/date-range-picker.js +19 -13
- package/dist/components/data-entry/form-field.d.ts +1 -1
- package/dist/components/data-entry/form-field.js +22 -5
- package/dist/components/data-entry/index.d.ts +2 -1
- package/dist/components/data-entry/input.js +18 -22
- package/dist/components/data-entry/label.js +4 -2
- package/dist/components/data-entry/month-picker.js +20 -17
- package/dist/components/data-entry/month-range-picker.js +26 -19
- package/dist/components/data-entry/radio.js +25 -6
- package/dist/components/data-entry/search-select.d.ts +1 -1
- package/dist/components/data-entry/search-select.js +37 -31
- package/dist/components/data-entry/select.d.ts +8 -0
- package/dist/components/data-entry/select.js +68 -26
- package/dist/components/data-entry/switch.js +16 -2
- package/dist/components/data-entry/textarea.d.ts +56 -0
- package/dist/components/data-entry/textarea.js +110 -40
- package/dist/components/data-entry/time-picker.js +52 -52
- package/dist/components/data-entry/toggle-group.d.ts +1 -0
- package/dist/components/data-entry/toggle.d.ts +1 -1
- package/dist/components/data-entry/transfer.js +14 -15
- package/dist/components/data-entry/tree-select.js +19 -23
- package/dist/components/data-entry/upload-crop-dialog.js +4 -4
- package/dist/components/data-entry/upload.d.ts +1 -1
- package/dist/components/data-entry/upload.js +46 -46
- package/dist/components/feedback/alert.js +7 -14
- package/dist/components/feedback/dialog.d.ts +23 -32
- package/dist/components/feedback/dialog.js +16 -13
- package/dist/components/feedback/sheet.d.ts +1 -1
- package/dist/components/feedback/sheet.js +14 -14
- package/dist/components/feedback/skeleton.js +13 -10
- package/dist/components/feedback/sonner.d.ts +1 -1
- package/dist/components/feedback/sonner.js +17 -8
- package/dist/components/feedback/tooltip.js +1 -1
- package/dist/components/general/activity.d.ts +44 -0
- package/dist/components/general/activity.js +65 -0
- package/dist/components/general/button.d.ts +2 -2
- package/dist/components/general/button.js +11 -24
- package/dist/components/general/index.d.ts +2 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/layout/app-shell.js +5 -3
- package/dist/components/layout/auth-divider.d.ts +9 -2
- package/dist/components/layout/auth-divider.js +7 -11
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/page-container.d.ts +1 -1
- package/dist/components/layout/page-container.js +32 -20
- package/dist/components/layout/resizable.d.ts +12 -12
- package/dist/components/layout/separator.d.ts +1 -0
- package/dist/components/layout/service-role-panel.js +47 -42
- package/dist/components/layout/sidebar.js +13 -1
- package/dist/components/layout/split-pane.d.ts +12 -1
- package/dist/components/layout/split-pane.js +13 -4
- package/dist/components/navigation/app-setting-picker.js +5 -14
- package/dist/components/navigation/dropdown-menu.js +10 -16
- package/dist/components/navigation/menubar.d.ts +3 -6
- package/dist/components/navigation/pagination-utils.d.ts +15 -2
- package/dist/components/navigation/pagination-utils.js +27 -21
- package/dist/components/navigation/pagination.d.ts +4 -4
- package/dist/components/navigation/pagination.js +2 -2
- package/dist/components/navigation/steps.js +31 -67
- package/dist/components/navigation/tabs.js +17 -5
- package/dist/components/query/infinite-query-state.js +2 -2
- package/dist/components/ui/accordion.d.ts +1 -1
- package/dist/components/ui/avatar.d.ts +1 -1
- package/dist/components/ui/avatar.js +29 -10
- package/dist/components/ui/input-otp.d.ts +8 -6
- package/dist/components/ui/rating.js +1 -1
- package/dist/components/ui/separator.d.ts +27 -2
- package/dist/components/ui/separator.js +42 -11
- package/dist/components/ui/toggle-group.d.ts +15 -5
- package/dist/components/ui/toggle-group.js +43 -18
- package/dist/components/ui/toggle.d.ts +66 -5
- package/dist/components/ui/toggle.js +64 -9
- package/dist/i18n/messages/en.json +8 -0
- package/dist/i18n/messages/ja.json +8 -0
- package/dist/i18n/messages/vi.json +8 -0
- package/dist/lib/control-styles.d.ts +14 -0
- package/dist/lib/control-styles.js +2 -0
- package/dist/lib/field-a11y.d.ts +52 -0
- package/dist/lib/field-a11y.js +17 -2
- package/dist/props/components/app.prop.d.ts +15 -0
- package/dist/props/components/data-display.prop.d.ts +85 -3
- package/dist/props/components/data-entry.prop.d.ts +35 -2
- package/dist/props/components/general.prop.d.ts +52 -1
- package/dist/props/components/layout.prop.d.ts +137 -2
- package/dist/props/registry.d.ts +116 -5
- package/dist/props/registry.js +165 -4
- package/dist/props/vocabulary/index.d.ts +2 -2
- package/dist/props/vocabulary/interaction.prop.d.ts +15 -0
- package/dist/props/vocabulary/layout.prop.d.ts +8 -0
- package/dist/styles/alert-layout.css +69 -3
- package/dist/styles/badge-layout.css +2 -2
- package/dist/styles/base.css +6 -0
- package/dist/styles/card-layout.css +25 -8
- package/dist/styles/control.css +1150 -29
- package/dist/styles/data-display-layout.css +185 -11
- package/dist/styles/data-entry-layout.css +352 -1
- package/dist/styles/density.css +2 -2
- package/dist/styles/dialog-layout.css +203 -4
- package/dist/styles/focus-ring.css +155 -0
- package/dist/styles/form-layout.css +50 -5
- package/dist/styles/index.css +1 -0
- package/dist/styles/layout.css +412 -23
- package/dist/styles/motion.css +178 -0
- package/dist/styles/navigation-layout.css +398 -22
- package/dist/styles/shell-layout.css +137 -39
- package/dist/styles/table-layout.css +153 -22
- package/dist/styles/toggle.css +59 -0
- package/dist/tokens/base.css +5 -0
- package/dist/tokens/components/activity.css +64 -0
- package/dist/tokens/components/badge.css +7 -0
- package/dist/tokens/components/card.css +14 -10
- package/dist/tokens/components/chart.css +1 -1
- package/dist/tokens/components/control.css +358 -8
- package/dist/tokens/components/data-display.css +75 -0
- package/dist/tokens/components/data-entry.css +25 -0
- package/dist/tokens/components/descriptions.css +22 -0
- package/dist/tokens/components/feedback.css +143 -4
- package/dist/tokens/components/form.css +16 -0
- package/dist/tokens/components/legal-document.css +5 -1
- package/dist/tokens/components/navigation.css +109 -0
- package/dist/tokens/components/scroll-area.css +21 -0
- package/dist/tokens/components/separator.css +52 -0
- package/dist/tokens/components/shell.css +132 -20
- package/dist/tokens/components/table.css +52 -3
- package/dist/tokens/components/toggle.css +82 -0
- package/dist/tokens/components/upload.css +107 -0
- package/dist/tokens/foundation.css +171 -10
- package/dist/tokens/semantic/layout.css +120 -1
- package/package.json +85 -68
- package/scripts/ui-audit.mjs +51 -2
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from "lucide-react";
|
|
13
13
|
import { useTranslation } from "../../i18n/use-translation.js";
|
|
14
14
|
import { humanError } from "../../lib/format.js";
|
|
15
|
-
import { cn } from "../../lib/utils.js";
|
|
16
15
|
import { Flex } from "../layout/flex.js";
|
|
17
16
|
import { Button } from "../general/button.js";
|
|
18
17
|
const AlertContext = React.createContext("default");
|
|
@@ -52,9 +51,9 @@ const AlertBase = React.forwardRef(
|
|
|
52
51
|
void onDismiss();
|
|
53
52
|
},
|
|
54
53
|
"data-slot": "alert-dismiss",
|
|
55
|
-
className: "
|
|
54
|
+
className: "ui-focus-ring",
|
|
56
55
|
"aria-label": t("feedback.alert.dismiss"),
|
|
57
|
-
children: /* @__PURE__ */ jsx(X, { className: "
|
|
56
|
+
children: /* @__PURE__ */ jsx(X, { className: "ui-alert-dismiss-icon", "aria-hidden": "true" })
|
|
58
57
|
}
|
|
59
58
|
)
|
|
60
59
|
]
|
|
@@ -71,15 +70,9 @@ const AlertTitle = React.forwardRef(
|
|
|
71
70
|
);
|
|
72
71
|
AlertTitle.displayName = "AlertTitle";
|
|
73
72
|
const AlertContent = React.forwardRef(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ref,
|
|
78
|
-
"data-slot": "alert-content",
|
|
79
|
-
className: cn("min-w-0 flex-1", className),
|
|
80
|
-
...props
|
|
81
|
-
}
|
|
82
|
-
)
|
|
73
|
+
// `min-w-0 flex-1` moved to alert-layout.css [data-slot="alert-content"] — same box, but a
|
|
74
|
+
// consumer className now overrides it from the utilities layer instead of tying with it.
|
|
75
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "alert-content", className, ...props })
|
|
83
76
|
);
|
|
84
77
|
AlertContent.displayName = "AlertContent";
|
|
85
78
|
const AlertDescription = React.forwardRef(
|
|
@@ -110,7 +103,7 @@ function RetryButton({ onRetry }) {
|
|
|
110
103
|
void onRetry();
|
|
111
104
|
},
|
|
112
105
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "row", wrap: true, align: "center", gap: "xs", children: [
|
|
113
|
-
/* @__PURE__ */ jsx(RefreshCw, {
|
|
106
|
+
/* @__PURE__ */ jsx(RefreshCw, { "aria-hidden": "true" }),
|
|
114
107
|
t("common.retry")
|
|
115
108
|
] })
|
|
116
109
|
}
|
|
@@ -144,7 +137,7 @@ function AlertQueryError({
|
|
|
144
137
|
void onAuthAction();
|
|
145
138
|
},
|
|
146
139
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "row", wrap: true, align: "center", gap: "xs", children: [
|
|
147
|
-
/* @__PURE__ */ jsx(LogIn, {
|
|
140
|
+
/* @__PURE__ */ jsx(LogIn, { "aria-hidden": "true" }),
|
|
148
141
|
t("query.error.action.signIn")
|
|
149
142
|
] })
|
|
150
143
|
}
|
|
@@ -21,18 +21,18 @@ interface DialogHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
|
21
21
|
extra?: React.ReactNode;
|
|
22
22
|
tone?: ToneProp;
|
|
23
23
|
}
|
|
24
|
-
declare
|
|
25
|
-
|
|
26
|
-
displayName: string;
|
|
27
|
-
}
|
|
28
|
-
declare
|
|
29
|
-
|
|
30
|
-
displayName: string;
|
|
31
|
-
}
|
|
32
|
-
declare
|
|
33
|
-
|
|
34
|
-
displayName: string;
|
|
35
|
-
}
|
|
24
|
+
declare function DialogHeader({ className, title, subtitle, extra, tone, children, ...props }: DialogHeaderProps): React.JSX.Element;
|
|
25
|
+
declare namespace DialogHeader {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
declare function DialogBody({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
29
|
+
declare namespace DialogBody {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
33
|
+
declare namespace DialogFooter {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
36
|
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
37
37
|
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
38
38
|
type AlertDialogRootProps = React.ComponentProps<typeof AlertDialogPrimitive.Root> & {};
|
|
@@ -55,14 +55,14 @@ declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDial
|
|
|
55
55
|
showClose?: boolean;
|
|
56
56
|
showCloseButton?: boolean;
|
|
57
57
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
58
|
-
declare
|
|
59
|
-
|
|
60
|
-
displayName: string;
|
|
61
|
-
}
|
|
62
|
-
declare
|
|
63
|
-
|
|
64
|
-
displayName: string;
|
|
65
|
-
}
|
|
58
|
+
declare function AlertDialogHeader({ className, title, subtitle, extra, tone, children, ...props }: DialogHeaderProps): React.JSX.Element;
|
|
59
|
+
declare namespace AlertDialogHeader {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
62
|
+
declare function AlertDialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
63
|
+
declare namespace AlertDialogFooter {
|
|
64
|
+
var displayName: string;
|
|
65
|
+
}
|
|
66
66
|
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
67
67
|
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
68
68
|
/** Confirm mode — primary action (maps to Radix AlertDialogAction). */
|
|
@@ -89,18 +89,9 @@ export declare const Dialog: typeof DialogRoot & {
|
|
|
89
89
|
showCloseButton?: boolean;
|
|
90
90
|
overlayClassName?: string;
|
|
91
91
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
92
|
-
Header:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
};
|
|
96
|
-
Body: {
|
|
97
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
98
|
-
displayName: string;
|
|
99
|
-
};
|
|
100
|
-
Footer: {
|
|
101
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
102
|
-
displayName: string;
|
|
103
|
-
};
|
|
92
|
+
Header: typeof DialogHeader;
|
|
93
|
+
Body: typeof DialogBody;
|
|
94
|
+
Footer: typeof DialogFooter;
|
|
104
95
|
Title: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
105
96
|
Description: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
106
97
|
Close: typeof DialogClose;
|
|
@@ -65,9 +65,9 @@ const DialogContent = React.forwardRef(
|
|
|
65
65
|
DialogPrimitive.Close,
|
|
66
66
|
{
|
|
67
67
|
"data-slot": "dialog-close",
|
|
68
|
-
className: "
|
|
68
|
+
className: "ui-focus-ring transition-opacity focus:outline-hidden disabled:pointer-events-none",
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */ jsx(X, { className: "
|
|
70
|
+
/* @__PURE__ */ jsx(X, { className: "ui-dialog-close-icon", "aria-hidden": "true" }),
|
|
71
71
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t("feedback.alert.dismiss") })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
@@ -95,12 +95,14 @@ const DialogHeader = ({
|
|
|
95
95
|
"data-tone": tone,
|
|
96
96
|
className: cn(overlayHeaderToneClass[tone], className),
|
|
97
97
|
...props,
|
|
98
|
-
children: children ??
|
|
99
|
-
|
|
98
|
+
children: children ?? // Chrome rhythm lives in dialog-layout.css (`.ui-dialog-*`, mirroring `.ui-sheet-*`), so
|
|
99
|
+
// the two overlay siblings retune from one --dialog-*/--sheet-* set instead of literals.
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-dialog-title-row", children: [
|
|
101
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-dialog-title-block", children: [
|
|
100
102
|
title != null && /* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
101
103
|
subtitle != null && /* @__PURE__ */ jsx(DialogDescription, { children: subtitle })
|
|
102
104
|
] }),
|
|
103
|
-
extra != null && /* @__PURE__ */ jsx("div", { className: "
|
|
105
|
+
extra != null && /* @__PURE__ */ jsx("div", { className: "ui-dialog-extra", children: extra })
|
|
104
106
|
] })
|
|
105
107
|
}
|
|
106
108
|
);
|
|
@@ -169,9 +171,10 @@ const AlertDialogContent = React.forwardRef(({ className, children, showClose, s
|
|
|
169
171
|
"button",
|
|
170
172
|
{
|
|
171
173
|
type: "button",
|
|
172
|
-
|
|
174
|
+
"data-slot": "dialog-close",
|
|
175
|
+
className: "ui-focus-ring transition-opacity focus:outline-hidden disabled:pointer-events-none",
|
|
173
176
|
"aria-label": t("feedback.alert.dismiss"),
|
|
174
|
-
children: /* @__PURE__ */ jsx(X, { className: "
|
|
177
|
+
children: /* @__PURE__ */ jsx(X, { className: "ui-dialog-close-icon", "aria-hidden": "true" })
|
|
175
178
|
}
|
|
176
179
|
) }) : null
|
|
177
180
|
]
|
|
@@ -195,12 +198,12 @@ const AlertDialogHeader = ({
|
|
|
195
198
|
"data-tone": tone,
|
|
196
199
|
className: cn(overlayHeaderToneClass[tone], className),
|
|
197
200
|
...props,
|
|
198
|
-
children: children ?? /* @__PURE__ */ jsxs("div", { className: "
|
|
199
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
201
|
+
children: children ?? /* @__PURE__ */ jsxs("div", { className: "ui-dialog-title-row", children: [
|
|
202
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-dialog-title-block", children: [
|
|
200
203
|
title != null && /* @__PURE__ */ jsx(AlertDialogTitle, { children: title }),
|
|
201
204
|
subtitle != null && /* @__PURE__ */ jsx(AlertDialogDescription, { children: subtitle })
|
|
202
205
|
] }),
|
|
203
|
-
extra != null && /* @__PURE__ */ jsx("div", { className: "
|
|
206
|
+
extra != null && /* @__PURE__ */ jsx("div", { className: "ui-dialog-extra", children: extra })
|
|
204
207
|
] })
|
|
205
208
|
}
|
|
206
209
|
);
|
|
@@ -289,7 +292,7 @@ function AlertDialog({
|
|
|
289
292
|
if (stepUp) {
|
|
290
293
|
setStepUpFailed(false);
|
|
291
294
|
setVerifying(true);
|
|
292
|
-
let ok
|
|
295
|
+
let ok;
|
|
293
296
|
try {
|
|
294
297
|
ok = await stepUp();
|
|
295
298
|
} catch {
|
|
@@ -324,7 +327,7 @@ function AlertDialog({
|
|
|
324
327
|
description ? /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, { "data-slot": "dialog-description", children: description }) : null
|
|
325
328
|
] }),
|
|
326
329
|
needsPhrase && /* @__PURE__ */ jsxs("div", { className: "ui-stack-xs", children: [
|
|
327
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: inputId,
|
|
330
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: inputId, children: t("common.typeToConfirm", { phrase }) }),
|
|
328
331
|
/* @__PURE__ */ jsx(
|
|
329
332
|
Input,
|
|
330
333
|
{
|
|
@@ -341,7 +344,7 @@ function AlertDialog({
|
|
|
341
344
|
}
|
|
342
345
|
)
|
|
343
346
|
] }),
|
|
344
|
-
stepUpFailed && /* @__PURE__ */ jsx("p", { id: stepErrorId, role: "alert", className: "
|
|
347
|
+
stepUpFailed && /* @__PURE__ */ jsx("p", { id: stepErrorId, role: "alert", className: "ui-dialog-step-up-error", children: t("feedback.alert.stepUpFailed") }),
|
|
345
348
|
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
346
349
|
/* @__PURE__ */ jsx(DialogCancel, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", disabled: busy, children: resolvedCancel }) }),
|
|
347
350
|
/* @__PURE__ */ jsx(
|
|
@@ -21,7 +21,7 @@ export declare function SheetClose(props: React.ComponentProps<typeof DialogPrim
|
|
|
21
21
|
export declare function SheetPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
22
22
|
export declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
23
|
declare const sheetVariants: (props?: ({
|
|
24
|
-
side?: "
|
|
24
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
25
25
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
26
26
|
export interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
27
27
|
showCloseButton?: boolean;
|
|
@@ -56,7 +56,7 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
56
56
|
className: cn(
|
|
57
57
|
// Scrim colour comes from the shared --overlay-background token (see dialog-layout.css),
|
|
58
58
|
// so a service tints every overlay's backdrop from one knob instead of a baked bg-black/50.
|
|
59
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed
|
|
59
|
+
"ui-sheet-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed",
|
|
60
60
|
className
|
|
61
61
|
),
|
|
62
62
|
...props
|
|
@@ -64,7 +64,7 @@ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
64
64
|
));
|
|
65
65
|
SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
66
66
|
const sheetVariants = cva(
|
|
67
|
-
"fixed
|
|
67
|
+
"ui-sheet-panel fixed flex flex-col gap-[var(--space-chrome-gap)] bg-background px-[var(--sheet-pad-x)] py-[var(--sheet-pad-y)] transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
|
|
68
68
|
{
|
|
69
69
|
variants: {
|
|
70
70
|
// `side` is a deliberately PHYSICAL API (left/right/top/bottom) — a sheet
|
|
@@ -75,8 +75,8 @@ const sheetVariants = cva(
|
|
|
75
75
|
right: "inset-y-0 right-0 h-full w-[min(var(--sheet-width-default),100%)] max-w-none border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
|
|
76
76
|
/* rtl-ignore: named physical side */
|
|
77
77
|
left: "inset-y-0 left-0 h-full w-[min(var(--sheet-width-default),100%)] max-w-none border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
|
|
78
|
-
top: "inset-x-0
|
|
79
|
-
bottom: "inset-x-0
|
|
78
|
+
top: "inset-x-0 h-auto data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
79
|
+
bottom: "inset-x-0 h-auto data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
defaultVariants: { side: "right" }
|
|
@@ -127,9 +127,9 @@ const SheetContent = React.forwardRef(
|
|
|
127
127
|
DialogPrimitive.Close,
|
|
128
128
|
{
|
|
129
129
|
"data-slot": "sheet-close",
|
|
130
|
-
className: "ring-offset-background focus:ring-ring
|
|
130
|
+
className: "ui-sheet-close ring-offset-background focus:ring-ring focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */ jsx(X, { className: "
|
|
132
|
+
/* @__PURE__ */ jsx(X, { className: "ui-sheet-close-icon", "aria-hidden": "true" }),
|
|
133
133
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t("feedback.alert.dismiss") })
|
|
134
134
|
]
|
|
135
135
|
}
|
|
@@ -156,18 +156,18 @@ const SheetHeader = ({
|
|
|
156
156
|
"data-slot": "sheet-header",
|
|
157
157
|
"data-tone": tone,
|
|
158
158
|
className: cn(
|
|
159
|
-
"-mx-[var(--sheet-pad-x)] -mt-[var(--sheet-pad-y)]
|
|
159
|
+
"ui-sheet-header -mx-[var(--sheet-pad-x)] -mt-[var(--sheet-pad-y)] px-[var(--sheet-pad-x)] py-[var(--sheet-pad-y)]",
|
|
160
160
|
overlayHeaderToneClass[tone],
|
|
161
161
|
className
|
|
162
162
|
),
|
|
163
163
|
...props,
|
|
164
164
|
children: children ?? // `pe-8` reserves room for the absolute close button (end-4) so title/extra never sit under it.
|
|
165
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
166
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
165
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-sheet-title-row", children: [
|
|
166
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-sheet-title-block", children: [
|
|
167
167
|
title != null && /* @__PURE__ */ jsx(SheetTitle, { children: title }),
|
|
168
168
|
subtitle != null && /* @__PURE__ */ jsx(SheetDescription, { children: subtitle })
|
|
169
169
|
] }),
|
|
170
|
-
extra != null && /* @__PURE__ */ jsx("div", { className: "
|
|
170
|
+
extra != null && /* @__PURE__ */ jsx("div", { className: "ui-sheet-extra", children: extra })
|
|
171
171
|
] })
|
|
172
172
|
}
|
|
173
173
|
);
|
|
@@ -183,7 +183,7 @@ const SheetBody = ({ className, ...props }) => (
|
|
|
183
183
|
{
|
|
184
184
|
"data-slot": "sheet-body",
|
|
185
185
|
className: cn(
|
|
186
|
-
"-mx-[var(--sheet-pad-x)]
|
|
186
|
+
"ui-sheet-body-space -mx-[var(--sheet-pad-x)] flex-1 overflow-y-auto px-[var(--sheet-pad-x)]",
|
|
187
187
|
className
|
|
188
188
|
),
|
|
189
189
|
...props
|
|
@@ -201,7 +201,7 @@ const SheetFooter = ({ className, ...props }) => (
|
|
|
201
201
|
{
|
|
202
202
|
"data-slot": "sheet-footer",
|
|
203
203
|
className: cn(
|
|
204
|
-
"-mx-[var(--sheet-pad-x)] mt-auto -mb-[var(--sheet-pad-y)]
|
|
204
|
+
"ui-sheet-footer-row -mx-[var(--sheet-pad-x)] mt-auto -mb-[var(--sheet-pad-y)] px-[var(--sheet-pad-x)] py-[var(--sheet-pad-y)]",
|
|
205
205
|
className
|
|
206
206
|
),
|
|
207
207
|
...props
|
|
@@ -213,7 +213,7 @@ const SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
213
213
|
{
|
|
214
214
|
ref,
|
|
215
215
|
"data-slot": "sheet-title",
|
|
216
|
-
className: cn("
|
|
216
|
+
className: cn("ui-sheet-title", className),
|
|
217
217
|
...props
|
|
218
218
|
}
|
|
219
219
|
));
|
|
@@ -223,7 +223,7 @@ const SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
223
223
|
{
|
|
224
224
|
ref,
|
|
225
225
|
"data-slot": "sheet-description",
|
|
226
|
-
className: cn("
|
|
226
|
+
className: cn("ui-sheet-description", className),
|
|
227
227
|
...props
|
|
228
228
|
}
|
|
229
229
|
));
|
|
@@ -16,19 +16,22 @@ function SkeletonRows({ rows = 6, columns = 4, className }) {
|
|
|
16
16
|
return /* @__PURE__ */ jsx("div", { className: cn("ui-skeleton-rows", className), "aria-busy": "true", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx("div", { className: "ui-skeleton-row", children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ jsx(
|
|
17
17
|
Skeleton,
|
|
18
18
|
{
|
|
19
|
-
className: cn(
|
|
19
|
+
className: cn(
|
|
20
|
+
"ui-skeleton-line",
|
|
21
|
+
j === 0 ? "w-1/4" : j === columns - 1 ? "w-1/6" : "flex-1"
|
|
22
|
+
)
|
|
20
23
|
},
|
|
21
24
|
j
|
|
22
25
|
)) }, i)) });
|
|
23
26
|
}
|
|
24
27
|
function SkeletonTable({ rows = 8, columns = 5 }) {
|
|
25
28
|
return /* @__PURE__ */ jsxs("div", { className: "ui-skeleton-table", "aria-busy": "true", children: [
|
|
26
|
-
/* @__PURE__ */ jsx("div", { className: cn("ui-skeleton-table-head", tableCellPaddingClass, tableRowHeightClass), children: Array.from({ length: columns }).map((_, j) => /* @__PURE__ */ jsx(Skeleton, { className: cn("
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: cn("ui-skeleton-table-head", tableCellPaddingClass, tableRowHeightClass), children: Array.from({ length: columns }).map((_, j) => /* @__PURE__ */ jsx(Skeleton, { className: cn("ui-skeleton-caption", j === 0 ? "w-1/5" : "flex-1") }, j)) }),
|
|
27
30
|
/* @__PURE__ */ jsx("div", { className: "ui-skeleton-table-body", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx(
|
|
28
31
|
"div",
|
|
29
32
|
{
|
|
30
33
|
className: cn("ui-skeleton-table-row", tableCellPaddingClass, tableRowHeightClass),
|
|
31
|
-
children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ jsx(Skeleton, { className: cn("
|
|
34
|
+
children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ jsx(Skeleton, { className: cn("ui-skeleton-line", j === 0 ? "w-1/5" : "flex-1") }, j))
|
|
32
35
|
},
|
|
33
36
|
i
|
|
34
37
|
)) })
|
|
@@ -36,19 +39,19 @@ function SkeletonTable({ rows = 8, columns = 5 }) {
|
|
|
36
39
|
}
|
|
37
40
|
function SkeletonDetail() {
|
|
38
41
|
return /* @__PURE__ */ jsxs("div", { className: "ui-skeleton-detail ui-skeleton-detail-stack", "aria-busy": "true", children: [
|
|
39
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
40
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
42
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "ui-skeleton-title w-1/3" }),
|
|
43
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "ui-skeleton-line w-1/2" }),
|
|
41
44
|
/* @__PURE__ */ jsx("div", { className: "ui-skeleton-detail-box ui-skeleton-detail-stack", children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxs("div", { className: "ui-skeleton-detail-stack", children: [
|
|
42
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
43
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
45
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "ui-skeleton-detail-label" }),
|
|
46
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "ui-skeleton-detail-value" })
|
|
44
47
|
] }, i)) })
|
|
45
48
|
] });
|
|
46
49
|
}
|
|
47
50
|
function SkeletonStat() {
|
|
48
51
|
return /* @__PURE__ */ jsxs("div", { className: "ui-skeleton-stat", "aria-busy": "true", children: [
|
|
49
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
50
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
51
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
52
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "ui-skeleton-detail-label" }),
|
|
53
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "ui-skeleton-stat-value" }),
|
|
54
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "ui-skeleton-stat-caption" })
|
|
52
55
|
] });
|
|
53
56
|
}
|
|
54
57
|
export {
|
|
@@ -20,7 +20,7 @@ function useDocumentTheme() {
|
|
|
20
20
|
() => "light"
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
function Toaster({ ...props }) {
|
|
23
|
+
function Toaster({ style, ...props }) {
|
|
24
24
|
const theme = useDocumentTheme();
|
|
25
25
|
return /* @__PURE__ */ jsx(
|
|
26
26
|
Sonner,
|
|
@@ -28,11 +28,11 @@ function Toaster({ ...props }) {
|
|
|
28
28
|
theme,
|
|
29
29
|
className: "toaster group",
|
|
30
30
|
icons: {
|
|
31
|
-
success: /* @__PURE__ */ jsx(CheckCircle2, { className: "
|
|
32
|
-
info: /* @__PURE__ */ jsx(Info, { className: "
|
|
33
|
-
warning: /* @__PURE__ */ jsx(TriangleAlert, { className: "
|
|
34
|
-
error: /* @__PURE__ */ jsx(OctagonX, { className: "
|
|
35
|
-
loading: /* @__PURE__ */ jsx(Loader2, { className: "
|
|
31
|
+
success: /* @__PURE__ */ jsx(CheckCircle2, { className: "ui-toast-icon", "aria-hidden": "true" }),
|
|
32
|
+
info: /* @__PURE__ */ jsx(Info, { className: "ui-toast-icon", "aria-hidden": "true" }),
|
|
33
|
+
warning: /* @__PURE__ */ jsx(TriangleAlert, { className: "ui-toast-icon", "aria-hidden": "true" }),
|
|
34
|
+
error: /* @__PURE__ */ jsx(OctagonX, { className: "ui-toast-icon", "aria-hidden": "true" }),
|
|
35
|
+
loading: /* @__PURE__ */ jsx(Loader2, { className: "ui-toast-icon animate-spin", "aria-hidden": "true" })
|
|
36
36
|
},
|
|
37
37
|
style: {
|
|
38
38
|
// Color tokens are raw HSL triplets (consumed as hsl(var(--token)));
|
|
@@ -42,10 +42,19 @@ function Toaster({ ...props }) {
|
|
|
42
42
|
"--normal-bg": "hsl(var(--popover))",
|
|
43
43
|
"--normal-text": "hsl(var(--popover-foreground))",
|
|
44
44
|
"--normal-border": "hsl(var(--border))",
|
|
45
|
-
"--border-radius": "var(--radius)"
|
|
45
|
+
"--border-radius": "var(--radius)",
|
|
46
|
+
// MERGED, never spread over. `style` used to arrive with the rest of `{...props}` AFTER
|
|
47
|
+
// this object, so a consumer passing ANY style (a z-index, a width) replaced the whole
|
|
48
|
+
// object and wiped all four vars — and an unset `--normal-bg` renders the toast
|
|
49
|
+
// transparent. Merging keeps the surface intact and still lets a consumer override one
|
|
50
|
+
// var by name.
|
|
51
|
+
...style
|
|
46
52
|
},
|
|
47
53
|
position: "bottom-right",
|
|
48
|
-
mobileOffset: {
|
|
54
|
+
mobileOffset: {
|
|
55
|
+
bottom: "var(--toast-mobile-offset)",
|
|
56
|
+
right: "var(--toast-mobile-offset)"
|
|
57
|
+
},
|
|
49
58
|
...props
|
|
50
59
|
}
|
|
51
60
|
);
|
|
@@ -23,7 +23,7 @@ const TooltipContent = React.forwardRef(({ className, sideOffset = 6, children,
|
|
|
23
23
|
"data-slot": "tooltip-content",
|
|
24
24
|
sideOffset,
|
|
25
25
|
className: cn(
|
|
26
|
-
"
|
|
26
|
+
"ui-tooltip-content",
|
|
27
27
|
"data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0",
|
|
28
28
|
"data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1",
|
|
29
29
|
"data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { SizeProp } from "../../props/vocabulary/index.js";
|
|
3
|
+
export type { ActivityProp, ActivityProp as ActivityProps, } from "../../props/components/general.prop.js";
|
|
4
|
+
/**
|
|
5
|
+
* Activity — the official AMBIENT-motion primitive: a continuous, unbounded "something is happening
|
|
6
|
+
* right now, elsewhere". The LOOP counterpart to `Reveal`'s one-shot entrance, so a consumer never
|
|
7
|
+
* hand-rolls a looping `@keyframes` + its own `prefers-reduced-motion` guard. Every interval,
|
|
8
|
+
* stagger, offset, size and colour reads a DS token (`--activity-interval`,
|
|
9
|
+
* `--activity-stagger-step`, `--activity-mark-offset`, `--activity-color`, …), so a service retunes
|
|
10
|
+
* the whole ambient feel from its theme.
|
|
11
|
+
*
|
|
12
|
+
* NOT `Skeleton` (content is LOADING — it hard-codes `aria-busy` + an unconditional live region, so
|
|
13
|
+
* reusing it for a typing indicator tells every screen reader the region is busy for as long as
|
|
14
|
+
* anyone is typing). NOT `Button loading` (THIS ACTION is in flight, on a control).
|
|
15
|
+
* `Activity` means: someone is typing, a sync is running, a response is streaming, a recording is
|
|
16
|
+
* live — indefinitely, and not here.
|
|
17
|
+
*
|
|
18
|
+
* ACCESSIBILITY — the half consumers get wrong, owned here:
|
|
19
|
+
* - The mark is decorative and always `aria-hidden`; the `label` (or `children`) carries the
|
|
20
|
+
* meaning, so the indicator is never animation-only.
|
|
21
|
+
* - `announce` defaults to `false` and then emits NO live region at all. An ambient indicator
|
|
22
|
+
* flickers on and off with every socket event; a live region there re-announces continuously.
|
|
23
|
+
* `announce="polite"` wraps ONLY the label in one `aria-live="polite" aria-atomic="true"` region.
|
|
24
|
+
* - No `aria-busy`: activity elsewhere does not make THIS region busy, and `aria-busy` would
|
|
25
|
+
* suppress the surrounding content's own updates.
|
|
26
|
+
* - Not focusable, not a tab stop, no pointer affordance — it is a status mark, not a control.
|
|
27
|
+
* - Under `prefers-reduced-motion: reduce` the loop is dropped and every mark falls back to a
|
|
28
|
+
* DESIGNED resting state (three solid dots / a solid pulse mark / a bar segment parked at the
|
|
29
|
+
* reading-start), never to nothing, with no layout shift (WCAG 2.2 SC 2.3.3 and SC 2.2.2).
|
|
30
|
+
*
|
|
31
|
+
* Copy is consumer-owned and localized — pass a `t()`-translated `label`, and derive
|
|
32
|
+
* "N people are typing" from `Intl.PluralRules`. The library never invents the string.
|
|
33
|
+
*
|
|
34
|
+
* Pure/server-safe: no hooks, no effects, no timers — the loop is CSS.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Activity: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLSpanElement>, "color"> & {
|
|
37
|
+
variant?: import("../../props/index.js").ActivityVariantProp;
|
|
38
|
+
size?: SizeProp;
|
|
39
|
+
tone?: import("../../props/index.js").TextToneProp;
|
|
40
|
+
label?: import("../../props/index.js").LabelProp;
|
|
41
|
+
children?: import("../../props/index.js").ChildrenProp;
|
|
42
|
+
announce?: import("../../props/index.js").ActivityAnnounceProp;
|
|
43
|
+
className?: import("../../props/index.js").ClassNameProp;
|
|
44
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { Text } from "./typography.js";
|
|
5
|
+
const LABEL_SIZE = {
|
|
6
|
+
xs: "2xs",
|
|
7
|
+
sm: "xs",
|
|
8
|
+
md: "sm",
|
|
9
|
+
lg: "lg"
|
|
10
|
+
};
|
|
11
|
+
function ActivityMark({ variant }) {
|
|
12
|
+
if (variant === "pulse") return /* @__PURE__ */ jsx("span", { className: "ui-activity-pulse" });
|
|
13
|
+
if (variant === "bar") {
|
|
14
|
+
return /* @__PURE__ */ jsx("span", { className: "ui-activity-bar", children: /* @__PURE__ */ jsx("span", { className: "ui-activity-bar-segment" }) });
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", { className: "ui-activity-dot" }),
|
|
18
|
+
/* @__PURE__ */ jsx("span", { className: "ui-activity-dot" }),
|
|
19
|
+
/* @__PURE__ */ jsx("span", { className: "ui-activity-dot" })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
const Activity = React.forwardRef(function Activity2({
|
|
23
|
+
variant = "dots",
|
|
24
|
+
size = "sm",
|
|
25
|
+
tone = "muted",
|
|
26
|
+
label,
|
|
27
|
+
announce = false,
|
|
28
|
+
children,
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}, ref) {
|
|
32
|
+
const hasChildren = children !== void 0 && children !== null && children !== false;
|
|
33
|
+
const visible = hasChildren ? children : label;
|
|
34
|
+
const describedOnly = hasChildren && label !== void 0 && label !== null ? label : void 0;
|
|
35
|
+
const text = visible === void 0 || visible === null ? null : /* @__PURE__ */ jsx(Text, { as: "span", size: LABEL_SIZE[size], tone, className: "ui-activity-label", children: visible });
|
|
36
|
+
const description = describedOnly === void 0 ? null : /* @__PURE__ */ jsx("span", { "data-slot": "activity-description", className: "sr-only", children: describedOnly });
|
|
37
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
+
text,
|
|
39
|
+
description
|
|
40
|
+
] });
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
"data-slot": "activity",
|
|
46
|
+
"data-variant": variant,
|
|
47
|
+
"data-size": size,
|
|
48
|
+
"data-tone": tone,
|
|
49
|
+
className: cn("ui-activity", className),
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: "ui-activity-mark", "data-slot": "activity-mark", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ActivityMark, { variant }) }),
|
|
53
|
+
announce === "polite" ? (
|
|
54
|
+
// The region wraps ONLY the label and is atomic, so a change is announced once as a whole.
|
|
55
|
+
// It is rendered even while empty so a label that arrives later is heard — an inserted
|
|
56
|
+
// region is not reliably announced. The mark stays outside it.
|
|
57
|
+
/* @__PURE__ */ jsx("span", { "aria-live": "polite", "aria-atomic": "true", "data-slot": "activity-live", children: body })
|
|
58
|
+
) : body
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
Activity
|
|
65
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
declare const buttonVariants: (props?: ({
|
|
3
|
-
variant?: "
|
|
4
|
-
size?: "default" | "
|
|
3
|
+
variant?: "dashed" | "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
4
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "md" | "sm" | "xs" | null | undefined;
|
|
5
5
|
shape?: "default" | "pill" | "sharp" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type { ButtonProp, ButtonProp as ButtonProps } from "../../props/components/general.prop.js";
|