@proteos/ui 0.42.2 → 0.43.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/dist/index.cjs +373 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +152 -2
- package/dist/index.d.ts +152 -2
- package/dist/index.js +366 -159
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/channel-icon/channel-icon.stories.tsx +44 -0
- package/src/components/channel-icon/channel-icon.test.tsx +26 -0
- package/src/components/channel-icon/channel-icon.tsx +67 -0
- package/src/components/channel-icon/index.ts +2 -0
- package/src/components/draft-message-card/draft-message-card.stories.tsx +94 -0
- package/src/components/draft-message-card/draft-message-card.test.tsx +43 -0
- package/src/components/draft-message-card/draft-message-card.tsx +111 -0
- package/src/components/draft-message-card/draft-message-review.test.tsx +170 -0
- package/src/components/draft-message-card/draft-message-review.tsx +197 -0
- package/src/components/draft-message-card/index.ts +7 -0
- package/src/components/draft-message-composer/draft-message-composer.tsx +1 -17
- package/src/components/draft-message-composer/draft-status.ts +49 -0
- package/src/components/draft-message-composer/index.ts +7 -0
- package/src/index.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -587,7 +587,7 @@ function BadgeMultiSelect({
|
|
|
587
587
|
autoFocus = false,
|
|
588
588
|
className
|
|
589
589
|
}) {
|
|
590
|
-
const
|
|
590
|
+
const styles3 = fieldControlStyles({ size, invalid: isInvalid, appearance });
|
|
591
591
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
592
592
|
const minHeight = appearance === "cell" ? "min-h-[29px]" : fieldMinHeight[size];
|
|
593
593
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
@@ -627,7 +627,7 @@ function BadgeMultiSelect({
|
|
|
627
627
|
"data-invalid": isInvalid || void 0,
|
|
628
628
|
"data-disabled": isDisabled || void 0,
|
|
629
629
|
className: chunkMWAXK66H_cjs.cn(
|
|
630
|
-
|
|
630
|
+
styles3.box(),
|
|
631
631
|
"flex flex-wrap items-center gap-1.5 cursor-pointer",
|
|
632
632
|
minHeight,
|
|
633
633
|
fieldChipPadding[size],
|
|
@@ -924,6 +924,29 @@ function CardFeatureTitle({ className, ...props }) {
|
|
|
924
924
|
function CardBody({ className, ...props }) {
|
|
925
925
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunkMWAXK66H_cjs.cn("text-[14px] leading-[1.55] text-ink-3", className) });
|
|
926
926
|
}
|
|
927
|
+
var CHANNEL_ICONS = {
|
|
928
|
+
slack: lucideReact.Hash,
|
|
929
|
+
email: lucideReact.Mail,
|
|
930
|
+
whatsapp: lucideReact.MessageCircle,
|
|
931
|
+
linkedin: lucideReact.Linkedin,
|
|
932
|
+
telegram: lucideReact.Send,
|
|
933
|
+
instagram: lucideReact.Camera,
|
|
934
|
+
messenger: lucideReact.MessagesSquare,
|
|
935
|
+
x: lucideReact.AtSign,
|
|
936
|
+
meeting: lucideReact.Mic,
|
|
937
|
+
"zoom-meeting": lucideReact.Video,
|
|
938
|
+
"google-meet": lucideReact.Video,
|
|
939
|
+
"teams-meeting": lucideReact.Video,
|
|
940
|
+
"webex-meeting": lucideReact.Video,
|
|
941
|
+
adhoc: lucideReact.AudioLines
|
|
942
|
+
};
|
|
943
|
+
function channelIcon(channel) {
|
|
944
|
+
return CHANNEL_ICONS[channel] ?? lucideReact.MessagesSquare;
|
|
945
|
+
}
|
|
946
|
+
function ChannelIcon({ channel, className, label }) {
|
|
947
|
+
const Icon = channelIcon(channel);
|
|
948
|
+
return label !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: chunkMWAXK66H_cjs.cn("size-4", className), role: "img", "aria-label": label }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: chunkMWAXK66H_cjs.cn("size-4", className), "aria-hidden": true });
|
|
949
|
+
}
|
|
927
950
|
function Checkbox({ children, className, ...props }) {
|
|
928
951
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
929
952
|
reactAriaComponents.Checkbox,
|
|
@@ -1021,7 +1044,7 @@ function Combobox({
|
|
|
1021
1044
|
allowsEmptyCollection = true,
|
|
1022
1045
|
...props
|
|
1023
1046
|
}) {
|
|
1024
|
-
const
|
|
1047
|
+
const styles3 = fieldControlStyles({ size, appearance });
|
|
1025
1048
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
1026
1049
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1027
1050
|
reactAriaComponents.ComboBox,
|
|
@@ -1040,7 +1063,7 @@ function Combobox({
|
|
|
1040
1063
|
className: chunkMWAXK66H_cjs.cn(
|
|
1041
1064
|
// Box chrome on the wrapper; the inner <input> carries the padding
|
|
1042
1065
|
// + font so the chevron button sits inside the same border + ring.
|
|
1043
|
-
|
|
1066
|
+
styles3.box(),
|
|
1044
1067
|
"flex items-center gap-1 pr-2",
|
|
1045
1068
|
focusWithin,
|
|
1046
1069
|
inputWrapperClassName
|
|
@@ -1052,7 +1075,7 @@ function Combobox({
|
|
|
1052
1075
|
placeholder,
|
|
1053
1076
|
className: chunkMWAXK66H_cjs.cn(
|
|
1054
1077
|
"flex-1 min-w-0 bg-transparent outline-none",
|
|
1055
|
-
|
|
1078
|
+
styles3.content(),
|
|
1056
1079
|
inputClassName
|
|
1057
1080
|
)
|
|
1058
1081
|
}
|
|
@@ -1492,16 +1515,16 @@ function CurrencyInput({
|
|
|
1492
1515
|
onChange({ amount: nextAmount, currency_code: nextCode });
|
|
1493
1516
|
};
|
|
1494
1517
|
const selectedSymbol = currencyOptions.find((option) => option.code === code)?.symbol ?? code;
|
|
1495
|
-
const
|
|
1518
|
+
const styles3 = fieldControlStyles({ size, appearance, ...isInvalid ? { invalid: true } : {} });
|
|
1496
1519
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
1497
1520
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn("grid grid-cols-1 gap-1.5", className), children: [
|
|
1498
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn(
|
|
1521
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn(styles3.box(), "flex items-center gap-1 pr-1", focusWithin), children: [
|
|
1499
1522
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1500
1523
|
"input",
|
|
1501
1524
|
{
|
|
1502
1525
|
className: chunkMWAXK66H_cjs.cn(
|
|
1503
1526
|
"min-w-0 flex-1 bg-transparent text-ink outline-none tabular-nums",
|
|
1504
|
-
|
|
1527
|
+
styles3.content(),
|
|
1505
1528
|
// Sit a touch lower than a standard field by trimming the vertical
|
|
1506
1529
|
// padding (cell mode keeps the fixed 29px row-editor height).
|
|
1507
1530
|
appearance === "cell" ? "" : size === "sm" ? "py-1" : "py-1.5"
|
|
@@ -2575,7 +2598,7 @@ function DatePicker({
|
|
|
2575
2598
|
className,
|
|
2576
2599
|
...props
|
|
2577
2600
|
}) {
|
|
2578
|
-
const
|
|
2601
|
+
const styles3 = fieldControlStyles({ size, appearance });
|
|
2579
2602
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
2580
2603
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2581
2604
|
reactAriaComponents.DatePicker,
|
|
@@ -2593,7 +2616,7 @@ function DatePicker({
|
|
|
2593
2616
|
className: chunkMWAXK66H_cjs.cn(
|
|
2594
2617
|
// Box chrome on the wrapper; the DateInput inside carries padding +
|
|
2595
2618
|
// font so the calendar trigger sits inside the same border + ring.
|
|
2596
|
-
|
|
2619
|
+
styles3.box(),
|
|
2597
2620
|
"flex items-center gap-1 pr-1",
|
|
2598
2621
|
focusWithin
|
|
2599
2622
|
),
|
|
@@ -2603,7 +2626,7 @@ function DatePicker({
|
|
|
2603
2626
|
{
|
|
2604
2627
|
className: chunkMWAXK66H_cjs.cn(
|
|
2605
2628
|
"flex-1 flex items-center min-w-0 text-ink",
|
|
2606
|
-
|
|
2629
|
+
styles3.content(),
|
|
2607
2630
|
// Tabular alignment for date segments — overrides content's
|
|
2608
2631
|
// font-sans on purpose.
|
|
2609
2632
|
"font-mono"
|
|
@@ -2725,7 +2748,7 @@ function DateTimePicker({
|
|
|
2725
2748
|
shouldCloseOnSelect = false,
|
|
2726
2749
|
...props
|
|
2727
2750
|
}) {
|
|
2728
|
-
const
|
|
2751
|
+
const styles3 = fieldControlStyles({ size, appearance });
|
|
2729
2752
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
2730
2753
|
const timeGranularity = granularity === "day" ? "minute" : granularity;
|
|
2731
2754
|
const { hourCycle } = props;
|
|
@@ -2748,7 +2771,7 @@ function DateTimePicker({
|
|
|
2748
2771
|
className: chunkMWAXK66H_cjs.cn(
|
|
2749
2772
|
// Box chrome on the wrapper; the DateInput inside carries padding +
|
|
2750
2773
|
// font so the calendar trigger sits inside the same border + ring.
|
|
2751
|
-
|
|
2774
|
+
styles3.box(),
|
|
2752
2775
|
"flex items-center gap-1 pr-1",
|
|
2753
2776
|
focusWithin
|
|
2754
2777
|
),
|
|
@@ -2758,7 +2781,7 @@ function DateTimePicker({
|
|
|
2758
2781
|
{
|
|
2759
2782
|
className: chunkMWAXK66H_cjs.cn(
|
|
2760
2783
|
"flex-1 flex items-center min-w-0 text-ink",
|
|
2761
|
-
|
|
2784
|
+
styles3.content(),
|
|
2762
2785
|
// Tabular alignment for date/time segments — overrides content's
|
|
2763
2786
|
// font-sans on purpose.
|
|
2764
2787
|
"font-mono"
|
|
@@ -2818,6 +2841,69 @@ function DateTimePicker({
|
|
|
2818
2841
|
}
|
|
2819
2842
|
);
|
|
2820
2843
|
}
|
|
2844
|
+
var draftMessageCardStyles = tailwindVariants.tv({
|
|
2845
|
+
slots: {
|
|
2846
|
+
root: [
|
|
2847
|
+
"flex items-center gap-2.5 rounded-md border border-accent/40 px-3 py-2",
|
|
2848
|
+
"bg-[color-mix(in_oklab,var(--color-accent)_6%,var(--color-surface))]"
|
|
2849
|
+
],
|
|
2850
|
+
icon: [
|
|
2851
|
+
"grid size-8 shrink-0 place-items-center rounded-full text-accent",
|
|
2852
|
+
"bg-[color-mix(in_oklab,var(--color-accent)_12%,transparent)]"
|
|
2853
|
+
],
|
|
2854
|
+
body: "min-w-0 flex-1",
|
|
2855
|
+
eyebrow: "font-mono text-[10px] uppercase tracking-[0.08em] text-accent",
|
|
2856
|
+
title: "truncate text-[13px] font-medium text-ink",
|
|
2857
|
+
recipients: "truncate text-[12px] text-ink-3",
|
|
2858
|
+
action: [
|
|
2859
|
+
"shrink-0 cursor-pointer rounded-sm border border-accent/50 px-2.5 py-1",
|
|
2860
|
+
"font-mono text-[11px] text-accent outline-none",
|
|
2861
|
+
"hover:bg-[color-mix(in_oklab,var(--color-accent)_12%,transparent)]",
|
|
2862
|
+
"focus-visible:shadow-[var(--shadow-focus)]",
|
|
2863
|
+
"disabled:cursor-default disabled:opacity-50"
|
|
2864
|
+
],
|
|
2865
|
+
outcome: "shrink-0 font-mono text-[11px] text-ink-3"
|
|
2866
|
+
}
|
|
2867
|
+
});
|
|
2868
|
+
var styles = draftMessageCardStyles();
|
|
2869
|
+
var DRAFT_OUTCOME_LABEL = {
|
|
2870
|
+
sent: "Sent",
|
|
2871
|
+
rejected: "Rejected",
|
|
2872
|
+
failed: "Approved, but delivery failed"
|
|
2873
|
+
};
|
|
2874
|
+
function DraftMessageCard({
|
|
2875
|
+
channel,
|
|
2876
|
+
title,
|
|
2877
|
+
recipients,
|
|
2878
|
+
eyebrow = "Draft \u2014 awaiting review",
|
|
2879
|
+
previewLabel = "Review",
|
|
2880
|
+
outcome,
|
|
2881
|
+
onPreview,
|
|
2882
|
+
isPreviewDisabled = false,
|
|
2883
|
+
className
|
|
2884
|
+
}) {
|
|
2885
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn(styles.root(), className), children: [
|
|
2886
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.icon(), children: /* @__PURE__ */ jsxRuntime.jsx(ChannelIcon, { channel }) }),
|
|
2887
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.body(), children: [
|
|
2888
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: styles.eyebrow(), children: eyebrow }),
|
|
2889
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: styles.title(), children: title }),
|
|
2890
|
+
recipients && recipients.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: styles.recipients(), children: [
|
|
2891
|
+
"To ",
|
|
2892
|
+
recipients.join(", ")
|
|
2893
|
+
] }) : null
|
|
2894
|
+
] }),
|
|
2895
|
+
outcome ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.outcome(), children: DRAFT_OUTCOME_LABEL[outcome] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2896
|
+
reactAriaComponents.Button,
|
|
2897
|
+
{
|
|
2898
|
+
onPress: onPreview ?? (() => {
|
|
2899
|
+
}),
|
|
2900
|
+
isDisabled: isPreviewDisabled,
|
|
2901
|
+
className: styles.action(),
|
|
2902
|
+
children: previewLabel
|
|
2903
|
+
}
|
|
2904
|
+
)
|
|
2905
|
+
] });
|
|
2906
|
+
}
|
|
2821
2907
|
|
|
2822
2908
|
// src/components/draft-message-composer/create-draft-message-client.ts
|
|
2823
2909
|
function createDraftMessageClient(conversation) {
|
|
@@ -2887,7 +2973,7 @@ function MultiSelect({
|
|
|
2887
2973
|
appearance,
|
|
2888
2974
|
className
|
|
2889
2975
|
}) {
|
|
2890
|
-
const
|
|
2976
|
+
const styles3 = fieldControlStyles({ size, invalid: isInvalid, appearance });
|
|
2891
2977
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
2892
2978
|
const minHeight = appearance === "cell" ? "min-h-[29px]" : fieldMinHeight[size];
|
|
2893
2979
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
@@ -2934,7 +3020,7 @@ function MultiSelect({
|
|
|
2934
3020
|
"data-invalid": isInvalid || void 0,
|
|
2935
3021
|
"data-disabled": isDisabled || void 0,
|
|
2936
3022
|
className: chunkMWAXK66H_cjs.cn(
|
|
2937
|
-
|
|
3023
|
+
styles3.box(),
|
|
2938
3024
|
"flex flex-wrap items-center gap-1.5 cursor-pointer",
|
|
2939
3025
|
minHeight,
|
|
2940
3026
|
fieldChipPadding[size],
|
|
@@ -3184,7 +3270,7 @@ function Select({
|
|
|
3184
3270
|
className,
|
|
3185
3271
|
...props
|
|
3186
3272
|
}) {
|
|
3187
|
-
const
|
|
3273
|
+
const styles3 = fieldControlStyles({ size, appearance });
|
|
3188
3274
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3189
3275
|
reactAriaComponents.Select,
|
|
3190
3276
|
{
|
|
@@ -3199,8 +3285,8 @@ function Select({
|
|
|
3199
3285
|
reactAriaComponents.Button,
|
|
3200
3286
|
{
|
|
3201
3287
|
className: chunkMWAXK66H_cjs.cn(
|
|
3202
|
-
|
|
3203
|
-
|
|
3288
|
+
styles3.box(),
|
|
3289
|
+
styles3.content(),
|
|
3204
3290
|
"flex items-center justify-between gap-3 text-left cursor-pointer",
|
|
3205
3291
|
triggerClassName
|
|
3206
3292
|
),
|
|
@@ -3593,6 +3679,27 @@ function __resetDraftMessageOutcomes() {
|
|
|
3593
3679
|
listenersByMessageId2.clear();
|
|
3594
3680
|
lastOutcomeByMessageId.clear();
|
|
3595
3681
|
}
|
|
3682
|
+
|
|
3683
|
+
// src/components/draft-message-composer/draft-status.ts
|
|
3684
|
+
var OUTCOME_BY_STATUS = {
|
|
3685
|
+
// `pending` is already handed to the transport — from the reviewer's side
|
|
3686
|
+
// the decision was "send".
|
|
3687
|
+
pending: "sent",
|
|
3688
|
+
sent: "sent",
|
|
3689
|
+
rejected: "rejected",
|
|
3690
|
+
failed: "failed"
|
|
3691
|
+
};
|
|
3692
|
+
function terminalKindFor(status) {
|
|
3693
|
+
if (status === "draft") return null;
|
|
3694
|
+
return OUTCOME_BY_STATUS[status] ?? "not-draft";
|
|
3695
|
+
}
|
|
3696
|
+
function draftOutcomeFor(status) {
|
|
3697
|
+
const kind = terminalKindFor(status);
|
|
3698
|
+
return kind === null || kind === "not-draft" ? null : kind;
|
|
3699
|
+
}
|
|
3700
|
+
function isDraftReviewOutcome(value) {
|
|
3701
|
+
return value === "sent" || value === "rejected" || value === "failed";
|
|
3702
|
+
}
|
|
3596
3703
|
var draftMessageComposerStyles = tailwindVariants.tv({
|
|
3597
3704
|
slots: {
|
|
3598
3705
|
root: "flex flex-col gap-1.5",
|
|
@@ -3610,28 +3717,13 @@ var draftMessageComposerStyles = tailwindVariants.tv({
|
|
|
3610
3717
|
error: "px-[18px] font-mono text-[11px] text-danger"
|
|
3611
3718
|
}
|
|
3612
3719
|
});
|
|
3613
|
-
var
|
|
3720
|
+
var styles2 = draftMessageComposerStyles();
|
|
3614
3721
|
function sendRecipientsFromMessage(message, role) {
|
|
3615
3722
|
return (message.recipients ?? []).filter((recipient) => recipient.role === role && !!recipient.external_id).map((recipient) => ({
|
|
3616
3723
|
kind: "contact-address",
|
|
3617
3724
|
external_id: recipient.external_id
|
|
3618
3725
|
}));
|
|
3619
3726
|
}
|
|
3620
|
-
function terminalKindFor(status) {
|
|
3621
|
-
switch (status) {
|
|
3622
|
-
case "draft":
|
|
3623
|
-
return null;
|
|
3624
|
-
case "pending":
|
|
3625
|
-
case "sent":
|
|
3626
|
-
return "sent";
|
|
3627
|
-
case "rejected":
|
|
3628
|
-
return "rejected";
|
|
3629
|
-
case "failed":
|
|
3630
|
-
return "failed";
|
|
3631
|
-
default:
|
|
3632
|
-
return "not-draft";
|
|
3633
|
-
}
|
|
3634
|
-
}
|
|
3635
3727
|
function DraftMessageComposer({
|
|
3636
3728
|
messageId,
|
|
3637
3729
|
client,
|
|
@@ -3841,10 +3933,10 @@ function DraftMessageComposer({
|
|
|
3841
3933
|
[message?.attachments]
|
|
3842
3934
|
);
|
|
3843
3935
|
if (phase === "loading") {
|
|
3844
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkMWAXK66H_cjs.cn(
|
|
3936
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkMWAXK66H_cjs.cn(styles2.root(), className), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles2.terminal(), children: "Loading draft\u2026" }) });
|
|
3845
3937
|
}
|
|
3846
3938
|
if (phase === "load-error") {
|
|
3847
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkMWAXK66H_cjs.cn(
|
|
3939
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkMWAXK66H_cjs.cn(styles2.root(), className), children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: styles2.terminal(), children: [
|
|
3848
3940
|
loadError ?? "Loading the draft failed.",
|
|
3849
3941
|
" ",
|
|
3850
3942
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3859,12 +3951,12 @@ function DraftMessageComposer({
|
|
|
3859
3951
|
}
|
|
3860
3952
|
if (phase === "terminal" || !message) {
|
|
3861
3953
|
const line = terminalKind === "sent" ? "This draft was sent." : terminalKind === "rejected" ? "This draft was rejected." : terminalKind === "failed" ? `Sending failed${message?.error ? ` \u2014 ${message.error}` : ""}.` : "This message is not a reviewable draft.";
|
|
3862
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkMWAXK66H_cjs.cn(
|
|
3954
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkMWAXK66H_cjs.cn(styles2.root(), className), "data-draft-terminal": terminalKind, children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles2.terminal(), children: line }) });
|
|
3863
3955
|
}
|
|
3864
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn(
|
|
3865
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
3866
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
3867
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
3956
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn(styles2.root(), className), children: [
|
|
3957
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.header(), children: [
|
|
3958
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.badge(), children: "Draft \xB7 awaiting review" }),
|
|
3959
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles2.sender(), children: [
|
|
3868
3960
|
"from ",
|
|
3869
3961
|
message.sender.name
|
|
3870
3962
|
] })
|
|
@@ -3895,11 +3987,11 @@ function DraftMessageComposer({
|
|
|
3895
3987
|
showSendButton: showActions
|
|
3896
3988
|
}
|
|
3897
3989
|
),
|
|
3898
|
-
actionError ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className:
|
|
3990
|
+
actionError ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: styles2.error(), children: [
|
|
3899
3991
|
actionError,
|
|
3900
3992
|
" \u2014 your edits are kept."
|
|
3901
3993
|
] }) : null,
|
|
3902
|
-
showActions ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
3994
|
+
showActions ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.actions(), children: [
|
|
3903
3995
|
isConfirmingReject ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3904
3996
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12.5px] text-ink-3", children: "Reject draft?" }),
|
|
3905
3997
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3936,6 +4028,207 @@ function DraftMessageComposer({
|
|
|
3936
4028
|
] }) : null
|
|
3937
4029
|
] });
|
|
3938
4030
|
}
|
|
4031
|
+
function Modal(props) {
|
|
4032
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.DialogTrigger, { ...props });
|
|
4033
|
+
}
|
|
4034
|
+
function ModalContent({
|
|
4035
|
+
children,
|
|
4036
|
+
className,
|
|
4037
|
+
modalClassName,
|
|
4038
|
+
isDismissable = true,
|
|
4039
|
+
...props
|
|
4040
|
+
}) {
|
|
4041
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4042
|
+
reactAriaComponents.ModalOverlay,
|
|
4043
|
+
{
|
|
4044
|
+
isDismissable,
|
|
4045
|
+
...props,
|
|
4046
|
+
className: (renderProps) => chunkMWAXK66H_cjs.cn(
|
|
4047
|
+
"fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
4048
|
+
// Warm ink scrim — stays in the Proteos palette (no pure black).
|
|
4049
|
+
"bg-[color-mix(in_oklab,var(--color-ink)_40%,transparent)]",
|
|
4050
|
+
"entering:animate-in entering:fade-in-0 entering:duration-150",
|
|
4051
|
+
"exiting:animate-out exiting:fade-out-0 exiting:duration-100",
|
|
4052
|
+
typeof className === "function" ? className(renderProps) : className
|
|
4053
|
+
),
|
|
4054
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4055
|
+
reactAriaComponents.Modal,
|
|
4056
|
+
{
|
|
4057
|
+
className: chunkMWAXK66H_cjs.cn(
|
|
4058
|
+
"w-full max-w-lg",
|
|
4059
|
+
// Cap the panel at the viewport (minus the overlay's p-4) and lay it
|
|
4060
|
+
// out as a column so a tall body scrolls instead of overflowing the
|
|
4061
|
+
// screen. Short modals are unaffected — height still tracks content.
|
|
4062
|
+
"flex flex-col max-h-[calc(100dvh-2rem)]",
|
|
4063
|
+
"bg-surface border border-rule rounded-lg",
|
|
4064
|
+
"shadow-[var(--shadow-float)]",
|
|
4065
|
+
"entering:animate-in entering:zoom-in-95 entering:slide-in-from-top-2 entering:duration-150",
|
|
4066
|
+
"exiting:animate-out exiting:zoom-out-95 exiting:duration-100",
|
|
4067
|
+
modalClassName
|
|
4068
|
+
),
|
|
4069
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Dialog, { className: "outline-none flex flex-col min-h-0 overflow-hidden", children })
|
|
4070
|
+
}
|
|
4071
|
+
)
|
|
4072
|
+
}
|
|
4073
|
+
);
|
|
4074
|
+
}
|
|
4075
|
+
function ModalHeader({ className, ...props }) {
|
|
4076
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunkMWAXK66H_cjs.cn("shrink-0 px-5 pt-5 pb-3 flex flex-col gap-1.5", className) });
|
|
4077
|
+
}
|
|
4078
|
+
function ModalTitle({ className, ...props }) {
|
|
4079
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4080
|
+
reactAriaComponents.Heading,
|
|
4081
|
+
{
|
|
4082
|
+
slot: "title",
|
|
4083
|
+
...props,
|
|
4084
|
+
className: chunkMWAXK66H_cjs.cn(
|
|
4085
|
+
"font-sans font-medium text-[20px] leading-[1.25] tracking-[-0.015em] text-ink",
|
|
4086
|
+
className
|
|
4087
|
+
)
|
|
4088
|
+
}
|
|
4089
|
+
);
|
|
4090
|
+
}
|
|
4091
|
+
function ModalDescription({ className, ...props }) {
|
|
4092
|
+
return /* @__PURE__ */ jsxRuntime.jsx("p", { ...props, className: chunkMWAXK66H_cjs.cn("text-[14px] leading-[1.55] text-ink-3", className) });
|
|
4093
|
+
}
|
|
4094
|
+
function ModalBody({ className, ...props }) {
|
|
4095
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4096
|
+
"div",
|
|
4097
|
+
{
|
|
4098
|
+
...props,
|
|
4099
|
+
className: chunkMWAXK66H_cjs.cn(
|
|
4100
|
+
// The scroll region: caps at the panel's spare height and scrolls when
|
|
4101
|
+
// the content is taller, leaving header + footer pinned.
|
|
4102
|
+
"min-h-0 overflow-y-auto px-5 py-3 flex flex-col gap-3 text-[14px] text-ink-2",
|
|
4103
|
+
className
|
|
4104
|
+
)
|
|
4105
|
+
}
|
|
4106
|
+
);
|
|
4107
|
+
}
|
|
4108
|
+
function ModalFooter({ className, ...props }) {
|
|
4109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4110
|
+
"div",
|
|
4111
|
+
{
|
|
4112
|
+
...props,
|
|
4113
|
+
className: chunkMWAXK66H_cjs.cn("shrink-0 flex justify-end items-center gap-2", "px-5 pt-3 pb-5", className)
|
|
4114
|
+
}
|
|
4115
|
+
);
|
|
4116
|
+
}
|
|
4117
|
+
function DraftMessageReview({
|
|
4118
|
+
messageId,
|
|
4119
|
+
client,
|
|
4120
|
+
onPreview,
|
|
4121
|
+
onOutcome,
|
|
4122
|
+
onLoadError,
|
|
4123
|
+
modalTitle = "Review draft",
|
|
4124
|
+
modalClassName = "max-w-3xl",
|
|
4125
|
+
overlayClassName,
|
|
4126
|
+
previewLabel,
|
|
4127
|
+
className
|
|
4128
|
+
}) {
|
|
4129
|
+
const [message, setMessage] = react.useState(null);
|
|
4130
|
+
const [subject, setSubject] = react.useState("");
|
|
4131
|
+
const [isOpen, setIsOpen] = react.useState(false);
|
|
4132
|
+
const [isPreviewing, setIsPreviewing] = react.useState(false);
|
|
4133
|
+
const [outcome, setOutcome] = react.useState(null);
|
|
4134
|
+
const onOutcomeRef = react.useRef(onOutcome);
|
|
4135
|
+
onOutcomeRef.current = onOutcome;
|
|
4136
|
+
const onLoadErrorRef = react.useRef(onLoadError);
|
|
4137
|
+
onLoadErrorRef.current = onLoadError;
|
|
4138
|
+
const hasSettledRef = react.useRef(false);
|
|
4139
|
+
const settle = react.useCallback((next, settled) => {
|
|
4140
|
+
setOutcome(next);
|
|
4141
|
+
setIsOpen(false);
|
|
4142
|
+
if (hasSettledRef.current) return;
|
|
4143
|
+
hasSettledRef.current = true;
|
|
4144
|
+
onOutcomeRef.current?.(next, settled);
|
|
4145
|
+
}, []);
|
|
4146
|
+
react.useEffect(() => {
|
|
4147
|
+
let cancelled = false;
|
|
4148
|
+
void (async () => {
|
|
4149
|
+
try {
|
|
4150
|
+
const loaded = await client.getMessage(messageId);
|
|
4151
|
+
if (cancelled) return;
|
|
4152
|
+
setMessage(loaded);
|
|
4153
|
+
const terminal = draftOutcomeFor(loaded.status);
|
|
4154
|
+
if (terminal) {
|
|
4155
|
+
settle(terminal, loaded);
|
|
4156
|
+
return;
|
|
4157
|
+
}
|
|
4158
|
+
if (loaded.conversation_id) {
|
|
4159
|
+
const conversation = await client.getConversation(loaded.conversation_id);
|
|
4160
|
+
if (!cancelled) setSubject(conversation.subject ?? "");
|
|
4161
|
+
}
|
|
4162
|
+
} catch (error) {
|
|
4163
|
+
if (cancelled) return;
|
|
4164
|
+
onLoadErrorRef.current?.(error instanceof Error ? error : new Error(String(error)));
|
|
4165
|
+
}
|
|
4166
|
+
})();
|
|
4167
|
+
return () => {
|
|
4168
|
+
cancelled = true;
|
|
4169
|
+
};
|
|
4170
|
+
}, [client, messageId, settle]);
|
|
4171
|
+
const published = useDraftMessageOutcome(messageId);
|
|
4172
|
+
react.useEffect(() => {
|
|
4173
|
+
if (published) settle(published.type, published.message);
|
|
4174
|
+
}, [published, settle]);
|
|
4175
|
+
const preview = () => {
|
|
4176
|
+
if (!onPreview) {
|
|
4177
|
+
setIsOpen(true);
|
|
4178
|
+
return;
|
|
4179
|
+
}
|
|
4180
|
+
setIsPreviewing(true);
|
|
4181
|
+
void onPreview(messageId).then((result) => {
|
|
4182
|
+
if (result) settle(result);
|
|
4183
|
+
}).finally(() => setIsPreviewing(false));
|
|
4184
|
+
};
|
|
4185
|
+
if (!message) return null;
|
|
4186
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4187
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4188
|
+
DraftMessageCard,
|
|
4189
|
+
{
|
|
4190
|
+
channel: message.channel,
|
|
4191
|
+
title: titleFor(message, subject),
|
|
4192
|
+
recipients: toRecipients(message),
|
|
4193
|
+
outcome,
|
|
4194
|
+
onPreview: preview,
|
|
4195
|
+
isPreviewDisabled: isPreviewing,
|
|
4196
|
+
...previewLabel !== void 0 ? { previewLabel } : {},
|
|
4197
|
+
...className !== void 0 ? { className } : {}
|
|
4198
|
+
}
|
|
4199
|
+
),
|
|
4200
|
+
onPreview ? null : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4201
|
+
ModalContent,
|
|
4202
|
+
{
|
|
4203
|
+
isOpen,
|
|
4204
|
+
onOpenChange: setIsOpen,
|
|
4205
|
+
modalClassName,
|
|
4206
|
+
...overlayClassName !== void 0 ? { className: overlayClassName } : {},
|
|
4207
|
+
children: [
|
|
4208
|
+
/* @__PURE__ */ jsxRuntime.jsx(ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalTitle, { children: modalTitle }) }),
|
|
4209
|
+
/* @__PURE__ */ jsxRuntime.jsx(ModalBody, { className: "min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4210
|
+
DraftMessageComposer,
|
|
4211
|
+
{
|
|
4212
|
+
messageId,
|
|
4213
|
+
client,
|
|
4214
|
+
bodyClassName: "max-h-[55dvh]",
|
|
4215
|
+
onSent: (sent) => settle(draftOutcomeFor(sent.status) ?? "sent", sent),
|
|
4216
|
+
onRejected: (rejected) => settle("rejected", rejected),
|
|
4217
|
+
onFailed: (failed) => settle("failed", failed)
|
|
4218
|
+
}
|
|
4219
|
+
) })
|
|
4220
|
+
]
|
|
4221
|
+
}
|
|
4222
|
+
)
|
|
4223
|
+
] });
|
|
4224
|
+
}
|
|
4225
|
+
function titleFor(message, subject) {
|
|
4226
|
+
const firstLine = message.content.find((block) => block.type === "text")?.text?.split("\n")[0];
|
|
4227
|
+
return subject || firstLine || "Draft message";
|
|
4228
|
+
}
|
|
4229
|
+
function toRecipients(message) {
|
|
4230
|
+
return (message.recipients ?? []).filter((recipient) => recipient.role === "to").map((recipient) => recipient.name || recipient.email || recipient.external_id).filter((label) => !!label);
|
|
4231
|
+
}
|
|
3939
4232
|
var emptyStateStyles = tailwindVariants.tv({
|
|
3940
4233
|
slots: {
|
|
3941
4234
|
root: "flex flex-col items-center text-center px-6",
|
|
@@ -3966,12 +4259,12 @@ function EmptyState({
|
|
|
3966
4259
|
size,
|
|
3967
4260
|
className
|
|
3968
4261
|
}) {
|
|
3969
|
-
const
|
|
3970
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn(
|
|
3971
|
-
icon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
3972
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
3973
|
-
description ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
3974
|
-
action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
4262
|
+
const styles3 = emptyStateStyles({ size });
|
|
4263
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkMWAXK66H_cjs.cn(styles3.root(), className), children: [
|
|
4264
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles3.art(), children: icon }) : null,
|
|
4265
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles3.title(), children: title }),
|
|
4266
|
+
description ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles3.description(), children: description }) : null,
|
|
4267
|
+
action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles3.actions(), children: action }) : null
|
|
3975
4268
|
] });
|
|
3976
4269
|
}
|
|
3977
4270
|
function ErrorAnimation({ className }) {
|
|
@@ -4212,7 +4505,7 @@ function Input({
|
|
|
4212
4505
|
className,
|
|
4213
4506
|
...props
|
|
4214
4507
|
}) {
|
|
4215
|
-
const
|
|
4508
|
+
const styles3 = fieldControlStyles({ size, appearance, hasFocusRing });
|
|
4216
4509
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4217
4510
|
reactAriaComponents.TextField,
|
|
4218
4511
|
{
|
|
@@ -4228,7 +4521,7 @@ function Input({
|
|
|
4228
4521
|
{
|
|
4229
4522
|
...inputProps,
|
|
4230
4523
|
placeholder: placeholder ?? "",
|
|
4231
|
-
className: chunkMWAXK66H_cjs.cn(
|
|
4524
|
+
className: chunkMWAXK66H_cjs.cn(styles3.box(), styles3.content(), inputClassName)
|
|
4232
4525
|
}
|
|
4233
4526
|
),
|
|
4234
4527
|
description ? /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Text, { slot: "description", className: fieldHintStyles, children: description }) : null,
|
|
@@ -4291,92 +4584,6 @@ function MenuItem({ icon, hasSubmenu, children, className, ...props }) {
|
|
|
4291
4584
|
}
|
|
4292
4585
|
);
|
|
4293
4586
|
}
|
|
4294
|
-
function Modal(props) {
|
|
4295
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.DialogTrigger, { ...props });
|
|
4296
|
-
}
|
|
4297
|
-
function ModalContent({
|
|
4298
|
-
children,
|
|
4299
|
-
className,
|
|
4300
|
-
modalClassName,
|
|
4301
|
-
isDismissable = true,
|
|
4302
|
-
...props
|
|
4303
|
-
}) {
|
|
4304
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4305
|
-
reactAriaComponents.ModalOverlay,
|
|
4306
|
-
{
|
|
4307
|
-
isDismissable,
|
|
4308
|
-
...props,
|
|
4309
|
-
className: (renderProps) => chunkMWAXK66H_cjs.cn(
|
|
4310
|
-
"fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
4311
|
-
// Warm ink scrim — stays in the Proteos palette (no pure black).
|
|
4312
|
-
"bg-[color-mix(in_oklab,var(--color-ink)_40%,transparent)]",
|
|
4313
|
-
"entering:animate-in entering:fade-in-0 entering:duration-150",
|
|
4314
|
-
"exiting:animate-out exiting:fade-out-0 exiting:duration-100",
|
|
4315
|
-
typeof className === "function" ? className(renderProps) : className
|
|
4316
|
-
),
|
|
4317
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4318
|
-
reactAriaComponents.Modal,
|
|
4319
|
-
{
|
|
4320
|
-
className: chunkMWAXK66H_cjs.cn(
|
|
4321
|
-
"w-full max-w-lg",
|
|
4322
|
-
// Cap the panel at the viewport (minus the overlay's p-4) and lay it
|
|
4323
|
-
// out as a column so a tall body scrolls instead of overflowing the
|
|
4324
|
-
// screen. Short modals are unaffected — height still tracks content.
|
|
4325
|
-
"flex flex-col max-h-[calc(100dvh-2rem)]",
|
|
4326
|
-
"bg-surface border border-rule rounded-lg",
|
|
4327
|
-
"shadow-[var(--shadow-float)]",
|
|
4328
|
-
"entering:animate-in entering:zoom-in-95 entering:slide-in-from-top-2 entering:duration-150",
|
|
4329
|
-
"exiting:animate-out exiting:zoom-out-95 exiting:duration-100",
|
|
4330
|
-
modalClassName
|
|
4331
|
-
),
|
|
4332
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Dialog, { className: "outline-none flex flex-col min-h-0 overflow-hidden", children })
|
|
4333
|
-
}
|
|
4334
|
-
)
|
|
4335
|
-
}
|
|
4336
|
-
);
|
|
4337
|
-
}
|
|
4338
|
-
function ModalHeader({ className, ...props }) {
|
|
4339
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunkMWAXK66H_cjs.cn("shrink-0 px-5 pt-5 pb-3 flex flex-col gap-1.5", className) });
|
|
4340
|
-
}
|
|
4341
|
-
function ModalTitle({ className, ...props }) {
|
|
4342
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4343
|
-
reactAriaComponents.Heading,
|
|
4344
|
-
{
|
|
4345
|
-
slot: "title",
|
|
4346
|
-
...props,
|
|
4347
|
-
className: chunkMWAXK66H_cjs.cn(
|
|
4348
|
-
"font-sans font-medium text-[20px] leading-[1.25] tracking-[-0.015em] text-ink",
|
|
4349
|
-
className
|
|
4350
|
-
)
|
|
4351
|
-
}
|
|
4352
|
-
);
|
|
4353
|
-
}
|
|
4354
|
-
function ModalDescription({ className, ...props }) {
|
|
4355
|
-
return /* @__PURE__ */ jsxRuntime.jsx("p", { ...props, className: chunkMWAXK66H_cjs.cn("text-[14px] leading-[1.55] text-ink-3", className) });
|
|
4356
|
-
}
|
|
4357
|
-
function ModalBody({ className, ...props }) {
|
|
4358
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4359
|
-
"div",
|
|
4360
|
-
{
|
|
4361
|
-
...props,
|
|
4362
|
-
className: chunkMWAXK66H_cjs.cn(
|
|
4363
|
-
// The scroll region: caps at the panel's spare height and scrolls when
|
|
4364
|
-
// the content is taller, leaving header + footer pinned.
|
|
4365
|
-
"min-h-0 overflow-y-auto px-5 py-3 flex flex-col gap-3 text-[14px] text-ink-2",
|
|
4366
|
-
className
|
|
4367
|
-
)
|
|
4368
|
-
}
|
|
4369
|
-
);
|
|
4370
|
-
}
|
|
4371
|
-
function ModalFooter({ className, ...props }) {
|
|
4372
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4373
|
-
"div",
|
|
4374
|
-
{
|
|
4375
|
-
...props,
|
|
4376
|
-
className: chunkMWAXK66H_cjs.cn("shrink-0 flex justify-end items-center gap-2", "px-5 pt-3 pb-5", className)
|
|
4377
|
-
}
|
|
4378
|
-
);
|
|
4379
|
-
}
|
|
4380
4587
|
var NavNestedContext = react.createContext(false);
|
|
4381
4588
|
function useIsNested() {
|
|
4382
4589
|
return react.useContext(NavNestedContext);
|
|
@@ -4863,7 +5070,7 @@ function SegmentedControl({
|
|
|
4863
5070
|
orientation = "horizontal",
|
|
4864
5071
|
...props
|
|
4865
5072
|
}) {
|
|
4866
|
-
const
|
|
5073
|
+
const styles3 = segmentedControlStyles({ size });
|
|
4867
5074
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4868
5075
|
reactAriaComponents.RadioGroup,
|
|
4869
5076
|
{
|
|
@@ -4871,14 +5078,14 @@ function SegmentedControl({
|
|
|
4871
5078
|
orientation,
|
|
4872
5079
|
value: String(value),
|
|
4873
5080
|
onChange: (next) => onChange(next),
|
|
4874
|
-
className: chunkMWAXK66H_cjs.cn(
|
|
5081
|
+
className: chunkMWAXK66H_cjs.cn(styles3.group(), className),
|
|
4875
5082
|
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4876
5083
|
reactAriaComponents.Radio,
|
|
4877
5084
|
{
|
|
4878
5085
|
value: String(option.id),
|
|
4879
5086
|
...option.isDisabled ? { isDisabled: true } : {},
|
|
4880
5087
|
...autoFocus && option.id === value ? { autoFocus: true } : {},
|
|
4881
|
-
className:
|
|
5088
|
+
className: styles3.segment(),
|
|
4882
5089
|
children: option.label
|
|
4883
5090
|
},
|
|
4884
5091
|
String(option.id)
|
|
@@ -4901,7 +5108,7 @@ function TagInput({
|
|
|
4901
5108
|
autoFocus = false,
|
|
4902
5109
|
className
|
|
4903
5110
|
}) {
|
|
4904
|
-
const
|
|
5111
|
+
const styles3 = fieldControlStyles({ size, invalid: isInvalid, appearance });
|
|
4905
5112
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
4906
5113
|
const minHeight = appearance === "cell" ? "min-h-[29px]" : fieldMinHeight[size];
|
|
4907
5114
|
const inputRef = react.useRef(null);
|
|
@@ -4942,7 +5149,7 @@ function TagInput({
|
|
|
4942
5149
|
"data-invalid": isInvalid || void 0,
|
|
4943
5150
|
"data-disabled": isDisabled || void 0,
|
|
4944
5151
|
className: chunkMWAXK66H_cjs.cn(
|
|
4945
|
-
|
|
5152
|
+
styles3.box(),
|
|
4946
5153
|
"flex flex-wrap items-center gap-1",
|
|
4947
5154
|
minHeight,
|
|
4948
5155
|
fieldChipPadding[size],
|
|
@@ -6682,45 +6889,45 @@ var tabsStyles = tailwindVariants.tv({
|
|
|
6682
6889
|
defaultVariants: { size: "md" }
|
|
6683
6890
|
});
|
|
6684
6891
|
function Root({ size, className, children, ...props }) {
|
|
6685
|
-
const
|
|
6892
|
+
const styles3 = tabsStyles({ size });
|
|
6686
6893
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6687
6894
|
reactAriaComponents.Tabs,
|
|
6688
6895
|
{
|
|
6689
6896
|
...props,
|
|
6690
|
-
className: (rp) => chunkMWAXK66H_cjs.cn(
|
|
6897
|
+
className: (rp) => chunkMWAXK66H_cjs.cn(styles3.root(), typeof className === "function" ? className(rp) : className),
|
|
6691
6898
|
children
|
|
6692
6899
|
}
|
|
6693
6900
|
);
|
|
6694
6901
|
}
|
|
6695
6902
|
function List({ size, className, children, ...props }) {
|
|
6696
|
-
const
|
|
6903
|
+
const styles3 = tabsStyles({ size });
|
|
6697
6904
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6698
6905
|
reactAriaComponents.TabList,
|
|
6699
6906
|
{
|
|
6700
6907
|
...props,
|
|
6701
|
-
className: (rp) => chunkMWAXK66H_cjs.cn(
|
|
6908
|
+
className: (rp) => chunkMWAXK66H_cjs.cn(styles3.list(), typeof className === "function" ? className(rp) : className),
|
|
6702
6909
|
children
|
|
6703
6910
|
}
|
|
6704
6911
|
);
|
|
6705
6912
|
}
|
|
6706
6913
|
function Trigger({ size, className, children, ...props }) {
|
|
6707
|
-
const
|
|
6914
|
+
const styles3 = tabsStyles({ size });
|
|
6708
6915
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6709
6916
|
reactAriaComponents.Tab,
|
|
6710
6917
|
{
|
|
6711
6918
|
...props,
|
|
6712
|
-
className: (rp) => chunkMWAXK66H_cjs.cn(
|
|
6919
|
+
className: (rp) => chunkMWAXK66H_cjs.cn(styles3.trigger(), typeof className === "function" ? className(rp) : className),
|
|
6713
6920
|
children
|
|
6714
6921
|
}
|
|
6715
6922
|
);
|
|
6716
6923
|
}
|
|
6717
6924
|
function Panel({ className, children, ...props }) {
|
|
6718
|
-
const
|
|
6925
|
+
const styles3 = tabsStyles({});
|
|
6719
6926
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6720
6927
|
reactAriaComponents.TabPanel,
|
|
6721
6928
|
{
|
|
6722
6929
|
...props,
|
|
6723
|
-
className: (rp) => chunkMWAXK66H_cjs.cn(
|
|
6930
|
+
className: (rp) => chunkMWAXK66H_cjs.cn(styles3.panel(), typeof className === "function" ? className(rp) : className),
|
|
6724
6931
|
children
|
|
6725
6932
|
}
|
|
6726
6933
|
);
|
|
@@ -6744,7 +6951,7 @@ function Textarea({
|
|
|
6744
6951
|
className,
|
|
6745
6952
|
...props
|
|
6746
6953
|
}) {
|
|
6747
|
-
const
|
|
6954
|
+
const styles3 = fieldControlStyles({ size, appearance });
|
|
6748
6955
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6749
6956
|
reactAriaComponents.TextField,
|
|
6750
6957
|
{
|
|
@@ -6764,8 +6971,8 @@ function Textarea({
|
|
|
6764
6971
|
className: chunkMWAXK66H_cjs.cn(
|
|
6765
6972
|
// Same hairline chrome as Input, but allow vertical resize and set a
|
|
6766
6973
|
// sensible minimum height so short content doesn't collapse.
|
|
6767
|
-
|
|
6768
|
-
|
|
6974
|
+
styles3.box(),
|
|
6975
|
+
styles3.content(),
|
|
6769
6976
|
"min-h-[100px] resize-y",
|
|
6770
6977
|
textareaClassName
|
|
6771
6978
|
)
|
|
@@ -6786,7 +6993,7 @@ function TimeField({
|
|
|
6786
6993
|
className,
|
|
6787
6994
|
...props
|
|
6788
6995
|
}) {
|
|
6789
|
-
const
|
|
6996
|
+
const styles3 = fieldControlStyles({ size, appearance });
|
|
6790
6997
|
const focusWithin = appearance === "cell" ? "focus-within:border-accent focus-within:shadow-none" : "focus-within:border-accent focus-within:shadow-[var(--shadow-focus)]";
|
|
6791
6998
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6792
6999
|
reactAriaComponents.TimeField,
|
|
@@ -6802,8 +7009,8 @@ function TimeField({
|
|
|
6802
7009
|
reactAriaComponents.DateInput,
|
|
6803
7010
|
{
|
|
6804
7011
|
className: chunkMWAXK66H_cjs.cn(
|
|
6805
|
-
|
|
6806
|
-
|
|
7012
|
+
styles3.box(),
|
|
7013
|
+
styles3.content(),
|
|
6807
7014
|
"flex items-center min-w-0 text-ink",
|
|
6808
7015
|
// Tabular alignment for time segments — overrides content's
|
|
6809
7016
|
// font-sans on purpose.
|
|
@@ -6899,6 +7106,7 @@ exports.CardFeatureTitle = CardFeatureTitle;
|
|
|
6899
7106
|
exports.CardFooter = CardFooter;
|
|
6900
7107
|
exports.CardHeader = CardHeader;
|
|
6901
7108
|
exports.CardTitle = CardTitle;
|
|
7109
|
+
exports.ChannelIcon = ChannelIcon;
|
|
6902
7110
|
exports.Checkbox = Checkbox;
|
|
6903
7111
|
exports.CheckboxGroup = CheckboxGroup;
|
|
6904
7112
|
exports.ChipValue = ChipValue;
|
|
@@ -6906,6 +7114,7 @@ exports.Combobox = Combobox;
|
|
|
6906
7114
|
exports.Command = Command;
|
|
6907
7115
|
exports.CommandHint = CommandHint;
|
|
6908
7116
|
exports.CurrencyInput = CurrencyInput;
|
|
7117
|
+
exports.DRAFT_OUTCOME_LABEL = DRAFT_OUTCOME_LABEL;
|
|
6909
7118
|
exports.DataTable = DataTable;
|
|
6910
7119
|
exports.DataTableEmpty = DataTableEmpty;
|
|
6911
7120
|
exports.DataTableError = DataTableError;
|
|
@@ -6914,7 +7123,9 @@ exports.DateCell = DateCell;
|
|
|
6914
7123
|
exports.DatePicker = DatePicker;
|
|
6915
7124
|
exports.DateTimeCell = DateTimeCell;
|
|
6916
7125
|
exports.DateTimePicker = DateTimePicker;
|
|
7126
|
+
exports.DraftMessageCard = DraftMessageCard;
|
|
6917
7127
|
exports.DraftMessageComposer = DraftMessageComposer;
|
|
7128
|
+
exports.DraftMessageReview = DraftMessageReview;
|
|
6918
7129
|
exports.EmptyState = EmptyState;
|
|
6919
7130
|
exports.ErrorAnimation = ErrorAnimation;
|
|
6920
7131
|
exports.FieldCaret = FieldCaret;
|
|
@@ -6996,10 +7207,13 @@ exports.avatarGroupStyles = avatarGroupStyles;
|
|
|
6996
7207
|
exports.avatarStyles = avatarStyles;
|
|
6997
7208
|
exports.badgeStyles = badgeStyles;
|
|
6998
7209
|
exports.cardStyles = cardStyles2;
|
|
7210
|
+
exports.channelIcon = channelIcon;
|
|
6999
7211
|
exports.countLeaves = countLeaves;
|
|
7000
7212
|
exports.createDraftMessageClient = createDraftMessageClient;
|
|
7001
7213
|
exports.defaultValueFor = defaultValueFor;
|
|
7214
|
+
exports.draftMessageCardStyles = draftMessageCardStyles;
|
|
7002
7215
|
exports.draftMessageComposerStyles = draftMessageComposerStyles;
|
|
7216
|
+
exports.draftOutcomeFor = draftOutcomeFor;
|
|
7003
7217
|
exports.emptyStateStyles = emptyStateStyles;
|
|
7004
7218
|
exports.fieldControlStyles = fieldControlStyles;
|
|
7005
7219
|
exports.fieldErrorStyles = fieldErrorStyles;
|
|
@@ -7013,6 +7227,7 @@ exports.iconForContentType = iconForContentType;
|
|
|
7013
7227
|
exports.imageAttachmentStyles = imageAttachmentStyles;
|
|
7014
7228
|
exports.imageLightboxStyles = imageLightboxStyles;
|
|
7015
7229
|
exports.isColumnDragData = isColumnDragData;
|
|
7230
|
+
exports.isDraftReviewOutcome = isDraftReviewOutcome;
|
|
7016
7231
|
exports.isEditableTarget = isEditableTarget;
|
|
7017
7232
|
exports.isPreviewableImageName = isPreviewableImageName;
|
|
7018
7233
|
exports.makeActionsColumn = makeActionsColumn;
|
|
@@ -7035,6 +7250,7 @@ exports.subscribeDraftMessageOutcome = subscribeDraftMessageOutcome;
|
|
|
7035
7250
|
exports.tableCellStyles = tableCellStyles;
|
|
7036
7251
|
exports.tableHeaderCellStyles = tableHeaderCellStyles;
|
|
7037
7252
|
exports.tabsStyles = tabsStyles;
|
|
7253
|
+
exports.terminalKindFor = terminalKindFor;
|
|
7038
7254
|
exports.updateLeaf = updateLeaf;
|
|
7039
7255
|
exports.updateSubgroup = updateSubgroup;
|
|
7040
7256
|
exports.useAttributeTypeIcon = useAttributeTypeIcon;
|