@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,10 +1,11 @@
|
|
|
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 { Clock, DoubleCheck, ThumbsUp, ThumbsDown, Copy, Link } from 'iconoir-react';
|
|
5
6
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
7
|
|
|
7
|
-
var divider = /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "h-3 w-px shrink-0 rounded-full bg-border-default" });
|
|
8
|
+
var divider = /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "sa:h-3 sa:w-px sa:shrink-0 sa:rounded-full sa:bg-border-default" });
|
|
8
9
|
function MessageActions({
|
|
9
10
|
timestamp,
|
|
10
11
|
status = "delivered",
|
|
@@ -16,6 +17,7 @@ function MessageActions({
|
|
|
16
17
|
className,
|
|
17
18
|
...props
|
|
18
19
|
}) {
|
|
20
|
+
const labels = useSatinLabels();
|
|
19
21
|
const [feedback, setFeedback] = React.useState(feedbackProp);
|
|
20
22
|
React.useEffect(() => setFeedback(feedbackProp), [feedbackProp]);
|
|
21
23
|
const toggle = (value) => {
|
|
@@ -23,26 +25,26 @@ function MessageActions({
|
|
|
23
25
|
setFeedback(next);
|
|
24
26
|
onFeedback?.(next);
|
|
25
27
|
};
|
|
26
|
-
const thumb = "aria-pressed:bg-border-input aria-pressed:[&_svg]:text-text-subtle";
|
|
27
|
-
return /* @__PURE__ */ jsxs("div", { "data-slot": "message-actions", className: cn("flex items-center gap-2", className), ...props, children: [
|
|
28
|
+
const thumb = "sa:aria-pressed:bg-border-input sa:aria-pressed:[&_svg]:text-text-subtle";
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "message-actions", className: cn("sa:flex sa:items-center sa:gap-2", className), ...props, children: [
|
|
28
30
|
timestamp && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
|
|
30
|
-
/* @__PURE__ */ jsxs("span", { className: "flex size-6 items-center justify-center text-text-muted", children: [
|
|
31
|
-
status === "sending" ? /* @__PURE__ */ jsx(Clock, { "aria-hidden": true, className: "size-icon-size [stroke-width:1.875]" }) : /* @__PURE__ */ jsx(DoubleCheck, { "aria-hidden": true, className: "size-icon-size [stroke-width:1.875]" }),
|
|
32
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: status === "sending" ? "Sending" : "Delivered" })
|
|
31
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:flex sa:items-center sa:gap-0.5", children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:flex sa:size-6 sa:items-center sa:justify-center sa:text-text-muted", children: [
|
|
33
|
+
status === "sending" ? /* @__PURE__ */ jsx(Clock, { "aria-hidden": true, className: "sa:size-icon-size sa:[stroke-width:1.875]" }) : /* @__PURE__ */ jsx(DoubleCheck, { "aria-hidden": true, className: "sa:size-icon-size sa:[stroke-width:1.875]" }),
|
|
34
|
+
/* @__PURE__ */ jsx("span", { className: "sa:sr-only", children: status === "sending" ? "Sending" : "Delivered" })
|
|
33
35
|
] }),
|
|
34
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium whitespace-nowrap text-text-muted", children: timestamp })
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-sm sa:font-medium sa:whitespace-nowrap sa:text-text-muted", children: timestamp })
|
|
35
37
|
] }),
|
|
36
38
|
divider
|
|
37
39
|
] }),
|
|
38
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:flex sa:items-center sa:gap-0.5", children: [
|
|
39
41
|
/* @__PURE__ */ jsx(
|
|
40
42
|
Button,
|
|
41
43
|
{
|
|
42
44
|
variant: "tertiary",
|
|
43
45
|
size: "xs",
|
|
44
46
|
iconOnly: true,
|
|
45
|
-
"aria-label":
|
|
47
|
+
"aria-label": labels.goodResponse,
|
|
46
48
|
"aria-pressed": feedback === "like",
|
|
47
49
|
onClick: () => toggle("like"),
|
|
48
50
|
className: thumb,
|
|
@@ -55,14 +57,14 @@ function MessageActions({
|
|
|
55
57
|
variant: "tertiary",
|
|
56
58
|
size: "xs",
|
|
57
59
|
iconOnly: true,
|
|
58
|
-
"aria-label":
|
|
60
|
+
"aria-label": labels.badResponse,
|
|
59
61
|
"aria-pressed": feedback === "dislike",
|
|
60
62
|
onClick: () => toggle("dislike"),
|
|
61
63
|
className: thumb,
|
|
62
64
|
children: /* @__PURE__ */ jsx(ThumbsDown, {})
|
|
63
65
|
}
|
|
64
66
|
),
|
|
65
|
-
/* @__PURE__ */ jsx(Button, { variant: "tertiary", size: "xs", iconOnly: true, "aria-label":
|
|
67
|
+
/* @__PURE__ */ jsx(Button, { variant: "tertiary", size: "xs", iconOnly: true, "aria-label": labels.copy, onClick: onCopy, children: /* @__PURE__ */ jsx(Copy, {}) })
|
|
66
68
|
] }),
|
|
67
69
|
showShare && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
70
|
divider,
|
|
@@ -75,5 +77,3 @@ function MessageActions({
|
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
export { MessageActions };
|
|
78
|
-
//# sourceMappingURL=chunk-AN2RNJLR.js.map
|
|
79
|
-
//# sourceMappingURL=chunk-AN2RNJLR.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Checkbox } from './chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { Checkbox } from './chunk-W2QQQWNE.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 { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
6
|
|
|
@@ -12,7 +13,7 @@ function SortIcon({ direction }) {
|
|
|
12
13
|
viewBox: "0 0 14 14",
|
|
13
14
|
fill: "none",
|
|
14
15
|
"aria-hidden": true,
|
|
15
|
-
className: cn("shrink-0 text-text-muted", direction === "desc" && "rotate-180"),
|
|
16
|
+
className: cn("sa:shrink-0 sa:text-text-muted", direction === "desc" && "sa:rotate-180"),
|
|
16
17
|
children: /* @__PURE__ */ jsx(
|
|
17
18
|
"path",
|
|
18
19
|
{
|
|
@@ -28,23 +29,23 @@ function SortIcon({ direction }) {
|
|
|
28
29
|
}
|
|
29
30
|
var cellHover = {
|
|
30
31
|
first: [
|
|
31
|
-
"group-hover/row:rounded-l-xl group-hover/row:bg-bg-hover group-hover/row:[box-shadow:inset_1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]",
|
|
32
|
-
"group-data-[force=hover]/row:rounded-l-xl group-data-[force=hover]/row:bg-bg-hover group-data-[force=hover]/row:[box-shadow:inset_1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]"
|
|
32
|
+
"sa:group-hover/row:rounded-l-xl sa:group-hover/row:bg-bg-hover sa:group-hover/row:[box-shadow:inset_1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]",
|
|
33
|
+
"sa:group-data-[force=hover]/row:rounded-l-xl sa:group-data-[force=hover]/row:bg-bg-hover sa:group-data-[force=hover]/row:[box-shadow:inset_1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]"
|
|
33
34
|
].join(" "),
|
|
34
35
|
middle: [
|
|
35
|
-
"group-hover/row:bg-bg-hover group-hover/row:[box-shadow:inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]",
|
|
36
|
-
"group-data-[force=hover]/row:bg-bg-hover group-data-[force=hover]/row:[box-shadow:inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]"
|
|
36
|
+
"sa:group-hover/row:bg-bg-hover sa:group-hover/row:[box-shadow:inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]",
|
|
37
|
+
"sa:group-data-[force=hover]/row:bg-bg-hover sa:group-data-[force=hover]/row:[box-shadow:inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]"
|
|
37
38
|
].join(" "),
|
|
38
39
|
last: [
|
|
39
|
-
"group-hover/row:rounded-r-xl group-hover/row:bg-bg-hover group-hover/row:[box-shadow:inset_-1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]",
|
|
40
|
-
"group-data-[force=hover]/row:rounded-r-xl group-data-[force=hover]/row:bg-bg-hover group-data-[force=hover]/row:[box-shadow:inset_-1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]"
|
|
40
|
+
"sa:group-hover/row:rounded-r-xl sa:group-hover/row:bg-bg-hover sa:group-hover/row:[box-shadow:inset_-1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]",
|
|
41
|
+
"sa:group-data-[force=hover]/row:rounded-r-xl sa:group-data-[force=hover]/row:bg-bg-hover sa:group-data-[force=hover]/row:[box-shadow:inset_-1px_0_0_var(--border-strong),inset_0_1px_0_var(--border-strong),inset_0_-1px_0_var(--border-strong)]"
|
|
41
42
|
].join(" "),
|
|
42
43
|
only: [
|
|
43
|
-
"group-hover/row:rounded-xl group-hover/row:bg-bg-hover group-hover/row:[box-shadow:inset_0_0_0_1px_var(--border-strong)]",
|
|
44
|
-
"group-data-[force=hover]/row:rounded-xl group-data-[force=hover]/row:bg-bg-hover group-data-[force=hover]/row:[box-shadow:inset_0_0_0_1px_var(--border-strong)]"
|
|
44
|
+
"sa:group-hover/row:rounded-xl sa:group-hover/row:bg-bg-hover sa:group-hover/row:[box-shadow:inset_0_0_0_1px_var(--border-strong)]",
|
|
45
|
+
"sa:group-data-[force=hover]/row:rounded-xl sa:group-data-[force=hover]/row:bg-bg-hover sa:group-data-[force=hover]/row:[box-shadow:inset_0_0_0_1px_var(--border-strong)]"
|
|
45
46
|
].join(" ")
|
|
46
47
|
};
|
|
47
|
-
var rowHover = "hover:[filter:drop-shadow(0_1px_1px_var(--effect-shadow-sm))_drop-shadow(0_1px_1.5px_var(--effect-shadow-sm))] data-[force=hover]:[filter:drop-shadow(0_1px_1px_var(--effect-shadow-sm))_drop-shadow(0_1px_1.5px_var(--effect-shadow-sm))]";
|
|
48
|
+
var rowHover = "sa:hover:[filter:drop-shadow(0_1px_1px_var(--effect-shadow-sm))_drop-shadow(0_1px_1.5px_var(--effect-shadow-sm))] sa:data-[force=hover]:[filter:drop-shadow(0_1px_1px_var(--effect-shadow-sm))_drop-shadow(0_1px_1.5px_var(--effect-shadow-sm))]";
|
|
48
49
|
function compare(a, b) {
|
|
49
50
|
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
50
51
|
return String(a ?? "").localeCompare(String(b ?? ""), void 0, { numeric: true });
|
|
@@ -64,6 +65,7 @@ function Table({
|
|
|
64
65
|
className,
|
|
65
66
|
...props
|
|
66
67
|
}) {
|
|
68
|
+
const labels = useSatinLabels();
|
|
67
69
|
const [sort, setSort] = React.useState(defaultSort);
|
|
68
70
|
const [selectedState, setSelectedState] = React.useState([]);
|
|
69
71
|
const selected = selectedProp ?? selectedState;
|
|
@@ -78,7 +80,8 @@ function Table({
|
|
|
78
80
|
};
|
|
79
81
|
const sortedRows = React.useMemo(() => {
|
|
80
82
|
if (!sort || manualSort) return rows;
|
|
81
|
-
const
|
|
83
|
+
const field = (r) => r[sort.key];
|
|
84
|
+
const s = [...rows].sort((a, b) => compare(field(a), field(b)));
|
|
82
85
|
return sort.direction === "desc" ? s.reverse() : s;
|
|
83
86
|
}, [rows, sort, manualSort]);
|
|
84
87
|
const scroll = overflow === "scroll";
|
|
@@ -106,50 +109,50 @@ function Table({
|
|
|
106
109
|
ro.disconnect();
|
|
107
110
|
};
|
|
108
111
|
}, [scroll, columns, rows]);
|
|
109
|
-
const stickyFirst = (bg) => scroll ? cn("sticky z-[1]", bg) : "";
|
|
110
|
-
const firstDataLeft = selectable ? "left-6" : "left-0";
|
|
112
|
+
const stickyFirst = (bg) => scroll ? cn("sa:sticky sa:z-[1]", bg) : "";
|
|
113
|
+
const firstDataLeft = selectable ? "sa:left-6" : "sa:left-0";
|
|
111
114
|
const cellPosition = (index, count) => count === 1 ? cellHover.only : index === 0 ? cellHover.first : index === count - 1 ? cellHover.last : cellHover.middle;
|
|
112
115
|
const cellCount = columns.length + (selectable ? 1 : 0);
|
|
113
116
|
const table = /* @__PURE__ */ jsxs(
|
|
114
117
|
"table",
|
|
115
118
|
{
|
|
116
119
|
"aria-label": label,
|
|
117
|
-
className: "w-full table-fixed border-separate border-spacing-0 text-left",
|
|
120
|
+
className: "sa:w-full sa:table-fixed sa:border-separate sa:border-spacing-0 sa:text-left",
|
|
118
121
|
style: tableWidth ? { width: tableWidth, minWidth: "100%" } : { minWidth: columns.length * 120 + (selectable ? 24 : 0) },
|
|
119
122
|
children: [
|
|
120
123
|
/* @__PURE__ */ jsxs("colgroup", { children: [
|
|
121
124
|
selectable && /* @__PURE__ */ jsx("col", { style: { width: 24 } }),
|
|
122
125
|
columns.map((c) => /* @__PURE__ */ jsx("col", { style: { width: colWidth(c) } }, c.key))
|
|
123
126
|
] }),
|
|
124
|
-
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "bg-component-table-header", children: [
|
|
127
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "sa:bg-component-table-header", children: [
|
|
125
128
|
selectable && /* @__PURE__ */ jsx(
|
|
126
129
|
"th",
|
|
127
130
|
{
|
|
128
131
|
scope: "col",
|
|
129
|
-
className: cn("border-b border-border-subtle py-2 pl-2 align-middle", stickyFirst("left-0 bg-component-table-header")),
|
|
132
|
+
className: cn("sa:border-b sa:border-border-subtle sa:py-2 sa:pl-2 sa:align-middle", stickyFirst("sa:left-0 sa:bg-component-table-header")),
|
|
130
133
|
children: /* @__PURE__ */ jsx(
|
|
131
134
|
Checkbox,
|
|
132
135
|
{
|
|
133
|
-
"aria-label":
|
|
136
|
+
"aria-label": labels.selectAllRows,
|
|
134
137
|
checked: allSelected ? true : someSelected ? "indeterminate" : false,
|
|
135
138
|
onCheckedChange: (v) => setSelected(v === true ? rows.map((r) => r.id) : []),
|
|
136
|
-
className: "align-middle"
|
|
139
|
+
className: "sa:align-middle"
|
|
137
140
|
}
|
|
138
141
|
)
|
|
139
142
|
}
|
|
140
143
|
),
|
|
141
144
|
columns.map((c, i) => {
|
|
142
145
|
const active = sort?.key === c.key ? sort.direction : void 0;
|
|
143
|
-
const labelClass = "inline-flex max-w-full items-center gap-2.5 overflow-hidden rounded-md px-2 py-[3px] text-sm leading-[18px] font-medium whitespace-nowrap text-text-muted";
|
|
146
|
+
const labelClass = "sa:inline-flex sa:max-w-full sa:items-center sa:gap-2.5 sa:overflow-hidden sa:rounded-md sa:px-2 sa:py-[3px] sa:text-sm sa:leading-[18px] sa:font-medium sa:whitespace-nowrap sa:text-text-muted";
|
|
144
147
|
return /* @__PURE__ */ jsx(
|
|
145
148
|
"th",
|
|
146
149
|
{
|
|
147
150
|
scope: "col",
|
|
148
151
|
"aria-sort": c.sortable ? active === "asc" ? "ascending" : active === "desc" ? "descending" : "none" : void 0,
|
|
149
152
|
className: cn(
|
|
150
|
-
"h-8 overflow-hidden border-b border-border-subtle py-1 pr-2 pl-1 align-middle font-medium",
|
|
151
|
-
c.align === "right" && "text-right",
|
|
152
|
-
i === 0 && stickyFirst(cn(firstDataLeft, "bg-component-table-header"))
|
|
153
|
+
"sa:h-8 sa:overflow-hidden sa:border-b sa:border-border-subtle sa:py-1 sa:pr-2 sa:pl-1 sa:align-middle sa:font-medium",
|
|
154
|
+
c.align === "right" && "sa:text-right",
|
|
155
|
+
i === 0 && stickyFirst(cn(firstDataLeft, "sa:bg-component-table-header"))
|
|
153
156
|
),
|
|
154
157
|
children: c.sortable ? /* @__PURE__ */ jsxs(
|
|
155
158
|
"button",
|
|
@@ -158,11 +161,11 @@ function Table({
|
|
|
158
161
|
onClick: () => cycleSort(c.key),
|
|
159
162
|
className: cn(
|
|
160
163
|
labelClass,
|
|
161
|
-
"transition-colors duration-(--duration-fast) ease-(--ease-out) focus-visible:outline-none",
|
|
162
|
-
"satin-hover:bg-bg-hover satin-focus:bg-bg-hover satin-focus:[box-shadow:0_0_0_2px_var(--action-focus-ring)]"
|
|
164
|
+
"sa:transition-colors sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out) sa:focus-visible:outline-none",
|
|
165
|
+
"sa:satin-hover:bg-bg-hover sa:satin-focus:bg-bg-hover sa:satin-focus:[box-shadow:0_0_0_2px_var(--action-focus-ring)]"
|
|
163
166
|
),
|
|
164
167
|
children: [
|
|
165
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: c.header }),
|
|
168
|
+
/* @__PURE__ */ jsx("span", { className: "sa:truncate", children: c.header }),
|
|
166
169
|
active && /* @__PURE__ */ jsx(SortIcon, { direction: active })
|
|
167
170
|
]
|
|
168
171
|
}
|
|
@@ -174,15 +177,15 @@ function Table({
|
|
|
174
177
|
] }) }),
|
|
175
178
|
/* @__PURE__ */ jsx("tbody", { children: sortedRows.map((row, r) => {
|
|
176
179
|
const isSelected = selected.includes(row.id);
|
|
177
|
-
const rowBg = zebra && r % 2 === 1 ? "bg-component-table-zebra" : "bg-bg-card";
|
|
178
|
-
return /* @__PURE__ */ jsxs("tr", { "data-state": isSelected ? "selected" : void 0, className: cn("group/row", rowBg, rowHover), children: [
|
|
179
|
-
selectable && /* @__PURE__ */ jsx("td", { className: cn("py-2 pl-2 align-middle", cellPosition(0, cellCount), stickyFirst(cn("left-0", rowBg))), children: /* @__PURE__ */ jsx(
|
|
180
|
+
const rowBg = zebra && r % 2 === 1 ? "sa:bg-component-table-zebra" : "sa:bg-bg-card";
|
|
181
|
+
return /* @__PURE__ */ jsxs("tr", { "data-state": isSelected ? "selected" : void 0, className: cn("sa:group/row", rowBg, rowHover), children: [
|
|
182
|
+
selectable && /* @__PURE__ */ jsx("td", { className: cn("sa:py-2 sa:pl-2 sa:align-middle", cellPosition(0, cellCount), stickyFirst(cn("sa:left-0", rowBg))), children: /* @__PURE__ */ jsx(
|
|
180
183
|
Checkbox,
|
|
181
184
|
{
|
|
182
|
-
"aria-label":
|
|
185
|
+
"aria-label": `${labels.selectRow} ${r + 1}`,
|
|
183
186
|
checked: isSelected,
|
|
184
187
|
onCheckedChange: (v) => setSelected(v === true ? [...selected, row.id] : selected.filter((id) => id !== row.id)),
|
|
185
|
-
className: "align-middle"
|
|
188
|
+
className: "sa:align-middle"
|
|
186
189
|
}
|
|
187
190
|
) }),
|
|
188
191
|
columns.map((c, i) => {
|
|
@@ -192,12 +195,12 @@ function Table({
|
|
|
192
195
|
"td",
|
|
193
196
|
{
|
|
194
197
|
className: cn(
|
|
195
|
-
"h-10 overflow-hidden py-2 pr-2.5 pl-3 align-middle text-body leading-(--text-body--line-height) text-text-default",
|
|
196
|
-
c.align === "right" && "text-right",
|
|
198
|
+
"sa:h-10 sa:overflow-hidden sa:py-2 sa:pr-2.5 sa:pl-3 sa:align-middle sa:text-body sa:leading-(--sa-text-body--line-height) sa:text-text-default",
|
|
199
|
+
c.align === "right" && "sa:text-right",
|
|
197
200
|
cellPosition(i + (selectable ? 1 : 0), cellCount),
|
|
198
201
|
i === 0 && stickyFirst(cn(firstDataLeft, rowBg))
|
|
199
202
|
),
|
|
200
|
-
children: plain ? /* @__PURE__ */ jsx("span", { className: "block truncate", children: content }) : /* @__PURE__ */ jsx("div", { className: cn("flex min-w-0 items-center gap-1 overflow-hidden", c.align === "right" && "justify-end"), children: content })
|
|
203
|
+
children: plain ? /* @__PURE__ */ jsx("span", { className: "sa:block sa:truncate", children: content }) : /* @__PURE__ */ jsx("div", { className: cn("sa:flex sa:min-w-0 sa:items-center sa:gap-1 sa:overflow-hidden", c.align === "right" && "sa:justify-end"), children: content })
|
|
201
204
|
},
|
|
202
205
|
c.key
|
|
203
206
|
);
|
|
@@ -211,10 +214,10 @@ function Table({
|
|
|
211
214
|
"div",
|
|
212
215
|
{
|
|
213
216
|
"data-slot": "table",
|
|
214
|
-
className: cn("relative overflow-hidden rounded-xl border border-border-subtle bg-bg-card", className),
|
|
217
|
+
className: cn("sa:relative sa:overflow-hidden sa:rounded-xl sa:border sa:border-border-subtle sa:bg-bg-card", className),
|
|
215
218
|
...props,
|
|
216
219
|
children: scroll ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
217
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
220
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:relative", children: [
|
|
218
221
|
/* @__PURE__ */ jsx(
|
|
219
222
|
"div",
|
|
220
223
|
{
|
|
@@ -222,7 +225,7 @@ function Table({
|
|
|
222
225
|
tabIndex: 0,
|
|
223
226
|
role: "region",
|
|
224
227
|
"aria-label": label ? `${label}, scrolls sideways` : "Table, scrolls sideways",
|
|
225
|
-
className: "overflow-x-auto [scrollbar-width:none] focus-visible:outline-none [&::-webkit-scrollbar]:hidden",
|
|
228
|
+
className: "sa:overflow-x-auto sa:[scrollbar-width:none] sa:focus-visible:outline-none sa:[&::-webkit-scrollbar]:hidden",
|
|
226
229
|
children: table
|
|
227
230
|
}
|
|
228
231
|
),
|
|
@@ -231,25 +234,23 @@ function Table({
|
|
|
231
234
|
{
|
|
232
235
|
"aria-hidden": true,
|
|
233
236
|
className: cn(
|
|
234
|
-
"pointer-events-none absolute inset-y-0 right-0 w-16 bg-linear-to-r from-bg-card-fade to-bg-card",
|
|
235
|
-
"transition-opacity duration-(--duration-fast) ease-(--ease-out)",
|
|
236
|
-
bar.atEnd && "opacity-0"
|
|
237
|
+
"sa:pointer-events-none sa:absolute sa:inset-y-0 sa:right-0 sa:w-16 sa:bg-linear-to-r sa:from-bg-card-fade sa:to-bg-card",
|
|
238
|
+
"sa:transition-opacity sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out)",
|
|
239
|
+
bar.atEnd && "sa:opacity-0"
|
|
237
240
|
)
|
|
238
241
|
}
|
|
239
242
|
)
|
|
240
243
|
] }),
|
|
241
|
-
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "px-3 pt-1.5 pb-1", children: /* @__PURE__ */ jsx("div", { className: "relative h-1.5 overflow-hidden rounded-full bg-bg-muted", children: /* @__PURE__ */ jsx(
|
|
244
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "sa:px-3 sa:pt-1.5 sa:pb-1", children: /* @__PURE__ */ jsx("div", { className: "sa:relative sa:h-1.5 sa:overflow-hidden sa:rounded-full sa:bg-bg-muted", children: /* @__PURE__ */ jsx(
|
|
242
245
|
"div",
|
|
243
246
|
{
|
|
244
|
-
className: "absolute inset-y-0 left-0 rounded-full bg-border-strong",
|
|
247
|
+
className: "sa:absolute sa:inset-y-0 sa:left-0 sa:rounded-full sa:bg-border-strong",
|
|
245
248
|
style: { width: `${bar.size * 100}%`, transform: `translateX(${bar.offset / bar.size * 100}%)` }
|
|
246
249
|
}
|
|
247
250
|
) }) })
|
|
248
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-x-auto overscroll-x-contain", children: table })
|
|
251
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "sa:overflow-x-auto sa:overscroll-x-contain", children: table })
|
|
249
252
|
}
|
|
250
253
|
);
|
|
251
254
|
}
|
|
252
255
|
|
|
253
256
|
export { Table };
|
|
254
|
-
//# sourceMappingURL=chunk-X3PQANZO.js.map
|
|
255
|
-
//# sourceMappingURL=chunk-X3PQANZO.js.map
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Progress } from './chunk-LKSFTNPF.js';
|
|
2
|
+
import { Badge } from './chunk-7NV53EL5.js';
|
|
3
|
+
import { useSatinLabels } from './chunk-NTSU44FY.js';
|
|
4
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { ArrowRight } from 'iconoir-react';
|
|
7
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function AgentSuggestion({
|
|
10
|
+
kind,
|
|
11
|
+
icon,
|
|
12
|
+
meta,
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
actions,
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
const titleId = React.useId();
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"section",
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "agent-suggestion",
|
|
25
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
26
|
+
className: cn(
|
|
27
|
+
"sa:flex sa:w-full sa:max-w-[400px] sa:flex-col sa:gap-3 sa:rounded-xl sa:border sa:border-border-subtle sa:bg-bg-card sa:p-3 sa:text-text-default sa:[box-shadow:0_1px_3px_0_var(--effect-shadow-sm),0_1px_2px_-1px_var(--effect-shadow-sm)]",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-h-6 sa:items-center sa:gap-1.5", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("div", { className: "sa:flex sa:min-w-0 sa:flex-1", children: /* @__PURE__ */ jsxs(
|
|
34
|
+
Badge,
|
|
35
|
+
{
|
|
36
|
+
size: "lg",
|
|
37
|
+
tone: "neutral",
|
|
38
|
+
variant: "outline",
|
|
39
|
+
className: "sa:max-w-full sa:[&_img]:size-3.5 sa:[&_img]:shrink-0",
|
|
40
|
+
children: [
|
|
41
|
+
icon,
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "sa:truncate", children: kind })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
) }),
|
|
46
|
+
meta && /* @__PURE__ */ jsx("div", { className: "sa:flex sa:shrink-0 sa:items-center", children: meta })
|
|
47
|
+
] }),
|
|
48
|
+
(title || description) && /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:flex-col sa:gap-2", children: [
|
|
49
|
+
title && /* @__PURE__ */ jsx("div", { id: titleId, className: "sa:text-base sa:leading-[14px] sa:font-medium sa:tracking-normal sa:text-text-default", children: title }),
|
|
50
|
+
description && /* @__PURE__ */ jsx("div", { className: "sa:text-base sa:text-text-muted", children: description })
|
|
51
|
+
] }),
|
|
52
|
+
children,
|
|
53
|
+
actions && /* @__PURE__ */ jsx("div", { className: "sa:flex sa:flex-wrap sa:items-center sa:justify-end sa:gap-2 sa:pt-1", children: actions })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function AgentSuggestionQuote({
|
|
59
|
+
from,
|
|
60
|
+
avatar,
|
|
61
|
+
children,
|
|
62
|
+
className
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ jsxs("blockquote", { "data-slot": "agent-suggestion-quote", className: cn("sa:m-0 sa:flex sa:flex-col sa:gap-1 sa:rounded-lg sa:bg-bg-muted sa:px-3 sa:py-2", className), children: [
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:items-center sa:gap-1.5", children: [
|
|
66
|
+
avatar,
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-xs sa:leading-3 sa:font-medium sa:tracking-normal sa:text-text-default", children: from })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ jsx("p", { className: "sa:m-0 sa:text-base sa:text-text-muted", children })
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
function AgentSuggestionMetric({
|
|
73
|
+
value,
|
|
74
|
+
unit,
|
|
75
|
+
used,
|
|
76
|
+
max,
|
|
77
|
+
className
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "agent-suggestion-metric", className: cn("sa:flex sa:flex-col sa:gap-2", className), children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "sa:flex sa:items-baseline sa:gap-2", children: [
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "sa:text-2xl sa:leading-[1.5] sa:font-medium sa:tabular-nums", children: value }),
|
|
82
|
+
unit && /* @__PURE__ */ jsx("span", { className: "sa:text-base sa:text-text-muted", children: unit })
|
|
83
|
+
] }),
|
|
84
|
+
used != null && max != null && /* @__PURE__ */ jsx(
|
|
85
|
+
Progress,
|
|
86
|
+
{
|
|
87
|
+
value: used,
|
|
88
|
+
max,
|
|
89
|
+
showValue: false,
|
|
90
|
+
"aria-label": typeof unit === "string" ? unit : void 0,
|
|
91
|
+
className: "sa:[&_[role=progressbar]]:h-1.5"
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
function AgentSuggestionDiff({ before, after, className }) {
|
|
97
|
+
const labels = useSatinLabels();
|
|
98
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "agent-suggestion-diff", className: cn("sa:flex sa:flex-col sa:gap-1 sa:text-base", className), children: [
|
|
99
|
+
/* @__PURE__ */ jsxs("del", { className: "sa:rounded-lg sa:bg-bg-muted sa:px-2 sa:py-1.5 sa:text-text-muted", children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:sr-only", children: [
|
|
101
|
+
labels.remove,
|
|
102
|
+
": "
|
|
103
|
+
] }),
|
|
104
|
+
before
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsxs("ins", { className: "sa:rounded-lg sa:bg-status-green-bg sa:px-2 sa:py-1.5 sa:text-status-green-fg sa:no-underline", children: [
|
|
107
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:sr-only", children: [
|
|
108
|
+
labels.add,
|
|
109
|
+
": "
|
|
110
|
+
] }),
|
|
111
|
+
after
|
|
112
|
+
] })
|
|
113
|
+
] });
|
|
114
|
+
}
|
|
115
|
+
function AgentSuggestionChanges({ changes, className }) {
|
|
116
|
+
return /* @__PURE__ */ jsx("dl", { "data-slot": "agent-suggestion-changes", className: cn("sa:m-0 sa:flex sa:flex-col sa:gap-2 sa:text-base", className), children: changes.map((c, i) => /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:min-h-[21px] sa:items-center sa:gap-2", children: [
|
|
117
|
+
/* @__PURE__ */ jsx("dt", { className: "sa:w-[88px] sa:shrink-0 sa:text-text-muted", children: c.field }),
|
|
118
|
+
/* @__PURE__ */ jsxs("dd", { className: "sa:m-0 sa:flex sa:min-w-0 sa:items-center sa:gap-2", children: [
|
|
119
|
+
c.from != null && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
120
|
+
/* @__PURE__ */ jsx("del", { className: "sa:text-text-subtle", children: c.from }),
|
|
121
|
+
/* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": true, className: "sa:size-4 sa:shrink-0 sa:text-text-subtle sa:[stroke-width:1.875]" })
|
|
122
|
+
] }),
|
|
123
|
+
typeof c.to === "string" ? /* @__PURE__ */ jsx("span", { className: "sa:font-medium sa:text-text-default", children: c.to }) : c.to
|
|
124
|
+
] })
|
|
125
|
+
] }, i)) });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { AgentSuggestion, AgentSuggestionChanges, AgentSuggestionDiff, AgentSuggestionMetric, AgentSuggestionQuote };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useSlidingIndicator, SLIDE_MS } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
3
|
-
import { cn } from './chunk-
|
|
1
|
+
import { useSlidingIndicator, SLIDE_MS } from './chunk-XETMIETJ.js';
|
|
2
|
+
import { Button } from './chunk-6DWLTGRQ.js';
|
|
3
|
+
import { cn } from './chunk-EHEXE2UV.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { NavArrowLeft, NavArrowRight } from 'iconoir-react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -18,10 +18,10 @@ function paginationRange(page, pageCount, siblings = 1) {
|
|
|
18
18
|
return [1, "gap", ...span(left, right), "gap", pageCount];
|
|
19
19
|
}
|
|
20
20
|
var pageClass = cn(
|
|
21
|
-
"relative z-10 grid h-control-height min-w-control-height place-items-center overflow-hidden rounded-lg px-1.5 text-sm text-text-muted tabular-nums",
|
|
22
|
-
"transition-colors duration-(--duration-fast) ease-(--ease-out) outline-none focus-visible:shadow-border-focus",
|
|
23
|
-
"hover:bg-bg-hover hover:text-text-default",
|
|
24
|
-
"aria-[current=page]:font-medium aria-[current=page]:text-text-default aria-[current=page]:hover:bg-transparent"
|
|
21
|
+
"sa:relative sa:z-10 sa:grid sa:h-control-height sa:min-w-control-height sa:place-items-center sa:overflow-hidden sa:rounded-lg sa:px-1.5 sa:text-sm sa:text-text-muted sa:tabular-nums",
|
|
22
|
+
"sa:transition-colors sa:duration-(--sa-duration-fast) sa:ease-(--sa-ease-out) sa:outline-none sa:focus-visible:shadow-border-focus",
|
|
23
|
+
"sa:hover:bg-bg-hover sa:hover:text-text-default",
|
|
24
|
+
"sa:aria-[current=page]:font-medium sa:aria-[current=page]:text-text-default sa:aria-[current=page]:hover:bg-transparent"
|
|
25
25
|
);
|
|
26
26
|
var STRIP_MS = SLIDE_MS;
|
|
27
27
|
var STEP_PX = 32;
|
|
@@ -32,7 +32,7 @@ function PageText({ text, dir, motion }) {
|
|
|
32
32
|
return (
|
|
33
33
|
// Clipped to the wider number, so in the compact "Page 5 of 12" a moving number never runs
|
|
34
34
|
// into the words around it.
|
|
35
|
-
/* @__PURE__ */ jsxs("span", { className: "inline-grid overflow-hidden align-bottom", children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:inline-grid sa:overflow-hidden sa:align-bottom", children: [
|
|
36
36
|
state.old != null && /* @__PURE__ */ jsx(
|
|
37
37
|
"span",
|
|
38
38
|
{
|
|
@@ -40,7 +40,7 @@ function PageText({ text, dir, motion }) {
|
|
|
40
40
|
"data-motion": motion,
|
|
41
41
|
"data-phase": "out",
|
|
42
42
|
"data-dir": state.dir,
|
|
43
|
-
className: "satin-page-text col-start-1 row-start-1 text-center",
|
|
43
|
+
className: "satin-page-text sa:col-start-1 sa:row-start-1 sa:text-center",
|
|
44
44
|
onAnimationEnd: () => setState((s) => ({ ...s, old: null })),
|
|
45
45
|
children: state.old
|
|
46
46
|
},
|
|
@@ -52,7 +52,7 @@ function PageText({ text, dir, motion }) {
|
|
|
52
52
|
"data-motion": animate ? motion : void 0,
|
|
53
53
|
"data-phase": animate ? "in" : void 0,
|
|
54
54
|
"data-dir": state.dir,
|
|
55
|
-
className: "satin-page-text col-start-1 row-start-1 text-center",
|
|
55
|
+
className: "satin-page-text sa:col-start-1 sa:row-start-1 sa:text-center",
|
|
56
56
|
children: state.text
|
|
57
57
|
},
|
|
58
58
|
`n${state.n}`
|
|
@@ -143,7 +143,7 @@ function Pagination({
|
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
}, [page, motion, layout, dir]);
|
|
146
|
-
const target = (p, className2, children, extra) => getHref ? /* @__PURE__ */ jsx("a", { href: getHref(p), className: className2, onClick: () => go(p), ...extra, children }) : /* @__PURE__ */ jsx("button", { type: "button", className: cn("cursor-pointer", className2), onClick: () => go(p), ...extra, children });
|
|
146
|
+
const target = (p, className2, children, extra) => getHref ? /* @__PURE__ */ jsx("a", { href: getHref(p), className: className2, onClick: () => go(p), ...extra, children }) : /* @__PURE__ */ jsx("button", { type: "button", className: cn("sa:cursor-pointer", className2), onClick: () => go(p), ...extra, children });
|
|
147
147
|
const step = (dir2) => {
|
|
148
148
|
const to = page + dir2;
|
|
149
149
|
const disabled = to < 1 || to > pageCount;
|
|
@@ -159,32 +159,32 @@ function Pagination({
|
|
|
159
159
|
] });
|
|
160
160
|
return getHref && !disabled ? /* @__PURE__ */ jsx(Button, { asChild: true, variant: "tertiary", iconOnly: compact, "aria-label": compact ? label : void 0, children: /* @__PURE__ */ jsx("a", { href: getHref(to), rel: dir2 < 0 ? "prev" : "next", onClick: () => go(to), children: content }) }) : /* @__PURE__ */ jsx(Button, { variant: "tertiary", iconOnly: compact, "aria-label": compact ? label : void 0, disabled, onClick: () => go(to), children: content });
|
|
161
161
|
};
|
|
162
|
-
return /* @__PURE__ */ jsx("nav", { "data-slot": "pagination", "data-layout": layout, "aria-label": ariaLabel, className: cn("flex items-center", className), ...props, children: layout === "compact" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
162
|
+
return /* @__PURE__ */ jsx("nav", { "data-slot": "pagination", "data-layout": layout, "aria-label": ariaLabel, className: cn("sa:flex sa:items-center", className), ...props, children: layout === "compact" ? /* @__PURE__ */ jsxs("div", { className: "sa:flex sa:items-center sa:gap-2", children: [
|
|
163
163
|
step(-1),
|
|
164
|
-
/* @__PURE__ */ jsxs("span", { className: "text-sm text-text-muted tabular-nums", "aria-live": "polite", children: [
|
|
164
|
+
/* @__PURE__ */ jsxs("span", { className: "sa:text-sm sa:text-text-muted sa:tabular-nums", "aria-live": "polite", children: [
|
|
165
165
|
"Page ",
|
|
166
166
|
/* @__PURE__ */ jsx(PageText, { text: String(page), dir, motion: motion === "scroll" ? "scroll" : textMotion }),
|
|
167
167
|
" of ",
|
|
168
168
|
pageCount
|
|
169
169
|
] }),
|
|
170
170
|
step(1)
|
|
171
|
-
] }) : /* @__PURE__ */ jsxs("ul", { ref: listRef, className: "relative flex items-center gap-1", children: [
|
|
171
|
+
] }) : /* @__PURE__ */ jsxs("ul", { ref: listRef, className: "sa:relative sa:flex sa:items-center sa:gap-1", children: [
|
|
172
172
|
/* @__PURE__ */ jsx(
|
|
173
173
|
"li",
|
|
174
174
|
{
|
|
175
175
|
ref: pill.ref,
|
|
176
176
|
"aria-hidden": true,
|
|
177
177
|
role: "presentation",
|
|
178
|
-
className: "pointer-events-none absolute top-0 left-0 h-control-height rounded-lg bg-bg-selected opacity-0"
|
|
178
|
+
className: "sa:pointer-events-none sa:absolute sa:top-0 sa:left-0 sa:h-control-height sa:rounded-lg sa:bg-bg-selected sa:opacity-0"
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
/* @__PURE__ */ jsx("li", { ref: ghostRef, "aria-hidden": true, role: "presentation", className: "pointer-events-none absolute inset-0 overflow-visible" }),
|
|
181
|
+
/* @__PURE__ */ jsx("li", { ref: ghostRef, "aria-hidden": true, role: "presentation", className: "sa:pointer-events-none sa:absolute sa:inset-0 sa:overflow-visible" }),
|
|
182
182
|
/* @__PURE__ */ jsx("li", { children: step(-1) }),
|
|
183
183
|
motion === "scroll" ? (
|
|
184
184
|
// The strip: pages keyed by their number, the two ellipses by their side.
|
|
185
185
|
paginationRange(page, pageCount, siblings).map((p, i, all) => {
|
|
186
186
|
const key = p === "gap" ? i < all.length / 2 ? "gap-start" : "gap-end" : `p${p}`;
|
|
187
|
-
return /* @__PURE__ */ jsx("li", { "data-cell": key, className: "relative", children: p === "gap" ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn(pageClass, "pointer-events-none"), children: "\u2026" }) : target(p, pageClass, p, {
|
|
187
|
+
return /* @__PURE__ */ jsx("li", { "data-cell": key, className: "sa:relative", children: p === "gap" ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn(pageClass, "sa:pointer-events-none"), children: "\u2026" }) : target(p, pageClass, p, {
|
|
188
188
|
"aria-current": p === page ? "page" : void 0,
|
|
189
189
|
"aria-label": `Page ${p}`
|
|
190
190
|
}) }, key);
|
|
@@ -195,7 +195,7 @@ function Pagination({
|
|
|
195
195
|
const gap = p === "gap";
|
|
196
196
|
const text = /* @__PURE__ */ jsx(PageText, { text: gap ? "\u2026" : String(p), dir, motion: textMotion });
|
|
197
197
|
return /* @__PURE__ */ jsx("li", { children: gap ? React.createElement(getHref ? "a" : "button", {
|
|
198
|
-
className: cn(pageClass, "pointer-events-none"),
|
|
198
|
+
className: cn(pageClass, "sa:pointer-events-none"),
|
|
199
199
|
"aria-hidden": true,
|
|
200
200
|
tabIndex: -1,
|
|
201
201
|
...getHref ? {} : { type: "button", disabled: true },
|
|
@@ -211,5 +211,3 @@ function Pagination({
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
export { Pagination, paginationRange };
|
|
214
|
-
//# sourceMappingURL=chunk-QS4N4MNP.js.map
|
|
215
|
-
//# sourceMappingURL=chunk-QS4N4MNP.js.map
|