@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
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { KbdGroup } from './chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { KbdGroup } from './chunk-XWPH7C2W.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
import { DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
5
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
7
|
|
|
7
8
|
var menuSurfaceClass = cn(
|
|
8
|
-
"rounded-xl border border-border-subtle bg-bg-popover",
|
|
9
|
-
"[box-shadow:0_1px_3px_0_var(--effect-shadow-sm),0_1px_2px_-1px_var(--effect-shadow-sm)]"
|
|
9
|
+
"sa:rounded-xl sa:border sa:border-border-subtle sa:bg-bg-popover",
|
|
10
|
+
"sa:[box-shadow:0_1px_3px_0_var(--effect-shadow-sm),0_1px_2px_-1px_var(--effect-shadow-sm)]"
|
|
10
11
|
);
|
|
11
|
-
var menuGroupClass = "flex flex-col gap-1 not-last:after:block not-last:after:h-px not-last:after:bg-bg-muted";
|
|
12
|
-
var menuGroupLabelClass = "flex h-6 items-center px-3 text-xs leading-3 tracking-normal text-text-subtle";
|
|
12
|
+
var menuGroupClass = "sa:flex sa:flex-col sa:gap-1 sa:not-last:after:block sa:not-last:after:h-px sa:not-last:after:bg-bg-muted";
|
|
13
|
+
var menuGroupLabelClass = "sa:flex sa:h-6 sa:items-center sa:px-3 sa:text-xs sa:leading-3 sa:tracking-normal sa:text-text-subtle";
|
|
13
14
|
function DropdownMenu({
|
|
14
15
|
trigger,
|
|
15
16
|
children,
|
|
@@ -30,19 +31,19 @@ function DropdownMenu({
|
|
|
30
31
|
/* @__PURE__ */ jsx(DropdownMenu$1.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
31
32
|
DropdownMenu$1.Content,
|
|
32
33
|
{
|
|
34
|
+
collisionPadding: 8,
|
|
35
|
+
...props,
|
|
33
36
|
"data-slot": "dropdown-menu",
|
|
34
|
-
"aria-label": props["aria-label"],
|
|
35
37
|
side,
|
|
36
38
|
align,
|
|
37
39
|
sideOffset,
|
|
38
|
-
collisionPadding: 8,
|
|
39
40
|
onFocusOutside,
|
|
40
41
|
className: cn(
|
|
41
|
-
"pointer-events-auto z-50 flex w-[255px] max-w-[520px] flex-col gap-1 overflow-x-clip overflow-y-auto p-1",
|
|
42
|
-
"max-h-(--radix-dropdown-menu-content-available-height)",
|
|
42
|
+
"sa:pointer-events-auto sa:z-50 sa:flex sa:w-[255px] sa:max-w-[520px] sa:flex-col sa:gap-1 sa:overflow-x-clip sa:overflow-y-auto sa:p-1",
|
|
43
|
+
"sa:max-h-(--radix-dropdown-menu-content-available-height)",
|
|
43
44
|
menuSurfaceClass,
|
|
44
|
-
"origin-(--radix-dropdown-menu-content-transform-origin) outline-none",
|
|
45
|
-
"data-[state=open]:animate-[satin-enter_var(--duration-base)_var(--ease-out)]",
|
|
45
|
+
"sa:origin-(--radix-dropdown-menu-content-transform-origin) sa:outline-none",
|
|
46
|
+
"sa:data-[state=open]:animate-[satin-enter_var(--sa-duration-base)_var(--sa-ease-out)]",
|
|
46
47
|
className
|
|
47
48
|
),
|
|
48
49
|
children
|
|
@@ -65,11 +66,11 @@ function DropdownMenuGroup({ label, children, className, ...props }) {
|
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
68
|
var menuItemClass = cn(
|
|
68
|
-
"flex min-h-menu-row w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-1.5 text-left outline-none select-none focus-visible:ring-0",
|
|
69
|
-
"transition-colors duration-(--duration-fast) ease-(--ease-out)",
|
|
70
|
-
"data-[highlighted]:bg-bg-selected data-[force=hover]:bg-bg-selected data-[selected]:bg-bg-selected",
|
|
71
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
72
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
69
|
+
"sa:flex sa:min-h-menu-row sa:w-full sa:cursor-pointer sa:items-center sa:gap-2 sa:rounded-lg sa:px-3 sa:py-1.5 sa:text-left sa:outline-none sa:select-none sa:focus-visible:ring-0",
|
|
70
|
+
"sa:transition-colors sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
71
|
+
"sa:data-[highlighted]:bg-bg-selected sa:data-[force=hover]:bg-bg-selected sa:data-[selected]:bg-bg-selected",
|
|
72
|
+
"sa:data-[disabled]:pointer-events-none sa:data-[disabled]:opacity-50",
|
|
73
|
+
"sa:[&_svg]:pointer-events-none sa:[&_svg]:shrink-0"
|
|
73
74
|
);
|
|
74
75
|
function MenuItemContent({
|
|
75
76
|
label,
|
|
@@ -81,27 +82,32 @@ function MenuItemContent({
|
|
|
81
82
|
shortcut,
|
|
82
83
|
renderLabel = (l) => l
|
|
83
84
|
}) {
|
|
85
|
+
const labels = useSatinLabels();
|
|
84
86
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
87
|
icon ? /* @__PURE__ */ jsx(
|
|
86
88
|
"span",
|
|
87
89
|
{
|
|
88
90
|
className: cn(
|
|
89
|
-
"grid shrink-0 place-items-center text-text-muted",
|
|
90
|
-
iconSize === 20 ? "size-5 [&_svg]:size-5 [&_svg]:[stroke-width:1.5]" : "size-4 [&_svg]:size-4 [&_svg]:[stroke-width:1.875]"
|
|
91
|
+
"sa:grid sa:shrink-0 sa:place-items-center sa:text-text-muted",
|
|
92
|
+
iconSize === 20 ? "sa:size-5 sa:[&_svg]:size-5 sa:[&_svg]:[stroke-width:1.5]" : "sa:size-4 sa:[&_svg]:size-4 sa:[&_svg]:[stroke-width:1.875]"
|
|
91
93
|
),
|
|
92
94
|
children: icon
|
|
93
95
|
}
|
|
94
96
|
) : null,
|
|
95
|
-
layout === "stacked" ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col justify-center gap-0.5", children: [
|
|
96
|
-
/* @__PURE__ */ jsx("span", { className: "text-base leading-5 font-medium text-text-default", children: renderLabel(label) }),
|
|
97
|
-
description ? /* @__PURE__ */ jsx("span", { className: "text-sm leading-[18px] text-text-muted", children: description }) : null
|
|
98
|
-
] }) : /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-baseline gap-3", children: [
|
|
99
|
-
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-base leading-5 font-medium whitespace-nowrap text-text-default", children: renderLabel(label) }),
|
|
100
|
-
description ? /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-sm text-text-muted", children: description }) : null
|
|
97
|
+
layout === "stacked" ? /* @__PURE__ */ jsxs("span", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:flex-col sa:justify-center sa:gap-0.5", children: [
|
|
98
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-base sa:leading-5 sa:font-medium sa:text-text-default", children: renderLabel(label) }),
|
|
99
|
+
description ? /* @__PURE__ */ jsx("span", { className: "sa:text-sm sa:leading-[18px] sa:text-text-muted", children: description }) : null
|
|
100
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:items-baseline sa:gap-3", children: [
|
|
101
|
+
/* @__PURE__ */ jsx("span", { className: "sa:shrink-0 sa:text-base sa:leading-5 sa:font-medium sa:whitespace-nowrap sa:text-text-default", children: renderLabel(label) }),
|
|
102
|
+
description ? /* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate sa:text-sm sa:text-text-muted", children: description }) : null
|
|
101
103
|
] }),
|
|
102
104
|
shortcut && /* @__PURE__ */ jsx(KbdGroup, { keys: shortcut, "aria-hidden": true }),
|
|
103
|
-
selected && /* @__PURE__ */
|
|
104
|
-
|
|
105
|
+
selected && /* @__PURE__ */ jsxs("span", { className: "sa:sr-only", children: [
|
|
106
|
+
"(",
|
|
107
|
+
labels.selected,
|
|
108
|
+
")"
|
|
109
|
+
] }),
|
|
110
|
+
selected && /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, className: "sa:text-status-green-fg", children: /* @__PURE__ */ jsx(
|
|
105
111
|
"path",
|
|
106
112
|
{
|
|
107
113
|
d: "M3.33333 8.66667L6 11.3333L12.6667 4.66667",
|
|
@@ -149,5 +155,3 @@ function DropdownMenuItem({
|
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
export { DropdownMenu, DropdownMenuGroup, DropdownMenuItem, MenuItemContent, menuGroupClass, menuGroupLabelClass, menuItemClass, menuSurfaceClass };
|
|
152
|
-
//# sourceMappingURL=chunk-3DINAQLL.js.map
|
|
153
|
-
//# sourceMappingURL=chunk-3DINAQLL.js.map
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { useSlidingIndicator } from './chunk-XETMIETJ.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Tabs as Tabs$1 } from 'radix-ui';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var list = cva("sa:relative sa:flex", {
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
// The rule is an inset shadow, so the 2px indicator can sit on top of it (as in Figma).
|
|
12
|
+
underline: "sa:items-end sa:gap-8 sa:[box-shadow:inset_0_-1px_0_var(--border-default)]",
|
|
13
|
+
pill: "sa:items-center sa:gap-1"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var trigger = cva(
|
|
18
|
+
[
|
|
19
|
+
"sa:group/tab sa:relative sa:flex sa:shrink-0 sa:items-center sa:font-medium sa:whitespace-nowrap sa:text-text-muted sa:select-none",
|
|
20
|
+
"sa:transition-[color,background-color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
21
|
+
"sa:focus-visible:outline-none sa:disabled:pointer-events-none sa:disabled:opacity-50",
|
|
22
|
+
"sa:satin-hover:text-text-default sa:satin-focus:text-text-default sa:data-[state=active]:text-text-default",
|
|
23
|
+
"sa:[&_svg]:pointer-events-none sa:[&_svg]:size-4 sa:[&_svg]:shrink-0 sa:[&_svg]:[stroke-width:1.875]"
|
|
24
|
+
],
|
|
25
|
+
{
|
|
26
|
+
variants: {
|
|
27
|
+
variant: {
|
|
28
|
+
underline: "",
|
|
29
|
+
pill: [
|
|
30
|
+
"sa:rounded-pill",
|
|
31
|
+
"sa:data-[state=inactive]:satin-hover:bg-bg-muted",
|
|
32
|
+
"sa:satin-focus:[box-shadow:0_0_0_1px_var(--border-focus)]"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
md: "sa:text-base",
|
|
37
|
+
sm: "sa:text-sm"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
compoundVariants: [
|
|
41
|
+
{ variant: "sa:underline", size: "md", className: "sa:h-control-height-xl" },
|
|
42
|
+
{ variant: "sa:underline", size: "sm", className: "sa:h-control-height-lg" },
|
|
43
|
+
{ variant: "pill", size: "md", className: "sa:h-control-height-lg sa:px-3" },
|
|
44
|
+
{ variant: "pill", size: "sm", className: "sa:h-control-height sa:px-2.5" }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
function normalize(item) {
|
|
49
|
+
return typeof item === "string" ? { value: item, label: item } : item;
|
|
50
|
+
}
|
|
51
|
+
function Tabs({
|
|
52
|
+
items,
|
|
53
|
+
value,
|
|
54
|
+
defaultValue,
|
|
55
|
+
onValueChange,
|
|
56
|
+
variant = "underline",
|
|
57
|
+
size = "md",
|
|
58
|
+
disabled = false,
|
|
59
|
+
children,
|
|
60
|
+
className,
|
|
61
|
+
"aria-label": ariaLabel,
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
const tabs = items.map(normalize);
|
|
65
|
+
const listRef = React.useRef(null);
|
|
66
|
+
const [current, setCurrent] = React.useState(value ?? defaultValue ?? tabs[0]?.value);
|
|
67
|
+
const selected = value ?? current;
|
|
68
|
+
const indicator = useSlidingIndicator(listRef, '[role="tab"][data-state="active"]', `${selected}|${variant}|${size}|${tabs.length}`);
|
|
69
|
+
return /* @__PURE__ */ jsxs(
|
|
70
|
+
Tabs$1.Root,
|
|
71
|
+
{
|
|
72
|
+
...props,
|
|
73
|
+
"data-slot": "tabs",
|
|
74
|
+
value,
|
|
75
|
+
defaultValue: defaultValue ?? (value === void 0 ? tabs[0]?.value : void 0),
|
|
76
|
+
onValueChange: (v) => {
|
|
77
|
+
setCurrent(v);
|
|
78
|
+
onValueChange?.(v);
|
|
79
|
+
},
|
|
80
|
+
className: cn("sa:flex sa:flex-col", className),
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsxs(Tabs$1.List, { ref: listRef, "aria-label": ariaLabel, className: list({ variant }), children: [
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
"span",
|
|
85
|
+
{
|
|
86
|
+
ref: indicator.ref,
|
|
87
|
+
"aria-hidden": true,
|
|
88
|
+
className: cn(
|
|
89
|
+
"sa:pointer-events-none sa:absolute sa:left-0 sa:opacity-0",
|
|
90
|
+
variant === "sa:underline" ? "sa:bottom-0 sa:z-10 sa:h-0.5 sa:rounded-full sa:bg-action-primary-bg" : "sa:top-1/2 sa:z-0 sa:-translate-y-1/2 sa:rounded-pill sa:bg-bg-selected",
|
|
91
|
+
variant === "pill" && (size === "md" ? "sa:h-control-height-lg" : "sa:h-control-height")
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
tabs.map((tab) => /* @__PURE__ */ jsxs(
|
|
96
|
+
Tabs$1.Trigger,
|
|
97
|
+
{
|
|
98
|
+
value: tab.value,
|
|
99
|
+
disabled: disabled || tab.disabled,
|
|
100
|
+
...children == null && { "aria-controls": void 0 },
|
|
101
|
+
className: cn(
|
|
102
|
+
trigger({ variant, size }),
|
|
103
|
+
variant === "pill" && "sa:z-10",
|
|
104
|
+
// Before the indicator is placed (server render), the selected tab paints its own.
|
|
105
|
+
!indicator.ready && variant === "pill" && "sa:data-[state=active]:bg-bg-selected"
|
|
106
|
+
),
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsxs(
|
|
109
|
+
"span",
|
|
110
|
+
{
|
|
111
|
+
className: cn(
|
|
112
|
+
"sa:flex sa:items-center sa:gap-1.5 sa:rounded-sm",
|
|
113
|
+
variant === "sa:underline" && "sa:group-focus-visible/tab:[box-shadow:inset_0_0_0_1.5px_var(--border-focus)] sa:group-data-[force=focus]/tab:[box-shadow:inset_0_0_0_1.5px_var(--border-focus)]"
|
|
114
|
+
),
|
|
115
|
+
children: [
|
|
116
|
+
tab.icon,
|
|
117
|
+
tab.label
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
variant === "underline" && /* @__PURE__ */ jsx(
|
|
122
|
+
"span",
|
|
123
|
+
{
|
|
124
|
+
"aria-hidden": true,
|
|
125
|
+
className: cn(
|
|
126
|
+
"sa:absolute sa:inset-x-0 sa:bottom-0 sa:h-0.5 sa:rounded-full sa:bg-transparent",
|
|
127
|
+
"sa:transition-colors sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
128
|
+
"sa:group-data-[state=inactive]/tab:group-hover/tab:bg-border-strong sa:group-data-[state=inactive]/tab:group-data-[force=hover]/tab:bg-border-strong",
|
|
129
|
+
!indicator.ready && "sa:group-data-[state=active]/tab:bg-action-primary-bg"
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
tab.value
|
|
136
|
+
))
|
|
137
|
+
] }),
|
|
138
|
+
children
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
function TabsContent({ className, ...props }) {
|
|
144
|
+
return /* @__PURE__ */ jsx(Tabs$1.Content, { "data-slot": "tabs-content", className: cn("sa:rounded-md sa:focus-visible:shadow-border-focus sa:focus-visible:outline-none", className), ...props });
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { Tabs, TabsContent };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartCard, defaultFormat, ChartLegendPill } from './chunk-
|
|
1
|
+
import { ChartCard, defaultFormat, ChartLegendPill } from './chunk-LI5VYDLN.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -23,11 +23,11 @@ function DonutCard({ data, formatValue = defaultFormat, highlight, centerLabel =
|
|
|
23
23
|
return /* @__PURE__ */ jsx(ChartCard, { ...props, children: /* @__PURE__ */ jsxs(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
className: "flex flex-col items-center gap-4
|
|
26
|
+
className: "sa:flex sa:flex-col sa:items-center sa:gap-4 sa:@min-[560px]:flex-row sa:@min-[560px]:gap-8",
|
|
27
27
|
onPointerLeave: () => setHovered(null),
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */ jsxs("div", { className: "relative shrink-0 py-2", style: { width: SIZE }, children: [
|
|
30
|
-
/* @__PURE__ */ jsx("svg", { width: SIZE, height: SIZE, viewBox: `0 0 ${SIZE} ${SIZE}`, "aria-hidden": true, className: "block
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:relative sa:shrink-0 sa:py-2", style: { width: SIZE }, children: [
|
|
30
|
+
/* @__PURE__ */ jsx("svg", { width: SIZE, height: SIZE, viewBox: `0 0 ${SIZE} ${SIZE}`, "aria-hidden": true, className: "sa:block sa:-rotate-90", children: arcs.map(({ i, start, len }) => /* @__PURE__ */ jsx(
|
|
31
31
|
"circle",
|
|
32
32
|
{
|
|
33
33
|
cx: SIZE / 2,
|
|
@@ -39,20 +39,20 @@ function DonutCard({ data, formatValue = defaultFormat, highlight, centerLabel =
|
|
|
39
39
|
strokeDasharray: `${len} ${C - len}`,
|
|
40
40
|
strokeDashoffset: -start,
|
|
41
41
|
onPointerEnter: () => setHovered(i),
|
|
42
|
-
className: "transition-opacity duration-(--duration-fast) ease-(--ease-out)",
|
|
42
|
+
className: "sa:transition-opacity sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
43
43
|
style: { opacity: active !== null && active !== i ? 0.15 : 1 }
|
|
44
44
|
},
|
|
45
45
|
data[i].label
|
|
46
46
|
)) }),
|
|
47
|
-
/* @__PURE__ */ jsxs("div", { "aria-live": "polite", className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center", children: [
|
|
48
|
-
/* @__PURE__ */ jsx("span", { className: "text-xl leading-(--text-xl--line-height) font-semibold text-text-default tabular-nums", children: formatValue(active != null ? data[active].value : sum) }),
|
|
49
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm leading-(--text-sm--line-height) text-text-muted", children: active != null ? `${data[active].label} \xB7 ${share(data[active].value)}%` : centerLabel })
|
|
47
|
+
/* @__PURE__ */ jsxs("div", { "aria-live": "polite", className: "sa:pointer-events-none sa:absolute sa:inset-0 sa:flex sa:flex-col sa:items-center sa:justify-center sa:text-center", children: [
|
|
48
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-xl sa:leading-(--sa-text-xl--line-height) sa:font-semibold sa:text-text-default sa:tabular-nums", children: formatValue(active != null ? data[active].value : sum) }),
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-sm sa:leading-(--sa-text-sm--line-height) sa:text-text-muted", children: active != null ? `${data[active].label} \xB7 ${share(data[active].value)}%` : centerLabel })
|
|
50
50
|
] })
|
|
51
51
|
] }),
|
|
52
52
|
/* @__PURE__ */ jsx(
|
|
53
53
|
"ul",
|
|
54
54
|
{
|
|
55
|
-
className: "grid w-full grid-cols-2 gap-x-4 gap-y-2 px-2
|
|
55
|
+
className: "sa:grid sa:w-full sa:grid-cols-2 sa:gap-x-4 sa:gap-y-2 sa:px-2 sa:@min-[560px]:flex sa:@min-[560px]:flex-1 sa:@min-[560px]:flex-col sa:@min-[560px]:gap-1 sa:@min-[560px]:px-0",
|
|
56
56
|
"aria-label": props.title,
|
|
57
57
|
children: data.map((d, i) => /* @__PURE__ */ jsx(
|
|
58
58
|
"li",
|
|
@@ -62,12 +62,12 @@ function DonutCard({ data, formatValue = defaultFormat, highlight, centerLabel =
|
|
|
62
62
|
onFocus: () => setHovered(i),
|
|
63
63
|
onBlur: () => setHovered(null),
|
|
64
64
|
"aria-label": `${d.label}: ${formatValue(d.value)}, ${share(d.value)}%`,
|
|
65
|
-
className: "min-w-0 rounded-pill outline-none focus-visible:[box-shadow:0_0_0_2px_var(--action-focus-ring)]",
|
|
65
|
+
className: "sa:min-w-0 sa:rounded-pill sa:outline-none sa:focus-visible:[box-shadow:0_0_0_2px_var(--action-focus-ring)]",
|
|
66
66
|
children: /* @__PURE__ */ jsx(
|
|
67
67
|
ChartLegendPill,
|
|
68
68
|
{
|
|
69
69
|
variant: "plain",
|
|
70
|
-
className: "flex w-full",
|
|
70
|
+
className: "sa:flex sa:w-full",
|
|
71
71
|
color: seriesColor(i),
|
|
72
72
|
label: d.label,
|
|
73
73
|
active: active === i,
|
|
@@ -85,5 +85,3 @@ function DonutCard({ data, formatValue = defaultFormat, highlight, centerLabel =
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export { DonutCard };
|
|
88
|
-
//# sourceMappingURL=chunk-CL2II6BX.js.map
|
|
89
|
-
//# sourceMappingURL=chunk-CL2II6BX.js.map
|
|
@@ -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';
|
|
@@ -21,6 +21,12 @@ function InputOTP({
|
|
|
21
21
|
id,
|
|
22
22
|
name,
|
|
23
23
|
className,
|
|
24
|
+
"aria-describedby": describedByProp,
|
|
25
|
+
ref,
|
|
26
|
+
onChange,
|
|
27
|
+
onFocus,
|
|
28
|
+
onBlur,
|
|
29
|
+
onSelect,
|
|
24
30
|
...props
|
|
25
31
|
}) {
|
|
26
32
|
const chrome = useFieldChrome({ id, disabled, error: error ? true : void 0 });
|
|
@@ -29,11 +35,19 @@ function InputOTP({
|
|
|
29
35
|
const successMessage = isSuccess && success !== true ? success : null;
|
|
30
36
|
const message = isError ? error : successMessage ?? (chrome.invalid ? null : hint);
|
|
31
37
|
const messageId = message ? `${chrome.controlId}-message` : void 0;
|
|
32
|
-
const describedBy = [chrome.describedBy, messageId].filter(Boolean).join(" ") || void 0;
|
|
38
|
+
const describedBy = [describedByProp, chrome.describedBy, messageId].filter(Boolean).join(" ") || void 0;
|
|
33
39
|
const [inner, setInner] = React.useState(defaultValue);
|
|
34
40
|
const value = (valueProp ?? inner).slice(0, length);
|
|
35
41
|
const [focused, setFocused] = React.useState(false);
|
|
36
42
|
const inputRef = React.useRef(null);
|
|
43
|
+
const setInput = React.useCallback(
|
|
44
|
+
(node) => {
|
|
45
|
+
inputRef.current = node;
|
|
46
|
+
if (typeof ref === "function") ref(node);
|
|
47
|
+
else if (ref) ref.current = node;
|
|
48
|
+
},
|
|
49
|
+
[ref]
|
|
50
|
+
);
|
|
37
51
|
const set = (raw) => {
|
|
38
52
|
const next = [...raw].filter((c) => pattern.test(c)).join("").slice(0, length);
|
|
39
53
|
if (valueProp == null) setInner(next);
|
|
@@ -42,33 +56,33 @@ function InputOTP({
|
|
|
42
56
|
};
|
|
43
57
|
const active = Math.min(value.length, length - 1);
|
|
44
58
|
const cells = Array.from({ length }, (_, i) => i);
|
|
45
|
-
return /* @__PURE__ */ jsxs(FieldChrome, { label, chrome, className: cn("w-fit", className), children: [
|
|
59
|
+
return /* @__PURE__ */ jsxs(FieldChrome, { label, chrome, className: cn("sa:w-fit", className), children: [
|
|
46
60
|
/* @__PURE__ */ jsxs(
|
|
47
61
|
"div",
|
|
48
62
|
{
|
|
49
63
|
"data-slot": "input-otp",
|
|
50
64
|
"data-disabled": chrome.disabled || void 0,
|
|
51
|
-
className: cn("relative flex w-fit items-center gap-2", chrome.disabled && "opacity-50"),
|
|
65
|
+
className: cn("sa:relative sa:flex sa:w-fit sa:items-center sa:gap-2", chrome.disabled && "sa:opacity-50"),
|
|
52
66
|
children: [
|
|
53
67
|
cells.map((i) => {
|
|
54
68
|
const isActive = focused && i === active;
|
|
55
69
|
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
56
|
-
groupSize > 0 && i > 0 && i % groupSize === 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "h-px w-2 shrink-0 bg-border-strong" }),
|
|
70
|
+
groupSize > 0 && i > 0 && i % groupSize === 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "sa:h-px sa:w-2 sa:shrink-0 sa:bg-border-strong" }),
|
|
57
71
|
/* @__PURE__ */ jsxs(
|
|
58
72
|
"span",
|
|
59
73
|
{
|
|
60
74
|
"aria-hidden": true,
|
|
61
75
|
"data-active": isActive || void 0,
|
|
62
76
|
className: cn(
|
|
63
|
-
"relative grid size-9 shrink-0 place-items-center rounded-lg border bg-bg-field text-base leading-[21px] font-medium text-text-default",
|
|
64
|
-
"[box-shadow:0_1px_2px_0_var(--effect-shadow-xs)]",
|
|
65
|
-
"transition-[border-color,box-shadow] duration-(--duration-fast) ease-(--ease-out)",
|
|
66
|
-
chrome.invalid ? "border-action-destructive-bg" : isSuccess ? "border-status-green-fg" : "border-border-default",
|
|
67
|
-
isActive && (chrome.invalid ? "[box-shadow:0_0_0_2px_var(--action-destructive-glow)]" : isSuccess ? "[box-shadow:0_0_0_2px_var(--status-green-border)]" : "border-border-focus [box-shadow:0_0_0_2px_var(--action-focus-ring)]")
|
|
77
|
+
"sa:relative sa:grid sa:size-9 sa:shrink-0 sa:place-items-center sa:rounded-lg sa:border sa:bg-bg-field sa:text-base sa:leading-[21px] sa:font-medium sa:text-text-default",
|
|
78
|
+
"sa:[box-shadow:0_1px_2px_0_var(--effect-shadow-xs)]",
|
|
79
|
+
"sa:transition-[border-color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
80
|
+
chrome.invalid ? "sa:border-action-destructive-bg" : isSuccess ? "sa:border-status-green-fg" : "sa:border-border-default",
|
|
81
|
+
isActive && (chrome.invalid ? "sa:[box-shadow:0_0_0_2px_var(--action-destructive-glow)]" : isSuccess ? "sa:[box-shadow:0_0_0_2px_var(--status-green-border)]" : "sa:border-border-focus sa:[box-shadow:0_0_0_2px_var(--action-focus-ring)]")
|
|
68
82
|
),
|
|
69
83
|
children: [
|
|
70
84
|
value[i] ?? "",
|
|
71
|
-
isActive && value.length < length && /* @__PURE__ */ jsx("span", { className: "absolute h-[18px] w-px animate-[satin-caret_1s_steps(1)_infinite] bg-text-default" })
|
|
85
|
+
isActive && value.length < length && /* @__PURE__ */ jsx("span", { className: "sa:absolute sa:h-[18px] sa:w-px sa:animate-[satin-caret_1s_steps(1)_infinite] sa:bg-text-default" })
|
|
72
86
|
]
|
|
73
87
|
}
|
|
74
88
|
)
|
|
@@ -77,18 +91,27 @@ function InputOTP({
|
|
|
77
91
|
/* @__PURE__ */ jsx(
|
|
78
92
|
"input",
|
|
79
93
|
{
|
|
80
|
-
|
|
94
|
+
...props,
|
|
95
|
+
ref: setInput,
|
|
81
96
|
id: chrome.controlId,
|
|
82
97
|
name,
|
|
83
98
|
value,
|
|
84
|
-
onChange: (e) =>
|
|
99
|
+
onChange: (e) => {
|
|
100
|
+
onChange?.(e);
|
|
101
|
+
set(e.target.value);
|
|
102
|
+
},
|
|
85
103
|
onFocus: (e) => {
|
|
104
|
+
onFocus?.(e);
|
|
86
105
|
setFocused(true);
|
|
87
106
|
const end = e.currentTarget.value.length;
|
|
88
107
|
requestAnimationFrame(() => inputRef.current?.setSelectionRange(end, end));
|
|
89
108
|
},
|
|
90
|
-
onBlur: () =>
|
|
109
|
+
onBlur: (e) => {
|
|
110
|
+
onBlur?.(e);
|
|
111
|
+
setFocused(false);
|
|
112
|
+
},
|
|
91
113
|
onSelect: (e) => {
|
|
114
|
+
onSelect?.(e);
|
|
92
115
|
const end = e.currentTarget.value.length;
|
|
93
116
|
if (e.currentTarget.selectionStart !== end) e.currentTarget.setSelectionRange(end, end);
|
|
94
117
|
},
|
|
@@ -99,9 +122,8 @@ function InputOTP({
|
|
|
99
122
|
disabled: chrome.disabled,
|
|
100
123
|
"aria-invalid": chrome.invalid || void 0,
|
|
101
124
|
"aria-describedby": describedBy,
|
|
102
|
-
"aria-label": props["aria-label"],
|
|
103
125
|
spellCheck: false,
|
|
104
|
-
className: "absolute inset-0 w-full cursor-text bg-transparent text-transparent caret-transparent outline-none selection:bg-transparent focus-visible:outline-none focus-visible:ring-0 focus-visible:[box-shadow:none] disabled:cursor-not-allowed"
|
|
126
|
+
className: "sa:absolute sa:inset-0 sa:w-full sa:cursor-text sa:bg-transparent sa:text-transparent sa:caret-transparent sa:outline-none sa:selection:bg-transparent sa:focus-visible:outline-none sa:focus-visible:ring-0 sa:focus-visible:[box-shadow:none] sa:disabled:cursor-not-allowed"
|
|
105
127
|
}
|
|
106
128
|
)
|
|
107
129
|
]
|
|
@@ -113,11 +135,11 @@ function InputOTP({
|
|
|
113
135
|
id: messageId,
|
|
114
136
|
"aria-live": "polite",
|
|
115
137
|
className: cn(
|
|
116
|
-
"flex min-h-5 w-0 min-w-full items-start gap-1.5 text-sm leading-5",
|
|
117
|
-
isError ? "text-action-destructive-bg" : successMessage ? "text-status-green-fg" : "text-text-muted"
|
|
138
|
+
"sa:flex sa:min-h-5 sa:w-0 sa:min-w-full sa:items-start sa:gap-1.5 sa:text-sm sa:leading-5",
|
|
139
|
+
isError ? "sa:text-action-destructive-bg" : successMessage ? "sa:text-status-green-fg" : "sa:text-text-muted"
|
|
118
140
|
),
|
|
119
141
|
children: [
|
|
120
|
-
successMessage && /* @__PURE__ */ jsx(CheckCircle, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0 [stroke-width:1.875]" }),
|
|
142
|
+
successMessage && /* @__PURE__ */ jsx(CheckCircle, { "aria-hidden": true, className: "sa:mt-0.5 sa:size-4 sa:shrink-0 sa:[stroke-width:1.875]" }),
|
|
121
143
|
message
|
|
122
144
|
]
|
|
123
145
|
}
|
|
@@ -126,5 +148,3 @@ function InputOTP({
|
|
|
126
148
|
}
|
|
127
149
|
|
|
128
150
|
export { InputOTP };
|
|
129
|
-
//# sourceMappingURL=chunk-XL75JRUA.js.map
|
|
130
|
-
//# sourceMappingURL=chunk-XL75JRUA.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Input } from './chunk-
|
|
2
|
-
import { TooltipBubble } from './chunk-
|
|
3
|
-
import {
|
|
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';
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import { Slider as Slider$1 } from 'radix-ui';
|
|
6
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -25,8 +26,12 @@ function Slider({
|
|
|
25
26
|
name,
|
|
26
27
|
id,
|
|
27
28
|
"aria-label": ariaLabel,
|
|
28
|
-
|
|
29
|
+
"aria-labelledby": labelledBy,
|
|
30
|
+
className,
|
|
31
|
+
onPointerDown,
|
|
32
|
+
...props
|
|
29
33
|
}) {
|
|
34
|
+
const labels = useSatinLabels();
|
|
30
35
|
const autoId = React.useId();
|
|
31
36
|
const sliderId = id ?? autoId;
|
|
32
37
|
const labelId = `${sliderId}-label`;
|
|
@@ -56,8 +61,8 @@ function Slider({
|
|
|
56
61
|
}, [dragging]);
|
|
57
62
|
React.useEffect(() => () => clearTimeout(keyTimer.current), []);
|
|
58
63
|
const readout = range ? `${formatValue(values[0])} \u2013 ${formatValue(values[1])}` : formatValue(values[0]);
|
|
59
|
-
const thumbLabel = (i) => range ? i === 0 ?
|
|
60
|
-
const fieldLabel = (i) => range ? i === 0 ?
|
|
64
|
+
const thumbLabel = (i) => range ? i === 0 ? labels.from : labels.to : void 0;
|
|
65
|
+
const fieldLabel = (i) => range ? i === 0 ? labels.from : labels.to : labels.value;
|
|
61
66
|
const commitTyped = (i, typed) => {
|
|
62
67
|
const places = decimals(step);
|
|
63
68
|
let v = Math.round((typed - min) / step) * step + min;
|
|
@@ -81,6 +86,7 @@ function Slider({
|
|
|
81
86
|
const slider = /* @__PURE__ */ jsxs(
|
|
82
87
|
Slider$1.Root,
|
|
83
88
|
{
|
|
89
|
+
...props,
|
|
84
90
|
id: sliderId,
|
|
85
91
|
"data-slot": "slider",
|
|
86
92
|
value: values,
|
|
@@ -93,18 +99,21 @@ function Slider({
|
|
|
93
99
|
orientation,
|
|
94
100
|
disabled,
|
|
95
101
|
name,
|
|
96
|
-
"aria-labelledby": label ? labelId :
|
|
97
|
-
onPointerDown: () =>
|
|
102
|
+
"aria-labelledby": label ? labelId : labelledBy,
|
|
103
|
+
onPointerDown: (e) => {
|
|
104
|
+
onPointerDown?.(e);
|
|
105
|
+
if (!disabled) setDragging(true);
|
|
106
|
+
},
|
|
98
107
|
className: cn(
|
|
99
|
-
"relative flex shrink-0 touch-none items-center select-none data-[disabled]:cursor-not-allowed",
|
|
100
|
-
vertical ? "h-40 w-5 flex-col" : "h-5 w-full min-w-0 flex-1"
|
|
108
|
+
"sa:relative sa:flex sa:shrink-0 sa:touch-none sa:items-center sa:select-none sa:data-[disabled]:cursor-not-allowed",
|
|
109
|
+
vertical ? "sa:h-40 sa:w-5 sa:flex-col" : "sa:h-5 sa:w-full sa:min-w-0 sa:flex-1"
|
|
101
110
|
),
|
|
102
111
|
children: [
|
|
103
112
|
/* @__PURE__ */ jsx(
|
|
104
113
|
Slider$1.Track,
|
|
105
114
|
{
|
|
106
|
-
className: cn("relative grow cursor-pointer overflow-hidden rounded-full bg-bg-muted", vertical ? "w-1" : "h-1"),
|
|
107
|
-
children: /* @__PURE__ */ jsx(Slider$1.Range, { className: cn("absolute rounded-full bg-action-primary-bg", vertical ? "w-full" : "h-full") })
|
|
115
|
+
className: cn("sa:relative sa:grow sa:cursor-pointer sa:overflow-hidden sa:rounded-full sa:bg-bg-muted", vertical ? "sa:w-1" : "sa:h-1"),
|
|
116
|
+
children: /* @__PURE__ */ jsx(Slider$1.Range, { className: cn("sa:absolute sa:rounded-full sa:bg-action-primary-bg", vertical ? "sa:w-full" : "sa:h-full") })
|
|
108
117
|
}
|
|
109
118
|
),
|
|
110
119
|
values.map((v, i) => /* @__PURE__ */ jsx(
|
|
@@ -125,11 +134,11 @@ function Slider({
|
|
|
125
134
|
keyTimer.current = setTimeout(() => setKeying(false), 1e3);
|
|
126
135
|
},
|
|
127
136
|
className: cn(
|
|
128
|
-
"relative block size-4 cursor-grab rounded-full border border-border-strong bg-bg-popover outline-none active:cursor-grabbing",
|
|
129
|
-
"[box-shadow:0_1px_3px_0_var(--effect-shadow-sm)]",
|
|
130
|
-
"transition-[border-color,box-shadow] duration-(--duration-fast) ease-(--ease-out)",
|
|
131
|
-
"hover:border-text-subtle focus-visible:[box-shadow:0_0_0_2px_var(--action-focus-ring)]",
|
|
132
|
-
"data-[disabled]:cursor-not-allowed data-[disabled]:hover:border-border-strong"
|
|
137
|
+
"sa:relative sa:block sa:size-4 sa:cursor-grab sa:rounded-full sa:border sa:border-border-strong sa:bg-bg-popover sa:outline-none sa:active:cursor-grabbing",
|
|
138
|
+
"sa:[box-shadow:0_1px_3px_0_var(--effect-shadow-sm)]",
|
|
139
|
+
"sa:transition-[border-color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
140
|
+
"sa:hover:border-text-subtle sa:focus-visible:[box-shadow:0_0_0_2px_var(--action-focus-ring)]",
|
|
141
|
+
"sa:data-[disabled]:cursor-not-allowed sa:data-[disabled]:hover:border-border-strong"
|
|
133
142
|
),
|
|
134
143
|
children: tooltip && /* @__PURE__ */ jsx(
|
|
135
144
|
TooltipBubble,
|
|
@@ -138,8 +147,8 @@ function Slider({
|
|
|
138
147
|
label: formatValue(v),
|
|
139
148
|
"data-visible": (dragging || keying) && focused === i ? "" : void 0,
|
|
140
149
|
className: cn(
|
|
141
|
-
"pointer-events-none absolute tabular-nums opacity-0 transition-[opacity,translate] duration-(--duration-fast) ease-(--ease-out) data-[visible]:opacity-100",
|
|
142
|
-
vertical ? "top-1/2 left-full ml-2
|
|
150
|
+
"sa:pointer-events-none sa:absolute sa:tabular-nums sa:opacity-0 sa:transition-[opacity,translate] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out) sa:data-[visible]:opacity-100",
|
|
151
|
+
vertical ? "sa:top-1/2 sa:left-full sa:ml-2 sa:-translate-x-0.5 sa:-translate-y-1/2 sa:data-[visible]:translate-x-0" : "sa:bottom-full sa:left-1/2 sa:mb-2 sa:-translate-x-1/2 sa:translate-y-0.5 sa:data-[visible]:translate-y-0"
|
|
143
152
|
)
|
|
144
153
|
}
|
|
145
154
|
)
|
|
@@ -149,9 +158,9 @@ function Slider({
|
|
|
149
158
|
]
|
|
150
159
|
}
|
|
151
160
|
);
|
|
152
|
-
const head = (label || showValue && !inputs) && /* @__PURE__ */ jsxs("div", { className: cn("flex h-[18px] items-center justify-between gap-3 whitespace-nowrap", vertical && "min-w-full"), children: [
|
|
153
|
-
label ? /* @__PURE__ */ jsx("span", { id: labelId, className: "text-sm leading-[18px] font-medium text-text-default", children: label }) : /* @__PURE__ */ jsx("span", {}),
|
|
154
|
-
showValue && !inputs && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-sm leading-[18px] text-text-muted tabular-nums", children: readout })
|
|
161
|
+
const head = (label || showValue && !inputs) && /* @__PURE__ */ jsxs("div", { className: cn("sa:flex sa:h-[18px] sa:items-center sa:justify-between sa:gap-3 sa:whitespace-nowrap", vertical && "sa:min-w-full"), children: [
|
|
162
|
+
label ? /* @__PURE__ */ jsx("span", { id: labelId, className: "sa:text-sm sa:leading-[18px] sa:font-medium sa:text-text-default", children: label }) : /* @__PURE__ */ jsx("span", {}),
|
|
163
|
+
showValue && !inputs && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "sa:text-sm sa:leading-[18px] sa:text-text-muted sa:tabular-nums", children: readout })
|
|
155
164
|
] });
|
|
156
165
|
return /* @__PURE__ */ jsxs(
|
|
157
166
|
"div",
|
|
@@ -159,14 +168,14 @@ function Slider({
|
|
|
159
168
|
"data-slot": "slider-field",
|
|
160
169
|
"data-orientation": orientation,
|
|
161
170
|
"data-disabled": disabled || void 0,
|
|
162
|
-
className: cn("flex flex-col gap-2", vertical ? "w-max items-center" : "w-full", className),
|
|
171
|
+
className: cn("sa:flex sa:flex-col sa:gap-2", vertical ? "sa:w-max sa:items-center" : "sa:w-full", className),
|
|
163
172
|
children: [
|
|
164
173
|
head,
|
|
165
|
-
vertical ? /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center gap-2", disabled && "opacity-50"), children: [
|
|
174
|
+
vertical ? /* @__PURE__ */ jsxs("div", { className: cn("sa:flex sa:flex-col sa:items-center sa:gap-2", disabled && "sa:opacity-50"), children: [
|
|
166
175
|
inputs && range && field(1),
|
|
167
176
|
slider,
|
|
168
177
|
inputs && field(0)
|
|
169
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", disabled && "opacity-50"), children: [
|
|
178
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: cn("sa:flex sa:items-center sa:gap-3", disabled && "sa:opacity-50"), children: [
|
|
170
179
|
inputs && range && field(0),
|
|
171
180
|
slider,
|
|
172
181
|
inputs && field(range ? 1 : 0)
|
|
@@ -202,12 +211,10 @@ function SliderInput({
|
|
|
202
211
|
if (e.key === "Enter") commit();
|
|
203
212
|
if (e.key === "Escape") setDraft(null);
|
|
204
213
|
},
|
|
205
|
-
wrapperClassName: "w-16 shrink-0",
|
|
206
|
-
className: "[&_input]:text-center [&_input]:tabular-nums"
|
|
214
|
+
wrapperClassName: "sa:w-16 sa:shrink-0",
|
|
215
|
+
className: "sa:[&_input]:text-center sa:[&_input]:tabular-nums"
|
|
207
216
|
}
|
|
208
217
|
);
|
|
209
218
|
}
|
|
210
219
|
|
|
211
220
|
export { Slider };
|
|
212
|
-
//# sourceMappingURL=chunk-L6NCCSIP.js.map
|
|
213
|
-
//# sourceMappingURL=chunk-L6NCCSIP.js.map
|