@uisatin/ui 0.3.0 → 0.4.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/CHANGELOG.md +13 -0
- package/{chunk-UZ4DXU6W.js → chunk-3VVO5MY5.js} +4 -4
- package/{chunk-EF5GT4OG.js → chunk-47DDBME3.js} +3 -3
- package/{chunk-JBKBRAC4.js → chunk-5663JVE5.js} +3 -3
- package/chunk-67CBFB6Y.js +99 -0
- package/{chunk-T6L32XXH.js → chunk-6DWLTGRQ.js} +30 -7
- package/{chunk-S7QHBVPX.js → chunk-6GNMUJQ4.js} +3 -3
- package/{chunk-Z7S2KQZS.js → chunk-6JTSZAGO.js} +1 -1
- package/chunk-6RLSRMB5.js +14 -0
- package/{chunk-GI2SMFZL.js → chunk-6Y6CY2DP.js} +1 -1
- package/{chunk-XUOSJMEJ.js → chunk-7NV53EL5.js} +1 -1
- package/{chunk-LFGUJHFF.js → chunk-7SVMERPH.js} +2 -2
- package/chunk-A52HUWVM.js +24 -0
- package/chunk-AKEZCWNW.js +29 -0
- package/{chunk-NH3EHMIL.js → chunk-APRVUOD6.js} +1 -1
- package/{chunk-DPYIBFQD.js → chunk-C435UD7V.js} +4 -3
- package/{chunk-5XTUFBZI.js → chunk-C6WRJ7DG.js} +1 -1
- package/{chunk-X66KTATQ.js → chunk-CQFAMWZI.js} +2 -2
- package/{chunk-YJK4MGSI.js → chunk-DAKVTPYZ.js} +4 -4
- package/{chunk-W472DBMT.js → chunk-DMZW4LGU.js} +3 -3
- package/chunk-EBZHGRM5.js +46 -0
- package/{chunk-O46O6LFQ.js → chunk-EHEXE2UV.js} +20 -1
- package/{chunk-UCCNXGLG.js → chunk-EQAFDIPE.js} +9 -7
- package/{chunk-LB37KTJH.js → chunk-EXKSKYG3.js} +2 -2
- package/chunk-FB6DG3LR.js +35 -0
- package/chunk-GH2DEOGO.js +67 -0
- package/{chunk-J7RMFN54.js → chunk-GKDMCY2S.js} +1 -1
- package/chunk-GTFUAA6H.js +42 -0
- package/{chunk-SAYNV7B3.js → chunk-HI6QIG55.js} +4 -4
- package/{chunk-SDOTDMYG.js → chunk-HZV7EXGU.js} +2 -2
- package/{chunk-RHQHDYTE.js → chunk-IKJIR6VL.js} +2 -2
- package/{chunk-ISYKZCPJ.js → chunk-INJWE2LD.js} +2 -2
- package/chunk-J5UQPROI.js +56 -0
- package/{chunk-5725MFGQ.js → chunk-JCR5TWTF.js} +4 -4
- package/chunk-JKOBDLP3.js +25 -0
- package/{chunk-FAJ3OVL4.js → chunk-JR3VVDV6.js} +1 -1
- package/{chunk-CVNRZ2YV.js → chunk-JYGCZWET.js} +1 -1
- package/{chunk-SPGUZMCC.js → chunk-K5G5OEV5.js} +2 -2
- package/{chunk-GMETYACH.js → chunk-KDU7AT2T.js} +2 -2
- package/chunk-KITXKIYW.js +104 -0
- package/{chunk-JYOZUQNU.js → chunk-KQNA22D3.js} +2 -2
- package/{chunk-OURZQM27.js → chunk-L5PPN42A.js} +11 -4
- package/{chunk-HK6WINL6.js → chunk-LAOE6Y57.js} +3 -3
- package/{chunk-ZBZ3ZQRB.js → chunk-LI5VYDLN.js} +4 -4
- package/{chunk-M2HEVFQ3.js → chunk-LKSFTNPF.js} +1 -1
- package/chunk-LLW3X4ZJ.js +39 -0
- package/{chunk-5KTBSMQU.js → chunk-LWRB4DED.js} +1 -1
- package/{chunk-LB7Z6BSK.js → chunk-M7RILZVW.js} +6 -6
- package/{chunk-674SRBZK.js → chunk-MOGWOUCN.js} +3 -3
- package/chunk-NCIRJ5V2.js +108 -0
- package/{chunk-SSOFFQ5T.js → chunk-NTSU44FY.js} +8 -1
- package/{chunk-BR2B4OIT.js → chunk-P36KBUYD.js} +3 -3
- package/{chunk-3DHJXU45.js → chunk-P6RHT2VM.js} +1 -1
- package/{chunk-WLQD5BN2.js → chunk-PD2KD5OR.js} +1 -1
- package/{chunk-OVKPPXK5.js → chunk-PP46SY7M.js} +2 -2
- package/{chunk-FB5HTCO2.js → chunk-PTK4QAOQ.js} +4 -4
- package/{chunk-IKO3GQFE.js → chunk-Q7KVC5B4.js} +3 -3
- package/{chunk-UUCVRIVP.js → chunk-R3DTMBDT.js} +3 -3
- package/{chunk-UGIVCXGN.js → chunk-R4KPFBMK.js} +1 -1
- package/{chunk-XH56JGYC.js → chunk-R5TQ3HNB.js} +1 -1
- package/chunk-RFSPJECL.js +84 -0
- package/chunk-RPL6FRVX.js +88 -0
- package/{chunk-SZJIVBOD.js → chunk-STYOBAC7.js} +3 -3
- package/{chunk-W4RDTP6W.js → chunk-SVUWR3HD.js} +3 -3
- package/{chunk-7Q76HLRQ.js → chunk-T7P3OEBP.js} +4 -4
- package/{chunk-TT2N5752.js → chunk-TB3ZRV3Y.js} +2 -2
- package/{chunk-BN7FDKCJ.js → chunk-TOY6YPTG.js} +2 -2
- package/{chunk-PHNR6ZQ7.js → chunk-U6X6ODDJ.js} +2 -2
- package/{chunk-6VKV36OK.js → chunk-UAJ6M34K.js} +4 -4
- package/{chunk-PD6YPFYN.js → chunk-W2EH6RY5.js} +1 -1
- package/{chunk-X2GNMNZQ.js → chunk-W2QQQWNE.js} +2 -2
- package/{chunk-JCXI7VQL.js → chunk-WALANB3V.js} +2 -2
- package/{chunk-NL574STL.js → chunk-WCUR44O6.js} +2 -2
- package/{chunk-PUWSL5XW.js → chunk-WJYJMX5S.js} +1 -1
- package/{chunk-AIMQNLPY.js → chunk-WZSLDYUU.js} +6 -29
- package/chunk-XU6JJDMZ.js +117 -0
- package/{chunk-57QEOCDZ.js → chunk-XWPH7C2W.js} +1 -1
- package/{chunk-73Z7NMQQ.js → chunk-YXWXSRXG.js} +5 -5
- package/{chunk-CGOH5IYX.js → chunk-YY236ZSJ.js} +3 -3
- package/components/accordion.js +2 -2
- package/components/action-button.d.ts +37 -0
- package/components/action-button.js +5 -0
- package/components/agent-loading.js +2 -2
- package/components/agent-picker.js +5 -4
- package/components/agent-suggestion.js +5 -5
- package/components/alert.d.ts +37 -0
- package/components/alert.js +5 -0
- package/components/announcement-bar.js +6 -5
- package/components/attachment.js +5 -4
- package/components/avatar.js +4 -4
- package/components/badge.js +2 -2
- package/components/banner.js +5 -3
- package/components/bar-chart.js +9 -9
- package/components/breadcrumb.js +5 -5
- package/components/button-group.d.ts +26 -0
- package/components/button-group.js +5 -0
- package/components/button.d.ts +13 -1
- package/components/button.js +4 -2
- package/components/card.js +5 -3
- package/components/channel-chart.js +9 -9
- package/components/chart.js +8 -8
- package/components/checkbox.js +2 -2
- package/components/chip.js +2 -2
- package/components/citations.js +4 -4
- package/components/code-block.js +5 -3
- package/components/combobox.js +10 -9
- package/components/command-menu.js +5 -5
- package/components/context-menu.js +5 -5
- package/components/cookie-consent.js +5 -3
- package/components/date-picker.js +9 -8
- package/components/decision-card.js +6 -5
- package/components/dialog.d.ts +2 -7
- package/components/dialog.js +6 -4
- package/components/donut-chart.js +9 -9
- package/components/dot.js +2 -2
- package/components/dropdown.js +4 -4
- package/components/empty-state.js +2 -2
- package/components/field-group.d.ts +27 -0
- package/components/field-group.js +3 -0
- package/components/file-upload.js +7 -6
- package/components/form-field.d.ts +38 -1
- package/components/form-field.js +2 -2
- package/components/form.d.ts +47 -0
- package/components/form.js +3 -0
- package/components/hover-card.js +2 -2
- package/components/input-group.d.ts +21 -0
- package/components/input-group.js +6 -0
- package/components/input-otp.js +7 -7
- package/components/input.d.ts +5 -1
- package/components/input.js +3 -3
- package/components/kbd.js +2 -2
- package/components/labels.d.ts +7 -0
- package/components/labels.js +1 -1
- package/components/line-chart.js +10 -10
- package/components/link.d.ts +20 -0
- package/components/link.js +3 -0
- package/components/list.d.ts +46 -0
- package/components/list.js +2 -0
- package/components/message-actions.js +5 -4
- package/components/message.js +8 -7
- package/components/number-input.js +7 -7
- package/components/pagination.js +5 -3
- package/components/password-input.d.ts +16 -0
- package/components/password-input.js +7 -0
- package/components/popover.js +3 -3
- package/components/progress.js +2 -2
- package/components/prompt-bar.js +6 -5
- package/components/radio.js +2 -2
- package/components/search-bar.js +3 -3
- package/components/segmented-control.js +2 -2
- package/components/select.d.ts +2 -1
- package/components/select.js +6 -6
- package/components/selectable-card.d.ts +37 -0
- package/components/selectable-card.js +2 -0
- package/components/selectable-checkbox.d.ts +14 -0
- package/components/selectable-checkbox.js +4 -0
- package/components/selectable-radio.d.ts +16 -0
- package/components/selectable-radio.js +3 -0
- package/components/separator.d.ts +18 -0
- package/components/separator.js +2 -0
- package/components/sheet.js +7 -5
- package/components/sidebar.js +2 -2
- package/components/skeleton.js +2 -2
- package/components/slider.js +7 -7
- package/components/spinner.d.ts +18 -0
- package/components/spinner.js +3 -0
- package/components/split-button.d.ts +24 -0
- package/components/split-button.js +8 -0
- package/components/streaming-text.js +2 -2
- package/components/switch.js +2 -2
- package/components/table.js +4 -4
- package/components/tabs.js +2 -2
- package/components/textarea.js +3 -3
- package/components/thinking.js +3 -3
- package/components/toast.js +5 -4
- package/components/toggle.js +2 -2
- package/components/tooltip.js +3 -3
- package/index.d.ts +16 -2
- package/index.js +79 -64
- package/lib/utils.js +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
- package/chunk-VUOAPWTF.js +0 -86
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFieldChrome, FieldChrome } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
1
|
+
import { useFieldChrome, FieldChrome } from './chunk-EQAFDIPE.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { CheckCircle } from 'iconoir-react';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Input } from './chunk-
|
|
2
|
-
import { TooltipBubble } from './chunk-
|
|
3
|
-
import { useSatinLabels } from './chunk-
|
|
4
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Input } from './chunk-L5PPN42A.js';
|
|
2
|
+
import { TooltipBubble } from './chunk-KDU7AT2T.js';
|
|
3
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
4
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { Slider as Slider$1 } from 'radix-ui';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DropdownMenu, DropdownMenuItem } from './chunk-
|
|
2
|
-
import { useSatinLabels } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
1
|
+
import { DropdownMenu, DropdownMenuItem } from './chunk-P36KBUYD.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { MoreHoriz, NavArrowRight } from 'iconoir-react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { useSatinLabels } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import { HoverCard } from 'radix-ui';
|
|
6
6
|
import { Xmark, ArrowUpRight, NavArrowUp, NavArrowDown } from 'iconoir-react';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useFormContext, RequiredMark, FieldDescription, FormContext, FieldError } from './chunk-KITXKIYW.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var columnClass = { 1: "", 2: "sa:sm:grid-cols-2", 3: "sa:sm:grid-cols-3" };
|
|
7
|
+
function FieldGroup({
|
|
8
|
+
legend,
|
|
9
|
+
description,
|
|
10
|
+
error: ownError,
|
|
11
|
+
name,
|
|
12
|
+
required,
|
|
13
|
+
variant = "fields",
|
|
14
|
+
columns = 1,
|
|
15
|
+
layout: ownLayout,
|
|
16
|
+
disabled: ownDisabled,
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
const form = useFormContext();
|
|
22
|
+
const id = React.useId();
|
|
23
|
+
const error = ownError ?? (name ? form?.errors?.[name] : void 0);
|
|
24
|
+
const layout = ownLayout ?? form?.layout ?? "vertical";
|
|
25
|
+
const disabled = ownDisabled ?? form?.disabled;
|
|
26
|
+
const invalid = Boolean(error);
|
|
27
|
+
const horizontal = layout === "horizontal";
|
|
28
|
+
const choices = variant === "choices";
|
|
29
|
+
const descriptionId = description ? `${id}-description` : void 0;
|
|
30
|
+
const errorId = invalid ? `${id}-error` : void 0;
|
|
31
|
+
const inner = React.useMemo(
|
|
32
|
+
() => ({ ...form, layout: "vertical", disabled }),
|
|
33
|
+
[form, disabled]
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
36
|
+
"fieldset",
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "field-group",
|
|
39
|
+
"data-variant": variant,
|
|
40
|
+
"data-layout": layout,
|
|
41
|
+
"data-invalid": invalid || void 0,
|
|
42
|
+
disabled,
|
|
43
|
+
"aria-describedby": [descriptionId, errorId].filter(Boolean).join(" ") || void 0,
|
|
44
|
+
className: cn("sa:m-0 sa:min-w-0 sa:border-0 sa:p-0", className),
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxs(
|
|
48
|
+
"legend",
|
|
49
|
+
{
|
|
50
|
+
className: cn(
|
|
51
|
+
"sa:float-left sa:p-0 sa:text-text-default",
|
|
52
|
+
horizontal ? "sa:w-40" : "sa:w-full",
|
|
53
|
+
choices ? "sa:text-sm sa:leading-[18px] sa:font-medium" : "sa:text-base sa:font-medium",
|
|
54
|
+
disabled && "sa:opacity-50"
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:flex sa:items-start sa:gap-0.5", children: [
|
|
58
|
+
legend,
|
|
59
|
+
required && /* @__PURE__ */ jsx(RequiredMark, {})
|
|
60
|
+
] }),
|
|
61
|
+
description && /* @__PURE__ */ jsx(FieldDescription, { id: descriptionId, className: "sa:mt-1 sa:font-normal", children: description })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsxs(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: cn(
|
|
69
|
+
"sa:grid sa:min-w-0",
|
|
70
|
+
horizontal ? "sa:ml-46" : cn("sa:clear-both", choices ? "sa:pt-2" : "sa:pt-4"),
|
|
71
|
+
choices ? "sa:gap-3" : cn("sa:gap-5", columnClass[columns])
|
|
72
|
+
),
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(FormContext.Provider, { value: inner, children }),
|
|
75
|
+
invalid && /* @__PURE__ */ jsx(FieldError, { id: errorId, className: cn(columns > 1 && "sa:sm:col-span-full"), children: error })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { FieldGroup };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var soft = {
|
|
8
|
+
neutral: "sa:bg-status-neutral-bg",
|
|
9
|
+
info: "sa:bg-status-sky-bg",
|
|
10
|
+
success: "sa:bg-status-green-bg",
|
|
11
|
+
warning: "sa:bg-status-amber-bg",
|
|
12
|
+
error: "sa:bg-status-red-bg"
|
|
13
|
+
};
|
|
14
|
+
var iconColor = {
|
|
15
|
+
neutral: "sa:text-status-neutral-fg",
|
|
16
|
+
info: "sa:text-status-sky-fg",
|
|
17
|
+
success: "sa:text-status-green-fg",
|
|
18
|
+
warning: "sa:text-status-amber-fg",
|
|
19
|
+
error: "sa:text-status-red-fg"
|
|
20
|
+
};
|
|
21
|
+
function Alert({
|
|
22
|
+
intent = "neutral",
|
|
23
|
+
variant = "soft",
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
icon = true,
|
|
27
|
+
action,
|
|
28
|
+
onDismiss,
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
const labels = useSatinLabels();
|
|
34
|
+
const body = description ?? children;
|
|
35
|
+
const actionBelow = action && body;
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
role: intent === "error" || intent === "warning" ? "alert" : "status",
|
|
40
|
+
"data-slot": "alert",
|
|
41
|
+
"data-intent": intent,
|
|
42
|
+
"data-variant": variant,
|
|
43
|
+
className: cn(
|
|
44
|
+
"sa:flex sa:w-full sa:items-start sa:gap-2.5 sa:rounded-xl sa:px-4 sa:py-3",
|
|
45
|
+
variant === "soft" ? soft[intent] : "sa:border sa:border-border-default sa:bg-bg-card sa:[box-shadow:0_1px_2px_0_var(--effect-shadow-xs)]",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
...props,
|
|
49
|
+
children: [
|
|
50
|
+
icon !== false && // 16px on the middle of the title's 20px line.
|
|
51
|
+
/* @__PURE__ */ jsx("span", { className: cn("sa:mt-0.5 sa:grid sa:shrink-0 sa:place-items-center sa:[&_svg]:size-4", iconColor[intent]), children: icon === true ? /* @__PURE__ */ jsx(StatusIcon, { intent }) : icon }),
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:flex-col", children: [
|
|
53
|
+
title && /* @__PURE__ */ jsx("p", { className: "sa:text-base sa:leading-5 sa:font-medium sa:text-text-default", children: title }),
|
|
54
|
+
body && /* @__PURE__ */ jsx("div", { className: "sa:text-body sa:text-text-muted", children: body }),
|
|
55
|
+
actionBelow && /* @__PURE__ */ jsx("div", { className: "sa:mt-2.5 sa:flex sa:flex-wrap sa:items-center sa:gap-2", children: action })
|
|
56
|
+
] }),
|
|
57
|
+
action && !actionBelow && /* @__PURE__ */ jsx("div", { className: "sa:-my-1 sa:flex sa:shrink-0 sa:items-center sa:gap-2", children: action }),
|
|
58
|
+
onDismiss && /* @__PURE__ */ jsx(Button, { variant: "tertiary", size: "xs", iconOnly: true, "aria-label": labels.dismiss, onClick: onDismiss, className: "sa:-my-0.5 sa:-mr-1.5", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function StatusIcon({ intent }) {
|
|
64
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, className: "sa:shrink-0", children: /* @__PURE__ */ jsx("g", { stroke: "currentColor", style: { strokeWidth: 1.25 }, strokeLinecap: "round", strokeLinejoin: "round", children: intent === "success" ? /* @__PURE__ */ jsx("path", { d: "M3.33333 8.66667L6 11.3333L12.6667 4.66667" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
65
|
+
intent === "info" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M8 7.70494V10.6557" }),
|
|
67
|
+
/* @__PURE__ */ jsx("path", { d: "M8 5.35022L8.0059 5.34366" })
|
|
68
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx("path", { d: "M8 5.34428V8.29506" }),
|
|
70
|
+
/* @__PURE__ */ jsx("path", { d: "M8 10.6563L8.0059 10.6498" })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsx("path", { d: "M8 13.9015C11.2593 13.9015 13.9015 11.2593 13.9015 8C13.9015 4.74066 11.2593 2.09845 8 2.09845C4.74066 2.09845 2.09845 4.74066 2.09845 8C2.09845 11.2593 4.74066 13.9015 8 13.9015Z" })
|
|
73
|
+
] }) }) });
|
|
74
|
+
}
|
|
75
|
+
function CloseIcon() {
|
|
76
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx(
|
|
77
|
+
"path",
|
|
78
|
+
{
|
|
79
|
+
d: "M4.50551 11.4951L8.0006 8M8.0006 8L11.4957 4.50491M8.0006 8L4.50551 4.50491M8.0006 8L11.4957 11.4951",
|
|
80
|
+
stroke: "currentColor",
|
|
81
|
+
strokeWidth: "1.25",
|
|
82
|
+
strokeLinecap: "round",
|
|
83
|
+
strokeLinejoin: "round"
|
|
84
|
+
}
|
|
85
|
+
) });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { Alert, CloseIcon, StatusIcon };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { useSatinLabels } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { Clock, DoubleCheck, ThumbsUp, ThumbsDown, Copy, Link } from 'iconoir-react';
|
|
6
6
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Checkbox } from './chunk-
|
|
2
|
-
import { useSatinLabels } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Checkbox } from './chunk-W2QQQWNE.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Progress } from './chunk-
|
|
2
|
-
import { Badge } from './chunk-
|
|
3
|
-
import { useSatinLabels } from './chunk-
|
|
4
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Progress } from './chunk-LKSFTNPF.js';
|
|
2
|
+
import { Badge } from './chunk-7NV53EL5.js';
|
|
3
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
4
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ArrowRight } from 'iconoir-react';
|
|
7
7
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useSlidingIndicator, SLIDE_MS } from './chunk-XETMIETJ.js';
|
|
2
|
-
import { Button } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
2
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { NavArrowLeft, NavArrowRight } from 'iconoir-react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tooltip, TooltipBubble } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Tooltip, TooltipBubble } from './chunk-KDU7AT2T.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { Xmark } from 'iconoir-react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useFieldChrome, FieldChrome, Select } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
3
|
-
import { useSatinLabels } from './chunk-
|
|
4
|
-
import { cn } from './chunk-
|
|
1
|
+
import { useFieldChrome, FieldChrome, Select } from './chunk-EQAFDIPE.js';
|
|
2
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
3
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
4
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { Popover } from 'radix-ui';
|
|
7
7
|
import { Calendar as Calendar$1, NavArrowDown, NavArrowLeft, NavArrowRight } from 'iconoir-react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Checkbox as Checkbox$1 } from 'radix-ui';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -40,7 +40,7 @@ function Checkbox({ className, label, description, placement = "left", id, ...pr
|
|
|
40
40
|
className: cn("sa:flex sa:cursor-pointer sa:items-start sa:gap-2 sa:has-disabled:cursor-not-allowed sa:has-data-disabled:cursor-not-allowed sa:[&>:first-child]:mt-0.5", placement === "right" && "sa:flex-row-reverse sa:justify-between"),
|
|
41
41
|
children: [
|
|
42
42
|
box,
|
|
43
|
-
/* @__PURE__ */ jsxs("div", { className: "sa:grid sa:gap-0.5 sa:text-base", children: [
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:grid sa:gap-0.5 sa:text-base sa:peer-disabled:*:text-text-subtle", children: [
|
|
44
44
|
label && /* @__PURE__ */ jsx("span", { id: labelId, className: "sa:block sa:leading-5 sa:font-medium sa:text-text-default", children: label }),
|
|
45
45
|
description && /* @__PURE__ */ jsx("span", { id: descriptionId, className: "sa:block sa:leading-5 sa:text-text-muted", children: description })
|
|
46
46
|
] })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChartCard, ChartTooltip, defaultFormat, ChartLegendRow } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
1
|
+
import { ChartCard, ChartTooltip, defaultFormat, ChartLegendRow } from './chunk-LI5VYDLN.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FlappySprite, TetrisStill } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
1
|
+
import { FlappySprite, TetrisStill } from './chunk-R4KPFBMK.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { NavArrowDown, Check, EditPencil } from 'iconoir-react';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CloseIcon, StatusIcon } from './chunk-RPL6FRVX.js';
|
|
2
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
3
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
4
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
import { Dialog as Dialog$1 } from 'radix-ui';
|
|
6
|
-
import {
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
|
-
function CloseIcon() {
|
|
9
|
-
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx(
|
|
10
|
-
"path",
|
|
11
|
-
{
|
|
12
|
-
d: "M4.50551 11.4951L8.0006 8M8.0006 8L11.4957 4.50491M8.0006 8L4.50551 4.50491M8.0006 8L11.4957 11.4951",
|
|
13
|
-
stroke: "currentColor",
|
|
14
|
-
strokeWidth: "1.25",
|
|
15
|
-
strokeLinecap: "round",
|
|
16
|
-
strokeLinejoin: "round"
|
|
17
|
-
}
|
|
18
|
-
) });
|
|
19
|
-
}
|
|
20
9
|
function Dialog({
|
|
21
10
|
open,
|
|
22
11
|
defaultOpen,
|
|
@@ -107,18 +96,6 @@ var alertTint = {
|
|
|
107
96
|
warning: "sa:bg-status-amber-bg sa:text-status-amber-fg",
|
|
108
97
|
error: "sa:bg-status-red-bg sa:text-status-red-fg"
|
|
109
98
|
};
|
|
110
|
-
function StatusIcon({ intent }) {
|
|
111
|
-
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, className: "sa:shrink-0", children: /* @__PURE__ */ jsx("g", { stroke: "currentColor", style: { strokeWidth: 1.25 }, strokeLinecap: "round", strokeLinejoin: "round", children: intent === "success" ? /* @__PURE__ */ jsx("path", { d: "M3.33333 8.66667L6 11.3333L12.6667 4.66667" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
|
-
intent === "info" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
113
|
-
/* @__PURE__ */ jsx("path", { d: "M8 7.70494V10.6557" }),
|
|
114
|
-
/* @__PURE__ */ jsx("path", { d: "M8 5.35022L8.0059 5.34366" })
|
|
115
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
116
|
-
/* @__PURE__ */ jsx("path", { d: "M8 5.34428V8.29506" }),
|
|
117
|
-
/* @__PURE__ */ jsx("path", { d: "M8 10.6563L8.0059 10.6498" })
|
|
118
|
-
] }),
|
|
119
|
-
/* @__PURE__ */ jsx("path", { d: "M8 13.9015C11.2593 13.9015 13.9015 11.2593 13.9015 8C13.9015 4.74066 11.2593 2.09845 8 2.09845C4.74066 2.09845 2.09845 4.74066 2.09845 8C2.09845 11.2593 4.74066 13.9015 8 13.9015Z" })
|
|
120
|
-
] }) }) });
|
|
121
|
-
}
|
|
122
99
|
function DialogAlert({
|
|
123
100
|
intent = "info",
|
|
124
101
|
title,
|
|
@@ -151,4 +128,4 @@ function DialogAlert({
|
|
|
151
128
|
);
|
|
152
129
|
}
|
|
153
130
|
|
|
154
|
-
export {
|
|
131
|
+
export { Dialog, DialogAlert, DialogClose };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
2
|
+
import { Spinner } from './chunk-AKEZCWNW.js';
|
|
3
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
4
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
9
|
+
function ActionButton({
|
|
10
|
+
onAction,
|
|
11
|
+
state: controlled,
|
|
12
|
+
onStateChange,
|
|
13
|
+
onError,
|
|
14
|
+
minLoading = 900,
|
|
15
|
+
resetAfter = 1800,
|
|
16
|
+
trailingIcon,
|
|
17
|
+
onClick,
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
const labels = useSatinLabels();
|
|
23
|
+
const [own, setOwn] = React.useState("idle");
|
|
24
|
+
const state = controlled ?? own;
|
|
25
|
+
const alive = React.useRef(true);
|
|
26
|
+
const reset = React.useRef(void 0);
|
|
27
|
+
const busy = React.useRef(false);
|
|
28
|
+
const [round, setRound] = React.useState(0);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
alive.current = true;
|
|
31
|
+
return () => {
|
|
32
|
+
alive.current = false;
|
|
33
|
+
clearTimeout(reset.current);
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
const set = (next) => {
|
|
37
|
+
if (!alive.current) return;
|
|
38
|
+
if (controlled === void 0) setOwn(next);
|
|
39
|
+
if (next === "success") setRound((r) => r + 1);
|
|
40
|
+
onStateChange?.(next);
|
|
41
|
+
};
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
if (state === "idle") busy.current = false;
|
|
44
|
+
}, [state]);
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (controlled === "success") setRound((r) => r + 1);
|
|
47
|
+
}, [controlled]);
|
|
48
|
+
const run = async (event) => {
|
|
49
|
+
onClick?.(event);
|
|
50
|
+
if (state !== "idle" || busy.current || event.defaultPrevented) return;
|
|
51
|
+
busy.current = true;
|
|
52
|
+
set("loading");
|
|
53
|
+
const started = Date.now();
|
|
54
|
+
try {
|
|
55
|
+
await onAction?.(event);
|
|
56
|
+
await wait(Math.max(0, minLoading - (Date.now() - started)));
|
|
57
|
+
set("success");
|
|
58
|
+
if (resetAfter !== null)
|
|
59
|
+
reset.current = setTimeout(() => {
|
|
60
|
+
busy.current = false;
|
|
61
|
+
set("idle");
|
|
62
|
+
}, resetAfter);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
busy.current = false;
|
|
65
|
+
set("idle");
|
|
66
|
+
if (onError) onError(error);
|
|
67
|
+
else throw error;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const layer = "sa:transition-opacity sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)";
|
|
71
|
+
const icon = trailingIcon === void 0 ? (
|
|
72
|
+
// Iconoir's ArrowRight, drawn here so the button needs no icon package.
|
|
73
|
+
/* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M3 12H21M21 12L14 5M21 12L14 19", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
74
|
+
) : trailingIcon;
|
|
75
|
+
const spinner = /* @__PURE__ */ jsx(Spinner, { size: props.size === "xs" ? "sm" : "md", label: null });
|
|
76
|
+
const check = round > 0 && /* @__PURE__ */ jsx("svg", { "data-slot": "action-button-check", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx(
|
|
77
|
+
"path",
|
|
78
|
+
{
|
|
79
|
+
d: "M3.33333 8.66667L6 11.3333L12.6667 4.66667",
|
|
80
|
+
pathLength: 1,
|
|
81
|
+
stroke: "currentColor",
|
|
82
|
+
strokeLinecap: "round",
|
|
83
|
+
strokeLinejoin: "round",
|
|
84
|
+
style: { strokeWidth: 1.5 }
|
|
85
|
+
}
|
|
86
|
+
) }, round);
|
|
87
|
+
const show = (on) => cn("sa:grid sa:place-items-center", layer, !on && "sa:opacity-0");
|
|
88
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
Button,
|
|
91
|
+
{
|
|
92
|
+
...props,
|
|
93
|
+
"data-slot": "action-button",
|
|
94
|
+
"data-state": state,
|
|
95
|
+
"aria-busy": state === "loading" || void 0,
|
|
96
|
+
"aria-disabled": state !== "idle" || props["aria-disabled"] || void 0,
|
|
97
|
+
className: cn("sa:relative", state !== "idle" && "sa:cursor-default", className),
|
|
98
|
+
onClick: run,
|
|
99
|
+
children: icon !== null ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
children ?? labels.submit,
|
|
101
|
+
/* @__PURE__ */ jsxs("span", { "data-slot": "action-button-icon", className: "sa:grid sa:shrink-0 sa:place-items-center sa:*:col-start-1 sa:*:row-start-1", children: [
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: show(state === "idle"), children: icon }),
|
|
103
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: show(state === "loading"), children: spinner }),
|
|
104
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: show(state === "success"), children: check })
|
|
105
|
+
] })
|
|
106
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
|
+
/* @__PURE__ */ jsx("span", { className: cn("sa:inline-flex sa:items-center", layer, state !== "idle" && "sa:opacity-0"), children: children ?? labels.submit }),
|
|
108
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("sa:absolute sa:inset-0", show(state === "loading")), children: spinner }),
|
|
109
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("sa:absolute sa:inset-0", show(state === "success")), children: check })
|
|
110
|
+
] })
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "sa:sr-only", "aria-live": "polite", children: state === "success" ? labels.done : "" })
|
|
114
|
+
] });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export { ActionButton };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FileIcon, Attachment } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useSatinLabels } from './chunk-
|
|
5
|
-
import { cn } from './chunk-
|
|
1
|
+
import { FileIcon, Attachment } from './chunk-R3DTMBDT.js';
|
|
2
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
3
|
+
import { Progress } from './chunk-LKSFTNPF.js';
|
|
4
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
5
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { Page, WarningCircle, Xmark } from 'iconoir-react';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { useSatinLabels } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
1
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { Toast as Toast$1 } from 'radix-ui';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
package/components/accordion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use client';export { Accordion, AccordionItem } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
'use client';export { Accordion, AccordionItem } from '../chunk-6Y6CY2DP.js';
|
|
2
|
+
import '../chunk-EHEXE2UV.js';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ButtonProps } from './button.js';
|
|
3
|
+
/**
|
|
4
|
+
* ActionButton: a Button that runs something and shows how it went, in place. Three states:
|
|
5
|
+
*
|
|
6
|
+
* 1. idle: the label ("Submit" by default) with an arrow on the right;
|
|
7
|
+
* 2. loading: from the click until `onAction`'s promise settles (at least `minLoading`, so a
|
|
8
|
+
* fast answer still reads as work), a Spinner in the arrow's place;
|
|
9
|
+
* 3. success: in the same place, a checkmark that draws itself in, held for `resetAfter` ms,
|
|
10
|
+
* then the arrow comes back.
|
|
11
|
+
*
|
|
12
|
+
* The label stays as it is; only the icon slot changes, its three layers stacked on one 16px
|
|
13
|
+
* cell and cross-fading (150ms), so the button never changes width. With `trailingIcon={null}`
|
|
14
|
+
* there is no slot: the spinner and checkmark take the middle and the label keeps its room. If the promise rejects, the button goes straight back to idle and the
|
|
15
|
+
* error is the app's to show (an Alert, a toast). While busy or done, clicks do nothing; focus
|
|
16
|
+
* stays on the button and screen readers hear `aria-busy`, then "Done" (`done` in SatinLabels).
|
|
17
|
+
*
|
|
18
|
+
* Pass `state` to drive it yourself (a form library's submitting flag, a server push) instead.
|
|
19
|
+
*/
|
|
20
|
+
export type ActionButtonState = 'idle' | 'loading' | 'success';
|
|
21
|
+
export interface ActionButtonProps extends Omit<ButtonProps, 'loading' | 'onClick' | 'iconOnly' | 'asChild'> {
|
|
22
|
+
/** Runs on click. The spinner stays until its promise settles. */
|
|
23
|
+
onAction?: (event: React.MouseEvent<HTMLButtonElement>) => Promise<unknown> | unknown;
|
|
24
|
+
/** Drive the state from outside instead. */
|
|
25
|
+
state?: ActionButtonState;
|
|
26
|
+
onStateChange?: (state: ActionButtonState) => void;
|
|
27
|
+
/** Shortest time the spinner shows, in ms. */
|
|
28
|
+
minLoading?: number;
|
|
29
|
+
/** How long the checkmark stays before the button is ready again, in ms; `null` keeps it. */
|
|
30
|
+
resetAfter?: number | null;
|
|
31
|
+
/** Called when `onAction` rejects; without it the error is rethrown. */
|
|
32
|
+
onError?: (error: unknown) => void;
|
|
33
|
+
/** The icon after the label; `null` for none. Defaults to an arrow. */
|
|
34
|
+
trailingIcon?: React.ReactNode;
|
|
35
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
36
|
+
}
|
|
37
|
+
export declare function ActionButton({ onAction, state: controlled, onStateChange, onError, minLoading, resetAfter, trailingIcon, onClick, children, className, ...props }: ActionButtonProps): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use client';export { AgentLoading, FlappySprite, ShimmerLabel, TetrisLabel, TetrisMark, TetrisStill } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
'use client';export { AgentLoading, FlappySprite, ShimmerLabel, TetrisLabel, TetrisMark, TetrisStill } from '../chunk-R4KPFBMK.js';
|
|
2
|
+
import '../chunk-EHEXE2UV.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
'use client';export { AgentAvatar, AgentMenuItem, AgentPicker, AgentPickerRow } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
'use client';export { AgentAvatar, AgentMenuItem, AgentPicker, AgentPickerRow } from '../chunk-DMZW4LGU.js';
|
|
2
|
+
import '../chunk-6DWLTGRQ.js';
|
|
3
|
+
import '../chunk-AKEZCWNW.js';
|
|
4
|
+
import '../chunk-NTSU44FY.js';
|
|
5
|
+
import '../chunk-EHEXE2UV.js';
|