@platned/ui 0.9.4 → 0.9.6
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/{chunk-OGQIGGVB.js → chunk-O2Y4XUXQ.js} +2 -1
- package/dist/{data-table-gr08E5aX.d.ts → data-table-JX-vnL0F.d.ts} +7 -1
- package/dist/data-table.cjs +10 -3
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +12 -4
- package/dist/data-table.js.map +1 -1
- package/dist/index.cjs +1608 -736
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +432 -13
- package/dist/index.js +1429 -559
- package/dist/index.js.map +1 -1
- package/dist/sidebar.cjs +922 -239
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.d.cts +175 -105
- package/dist/sidebar.d.ts +175 -105
- package/dist/sidebar.js +924 -219
- package/dist/sidebar.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-OGQIGGVB.js.map → chunk-O2Y4XUXQ.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
deferEscapeToInnerPopup,
|
|
75
75
|
devWarn,
|
|
76
76
|
focusMenuEdge,
|
|
77
|
+
overlayItemTone,
|
|
77
78
|
paginationRange,
|
|
78
79
|
stopToAncestors,
|
|
79
80
|
useControlSize,
|
|
@@ -85,7 +86,7 @@ import {
|
|
|
85
86
|
useOverlayDismiss,
|
|
86
87
|
usePortalContainer,
|
|
87
88
|
useRovingFocus
|
|
88
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-O2Y4XUXQ.js";
|
|
89
90
|
|
|
90
91
|
// src/components/forms/button-group.tsx
|
|
91
92
|
import clsx from "clsx";
|
|
@@ -2029,7 +2030,7 @@ import clsx17 from "clsx";
|
|
|
2029
2030
|
// src/components/status/tag-pill.tsx
|
|
2030
2031
|
import clsx16 from "clsx";
|
|
2031
2032
|
import { XIcon } from "lucide-react";
|
|
2032
|
-
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2033
|
+
import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2033
2034
|
var toneStyles = {
|
|
2034
2035
|
default: "bg-default-secondary text-default-secondary",
|
|
2035
2036
|
brand: "bg-brand-tertiary text-brand",
|
|
@@ -2046,51 +2047,64 @@ function TagPill({
|
|
|
2046
2047
|
tone = "default",
|
|
2047
2048
|
size = "sm",
|
|
2048
2049
|
onRemove,
|
|
2050
|
+
asChild = false,
|
|
2051
|
+
icon,
|
|
2052
|
+
title,
|
|
2053
|
+
children,
|
|
2049
2054
|
bg,
|
|
2050
2055
|
color,
|
|
2051
2056
|
className
|
|
2052
2057
|
}) {
|
|
2058
|
+
if (asChild && onRemove) devWarn("TagPill: `asChild` and `onRemove` cannot be combined; `onRemove` is ignored.");
|
|
2053
2059
|
const removeOnKey = (event) => {
|
|
2054
2060
|
if (event.key === "Backspace" || event.key === "Delete") {
|
|
2055
2061
|
event.preventDefault();
|
|
2056
2062
|
onRemove?.();
|
|
2057
2063
|
}
|
|
2058
2064
|
};
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
{
|
|
2083
|
-
type: "button",
|
|
2084
|
-
onClick: onRemove,
|
|
2085
|
-
onKeyDown: removeOnKey,
|
|
2086
|
-
"aria-label": `Remove ${label}`,
|
|
2087
|
-
className: "touch-hit inline-flex shrink-0 items-center justify-center rounded-full opacity-60 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current",
|
|
2088
|
-
children: /* @__PURE__ */ jsx16(XIcon, { className: "size-3", strokeWidth: 2.5, "aria-hidden": true })
|
|
2089
|
-
}
|
|
2090
|
-
)
|
|
2091
|
-
]
|
|
2065
|
+
const glyph = icon && /* @__PURE__ */ jsx16("span", { "aria-hidden": true, className: "inline-flex size-3 shrink-0 [&>svg]:size-full", children: icon });
|
|
2066
|
+
const labelContent = icon ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
2067
|
+
glyph,
|
|
2068
|
+
/* @__PURE__ */ jsx16("span", { className: "truncate", children: label })
|
|
2069
|
+
] }) : label;
|
|
2070
|
+
const rootProps = {
|
|
2071
|
+
"data-tone": tone,
|
|
2072
|
+
"data-size": size,
|
|
2073
|
+
"data-removable": onRemove && !asChild ? "" : void 0,
|
|
2074
|
+
title: title ?? (onRemove && !asChild ? label : void 0),
|
|
2075
|
+
className: clsx16(
|
|
2076
|
+
"inline-flex items-center rounded-full text-body-xs font-medium",
|
|
2077
|
+
sizeStyles2[size],
|
|
2078
|
+
// The remove button sits in the end padding, so trim it to keep the × optically centred.
|
|
2079
|
+
"data-[removable]:max-w-full data-[removable]:gap-1 data-[removable]:whitespace-nowrap data-[removable]:pr-1.5",
|
|
2080
|
+
icon && "max-w-full gap-1",
|
|
2081
|
+
!bg && !color && toneStyles[tone],
|
|
2082
|
+
asChild && ["hover:underline underline-offset-2", FOCUS_RING],
|
|
2083
|
+
className
|
|
2084
|
+
),
|
|
2085
|
+
style: {
|
|
2086
|
+
...bg ? { backgroundColor: bg } : void 0,
|
|
2087
|
+
...color ? { color } : void 0
|
|
2092
2088
|
}
|
|
2093
|
-
|
|
2089
|
+
};
|
|
2090
|
+
if (asChild) {
|
|
2091
|
+
return /* @__PURE__ */ jsx16(Slot, { ...rootProps, wrapChildren: () => labelContent, children });
|
|
2092
|
+
}
|
|
2093
|
+
return /* @__PURE__ */ jsxs14("span", { ...rootProps, children: [
|
|
2094
|
+
glyph,
|
|
2095
|
+
onRemove || icon ? /* @__PURE__ */ jsx16("span", { className: "truncate", children: label }) : label,
|
|
2096
|
+
onRemove && /* @__PURE__ */ jsx16(
|
|
2097
|
+
"button",
|
|
2098
|
+
{
|
|
2099
|
+
type: "button",
|
|
2100
|
+
onClick: onRemove,
|
|
2101
|
+
onKeyDown: removeOnKey,
|
|
2102
|
+
"aria-label": `Remove ${label}`,
|
|
2103
|
+
className: "touch-hit inline-flex shrink-0 items-center justify-center rounded-full opacity-60 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current",
|
|
2104
|
+
children: /* @__PURE__ */ jsx16(XIcon, { className: "size-3", strokeWidth: 2.5, "aria-hidden": true })
|
|
2105
|
+
}
|
|
2106
|
+
)
|
|
2107
|
+
] });
|
|
2094
2108
|
}
|
|
2095
2109
|
|
|
2096
2110
|
// src/components/forms/tag-input.tsx
|
|
@@ -2326,6 +2340,7 @@ function FormCardFooter({
|
|
|
2326
2340
|
import clsx19 from "clsx";
|
|
2327
2341
|
import { XIcon as XIcon2 } from "lucide-react";
|
|
2328
2342
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2343
|
+
var BADGE_COLORS = ["blue", "green", "violet", "yellow", "teal", "pink", "lime", "red", "slate", "gray"];
|
|
2329
2344
|
var defaultClasses = {
|
|
2330
2345
|
gray: "bg-badge-gray text-badge-gray",
|
|
2331
2346
|
red: "bg-badge-red text-badge-red",
|
|
@@ -2356,6 +2371,7 @@ function Badge({
|
|
|
2356
2371
|
size = "sm",
|
|
2357
2372
|
variant = "default",
|
|
2358
2373
|
indicator = false,
|
|
2374
|
+
icon,
|
|
2359
2375
|
onRemove: onRemoveProp,
|
|
2360
2376
|
onClose,
|
|
2361
2377
|
className
|
|
@@ -2382,6 +2398,14 @@ function Badge({
|
|
|
2382
2398
|
)
|
|
2383
2399
|
}
|
|
2384
2400
|
),
|
|
2401
|
+
icon && /* @__PURE__ */ jsx19(
|
|
2402
|
+
"span",
|
|
2403
|
+
{
|
|
2404
|
+
"aria-hidden": true,
|
|
2405
|
+
className: clsx19("inline-flex shrink-0 [&>svg]:h-full [&>svg]:w-full", size === "sm" ? "h-3 w-3" : "h-3.5 w-3.5"),
|
|
2406
|
+
children: icon
|
|
2407
|
+
}
|
|
2408
|
+
),
|
|
2385
2409
|
/* @__PURE__ */ jsx19(
|
|
2386
2410
|
"span",
|
|
2387
2411
|
{
|
|
@@ -2469,7 +2493,7 @@ import {
|
|
|
2469
2493
|
} from "react";
|
|
2470
2494
|
import clsx21 from "clsx";
|
|
2471
2495
|
import { CheckIcon as CheckIcon3, ChevronDownIcon as ChevronDownIcon2 } from "lucide-react";
|
|
2472
|
-
import { Fragment as
|
|
2496
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2473
2497
|
var HEIGHT = {
|
|
2474
2498
|
lg: "h-12 px-4 text-body",
|
|
2475
2499
|
md: "h-9 px-3 text-body-sm",
|
|
@@ -2707,7 +2731,7 @@ function Combobox({
|
|
|
2707
2731
|
"items-center",
|
|
2708
2732
|
option.disabled ? "cursor-not-allowed text-disabled" : isActive ? clsx21(OVERLAY_ITEM_ACTIVE, "text-default") : "text-default"
|
|
2709
2733
|
),
|
|
2710
|
-
children: renderOption ? renderOption(option, isSelected) : /* @__PURE__ */ jsxs18(
|
|
2734
|
+
children: renderOption ? renderOption(option, isSelected) : /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
2711
2735
|
option.icon && /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "flex shrink-0 items-center self-center", children: option.icon }),
|
|
2712
2736
|
/* @__PURE__ */ jsxs18("span", { className: "min-w-0 flex-1", children: [
|
|
2713
2737
|
/* @__PURE__ */ jsx21("span", { className: "block truncate", children: option.label }),
|
|
@@ -2726,7 +2750,7 @@ function Combobox({
|
|
|
2726
2750
|
}
|
|
2727
2751
|
|
|
2728
2752
|
// src/components/forms/role-combo-box.tsx
|
|
2729
|
-
import { Fragment as
|
|
2753
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2730
2754
|
var ROLE_COMBO_OPTIONS = [
|
|
2731
2755
|
{ role: "Reviewer", description: "Reviews onboarding requests" },
|
|
2732
2756
|
{ role: "Admin", description: "Full org control" },
|
|
@@ -2761,7 +2785,7 @@ function RoleComboBox({
|
|
|
2761
2785
|
clearable: false,
|
|
2762
2786
|
emptyMessage: "No roles match",
|
|
2763
2787
|
className,
|
|
2764
|
-
renderOption: (option) => /* @__PURE__ */ jsxs19(
|
|
2788
|
+
renderOption: (option) => /* @__PURE__ */ jsxs19(Fragment4, { children: [
|
|
2765
2789
|
/* @__PURE__ */ jsx22(RoleBadge, { role: option.value, size: "sm" }),
|
|
2766
2790
|
/* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1 truncate text-body-xs text-default-secondary", children: option.description })
|
|
2767
2791
|
] })
|
|
@@ -3272,11 +3296,12 @@ import clsx29 from "clsx";
|
|
|
3272
3296
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3273
3297
|
var sizeStyles3 = {
|
|
3274
3298
|
sm: "size-8",
|
|
3275
|
-
md: "size-10"
|
|
3299
|
+
md: "size-10",
|
|
3300
|
+
lg: "size-14"
|
|
3276
3301
|
};
|
|
3277
3302
|
var shapeStyles = {
|
|
3278
|
-
square: { sm: "rounded-lg", md: "rounded-xl" },
|
|
3279
|
-
circle: { sm: "rounded-full", md: "rounded-full" }
|
|
3303
|
+
square: { sm: "rounded-lg", md: "rounded-xl", lg: "rounded-2xl" },
|
|
3304
|
+
circle: { sm: "rounded-full", md: "rounded-full", lg: "rounded-full" }
|
|
3280
3305
|
};
|
|
3281
3306
|
var toneStyles2 = {
|
|
3282
3307
|
default: "bg-default-secondary text-icon-default",
|
|
@@ -3286,16 +3311,29 @@ var toneStyles2 = {
|
|
|
3286
3311
|
danger: "bg-danger-tertiary text-icon-danger",
|
|
3287
3312
|
neutral: "bg-neutral-tertiary text-icon-neutral"
|
|
3288
3313
|
};
|
|
3289
|
-
|
|
3314
|
+
var hueStyles = {
|
|
3315
|
+
gray: "bg-badge-gray text-badge-gray",
|
|
3316
|
+
red: "bg-badge-red text-badge-red",
|
|
3317
|
+
yellow: "bg-badge-yellow text-badge-yellow",
|
|
3318
|
+
lime: "bg-badge-lime text-badge-lime",
|
|
3319
|
+
green: "bg-badge-green text-badge-green",
|
|
3320
|
+
teal: "bg-badge-teal text-badge-teal",
|
|
3321
|
+
blue: "bg-badge-blue text-badge-blue",
|
|
3322
|
+
pink: "bg-badge-pink text-badge-pink",
|
|
3323
|
+
slate: "bg-badge-slate text-badge-slate",
|
|
3324
|
+
violet: "bg-badge-violet text-badge-violet"
|
|
3325
|
+
};
|
|
3326
|
+
function EntityIconBadge({ size = "sm", tone = "default", shape = "square", hue, bg, iconColor, children, className }) {
|
|
3290
3327
|
return /* @__PURE__ */ jsx33(
|
|
3291
3328
|
"span",
|
|
3292
3329
|
{
|
|
3293
|
-
"data-tone": tone,
|
|
3330
|
+
"data-tone": hue ? void 0 : tone,
|
|
3331
|
+
"data-hue": hue,
|
|
3294
3332
|
className: clsx29(
|
|
3295
3333
|
"inline-flex shrink-0 items-center justify-center",
|
|
3296
3334
|
sizeStyles3[size],
|
|
3297
3335
|
shapeStyles[shape][size],
|
|
3298
|
-
!bg && !iconColor && toneStyles2[tone],
|
|
3336
|
+
!bg && !iconColor && (hue ? hueStyles[hue] : toneStyles2[tone]),
|
|
3299
3337
|
className
|
|
3300
3338
|
),
|
|
3301
3339
|
style: {
|
|
@@ -3385,14 +3423,33 @@ var LABEL_TEXT = {
|
|
|
3385
3423
|
sm: "text-body-tiny",
|
|
3386
3424
|
md: "text-body-xs"
|
|
3387
3425
|
};
|
|
3388
|
-
var Radio = forwardRef10(function Radio2({
|
|
3426
|
+
var Radio = forwardRef10(function Radio2({
|
|
3427
|
+
value,
|
|
3428
|
+
label,
|
|
3429
|
+
description,
|
|
3430
|
+
disabled,
|
|
3431
|
+
id,
|
|
3432
|
+
className,
|
|
3433
|
+
checked: checkedProp,
|
|
3434
|
+
onCheckedChange,
|
|
3435
|
+
size: sizeProp,
|
|
3436
|
+
invalid: invalidProp,
|
|
3437
|
+
name: nameProp,
|
|
3438
|
+
...props
|
|
3439
|
+
}, ref) {
|
|
3389
3440
|
const group = useContext3(RadioGroupContext);
|
|
3390
|
-
if (!group
|
|
3441
|
+
if (!group && !nameProp) {
|
|
3442
|
+
devWarn("A standalone <Radio> needs a `name` shared by its set: without one, each radio is a group of its own.");
|
|
3443
|
+
}
|
|
3391
3444
|
const generatedId = useId8();
|
|
3392
3445
|
const controlId = id ?? generatedId;
|
|
3393
3446
|
const descriptionId = `${controlId}-description`;
|
|
3394
|
-
const isDisabled = disabled ?? group
|
|
3395
|
-
const checked = group.value === value;
|
|
3447
|
+
const isDisabled = disabled ?? group?.disabled ?? false;
|
|
3448
|
+
const checked = group ? group.value === value : Boolean(checkedProp);
|
|
3449
|
+
const size = group?.size ?? sizeProp ?? "md";
|
|
3450
|
+
const invalid = group?.invalid ?? invalidProp ?? false;
|
|
3451
|
+
const name = group?.name ?? nameProp;
|
|
3452
|
+
const select = () => group ? group.setValue(value) : onCheckedChange?.(true);
|
|
3396
3453
|
return /* @__PURE__ */ jsxs25("div", { className: clsx30("flex flex-col", className), children: [
|
|
3397
3454
|
/* @__PURE__ */ jsxs25(
|
|
3398
3455
|
"label",
|
|
@@ -3412,27 +3469,19 @@ var Radio = forwardRef10(function Radio2({ value, label, description, disabled,
|
|
|
3412
3469
|
ref,
|
|
3413
3470
|
id: controlId,
|
|
3414
3471
|
type: "radio",
|
|
3415
|
-
name
|
|
3472
|
+
name,
|
|
3416
3473
|
value,
|
|
3417
3474
|
checked,
|
|
3418
3475
|
disabled: isDisabled,
|
|
3476
|
+
"aria-invalid": !group && invalid ? true : void 0,
|
|
3419
3477
|
"aria-describedby": description ? descriptionId : void 0,
|
|
3420
|
-
onChange:
|
|
3478
|
+
onChange: select,
|
|
3421
3479
|
className: "peer sr-only",
|
|
3422
3480
|
...props
|
|
3423
3481
|
}
|
|
3424
3482
|
),
|
|
3425
|
-
/* @__PURE__ */ jsx34(
|
|
3426
|
-
|
|
3427
|
-
{
|
|
3428
|
-
type: "radio",
|
|
3429
|
-
checked,
|
|
3430
|
-
disabled: isDisabled,
|
|
3431
|
-
invalid: group.invalid,
|
|
3432
|
-
size: group.size
|
|
3433
|
-
}
|
|
3434
|
-
),
|
|
3435
|
-
label && /* @__PURE__ */ jsx34("span", { className: clsx30(LABEL_TEXT[group.size], "text-default"), children: label })
|
|
3483
|
+
/* @__PURE__ */ jsx34(CheckControl, { type: "radio", checked, disabled: isDisabled, invalid, size }),
|
|
3484
|
+
label && /* @__PURE__ */ jsx34("span", { className: clsx30(LABEL_TEXT[size], "text-default"), children: label })
|
|
3436
3485
|
]
|
|
3437
3486
|
}
|
|
3438
3487
|
),
|
|
@@ -3442,7 +3491,7 @@ var Radio = forwardRef10(function Radio2({ value, label, description, disabled,
|
|
|
3442
3491
|
id: descriptionId,
|
|
3443
3492
|
className: clsx30(
|
|
3444
3493
|
"mt-0.5 pl-[26px]",
|
|
3445
|
-
LABEL_TEXT[
|
|
3494
|
+
LABEL_TEXT[size],
|
|
3446
3495
|
isDisabled ? "text-disabled" : "text-default-secondary"
|
|
3447
3496
|
),
|
|
3448
3497
|
children: description
|
|
@@ -4067,7 +4116,7 @@ var ModalFooter = forwardRef15(function ModalFooter2({ children, align = "end",
|
|
|
4067
4116
|
// src/components/overlays/tooltip.tsx
|
|
4068
4117
|
import { useId as useId12 } from "react";
|
|
4069
4118
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
4070
|
-
import { Fragment as
|
|
4119
|
+
import { Fragment as Fragment5, jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4071
4120
|
function Tooltip({
|
|
4072
4121
|
children,
|
|
4073
4122
|
title,
|
|
@@ -4084,7 +4133,7 @@ function Tooltip({
|
|
|
4084
4133
|
const container = usePortalContainer();
|
|
4085
4134
|
const labelId = useId12();
|
|
4086
4135
|
const labelled = association === "labelledby";
|
|
4087
|
-
const content = /* @__PURE__ */ jsxs30(
|
|
4136
|
+
const content = /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
4088
4137
|
title && /* @__PURE__ */ jsx41("p", { className: "font-semibold", children: title }),
|
|
4089
4138
|
body && /* @__PURE__ */ jsx41("p", { className: cn(title && "mt-0.5 opacity-80"), children: body })
|
|
4090
4139
|
] });
|
|
@@ -4190,14 +4239,14 @@ import {
|
|
|
4190
4239
|
forwardRef as forwardRef16
|
|
4191
4240
|
} from "react";
|
|
4192
4241
|
import { ContextMenu as ContextMenuPrimitive } from "radix-ui";
|
|
4193
|
-
import { Fragment as
|
|
4242
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4194
4243
|
function ContextMenu({ children, items, open: openProp, defaultOpen = false, onOpenChange }) {
|
|
4195
4244
|
const [, setOpen] = useControllableState({
|
|
4196
4245
|
value: openProp,
|
|
4197
4246
|
defaultValue: defaultOpen,
|
|
4198
4247
|
onChange: onOpenChange
|
|
4199
4248
|
});
|
|
4200
|
-
return /* @__PURE__ */ jsx43(ContextMenuPrimitive.Root, { onOpenChange: setOpen, modal: false, children: items ? /* @__PURE__ */ jsxs32(
|
|
4249
|
+
return /* @__PURE__ */ jsx43(ContextMenuPrimitive.Root, { onOpenChange: setOpen, modal: false, children: items ? /* @__PURE__ */ jsxs32(Fragment6, { children: [
|
|
4201
4250
|
/* @__PURE__ */ jsx43(ContextMenuTrigger, { children }),
|
|
4202
4251
|
/* @__PURE__ */ jsx43(ContextMenuContent, { children: /* @__PURE__ */ jsx43(ContextMenuItems, { items }) })
|
|
4203
4252
|
] }) : children });
|
|
@@ -4428,7 +4477,7 @@ var ScrollArea = forwardRef18(function ScrollArea2({ children, axis = "vertical"
|
|
|
4428
4477
|
});
|
|
4429
4478
|
|
|
4430
4479
|
// src/components/overlays/drawer.tsx
|
|
4431
|
-
import { Fragment as
|
|
4480
|
+
import { Fragment as Fragment7, jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4432
4481
|
var DrawerNaming = createContext7(null);
|
|
4433
4482
|
var Drawer = forwardRef19(function Drawer2({
|
|
4434
4483
|
open,
|
|
@@ -4460,7 +4509,7 @@ var Drawer = forwardRef19(function Drawer2({
|
|
|
4460
4509
|
onEscapeKeyDown,
|
|
4461
4510
|
onInteractOutside,
|
|
4462
4511
|
initialFocus,
|
|
4463
|
-
children: header !== void 0 ? /* @__PURE__ */ jsxs34(
|
|
4512
|
+
children: header !== void 0 ? /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
4464
4513
|
/* @__PURE__ */ jsx46(DrawerHeader, { children: header }),
|
|
4465
4514
|
/* @__PURE__ */ jsx46(DrawerBody, { label, children: withoutTrigger2(children) }),
|
|
4466
4515
|
footer && /* @__PURE__ */ jsx46(DrawerFooter, { align: footerAlign, children: footer })
|
|
@@ -5918,13 +5967,19 @@ function PageHeading({
|
|
|
5918
5967
|
subtitle,
|
|
5919
5968
|
size = "page",
|
|
5920
5969
|
as,
|
|
5970
|
+
badges,
|
|
5971
|
+
meta,
|
|
5921
5972
|
actions,
|
|
5922
5973
|
truncateTitle,
|
|
5923
5974
|
className
|
|
5924
5975
|
}) {
|
|
5925
5976
|
const Tag = as ?? (size === "section" ? "h2" : "h1");
|
|
5926
5977
|
const heading = /* @__PURE__ */ jsxs41("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
5927
|
-
/* @__PURE__ */
|
|
5978
|
+
badges ? /* @__PURE__ */ jsxs41("div", { className: "flex min-w-0 flex-wrap items-center gap-2.5", children: [
|
|
5979
|
+
/* @__PURE__ */ jsx60(Tag, { className: clsx40(TITLE[size], truncateTitle && "truncate"), children: title }),
|
|
5980
|
+
badges
|
|
5981
|
+
] }) : /* @__PURE__ */ jsx60(Tag, { className: clsx40(TITLE[size], truncateTitle && "truncate"), children: title }),
|
|
5982
|
+
meta && /* @__PURE__ */ jsx60("div", { className: "flex flex-wrap items-center gap-2.5 text-body-xs text-default-secondary", children: meta }),
|
|
5928
5983
|
subtitle && /* @__PURE__ */ jsx60("p", { className: SUBTITLE[size], children: subtitle })
|
|
5929
5984
|
] });
|
|
5930
5985
|
if (!actions) return className ? /* @__PURE__ */ jsx60("div", { className, children: heading }) : heading;
|
|
@@ -6347,8 +6402,10 @@ var TabsContent = forwardRef25(function TabsContent2({ value, keepMounted = fals
|
|
|
6347
6402
|
});
|
|
6348
6403
|
|
|
6349
6404
|
// src/components/chrome/nav-item.tsx
|
|
6405
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
6350
6406
|
import clsx44 from "clsx";
|
|
6351
|
-
import {
|
|
6407
|
+
import { ChevronDownIcon as ChevronDownIcon4 } from "lucide-react";
|
|
6408
|
+
import { Fragment as Fragment8, jsx as jsx64, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6352
6409
|
var SIZE8 = {
|
|
6353
6410
|
sm: { box: "h-9 gap-2 rounded-lg px-3 py-1.5", label: "text-body-xs", square: "w-9" },
|
|
6354
6411
|
md: { box: "h-11 gap-3 rounded-xl px-3.5 py-2.5", label: "text-body-sm", square: "w-11" }
|
|
@@ -6383,7 +6440,32 @@ var VARIANT2 = {
|
|
|
6383
6440
|
inactive: clsx44("text-default-secondary", STATE.hover)
|
|
6384
6441
|
}
|
|
6385
6442
|
};
|
|
6386
|
-
|
|
6443
|
+
var DENSITY = {
|
|
6444
|
+
comfortable: {
|
|
6445
|
+
box: "h-11 gap-3 rounded-xl",
|
|
6446
|
+
pad: "px-3.5",
|
|
6447
|
+
square: "w-11",
|
|
6448
|
+
active: clsx44("border border-transparent", STATE.active),
|
|
6449
|
+
inactive: clsx44("border border-default bg-default text-default", STATE.hover),
|
|
6450
|
+
disabled: "data-[disabled]:hover:bg-default",
|
|
6451
|
+
// Straddles the card's corner, as in Figma.
|
|
6452
|
+
dot: "-right-px -top-px",
|
|
6453
|
+
railDot: "-right-px -top-px"
|
|
6454
|
+
},
|
|
6455
|
+
compact: {
|
|
6456
|
+
box: "h-10 gap-3 rounded-xl",
|
|
6457
|
+
pad: "px-3",
|
|
6458
|
+
square: "w-10",
|
|
6459
|
+
active: STATE.active,
|
|
6460
|
+
inactive: clsx44("text-default", STATE.hover),
|
|
6461
|
+
disabled: "data-[disabled]:hover:bg-transparent",
|
|
6462
|
+
// A plain row has no corner to sit on, so the expanded dot trails the label instead.
|
|
6463
|
+
dot: "right-2 top-1/2 -translate-y-1/2",
|
|
6464
|
+
railDot: "right-0 top-0"
|
|
6465
|
+
}
|
|
6466
|
+
};
|
|
6467
|
+
var DENSITY_DISABLED = "data-[disabled]:cursor-not-allowed data-[disabled]:text-disabled data-[disabled]:hover:text-disabled";
|
|
6468
|
+
var NavItem = forwardRef26(function NavItem2({
|
|
6387
6469
|
icon,
|
|
6388
6470
|
label,
|
|
6389
6471
|
isActive = false,
|
|
@@ -6391,16 +6473,21 @@ function NavItem({
|
|
|
6391
6473
|
collapsed = false,
|
|
6392
6474
|
size = "md",
|
|
6393
6475
|
variant = "card",
|
|
6476
|
+
density,
|
|
6477
|
+
trailing,
|
|
6394
6478
|
asChild = false,
|
|
6395
6479
|
disabled = false,
|
|
6396
6480
|
children,
|
|
6397
6481
|
className,
|
|
6398
6482
|
onClick,
|
|
6399
6483
|
...rest
|
|
6400
|
-
}) {
|
|
6484
|
+
}, ref) {
|
|
6401
6485
|
const s = SIZE8[size];
|
|
6402
6486
|
const v = VARIANT2[variant];
|
|
6487
|
+
const d = density ? DENSITY[density] : null;
|
|
6403
6488
|
const rootProps = {
|
|
6489
|
+
ref,
|
|
6490
|
+
"data-density": density,
|
|
6404
6491
|
// Only meaningful when `asChild` renders a real link — a decorative span with
|
|
6405
6492
|
// aria-current would be a lie.
|
|
6406
6493
|
"aria-current": asChild && isActive ? "page" : void 0,
|
|
@@ -6421,12 +6508,25 @@ function NavItem({
|
|
|
6421
6508
|
// halo on the #F5F5F5 rail. The offset itself is load-bearing — in dark mode
|
|
6422
6509
|
// `ring-brand` and `bg-brand` are both #F1F7FD, so without it a focused *active* row
|
|
6423
6510
|
// would have no visible ring at its inner edge.
|
|
6511
|
+
// It is also Figma's focus state for both densities: 1px rail-coloured gap, 3px of brand
|
|
6512
|
+
// in all. Figma's compact focus variant draws a 0px shadow — no ring at all — which
|
|
6513
|
+
// would fail WCAG 2.4.7, so compact keeps this ring too.
|
|
6424
6514
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default-secondary",
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6515
|
+
d ? clsx44(
|
|
6516
|
+
// text-left: a parent row is a <button>, which centres its text by default.
|
|
6517
|
+
"group/nav-item text-left",
|
|
6518
|
+
d.box,
|
|
6519
|
+
collapsed ? clsx44("justify-center", d.square) : clsx44("w-full", d.pad),
|
|
6520
|
+
isActive ? d.active : d.inactive,
|
|
6521
|
+
DENSITY_DISABLED,
|
|
6522
|
+
d.disabled
|
|
6523
|
+
) : clsx44(
|
|
6524
|
+
s.box,
|
|
6525
|
+
// Expanded rows fill the nav; a collapsed one is a centred square, not a stretched row.
|
|
6526
|
+
collapsed ? clsx44("justify-center", s.square) : "w-full",
|
|
6527
|
+
isActive ? v.active : v.inactive,
|
|
6528
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-40 data-[disabled]:hover:bg-transparent data-[disabled]:hover:text-default-secondary"
|
|
6529
|
+
),
|
|
6430
6530
|
className
|
|
6431
6531
|
),
|
|
6432
6532
|
...rest,
|
|
@@ -6441,8 +6541,23 @@ function NavItem({
|
|
|
6441
6541
|
onClick?.(event);
|
|
6442
6542
|
}
|
|
6443
6543
|
};
|
|
6444
|
-
const content = /* @__PURE__ */ jsxs45(
|
|
6445
|
-
icon != null ? /* @__PURE__ */ jsx64(
|
|
6544
|
+
const content = /* @__PURE__ */ jsxs45(Fragment8, { children: [
|
|
6545
|
+
icon != null ? /* @__PURE__ */ jsx64(
|
|
6546
|
+
"span",
|
|
6547
|
+
{
|
|
6548
|
+
"aria-hidden": true,
|
|
6549
|
+
className: clsx44(
|
|
6550
|
+
"shrink-0",
|
|
6551
|
+
d ? clsx44(
|
|
6552
|
+
// Figma: a 20px glyph, icon-secondary at rest, brand under hover,
|
|
6553
|
+
// on-brand on the current row, disabled grey on a disabled one.
|
|
6554
|
+
"flex size-5 items-center justify-center [&_svg]:size-5",
|
|
6555
|
+
disabled ? "text-icon-disabled" : isActive ? "text-icon-brand-on-brand" : "text-icon-default-secondary group-hover/nav-item:text-icon-brand"
|
|
6556
|
+
) : "[&_svg]:size-4"
|
|
6557
|
+
),
|
|
6558
|
+
children: icon
|
|
6559
|
+
}
|
|
6560
|
+
) : (
|
|
6446
6561
|
// Icons are optional, but the collapsed rail hides the label — so a row with neither
|
|
6447
6562
|
// renders as an empty box. Through 0.5.0 that is exactly what a nav without icons
|
|
6448
6563
|
// collapsed to, the docs site's own 36-row sidebar included. The monogram is
|
|
@@ -6461,19 +6576,23 @@ function NavItem({
|
|
|
6461
6576
|
"span",
|
|
6462
6577
|
{
|
|
6463
6578
|
className: clsx44(
|
|
6464
|
-
"min-w-0 truncate font-regular
|
|
6465
|
-
s.label,
|
|
6579
|
+
"min-w-0 truncate font-regular",
|
|
6580
|
+
d ? "text-body" : clsx44("leading-snug", s.label),
|
|
6466
6581
|
collapsed ? "sr-only" : "flex-1"
|
|
6467
6582
|
),
|
|
6468
6583
|
children: label
|
|
6469
6584
|
}
|
|
6470
6585
|
),
|
|
6586
|
+
trailing != null && !collapsed && /* @__PURE__ */ jsx64("span", { "aria-hidden": true, className: "flex shrink-0 items-center [&_svg]:size-4", children: trailing }),
|
|
6471
6587
|
indicator && /* @__PURE__ */ jsx64(
|
|
6472
6588
|
"span",
|
|
6473
6589
|
{
|
|
6474
6590
|
role: "status",
|
|
6475
6591
|
"aria-label": "Unread",
|
|
6476
|
-
className:
|
|
6592
|
+
className: clsx44(
|
|
6593
|
+
"absolute size-2 rounded-full bg-danger",
|
|
6594
|
+
d ? collapsed ? d.railDot : d.dot : "-right-px -top-px"
|
|
6595
|
+
)
|
|
6477
6596
|
}
|
|
6478
6597
|
)
|
|
6479
6598
|
] });
|
|
@@ -6481,67 +6600,686 @@ function NavItem({
|
|
|
6481
6600
|
return /* @__PURE__ */ jsx64(Slot, { wrapChildren: () => content, ...rootProps, children });
|
|
6482
6601
|
}
|
|
6483
6602
|
return /* @__PURE__ */ jsx64("span", { ...rootProps, children: content });
|
|
6603
|
+
});
|
|
6604
|
+
var SUB_HEIGHT = { comfortable: "h-11", compact: "h-10" };
|
|
6605
|
+
var NavSubItem = forwardRef26(function NavSubItem2({
|
|
6606
|
+
label,
|
|
6607
|
+
isActive = false,
|
|
6608
|
+
disabled = false,
|
|
6609
|
+
last = false,
|
|
6610
|
+
density = "comfortable",
|
|
6611
|
+
asChild = false,
|
|
6612
|
+
children,
|
|
6613
|
+
className,
|
|
6614
|
+
onClick,
|
|
6615
|
+
...rest
|
|
6616
|
+
}, ref) {
|
|
6617
|
+
const rootProps = {
|
|
6618
|
+
ref,
|
|
6619
|
+
"aria-current": asChild && isActive ? "page" : void 0,
|
|
6620
|
+
"data-state": isActive ? "active" : void 0,
|
|
6621
|
+
"data-disabled": disabled || void 0,
|
|
6622
|
+
"aria-disabled": disabled || void 0,
|
|
6623
|
+
className: clsx44(
|
|
6624
|
+
"relative flex w-full items-center gap-3 rounded-md pl-4 pr-3 transition-colors",
|
|
6625
|
+
// Figma's focus variant is a 1px brand border on the hover tint. The transparent
|
|
6626
|
+
// border holds the 1px at rest so the label does not move when focus arrives.
|
|
6627
|
+
"border border-transparent focus-visible:border-brand focus-visible:bg-brand-secondary focus-visible:text-brand focus-visible:outline-none",
|
|
6628
|
+
SUB_HEIGHT[density],
|
|
6629
|
+
isActive ? "bg-brand text-brand-on-brand" : "text-default-secondary hover:bg-brand-secondary hover:text-brand",
|
|
6630
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:text-disabled data-[disabled]:hover:bg-transparent data-[disabled]:hover:text-disabled",
|
|
6631
|
+
className
|
|
6632
|
+
),
|
|
6633
|
+
...rest,
|
|
6634
|
+
...disabled ? { tabIndex: -1 } : {},
|
|
6635
|
+
onClick: (event) => {
|
|
6636
|
+
if (disabled) {
|
|
6637
|
+
event.preventDefault();
|
|
6638
|
+
return;
|
|
6639
|
+
}
|
|
6640
|
+
onClick?.(event);
|
|
6641
|
+
}
|
|
6642
|
+
};
|
|
6643
|
+
const content = /* @__PURE__ */ jsxs45(Fragment8, { children: [
|
|
6644
|
+
/* @__PURE__ */ jsx64(NestIndicator, { last }),
|
|
6645
|
+
/* @__PURE__ */ jsx64("span", { className: "min-w-0 flex-1 truncate text-body font-regular", children: label })
|
|
6646
|
+
] });
|
|
6647
|
+
if (asChild) {
|
|
6648
|
+
return /* @__PURE__ */ jsx64(Slot, { wrapChildren: () => content, ...rootProps, children });
|
|
6649
|
+
}
|
|
6650
|
+
return /* @__PURE__ */ jsx64("span", { ...rootProps, children: content });
|
|
6651
|
+
});
|
|
6652
|
+
function NestIndicator({ last }) {
|
|
6653
|
+
return /* @__PURE__ */ jsxs45("span", { "aria-hidden": true, className: "relative w-4 shrink-0 self-stretch", children: [
|
|
6654
|
+
/* @__PURE__ */ jsx64(
|
|
6655
|
+
"span",
|
|
6656
|
+
{
|
|
6657
|
+
className: clsx44(
|
|
6658
|
+
"absolute left-1/2 top-0 w-px -translate-x-1/2 bg-[var(--prim-stone-400)]",
|
|
6659
|
+
last ? "h-1/2" : "h-full"
|
|
6660
|
+
)
|
|
6661
|
+
}
|
|
6662
|
+
),
|
|
6663
|
+
last && /* @__PURE__ */ jsx64("span", { className: "absolute left-1/2 right-0 top-1/2 h-px bg-[var(--prim-stone-400)]" })
|
|
6664
|
+
] });
|
|
6484
6665
|
}
|
|
6666
|
+
var NavGroupHeader = forwardRef26(function NavGroupHeader2({ title, open, onOpenChange, controls, action, className, ...rest }, ref) {
|
|
6667
|
+
const collapsible = open !== void 0 && onOpenChange !== void 0;
|
|
6668
|
+
return /* @__PURE__ */ jsxs45("div", { ref, className: clsx44("flex items-center gap-2 pl-2.5", className), ...rest, children: [
|
|
6669
|
+
collapsible && /* @__PURE__ */ jsx64(
|
|
6670
|
+
"button",
|
|
6671
|
+
{
|
|
6672
|
+
type: "button",
|
|
6673
|
+
"aria-expanded": open,
|
|
6674
|
+
"aria-controls": controls,
|
|
6675
|
+
"aria-label": `${open ? "Collapse" : "Expand"} ${title}`,
|
|
6676
|
+
onClick: () => onOpenChange(!open),
|
|
6677
|
+
className: clsx44(
|
|
6678
|
+
"flex shrink-0 items-center justify-center rounded-full p-1 text-icon-default-secondary transition-colors",
|
|
6679
|
+
"hover:bg-brand-tertiary-hover hover:text-icon-brand",
|
|
6680
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default-secondary"
|
|
6681
|
+
),
|
|
6682
|
+
children: /* @__PURE__ */ jsx64(
|
|
6683
|
+
ChevronDownIcon4,
|
|
6684
|
+
{
|
|
6685
|
+
"aria-hidden": true,
|
|
6686
|
+
className: clsx44(
|
|
6687
|
+
"size-4 transition-transform motion-reduce:transition-none",
|
|
6688
|
+
!open && "-rotate-90"
|
|
6689
|
+
)
|
|
6690
|
+
}
|
|
6691
|
+
)
|
|
6692
|
+
}
|
|
6693
|
+
),
|
|
6694
|
+
/* @__PURE__ */ jsx64("p", { className: "min-w-0 flex-1 truncate text-body font-regular text-neutral-tertiary", children: title }),
|
|
6695
|
+
action != null && /* @__PURE__ */ jsx64("div", { className: "flex shrink-0 items-center", children: action })
|
|
6696
|
+
] });
|
|
6697
|
+
});
|
|
6485
6698
|
|
|
6486
|
-
// src/components/chrome/
|
|
6699
|
+
// src/components/chrome/sidebar.tsx
|
|
6700
|
+
import {
|
|
6701
|
+
createContext as createContext14,
|
|
6702
|
+
forwardRef as forwardRef27,
|
|
6703
|
+
useCallback as useCallback7,
|
|
6704
|
+
useContext as useContext14,
|
|
6705
|
+
useEffect as useEffect10,
|
|
6706
|
+
useId as useId18,
|
|
6707
|
+
useMemo as useMemo11,
|
|
6708
|
+
useState as useState20
|
|
6709
|
+
} from "react";
|
|
6710
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
6711
|
+
import {
|
|
6712
|
+
ChevronDownIcon as ChevronDownIcon5,
|
|
6713
|
+
ChevronLeftIcon as ChevronLeftIcon4,
|
|
6714
|
+
ChevronRightIcon as ChevronRightIcon5,
|
|
6715
|
+
EllipsisVerticalIcon,
|
|
6716
|
+
LogOutIcon,
|
|
6717
|
+
MenuIcon
|
|
6718
|
+
} from "lucide-react";
|
|
6487
6719
|
import clsx45 from "clsx";
|
|
6488
|
-
|
|
6489
|
-
|
|
6720
|
+
|
|
6721
|
+
// src/lib/use-media-query.ts
|
|
6722
|
+
import { useCallback as useCallback6, useSyncExternalStore } from "react";
|
|
6723
|
+
function useMediaQuery(query) {
|
|
6724
|
+
const subscribe = useCallback6(
|
|
6725
|
+
(onChange) => {
|
|
6726
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return () => {
|
|
6727
|
+
};
|
|
6728
|
+
const list = window.matchMedia(query);
|
|
6729
|
+
list.addEventListener("change", onChange);
|
|
6730
|
+
return () => list.removeEventListener("change", onChange);
|
|
6731
|
+
},
|
|
6732
|
+
[query]
|
|
6733
|
+
);
|
|
6734
|
+
const getSnapshot = () => typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query).matches : false;
|
|
6735
|
+
return useSyncExternalStore(subscribe, getSnapshot, () => false);
|
|
6736
|
+
}
|
|
6737
|
+
|
|
6738
|
+
// src/components/chrome/sidebar.tsx
|
|
6739
|
+
import { Fragment as Fragment9, jsx as jsx65, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6740
|
+
var MOBILE_QUERY = "(max-width: 767.98px)";
|
|
6741
|
+
var SidebarContext = createContext14(null);
|
|
6742
|
+
function useSidebar() {
|
|
6743
|
+
const value = useContext14(SidebarContext);
|
|
6744
|
+
if (!value) throw new Error("useSidebar must be used inside <SidebarProvider>");
|
|
6745
|
+
return value;
|
|
6746
|
+
}
|
|
6747
|
+
function readStored(key) {
|
|
6748
|
+
try {
|
|
6749
|
+
const value = window.localStorage.getItem(key);
|
|
6750
|
+
return value === "true" ? true : value === "false" ? false : null;
|
|
6751
|
+
} catch {
|
|
6752
|
+
return null;
|
|
6753
|
+
}
|
|
6754
|
+
}
|
|
6755
|
+
function writeStored(key, value) {
|
|
6756
|
+
try {
|
|
6757
|
+
window.localStorage.setItem(key, String(value));
|
|
6758
|
+
} catch {
|
|
6759
|
+
}
|
|
6760
|
+
}
|
|
6761
|
+
function SidebarProvider({
|
|
6762
|
+
children,
|
|
6763
|
+
collapsed: collapsedProp,
|
|
6764
|
+
defaultCollapsed = false,
|
|
6765
|
+
onCollapsedChange,
|
|
6766
|
+
storageKey,
|
|
6767
|
+
mobileOpen: mobileOpenProp,
|
|
6768
|
+
defaultMobileOpen = false,
|
|
6769
|
+
onMobileOpenChange
|
|
6770
|
+
}) {
|
|
6771
|
+
const [collapsed, setCollapsedState] = useControllableState({
|
|
6772
|
+
value: collapsedProp,
|
|
6773
|
+
defaultValue: defaultCollapsed,
|
|
6774
|
+
onChange: onCollapsedChange
|
|
6775
|
+
});
|
|
6776
|
+
const [mobileOpen, setMobileOpen] = useControllableState({
|
|
6777
|
+
value: mobileOpenProp,
|
|
6778
|
+
defaultValue: defaultMobileOpen,
|
|
6779
|
+
onChange: onMobileOpenChange
|
|
6780
|
+
});
|
|
6781
|
+
const isMobile = useMediaQuery(MOBILE_QUERY);
|
|
6782
|
+
useEffect10(() => {
|
|
6783
|
+
if (!storageKey) return;
|
|
6784
|
+
const stored = readStored(storageKey);
|
|
6785
|
+
if (stored !== null) setCollapsedState(stored);
|
|
6786
|
+
}, [storageKey, setCollapsedState]);
|
|
6787
|
+
const setCollapsed = useCallback7(
|
|
6788
|
+
(next) => {
|
|
6789
|
+
if (storageKey) writeStored(storageKey, next);
|
|
6790
|
+
setCollapsedState(next);
|
|
6791
|
+
},
|
|
6792
|
+
[storageKey, setCollapsedState]
|
|
6793
|
+
);
|
|
6794
|
+
const value = useMemo11(
|
|
6795
|
+
() => ({
|
|
6796
|
+
collapsed,
|
|
6797
|
+
setCollapsed,
|
|
6798
|
+
toggleCollapsed: () => setCollapsed(!collapsed),
|
|
6799
|
+
mobileOpen,
|
|
6800
|
+
setMobileOpen,
|
|
6801
|
+
isMobile
|
|
6802
|
+
}),
|
|
6803
|
+
[collapsed, setCollapsed, mobileOpen, setMobileOpen, isMobile]
|
|
6804
|
+
);
|
|
6805
|
+
return /* @__PURE__ */ jsx65(SidebarContext.Provider, { value, children });
|
|
6806
|
+
}
|
|
6807
|
+
var DefaultLink = forwardRef27(function DefaultLink2({ children, ...rest }, ref) {
|
|
6808
|
+
return /* @__PURE__ */ jsx65("a", { ref, ...rest, children });
|
|
6809
|
+
});
|
|
6810
|
+
var Row = createContext14(null);
|
|
6811
|
+
function useRow() {
|
|
6812
|
+
const value = useContext14(Row);
|
|
6813
|
+
if (!value) throw new Error("Sidebar rows must be rendered by <Sidebar>");
|
|
6814
|
+
return value;
|
|
6815
|
+
}
|
|
6816
|
+
function Sidebar(props) {
|
|
6817
|
+
const outer = useContext14(SidebarContext);
|
|
6818
|
+
if (outer) return /* @__PURE__ */ jsx65(SidebarRoot, { ...props, context: outer, ownsState: false });
|
|
6490
6819
|
return /* @__PURE__ */ jsx65(
|
|
6491
|
-
|
|
6820
|
+
SidebarProvider,
|
|
6492
6821
|
{
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
),
|
|
6499
|
-
children
|
|
6822
|
+
collapsed: props.collapsed,
|
|
6823
|
+
defaultCollapsed: props.defaultCollapsed,
|
|
6824
|
+
onCollapsedChange: props.onCollapsedChange,
|
|
6825
|
+
storageKey: props.storageKey,
|
|
6826
|
+
children: /* @__PURE__ */ jsx65(SidebarFromContext, { ...props })
|
|
6500
6827
|
}
|
|
6501
6828
|
);
|
|
6502
6829
|
}
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6830
|
+
function SidebarFromContext(props) {
|
|
6831
|
+
return /* @__PURE__ */ jsx65(SidebarRoot, { ...props, context: useSidebar(), ownsState: true });
|
|
6832
|
+
}
|
|
6833
|
+
function SidebarRoot({
|
|
6834
|
+
groups,
|
|
6835
|
+
footerNav,
|
|
6836
|
+
brand,
|
|
6837
|
+
footer,
|
|
6838
|
+
density: densityProp,
|
|
6839
|
+
collapsible = true,
|
|
6840
|
+
collapsed: collapsedProp,
|
|
6841
|
+
onCollapsedChange,
|
|
6842
|
+
onToggle,
|
|
6843
|
+
currentPath,
|
|
6844
|
+
currentHash,
|
|
6845
|
+
linkComponent = DefaultLink,
|
|
6846
|
+
onNavigate,
|
|
6847
|
+
label = "Primary",
|
|
6848
|
+
variant,
|
|
6849
|
+
width = "w-80",
|
|
6850
|
+
collapsedWidth,
|
|
6851
|
+
className,
|
|
6852
|
+
context,
|
|
6853
|
+
ownsState
|
|
6854
|
+
}) {
|
|
6855
|
+
const density = densityProp ?? (variant === "plain" ? "compact" : "comfortable");
|
|
6856
|
+
const asideId = useId18();
|
|
6857
|
+
const { isMobile, setMobileOpen } = context;
|
|
6858
|
+
const collapsed = !isMobile && collapsible && (collapsedProp ?? context.collapsed);
|
|
6859
|
+
const showToggle = collapsible && !isMobile && (collapsedProp === void 0 || onToggle != null || onCollapsedChange != null);
|
|
6860
|
+
const toggle = () => {
|
|
6861
|
+
const next = !collapsed;
|
|
6862
|
+
onToggle?.();
|
|
6863
|
+
if (!ownsState) onCollapsedChange?.(next);
|
|
6864
|
+
context.setCollapsed(next);
|
|
6865
|
+
};
|
|
6866
|
+
const hashTargets = useMemo11(
|
|
6867
|
+
() => new Set(
|
|
6868
|
+
[...groups.flatMap((group) => group.items), ...footerNav ?? []].flatMap((item) => [item, ...item.children ?? []]).map((item) => item.to).filter((to) => to?.includes("#") ?? false)
|
|
6869
|
+
),
|
|
6870
|
+
[groups, footerNav]
|
|
6871
|
+
);
|
|
6872
|
+
const row = useMemo11(
|
|
6873
|
+
() => ({
|
|
6874
|
+
density,
|
|
6875
|
+
collapsed,
|
|
6876
|
+
path: currentPath,
|
|
6877
|
+
hash: currentHash,
|
|
6878
|
+
hashTargets,
|
|
6879
|
+
Link: linkComponent,
|
|
6880
|
+
onNavigate: () => {
|
|
6881
|
+
if (isMobile) setMobileOpen(false);
|
|
6882
|
+
onNavigate?.();
|
|
6883
|
+
}
|
|
6884
|
+
}),
|
|
6885
|
+
[density, collapsed, currentPath, currentHash, hashTargets, linkComponent, isMobile, setMobileOpen, onNavigate]
|
|
6886
|
+
);
|
|
6887
|
+
const state = { collapsed, density };
|
|
6888
|
+
const comfortable = density === "comfortable";
|
|
6889
|
+
const panel = /* @__PURE__ */ jsxs46(
|
|
6890
|
+
"aside",
|
|
6511
6891
|
{
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
"
|
|
6515
|
-
"data-
|
|
6516
|
-
className:
|
|
6517
|
-
"shrink-0 bg-
|
|
6518
|
-
|
|
6892
|
+
id: asideId,
|
|
6893
|
+
"aria-label": label,
|
|
6894
|
+
"data-density": density,
|
|
6895
|
+
"data-collapsed": collapsed || void 0,
|
|
6896
|
+
className: cn(
|
|
6897
|
+
"relative flex h-full shrink-0 flex-col justify-between bg-default-secondary py-2",
|
|
6898
|
+
"transition-[width] duration-200 motion-reduce:transition-none",
|
|
6899
|
+
isMobile ? "w-full" : clsx45(
|
|
6900
|
+
"rounded-xl border-r border-default",
|
|
6901
|
+
collapsed ? collapsedWidth ?? (comfortable ? "w-20" : "w-[72px]") : width
|
|
6902
|
+
),
|
|
6519
6903
|
className
|
|
6520
6904
|
),
|
|
6521
|
-
|
|
6905
|
+
children: [
|
|
6906
|
+
showToggle && /* @__PURE__ */ jsx65(
|
|
6907
|
+
"button",
|
|
6908
|
+
{
|
|
6909
|
+
type: "button",
|
|
6910
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
6911
|
+
"aria-expanded": !collapsed,
|
|
6912
|
+
"aria-controls": asideId,
|
|
6913
|
+
onClick: toggle,
|
|
6914
|
+
className: cn(
|
|
6915
|
+
"absolute -right-3 top-5 z-raised flex size-6 items-center justify-center rounded-full",
|
|
6916
|
+
"border border-default bg-default text-default-secondary",
|
|
6917
|
+
// Not `hover:bg-default-hover` — that is #F5F5F5, exactly the rail colour, and
|
|
6918
|
+
// this button straddles the rail edge, so half of it dissolved into the rail on
|
|
6919
|
+
// hover. Same hover vocabulary as the rows instead.
|
|
6920
|
+
"shadow-100 transition-colors hover:bg-brand-tertiary-hover hover:text-brand",
|
|
6921
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default"
|
|
6922
|
+
),
|
|
6923
|
+
children: collapsed ? /* @__PURE__ */ jsx65(ChevronRightIcon5, { className: "size-3", strokeWidth: 2.5, "aria-hidden": true }) : /* @__PURE__ */ jsx65(ChevronLeftIcon4, { className: "size-3", strokeWidth: 2.5, "aria-hidden": true })
|
|
6924
|
+
}
|
|
6925
|
+
),
|
|
6926
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex min-h-0 flex-1 flex-col gap-1 pb-3", children: [
|
|
6927
|
+
brand && /* @__PURE__ */ jsx65(
|
|
6928
|
+
"div",
|
|
6929
|
+
{
|
|
6930
|
+
className: cn(
|
|
6931
|
+
"flex shrink-0 items-center overflow-hidden p-4",
|
|
6932
|
+
collapsed ? "justify-center" : "gap-2.5"
|
|
6933
|
+
),
|
|
6934
|
+
children: typeof brand === "function" ? brand(state) : brand
|
|
6935
|
+
}
|
|
6936
|
+
),
|
|
6937
|
+
/* @__PURE__ */ jsx65(ScrollArea, { axis: "vertical", label: "Sidebar navigation", className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx65(Row.Provider, { value: row, children: /* @__PURE__ */ jsx65("nav", { "aria-label": "Main", className: cn("flex flex-col px-4", comfortable ? "gap-4 pt-2" : "gap-2"), children: groups.map((group, index) => /* @__PURE__ */ jsx65(SidebarGroupView, { group }, group.id ?? group.title ?? `group-${index}`)) }) }) })
|
|
6938
|
+
] }),
|
|
6939
|
+
(Boolean(footerNav?.length) || footer != null) && /* @__PURE__ */ jsxs46("div", { className: "flex shrink-0 flex-col", children: [
|
|
6940
|
+
footerNav && footerNav.length > 0 && /* @__PURE__ */ jsx65(Row.Provider, { value: row, children: /* @__PURE__ */ jsx65(
|
|
6941
|
+
"nav",
|
|
6942
|
+
{
|
|
6943
|
+
"aria-label": "Secondary",
|
|
6944
|
+
className: cn("flex flex-col px-4 pt-2", comfortable && "gap-1", collapsed && "items-center"),
|
|
6945
|
+
children: footerNav.map((item) => /* @__PURE__ */ jsx65(SidebarRow, { item }, itemKey(item)))
|
|
6946
|
+
}
|
|
6947
|
+
) }),
|
|
6948
|
+
typeof footer === "function" ? footer(state) : footer
|
|
6949
|
+
] })
|
|
6950
|
+
]
|
|
6522
6951
|
}
|
|
6523
6952
|
);
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6953
|
+
if (isMobile) {
|
|
6954
|
+
return /* @__PURE__ */ jsx65(
|
|
6955
|
+
Drawer,
|
|
6956
|
+
{
|
|
6957
|
+
side: "left",
|
|
6958
|
+
open: context.mobileOpen,
|
|
6959
|
+
onOpenChange: setMobileOpen,
|
|
6960
|
+
label,
|
|
6961
|
+
width: "w-80 max-w-[85vw]",
|
|
6962
|
+
className: "bg-default-secondary",
|
|
6963
|
+
children: panel
|
|
6964
|
+
}
|
|
6965
|
+
);
|
|
6966
|
+
}
|
|
6967
|
+
return panel;
|
|
6968
|
+
}
|
|
6969
|
+
function itemKey(item) {
|
|
6970
|
+
return item.id ?? item.to ?? item.href ?? item.label;
|
|
6971
|
+
}
|
|
6972
|
+
function SidebarGroupView({ group }) {
|
|
6973
|
+
const { density, collapsed } = useRow();
|
|
6974
|
+
const [open, setOpen] = useState20(group.defaultOpen ?? true);
|
|
6975
|
+
const regionId = useId18();
|
|
6976
|
+
const foldable = Boolean(group.collapsible && group.title) && !collapsed;
|
|
6977
|
+
const comfortable = density === "comfortable";
|
|
6978
|
+
return (
|
|
6979
|
+
// Figma "Menu Container": 8px above and below; 12px (comfortable) or 8px (compact)
|
|
6980
|
+
// between the heading and the rows; rows 4px apart when comfortable, touching when compact.
|
|
6981
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col py-2", comfortable ? "gap-3" : "gap-2"), children: [
|
|
6982
|
+
group.title && (collapsed ? (
|
|
6983
|
+
// No room in the rail, but still the only thing naming the run of icons below.
|
|
6984
|
+
/* @__PURE__ */ jsx65("p", { className: "sr-only", children: group.title })
|
|
6985
|
+
) : /* @__PURE__ */ jsx65(
|
|
6986
|
+
NavGroupHeader,
|
|
6987
|
+
{
|
|
6988
|
+
title: group.title,
|
|
6989
|
+
action: group.action,
|
|
6990
|
+
...foldable ? { open, onOpenChange: setOpen, controls: regionId } : {}
|
|
6991
|
+
}
|
|
6992
|
+
)),
|
|
6993
|
+
(!foldable || open) && /* @__PURE__ */ jsx65("div", { id: regionId, className: cn("flex flex-col", comfortable && "gap-1", collapsed && "items-center"), children: group.items.map((item) => /* @__PURE__ */ jsx65(SidebarRow, { item }, itemKey(item))) })
|
|
6994
|
+
] })
|
|
6995
|
+
);
|
|
6996
|
+
}
|
|
6997
|
+
function isRowActive(item, row) {
|
|
6998
|
+
if (item.isActive !== void 0) return item.isActive;
|
|
6999
|
+
if (!item.to || row.path === void 0) return false;
|
|
7000
|
+
const [path, hash] = item.to.split("#");
|
|
7001
|
+
const pathMatches = item.end ? row.path === path : row.path === path || row.path.startsWith(`${path.replace(/\/$/, "")}/`);
|
|
7002
|
+
if (!pathMatches) return false;
|
|
7003
|
+
if (hash !== void 0) return row.hash === `#${hash}`;
|
|
7004
|
+
return !row.hashTargets.has(`${row.path}${row.hash ?? ""}`);
|
|
7005
|
+
}
|
|
7006
|
+
function SidebarRow({ item }) {
|
|
7007
|
+
const row = useRow();
|
|
7008
|
+
if (item.children?.length) {
|
|
7009
|
+
return row.collapsed ? /* @__PURE__ */ jsx65(RailParent, { item }) : /* @__PURE__ */ jsx65(ParentRow, { item });
|
|
7010
|
+
}
|
|
7011
|
+
return /* @__PURE__ */ jsx65(LeafRow, { item });
|
|
7012
|
+
}
|
|
7013
|
+
function navigateHandler(row) {
|
|
7014
|
+
return (event) => {
|
|
7015
|
+
if (!event.defaultPrevented) row.onNavigate();
|
|
7016
|
+
};
|
|
7017
|
+
}
|
|
7018
|
+
function LeafRow({ item }) {
|
|
7019
|
+
const row = useRow();
|
|
7020
|
+
const active = isRowActive(item, row);
|
|
7021
|
+
const common = {
|
|
7022
|
+
icon: item.icon,
|
|
7023
|
+
label: item.label,
|
|
7024
|
+
isActive: active,
|
|
7025
|
+
indicator: item.indicator,
|
|
7026
|
+
disabled: item.disabled,
|
|
7027
|
+
collapsed: row.collapsed,
|
|
7028
|
+
density: row.density
|
|
7029
|
+
};
|
|
7030
|
+
let element;
|
|
7031
|
+
if (item.href) {
|
|
7032
|
+
element = /* @__PURE__ */ jsx65(NavItem, { asChild: true, ...common, onClick: navigateHandler(row), children: /* @__PURE__ */ jsx65("a", { href: item.href, target: "_blank", rel: "noreferrer" }) });
|
|
7033
|
+
} else if (item.to) {
|
|
7034
|
+
const { Link } = row;
|
|
7035
|
+
element = /* @__PURE__ */ jsx65(NavItem, { asChild: true, ...common, onClick: navigateHandler(row), children: /* @__PURE__ */ jsx65(Link, { href: item.to }) });
|
|
7036
|
+
} else {
|
|
7037
|
+
return /* @__PURE__ */ jsx65(NavItem, { ...common });
|
|
7038
|
+
}
|
|
7039
|
+
if (!row.collapsed) return element;
|
|
7040
|
+
return /* @__PURE__ */ jsx65(Tooltip, { title: item.label, side: "right", children: element });
|
|
7041
|
+
}
|
|
7042
|
+
function ParentRow({ item }) {
|
|
7043
|
+
const row = useRow();
|
|
7044
|
+
const children = item.children ?? [];
|
|
7045
|
+
const childActive = children.some((child) => isRowActive(child, row));
|
|
7046
|
+
const [open, setOpen] = useState20(item.defaultOpen ?? childActive);
|
|
7047
|
+
const regionId = useId18();
|
|
7048
|
+
useEffect10(() => {
|
|
7049
|
+
if (childActive) setOpen(true);
|
|
7050
|
+
}, [childActive]);
|
|
7051
|
+
return /* @__PURE__ */ jsxs46(Fragment9, { children: [
|
|
7052
|
+
/* @__PURE__ */ jsx65(
|
|
7053
|
+
NavItem,
|
|
7054
|
+
{
|
|
7055
|
+
asChild: true,
|
|
7056
|
+
icon: item.icon,
|
|
7057
|
+
label: item.label,
|
|
7058
|
+
isActive: !open && childActive,
|
|
7059
|
+
indicator: item.indicator,
|
|
7060
|
+
disabled: item.disabled,
|
|
7061
|
+
density: row.density,
|
|
7062
|
+
trailing: /* @__PURE__ */ jsx65(
|
|
7063
|
+
ChevronDownIcon5,
|
|
7064
|
+
{
|
|
7065
|
+
className: cn(
|
|
7066
|
+
"text-icon-default-secondary transition-transform motion-reduce:transition-none",
|
|
7067
|
+
!open && "-rotate-90"
|
|
7068
|
+
)
|
|
7069
|
+
}
|
|
7070
|
+
),
|
|
7071
|
+
children: /* @__PURE__ */ jsx65("button", { type: "button", "aria-expanded": open, "aria-controls": regionId, onClick: () => setOpen(!open) })
|
|
7072
|
+
}
|
|
7073
|
+
),
|
|
7074
|
+
open && /* @__PURE__ */ jsx65("div", { id: regionId, className: "flex flex-col", children: children.map((child, index) => /* @__PURE__ */ jsx65(SubRow, { item: child, last: index === children.length - 1 }, itemKey(child))) })
|
|
7075
|
+
] });
|
|
7076
|
+
}
|
|
7077
|
+
function SubRow({ item, last }) {
|
|
7078
|
+
const row = useRow();
|
|
7079
|
+
const common = {
|
|
7080
|
+
label: item.label,
|
|
7081
|
+
isActive: isRowActive(item, row),
|
|
7082
|
+
disabled: item.disabled,
|
|
7083
|
+
last,
|
|
7084
|
+
density: row.density
|
|
7085
|
+
};
|
|
7086
|
+
if (item.href) {
|
|
7087
|
+
return /* @__PURE__ */ jsx65(NavSubItem, { asChild: true, ...common, onClick: navigateHandler(row), children: /* @__PURE__ */ jsx65("a", { href: item.href, target: "_blank", rel: "noreferrer" }) });
|
|
7088
|
+
}
|
|
7089
|
+
if (item.to) {
|
|
7090
|
+
const { Link } = row;
|
|
7091
|
+
return /* @__PURE__ */ jsx65(NavSubItem, { asChild: true, ...common, onClick: navigateHandler(row), children: /* @__PURE__ */ jsx65(Link, { href: item.to }) });
|
|
7092
|
+
}
|
|
7093
|
+
return /* @__PURE__ */ jsx65(NavSubItem, { ...common });
|
|
7094
|
+
}
|
|
7095
|
+
var FLYOUT_ITEM = clsx45(OVERLAY_ITEM_BASE, OVERLAY_ITEM_SIZE.md, "no-underline");
|
|
7096
|
+
function RailParent({ item }) {
|
|
7097
|
+
const row = useRow();
|
|
7098
|
+
const children = item.children ?? [];
|
|
7099
|
+
const childActive = children.some((child) => isRowActive(child, row));
|
|
7100
|
+
const { Link } = row;
|
|
7101
|
+
return /* @__PURE__ */ jsxs46(DropdownMenu, { children: [
|
|
7102
|
+
/* @__PURE__ */ jsx65(Tooltip, { title: item.label, side: "right", children: /* @__PURE__ */ jsx65(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx65(
|
|
7103
|
+
NavItem,
|
|
7104
|
+
{
|
|
7105
|
+
asChild: true,
|
|
7106
|
+
icon: item.icon,
|
|
7107
|
+
label: item.label,
|
|
7108
|
+
isActive: childActive,
|
|
7109
|
+
indicator: item.indicator,
|
|
7110
|
+
disabled: item.disabled,
|
|
7111
|
+
collapsed: true,
|
|
7112
|
+
density: row.density,
|
|
7113
|
+
children: /* @__PURE__ */ jsx65("button", { type: "button" })
|
|
7114
|
+
}
|
|
7115
|
+
) }) }),
|
|
7116
|
+
/* @__PURE__ */ jsxs46(DropdownMenuContent, { side: "right", align: "start", children: [
|
|
7117
|
+
/* @__PURE__ */ jsx65(DropdownMenuLabel, { children: item.label }),
|
|
7118
|
+
children.map((child) => {
|
|
7119
|
+
const active = isRowActive(child, row);
|
|
7120
|
+
const className = cn(
|
|
7121
|
+
FLYOUT_ITEM,
|
|
7122
|
+
overlayItemTone("default", Boolean(child.disabled)),
|
|
7123
|
+
active && "bg-brand text-brand-on-brand hover:bg-brand-hover focus:bg-brand-hover"
|
|
7124
|
+
);
|
|
7125
|
+
if (!child.to && !child.href) {
|
|
7126
|
+
return /* @__PURE__ */ jsx65(DropdownMenuItem, { disabled: child.disabled, children: child.label }, itemKey(child));
|
|
7127
|
+
}
|
|
7128
|
+
return /* @__PURE__ */ jsx65(
|
|
7129
|
+
DropdownMenuPrimitive.Item,
|
|
7130
|
+
{
|
|
7131
|
+
asChild: true,
|
|
7132
|
+
disabled: child.disabled,
|
|
7133
|
+
className,
|
|
7134
|
+
onSelect: () => row.onNavigate(),
|
|
7135
|
+
children: child.href ? /* @__PURE__ */ jsx65("a", { href: child.href, target: "_blank", rel: "noreferrer", children: child.label }) : /* @__PURE__ */ jsx65(Link, { href: child.to, "aria-current": active ? "page" : void 0, children: child.label })
|
|
7136
|
+
},
|
|
7137
|
+
itemKey(child)
|
|
7138
|
+
);
|
|
7139
|
+
})
|
|
7140
|
+
] })
|
|
7141
|
+
] });
|
|
7142
|
+
}
|
|
7143
|
+
var SidebarTrigger = forwardRef27(function SidebarTrigger2({ "aria-label": ariaLabel = "Open navigation", className, onClick, variant = "subtle", ...rest }, ref) {
|
|
7144
|
+
const { mobileOpen, setMobileOpen } = useSidebar();
|
|
7145
|
+
return /* @__PURE__ */ jsx65(
|
|
7146
|
+
IconButton,
|
|
7147
|
+
{
|
|
7148
|
+
ref,
|
|
7149
|
+
"aria-label": ariaLabel,
|
|
7150
|
+
"aria-expanded": mobileOpen,
|
|
7151
|
+
"aria-haspopup": "dialog",
|
|
7152
|
+
variant,
|
|
7153
|
+
className: cn("md:hidden", className),
|
|
7154
|
+
onClick: (event) => {
|
|
7155
|
+
onClick?.(event);
|
|
7156
|
+
if (!event.defaultPrevented) setMobileOpen(!mobileOpen);
|
|
7157
|
+
},
|
|
7158
|
+
...rest,
|
|
7159
|
+
children: /* @__PURE__ */ jsx65(MenuIcon, { className: "size-5", "aria-hidden": true })
|
|
7160
|
+
}
|
|
7161
|
+
);
|
|
7162
|
+
});
|
|
7163
|
+
function filterNav(groups, isVisible) {
|
|
7164
|
+
return groups.map((group) => ({ ...group, items: filterNavItems(group.items, isVisible) })).filter((group) => group.items.length > 0);
|
|
7165
|
+
}
|
|
7166
|
+
function filterNavItems(items, isVisible) {
|
|
7167
|
+
return items.flatMap((item) => {
|
|
7168
|
+
if (!isVisible(item)) return [];
|
|
7169
|
+
if (!item.children) return [item];
|
|
7170
|
+
const children = filterNavItems(item.children, isVisible);
|
|
7171
|
+
if (children.length === 0 && !item.to && !item.href) return [];
|
|
7172
|
+
return [{ ...item, children }];
|
|
7173
|
+
});
|
|
7174
|
+
}
|
|
7175
|
+
function SidebarSeparator({ className, ...rest }) {
|
|
7176
|
+
return /* @__PURE__ */ jsx65("div", { "aria-hidden": true, className: cn("mx-1 h-px shrink-0 bg-divider", className), ...rest });
|
|
7177
|
+
}
|
|
7178
|
+
function SidebarUserCard({
|
|
7179
|
+
name,
|
|
7180
|
+
role,
|
|
7181
|
+
onLogout,
|
|
7182
|
+
collapsed = false,
|
|
7183
|
+
menu,
|
|
7184
|
+
className
|
|
7185
|
+
}) {
|
|
7186
|
+
const initial = name.trim().charAt(0);
|
|
7187
|
+
const items = /* @__PURE__ */ jsxs46(Fragment9, { children: [
|
|
7188
|
+
menu,
|
|
7189
|
+
/* @__PURE__ */ jsx65(DropdownMenuItem, { icon: /* @__PURE__ */ jsx65(LogOutIcon, { className: "size-3.5", "aria-hidden": true }), onSelect: onLogout, children: "Sign out" })
|
|
7190
|
+
] });
|
|
7191
|
+
if (collapsed) {
|
|
7192
|
+
return (
|
|
7193
|
+
// Figma collapsed user card: the avatar alone, 24px above and 16px below.
|
|
7194
|
+
/* @__PURE__ */ jsx65("div", { className: cn("flex shrink-0 items-center justify-center px-4 pb-4 pt-6", className), children: /* @__PURE__ */ jsxs46(DropdownMenu, { children: [
|
|
7195
|
+
/* @__PURE__ */ jsx65(DropdownMenuTrigger, { asChild: true, label: "User options", children: /* @__PURE__ */ jsx65("button", { type: "button", "aria-label": `${name} \u2014 user options`, className: "rounded-full", children: /* @__PURE__ */ jsx65(Avatar, { initial, size: "lg", shape: "circle" }) }) }),
|
|
7196
|
+
/* @__PURE__ */ jsx65(DropdownMenuContent, { side: "right", align: "end", children: items })
|
|
7197
|
+
] }) })
|
|
7198
|
+
);
|
|
7199
|
+
}
|
|
7200
|
+
return (
|
|
7201
|
+
// Figma: 16px padding, plus 4px more above and below the row inside it.
|
|
7202
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("flex shrink-0 items-center gap-2.5 px-4 py-5", className), children: [
|
|
7203
|
+
/* @__PURE__ */ jsx65(Avatar, { initial, size: "lg", shape: "circle" }),
|
|
7204
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
7205
|
+
/* @__PURE__ */ jsx65("span", { className: "truncate text-body-sm font-semibold leading-snug text-default", children: name }),
|
|
7206
|
+
/* @__PURE__ */ jsx65("span", { className: "truncate text-body-tiny font-regular leading-none text-default-secondary", children: role })
|
|
7207
|
+
] }),
|
|
7208
|
+
/* @__PURE__ */ jsxs46(DropdownMenu, { children: [
|
|
7209
|
+
/* @__PURE__ */ jsx65(DropdownMenuTrigger, { asChild: true, label: "User options", children: /* @__PURE__ */ jsx65(
|
|
7210
|
+
"button",
|
|
7211
|
+
{
|
|
7212
|
+
type: "button",
|
|
7213
|
+
"aria-label": `${name} \u2014 user options`,
|
|
7214
|
+
className: "flex size-6 shrink-0 items-center justify-center rounded-md text-default-secondary transition-colors hover:bg-brand-tertiary-hover hover:text-brand",
|
|
7215
|
+
children: /* @__PURE__ */ jsx65(EllipsisVerticalIcon, { className: "size-5", "aria-hidden": true })
|
|
7216
|
+
}
|
|
7217
|
+
) }),
|
|
7218
|
+
/* @__PURE__ */ jsx65(DropdownMenuContent, { side: "top", align: "end", children: items })
|
|
7219
|
+
] })
|
|
7220
|
+
] })
|
|
7221
|
+
);
|
|
7222
|
+
}
|
|
7223
|
+
|
|
7224
|
+
// src/components/chrome/eyebrow-label.tsx
|
|
7225
|
+
import clsx46 from "clsx";
|
|
7226
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
7227
|
+
function EyebrowLabel({ children, variant = "uppercase", className }) {
|
|
7228
|
+
return /* @__PURE__ */ jsx66(
|
|
7229
|
+
"p",
|
|
7230
|
+
{
|
|
7231
|
+
"data-variant": variant,
|
|
7232
|
+
className: clsx46(
|
|
7233
|
+
"text-body-tiny font-semibold tracking-wide text-default-secondary",
|
|
7234
|
+
variant === "uppercase" && "uppercase",
|
|
7235
|
+
className
|
|
7236
|
+
),
|
|
7237
|
+
children
|
|
7238
|
+
}
|
|
7239
|
+
);
|
|
7240
|
+
}
|
|
7241
|
+
|
|
7242
|
+
// src/components/chrome/separator.tsx
|
|
7243
|
+
import { forwardRef as forwardRef28 } from "react";
|
|
7244
|
+
import clsx47 from "clsx";
|
|
7245
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
7246
|
+
var Separator = forwardRef28(function Separator2({ orientation = "horizontal", decorative = true, className, ...rest }, ref) {
|
|
7247
|
+
return /* @__PURE__ */ jsx67(
|
|
7248
|
+
"div",
|
|
7249
|
+
{
|
|
7250
|
+
ref,
|
|
7251
|
+
role: decorative ? "none" : "separator",
|
|
7252
|
+
"aria-orientation": decorative ? void 0 : orientation,
|
|
7253
|
+
"data-slot": "separator",
|
|
7254
|
+
className: clsx47(
|
|
7255
|
+
"shrink-0 bg-divider",
|
|
7256
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
7257
|
+
className
|
|
7258
|
+
),
|
|
7259
|
+
...rest
|
|
7260
|
+
}
|
|
7261
|
+
);
|
|
7262
|
+
});
|
|
7263
|
+
|
|
7264
|
+
// src/components/chrome/kbd.tsx
|
|
7265
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
7266
|
+
import clsx48 from "clsx";
|
|
7267
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
7268
|
+
var SIZE9 = {
|
|
7269
|
+
sm: "h-4 min-w-4 px-1 text-body-tiny",
|
|
7270
|
+
md: "h-5 min-w-5 px-1.5 text-body-xs"
|
|
7271
|
+
};
|
|
7272
|
+
var Kbd = forwardRef29(function Kbd2({ children, size = "md", className, ...rest }, ref) {
|
|
7273
|
+
return /* @__PURE__ */ jsx68(
|
|
7274
|
+
"kbd",
|
|
7275
|
+
{
|
|
7276
|
+
ref,
|
|
7277
|
+
"data-slot": "kbd",
|
|
7278
|
+
className: clsx48(
|
|
7279
|
+
"inline-flex items-center justify-center rounded border border-default bg-default-secondary",
|
|
7280
|
+
"font-medium tabular-nums text-default-secondary",
|
|
7281
|
+
SIZE9[size],
|
|
7282
|
+
className
|
|
6545
7283
|
),
|
|
6546
7284
|
...rest,
|
|
6547
7285
|
children
|
|
@@ -6551,14 +7289,14 @@ var Kbd = forwardRef27(function Kbd2({ children, size = "md", className, ...rest
|
|
|
6551
7289
|
|
|
6552
7290
|
// src/components/chrome/breadcrumb.tsx
|
|
6553
7291
|
import {
|
|
6554
|
-
Fragment as
|
|
6555
|
-
forwardRef as
|
|
7292
|
+
Fragment as Fragment10,
|
|
7293
|
+
forwardRef as forwardRef30
|
|
6556
7294
|
} from "react";
|
|
6557
|
-
import
|
|
6558
|
-
import { ChevronRightIcon as
|
|
6559
|
-
import { jsx as
|
|
6560
|
-
var Breadcrumb =
|
|
6561
|
-
return /* @__PURE__ */
|
|
7295
|
+
import clsx49 from "clsx";
|
|
7296
|
+
import { ChevronRightIcon as ChevronRightIcon6 } from "lucide-react";
|
|
7297
|
+
import { jsx as jsx69, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
7298
|
+
var Breadcrumb = forwardRef30(function Breadcrumb2({ children, items, renderLink, maxItems, label = "Breadcrumb", className, ...rest }, ref) {
|
|
7299
|
+
return /* @__PURE__ */ jsx69("nav", { ref, "aria-label": label, "data-slot": "breadcrumb", ...rest, children: /* @__PURE__ */ jsx69("ol", { className: clsx49("flex flex-wrap items-center gap-1.5 p-0 text-body-xs", className), children: items ? renderItems(items, renderLink, maxItems) : children }) });
|
|
6562
7300
|
});
|
|
6563
7301
|
function renderItems(items, renderLink, maxItems) {
|
|
6564
7302
|
const last = items.length - 1;
|
|
@@ -6567,21 +7305,21 @@ function renderItems(items, renderLink, maxItems) {
|
|
|
6567
7305
|
return shown.map((index, position) => {
|
|
6568
7306
|
const item = items[index];
|
|
6569
7307
|
const current = item.current ?? index === last;
|
|
6570
|
-
const crumb = !current && renderLink ? /* @__PURE__ */
|
|
6571
|
-
return /* @__PURE__ */
|
|
7308
|
+
const crumb = !current && renderLink ? /* @__PURE__ */ jsx69(BreadcrumbItem, { asChild: true, first: position === 0, children: renderLink(item) }) : /* @__PURE__ */ jsx69(BreadcrumbItem, { href: item.href, current, first: position === 0, children: item.label });
|
|
7309
|
+
return /* @__PURE__ */ jsxs47(Fragment10, { children: [
|
|
6572
7310
|
crumb,
|
|
6573
|
-
collapse && position === 0 && /* @__PURE__ */
|
|
7311
|
+
collapse && position === 0 && /* @__PURE__ */ jsx69(BreadcrumbEllipsis, {})
|
|
6574
7312
|
] }, item.id ?? index);
|
|
6575
7313
|
});
|
|
6576
7314
|
}
|
|
6577
|
-
var BreadcrumbItem =
|
|
7315
|
+
var BreadcrumbItem = forwardRef30(
|
|
6578
7316
|
function BreadcrumbItem2({ children, current = false, asChild = false, first = false, className, ...rest }, ref) {
|
|
6579
|
-
return /* @__PURE__ */
|
|
6580
|
-
!first && /* @__PURE__ */
|
|
6581
|
-
current ? /* @__PURE__ */
|
|
7317
|
+
return /* @__PURE__ */ jsxs47("li", { className: "flex items-center gap-1.5", children: [
|
|
7318
|
+
!first && /* @__PURE__ */ jsx69(ChevronRightIcon6, { "aria-hidden": true, className: "size-3.5 shrink-0 text-icon-default-tertiary" }),
|
|
7319
|
+
current ? /* @__PURE__ */ jsx69("span", { "aria-current": "page", className: clsx49("font-medium text-default", className), children }) : asChild ? /* @__PURE__ */ jsx69(
|
|
6582
7320
|
Slot,
|
|
6583
7321
|
{
|
|
6584
|
-
className:
|
|
7322
|
+
className: clsx49(
|
|
6585
7323
|
"rounded text-default-secondary transition-colors hover:text-brand",
|
|
6586
7324
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
6587
7325
|
className
|
|
@@ -6589,11 +7327,11 @@ var BreadcrumbItem = forwardRef28(
|
|
|
6589
7327
|
...rest,
|
|
6590
7328
|
children
|
|
6591
7329
|
}
|
|
6592
|
-
) : /* @__PURE__ */
|
|
7330
|
+
) : /* @__PURE__ */ jsx69(
|
|
6593
7331
|
"a",
|
|
6594
7332
|
{
|
|
6595
7333
|
ref,
|
|
6596
|
-
className:
|
|
7334
|
+
className: clsx49(
|
|
6597
7335
|
"rounded text-default-secondary transition-colors hover:text-brand",
|
|
6598
7336
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
6599
7337
|
className
|
|
@@ -6605,16 +7343,16 @@ var BreadcrumbItem = forwardRef28(
|
|
|
6605
7343
|
] });
|
|
6606
7344
|
}
|
|
6607
7345
|
);
|
|
6608
|
-
var BreadcrumbEllipsis =
|
|
7346
|
+
var BreadcrumbEllipsis = forwardRef30(
|
|
6609
7347
|
function BreadcrumbEllipsis2({ className, ...rest }, ref) {
|
|
6610
|
-
return /* @__PURE__ */
|
|
6611
|
-
/* @__PURE__ */
|
|
6612
|
-
/* @__PURE__ */
|
|
7348
|
+
return /* @__PURE__ */ jsxs47("li", { className: "flex items-center gap-1.5", children: [
|
|
7349
|
+
/* @__PURE__ */ jsx69(ChevronRightIcon6, { "aria-hidden": true, className: "size-3.5 shrink-0 text-icon-default-tertiary" }),
|
|
7350
|
+
/* @__PURE__ */ jsx69(
|
|
6613
7351
|
"span",
|
|
6614
7352
|
{
|
|
6615
7353
|
ref,
|
|
6616
7354
|
"aria-label": "Collapsed items",
|
|
6617
|
-
className:
|
|
7355
|
+
className: clsx49("px-0.5 text-default-tertiary", className),
|
|
6618
7356
|
...rest,
|
|
6619
7357
|
children: "\u2026"
|
|
6620
7358
|
}
|
|
@@ -6624,15 +7362,15 @@ var BreadcrumbEllipsis = forwardRef28(
|
|
|
6624
7362
|
);
|
|
6625
7363
|
|
|
6626
7364
|
// src/components/chrome/navigation-menu.tsx
|
|
6627
|
-
import { forwardRef as
|
|
6628
|
-
import
|
|
6629
|
-
import { Fragment as
|
|
6630
|
-
var NavigationMenu =
|
|
7365
|
+
import { forwardRef as forwardRef31 } from "react";
|
|
7366
|
+
import clsx50 from "clsx";
|
|
7367
|
+
import { Fragment as Fragment11, jsx as jsx70, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
7368
|
+
var NavigationMenu = forwardRef31(
|
|
6631
7369
|
function NavigationMenu2({ children, orientation = "horizontal", label, className, ...rest }, ref) {
|
|
6632
|
-
return /* @__PURE__ */
|
|
7370
|
+
return /* @__PURE__ */ jsx70("nav", { ref, "aria-label": label, "data-slot": "navigation-menu", ...rest, children: /* @__PURE__ */ jsx70(
|
|
6633
7371
|
"ul",
|
|
6634
7372
|
{
|
|
6635
|
-
className:
|
|
7373
|
+
className: clsx50(
|
|
6636
7374
|
"flex list-none p-0",
|
|
6637
7375
|
orientation === "vertical" ? "flex-col gap-1" : "flex-row items-center gap-1",
|
|
6638
7376
|
className
|
|
@@ -6642,21 +7380,21 @@ var NavigationMenu = forwardRef29(
|
|
|
6642
7380
|
) });
|
|
6643
7381
|
}
|
|
6644
7382
|
);
|
|
6645
|
-
var NavigationMenuItem =
|
|
7383
|
+
var NavigationMenuItem = forwardRef31(
|
|
6646
7384
|
function NavigationMenuItem2({ children, active = false, variant = "pill", asChild = false, icon, className, ...rest }, ref) {
|
|
6647
|
-
const content = /* @__PURE__ */
|
|
6648
|
-
icon && /* @__PURE__ */
|
|
6649
|
-
/* @__PURE__ */
|
|
7385
|
+
const content = /* @__PURE__ */ jsxs48(Fragment11, { children: [
|
|
7386
|
+
icon && /* @__PURE__ */ jsx70("span", { "aria-hidden": true, className: "shrink-0 [&_svg]:size-4", children: icon }),
|
|
7387
|
+
/* @__PURE__ */ jsx70("span", { className: "min-w-0 truncate", children })
|
|
6650
7388
|
] });
|
|
6651
7389
|
const linkProps = {
|
|
6652
7390
|
"aria-current": active ? "page" : void 0,
|
|
6653
|
-
className:
|
|
7391
|
+
className: clsx50(
|
|
6654
7392
|
"inline-flex items-center gap-2 whitespace-nowrap transition-colors",
|
|
6655
7393
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
6656
|
-
variant === "pill" ?
|
|
7394
|
+
variant === "pill" ? clsx50(
|
|
6657
7395
|
"rounded-lg px-3 py-1.5 text-body-xs font-medium",
|
|
6658
7396
|
active ? "bg-brand text-brand-on-brand" : "text-default-secondary hover:bg-default-secondary hover:text-default"
|
|
6659
|
-
) :
|
|
7397
|
+
) : clsx50(
|
|
6660
7398
|
"rounded px-1 py-0.5 text-body-sm",
|
|
6661
7399
|
active ? "font-semibold text-brand" : "text-default-secondary hover:text-default"
|
|
6662
7400
|
),
|
|
@@ -6664,14 +7402,14 @@ var NavigationMenuItem = forwardRef29(
|
|
|
6664
7402
|
),
|
|
6665
7403
|
...rest
|
|
6666
7404
|
};
|
|
6667
|
-
return /* @__PURE__ */
|
|
7405
|
+
return /* @__PURE__ */ jsx70("li", { children: asChild ? /* @__PURE__ */ jsx70(Slot, { wrapChildren: () => content, ...linkProps, children }) : /* @__PURE__ */ jsx70("a", { ref, ...linkProps, children: content }) });
|
|
6668
7406
|
}
|
|
6669
7407
|
);
|
|
6670
7408
|
|
|
6671
7409
|
// src/components/chrome/typography.tsx
|
|
6672
|
-
import { forwardRef as
|
|
6673
|
-
import
|
|
6674
|
-
import { jsx as
|
|
7410
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
7411
|
+
import clsx51 from "clsx";
|
|
7412
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
6675
7413
|
var TONE2 = {
|
|
6676
7414
|
default: "text-default",
|
|
6677
7415
|
muted: "text-default-secondary",
|
|
@@ -6682,9 +7420,9 @@ var TONE2 = {
|
|
|
6682
7420
|
danger: "text-danger"
|
|
6683
7421
|
};
|
|
6684
7422
|
function textComponent(displayName, defaultElement, classes) {
|
|
6685
|
-
const Component2 =
|
|
7423
|
+
const Component2 = forwardRef32(function TextComponent({ children, asChild = false, tone, className, ...rest }, ref) {
|
|
6686
7424
|
const Root = asChild ? Slot : defaultElement;
|
|
6687
|
-
return /* @__PURE__ */
|
|
7425
|
+
return /* @__PURE__ */ jsx71(
|
|
6688
7426
|
Root,
|
|
6689
7427
|
{
|
|
6690
7428
|
ref,
|
|
@@ -6714,8 +7452,8 @@ var TitlePage = textComponent("TitlePage", "h1", "text-title font-bold text-defa
|
|
|
6714
7452
|
var Subtitle = textComponent("Subtitle", "p", "text-subtitle text-default-secondary");
|
|
6715
7453
|
var Heading = textComponent("Heading", "h2", "text-heading font-semibold text-default");
|
|
6716
7454
|
var Subheading = textComponent("Subheading", "h3", "text-subheading text-default");
|
|
6717
|
-
var Blockquote =
|
|
6718
|
-
return /* @__PURE__ */
|
|
7455
|
+
var Blockquote = forwardRef32(function Blockquote2({ children, cite, tone, className, ...rest }, ref) {
|
|
7456
|
+
return /* @__PURE__ */ jsx71(
|
|
6719
7457
|
"blockquote",
|
|
6720
7458
|
{
|
|
6721
7459
|
ref,
|
|
@@ -6731,15 +7469,20 @@ var Blockquote = forwardRef30(function Blockquote2({ children, cite, tone, class
|
|
|
6731
7469
|
}
|
|
6732
7470
|
);
|
|
6733
7471
|
});
|
|
6734
|
-
var
|
|
7472
|
+
var TEXT_LINK_TONE = {
|
|
7473
|
+
brand: "text-brand underline decoration-1 hover:text-brand-secondary",
|
|
7474
|
+
neutral: "text-default no-underline decoration-1 hover:underline"
|
|
7475
|
+
};
|
|
7476
|
+
var TextLink = forwardRef32(function TextLink2({ children, asChild = false, tone = "brand", className, ...rest }, ref) {
|
|
6735
7477
|
const Root = asChild ? Slot : "a";
|
|
6736
|
-
return /* @__PURE__ */
|
|
7478
|
+
return /* @__PURE__ */ jsx71(
|
|
6737
7479
|
Root,
|
|
6738
7480
|
{
|
|
6739
7481
|
ref,
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
"
|
|
7482
|
+
"data-tone": tone,
|
|
7483
|
+
className: clsx51(
|
|
7484
|
+
"rounded underline-offset-2 transition-colors",
|
|
7485
|
+
TEXT_LINK_TONE[tone],
|
|
6743
7486
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
6744
7487
|
className
|
|
6745
7488
|
),
|
|
@@ -6753,13 +7496,13 @@ var LIST_MARKER = {
|
|
|
6753
7496
|
numbered: "list-decimal pl-5",
|
|
6754
7497
|
plain: "list-none pl-0"
|
|
6755
7498
|
};
|
|
6756
|
-
var TextList =
|
|
7499
|
+
var TextList = forwardRef32(function TextList2({ children, variant = "bulleted", density = "default", className, ...rest }, ref) {
|
|
6757
7500
|
const Root = variant === "numbered" ? "ol" : "ul";
|
|
6758
|
-
return /* @__PURE__ */
|
|
7501
|
+
return /* @__PURE__ */ jsx71(
|
|
6759
7502
|
Root,
|
|
6760
7503
|
{
|
|
6761
7504
|
ref,
|
|
6762
|
-
className:
|
|
7505
|
+
className: clsx51(
|
|
6763
7506
|
"text-body text-default",
|
|
6764
7507
|
LIST_MARKER[variant],
|
|
6765
7508
|
density === "compact" ? "space-y-0.5" : "space-y-1.5",
|
|
@@ -6770,17 +7513,17 @@ var TextList = forwardRef30(function TextList2({ children, variant = "bulleted",
|
|
|
6770
7513
|
}
|
|
6771
7514
|
);
|
|
6772
7515
|
});
|
|
6773
|
-
var TextListItem =
|
|
6774
|
-
return /* @__PURE__ */
|
|
7516
|
+
var TextListItem = forwardRef32(function TextListItem2({ children, className, ...rest }, ref) {
|
|
7517
|
+
return /* @__PURE__ */ jsx71("li", { ref, className: clsx51("text-body text-default", className), ...rest, children });
|
|
6775
7518
|
});
|
|
6776
7519
|
|
|
6777
7520
|
// src/components/widgets/widget-header.tsx
|
|
6778
|
-
import { createContext as
|
|
6779
|
-
import
|
|
7521
|
+
import { createContext as createContext15, useContext as useContext15 } from "react";
|
|
7522
|
+
import clsx53 from "clsx";
|
|
6780
7523
|
|
|
6781
7524
|
// src/components/widgets/widget-title.tsx
|
|
6782
|
-
import
|
|
6783
|
-
import { jsx as
|
|
7525
|
+
import clsx52 from "clsx";
|
|
7526
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
6784
7527
|
var sizeStyles4 = {
|
|
6785
7528
|
sm: "text-subheading-sm font-semibold leading-none",
|
|
6786
7529
|
// Was `text-[18px]`, which had no step on the type scale (Scale 04 = 16, Scale 05 = 20).
|
|
@@ -6790,17 +7533,17 @@ var sizeStyles4 = {
|
|
|
6790
7533
|
lg: "text-subheading font-semibold leading-[1.2]"
|
|
6791
7534
|
};
|
|
6792
7535
|
function WidgetTitle({ children, size = "sm", className }) {
|
|
6793
|
-
return /* @__PURE__ */
|
|
7536
|
+
return /* @__PURE__ */ jsx72("h3", { className: clsx52(sizeStyles4[size], "text-default", className), children });
|
|
6794
7537
|
}
|
|
6795
7538
|
|
|
6796
7539
|
// src/components/widgets/widget-header.tsx
|
|
6797
|
-
import { jsx as
|
|
6798
|
-
var WidgetHeaderAccessoryContext =
|
|
7540
|
+
import { jsx as jsx73, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
7541
|
+
var WidgetHeaderAccessoryContext = createContext15(null);
|
|
6799
7542
|
function WidgetHeaderAccessoryProvider({ accessory, children }) {
|
|
6800
|
-
return /* @__PURE__ */
|
|
7543
|
+
return /* @__PURE__ */ jsx73(WidgetHeaderAccessoryContext.Provider, { value: accessory, children });
|
|
6801
7544
|
}
|
|
6802
7545
|
function useWidgetHeaderAccessory() {
|
|
6803
|
-
return
|
|
7546
|
+
return useContext15(WidgetHeaderAccessoryContext);
|
|
6804
7547
|
}
|
|
6805
7548
|
var eyebrowStyles = {
|
|
6806
7549
|
uppercase: "text-body-tiny font-medium uppercase tracking-[0.66px] text-default-secondary",
|
|
@@ -6819,13 +7562,13 @@ function WidgetHeader({
|
|
|
6819
7562
|
}) {
|
|
6820
7563
|
const provided = useWidgetHeaderAccessory();
|
|
6821
7564
|
const accessory = accessoryProp !== void 0 ? accessoryProp : provided;
|
|
6822
|
-
return /* @__PURE__ */
|
|
6823
|
-
/* @__PURE__ */
|
|
6824
|
-
eyebrow && /* @__PURE__ */
|
|
6825
|
-
/* @__PURE__ */
|
|
6826
|
-
subtitle && /* @__PURE__ */
|
|
7565
|
+
return /* @__PURE__ */ jsxs49("div", { className: clsx53("flex items-start justify-between gap-2", className), children: [
|
|
7566
|
+
/* @__PURE__ */ jsxs49("div", { className: "min-w-0 flex-1", children: [
|
|
7567
|
+
eyebrow && /* @__PURE__ */ jsx73("p", { className: eyebrowStyles[eyebrowVariant], children: eyebrow }),
|
|
7568
|
+
/* @__PURE__ */ jsx73(WidgetTitle, { size: titleSize, children: title }),
|
|
7569
|
+
subtitle && /* @__PURE__ */ jsx73("p", { className: "mt-1 text-body-xs text-default-secondary leading-snug", children: subtitle })
|
|
6827
7570
|
] }),
|
|
6828
|
-
/* @__PURE__ */
|
|
7571
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
6829
7572
|
badge,
|
|
6830
7573
|
action,
|
|
6831
7574
|
accessory
|
|
@@ -6834,24 +7577,24 @@ function WidgetHeader({
|
|
|
6834
7577
|
}
|
|
6835
7578
|
|
|
6836
7579
|
// src/components/widgets/widget-footer.tsx
|
|
6837
|
-
import
|
|
6838
|
-
import { jsx as
|
|
7580
|
+
import clsx54 from "clsx";
|
|
7581
|
+
import { jsx as jsx74, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
6839
7582
|
function WidgetFooter({ caption, subcaption, action, className }) {
|
|
6840
|
-
return /* @__PURE__ */
|
|
6841
|
-
caption && /* @__PURE__ */
|
|
6842
|
-
/* @__PURE__ */
|
|
6843
|
-
/* @__PURE__ */
|
|
6844
|
-
/* @__PURE__ */
|
|
6845
|
-
subcaption && /* @__PURE__ */
|
|
7583
|
+
return /* @__PURE__ */ jsxs50("div", { className: clsx54("flex items-center gap-3", className), children: [
|
|
7584
|
+
caption && /* @__PURE__ */ jsxs50("div", { className: "flex items-stretch gap-3 flex-1 min-w-0", children: [
|
|
7585
|
+
/* @__PURE__ */ jsx74("div", { className: "w-0.5 shrink-0 self-stretch rounded-full bg-brand" }),
|
|
7586
|
+
/* @__PURE__ */ jsxs50("div", { className: "min-w-0", children: [
|
|
7587
|
+
/* @__PURE__ */ jsx74("p", { className: "text-body-sm font-medium text-default leading-snug", children: caption }),
|
|
7588
|
+
subcaption && /* @__PURE__ */ jsx74("p", { className: "mt-0.5 text-body-xs text-default-secondary", children: subcaption })
|
|
6846
7589
|
] })
|
|
6847
7590
|
] }),
|
|
6848
|
-
action && /* @__PURE__ */
|
|
7591
|
+
action && /* @__PURE__ */ jsx74("div", { className: "ml-auto shrink-0", children: action })
|
|
6849
7592
|
] });
|
|
6850
7593
|
}
|
|
6851
7594
|
|
|
6852
7595
|
// src/components/widgets/widget-grid.tsx
|
|
6853
|
-
import
|
|
6854
|
-
import { jsx as
|
|
7596
|
+
import clsx55 from "clsx";
|
|
7597
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
6855
7598
|
var COL_SPAN = {
|
|
6856
7599
|
tiny: "col-span-6 lg:col-span-3",
|
|
6857
7600
|
small: "col-span-12 lg:col-span-4",
|
|
@@ -6870,18 +7613,18 @@ var HEIGHT_PX = {
|
|
|
6870
7613
|
large: 752
|
|
6871
7614
|
};
|
|
6872
7615
|
function WidgetGrid({ children, className }) {
|
|
6873
|
-
return /* @__PURE__ */
|
|
7616
|
+
return /* @__PURE__ */ jsx75("div", { className: cn("flex w-full flex-col gap-3 lg:gap-6", className), children });
|
|
6874
7617
|
}
|
|
6875
7618
|
function WidgetGridRow({ children, className }) {
|
|
6876
|
-
return /* @__PURE__ */
|
|
7619
|
+
return /* @__PURE__ */ jsx75("div", { className: cn("grid grid-cols-12 items-start gap-3 lg:gap-6", className), children });
|
|
6877
7620
|
}
|
|
6878
7621
|
function WidgetGridItem({ size, height, className, ...rest }) {
|
|
6879
|
-
return /* @__PURE__ */
|
|
7622
|
+
return /* @__PURE__ */ jsx75(
|
|
6880
7623
|
"div",
|
|
6881
7624
|
{
|
|
6882
7625
|
"data-size": size,
|
|
6883
7626
|
"data-height": height,
|
|
6884
|
-
className: cn(COL_SPAN[size], height &&
|
|
7627
|
+
className: cn(COL_SPAN[size], height && clsx55(HEIGHT_CLASS[height], "min-h-0"), className),
|
|
6885
7628
|
...rest
|
|
6886
7629
|
}
|
|
6887
7630
|
);
|
|
@@ -6944,12 +7687,12 @@ function slotWidthPx(gridWidthPx, columnGapPx, cols) {
|
|
|
6944
7687
|
}
|
|
6945
7688
|
|
|
6946
7689
|
// src/lib/use-width-tier.ts
|
|
6947
|
-
import { useCallback as
|
|
6948
|
-
var useIsomorphicLayoutEffect = typeof window === "undefined" ?
|
|
7690
|
+
import { useCallback as useCallback8, useEffect as useEffect11, useLayoutEffect as useLayoutEffect3, useRef as useRef14, useState as useState21 } from "react";
|
|
7691
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect11 : useLayoutEffect3;
|
|
6949
7692
|
var TIER_SETTLE_MS = 200;
|
|
6950
7693
|
function useWidthTier({ frozen = false } = {}) {
|
|
6951
|
-
const [node, setNode] =
|
|
6952
|
-
const [{ widthPx, tier }, setMeasured] =
|
|
7694
|
+
const [node, setNode] = useState21(null);
|
|
7695
|
+
const [{ widthPx, tier }, setMeasured] = useState21({
|
|
6953
7696
|
widthPx: null,
|
|
6954
7697
|
tier: "wide"
|
|
6955
7698
|
});
|
|
@@ -6960,7 +7703,7 @@ function useWidthTier({ frozen = false } = {}) {
|
|
|
6960
7703
|
tierRef.current = tier;
|
|
6961
7704
|
const widthRef = useRef14(widthPx);
|
|
6962
7705
|
widthRef.current = widthPx;
|
|
6963
|
-
const commit =
|
|
7706
|
+
const commit = useCallback8(() => {
|
|
6964
7707
|
const raw = observed.current;
|
|
6965
7708
|
if (raw === null || raw <= 0 || frozenRef.current) return;
|
|
6966
7709
|
const next = quantizeWidth(raw);
|
|
@@ -6992,15 +7735,15 @@ function useWidthTier({ frozen = false } = {}) {
|
|
|
6992
7735
|
if (timer) clearTimeout(timer);
|
|
6993
7736
|
};
|
|
6994
7737
|
}, [node, commit]);
|
|
6995
|
-
|
|
7738
|
+
useEffect11(() => {
|
|
6996
7739
|
if (!frozen) commit();
|
|
6997
7740
|
}, [frozen, commit]);
|
|
6998
7741
|
return { ref: setNode, widthPx, tier };
|
|
6999
7742
|
}
|
|
7000
7743
|
|
|
7001
7744
|
// src/components/stats/stat-tile.tsx
|
|
7002
|
-
import
|
|
7003
|
-
import { Fragment as
|
|
7745
|
+
import clsx56 from "clsx";
|
|
7746
|
+
import { Fragment as Fragment12, jsx as jsx76, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
7004
7747
|
var DOT_TONE = {
|
|
7005
7748
|
neutral: "bg-status-dot-neutral",
|
|
7006
7749
|
info: "bg-status-dot-info",
|
|
@@ -7025,20 +7768,20 @@ function StatTile({
|
|
|
7025
7768
|
}) {
|
|
7026
7769
|
const showDot = Boolean(tone || dotColor);
|
|
7027
7770
|
const interactive = Boolean(onClick) || asChild;
|
|
7028
|
-
const content = /* @__PURE__ */
|
|
7029
|
-
/* @__PURE__ */
|
|
7030
|
-
showDot && /* @__PURE__ */
|
|
7771
|
+
const content = /* @__PURE__ */ jsxs51(Fragment12, { children: [
|
|
7772
|
+
/* @__PURE__ */ jsxs51("span", { className: "flex items-center gap-1.5", children: [
|
|
7773
|
+
showDot && /* @__PURE__ */ jsx76(
|
|
7031
7774
|
"span",
|
|
7032
7775
|
{
|
|
7033
7776
|
"aria-hidden": true,
|
|
7034
|
-
className:
|
|
7777
|
+
className: clsx56("size-2 shrink-0 rounded-full", tone && DOT_TONE[tone]),
|
|
7035
7778
|
style: tone ? void 0 : { backgroundColor: dotColor }
|
|
7036
7779
|
}
|
|
7037
7780
|
),
|
|
7038
|
-
/* @__PURE__ */
|
|
7781
|
+
/* @__PURE__ */ jsx76("span", { className: "text-body-xs font-medium text-default-secondary whitespace-nowrap", children: label })
|
|
7039
7782
|
] }),
|
|
7040
|
-
/* @__PURE__ */
|
|
7041
|
-
hint && /* @__PURE__ */
|
|
7783
|
+
/* @__PURE__ */ jsx76("span", { className: "text-heading font-semibold text-default leading-none", children: value }),
|
|
7784
|
+
hint && /* @__PURE__ */ jsx76("span", { className: "text-body-tiny text-default-secondary", children: hint })
|
|
7042
7785
|
] });
|
|
7043
7786
|
const rootProps = {
|
|
7044
7787
|
"data-state": selected ? "selected" : void 0,
|
|
@@ -7053,18 +7796,18 @@ function StatTile({
|
|
|
7053
7796
|
return (
|
|
7054
7797
|
// A link to a filtered view is the current one, not a pressed toggle: `aria-pressed` is
|
|
7055
7798
|
// only valid on a button.
|
|
7056
|
-
/* @__PURE__ */
|
|
7799
|
+
/* @__PURE__ */ jsx76(Slot, { ...rootProps, "aria-current": selected ? "true" : void 0, wrapChildren: () => content, children })
|
|
7057
7800
|
);
|
|
7058
7801
|
}
|
|
7059
7802
|
if (onClick) {
|
|
7060
|
-
return /* @__PURE__ */
|
|
7803
|
+
return /* @__PURE__ */ jsx76("button", { type: "button", "aria-pressed": selected ?? false, onClick, ...rootProps, children: content });
|
|
7061
7804
|
}
|
|
7062
|
-
return /* @__PURE__ */
|
|
7805
|
+
return /* @__PURE__ */ jsx76("div", { ...rootProps, children: content });
|
|
7063
7806
|
}
|
|
7064
7807
|
|
|
7065
7808
|
// src/components/stats/stat-number.tsx
|
|
7066
|
-
import
|
|
7067
|
-
import { jsx as
|
|
7809
|
+
import clsx57 from "clsx";
|
|
7810
|
+
import { jsx as jsx77, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
7068
7811
|
var sizeStyles5 = {
|
|
7069
7812
|
sm: "text-subtitle",
|
|
7070
7813
|
md: "text-subtitle-lg",
|
|
@@ -7075,22 +7818,22 @@ var weightStyles = {
|
|
|
7075
7818
|
bold: "font-bold"
|
|
7076
7819
|
};
|
|
7077
7820
|
function StatNumber({ value, unit, size = "md", weight = "bold", color, className }) {
|
|
7078
|
-
return /* @__PURE__ */
|
|
7821
|
+
return /* @__PURE__ */ jsxs52(
|
|
7079
7822
|
"p",
|
|
7080
7823
|
{
|
|
7081
|
-
className:
|
|
7824
|
+
className: clsx57(sizeStyles5[size], weightStyles[weight], "leading-none", !color && "text-default", className),
|
|
7082
7825
|
style: color ? { color } : void 0,
|
|
7083
7826
|
children: [
|
|
7084
7827
|
value,
|
|
7085
|
-
unit && /* @__PURE__ */
|
|
7828
|
+
unit && /* @__PURE__ */ jsx77("span", { className: "ml-1 text-subheading font-medium text-default-secondary", children: unit })
|
|
7086
7829
|
]
|
|
7087
7830
|
}
|
|
7088
7831
|
);
|
|
7089
7832
|
}
|
|
7090
7833
|
|
|
7091
7834
|
// src/components/stats/score-value.tsx
|
|
7092
|
-
import
|
|
7093
|
-
import { jsx as
|
|
7835
|
+
import clsx58 from "clsx";
|
|
7836
|
+
import { jsx as jsx78, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
7094
7837
|
var DEFAULT_SCORE_THRESHOLDS = { danger: 80, warning: 65, neutral: 50 };
|
|
7095
7838
|
function getScoreTone(score, {
|
|
7096
7839
|
direction = "higher-is-worse",
|
|
@@ -7134,15 +7877,15 @@ function ScoreValue({
|
|
|
7134
7877
|
}) {
|
|
7135
7878
|
const numeric = typeof value === "number" ? value : Number(value);
|
|
7136
7879
|
const resolved = tone === "auto" ? Number.isFinite(numeric) ? getScoreTone(numeric, { direction, thresholds }) : "default" : tone;
|
|
7137
|
-
return /* @__PURE__ */
|
|
7138
|
-
/* @__PURE__ */
|
|
7139
|
-
label && /* @__PURE__ */
|
|
7880
|
+
return /* @__PURE__ */ jsxs53("span", { "data-tone": resolved, className: clsx58("inline-flex items-baseline gap-1", className), children: [
|
|
7881
|
+
/* @__PURE__ */ jsx78("span", { className: clsx58(SIZE10[size], WEIGHT[weight], TONE3[resolved]), children: value }),
|
|
7882
|
+
label && /* @__PURE__ */ jsx78("span", { className: "text-body-xs text-default-secondary whitespace-nowrap", children: label })
|
|
7140
7883
|
] });
|
|
7141
7884
|
}
|
|
7142
7885
|
|
|
7143
7886
|
// src/components/stats/tile-grid.tsx
|
|
7144
|
-
import
|
|
7145
|
-
import { jsx as
|
|
7887
|
+
import clsx59 from "clsx";
|
|
7888
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
7146
7889
|
var COLUMNS2 = {
|
|
7147
7890
|
sm: {
|
|
7148
7891
|
2: "grid-cols-2",
|
|
@@ -7172,7 +7915,7 @@ function TileGrid({
|
|
|
7172
7915
|
at = "lg",
|
|
7173
7916
|
className
|
|
7174
7917
|
}) {
|
|
7175
|
-
return /* @__PURE__ */
|
|
7918
|
+
return /* @__PURE__ */ jsx79("div", { className: clsx59("grid gap-3", COLUMNS2[at][columns], className), children });
|
|
7176
7919
|
}
|
|
7177
7920
|
|
|
7178
7921
|
// src/components/charts/chart-tone.ts
|
|
@@ -7193,8 +7936,8 @@ function resolveChartColor(color, tone, index = 0) {
|
|
|
7193
7936
|
}
|
|
7194
7937
|
|
|
7195
7938
|
// src/components/charts/bar-chart.tsx
|
|
7196
|
-
import
|
|
7197
|
-
import { jsx as
|
|
7939
|
+
import clsx60 from "clsx";
|
|
7940
|
+
import { jsx as jsx80, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
7198
7941
|
var SIZE11 = {
|
|
7199
7942
|
sm: { band: 14, gap: 6, label: "text-body-tiny" },
|
|
7200
7943
|
md: { band: 20, gap: 8, label: "text-body-xs" },
|
|
@@ -7221,10 +7964,10 @@ function BarChart({
|
|
|
7221
7964
|
);
|
|
7222
7965
|
const max = Math.max(...categoryTotals, 1);
|
|
7223
7966
|
const horizontal = orientation === "horizontal";
|
|
7224
|
-
return /* @__PURE__ */
|
|
7967
|
+
return /* @__PURE__ */ jsx80(
|
|
7225
7968
|
"div",
|
|
7226
7969
|
{
|
|
7227
|
-
className:
|
|
7970
|
+
className: clsx60("flex w-full min-w-0", horizontal ? "flex-col gap-2" : "flex-row items-end gap-3", className),
|
|
7228
7971
|
role: label ? "img" : void 0,
|
|
7229
7972
|
"aria-label": label,
|
|
7230
7973
|
"aria-hidden": label ? void 0 : true,
|
|
@@ -7234,23 +7977,23 @@ function BarChart({
|
|
|
7234
7977
|
value: Math.max(0, s.values[ci] ?? 0),
|
|
7235
7978
|
color: resolveChartColor(s.color, s.tone, si)
|
|
7236
7979
|
}));
|
|
7237
|
-
return /* @__PURE__ */
|
|
7980
|
+
return /* @__PURE__ */ jsxs54(
|
|
7238
7981
|
"div",
|
|
7239
7982
|
{
|
|
7240
|
-
className:
|
|
7983
|
+
className: clsx60("flex min-w-0", horizontal ? "flex-col gap-1" : "h-full flex-col justify-end gap-1.5"),
|
|
7241
7984
|
style: horizontal ? void 0 : { width: perCategory },
|
|
7242
7985
|
children: [
|
|
7243
|
-
showLabels && horizontal && /* @__PURE__ */
|
|
7244
|
-
/* @__PURE__ */
|
|
7986
|
+
showLabels && horizontal && /* @__PURE__ */ jsx80("span", { className: clsx60("truncate text-default-secondary", labelClass2), children: category }),
|
|
7987
|
+
/* @__PURE__ */ jsxs54(
|
|
7245
7988
|
"div",
|
|
7246
7989
|
{
|
|
7247
|
-
className:
|
|
7990
|
+
className: clsx60("flex", horizontal ? "items-center gap-2" : "w-full flex-1 items-end justify-center"),
|
|
7248
7991
|
style: horizontal ? void 0 : { height: length },
|
|
7249
7992
|
children: [
|
|
7250
|
-
/* @__PURE__ */
|
|
7993
|
+
/* @__PURE__ */ jsx80(
|
|
7251
7994
|
"div",
|
|
7252
7995
|
{
|
|
7253
|
-
className:
|
|
7996
|
+
className: clsx60("flex min-w-0", stacked ? "gap-0" : ""),
|
|
7254
7997
|
style: horizontal ? { width: length, flexDirection: stacked ? "row" : "column", gap: stacked ? 0 : gap } : {
|
|
7255
7998
|
height: "100%",
|
|
7256
7999
|
width: perCategory,
|
|
@@ -7260,7 +8003,7 @@ function BarChart({
|
|
|
7260
8003
|
},
|
|
7261
8004
|
children: bars.map((bar) => {
|
|
7262
8005
|
const extent = `${bar.value / max * 100}%`;
|
|
7263
|
-
return /* @__PURE__ */
|
|
8006
|
+
return /* @__PURE__ */ jsx80(
|
|
7264
8007
|
"div",
|
|
7265
8008
|
{
|
|
7266
8009
|
title: `${category} \xB7 ${bar.key}: ${bar.value}`,
|
|
@@ -7276,11 +8019,11 @@ function BarChart({
|
|
|
7276
8019
|
})
|
|
7277
8020
|
}
|
|
7278
8021
|
),
|
|
7279
|
-
showValues && horizontal && /* @__PURE__ */
|
|
8022
|
+
showValues && horizontal && /* @__PURE__ */ jsx80("span", { className: clsx60("shrink-0 tabular-nums text-default-secondary", labelClass2), children: categoryTotals[ci] })
|
|
7280
8023
|
]
|
|
7281
8024
|
}
|
|
7282
8025
|
),
|
|
7283
|
-
showLabels && !horizontal && /* @__PURE__ */
|
|
8026
|
+
showLabels && !horizontal && /* @__PURE__ */ jsx80("span", { className: clsx60("truncate text-center text-default-secondary", labelClass2), children: category })
|
|
7284
8027
|
]
|
|
7285
8028
|
},
|
|
7286
8029
|
category
|
|
@@ -7291,8 +8034,8 @@ function BarChart({
|
|
|
7291
8034
|
}
|
|
7292
8035
|
|
|
7293
8036
|
// src/components/charts/donut-chart.tsx
|
|
7294
|
-
import
|
|
7295
|
-
import { jsx as
|
|
8037
|
+
import clsx61 from "clsx";
|
|
8038
|
+
import { jsx as jsx81, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
7296
8039
|
var SIZE12 = {
|
|
7297
8040
|
sm: { box: 88, thickness: 10 },
|
|
7298
8041
|
md: { box: 128, thickness: 14 },
|
|
@@ -7316,8 +8059,8 @@ function DonutChart({
|
|
|
7316
8059
|
const visible = segments.filter((s) => s.value > 0);
|
|
7317
8060
|
const gapLength = visible.length > 1 ? gap / 360 * circumference : 0;
|
|
7318
8061
|
let offset = 0;
|
|
7319
|
-
return /* @__PURE__ */
|
|
7320
|
-
/* @__PURE__ */
|
|
8062
|
+
return /* @__PURE__ */ jsxs55("div", { className: clsx61("relative inline-flex shrink-0 items-center justify-center", className), children: [
|
|
8063
|
+
/* @__PURE__ */ jsxs55(
|
|
7321
8064
|
"svg",
|
|
7322
8065
|
{
|
|
7323
8066
|
width: box,
|
|
@@ -7328,7 +8071,7 @@ function DonutChart({
|
|
|
7328
8071
|
"aria-hidden": label ? void 0 : true,
|
|
7329
8072
|
className: "block -rotate-90",
|
|
7330
8073
|
children: [
|
|
7331
|
-
/* @__PURE__ */
|
|
8074
|
+
/* @__PURE__ */ jsx81("circle", { cx: box / 2, cy: box / 2, r: radius, fill: "none", stroke: CHART_TRACK, strokeWidth: ring }),
|
|
7332
8075
|
total > 0 && segments.map((segment, i) => {
|
|
7333
8076
|
const fraction = Math.max(0, segment.value) / total;
|
|
7334
8077
|
const length = Math.max(0, fraction * circumference - gapLength);
|
|
@@ -7336,7 +8079,7 @@ function DonutChart({
|
|
|
7336
8079
|
const thisOffset = offset;
|
|
7337
8080
|
offset += fraction * circumference;
|
|
7338
8081
|
if (segment.value <= 0) return null;
|
|
7339
|
-
return /* @__PURE__ */
|
|
8082
|
+
return /* @__PURE__ */ jsx81(
|
|
7340
8083
|
"circle",
|
|
7341
8084
|
{
|
|
7342
8085
|
cx: box / 2,
|
|
@@ -7355,16 +8098,16 @@ function DonutChart({
|
|
|
7355
8098
|
]
|
|
7356
8099
|
}
|
|
7357
8100
|
),
|
|
7358
|
-
(centerValue != null || centerLabel != null) && /* @__PURE__ */
|
|
7359
|
-
centerValue != null && /* @__PURE__ */
|
|
7360
|
-
centerLabel != null && /* @__PURE__ */
|
|
8101
|
+
(centerValue != null || centerLabel != null) && /* @__PURE__ */ jsxs55("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center", children: [
|
|
8102
|
+
centerValue != null && /* @__PURE__ */ jsx81("span", { className: "text-subheading-sm font-bold leading-none text-default", children: centerValue }),
|
|
8103
|
+
centerLabel != null && /* @__PURE__ */ jsx81("span", { className: "mt-0.5 text-body-tiny text-default-secondary", children: centerLabel })
|
|
7361
8104
|
] })
|
|
7362
8105
|
] });
|
|
7363
8106
|
}
|
|
7364
8107
|
|
|
7365
8108
|
// src/components/charts/radial-gauge.tsx
|
|
7366
|
-
import
|
|
7367
|
-
import { jsx as
|
|
8109
|
+
import clsx62 from "clsx";
|
|
8110
|
+
import { jsx as jsx82, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
7368
8111
|
var SIZE13 = {
|
|
7369
8112
|
sm: { box: 72, thickness: 8, value: "text-body-sm" },
|
|
7370
8113
|
md: { box: 104, thickness: 11, value: "text-subheading-sm" },
|
|
@@ -7393,8 +8136,8 @@ function RadialGauge({
|
|
|
7393
8136
|
const fraction = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;
|
|
7394
8137
|
const stroke = resolveChartColor(color, tone);
|
|
7395
8138
|
const rotation = -90 + (360 - clampedSweep) / 2;
|
|
7396
|
-
return /* @__PURE__ */
|
|
7397
|
-
/* @__PURE__ */
|
|
8139
|
+
return /* @__PURE__ */ jsxs56("div", { className: clsx62("relative inline-flex shrink-0 items-center justify-center", className), children: [
|
|
8140
|
+
/* @__PURE__ */ jsxs56(
|
|
7398
8141
|
"svg",
|
|
7399
8142
|
{
|
|
7400
8143
|
width: box,
|
|
@@ -7406,7 +8149,7 @@ function RadialGauge({
|
|
|
7406
8149
|
className: "block",
|
|
7407
8150
|
style: { transform: `rotate(${rotation}deg)` },
|
|
7408
8151
|
children: [
|
|
7409
|
-
/* @__PURE__ */
|
|
8152
|
+
/* @__PURE__ */ jsx82(
|
|
7410
8153
|
"circle",
|
|
7411
8154
|
{
|
|
7412
8155
|
cx: box / 2,
|
|
@@ -7419,7 +8162,7 @@ function RadialGauge({
|
|
|
7419
8162
|
strokeLinecap: "round"
|
|
7420
8163
|
}
|
|
7421
8164
|
),
|
|
7422
|
-
/* @__PURE__ */
|
|
8165
|
+
/* @__PURE__ */ jsx82(
|
|
7423
8166
|
"circle",
|
|
7424
8167
|
{
|
|
7425
8168
|
cx: box / 2,
|
|
@@ -7436,17 +8179,17 @@ function RadialGauge({
|
|
|
7436
8179
|
]
|
|
7437
8180
|
}
|
|
7438
8181
|
),
|
|
7439
|
-
/* @__PURE__ */
|
|
7440
|
-
children === void 0 ? /* @__PURE__ */
|
|
7441
|
-
centerLabel != null && /* @__PURE__ */
|
|
8182
|
+
/* @__PURE__ */ jsxs56("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center", children: [
|
|
8183
|
+
children === void 0 ? /* @__PURE__ */ jsx82("span", { className: clsx62("font-bold leading-none text-default", preset.value), children: value }) : children,
|
|
8184
|
+
centerLabel != null && /* @__PURE__ */ jsx82("span", { className: "mt-0.5 text-body-tiny text-default-secondary", children: centerLabel })
|
|
7442
8185
|
] })
|
|
7443
8186
|
] });
|
|
7444
8187
|
}
|
|
7445
8188
|
|
|
7446
8189
|
// src/components/charts/sparkline.tsx
|
|
7447
|
-
import { useId as
|
|
7448
|
-
import
|
|
7449
|
-
import { Fragment as
|
|
8190
|
+
import { useId as useId19 } from "react";
|
|
8191
|
+
import clsx63 from "clsx";
|
|
8192
|
+
import { Fragment as Fragment13, jsx as jsx83, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
7450
8193
|
var SIZE14 = {
|
|
7451
8194
|
sm: { width: 80, height: 24 },
|
|
7452
8195
|
md: { width: 120, height: 36 },
|
|
@@ -7466,7 +8209,7 @@ function Sparkline({
|
|
|
7466
8209
|
label,
|
|
7467
8210
|
className
|
|
7468
8211
|
}) {
|
|
7469
|
-
const gradientId =
|
|
8212
|
+
const gradientId = useId19();
|
|
7470
8213
|
if (data.length < 2) return null;
|
|
7471
8214
|
const w = width ?? SIZE14[size].width;
|
|
7472
8215
|
const h = height ?? SIZE14[size].height;
|
|
@@ -7484,7 +8227,7 @@ function Sparkline({
|
|
|
7484
8227
|
const points = coords.map((p) => `${p.x.toFixed(2)},${p.y.toFixed(2)}`).join(" ");
|
|
7485
8228
|
const areaPath = `M ${points.split(" ").join(" L ")} L ${coords[coords.length - 1].x.toFixed(2)},${h} L ${coords[0].x.toFixed(2)},${h} Z`;
|
|
7486
8229
|
const last = coords[coords.length - 1];
|
|
7487
|
-
return /* @__PURE__ */
|
|
8230
|
+
return /* @__PURE__ */ jsxs57(
|
|
7488
8231
|
"svg",
|
|
7489
8232
|
{
|
|
7490
8233
|
width: stretch ? void 0 : w,
|
|
@@ -7495,16 +8238,16 @@ function Sparkline({
|
|
|
7495
8238
|
role: label ? "img" : void 0,
|
|
7496
8239
|
"aria-label": label,
|
|
7497
8240
|
"aria-hidden": label ? void 0 : true,
|
|
7498
|
-
className:
|
|
8241
|
+
className: clsx63("block", stretch ? "h-full w-full" : "shrink-0", className),
|
|
7499
8242
|
children: [
|
|
7500
|
-
variant === "area" && /* @__PURE__ */
|
|
7501
|
-
/* @__PURE__ */
|
|
7502
|
-
/* @__PURE__ */
|
|
7503
|
-
/* @__PURE__ */
|
|
8243
|
+
variant === "area" && /* @__PURE__ */ jsxs57(Fragment13, { children: [
|
|
8244
|
+
/* @__PURE__ */ jsx83("defs", { children: /* @__PURE__ */ jsxs57("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
8245
|
+
/* @__PURE__ */ jsx83("stop", { offset: "0%", stopColor: stroke, stopOpacity: 0.24 }),
|
|
8246
|
+
/* @__PURE__ */ jsx83("stop", { offset: "100%", stopColor: stroke, stopOpacity: 0 })
|
|
7504
8247
|
] }) }),
|
|
7505
|
-
/* @__PURE__ */
|
|
8248
|
+
/* @__PURE__ */ jsx83("path", { d: areaPath, fill: `url(#${gradientId})` })
|
|
7506
8249
|
] }),
|
|
7507
|
-
/* @__PURE__ */
|
|
8250
|
+
/* @__PURE__ */ jsx83(
|
|
7508
8251
|
"polyline",
|
|
7509
8252
|
{
|
|
7510
8253
|
points,
|
|
@@ -7516,7 +8259,7 @@ function Sparkline({
|
|
|
7516
8259
|
fill: "none"
|
|
7517
8260
|
}
|
|
7518
8261
|
),
|
|
7519
|
-
showEndDot && /* @__PURE__ */
|
|
8262
|
+
showEndDot && /* @__PURE__ */ jsx83(
|
|
7520
8263
|
"circle",
|
|
7521
8264
|
{
|
|
7522
8265
|
cx: last.x,
|
|
@@ -7533,8 +8276,8 @@ function Sparkline({
|
|
|
7533
8276
|
}
|
|
7534
8277
|
|
|
7535
8278
|
// src/components/charts/mini-bar-chart.tsx
|
|
7536
|
-
import
|
|
7537
|
-
import { jsx as
|
|
8279
|
+
import clsx64 from "clsx";
|
|
8280
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
7538
8281
|
var SIZE15 = {
|
|
7539
8282
|
sm: { width: 80, height: 32, gap: 2 },
|
|
7540
8283
|
md: { width: 120, height: 48, gap: 3 },
|
|
@@ -7570,7 +8313,7 @@ function MiniBarChart({
|
|
|
7570
8313
|
const span = vertical ? w : h;
|
|
7571
8314
|
const extent = vertical ? h : w;
|
|
7572
8315
|
const barThickness = (span - g * (bars.length - 1)) / bars.length;
|
|
7573
|
-
return /* @__PURE__ */
|
|
8316
|
+
return /* @__PURE__ */ jsx84(
|
|
7574
8317
|
"svg",
|
|
7575
8318
|
{
|
|
7576
8319
|
width: stretch ? void 0 : w,
|
|
@@ -7581,11 +8324,11 @@ function MiniBarChart({
|
|
|
7581
8324
|
role: label ? "img" : void 0,
|
|
7582
8325
|
"aria-label": label,
|
|
7583
8326
|
"aria-hidden": label ? void 0 : true,
|
|
7584
|
-
className:
|
|
8327
|
+
className: clsx64("block", stretch ? "h-full w-full" : "shrink-0", className),
|
|
7585
8328
|
children: bars.map((v, i) => {
|
|
7586
8329
|
const magnitude = Math.max(2, v / max * extent);
|
|
7587
8330
|
const offset = i * (barThickness + g);
|
|
7588
|
-
return /* @__PURE__ */
|
|
8331
|
+
return /* @__PURE__ */ jsx84(
|
|
7589
8332
|
"rect",
|
|
7590
8333
|
{
|
|
7591
8334
|
x: (vertical ? offset : 0).toFixed(2),
|
|
@@ -7603,29 +8346,29 @@ function MiniBarChart({
|
|
|
7603
8346
|
}
|
|
7604
8347
|
|
|
7605
8348
|
// src/components/charts/chart-legend.tsx
|
|
7606
|
-
import
|
|
8349
|
+
import clsx66 from "clsx";
|
|
7607
8350
|
|
|
7608
8351
|
// src/components/charts/legend-dot.tsx
|
|
7609
|
-
import
|
|
7610
|
-
import { jsx as
|
|
8352
|
+
import clsx65 from "clsx";
|
|
8353
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
7611
8354
|
var SHAPE = {
|
|
7612
8355
|
dot: { sm: "size-1.5 rounded-full", md: "size-2 rounded-full" },
|
|
7613
8356
|
square: { sm: "size-1.5 rounded-[2px]", md: "size-2 rounded-[3px]" },
|
|
7614
8357
|
line: { sm: "h-0.5 w-3 rounded-full", md: "h-0.5 w-4 rounded-full" }
|
|
7615
8358
|
};
|
|
7616
|
-
function LegendDot({ tone, color, size = "md", shape = "dot", className }) {
|
|
7617
|
-
return /* @__PURE__ */
|
|
8359
|
+
function LegendDot({ tone, color, hue, size = "md", shape = "dot", className }) {
|
|
8360
|
+
return /* @__PURE__ */ jsx85(
|
|
7618
8361
|
"span",
|
|
7619
8362
|
{
|
|
7620
|
-
className:
|
|
7621
|
-
style: { backgroundColor: resolveChartColor(color, tone) },
|
|
8363
|
+
className: clsx65("inline-block shrink-0", SHAPE[shape][size], className),
|
|
8364
|
+
style: { backgroundColor: color || !hue ? resolveChartColor(color, tone) : `var(--badge-${hue}-text)` },
|
|
7622
8365
|
"aria-hidden": true
|
|
7623
8366
|
}
|
|
7624
8367
|
);
|
|
7625
8368
|
}
|
|
7626
8369
|
|
|
7627
8370
|
// src/components/charts/chart-legend.tsx
|
|
7628
|
-
import { jsx as
|
|
8371
|
+
import { jsx as jsx86, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
7629
8372
|
function ChartLegend({
|
|
7630
8373
|
items,
|
|
7631
8374
|
orientation = "vertical",
|
|
@@ -7634,23 +8377,23 @@ function ChartLegend({
|
|
|
7634
8377
|
className
|
|
7635
8378
|
}) {
|
|
7636
8379
|
const horizontal = orientation === "horizontal";
|
|
7637
|
-
return /* @__PURE__ */
|
|
8380
|
+
return /* @__PURE__ */ jsx86(
|
|
7638
8381
|
"div",
|
|
7639
8382
|
{
|
|
7640
|
-
className:
|
|
8383
|
+
className: clsx66(
|
|
7641
8384
|
horizontal ? "flex flex-wrap items-center gap-x-4 gap-y-2" : "flex flex-col gap-3",
|
|
7642
8385
|
className
|
|
7643
8386
|
),
|
|
7644
|
-
children: items.map((item, i) => /* @__PURE__ */
|
|
8387
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs58(
|
|
7645
8388
|
"div",
|
|
7646
8389
|
{
|
|
7647
|
-
className:
|
|
8390
|
+
className: clsx66("flex items-center gap-2", horizontal ? "min-w-0" : "justify-between"),
|
|
7648
8391
|
children: [
|
|
7649
|
-
/* @__PURE__ */
|
|
7650
|
-
/* @__PURE__ */
|
|
7651
|
-
/* @__PURE__ */
|
|
8392
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
8393
|
+
/* @__PURE__ */ jsx86(LegendDot, { color: resolveChartColor(item.color, item.tone, i), size, shape }),
|
|
8394
|
+
/* @__PURE__ */ jsx86("span", { className: "truncate text-body-xs text-default-secondary", children: item.label })
|
|
7652
8395
|
] }),
|
|
7653
|
-
item.count != null && /* @__PURE__ */
|
|
8396
|
+
item.count != null && /* @__PURE__ */ jsx86("span", { className: "shrink-0 text-body-xs font-semibold tabular-nums text-default", children: item.count })
|
|
7654
8397
|
]
|
|
7655
8398
|
},
|
|
7656
8399
|
item.label
|
|
@@ -7660,9 +8403,9 @@ function ChartLegend({
|
|
|
7660
8403
|
}
|
|
7661
8404
|
|
|
7662
8405
|
// src/components/charts/trend-label.tsx
|
|
7663
|
-
import
|
|
8406
|
+
import clsx67 from "clsx";
|
|
7664
8407
|
import { TrendingDownIcon, TrendingUpIcon } from "lucide-react";
|
|
7665
|
-
import { jsx as
|
|
8408
|
+
import { jsx as jsx87, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
7666
8409
|
var SIZE16 = {
|
|
7667
8410
|
sm: "text-body-xs",
|
|
7668
8411
|
md: "text-body-sm",
|
|
@@ -7696,10 +8439,10 @@ function TrendLabel({
|
|
|
7696
8439
|
const flat = value === 0;
|
|
7697
8440
|
const good = direction === "up-is-good" ? rising : !rising;
|
|
7698
8441
|
const Arrow = rising ? TrendingUpIcon : TrendingDownIcon;
|
|
7699
|
-
return /* @__PURE__ */
|
|
8442
|
+
return /* @__PURE__ */ jsxs59(
|
|
7700
8443
|
"span",
|
|
7701
8444
|
{
|
|
7702
|
-
className:
|
|
8445
|
+
className: clsx67(
|
|
7703
8446
|
"inline-flex items-center gap-1 whitespace-nowrap",
|
|
7704
8447
|
SIZE16[size],
|
|
7705
8448
|
WEIGHT2[weight ?? weightBySize[size]],
|
|
@@ -7708,7 +8451,7 @@ function TrendLabel({
|
|
|
7708
8451
|
),
|
|
7709
8452
|
style: color ? { color } : void 0,
|
|
7710
8453
|
children: [
|
|
7711
|
-
showArrow && !flat && /* @__PURE__ */
|
|
8454
|
+
showArrow && !flat && /* @__PURE__ */ jsx87(Arrow, { className: clsx67("shrink-0", ICON_SIZE[size]), "aria-hidden": true }),
|
|
7712
8455
|
rising ? "+" : "",
|
|
7713
8456
|
value,
|
|
7714
8457
|
suffix
|
|
@@ -7717,10 +8460,118 @@ function TrendLabel({
|
|
|
7717
8460
|
);
|
|
7718
8461
|
}
|
|
7719
8462
|
|
|
8463
|
+
// src/components/lists/listbox.tsx
|
|
8464
|
+
import { Fragment as Fragment14, useEffect as useEffect12, useId as useId20, useMemo as useMemo12 } from "react";
|
|
8465
|
+
import clsx68 from "clsx";
|
|
8466
|
+
import { jsx as jsx88, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
8467
|
+
var isGroup2 = (entry) => "options" in entry;
|
|
8468
|
+
function Listbox({
|
|
8469
|
+
options,
|
|
8470
|
+
value: valueProp,
|
|
8471
|
+
defaultValue,
|
|
8472
|
+
onValueChange,
|
|
8473
|
+
label,
|
|
8474
|
+
selectionFollowsFocus = true,
|
|
8475
|
+
maxHeight,
|
|
8476
|
+
empty,
|
|
8477
|
+
className
|
|
8478
|
+
}) {
|
|
8479
|
+
const id = useId20();
|
|
8480
|
+
const [value, setValue] = useControllableState({
|
|
8481
|
+
value: valueProp,
|
|
8482
|
+
defaultValue,
|
|
8483
|
+
onChange: onValueChange
|
|
8484
|
+
});
|
|
8485
|
+
const flat = useMemo12(
|
|
8486
|
+
() => options.flatMap((entry) => isGroup2(entry) ? entry.options : [entry]),
|
|
8487
|
+
[options]
|
|
8488
|
+
);
|
|
8489
|
+
const selectedIndex = flat.findIndex((option) => option.value === value);
|
|
8490
|
+
const roving = useRovingFocus({
|
|
8491
|
+
orientation: "vertical",
|
|
8492
|
+
loop: false,
|
|
8493
|
+
typeahead: true,
|
|
8494
|
+
defaultIndex: Math.max(0, selectedIndex)
|
|
8495
|
+
});
|
|
8496
|
+
const { setActiveIndex } = roving;
|
|
8497
|
+
useEffect12(() => {
|
|
8498
|
+
if (selectedIndex >= 0) setActiveIndex(selectedIndex);
|
|
8499
|
+
}, [selectedIndex, setActiveIndex]);
|
|
8500
|
+
let index = -1;
|
|
8501
|
+
const renderOption = (option) => {
|
|
8502
|
+
index += 1;
|
|
8503
|
+
const position = index;
|
|
8504
|
+
const selected = option.value === value;
|
|
8505
|
+
const item = roving.itemProps(position, {
|
|
8506
|
+
disabled: option.disabled,
|
|
8507
|
+
label: option.textValue ?? (typeof option.label === "string" ? option.label : void 0)
|
|
8508
|
+
});
|
|
8509
|
+
const select = () => {
|
|
8510
|
+
if (!option.disabled) setValue(option.value);
|
|
8511
|
+
};
|
|
8512
|
+
return /* @__PURE__ */ jsxs60(
|
|
8513
|
+
"div",
|
|
8514
|
+
{
|
|
8515
|
+
ref: item.ref,
|
|
8516
|
+
tabIndex: item.tabIndex,
|
|
8517
|
+
"data-roving-index": item["data-roving-index"],
|
|
8518
|
+
role: "option",
|
|
8519
|
+
"aria-selected": selected,
|
|
8520
|
+
"aria-disabled": option.disabled || void 0,
|
|
8521
|
+
"data-state": selected ? "selected" : void 0,
|
|
8522
|
+
onFocus: () => {
|
|
8523
|
+
item.onFocus();
|
|
8524
|
+
if (selectionFollowsFocus) select();
|
|
8525
|
+
},
|
|
8526
|
+
onClick: select,
|
|
8527
|
+
onKeyDown: (event) => {
|
|
8528
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
8529
|
+
event.preventDefault();
|
|
8530
|
+
select();
|
|
8531
|
+
}
|
|
8532
|
+
},
|
|
8533
|
+
className: clsx68(
|
|
8534
|
+
"flex w-full cursor-pointer items-center gap-2.5 border-b border-default bg-default px-4 py-2 text-left text-body-xs text-default",
|
|
8535
|
+
"hover:bg-default-secondary",
|
|
8536
|
+
"data-[state=selected]:bg-brand-tertiary data-[state=selected]:font-semibold",
|
|
8537
|
+
"aria-disabled:cursor-not-allowed aria-disabled:text-disabled",
|
|
8538
|
+
FOCUS_RING_INSET
|
|
8539
|
+
),
|
|
8540
|
+
children: [
|
|
8541
|
+
/* @__PURE__ */ jsx88("span", { className: "min-w-0 flex-1", children: option.label }),
|
|
8542
|
+
option.meta !== void 0 && /* @__PURE__ */ jsx88("span", { className: "shrink-0 whitespace-nowrap font-normal text-default-secondary", children: option.meta })
|
|
8543
|
+
]
|
|
8544
|
+
},
|
|
8545
|
+
option.value
|
|
8546
|
+
);
|
|
8547
|
+
};
|
|
8548
|
+
if (flat.length === 0 && empty) {
|
|
8549
|
+
return /* @__PURE__ */ jsx88("div", { className: cn("px-4 py-6 text-center text-body-xs text-default-secondary", className), children: empty });
|
|
8550
|
+
}
|
|
8551
|
+
return /* @__PURE__ */ jsx88(
|
|
8552
|
+
"div",
|
|
8553
|
+
{
|
|
8554
|
+
role: "listbox",
|
|
8555
|
+
"aria-label": label,
|
|
8556
|
+
...roving.containerProps,
|
|
8557
|
+
className: cn(maxHeight !== void 0 && ["overflow-auto overscroll-contain", SCROLLBAR_CLASSES], className),
|
|
8558
|
+
style: maxHeight !== void 0 ? { maxHeight } : void 0,
|
|
8559
|
+
children: options.map((entry, groupIndex) => {
|
|
8560
|
+
if (!isGroup2(entry)) return /* @__PURE__ */ jsx88(Fragment14, { children: renderOption(entry) }, entry.value);
|
|
8561
|
+
const headerId = `${id}-group-${groupIndex}`;
|
|
8562
|
+
return /* @__PURE__ */ jsxs60("div", { role: "group", "aria-labelledby": headerId, children: [
|
|
8563
|
+
/* @__PURE__ */ jsx88("div", { id: headerId, className: "border-b border-default bg-default-secondary px-4 py-2", children: /* @__PURE__ */ jsx88(EyebrowLabel, { children: entry.label }) }),
|
|
8564
|
+
entry.options.map(renderOption)
|
|
8565
|
+
] }, `${groupIndex}-${entry.label}`);
|
|
8566
|
+
})
|
|
8567
|
+
}
|
|
8568
|
+
);
|
|
8569
|
+
}
|
|
8570
|
+
|
|
7720
8571
|
// src/components/lists/list-row.tsx
|
|
7721
|
-
import
|
|
7722
|
-
import { Fragment as
|
|
7723
|
-
var
|
|
8572
|
+
import clsx69 from "clsx";
|
|
8573
|
+
import { Fragment as Fragment15, jsx as jsx89, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
8574
|
+
var DENSITY2 = {
|
|
7724
8575
|
default: {
|
|
7725
8576
|
pad: "py-4",
|
|
7726
8577
|
gap: "gap-3",
|
|
@@ -7759,7 +8610,7 @@ function ListRow({
|
|
|
7759
8610
|
"aria-label": ariaLabel,
|
|
7760
8611
|
className
|
|
7761
8612
|
}) {
|
|
7762
|
-
const d =
|
|
8613
|
+
const d = DENSITY2[density];
|
|
7763
8614
|
const hasTitleLine = Boolean(leading || title != null || titleMeta || meta);
|
|
7764
8615
|
const clickable = Boolean(onClick) && !asChild;
|
|
7765
8616
|
const interactive = clickable || asChild;
|
|
@@ -7780,24 +8631,24 @@ function ListRow({
|
|
|
7780
8631
|
className
|
|
7781
8632
|
)
|
|
7782
8633
|
};
|
|
7783
|
-
const body = /* @__PURE__ */
|
|
7784
|
-
/* @__PURE__ */
|
|
7785
|
-
hasTitleLine && /* @__PURE__ */
|
|
7786
|
-
/* @__PURE__ */
|
|
8634
|
+
const body = /* @__PURE__ */ jsxs61(Fragment15, { children: [
|
|
8635
|
+
/* @__PURE__ */ jsxs61("div", { className: clsx69("flex min-w-0 flex-1 flex-col", d.gap), children: [
|
|
8636
|
+
hasTitleLine && /* @__PURE__ */ jsxs61("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8637
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
7787
8638
|
leading,
|
|
7788
|
-
title != null && /* @__PURE__ */
|
|
7789
|
-
titleMeta && /* @__PURE__ */
|
|
8639
|
+
title != null && /* @__PURE__ */ jsx89("span", { className: clsx69("truncate", d.title), children: title }),
|
|
8640
|
+
titleMeta && /* @__PURE__ */ jsx89("span", { className: "shrink-0", children: titleMeta })
|
|
7790
8641
|
] }),
|
|
7791
|
-
meta && /* @__PURE__ */
|
|
8642
|
+
meta && /* @__PURE__ */ jsx89("span", { className: "shrink-0", children: meta })
|
|
7792
8643
|
] }),
|
|
7793
|
-
description && /* @__PURE__ */
|
|
8644
|
+
description && /* @__PURE__ */ jsx89("p", { className: d.description, children: description }),
|
|
7794
8645
|
footer && // These two wrappers are propagation barriers, not controls — they add no
|
|
7795
8646
|
// behaviour of their own and must not be focusable or take a role.
|
|
7796
8647
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
7797
|
-
/* @__PURE__ */
|
|
8648
|
+
/* @__PURE__ */ jsx89("div", { onClick: stopIfInteractive, onKeyDown: stopIfInteractive, children: footer })
|
|
7798
8649
|
] }),
|
|
7799
8650
|
trailing && // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
7800
|
-
/* @__PURE__ */
|
|
8651
|
+
/* @__PURE__ */ jsx89(
|
|
7801
8652
|
"div",
|
|
7802
8653
|
{
|
|
7803
8654
|
className: "ml-3 flex shrink-0 items-center self-center",
|
|
@@ -7808,7 +8659,7 @@ function ListRow({
|
|
|
7808
8659
|
)
|
|
7809
8660
|
] });
|
|
7810
8661
|
if (asChild) {
|
|
7811
|
-
return /* @__PURE__ */
|
|
8662
|
+
return /* @__PURE__ */ jsx89(
|
|
7812
8663
|
Slot,
|
|
7813
8664
|
{
|
|
7814
8665
|
...rootProps,
|
|
@@ -7821,7 +8672,7 @@ function ListRow({
|
|
|
7821
8672
|
}
|
|
7822
8673
|
);
|
|
7823
8674
|
}
|
|
7824
|
-
return /* @__PURE__ */
|
|
8675
|
+
return /* @__PURE__ */ jsx89(
|
|
7825
8676
|
Tag,
|
|
7826
8677
|
{
|
|
7827
8678
|
...rootProps,
|
|
@@ -7850,11 +8701,11 @@ function refusePress(event) {
|
|
|
7850
8701
|
}
|
|
7851
8702
|
|
|
7852
8703
|
// src/components/lists/file-row.tsx
|
|
7853
|
-
import
|
|
8704
|
+
import clsx70 from "clsx";
|
|
7854
8705
|
import { DownloadIcon, Trash2Icon } from "lucide-react";
|
|
7855
|
-
import { jsx as
|
|
8706
|
+
import { jsx as jsx90, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
7856
8707
|
function FileTypeBadge({ type }) {
|
|
7857
|
-
return /* @__PURE__ */
|
|
8708
|
+
return /* @__PURE__ */ jsx90("span", { className: "flex size-[34px] shrink-0 items-center justify-center rounded-md bg-brand-tertiary text-body-tiny font-semibold text-brand", children: type });
|
|
7858
8709
|
}
|
|
7859
8710
|
function FileRow({
|
|
7860
8711
|
name,
|
|
@@ -7868,24 +8719,24 @@ function FileRow({
|
|
|
7868
8719
|
actions,
|
|
7869
8720
|
className
|
|
7870
8721
|
}) {
|
|
7871
|
-
const lead = leading ?? (fileType ? /* @__PURE__ */
|
|
7872
|
-
return /* @__PURE__ */
|
|
8722
|
+
const lead = leading ?? (fileType ? /* @__PURE__ */ jsx90(FileTypeBadge, { type: fileType }) : null);
|
|
8723
|
+
return /* @__PURE__ */ jsxs62(
|
|
7873
8724
|
"div",
|
|
7874
8725
|
{
|
|
7875
|
-
className:
|
|
8726
|
+
className: clsx70(
|
|
7876
8727
|
"flex items-center gap-3 rounded-lg border border-default bg-default px-3 py-2.5",
|
|
7877
8728
|
className
|
|
7878
8729
|
),
|
|
7879
8730
|
children: [
|
|
7880
8731
|
lead,
|
|
7881
|
-
/* @__PURE__ */
|
|
7882
|
-
/* @__PURE__ */
|
|
7883
|
-
detail && /* @__PURE__ */
|
|
8732
|
+
/* @__PURE__ */ jsxs62("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
8733
|
+
/* @__PURE__ */ jsx90("span", { className: "truncate text-body-sm font-medium text-default", children: name }),
|
|
8734
|
+
detail && /* @__PURE__ */ jsx90("span", { className: "text-body-xs text-default-secondary", children: detail })
|
|
7884
8735
|
] }),
|
|
7885
|
-
(onDownload || onRemove || actions) && /* @__PURE__ */
|
|
7886
|
-
onDownload && /* @__PURE__ */
|
|
7887
|
-
onRemove && /* @__PURE__ */
|
|
7888
|
-
actions && /* @__PURE__ */
|
|
8736
|
+
(onDownload || onRemove || actions) && /* @__PURE__ */ jsxs62("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
8737
|
+
onDownload && /* @__PURE__ */ jsx90(Tooltip, { title: downloadLabel, children: /* @__PURE__ */ jsx90(IconButton, { variant: "subtle", size: "sm", "aria-label": `${downloadLabel} ${name}`, onClick: onDownload, className: "touch-hit", children: /* @__PURE__ */ jsx90(DownloadIcon, { "aria-hidden": true }) }) }),
|
|
8738
|
+
onRemove && /* @__PURE__ */ jsx90(Tooltip, { title: removeLabel, children: /* @__PURE__ */ jsx90(IconButton, { variant: "subtle", size: "sm", "aria-label": `${removeLabel} ${name}`, onClick: onRemove, className: "touch-hit", children: /* @__PURE__ */ jsx90(Trash2Icon, { "aria-hidden": true }) }) }),
|
|
8739
|
+
actions && /* @__PURE__ */ jsx90("div", { className: "ml-2 flex items-center gap-2", children: actions })
|
|
7889
8740
|
] })
|
|
7890
8741
|
]
|
|
7891
8742
|
}
|
|
@@ -7893,8 +8744,8 @@ function FileRow({
|
|
|
7893
8744
|
}
|
|
7894
8745
|
|
|
7895
8746
|
// src/components/lists/scored-row.tsx
|
|
7896
|
-
import
|
|
7897
|
-
import { jsx as
|
|
8747
|
+
import clsx71 from "clsx";
|
|
8748
|
+
import { jsx as jsx91, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
7898
8749
|
var GAP3 = {
|
|
7899
8750
|
sm: "gap-2",
|
|
7900
8751
|
md: "gap-3",
|
|
@@ -7921,11 +8772,11 @@ function ScoredRow({
|
|
|
7921
8772
|
align = "center",
|
|
7922
8773
|
className
|
|
7923
8774
|
}) {
|
|
7924
|
-
return /* @__PURE__ */
|
|
7925
|
-
/* @__PURE__ */
|
|
8775
|
+
return /* @__PURE__ */ jsxs63("div", { className: clsx71("flex w-full", ALIGN3[align], GAP3[gap], className), children: [
|
|
8776
|
+
/* @__PURE__ */ jsxs63(
|
|
7926
8777
|
"div",
|
|
7927
8778
|
{
|
|
7928
|
-
className:
|
|
8779
|
+
className: clsx71(
|
|
7929
8780
|
"flex min-w-0",
|
|
7930
8781
|
ALIGN3[align],
|
|
7931
8782
|
GAP3[leadingGap ?? gap],
|
|
@@ -7934,36 +8785,36 @@ function ScoredRow({
|
|
|
7934
8785
|
style: titleWidth ? { width: titleWidth } : void 0,
|
|
7935
8786
|
children: [
|
|
7936
8787
|
leading,
|
|
7937
|
-
/* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
7939
|
-
subtitle && /* @__PURE__ */
|
|
8788
|
+
/* @__PURE__ */ jsxs63("div", { className: "min-w-0 flex-1", children: [
|
|
8789
|
+
/* @__PURE__ */ jsx91("p", { className: "truncate text-body-sm font-medium leading-none text-default", children: title }),
|
|
8790
|
+
subtitle && /* @__PURE__ */ jsx91("p", { className: "mt-0.5 truncate text-body-xs text-default-secondary", children: subtitle })
|
|
7940
8791
|
] })
|
|
7941
8792
|
]
|
|
7942
8793
|
}
|
|
7943
8794
|
),
|
|
7944
|
-
aside && /* @__PURE__ */
|
|
8795
|
+
aside && /* @__PURE__ */ jsx91(
|
|
7945
8796
|
"div",
|
|
7946
8797
|
{
|
|
7947
|
-
className:
|
|
8798
|
+
className: clsx71("min-w-0", asideWidth ? "shrink-0" : "flex-1"),
|
|
7948
8799
|
style: asideWidth ? { width: asideWidth } : void 0,
|
|
7949
8800
|
children: aside
|
|
7950
8801
|
}
|
|
7951
8802
|
),
|
|
7952
|
-
meter && /* @__PURE__ */
|
|
8803
|
+
meter && /* @__PURE__ */ jsx91(
|
|
7953
8804
|
"div",
|
|
7954
8805
|
{
|
|
7955
|
-
className:
|
|
8806
|
+
className: clsx71("min-w-0", meterWidth ? "shrink-0" : "flex-1"),
|
|
7956
8807
|
style: meterWidth ? { width: meterWidth } : void 0,
|
|
7957
8808
|
children: meter
|
|
7958
8809
|
}
|
|
7959
8810
|
),
|
|
7960
|
-
trailing && /* @__PURE__ */
|
|
8811
|
+
trailing && /* @__PURE__ */ jsx91("div", { className: "shrink-0 text-right", style: trailingWidth ? { width: trailingWidth } : void 0, children: trailing })
|
|
7961
8812
|
] });
|
|
7962
8813
|
}
|
|
7963
8814
|
|
|
7964
8815
|
// src/components/lists/numbered-list.tsx
|
|
7965
|
-
import
|
|
7966
|
-
import { jsx as
|
|
8816
|
+
import clsx72 from "clsx";
|
|
8817
|
+
import { jsx as jsx92, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
7967
8818
|
var GAP4 = {
|
|
7968
8819
|
sm: "gap-2",
|
|
7969
8820
|
md: "gap-3"
|
|
@@ -7977,18 +8828,18 @@ function NumberedList({
|
|
|
7977
8828
|
gap = "md",
|
|
7978
8829
|
className
|
|
7979
8830
|
}) {
|
|
7980
|
-
return /* @__PURE__ */
|
|
8831
|
+
return /* @__PURE__ */ jsx92("ol", { className: clsx72("flex list-none flex-col p-0", GAP4[gap], className), children: items.map((item, index) => {
|
|
7981
8832
|
const tone = !item.tone || item.tone === "auto" ? getScoreTone(item.score, { direction }) : item.tone;
|
|
7982
|
-
return /* @__PURE__ */
|
|
7983
|
-
/* @__PURE__ */
|
|
7984
|
-
/* @__PURE__ */
|
|
7985
|
-
/* @__PURE__ */
|
|
7986
|
-
/* @__PURE__ */
|
|
7987
|
-
/* @__PURE__ */
|
|
7988
|
-
item.subtitle && /* @__PURE__ */
|
|
8833
|
+
return /* @__PURE__ */ jsxs64("li", { className: "flex w-full shrink-0 flex-col gap-1.5", children: [
|
|
8834
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex w-full items-center justify-between", children: [
|
|
8835
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
8836
|
+
/* @__PURE__ */ jsx92("span", { className: "w-[14px] shrink-0 text-body-xs font-bold text-default-secondary", children: startAt + index }),
|
|
8837
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex min-w-0 flex-col gap-px", children: [
|
|
8838
|
+
/* @__PURE__ */ jsx92("span", { className: "truncate text-body-sm font-medium leading-none text-default", children: item.title }),
|
|
8839
|
+
item.subtitle && /* @__PURE__ */ jsx92("span", { className: "text-body-tiny text-default-tertiary", children: item.subtitle })
|
|
7989
8840
|
] })
|
|
7990
8841
|
] }),
|
|
7991
|
-
/* @__PURE__ */
|
|
8842
|
+
/* @__PURE__ */ jsx92(
|
|
7992
8843
|
ScoreValue,
|
|
7993
8844
|
{
|
|
7994
8845
|
value: item.score,
|
|
@@ -7999,43 +8850,43 @@ function NumberedList({
|
|
|
7999
8850
|
}
|
|
8000
8851
|
)
|
|
8001
8852
|
] }),
|
|
8002
|
-
/* @__PURE__ */
|
|
8853
|
+
/* @__PURE__ */ jsx92(ProgressBar, { value: item.score, tone, "aria-label": `${item.title} score` })
|
|
8003
8854
|
] }, `${item.title}-${index}`);
|
|
8004
8855
|
}) });
|
|
8005
8856
|
}
|
|
8006
8857
|
|
|
8007
8858
|
// src/components/lists/icon-text-row.tsx
|
|
8008
|
-
import
|
|
8009
|
-
import { jsx as
|
|
8859
|
+
import clsx73 from "clsx";
|
|
8860
|
+
import { jsx as jsx93, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
8010
8861
|
function IconTextRow({ icon, title, detail, className }) {
|
|
8011
|
-
return /* @__PURE__ */
|
|
8012
|
-
/* @__PURE__ */
|
|
8013
|
-
/* @__PURE__ */
|
|
8014
|
-
/* @__PURE__ */
|
|
8015
|
-
/* @__PURE__ */
|
|
8862
|
+
return /* @__PURE__ */ jsxs65("div", { className: clsx73("flex items-start gap-3", className), children: [
|
|
8863
|
+
/* @__PURE__ */ jsx93("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-brand-tertiary text-brand", children: icon }),
|
|
8864
|
+
/* @__PURE__ */ jsxs65("div", { className: "min-w-0", children: [
|
|
8865
|
+
/* @__PURE__ */ jsx93("p", { className: "text-body-sm font-semibold text-default", children: title }),
|
|
8866
|
+
/* @__PURE__ */ jsx93("p", { className: "mt-0.5 text-body-xs text-default-secondary", children: detail })
|
|
8016
8867
|
] })
|
|
8017
8868
|
] });
|
|
8018
8869
|
}
|
|
8019
8870
|
|
|
8020
8871
|
// src/components/lists/checklist-row.tsx
|
|
8021
|
-
import
|
|
8872
|
+
import clsx74 from "clsx";
|
|
8022
8873
|
import { CheckIcon as CheckIcon5 } from "lucide-react";
|
|
8023
|
-
import { jsx as
|
|
8874
|
+
import { jsx as jsx94, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
8024
8875
|
function ChecklistRow({ label, state, className }) {
|
|
8025
|
-
return /* @__PURE__ */
|
|
8026
|
-
/* @__PURE__ */
|
|
8876
|
+
return /* @__PURE__ */ jsxs66("li", { "data-state": state, className: clsx74("flex items-center gap-3", className), children: [
|
|
8877
|
+
/* @__PURE__ */ jsx94("span", { className: "flex size-5 shrink-0 items-center justify-center", children: state === "done" ? /* @__PURE__ */ jsx94(CheckIcon5, { className: "size-4 text-positive", strokeWidth: 2.5, "aria-hidden": true }) : /* @__PURE__ */ jsx94(
|
|
8027
8878
|
"span",
|
|
8028
8879
|
{
|
|
8029
|
-
className:
|
|
8880
|
+
className: clsx74(
|
|
8030
8881
|
"size-3.5 rounded-full border-2",
|
|
8031
8882
|
state === "active" ? "motion-safe:animate-pulse border-brand-emphasis border-t-transparent" : "border-disabled"
|
|
8032
8883
|
)
|
|
8033
8884
|
}
|
|
8034
8885
|
) }),
|
|
8035
|
-
/* @__PURE__ */
|
|
8886
|
+
/* @__PURE__ */ jsx94(
|
|
8036
8887
|
"span",
|
|
8037
8888
|
{
|
|
8038
|
-
className:
|
|
8889
|
+
className: clsx74(
|
|
8039
8890
|
"text-body-sm",
|
|
8040
8891
|
state === "pending" ? "text-default-tertiary" : "font-semibold text-default"
|
|
8041
8892
|
),
|
|
@@ -8046,22 +8897,22 @@ function ChecklistRow({ label, state, className }) {
|
|
|
8046
8897
|
}
|
|
8047
8898
|
|
|
8048
8899
|
// src/components/lists/steps-list.tsx
|
|
8049
|
-
import
|
|
8050
|
-
import { jsx as
|
|
8900
|
+
import clsx75 from "clsx";
|
|
8901
|
+
import { jsx as jsx95, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
8051
8902
|
function StepsList({ steps, className }) {
|
|
8052
|
-
return /* @__PURE__ */
|
|
8903
|
+
return /* @__PURE__ */ jsx95("ol", { className: clsx75("flex flex-col gap-1.5", className), children: steps.map((step, i) => (
|
|
8053
8904
|
// `text-[12px]` was off the type scale; 12 sits midway between Scale 01 (11) and
|
|
8054
8905
|
// Scale 02 (13), so it rounds up to 13 like every other snap in this pass.
|
|
8055
|
-
/* @__PURE__ */
|
|
8056
|
-
/* @__PURE__ */
|
|
8906
|
+
/* @__PURE__ */ jsxs67("li", { className: "flex items-start gap-2 text-body-xs text-default", children: [
|
|
8907
|
+
/* @__PURE__ */ jsx95("span", { className: "mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full bg-brand-tertiary text-[9px] font-bold text-brand", children: i + 1 }),
|
|
8057
8908
|
step
|
|
8058
8909
|
] }, i)
|
|
8059
8910
|
)) });
|
|
8060
8911
|
}
|
|
8061
8912
|
|
|
8062
8913
|
// src/components/lists/detail-item.tsx
|
|
8063
|
-
import
|
|
8064
|
-
import { jsx as
|
|
8914
|
+
import clsx76 from "clsx";
|
|
8915
|
+
import { jsx as jsx96, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
8065
8916
|
var SPAN = {
|
|
8066
8917
|
1: "",
|
|
8067
8918
|
2: "sm:col-span-2",
|
|
@@ -8078,18 +8929,18 @@ function DetailItem({
|
|
|
8078
8929
|
}) {
|
|
8079
8930
|
const shown = value === null || value === void 0 || value === "" ? "\u2014" : value;
|
|
8080
8931
|
if (layout === "inline") {
|
|
8081
|
-
return /* @__PURE__ */
|
|
8082
|
-
/* @__PURE__ */
|
|
8083
|
-
/* @__PURE__ */
|
|
8084
|
-
/* @__PURE__ */
|
|
8085
|
-
detail && /* @__PURE__ */
|
|
8932
|
+
return /* @__PURE__ */ jsxs68("div", { className: clsx76("flex gap-3 text-body-xs", SPAN[span], className), children: [
|
|
8933
|
+
/* @__PURE__ */ jsx96("span", { className: clsx76("shrink-0 text-default-secondary", labelWidth), children: label }),
|
|
8934
|
+
/* @__PURE__ */ jsxs68("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]", children: [
|
|
8935
|
+
/* @__PURE__ */ jsx96("span", { className: "text-default", children: shown }),
|
|
8936
|
+
detail && /* @__PURE__ */ jsx96("span", { className: "text-default-secondary", children: detail })
|
|
8086
8937
|
] })
|
|
8087
8938
|
] });
|
|
8088
8939
|
}
|
|
8089
|
-
return /* @__PURE__ */
|
|
8090
|
-
/* @__PURE__ */
|
|
8091
|
-
/* @__PURE__ */
|
|
8092
|
-
detail && /* @__PURE__ */
|
|
8940
|
+
return /* @__PURE__ */ jsxs68("div", { className: clsx76("flex min-w-0 flex-col gap-0.5", SPAN[span], className), children: [
|
|
8941
|
+
/* @__PURE__ */ jsx96("p", { className: "text-body-tiny font-medium text-default-secondary", children: label }),
|
|
8942
|
+
/* @__PURE__ */ jsx96("p", { className: "text-body-sm font-medium text-default [overflow-wrap:anywhere]", children: shown }),
|
|
8943
|
+
detail && /* @__PURE__ */ jsx96("p", { className: "text-body-xs text-default-secondary [overflow-wrap:anywhere]", children: detail })
|
|
8093
8944
|
] });
|
|
8094
8945
|
}
|
|
8095
8946
|
var COLUMNS3 = {
|
|
@@ -8100,38 +8951,38 @@ var COLUMNS3 = {
|
|
|
8100
8951
|
4: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"
|
|
8101
8952
|
};
|
|
8102
8953
|
function DetailGrid({ children, columns = "auto", className }) {
|
|
8103
|
-
return /* @__PURE__ */
|
|
8954
|
+
return /* @__PURE__ */ jsx96("div", { className: clsx76("grid gap-x-4 gap-y-4", COLUMNS3[columns], className), children });
|
|
8104
8955
|
}
|
|
8105
8956
|
|
|
8106
8957
|
// src/components/lists/description-list.tsx
|
|
8107
|
-
import { useEffect as
|
|
8108
|
-
import
|
|
8958
|
+
import { useEffect as useEffect13, useState as useState22 } from "react";
|
|
8959
|
+
import clsx77 from "clsx";
|
|
8109
8960
|
import { CheckIcon as CheckIcon6, CopyIcon } from "lucide-react";
|
|
8110
|
-
import { jsx as
|
|
8961
|
+
import { jsx as jsx97, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
8111
8962
|
function DescriptionList({ children, className }) {
|
|
8112
|
-
return /* @__PURE__ */
|
|
8963
|
+
return /* @__PURE__ */ jsx97("dl", { className: cn("flex flex-col gap-3", className), children });
|
|
8113
8964
|
}
|
|
8114
8965
|
function DescriptionItem({ label, value, copyValue, className }) {
|
|
8115
8966
|
const shown = value === null || value === void 0 || value === "" ? "\u2014" : value;
|
|
8116
|
-
return /* @__PURE__ */
|
|
8117
|
-
/* @__PURE__ */
|
|
8118
|
-
/* @__PURE__ */
|
|
8119
|
-
/* @__PURE__ */
|
|
8120
|
-
copyValue && /* @__PURE__ */
|
|
8967
|
+
return /* @__PURE__ */ jsxs69("div", { className: cn("flex flex-wrap items-start gap-x-4 gap-y-0.5 text-body-xs", className), children: [
|
|
8968
|
+
/* @__PURE__ */ jsx97("dt", { className: "shrink-0 grow-0 basis-28 text-default-secondary", children: label }),
|
|
8969
|
+
/* @__PURE__ */ jsxs69("dd", { className: "flex min-w-0 flex-[1_1_10rem] items-start gap-1.5 text-default", children: [
|
|
8970
|
+
/* @__PURE__ */ jsx97("span", { className: "min-w-0 [overflow-wrap:anywhere]", children: shown }),
|
|
8971
|
+
copyValue && /* @__PURE__ */ jsx97(CopyButton, { value: copyValue, label: `Copy ${label.toLowerCase()}` })
|
|
8121
8972
|
] })
|
|
8122
8973
|
] });
|
|
8123
8974
|
}
|
|
8124
8975
|
function CopyButton({ value, label, copiedLabel = "Copied", className }) {
|
|
8125
|
-
const [copied, setCopied] =
|
|
8126
|
-
|
|
8976
|
+
const [copied, setCopied] = useState22(false);
|
|
8977
|
+
useEffect13(() => {
|
|
8127
8978
|
if (!copied) return;
|
|
8128
8979
|
const timer = window.setTimeout(() => setCopied(false), 2e3);
|
|
8129
8980
|
return () => window.clearTimeout(timer);
|
|
8130
8981
|
}, [copied]);
|
|
8131
8982
|
return (
|
|
8132
8983
|
// relative: keeps the sr-only status (absolutely positioned) inside a scrolling container.
|
|
8133
|
-
/* @__PURE__ */
|
|
8134
|
-
/* @__PURE__ */
|
|
8984
|
+
/* @__PURE__ */ jsxs69("span", { className: "relative inline-flex", children: [
|
|
8985
|
+
/* @__PURE__ */ jsx97(
|
|
8135
8986
|
IconButton,
|
|
8136
8987
|
{
|
|
8137
8988
|
variant: "subtle",
|
|
@@ -8145,10 +8996,10 @@ function CopyButton({ value, label, copiedLabel = "Copied", className }) {
|
|
|
8145
8996
|
() => void 0
|
|
8146
8997
|
);
|
|
8147
8998
|
},
|
|
8148
|
-
children: copied ? /* @__PURE__ */
|
|
8999
|
+
children: copied ? /* @__PURE__ */ jsx97(CheckIcon6, { "aria-hidden": true }) : /* @__PURE__ */ jsx97(CopyIcon, { "aria-hidden": true })
|
|
8149
9000
|
}
|
|
8150
9001
|
),
|
|
8151
|
-
/* @__PURE__ */
|
|
9002
|
+
/* @__PURE__ */ jsx97("span", { role: "status", className: "sr-only", children: copied ? copiedLabel : "" })
|
|
8152
9003
|
] })
|
|
8153
9004
|
);
|
|
8154
9005
|
}
|
|
@@ -8156,16 +9007,16 @@ function EmailText({ email, className }) {
|
|
|
8156
9007
|
const at = email.lastIndexOf("@");
|
|
8157
9008
|
const local = at > 0 ? email.slice(0, at) : email;
|
|
8158
9009
|
const domain = at > 0 ? email.slice(at) : "";
|
|
8159
|
-
return /* @__PURE__ */
|
|
8160
|
-
/* @__PURE__ */
|
|
8161
|
-
domain && /* @__PURE__ */
|
|
9010
|
+
return /* @__PURE__ */ jsxs69("span", { title: email, "data-slot": "email-text", className: clsx77("flex min-w-0 max-w-full", className), children: [
|
|
9011
|
+
/* @__PURE__ */ jsx97("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: local }),
|
|
9012
|
+
domain && /* @__PURE__ */ jsx97("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap [flex-shrink:0.001]", children: domain })
|
|
8162
9013
|
] });
|
|
8163
9014
|
}
|
|
8164
9015
|
|
|
8165
9016
|
// src/components/lists/checked-group-list.tsx
|
|
8166
|
-
import
|
|
9017
|
+
import clsx78 from "clsx";
|
|
8167
9018
|
import { CheckIcon as CheckIcon7 } from "lucide-react";
|
|
8168
|
-
import { jsx as
|
|
9019
|
+
import { jsx as jsx98, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
8169
9020
|
var COLUMNS4 = {
|
|
8170
9021
|
1: "columns-1",
|
|
8171
9022
|
2: "columns-2",
|
|
@@ -8179,23 +9030,23 @@ function CheckedGroupList({
|
|
|
8179
9030
|
className
|
|
8180
9031
|
}) {
|
|
8181
9032
|
if (groups.length === 0) {
|
|
8182
|
-
return /* @__PURE__ */
|
|
9033
|
+
return /* @__PURE__ */ jsx98("p", { className: clsx78("text-body-xs text-default-secondary", className), children: emptyLabel });
|
|
8183
9034
|
}
|
|
8184
|
-
const glyph = icon === void 0 ? /* @__PURE__ */
|
|
8185
|
-
return /* @__PURE__ */
|
|
8186
|
-
/* @__PURE__ */
|
|
8187
|
-
/* @__PURE__ */
|
|
8188
|
-
glyph && /* @__PURE__ */
|
|
9035
|
+
const glyph = icon === void 0 ? /* @__PURE__ */ jsx98(CheckIcon7, { className: "size-3.5", strokeWidth: 2.5, "aria-hidden": true }) : icon;
|
|
9036
|
+
return /* @__PURE__ */ jsx98("div", { className: clsx78(COLUMNS4[columns], "gap-x-6", className), children: groups.map((group) => /* @__PURE__ */ jsxs70("div", { className: "mb-5 break-inside-avoid last:mb-0", children: [
|
|
9037
|
+
/* @__PURE__ */ jsx98("p", { className: "mb-2 text-body-tiny font-semibold uppercase tracking-wide text-default-secondary", children: group.label }),
|
|
9038
|
+
/* @__PURE__ */ jsx98("ul", { className: "space-y-1.5", children: group.items.map((item) => /* @__PURE__ */ jsxs70("li", { className: "flex items-center gap-2 text-body-xs text-default", children: [
|
|
9039
|
+
glyph && /* @__PURE__ */ jsx98("span", { className: "shrink-0", children: glyph }),
|
|
8189
9040
|
item
|
|
8190
9041
|
] }, item)) })
|
|
8191
9042
|
] }, group.label)) });
|
|
8192
9043
|
}
|
|
8193
9044
|
|
|
8194
9045
|
// src/components/lists/tree-view.tsx
|
|
8195
|
-
import { useMemo as
|
|
8196
|
-
import
|
|
8197
|
-
import { ChevronRightIcon as
|
|
8198
|
-
import { jsx as
|
|
9046
|
+
import { useMemo as useMemo13, useRef as useRef15, useState as useState23 } from "react";
|
|
9047
|
+
import clsx79 from "clsx";
|
|
9048
|
+
import { ChevronRightIcon as ChevronRightIcon7 } from "lucide-react";
|
|
9049
|
+
import { jsx as jsx99, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
8199
9050
|
var ROW = {
|
|
8200
9051
|
sm: "min-h-8 py-1 text-body-xs",
|
|
8201
9052
|
md: "min-h-10 py-2 text-body-sm"
|
|
@@ -8225,10 +9076,10 @@ function TreeView({
|
|
|
8225
9076
|
value: selectedProp,
|
|
8226
9077
|
defaultValue: defaultSelected
|
|
8227
9078
|
});
|
|
8228
|
-
const [focusedId, setFocusedId] =
|
|
9079
|
+
const [focusedId, setFocusedId] = useState23(null);
|
|
8229
9080
|
const rowRefs = useRef15(/* @__PURE__ */ new Map());
|
|
8230
|
-
const expandedSet =
|
|
8231
|
-
const visible =
|
|
9081
|
+
const expandedSet = useMemo13(() => new Set(expanded), [expanded]);
|
|
9082
|
+
const visible = useMemo13(() => {
|
|
8232
9083
|
const out = [];
|
|
8233
9084
|
const walk = (nodes, level, parentId) => {
|
|
8234
9085
|
for (const item of nodes) {
|
|
@@ -8299,7 +9150,7 @@ function TreeView({
|
|
|
8299
9150
|
if (!node) return null;
|
|
8300
9151
|
const children = getChildren?.(item) ?? [];
|
|
8301
9152
|
const isSelected = selected === id;
|
|
8302
|
-
return /* @__PURE__ */
|
|
9153
|
+
return /* @__PURE__ */ jsxs71(
|
|
8303
9154
|
"li",
|
|
8304
9155
|
{
|
|
8305
9156
|
role: "treeitem",
|
|
@@ -8321,7 +9172,7 @@ function TreeView({
|
|
|
8321
9172
|
},
|
|
8322
9173
|
className: "outline-none [&:focus-visible>div]:ring-2 [&:focus-visible>div]:ring-inset [&:focus-visible>div]:ring-brand",
|
|
8323
9174
|
children: [
|
|
8324
|
-
/* @__PURE__ */
|
|
9175
|
+
/* @__PURE__ */ jsxs71(
|
|
8325
9176
|
"div",
|
|
8326
9177
|
{
|
|
8327
9178
|
onClick: () => {
|
|
@@ -8329,7 +9180,7 @@ function TreeView({
|
|
|
8329
9180
|
choose(node);
|
|
8330
9181
|
},
|
|
8331
9182
|
style: { paddingLeft: 8 + (level - 1) * INDENT },
|
|
8332
|
-
className:
|
|
9183
|
+
className: clsx79(
|
|
8333
9184
|
"flex w-full cursor-pointer items-center gap-1.5 rounded-md pr-2 transition-colors",
|
|
8334
9185
|
ROW[size],
|
|
8335
9186
|
isSelected ? "bg-brand-secondary text-default" : "text-default hover:bg-default-secondary"
|
|
@@ -8339,7 +9190,7 @@ function TreeView({
|
|
|
8339
9190
|
// Not a button: the treeitem is the one tab stop, and Left/Right already toggle.
|
|
8340
9191
|
// A pointer user still needs a target that toggles without selecting.
|
|
8341
9192
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
8342
|
-
/* @__PURE__ */
|
|
9193
|
+
/* @__PURE__ */ jsx99(
|
|
8343
9194
|
"span",
|
|
8344
9195
|
{
|
|
8345
9196
|
"aria-hidden": true,
|
|
@@ -8350,11 +9201,11 @@ function TreeView({
|
|
|
8350
9201
|
focus(id);
|
|
8351
9202
|
},
|
|
8352
9203
|
className: "flex size-5 shrink-0 items-center justify-center rounded text-icon-default-secondary hover:bg-default-tertiary",
|
|
8353
|
-
children: /* @__PURE__ */
|
|
9204
|
+
children: /* @__PURE__ */ jsx99(ChevronRightIcon7, { className: clsx79("size-3.5 transition-transform motion-reduce:transition-none", node.expanded && "rotate-90") })
|
|
8354
9205
|
}
|
|
8355
9206
|
)
|
|
8356
|
-
) : /* @__PURE__ */
|
|
8357
|
-
/* @__PURE__ */
|
|
9207
|
+
) : /* @__PURE__ */ jsx99("span", { "aria-hidden": true, className: "size-5 shrink-0" }),
|
|
9208
|
+
/* @__PURE__ */ jsx99("div", { className: "min-w-0 flex-1", children: renderItem(item, {
|
|
8358
9209
|
level,
|
|
8359
9210
|
hasChildren: node.hasChildren,
|
|
8360
9211
|
expanded: node.expanded,
|
|
@@ -8363,49 +9214,51 @@ function TreeView({
|
|
|
8363
9214
|
]
|
|
8364
9215
|
}
|
|
8365
9216
|
),
|
|
8366
|
-
node.expanded && /* @__PURE__ */
|
|
9217
|
+
node.expanded && /* @__PURE__ */ jsx99("ul", { role: "group", className: "m-0 list-none p-0", children: renderLevel(children, level + 1) })
|
|
8367
9218
|
]
|
|
8368
9219
|
},
|
|
8369
9220
|
id
|
|
8370
9221
|
);
|
|
8371
9222
|
});
|
|
8372
|
-
return /* @__PURE__ */
|
|
9223
|
+
return /* @__PURE__ */ jsx99("ul", { role: "tree", "aria-label": label, className: clsx79("m-0 flex list-none flex-col p-0", className), children: renderLevel(items, 1) });
|
|
8373
9224
|
}
|
|
8374
9225
|
|
|
8375
9226
|
// src/index.tsx
|
|
8376
9227
|
export * from "./data-table.js";
|
|
8377
9228
|
|
|
8378
9229
|
// src/components/feedback/inline-alert.tsx
|
|
8379
|
-
import
|
|
9230
|
+
import clsx80 from "clsx";
|
|
8380
9231
|
import { CircleCheckBigIcon as CircleCheckBigIcon2, InfoIcon as InfoIcon2, TriangleAlertIcon as TriangleAlertIcon2 } from "lucide-react";
|
|
8381
|
-
import { jsx as
|
|
9232
|
+
import { jsx as jsx100, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
8382
9233
|
var toneStyles3 = {
|
|
8383
9234
|
info: "border-brand-tertiary bg-brand-tertiary text-brand",
|
|
8384
9235
|
warning: "border-warning-tertiary bg-warning-tertiary text-warning",
|
|
8385
9236
|
danger: "border-danger-tertiary bg-danger-tertiary text-danger",
|
|
8386
|
-
positive: "border-positive-tertiary bg-positive-tertiary text-positive"
|
|
9237
|
+
positive: "border-positive-tertiary bg-positive-tertiary text-positive",
|
|
9238
|
+
neutral: "border-default bg-default text-default-secondary"
|
|
8387
9239
|
};
|
|
8388
9240
|
var toneIcons = {
|
|
8389
|
-
info: /* @__PURE__ */
|
|
8390
|
-
warning: /* @__PURE__ */
|
|
8391
|
-
danger: /* @__PURE__ */
|
|
8392
|
-
positive: /* @__PURE__ */
|
|
9241
|
+
info: /* @__PURE__ */ jsx100(InfoIcon2, { className: "size-4" }),
|
|
9242
|
+
warning: /* @__PURE__ */ jsx100(TriangleAlertIcon2, { className: "size-4" }),
|
|
9243
|
+
danger: /* @__PURE__ */ jsx100(TriangleAlertIcon2, { className: "size-4" }),
|
|
9244
|
+
positive: /* @__PURE__ */ jsx100(CircleCheckBigIcon2, { className: "size-4" }),
|
|
9245
|
+
neutral: /* @__PURE__ */ jsx100(InfoIcon2, { className: "size-4 text-icon-default-secondary" })
|
|
8393
9246
|
};
|
|
8394
|
-
function InlineAlert({ tone, children, icon, className }) {
|
|
9247
|
+
function InlineAlert({ tone, children, icon, role, className }) {
|
|
8395
9248
|
const glyph = icon === void 0 ? toneIcons[tone] : icon;
|
|
8396
|
-
return /* @__PURE__ */
|
|
9249
|
+
return /* @__PURE__ */ jsxs72(
|
|
8397
9250
|
"div",
|
|
8398
9251
|
{
|
|
8399
9252
|
"data-tone": tone,
|
|
8400
|
-
role: tone === "danger" ? "alert" : "status",
|
|
8401
|
-
className:
|
|
9253
|
+
role: role ?? (tone === "danger" ? "alert" : "status"),
|
|
9254
|
+
className: clsx80(
|
|
8402
9255
|
"flex items-start gap-3 rounded-xl border p-4 text-body-xs",
|
|
8403
9256
|
toneStyles3[tone],
|
|
8404
9257
|
className
|
|
8405
9258
|
),
|
|
8406
9259
|
children: [
|
|
8407
|
-
glyph && /* @__PURE__ */
|
|
8408
|
-
/* @__PURE__ */
|
|
9260
|
+
glyph && /* @__PURE__ */ jsx100("span", { "aria-hidden": true, className: "mt-px shrink-0", children: glyph }),
|
|
9261
|
+
/* @__PURE__ */ jsx100("div", { className: "min-w-0", children })
|
|
8409
9262
|
]
|
|
8410
9263
|
}
|
|
8411
9264
|
);
|
|
@@ -8413,7 +9266,7 @@ function InlineAlert({ tone, children, icon, className }) {
|
|
|
8413
9266
|
|
|
8414
9267
|
// src/components/feedback/error-boundary.tsx
|
|
8415
9268
|
import { Component } from "react";
|
|
8416
|
-
import { jsx as
|
|
9269
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
8417
9270
|
var ErrorBoundary = class extends Component {
|
|
8418
9271
|
constructor() {
|
|
8419
9272
|
super(...arguments);
|
|
@@ -8433,7 +9286,7 @@ var ErrorBoundary = class extends Component {
|
|
|
8433
9286
|
}
|
|
8434
9287
|
render() {
|
|
8435
9288
|
if (!this.state.error) return this.props.children;
|
|
8436
|
-
return this.props.fallback ?? /* @__PURE__ */
|
|
9289
|
+
return this.props.fallback ?? /* @__PURE__ */ jsx101(
|
|
8437
9290
|
"div",
|
|
8438
9291
|
{
|
|
8439
9292
|
role: "status",
|
|
@@ -8446,29 +9299,32 @@ var ErrorBoundary = class extends Component {
|
|
|
8446
9299
|
};
|
|
8447
9300
|
|
|
8448
9301
|
// src/components/feedback/banner.tsx
|
|
8449
|
-
import { forwardRef as
|
|
8450
|
-
import
|
|
9302
|
+
import { forwardRef as forwardRef33, useId as useId21 } from "react";
|
|
9303
|
+
import clsx81 from "clsx";
|
|
8451
9304
|
import { CircleCheckBigIcon as CircleCheckBigIcon3, InfoIcon as InfoIcon3, TriangleAlertIcon as TriangleAlertIcon3, XIcon as XIcon7 } from "lucide-react";
|
|
8452
|
-
import { jsx as
|
|
9305
|
+
import { jsx as jsx102, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
8453
9306
|
var TONE_STYLES3 = {
|
|
8454
9307
|
info: "border-brand-tertiary bg-brand-tertiary text-default",
|
|
8455
9308
|
positive: "border-positive-tertiary bg-positive-tertiary text-default",
|
|
8456
9309
|
warning: "border-warning-tertiary bg-warning-tertiary text-default",
|
|
8457
|
-
danger: "border-danger-tertiary bg-danger-tertiary text-default"
|
|
9310
|
+
danger: "border-danger-tertiary bg-danger-tertiary text-default",
|
|
9311
|
+
neutral: "border-default bg-default text-default"
|
|
8458
9312
|
};
|
|
8459
9313
|
var TONE_ICON_COLOR = {
|
|
8460
9314
|
info: "text-icon-brand",
|
|
8461
9315
|
positive: "text-icon-positive",
|
|
8462
9316
|
warning: "text-icon-warning",
|
|
8463
|
-
danger: "text-icon-danger"
|
|
9317
|
+
danger: "text-icon-danger",
|
|
9318
|
+
neutral: "text-icon-default-secondary"
|
|
8464
9319
|
};
|
|
8465
9320
|
var TONE_ICON2 = {
|
|
8466
|
-
info: /* @__PURE__ */
|
|
8467
|
-
positive: /* @__PURE__ */
|
|
8468
|
-
warning: /* @__PURE__ */
|
|
8469
|
-
danger: /* @__PURE__ */
|
|
9321
|
+
info: /* @__PURE__ */ jsx102(InfoIcon3, { "aria-hidden": true, className: "size-5" }),
|
|
9322
|
+
positive: /* @__PURE__ */ jsx102(CircleCheckBigIcon3, { "aria-hidden": true, className: "size-5" }),
|
|
9323
|
+
warning: /* @__PURE__ */ jsx102(TriangleAlertIcon3, { "aria-hidden": true, className: "size-5" }),
|
|
9324
|
+
danger: /* @__PURE__ */ jsx102(TriangleAlertIcon3, { "aria-hidden": true, className: "size-5" }),
|
|
9325
|
+
neutral: /* @__PURE__ */ jsx102(InfoIcon3, { "aria-hidden": true, className: "size-5" })
|
|
8470
9326
|
};
|
|
8471
|
-
var Banner =
|
|
9327
|
+
var Banner = forwardRef33(function Banner2({
|
|
8472
9328
|
title,
|
|
8473
9329
|
children,
|
|
8474
9330
|
variant = "message",
|
|
@@ -8479,9 +9335,9 @@ var Banner = forwardRef31(function Banner2({
|
|
|
8479
9335
|
className,
|
|
8480
9336
|
...rest
|
|
8481
9337
|
}, ref) {
|
|
8482
|
-
const titleId =
|
|
9338
|
+
const titleId = useId21();
|
|
8483
9339
|
const glyph = icon === void 0 ? TONE_ICON2[tone] : icon;
|
|
8484
|
-
return /* @__PURE__ */
|
|
9340
|
+
return /* @__PURE__ */ jsxs73(
|
|
8485
9341
|
"div",
|
|
8486
9342
|
{
|
|
8487
9343
|
"data-tone": tone,
|
|
@@ -8490,20 +9346,20 @@ var Banner = forwardRef31(function Banner2({
|
|
|
8490
9346
|
role: variant === "alert" ? "alert" : "status",
|
|
8491
9347
|
"aria-labelledby": titleId,
|
|
8492
9348
|
"data-slot": "banner",
|
|
8493
|
-
className:
|
|
9349
|
+
className: clsx81(
|
|
8494
9350
|
"flex w-full items-start gap-3 rounded-xl border p-4",
|
|
8495
9351
|
TONE_STYLES3[tone],
|
|
8496
9352
|
className
|
|
8497
9353
|
),
|
|
8498
9354
|
...rest,
|
|
8499
9355
|
children: [
|
|
8500
|
-
glyph && /* @__PURE__ */
|
|
8501
|
-
/* @__PURE__ */
|
|
8502
|
-
/* @__PURE__ */
|
|
8503
|
-
children && /* @__PURE__ */
|
|
8504
|
-
action && /* @__PURE__ */
|
|
9356
|
+
glyph && /* @__PURE__ */ jsx102("span", { "aria-hidden": true, className: clsx81("mt-px shrink-0", TONE_ICON_COLOR[tone]), children: glyph }),
|
|
9357
|
+
/* @__PURE__ */ jsxs73("div", { className: "min-w-0 flex-1", children: [
|
|
9358
|
+
/* @__PURE__ */ jsx102("p", { id: titleId, className: "text-body-sm font-semibold text-default", children: title }),
|
|
9359
|
+
children && /* @__PURE__ */ jsx102("div", { className: "mt-1 text-body-xs text-default-secondary", children }),
|
|
9360
|
+
action && /* @__PURE__ */ jsx102("div", { className: "mt-3 flex items-center gap-2", children: action })
|
|
8505
9361
|
] }),
|
|
8506
|
-
onDismiss && /* @__PURE__ */
|
|
9362
|
+
onDismiss && /* @__PURE__ */ jsx102(
|
|
8507
9363
|
IconButton,
|
|
8508
9364
|
{
|
|
8509
9365
|
variant: "subtle",
|
|
@@ -8511,7 +9367,7 @@ var Banner = forwardRef31(function Banner2({
|
|
|
8511
9367
|
"aria-label": typeof title === "string" ? `Dismiss: ${title}` : "Dismiss",
|
|
8512
9368
|
onClick: onDismiss,
|
|
8513
9369
|
className: "-mr-1 -mt-1 shrink-0",
|
|
8514
|
-
children: /* @__PURE__ */
|
|
9370
|
+
children: /* @__PURE__ */ jsx102(XIcon7, { "aria-hidden": true, size: 16 })
|
|
8515
9371
|
}
|
|
8516
9372
|
)
|
|
8517
9373
|
]
|
|
@@ -8521,34 +9377,36 @@ var Banner = forwardRef31(function Banner2({
|
|
|
8521
9377
|
|
|
8522
9378
|
// src/components/feedback/toast.tsx
|
|
8523
9379
|
import {
|
|
8524
|
-
createContext as
|
|
8525
|
-
useCallback as
|
|
8526
|
-
useContext as
|
|
8527
|
-
useEffect as
|
|
8528
|
-
useMemo as
|
|
9380
|
+
createContext as createContext16,
|
|
9381
|
+
useCallback as useCallback9,
|
|
9382
|
+
useContext as useContext16,
|
|
9383
|
+
useEffect as useEffect14,
|
|
9384
|
+
useMemo as useMemo14,
|
|
8529
9385
|
useRef as useRef16,
|
|
8530
|
-
useState as
|
|
9386
|
+
useState as useState24
|
|
8531
9387
|
} from "react";
|
|
8532
|
-
import
|
|
9388
|
+
import clsx82 from "clsx";
|
|
8533
9389
|
import { CircleCheckBigIcon as CircleCheckBigIcon4, InfoIcon as InfoIcon4, TriangleAlertIcon as TriangleAlertIcon4, XIcon as XIcon8 } from "lucide-react";
|
|
8534
|
-
import { jsx as
|
|
8535
|
-
var ToastContext =
|
|
9390
|
+
import { jsx as jsx103, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
9391
|
+
var ToastContext = createContext16(null);
|
|
8536
9392
|
function useToast() {
|
|
8537
|
-
const context =
|
|
9393
|
+
const context = useContext16(ToastContext);
|
|
8538
9394
|
if (!context) throw new Error("useToast() must be used inside <Toaster>");
|
|
8539
9395
|
return context;
|
|
8540
9396
|
}
|
|
8541
9397
|
var TONE_ICON3 = {
|
|
8542
|
-
info: /* @__PURE__ */
|
|
8543
|
-
positive: /* @__PURE__ */
|
|
8544
|
-
warning: /* @__PURE__ */
|
|
8545
|
-
danger: /* @__PURE__ */
|
|
9398
|
+
info: /* @__PURE__ */ jsx103(InfoIcon4, { "aria-hidden": true, className: "size-4" }),
|
|
9399
|
+
positive: /* @__PURE__ */ jsx103(CircleCheckBigIcon4, { "aria-hidden": true, className: "size-4" }),
|
|
9400
|
+
warning: /* @__PURE__ */ jsx103(TriangleAlertIcon4, { "aria-hidden": true, className: "size-4" }),
|
|
9401
|
+
danger: /* @__PURE__ */ jsx103(TriangleAlertIcon4, { "aria-hidden": true, className: "size-4" }),
|
|
9402
|
+
neutral: /* @__PURE__ */ jsx103(InfoIcon4, { "aria-hidden": true, className: "size-4" })
|
|
8546
9403
|
};
|
|
8547
9404
|
var TONE_ICON_COLOR2 = {
|
|
8548
9405
|
info: "text-icon-brand",
|
|
8549
9406
|
positive: "text-icon-positive",
|
|
8550
9407
|
warning: "text-icon-warning",
|
|
8551
|
-
danger: "text-icon-danger"
|
|
9408
|
+
danger: "text-icon-danger",
|
|
9409
|
+
neutral: "text-icon-default-secondary"
|
|
8552
9410
|
};
|
|
8553
9411
|
var POSITION = {
|
|
8554
9412
|
"top-left": "top-[var(--toaster-mobile-offset)] md:top-[var(--toaster-offset)] left-4 items-start",
|
|
@@ -8569,10 +9427,10 @@ function Toaster({
|
|
|
8569
9427
|
offset = 16,
|
|
8570
9428
|
mobileOffset
|
|
8571
9429
|
}) {
|
|
8572
|
-
const [toasts, setToasts] =
|
|
9430
|
+
const [toasts, setToasts] = useState24([]);
|
|
8573
9431
|
const timers = useRef16(/* @__PURE__ */ new Map());
|
|
8574
9432
|
const counter = useRef16(0);
|
|
8575
|
-
const dismiss =
|
|
9433
|
+
const dismiss = useCallback9((id) => {
|
|
8576
9434
|
const timer = timers.current.get(id);
|
|
8577
9435
|
if (timer) {
|
|
8578
9436
|
clearTimeout(timer);
|
|
@@ -8580,12 +9438,12 @@ function Toaster({
|
|
|
8580
9438
|
}
|
|
8581
9439
|
setToasts((current) => current.filter((entry) => entry.id !== id));
|
|
8582
9440
|
}, []);
|
|
8583
|
-
const dismissAll =
|
|
9441
|
+
const dismissAll = useCallback9(() => {
|
|
8584
9442
|
for (const timer of timers.current.values()) clearTimeout(timer);
|
|
8585
9443
|
timers.current.clear();
|
|
8586
9444
|
setToasts([]);
|
|
8587
9445
|
}, []);
|
|
8588
|
-
const toast =
|
|
9446
|
+
const toast = useCallback9(
|
|
8589
9447
|
(options) => {
|
|
8590
9448
|
counter.current += 1;
|
|
8591
9449
|
const id = `toast-${counter.current}`;
|
|
@@ -8601,23 +9459,23 @@ function Toaster({
|
|
|
8601
9459
|
},
|
|
8602
9460
|
[duration, max, dismiss]
|
|
8603
9461
|
);
|
|
8604
|
-
|
|
9462
|
+
useEffect14(() => {
|
|
8605
9463
|
const map = timers.current;
|
|
8606
9464
|
return () => {
|
|
8607
9465
|
for (const timer of map.values()) clearTimeout(timer);
|
|
8608
9466
|
map.clear();
|
|
8609
9467
|
};
|
|
8610
9468
|
}, []);
|
|
8611
|
-
const context =
|
|
8612
|
-
return /* @__PURE__ */
|
|
9469
|
+
const context = useMemo14(() => ({ toast, dismiss, dismissAll }), [toast, dismiss, dismissAll]);
|
|
9470
|
+
return /* @__PURE__ */ jsxs74(ToastContext.Provider, { value: context, children: [
|
|
8613
9471
|
children,
|
|
8614
|
-
/* @__PURE__ */
|
|
9472
|
+
/* @__PURE__ */ jsx103(Portal, { children: /* @__PURE__ */ jsx103(
|
|
8615
9473
|
"div",
|
|
8616
9474
|
{
|
|
8617
9475
|
"aria-live": "polite",
|
|
8618
9476
|
"aria-atomic": "false",
|
|
8619
9477
|
...{ [TOASTER_ATTRIBUTE]: "" },
|
|
8620
|
-
className:
|
|
9478
|
+
className: clsx82(
|
|
8621
9479
|
"pointer-events-none fixed z-toast flex w-[calc(100%-2rem)] max-w-[380px] flex-col gap-2",
|
|
8622
9480
|
POSITION[position]
|
|
8623
9481
|
),
|
|
@@ -8625,29 +9483,29 @@ function Toaster({
|
|
|
8625
9483
|
"--toaster-offset": toLength(offset),
|
|
8626
9484
|
"--toaster-mobile-offset": toLength(mobileOffset ?? offset)
|
|
8627
9485
|
},
|
|
8628
|
-
children: toasts.map((entry) => /* @__PURE__ */
|
|
9486
|
+
children: toasts.map((entry) => /* @__PURE__ */ jsx103(ToastItem, { toast: entry, onDismiss: () => dismiss(entry.id) }, entry.id))
|
|
8629
9487
|
}
|
|
8630
9488
|
) })
|
|
8631
9489
|
] });
|
|
8632
9490
|
}
|
|
8633
9491
|
function ToastItem({ toast, onDismiss }) {
|
|
8634
9492
|
const tone = toast.tone ?? "info";
|
|
8635
|
-
return /* @__PURE__ */
|
|
9493
|
+
return /* @__PURE__ */ jsxs74(
|
|
8636
9494
|
"div",
|
|
8637
9495
|
{
|
|
8638
9496
|
role: tone === "danger" ? "alert" : "status",
|
|
8639
|
-
className:
|
|
9497
|
+
className: clsx82(
|
|
8640
9498
|
"pointer-events-auto flex w-full items-start gap-3 rounded-xl border border-default",
|
|
8641
9499
|
"bg-default p-4 shadow-400"
|
|
8642
9500
|
),
|
|
8643
9501
|
children: [
|
|
8644
|
-
/* @__PURE__ */
|
|
8645
|
-
/* @__PURE__ */
|
|
8646
|
-
/* @__PURE__ */
|
|
8647
|
-
toast.description && /* @__PURE__ */
|
|
8648
|
-
toast.action && /* @__PURE__ */
|
|
9502
|
+
/* @__PURE__ */ jsx103("span", { "aria-hidden": true, className: clsx82("mt-px shrink-0", TONE_ICON_COLOR2[tone]), children: TONE_ICON3[tone] }),
|
|
9503
|
+
/* @__PURE__ */ jsxs74("div", { className: "min-w-0 flex-1", children: [
|
|
9504
|
+
/* @__PURE__ */ jsx103("p", { className: "text-body-sm font-semibold text-default", children: toast.title }),
|
|
9505
|
+
toast.description && /* @__PURE__ */ jsx103("p", { className: "mt-0.5 text-body-xs text-default-secondary", children: toast.description }),
|
|
9506
|
+
toast.action && /* @__PURE__ */ jsx103("div", { className: "mt-2 flex items-center gap-2", children: toast.action })
|
|
8649
9507
|
] }),
|
|
8650
|
-
/* @__PURE__ */
|
|
9508
|
+
/* @__PURE__ */ jsx103(
|
|
8651
9509
|
IconButton,
|
|
8652
9510
|
{
|
|
8653
9511
|
variant: "subtle",
|
|
@@ -8655,7 +9513,7 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
8655
9513
|
"aria-label": typeof toast.title === "string" ? `Dismiss: ${toast.title}` : "Dismiss",
|
|
8656
9514
|
onClick: onDismiss,
|
|
8657
9515
|
className: "-mr-1 -mt-1 shrink-0",
|
|
8658
|
-
children: /* @__PURE__ */
|
|
9516
|
+
children: /* @__PURE__ */ jsx103(XIcon8, { "aria-hidden": true, size: 14 })
|
|
8659
9517
|
}
|
|
8660
9518
|
)
|
|
8661
9519
|
]
|
|
@@ -8664,25 +9522,25 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
8664
9522
|
}
|
|
8665
9523
|
|
|
8666
9524
|
// src/components/forms/password-input.tsx
|
|
8667
|
-
import { forwardRef as
|
|
9525
|
+
import { forwardRef as forwardRef34, useState as useState25 } from "react";
|
|
8668
9526
|
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
8669
|
-
import { jsx as
|
|
8670
|
-
var PasswordInput =
|
|
8671
|
-
const [visible, setVisible] =
|
|
8672
|
-
return /* @__PURE__ */
|
|
9527
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
9528
|
+
var PasswordInput = forwardRef34(function PasswordInput2(props, ref) {
|
|
9529
|
+
const [visible, setVisible] = useState25(false);
|
|
9530
|
+
return /* @__PURE__ */ jsx104(
|
|
8673
9531
|
Input,
|
|
8674
9532
|
{
|
|
8675
9533
|
ref,
|
|
8676
9534
|
...props,
|
|
8677
9535
|
type: visible ? "text" : "password",
|
|
8678
|
-
trailingAction: /* @__PURE__ */
|
|
9536
|
+
trailingAction: /* @__PURE__ */ jsx104(
|
|
8679
9537
|
"button",
|
|
8680
9538
|
{
|
|
8681
9539
|
type: "button",
|
|
8682
9540
|
"aria-label": visible ? "Hide password" : "Show password",
|
|
8683
9541
|
onClick: () => setVisible((v) => !v),
|
|
8684
9542
|
className: "flex items-center justify-center rounded transition-colors hover:text-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",
|
|
8685
|
-
children: visible ? /* @__PURE__ */
|
|
9543
|
+
children: visible ? /* @__PURE__ */ jsx104(EyeOffIcon, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx104(EyeIcon, { "aria-hidden": true, className: "size-4" })
|
|
8686
9544
|
}
|
|
8687
9545
|
)
|
|
8688
9546
|
}
|
|
@@ -8690,31 +9548,31 @@ var PasswordInput = forwardRef32(function PasswordInput2(props, ref) {
|
|
|
8690
9548
|
});
|
|
8691
9549
|
|
|
8692
9550
|
// src/components/ai/ai-chat-bar.tsx
|
|
8693
|
-
import
|
|
9551
|
+
import clsx83 from "clsx";
|
|
8694
9552
|
import { ArrowRightIcon as ArrowRightIcon2, SearchIcon as SearchIcon2 } from "lucide-react";
|
|
8695
|
-
import { jsx as
|
|
9553
|
+
import { jsx as jsx105, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
8696
9554
|
function AIChatBar({
|
|
8697
9555
|
placeholder = "Ask Intelligence about any entity, supplier, or risk\u2026",
|
|
8698
9556
|
className
|
|
8699
9557
|
}) {
|
|
8700
|
-
return /* @__PURE__ */
|
|
9558
|
+
return /* @__PURE__ */ jsxs75(
|
|
8701
9559
|
"div",
|
|
8702
9560
|
{
|
|
8703
|
-
className:
|
|
9561
|
+
className: clsx83(
|
|
8704
9562
|
"flex h-16 items-center gap-3 rounded-2xl border border-default bg-default px-6 shadow-panel",
|
|
8705
9563
|
className
|
|
8706
9564
|
),
|
|
8707
9565
|
children: [
|
|
8708
|
-
/* @__PURE__ */
|
|
8709
|
-
/* @__PURE__ */
|
|
8710
|
-
/* @__PURE__ */
|
|
9566
|
+
/* @__PURE__ */ jsx105("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ jsx105(SearchIcon2, { className: "size-4" }) }),
|
|
9567
|
+
/* @__PURE__ */ jsx105("p", { className: "flex-1 text-body-sm text-default-tertiary truncate", children: placeholder }),
|
|
9568
|
+
/* @__PURE__ */ jsxs75(
|
|
8711
9569
|
"button",
|
|
8712
9570
|
{
|
|
8713
9571
|
type: "button",
|
|
8714
9572
|
className: "inline-flex shrink-0 items-center gap-2 rounded-xl bg-brand px-4 py-3 text-body-sm font-semibold text-brand-on-brand hover:bg-brand-hover transition-colors",
|
|
8715
9573
|
children: [
|
|
8716
9574
|
"Ask",
|
|
8717
|
-
/* @__PURE__ */
|
|
9575
|
+
/* @__PURE__ */ jsx105(ArrowRightIcon2, { "aria-hidden": true, className: "size-4" })
|
|
8718
9576
|
]
|
|
8719
9577
|
}
|
|
8720
9578
|
)
|
|
@@ -8724,42 +9582,42 @@ function AIChatBar({
|
|
|
8724
9582
|
}
|
|
8725
9583
|
|
|
8726
9584
|
// src/components/ai/ai-suggestion-chip.tsx
|
|
8727
|
-
import
|
|
9585
|
+
import clsx84 from "clsx";
|
|
8728
9586
|
import { ArrowRightIcon as ArrowRightIcon3, CpuIcon } from "lucide-react";
|
|
8729
|
-
import { jsx as
|
|
9587
|
+
import { jsx as jsx106, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
8730
9588
|
function AISuggestionChip({ prompt, onClick, className }) {
|
|
8731
|
-
return /* @__PURE__ */
|
|
9589
|
+
return /* @__PURE__ */ jsxs76(
|
|
8732
9590
|
"button",
|
|
8733
9591
|
{
|
|
8734
9592
|
type: "button",
|
|
8735
9593
|
onClick,
|
|
8736
|
-
className:
|
|
9594
|
+
className: clsx84(
|
|
8737
9595
|
"flex h-12 w-full items-center gap-3 rounded-xl border border-default bg-default px-3 text-left hover:bg-default-hover transition-colors",
|
|
8738
9596
|
className
|
|
8739
9597
|
),
|
|
8740
9598
|
children: [
|
|
8741
|
-
/* @__PURE__ */
|
|
8742
|
-
/* @__PURE__ */
|
|
8743
|
-
/* @__PURE__ */
|
|
9599
|
+
/* @__PURE__ */ jsx106("span", { "aria-hidden": true, className: "shrink-0 text-icon-brand", children: /* @__PURE__ */ jsx106(CpuIcon, { className: "size-4" }) }),
|
|
9600
|
+
/* @__PURE__ */ jsx106("span", { className: "flex-1 text-body-sm text-default truncate", children: prompt }),
|
|
9601
|
+
/* @__PURE__ */ jsx106("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ jsx106(ArrowRightIcon3, { className: "size-3.5", strokeWidth: 2.5 }) })
|
|
8744
9602
|
]
|
|
8745
9603
|
}
|
|
8746
9604
|
);
|
|
8747
9605
|
}
|
|
8748
9606
|
|
|
8749
9607
|
// src/components/ai/quick-actions-bar.tsx
|
|
8750
|
-
import
|
|
8751
|
-
import { jsx as
|
|
9608
|
+
import clsx85 from "clsx";
|
|
9609
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
8752
9610
|
function QuickActionsBar({ actions, active, onSelect, className }) {
|
|
8753
|
-
return /* @__PURE__ */
|
|
9611
|
+
return /* @__PURE__ */ jsx107("div", { className: clsx85("flex flex-wrap items-center gap-3", className), children: actions.map((action) => {
|
|
8754
9612
|
const isActive = active === action.value;
|
|
8755
|
-
return /* @__PURE__ */
|
|
9613
|
+
return /* @__PURE__ */ jsx107(
|
|
8756
9614
|
"button",
|
|
8757
9615
|
{
|
|
8758
9616
|
type: "button",
|
|
8759
9617
|
"aria-pressed": isActive,
|
|
8760
9618
|
onClick: () => onSelect?.(action.value),
|
|
8761
9619
|
className: "rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
8762
|
-
children: /* @__PURE__ */
|
|
9620
|
+
children: /* @__PURE__ */ jsx107(TagPill, { label: action.label, tone: isActive ? "brand" : "default" })
|
|
8763
9621
|
},
|
|
8764
9622
|
action.value
|
|
8765
9623
|
);
|
|
@@ -8767,25 +9625,25 @@ function QuickActionsBar({ actions, active, onSelect, className }) {
|
|
|
8767
9625
|
}
|
|
8768
9626
|
|
|
8769
9627
|
// src/components/ai/chat.tsx
|
|
8770
|
-
import
|
|
9628
|
+
import clsx86 from "clsx";
|
|
8771
9629
|
import { CpuIcon as CpuIcon2 } from "lucide-react";
|
|
8772
|
-
import { jsx as
|
|
9630
|
+
import { jsx as jsx108, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
8773
9631
|
function AiAvatar({ className, icon }) {
|
|
8774
|
-
return /* @__PURE__ */
|
|
9632
|
+
return /* @__PURE__ */ jsx108(
|
|
8775
9633
|
"span",
|
|
8776
9634
|
{
|
|
8777
9635
|
"aria-hidden": true,
|
|
8778
9636
|
className: cn("flex size-8 shrink-0 items-center justify-center rounded-full bg-brand text-icon-brand-on-brand", className),
|
|
8779
|
-
children: icon ?? /* @__PURE__ */
|
|
9637
|
+
children: icon ?? /* @__PURE__ */ jsx108(CpuIcon2, { className: "size-3.5" })
|
|
8780
9638
|
}
|
|
8781
9639
|
);
|
|
8782
9640
|
}
|
|
8783
9641
|
function TypingIndicator({ label = "Assistant is typing", className }) {
|
|
8784
|
-
return /* @__PURE__ */
|
|
8785
|
-
/* @__PURE__ */
|
|
8786
|
-
/* @__PURE__ */
|
|
8787
|
-
/* @__PURE__ */
|
|
8788
|
-
/* @__PURE__ */
|
|
9642
|
+
return /* @__PURE__ */ jsxs77("div", { role: "status", "aria-live": "polite", className: cn("flex items-center gap-3", className), children: [
|
|
9643
|
+
/* @__PURE__ */ jsx108(AiAvatar, {}),
|
|
9644
|
+
/* @__PURE__ */ jsxs77("div", { className: "flex items-center gap-2 rounded-2xl rounded-tl-sm border border-default bg-default-secondary px-5 py-3", children: [
|
|
9645
|
+
/* @__PURE__ */ jsx108("span", { className: "text-body-xs text-default-secondary", children: label }),
|
|
9646
|
+
/* @__PURE__ */ jsx108("span", { "aria-hidden": true, className: "flex gap-1", children: [0, 1, 2].map((index) => /* @__PURE__ */ jsx108(
|
|
8789
9647
|
"span",
|
|
8790
9648
|
{
|
|
8791
9649
|
className: "inline-block size-1.5 rounded-full bg-default-tertiary motion-safe:animate-bounce",
|
|
@@ -8798,16 +9656,16 @@ function TypingIndicator({ label = "Assistant is typing", className }) {
|
|
|
8798
9656
|
}
|
|
8799
9657
|
function ChatBubble({ sender, children, failed = false, className }) {
|
|
8800
9658
|
if (sender === "user") {
|
|
8801
|
-
return /* @__PURE__ */
|
|
9659
|
+
return /* @__PURE__ */ jsx108("div", { "data-sender": "user", className: cn("flex justify-end", className), children: /* @__PURE__ */ jsx108("div", { className: "max-w-[85%] rounded-[18px] rounded-tr-sm bg-neutral px-5 py-3.5 text-body-sm leading-relaxed text-neutral-on-neutral md:max-w-[441px] md:px-7 md:py-4", children }) });
|
|
8802
9660
|
}
|
|
8803
|
-
return /* @__PURE__ */
|
|
9661
|
+
return /* @__PURE__ */ jsx108(
|
|
8804
9662
|
"div",
|
|
8805
9663
|
{
|
|
8806
9664
|
"data-sender": "assistant",
|
|
8807
9665
|
"data-state": failed ? "failed" : void 0,
|
|
8808
9666
|
className: cn(
|
|
8809
9667
|
"rounded-2xl rounded-tl-sm border px-5 py-4 text-body-sm leading-relaxed",
|
|
8810
|
-
|
|
9668
|
+
clsx86(
|
|
8811
9669
|
"border-default bg-default-secondary text-default",
|
|
8812
9670
|
"data-[state=failed]:border-danger-secondary data-[state=failed]:bg-danger-tertiary data-[state=failed]:text-danger"
|
|
8813
9671
|
),
|
|
@@ -8819,17 +9677,17 @@ function ChatBubble({ sender, children, failed = false, className }) {
|
|
|
8819
9677
|
}
|
|
8820
9678
|
|
|
8821
9679
|
// src/components/decorative/aurora-backdrop.tsx
|
|
8822
|
-
import { jsx as
|
|
9680
|
+
import { jsx as jsx109, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
8823
9681
|
function blob(primitive, alpha) {
|
|
8824
9682
|
return `radial-gradient(ellipse, color-mix(in srgb, var(${primitive}) ${alpha}%, transparent) 0%, transparent 70%)`;
|
|
8825
9683
|
}
|
|
8826
9684
|
function AuroraBackdrop() {
|
|
8827
|
-
return /* @__PURE__ */
|
|
8828
|
-
/* @__PURE__ */
|
|
8829
|
-
/* @__PURE__ */
|
|
8830
|
-
/* @__PURE__ */
|
|
8831
|
-
/* @__PURE__ */
|
|
8832
|
-
/* @__PURE__ */
|
|
9685
|
+
return /* @__PURE__ */ jsxs78("div", { className: "pointer-events-none absolute inset-0", "aria-hidden": true, children: [
|
|
9686
|
+
/* @__PURE__ */ jsx109("div", { className: "absolute -left-24 -top-28", style: { width: 380, height: 380, background: blob("--prim-red-400", 45) } }),
|
|
9687
|
+
/* @__PURE__ */ jsx109("div", { className: "absolute -top-24 right-[-4%]", style: { width: 320, height: 320, background: blob("--prim-red-300", 40) } }),
|
|
9688
|
+
/* @__PURE__ */ jsx109("div", { className: "absolute bottom-[-10%] right-[14%]", style: { width: 420, height: 420, background: blob("--prim-violet-400", 30) } }),
|
|
9689
|
+
/* @__PURE__ */ jsx109("div", { className: "absolute bottom-[-6%] left-[4%]", style: { width: 280, height: 280, background: blob("--prim-blue-400", 25) } }),
|
|
9690
|
+
/* @__PURE__ */ jsx109("div", { className: "absolute left-[20%] top-[30%]", style: { width: 240, height: 240, background: blob("--prim-blue-300", 18) } })
|
|
8833
9691
|
] });
|
|
8834
9692
|
}
|
|
8835
9693
|
export {
|
|
@@ -8846,6 +9704,7 @@ export {
|
|
|
8846
9704
|
Avatar,
|
|
8847
9705
|
AvatarBlock,
|
|
8848
9706
|
AvatarGroup,
|
|
9707
|
+
BADGE_COLORS,
|
|
8849
9708
|
Badge,
|
|
8850
9709
|
Banner,
|
|
8851
9710
|
BarChart,
|
|
@@ -8982,6 +9841,7 @@ export {
|
|
|
8982
9841
|
Label,
|
|
8983
9842
|
LegendDot,
|
|
8984
9843
|
ListRow,
|
|
9844
|
+
Listbox,
|
|
8985
9845
|
Menubar,
|
|
8986
9846
|
MenubarCheckboxItem,
|
|
8987
9847
|
MenubarContent,
|
|
@@ -9010,7 +9870,9 @@ export {
|
|
|
9010
9870
|
MultiSelectCard,
|
|
9011
9871
|
NativeSelect,
|
|
9012
9872
|
NativeSelectControl,
|
|
9873
|
+
NavGroupHeader,
|
|
9013
9874
|
NavItem,
|
|
9875
|
+
NavSubItem,
|
|
9014
9876
|
NavigationMenu,
|
|
9015
9877
|
NavigationMenuItem,
|
|
9016
9878
|
NoteConfirmModal,
|
|
@@ -9053,6 +9915,11 @@ export {
|
|
|
9053
9915
|
Select,
|
|
9054
9916
|
SelectControl,
|
|
9055
9917
|
Separator,
|
|
9918
|
+
Sidebar,
|
|
9919
|
+
SidebarProvider,
|
|
9920
|
+
SidebarSeparator,
|
|
9921
|
+
SidebarTrigger,
|
|
9922
|
+
SidebarUserCard,
|
|
9056
9923
|
Skeleton,
|
|
9057
9924
|
Slider,
|
|
9058
9925
|
Slot,
|
|
@@ -9127,6 +9994,8 @@ export {
|
|
|
9127
9994
|
composeRefs,
|
|
9128
9995
|
countryOptions,
|
|
9129
9996
|
currentZoneName,
|
|
9997
|
+
filterNav,
|
|
9998
|
+
filterNavItems,
|
|
9130
9999
|
formatFileSize,
|
|
9131
10000
|
getScoreTone,
|
|
9132
10001
|
nextTier,
|
|
@@ -9146,6 +10015,7 @@ export {
|
|
|
9146
10015
|
useFilePicker,
|
|
9147
10016
|
useOverlayDismiss,
|
|
9148
10017
|
usePortalContainer,
|
|
10018
|
+
useSidebar,
|
|
9149
10019
|
useToast,
|
|
9150
10020
|
useWidgetHeaderAccessory,
|
|
9151
10021
|
useWidthTier
|