@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,14 +1,14 @@
|
|
|
1
|
-
import { menuSurfaceClass, MenuItemContent, menuItemClass } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
1
|
+
import { menuSurfaceClass, MenuItemContent, menuItemClass } from './chunk-P36KBUYD.js';
|
|
2
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import { ContextMenu as ContextMenu$1 } from 'radix-ui';
|
|
5
5
|
import { NavArrowRight } from 'iconoir-react';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
var contentClass = cn(
|
|
9
|
-
"pointer-events-auto z-50 flex w-[255px] max-w-[calc(100vw-16px)] flex-col overflow-x-clip overflow-y-auto p-1",
|
|
9
|
+
"sa:pointer-events-auto sa:z-50 sa:flex sa:w-[255px] sa:max-w-[calc(100vw-16px)] sa:flex-col sa:overflow-x-clip sa:overflow-y-auto sa:p-1",
|
|
10
10
|
menuSurfaceClass,
|
|
11
|
-
"outline-none data-[state=open]:animate-[satin-enter_var(--duration-base)_var(--ease-out)]"
|
|
11
|
+
"sa:outline-none sa:data-[state=open]:animate-[satin-enter_var(--sa-duration-base)_var(--sa-ease-out)]"
|
|
12
12
|
);
|
|
13
13
|
function ContextMenu({
|
|
14
14
|
trigger,
|
|
@@ -17,17 +17,19 @@ function ContextMenu({
|
|
|
17
17
|
container,
|
|
18
18
|
modal = true,
|
|
19
19
|
onFocusOutside,
|
|
20
|
-
className
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
21
22
|
}) {
|
|
22
23
|
return /* @__PURE__ */ jsxs(ContextMenu$1.Root, { onOpenChange, modal, children: [
|
|
23
24
|
/* @__PURE__ */ jsx(ContextMenu$1.Trigger, { asChild: true, children: trigger }),
|
|
24
25
|
/* @__PURE__ */ jsx(ContextMenu$1.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
25
26
|
ContextMenu$1.Content,
|
|
26
27
|
{
|
|
27
|
-
"data-slot": "context-menu",
|
|
28
28
|
collisionPadding: 8,
|
|
29
|
+
...props,
|
|
30
|
+
"data-slot": "context-menu",
|
|
29
31
|
onFocusOutside,
|
|
30
|
-
className: cn(contentClass, "origin-(--radix-context-menu-content-transform-origin)", "max-h-(--radix-context-menu-content-available-height)", className),
|
|
32
|
+
className: cn(contentClass, "sa:origin-(--radix-context-menu-content-transform-origin)", "sa:max-h-(--radix-context-menu-content-available-height)", className),
|
|
31
33
|
children
|
|
32
34
|
}
|
|
33
35
|
) })
|
|
@@ -39,13 +41,13 @@ function ContextMenuItem({ label, icon, shortcut, description, destructive, clas
|
|
|
39
41
|
{
|
|
40
42
|
"data-slot": "context-menu-item",
|
|
41
43
|
textValue: label,
|
|
42
|
-
className: cn(menuItemClass, destructive && "[&_*]:text-action-destructive-fg", className),
|
|
44
|
+
className: cn(menuItemClass, destructive && "sa:[&_*]:text-action-destructive-fg", className),
|
|
43
45
|
...props,
|
|
44
46
|
children: /* @__PURE__ */ jsx(MenuItemContent, { label, icon, shortcut, description, layout: "inline" })
|
|
45
47
|
}
|
|
46
48
|
);
|
|
47
49
|
}
|
|
48
|
-
function ContextMenuSub({ label, icon, children, disabled }) {
|
|
50
|
+
function ContextMenuSub({ label, icon, children, disabled, className, ...props }) {
|
|
49
51
|
return /* @__PURE__ */ jsxs(ContextMenu$1.Sub, { children: [
|
|
50
52
|
/* @__PURE__ */ jsxs(
|
|
51
53
|
ContextMenu$1.SubTrigger,
|
|
@@ -53,10 +55,10 @@ function ContextMenuSub({ label, icon, children, disabled }) {
|
|
|
53
55
|
"data-slot": "context-menu-sub",
|
|
54
56
|
disabled,
|
|
55
57
|
textValue: label,
|
|
56
|
-
className: cn(menuItemClass, "data-[state=open]:bg-bg-selected"),
|
|
58
|
+
className: cn(menuItemClass, "sa:data-[state=open]:bg-bg-selected"),
|
|
57
59
|
children: [
|
|
58
60
|
/* @__PURE__ */ jsx(MenuItemContent, { label, icon, layout: "inline" }),
|
|
59
|
-
/* @__PURE__ */ jsx(NavArrowRight, { "aria-hidden": true, className: "size-4 text-text-muted [stroke-width:1.875]" })
|
|
61
|
+
/* @__PURE__ */ jsx(NavArrowRight, { "aria-hidden": true, className: "sa:size-4 sa:text-text-muted sa:[stroke-width:1.875]" })
|
|
60
62
|
]
|
|
61
63
|
}
|
|
62
64
|
),
|
|
@@ -66,16 +68,15 @@ function ContextMenuSub({ label, icon, children, disabled }) {
|
|
|
66
68
|
sideOffset: 4,
|
|
67
69
|
alignOffset: -5,
|
|
68
70
|
collisionPadding: 8,
|
|
69
|
-
|
|
71
|
+
...props,
|
|
72
|
+
className: cn(contentClass, "sa:w-[220px] sa:origin-(--radix-context-menu-content-transform-origin)", className),
|
|
70
73
|
children
|
|
71
74
|
}
|
|
72
75
|
) })
|
|
73
76
|
] });
|
|
74
77
|
}
|
|
75
78
|
function ContextMenuSeparator({ className }) {
|
|
76
|
-
return /* @__PURE__ */ jsx(ContextMenu$1.Separator, { className: cn("
|
|
79
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Separator, { className: cn("sa:-mx-1 sa:my-1 sa:h-px sa:bg-bg-muted", className) });
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
export { ContextMenu, ContextMenuItem, ContextMenuSeparator, ContextMenuSub };
|
|
80
|
-
//# sourceMappingURL=chunk-PF3YBUKT.js.map
|
|
81
|
-
//# sourceMappingURL=chunk-PF3YBUKT.js.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { CloseIcon } 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 } from 'radix-ui';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function Sheet({
|
|
10
|
+
open,
|
|
11
|
+
defaultOpen,
|
|
12
|
+
onOpenChange,
|
|
13
|
+
trigger,
|
|
14
|
+
side = "right",
|
|
15
|
+
title,
|
|
16
|
+
description,
|
|
17
|
+
footer,
|
|
18
|
+
children,
|
|
19
|
+
modal = true,
|
|
20
|
+
container,
|
|
21
|
+
onOpenAutoFocus,
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
const labels = useSatinLabels();
|
|
26
|
+
const position = container ? "absolute" : "fixed";
|
|
27
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { open, defaultOpen, onOpenChange, modal, children: [
|
|
28
|
+
trigger && /* @__PURE__ */ jsx(Dialog.Trigger, { asChild: true, children: trigger }),
|
|
29
|
+
/* @__PURE__ */ jsxs(Dialog.Portal, { container, children: [
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Dialog.Overlay,
|
|
32
|
+
{
|
|
33
|
+
className: cn(
|
|
34
|
+
position,
|
|
35
|
+
"sa:inset-0 sa:z-50 sa:bg-black-a40",
|
|
36
|
+
"sa:data-[state=open]:animate-[satin-fade-in_var(--sa-duration-slow)_var(--sa-ease-out)]",
|
|
37
|
+
"sa:data-[state=closed]:animate-[satin-fade-out_var(--sa-duration-base)_var(--sa-ease-out)]"
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsxs(
|
|
42
|
+
Dialog.Content,
|
|
43
|
+
{
|
|
44
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
45
|
+
...props,
|
|
46
|
+
"data-slot": "sheet",
|
|
47
|
+
"data-side": side,
|
|
48
|
+
onOpenAutoFocus,
|
|
49
|
+
className: cn(
|
|
50
|
+
position,
|
|
51
|
+
"sa:z-50 sa:flex sa:flex-col sa:gap-4 sa:bg-bg-card sa:p-4 sa:outline-none",
|
|
52
|
+
"sa:[box-shadow:0_4px_6px_-4px_var(--effect-shadow-sm),0_10px_15px_-3px_var(--effect-shadow-sm)]",
|
|
53
|
+
// Flush with its edge: no radius and no border on the side that touches it.
|
|
54
|
+
side === "bottom" && "sa:inset-x-0 sa:bottom-0 sa:max-h-[85%] sa:rounded-t-2xl sa:border-t sa:border-border-subtle sa:pt-6",
|
|
55
|
+
side === "right" && "sa:inset-y-0 sa:right-0 sa:w-[400px] sa:max-w-[calc(100%-32px)] sa:rounded-l-2xl sa:border-l sa:border-border-subtle",
|
|
56
|
+
side === "left" && "sa:inset-y-0 sa:left-0 sa:w-[400px] sa:max-w-[calc(100%-32px)] sa:rounded-r-2xl sa:border-r sa:border-border-subtle",
|
|
57
|
+
side === "bottom" && "sa:data-[state=open]:animate-[satin-sheet-up_var(--sa-duration-slow)_var(--sa-ease-out)] sa:data-[state=closed]:animate-[satin-sheet-down_var(--sa-duration-base)_var(--sa-ease-out)]",
|
|
58
|
+
side === "right" && "sa:data-[state=open]:animate-[satin-sheet-left_var(--sa-duration-slow)_var(--sa-ease-out)] sa:data-[state=closed]:animate-[satin-sheet-right_var(--sa-duration-base)_var(--sa-ease-out)]",
|
|
59
|
+
side === "left" && "sa:data-[state=open]:animate-[satin-sheet-from-left_var(--sa-duration-slow)_var(--sa-ease-out)] sa:data-[state=closed]:animate-[satin-sheet-to-left_var(--sa-duration-base)_var(--sa-ease-out)]",
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
children: [
|
|
63
|
+
side === "bottom" && /* @__PURE__ */ jsx(
|
|
64
|
+
Dialog.Close,
|
|
65
|
+
{
|
|
66
|
+
"aria-label": labels.close,
|
|
67
|
+
className: "sa:absolute sa:inset-x-4 sa:top-0 sa:flex sa:h-6 sa:cursor-pointer sa:items-center sa:justify-center sa:rounded-lg sa:outline-none sa:focus-visible:ring-2 sa:focus-visible:ring-action-focus-ring",
|
|
68
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "sa:h-1 sa:w-9 sa:rounded-full sa:bg-border-strong" })
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { className: cn("sa:flex sa:flex-col sa:gap-0.5", side !== "bottom" && "sa:pr-8"), children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Dialog.Title, { className: "sa:text-base sa:leading-[21px] sa:font-medium sa:text-text-default", children: title }),
|
|
73
|
+
description ? /* @__PURE__ */ jsx(Dialog.Description, { className: "sa:text-sm sa:text-text-muted", children: description }) : null
|
|
74
|
+
] }),
|
|
75
|
+
children != null && /* @__PURE__ */ jsx("div", { className: "sa:flex sa:min-h-0 sa:flex-1 sa:flex-col sa:overflow-y-auto", children }),
|
|
76
|
+
footer && /* @__PURE__ */ jsx("div", { className: cn("sa:flex sa:shrink-0 sa:items-center sa:justify-end sa:gap-2", side === "bottom" && "sa:*:flex-1"), children: footer }),
|
|
77
|
+
side !== "bottom" && /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", size: "xl", iconOnly: true, "aria-label": labels.close, className: "sa:absolute sa:top-[7px] sa:right-[7px] sa:rounded-lg", children: /* @__PURE__ */ jsx(CloseIcon, {}) }) })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
var SheetClose = Dialog.Close;
|
|
85
|
+
|
|
86
|
+
export { Sheet, SheetClose };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
2
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { DropdownMenu } from 'radix-ui';
|
|
5
6
|
import { NavArrowDown, Check, Plus } from 'iconoir-react';
|
|
@@ -22,6 +23,7 @@ function AgentPicker({
|
|
|
22
23
|
disablePortal = false,
|
|
23
24
|
className
|
|
24
25
|
}) {
|
|
26
|
+
const labels = useSatinLabels();
|
|
25
27
|
const [inner, setInner] = React.useState(defaultValue ?? agents[0]?.id);
|
|
26
28
|
const value = valueProp ?? inner;
|
|
27
29
|
const current = agents.find((a) => a.id === value);
|
|
@@ -47,11 +49,14 @@ function AgentPicker({
|
|
|
47
49
|
variant,
|
|
48
50
|
size,
|
|
49
51
|
shape: "rounded",
|
|
50
|
-
className: cn("data-[state=open]:bg-action-secondary-bg-hover", className),
|
|
52
|
+
className: cn("sa:data-[state=open]:bg-action-secondary-bg-hover", className),
|
|
51
53
|
children: [
|
|
52
54
|
current && /* @__PURE__ */ jsx(AgentAvatar, { agent: current, size: 16 }),
|
|
53
|
-
/* @__PURE__ */ jsxs("span", { className: "truncate", children: [
|
|
54
|
-
current && /* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:truncate", children: [
|
|
56
|
+
current && /* @__PURE__ */ jsxs("span", { className: "sa:sr-only", children: [
|
|
57
|
+
labels.agent,
|
|
58
|
+
": "
|
|
59
|
+
] }),
|
|
55
60
|
current ? current.name : placeholder
|
|
56
61
|
] }),
|
|
57
62
|
/* @__PURE__ */ jsx(NavArrowDown, { "aria-hidden": true, "data-chevron": true })
|
|
@@ -75,21 +80,21 @@ function AgentMenu({
|
|
|
75
80
|
align: "start",
|
|
76
81
|
sideOffset: 8,
|
|
77
82
|
className: cn(
|
|
78
|
-
"z-50 flex w-[255px] max-w-[520px] flex-col gap-1 rounded-xl border border-border-subtle bg-bg-popover p-1 outline-none",
|
|
79
|
-
"[box-shadow:0_1px_3px_0_var(--effect-shadow-sm),0_1px_2px_-1px_var(--effect-shadow-sm)]",
|
|
80
|
-
"data-[state=open]:[animation:satin-enter_var(--duration-fast)_var(--ease-out)]"
|
|
83
|
+
"sa:z-50 sa:flex sa:w-[255px] sa:max-w-[520px] sa:flex-col sa:gap-1 sa:rounded-xl sa:border sa:border-border-subtle sa:bg-bg-popover sa:p-1 sa:outline-none",
|
|
84
|
+
"sa:[box-shadow:0_1px_3px_0_var(--effect-shadow-sm),0_1px_2px_-1px_var(--effect-shadow-sm)]",
|
|
85
|
+
"sa:data-[state=open]:[animation:satin-enter_var(--sa-duration-fast)_var(--sa-ease-out)]"
|
|
81
86
|
),
|
|
82
87
|
children: [
|
|
83
|
-
/* @__PURE__ */ jsx(DropdownMenu.RadioGroup, { value, onValueChange, className: "flex flex-col", children: agents.map((agent) => /* @__PURE__ */ jsx(AgentMenuItem, { agent, showDescription }, agent.id)) }),
|
|
88
|
+
/* @__PURE__ */ jsx(DropdownMenu.RadioGroup, { value, onValueChange, className: "sa:flex sa:flex-col", children: agents.map((agent) => /* @__PURE__ */ jsx(AgentMenuItem, { agent, showDescription }, agent.id)) }),
|
|
84
89
|
onCreate && /* @__PURE__ */ jsxs(
|
|
85
90
|
DropdownMenu.Item,
|
|
86
91
|
{
|
|
87
92
|
onSelect: onCreate,
|
|
88
93
|
className: cn(
|
|
89
|
-
"flex h-control-height-xs items-center gap-1 self-start rounded-md px-2 text-sm font-medium text-text-default outline-none select-none",
|
|
90
|
-
"transition-[background-color,box-shadow] duration-(--duration-fast) ease-(--ease-out)",
|
|
91
|
-
"[&_svg]:size-icon-size-sm [&_svg]:text-text-muted [&_svg]:[stroke-width:1.875]",
|
|
92
|
-
"data-highlighted:bg-bg-hover"
|
|
94
|
+
"sa:flex sa:h-control-height-xs sa:items-center sa:gap-1 sa:self-start sa:rounded-md sa:px-2 sa:text-sm sa:font-medium sa:text-text-default sa:outline-none sa:select-none",
|
|
95
|
+
"sa:transition-[background-color,box-shadow] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
96
|
+
"sa:[&_svg]:size-icon-size-sm sa:[&_svg]:text-text-muted sa:[&_svg]:[stroke-width:1.875]",
|
|
97
|
+
"sa:data-highlighted:bg-bg-hover"
|
|
93
98
|
),
|
|
94
99
|
children: [
|
|
95
100
|
/* @__PURE__ */ jsx(Plus, { "aria-hidden": true }),
|
|
@@ -112,20 +117,20 @@ function AgentMenuItem({ agent, showDescription = true, className, ...props }) {
|
|
|
112
117
|
children: [
|
|
113
118
|
/* @__PURE__ */ jsx(AgentAvatar, { agent, size: stacked ? 20 : 16 }),
|
|
114
119
|
/* @__PURE__ */ jsx(AgentRowText, { agent, stacked }),
|
|
115
|
-
/* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { className: "flex shrink-0", children: /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "size-icon-size text-status-green-fg [stroke-width:1.875]" }) })
|
|
120
|
+
/* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { className: "sa:flex sa:shrink-0", children: /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "sa:size-icon-size sa:text-status-green-fg sa:[stroke-width:1.875]" }) })
|
|
116
121
|
]
|
|
117
122
|
}
|
|
118
123
|
);
|
|
119
124
|
}
|
|
120
125
|
var agentRowClass = cn(
|
|
121
|
-
"flex min-h-8 w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left outline-none select-none",
|
|
122
|
-
"transition-[background-color] duration-(--duration-fast) ease-(--ease-out)",
|
|
123
|
-
"data-highlighted:bg-bg-selected data-[force=hover]:bg-bg-selected data-[state=checked]:bg-bg-selected"
|
|
126
|
+
"sa:flex sa:min-h-8 sa:w-full sa:items-center sa:gap-2 sa:rounded-lg sa:px-2 sa:py-1.5 sa:text-left sa:outline-none sa:select-none",
|
|
127
|
+
"sa:transition-[background-color] sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
128
|
+
"sa:data-highlighted:bg-bg-selected sa:data-[force=hover]:bg-bg-selected sa:data-[state=checked]:bg-bg-selected"
|
|
124
129
|
);
|
|
125
130
|
function AgentRowText({ agent, stacked }) {
|
|
126
|
-
return /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
|
|
127
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm leading-[13px] font-medium text-text-default", children: agent.name }),
|
|
128
|
-
stacked && /* @__PURE__ */ jsx("span", { className: "text-sm font-normal text-text-muted", children: agent.description })
|
|
131
|
+
return /* @__PURE__ */ jsxs("span", { className: "sa:flex sa:min-w-0 sa:flex-1 sa:flex-col sa:justify-center sa:gap-1", children: [
|
|
132
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-sm sa:leading-[13px] sa:font-medium sa:text-text-default", children: agent.name }),
|
|
133
|
+
stacked && /* @__PURE__ */ jsx("span", { className: "sa:text-sm sa:font-normal sa:text-text-muted", children: agent.description })
|
|
129
134
|
] });
|
|
130
135
|
}
|
|
131
136
|
function AgentPickerRow({
|
|
@@ -144,7 +149,7 @@ function AgentPickerRow({
|
|
|
144
149
|
children: [
|
|
145
150
|
/* @__PURE__ */ jsx(AgentAvatar, { agent, size: stacked ? 20 : 16 }),
|
|
146
151
|
/* @__PURE__ */ jsx(AgentRowText, { agent, stacked }),
|
|
147
|
-
state === "selected" && /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "size-icon-size shrink-0 text-status-green-fg [stroke-width:1.875]" })
|
|
152
|
+
state === "selected" && /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "sa:size-icon-size sa:shrink-0 sa:text-status-green-fg sa:[stroke-width:1.875]" })
|
|
148
153
|
]
|
|
149
154
|
}
|
|
150
155
|
);
|
|
@@ -158,8 +163,8 @@ function AgentAvatar({ agent, size = 16 }) {
|
|
|
158
163
|
"aria-hidden": true,
|
|
159
164
|
"data-tone": agent.tone ?? "brand",
|
|
160
165
|
className: cn(
|
|
161
|
-
"inline-flex shrink-0 items-center justify-center rounded-full bg-tone-bg font-semibold tracking-normal text-tone-fg",
|
|
162
|
-
size === 16 ? "size-4 text-[7px] leading-2" : "size-5 text-[9px] leading-[10px]"
|
|
166
|
+
"sa:inline-flex sa:shrink-0 sa:items-center sa:justify-center sa:rounded-full sa:bg-tone-bg sa:font-semibold sa:tracking-normal sa:text-tone-fg",
|
|
167
|
+
size === 16 ? "sa:size-4 sa:text-[7px] sa:leading-2" : "sa:size-5 sa:text-[9px] sa:leading-[10px]"
|
|
163
168
|
),
|
|
164
169
|
children: initials
|
|
165
170
|
}
|
|
@@ -196,7 +201,7 @@ function FlappyAvatar({ tone, size }) {
|
|
|
196
201
|
height: size,
|
|
197
202
|
viewBox: "0 -2.5 17 17",
|
|
198
203
|
shapeRendering: "crispEdges",
|
|
199
|
-
className: "shrink-0",
|
|
204
|
+
className: "sa:shrink-0",
|
|
200
205
|
children: FLAPPY_GRID.flatMap(
|
|
201
206
|
(row, y) => [...row].map((c, x) => c === "." ? null : /* @__PURE__ */ jsx("rect", { x, y, width: 1, height: 1, fill: FLAPPY_FILL[+c] }, `${x}-${y}`))
|
|
202
207
|
)
|
|
@@ -210,5 +215,3 @@ function toInitials(name) {
|
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
export { AgentAvatar, AgentMenuItem, AgentPicker, AgentPickerRow };
|
|
213
|
-
//# sourceMappingURL=chunk-VAGIAREV.js.map
|
|
214
|
-
//# sourceMappingURL=chunk-VAGIAREV.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function SelectableCardBody({
|
|
6
|
+
id,
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
icon,
|
|
10
|
+
size = "md",
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
const sm = size === "sm";
|
|
14
|
+
const tile = description ? sm ? 36 : 40 : 20;
|
|
15
|
+
const titleLine = description ? "sa:leading-[18px]" : "sa:leading-5";
|
|
16
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("sa:flex sa:min-w-0 sa:flex-1 sa:items-start", sm ? "sa:gap-2.5" : "sa:gap-3"), children: [
|
|
17
|
+
icon && /* @__PURE__ */ jsx(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "selectable-card-icon",
|
|
21
|
+
"aria-hidden": true,
|
|
22
|
+
style: { width: tile, height: tile, borderRadius: tile === 20 ? "var(--sa-radius-sm)" : sm ? "var(--sa-radius-md)" : void 0 },
|
|
23
|
+
children: icon
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:min-w-0 sa:flex-1 sa:text-left", children: [
|
|
27
|
+
/* @__PURE__ */ jsxs("span", { className: cn("sa:grid", !sm && "sa:gap-0.5"), children: [
|
|
28
|
+
/* @__PURE__ */ jsx("span", { id: `${id}-title`, className: cn("sa:block sa:font-medium sa:text-text-default", sm ? "sa:text-sm" : "sa:text-base", titleLine), children: title }),
|
|
29
|
+
description && // md: the theme's body size, like Banner, Card and Alert; sm: 13px.
|
|
30
|
+
/* @__PURE__ */ jsx("span", { id: `${id}-description`, className: cn("sa:block sa:text-text-muted", sm ? "sa:text-sm sa:leading-[18px]" : "sa:text-body sa:leading-5"), children: description })
|
|
31
|
+
] }),
|
|
32
|
+
children && /* @__PURE__ */ jsx("span", { className: cn("sa:block", sm ? "sa:mt-1.5" : "sa:mt-2"), children })
|
|
33
|
+
] })
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
function useSelectableIds(id, description) {
|
|
37
|
+
const autoId = React.useId();
|
|
38
|
+
const controlId = id ?? autoId;
|
|
39
|
+
return {
|
|
40
|
+
controlId,
|
|
41
|
+
"aria-labelledby": `${controlId}-title`,
|
|
42
|
+
"aria-describedby": description ? `${controlId}-description` : void 0
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { SelectableCardBody, useSelectableIds };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
var twMerge = extendTailwindMerge({
|
|
6
|
+
extend: {
|
|
7
|
+
theme: {
|
|
8
|
+
text: ["body", "body-lg", "title", "heading", "display"],
|
|
9
|
+
radius: ["pill"],
|
|
10
|
+
spacing: [
|
|
11
|
+
"control-height",
|
|
12
|
+
"control-height-xs",
|
|
13
|
+
"control-height-lg",
|
|
14
|
+
"control-height-xl",
|
|
15
|
+
"icon-size",
|
|
16
|
+
"icon-size-sm",
|
|
17
|
+
"menu-row",
|
|
18
|
+
"toast-height"
|
|
19
|
+
],
|
|
20
|
+
shadow: ["primary", "primary-focus", "destructive", "destructive-focus", "border-focus", "xs-focus"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var PREFIX = "sa:";
|
|
25
|
+
function cn(...inputs) {
|
|
26
|
+
const joined = clsx(inputs);
|
|
27
|
+
if (!joined.includes(PREFIX)) return twMerge(joined);
|
|
28
|
+
const tokens = joined.split(/\s+/).filter(Boolean);
|
|
29
|
+
const bare = tokens.map((t) => t.startsWith(PREFIX) ? t.slice(PREFIX.length) : t);
|
|
30
|
+
const kept = twMerge(bare.join(" ")).split(" ");
|
|
31
|
+
const left = /* @__PURE__ */ new Map();
|
|
32
|
+
for (const k of kept) left.set(k, (left.get(k) ?? 0) + 1);
|
|
33
|
+
const out = [];
|
|
34
|
+
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
35
|
+
const n = left.get(bare[i]) ?? 0;
|
|
36
|
+
if (n > 0) {
|
|
37
|
+
left.set(bare[i], n - 1);
|
|
38
|
+
out.push(tokens[i]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return out.reverse().join(" ");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { cn };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useFormField } from './chunk-
|
|
2
|
-
import { MenuItemContent, menuItemClass, menuGroupClass, menuGroupLabelClass, menuSurfaceClass } from './chunk-
|
|
3
|
-
import {
|
|
1
|
+
import { useFormField, FieldSizeContext } from './chunk-KITXKIYW.js';
|
|
2
|
+
import { MenuItemContent, menuItemClass, menuGroupClass, menuGroupLabelClass, menuSurfaceClass } from './chunk-P36KBUYD.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 { Select as Select$1 } from 'radix-ui';
|
|
6
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -23,6 +24,7 @@ function useFieldChrome({
|
|
|
23
24
|
disabled: disabled ?? field?.disabled ?? false,
|
|
24
25
|
invalid: Boolean(error) || (field?.invalid ?? false),
|
|
25
26
|
required: field?.required,
|
|
27
|
+
name: field?.name,
|
|
26
28
|
describedBy: [field?.describedBy, messageId].filter(Boolean).join(" ") || void 0,
|
|
27
29
|
message,
|
|
28
30
|
messageId,
|
|
@@ -36,29 +38,29 @@ function FieldChrome({
|
|
|
36
38
|
className,
|
|
37
39
|
children
|
|
38
40
|
}) {
|
|
39
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("grid w-full gap-2", className), children: [
|
|
41
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "field-chrome", className: cn("sa:grid sa:w-full sa:gap-2", className), children: [
|
|
40
42
|
label && // The row keeps the label's 18px whatever the action, so the field never moves.
|
|
41
|
-
/* @__PURE__ */ jsxs("div", { className: "flex h-[18px] items-center justify-between gap-2", children: [
|
|
42
|
-
/* @__PURE__ */ jsx("label", { htmlFor: chrome.controlId, className: "text-sm leading-[18px] font-medium text-text-default", children: label }),
|
|
43
|
-
action && /* @__PURE__ */ jsx("div", { className: "
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:h-[18px] sa:items-center sa:justify-between sa:gap-2", children: [
|
|
44
|
+
/* @__PURE__ */ jsx("label", { htmlFor: chrome.controlId, className: "sa:text-sm sa:leading-[18px] sa:font-medium sa:text-text-default", children: label }),
|
|
45
|
+
action && /* @__PURE__ */ jsx("div", { className: "sa:-my-[3px] sa:flex sa:shrink-0 sa:items-center", children: action })
|
|
44
46
|
] }),
|
|
45
47
|
children,
|
|
46
|
-
chrome.message && /* @__PURE__ */ jsx("p", { id: chrome.messageId, className: cn("text-sm", chrome.isError ? "text-action-destructive-bg" : "text-text-muted"), children: chrome.message })
|
|
48
|
+
chrome.message && /* @__PURE__ */ jsx("p", { id: chrome.messageId, className: cn("sa:text-sm", chrome.isError ? "sa:text-action-destructive-bg" : "sa:text-text-muted"), children: chrome.message })
|
|
47
49
|
] });
|
|
48
50
|
}
|
|
49
51
|
function SelectChevron({ className }) {
|
|
50
|
-
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, className: cn("satin-field-icon text-text-muted", className), children: /* @__PURE__ */ jsx("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
52
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, className: cn("satin-field-icon sa:text-text-muted", className), children: /* @__PURE__ */ jsx("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
51
53
|
}
|
|
52
54
|
function Select({
|
|
53
55
|
options,
|
|
54
56
|
value,
|
|
55
57
|
defaultValue,
|
|
56
58
|
onValueChange,
|
|
57
|
-
placeholder
|
|
59
|
+
placeholder,
|
|
58
60
|
label,
|
|
59
61
|
hint,
|
|
60
62
|
error,
|
|
61
|
-
size
|
|
63
|
+
size: ownSize,
|
|
62
64
|
leadingIcon,
|
|
63
65
|
layout = "inline",
|
|
64
66
|
iconSize = 16,
|
|
@@ -73,9 +75,12 @@ function Select({
|
|
|
73
75
|
wrapperClassName,
|
|
74
76
|
className,
|
|
75
77
|
"data-force": force,
|
|
78
|
+
"aria-describedby": describedBy,
|
|
76
79
|
...props
|
|
77
80
|
}) {
|
|
78
81
|
const chrome = useFieldChrome({ id, disabled, error, hint });
|
|
82
|
+
const size = ownSize ?? React.useContext(FieldSizeContext) ?? "md";
|
|
83
|
+
const labels = useSatinLabels();
|
|
79
84
|
const [uncontrolled, setUncontrolled] = React.useState(defaultValue);
|
|
80
85
|
const current = value ?? uncontrolled;
|
|
81
86
|
const groups = isOptionGroups(options) ? options : [{ options }];
|
|
@@ -94,11 +99,12 @@ function Select({
|
|
|
94
99
|
onOpenChange,
|
|
95
100
|
disabled: chrome.disabled,
|
|
96
101
|
required: required ?? chrome.required,
|
|
97
|
-
name,
|
|
102
|
+
name: name ?? chrome.name,
|
|
98
103
|
children: [
|
|
99
104
|
/* @__PURE__ */ jsxs(
|
|
100
105
|
Select$1.Trigger,
|
|
101
106
|
{
|
|
107
|
+
...props,
|
|
102
108
|
id: chrome.controlId,
|
|
103
109
|
"data-slot": "select-trigger",
|
|
104
110
|
"data-size": size,
|
|
@@ -107,12 +113,11 @@ function Select({
|
|
|
107
113
|
"data-disabled": chrome.disabled || void 0,
|
|
108
114
|
"data-force": force,
|
|
109
115
|
"aria-invalid": chrome.invalid || void 0,
|
|
110
|
-
"aria-describedby": chrome.describedBy,
|
|
111
|
-
"aria-label": props["aria-label"],
|
|
116
|
+
"aria-describedby": [describedBy, chrome.describedBy].filter(Boolean).join(" ") || void 0,
|
|
112
117
|
className: cn("satin-field satin-select", className),
|
|
113
118
|
children: [
|
|
114
119
|
lead && /* @__PURE__ */ jsx("span", { className: "satin-field-icon", "aria-hidden": true, children: lead }),
|
|
115
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-text-default", children: /* @__PURE__ */ jsx(Select$1.Value, { placeholder: /* @__PURE__ */ jsx("span", { className: "text-text-muted", children: placeholder }) }) }),
|
|
120
|
+
/* @__PURE__ */ jsx("span", { className: "sa:min-w-0 sa:flex-1 sa:truncate sa:text-text-default", children: /* @__PURE__ */ jsx(Select$1.Value, { placeholder: /* @__PURE__ */ jsx("span", { className: "sa:text-text-muted", children: placeholder ?? labels.select }) }) }),
|
|
116
121
|
/* @__PURE__ */ jsx(Select$1.Icon, { asChild: true, children: /* @__PURE__ */ jsx(SelectChevron, {}) })
|
|
117
122
|
]
|
|
118
123
|
}
|
|
@@ -127,13 +132,13 @@ function Select({
|
|
|
127
132
|
sideOffset: 4,
|
|
128
133
|
collisionPadding: 8,
|
|
129
134
|
className: cn(
|
|
130
|
-
"pointer-events-auto z-50 max-w-[520px] min-w-(--radix-select-trigger-width) overflow-hidden",
|
|
131
|
-
"max-h-(--radix-select-content-available-height)",
|
|
135
|
+
"sa:pointer-events-auto sa:z-50 sa:max-w-[520px] sa:min-w-(--radix-select-trigger-width) sa:overflow-hidden",
|
|
136
|
+
"sa:max-h-(--radix-select-content-available-height)",
|
|
132
137
|
menuSurfaceClass,
|
|
133
|
-
"origin-(--radix-select-content-transform-origin) outline-none",
|
|
134
|
-
"data-[state=open]:animate-[satin-enter_var(--duration-base)_var(--ease-out)]"
|
|
138
|
+
"sa:origin-(--radix-select-content-transform-origin) sa:outline-none",
|
|
139
|
+
"sa:data-[state=open]:animate-[satin-enter_var(--sa-duration-base)_var(--sa-ease-out)]"
|
|
135
140
|
),
|
|
136
|
-
children: /* @__PURE__ */ jsx(Select$1.Viewport, { className: "flex flex-col gap-1 p-1", children: groups.map((g, gi) => {
|
|
141
|
+
children: /* @__PURE__ */ jsx(Select$1.Viewport, { className: "sa:flex sa:flex-col sa:gap-1 sa:p-1", children: groups.map((g, gi) => {
|
|
137
142
|
const rows = g.options.map((o) => /* @__PURE__ */ jsx(
|
|
138
143
|
Select$1.Item,
|
|
139
144
|
{
|
|
@@ -141,7 +146,7 @@ function Select({
|
|
|
141
146
|
disabled: o.disabled,
|
|
142
147
|
textValue: o.label,
|
|
143
148
|
"data-slot": "select-item",
|
|
144
|
-
className: cn(menuItemClass, "data-[state=checked]:bg-bg-selected"),
|
|
149
|
+
className: cn(menuItemClass, "sa:data-[state=checked]:bg-bg-selected"),
|
|
145
150
|
children: /* @__PURE__ */ jsx(
|
|
146
151
|
MenuItemContent,
|
|
147
152
|
{
|
|
@@ -171,5 +176,3 @@ function Select({
|
|
|
171
176
|
}
|
|
172
177
|
|
|
173
178
|
export { FieldChrome, Select, SelectChevron, isOptionGroups, useFieldChrome };
|
|
174
|
-
//# sourceMappingURL=chunk-72OCFAPT.js.map
|
|
175
|
-
//# sourceMappingURL=chunk-72OCFAPT.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { RadioGroup as RadioGroup$1 } from 'radix-ui';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
function RadioGroup({ className, ...props }) {
|
|
7
|
-
return /* @__PURE__ */ jsx(RadioGroup$1.Root, { "data-slot": "radio-group", className: cn("grid gap-3", className), ...props });
|
|
7
|
+
return /* @__PURE__ */ jsx(RadioGroup$1.Root, { "data-slot": "radio-group", className: cn("sa:grid sa:gap-3", className), ...props });
|
|
8
8
|
}
|
|
9
9
|
function Radio({ className, label, description, placement = "left", id, disabled, ...props }) {
|
|
10
10
|
const autoId = React.useId();
|
|
@@ -19,7 +19,7 @@ function Radio({ className, label, description, placement = "left", id, disabled
|
|
|
19
19
|
"aria-labelledby": labelId,
|
|
20
20
|
"aria-describedby": descriptionId,
|
|
21
21
|
disabled,
|
|
22
|
-
className: cn("peer satin-radio", className),
|
|
22
|
+
className: cn("sa:peer satin-radio", className),
|
|
23
23
|
...props,
|
|
24
24
|
children: /* @__PURE__ */ jsx(RadioGroup$1.Indicator, { className: "satin-radio-dot" })
|
|
25
25
|
}
|
|
@@ -32,12 +32,12 @@ function Radio({ className, label, description, placement = "left", id, disabled
|
|
|
32
32
|
{
|
|
33
33
|
htmlFor: radioId,
|
|
34
34
|
"data-slot": "radio-field",
|
|
35
|
-
className: cn("flex cursor-pointer items-start gap-2 has-disabled:cursor-not-allowed has-data-disabled:cursor-not-allowed [&>:first-child]:mt-0.5", placement === "right" && "flex-row-reverse justify-between"),
|
|
35
|
+
className: cn("sa:flex sa:cursor-pointer sa:items-start sa:gap-2 sa:has-disabled:cursor-not-allowed sa:has-data-disabled:cursor-not-allowed sa:[&>:first-child]:mt-0.5", placement === "right" && "sa:flex-row-reverse sa:justify-between"),
|
|
36
36
|
children: [
|
|
37
37
|
circle,
|
|
38
|
-
/* @__PURE__ */ jsxs("div", { className: "grid min-w-0 gap-0.5 text-base text-text-default peer-data-disabled:text-text-subtle peer-data-disabled:*:text-text-subtle", children: [
|
|
39
|
-
label && /* @__PURE__ */ jsx("span", { id: labelId, className: "block leading-5 font-medium", children: label }),
|
|
40
|
-
description && /* @__PURE__ */ jsx("span", { id: descriptionId, className: "block leading-5 text-text-muted", children: description })
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:grid sa:min-w-0 sa:gap-0.5 sa:text-base sa:text-text-default sa:peer-data-disabled:text-text-subtle sa:peer-data-disabled:*:text-text-subtle sa:peer-disabled:*:text-text-subtle", children: [
|
|
39
|
+
label && /* @__PURE__ */ jsx("span", { id: labelId, className: "sa:block sa:leading-5 sa:font-medium", children: label }),
|
|
40
|
+
description && /* @__PURE__ */ jsx("span", { id: descriptionId, className: "sa:block sa:leading-5 sa:text-text-muted", children: description })
|
|
41
41
|
] })
|
|
42
42
|
]
|
|
43
43
|
}
|
|
@@ -46,5 +46,3 @@ function Radio({ className, label, description, placement = "left", id, disabled
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export { Radio, RadioGroup };
|
|
49
|
-
//# sourceMappingURL=chunk-LLHTVIM3.js.map
|
|
50
|
-
//# sourceMappingURL=chunk-LLHTVIM3.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ButtonGroup } from './chunk-GH2DEOGO.js';
|
|
2
|
+
import { DropdownMenu } from './chunk-P36KBUYD.js';
|
|
3
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
4
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function SplitButton({
|
|
9
|
+
menu,
|
|
10
|
+
menuLabel,
|
|
11
|
+
menuProps,
|
|
12
|
+
groupClassName,
|
|
13
|
+
variant = "primary",
|
|
14
|
+
size,
|
|
15
|
+
shape,
|
|
16
|
+
disabled,
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
const labels = useSatinLabels();
|
|
21
|
+
return /* @__PURE__ */ jsxs(ButtonGroup, { variant, size, shape, className: groupClassName, "data-slot": "split-button", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Button, { disabled, ...props, children }),
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
DropdownMenu,
|
|
25
|
+
{
|
|
26
|
+
align: "end",
|
|
27
|
+
...menuProps,
|
|
28
|
+
trigger: /* @__PURE__ */ jsx(Button, { iconOnly: true, "aria-label": menuLabel ?? labels.moreOptions, disabled, children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", strokeWidth: "1.25", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
29
|
+
children: menu
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { SplitButton };
|