@uisatin/ui 0.3.0 → 0.5.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 +19 -0
- package/{chunk-NQL6SIIB.js → chunk-2643HEXD.js} +1 -1
- 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.d.ts +3 -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 +80 -65
- package/lib/utils.js +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
- package/theme/create-theme.d.ts +2 -1
- package/theme/index.js +1 -1
- package/chunk-VUOAPWTF.js +0 -86
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { FormContext, FieldDescription, useFormContext } from './chunk-KITXKIYW.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function formValues(form) {
|
|
7
|
+
const values = {};
|
|
8
|
+
for (const [key, value] of new FormData(form)) {
|
|
9
|
+
const prev = values[key];
|
|
10
|
+
values[key] = prev === void 0 ? value : Array.isArray(prev) ? [...prev, value] : [prev, value];
|
|
11
|
+
}
|
|
12
|
+
return values;
|
|
13
|
+
}
|
|
14
|
+
var hasErrors = (errors) => !!errors && Object.values(errors).some(Boolean);
|
|
15
|
+
function Form({
|
|
16
|
+
layout = "vertical",
|
|
17
|
+
errors,
|
|
18
|
+
disabled,
|
|
19
|
+
onSubmit,
|
|
20
|
+
onSubmitValues,
|
|
21
|
+
noValidate = true,
|
|
22
|
+
className,
|
|
23
|
+
children,
|
|
24
|
+
ref,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
const formRef = React.useRef(null);
|
|
28
|
+
const [submits, setSubmits] = React.useState(0);
|
|
29
|
+
const context = React.useMemo(() => ({ layout, disabled, errors }), [layout, disabled, errors]);
|
|
30
|
+
const hadErrors = React.useRef(false);
|
|
31
|
+
const lastSubmit = React.useRef(0);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
const now = hasErrors(errors);
|
|
34
|
+
const submitted = submits !== lastSubmit.current;
|
|
35
|
+
if (now && (submitted || !hadErrors.current)) {
|
|
36
|
+
const first = formRef.current?.querySelector('[aria-invalid="true"]');
|
|
37
|
+
if (submits > 0) first?.focus();
|
|
38
|
+
}
|
|
39
|
+
hadErrors.current = now;
|
|
40
|
+
lastSubmit.current = submits;
|
|
41
|
+
}, [errors, submits]);
|
|
42
|
+
const setRefs = (node) => {
|
|
43
|
+
formRef.current = node;
|
|
44
|
+
if (typeof ref === "function") ref(node);
|
|
45
|
+
else if (ref) ref.current = node;
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ jsx(FormContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
48
|
+
"form",
|
|
49
|
+
{
|
|
50
|
+
ref: setRefs,
|
|
51
|
+
"data-slot": "form",
|
|
52
|
+
"data-layout": layout,
|
|
53
|
+
noValidate,
|
|
54
|
+
onSubmit: (event) => {
|
|
55
|
+
setSubmits((n) => n + 1);
|
|
56
|
+
if (onSubmitValues) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
onSubmitValues(formValues(event.currentTarget), event);
|
|
59
|
+
}
|
|
60
|
+
onSubmit?.(event);
|
|
61
|
+
},
|
|
62
|
+
className: cn("sa:w-full", className),
|
|
63
|
+
...props,
|
|
64
|
+
children: /* @__PURE__ */ jsx("fieldset", { disabled, className: "sa:m-0 sa:grid sa:min-w-0 sa:gap-6 sa:border-0 sa:p-0", children })
|
|
65
|
+
}
|
|
66
|
+
) });
|
|
67
|
+
}
|
|
68
|
+
function FormSection({ title, description, className, children, ...props }) {
|
|
69
|
+
const id = React.useId();
|
|
70
|
+
return /* @__PURE__ */ jsxs(
|
|
71
|
+
"section",
|
|
72
|
+
{
|
|
73
|
+
"aria-labelledby": `${id}-title`,
|
|
74
|
+
"data-slot": "form-section",
|
|
75
|
+
className: cn(
|
|
76
|
+
"sa:grid sa:gap-5 sa:not-first:border-t sa:not-first:border-border-default sa:not-first:pt-6",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...props,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsxs("header", { className: "sa:grid sa:gap-1", children: [
|
|
82
|
+
/* @__PURE__ */ jsx("h3", { id: `${id}-title`, className: "sa:text-base sa:font-medium sa:text-text-default", children: title }),
|
|
83
|
+
description && /* @__PURE__ */ jsx(FieldDescription, { children: description })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsx("div", { className: "sa:grid sa:gap-5", children })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function FormActions({ align = "end", className, ...props }) {
|
|
91
|
+
const form = useFormContext();
|
|
92
|
+
return /* @__PURE__ */ jsx(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
"data-slot": "form-actions",
|
|
96
|
+
className: cn(
|
|
97
|
+
"sa:flex sa:flex-wrap sa:items-center sa:gap-2",
|
|
98
|
+
align === "end" && "sa:justify-end",
|
|
99
|
+
align === "between" && "sa:justify-end sa:[&>:first-child]:mr-auto",
|
|
100
|
+
align === "start" && form?.layout === "horizontal" && "sa:pl-46",
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { Form, FormActions, FormSection, formValues };
|
|
@@ -59,7 +59,14 @@ var defaultLabels = {
|
|
|
59
59
|
commandPlaceholder: "Type a command or search\u2026",
|
|
60
60
|
navigate: "Navigate",
|
|
61
61
|
openItem: "Open",
|
|
62
|
-
source: "Source"
|
|
62
|
+
source: "Source",
|
|
63
|
+
moreOptions: "More options",
|
|
64
|
+
loading: "Loading",
|
|
65
|
+
submit: "Submit",
|
|
66
|
+
done: "Done",
|
|
67
|
+
opensInNewTab: "(opens in a new tab)",
|
|
68
|
+
showPassword: "Show password",
|
|
69
|
+
hidePassword: "Hide password"
|
|
63
70
|
};
|
|
64
71
|
var LabelsContext = React.createContext(defaultLabels);
|
|
65
72
|
function SatinLabels({ labels, children }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { KbdGroup } from './chunk-
|
|
2
|
-
import { useSatinLabels } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
1
|
+
import { KbdGroup } from './chunk-XWPH7C2W.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import { DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSlidingIndicator } from './chunk-XETMIETJ.js';
|
|
2
|
-
import { cn } from './chunk-
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Tabs as Tabs$1 } from 'radix-ui';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
@@ -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 };
|