@estiva-app/ui 0.76.0 → 0.78.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/Button.d.ts +5 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/EmptyState.d.ts +2 -4
- package/dist/EmptyState.d.ts.map +1 -1
- package/dist/EntryShell.d.ts +50 -0
- package/dist/EntryShell.d.ts.map +1 -0
- package/dist/NavItem.d.ts +3 -1
- package/dist/NavItem.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +348 -330
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/registry.json +66 -4
- package/src/Button.tsx +6 -0
- package/src/EmptyState.tsx +2 -2
- package/src/EntryShell.mdx +69 -0
- package/src/EntryShell.stories.tsx +48 -0
- package/src/EntryShell.test.tsx +69 -0
- package/src/EntryShell.tsx +76 -0
- package/src/NavItem.mdx +8 -0
- package/src/NavItem.stories.tsx +5 -0
- package/src/NavItem.test.tsx +40 -1
- package/src/NavItem.tsx +12 -1
- package/src/index.ts +2 -1
- package/src/registry/registry.test.ts +4 -4
- package/stories/Choosing.mdx +1 -0
package/dist/index.js
CHANGED
|
@@ -3199,10 +3199,22 @@ function EditableText({ value, display, displayNode, placeholder, onCommit, mult
|
|
|
3199
3199
|
);
|
|
3200
3200
|
}
|
|
3201
3201
|
|
|
3202
|
+
// src/EntryShell.tsx
|
|
3203
|
+
import { cloneElement as cloneElement2 } from "react";
|
|
3204
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3205
|
+
var isEmpty = (node) => node == null || node === false || typeof node === "string" && node.trim() === "";
|
|
3206
|
+
function EntryShell({ logo, busy = false, busyLabel = "Loading", message, action, className }) {
|
|
3207
|
+
return /* @__PURE__ */ jsx45("div", { className: cn("min-h-screen bg-bg-base flex items-center justify-center p-6", className), children: busy ? /* @__PURE__ */ jsx45("div", { role: "status", "aria-busy": "true", "aria-label": busyLabel, className: "flex flex-col items-center gap-4", children: cloneElement2(logo, { className: cn(logo.props.className, "animate-skeleton-in animate-pulse") }) }) : /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center gap-4", children: [
|
|
3208
|
+
logo,
|
|
3209
|
+
!isEmpty(message) && /* @__PURE__ */ jsx45("p", { role: "status", className: "text-body-2 text-text-secondary max-w-sm text-center", children: message }),
|
|
3210
|
+
action && /* @__PURE__ */ jsx45(Button, { variant: "primary", type: "button", onClick: action.onClick, disabled: action.disabled, children: action.label })
|
|
3211
|
+
] }) });
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3202
3214
|
// src/ErrorBoundary.tsx
|
|
3203
3215
|
import { Component } from "react";
|
|
3204
3216
|
import { IconAlertTriangle as IconAlertTriangle2 } from "@tabler/icons-react";
|
|
3205
|
-
import { jsx as
|
|
3217
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3206
3218
|
var ErrorBoundary = class extends Component {
|
|
3207
3219
|
state = { hasError: false };
|
|
3208
3220
|
static getDerivedStateFromError() {
|
|
@@ -3213,22 +3225,22 @@ var ErrorBoundary = class extends Component {
|
|
|
3213
3225
|
}
|
|
3214
3226
|
render() {
|
|
3215
3227
|
if (!this.state.hasError) return this.props.children;
|
|
3216
|
-
const message = /* @__PURE__ */
|
|
3228
|
+
const message = /* @__PURE__ */ jsx46(
|
|
3217
3229
|
EmptyState,
|
|
3218
3230
|
{
|
|
3219
|
-
icon: /* @__PURE__ */
|
|
3231
|
+
icon: /* @__PURE__ */ jsx46(IconAlertTriangle2, { size: 16, stroke: 1.5 }),
|
|
3220
3232
|
message: `Something went wrong${this.props.label ? ` in the ${this.props.label}` : ""}. Your data is safe \u2014 try again.`,
|
|
3221
3233
|
action: { label: "Try again", onClick: () => this.setState({ hasError: false }) }
|
|
3222
3234
|
}
|
|
3223
3235
|
);
|
|
3224
3236
|
if (this.props.frame) return this.props.frame(message);
|
|
3225
|
-
return this.props.fallbackClassName ? /* @__PURE__ */
|
|
3237
|
+
return this.props.fallbackClassName ? /* @__PURE__ */ jsx46("div", { className: this.props.fallbackClassName, children: message }) : message;
|
|
3226
3238
|
}
|
|
3227
3239
|
};
|
|
3228
3240
|
|
|
3229
3241
|
// src/ProgressBar.tsx
|
|
3230
3242
|
import { Progress } from "@base-ui/react/progress";
|
|
3231
|
-
import { jsx as
|
|
3243
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3232
3244
|
var TRACK_CLASSES = {
|
|
3233
3245
|
default: "h-1.5 w-full overflow-hidden rounded-full bg-bg-inset",
|
|
3234
3246
|
// 4px, Katerina's ruling of 14 September; Peek's own bar is 3px until it takes this one.
|
|
@@ -3241,13 +3253,13 @@ var INDICATOR_CLASSES = {
|
|
|
3241
3253
|
function ProgressBar({ value, max, label, variant = "default", className }) {
|
|
3242
3254
|
return (
|
|
3243
3255
|
// `max={0}` needs no guard: Base UI reads the 0/0 share as an empty bar.
|
|
3244
|
-
/* @__PURE__ */
|
|
3256
|
+
/* @__PURE__ */ jsx47(Progress.Root, { value, max, "aria-label": label, className, children: /* @__PURE__ */ jsx47(Progress.Track, { className: TRACK_CLASSES[variant], children: /* @__PURE__ */ jsx47(Progress.Indicator, { className: INDICATOR_CLASSES[variant] }) }) })
|
|
3245
3257
|
);
|
|
3246
3258
|
}
|
|
3247
3259
|
|
|
3248
3260
|
// src/Breadcrumb.tsx
|
|
3249
3261
|
import { Fragment as Fragment12, useCallback as useCallback3, useLayoutEffect as useLayoutEffect4, useRef as useRef10, useState as useState8 } from "react";
|
|
3250
|
-
import { jsx as
|
|
3262
|
+
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3251
3263
|
function Breadcrumb({ items, className }) {
|
|
3252
3264
|
const navRef = useRef10(null);
|
|
3253
3265
|
const labelRefs = useRef10([]);
|
|
@@ -3267,7 +3279,7 @@ function Breadcrumb({ items, className }) {
|
|
|
3267
3279
|
observer.observe(nav);
|
|
3268
3280
|
return () => observer.disconnect();
|
|
3269
3281
|
}, [measure, items]);
|
|
3270
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx48("nav", { ref: navRef, "aria-label": "Breadcrumb", className: cn("flex min-w-0 items-center gap-1.5 text-body-2", className), children: items.map((item, index) => {
|
|
3271
3283
|
const last = index === items.length - 1;
|
|
3272
3284
|
const tone = item.muted || last && item.mono ? "text-text-muted" : last ? "text-text-primary" : "text-text-secondary";
|
|
3273
3285
|
const text = cn(
|
|
@@ -3288,16 +3300,16 @@ function Breadcrumb({ items, className }) {
|
|
|
3288
3300
|
// on a box around it, which the link takes them from, rather than
|
|
3289
3301
|
// pushed into it (UIG-9); the link is still the one element that
|
|
3290
3302
|
// truncates and is measured.
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
) : /* @__PURE__ */
|
|
3293
|
-
return /* @__PURE__ */
|
|
3294
|
-
index > 0 && /* @__PURE__ */
|
|
3295
|
-
item.icon && /* @__PURE__ */
|
|
3303
|
+
/* @__PURE__ */ jsx48("span", { className: cn("flex min-w-0", item.mono && "shrink-0 font-mono text-caption", tone, "hover:text-text-primary"), children: /* @__PURE__ */ jsx48(Link, { ref: setLabelRef, variant: "plain", truncate: true, href: item.href, onClick: item.onClick, children: item.label }) })
|
|
3304
|
+
) : /* @__PURE__ */ jsx48("span", { ref: setLabelRef, className: text, "aria-current": last ? "page" : void 0, children: item.label });
|
|
3305
|
+
return /* @__PURE__ */ jsxs32(Fragment12, { children: [
|
|
3306
|
+
index > 0 && /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", className: "shrink-0 text-text-muted", children: "/" }),
|
|
3307
|
+
item.icon && /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", className: cn("flex shrink-0", tone), children: item.icon }),
|
|
3296
3308
|
truncated.has(index) ? (
|
|
3297
3309
|
// `min-w-0 shrink` undoes the wrapper's own shrink-0 — the crumb
|
|
3298
3310
|
// must keep truncating inside it, or wrapping it would widen the
|
|
3299
3311
|
// trail and the tooltip would never be needed again.
|
|
3300
|
-
/* @__PURE__ */
|
|
3312
|
+
/* @__PURE__ */ jsx48(WithTooltip, { label: item.label, wrapperClassName: "min-w-0 shrink", children: crumb })
|
|
3301
3313
|
) : crumb
|
|
3302
3314
|
] }, `${item.label}-${index}`);
|
|
3303
3315
|
}) });
|
|
@@ -3309,13 +3321,13 @@ import { Collapsible } from "@base-ui/react/collapsible";
|
|
|
3309
3321
|
import { IconAlertSquareRounded, IconChevronRight as IconChevronRight2, IconDotsVertical } from "@tabler/icons-react";
|
|
3310
3322
|
|
|
3311
3323
|
// src/UnreadDot.tsx
|
|
3312
|
-
import { jsx as
|
|
3324
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3313
3325
|
function UnreadDot({ className }) {
|
|
3314
|
-
return /* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ jsx49("div", { className: cn("flex h-6 w-6 shrink-0 items-center justify-center", className), "data-unread": true, children: /* @__PURE__ */ jsx49("div", { className: "h-1.5 w-1.5 rounded-full bg-accent-primary" }) });
|
|
3315
3327
|
}
|
|
3316
3328
|
|
|
3317
3329
|
// src/NavItem.tsx
|
|
3318
|
-
import { jsx as
|
|
3330
|
+
import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3319
3331
|
function NavItem({
|
|
3320
3332
|
label,
|
|
3321
3333
|
href,
|
|
@@ -3327,6 +3339,7 @@ function NavItem({
|
|
|
3327
3339
|
menuLabel,
|
|
3328
3340
|
action,
|
|
3329
3341
|
hint,
|
|
3342
|
+
tooltip,
|
|
3330
3343
|
unread = false,
|
|
3331
3344
|
urgent = false,
|
|
3332
3345
|
children,
|
|
@@ -3348,9 +3361,9 @@ function NavItem({
|
|
|
3348
3361
|
};
|
|
3349
3362
|
const buttons = (menu != null ? 1 : 0) + (action ? 1 : 0);
|
|
3350
3363
|
const besides = buttons > 0 || hasRows;
|
|
3351
|
-
const mark = unread ? urgent ? /* @__PURE__ */
|
|
3364
|
+
const mark = unread ? urgent ? /* @__PURE__ */ jsx50(UrgentMark, {}) : /* @__PURE__ */ jsx50(UnreadDot, {}) : null;
|
|
3352
3365
|
const stepsAside = buttons > 0 && "transition-opacity group-hover/nav:opacity-0 group-has-[:focus-visible]/nav:opacity-0 group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:opacity-0 [@media(hover:none)]:opacity-0";
|
|
3353
|
-
const row = /* @__PURE__ */
|
|
3366
|
+
const row = /* @__PURE__ */ jsxs33(
|
|
3354
3367
|
"a",
|
|
3355
3368
|
{
|
|
3356
3369
|
href,
|
|
@@ -3372,7 +3385,7 @@ function NavItem({
|
|
|
3372
3385
|
...props,
|
|
3373
3386
|
onClick: inApp,
|
|
3374
3387
|
children: [
|
|
3375
|
-
(icon || hasRows) && /* @__PURE__ */
|
|
3388
|
+
(icon || hasRows) && /* @__PURE__ */ jsx50(
|
|
3376
3389
|
"span",
|
|
3377
3390
|
{
|
|
3378
3391
|
className: cn(
|
|
@@ -3383,13 +3396,17 @@ function NavItem({
|
|
|
3383
3396
|
children: icon
|
|
3384
3397
|
}
|
|
3385
3398
|
),
|
|
3386
|
-
|
|
3399
|
+
tooltip?.trim() ? (
|
|
3400
|
+
// On the label alone, not the row: the ⋮ and the action keep their
|
|
3401
|
+
// own tooltips, and the two never stand up at once.
|
|
3402
|
+
/* @__PURE__ */ jsx50(WithTooltip, { label: tooltip, inline: true, wrapperClassName: "flex min-w-0 flex-1", children: /* @__PURE__ */ jsx50("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }) })
|
|
3403
|
+
) : /* @__PURE__ */ jsx50("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }),
|
|
3387
3404
|
hint != null && // Takes room only while it shows, so the label gives way to it.
|
|
3388
|
-
/* @__PURE__ */
|
|
3405
|
+
/* @__PURE__ */ jsx50("span", { className: "hidden shrink-0 items-center group-hover/nav:flex group-has-[:focus-visible]/nav:flex", children: hint }),
|
|
3389
3406
|
buttons > 1 && // Two buttons: the second one's room (24px and the 4px between them, the
|
|
3390
3407
|
// row's 8px gap making up the rest), kept only while they show.
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
count ? /* @__PURE__ */
|
|
3408
|
+
/* @__PURE__ */ jsx50("span", { "aria-hidden": "true", className: "hidden w-5 shrink-0 group-hover/nav:block group-has-[:focus-visible]/nav:block group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:block [@media(hover:none)]:block" }),
|
|
3409
|
+
count ? /* @__PURE__ */ jsx50(WithTooltip, { label: countLabel ?? `${count} open`, children: /* @__PURE__ */ jsx50(
|
|
3393
3410
|
"span",
|
|
3394
3411
|
{
|
|
3395
3412
|
className: cn(
|
|
@@ -3405,7 +3422,7 @@ function NavItem({
|
|
|
3405
3422
|
// `-mr-1`: the 24px slot's dot then sits on the axis of a count and
|
|
3406
3423
|
// of the ⋮ (8px from the edge to the 16px box), one column with a
|
|
3407
3424
|
// folder heading's dot and ⋮ (Katerina, 5 October).
|
|
3408
|
-
/* @__PURE__ */
|
|
3425
|
+
/* @__PURE__ */ jsx50("span", { className: cn("-mr-1 flex shrink-0", stepsAside), children: mark })
|
|
3409
3426
|
) : buttons > 0 && !count ? (
|
|
3410
3427
|
// Nothing at the right, but a menu: no room is kept at rest, so the
|
|
3411
3428
|
// label has the row's whole width; while the ⋮ shows, its 24px slot
|
|
@@ -3413,18 +3430,18 @@ function NavItem({
|
|
|
3413
3430
|
// `-mr-1`: the ⋮ sits at `right-1`, 4px into the row's padding, so the
|
|
3414
3431
|
// slot does too — at the padding's edge it kept 4px the ⋮ never
|
|
3415
3432
|
// covers, and the label stopped 12px short of the button, not 8.
|
|
3416
|
-
/* @__PURE__ */
|
|
3433
|
+
/* @__PURE__ */ jsx50("span", { "aria-hidden": "true", className: "-mr-1 hidden w-6 shrink-0 group-hover/nav:block group-has-[:focus-visible]/nav:block group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:block [@media(hover:none)]:block" })
|
|
3417
3434
|
) : null
|
|
3418
3435
|
]
|
|
3419
3436
|
}
|
|
3420
3437
|
);
|
|
3421
3438
|
if (!besides && hint == null) return row;
|
|
3422
3439
|
const name = menuLabel ?? `More options for ${label}`;
|
|
3423
|
-
const line = /* @__PURE__ */
|
|
3440
|
+
const line = /* @__PURE__ */ jsxs33("div", { className: "group/nav relative shrink-0", children: [
|
|
3424
3441
|
row,
|
|
3425
3442
|
hasRows && // `left-1`: the 24px button's 16px arrow then sits where the icon
|
|
3426
3443
|
// sits (the row's px-2), so the icon turns into the arrow in place.
|
|
3427
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ jsx50("div", { className: "absolute inset-y-0 left-1 flex items-center opacity-0 transition-opacity group-hover/nav:opacity-100 group-has-[:focus-visible]/nav:opacity-100", children: /* @__PURE__ */ jsx50(
|
|
3428
3445
|
IconButton,
|
|
3429
3446
|
{
|
|
3430
3447
|
tooltip: open ? "Collapse" : "Expand",
|
|
@@ -3432,7 +3449,7 @@ function NavItem({
|
|
|
3432
3449
|
"aria-expanded": open,
|
|
3433
3450
|
"aria-controls": panelId,
|
|
3434
3451
|
onClick: () => setOpen(!open),
|
|
3435
|
-
children: /* @__PURE__ */
|
|
3452
|
+
children: /* @__PURE__ */ jsx50(IconChevronRight2, { size: 16, stroke: 1.5, className: cn("transition-transform duration-150", open && "rotate-90") })
|
|
3436
3453
|
}
|
|
3437
3454
|
) }),
|
|
3438
3455
|
buttons > 0 && // `right-1`: the 24px button's 16px icon ends 8px from the row's
|
|
@@ -3443,34 +3460,34 @@ function NavItem({
|
|
|
3443
3460
|
// right of the slot's centre.
|
|
3444
3461
|
// On a screen with no hover it always shows: nothing there can point
|
|
3445
3462
|
// at the row, and the menu has no other way in.
|
|
3446
|
-
/* @__PURE__ */
|
|
3447
|
-
action && /* @__PURE__ */
|
|
3448
|
-
menu != null && /* @__PURE__ */
|
|
3463
|
+
/* @__PURE__ */ jsxs33("div", { "data-nav-menu": true, className: cn("absolute inset-y-0 right-1 flex items-center gap-1", "opacity-0 transition-opacity group-hover/nav:opacity-100 group-has-[:focus-visible]/nav:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100"), children: [
|
|
3464
|
+
action && /* @__PURE__ */ jsx50(IconButton, { tooltip: action.tooltip, "aria-label": `${action.tooltip}: ${label}`, onClick: action.onClick, children: action.icon }),
|
|
3465
|
+
menu != null && /* @__PURE__ */ jsx50(
|
|
3449
3466
|
Menu,
|
|
3450
3467
|
{
|
|
3451
3468
|
align: "right",
|
|
3452
|
-
trigger: /* @__PURE__ */
|
|
3469
|
+
trigger: /* @__PURE__ */ jsx50(IconButton, { tooltip: "More options", "aria-label": name, children: /* @__PURE__ */ jsx50(IconDotsVertical, { size: 16, stroke: 1.5 }) }),
|
|
3453
3470
|
children: menu
|
|
3454
3471
|
}
|
|
3455
3472
|
)
|
|
3456
3473
|
] })
|
|
3457
3474
|
] });
|
|
3458
3475
|
if (!hasRows) return line;
|
|
3459
|
-
return /* @__PURE__ */
|
|
3476
|
+
return /* @__PURE__ */ jsxs33(Collapsible.Root, { open, onOpenChange: setOpen, className: "flex shrink-0 flex-col", children: [
|
|
3460
3477
|
line,
|
|
3461
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ jsx50(
|
|
3462
3479
|
Collapsible.Panel,
|
|
3463
3480
|
{
|
|
3464
3481
|
id: panelId,
|
|
3465
3482
|
hiddenUntilFound: true,
|
|
3466
3483
|
className: COLLAPSIBLE_PANEL_CLASSES,
|
|
3467
|
-
children: /* @__PURE__ */
|
|
3484
|
+
children: /* @__PURE__ */ jsx50("div", { className: "flex flex-col gap-0.5 pt-0.5 pl-6", children })
|
|
3468
3485
|
}
|
|
3469
3486
|
)
|
|
3470
3487
|
] });
|
|
3471
3488
|
}
|
|
3472
3489
|
function UrgentMark() {
|
|
3473
|
-
return /* @__PURE__ */
|
|
3490
|
+
return /* @__PURE__ */ jsx50("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center", "data-urgent": true, children: /* @__PURE__ */ jsx50("div", { className: "flex items-center rounded-full bg-warning-muted p-0.5 signal:shadow-glow-warning", children: /* @__PURE__ */ jsx50(IconAlertSquareRounded, { size: 12, stroke: 2.5, className: "text-warning-default" }) }) });
|
|
3474
3491
|
}
|
|
3475
3492
|
|
|
3476
3493
|
// src/NavTree.tsx
|
|
@@ -3483,24 +3500,24 @@ import { Collapsible as Collapsible2 } from "@base-ui/react/collapsible";
|
|
|
3483
3500
|
// src/SectionHeader.tsx
|
|
3484
3501
|
import { IconChevronRight as IconChevronRight3, IconDotsVertical as IconDotsVertical2 } from "@tabler/icons-react";
|
|
3485
3502
|
import { useRender } from "@base-ui/react/use-render";
|
|
3486
|
-
import { Fragment as Fragment13, jsx as
|
|
3503
|
+
import { Fragment as Fragment13, jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3487
3504
|
function SectionHeader({ title, chevron = false, icon, isExpanded = true, onToggle, trailing, count, actions, menu, menuLabel, showActions = "hover", hover = "fill", look = "heading", render, className }) {
|
|
3488
3505
|
const row = look === "row";
|
|
3489
3506
|
const acts = actions && actions.length > 0 || menu != null;
|
|
3490
3507
|
const trailingClasses = !acts ? "has-[[data-unread]]:-mr-1" : showActions === "hover" && "has-[[data-unread]]:pointer-events-none has-[[data-unread]]:absolute has-[[data-unread]]:inset-y-0 has-[[data-unread]]:right-1 has-[[data-unread]]:w-6 has-[[data-unread]]:justify-center has-[[data-unread]]:transition-opacity group-hover:has-[[data-unread]]:opacity-0 group-has-[:focus-visible]:has-[[data-unread]]:opacity-0 group-has-[[data-section-menu]_[aria-expanded=true]]:has-[[data-unread]]:opacity-0 [@media(hover:none)]:has-[[data-unread]]:opacity-0";
|
|
3491
3508
|
const reveal = showActions === "hover" && "opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100";
|
|
3492
3509
|
const titleElement = useRender({
|
|
3493
|
-
render: render ?? (chevron ? /* @__PURE__ */
|
|
3510
|
+
render: render ?? (chevron ? /* @__PURE__ */ jsx51("button", { type: "button", onClick: onToggle, "aria-expanded": isExpanded }) : /* @__PURE__ */ jsx51("span", {})),
|
|
3494
3511
|
props: {
|
|
3495
3512
|
// `text-left`: a button centres its text. `h-full` and `flex-1`: the
|
|
3496
3513
|
// whole row up to the actions is the hit target, as it was when the
|
|
3497
3514
|
// row itself carried the click.
|
|
3498
3515
|
// An icon is a row's: NavItem's 8px after it.
|
|
3499
3516
|
className: cn("flex h-full min-w-0 flex-1 items-center text-left", row || chevron || icon != null ? "gap-2" : "gap-1"),
|
|
3500
|
-
children: /* @__PURE__ */
|
|
3501
|
-
icon != null ? /* @__PURE__ */
|
|
3502
|
-
/* @__PURE__ */
|
|
3503
|
-
chevron && /* @__PURE__ */
|
|
3517
|
+
children: /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
3518
|
+
icon != null ? /* @__PURE__ */ jsxs34("span", { className: "relative flex size-4 shrink-0 items-center justify-center text-text-secondary", children: [
|
|
3519
|
+
/* @__PURE__ */ jsx51("span", { className: cn("flex", chevron && "transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"), children: icon }),
|
|
3520
|
+
chevron && /* @__PURE__ */ jsx51(
|
|
3504
3521
|
IconChevronRight3,
|
|
3505
3522
|
{
|
|
3506
3523
|
size: 16,
|
|
@@ -3508,7 +3525,7 @@ function SectionHeader({ title, chevron = false, icon, isExpanded = true, onTogg
|
|
|
3508
3525
|
className: cn("absolute opacity-0 transition-[opacity,transform] duration-150 group-hover:opacity-100 group-has-[:focus-visible]:opacity-100", isExpanded && "rotate-90")
|
|
3509
3526
|
}
|
|
3510
3527
|
)
|
|
3511
|
-
] }) : chevron && /* @__PURE__ */
|
|
3528
|
+
] }) : chevron && /* @__PURE__ */ jsx51(
|
|
3512
3529
|
IconChevronRight3,
|
|
3513
3530
|
{
|
|
3514
3531
|
size: 16,
|
|
@@ -3516,15 +3533,15 @@ function SectionHeader({ title, chevron = false, icon, isExpanded = true, onTogg
|
|
|
3516
3533
|
className: cn("shrink-0 transition-transform duration-150", !row && "text-text-secondary", isExpanded && "rotate-90")
|
|
3517
3534
|
}
|
|
3518
3535
|
),
|
|
3519
|
-
look === "quiet" ? /* @__PURE__ */
|
|
3536
|
+
look === "quiet" ? /* @__PURE__ */ jsx51("span", { className: "min-w-0 truncate text-caption text-text-muted", children: title }) : row ? (
|
|
3520
3537
|
// A row's words: NavItem's size and colour, brightening under the pointer with the row.
|
|
3521
|
-
/* @__PURE__ */
|
|
3522
|
-
) : /* @__PURE__ */
|
|
3523
|
-
count != null && /* @__PURE__ */
|
|
3538
|
+
/* @__PURE__ */ jsx51("span", { className: "min-w-0 flex-1 truncate text-body-2", children: title })
|
|
3539
|
+
) : /* @__PURE__ */ jsx51(SectionLabel, { folds: chevron, children: title }),
|
|
3540
|
+
count != null && /* @__PURE__ */ jsx51("span", { className: cn("ml-1 shrink-0", COUNT_TEXT_CLASSES), children: count })
|
|
3524
3541
|
] })
|
|
3525
3542
|
}
|
|
3526
3543
|
});
|
|
3527
|
-
return /* @__PURE__ */
|
|
3544
|
+
return /* @__PURE__ */ jsxs34(
|
|
3528
3545
|
"div",
|
|
3529
3546
|
{
|
|
3530
3547
|
className: cn(
|
|
@@ -3545,18 +3562,18 @@ function SectionHeader({ title, chevron = false, icon, isExpanded = true, onTogg
|
|
|
3545
3562
|
),
|
|
3546
3563
|
children: [
|
|
3547
3564
|
titleElement,
|
|
3548
|
-
trailing != null && /* @__PURE__ */
|
|
3549
|
-
acts && /* @__PURE__ */
|
|
3565
|
+
trailing != null && /* @__PURE__ */ jsx51("div", { className: cn("flex shrink-0 items-center", trailingClasses), children: trailing }),
|
|
3566
|
+
acts && /* @__PURE__ */ jsx51(
|
|
3550
3567
|
"div",
|
|
3551
3568
|
{
|
|
3552
3569
|
className: "-mr-1 flex shrink-0 items-center",
|
|
3553
|
-
children: /* @__PURE__ */
|
|
3554
|
-
actions?.map((action) => /* @__PURE__ */
|
|
3555
|
-
menu != null && /* @__PURE__ */
|
|
3570
|
+
children: /* @__PURE__ */ jsxs34("div", { className: cn("flex items-center gap-1", reveal), children: [
|
|
3571
|
+
actions?.map((action) => /* @__PURE__ */ jsx51(IconButton, { tooltip: action.tooltip, "aria-label": action.tooltip, onClick: action.onClick, children: action.icon }, action.tooltip)),
|
|
3572
|
+
menu != null && /* @__PURE__ */ jsx51("div", { "data-section-menu": true, className: "flex items-center", children: /* @__PURE__ */ jsx51(
|
|
3556
3573
|
Menu,
|
|
3557
3574
|
{
|
|
3558
3575
|
align: "right",
|
|
3559
|
-
trigger: /* @__PURE__ */
|
|
3576
|
+
trigger: /* @__PURE__ */ jsx51(IconButton, { tooltip: "More options", "aria-label": menuLabel ?? `More options for ${title}`, children: /* @__PURE__ */ jsx51(IconDotsVertical2, { size: 16, stroke: 1.5 }) }),
|
|
3560
3577
|
children: menu
|
|
3561
3578
|
}
|
|
3562
3579
|
) })
|
|
@@ -3569,7 +3586,7 @@ function SectionHeader({ title, chevron = false, icon, isExpanded = true, onTogg
|
|
|
3569
3586
|
}
|
|
3570
3587
|
|
|
3571
3588
|
// src/CollapsibleSection.tsx
|
|
3572
|
-
import { jsx as
|
|
3589
|
+
import { jsx as jsx52, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3573
3590
|
var OPEN = "open";
|
|
3574
3591
|
var CLOSED = "closed";
|
|
3575
3592
|
function readStored(key) {
|
|
@@ -3597,31 +3614,31 @@ function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenC
|
|
|
3597
3614
|
onOpenChange?.(next);
|
|
3598
3615
|
};
|
|
3599
3616
|
const shown = open && !pending;
|
|
3600
|
-
return /* @__PURE__ */
|
|
3601
|
-
/* @__PURE__ */
|
|
3602
|
-
/* @__PURE__ */
|
|
3617
|
+
return /* @__PURE__ */ jsxs35(Collapsible2.Root, { open: shown, onOpenChange: (next, details) => setOpen(pending && details.reason === "trigger-press" ? !open : next), className: cn("flex flex-col", className), children: [
|
|
3618
|
+
/* @__PURE__ */ jsx52(SectionHeader, { title, chevron: true, icon, isExpanded: open, trailing, actions, menu, menuLabel, showActions, look, className: "shrink-0", render: /* @__PURE__ */ jsx52(Collapsible2.Trigger, { "aria-expanded": open, "aria-busy": pending && open ? true : void 0 }) }),
|
|
3619
|
+
/* @__PURE__ */ jsx52(
|
|
3603
3620
|
Collapsible2.Panel,
|
|
3604
3621
|
{
|
|
3605
3622
|
hiddenUntilFound: true,
|
|
3606
3623
|
className: COLLAPSIBLE_PANEL_CLASSES,
|
|
3607
|
-
children: /* @__PURE__ */
|
|
3624
|
+
children: /* @__PURE__ */ jsx52("div", { className: cn("flex flex-col pt-0.5", (look === "row" || indent) && "pl-6", contentClassName), children })
|
|
3608
3625
|
}
|
|
3609
3626
|
)
|
|
3610
3627
|
] });
|
|
3611
3628
|
}
|
|
3612
3629
|
|
|
3613
3630
|
// src/NavTree.tsx
|
|
3614
|
-
import { Fragment as Fragment14, jsx as
|
|
3631
|
+
import { Fragment as Fragment14, jsx as jsx53, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3615
3632
|
var NAV_TREE_INTENT_MS = 150;
|
|
3616
3633
|
function holds(nodes, id) {
|
|
3617
3634
|
return !!nodes && id !== void 0 && nodes.some((node) => node.id === id || holds(node.children ?? null, id));
|
|
3618
3635
|
}
|
|
3619
3636
|
function Line({ message }) {
|
|
3620
|
-
return /* @__PURE__ */
|
|
3637
|
+
return /* @__PURE__ */ jsx53("div", { className: "px-2 py-1", children: /* @__PURE__ */ jsx53(EmptyState, { scope: "section", message }) });
|
|
3621
3638
|
}
|
|
3622
3639
|
function Row({ node, selected, onSelect }) {
|
|
3623
|
-
const under = node.childrenMessage !== void 0 ? /* @__PURE__ */
|
|
3624
|
-
return /* @__PURE__ */
|
|
3640
|
+
const under = node.childrenMessage !== void 0 ? /* @__PURE__ */ jsx53(Line, { message: node.childrenMessage }) : node.children?.length ? node.children.map((child) => /* @__PURE__ */ jsx53(Row, { node: child, selected, onSelect }, child.id)) : node.children === null || node.hasChildren && node.children === void 0 ? /* @__PURE__ */ jsx53(SkeletonList, { rows: 2 }) : void 0;
|
|
3641
|
+
return /* @__PURE__ */ jsx53(
|
|
3625
3642
|
NavItem,
|
|
3626
3643
|
{
|
|
3627
3644
|
href: node.href,
|
|
@@ -3643,7 +3660,7 @@ function Row({ node, selected, onSelect }) {
|
|
|
3643
3660
|
);
|
|
3644
3661
|
}
|
|
3645
3662
|
function Group({ group, selected, onSelect, storageKey }) {
|
|
3646
|
-
return /* @__PURE__ */
|
|
3663
|
+
return /* @__PURE__ */ jsx53(
|
|
3647
3664
|
NavTreeSection,
|
|
3648
3665
|
{
|
|
3649
3666
|
id: group.id,
|
|
@@ -3659,7 +3676,7 @@ function Group({ group, selected, onSelect, storageKey }) {
|
|
|
3659
3676
|
onOpenChange: group.onOpenChange,
|
|
3660
3677
|
storageKey: storageKey ? `${storageKey}.${group.id}` : void 0,
|
|
3661
3678
|
onIntent: group.onIntent,
|
|
3662
|
-
children: group.nodes?.map((node) => /* @__PURE__ */
|
|
3679
|
+
children: group.nodes?.map((node) => /* @__PURE__ */ jsx53(Row, { node, selected, onSelect }, node.id))
|
|
3663
3680
|
}
|
|
3664
3681
|
);
|
|
3665
3682
|
}
|
|
@@ -3667,7 +3684,7 @@ function NavTreeSection({ id, title, message, loading = false, pending, trailing
|
|
|
3667
3684
|
const timer = useRef11(void 0);
|
|
3668
3685
|
useEffect6(() => () => clearTimeout(timer.current), []);
|
|
3669
3686
|
const intent = onIntent;
|
|
3670
|
-
return /* @__PURE__ */
|
|
3687
|
+
return /* @__PURE__ */ jsx53(
|
|
3671
3688
|
"div",
|
|
3672
3689
|
{
|
|
3673
3690
|
className: "shrink-0 [&+&]:mt-1",
|
|
@@ -3678,7 +3695,7 @@ function NavTreeSection({ id, title, message, loading = false, pending, trailing
|
|
|
3678
3695
|
} : void 0,
|
|
3679
3696
|
onPointerLeave: intent ? () => clearTimeout(timer.current) : void 0,
|
|
3680
3697
|
onFocus: intent,
|
|
3681
|
-
children: /* @__PURE__ */
|
|
3698
|
+
children: /* @__PURE__ */ jsx53(
|
|
3682
3699
|
CollapsibleSection,
|
|
3683
3700
|
{
|
|
3684
3701
|
title,
|
|
@@ -3694,26 +3711,26 @@ function NavTreeSection({ id, title, message, loading = false, pending, trailing
|
|
|
3694
3711
|
icon,
|
|
3695
3712
|
className: "shrink-0",
|
|
3696
3713
|
contentClassName: "gap-0.5",
|
|
3697
|
-
children: message !== void 0 ? /* @__PURE__ */
|
|
3714
|
+
children: message !== void 0 ? /* @__PURE__ */ jsx53(Line, { message }) : loading ? /* @__PURE__ */ jsx53(SkeletonList, { rows: 3 }) : children
|
|
3698
3715
|
}
|
|
3699
3716
|
)
|
|
3700
3717
|
}
|
|
3701
3718
|
);
|
|
3702
3719
|
}
|
|
3703
3720
|
function NavTree({ title, titleActions, groups, children, selected, onSelect, emptyMessage = "", storageKey }) {
|
|
3704
|
-
return /* @__PURE__ */
|
|
3705
|
-
title && /* @__PURE__ */
|
|
3706
|
-
groups === void 0 ? children : groups === null ? /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ jsxs36(Fragment14, { children: [
|
|
3722
|
+
title && /* @__PURE__ */ jsx53(SectionHeader, { title, look: "quiet", showActions: "always", actions: titleActions, className: "mt-4 shrink-0" }),
|
|
3723
|
+
groups === void 0 ? children : groups === null ? /* @__PURE__ */ jsx53(SkeletonList, { rows: 5 }) : groups.length === 0 ? (
|
|
3707
3724
|
// No words, no line: an app that says nothing when it has no groups.
|
|
3708
|
-
emptyMessage ? /* @__PURE__ */
|
|
3709
|
-
) : groups.map((group) => /* @__PURE__ */
|
|
3725
|
+
emptyMessage ? /* @__PURE__ */ jsx53(Line, { message: emptyMessage }) : null
|
|
3726
|
+
) : groups.map((group) => /* @__PURE__ */ jsx53(Group, { group, selected, onSelect, storageKey }, group.id))
|
|
3710
3727
|
] });
|
|
3711
3728
|
}
|
|
3712
3729
|
|
|
3713
3730
|
// src/Popover.tsx
|
|
3714
3731
|
import { useMemo as useMemo4 } from "react";
|
|
3715
3732
|
import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
3716
|
-
import { jsx as
|
|
3733
|
+
import { jsx as jsx54, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3717
3734
|
var GAP5 = 4;
|
|
3718
3735
|
var VIEWPORT_PAD5 = 8;
|
|
3719
3736
|
function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpenChange, finalFocus, actionsRef, ariaLabel, children, className, contentClassName, maxHeight }) {
|
|
@@ -3722,7 +3739,7 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
|
|
|
3722
3739
|
if (anchor instanceof Element) return anchor;
|
|
3723
3740
|
return { getBoundingClientRect: () => anchor };
|
|
3724
3741
|
}, [anchor]);
|
|
3725
|
-
return /* @__PURE__ */
|
|
3742
|
+
return /* @__PURE__ */ jsxs37(
|
|
3726
3743
|
BasePopover.Root,
|
|
3727
3744
|
{
|
|
3728
3745
|
open,
|
|
@@ -3730,8 +3747,8 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
|
|
|
3730
3747
|
actionsRef,
|
|
3731
3748
|
modal: false,
|
|
3732
3749
|
children: [
|
|
3733
|
-
trigger && /* @__PURE__ */
|
|
3734
|
-
/* @__PURE__ */
|
|
3750
|
+
trigger && /* @__PURE__ */ jsx54(BasePopover.Trigger, { render: trigger, disabled: triggerDisabled(trigger) }),
|
|
3751
|
+
/* @__PURE__ */ jsx54(BasePopover.Portal, { children: /* @__PURE__ */ jsx54(
|
|
3735
3752
|
BasePopover.Positioner,
|
|
3736
3753
|
{
|
|
3737
3754
|
anchor: anchorTarget,
|
|
@@ -3740,20 +3757,20 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
|
|
|
3740
3757
|
sideOffset: GAP5,
|
|
3741
3758
|
collisionPadding: VIEWPORT_PAD5,
|
|
3742
3759
|
className: "z-50 data-[anchor-hidden]:hidden",
|
|
3743
|
-
children: /* @__PURE__ */
|
|
3760
|
+
children: /* @__PURE__ */ jsx54(
|
|
3744
3761
|
BasePopover.Popup,
|
|
3745
3762
|
{
|
|
3746
3763
|
"aria-label": ariaLabel,
|
|
3747
3764
|
initialFocus: trigger ? void 0 : false,
|
|
3748
3765
|
finalFocus,
|
|
3749
3766
|
className: cn("min-w-[180px] outline-none p-0", className),
|
|
3750
|
-
render: /* @__PURE__ */
|
|
3751
|
-
children: /* @__PURE__ */
|
|
3767
|
+
render: /* @__PURE__ */ jsx54(MenuPanel, {}),
|
|
3768
|
+
children: /* @__PURE__ */ jsx54(
|
|
3752
3769
|
ScrollArea,
|
|
3753
3770
|
{
|
|
3754
3771
|
viewportClassName: maxHeight ?? "max-h-[var(--available-height)]",
|
|
3755
3772
|
contentClassName: cn("flex flex-col p-2", contentClassName),
|
|
3756
|
-
children: /* @__PURE__ */
|
|
3773
|
+
children: /* @__PURE__ */ jsx54(DividerInPanel.Provider, { value: true, children })
|
|
3757
3774
|
}
|
|
3758
3775
|
)
|
|
3759
3776
|
}
|
|
@@ -3767,7 +3784,7 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
|
|
|
3767
3784
|
|
|
3768
3785
|
// src/SuggestionMenu.tsx
|
|
3769
3786
|
import { useCallback as useCallback4, useEffect as useEffect7, useId as useId3, useImperativeHandle, useMemo as useMemo5, useRef as useRef12, useState as useState11 } from "react";
|
|
3770
|
-
import { jsx as
|
|
3787
|
+
import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3771
3788
|
function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sections, itemKey, row, onSelect, handle }) {
|
|
3772
3789
|
const shown = useMemo5(() => sections.filter((section) => section.items.length > 0), [sections]);
|
|
3773
3790
|
const items = useMemo5(() => shown.flatMap((section) => section.items), [shown]);
|
|
@@ -3832,7 +3849,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
3832
3849
|
const { label, description, aside, leading, shortcut, hint, size } = row(item);
|
|
3833
3850
|
return (
|
|
3834
3851
|
// A row of a list the editor drives from its caret: focus stays in the text, so the row is no Tab stop.
|
|
3835
|
-
/* @__PURE__ */
|
|
3852
|
+
/* @__PURE__ */ jsx55(
|
|
3836
3853
|
MenuItem,
|
|
3837
3854
|
{
|
|
3838
3855
|
role: "option",
|
|
@@ -3860,9 +3877,9 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
3860
3877
|
};
|
|
3861
3878
|
return (
|
|
3862
3879
|
// finalFocus={false}: focus never left the text, and a list that closes because focus moved elsewhere must not pull it back (71a4577b).
|
|
3863
|
-
/* @__PURE__ */
|
|
3864
|
-
i > 0 && /* @__PURE__ */
|
|
3865
|
-
section.label ? /* @__PURE__ */
|
|
3880
|
+
/* @__PURE__ */ jsx55(Popover, { anchor: rect, open: rect !== null, side: "top", align: "left", className: width, maxHeight, ariaLabel, finalFocus: false, children: /* @__PURE__ */ jsx55("div", { ref: keepFocus, id: listboxId, role: "listbox", "aria-label": ariaLabel, className: "flex flex-col gap-0.5", children: shown.map((section, i) => /* @__PURE__ */ jsxs38("div", { className: "contents", children: [
|
|
3881
|
+
i > 0 && /* @__PURE__ */ jsx55(MenuSeparator, {}),
|
|
3882
|
+
section.label ? /* @__PURE__ */ jsx55("div", { role: "group", "aria-label": section.label, children: /* @__PURE__ */ jsx55(MenuSection, { label: section.label, className: section.className, children: section.items.map(drawRow) }) }) : section.items.map(drawRow)
|
|
3866
3883
|
] }, section.label ?? i)) }) })
|
|
3867
3884
|
);
|
|
3868
3885
|
}
|
|
@@ -3870,7 +3887,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
3870
3887
|
// src/ShowMore.tsx
|
|
3871
3888
|
import { useLayoutEffect as useLayoutEffect5, useRef as useRef13, useState as useState12 } from "react";
|
|
3872
3889
|
import { IconChevronDown as IconChevronDown4, IconChevronUp } from "@tabler/icons-react";
|
|
3873
|
-
import { jsx as
|
|
3890
|
+
import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3874
3891
|
var FADE_CLASSES = { surface: "from-bg-surface", inset: "from-bg-inset" };
|
|
3875
3892
|
function ShowMore({ children, maxHeight = 96, surface = "surface", action, className }) {
|
|
3876
3893
|
const box = useRef13(null);
|
|
@@ -3887,25 +3904,25 @@ function ShowMore({ children, maxHeight = 96, surface = "surface", action, class
|
|
|
3887
3904
|
return () => observer.disconnect();
|
|
3888
3905
|
}, [maxHeight]);
|
|
3889
3906
|
const cut = overflows && !open;
|
|
3890
|
-
return /* @__PURE__ */
|
|
3891
|
-
/* @__PURE__ */
|
|
3907
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("flex flex-col items-start", className), children: [
|
|
3908
|
+
/* @__PURE__ */ jsxs39("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden"), style: cut ? { maxHeight } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children: [
|
|
3892
3909
|
children,
|
|
3893
|
-
cut && /* @__PURE__ */
|
|
3910
|
+
cut && /* @__PURE__ */ jsx56("div", { "aria-hidden": true, className: cn("pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent", FADE_CLASSES[surface]) })
|
|
3894
3911
|
] }),
|
|
3895
|
-
action ? /* @__PURE__ */
|
|
3896
|
-
overflows && /* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3898
|
-
] }) : overflows && /* @__PURE__ */
|
|
3912
|
+
action ? /* @__PURE__ */ jsxs39("div", { className: cn("mt-1 flex w-full items-center gap-2", overflows ? "justify-between" : "justify-end"), children: [
|
|
3913
|
+
overflows && /* @__PURE__ */ jsx56(Toggle, { open, onToggle: () => setOpen((o) => !o) }),
|
|
3914
|
+
/* @__PURE__ */ jsx56("div", { className: "-mr-2 flex shrink-0", children: action })
|
|
3915
|
+
] }) : overflows && /* @__PURE__ */ jsx56(Toggle, { open, onToggle: () => setOpen((o) => !o), className: "mt-1" })
|
|
3899
3916
|
] });
|
|
3900
3917
|
}
|
|
3901
3918
|
function Toggle({ open, onToggle, className }) {
|
|
3902
3919
|
const Icon = open ? IconChevronUp : IconChevronDown4;
|
|
3903
|
-
return /* @__PURE__ */
|
|
3920
|
+
return /* @__PURE__ */ jsx56(
|
|
3904
3921
|
Button,
|
|
3905
3922
|
{
|
|
3906
3923
|
variant: "outlined",
|
|
3907
3924
|
size: "small",
|
|
3908
|
-
leadingIcon: /* @__PURE__ */
|
|
3925
|
+
leadingIcon: /* @__PURE__ */ jsx56(Icon, { stroke: 1.5, className: "size-3.5" }),
|
|
3909
3926
|
className,
|
|
3910
3927
|
"aria-expanded": open,
|
|
3911
3928
|
onClick: onToggle,
|
|
@@ -3916,9 +3933,9 @@ function Toggle({ open, onToggle, className }) {
|
|
|
3916
3933
|
|
|
3917
3934
|
// src/Toolbar.tsx
|
|
3918
3935
|
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
3919
|
-
import { jsx as
|
|
3936
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
3920
3937
|
function Toolbar({ "aria-label": ariaLabel, orientation = "horizontal", loopFocus = true, surface = true, children, className }) {
|
|
3921
|
-
const strip = /* @__PURE__ */
|
|
3938
|
+
const strip = /* @__PURE__ */ jsx57(
|
|
3922
3939
|
BaseToolbar.Root,
|
|
3923
3940
|
{
|
|
3924
3941
|
"aria-label": ariaLabel,
|
|
@@ -3929,27 +3946,27 @@ function Toolbar({ "aria-label": ariaLabel, orientation = "horizontal", loopFocu
|
|
|
3929
3946
|
}
|
|
3930
3947
|
);
|
|
3931
3948
|
if (!surface) return strip;
|
|
3932
|
-
return /* @__PURE__ */
|
|
3949
|
+
return /* @__PURE__ */ jsx57(MenuPanel, { className: "w-fit p-1", children: strip });
|
|
3933
3950
|
}
|
|
3934
3951
|
function ToolbarButton({ ref, disabled, disabledReason, ...props }) {
|
|
3935
|
-
return /* @__PURE__ */
|
|
3952
|
+
return /* @__PURE__ */ jsx57(
|
|
3936
3953
|
BaseToolbar.Button,
|
|
3937
3954
|
{
|
|
3938
3955
|
ref,
|
|
3939
3956
|
disabled: disabled || !!disabledReason,
|
|
3940
3957
|
focusableWhenDisabled: true,
|
|
3941
|
-
render: /* @__PURE__ */
|
|
3958
|
+
render: /* @__PURE__ */ jsx57(IconButton, { disabled, disabledReason, ...props })
|
|
3942
3959
|
}
|
|
3943
3960
|
);
|
|
3944
3961
|
}
|
|
3945
3962
|
function ToolbarLink({ ref, href, ...props }) {
|
|
3946
|
-
return /* @__PURE__ */
|
|
3963
|
+
return /* @__PURE__ */ jsx57(BaseToolbar.Link, { ref, render: /* @__PURE__ */ jsx57(IconButton, { href, ...props }) });
|
|
3947
3964
|
}
|
|
3948
3965
|
function ToolbarInput({ size, ...props }) {
|
|
3949
|
-
return /* @__PURE__ */
|
|
3966
|
+
return /* @__PURE__ */ jsx57(BaseToolbar.Input, { render: /* @__PURE__ */ jsx57(TextInput, { size }), ...props });
|
|
3950
3967
|
}
|
|
3951
3968
|
function ToolbarSeparator({ className }) {
|
|
3952
|
-
return /* @__PURE__ */
|
|
3969
|
+
return /* @__PURE__ */ jsx57(
|
|
3953
3970
|
BaseToolbar.Separator,
|
|
3954
3971
|
{
|
|
3955
3972
|
orientation: "vertical",
|
|
@@ -3959,9 +3976,9 @@ function ToolbarSeparator({ className }) {
|
|
|
3959
3976
|
}
|
|
3960
3977
|
|
|
3961
3978
|
// src/ReactionPicker.tsx
|
|
3962
|
-
import { jsx as
|
|
3979
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
3963
3980
|
function ReactionPicker({ options, onSelect, "aria-label": ariaLabel = "Reactions", surface = true, className }) {
|
|
3964
|
-
return /* @__PURE__ */
|
|
3981
|
+
return /* @__PURE__ */ jsx58(Toolbar, { "aria-label": ariaLabel, surface, className: cn("gap-0.5", className), children: options.map((option) => (
|
|
3965
3982
|
/*
|
|
3966
3983
|
A `ToolbarButton`, not a button in a tooltip wrapper. The wrapper
|
|
3967
3984
|
would become the toolbar's item and the button inside it would never
|
|
@@ -3971,14 +3988,14 @@ function ReactionPicker({ options, onSelect, "aria-label": ariaLabel = "Reaction
|
|
|
3971
3988
|
The tooltip names it for a pointer, `aria-label` for everything else,
|
|
3972
3989
|
and both say the meaning rather than the glyph.
|
|
3973
3990
|
*/
|
|
3974
|
-
/* @__PURE__ */
|
|
3991
|
+
/* @__PURE__ */ jsx58(
|
|
3975
3992
|
ToolbarButton,
|
|
3976
3993
|
{
|
|
3977
3994
|
"aria-label": option.label,
|
|
3978
3995
|
tooltip: option.label,
|
|
3979
3996
|
onClick: () => onSelect(option.emoji),
|
|
3980
3997
|
className: "size-7",
|
|
3981
|
-
children: /* @__PURE__ */
|
|
3998
|
+
children: /* @__PURE__ */ jsx58("span", { "aria-hidden": "true", className: "text-h3 leading-none", children: option.emoji })
|
|
3982
3999
|
},
|
|
3983
4000
|
option.emoji
|
|
3984
4001
|
)
|
|
@@ -3987,23 +4004,23 @@ function ReactionPicker({ options, onSelect, "aria-label": ariaLabel = "Reaction
|
|
|
3987
4004
|
|
|
3988
4005
|
// src/PreviewCard.tsx
|
|
3989
4006
|
import { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card";
|
|
3990
|
-
import { jsx as
|
|
4007
|
+
import { jsx as jsx59, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3991
4008
|
var GAP6 = 12;
|
|
3992
4009
|
var VIEWPORT_PAD6 = 8;
|
|
3993
4010
|
var OPEN_DELAY2 = 350;
|
|
3994
4011
|
var CLOSE_DELAY = 200;
|
|
3995
4012
|
function PreviewCard({ content, children, side = "right", delay = OPEN_DELAY2, closeDelay = CLOSE_DELAY, className, contentClassName, wrapperClassName }) {
|
|
3996
|
-
return /* @__PURE__ */
|
|
3997
|
-
/* @__PURE__ */
|
|
4013
|
+
return /* @__PURE__ */ jsxs40(BasePreviewCard.Root, { children: [
|
|
4014
|
+
/* @__PURE__ */ jsx59(
|
|
3998
4015
|
BasePreviewCard.Trigger,
|
|
3999
4016
|
{
|
|
4000
4017
|
delay,
|
|
4001
4018
|
closeDelay,
|
|
4002
|
-
render: /* @__PURE__ */
|
|
4019
|
+
render: /* @__PURE__ */ jsx59("span", { className: cn("inline-flex", wrapperClassName) }),
|
|
4003
4020
|
children
|
|
4004
4021
|
}
|
|
4005
4022
|
),
|
|
4006
|
-
/* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ jsx59(BasePreviewCard.Portal, { children: /* @__PURE__ */ jsx59(
|
|
4007
4024
|
BasePreviewCard.Positioner,
|
|
4008
4025
|
{
|
|
4009
4026
|
side,
|
|
@@ -4011,12 +4028,12 @@ function PreviewCard({ content, children, side = "right", delay = OPEN_DELAY2, c
|
|
|
4011
4028
|
sideOffset: GAP6,
|
|
4012
4029
|
collisionPadding: VIEWPORT_PAD6,
|
|
4013
4030
|
className: "z-50 data-[anchor-hidden]:hidden",
|
|
4014
|
-
children: /* @__PURE__ */
|
|
4031
|
+
children: /* @__PURE__ */ jsx59(
|
|
4015
4032
|
BasePreviewCard.Popup,
|
|
4016
4033
|
{
|
|
4017
4034
|
className: cn("w-[360px] p-0 outline-none", className),
|
|
4018
|
-
render: /* @__PURE__ */
|
|
4019
|
-
children: /* @__PURE__ */
|
|
4035
|
+
render: /* @__PURE__ */ jsx59(MenuPanel, {}),
|
|
4036
|
+
children: /* @__PURE__ */ jsx59(ScrollArea, { viewportClassName: "max-h-[min(300px,var(--available-height))]", contentClassName: cn("flex flex-col gap-3 p-3", contentClassName), children: content })
|
|
4020
4037
|
}
|
|
4021
4038
|
)
|
|
4022
4039
|
}
|
|
@@ -4077,7 +4094,7 @@ function unavailableMemory(storageKey, limit = 300) {
|
|
|
4077
4094
|
|
|
4078
4095
|
// src/LinkParts.tsx
|
|
4079
4096
|
import { IconCircleCheck, IconCircleDashed as IconCircleDashed2, IconCircleHalf2, IconCircleX, IconFileText, IconMessage2 as IconMessage22 } from "@tabler/icons-react";
|
|
4080
|
-
import { jsx as
|
|
4097
|
+
import { jsx as jsx60, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4081
4098
|
var STATUS_ICON = {
|
|
4082
4099
|
neutral: { Icon: IconCircleDashed2, tone: "text-text-secondary" },
|
|
4083
4100
|
blue: { Icon: IconCircleHalf2, tone: "text-info-default" },
|
|
@@ -4086,20 +4103,20 @@ var STATUS_ICON = {
|
|
|
4086
4103
|
};
|
|
4087
4104
|
function StatusIcon({ colour }) {
|
|
4088
4105
|
const { Icon, tone } = STATUS_ICON[colour];
|
|
4089
|
-
return /* @__PURE__ */
|
|
4106
|
+
return /* @__PURE__ */ jsx60(Icon, { size: 14, stroke: 1.5, className: cn("shrink-0", tone), "aria-hidden": true });
|
|
4090
4107
|
}
|
|
4091
4108
|
function StatusMark({ status }) {
|
|
4092
|
-
return /* @__PURE__ */
|
|
4093
|
-
/* @__PURE__ */
|
|
4094
|
-
/* @__PURE__ */
|
|
4109
|
+
return /* @__PURE__ */ jsxs41(WithTooltip, { label: status.label, inline: true, wrapperClassName: "inline-flex shrink-0 items-center", children: [
|
|
4110
|
+
/* @__PURE__ */ jsx60(StatusIcon, { colour: status.colour }),
|
|
4111
|
+
/* @__PURE__ */ jsx60("span", { className: "sr-only", children: status.label })
|
|
4095
4112
|
] });
|
|
4096
4113
|
}
|
|
4097
4114
|
function LinkedIcon({ kind, size = 16, tone = "secondary" }) {
|
|
4098
|
-
if (kind === "page") return /* @__PURE__ */
|
|
4099
|
-
return /* @__PURE__ */
|
|
4115
|
+
if (kind === "page") return /* @__PURE__ */ jsx60(IconFileText, { size, stroke: 1.5, className: cn("shrink-0", tone === "secondary" && "text-text-secondary"), "aria-hidden": true });
|
|
4116
|
+
return /* @__PURE__ */ jsx60(KindIcon, { kind, size, tone });
|
|
4100
4117
|
}
|
|
4101
4118
|
function LinkKey({ children }) {
|
|
4102
|
-
return /* @__PURE__ */
|
|
4119
|
+
return /* @__PURE__ */ jsx60("span", { className: "shrink-0 text-caption tabular-nums text-text-muted", children });
|
|
4103
4120
|
}
|
|
4104
4121
|
function ProgressRing({ done, total }) {
|
|
4105
4122
|
const size = 16;
|
|
@@ -4107,10 +4124,10 @@ function ProgressRing({ done, total }) {
|
|
|
4107
4124
|
const r = (size - stroke) / 2;
|
|
4108
4125
|
const c = 2 * Math.PI * r;
|
|
4109
4126
|
const share = total > 0 ? Math.min(done, total) / total : 0;
|
|
4110
|
-
return /* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4127
|
+
return /* @__PURE__ */ jsx60(WithTooltip, { label: `${done} of ${total} done`, inline: true, wrapperClassName: "inline-flex shrink-0", children: /* @__PURE__ */ jsxs41("span", { className: "inline-flex shrink-0 items-center gap-1 text-caption tabular-nums text-text-secondary", children: [
|
|
4128
|
+
/* @__PURE__ */ jsxs41("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "shrink-0 -rotate-90", "aria-hidden": true, children: [
|
|
4129
|
+
/* @__PURE__ */ jsx60("circle", { cx: size / 2, cy: size / 2, r, fill: "none", strokeWidth: stroke, className: "stroke-border-default" }),
|
|
4130
|
+
/* @__PURE__ */ jsx60("circle", { cx: size / 2, cy: size / 2, r, fill: "none", strokeWidth: stroke, strokeLinecap: "round", strokeDasharray: `${c * share} ${c}`, className: "stroke-success-default" })
|
|
4114
4131
|
] }),
|
|
4115
4132
|
done,
|
|
4116
4133
|
"/",
|
|
@@ -4119,11 +4136,11 @@ function ProgressRing({ done, total }) {
|
|
|
4119
4136
|
}
|
|
4120
4137
|
function CommentCount({ conversation, noun = "comments" }) {
|
|
4121
4138
|
const { count, href, unread = false } = conversation;
|
|
4122
|
-
return /* @__PURE__ */
|
|
4123
|
-
/* @__PURE__ */
|
|
4139
|
+
return /* @__PURE__ */ jsx60("span", { className: cn("relative z-10 -mx-1 inline-flex shrink-0 rounded-sm px-1 text-caption tabular-nums hover:bg-bg-active", unread ? "font-medium text-text-primary" : "text-text-secondary"), children: /* @__PURE__ */ jsxs41(Link, { href, variant: "plain", className: "inline-flex items-center gap-1", children: [
|
|
4140
|
+
/* @__PURE__ */ jsx60(IconMessage22, { size: 14, stroke: 1.5, "aria-hidden": true }),
|
|
4124
4141
|
count,
|
|
4125
|
-
/* @__PURE__ */
|
|
4126
|
-
unread && /* @__PURE__ */
|
|
4142
|
+
/* @__PURE__ */ jsx60("span", { className: "sr-only", children: unread ? `${noun}, unread \u2014 open the conversation` : `${noun} \u2014 open the conversation` }),
|
|
4143
|
+
unread && /* @__PURE__ */ jsx60(UnreadDot, { className: "h-auto w-auto" })
|
|
4127
4144
|
] }) });
|
|
4128
4145
|
}
|
|
4129
4146
|
function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false }) {
|
|
@@ -4131,11 +4148,11 @@ function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false })
|
|
|
4131
4148
|
const ownerNow = chosenOf(owner);
|
|
4132
4149
|
const statusWords = status && (readOnly || !status.onChange);
|
|
4133
4150
|
const ownerWords = owner && (readOnly || !owner.onChange);
|
|
4134
|
-
return /* @__PURE__ */
|
|
4135
|
-
status && (statusWords ? /* @__PURE__ */
|
|
4136
|
-
statusNow?.colour && /* @__PURE__ */
|
|
4151
|
+
return /* @__PURE__ */ jsxs41("span", { className: "flex h-6 min-w-0 items-center gap-2 text-caption text-text-secondary", children: [
|
|
4152
|
+
status && (statusWords ? /* @__PURE__ */ jsxs41("span", { className: "inline-flex shrink-0 items-center gap-1", children: [
|
|
4153
|
+
statusNow?.colour && /* @__PURE__ */ jsx60(StatusIcon, { colour: statusNow.colour }),
|
|
4137
4154
|
statusNow?.label ?? "No status"
|
|
4138
|
-
] }) : /* @__PURE__ */
|
|
4155
|
+
] }) : /* @__PURE__ */ jsx60(
|
|
4139
4156
|
Select,
|
|
4140
4157
|
{
|
|
4141
4158
|
size: "small",
|
|
@@ -4143,13 +4160,13 @@ function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false })
|
|
|
4143
4160
|
value: status.value ?? "",
|
|
4144
4161
|
onChange: (value) => status.onChange?.(value),
|
|
4145
4162
|
ariaLabel: "Status",
|
|
4146
|
-
options: status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && /* @__PURE__ */
|
|
4163
|
+
options: status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && /* @__PURE__ */ jsx60(StatusIcon, { colour: option.colour }) }))
|
|
4147
4164
|
}
|
|
4148
4165
|
)),
|
|
4149
|
-
owner && (ownerWords ? /* @__PURE__ */
|
|
4150
|
-
/* @__PURE__ */
|
|
4151
|
-
/* @__PURE__ */
|
|
4152
|
-
] }) : /* @__PURE__ */
|
|
4166
|
+
owner && (ownerWords ? /* @__PURE__ */ jsxs41("span", { className: "inline-flex min-w-0 items-center gap-1", children: [
|
|
4167
|
+
/* @__PURE__ */ jsx60(Avatar, { name: ownerNow?.label, src: ownerNow?.picture, size: 16 }),
|
|
4168
|
+
/* @__PURE__ */ jsx60("span", { className: "truncate", children: ownerNow?.label ?? "Unassigned" })
|
|
4169
|
+
] }) : /* @__PURE__ */ jsx60(
|
|
4153
4170
|
Select,
|
|
4154
4171
|
{
|
|
4155
4172
|
size: "small",
|
|
@@ -4158,7 +4175,7 @@ function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false })
|
|
|
4158
4175
|
placeholder: "Unassigned",
|
|
4159
4176
|
onChange: (value) => owner.onChange?.(value),
|
|
4160
4177
|
ariaLabel: ownerLabel,
|
|
4161
|
-
options: owner.options.map((option) => ({ value: option.value, label: option.label, leading: /* @__PURE__ */
|
|
4178
|
+
options: owner.options.map((option) => ({ value: option.value, label: option.label, leading: /* @__PURE__ */ jsx60(Avatar, { name: option.label, src: option.picture, size: 16 }) }))
|
|
4162
4179
|
}
|
|
4163
4180
|
))
|
|
4164
4181
|
] });
|
|
@@ -4168,15 +4185,15 @@ function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false })
|
|
|
4168
4185
|
import { useSyncExternalStore } from "react";
|
|
4169
4186
|
|
|
4170
4187
|
// src/LinkRow.tsx
|
|
4171
|
-
import { Fragment as Fragment15, jsx as
|
|
4188
|
+
import { Fragment as Fragment15, jsx as jsx61, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4172
4189
|
function LinkUnavailable({ kind, noun, openIn }) {
|
|
4173
|
-
return /* @__PURE__ */
|
|
4174
|
-
/* @__PURE__ */
|
|
4175
|
-
/* @__PURE__ */
|
|
4190
|
+
return /* @__PURE__ */ jsxs42(Card, { fill: "none", unreadable: true, className: "flex h-9 items-center gap-2 px-3", children: [
|
|
4191
|
+
/* @__PURE__ */ jsx61(LinkedIcon, { kind }),
|
|
4192
|
+
/* @__PURE__ */ jsxs42("span", { className: "min-w-0 flex-1 truncate text-body-2 text-text-muted", children: [
|
|
4176
4193
|
noun,
|
|
4177
4194
|
" \u2014 not available."
|
|
4178
4195
|
] }),
|
|
4179
|
-
openIn && /* @__PURE__ */
|
|
4196
|
+
openIn && /* @__PURE__ */ jsx61("span", { className: "shrink-0 text-caption text-text-secondary", children: /* @__PURE__ */ jsxs42(Link, { href: openIn.href, variant: "quiet", external: true, children: [
|
|
4180
4197
|
"Open in ",
|
|
4181
4198
|
openIn.app,
|
|
4182
4199
|
" \u2197"
|
|
@@ -4185,100 +4202,100 @@ function LinkUnavailable({ kind, noun, openIn }) {
|
|
|
4185
4202
|
}
|
|
4186
4203
|
function LinkRow({ link, preview = true }) {
|
|
4187
4204
|
if (link.state === "loading") {
|
|
4188
|
-
return /* @__PURE__ */
|
|
4189
|
-
/* @__PURE__ */
|
|
4190
|
-
/* @__PURE__ */
|
|
4191
|
-
/* @__PURE__ */
|
|
4205
|
+
return /* @__PURE__ */ jsx61("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs42(Card, { fill: "inset", "aria-hidden": true, className: "flex h-9 items-center gap-2 px-3", children: [
|
|
4206
|
+
/* @__PURE__ */ jsx61(LinkedIcon, { kind: link.kind }),
|
|
4207
|
+
/* @__PURE__ */ jsx61(SkeletonBar, { on: "inset", className: "h-3 w-2/5" }),
|
|
4208
|
+
/* @__PURE__ */ jsx61(SkeletonBar, { on: "inset", shape: "round", className: "ml-auto size-4" })
|
|
4192
4209
|
] }) });
|
|
4193
4210
|
}
|
|
4194
|
-
if (link.state === "unavailable") return /* @__PURE__ */
|
|
4211
|
+
if (link.state === "unavailable") return /* @__PURE__ */ jsx61(LinkUnavailable, { kind: link.kind, noun: link.noun, openIn: link.openIn });
|
|
4195
4212
|
const { linked } = link;
|
|
4196
4213
|
const status = chosenOf(linked.status);
|
|
4197
4214
|
const owner = chosenOf(linked.owner);
|
|
4198
4215
|
const said = linked.kind === "message" && linked.author;
|
|
4199
|
-
const row = /* @__PURE__ */
|
|
4200
|
-
said ? /* @__PURE__ */
|
|
4201
|
-
said ? /* @__PURE__ */
|
|
4202
|
-
/* @__PURE__ */
|
|
4203
|
-
/* @__PURE__ */
|
|
4204
|
-
] }) : /* @__PURE__ */
|
|
4205
|
-
linked.key && /* @__PURE__ */
|
|
4206
|
-
/* @__PURE__ */
|
|
4216
|
+
const row = /* @__PURE__ */ jsxs42(Card, { fill: "inset", hover: "hairline", className: "relative flex h-9 items-center gap-2 px-3", children: [
|
|
4217
|
+
said ? /* @__PURE__ */ jsx61(Avatar, { name: said.name, src: said.picture, size: 16 }) : /* @__PURE__ */ jsx61(LinkedIcon, { kind: linked.kind }),
|
|
4218
|
+
said ? /* @__PURE__ */ jsxs42("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 text-body-2", children: [
|
|
4219
|
+
/* @__PURE__ */ jsx61("span", { className: "shrink-0 text-body-2-strong text-text-primary", children: said.name }),
|
|
4220
|
+
/* @__PURE__ */ jsx61("span", { className: "contents text-text-secondary", children: /* @__PURE__ */ jsx61(Link, { href: linked.href, variant: "quiet", cover: true, truncate: true, children: linked.body ?? linked.title }) })
|
|
4221
|
+
] }) : /* @__PURE__ */ jsxs42(Fragment15, { children: [
|
|
4222
|
+
linked.key && /* @__PURE__ */ jsx61(LinkKey, { children: linked.key }),
|
|
4223
|
+
/* @__PURE__ */ jsx61("span", { className: "contents text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsx61(Link, { href: linked.href, variant: "quiet", cover: true, truncate: true, className: "min-w-0 flex-1", children: linked.title }) })
|
|
4207
4224
|
] }),
|
|
4208
|
-
linked.updated && /* @__PURE__ */
|
|
4209
|
-
linked.conversation && (linked.conversation.unread || linked.kind === "topic") && /* @__PURE__ */
|
|
4210
|
-
status?.colour && !linked.done && /* @__PURE__ */
|
|
4211
|
-
linked.done && /* @__PURE__ */
|
|
4212
|
-
owner && /* @__PURE__ */
|
|
4213
|
-
linked.members && /* @__PURE__ */
|
|
4214
|
-
linked.authors && /* @__PURE__ */
|
|
4225
|
+
linked.updated && /* @__PURE__ */ jsx61("span", { className: "shrink-0 text-caption text-text-secondary", children: linked.updated }),
|
|
4226
|
+
linked.conversation && (linked.conversation.unread || linked.kind === "topic") && /* @__PURE__ */ jsx61(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }),
|
|
4227
|
+
status?.colour && !linked.done && /* @__PURE__ */ jsx61(StatusMark, { status: { label: status.label, colour: status.colour } }),
|
|
4228
|
+
linked.done && /* @__PURE__ */ jsx61(ProgressRing, { done: linked.done.done, total: linked.done.total }),
|
|
4229
|
+
owner && /* @__PURE__ */ jsx61(Avatar, { name: owner.label, src: owner.picture, size: 16 }),
|
|
4230
|
+
linked.members && /* @__PURE__ */ jsx61(AvatarGroup, { members: linked.members, size: 16 }),
|
|
4231
|
+
linked.authors && /* @__PURE__ */ jsx61(AvatarGroup, { members: linked.authors, size: 16 })
|
|
4215
4232
|
] });
|
|
4216
|
-
return preview ? /* @__PURE__ */
|
|
4233
|
+
return preview ? /* @__PURE__ */ jsx61(LinkPreview, { linked, block: true, children: row }) : row;
|
|
4217
4234
|
}
|
|
4218
4235
|
|
|
4219
4236
|
// src/LinkCard.tsx
|
|
4220
|
-
import { Fragment as Fragment16, jsx as
|
|
4237
|
+
import { Fragment as Fragment16, jsx as jsx62, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4221
4238
|
function LinkCard({ link, readOnly = false, bare = false }) {
|
|
4222
|
-
if (link.state === "loading") return /* @__PURE__ */
|
|
4223
|
-
if (link.state === "unavailable") return /* @__PURE__ */
|
|
4239
|
+
if (link.state === "loading") return /* @__PURE__ */ jsx62(LinkCardLoading, { kind: link.kind, shape: link.shape });
|
|
4240
|
+
if (link.state === "unavailable") return /* @__PURE__ */ jsx62(LinkUnavailable, { kind: link.kind, noun: link.noun, openIn: link.openIn });
|
|
4224
4241
|
const { linked } = link;
|
|
4225
|
-
const body = linked.kind === "message" && linked.author ? /* @__PURE__ */
|
|
4226
|
-
if (bare) return /* @__PURE__ */
|
|
4227
|
-
return /* @__PURE__ */
|
|
4242
|
+
const body = linked.kind === "message" && linked.author ? /* @__PURE__ */ jsx62(SaidBody, { linked }) : /* @__PURE__ */ jsx62(CardBody, { linked, readOnly });
|
|
4243
|
+
if (bare) return /* @__PURE__ */ jsx62("div", { className: "flex flex-col gap-2 p-3", children: body });
|
|
4244
|
+
return /* @__PURE__ */ jsx62(Card, { fill: "inset", className: "flex flex-col gap-2 p-3", children: body });
|
|
4228
4245
|
}
|
|
4229
4246
|
function CardBody({ linked, readOnly }) {
|
|
4230
|
-
return /* @__PURE__ */
|
|
4231
|
-
/* @__PURE__ */
|
|
4232
|
-
/* @__PURE__ */
|
|
4233
|
-
/* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4247
|
+
return /* @__PURE__ */ jsxs43(Fragment16, { children: [
|
|
4248
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex min-h-[19.6px] items-center gap-2", children: [
|
|
4249
|
+
/* @__PURE__ */ jsx62("span", { className: "flex min-w-0 flex-1 text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsxs43(Link, { href: linked.href, variant: "quiet", className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
4250
|
+
/* @__PURE__ */ jsx62(LinkedIcon, { kind: linked.kind }),
|
|
4251
|
+
/* @__PURE__ */ jsx62("span", { className: "truncate", children: linked.title })
|
|
4235
4252
|
] }) }),
|
|
4236
|
-
linked.done && /* @__PURE__ */
|
|
4237
|
-
linked.members && /* @__PURE__ */
|
|
4253
|
+
linked.done && /* @__PURE__ */ jsx62(ProgressRing, { done: linked.done.done, total: linked.done.total }),
|
|
4254
|
+
linked.members && /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.members, size: 16 })
|
|
4238
4255
|
] }),
|
|
4239
|
-
(linked.key || linked.subtitle) && /* @__PURE__ */
|
|
4240
|
-
linked.summary && /* @__PURE__ */
|
|
4241
|
-
linked.children && linked.children.length > 0 && /* @__PURE__ */
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
child.key && /* @__PURE__ */
|
|
4244
|
-
/* @__PURE__ */
|
|
4245
|
-
child.owner ? /* @__PURE__ */
|
|
4256
|
+
(linked.key || linked.subtitle) && /* @__PURE__ */ jsx62("p", { className: "-mt-1 pl-6 text-caption text-text-secondary", children: [linked.key, linked.subtitle].filter(Boolean).join(" \xB7 ") }),
|
|
4257
|
+
linked.summary && /* @__PURE__ */ jsx62("p", { className: "line-clamp-2 text-body-2 text-text-secondary", children: linked.summary }),
|
|
4258
|
+
linked.children && linked.children.length > 0 && /* @__PURE__ */ jsx62("div", { className: "flex flex-col divide-y divide-border-subtle rounded-md border border-border-subtle leaf:divide-border-strong leaf:border-border-strong", children: linked.children.map((child) => /* @__PURE__ */ jsxs43("div", { className: "relative flex h-8 items-center gap-2 px-2 hover:bg-bg-active", children: [
|
|
4259
|
+
/* @__PURE__ */ jsx62(StatusMark, { status: child.status }),
|
|
4260
|
+
child.key && /* @__PURE__ */ jsx62(LinkKey, { children: child.key }),
|
|
4261
|
+
/* @__PURE__ */ jsx62("span", { className: "contents text-body-2 text-text-primary", children: /* @__PURE__ */ jsx62(Link, { href: child.href, variant: "quiet", cover: true, truncate: true, className: "min-w-0 flex-1", children: child.title }) }),
|
|
4262
|
+
child.owner ? /* @__PURE__ */ jsx62(Avatar, { name: child.owner.name, src: child.owner.picture, size: 16 }) : /* @__PURE__ */ jsx62("span", { className: "size-4 shrink-0", "aria-hidden": true })
|
|
4246
4263
|
] }, child.id)) }),
|
|
4247
|
-
linked.latest && /* @__PURE__ */
|
|
4248
|
-
/* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4251
|
-
/* @__PURE__ */
|
|
4252
|
-
/* @__PURE__ */
|
|
4253
|
-
/* @__PURE__ */
|
|
4254
|
-
/* @__PURE__ */
|
|
4264
|
+
linked.latest && /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-1", children: [
|
|
4265
|
+
/* @__PURE__ */ jsx62("span", { className: "text-caption text-text-muted", children: "Latest conversation" }),
|
|
4266
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex gap-2 rounded-md border border-border-subtle p-2 leaf:border-border-strong", children: [
|
|
4267
|
+
/* @__PURE__ */ jsx62(Avatar, { name: linked.latest.author.name, src: linked.latest.author.picture, size: 16 }),
|
|
4268
|
+
/* @__PURE__ */ jsxs43("div", { className: "min-w-0 flex-1", children: [
|
|
4269
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-baseline gap-2 text-caption", children: [
|
|
4270
|
+
/* @__PURE__ */ jsx62("span", { className: "text-text-primary", children: linked.latest.author.name }),
|
|
4271
|
+
/* @__PURE__ */ jsx62("span", { className: "text-text-muted", children: linked.latest.at })
|
|
4255
4272
|
] }),
|
|
4256
|
-
/* @__PURE__ */
|
|
4273
|
+
/* @__PURE__ */ jsx62("p", { className: "line-clamp-2 text-body-2 text-text-secondary", children: linked.latest.body })
|
|
4257
4274
|
] })
|
|
4258
4275
|
] })
|
|
4259
4276
|
] }),
|
|
4260
|
-
/* @__PURE__ */
|
|
4261
|
-
(linked.status || linked.owner) && /* @__PURE__ */
|
|
4262
|
-
linked.authors ? /* @__PURE__ */
|
|
4263
|
-
/* @__PURE__ */
|
|
4264
|
-
linked.updated && /* @__PURE__ */
|
|
4265
|
-
] }) : !linked.status && !linked.owner && linked.updated && /* @__PURE__ */
|
|
4277
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex min-h-6 items-center gap-2 border-t border-border-subtle pt-2 leaf:border-border-strong", children: [
|
|
4278
|
+
(linked.status || linked.owner) && /* @__PURE__ */ jsx62(LinkPickers, { status: linked.status, owner: linked.owner, ownerLabel: linked.ownerLabel, readOnly }),
|
|
4279
|
+
linked.authors ? /* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 items-center gap-2 text-caption text-text-secondary", children: [
|
|
4280
|
+
/* @__PURE__ */ jsx62(AvatarGroup, { members: linked.authors, size: 16 }),
|
|
4281
|
+
linked.updated && /* @__PURE__ */ jsx62("span", { className: "shrink-0", children: linked.updated })
|
|
4282
|
+
] }) : !linked.status && !linked.owner && linked.updated && /* @__PURE__ */ jsxs43("span", { className: "text-caption text-text-secondary", children: [
|
|
4266
4283
|
"Updated ",
|
|
4267
4284
|
linked.updated
|
|
4268
4285
|
] }),
|
|
4269
|
-
linked.conversation && /* @__PURE__ */
|
|
4286
|
+
linked.conversation && /* @__PURE__ */ jsx62("span", { className: "ml-auto flex", children: /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }) })
|
|
4270
4287
|
] })
|
|
4271
4288
|
] });
|
|
4272
4289
|
}
|
|
4273
4290
|
function SaidBody({ linked }) {
|
|
4274
4291
|
const author = linked.author;
|
|
4275
|
-
return /* @__PURE__ */
|
|
4276
|
-
/* @__PURE__ */
|
|
4277
|
-
/* @__PURE__ */
|
|
4278
|
-
/* @__PURE__ */
|
|
4279
|
-
/* @__PURE__ */
|
|
4292
|
+
return /* @__PURE__ */ jsxs43(Fragment16, { children: [
|
|
4293
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
|
|
4294
|
+
/* @__PURE__ */ jsx62(Avatar, { name: author.name, src: author.picture, size: 24 }),
|
|
4295
|
+
/* @__PURE__ */ jsx62("span", { className: "text-body-2-strong text-text-primary", children: author.name }),
|
|
4296
|
+
/* @__PURE__ */ jsx62("span", { className: "text-caption text-text-muted", children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: linked.updated ?? "Open" }) })
|
|
4280
4297
|
] }),
|
|
4281
|
-
/* @__PURE__ */
|
|
4298
|
+
/* @__PURE__ */ jsx62("p", { className: "line-clamp-4 text-body-2 text-text-primary", children: linked.body ?? linked.title })
|
|
4282
4299
|
] });
|
|
4283
4300
|
}
|
|
4284
4301
|
var KIND_SHAPE = {
|
|
@@ -4291,35 +4308,35 @@ var KIND_SHAPE = {
|
|
|
4291
4308
|
};
|
|
4292
4309
|
function LinkCardLoading({ kind, shape }) {
|
|
4293
4310
|
const { subtitle = false, summary = true, rows = 0, latest = false, ring = false, footer = "line" } = shape ?? KIND_SHAPE[kind];
|
|
4294
|
-
return /* @__PURE__ */
|
|
4295
|
-
/* @__PURE__ */
|
|
4296
|
-
/* @__PURE__ */
|
|
4297
|
-
/* @__PURE__ */
|
|
4298
|
-
ring && /* @__PURE__ */
|
|
4311
|
+
return /* @__PURE__ */ jsx62("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs43(Card, { fill: "inset", "aria-hidden": true, className: "flex flex-col gap-2 p-3", children: [
|
|
4312
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex h-[19.6px] items-center gap-2", children: [
|
|
4313
|
+
/* @__PURE__ */ jsx62(LinkedIcon, { kind }),
|
|
4314
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3.5 w-1/2" }),
|
|
4315
|
+
ring && /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "round", className: "ml-auto size-4" })
|
|
4299
4316
|
] }),
|
|
4300
|
-
subtitle && /* @__PURE__ */
|
|
4301
|
-
summary && /* @__PURE__ */
|
|
4302
|
-
rows > 0 && /* @__PURE__ */
|
|
4303
|
-
latest && /* @__PURE__ */
|
|
4304
|
-
/* @__PURE__ */
|
|
4305
|
-
/* @__PURE__ */
|
|
4306
|
-
/* @__PURE__ */
|
|
4307
|
-
/* @__PURE__ */
|
|
4308
|
-
/* @__PURE__ */
|
|
4317
|
+
subtitle && /* @__PURE__ */ jsx62("div", { className: "-mt-1 flex h-[14.4px] items-center pl-6", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-2.5 w-20" }) }),
|
|
4318
|
+
summary && /* @__PURE__ */ jsx62("div", { className: "flex h-[19.6px] items-center", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-4/5" }) }),
|
|
4319
|
+
rows > 0 && /* @__PURE__ */ jsx62("div", { className: "flex flex-col divide-y divide-border-subtle rounded-md border border-border-subtle leaf:divide-border-strong leaf:border-border-strong", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx62("div", { className: "flex h-8 items-center px-2", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-1/3" }) }, i)) }),
|
|
4320
|
+
latest && /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-1", children: [
|
|
4321
|
+
/* @__PURE__ */ jsx62("div", { className: "flex h-[14.4px] items-center", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-2.5 w-28" }) }),
|
|
4322
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex h-[71.6px] flex-col justify-center gap-2 rounded-md border border-border-subtle p-2 leaf:border-border-strong", children: [
|
|
4323
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-2.5 w-24" }),
|
|
4324
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-full" }),
|
|
4325
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-3/5" })
|
|
4309
4326
|
] })
|
|
4310
4327
|
] }),
|
|
4311
|
-
footer !== "none" && /* @__PURE__ */
|
|
4312
|
-
/* @__PURE__ */
|
|
4313
|
-
/* @__PURE__ */
|
|
4314
|
-
] }) : footer === "people" ? /* @__PURE__ */
|
|
4315
|
-
/* @__PURE__ */
|
|
4316
|
-
/* @__PURE__ */
|
|
4317
|
-
] }) : /* @__PURE__ */
|
|
4328
|
+
footer !== "none" && /* @__PURE__ */ jsx62("div", { className: "flex min-h-6 items-center gap-2 border-t border-border-subtle pt-2 leaf:border-border-strong", children: footer === "pickers" ? /* @__PURE__ */ jsxs43(Fragment16, { children: [
|
|
4329
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "control", className: "h-6 w-24" }),
|
|
4330
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "control", className: "h-6 w-28" })
|
|
4331
|
+
] }) : footer === "people" ? /* @__PURE__ */ jsxs43(Fragment16, { children: [
|
|
4332
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "round", className: "size-4" }),
|
|
4333
|
+
/* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-40" })
|
|
4334
|
+
] }) : /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-40" }) })
|
|
4318
4335
|
] }) });
|
|
4319
4336
|
}
|
|
4320
4337
|
|
|
4321
4338
|
// src/LinkPreview.tsx
|
|
4322
|
-
import { Fragment as Fragment17, jsx as
|
|
4339
|
+
import { Fragment as Fragment17, jsx as jsx63 } from "react/jsx-runtime";
|
|
4323
4340
|
var HOVER = "(hover: hover)";
|
|
4324
4341
|
function subscribe(onChange) {
|
|
4325
4342
|
if (typeof window === "undefined" || !window.matchMedia) return () => {
|
|
@@ -4337,21 +4354,21 @@ function useCanHover() {
|
|
|
4337
4354
|
}
|
|
4338
4355
|
function LinkPreview({ linked, block = false, children }) {
|
|
4339
4356
|
const canHover = useCanHover();
|
|
4340
|
-
if (!canHover) return /* @__PURE__ */
|
|
4341
|
-
return /* @__PURE__ */
|
|
4357
|
+
if (!canHover) return /* @__PURE__ */ jsx63(Fragment17, { children });
|
|
4358
|
+
return /* @__PURE__ */ jsx63(PreviewCard, { side: "bottom", content: /* @__PURE__ */ jsx63(LinkCard, { link: { state: "ready", linked }, bare: true, readOnly: true }), wrapperClassName: block ? "grid w-full min-w-0 grid-cols-[minmax(0,1fr)]" : "max-w-full", children });
|
|
4342
4359
|
}
|
|
4343
4360
|
function LinkPreviewOpen({ linked }) {
|
|
4344
|
-
return /* @__PURE__ */
|
|
4361
|
+
return /* @__PURE__ */ jsx63(MenuPanel, { className: "w-[360px] p-0", children: /* @__PURE__ */ jsx63(LinkCard, { link: { state: "ready", linked }, bare: true, readOnly: true }) });
|
|
4345
4362
|
}
|
|
4346
4363
|
|
|
4347
4364
|
// src/LinkChip.tsx
|
|
4348
|
-
import { jsx as
|
|
4365
|
+
import { jsx as jsx64, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4349
4366
|
function LinkChip({ link, preview = true }) {
|
|
4350
4367
|
if (link.state === "loading") {
|
|
4351
|
-
return /* @__PURE__ */
|
|
4368
|
+
return /* @__PURE__ */ jsx64(InlineChip, { icon: /* @__PURE__ */ jsx64(LinkedIcon, { kind: link.kind, size: 14, tone: "inherit" }), "aria-busy": true, children: /* @__PURE__ */ jsx64(SkeletonBar, { className: "h-2.5 w-16" }) });
|
|
4352
4369
|
}
|
|
4353
4370
|
if (link.state === "unavailable") {
|
|
4354
|
-
return /* @__PURE__ */
|
|
4371
|
+
return /* @__PURE__ */ jsxs44(InlineChip, { tone: "muted", icon: /* @__PURE__ */ jsx64(LinkedIcon, { kind: link.kind, size: 14, tone: "inherit" }), children: [
|
|
4355
4372
|
link.noun,
|
|
4356
4373
|
", not available"
|
|
4357
4374
|
] });
|
|
@@ -4359,69 +4376,69 @@ function LinkChip({ link, preview = true }) {
|
|
|
4359
4376
|
const { linked } = link;
|
|
4360
4377
|
const status = chosenOf(linked.status);
|
|
4361
4378
|
const said = linked.kind === "message" && linked.author;
|
|
4362
|
-
const chip = /* @__PURE__ */
|
|
4379
|
+
const chip = /* @__PURE__ */ jsxs44(
|
|
4363
4380
|
InlineChip,
|
|
4364
4381
|
{
|
|
4365
|
-
icon: said ? /* @__PURE__ */
|
|
4382
|
+
icon: said ? /* @__PURE__ */ jsx64(Avatar, { name: said.name, src: said.picture, size: 16 }) : /* @__PURE__ */ jsx64(LinkedIcon, { kind: linked.kind, size: 14, tone: "inherit" }),
|
|
4366
4383
|
href: linked.href,
|
|
4367
4384
|
className: "max-w-[28ch]",
|
|
4368
4385
|
children: [
|
|
4369
|
-
linked.key && /* @__PURE__ */
|
|
4370
|
-
/* @__PURE__ */
|
|
4371
|
-
status?.colour && /* @__PURE__ */
|
|
4386
|
+
linked.key && /* @__PURE__ */ jsx64(LinkKey, { children: linked.key }),
|
|
4387
|
+
/* @__PURE__ */ jsx64("span", { className: "truncate", children: said ? `${said.name}: ${linked.body ?? linked.title}` : linked.title }),
|
|
4388
|
+
status?.colour && /* @__PURE__ */ jsx64(StatusMark, { status: { label: status.label, colour: status.colour } })
|
|
4372
4389
|
]
|
|
4373
4390
|
}
|
|
4374
4391
|
);
|
|
4375
|
-
return preview ? /* @__PURE__ */
|
|
4392
|
+
return preview ? /* @__PURE__ */ jsx64(LinkPreview, { linked, children: chip }) : chip;
|
|
4376
4393
|
}
|
|
4377
4394
|
|
|
4378
4395
|
// src/CardUnder.tsx
|
|
4379
4396
|
import { IconX as IconX6 } from "@tabler/icons-react";
|
|
4380
|
-
import { jsx as
|
|
4397
|
+
import { jsx as jsx65, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4381
4398
|
function CardUnder({ link, onRemove, revealOnHover = false }) {
|
|
4382
|
-
return /* @__PURE__ */
|
|
4383
|
-
/* @__PURE__ */
|
|
4399
|
+
return /* @__PURE__ */ jsxs45("div", { className: "group/card flex max-w-[480px] items-start gap-1", children: [
|
|
4400
|
+
/* @__PURE__ */ jsx65("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx65(LinkCard, { link }) }),
|
|
4384
4401
|
onRemove && // At the card's top corner: halfway down a tall card a ✕ reads as belonging to nothing.
|
|
4385
|
-
/* @__PURE__ */
|
|
4402
|
+
/* @__PURE__ */ jsx65(
|
|
4386
4403
|
"div",
|
|
4387
4404
|
{
|
|
4388
4405
|
className: cn(
|
|
4389
4406
|
"flex shrink-0 self-start pt-2",
|
|
4390
4407
|
revealOnHover && "opacity-0 transition-opacity group-hover/card:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-100"
|
|
4391
4408
|
),
|
|
4392
|
-
children: /* @__PURE__ */
|
|
4409
|
+
children: /* @__PURE__ */ jsx65(IconButton, { "aria-label": "Remove card", tooltip: "Remove card", onClick: onRemove, children: /* @__PURE__ */ jsx65(IconX6, { size: 16 }) })
|
|
4393
4410
|
}
|
|
4394
4411
|
)
|
|
4395
4412
|
] });
|
|
4396
4413
|
}
|
|
4397
4414
|
|
|
4398
4415
|
// src/PartCard.tsx
|
|
4399
|
-
import { Fragment as Fragment18, jsx as
|
|
4416
|
+
import { Fragment as Fragment18, jsx as jsx66, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4400
4417
|
function PartCard({ state = "ready", kind, heading, href, partKey, noun = "Item", openIn, children }) {
|
|
4401
|
-
if (state === "loading") return /* @__PURE__ */
|
|
4402
|
-
if (state === "unavailable") return /* @__PURE__ */
|
|
4403
|
-
const header = /* @__PURE__ */
|
|
4404
|
-
/* @__PURE__ */
|
|
4405
|
-
partKey && /* @__PURE__ */
|
|
4406
|
-
/* @__PURE__ */
|
|
4418
|
+
if (state === "loading") return /* @__PURE__ */ jsx66(LinkCardLoading, { kind, shape: { summary: true, rows: 0, footer: "none" } });
|
|
4419
|
+
if (state === "unavailable") return /* @__PURE__ */ jsx66(LinkUnavailable, { kind, noun: `A part of this ${noun.toLowerCase()}`, openIn });
|
|
4420
|
+
const header = /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
4421
|
+
/* @__PURE__ */ jsx66(LinkedIcon, { kind }),
|
|
4422
|
+
partKey && /* @__PURE__ */ jsx66(LinkKey, { children: partKey }),
|
|
4423
|
+
/* @__PURE__ */ jsx66("span", { className: "truncate", children: heading })
|
|
4407
4424
|
] });
|
|
4408
|
-
return /* @__PURE__ */
|
|
4409
|
-
/* @__PURE__ */
|
|
4410
|
-
/* @__PURE__ */
|
|
4425
|
+
return /* @__PURE__ */ jsxs46(Card, { fill: "inset", className: "flex flex-col gap-2 p-3", children: [
|
|
4426
|
+
/* @__PURE__ */ jsx66("span", { className: "flex min-w-0 items-center gap-2 text-body-2-strong text-text-primary", children: href ? /* @__PURE__ */ jsx66(Link, { href, variant: "quiet", className: "flex min-w-0 items-center gap-2", children: header }) : header }),
|
|
4427
|
+
/* @__PURE__ */ jsx66("div", { className: "border-l-2 border-border-default pl-3", children })
|
|
4411
4428
|
] });
|
|
4412
4429
|
}
|
|
4413
4430
|
|
|
4414
4431
|
// src/Rail.tsx
|
|
4415
|
-
import { jsx as
|
|
4432
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4416
4433
|
function Rail({ "aria-label": ariaLabel = "Navigation", children, className }) {
|
|
4417
|
-
return /* @__PURE__ */
|
|
4434
|
+
return /* @__PURE__ */ jsx67("nav", { "aria-label": ariaLabel, className: cn("flex w-16 shrink-0 flex-col items-start gap-2 px-2 py-3", className), children });
|
|
4418
4435
|
}
|
|
4419
4436
|
|
|
4420
4437
|
// src/RailItem.tsx
|
|
4421
|
-
import { jsx as
|
|
4438
|
+
import { jsx as jsx68, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4422
4439
|
function RailItem({ href, icon, label, active = false, className, onClick, ...props }) {
|
|
4423
4440
|
const inApp = useInAppClick(href, onClick);
|
|
4424
|
-
return /* @__PURE__ */
|
|
4441
|
+
return /* @__PURE__ */ jsxs47(
|
|
4425
4442
|
"a",
|
|
4426
4443
|
{
|
|
4427
4444
|
href,
|
|
@@ -4430,14 +4447,14 @@ function RailItem({ href, icon, label, active = false, className, onClick, ...pr
|
|
|
4430
4447
|
...props,
|
|
4431
4448
|
onClick: inApp,
|
|
4432
4449
|
children: [
|
|
4433
|
-
/* @__PURE__ */
|
|
4450
|
+
/* @__PURE__ */ jsx68(
|
|
4434
4451
|
"div",
|
|
4435
4452
|
{
|
|
4436
4453
|
className: cn(
|
|
4437
4454
|
"flex items-center justify-center rounded-lg p-2 transition-colors",
|
|
4438
4455
|
active ? "bg-bg-selected" : "group-hover:bg-bg-hover"
|
|
4439
4456
|
),
|
|
4440
|
-
children: /* @__PURE__ */
|
|
4457
|
+
children: /* @__PURE__ */ jsx68(
|
|
4441
4458
|
"span",
|
|
4442
4459
|
{
|
|
4443
4460
|
className: cn(
|
|
@@ -4449,14 +4466,14 @@ function RailItem({ href, icon, label, active = false, className, onClick, ...pr
|
|
|
4449
4466
|
)
|
|
4450
4467
|
}
|
|
4451
4468
|
),
|
|
4452
|
-
/* @__PURE__ */
|
|
4469
|
+
/* @__PURE__ */ jsx68("span", { className: cn("text-center text-menu", active ? "text-text-primary" : "text-text-secondary"), children: label })
|
|
4453
4470
|
]
|
|
4454
4471
|
}
|
|
4455
4472
|
);
|
|
4456
4473
|
}
|
|
4457
4474
|
|
|
4458
4475
|
// src/Property.tsx
|
|
4459
|
-
import { jsx as
|
|
4476
|
+
import { jsx as jsx69, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4460
4477
|
var VALUE_CLASSES = "contents";
|
|
4461
4478
|
function Property({ label, layout = "row", children, className }) {
|
|
4462
4479
|
if (layout === "stacked") {
|
|
@@ -4464,25 +4481,25 @@ function Property({ label, layout = "row", children, className }) {
|
|
|
4464
4481
|
// gap-3 — the one label-above-content distance (Katerina, 2026-09-01):
|
|
4465
4482
|
// Peek's topic-details sections already sit at 12px, Ship's rail was
|
|
4466
4483
|
// 6px, and unifying means the bigger, calmer one.
|
|
4467
|
-
/* @__PURE__ */
|
|
4468
|
-
/* @__PURE__ */
|
|
4469
|
-
/* @__PURE__ */
|
|
4484
|
+
/* @__PURE__ */ jsxs48("dl", { className: cn("flex flex-col gap-3", className), children: [
|
|
4485
|
+
/* @__PURE__ */ jsx69("dt", { className: "text-menu uppercase tracking-widest text-text-secondary", children: label }),
|
|
4486
|
+
/* @__PURE__ */ jsx69("dd", { className: VALUE_CLASSES, children })
|
|
4470
4487
|
] })
|
|
4471
4488
|
);
|
|
4472
4489
|
}
|
|
4473
|
-
return /* @__PURE__ */
|
|
4474
|
-
/* @__PURE__ */
|
|
4475
|
-
/* @__PURE__ */
|
|
4490
|
+
return /* @__PURE__ */ jsxs48("dl", { className: cn("flex items-center gap-2", className), children: [
|
|
4491
|
+
/* @__PURE__ */ jsx69("dt", { className: "w-[68px] shrink-0 text-caption text-text-secondary", children: label }),
|
|
4492
|
+
/* @__PURE__ */ jsx69("dd", { className: VALUE_CLASSES, children })
|
|
4476
4493
|
] });
|
|
4477
4494
|
}
|
|
4478
4495
|
|
|
4479
4496
|
// src/Reaction.tsx
|
|
4480
4497
|
import { Toggle as Toggle2 } from "@base-ui/react/toggle";
|
|
4481
|
-
import { jsx as
|
|
4498
|
+
import { jsx as jsx70, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4482
4499
|
function Reaction({ emoji, count, pressed = false, className, ...props }) {
|
|
4483
4500
|
return (
|
|
4484
4501
|
// @estiva-escape(no-copied-look): W1 (Katerina, 24 September: leave alone): a reaction pill shares four words with a field's box by coincidence
|
|
4485
|
-
/* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ jsxs49(
|
|
4486
4503
|
Toggle2,
|
|
4487
4504
|
{
|
|
4488
4505
|
pressed,
|
|
@@ -4504,8 +4521,8 @@ function Reaction({ emoji, count, pressed = false, className, ...props }) {
|
|
|
4504
4521
|
),
|
|
4505
4522
|
...props,
|
|
4506
4523
|
children: [
|
|
4507
|
-
/* @__PURE__ */
|
|
4508
|
-
/* @__PURE__ */
|
|
4524
|
+
/* @__PURE__ */ jsx70("span", { "aria-hidden": "true", className: "shrink-0 text-body-1 leading-none", children: emoji }),
|
|
4525
|
+
/* @__PURE__ */ jsx70("span", { className: CHIP_TEXT_CLASSES, children: count })
|
|
4509
4526
|
]
|
|
4510
4527
|
}
|
|
4511
4528
|
)
|
|
@@ -4515,7 +4532,7 @@ function Reaction({ emoji, count, pressed = false, className, ...props }) {
|
|
|
4515
4532
|
// src/ReactionRow.tsx
|
|
4516
4533
|
import { useState as useState13 } from "react";
|
|
4517
4534
|
import { IconMoodPlus } from "@tabler/icons-react";
|
|
4518
|
-
import { jsx as
|
|
4535
|
+
import { jsx as jsx71, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4519
4536
|
var NAMED = 8;
|
|
4520
4537
|
var meaningOf = (options, emoji) => options.find((o) => o.emoji === emoji)?.label ?? emoji;
|
|
4521
4538
|
function whoReacted(reaction, nameOf, options, viewer) {
|
|
@@ -4530,7 +4547,7 @@ function whoReacted(reaction, nameOf, options, viewer) {
|
|
|
4530
4547
|
}
|
|
4531
4548
|
function AddReactionButton({ options, onPick, className }) {
|
|
4532
4549
|
const [picking, setPicking] = useState13(false);
|
|
4533
|
-
return /* @__PURE__ */
|
|
4550
|
+
return /* @__PURE__ */ jsx71(
|
|
4534
4551
|
Popover,
|
|
4535
4552
|
{
|
|
4536
4553
|
open: picking,
|
|
@@ -4540,8 +4557,8 @@ function AddReactionButton({ options, onPick, className }) {
|
|
|
4540
4557
|
ariaLabel: "Add a reaction",
|
|
4541
4558
|
contentClassName: "p-1",
|
|
4542
4559
|
className,
|
|
4543
|
-
trigger: /* @__PURE__ */
|
|
4544
|
-
children: /* @__PURE__ */
|
|
4560
|
+
trigger: /* @__PURE__ */ jsx71(IconButton, { variant: "muted", tooltip: "Add a reaction", "aria-label": "Add a reaction", children: /* @__PURE__ */ jsx71(IconMoodPlus, { size: 16, stroke: 1.5 }) }),
|
|
4561
|
+
children: /* @__PURE__ */ jsx71(
|
|
4545
4562
|
ReactionPicker,
|
|
4546
4563
|
{
|
|
4547
4564
|
options: [...options],
|
|
@@ -4558,8 +4575,8 @@ function AddReactionButton({ options, onPick, className }) {
|
|
|
4558
4575
|
function ReactionRow({ reactions, options, nameOf, viewer, onToggle, className }) {
|
|
4559
4576
|
const shown = reactions.filter((r) => r.by.length > 0);
|
|
4560
4577
|
if (shown.length === 0) return null;
|
|
4561
|
-
return /* @__PURE__ */
|
|
4562
|
-
shown.map((r) => /* @__PURE__ */
|
|
4578
|
+
return /* @__PURE__ */ jsxs50("div", { "data-reaction-row": true, className: cn("flex flex-wrap items-center gap-1", className), children: [
|
|
4579
|
+
shown.map((r) => /* @__PURE__ */ jsx71(WithTooltip, { label: whoReacted(r, nameOf, options, viewer), children: /* @__PURE__ */ jsx71(
|
|
4563
4580
|
Reaction,
|
|
4564
4581
|
{
|
|
4565
4582
|
emoji: r.emoji,
|
|
@@ -4570,16 +4587,16 @@ function ReactionRow({ reactions, options, nameOf, viewer, onToggle, className }
|
|
|
4570
4587
|
onClick: () => onToggle?.(r.emoji)
|
|
4571
4588
|
}
|
|
4572
4589
|
) }, r.emoji)),
|
|
4573
|
-
onToggle && /* @__PURE__ */
|
|
4590
|
+
onToggle && /* @__PURE__ */ jsx71(AddReactionButton, { options, onPick: onToggle })
|
|
4574
4591
|
] });
|
|
4575
4592
|
}
|
|
4576
4593
|
|
|
4577
4594
|
// src/SearchInput.tsx
|
|
4578
4595
|
import "react";
|
|
4579
4596
|
import { Input as Input3 } from "@base-ui/react/input";
|
|
4580
|
-
import { jsx as
|
|
4597
|
+
import { jsx as jsx72, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4581
4598
|
function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...props }) {
|
|
4582
|
-
return /* @__PURE__ */
|
|
4599
|
+
return /* @__PURE__ */ jsxs51(
|
|
4583
4600
|
"div",
|
|
4584
4601
|
{
|
|
4585
4602
|
className: cn(
|
|
@@ -4591,7 +4608,7 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
|
|
|
4591
4608
|
className
|
|
4592
4609
|
),
|
|
4593
4610
|
children: [
|
|
4594
|
-
/* @__PURE__ */
|
|
4611
|
+
/* @__PURE__ */ jsx72(
|
|
4595
4612
|
Input3,
|
|
4596
4613
|
{
|
|
4597
4614
|
className: cn("flex-1 min-w-0 text-input-value", BARE_INPUT_CLASSES),
|
|
@@ -4599,42 +4616,42 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
|
|
|
4599
4616
|
...props
|
|
4600
4617
|
}
|
|
4601
4618
|
),
|
|
4602
|
-
shortcut && /* @__PURE__ */
|
|
4619
|
+
shortcut && /* @__PURE__ */ jsx72(Kbd, { children: shortcut })
|
|
4603
4620
|
]
|
|
4604
4621
|
}
|
|
4605
4622
|
);
|
|
4606
4623
|
}
|
|
4607
4624
|
|
|
4608
4625
|
// src/Panel.tsx
|
|
4609
|
-
import { jsx as
|
|
4626
|
+
import { jsx as jsx73, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
4610
4627
|
function Frame({ title, chevron = false, actions, children, footer, bodyClassName, bodyRef, onBodyScroll, className, broken = false }) {
|
|
4611
|
-
return /* @__PURE__ */
|
|
4612
|
-
/* @__PURE__ */
|
|
4628
|
+
return /* @__PURE__ */ jsxs52("div", { className: cn("flex h-full min-h-0 flex-1 flex-col", className), children: [
|
|
4629
|
+
/* @__PURE__ */ jsx73(ContainerHeader, { title, chevron, actions }),
|
|
4613
4630
|
broken ? (
|
|
4614
4631
|
// The message takes the room the body had and centres itself in it.
|
|
4615
|
-
/* @__PURE__ */
|
|
4616
|
-
) : /* @__PURE__ */
|
|
4617
|
-
!broken && footer && /* @__PURE__ */
|
|
4632
|
+
/* @__PURE__ */ jsx73("div", { className: "flex min-h-0 flex-1 flex-col px-4", children })
|
|
4633
|
+
) : /* @__PURE__ */ jsx73(ScrollArea, { className: "min-h-0 flex-1", contentClassName: bodyClassName, viewportRef: bodyRef, onScroll: onBodyScroll, children }),
|
|
4634
|
+
!broken && footer && /* @__PURE__ */ jsx73("div", { className: "shrink-0", children: footer })
|
|
4618
4635
|
] });
|
|
4619
4636
|
}
|
|
4620
4637
|
function Panel(props) {
|
|
4621
|
-
return /* @__PURE__ */
|
|
4638
|
+
return /* @__PURE__ */ jsx73(
|
|
4622
4639
|
ErrorBoundary,
|
|
4623
4640
|
{
|
|
4624
4641
|
label: "panel",
|
|
4625
4642
|
frame: (message) => (
|
|
4626
4643
|
// Only the name comes back with the message: the actions and the footer may be what threw.
|
|
4627
|
-
/* @__PURE__ */
|
|
4644
|
+
/* @__PURE__ */ jsx73(Frame, { title: props.title, chevron: props.chevron, className: props.className, broken: true, children: message })
|
|
4628
4645
|
),
|
|
4629
|
-
children: /* @__PURE__ */
|
|
4646
|
+
children: /* @__PURE__ */ jsx73(Frame, { ...props })
|
|
4630
4647
|
}
|
|
4631
4648
|
);
|
|
4632
4649
|
}
|
|
4633
4650
|
|
|
4634
4651
|
// src/ListColumn.tsx
|
|
4635
|
-
import { jsx as
|
|
4652
|
+
import { jsx as jsx74, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4636
4653
|
function Column({ title, chevron = false, titleMenu, actions, above, collapsed = false, children, className, broken = false }) {
|
|
4637
|
-
return /* @__PURE__ */
|
|
4654
|
+
return /* @__PURE__ */ jsxs53(
|
|
4638
4655
|
"div",
|
|
4639
4656
|
{
|
|
4640
4657
|
className: cn(
|
|
@@ -4645,35 +4662,35 @@ function Column({ title, chevron = false, titleMenu, actions, above, collapsed =
|
|
|
4645
4662
|
),
|
|
4646
4663
|
"data-collapsed": collapsed || void 0,
|
|
4647
4664
|
children: [
|
|
4648
|
-
/* @__PURE__ */
|
|
4665
|
+
/* @__PURE__ */ jsx74(ContainerHeader, { title, chevron, titleMenu, actions }),
|
|
4649
4666
|
above,
|
|
4650
4667
|
broken ? (
|
|
4651
4668
|
// The message takes the room the list had and centres itself in it (Katerina, 19 September).
|
|
4652
|
-
/* @__PURE__ */
|
|
4653
|
-
) : /* @__PURE__ */
|
|
4669
|
+
/* @__PURE__ */ jsx74("div", { className: "flex min-h-0 flex-1 flex-col px-3", children })
|
|
4670
|
+
) : /* @__PURE__ */ jsx74(ScrollArea, { className: "flex-1", contentClassName: "flex flex-col gap-0.5 px-3 pt-4 pb-3", children })
|
|
4654
4671
|
]
|
|
4655
4672
|
}
|
|
4656
4673
|
);
|
|
4657
4674
|
}
|
|
4658
4675
|
function ListColumn(props) {
|
|
4659
|
-
return /* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ jsx74(
|
|
4660
4677
|
ErrorBoundary,
|
|
4661
4678
|
{
|
|
4662
4679
|
label: "list panel",
|
|
4663
4680
|
frame: (message) => (
|
|
4664
4681
|
// Only the name comes back with the message: the actions and the row above may be what threw.
|
|
4665
|
-
/* @__PURE__ */
|
|
4682
|
+
/* @__PURE__ */ jsx74(Column, { title: props.title, chevron: props.chevron, collapsed: props.collapsed, className: props.className, broken: true, children: message })
|
|
4666
4683
|
),
|
|
4667
|
-
children: /* @__PURE__ */
|
|
4684
|
+
children: /* @__PURE__ */ jsx74(Column, { ...props })
|
|
4668
4685
|
}
|
|
4669
4686
|
);
|
|
4670
4687
|
}
|
|
4671
4688
|
|
|
4672
4689
|
// src/Tabs.tsx
|
|
4673
4690
|
import { Tabs as BaseTabs } from "@base-ui/react/tabs";
|
|
4674
|
-
import { Fragment as Fragment19, jsx as
|
|
4691
|
+
import { Fragment as Fragment19, jsx as jsx75, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4675
4692
|
function Tabs({ tabs, active, onChange, size = "default", className, ...aria }) {
|
|
4676
|
-
return /* @__PURE__ */
|
|
4693
|
+
return /* @__PURE__ */ jsx75(
|
|
4677
4694
|
BaseTabs.Root,
|
|
4678
4695
|
{
|
|
4679
4696
|
value: active,
|
|
@@ -4681,14 +4698,14 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
|
|
|
4681
4698
|
if (details.reason === "none") onChange(value);
|
|
4682
4699
|
},
|
|
4683
4700
|
className,
|
|
4684
|
-
children: /* @__PURE__ */
|
|
4701
|
+
children: /* @__PURE__ */ jsx75(
|
|
4685
4702
|
BaseTabs.List,
|
|
4686
4703
|
{
|
|
4687
4704
|
activateOnFocus: true,
|
|
4688
4705
|
"aria-label": aria["aria-label"],
|
|
4689
4706
|
"aria-labelledby": aria["aria-labelledby"],
|
|
4690
4707
|
className: "flex items-center gap-2",
|
|
4691
|
-
children: tabs.map((tab) => /* @__PURE__ */
|
|
4708
|
+
children: tabs.map((tab) => /* @__PURE__ */ jsxs54(
|
|
4692
4709
|
BaseTabs.Tab,
|
|
4693
4710
|
{
|
|
4694
4711
|
value: tab.id,
|
|
@@ -4701,13 +4718,13 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
|
|
|
4701
4718
|
),
|
|
4702
4719
|
children: [
|
|
4703
4720
|
tab.icon,
|
|
4704
|
-
/* @__PURE__ */
|
|
4721
|
+
/* @__PURE__ */ jsxs54("span", { className: "flex items-baseline", children: [
|
|
4705
4722
|
tab.label,
|
|
4706
|
-
tab.count !== void 0 ? /* @__PURE__ */
|
|
4723
|
+
tab.count !== void 0 ? /* @__PURE__ */ jsx75("span", { className: "ml-2.5 font-mono text-caption tabular-nums text-text-secondary", children: tab.count }) : null
|
|
4707
4724
|
] }),
|
|
4708
|
-
tab.unread ? /* @__PURE__ */
|
|
4709
|
-
/* @__PURE__ */
|
|
4710
|
-
/* @__PURE__ */
|
|
4725
|
+
tab.unread ? /* @__PURE__ */ jsxs54(Fragment19, { children: [
|
|
4726
|
+
/* @__PURE__ */ jsx75(UnreadDot, { className: "h-auto w-auto" }),
|
|
4727
|
+
/* @__PURE__ */ jsx75("span", { className: "sr-only", children: "new" })
|
|
4711
4728
|
] }) : null
|
|
4712
4729
|
]
|
|
4713
4730
|
},
|
|
@@ -4723,7 +4740,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
|
|
|
4723
4740
|
import { createContext as createContext7, useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
4724
4741
|
import { Toast as BaseToast } from "@base-ui/react/toast";
|
|
4725
4742
|
import { IconAlertCircle as IconAlertCircle2, IconCircleCheck as IconCircleCheck2, IconCircleX as IconCircleX2 } from "@tabler/icons-react";
|
|
4726
|
-
import { jsx as
|
|
4743
|
+
import { jsx as jsx76, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
4727
4744
|
var SURFACE_STYLES = {
|
|
4728
4745
|
success: "bg-success-muted signal:bg-bg-inset signal:border signal:border-border-default signal:shadow-md leaf:bg-bg-inset leaf:border leaf:border-border-default leaf:shadow-md",
|
|
4729
4746
|
brand: "bg-accent-muted signal:bg-bg-inset signal:border signal:border-border-default signal:shadow-md leaf:bg-bg-inset leaf:border leaf:border-border-default leaf:shadow-md",
|
|
@@ -4759,16 +4776,16 @@ var pillClassName = (type, hasAction, className) => cn(
|
|
|
4759
4776
|
);
|
|
4760
4777
|
function LeadingIcon({ type }) {
|
|
4761
4778
|
const Icon = ICONS2[type];
|
|
4762
|
-
return /* @__PURE__ */
|
|
4779
|
+
return /* @__PURE__ */ jsx76(Icon, { size: 16, stroke: 1.5, className: cn("text-text-primary shrink-0", ICON_STYLES[type]) });
|
|
4763
4780
|
}
|
|
4764
4781
|
function Toast({ label, type = "neutral", leadingIcon = true, actionLabel, onAction, className }) {
|
|
4765
4782
|
const hasAction = !!(actionLabel && onAction);
|
|
4766
|
-
return /* @__PURE__ */
|
|
4767
|
-
/* @__PURE__ */
|
|
4768
|
-
leadingIcon && /* @__PURE__ */
|
|
4769
|
-
/* @__PURE__ */
|
|
4783
|
+
return /* @__PURE__ */ jsxs55("div", { className: pillClassName(type, hasAction, className), children: [
|
|
4784
|
+
/* @__PURE__ */ jsxs55("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
4785
|
+
leadingIcon && /* @__PURE__ */ jsx76(LeadingIcon, { type }),
|
|
4786
|
+
/* @__PURE__ */ jsx76("span", { className: LABEL_CLASSES, children: label })
|
|
4770
4787
|
] }),
|
|
4771
|
-
hasAction && /* @__PURE__ */
|
|
4788
|
+
hasAction && /* @__PURE__ */ jsx76(Button, { variant: "outlined", size: "small", onClick: onAction, children: actionLabel })
|
|
4772
4789
|
] });
|
|
4773
4790
|
}
|
|
4774
4791
|
var ToastContext = createContext7(null);
|
|
@@ -4789,9 +4806,9 @@ function ToastProvider({ children }) {
|
|
|
4789
4806
|
}),
|
|
4790
4807
|
[manager]
|
|
4791
4808
|
);
|
|
4792
|
-
return /* @__PURE__ */
|
|
4809
|
+
return /* @__PURE__ */ jsx76(ToastContext.Provider, { value, children: /* @__PURE__ */ jsxs55(BaseToast.Provider, { toastManager: manager, limit: VISIBLE_TOASTS, children: [
|
|
4793
4810
|
children,
|
|
4794
|
-
/* @__PURE__ */
|
|
4811
|
+
/* @__PURE__ */ jsx76(BaseToast.Portal, { children: /* @__PURE__ */ jsx76(BaseToast.Viewport, { className: "fixed bottom-4 left-4 z-[100] flex flex-col-reverse items-start gap-2 pointer-events-none", children: /* @__PURE__ */ jsx76(ToastList, {}) }) })
|
|
4795
4812
|
] }) });
|
|
4796
4813
|
}
|
|
4797
4814
|
function ToastList() {
|
|
@@ -4799,25 +4816,25 @@ function ToastList() {
|
|
|
4799
4816
|
return toasts.map((toast) => {
|
|
4800
4817
|
const type = toast.type ?? "neutral";
|
|
4801
4818
|
const { leadingIcon = true, actionLabel, onAction } = toast.data ?? {};
|
|
4802
|
-
return /* @__PURE__ */
|
|
4819
|
+
return /* @__PURE__ */ jsxs55(
|
|
4803
4820
|
BaseToast.Root,
|
|
4804
4821
|
{
|
|
4805
4822
|
toast,
|
|
4806
4823
|
swipeDirection: ["left", "down"],
|
|
4807
4824
|
className: pillClassName(type, !!actionLabel, "pointer-events-auto data-[limited]:hidden"),
|
|
4808
4825
|
children: [
|
|
4809
|
-
/* @__PURE__ */
|
|
4810
|
-
leadingIcon && /* @__PURE__ */
|
|
4811
|
-
/* @__PURE__ */
|
|
4826
|
+
/* @__PURE__ */ jsxs55("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
4827
|
+
leadingIcon && /* @__PURE__ */ jsx76(LeadingIcon, { type }),
|
|
4828
|
+
/* @__PURE__ */ jsx76(BaseToast.Title, { render: /* @__PURE__ */ jsx76("span", {}), className: LABEL_CLASSES })
|
|
4812
4829
|
] }),
|
|
4813
|
-
actionLabel && /* @__PURE__ */
|
|
4830
|
+
actionLabel && /* @__PURE__ */ jsx76(
|
|
4814
4831
|
BaseToast.Action,
|
|
4815
4832
|
{
|
|
4816
4833
|
onClick: () => {
|
|
4817
4834
|
onAction?.();
|
|
4818
4835
|
close(toast.id);
|
|
4819
4836
|
},
|
|
4820
|
-
render: /* @__PURE__ */
|
|
4837
|
+
render: /* @__PURE__ */ jsx76(Button, { variant: "outlined", size: "small", children: actionLabel })
|
|
4821
4838
|
}
|
|
4822
4839
|
)
|
|
4823
4840
|
]
|
|
@@ -4863,6 +4880,7 @@ export {
|
|
|
4863
4880
|
EditableText,
|
|
4864
4881
|
EmptyState,
|
|
4865
4882
|
EnterHint,
|
|
4883
|
+
EntryShell,
|
|
4866
4884
|
ErrorBoundary,
|
|
4867
4885
|
Field,
|
|
4868
4886
|
FieldLine,
|