@ai-matrx/design-system 0.86.333 → 0.86.334
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 -2
- package/dist/{chunk-NNETFHGX.js → chunk-677JS6TX.js} +17 -3
- package/dist/chunk-677JS6TX.js.map +1 -0
- package/dist/index.cjs +574 -385
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +115 -3
- package/dist/index.d.ts +115 -3
- package/dist/index.js +431 -262
- package/dist/index.js.map +1 -1
- package/dist/item.cjs +33 -17
- package/dist/item.cjs.map +1 -1
- package/dist/item.d.cts +7 -1
- package/dist/item.d.ts +7 -1
- package/dist/item.js +18 -16
- package/dist/item.js.map +1 -1
- package/dist/record-list.cjs +16 -2
- package/dist/record-list.cjs.map +1 -1
- package/dist/record-list.d.cts +7 -1
- package/dist/record-list.d.ts +7 -1
- package/dist/record-list.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-NNETFHGX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -383,11 +383,14 @@ import {
|
|
|
383
383
|
import {
|
|
384
384
|
AtSignIcon,
|
|
385
385
|
BadgeCheckIcon,
|
|
386
|
+
BellOffIcon,
|
|
386
387
|
CheckIcon,
|
|
387
388
|
ChevronDownIcon,
|
|
388
389
|
ChevronRightIcon,
|
|
390
|
+
ClockIcon,
|
|
389
391
|
CopyIcon,
|
|
390
392
|
CopyPlusIcon,
|
|
393
|
+
CornerDownRightIcon,
|
|
391
394
|
DownloadIcon,
|
|
392
395
|
ExternalLinkIcon,
|
|
393
396
|
GlobeIcon,
|
|
@@ -2756,7 +2759,7 @@ import * as React16 from "react";
|
|
|
2756
2759
|
import { createPortal } from "react-dom";
|
|
2757
2760
|
import { openOutbound } from "@ai-matrx/kit/outbound";
|
|
2758
2761
|
import { OutboundLink as OutboundLink2 } from "@ai-matrx/kit/outbound-react";
|
|
2759
|
-
import { Fragment as
|
|
2762
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2760
2763
|
function defaultDensity(size) {
|
|
2761
2764
|
return size === "xs" || size === "sm" ? "compact" : "comfortable";
|
|
2762
2765
|
}
|
|
@@ -2829,7 +2832,7 @@ var PeekCard = React16.forwardRef((allProps, ref) => {
|
|
|
2829
2832
|
// Every height is capped by the room the host left (`--matrx-peek-room`, set by the hover
|
|
2830
2833
|
// and click hosts from the popper's available height), so a card that cannot fit above or
|
|
2831
2834
|
// below its trigger shrinks and scrolls inside instead of leaving the screen.
|
|
2832
|
-
...height === "fixed" || loading ? { height: `min(${box.height}px, var(${PEEK_ROOM_VAR}, 100vh))` } : {
|
|
2835
|
+
...height === "content" ? { maxHeight: `min(${box.height}px, var(${PEEK_ROOM_VAR}, 100vh))` } : height === "fixed" || loading ? { height: `min(${box.height}px, var(${PEEK_ROOM_VAR}, 100vh))` } : {
|
|
2833
2836
|
minHeight: `min(${box.minHeight}px, var(${PEEK_ROOM_VAR}, 100vh))`,
|
|
2834
2837
|
maxHeight: `min(${box.height}px, var(${PEEK_ROOM_VAR}, 100vh))`
|
|
2835
2838
|
}
|
|
@@ -2848,7 +2851,7 @@ function PeekRule({ vertical = false }) {
|
|
|
2848
2851
|
function PeekCardHeader({ title, subtitle, leading, trailing, pinned, id }) {
|
|
2849
2852
|
const { density, window: window2 } = usePeekCard();
|
|
2850
2853
|
const pad = PAD[density];
|
|
2851
|
-
return /* @__PURE__ */ jsxs9(
|
|
2854
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
2852
2855
|
/* @__PURE__ */ jsxs9(
|
|
2853
2856
|
"div",
|
|
2854
2857
|
{
|
|
@@ -3146,16 +3149,44 @@ function recordDoors(doors) {
|
|
|
3146
3149
|
href: door.href,
|
|
3147
3150
|
newTab: door.newTab,
|
|
3148
3151
|
inMenu: known.inMenu,
|
|
3149
|
-
busy: door.busy
|
|
3152
|
+
busy: door.busy,
|
|
3153
|
+
menu: door.kind === "action" && door.menu?.length ? door.menu : void 0
|
|
3150
3154
|
});
|
|
3151
3155
|
}
|
|
3152
3156
|
return out;
|
|
3153
3157
|
}
|
|
3154
3158
|
var PEEK_SHEET_FOOTER_SLOTS = 4;
|
|
3155
3159
|
var PEEK_DOOR = "flex shrink-0 items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent hover:text-primary disabled:text-disabled-foreground disabled:hover:bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary";
|
|
3160
|
+
function MenuDoor({ action, menu, disabled }) {
|
|
3161
|
+
const { sheet } = usePeekCard();
|
|
3162
|
+
const [open, setOpen] = React16.useState(false);
|
|
3163
|
+
usePeekHoldWhile(open);
|
|
3164
|
+
const glyph = sheet ? /* @__PURE__ */ jsx19(action.icon, { className: "size-5" }) : /* @__PURE__ */ jsx19(action.icon, { className: "size-3.5" });
|
|
3165
|
+
return /* @__PURE__ */ jsxs9(DropdownMenu, { modal: false, open, onOpenChange: setOpen, children: [
|
|
3166
|
+
/* @__PURE__ */ jsx19(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx19(
|
|
3167
|
+
Button2,
|
|
3168
|
+
{
|
|
3169
|
+
type: "button",
|
|
3170
|
+
variant: "quiet",
|
|
3171
|
+
"aria-label": action.label,
|
|
3172
|
+
title: action.label,
|
|
3173
|
+
icon: action.busy ? /* @__PURE__ */ jsx19(Loader2Icon, { className: "animate-spin" }) : glyph,
|
|
3174
|
+
className: "shrink-0",
|
|
3175
|
+
disabled: disabled || action.busy,
|
|
3176
|
+
onClick: (event) => event.stopPropagation()
|
|
3177
|
+
}
|
|
3178
|
+
) }),
|
|
3179
|
+
/* @__PURE__ */ jsx19(DropdownMenuContent, { align: "end", "data-peek-no-drag": "", children: menu.map((group, i) => /* @__PURE__ */ jsxs9(React16.Fragment, { children: [
|
|
3180
|
+
i > 0 ? /* @__PURE__ */ jsx19(DropdownMenuSeparator, {}) : null,
|
|
3181
|
+
group.label ? /* @__PURE__ */ jsx19(DropdownMenuLabel, { children: group.label }) : null,
|
|
3182
|
+
group.items.map((item) => /* @__PURE__ */ jsx19(DropdownMenuItem, { ...item.tone ? { tone: item.tone } : {}, onSelect: () => item.onSelect(), children: item.label }, item.key))
|
|
3183
|
+
] }, `${group.label ?? ""}-${i}`)) })
|
|
3184
|
+
] });
|
|
3185
|
+
}
|
|
3156
3186
|
function FooterDoor({ action, disabled = false }) {
|
|
3157
3187
|
const { sheet } = usePeekCard();
|
|
3158
3188
|
const { Link } = useMatrxDataTableHost();
|
|
3189
|
+
if (action.menu) return /* @__PURE__ */ jsx19(MenuDoor, { action, menu: action.menu, disabled });
|
|
3159
3190
|
const box = sheet ? "size-11" : "size-7";
|
|
3160
3191
|
const glyph = /* @__PURE__ */ jsx19(action.icon, { className: sheet ? "size-5" : "size-3.5" });
|
|
3161
3192
|
if (action.href && !disabled && !action.newTab && Link) {
|
|
@@ -3332,7 +3363,7 @@ function useDoorsThatFit(row, primaryRef, opts) {
|
|
|
3332
3363
|
}, [row, primaryRef, doorPx, fixedDoors, fills, hasPrimary, sheet, actionCount]);
|
|
3333
3364
|
return fit;
|
|
3334
3365
|
}
|
|
3335
|
-
function PeekCardFooter({ primary, onSettings, doors = [], copy, openHref }) {
|
|
3366
|
+
function PeekCardFooter({ primary, primaryAt, onSettings, doors = [], copy, openHref }) {
|
|
3336
3367
|
const { density, size, orientation, loading, sheet } = usePeekCard();
|
|
3337
3368
|
const row = React16.useRef(null);
|
|
3338
3369
|
const primaryRef = React16.useRef(null);
|
|
@@ -3340,8 +3371,8 @@ function PeekCardFooter({ primary, onSettings, doors = [], copy, openHref }) {
|
|
|
3340
3371
|
const [moreOpen, setMoreOpen] = React16.useState(false);
|
|
3341
3372
|
const actions2 = recordDoors(doors);
|
|
3342
3373
|
const open = openHref ? { icon: ExternalLinkIcon, label: "Open in new tab", href: openHref, newTab: true } : null;
|
|
3343
|
-
const fixedDoors = [settings, copy, open].filter(Boolean).length;
|
|
3344
|
-
const fills = Boolean(sheet) || orientation === "portrait";
|
|
3374
|
+
const fixedDoors = [settings, copy, open].filter(Boolean).length + actions2.filter((action) => action.menu).length;
|
|
3375
|
+
const fills = Boolean(sheet) || (primaryAt ?? (orientation === "portrait" ? "fill" : "end")) === "fill";
|
|
3345
3376
|
const measured = useDoorsThatFit(row, primaryRef, {
|
|
3346
3377
|
doorPx: sheet ? 44 : 28,
|
|
3347
3378
|
fixedDoors,
|
|
@@ -3351,8 +3382,9 @@ function PeekCardFooter({ primary, onSettings, doors = [], copy, openHref }) {
|
|
|
3351
3382
|
actionCount: actions2.length
|
|
3352
3383
|
});
|
|
3353
3384
|
const room = measured ?? (sheet ? PEEK_SHEET_FOOTER_SLOTS : PEEK_CARD_FOOTER_SLOTS[size]) - fixedDoors;
|
|
3354
|
-
const inline = actions2.filter((action) => !action.inMenu);
|
|
3385
|
+
const inline = actions2.filter((action) => !action.inMenu && !action.menu);
|
|
3355
3386
|
const menuOnly = actions2.filter((action) => action.inMenu);
|
|
3387
|
+
const menuDoors = actions2.filter((action) => action.menu);
|
|
3356
3388
|
const inlineRoom = menuOnly.length ? Math.max(0, room - 1) : room;
|
|
3357
3389
|
const shown = inline.length <= inlineRoom ? inline : inline.slice(0, Math.max(0, inlineRoom - (menuOnly.length ? 0 : 1)));
|
|
3358
3390
|
const overflow = [...inline.slice(shown.length), ...menuOnly];
|
|
@@ -3365,7 +3397,9 @@ function PeekCardFooter({ primary, onSettings, doors = [], copy, openHref }) {
|
|
|
3365
3397
|
variant: "primary",
|
|
3366
3398
|
className: cn("mx-1", fills && "flex-1"),
|
|
3367
3399
|
style: fills ? { minWidth: PEEK_PRIMARY_MIN_PX[sheet ? "sheet" : "card"] } : void 0,
|
|
3368
|
-
disabled: loading,
|
|
3400
|
+
disabled: loading || primary.disabled || primary.busy,
|
|
3401
|
+
title: primary.title,
|
|
3402
|
+
icon: primary.busy ? /* @__PURE__ */ jsx19(Loader2Icon, { className: "animate-spin" }) : void 0,
|
|
3369
3403
|
onClick: primary.onClick,
|
|
3370
3404
|
children: primary.label
|
|
3371
3405
|
}
|
|
@@ -3377,7 +3411,7 @@ function PeekCardFooter({ primary, onSettings, doors = [], copy, openHref }) {
|
|
|
3377
3411
|
action.label
|
|
3378
3412
|
] }, `${action.label}-${i}`)) })
|
|
3379
3413
|
] }) : null;
|
|
3380
|
-
return /* @__PURE__ */ jsxs9(
|
|
3414
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3381
3415
|
sheet ? /* @__PURE__ */ jsx19("div", { "aria-hidden": true, className: "h-px shrink-0 bg-border" }) : /* @__PURE__ */ jsx19(PeekRule, {}),
|
|
3382
3416
|
/* @__PURE__ */ jsxs9(
|
|
3383
3417
|
"div",
|
|
@@ -3393,6 +3427,7 @@ function PeekCardFooter({ primary, onSettings, doors = [], copy, openHref }) {
|
|
|
3393
3427
|
settings ? /* @__PURE__ */ jsx19(FooterDoor, { action: settings, disabled: loading }) : null,
|
|
3394
3428
|
fills && primaryButton ? primaryButton : /* @__PURE__ */ jsx19("span", { className: "flex-1" }),
|
|
3395
3429
|
more,
|
|
3430
|
+
menuDoors.map((action, i) => /* @__PURE__ */ jsx19(FooterDoor, { action, disabled: loading }, `menu-${action.label}-${i}`)),
|
|
3396
3431
|
shown.map((action, i) => /* @__PURE__ */ jsx19(FooterDoor, { action, disabled: loading }, `${action.label}-${i}`)),
|
|
3397
3432
|
copy ? /* @__PURE__ */ jsx19(PeekCopyDoor, { copy, disabled: loading }) : null,
|
|
3398
3433
|
open ? /* @__PURE__ */ jsx19(FooterDoor, { action: open, disabled: loading }) : null,
|
|
@@ -3434,7 +3469,7 @@ function SheetHost({ trigger, children, label = "Details", open, onOpenChange, s
|
|
|
3434
3469
|
setOwn(next);
|
|
3435
3470
|
onOpenChange?.(next);
|
|
3436
3471
|
};
|
|
3437
|
-
return /* @__PURE__ */ jsxs9(
|
|
3472
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3438
3473
|
/* @__PURE__ */ jsx19(Slot2, { onClick: () => setOpen(true), children: trigger }),
|
|
3439
3474
|
/* @__PURE__ */ jsx19(PeekSheet, { open: isOpen, onOpenChange: setOpen, label, sheetFooter, children })
|
|
3440
3475
|
] });
|
|
@@ -3450,7 +3485,7 @@ function PeekHoverCard(props) {
|
|
|
3450
3485
|
{
|
|
3451
3486
|
openDelay: Math.max(HOVER_CARD_OPEN_DELAY_MS, HOVER_CARD_OPEN_DELAY_FLOOR_MS),
|
|
3452
3487
|
closeDelay: HOVER_CARD_CLOSE_DELAY_MS,
|
|
3453
|
-
open: open ??
|
|
3488
|
+
open: (open ?? hovered) || held,
|
|
3454
3489
|
onOpenChange: (next) => {
|
|
3455
3490
|
setHovered(next);
|
|
3456
3491
|
onOpenChange?.(next);
|
|
@@ -3591,7 +3626,7 @@ function FloatingPeekWindow({ open, onClose, initialPosition, children }) {
|
|
|
3591
3626
|
}
|
|
3592
3627
|
|
|
3593
3628
|
// src/peek.tsx
|
|
3594
|
-
import { Fragment as
|
|
3629
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3595
3630
|
var PeekEntityRendererContext = React17.createContext(null);
|
|
3596
3631
|
function PeekEntityRendererProvider({ render, children }) {
|
|
3597
3632
|
return /* @__PURE__ */ jsx20(PeekEntityRendererContext.Provider, { value: render, children });
|
|
@@ -3609,7 +3644,7 @@ function screamPartOnce(kind) {
|
|
|
3609
3644
|
function HostPart({ part }) {
|
|
3610
3645
|
const render = React17.useContext(PeekPartRendererContext);
|
|
3611
3646
|
const drawn = render?.(part);
|
|
3612
|
-
if (drawn) return /* @__PURE__ */ jsx20(
|
|
3647
|
+
if (drawn) return /* @__PURE__ */ jsx20(Fragment4, { children: drawn });
|
|
3613
3648
|
if (!render) {
|
|
3614
3649
|
screamPartOnce("token" in part ? `${part.part}:${part.token}` : part.part);
|
|
3615
3650
|
}
|
|
@@ -3643,7 +3678,7 @@ function EntityText({ entity, name }) {
|
|
|
3643
3678
|
const { EntityRef } = useMatrxDataTableHost();
|
|
3644
3679
|
const className = "type-secondary min-w-0 max-w-full truncate text-foreground";
|
|
3645
3680
|
const drawn = render?.({ ...entity, name, className });
|
|
3646
|
-
if (drawn) return /* @__PURE__ */ jsx20(
|
|
3681
|
+
if (drawn) return /* @__PURE__ */ jsx20(Fragment4, { children: drawn });
|
|
3647
3682
|
if (EntityRef) {
|
|
3648
3683
|
return /* @__PURE__ */ jsx20(
|
|
3649
3684
|
EntityRef,
|
|
@@ -3836,7 +3871,7 @@ function PeekBody({ record, size, orientation, height, density, frame, loading }
|
|
|
3836
3871
|
} : {},
|
|
3837
3872
|
...record.avatar ? { leading: /* @__PURE__ */ jsx20(PeekCardAvatar, { initials: record.avatar.initials, src: record.avatar.src }) } : record.glyph ? { leading: /* @__PURE__ */ jsx20(record.glyph, {}) } : {},
|
|
3838
3873
|
...record.favorite || record.badge ? {
|
|
3839
|
-
trailing: /* @__PURE__ */ jsxs10(
|
|
3874
|
+
trailing: /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
3840
3875
|
record.badge ? /* @__PURE__ */ jsx20(
|
|
3841
3876
|
Chip,
|
|
3842
3877
|
{
|
|
@@ -3860,7 +3895,7 @@ function PeekBody({ record, size, orientation, height, density, frame, loading }
|
|
|
3860
3895
|
children: [
|
|
3861
3896
|
record.failure ? /* @__PURE__ */ jsx20(Failure, { failure: record.failure }) : null,
|
|
3862
3897
|
record.media ? /* @__PURE__ */ jsx20(Media, { media: record.media }) : null,
|
|
3863
|
-
record.callout ? /* @__PURE__ */ jsx20(PeekCardCallout, { title: record.callout.title, ...record.callout.glyph ? { icon: record.callout.glyph } : {}, children: record.callout.text || record.callout.lines?.length ? /* @__PURE__ */ jsxs10(
|
|
3898
|
+
record.callout ? /* @__PURE__ */ jsx20(PeekCardCallout, { title: record.callout.title, ...record.callout.glyph ? { icon: record.callout.glyph } : {}, children: record.callout.text || record.callout.lines?.length ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
3864
3899
|
record.callout.text,
|
|
3865
3900
|
record.callout.lines?.map((line, i) => /* @__PURE__ */ jsx20("div", { className: "type-meta text-muted-foreground", ...line.hint ? { title: line.hint } : {}, children: line.text }, `${i}:${line.text}`))
|
|
3866
3901
|
] }) : null }) : null,
|
|
@@ -4187,7 +4222,7 @@ function compactCount(n) {
|
|
|
4187
4222
|
}
|
|
4188
4223
|
|
|
4189
4224
|
// src/contact-values/contact-values.tsx
|
|
4190
|
-
import { Fragment as
|
|
4225
|
+
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4191
4226
|
var HostContext = React18.createContext({});
|
|
4192
4227
|
function ContactValuesHostProvider({ children, ...host }) {
|
|
4193
4228
|
const value = React18.useMemo(() => host, [host.validateAddress]);
|
|
@@ -4260,7 +4295,7 @@ function ValueShell({ kind, glyph: Glyph, text, copy, state, record, peek, wrap
|
|
|
4260
4295
|
const { open, setHovered, setHeld, setPinned, trigger } = usePinnedHover();
|
|
4261
4296
|
const off = state !== "ok";
|
|
4262
4297
|
const value = /* @__PURE__ */ jsx22("span", { className: cn("min-w-0", wrap ? "whitespace-pre-line break-words" : "truncate", off ? "text-muted-foreground line-through" : "text-foreground"), children: text });
|
|
4263
|
-
const body = /* @__PURE__ */ jsxs11(
|
|
4298
|
+
const body = /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
4264
4299
|
/* @__PURE__ */ jsx22(Glyph, { className: cn("size-[1em] shrink-0", off ? "text-muted-foreground" : "text-muted-foreground") }),
|
|
4265
4300
|
value,
|
|
4266
4301
|
off ? /* @__PURE__ */ jsx22("span", { className: "shrink-0 text-muted-foreground no-underline", children: `\xB7 ${CONTACT_STATE_LABEL[state]}` }) : null
|
|
@@ -4676,11 +4711,143 @@ var AddTile = React20.forwardRef(function AddTile2({ icon, className, children,
|
|
|
4676
4711
|
);
|
|
4677
4712
|
});
|
|
4678
4713
|
|
|
4679
|
-
// src/
|
|
4680
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4714
|
+
// src/assist-peek.tsx
|
|
4681
4715
|
import * as React21 from "react";
|
|
4716
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
4682
4717
|
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4683
|
-
|
|
4718
|
+
function AssistPeekCard({
|
|
4719
|
+
title,
|
|
4720
|
+
icon: Icon,
|
|
4721
|
+
subtitle,
|
|
4722
|
+
children,
|
|
4723
|
+
why,
|
|
4724
|
+
evidence,
|
|
4725
|
+
yourNote,
|
|
4726
|
+
explainer,
|
|
4727
|
+
primary,
|
|
4728
|
+
later,
|
|
4729
|
+
stopShowing,
|
|
4730
|
+
deciding = false,
|
|
4731
|
+
onNotNow,
|
|
4732
|
+
step
|
|
4733
|
+
}) {
|
|
4734
|
+
const laterDoor = later?.length ? { kind: "action", id: "later", label: "Later", icon: ClockIcon, menu: later, busy: deciding } : null;
|
|
4735
|
+
const stopDoor = stopShowing?.length ? { kind: "action", id: "stop", label: "Stop showing", icon: BellOffIcon, menu: stopShowing, busy: deciding } : null;
|
|
4736
|
+
const doors = laterDoor && stopDoor ? [laterDoor, stopDoor] : laterDoor ? [laterDoor] : stopDoor ? [stopDoor] : [];
|
|
4737
|
+
return /* @__PURE__ */ jsxs14(PeekCard, { size: "xl", height: "content", "data-matrx-assist-peek": "", "data-matrx-notice-surface": "", children: [
|
|
4738
|
+
/* @__PURE__ */ jsx25(
|
|
4739
|
+
PeekCardHeader,
|
|
4740
|
+
{
|
|
4741
|
+
title,
|
|
4742
|
+
leading: Icon ? /* @__PURE__ */ jsx25(Icon, {}) : void 0,
|
|
4743
|
+
subtitle,
|
|
4744
|
+
trailing: /* @__PURE__ */ jsx25(Button2, { type: "button", variant: "quiet", "aria-label": "Not now", title: "Not now", icon: /* @__PURE__ */ jsx25(XIcon, {}), disabled: Boolean(primary.busy) || deciding, onClick: onNotNow })
|
|
4745
|
+
}
|
|
4746
|
+
),
|
|
4747
|
+
/* @__PURE__ */ jsxs14(PeekCardBody, { children: [
|
|
4748
|
+
children ? (
|
|
4749
|
+
// The explanation is what the person came to read: 14px (the size the host's markdown
|
|
4750
|
+
// paragraphs draw at), one step above the card's secondary sections.
|
|
4751
|
+
/* @__PURE__ */ jsx25("div", { "data-matrx-assist-body": "", className: "type-value min-w-0 break-words text-foreground", children: typeof children === "string" ? /* @__PURE__ */ jsx25("p", { className: "whitespace-pre-wrap", children }) : children })
|
|
4752
|
+
) : null,
|
|
4753
|
+
why ? /* @__PURE__ */ jsx25(PeekCardSection, { label: "Why", children: /* @__PURE__ */ jsx25(PeekCardText, { children: why }) }) : null,
|
|
4754
|
+
evidence ? /* @__PURE__ */ jsx25(EvidenceSection, { evidence }) : null,
|
|
4755
|
+
yourNote ? /* @__PURE__ */ jsx25(PeekCardSection, { label: "Your note", children: /* @__PURE__ */ jsx25(PeekCardText, { children: yourNote }) }) : null,
|
|
4756
|
+
explainer ? (
|
|
4757
|
+
// What pressing the verb will do, hung off a return arrow like a consequence.
|
|
4758
|
+
/* @__PURE__ */ jsx25(PeekCardRow, { icon: CornerDownRightIcon, tone: "muted", wrap: true, children: explainer })
|
|
4759
|
+
) : /* @__PURE__ */ jsx25(PeekCardSection, { label: "Not available here", tone: "danger", children: /* @__PURE__ */ jsx25(PeekCardText, { children: "This version of the app does not know how to do this." }) }),
|
|
4760
|
+
step
|
|
4761
|
+
] }),
|
|
4762
|
+
/* @__PURE__ */ jsx25(
|
|
4763
|
+
PeekCardFooter,
|
|
4764
|
+
{
|
|
4765
|
+
primaryAt: "end",
|
|
4766
|
+
primary: { ...primary, disabled: Boolean(primary.disabled) || explainer === null || deciding },
|
|
4767
|
+
doors
|
|
4768
|
+
}
|
|
4769
|
+
)
|
|
4770
|
+
] });
|
|
4771
|
+
}
|
|
4772
|
+
function EvidenceSection({ evidence }) {
|
|
4773
|
+
const items = evidence.items ?? [];
|
|
4774
|
+
return /* @__PURE__ */ jsxs14(PeekCardSection, { label: "What we saw", children: [
|
|
4775
|
+
/* @__PURE__ */ jsx25(
|
|
4776
|
+
PeekCardRows,
|
|
4777
|
+
{
|
|
4778
|
+
rows: [{ key: "evidence", text: evidence.label, title: evidence.label, href: evidence.href }]
|
|
4779
|
+
}
|
|
4780
|
+
),
|
|
4781
|
+
evidence.snippet ? /* @__PURE__ */ jsx25(PeekCardText, { clamp: 4, breaks: true, children: evidence.snippet }) : null,
|
|
4782
|
+
items.length ? /* @__PURE__ */ jsx25(PeekCardRows, { limit: 6, rows: items.map((item, i) => ({ key: `${i}-${item}`, text: item, title: item })) }) : null
|
|
4783
|
+
] });
|
|
4784
|
+
}
|
|
4785
|
+
function inCardMenu(target) {
|
|
4786
|
+
return target instanceof Element && target.closest("[data-radix-menu-content]") !== null;
|
|
4787
|
+
}
|
|
4788
|
+
function AssistPeekHover({ trigger, label, side = "top", align = "end", presentation, children }) {
|
|
4789
|
+
const [hovered, setHovered] = React21.useState(false);
|
|
4790
|
+
const [kept, setKept] = React21.useState(false);
|
|
4791
|
+
const isMobile = useIsMobile();
|
|
4792
|
+
const sheet = presentation === "sheet" || presentation !== "float" && isMobile;
|
|
4793
|
+
const card = React21.useRef(null);
|
|
4794
|
+
const close = React21.useCallback(() => {
|
|
4795
|
+
setHovered(false);
|
|
4796
|
+
setKept(false);
|
|
4797
|
+
}, []);
|
|
4798
|
+
React21.useEffect(() => {
|
|
4799
|
+
if (!kept) return;
|
|
4800
|
+
const onPress = (event) => {
|
|
4801
|
+
if (card.current?.contains(event.target) || inCardMenu(event.target)) return;
|
|
4802
|
+
close();
|
|
4803
|
+
};
|
|
4804
|
+
const onKey = (event) => {
|
|
4805
|
+
if (event.key !== "Escape" || document.querySelector("[data-radix-menu-content]")) return;
|
|
4806
|
+
close();
|
|
4807
|
+
};
|
|
4808
|
+
document.addEventListener("pointerdown", onPress, true);
|
|
4809
|
+
document.addEventListener("keydown", onKey);
|
|
4810
|
+
return () => {
|
|
4811
|
+
document.removeEventListener("pointerdown", onPress, true);
|
|
4812
|
+
document.removeEventListener("keydown", onKey);
|
|
4813
|
+
};
|
|
4814
|
+
}, [kept, close]);
|
|
4815
|
+
const keep = () => {
|
|
4816
|
+
setHovered(true);
|
|
4817
|
+
setKept(true);
|
|
4818
|
+
};
|
|
4819
|
+
return /* @__PURE__ */ jsx25(
|
|
4820
|
+
PeekHoverCard,
|
|
4821
|
+
{
|
|
4822
|
+
trigger: /* @__PURE__ */ jsx25(
|
|
4823
|
+
Slot3,
|
|
4824
|
+
{
|
|
4825
|
+
onClick: (event) => {
|
|
4826
|
+
event.stopPropagation();
|
|
4827
|
+
keep();
|
|
4828
|
+
},
|
|
4829
|
+
children: trigger
|
|
4830
|
+
}
|
|
4831
|
+
),
|
|
4832
|
+
label,
|
|
4833
|
+
side,
|
|
4834
|
+
align,
|
|
4835
|
+
open: hovered || kept,
|
|
4836
|
+
onOpenChange: (next) => {
|
|
4837
|
+
setHovered(next);
|
|
4838
|
+
if (!next && (sheet || !kept)) close();
|
|
4839
|
+
},
|
|
4840
|
+
...presentation ? { presentation } : {},
|
|
4841
|
+
children: /* @__PURE__ */ jsx25("div", { ref: card, onPointerDownCapture: keep, onFocusCapture: keep, children: children(close) })
|
|
4842
|
+
}
|
|
4843
|
+
);
|
|
4844
|
+
}
|
|
4845
|
+
|
|
4846
|
+
// src/radio-group.tsx
|
|
4847
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4848
|
+
import * as React22 from "react";
|
|
4849
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4850
|
+
var RadioGroupSizeContext = React22.createContext("md");
|
|
4684
4851
|
var CONTROL_CLASSES = {
|
|
4685
4852
|
sm: "h-3.5 w-3.5",
|
|
4686
4853
|
md: "h-4 w-4",
|
|
@@ -4691,7 +4858,7 @@ var DOT_CLASSES = {
|
|
|
4691
4858
|
md: "h-1.5 w-1.5",
|
|
4692
4859
|
lg: "h-2 w-2"
|
|
4693
4860
|
};
|
|
4694
|
-
var RadioGroup =
|
|
4861
|
+
var RadioGroup = React22.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx26(RadioGroupSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx26(
|
|
4695
4862
|
RadioGroupPrimitive.Root,
|
|
4696
4863
|
{
|
|
4697
4864
|
ref,
|
|
@@ -4701,10 +4868,10 @@ var RadioGroup = React21.forwardRef(({ className, size = "md", ...props }, ref)
|
|
|
4701
4868
|
}
|
|
4702
4869
|
) }));
|
|
4703
4870
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4704
|
-
var RadioGroupItem =
|
|
4705
|
-
const groupSize =
|
|
4871
|
+
var RadioGroupItem = React22.forwardRef(({ className, size, ...props }, ref) => {
|
|
4872
|
+
const groupSize = React22.useContext(RadioGroupSizeContext);
|
|
4706
4873
|
const resolved = size ?? groupSize;
|
|
4707
|
-
return /* @__PURE__ */
|
|
4874
|
+
return /* @__PURE__ */ jsx26(
|
|
4708
4875
|
RadioGroupPrimitive.Item,
|
|
4709
4876
|
{
|
|
4710
4877
|
ref,
|
|
@@ -4721,7 +4888,7 @@ var RadioGroupItem = React21.forwardRef(({ className, size, ...props }, ref) =>
|
|
|
4721
4888
|
className
|
|
4722
4889
|
),
|
|
4723
4890
|
...props,
|
|
4724
|
-
children: /* @__PURE__ */
|
|
4891
|
+
children: /* @__PURE__ */ jsx26(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx26(
|
|
4725
4892
|
"div",
|
|
4726
4893
|
{
|
|
4727
4894
|
className: cn("rounded-full bg-primary-foreground", DOT_CLASSES[resolved])
|
|
@@ -4739,8 +4906,8 @@ function RadioList({
|
|
|
4739
4906
|
className,
|
|
4740
4907
|
"aria-label": ariaLabel
|
|
4741
4908
|
}) {
|
|
4742
|
-
const baseId =
|
|
4743
|
-
return /* @__PURE__ */
|
|
4909
|
+
const baseId = React22.useId();
|
|
4910
|
+
return /* @__PURE__ */ jsx26(
|
|
4744
4911
|
RadioGroup,
|
|
4745
4912
|
{
|
|
4746
4913
|
value,
|
|
@@ -4751,7 +4918,7 @@ function RadioList({
|
|
|
4751
4918
|
children: options.map((opt, i) => {
|
|
4752
4919
|
const selected = value === opt.value;
|
|
4753
4920
|
const id = `${baseId}-${i}`;
|
|
4754
|
-
return /* @__PURE__ */
|
|
4921
|
+
return /* @__PURE__ */ jsxs15(
|
|
4755
4922
|
"label",
|
|
4756
4923
|
{
|
|
4757
4924
|
htmlFor: id,
|
|
@@ -4762,9 +4929,9 @@ function RadioList({
|
|
|
4762
4929
|
opt.disabled && "cursor-not-allowed text-disabled-foreground"
|
|
4763
4930
|
),
|
|
4764
4931
|
children: [
|
|
4765
|
-
/* @__PURE__ */
|
|
4766
|
-
/* @__PURE__ */
|
|
4767
|
-
opt.hint != null && opt.hint !== "" ? /* @__PURE__ */
|
|
4932
|
+
/* @__PURE__ */ jsx26(RadioGroupItem, { id, value: opt.value, disabled: opt.disabled }),
|
|
4933
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-1 truncate", children: opt.label }),
|
|
4934
|
+
opt.hint != null && opt.hint !== "" ? /* @__PURE__ */ jsx26("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: opt.hint }) : null
|
|
4768
4935
|
]
|
|
4769
4936
|
},
|
|
4770
4937
|
opt.value
|
|
@@ -4778,8 +4945,8 @@ function RadioList({
|
|
|
4778
4945
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4779
4946
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4780
4947
|
import { cva as cva4 } from "class-variance-authority";
|
|
4781
|
-
import * as
|
|
4782
|
-
import { jsx as
|
|
4948
|
+
import * as React23 from "react";
|
|
4949
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4783
4950
|
var toggleVariants = cva4(
|
|
4784
4951
|
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
4785
4952
|
{
|
|
@@ -4805,7 +4972,7 @@ var toggleVariants = cva4(
|
|
|
4805
4972
|
}
|
|
4806
4973
|
}
|
|
4807
4974
|
);
|
|
4808
|
-
var Toggle =
|
|
4975
|
+
var Toggle = React23.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
4809
4976
|
TogglePrimitive.Root,
|
|
4810
4977
|
{
|
|
4811
4978
|
ref,
|
|
@@ -4815,21 +4982,21 @@ var Toggle = React22.forwardRef(({ className, variant, size, ...props }, ref) =>
|
|
|
4815
4982
|
}
|
|
4816
4983
|
));
|
|
4817
4984
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
4818
|
-
var ToggleGroupContext =
|
|
4819
|
-
var ToggleGroup =
|
|
4985
|
+
var ToggleGroupContext = React23.createContext({ size: "default", variant: "default" });
|
|
4986
|
+
var ToggleGroup = React23.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
4820
4987
|
ToggleGroupPrimitive.Root,
|
|
4821
4988
|
{
|
|
4822
4989
|
ref,
|
|
4823
4990
|
"data-slot": "toggle-group",
|
|
4824
4991
|
className: cn("flex items-center justify-center gap-1", className),
|
|
4825
4992
|
...props,
|
|
4826
|
-
children: /* @__PURE__ */
|
|
4993
|
+
children: /* @__PURE__ */ jsx27(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
4827
4994
|
}
|
|
4828
4995
|
));
|
|
4829
4996
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
4830
|
-
var ToggleGroupItem =
|
|
4831
|
-
const context =
|
|
4832
|
-
return /* @__PURE__ */
|
|
4997
|
+
var ToggleGroupItem = React23.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
4998
|
+
const context = React23.useContext(ToggleGroupContext);
|
|
4999
|
+
return /* @__PURE__ */ jsx27(
|
|
4833
5000
|
ToggleGroupPrimitive.Item,
|
|
4834
5001
|
{
|
|
4835
5002
|
ref,
|
|
@@ -4849,8 +5016,8 @@ var ToggleGroupItem = React22.forwardRef(({ className, children, variant, size,
|
|
|
4849
5016
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
4850
5017
|
|
|
4851
5018
|
// src/floating-dock.tsx
|
|
4852
|
-
import * as
|
|
4853
|
-
import { jsx as
|
|
5019
|
+
import * as React24 from "react";
|
|
5020
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4854
5021
|
var BASE_SIZE = 40;
|
|
4855
5022
|
var BASE_ICON = 20;
|
|
4856
5023
|
var REACH = 150;
|
|
@@ -4870,29 +5037,29 @@ function FloatingDock({
|
|
|
4870
5037
|
growthFactor = 2,
|
|
4871
5038
|
labelPosition = "top"
|
|
4872
5039
|
}) {
|
|
4873
|
-
return /* @__PURE__ */
|
|
4874
|
-
/* @__PURE__ */
|
|
4875
|
-
/* @__PURE__ */
|
|
5040
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn("flex w-auto items-center justify-center bg-background", className), children: [
|
|
5041
|
+
/* @__PURE__ */ jsx28(FloatingDockPhone, { items }),
|
|
5042
|
+
/* @__PURE__ */ jsx28(FloatingDockDesktop, { items, growthFactor, labelPosition })
|
|
4876
5043
|
] });
|
|
4877
5044
|
}
|
|
4878
5045
|
function BalancedFloatingDock(props) {
|
|
4879
|
-
return /* @__PURE__ */
|
|
5046
|
+
return /* @__PURE__ */ jsx28(FloatingDock, { growthFactor: 1.8, labelPosition: "side", ...props });
|
|
4880
5047
|
}
|
|
4881
5048
|
function FloatingDockPhone({ items }) {
|
|
4882
|
-
const [open, setOpen] =
|
|
4883
|
-
return /* @__PURE__ */
|
|
4884
|
-
/* @__PURE__ */
|
|
5049
|
+
const [open, setOpen] = React24.useState(false);
|
|
5050
|
+
return /* @__PURE__ */ jsxs16("div", { className: "relative block md:hidden", children: [
|
|
5051
|
+
/* @__PURE__ */ jsx28(
|
|
4885
5052
|
Button2,
|
|
4886
5053
|
{
|
|
4887
5054
|
type: "button",
|
|
4888
5055
|
variant: "quiet",
|
|
4889
5056
|
"aria-label": open ? "Close menu" : "Open menu",
|
|
4890
|
-
icon: open ? /* @__PURE__ */
|
|
5057
|
+
icon: open ? /* @__PURE__ */ jsx28(PanelTopCloseIcon, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx28(PanelTopOpenIcon, { className: "h-5 w-5" }),
|
|
4891
5058
|
"aria-expanded": open,
|
|
4892
5059
|
onClick: () => setOpen(!open)
|
|
4893
5060
|
}
|
|
4894
5061
|
),
|
|
4895
|
-
/* @__PURE__ */
|
|
5062
|
+
/* @__PURE__ */ jsx28(
|
|
4896
5063
|
"div",
|
|
4897
5064
|
{
|
|
4898
5065
|
"data-open": open,
|
|
@@ -4902,32 +5069,32 @@ function FloatingDockPhone({ items }) {
|
|
|
4902
5069
|
PANEL_MOTION_CLASS,
|
|
4903
5070
|
open ? "translate-y-0" : "pointer-events-none -translate-y-full"
|
|
4904
5071
|
),
|
|
4905
|
-
children: /* @__PURE__ */
|
|
4906
|
-
/* @__PURE__ */
|
|
4907
|
-
/* @__PURE__ */
|
|
4908
|
-
/* @__PURE__ */
|
|
5072
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "flex h-full flex-col", children: [
|
|
5073
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between border-b border-border p-4", children: [
|
|
5074
|
+
/* @__PURE__ */ jsx28("h2", { className: "text-lg font-medium", children: "Menu" }),
|
|
5075
|
+
/* @__PURE__ */ jsx28(
|
|
4909
5076
|
Button2,
|
|
4910
5077
|
{
|
|
4911
5078
|
type: "button",
|
|
4912
5079
|
variant: "quiet",
|
|
4913
5080
|
"aria-label": "Close menu",
|
|
4914
|
-
icon: /* @__PURE__ */
|
|
5081
|
+
icon: /* @__PURE__ */ jsx28(XIcon, { className: "h-6 w-6" }),
|
|
4915
5082
|
onClick: () => setOpen(false)
|
|
4916
5083
|
}
|
|
4917
5084
|
)
|
|
4918
5085
|
] }),
|
|
4919
|
-
/* @__PURE__ */
|
|
5086
|
+
/* @__PURE__ */ jsx28("div", { className: "flex-1 overflow-y-auto", children: items.map((item) => /* @__PURE__ */ jsxs16(
|
|
4920
5087
|
HostLink,
|
|
4921
5088
|
{
|
|
4922
5089
|
href: item.href,
|
|
4923
5090
|
className: "flex items-center justify-between border-b border-border p-4",
|
|
4924
5091
|
onClick: () => setOpen(false),
|
|
4925
5092
|
children: [
|
|
4926
|
-
/* @__PURE__ */
|
|
4927
|
-
/* @__PURE__ */
|
|
4928
|
-
/* @__PURE__ */
|
|
5093
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center space-x-4", children: [
|
|
5094
|
+
/* @__PURE__ */ jsx28("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ jsx28("div", { className: "h-5 w-5 [&>svg]:h-full [&>svg]:w-full", children: item.icon }) }),
|
|
5095
|
+
/* @__PURE__ */ jsx28("span", { className: "font-medium", children: item.label })
|
|
4929
5096
|
] }),
|
|
4930
|
-
/* @__PURE__ */
|
|
5097
|
+
/* @__PURE__ */ jsx28(ChevronRightIcon, { className: "h-5 w-5 text-muted-foreground" })
|
|
4931
5098
|
]
|
|
4932
5099
|
},
|
|
4933
5100
|
item.label
|
|
@@ -4942,9 +5109,9 @@ function FloatingDockDesktop({
|
|
|
4942
5109
|
growthFactor,
|
|
4943
5110
|
labelPosition
|
|
4944
5111
|
}) {
|
|
4945
|
-
const circles =
|
|
4946
|
-
const [pointerX, setPointerX] =
|
|
4947
|
-
const [centers, setCenters] =
|
|
5112
|
+
const circles = React24.useRef([]);
|
|
5113
|
+
const [pointerX, setPointerX] = React24.useState(null);
|
|
5114
|
+
const [centers, setCenters] = React24.useState([]);
|
|
4948
5115
|
const measure = (x) => {
|
|
4949
5116
|
setPointerX(x);
|
|
4950
5117
|
setCenters(
|
|
@@ -4954,7 +5121,7 @@ function FloatingDockDesktop({
|
|
|
4954
5121
|
})
|
|
4955
5122
|
);
|
|
4956
5123
|
};
|
|
4957
|
-
return /* @__PURE__ */
|
|
5124
|
+
return /* @__PURE__ */ jsx28(
|
|
4958
5125
|
"div",
|
|
4959
5126
|
{
|
|
4960
5127
|
onMouseMove: (e) => measure(e.clientX),
|
|
@@ -4968,8 +5135,8 @@ function FloatingDockDesktop({
|
|
|
4968
5135
|
const size = dockSize(BASE_SIZE, growthFactor, distance);
|
|
4969
5136
|
const icon = dockSize(BASE_ICON, growthFactor, distance);
|
|
4970
5137
|
const under = Number.isFinite(distance) && Math.abs(distance) < BASE_SIZE / 2;
|
|
4971
|
-
return /* @__PURE__ */
|
|
4972
|
-
/* @__PURE__ */
|
|
5138
|
+
return /* @__PURE__ */ jsx28(HostLink, { href: item.href, "aria-label": item.label, children: /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
|
|
5139
|
+
/* @__PURE__ */ jsx28(
|
|
4973
5140
|
"div",
|
|
4974
5141
|
{
|
|
4975
5142
|
ref: (el) => {
|
|
@@ -4980,7 +5147,7 @@ function FloatingDockDesktop({
|
|
|
4980
5147
|
"relative flex aspect-square items-center justify-center rounded-full bg-muted transition-[width,height]",
|
|
4981
5148
|
MAGNIFY_MOTION
|
|
4982
5149
|
),
|
|
4983
|
-
children: /* @__PURE__ */
|
|
5150
|
+
children: /* @__PURE__ */ jsx28(
|
|
4984
5151
|
"div",
|
|
4985
5152
|
{
|
|
4986
5153
|
style: { width: icon, height: icon },
|
|
@@ -4993,7 +5160,7 @@ function FloatingDockDesktop({
|
|
|
4993
5160
|
)
|
|
4994
5161
|
}
|
|
4995
5162
|
),
|
|
4996
|
-
/* @__PURE__ */
|
|
5163
|
+
/* @__PURE__ */ jsx28(
|
|
4997
5164
|
"div",
|
|
4998
5165
|
{
|
|
4999
5166
|
"data-shown": under,
|
|
@@ -5014,18 +5181,18 @@ function FloatingDockDesktop({
|
|
|
5014
5181
|
}
|
|
5015
5182
|
|
|
5016
5183
|
// src/deferred-dialog.tsx
|
|
5017
|
-
import * as
|
|
5018
|
-
import { jsx as
|
|
5184
|
+
import * as React25 from "react";
|
|
5185
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5019
5186
|
function deferredDialog(name, load, isOpen) {
|
|
5020
5187
|
let pending = null;
|
|
5021
5188
|
const preload = () => pending ??= load().then((component) => ({ default: component }));
|
|
5022
|
-
const Body =
|
|
5189
|
+
const Body = React25.lazy(preload);
|
|
5023
5190
|
function Deferred(props) {
|
|
5024
5191
|
const open = isOpen(props);
|
|
5025
|
-
const [opened, setOpened] =
|
|
5192
|
+
const [opened, setOpened] = React25.useState(open);
|
|
5026
5193
|
if (open && !opened) setOpened(true);
|
|
5027
5194
|
if (!open && !opened) return null;
|
|
5028
|
-
return /* @__PURE__ */
|
|
5195
|
+
return /* @__PURE__ */ jsx29(React25.Suspense, { fallback: null, children: /* @__PURE__ */ jsx29(Body, { ...props }) });
|
|
5029
5196
|
}
|
|
5030
5197
|
Deferred.displayName = name;
|
|
5031
5198
|
return Object.assign(Deferred, { preload });
|
|
@@ -5071,10 +5238,10 @@ var TextInputDialog = deferredDialog(
|
|
|
5071
5238
|
// src/clipboard-fallback-host.tsx
|
|
5072
5239
|
import { clipboardFallbackOpener } from "@ai-matrx/kit/clipboard-fallback-opener";
|
|
5073
5240
|
import { useOpenerHost } from "@ai-matrx/kit/opener-react";
|
|
5074
|
-
import { jsx as
|
|
5241
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5075
5242
|
function ClipboardFallbackHost() {
|
|
5076
5243
|
const { open, shown, settle } = useOpenerHost(clipboardFallbackOpener);
|
|
5077
|
-
return /* @__PURE__ */
|
|
5244
|
+
return /* @__PURE__ */ jsx30(
|
|
5078
5245
|
ClipboardFallbackDialog,
|
|
5079
5246
|
{
|
|
5080
5247
|
open,
|
|
@@ -5089,8 +5256,8 @@ function ClipboardFallbackHost() {
|
|
|
5089
5256
|
}
|
|
5090
5257
|
|
|
5091
5258
|
// src/floating-sheet.tsx
|
|
5092
|
-
import { useState as
|
|
5093
|
-
import { Fragment as
|
|
5259
|
+
import { useState as useState15, useEffect as useEffect9, useCallback as useCallback7, useRef as useRef9 } from "react";
|
|
5260
|
+
import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5094
5261
|
var FloatingSheet = ({
|
|
5095
5262
|
children,
|
|
5096
5263
|
isOpen,
|
|
@@ -5125,16 +5292,16 @@ var FloatingSheet = ({
|
|
|
5125
5292
|
respectHeader = true
|
|
5126
5293
|
// Default to true - sheets should respect the header by default
|
|
5127
5294
|
}) => {
|
|
5128
|
-
const [hasRendered, setHasRendered] =
|
|
5129
|
-
const sheetRef =
|
|
5130
|
-
const contentRef =
|
|
5131
|
-
const [scrollPosition, setScrollPosition] =
|
|
5132
|
-
|
|
5295
|
+
const [hasRendered, setHasRendered] = useState15(false);
|
|
5296
|
+
const sheetRef = useRef9(null);
|
|
5297
|
+
const contentRef = useRef9(null);
|
|
5298
|
+
const [scrollPosition, setScrollPosition] = useState15(0);
|
|
5299
|
+
useEffect9(() => {
|
|
5133
5300
|
if (!hasRendered) {
|
|
5134
5301
|
setHasRendered(true);
|
|
5135
5302
|
}
|
|
5136
5303
|
}, []);
|
|
5137
|
-
|
|
5304
|
+
useEffect9(() => {
|
|
5138
5305
|
if (!lockScroll) return void 0;
|
|
5139
5306
|
if (isOpen) {
|
|
5140
5307
|
const scrollY = window.scrollY;
|
|
@@ -5159,7 +5326,7 @@ var FloatingSheet = ({
|
|
|
5159
5326
|
document.body.style.overflow = "";
|
|
5160
5327
|
};
|
|
5161
5328
|
}, [isOpen, lockScroll]);
|
|
5162
|
-
|
|
5329
|
+
useEffect9(() => {
|
|
5163
5330
|
const handleKeyDown = (e) => {
|
|
5164
5331
|
if (e.key === "Escape" && isOpen && closeOnEsc && !e.defaultPrevented) {
|
|
5165
5332
|
if (holdsUnsentWork) {
|
|
@@ -5176,22 +5343,22 @@ var FloatingSheet = ({
|
|
|
5176
5343
|
document.removeEventListener("keydown", handleKeyDown);
|
|
5177
5344
|
};
|
|
5178
5345
|
}, [isOpen, closeOnEsc, holdsUnsentWork, onClose]);
|
|
5179
|
-
|
|
5346
|
+
useEffect9(() => {
|
|
5180
5347
|
if (isOpen && initialFocus && sheetRef.current) {
|
|
5181
5348
|
sheetRef.current.focus();
|
|
5182
5349
|
}
|
|
5183
5350
|
}, [isOpen, initialFocus]);
|
|
5184
|
-
|
|
5351
|
+
useEffect9(() => {
|
|
5185
5352
|
if (isOpen && contentRef.current && preserveScrollPosition) {
|
|
5186
5353
|
contentRef.current.scrollTop = scrollPosition;
|
|
5187
5354
|
}
|
|
5188
5355
|
}, [isOpen, preserveScrollPosition, scrollPosition]);
|
|
5189
|
-
|
|
5356
|
+
useEffect9(() => {
|
|
5190
5357
|
if (!isOpen && contentRef.current && preserveScrollPosition) {
|
|
5191
5358
|
setScrollPosition(contentRef.current.scrollTop);
|
|
5192
5359
|
}
|
|
5193
5360
|
}, [isOpen, preserveScrollPosition]);
|
|
5194
|
-
const handleBackdropClick =
|
|
5361
|
+
const handleBackdropClick = useCallback7(() => {
|
|
5195
5362
|
if (holdsUnsentWork) return;
|
|
5196
5363
|
if (onBackdropClick) {
|
|
5197
5364
|
onBackdropClick();
|
|
@@ -5396,8 +5563,8 @@ var FloatingSheet = ({
|
|
|
5396
5563
|
const bottomPadding = showFooter ? "" : "pb-safe";
|
|
5397
5564
|
return `${basePadding} ${bottomPadding}`.trim();
|
|
5398
5565
|
};
|
|
5399
|
-
return /* @__PURE__ */
|
|
5400
|
-
isOpen && hasBackdrop && /* @__PURE__ */
|
|
5566
|
+
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
5567
|
+
isOpen && hasBackdrop && /* @__PURE__ */ jsx31(
|
|
5401
5568
|
"div",
|
|
5402
5569
|
{
|
|
5403
5570
|
className: `fixed ${respectHeader ? "left-0 right-0 top-10 bottom-0" : "inset-0"} bg-[var(--matrx-overlay-scrim-soft)] z-40 ${isMobile ? "backdrop-blur-sm" : ""} transition-opacity ${durationClass} ${backdropClassName}`,
|
|
@@ -5406,7 +5573,7 @@ var FloatingSheet = ({
|
|
|
5406
5573
|
"data-testid": "floating-sheet-backdrop"
|
|
5407
5574
|
}
|
|
5408
5575
|
),
|
|
5409
|
-
/* @__PURE__ */
|
|
5576
|
+
/* @__PURE__ */ jsx31(
|
|
5410
5577
|
"div",
|
|
5411
5578
|
{
|
|
5412
5579
|
ref: sheetRef,
|
|
@@ -5418,25 +5585,25 @@ var FloatingSheet = ({
|
|
|
5418
5585
|
"aria-labelledby": "sheet-title",
|
|
5419
5586
|
tabIndex: -1,
|
|
5420
5587
|
"data-testid": "floating-sheet",
|
|
5421
|
-
children: /* @__PURE__ */
|
|
5422
|
-
showHeader && /* @__PURE__ */
|
|
5588
|
+
children: /* @__PURE__ */ jsxs17("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
5589
|
+
showHeader && /* @__PURE__ */ jsxs17(
|
|
5423
5590
|
"div",
|
|
5424
5591
|
{
|
|
5425
5592
|
className: `flex items-center justify-between border-b border-border ${getMobileHeaderClass()} ${headerClassName}`,
|
|
5426
5593
|
children: [
|
|
5427
|
-
/* @__PURE__ */
|
|
5428
|
-
typeof title === "string" ? /* @__PURE__ */
|
|
5429
|
-
description && (typeof description === "string" ? /* @__PURE__ */
|
|
5594
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
|
|
5595
|
+
typeof title === "string" ? /* @__PURE__ */ jsx31("h2", { id: "sheet-title", className: `${isMobile ? "text-xl" : "text-lg"} font-semibold text-foreground`, children: title }) : /* @__PURE__ */ jsx31("div", { id: "sheet-title", children: title }),
|
|
5596
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx31("p", { className: "type-body text-muted-foreground mt-1", children: description }) : /* @__PURE__ */ jsx31("div", { className: "mt-1", children: description }))
|
|
5430
5597
|
] }),
|
|
5431
|
-
headerContent && /* @__PURE__ */
|
|
5432
|
-
showCloseButton && /* @__PURE__ */
|
|
5598
|
+
headerContent && /* @__PURE__ */ jsx31("div", { className: "ml-4 flex items-center", children: headerContent }),
|
|
5599
|
+
showCloseButton && /* @__PURE__ */ jsx31(
|
|
5433
5600
|
"button",
|
|
5434
5601
|
{
|
|
5435
5602
|
onClick: onClose,
|
|
5436
5603
|
className: `ml-4 rounded-full ${isMobile ? "p-2" : "p-1.5"} text-muted-foreground hover:text-foreground bg-transparent hover:bg-accent focus:outline-none focus:ring-2 focus:ring-ring`,
|
|
5437
5604
|
"aria-label": "Close",
|
|
5438
5605
|
"data-testid": "floating-sheet-close",
|
|
5439
|
-
children: closeButton || /* @__PURE__ */
|
|
5606
|
+
children: closeButton || /* @__PURE__ */ jsxs17(
|
|
5440
5607
|
"svg",
|
|
5441
5608
|
{
|
|
5442
5609
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5448,8 +5615,8 @@ var FloatingSheet = ({
|
|
|
5448
5615
|
strokeLinecap: "round",
|
|
5449
5616
|
strokeLinejoin: "round",
|
|
5450
5617
|
children: [
|
|
5451
|
-
/* @__PURE__ */
|
|
5452
|
-
/* @__PURE__ */
|
|
5618
|
+
/* @__PURE__ */ jsx31("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
5619
|
+
/* @__PURE__ */ jsx31("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
5453
5620
|
]
|
|
5454
5621
|
}
|
|
5455
5622
|
)
|
|
@@ -5458,7 +5625,7 @@ var FloatingSheet = ({
|
|
|
5458
5625
|
]
|
|
5459
5626
|
}
|
|
5460
5627
|
),
|
|
5461
|
-
/* @__PURE__ */
|
|
5628
|
+
/* @__PURE__ */ jsx31(
|
|
5462
5629
|
"div",
|
|
5463
5630
|
{
|
|
5464
5631
|
ref: contentRef,
|
|
@@ -5467,7 +5634,7 @@ var FloatingSheet = ({
|
|
|
5467
5634
|
children
|
|
5468
5635
|
}
|
|
5469
5636
|
),
|
|
5470
|
-
showFooter && /* @__PURE__ */
|
|
5637
|
+
showFooter && /* @__PURE__ */ jsx31(
|
|
5471
5638
|
"div",
|
|
5472
5639
|
{
|
|
5473
5640
|
className: `border-t border-border ${getMobileFooterClass()} ${footerClassName}`,
|
|
@@ -5482,12 +5649,12 @@ var FloatingSheet = ({
|
|
|
5482
5649
|
};
|
|
5483
5650
|
|
|
5484
5651
|
// src/simple-tooltip.tsx
|
|
5485
|
-
import { jsx as
|
|
5652
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5486
5653
|
var SimpleTooltip = ({ children, text }) => {
|
|
5487
5654
|
if (!text) return children;
|
|
5488
|
-
return /* @__PURE__ */
|
|
5489
|
-
/* @__PURE__ */
|
|
5490
|
-
/* @__PURE__ */
|
|
5655
|
+
return /* @__PURE__ */ jsxs18(Tooltip, { children: [
|
|
5656
|
+
/* @__PURE__ */ jsx32(TooltipTrigger, { asChild: true, children }),
|
|
5657
|
+
/* @__PURE__ */ jsx32(TooltipContent, { children: /* @__PURE__ */ jsx32("p", { children: text }) })
|
|
5491
5658
|
] });
|
|
5492
5659
|
};
|
|
5493
5660
|
var AdvancedTooltip = ({
|
|
@@ -5510,24 +5677,24 @@ var AdvancedTooltip = ({
|
|
|
5510
5677
|
success: "bg-success text-success-foreground"
|
|
5511
5678
|
};
|
|
5512
5679
|
const baseContentClasses = "rounded-md px-3 py-1.5 text-sm shadow-md";
|
|
5513
|
-
return /* @__PURE__ */
|
|
5514
|
-
/* @__PURE__ */
|
|
5515
|
-
/* @__PURE__ */
|
|
5680
|
+
return /* @__PURE__ */ jsxs18(Tooltip, { delayDuration, children: [
|
|
5681
|
+
/* @__PURE__ */ jsx32(TooltipTrigger, { asChild: true, className, children }),
|
|
5682
|
+
/* @__PURE__ */ jsx32(
|
|
5516
5683
|
TooltipContent,
|
|
5517
5684
|
{
|
|
5518
5685
|
side,
|
|
5519
5686
|
align,
|
|
5520
5687
|
sideOffset,
|
|
5521
5688
|
className: `${baseContentClasses} ${variantStyles[variant]} ${contentClassName}`,
|
|
5522
|
-
children: /* @__PURE__ */
|
|
5689
|
+
children: /* @__PURE__ */ jsx32("p", { className: "leading-none whitespace-pre-wrap", children: text })
|
|
5523
5690
|
}
|
|
5524
5691
|
)
|
|
5525
5692
|
] });
|
|
5526
5693
|
};
|
|
5527
5694
|
|
|
5528
5695
|
// src/loading-spinner.tsx
|
|
5529
|
-
import
|
|
5530
|
-
import { Fragment as
|
|
5696
|
+
import React27 from "react";
|
|
5697
|
+
import { Fragment as Fragment7, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5531
5698
|
var animationStyles = `
|
|
5532
5699
|
@keyframes pulseWave {
|
|
5533
5700
|
0% { opacity: 0.3; transform: scale(0.8); }
|
|
@@ -5584,7 +5751,7 @@ var LoadingSpinner = ({
|
|
|
5584
5751
|
subtitle,
|
|
5585
5752
|
showProgressSteps = true
|
|
5586
5753
|
}) => {
|
|
5587
|
-
|
|
5754
|
+
React27.useEffect(() => {
|
|
5588
5755
|
const styleId = "loading-spinner-styles";
|
|
5589
5756
|
if (!document.getElementById(styleId)) {
|
|
5590
5757
|
const style = document.createElement("style");
|
|
@@ -5604,19 +5771,19 @@ var LoadingSpinner = ({
|
|
|
5604
5771
|
}
|
|
5605
5772
|
};
|
|
5606
5773
|
const sizeClasses2 = getSizeClasses();
|
|
5607
|
-
const renderDots = () => /* @__PURE__ */
|
|
5608
|
-
/* @__PURE__ */
|
|
5609
|
-
/* @__PURE__ */
|
|
5610
|
-
/* @__PURE__ */
|
|
5774
|
+
const renderDots = () => /* @__PURE__ */ jsxs19("div", { className: cn("flex items-center", sizeClasses2.container), children: [
|
|
5775
|
+
/* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-1") }),
|
|
5776
|
+
/* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-2") }),
|
|
5777
|
+
/* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-3") })
|
|
5611
5778
|
] });
|
|
5612
|
-
const renderBars = () => /* @__PURE__ */
|
|
5613
|
-
/* @__PURE__ */
|
|
5614
|
-
/* @__PURE__ */
|
|
5615
|
-
/* @__PURE__ */
|
|
5616
|
-
/* @__PURE__ */
|
|
5779
|
+
const renderBars = () => /* @__PURE__ */ jsxs19("div", { className: cn("flex items-center", sizeClasses2.container), children: [
|
|
5780
|
+
/* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-1") }),
|
|
5781
|
+
/* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-2") }),
|
|
5782
|
+
/* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-3") }),
|
|
5783
|
+
/* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-4") })
|
|
5617
5784
|
] });
|
|
5618
|
-
const renderBrain = () => /* @__PURE__ */
|
|
5619
|
-
/* @__PURE__ */
|
|
5785
|
+
const renderBrain = () => /* @__PURE__ */ jsxs19("div", { className: "relative w-6 h-6 flex items-center justify-center", children: [
|
|
5786
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute", children: /* @__PURE__ */ jsx33(
|
|
5620
5787
|
"svg",
|
|
5621
5788
|
{
|
|
5622
5789
|
width: "24",
|
|
@@ -5624,7 +5791,7 @@ var LoadingSpinner = ({
|
|
|
5624
5791
|
viewBox: "0 0 24 24",
|
|
5625
5792
|
fill: "none",
|
|
5626
5793
|
className: "w-5 h-5 text-primary dark:text-primary-foreground",
|
|
5627
|
-
children: /* @__PURE__ */
|
|
5794
|
+
children: /* @__PURE__ */ jsx33(
|
|
5628
5795
|
"path",
|
|
5629
5796
|
{
|
|
5630
5797
|
d: "M12 4C9.5 4 7.5 5.5 7.5 8C7.5 9 7.5 9.5 7 10.5C6.5 11.5 6 12 6 13.5C6 15.5 7.5 17 9.5 17C10.5 17 11 16.5 12 16.5C13 16.5 13.5 17 14.5 17C16.5 17 18 15.5 18 13.5C18 12 17.5 11.5 17 10.5C16.5 9.5 16.5 9 16.5 8C16.5 5.5 14.5 4 12 4Z",
|
|
@@ -5635,44 +5802,44 @@ var LoadingSpinner = ({
|
|
|
5635
5802
|
)
|
|
5636
5803
|
}
|
|
5637
5804
|
) }),
|
|
5638
|
-
/* @__PURE__ */
|
|
5639
|
-
/* @__PURE__ */
|
|
5640
|
-
/* @__PURE__ */
|
|
5641
|
-
/* @__PURE__ */
|
|
5642
|
-
/* @__PURE__ */
|
|
5643
|
-
/* @__PURE__ */
|
|
5805
|
+
/* @__PURE__ */ jsxs19("div", { className: "absolute inset-0", children: [
|
|
5806
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[8px] top-[10px] loading-neuron-1" }),
|
|
5807
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[12px] top-[8px] loading-neuron-2" }),
|
|
5808
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[16px] top-[10px] loading-neuron-3" }),
|
|
5809
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[10px] top-[14px] loading-neuron-4" }),
|
|
5810
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[14px] top-[14px] loading-neuron-5" })
|
|
5644
5811
|
] }),
|
|
5645
|
-
/* @__PURE__ */
|
|
5646
|
-
/* @__PURE__ */
|
|
5812
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute w-full h-full rounded-full border border-primary/30 dark:border-primary-foreground/30 loading-brain-pulse-1" }),
|
|
5813
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute w-full h-full rounded-full border border-primary/30 dark:border-primary-foreground/30 loading-brain-pulse-2" })
|
|
5647
5814
|
] });
|
|
5648
|
-
const renderMinimal = () => /* @__PURE__ */
|
|
5649
|
-
const renderWorkflow = () => /* @__PURE__ */
|
|
5650
|
-
/* @__PURE__ */
|
|
5651
|
-
/* @__PURE__ */
|
|
5652
|
-
/* @__PURE__ */
|
|
5653
|
-
/* @__PURE__ */
|
|
5815
|
+
const renderMinimal = () => /* @__PURE__ */ jsx33("div", { className: "relative", children: /* @__PURE__ */ jsx33("div", { className: cn(sizeClasses2.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-1") }) });
|
|
5816
|
+
const renderWorkflow = () => /* @__PURE__ */ jsxs19("div", { className: "flex flex-col items-center justify-center space-y-6", children: [
|
|
5817
|
+
/* @__PURE__ */ jsxs19("div", { className: "relative", children: [
|
|
5818
|
+
/* @__PURE__ */ jsx33("div", { className: "w-16 h-16 bg-primary/10 dark:bg-primary-foreground/10 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx33(WorkflowIcon, { className: "w-8 h-8 text-primary dark:text-primary-foreground" }) }),
|
|
5819
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute -top-1 -right-1 w-6 h-6 bg-primary dark:bg-primary-foreground rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx33(PlusIcon, { className: "w-3 h-3 text-primary-foreground dark:text-primary" }) }),
|
|
5820
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute inset-0 border-2 border-transparent border-t-primary dark:border-t-primary-foreground rounded-full matrx-spin" })
|
|
5654
5821
|
] }),
|
|
5655
|
-
/* @__PURE__ */
|
|
5656
|
-
/* @__PURE__ */
|
|
5657
|
-
/* @__PURE__ */
|
|
5822
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-center space-y-2", children: [
|
|
5823
|
+
/* @__PURE__ */ jsxs19("h2", { className: "text-lg font-semibold text-foreground flex items-center gap-2 justify-center", children: [
|
|
5824
|
+
/* @__PURE__ */ jsx33(Loader2Icon, { className: "w-4 h-4 matrx-spin" }),
|
|
5658
5825
|
title || "Loading Workflow"
|
|
5659
5826
|
] }),
|
|
5660
|
-
/* @__PURE__ */
|
|
5827
|
+
/* @__PURE__ */ jsx33("p", { className: "type-body text-muted-foreground max-w-sm", children: subtitle || message || "Setting up your workflow..." })
|
|
5661
5828
|
] }),
|
|
5662
|
-
showProgressSteps && /* @__PURE__ */
|
|
5663
|
-
/* @__PURE__ */
|
|
5664
|
-
/* @__PURE__ */
|
|
5665
|
-
/* @__PURE__ */
|
|
5829
|
+
showProgressSteps && /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 type-secondary text-muted-foreground", children: [
|
|
5830
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1", children: [
|
|
5831
|
+
/* @__PURE__ */ jsx33("div", { className: "w-2 h-2 bg-primary dark:bg-primary-foreground rounded-full matrx-pulse" }),
|
|
5832
|
+
/* @__PURE__ */ jsx33("span", { children: "Loading" })
|
|
5666
5833
|
] }),
|
|
5667
|
-
/* @__PURE__ */
|
|
5668
|
-
/* @__PURE__ */
|
|
5669
|
-
/* @__PURE__ */
|
|
5670
|
-
/* @__PURE__ */
|
|
5834
|
+
/* @__PURE__ */ jsx33("div", { className: "w-4 h-px bg-muted-foreground/30" }),
|
|
5835
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1", children: [
|
|
5836
|
+
/* @__PURE__ */ jsx33("div", { className: "w-2 h-2 bg-muted-foreground/30 rounded-full" }),
|
|
5837
|
+
/* @__PURE__ */ jsx33("span", { children: "Initializing" })
|
|
5671
5838
|
] }),
|
|
5672
|
-
/* @__PURE__ */
|
|
5673
|
-
/* @__PURE__ */
|
|
5674
|
-
/* @__PURE__ */
|
|
5675
|
-
/* @__PURE__ */
|
|
5839
|
+
/* @__PURE__ */ jsx33("div", { className: "w-4 h-px bg-muted-foreground/30" }),
|
|
5840
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1", children: [
|
|
5841
|
+
/* @__PURE__ */ jsx33("div", { className: "w-2 h-2 bg-muted-foreground/30 rounded-full" }),
|
|
5842
|
+
/* @__PURE__ */ jsx33("span", { children: "Ready" })
|
|
5676
5843
|
] })
|
|
5677
5844
|
] })
|
|
5678
5845
|
] });
|
|
@@ -5701,32 +5868,32 @@ var LoadingSpinner = ({
|
|
|
5701
5868
|
}
|
|
5702
5869
|
};
|
|
5703
5870
|
if (variant === "workflow" && (fullscreen || overlay)) {
|
|
5704
|
-
return /* @__PURE__ */
|
|
5871
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn(
|
|
5705
5872
|
"flex items-center justify-center bg-background",
|
|
5706
5873
|
fullscreen && "h-dvh w-full",
|
|
5707
5874
|
className
|
|
5708
5875
|
), children: [
|
|
5709
|
-
overlay && /* @__PURE__ */
|
|
5710
|
-
/* @__PURE__ */
|
|
5876
|
+
overlay && /* @__PURE__ */ jsx33("div", { className: "absolute inset-0 bg-background/80 backdrop-blur-sm z-50" }),
|
|
5877
|
+
/* @__PURE__ */ jsx33("div", { className: cn(
|
|
5711
5878
|
"flex flex-col items-center justify-center",
|
|
5712
5879
|
overlay && "relative z-50"
|
|
5713
5880
|
), children: renderWorkflow() })
|
|
5714
5881
|
] });
|
|
5715
5882
|
}
|
|
5716
|
-
return /* @__PURE__ */
|
|
5883
|
+
return /* @__PURE__ */ jsx33("div", { className: cn("flex items-center", className), children: variant === "workflow" ? renderWorkflow() : /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
5717
5884
|
renderSpinner(),
|
|
5718
|
-
showMessage && /* @__PURE__ */
|
|
5885
|
+
showMessage && /* @__PURE__ */ jsx33("span", { className: cn("ml-3 text-muted-foreground", sizeClasses2.text), children: message || getDefaultMessage() })
|
|
5719
5886
|
] }) });
|
|
5720
5887
|
};
|
|
5721
5888
|
|
|
5722
5889
|
// src/mini-loader.tsx
|
|
5723
|
-
import { jsx as
|
|
5890
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5724
5891
|
function MatrxMiniLoader() {
|
|
5725
|
-
return /* @__PURE__ */
|
|
5892
|
+
return /* @__PURE__ */ jsx34(LoadingSpinner, { variant: "dots", message: "Initializing Matrx...", size: "md" });
|
|
5726
5893
|
}
|
|
5727
5894
|
|
|
5728
5895
|
// src/suspense-loader.tsx
|
|
5729
|
-
import { jsx as
|
|
5896
|
+
import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5730
5897
|
var sizeClasses = {
|
|
5731
5898
|
xs: "h-3 w-3",
|
|
5732
5899
|
sm: "h-4 w-4",
|
|
@@ -5739,7 +5906,7 @@ function SuspenseLoader({
|
|
|
5739
5906
|
message,
|
|
5740
5907
|
className = ""
|
|
5741
5908
|
}) {
|
|
5742
|
-
const spinner = /* @__PURE__ */
|
|
5909
|
+
const spinner = /* @__PURE__ */ jsx35(
|
|
5743
5910
|
Loader2Icon,
|
|
5744
5911
|
{
|
|
5745
5912
|
className: `${sizeClasses[size]} matrx-spin text-disabled-foreground ${className}`,
|
|
@@ -5747,7 +5914,7 @@ function SuspenseLoader({
|
|
|
5747
5914
|
"aria-label": message ? void 0 : "Loading"
|
|
5748
5915
|
}
|
|
5749
5916
|
);
|
|
5750
|
-
const content = message ? /* @__PURE__ */
|
|
5917
|
+
const content = message ? /* @__PURE__ */ jsxs20(
|
|
5751
5918
|
"span",
|
|
5752
5919
|
{
|
|
5753
5920
|
className: "inline-flex items-center gap-2",
|
|
@@ -5755,19 +5922,19 @@ function SuspenseLoader({
|
|
|
5755
5922
|
"aria-live": "polite",
|
|
5756
5923
|
children: [
|
|
5757
5924
|
spinner,
|
|
5758
|
-
/* @__PURE__ */
|
|
5925
|
+
/* @__PURE__ */ jsx35("span", { children: message })
|
|
5759
5926
|
]
|
|
5760
5927
|
}
|
|
5761
5928
|
) : spinner;
|
|
5762
5929
|
if (centered) {
|
|
5763
|
-
return /* @__PURE__ */
|
|
5930
|
+
return /* @__PURE__ */ jsx35("div", { className: "flex items-center justify-center w-full h-full min-h-[2rem]", children: content });
|
|
5764
5931
|
}
|
|
5765
5932
|
return content;
|
|
5766
5933
|
}
|
|
5767
5934
|
|
|
5768
5935
|
// src/shimmer-text.tsx
|
|
5769
|
-
import { useCallback as
|
|
5770
|
-
import { jsx as
|
|
5936
|
+
import { useCallback as useCallback8, useRef as useRef10 } from "react";
|
|
5937
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5771
5938
|
var SHIMMER_STYLE = {
|
|
5772
5939
|
backgroundImage: "linear-gradient(90deg, color-mix(in srgb, currentColor 18%, transparent) 0%, currentColor 50%, color-mix(in srgb, currentColor 18%, transparent) 100%)",
|
|
5773
5940
|
backgroundSize: "200% 100%",
|
|
@@ -5776,8 +5943,8 @@ var SHIMMER_STYLE = {
|
|
|
5776
5943
|
WebkitTextFillColor: "transparent"
|
|
5777
5944
|
};
|
|
5778
5945
|
function useShimmerSweep(durationMs = 2e3) {
|
|
5779
|
-
const animationRef =
|
|
5780
|
-
return
|
|
5946
|
+
const animationRef = useRef10(null);
|
|
5947
|
+
return useCallback8(
|
|
5781
5948
|
(el) => {
|
|
5782
5949
|
animationRef.current?.cancel();
|
|
5783
5950
|
animationRef.current = null;
|
|
@@ -5795,7 +5962,7 @@ function useShimmerSweep(durationMs = 2e3) {
|
|
|
5795
5962
|
}
|
|
5796
5963
|
function ShimmerText({ text, className }) {
|
|
5797
5964
|
const ref = useShimmerSweep();
|
|
5798
|
-
return /* @__PURE__ */
|
|
5965
|
+
return /* @__PURE__ */ jsx36(
|
|
5799
5966
|
"span",
|
|
5800
5967
|
{
|
|
5801
5968
|
ref,
|
|
@@ -5852,24 +6019,24 @@ function formThemeClasses(theme) {
|
|
|
5852
6019
|
|
|
5853
6020
|
// src/first-use-hint.tsx
|
|
5854
6021
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
5855
|
-
import { Slot as
|
|
5856
|
-
import * as
|
|
5857
|
-
import { Fragment as
|
|
6022
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
6023
|
+
import * as React28 from "react";
|
|
6024
|
+
import { Fragment as Fragment8, jsx as jsx37, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5858
6025
|
var FIRST_USE_HINT_TITLE_MAX = 32;
|
|
5859
6026
|
var FIRST_USE_HINT_DETAIL_MAX = 60;
|
|
5860
|
-
var FirstUseHintContext =
|
|
6027
|
+
var FirstUseHintContext = React28.createContext(null);
|
|
5861
6028
|
function FirstUseHintProvider({
|
|
5862
6029
|
store,
|
|
5863
6030
|
children
|
|
5864
6031
|
}) {
|
|
5865
|
-
return /* @__PURE__ */
|
|
6032
|
+
return /* @__PURE__ */ jsx37(FirstUseHintContext.Provider, { value: store, children });
|
|
5866
6033
|
}
|
|
5867
6034
|
var sessionLearned = /* @__PURE__ */ new Set();
|
|
5868
6035
|
var warnedNoProvider = false;
|
|
5869
6036
|
function useFirstUseHint(id) {
|
|
5870
|
-
const store =
|
|
5871
|
-
const [, rerender] =
|
|
5872
|
-
const [dismissed, setDismissed] =
|
|
6037
|
+
const store = React28.useContext(FirstUseHintContext);
|
|
6038
|
+
const [, rerender] = React28.useReducer((n) => n + 1, 0);
|
|
6039
|
+
const [dismissed, setDismissed] = React28.useState(false);
|
|
5873
6040
|
if (!store && !warnedNoProvider) {
|
|
5874
6041
|
warnedNoProvider = true;
|
|
5875
6042
|
console.warn(
|
|
@@ -5878,7 +6045,7 @@ function useFirstUseHint(id) {
|
|
|
5878
6045
|
}
|
|
5879
6046
|
const learned = store ? store.learned.includes(id) : sessionLearned.has(id);
|
|
5880
6047
|
const ready = store ? store.ready : true;
|
|
5881
|
-
const learn =
|
|
6048
|
+
const learn = React28.useCallback(() => {
|
|
5882
6049
|
setDismissed(true);
|
|
5883
6050
|
if (store) {
|
|
5884
6051
|
if (!store.learned.includes(id)) store.learn(id);
|
|
@@ -5901,11 +6068,11 @@ function FirstUseHint({
|
|
|
5901
6068
|
pulse,
|
|
5902
6069
|
children
|
|
5903
6070
|
}) {
|
|
5904
|
-
const hostRef =
|
|
6071
|
+
const hostRef = React28.useRef(null);
|
|
5905
6072
|
const { visible, learn } = useFirstUseHint(id);
|
|
5906
6073
|
const eligible = visible && when;
|
|
5907
|
-
const [shown, setShown] =
|
|
5908
|
-
|
|
6074
|
+
const [shown, setShown] = React28.useState(false);
|
|
6075
|
+
React28.useEffect(() => {
|
|
5909
6076
|
if (!eligible) {
|
|
5910
6077
|
setShown(false);
|
|
5911
6078
|
return void 0;
|
|
@@ -5922,11 +6089,11 @@ function FirstUseHint({
|
|
|
5922
6089
|
}
|
|
5923
6090
|
const open = eligible && shown;
|
|
5924
6091
|
const beaconOn = open && beacon !== "none";
|
|
5925
|
-
const target =
|
|
6092
|
+
const target = React28.useCallback(
|
|
5926
6093
|
() => pulse ? hostRef.current?.querySelector(pulse) ?? hostRef.current : hostRef.current,
|
|
5927
6094
|
[pulse]
|
|
5928
6095
|
);
|
|
5929
|
-
|
|
6096
|
+
React28.useEffect(() => {
|
|
5930
6097
|
if (!pulse || !beaconOn) return void 0;
|
|
5931
6098
|
const el = target();
|
|
5932
6099
|
if (!el || el === hostRef.current) return void 0;
|
|
@@ -5937,7 +6104,7 @@ function FirstUseHint({
|
|
|
5937
6104
|
el.removeAttribute("data-matrx-hint-beacon");
|
|
5938
6105
|
};
|
|
5939
6106
|
}, [pulse, beaconOn, beacon, target]);
|
|
5940
|
-
const virtualRef =
|
|
6107
|
+
const virtualRef = React28.useMemo(
|
|
5941
6108
|
() => ({
|
|
5942
6109
|
current: {
|
|
5943
6110
|
getBoundingClientRect: () => target()?.getBoundingClientRect() ?? new DOMRect()
|
|
@@ -5945,10 +6112,10 @@ function FirstUseHint({
|
|
|
5945
6112
|
}),
|
|
5946
6113
|
[target]
|
|
5947
6114
|
);
|
|
5948
|
-
return /* @__PURE__ */
|
|
5949
|
-
pulse ? /* @__PURE__ */
|
|
5950
|
-
/* @__PURE__ */
|
|
5951
|
-
|
|
6115
|
+
return /* @__PURE__ */ jsxs21(Popover, { open, children: [
|
|
6116
|
+
pulse ? /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
6117
|
+
/* @__PURE__ */ jsx37(
|
|
6118
|
+
Slot4,
|
|
5952
6119
|
{
|
|
5953
6120
|
ref: hostRef,
|
|
5954
6121
|
"data-matrx-first-use-hint": open ? id : void 0,
|
|
@@ -5956,8 +6123,8 @@ function FirstUseHint({
|
|
|
5956
6123
|
children
|
|
5957
6124
|
}
|
|
5958
6125
|
),
|
|
5959
|
-
/* @__PURE__ */
|
|
5960
|
-
] }) : /* @__PURE__ */
|
|
6126
|
+
/* @__PURE__ */ jsx37(PopoverAnchor, { virtualRef })
|
|
6127
|
+
] }) : /* @__PURE__ */ jsx37(
|
|
5961
6128
|
PopoverAnchor,
|
|
5962
6129
|
{
|
|
5963
6130
|
asChild: true,
|
|
@@ -5969,7 +6136,7 @@ function FirstUseHint({
|
|
|
5969
6136
|
children
|
|
5970
6137
|
}
|
|
5971
6138
|
),
|
|
5972
|
-
/* @__PURE__ */
|
|
6139
|
+
/* @__PURE__ */ jsxs21(
|
|
5973
6140
|
PopoverContent,
|
|
5974
6141
|
{
|
|
5975
6142
|
side,
|
|
@@ -5986,17 +6153,17 @@ function FirstUseHint({
|
|
|
5986
6153
|
onInteractOutside: (e) => e.preventDefault(),
|
|
5987
6154
|
onEscapeKeyDown: learn,
|
|
5988
6155
|
children: [
|
|
5989
|
-
/* @__PURE__ */
|
|
5990
|
-
/* @__PURE__ */
|
|
5991
|
-
/* @__PURE__ */
|
|
6156
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1 py-0.5 pl-3 pr-0.5", children: [
|
|
6157
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 flex-col py-1", children: [
|
|
6158
|
+
/* @__PURE__ */ jsx37("span", { className: "type-secondary truncate font-medium text-foreground", children: title }),
|
|
5992
6159
|
detail ? (
|
|
5993
6160
|
// Two lines at most: on a 375px phone a full 60-character line can wrap once.
|
|
5994
|
-
/* @__PURE__ */
|
|
6161
|
+
/* @__PURE__ */ jsx37("span", { className: "type-secondary line-clamp-2 text-muted-foreground", children: detail })
|
|
5995
6162
|
) : null
|
|
5996
6163
|
] }),
|
|
5997
|
-
/* @__PURE__ */
|
|
6164
|
+
/* @__PURE__ */ jsx37(IconButton, { icon: XIcon, "aria-label": "Dismiss tip", className: "shrink-0", onClick: learn })
|
|
5998
6165
|
] }),
|
|
5999
|
-
/* @__PURE__ */
|
|
6166
|
+
/* @__PURE__ */ jsx37(PopoverPrimitive2.Arrow, { className: "fill-popover", width: 10, height: 5 })
|
|
6000
6167
|
]
|
|
6001
6168
|
}
|
|
6002
6169
|
)
|
|
@@ -6004,8 +6171,8 @@ function FirstUseHint({
|
|
|
6004
6171
|
}
|
|
6005
6172
|
|
|
6006
6173
|
// src/review-changes.tsx
|
|
6007
|
-
import * as
|
|
6008
|
-
import { jsx as
|
|
6174
|
+
import * as React29 from "react";
|
|
6175
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6009
6176
|
var SKIP = "skip";
|
|
6010
6177
|
function unansweredQuestions(preview, answers) {
|
|
6011
6178
|
return preview.questions.filter((q) => !answers[q.id]);
|
|
@@ -6018,16 +6185,16 @@ function acceptSuggestions(preview, answers) {
|
|
|
6018
6185
|
for (const q of preview.questions) if (!next[q.id] && q.suggested) next[q.id] = q.suggested;
|
|
6019
6186
|
return next;
|
|
6020
6187
|
}
|
|
6021
|
-
var RenderItemContext =
|
|
6188
|
+
var RenderItemContext = React29.createContext(void 0);
|
|
6022
6189
|
function ItemDoor({ item, onOpenItem }) {
|
|
6023
|
-
const renderItem =
|
|
6190
|
+
const renderItem = React29.useContext(RenderItemContext);
|
|
6024
6191
|
const hosted = renderItem ? renderItem(item) : null;
|
|
6025
6192
|
if (hosted != null) {
|
|
6026
|
-
return /* @__PURE__ */
|
|
6193
|
+
return /* @__PURE__ */ jsx38("span", { "data-change-item": item.id, className: "inline-flex max-w-full items-center", children: hosted });
|
|
6027
6194
|
}
|
|
6028
6195
|
const title = item.title?.trim() || "Untitled";
|
|
6029
|
-
return /* @__PURE__ */
|
|
6030
|
-
/* @__PURE__ */
|
|
6196
|
+
return /* @__PURE__ */ jsxs22("span", { "data-change-item": item.id, className: "inline-flex max-w-full items-center gap-0.5", children: [
|
|
6197
|
+
/* @__PURE__ */ jsx38(
|
|
6031
6198
|
Button2,
|
|
6032
6199
|
{
|
|
6033
6200
|
type: "button",
|
|
@@ -6038,12 +6205,12 @@ function ItemDoor({ item, onOpenItem }) {
|
|
|
6038
6205
|
children: title
|
|
6039
6206
|
}
|
|
6040
6207
|
),
|
|
6041
|
-
/* @__PURE__ */
|
|
6208
|
+
/* @__PURE__ */ jsx38(
|
|
6042
6209
|
Button2,
|
|
6043
6210
|
{
|
|
6044
6211
|
type: "button",
|
|
6045
6212
|
variant: "quiet",
|
|
6046
|
-
icon: /* @__PURE__ */
|
|
6213
|
+
icon: /* @__PURE__ */ jsx38(ExternalLinkIcon, {}),
|
|
6047
6214
|
"data-clickable": "",
|
|
6048
6215
|
"aria-label": `Open ${title} in a new tab`,
|
|
6049
6216
|
className: "shrink-0",
|
|
@@ -6055,9 +6222,9 @@ function ItemDoor({ item, onOpenItem }) {
|
|
|
6055
6222
|
function Doors({ items, total, onOpenItem }) {
|
|
6056
6223
|
if (!items.length) return null;
|
|
6057
6224
|
const more = (total ?? items.length) - items.length;
|
|
6058
|
-
return /* @__PURE__ */
|
|
6059
|
-
items.map((item) => /* @__PURE__ */
|
|
6060
|
-
more > 0 ? /* @__PURE__ */
|
|
6225
|
+
return /* @__PURE__ */ jsxs22("span", { className: "flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
6226
|
+
items.map((item) => /* @__PURE__ */ jsx38(ItemDoor, { item, onOpenItem }, `${item.table ?? item.type}:${item.id}`)),
|
|
6227
|
+
more > 0 ? /* @__PURE__ */ jsxs22("span", { className: "text-xs text-muted-foreground", children: [
|
|
6061
6228
|
"+",
|
|
6062
6229
|
more,
|
|
6063
6230
|
" more"
|
|
@@ -6065,17 +6232,17 @@ function Doors({ items, total, onOpenItem }) {
|
|
|
6065
6232
|
] });
|
|
6066
6233
|
}
|
|
6067
6234
|
function Row({ title, meta, children }) {
|
|
6068
|
-
return /* @__PURE__ */
|
|
6069
|
-
/* @__PURE__ */
|
|
6070
|
-
/* @__PURE__ */
|
|
6071
|
-
meta ? /* @__PURE__ */
|
|
6235
|
+
return /* @__PURE__ */ jsxs22("div", { "data-change-row": "", className: "flex flex-col gap-1 px-3 py-2", children: [
|
|
6236
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
6237
|
+
/* @__PURE__ */ jsx38("span", { className: "min-w-0 text-sm text-foreground", children: title }),
|
|
6238
|
+
meta ? /* @__PURE__ */ jsx38("span", { className: "shrink-0 text-xs text-muted-foreground", children: meta }) : null
|
|
6072
6239
|
] }),
|
|
6073
6240
|
children
|
|
6074
6241
|
] });
|
|
6075
6242
|
}
|
|
6076
6243
|
function Alarm({ warning, onOpenItem }) {
|
|
6077
6244
|
const items = [...warning.items ?? [], ...warning.users ?? []];
|
|
6078
|
-
return /* @__PURE__ */
|
|
6245
|
+
return /* @__PURE__ */ jsxs22(
|
|
6079
6246
|
"div",
|
|
6080
6247
|
{
|
|
6081
6248
|
role: "alert",
|
|
@@ -6083,8 +6250,8 @@ function Alarm({ warning, onOpenItem }) {
|
|
|
6083
6250
|
"data-severity": warning.severity,
|
|
6084
6251
|
className: "flex flex-col gap-1.5 rounded-group border border-destructive bg-destructive/10 px-3 py-2",
|
|
6085
6252
|
children: [
|
|
6086
|
-
/* @__PURE__ */
|
|
6087
|
-
/* @__PURE__ */
|
|
6253
|
+
/* @__PURE__ */ jsx38("span", { className: "text-sm font-medium text-foreground", children: warning.message }),
|
|
6254
|
+
/* @__PURE__ */ jsx38(Doors, { items, total: warning.count ?? items.length, onOpenItem })
|
|
6088
6255
|
]
|
|
6089
6256
|
}
|
|
6090
6257
|
);
|
|
@@ -6101,10 +6268,10 @@ function Question({ question, answer, onAnswer, onOpenItem, disabled }) {
|
|
|
6101
6268
|
const suggested = !question.suggested ? null : yes && question.suggested === yes.value ? "yes" : noOption && question.suggested === noOption.value ? "no" : "other";
|
|
6102
6269
|
const wayOut = rest.map((o) => ({ value: o.value, label: o.label }));
|
|
6103
6270
|
const chosen = [...question.options, ...question.way_out].find((o) => o.value === answer);
|
|
6104
|
-
return /* @__PURE__ */
|
|
6105
|
-
/* @__PURE__ */
|
|
6106
|
-
/* @__PURE__ */
|
|
6107
|
-
/* @__PURE__ */
|
|
6271
|
+
return /* @__PURE__ */ jsxs22("div", { "data-change-question": question.id, "data-kind": question.kind, className: "flex flex-col gap-1.5 px-3 py-2", children: [
|
|
6272
|
+
/* @__PURE__ */ jsx38("span", { className: "text-sm text-foreground", children: question.prompt }),
|
|
6273
|
+
/* @__PURE__ */ jsx38(Doors, { items: question.items.sample, total: question.items.count, onOpenItem }),
|
|
6274
|
+
/* @__PURE__ */ jsx38(
|
|
6108
6275
|
DecisionControl,
|
|
6109
6276
|
{
|
|
6110
6277
|
value,
|
|
@@ -6126,7 +6293,7 @@ function Question({ question, answer, onAnswer, onOpenItem, disabled }) {
|
|
|
6126
6293
|
"aria-label": question.prompt
|
|
6127
6294
|
}
|
|
6128
6295
|
),
|
|
6129
|
-
chosen?.consequence ? /* @__PURE__ */
|
|
6296
|
+
chosen?.consequence ? /* @__PURE__ */ jsx38("span", { className: "text-xs text-muted-foreground", children: chosen.consequence }) : null
|
|
6130
6297
|
] });
|
|
6131
6298
|
}
|
|
6132
6299
|
var VERB_WORDS = {
|
|
@@ -6135,7 +6302,7 @@ var VERB_WORDS = {
|
|
|
6135
6302
|
move: { goes: "Moves with it", commit: "Move" }
|
|
6136
6303
|
};
|
|
6137
6304
|
function ReviewChanges({ renderItem, ...props }) {
|
|
6138
|
-
return /* @__PURE__ */
|
|
6305
|
+
return /* @__PURE__ */ jsx38(RenderItemContext.Provider, { value: renderItem, children: /* @__PURE__ */ jsx38(ReviewChangesBody, { ...props }) });
|
|
6139
6306
|
}
|
|
6140
6307
|
function ReviewChangesBody({ preview, answers, onAnswer, onOpenItem, onCommit, onCancel, busy, commitLabel, className }) {
|
|
6141
6308
|
const words = VERB_WORDS[preview.verb] ?? { goes: "Changes with it", commit: "Apply" };
|
|
@@ -6149,33 +6316,33 @@ function ReviewChangesBody({ preview, answers, onAnswer, onOpenItem, onCommit, o
|
|
|
6149
6316
|
const suggestible = pending.filter((q) => q.suggested);
|
|
6150
6317
|
const ready = canCommitChanges(preview, answers);
|
|
6151
6318
|
const target = preview.target_organization?.name;
|
|
6152
|
-
return /* @__PURE__ */
|
|
6153
|
-
alarms.map((w, i) => /* @__PURE__ */
|
|
6154
|
-
/* @__PURE__ */
|
|
6155
|
-
moving.length ? /* @__PURE__ */
|
|
6156
|
-
kept.length || staying.length ? /* @__PURE__ */
|
|
6157
|
-
kept.map((w, i) => /* @__PURE__ */
|
|
6158
|
-
staying.map((g) => /* @__PURE__ */
|
|
6319
|
+
return /* @__PURE__ */ jsxs22("div", { "data-review-changes": "", "data-verb": preview.verb, className: cn("flex min-h-0 flex-col gap-3", className), children: [
|
|
6320
|
+
alarms.map((w, i) => /* @__PURE__ */ jsx38(Alarm, { warning: w, onOpenItem }, `${w.kind}:${i}`)),
|
|
6321
|
+
/* @__PURE__ */ jsx38(RowGroup, { title: preview.verb === "move" && target ? `Moving to ${target}` : void 0, children: /* @__PURE__ */ jsx38(Row, { title: /* @__PURE__ */ jsx38(Doors, { items: preview.roots, onOpenItem }) }) }),
|
|
6322
|
+
moving.length ? /* @__PURE__ */ jsx38(RowGroup, { title: words.goes, children: moving.map((g) => /* @__PURE__ */ jsx38(Row, { title: g.noun, meta: `${g.count_is_estimate ? "about " : ""}${g.count}`, children: /* @__PURE__ */ jsx38(Doors, { items: g.sample, total: g.count, onOpenItem }) }, `${g.rule_id ?? "root"}:${g.table ?? g.type}`)) }) : null,
|
|
6323
|
+
kept.length || staying.length ? /* @__PURE__ */ jsxs22(RowGroup, { title: "Stays where it is", children: [
|
|
6324
|
+
kept.map((w, i) => /* @__PURE__ */ jsx38(Row, { title: w.message ?? w.noun ?? "Used elsewhere", meta: w.count ?? void 0, children: /* @__PURE__ */ jsx38(Doors, { items: w.items ?? [], total: w.count, onOpenItem }) }, `kept:${i}`)),
|
|
6325
|
+
staying.map((g) => /* @__PURE__ */ jsx38(Row, { title: g.noun, meta: g.count, children: /* @__PURE__ */ jsx38(Doors, { items: g.sample, total: g.count, onOpenItem }) }, `stay:${g.table ?? g.type}`))
|
|
6159
6326
|
] }) : null,
|
|
6160
|
-
preview.questions.length ? /* @__PURE__ */
|
|
6161
|
-
auto || unchecked ? /* @__PURE__ */
|
|
6162
|
-
auto ? /* @__PURE__ */
|
|
6163
|
-
unchecked ? /* @__PURE__ */
|
|
6327
|
+
preview.questions.length ? /* @__PURE__ */ jsx38(RowGroup, { title: "Decide", children: preview.questions.map((q) => /* @__PURE__ */ jsx38(Question, { question: q, answer: answers[q.id], onAnswer, onOpenItem, disabled: busy }, q.id)) }) : null,
|
|
6328
|
+
auto || unchecked ? /* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap gap-2 px-1", children: [
|
|
6329
|
+
auto ? /* @__PURE__ */ jsx38(Badge, { tone: "neutral", children: `${auto.count ?? ""} decided automatically`.trim() }) : null,
|
|
6330
|
+
unchecked ? /* @__PURE__ */ jsx38(Badge, { tone: "neutral", children: "Links inside text not checked" }) : null
|
|
6164
6331
|
] }) : null,
|
|
6165
|
-
/* @__PURE__ */
|
|
6166
|
-
suggestible.length ? /* @__PURE__ */
|
|
6167
|
-
/* @__PURE__ */
|
|
6168
|
-
/* @__PURE__ */
|
|
6332
|
+
/* @__PURE__ */ jsxs22("div", { "data-review-changes-actions": "", className: "flex flex-wrap items-center justify-end gap-2", children: [
|
|
6333
|
+
suggestible.length ? /* @__PURE__ */ jsx38(Button2, { variant: "quiet", disabled: busy, onClick: () => suggestible.forEach((q) => onAnswer(q.id, q.suggested)), children: "Accept suggestions" }) : null,
|
|
6334
|
+
/* @__PURE__ */ jsx38(Button2, { variant: "outline", disabled: busy, onClick: onCancel, children: "Cancel" }),
|
|
6335
|
+
/* @__PURE__ */ jsx38(Button2, { variant: preview.verb === "delete" ? "danger" : "primary", disabled: busy || !ready, onClick: onCommit, children: commitLabel ?? words.commit })
|
|
6169
6336
|
] })
|
|
6170
6337
|
] });
|
|
6171
6338
|
}
|
|
6172
6339
|
|
|
6173
6340
|
// src/grid-canvas/grid-canvas.tsx
|
|
6174
6341
|
import {
|
|
6175
|
-
useEffect as
|
|
6342
|
+
useEffect as useEffect11,
|
|
6176
6343
|
useLayoutEffect as useLayoutEffect3,
|
|
6177
|
-
useRef as
|
|
6178
|
-
useState as
|
|
6344
|
+
useRef as useRef12,
|
|
6345
|
+
useState as useState17
|
|
6179
6346
|
} from "react";
|
|
6180
6347
|
|
|
6181
6348
|
// src/grid-canvas/layout.ts
|
|
@@ -6336,7 +6503,7 @@ function insertLines(boxes, id, line, col, cols) {
|
|
|
6336
6503
|
}
|
|
6337
6504
|
|
|
6338
6505
|
// src/grid-canvas/grid-canvas.tsx
|
|
6339
|
-
import { jsx as
|
|
6506
|
+
import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6340
6507
|
var GRID_CANVAS_COLUMNS = { lg: 12, sm: 4 };
|
|
6341
6508
|
var GRID_CANVAS_PHONE_MAX_PX = 640;
|
|
6342
6509
|
var GRID_CANVAS_ROW_PX = 24;
|
|
@@ -6380,7 +6547,7 @@ function resolveGridCanvas(items, fit = "cells") {
|
|
|
6380
6547
|
}
|
|
6381
6548
|
var sameGrid = (a, b) => a.length === b.length && a.every((x, i) => x.x === b[i].x && x.y === b[i].y && x.w === b[i].w && x.h === b[i].h);
|
|
6382
6549
|
function useBreakpoint(ref) {
|
|
6383
|
-
const [breakpoint, setBreakpoint] =
|
|
6550
|
+
const [breakpoint, setBreakpoint] = useState17("lg");
|
|
6384
6551
|
useLayoutEffect3(() => {
|
|
6385
6552
|
const el = ref.current;
|
|
6386
6553
|
if (!el) return;
|
|
@@ -6408,14 +6575,14 @@ function GridCanvas({
|
|
|
6408
6575
|
className,
|
|
6409
6576
|
"aria-label": ariaLabel
|
|
6410
6577
|
}) {
|
|
6411
|
-
const rootRef =
|
|
6578
|
+
const rootRef = useRef12(null);
|
|
6412
6579
|
const breakpoint = useBreakpoint(rootRef);
|
|
6413
6580
|
const resolved = resolveGridCanvas(items, fit);
|
|
6414
|
-
const [preview, setPreview] =
|
|
6415
|
-
const gesture =
|
|
6416
|
-
const itemEls =
|
|
6417
|
-
const [announcement, setAnnouncement] =
|
|
6418
|
-
|
|
6581
|
+
const [preview, setPreview] = useState17(null);
|
|
6582
|
+
const gesture = useRef12(null);
|
|
6583
|
+
const itemEls = useRef12(/* @__PURE__ */ new Map());
|
|
6584
|
+
const [announcement, setAnnouncement] = useState17("");
|
|
6585
|
+
useEffect11(() => () => gesture.current?.handle.cancel(), []);
|
|
6419
6586
|
const grids = {
|
|
6420
6587
|
lg: preview?.breakpoint === "lg" ? preview.boxes : resolved.lg,
|
|
6421
6588
|
sm: preview?.breakpoint === "sm" ? preview.boxes : resolved.sm
|
|
@@ -6511,7 +6678,7 @@ function GridCanvas({
|
|
|
6511
6678
|
};
|
|
6512
6679
|
const rows = { lg: gridRows(grids.lg), sm: gridRows(grids.sm) };
|
|
6513
6680
|
const active = preview ? preview.boxes.find((b) => b.id === preview.id) : void 0;
|
|
6514
|
-
return /* @__PURE__ */
|
|
6681
|
+
return /* @__PURE__ */ jsxs23(
|
|
6515
6682
|
"div",
|
|
6516
6683
|
{
|
|
6517
6684
|
ref: rootRef,
|
|
@@ -6531,8 +6698,8 @@ function GridCanvas({
|
|
|
6531
6698
|
"--grid-rows-sm": preview?.breakpoint === "sm" ? rows.sm + 1 : rows.sm
|
|
6532
6699
|
},
|
|
6533
6700
|
children: [
|
|
6534
|
-
/* @__PURE__ */
|
|
6535
|
-
active && preview ? /* @__PURE__ */
|
|
6701
|
+
/* @__PURE__ */ jsxs23("div", { className: "matrx-grid-canvas-field", children: [
|
|
6702
|
+
active && preview ? /* @__PURE__ */ jsx39("div", { className: "matrx-grid-canvas-placeholder", "aria-hidden": true, style: placementVars(active, active) }) : null,
|
|
6536
6703
|
items.map((item, n) => {
|
|
6537
6704
|
const lg = grids.lg[n];
|
|
6538
6705
|
const sm = grids.sm[n];
|
|
@@ -6541,7 +6708,7 @@ function GridCanvas({
|
|
|
6541
6708
|
const drawLg = moving && preview.breakpoint === "lg" ? startBox : lg;
|
|
6542
6709
|
const drawSm = moving && preview.breakpoint === "sm" ? startBox : sm;
|
|
6543
6710
|
const label = itemLabel?.(item.id);
|
|
6544
|
-
return /* @__PURE__ */
|
|
6711
|
+
return /* @__PURE__ */ jsxs23(
|
|
6545
6712
|
"div",
|
|
6546
6713
|
{
|
|
6547
6714
|
ref: (el) => {
|
|
@@ -6557,8 +6724,8 @@ function GridCanvas({
|
|
|
6557
6724
|
onPointerDown: editable ? (e) => onItemPointerDown(e, item.id) : void 0,
|
|
6558
6725
|
onKeyDown: editable ? (e) => onItemKeyDown(e, item.id) : void 0,
|
|
6559
6726
|
children: [
|
|
6560
|
-
/* @__PURE__ */
|
|
6561
|
-
editable ? /* @__PURE__ */
|
|
6727
|
+
/* @__PURE__ */ jsx39("div", { className: "matrx-grid-canvas-content", children: renderItem(item.id, { breakpoint, editing: editable }) }),
|
|
6728
|
+
editable ? /* @__PURE__ */ jsx39(
|
|
6562
6729
|
"span",
|
|
6563
6730
|
{
|
|
6564
6731
|
className: "matrx-grid-canvas-resize",
|
|
@@ -6573,7 +6740,7 @@ function GridCanvas({
|
|
|
6573
6740
|
);
|
|
6574
6741
|
})
|
|
6575
6742
|
] }),
|
|
6576
|
-
/* @__PURE__ */
|
|
6743
|
+
/* @__PURE__ */ jsx39("span", { className: "matrx-grid-canvas-live", "aria-live": "polite", children: announcement })
|
|
6577
6744
|
]
|
|
6578
6745
|
}
|
|
6579
6746
|
);
|
|
@@ -6643,6 +6810,8 @@ export {
|
|
|
6643
6810
|
AppRailSpacer,
|
|
6644
6811
|
ArchiveFilter,
|
|
6645
6812
|
ArchivedDisclosure,
|
|
6813
|
+
AssistPeekCard,
|
|
6814
|
+
AssistPeekHover,
|
|
6646
6815
|
AuthGateDialog,
|
|
6647
6816
|
Avatar,
|
|
6648
6817
|
AvatarFallback,
|