@uisatin/ui 0.2.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 +27 -0
- package/README.md +10 -1
- package/{chunk-P4O6TGDR.js → chunk-3VVO5MY5.js} +28 -26
- package/chunk-47DDBME3.js +87 -0
- package/{chunk-SHDFUXYV.js → chunk-5663JVE5.js} +16 -18
- package/chunk-67CBFB6Y.js +99 -0
- package/chunk-6DWLTGRQ.js +130 -0
- package/chunk-6GNMUJQ4.js +45 -0
- package/chunk-6JTSZAGO.js +177 -0
- package/chunk-6RLSRMB5.js +14 -0
- package/chunk-6Y6CY2DP.js +55 -0
- package/{chunk-O7F3CIDV.js → chunk-7NV53EL5.js} +10 -12
- package/{chunk-BNZVTLHV.js → chunk-7SVMERPH.js} +25 -21
- package/chunk-A52HUWVM.js +24 -0
- package/chunk-AKEZCWNW.js +29 -0
- package/{chunk-SH6NG6VN.js → chunk-APRVUOD6.js} +6 -8
- package/{chunk-QUF2IPOZ.js → chunk-C435UD7V.js} +14 -15
- package/{chunk-B2K45IUR.js → chunk-C6WRJ7DG.js} +5 -7
- package/{chunk-PF3YBUKT.js → chunk-CQFAMWZI.js} +16 -15
- package/chunk-DAKVTPYZ.js +86 -0
- package/{chunk-VAGIAREV.js → chunk-DMZW4LGU.js} +29 -26
- package/chunk-EBZHGRM5.js +46 -0
- package/chunk-EHEXE2UV.js +44 -0
- package/{chunk-72OCFAPT.js → chunk-EQAFDIPE.js} +26 -23
- package/{chunk-LLHTVIM3.js → chunk-EXKSKYG3.js} +7 -9
- package/chunk-FB6DG3LR.js +35 -0
- package/chunk-GH2DEOGO.js +67 -0
- package/{chunk-YG7JOOLJ.js → chunk-GKDMCY2S.js} +5 -7
- package/chunk-GTFUAA6H.js +42 -0
- package/{chunk-TX3H3QMA.js → chunk-HI6QIG55.js} +71 -70
- package/{chunk-6QMSWITQ.js → chunk-HZV7EXGU.js} +24 -26
- package/{chunk-A5XEM3GF.js → chunk-IKJIR6VL.js} +34 -36
- package/{chunk-DO3TBNSC.js → chunk-INJWE2LD.js} +15 -17
- package/chunk-J5UQPROI.js +56 -0
- package/{chunk-6YXUBP27.js → chunk-JCR5TWTF.js} +72 -67
- package/chunk-JKOBDLP3.js +25 -0
- package/chunk-JR3VVDV6.js +37 -0
- package/chunk-JYGCZWET.js +112 -0
- package/{chunk-UGRSWP6U.js → chunk-K5G5OEV5.js} +10 -12
- package/{chunk-B6V4VSGH.js → chunk-KDU7AT2T.js} +14 -15
- package/chunk-KITXKIYW.js +104 -0
- package/{chunk-NN6PKJWS.js → chunk-KQNA22D3.js} +7 -9
- package/{chunk-YPNKBE5X.js → chunk-L5PPN42A.js} +14 -9
- package/chunk-LAOE6Y57.js +95 -0
- package/chunk-LI5VYDLN.js +195 -0
- package/{chunk-7TXHCRAG.js → chunk-LKSFTNPF.js} +8 -10
- package/chunk-LLW3X4ZJ.js +39 -0
- package/{chunk-RTJ76X5U.js → chunk-LWRB4DED.js} +2 -4
- package/{chunk-NSRTTYQ4.js → chunk-M7RILZVW.js} +42 -35
- package/{chunk-LW3TRU5W.js → chunk-MOGWOUCN.js} +28 -16
- package/chunk-NCIRJ5V2.js +108 -0
- package/chunk-NQL6SIIB.js +168 -0
- package/chunk-NTSU44FY.js +81 -0
- package/{chunk-3DINAQLL.js → chunk-P36KBUYD.js} +33 -29
- package/chunk-P6RHT2VM.js +147 -0
- package/{chunk-CL2II6BX.js → chunk-PD2KD5OR.js} +11 -13
- package/{chunk-XL75JRUA.js → chunk-PP46SY7M.js} +42 -22
- package/{chunk-L6NCCSIP.js → chunk-PTK4QAOQ.js} +36 -29
- package/{chunk-HL42K2NH.js → chunk-Q7KVC5B4.js} +17 -17
- package/{chunk-H4NU7NPO.js → chunk-R3DTMBDT.js} +62 -61
- package/{chunk-KNUWZNFV.js → chunk-R4KPFBMK.js} +4 -6
- package/chunk-R5TQ3HNB.js +71 -0
- package/chunk-RFSPJECL.js +84 -0
- package/chunk-RPL6FRVX.js +88 -0
- package/{chunk-AN2RNJLR.js → chunk-STYOBAC7.js} +16 -16
- package/{chunk-X3PQANZO.js → chunk-SVUWR3HD.js} +47 -46
- package/chunk-T7P3OEBP.js +128 -0
- package/{chunk-QS4N4MNP.js → chunk-TB3ZRV3Y.js} +18 -20
- package/{chunk-MYEZXZZC.js → chunk-TOY6YPTG.js} +23 -25
- package/{chunk-XILQ7GXE.js → chunk-U6X6ODDJ.js} +11 -13
- package/{chunk-XZNHT6MO.js → chunk-UAJ6M34K.js} +115 -61
- package/chunk-W2EH6RY5.js +42 -0
- package/{chunk-FDKIX4DC.js → chunk-W2QQQWNE.js} +7 -9
- package/{chunk-LZMKSFCF.js → chunk-WALANB3V.js} +10 -12
- package/chunk-WCUR44O6.js +88 -0
- package/{chunk-BNTPPZCK.js → chunk-WJYJMX5S.js} +37 -39
- package/chunk-WZSLDYUU.js +131 -0
- package/{chunk-J3NSDRVH.js → chunk-XETMIETJ.js} +0 -2
- package/chunk-XU6JJDMZ.js +117 -0
- package/{chunk-BKZBWPUH.js → chunk-XWPH7C2W.js} +9 -11
- package/{chunk-GICKPMJU.js → chunk-YXWXSRXG.js} +31 -31
- package/{chunk-2HKBZFIK.js → chunk-YY236ZSJ.js} +31 -31
- package/{chunk-YX5VNRJX.js → chunk-YYFAZQ25.js} +0 -2
- package/{chunk-Y5AYU7PK.js → chunk-ZHFIWDGF.js} +0 -2
- package/components/accordion.js +2 -4
- package/components/action-button.d.ts +37 -0
- package/components/action-button.js +5 -0
- package/components/agent-loading.d.ts +2 -0
- package/components/agent-loading.js +2 -4
- package/components/agent-picker.js +5 -5
- package/components/agent-suggestion.js +5 -6
- package/components/alert.d.ts +37 -0
- package/components/alert.js +5 -0
- package/components/announcement-bar.js +7 -7
- package/components/attachment.js +5 -5
- package/components/avatar.js +4 -6
- package/components/badge.js +2 -4
- package/components/banner-mesh.js +1 -3
- package/components/banner.js +6 -6
- package/components/bar-chart.js +10 -11
- package/components/breadcrumb.js +5 -6
- 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 -4
- package/components/card.js +5 -5
- package/components/channel-chart.js +10 -11
- package/components/chart.js +9 -10
- package/components/checkbox.js +2 -4
- package/components/chip.js +2 -4
- package/components/citations.d.ts +6 -4
- package/components/citations.js +4 -5
- package/components/code-block.js +5 -5
- package/components/combobox.d.ts +12 -3
- package/components/combobox.js +10 -10
- package/components/command-menu.d.ts +6 -2
- package/components/command-menu.js +5 -6
- package/components/context-menu.d.ts +12 -5
- package/components/context-menu.js +5 -6
- package/components/cookie-consent.js +5 -5
- package/components/date-picker.d.ts +26 -14
- package/components/date-picker.js +9 -9
- package/components/decision-card.js +7 -7
- package/components/dialog.d.ts +6 -8
- package/components/dialog.js +6 -5
- package/components/donut-chart.js +10 -11
- package/components/dot.js +2 -4
- package/components/dropdown.d.ts +6 -1
- package/components/dropdown.js +4 -5
- package/components/empty-state.js +2 -4
- package/components/field-group.d.ts +27 -0
- package/components/field-group.js +3 -0
- package/components/file-upload.js +7 -7
- package/components/floating.js +1 -3
- package/components/form-field.d.ts +38 -1
- package/components/form-field.js +2 -4
- package/components/form.d.ts +47 -0
- package/components/form.js +3 -0
- package/components/hover-card.d.ts +5 -2
- package/components/hover-card.js +2 -4
- package/components/input-group.d.ts +21 -0
- package/components/input-group.js +6 -0
- package/components/input-otp.d.ts +4 -2
- package/components/input-otp.js +7 -8
- package/components/input.d.ts +5 -1
- package/components/input.js +3 -5
- package/components/kbd.js +2 -4
- package/components/labels.d.ts +86 -0
- package/components/labels.js +1 -0
- package/components/line-chart.js +11 -12
- 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 -5
- package/components/message.js +8 -8
- package/components/number-input.d.ts +4 -2
- package/components/number-input.js +7 -8
- package/components/pagination.js +6 -6
- package/components/password-input.d.ts +16 -0
- package/components/password-input.js +7 -0
- package/components/popover.d.ts +11 -5
- package/components/popover.js +3 -4
- package/components/progress.js +2 -4
- package/components/prompt-bar.js +6 -6
- package/components/radio.js +2 -4
- package/components/search-bar.js +3 -5
- package/components/segmented-control.d.ts +4 -2
- package/components/segmented-control.js +3 -5
- package/components/select.d.ts +11 -2
- package/components/select.js +6 -7
- 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.d.ts +4 -2
- package/components/sheet.js +7 -6
- package/components/sidebar.js +2 -4
- package/components/skeleton.js +2 -4
- package/components/slider.d.ts +6 -2
- package/components/slider.js +7 -8
- package/components/sliding-indicator.js +1 -3
- 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 -4
- package/components/switch.js +2 -4
- package/components/table.d.ts +16 -5
- package/components/table.js +4 -5
- package/components/tabs.d.ts +4 -2
- package/components/tabs.js +3 -5
- package/components/textarea.js +3 -5
- package/components/thinking.js +3 -5
- package/components/toast.js +5 -5
- package/components/toggle.js +2 -4
- package/components/tooltip.d.ts +5 -2
- package/components/tooltip.js +3 -5
- package/index.d.ts +17 -2
- package/index.js +82 -231
- package/lib/utils.d.ts +8 -1
- package/lib/utils.js +1 -3
- package/package.json +11 -1
- package/styles.css +1 -1
- package/theme/create-theme.d.ts +6 -2
- package/theme/index.js +1 -0
- package/chunk-2HKBZFIK.js.map +0 -1
- package/chunk-3DINAQLL.js.map +0 -1
- package/chunk-3ERGAHKA.js +0 -179
- package/chunk-3ERGAHKA.js.map +0 -1
- package/chunk-6C7CGJX2.js +0 -86
- package/chunk-6C7CGJX2.js.map +0 -1
- package/chunk-6QMSWITQ.js.map +0 -1
- package/chunk-6YXUBP27.js.map +0 -1
- package/chunk-72OCFAPT.js.map +0 -1
- package/chunk-7TXHCRAG.js.map +0 -1
- package/chunk-A5XEM3GF.js.map +0 -1
- package/chunk-AN2RNJLR.js.map +0 -1
- package/chunk-B2K45IUR.js.map +0 -1
- package/chunk-B6V4VSGH.js.map +0 -1
- package/chunk-BKZBWPUH.js.map +0 -1
- package/chunk-BNTPPZCK.js.map +0 -1
- package/chunk-BNZVTLHV.js.map +0 -1
- package/chunk-CL2II6BX.js.map +0 -1
- package/chunk-D7RZNTFC.js +0 -95
- package/chunk-D7RZNTFC.js.map +0 -1
- package/chunk-DETGJAIC.js +0 -147
- package/chunk-DETGJAIC.js.map +0 -1
- package/chunk-DO3TBNSC.js.map +0 -1
- package/chunk-ESC5JCVQ.js +0 -90
- package/chunk-ESC5JCVQ.js.map +0 -1
- package/chunk-FDKIX4DC.js.map +0 -1
- package/chunk-GICKPMJU.js.map +0 -1
- package/chunk-GQA24FYG.js +0 -57
- package/chunk-GQA24FYG.js.map +0 -1
- package/chunk-H4NU7NPO.js.map +0 -1
- package/chunk-H63FYCMY.js +0 -11
- package/chunk-H63FYCMY.js.map +0 -1
- package/chunk-HL42K2NH.js.map +0 -1
- package/chunk-HNQUX43Z.js +0 -109
- package/chunk-HNQUX43Z.js.map +0 -1
- package/chunk-HRKPV66B.js +0 -32
- package/chunk-HRKPV66B.js.map +0 -1
- package/chunk-J3NSDRVH.js.map +0 -1
- package/chunk-JPNWHWAQ.js +0 -151
- package/chunk-JPNWHWAQ.js.map +0 -1
- package/chunk-KNUWZNFV.js.map +0 -1
- package/chunk-L6NCCSIP.js.map +0 -1
- package/chunk-LLHTVIM3.js.map +0 -1
- package/chunk-LW3TRU5W.js.map +0 -1
- package/chunk-LZMKSFCF.js.map +0 -1
- package/chunk-MR3JDI7E.js +0 -122
- package/chunk-MR3JDI7E.js.map +0 -1
- package/chunk-MYEZXZZC.js.map +0 -1
- package/chunk-NN6PKJWS.js.map +0 -1
- package/chunk-NSRTTYQ4.js.map +0 -1
- package/chunk-O7F3CIDV.js.map +0 -1
- package/chunk-P4O6TGDR.js.map +0 -1
- package/chunk-PF3YBUKT.js.map +0 -1
- package/chunk-PVOLDO4G.js +0 -47
- package/chunk-PVOLDO4G.js.map +0 -1
- package/chunk-QS4N4MNP.js.map +0 -1
- package/chunk-QUF2IPOZ.js.map +0 -1
- package/chunk-RTJ76X5U.js.map +0 -1
- package/chunk-SH6NG6VN.js.map +0 -1
- package/chunk-SHDFUXYV.js.map +0 -1
- package/chunk-TKO44NDI.js +0 -84
- package/chunk-TKO44NDI.js.map +0 -1
- package/chunk-TX3H3QMA.js.map +0 -1
- package/chunk-UBNHSZSE.js +0 -88
- package/chunk-UBNHSZSE.js.map +0 -1
- package/chunk-UC3ZJWOD.js +0 -73
- package/chunk-UC3ZJWOD.js.map +0 -1
- package/chunk-UGRSWP6U.js.map +0 -1
- package/chunk-VAGIAREV.js.map +0 -1
- package/chunk-WTMZT3IT.js +0 -105
- package/chunk-WTMZT3IT.js.map +0 -1
- package/chunk-WX6BP5ZP.js +0 -39
- package/chunk-WX6BP5ZP.js.map +0 -1
- package/chunk-X3PQANZO.js.map +0 -1
- package/chunk-XILQ7GXE.js.map +0 -1
- package/chunk-XL75JRUA.js.map +0 -1
- package/chunk-XZNHT6MO.js.map +0 -1
- package/chunk-Y5AYU7PK.js.map +0 -1
- package/chunk-YG7JOOLJ.js.map +0 -1
- package/chunk-YPJYW624.js +0 -195
- package/chunk-YPJYW624.js.map +0 -1
- package/chunk-YPNKBE5X.js.map +0 -1
- package/chunk-YX5VNRJX.js.map +0 -1
- package/components/accordion.js.map +0 -1
- package/components/agent-loading.js.map +0 -1
- package/components/agent-picker.js.map +0 -1
- package/components/agent-suggestion.js.map +0 -1
- package/components/announcement-bar.js.map +0 -1
- package/components/attachment.js.map +0 -1
- package/components/avatar.js.map +0 -1
- package/components/badge.js.map +0 -1
- package/components/banner-mesh.js.map +0 -1
- package/components/banner.js.map +0 -1
- package/components/bar-chart.js.map +0 -1
- package/components/breadcrumb.js.map +0 -1
- package/components/button.js.map +0 -1
- package/components/card.js.map +0 -1
- package/components/channel-chart.js.map +0 -1
- package/components/chart.js.map +0 -1
- package/components/checkbox.js.map +0 -1
- package/components/chip.js.map +0 -1
- package/components/citations.js.map +0 -1
- package/components/code-block.js.map +0 -1
- package/components/combobox.js.map +0 -1
- package/components/command-menu.js.map +0 -1
- package/components/context-menu.js.map +0 -1
- package/components/cookie-consent.js.map +0 -1
- package/components/date-picker.js.map +0 -1
- package/components/decision-card.js.map +0 -1
- package/components/dialog.js.map +0 -1
- package/components/donut-chart.js.map +0 -1
- package/components/dot.js.map +0 -1
- package/components/dropdown.js.map +0 -1
- package/components/empty-state.js.map +0 -1
- package/components/file-upload.js.map +0 -1
- package/components/floating.js.map +0 -1
- package/components/form-field.js.map +0 -1
- package/components/hover-card.js.map +0 -1
- package/components/input-otp.js.map +0 -1
- package/components/input.js.map +0 -1
- package/components/kbd.js.map +0 -1
- package/components/line-chart.js.map +0 -1
- package/components/message-actions.js.map +0 -1
- package/components/message.js.map +0 -1
- package/components/number-input.js.map +0 -1
- package/components/pagination.js.map +0 -1
- package/components/popover.js.map +0 -1
- package/components/progress.js.map +0 -1
- package/components/prompt-bar.js.map +0 -1
- package/components/radio.js.map +0 -1
- package/components/search-bar.js.map +0 -1
- package/components/segmented-control.js.map +0 -1
- package/components/select.js.map +0 -1
- package/components/sheet.js.map +0 -1
- package/components/sidebar.js.map +0 -1
- package/components/skeleton.js.map +0 -1
- package/components/slider.js.map +0 -1
- package/components/sliding-indicator.js.map +0 -1
- package/components/streaming-text.js.map +0 -1
- package/components/switch.js.map +0 -1
- package/components/table.js.map +0 -1
- package/components/tabs.js.map +0 -1
- package/components/textarea.js.map +0 -1
- package/components/thinking.js.map +0 -1
- package/components/toast.js.map +0 -1
- package/components/toggle.js.map +0 -1
- package/components/tooltip.js.map +0 -1
- package/index.js.map +0 -1
- package/lib/utils.js.map +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { FlappySprite, TetrisStill } from './chunk-R4KPFBMK.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { NavArrowDown, Check, EditPencil } from 'iconoir-react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function Thinking({
|
|
8
|
+
state = "collapsed",
|
|
9
|
+
label = "Thought",
|
|
10
|
+
steps = [],
|
|
11
|
+
indicator = "tetris",
|
|
12
|
+
onToggle,
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
const [open, setOpen] = React.useState(state === "expanded");
|
|
17
|
+
React.useEffect(() => setOpen(state === "expanded"), [state]);
|
|
18
|
+
const bodyId = `${React.useId()}-steps`;
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "thinking", "data-state": open ? "expanded" : "collapsed", className: cn("sa:w-full", className), ...props, children: [
|
|
20
|
+
/* @__PURE__ */ jsxs(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
type: "button",
|
|
24
|
+
"aria-expanded": open,
|
|
25
|
+
"aria-controls": bodyId,
|
|
26
|
+
onClick: () => {
|
|
27
|
+
setOpen(!open);
|
|
28
|
+
onToggle?.(!open);
|
|
29
|
+
},
|
|
30
|
+
className: "sa:group sa:flex sa:w-fit sa:cursor-pointer sa:items-center sa:gap-3 sa:rounded-md sa:p-1 sa:outline-none sa:select-none sa:focus-visible:[box-shadow:0_0_0_2px_var(--action-focus-ring)]",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx(ThinkingMark, { indicator }),
|
|
33
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-sm sa:whitespace-nowrap sa:text-text-muted", children: label }),
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
NavArrowDown,
|
|
36
|
+
{
|
|
37
|
+
"aria-hidden": true,
|
|
38
|
+
className: cn(
|
|
39
|
+
"sa:size-icon-size-sm sa:shrink-0 sa:text-text-muted sa:transition-transform sa:duration-(--sa-duration-base) sa:ease-(--sa-ease-out) sa:[stroke-width:1.875]",
|
|
40
|
+
open && "sa:rotate-180"
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx("div", { id: bodyId, "data-state": open ? "open" : "closed", className: "satin-expand", children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:gap-3 sa:pt-2 sa:pl-1", children: [
|
|
48
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "sa:relative sa:w-4 sa:shrink-0 sa:self-stretch", children: /* @__PURE__ */ jsx("div", { className: "sa:absolute sa:inset-y-0 sa:left-1/2 sa:w-px sa:-translate-x-1/2 sa:bg-linear-to-b sa:from-component-rail-edge sa:via-component-rail-center sa:to-component-rail-edge" }) }),
|
|
49
|
+
/* @__PURE__ */ jsx("ol", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:flex-col sa:gap-2", children: steps.map((step, i) => /* @__PURE__ */ jsx("li", { className: "sa:min-w-0", children: /* @__PURE__ */ jsx(Step, { step }) }, i)) })
|
|
50
|
+
] }) }) })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
function Step({ step }) {
|
|
54
|
+
switch (step.type) {
|
|
55
|
+
case "text":
|
|
56
|
+
return /* @__PURE__ */ jsx("p", { className: "sa:text-body sa:text-text-muted", children: step.text });
|
|
57
|
+
case "more":
|
|
58
|
+
return /* @__PURE__ */ jsx("p", { className: "sa:text-sm sa:whitespace-nowrap sa:text-text-muted", children: step.label });
|
|
59
|
+
case "source":
|
|
60
|
+
return /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-w-0 sa:items-center sa:gap-3 sa:p-1 sa:text-sm", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: "sa:flex sa:size-4 sa:shrink-0 sa:items-center sa:justify-center sa:overflow-clip sa:rounded-xs sa:[&>*]:size-4", children: step.icon }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "sa:max-w-full sa:shrink-0 sa:truncate sa:text-text-default", children: step.label }),
|
|
63
|
+
step.meta != null && /* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate sa:text-text-muted", children: step.meta })
|
|
64
|
+
] });
|
|
65
|
+
case "tool":
|
|
66
|
+
return /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-w-0 sa:items-center sa:gap-2 sa:p-1 sa:text-sm sa:[&>svg]:size-icon-size sa:[&>svg]:shrink-0 sa:[&>svg]:text-text-muted sa:[&>svg]:[stroke-width:1.875]", children: [
|
|
67
|
+
step.icon ?? /* @__PURE__ */ jsx(EditPencil, {}),
|
|
68
|
+
/* @__PURE__ */ jsx("span", { className: "sa:shrink-0 sa:whitespace-nowrap sa:text-text-default", children: step.label }),
|
|
69
|
+
/* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate sa:font-mono sa:tracking-normal sa:text-text-muted", children: step.target }),
|
|
70
|
+
(step.added != null || step.removed != null) && /* @__PURE__ */ jsxs("span", { className: "sa:flex sa:shrink-0 sa:gap-1.5 sa:font-mono sa:tracking-normal sa:whitespace-nowrap", children: [
|
|
71
|
+
step.added != null && /* @__PURE__ */ jsx("span", { className: "sa:text-status-green-fg", children: step.added }),
|
|
72
|
+
step.removed != null && /* @__PURE__ */ jsx("span", { className: "sa:text-status-red-fg", children: step.removed })
|
|
73
|
+
] }),
|
|
74
|
+
step.meta != null && /* @__PURE__ */ jsx("span", { className: "sa:shrink-0 sa:whitespace-nowrap sa:text-text-muted", children: step.meta })
|
|
75
|
+
] });
|
|
76
|
+
default:
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-w-0 sa:items-center sa:gap-3 sa:p-1 sa:text-sm", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "sa:size-icon-size-sm sa:shrink-0 sa:text-status-green-fg sa:[stroke-width:1.875]" }),
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "sa:max-w-full sa:shrink-0 sa:truncate sa:text-text-default", children: step.label }),
|
|
80
|
+
step.meta != null && /* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate sa:text-text-muted", children: step.meta })
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function ThinkingMark({ indicator }) {
|
|
85
|
+
return indicator === "flappy" ? /* @__PURE__ */ jsx(FlappySprite, { size: 16, run: false }) : /* @__PURE__ */ jsx(TetrisStill, {});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { Thinking };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Slot, Tooltip, Collapsible } from 'radix-ui';
|
|
4
4
|
import { NavArrowRight } from 'iconoir-react';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var rowFocus = "outline-none satin-focus:[box-shadow:inset_0_0_0_1px_var(--border-focus)]";
|
|
7
|
+
var rowFocus = "sa:outline-none sa:satin-focus:[box-shadow:inset_0_0_0_1px_var(--border-focus)]";
|
|
8
8
|
function Sidebar({ className, ...props }) {
|
|
9
|
-
return /* @__PURE__ */ jsx("nav", { "data-slot": "sidebar", className: cn("flex flex-col gap-0.5", className), ...props });
|
|
9
|
+
return /* @__PURE__ */ jsx("nav", { "data-slot": "sidebar", className: cn("sa:flex sa:flex-col sa:gap-0.5", className), ...props });
|
|
10
10
|
}
|
|
11
11
|
function SidebarItem({
|
|
12
12
|
className,
|
|
@@ -34,22 +34,22 @@ function SidebarItem({
|
|
|
34
34
|
href: disabled ? void 0 : href,
|
|
35
35
|
tabIndex: disabled ? -1 : void 0,
|
|
36
36
|
className: cn(
|
|
37
|
-
"flex h-8 shrink-0 items-center gap-2 rounded-lg px-2 text-sm leading-4 font-medium tracking-normal text-text-muted no-underline select-none",
|
|
38
|
-
"transition-[background-color,color,box-shadow] duration-(--duration-fast) ease-(--ease-out)",
|
|
39
|
-
"[&_svg]:size-icon-size-sm [&_svg]:shrink-0 [&_svg]:[stroke-width:1.875]",
|
|
40
|
-
"not-data-active:satin-hover:bg-bg-muted",
|
|
37
|
+
"sa:flex sa:h-8 sa:shrink-0 sa:items-center sa:gap-2 sa:rounded-lg sa:px-2 sa:text-sm sa:leading-4 sa:font-medium sa:tracking-normal sa:text-text-muted sa:no-underline sa:select-none",
|
|
38
|
+
"sa:transition-[background-color,color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
39
|
+
"sa:[&_svg]:size-icon-size-sm sa:[&_svg]:shrink-0 sa:[&_svg]:[stroke-width:1.875]",
|
|
40
|
+
"sa:not-data-active:satin-hover:bg-bg-muted",
|
|
41
41
|
rowFocus,
|
|
42
|
-
"data-active:bg-border-input data-active:text-text-default",
|
|
43
|
-
"aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
44
|
-
iconOnly && "relative size-8 justify-center px-0",
|
|
42
|
+
"sa:data-active:bg-border-input sa:data-active:text-text-default",
|
|
43
|
+
"sa:aria-disabled:pointer-events-none sa:aria-disabled:opacity-50",
|
|
44
|
+
iconOnly && "sa:relative sa:size-8 sa:justify-center sa:px-0",
|
|
45
45
|
className
|
|
46
46
|
),
|
|
47
47
|
...props,
|
|
48
48
|
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
49
|
icon,
|
|
50
|
-
!iconOnly && /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: label }),
|
|
50
|
+
!iconOnly && /* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate", children: label }),
|
|
51
51
|
showCount && !iconOnly && /* @__PURE__ */ jsx(SidebarCount, { count }),
|
|
52
|
-
showCount && iconOnly && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute top-1 right-1 size-1.5 rounded-full bg-action-destructive-bg" })
|
|
52
|
+
showCount && iconOnly && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "sa:absolute sa:top-1 sa:right-1 sa:size-1.5 sa:rounded-full sa:bg-action-destructive-bg" })
|
|
53
53
|
] })
|
|
54
54
|
}
|
|
55
55
|
);
|
|
@@ -62,7 +62,7 @@ function SidebarItem({
|
|
|
62
62
|
side: "right",
|
|
63
63
|
sideOffset: 6,
|
|
64
64
|
collisionPadding: 8,
|
|
65
|
-
className: "z-50 rounded-md bg-action-inverse-bg px-2 py-1 text-xs font-medium text-text-on-inverse [box-shadow:0_1px_2px_0_var(--effect-shadow-xs)]",
|
|
65
|
+
className: "sa:z-50 sa:rounded-md sa:bg-action-inverse-bg sa:px-2 sa:py-1 sa:text-xs sa:font-medium sa:text-text-on-inverse sa:[box-shadow:0_1px_2px_0_var(--effect-shadow-xs)]",
|
|
66
66
|
children: label
|
|
67
67
|
}
|
|
68
68
|
) })
|
|
@@ -71,7 +71,7 @@ function SidebarItem({
|
|
|
71
71
|
function SidebarCount({ count }) {
|
|
72
72
|
return (
|
|
73
73
|
// 11/12 has no type token in the kit; Figma uses it raw for this counter.
|
|
74
|
-
/* @__PURE__ */ jsx("span", { className: "inline-flex h-4 min-w-[18px] shrink-0 items-center justify-center rounded-xs bg-action-destructive-bg px-1 text-[11px] leading-3 font-medium tracking-normal text-text-on-solid tabular-nums", children: count > 99 ? "99+" : count })
|
|
74
|
+
/* @__PURE__ */ jsx("span", { className: "sa:inline-flex sa:h-4 sa:min-w-[18px] sa:shrink-0 sa:items-center sa:justify-center sa:rounded-xs sa:bg-action-destructive-bg sa:px-1 sa:text-[11px] sa:leading-3 sa:font-medium sa:tracking-normal sa:text-text-on-solid sa:tabular-nums", children: count > 99 ? "99+" : count })
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
function SidebarGroup({
|
|
@@ -98,7 +98,7 @@ function SidebarGroup({
|
|
|
98
98
|
if (openProp == null) setUncontrolled(next);
|
|
99
99
|
onOpenChange?.(next);
|
|
100
100
|
},
|
|
101
|
-
className: cn("group/sidebar-group flex flex-col gap-0.5", className),
|
|
101
|
+
className: cn("sa:group/sidebar-group sa:flex sa:flex-col sa:gap-0.5", className),
|
|
102
102
|
...props,
|
|
103
103
|
children: [
|
|
104
104
|
/* @__PURE__ */ jsxs(
|
|
@@ -107,28 +107,28 @@ function SidebarGroup({
|
|
|
107
107
|
"aria-controls": regionId,
|
|
108
108
|
...triggerProps,
|
|
109
109
|
className: cn(
|
|
110
|
-
"flex h-8 w-full shrink-0 items-center gap-2 rounded-lg px-3 text-left text-text-muted",
|
|
111
|
-
"transition-[background-color,box-shadow] duration-(--duration-fast) ease-(--ease-out)",
|
|
112
|
-
"[&_svg]:size-icon-size-sm [&_svg]:shrink-0 [&_svg]:[stroke-width:1.875]",
|
|
113
|
-
"not-data-active:satin-hover:bg-bg-muted",
|
|
110
|
+
"sa:flex sa:h-8 sa:w-full sa:shrink-0 sa:items-center sa:gap-2 sa:rounded-lg sa:px-3 sa:text-left sa:text-text-muted",
|
|
111
|
+
"sa:transition-[background-color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
112
|
+
"sa:[&_svg]:size-icon-size-sm sa:[&_svg]:shrink-0 sa:[&_svg]:[stroke-width:1.875]",
|
|
113
|
+
"sa:not-data-active:satin-hover:bg-bg-muted",
|
|
114
114
|
rowFocus,
|
|
115
115
|
triggerProps?.className
|
|
116
116
|
),
|
|
117
117
|
children: [
|
|
118
118
|
icon,
|
|
119
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-sm leading-4 font-medium tracking-normal text-text-default", children: label }),
|
|
120
|
-
typeof count === "number" && /* @__PURE__ */ jsx("span", { className: "shrink-0 px-1.5 py-0.5 text-sm leading-4 font-medium tracking-normal text-tone-fg tabular-nums", children: count }),
|
|
119
|
+
/* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate sa:text-sm sa:leading-4 sa:font-medium sa:tracking-normal sa:text-text-default", children: label }),
|
|
120
|
+
typeof count === "number" && /* @__PURE__ */ jsx("span", { className: "sa:shrink-0 sa:px-1.5 sa:py-0.5 sa:text-sm sa:leading-4 sa:font-medium sa:tracking-normal sa:text-tone-fg sa:tabular-nums", children: count }),
|
|
121
121
|
/* @__PURE__ */ jsx(
|
|
122
122
|
NavArrowRight,
|
|
123
123
|
{
|
|
124
124
|
"aria-hidden": true,
|
|
125
|
-
className: "transition-transform duration-(--duration-base) ease-(--ease-out) group-data-[state=open]/sidebar-group:rotate-90 motion-reduce:transition-none"
|
|
125
|
+
className: "sa:transition-transform sa:duration-(--sa-duration-base) sa:ease-(--sa-ease-out) sa:group-data-[state=open]/sidebar-group:rotate-90 sa:motion-reduce:transition-none"
|
|
126
126
|
}
|
|
127
127
|
)
|
|
128
128
|
]
|
|
129
129
|
}
|
|
130
130
|
),
|
|
131
|
-
/* @__PURE__ */ jsx("div", { id: regionId, "data-state": open ? "open" : "closed", className: "satin-expand", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5", children }) })
|
|
131
|
+
/* @__PURE__ */ jsx("div", { id: regionId, "data-state": open ? "open" : "closed", className: "satin-expand", children: /* @__PURE__ */ jsx("div", { className: "sa:flex sa:flex-col sa:gap-0.5", children }) })
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
);
|
|
@@ -154,16 +154,16 @@ function SidebarSubItem({
|
|
|
154
154
|
href: disabled ? void 0 : href,
|
|
155
155
|
tabIndex: disabled ? -1 : void 0,
|
|
156
156
|
className: cn(
|
|
157
|
-
"flex h-8 shrink-0 items-center rounded-lg pr-3 pl-[34px] text-sm font-normal text-text-muted no-underline select-none",
|
|
158
|
-
"transition-[background-color,color,box-shadow] duration-(--duration-fast) ease-(--ease-out)",
|
|
159
|
-
"not-data-active:satin-hover:bg-bg-muted not-data-active:satin-hover:text-text-default",
|
|
157
|
+
"sa:flex sa:h-8 sa:shrink-0 sa:items-center sa:rounded-lg sa:pr-3 sa:pl-[34px] sa:text-sm sa:font-normal sa:text-text-muted sa:no-underline sa:select-none",
|
|
158
|
+
"sa:transition-[background-color,color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
159
|
+
"sa:not-data-active:satin-hover:bg-bg-muted sa:not-data-active:satin-hover:text-text-default",
|
|
160
160
|
rowFocus,
|
|
161
|
-
"data-active:bg-bg-selected data-active:text-text-default",
|
|
162
|
-
"aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
161
|
+
"sa:data-active:bg-bg-selected sa:data-active:text-text-default",
|
|
162
|
+
"sa:aria-disabled:pointer-events-none sa:aria-disabled:opacity-50",
|
|
163
163
|
className
|
|
164
164
|
),
|
|
165
165
|
...props,
|
|
166
|
-
children: asChild ? children : /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: label })
|
|
166
|
+
children: asChild ? children : /* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate", children: label })
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
169
|
}
|
|
@@ -180,7 +180,7 @@ function SidebarSubGroup({
|
|
|
180
180
|
const [uncontrolled, setUncontrolled] = React.useState(defaultOpen ?? active);
|
|
181
181
|
const open = openProp ?? uncontrolled;
|
|
182
182
|
const regionId = React.useId();
|
|
183
|
-
return /* @__PURE__ */ jsxs("div", { "data-slot": "sidebar-sub-group", "data-state": open ? "open" : "closed", className: cn("group/sub-group flex flex-col gap-0.5", className), ...props, children: [
|
|
183
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "sidebar-sub-group", "data-state": open ? "open" : "closed", className: cn("sa:group/sub-group sa:flex sa:flex-col sa:gap-0.5", className), ...props, children: [
|
|
184
184
|
/* @__PURE__ */ jsxs(
|
|
185
185
|
"button",
|
|
186
186
|
{
|
|
@@ -193,28 +193,26 @@ function SidebarSubGroup({
|
|
|
193
193
|
onOpenChange?.(!open);
|
|
194
194
|
},
|
|
195
195
|
className: cn(
|
|
196
|
-
"flex h-8 w-full shrink-0 items-center gap-2 rounded-lg pr-3 pl-[34px] text-left text-sm font-normal text-text-muted select-none",
|
|
197
|
-
"transition-[background-color,color,box-shadow] duration-(--duration-fast) ease-(--ease-out)",
|
|
198
|
-
"satin-hover:bg-bg-muted satin-hover:text-text-default data-active:text-text-default",
|
|
199
|
-
"[&_svg]:size-icon-size-sm [&_svg]:shrink-0 [&_svg]:[stroke-width:1.875]",
|
|
196
|
+
"sa:flex sa:h-8 sa:w-full sa:shrink-0 sa:items-center sa:gap-2 sa:rounded-lg sa:pr-3 sa:pl-[34px] sa:text-left sa:text-sm sa:font-normal sa:text-text-muted sa:select-none",
|
|
197
|
+
"sa:transition-[background-color,color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
198
|
+
"sa:satin-hover:bg-bg-muted sa:satin-hover:text-text-default sa:data-active:text-text-default",
|
|
199
|
+
"sa:[&_svg]:size-icon-size-sm sa:[&_svg]:shrink-0 sa:[&_svg]:[stroke-width:1.875]",
|
|
200
200
|
rowFocus
|
|
201
201
|
),
|
|
202
202
|
children: [
|
|
203
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: label }),
|
|
203
|
+
/* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate", children: label }),
|
|
204
204
|
/* @__PURE__ */ jsx(
|
|
205
205
|
NavArrowRight,
|
|
206
206
|
{
|
|
207
207
|
"aria-hidden": true,
|
|
208
|
-
className: "text-text-muted transition-transform duration-(--duration-base) ease-(--ease-out) group-data-[state=open]/sub-group:rotate-90 motion-reduce:transition-none"
|
|
208
|
+
className: "sa:text-text-muted sa:transition-transform sa:duration-(--sa-duration-base) sa:ease-(--sa-ease-out) sa:group-data-[state=open]/sub-group:rotate-90 sa:motion-reduce:transition-none"
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
]
|
|
212
212
|
}
|
|
213
213
|
),
|
|
214
|
-
/* @__PURE__ */ jsx("div", { id: regionId, "data-state": open ? "open" : "closed", className: "satin-expand", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5 [&>[data-slot=sidebar-sub-item]]:pl-[46px]", children }) })
|
|
214
|
+
/* @__PURE__ */ jsx("div", { id: regionId, "data-state": open ? "open" : "closed", className: "satin-expand", children: /* @__PURE__ */ jsx("div", { className: "sa:flex sa:flex-col sa:gap-0.5 sa:[&>[data-slot=sidebar-sub-item]]:pl-[46px]", children }) })
|
|
215
215
|
] });
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
export { Sidebar, SidebarGroup, SidebarItem, SidebarSubGroup, SidebarSubItem };
|
|
219
|
-
//# sourceMappingURL=chunk-BNTPPZCK.js.map
|
|
220
|
-
//# sourceMappingURL=chunk-BNTPPZCK.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
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';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { Dialog as Dialog$1 } from 'radix-ui';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function Dialog({
|
|
10
|
+
open,
|
|
11
|
+
defaultOpen,
|
|
12
|
+
onOpenChange,
|
|
13
|
+
trigger,
|
|
14
|
+
title,
|
|
15
|
+
description,
|
|
16
|
+
variant = "default",
|
|
17
|
+
alert,
|
|
18
|
+
footer,
|
|
19
|
+
footerStart,
|
|
20
|
+
children,
|
|
21
|
+
closeButton = true,
|
|
22
|
+
modal = true,
|
|
23
|
+
container,
|
|
24
|
+
onOpenAutoFocus,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
const labels = useSatinLabels();
|
|
29
|
+
const position = container ? "absolute" : "fixed";
|
|
30
|
+
const hasBody = children != null || alert != null;
|
|
31
|
+
return /* @__PURE__ */ jsxs(Dialog$1.Root, { open, defaultOpen, onOpenChange, modal, children: [
|
|
32
|
+
trigger && /* @__PURE__ */ jsx(Dialog$1.Trigger, { asChild: true, children: trigger }),
|
|
33
|
+
/* @__PURE__ */ jsxs(Dialog$1.Portal, { container, children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
Dialog$1.Overlay,
|
|
36
|
+
{
|
|
37
|
+
className: cn(
|
|
38
|
+
position,
|
|
39
|
+
"sa:inset-0 sa:z-50 sa:bg-black-a40"
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: cn(position, "sa:pointer-events-none sa:inset-0 sa:z-50 sa:grid sa:grid-cols-[minmax(0,1fr)] sa:grid-rows-[minmax(0,1fr)] sa:place-items-center sa:p-4"), children: /* @__PURE__ */ jsxs(
|
|
44
|
+
Dialog$1.Content,
|
|
45
|
+
{
|
|
46
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
47
|
+
...props,
|
|
48
|
+
role: variant === "destructive" ? "alertdialog" : "dialog",
|
|
49
|
+
"data-slot": "dialog",
|
|
50
|
+
"data-variant": variant,
|
|
51
|
+
onOpenAutoFocus,
|
|
52
|
+
className: cn(
|
|
53
|
+
"sa:pointer-events-auto sa:relative sa:flex sa:max-h-full sa:w-[425px] sa:max-w-[min(560px,100%)] sa:min-w-[min(360px,100%)] sa:flex-col sa:overflow-clip",
|
|
54
|
+
"sa:rounded-2xl sa:border sa:border-border-default sa:bg-bg-popover",
|
|
55
|
+
"sa:[box-shadow:0_4px_6px_-4px_var(--effect-shadow-sm),0_10px_15px_-3px_var(--effect-shadow-sm)]",
|
|
56
|
+
"sa:focus-visible:outline-none",
|
|
57
|
+
"sa:data-[state=open]:animate-[satin-enter_var(--sa-duration-base)_var(--sa-ease-out)]",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-h-0 sa:flex-col sa:gap-3", children: [
|
|
62
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:shrink-0 sa:flex-col sa:gap-0.5 sa:px-4 sa:pt-4 sa:pb-2", children: [
|
|
63
|
+
/* @__PURE__ */ jsx(Dialog$1.Title, { className: "sa:pr-8 sa:text-base sa:leading-[14px] sa:font-medium sa:tracking-normal sa:text-text-default", children: title }),
|
|
64
|
+
description ? /* @__PURE__ */ jsx(Dialog$1.Description, { className: "sa:text-body sa:text-text-muted", children: description }) : null
|
|
65
|
+
] }),
|
|
66
|
+
hasBody && /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-h-0 sa:flex-col sa:gap-3 sa:overflow-y-auto sa:px-4 sa:pb-3", children: [
|
|
67
|
+
typeof children === "string" ? /* @__PURE__ */ jsx("p", { className: "sa:text-body sa:text-text-default", children }) : children,
|
|
68
|
+
alert
|
|
69
|
+
] })
|
|
70
|
+
] }),
|
|
71
|
+
(footer || footerStart) && /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:shrink-0 sa:flex-wrap sa:items-center sa:justify-end sa:gap-3 sa:p-4", children: [
|
|
72
|
+
footerStart && /* @__PURE__ */ jsx("div", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:items-center", children: footerStart }),
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "sa:flex sa:shrink-0 sa:items-center sa:gap-2", children: footer })
|
|
74
|
+
] }),
|
|
75
|
+
closeButton && /* @__PURE__ */ jsx(Dialog$1.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
76
|
+
Button,
|
|
77
|
+
{
|
|
78
|
+
variant: "tertiary",
|
|
79
|
+
size: "xl",
|
|
80
|
+
iconOnly: true,
|
|
81
|
+
"aria-label": labels.close,
|
|
82
|
+
className: "sa:absolute sa:top-[7px] sa:right-[7px] sa:rounded-lg",
|
|
83
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
84
|
+
}
|
|
85
|
+
) })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
) })
|
|
89
|
+
] })
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
92
|
+
var DialogClose = Dialog$1.Close;
|
|
93
|
+
var alertTint = {
|
|
94
|
+
info: "sa:bg-status-sky-bg sa:text-status-sky-fg",
|
|
95
|
+
success: "sa:bg-status-green-bg sa:text-status-green-fg",
|
|
96
|
+
warning: "sa:bg-status-amber-bg sa:text-status-amber-fg",
|
|
97
|
+
error: "sa:bg-status-red-bg sa:text-status-red-fg"
|
|
98
|
+
};
|
|
99
|
+
function DialogAlert({
|
|
100
|
+
intent = "info",
|
|
101
|
+
title,
|
|
102
|
+
description,
|
|
103
|
+
icon = true,
|
|
104
|
+
onDismiss,
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}) {
|
|
108
|
+
const labels = useSatinLabels();
|
|
109
|
+
return /* @__PURE__ */ jsxs(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
role: intent === "error" || intent === "warning" ? "alert" : "status",
|
|
113
|
+
"data-slot": "dialog-alert",
|
|
114
|
+
"data-intent": intent,
|
|
115
|
+
className: cn("sa:flex sa:w-full sa:items-center sa:gap-3 sa:rounded-xl sa:px-4 sa:py-3", alertTint[intent], className),
|
|
116
|
+
...props,
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:items-center sa:gap-2.5", children: [
|
|
119
|
+
icon && /* @__PURE__ */ jsx(StatusIcon, { intent }),
|
|
120
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:flex-col", children: [
|
|
121
|
+
/* @__PURE__ */ jsx("p", { className: "sa:text-base sa:font-medium sa:text-text-default", children: title }),
|
|
122
|
+
description ? /* @__PURE__ */ jsx("p", { className: "sa:text-body sa:text-text-muted", children: description }) : null
|
|
123
|
+
] })
|
|
124
|
+
] }),
|
|
125
|
+
onDismiss && /* @__PURE__ */ jsx(Button, { variant: "tertiary", iconOnly: true, "aria-label": labels.dismiss, onClick: onDismiss, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
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,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 { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -11,13 +11,13 @@ function Kbd({ size = "sm", tone = "default", className, children, ...props }) {
|
|
|
11
11
|
"data-slot": "kbd",
|
|
12
12
|
"data-square": square || void 0,
|
|
13
13
|
className: cn(
|
|
14
|
-
"inline-flex shrink-0 items-center justify-center rounded-sm border-[0.75px] font-sans text-2xs leading-none font-medium tracking-normal whitespace-nowrap",
|
|
15
|
-
size === "sm" ? "h-[18px] min-w-[18px]" : "h-5 min-w-5",
|
|
14
|
+
"sa:inline-flex sa:shrink-0 sa:items-center sa:justify-center sa:rounded-sm sa:border-[0.75px] sa:font-sans sa:text-2xs sa:leading-none sa:font-medium sa:tracking-normal sa:whitespace-nowrap",
|
|
15
|
+
size === "sm" ? "sa:h-[18px] sa:min-w-[18px]" : "sa:h-5 sa:min-w-5",
|
|
16
16
|
// A single key is exactly square with nothing on the sides, so the glyph sits in the middle.
|
|
17
|
-
square ? size === "sm" ? "w-[18px] px-0" : "w-5 px-0" : size === "sm" ? "px-1" : "px-1.5",
|
|
18
|
-
tone === "default" ? "border-border-default bg-component-kbd-bg text-text-muted" : "border-action-inverse-border bg-action-inverse-bg-hover text-bg-canvas/72 dark:border-action-inverse-bg-pressed dark:bg-text-default",
|
|
17
|
+
square ? size === "sm" ? "sa:w-[18px] sa:px-0" : "sa:w-5 sa:px-0" : size === "sm" ? "sa:px-1" : "sa:px-1.5",
|
|
18
|
+
tone === "default" ? "sa:border-border-default sa:bg-component-kbd-bg sa:text-text-muted" : "sa:border-action-inverse-border sa:bg-action-inverse-bg-hover sa:text-bg-canvas/72 sa:dark:border-action-inverse-bg-pressed sa:dark:bg-text-default",
|
|
19
19
|
// Glyph icons (arrows, return) take the key's colour at 10px.
|
|
20
|
-
"[&>svg]:size-2.5 [&>svg]:shrink-0",
|
|
20
|
+
"sa:[&>svg]:size-2.5 sa:[&>svg]:shrink-0",
|
|
21
21
|
className
|
|
22
22
|
),
|
|
23
23
|
...props,
|
|
@@ -38,7 +38,7 @@ function keysOf(shortcut) {
|
|
|
38
38
|
}
|
|
39
39
|
function KbdGroup({ keys, size, tone, className, ...props }) {
|
|
40
40
|
const list = typeof keys === "string" ? keysOf(keys) : keys;
|
|
41
|
-
return /* @__PURE__ */ jsx("span", { "data-slot": "kbd-group", className: cn("inline-flex shrink-0 items-center gap-0.5", className), ...props, children: list.map((k, i) => /* @__PURE__ */ jsx(Kbd, { size, tone, children: k }, i)) });
|
|
41
|
+
return /* @__PURE__ */ jsx("span", { "data-slot": "kbd-group", className: cn("sa:inline-flex sa:shrink-0 sa:items-center sa:gap-0.5", className), ...props, children: list.map((k, i) => /* @__PURE__ */ jsx(Kbd, { size, tone, children: k }, i)) });
|
|
42
42
|
}
|
|
43
43
|
var glyph = { viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: 0.75, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true };
|
|
44
44
|
var KbdArrowUp = () => /* @__PURE__ */ jsx("svg", { ...glyph, children: /* @__PURE__ */ jsx("path", { d: "M5.00018 8.17963L5.00018 1.82037M8.00316 4.82335L5.00018 1.82037L1.9972 4.82335" }) });
|
|
@@ -48,12 +48,10 @@ var KbdReturn = () => /* @__PURE__ */ jsxs("svg", { ...glyph, children: [
|
|
|
48
48
|
/* @__PURE__ */ jsx("path", { d: "M2.8125 6.5625H5.3125C6.23296 6.5625 6.97917 5.81629 6.97917 4.89583V1.97917" })
|
|
49
49
|
] });
|
|
50
50
|
function KbdHint({ keys, label, className, ...props }) {
|
|
51
|
-
return /* @__PURE__ */ jsxs("span", { "data-slot": "kbd-hint", className: cn("flex items-center gap-1.5", className), ...props, children: [
|
|
51
|
+
return /* @__PURE__ */ jsxs("span", { "data-slot": "kbd-hint", className: cn("sa:flex sa:items-center sa:gap-1.5", className), ...props, children: [
|
|
52
52
|
/* @__PURE__ */ jsx(KbdGroup, { keys }),
|
|
53
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs leading-4 tracking-normal whitespace-nowrap text-text-muted", children: label })
|
|
53
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-xs sa:leading-4 sa:tracking-normal sa:whitespace-nowrap sa:text-text-muted", children: label })
|
|
54
54
|
] });
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export { Kbd, KbdArrowDown, KbdArrowUp, KbdGroup, KbdHint, KbdReturn, keysOf };
|
|
58
|
-
//# sourceMappingURL=chunk-BKZBWPUH.js.map
|
|
59
|
-
//# sourceMappingURL=chunk-BKZBWPUH.js.map
|