@platned/ui 0.9.3 → 0.9.5
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 +2788 -0
- package/dist/chunk-OGQIGGVB.js.map +1 -0
- package/dist/data-table-JX-vnL0F.d.ts +464 -0
- package/dist/data-table.cjs +3470 -0
- package/dist/data-table.cjs.map +1 -0
- package/dist/data-table.d.ts +3 -0
- package/dist/data-table.js +840 -0
- package/dist/data-table.js.map +1 -0
- package/dist/index.cjs +796 -502
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +163 -473
- package/dist/index.js +2307 -5436
- package/dist/index.js.map +1 -1
- package/dist/sidebar.cjs +1 -4
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.js +1 -4
- package/dist/sidebar.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +6 -1
- package/tailwind-preset.cjs +18 -6
- package/dist/index.d.cts +0 -5422
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(src_exports, {
|
|
|
43
43
|
Avatar: () => Avatar,
|
|
44
44
|
AvatarBlock: () => AvatarBlock,
|
|
45
45
|
AvatarGroup: () => AvatarGroup,
|
|
46
|
+
BADGE_COLORS: () => BADGE_COLORS,
|
|
46
47
|
Badge: () => Badge,
|
|
47
48
|
Banner: () => Banner,
|
|
48
49
|
BarChart: () => BarChart,
|
|
@@ -183,6 +184,7 @@ __export(src_exports, {
|
|
|
183
184
|
Label: () => Label,
|
|
184
185
|
LegendDot: () => LegendDot,
|
|
185
186
|
ListRow: () => ListRow,
|
|
187
|
+
Listbox: () => Listbox,
|
|
186
188
|
Menubar: () => Menubar,
|
|
187
189
|
MenubarCheckboxItem: () => MenubarCheckboxItem,
|
|
188
190
|
MenubarContent: () => MenubarContent,
|
|
@@ -482,7 +484,7 @@ var Spinner = (0, import_react2.forwardRef)(function Spinner2({ size: size2 = "s
|
|
|
482
484
|
"aria-label": label,
|
|
483
485
|
"aria-hidden": label ? void 0 : true,
|
|
484
486
|
className: (0, import_clsx3.default)(
|
|
485
|
-
"inline-block shrink-0 animate-spin
|
|
487
|
+
"inline-block shrink-0 rounded-full motion-safe:animate-spin motion-reduce:animate-pulse",
|
|
486
488
|
"border-current border-t-transparent",
|
|
487
489
|
SIZE[size2],
|
|
488
490
|
className
|
|
@@ -3247,7 +3249,7 @@ var Switch = (0, import_react23.forwardRef)(function Switch2({
|
|
|
3247
3249
|
"span",
|
|
3248
3250
|
{
|
|
3249
3251
|
className: (0, import_clsx20.default)(
|
|
3250
|
-
"absolute left-0.5 top-0.5 rounded-full bg-default shadow-100 transition-transform",
|
|
3252
|
+
"absolute left-0.5 top-0.5 rounded-full bg-default shadow-100 transition-transform motion-reduce:transition-none",
|
|
3251
3253
|
s.knob,
|
|
3252
3254
|
checked ? s.translate : "translate-x-0"
|
|
3253
3255
|
)
|
|
@@ -3707,51 +3709,64 @@ function TagPill({
|
|
|
3707
3709
|
tone = "default",
|
|
3708
3710
|
size: size2 = "sm",
|
|
3709
3711
|
onRemove,
|
|
3712
|
+
asChild = false,
|
|
3713
|
+
icon,
|
|
3714
|
+
title,
|
|
3715
|
+
children,
|
|
3710
3716
|
bg,
|
|
3711
3717
|
color,
|
|
3712
3718
|
className
|
|
3713
3719
|
}) {
|
|
3720
|
+
if (asChild && onRemove) devWarn("TagPill: `asChild` and `onRemove` cannot be combined; `onRemove` is ignored.");
|
|
3714
3721
|
const removeOnKey = (event) => {
|
|
3715
3722
|
if (event.key === "Backspace" || event.key === "Delete") {
|
|
3716
3723
|
event.preventDefault();
|
|
3717
3724
|
onRemove?.();
|
|
3718
3725
|
}
|
|
3719
3726
|
};
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
{
|
|
3744
|
-
type: "button",
|
|
3745
|
-
onClick: onRemove,
|
|
3746
|
-
onKeyDown: removeOnKey,
|
|
3747
|
-
"aria-label": `Remove ${label}`,
|
|
3748
|
-
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",
|
|
3749
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react8.XIcon, { className: "size-3", strokeWidth: 2.5, "aria-hidden": true })
|
|
3750
|
-
}
|
|
3751
|
-
)
|
|
3752
|
-
]
|
|
3727
|
+
const glyph = icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { "aria-hidden": true, className: "inline-flex size-3 shrink-0 [&>svg]:size-full", children: icon });
|
|
3728
|
+
const labelContent = icon ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
3729
|
+
glyph,
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate", children: label })
|
|
3731
|
+
] }) : label;
|
|
3732
|
+
const rootProps = {
|
|
3733
|
+
"data-tone": tone,
|
|
3734
|
+
"data-size": size2,
|
|
3735
|
+
"data-removable": onRemove && !asChild ? "" : void 0,
|
|
3736
|
+
title: title ?? (onRemove && !asChild ? label : void 0),
|
|
3737
|
+
className: (0, import_clsx24.default)(
|
|
3738
|
+
"inline-flex items-center rounded-full text-body-xs font-medium",
|
|
3739
|
+
sizeStyles4[size2],
|
|
3740
|
+
// The remove button sits in the end padding, so trim it to keep the × optically centred.
|
|
3741
|
+
"data-[removable]:max-w-full data-[removable]:gap-1 data-[removable]:whitespace-nowrap data-[removable]:pr-1.5",
|
|
3742
|
+
icon && "max-w-full gap-1",
|
|
3743
|
+
!bg && !color && toneStyles[tone],
|
|
3744
|
+
asChild && ["hover:underline underline-offset-2", FOCUS_RING],
|
|
3745
|
+
className
|
|
3746
|
+
),
|
|
3747
|
+
style: {
|
|
3748
|
+
...bg ? { backgroundColor: bg } : void 0,
|
|
3749
|
+
...color ? { color } : void 0
|
|
3753
3750
|
}
|
|
3754
|
-
|
|
3751
|
+
};
|
|
3752
|
+
if (asChild) {
|
|
3753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Slot, { ...rootProps, wrapChildren: () => labelContent, children });
|
|
3754
|
+
}
|
|
3755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { ...rootProps, children: [
|
|
3756
|
+
glyph,
|
|
3757
|
+
onRemove || icon ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "truncate", children: label }) : label,
|
|
3758
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3759
|
+
"button",
|
|
3760
|
+
{
|
|
3761
|
+
type: "button",
|
|
3762
|
+
onClick: onRemove,
|
|
3763
|
+
onKeyDown: removeOnKey,
|
|
3764
|
+
"aria-label": `Remove ${label}`,
|
|
3765
|
+
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",
|
|
3766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react8.XIcon, { className: "size-3", strokeWidth: 2.5, "aria-hidden": true })
|
|
3767
|
+
}
|
|
3768
|
+
)
|
|
3769
|
+
] });
|
|
3755
3770
|
}
|
|
3756
3771
|
|
|
3757
3772
|
// src/components/forms/tag-input.tsx
|
|
@@ -3987,6 +4002,7 @@ function FormCardFooter({
|
|
|
3987
4002
|
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
3988
4003
|
var import_lucide_react10 = require("lucide-react");
|
|
3989
4004
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4005
|
+
var BADGE_COLORS = ["blue", "green", "violet", "yellow", "teal", "pink", "lime", "red", "slate", "gray"];
|
|
3990
4006
|
var defaultClasses = {
|
|
3991
4007
|
gray: "bg-badge-gray text-badge-gray",
|
|
3992
4008
|
red: "bg-badge-red text-badge-red",
|
|
@@ -4017,6 +4033,7 @@ function Badge({
|
|
|
4017
4033
|
size: size2 = "sm",
|
|
4018
4034
|
variant = "default",
|
|
4019
4035
|
indicator = false,
|
|
4036
|
+
icon,
|
|
4020
4037
|
onRemove: onRemoveProp,
|
|
4021
4038
|
onClose,
|
|
4022
4039
|
className
|
|
@@ -4043,6 +4060,14 @@ function Badge({
|
|
|
4043
4060
|
)
|
|
4044
4061
|
}
|
|
4045
4062
|
),
|
|
4063
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4064
|
+
"span",
|
|
4065
|
+
{
|
|
4066
|
+
"aria-hidden": true,
|
|
4067
|
+
className: (0, import_clsx27.default)("inline-flex shrink-0 [&>svg]:h-full [&>svg]:w-full", size2 === "sm" ? "h-3 w-3" : "h-3.5 w-3.5"),
|
|
4068
|
+
children: icon
|
|
4069
|
+
}
|
|
4070
|
+
),
|
|
4046
4071
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4047
4072
|
"span",
|
|
4048
4073
|
{
|
|
@@ -4307,7 +4332,7 @@ function Combobox({
|
|
|
4307
4332
|
{
|
|
4308
4333
|
"aria-hidden": true,
|
|
4309
4334
|
className: (0, import_clsx29.default)(
|
|
4310
|
-
"shrink-0 transition-transform",
|
|
4335
|
+
"shrink-0 transition-transform motion-reduce:transition-none",
|
|
4311
4336
|
size2 === "sm" ? "size-3" : "size-4",
|
|
4312
4337
|
disabled ? "text-icon-disabled" : "text-icon-default-secondary",
|
|
4313
4338
|
open && "rotate-180"
|
|
@@ -4926,11 +4951,12 @@ var import_clsx37 = __toESM(require("clsx"), 1);
|
|
|
4926
4951
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4927
4952
|
var sizeStyles5 = {
|
|
4928
4953
|
sm: "size-8",
|
|
4929
|
-
md: "size-10"
|
|
4954
|
+
md: "size-10",
|
|
4955
|
+
lg: "size-14"
|
|
4930
4956
|
};
|
|
4931
4957
|
var shapeStyles = {
|
|
4932
|
-
square: { sm: "rounded-lg", md: "rounded-xl" },
|
|
4933
|
-
circle: { sm: "rounded-full", md: "rounded-full" }
|
|
4958
|
+
square: { sm: "rounded-lg", md: "rounded-xl", lg: "rounded-2xl" },
|
|
4959
|
+
circle: { sm: "rounded-full", md: "rounded-full", lg: "rounded-full" }
|
|
4934
4960
|
};
|
|
4935
4961
|
var toneStyles2 = {
|
|
4936
4962
|
default: "bg-default-secondary text-icon-default",
|
|
@@ -4940,16 +4966,29 @@ var toneStyles2 = {
|
|
|
4940
4966
|
danger: "bg-danger-tertiary text-icon-danger",
|
|
4941
4967
|
neutral: "bg-neutral-tertiary text-icon-neutral"
|
|
4942
4968
|
};
|
|
4943
|
-
|
|
4969
|
+
var hueStyles = {
|
|
4970
|
+
gray: "bg-badge-gray text-badge-gray",
|
|
4971
|
+
red: "bg-badge-red text-badge-red",
|
|
4972
|
+
yellow: "bg-badge-yellow text-badge-yellow",
|
|
4973
|
+
lime: "bg-badge-lime text-badge-lime",
|
|
4974
|
+
green: "bg-badge-green text-badge-green",
|
|
4975
|
+
teal: "bg-badge-teal text-badge-teal",
|
|
4976
|
+
blue: "bg-badge-blue text-badge-blue",
|
|
4977
|
+
pink: "bg-badge-pink text-badge-pink",
|
|
4978
|
+
slate: "bg-badge-slate text-badge-slate",
|
|
4979
|
+
violet: "bg-badge-violet text-badge-violet"
|
|
4980
|
+
};
|
|
4981
|
+
function EntityIconBadge({ size: size2 = "sm", tone = "default", shape = "square", hue, bg, iconColor, children, className }) {
|
|
4944
4982
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4945
4983
|
"span",
|
|
4946
4984
|
{
|
|
4947
|
-
"data-tone": tone,
|
|
4985
|
+
"data-tone": hue ? void 0 : tone,
|
|
4986
|
+
"data-hue": hue,
|
|
4948
4987
|
className: (0, import_clsx37.default)(
|
|
4949
4988
|
"inline-flex shrink-0 items-center justify-center",
|
|
4950
4989
|
sizeStyles5[size2],
|
|
4951
4990
|
shapeStyles[shape][size2],
|
|
4952
|
-
!bg && !iconColor && toneStyles2[tone],
|
|
4991
|
+
!bg && !iconColor && (hue ? hueStyles[hue] : toneStyles2[tone]),
|
|
4953
4992
|
className
|
|
4954
4993
|
),
|
|
4955
4994
|
style: {
|
|
@@ -5164,14 +5203,33 @@ var LABEL_TEXT3 = {
|
|
|
5164
5203
|
sm: "text-body-tiny",
|
|
5165
5204
|
md: "text-body-xs"
|
|
5166
5205
|
};
|
|
5167
|
-
var Radio = (0, import_react33.forwardRef)(function Radio2({
|
|
5206
|
+
var Radio = (0, import_react33.forwardRef)(function Radio2({
|
|
5207
|
+
value,
|
|
5208
|
+
label,
|
|
5209
|
+
description,
|
|
5210
|
+
disabled,
|
|
5211
|
+
id,
|
|
5212
|
+
className,
|
|
5213
|
+
checked: checkedProp,
|
|
5214
|
+
onCheckedChange,
|
|
5215
|
+
size: sizeProp,
|
|
5216
|
+
invalid: invalidProp,
|
|
5217
|
+
name: nameProp,
|
|
5218
|
+
...props
|
|
5219
|
+
}, ref) {
|
|
5168
5220
|
const group = (0, import_react33.useContext)(RadioGroupContext);
|
|
5169
|
-
if (!group
|
|
5221
|
+
if (!group && !nameProp) {
|
|
5222
|
+
devWarn("A standalone <Radio> needs a `name` shared by its set: without one, each radio is a group of its own.");
|
|
5223
|
+
}
|
|
5170
5224
|
const generatedId = (0, import_react33.useId)();
|
|
5171
5225
|
const controlId = id ?? generatedId;
|
|
5172
5226
|
const descriptionId = `${controlId}-description`;
|
|
5173
|
-
const isDisabled = disabled ?? group
|
|
5174
|
-
const checked = group.value === value;
|
|
5227
|
+
const isDisabled = disabled ?? group?.disabled ?? false;
|
|
5228
|
+
const checked = group ? group.value === value : Boolean(checkedProp);
|
|
5229
|
+
const size2 = group?.size ?? sizeProp ?? "md";
|
|
5230
|
+
const invalid = group?.invalid ?? invalidProp ?? false;
|
|
5231
|
+
const name = group?.name ?? nameProp;
|
|
5232
|
+
const select = () => group ? group.setValue(value) : onCheckedChange?.(true);
|
|
5175
5233
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: (0, import_clsx40.default)("flex flex-col", className), children: [
|
|
5176
5234
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
5177
5235
|
"label",
|
|
@@ -5191,27 +5249,19 @@ var Radio = (0, import_react33.forwardRef)(function Radio2({ value, label, descr
|
|
|
5191
5249
|
ref,
|
|
5192
5250
|
id: controlId,
|
|
5193
5251
|
type: "radio",
|
|
5194
|
-
name
|
|
5252
|
+
name,
|
|
5195
5253
|
value,
|
|
5196
5254
|
checked,
|
|
5197
5255
|
disabled: isDisabled,
|
|
5256
|
+
"aria-invalid": !group && invalid ? true : void 0,
|
|
5198
5257
|
"aria-describedby": description ? descriptionId : void 0,
|
|
5199
|
-
onChange:
|
|
5258
|
+
onChange: select,
|
|
5200
5259
|
className: "peer sr-only",
|
|
5201
5260
|
...props
|
|
5202
5261
|
}
|
|
5203
5262
|
),
|
|
5204
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5205
|
-
|
|
5206
|
-
{
|
|
5207
|
-
type: "radio",
|
|
5208
|
-
checked,
|
|
5209
|
-
disabled: isDisabled,
|
|
5210
|
-
invalid: group.invalid,
|
|
5211
|
-
size: group.size
|
|
5212
|
-
}
|
|
5213
|
-
),
|
|
5214
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: (0, import_clsx40.default)(LABEL_TEXT3[group.size], "text-default"), children: label })
|
|
5263
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckControl, { type: "radio", checked, disabled: isDisabled, invalid, size: size2 }),
|
|
5264
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: (0, import_clsx40.default)(LABEL_TEXT3[size2], "text-default"), children: label })
|
|
5215
5265
|
]
|
|
5216
5266
|
}
|
|
5217
5267
|
),
|
|
@@ -5221,7 +5271,7 @@ var Radio = (0, import_react33.forwardRef)(function Radio2({ value, label, descr
|
|
|
5221
5271
|
id: descriptionId,
|
|
5222
5272
|
className: (0, import_clsx40.default)(
|
|
5223
5273
|
"mt-0.5 pl-[26px]",
|
|
5224
|
-
LABEL_TEXT3[
|
|
5274
|
+
LABEL_TEXT3[size2],
|
|
5225
5275
|
isDisabled ? "text-disabled" : "text-default-secondary"
|
|
5226
5276
|
),
|
|
5227
5277
|
children: description
|
|
@@ -5335,7 +5385,7 @@ var RadioCardsItem = (0, import_react34.forwardRef)(function RadioCardsItem2({ v
|
|
|
5335
5385
|
"[label:has(:checked)_&]:border-brand",
|
|
5336
5386
|
s.mark
|
|
5337
5387
|
),
|
|
5338
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "size-2 scale-0 rounded-full bg-brand transition-transform [label:has(:checked)_&]:scale-100" })
|
|
5388
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "size-2 scale-0 rounded-full bg-brand transition-transform motion-reduce:transition-none [label:has(:checked)_&]:scale-100" })
|
|
5339
5389
|
}
|
|
5340
5390
|
)
|
|
5341
5391
|
] }),
|
|
@@ -7376,7 +7426,7 @@ var AccordionTrigger = (0, import_react53.forwardRef)(
|
|
|
7376
7426
|
{
|
|
7377
7427
|
"aria-hidden": true,
|
|
7378
7428
|
className: (0, import_clsx48.default)(
|
|
7379
|
-
"size-4 shrink-0 text-icon-default-secondary transition-transform",
|
|
7429
|
+
"size-4 shrink-0 text-icon-default-secondary transition-transform motion-reduce:transition-none",
|
|
7380
7430
|
"group-data-[state=open]:rotate-180"
|
|
7381
7431
|
)
|
|
7382
7432
|
}
|
|
@@ -8150,13 +8200,19 @@ function PageHeading({
|
|
|
8150
8200
|
subtitle,
|
|
8151
8201
|
size: size2 = "page",
|
|
8152
8202
|
as,
|
|
8203
|
+
badges,
|
|
8204
|
+
meta,
|
|
8153
8205
|
actions,
|
|
8154
8206
|
truncateTitle,
|
|
8155
8207
|
className
|
|
8156
8208
|
}) {
|
|
8157
8209
|
const Tag = as ?? (size2 === "section" ? "h2" : "h1");
|
|
8158
8210
|
const heading = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
8159
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.
|
|
8211
|
+
badges ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-2.5", children: [
|
|
8212
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Tag, { className: (0, import_clsx52.default)(TITLE[size2], truncateTitle && "truncate"), children: title }),
|
|
8213
|
+
badges
|
|
8214
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Tag, { className: (0, import_clsx52.default)(TITLE[size2], truncateTitle && "truncate"), children: title }),
|
|
8215
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex flex-wrap items-center gap-2.5 text-body-xs text-default-secondary", children: meta }),
|
|
8160
8216
|
subtitle && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: SUBTITLE[size2], children: subtitle })
|
|
8161
8217
|
] });
|
|
8162
8218
|
if (!actions) return className ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className, children: heading }) : heading;
|
|
@@ -8238,6 +8294,7 @@ function FilterBar({ children, trailing, size: size2 = "md", className }) {
|
|
|
8238
8294
|
// src/components/chrome/tabs.tsx
|
|
8239
8295
|
var import_react59 = require("react");
|
|
8240
8296
|
var import_clsx55 = __toESM(require("clsx"), 1);
|
|
8297
|
+
var import_lucide_react24 = require("lucide-react");
|
|
8241
8298
|
var import_radix_ui14 = require("radix-ui");
|
|
8242
8299
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
8243
8300
|
var SIZE8 = {
|
|
@@ -8256,7 +8313,7 @@ var TAB_VARIANT = {
|
|
|
8256
8313
|
"aria-selected:bg-brand aria-selected:text-brand-on-brand aria-selected:hover:bg-brand"
|
|
8257
8314
|
),
|
|
8258
8315
|
underline: (0, import_clsx55.default)(
|
|
8259
|
-
"leading-snug font-normal text-default-secondary hover:text-default",
|
|
8316
|
+
"snap-start leading-snug font-normal text-default-secondary hover:text-default",
|
|
8260
8317
|
"border-b-2 border-transparent",
|
|
8261
8318
|
"aria-selected:border-brand-emphasis aria-selected:font-semibold aria-selected:text-brand-emphasis"
|
|
8262
8319
|
)
|
|
@@ -8268,14 +8325,22 @@ var tabClasses = (variant, size2) => (0, import_clsx55.default)(
|
|
|
8268
8325
|
SIZE8[variant][size2].tab,
|
|
8269
8326
|
TAB_VARIANT[variant]
|
|
8270
8327
|
);
|
|
8328
|
+
var scrollsHorizontally = (variant, orientation) => variant === "underline" && orientation === "horizontal";
|
|
8271
8329
|
var stripClasses = (variant, size2, orientation) => (0, import_clsx55.default)(
|
|
8272
|
-
"flex
|
|
8330
|
+
"flex",
|
|
8273
8331
|
// The strip's own children are the tab stops, so it needs no tab stop of its own.
|
|
8274
|
-
orientation === "vertical" ? "flex-col" :
|
|
8332
|
+
orientation === "vertical" ? "shrink-0 flex-col" : variant === "pill" ? (
|
|
8333
|
+
// Pills are a handful of filter-style choices: wrap, so every one stays visible.
|
|
8334
|
+
"shrink-0 flex-wrap"
|
|
8335
|
+
) : (
|
|
8336
|
+
// Underline tabs are page sections: scroll, snapping to whole tabs. The edge buttons are
|
|
8337
|
+
// the affordance, so the (often overlay) native scrollbar is hidden rather than doubled.
|
|
8338
|
+
"min-w-0 flex-1 snap-x snap-mandatory overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
8339
|
+
),
|
|
8275
8340
|
SIZE8[variant][size2].strip,
|
|
8276
8341
|
variant === "underline" && (orientation === "vertical" ? "border-r border-default" : "border-b border-default")
|
|
8277
8342
|
);
|
|
8278
|
-
function TabCount({ count, variant }) {
|
|
8343
|
+
function TabCount({ count, variant, locale }) {
|
|
8279
8344
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
8280
8345
|
"span",
|
|
8281
8346
|
{
|
|
@@ -8283,7 +8348,75 @@ function TabCount({ count, variant }) {
|
|
|
8283
8348
|
"rounded-md bg-default-secondary px-1.5 py-px text-body-tiny font-medium leading-snug text-default-secondary",
|
|
8284
8349
|
variant === "pill" && "group-aria-selected:bg-brand-hover group-aria-selected:text-brand-on-brand"
|
|
8285
8350
|
),
|
|
8286
|
-
children: count
|
|
8351
|
+
children: typeof count === "number" ? count.toLocaleString(locale) : count
|
|
8352
|
+
}
|
|
8353
|
+
);
|
|
8354
|
+
}
|
|
8355
|
+
var EDGE_PAD = 32;
|
|
8356
|
+
var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
8357
|
+
function useTabStrip(enabled) {
|
|
8358
|
+
const listRef = (0, import_react59.useRef)(null);
|
|
8359
|
+
const selected = (0, import_react59.useRef)(null);
|
|
8360
|
+
const [edges, setEdges] = (0, import_react59.useState)({ start: false, end: false });
|
|
8361
|
+
const measure = (0, import_react59.useCallback)(() => {
|
|
8362
|
+
const el = listRef.current;
|
|
8363
|
+
if (!enabled || !el) return;
|
|
8364
|
+
const start = el.scrollLeft > 1;
|
|
8365
|
+
const end = el.scrollLeft + el.clientWidth < el.scrollWidth - 1;
|
|
8366
|
+
setEdges((prev) => prev.start === start && prev.end === end ? prev : { start, end });
|
|
8367
|
+
}, [enabled]);
|
|
8368
|
+
(0, import_react59.useLayoutEffect)(() => {
|
|
8369
|
+
const el = listRef.current;
|
|
8370
|
+
if (!enabled || !el || typeof ResizeObserver === "undefined") return;
|
|
8371
|
+
const observer = new ResizeObserver(measure);
|
|
8372
|
+
observer.observe(el);
|
|
8373
|
+
return () => observer.disconnect();
|
|
8374
|
+
}, [enabled, measure]);
|
|
8375
|
+
(0, import_react59.useLayoutEffect)(() => {
|
|
8376
|
+
const list = listRef.current;
|
|
8377
|
+
if (!enabled || !list) return;
|
|
8378
|
+
measure();
|
|
8379
|
+
const tab = list.querySelector('[role="tab"][aria-selected="true"]');
|
|
8380
|
+
if (!tab || tab === selected.current) return;
|
|
8381
|
+
selected.current = tab;
|
|
8382
|
+
if (typeof list.scrollTo !== "function") return;
|
|
8383
|
+
const left = tab.offsetLeft - list.offsetLeft;
|
|
8384
|
+
const right = left + tab.offsetWidth;
|
|
8385
|
+
if (left < list.scrollLeft + EDGE_PAD) list.scrollTo({ left: Math.max(0, left - EDGE_PAD) });
|
|
8386
|
+
else if (right > list.scrollLeft + list.clientWidth - EDGE_PAD) {
|
|
8387
|
+
list.scrollTo({ left: right - list.clientWidth + EDGE_PAD });
|
|
8388
|
+
}
|
|
8389
|
+
});
|
|
8390
|
+
const page = (0, import_react59.useCallback)((direction) => {
|
|
8391
|
+
const el = listRef.current;
|
|
8392
|
+
if (!el || typeof el.scrollBy !== "function") return;
|
|
8393
|
+
el.scrollBy({ left: direction * el.clientWidth * 0.8, behavior: prefersReducedMotion() ? "auto" : "smooth" });
|
|
8394
|
+
}, []);
|
|
8395
|
+
return { listRef, edges, measure, page };
|
|
8396
|
+
}
|
|
8397
|
+
function TabStripFrame({ strip, children }) {
|
|
8398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "relative flex min-w-0 max-w-full", children: [
|
|
8399
|
+
children,
|
|
8400
|
+
strip.edges.start && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabStripEdge, { side: "start", onClick: () => strip.page(-1) }),
|
|
8401
|
+
strip.edges.end && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabStripEdge, { side: "end", onClick: () => strip.page(1) })
|
|
8402
|
+
] });
|
|
8403
|
+
}
|
|
8404
|
+
function TabStripEdge({ side, onClick }) {
|
|
8405
|
+
const Icon = side === "start" ? import_lucide_react24.ChevronLeftIcon : import_lucide_react24.ChevronRightIcon;
|
|
8406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
8407
|
+
"button",
|
|
8408
|
+
{
|
|
8409
|
+
type: "button",
|
|
8410
|
+
"aria-hidden": true,
|
|
8411
|
+
tabIndex: -1,
|
|
8412
|
+
onClick,
|
|
8413
|
+
"data-edge": side,
|
|
8414
|
+
className: (0, import_clsx55.default)(
|
|
8415
|
+
// `bottom-px` keeps the strip's baseline visible under the fade.
|
|
8416
|
+
"absolute bottom-px top-0 z-raised flex w-8 items-center text-icon-default-secondary hover:text-icon-default",
|
|
8417
|
+
side === "start" ? "left-0 justify-start bg-gradient-to-r from-default via-default to-transparent" : "right-0 justify-end bg-gradient-to-l from-default via-default to-transparent"
|
|
8418
|
+
),
|
|
8419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Icon, { className: "size-4" })
|
|
8287
8420
|
}
|
|
8288
8421
|
);
|
|
8289
8422
|
}
|
|
@@ -8304,8 +8437,11 @@ function ItemsTabs({
|
|
|
8304
8437
|
activation = "automatic",
|
|
8305
8438
|
idPrefix,
|
|
8306
8439
|
label,
|
|
8440
|
+
locale,
|
|
8307
8441
|
className
|
|
8308
8442
|
}) {
|
|
8443
|
+
const scrolls = scrollsHorizontally(variant, orientation);
|
|
8444
|
+
const strip = useTabStrip(scrolls);
|
|
8309
8445
|
const generatedPrefix = (0, import_react59.useId)();
|
|
8310
8446
|
const prefix = idPrefix ?? generatedPrefix;
|
|
8311
8447
|
const [value, setValue] = useControllableState({
|
|
@@ -8322,14 +8458,20 @@ function ItemsTabs({
|
|
|
8322
8458
|
loop: true,
|
|
8323
8459
|
defaultIndex: selectedIndex
|
|
8324
8460
|
});
|
|
8325
|
-
|
|
8461
|
+
const list = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
8326
8462
|
"div",
|
|
8327
8463
|
{
|
|
8464
|
+
ref: strip.listRef,
|
|
8328
8465
|
role: "tablist",
|
|
8329
8466
|
"aria-label": label,
|
|
8330
8467
|
"aria-orientation": orientation,
|
|
8331
8468
|
"data-variant": variant,
|
|
8332
|
-
|
|
8469
|
+
onScroll: scrolls ? strip.measure : void 0,
|
|
8470
|
+
className: cn(
|
|
8471
|
+
stripClasses(variant, size2, orientation),
|
|
8472
|
+
scrolls && (strip.edges.start || strip.edges.end) && "scroll-px-8",
|
|
8473
|
+
className
|
|
8474
|
+
),
|
|
8333
8475
|
...roving.containerProps,
|
|
8334
8476
|
children: items.map((tab, index) => {
|
|
8335
8477
|
const active = tab.key === value;
|
|
@@ -8360,7 +8502,7 @@ function ItemsTabs({
|
|
|
8360
8502
|
className: tabClasses(variant, size2),
|
|
8361
8503
|
children: [
|
|
8362
8504
|
tab.label,
|
|
8363
|
-
tab.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabCount, { count: tab.count, variant })
|
|
8505
|
+
tab.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabCount, { count: tab.count, variant, locale })
|
|
8364
8506
|
]
|
|
8365
8507
|
},
|
|
8366
8508
|
tab.key
|
|
@@ -8368,6 +8510,7 @@ function ItemsTabs({
|
|
|
8368
8510
|
})
|
|
8369
8511
|
}
|
|
8370
8512
|
);
|
|
8513
|
+
return scrolls ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabStripFrame, { strip, children: list }) : list;
|
|
8371
8514
|
}
|
|
8372
8515
|
var PANEL_CLASSES = (0, import_clsx55.default)(FOCUS_RING, "rounded-sm");
|
|
8373
8516
|
function TabsPanel({
|
|
@@ -8410,6 +8553,7 @@ function TabsRoot({
|
|
|
8410
8553
|
orientation = "horizontal",
|
|
8411
8554
|
activation = "automatic",
|
|
8412
8555
|
dir,
|
|
8556
|
+
locale,
|
|
8413
8557
|
className
|
|
8414
8558
|
}) {
|
|
8415
8559
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
@@ -8422,23 +8566,34 @@ function TabsRoot({
|
|
|
8422
8566
|
activationMode: activation,
|
|
8423
8567
|
dir,
|
|
8424
8568
|
className: cn(orientation === "vertical" ? "flex gap-6" : "flex flex-col gap-4", className),
|
|
8425
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabsStyle.Provider, { value: { variant, size: size2, orientation }, children })
|
|
8569
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabsStyle.Provider, { value: { variant, size: size2, orientation, locale }, children })
|
|
8426
8570
|
}
|
|
8427
8571
|
);
|
|
8428
8572
|
}
|
|
8429
|
-
var TabsList = (0, import_react59.forwardRef)(function TabsList2({ label, className, ...rest }, ref) {
|
|
8573
|
+
var TabsList = (0, import_react59.forwardRef)(function TabsList2({ label, className, onScroll, ...rest }, ref) {
|
|
8430
8574
|
const style = (0, import_react59.useContext)(TabsStyle);
|
|
8431
|
-
|
|
8575
|
+
const scrolls = scrollsHorizontally(style.variant, style.orientation);
|
|
8576
|
+
const strip = useTabStrip(scrolls);
|
|
8577
|
+
const list = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
8432
8578
|
import_radix_ui14.Tabs.List,
|
|
8433
8579
|
{
|
|
8434
|
-
ref,
|
|
8580
|
+
ref: composeRefs(ref, strip.listRef),
|
|
8435
8581
|
"aria-label": label,
|
|
8436
8582
|
loop: true,
|
|
8437
8583
|
"data-variant": style.variant,
|
|
8438
|
-
|
|
8584
|
+
onScroll: (event) => {
|
|
8585
|
+
onScroll?.(event);
|
|
8586
|
+
if (scrolls) strip.measure();
|
|
8587
|
+
},
|
|
8588
|
+
className: cn(
|
|
8589
|
+
stripClasses(style.variant, style.size, style.orientation),
|
|
8590
|
+
scrolls && (strip.edges.start || strip.edges.end) && "scroll-px-8",
|
|
8591
|
+
className
|
|
8592
|
+
),
|
|
8439
8593
|
...rest
|
|
8440
8594
|
}
|
|
8441
8595
|
);
|
|
8596
|
+
return scrolls ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabStripFrame, { strip, children: list }) : list;
|
|
8442
8597
|
});
|
|
8443
8598
|
var TabsTrigger = (0, import_react59.forwardRef)(function TabsTrigger2({ value, disabled, count, className, children, ...rest }, ref) {
|
|
8444
8599
|
const style = (0, import_react59.useContext)(TabsStyle);
|
|
@@ -8452,7 +8607,7 @@ var TabsTrigger = (0, import_react59.forwardRef)(function TabsTrigger2({ value,
|
|
|
8452
8607
|
...rest,
|
|
8453
8608
|
children: [
|
|
8454
8609
|
children,
|
|
8455
|
-
count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabCount, { count, variant: style.variant })
|
|
8610
|
+
count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabCount, { count, variant: style.variant, locale: style.locale })
|
|
8456
8611
|
]
|
|
8457
8612
|
}
|
|
8458
8613
|
);
|
|
@@ -8676,7 +8831,7 @@ var Kbd = (0, import_react61.forwardRef)(function Kbd2({ children, size: size2 =
|
|
|
8676
8831
|
// src/components/chrome/breadcrumb.tsx
|
|
8677
8832
|
var import_react62 = require("react");
|
|
8678
8833
|
var import_clsx60 = __toESM(require("clsx"), 1);
|
|
8679
|
-
var
|
|
8834
|
+
var import_lucide_react25 = require("lucide-react");
|
|
8680
8835
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
8681
8836
|
var Breadcrumb = (0, import_react62.forwardRef)(function Breadcrumb2({ children, items, renderLink, maxItems, label = "Breadcrumb", className, ...rest }, ref) {
|
|
8682
8837
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("nav", { ref, "aria-label": label, "data-slot": "breadcrumb", ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("ol", { className: (0, import_clsx60.default)("flex flex-wrap items-center gap-1.5 p-0 text-body-xs", className), children: items ? renderItems(items, renderLink, maxItems) : children }) });
|
|
@@ -8698,7 +8853,7 @@ function renderItems(items, renderLink, maxItems) {
|
|
|
8698
8853
|
var BreadcrumbItem = (0, import_react62.forwardRef)(
|
|
8699
8854
|
function BreadcrumbItem2({ children, current = false, asChild = false, first = false, className, ...rest }, ref) {
|
|
8700
8855
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("li", { className: "flex items-center gap-1.5", children: [
|
|
8701
|
-
!first && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8856
|
+
!first && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react25.ChevronRightIcon, { "aria-hidden": true, className: "size-3.5 shrink-0 text-icon-default-tertiary" }),
|
|
8702
8857
|
current ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { "aria-current": "page", className: (0, import_clsx60.default)("font-medium text-default", className), children }) : asChild ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8703
8858
|
Slot,
|
|
8704
8859
|
{
|
|
@@ -8729,7 +8884,7 @@ var BreadcrumbItem = (0, import_react62.forwardRef)(
|
|
|
8729
8884
|
var BreadcrumbEllipsis = (0, import_react62.forwardRef)(
|
|
8730
8885
|
function BreadcrumbEllipsis2({ className, ...rest }, ref) {
|
|
8731
8886
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("li", { className: "flex items-center gap-1.5", children: [
|
|
8732
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8887
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react25.ChevronRightIcon, { "aria-hidden": true, className: "size-3.5 shrink-0 text-icon-default-tertiary" }),
|
|
8733
8888
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8734
8889
|
"span",
|
|
8735
8890
|
{
|
|
@@ -8747,7 +8902,7 @@ var BreadcrumbEllipsis = (0, import_react62.forwardRef)(
|
|
|
8747
8902
|
// src/components/chrome/pagination.tsx
|
|
8748
8903
|
var import_react63 = require("react");
|
|
8749
8904
|
var import_clsx61 = __toESM(require("clsx"), 1);
|
|
8750
|
-
var
|
|
8905
|
+
var import_lucide_react26 = require("lucide-react");
|
|
8751
8906
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
8752
8907
|
var GAP4 = "\u2026";
|
|
8753
8908
|
function paginationRange(page, pageCount, siblingCount = 1) {
|
|
@@ -8813,7 +8968,7 @@ var Pagination = (0, import_react63.forwardRef)(function Pagination2({
|
|
|
8813
8968
|
disabled: page <= 1,
|
|
8814
8969
|
onClick: () => go(page - 1),
|
|
8815
8970
|
className: ARROW_BASE,
|
|
8816
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8971
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react26.ChevronLeftIcon, { "aria-hidden": true, className: "size-4" })
|
|
8817
8972
|
}
|
|
8818
8973
|
),
|
|
8819
8974
|
type === "dots" ? (
|
|
@@ -8876,7 +9031,7 @@ var Pagination = (0, import_react63.forwardRef)(function Pagination2({
|
|
|
8876
9031
|
disabled: page >= pageCount,
|
|
8877
9032
|
onClick: () => go(page + 1),
|
|
8878
9033
|
className: ARROW_BASE,
|
|
8879
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
9034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react26.ChevronRightIcon, { "aria-hidden": true, className: "size-4" })
|
|
8880
9035
|
}
|
|
8881
9036
|
)
|
|
8882
9037
|
]
|
|
@@ -9043,15 +9198,20 @@ var Blockquote = (0, import_react65.forwardRef)(function Blockquote2({ children,
|
|
|
9043
9198
|
}
|
|
9044
9199
|
);
|
|
9045
9200
|
});
|
|
9046
|
-
var
|
|
9201
|
+
var TEXT_LINK_TONE = {
|
|
9202
|
+
brand: "text-brand underline decoration-1 hover:text-brand-secondary",
|
|
9203
|
+
neutral: "text-default no-underline decoration-1 hover:underline"
|
|
9204
|
+
};
|
|
9205
|
+
var TextLink = (0, import_react65.forwardRef)(function TextLink2({ children, asChild = false, tone = "brand", className, ...rest }, ref) {
|
|
9047
9206
|
const Root = asChild ? Slot : "a";
|
|
9048
9207
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9049
9208
|
Root,
|
|
9050
9209
|
{
|
|
9051
9210
|
ref,
|
|
9211
|
+
"data-tone": tone,
|
|
9052
9212
|
className: (0, import_clsx63.default)(
|
|
9053
|
-
"rounded
|
|
9054
|
-
|
|
9213
|
+
"rounded underline-offset-2 transition-colors",
|
|
9214
|
+
TEXT_LINK_TONE[tone],
|
|
9055
9215
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
9056
9216
|
className
|
|
9057
9217
|
),
|
|
@@ -9576,7 +9736,7 @@ function BarChart({
|
|
|
9576
9736
|
"div",
|
|
9577
9737
|
{
|
|
9578
9738
|
title: `${category} \xB7 ${bar.key}: ${bar.value}`,
|
|
9579
|
-
className: "transition-all",
|
|
9739
|
+
className: "transition-all motion-reduce:transition-none",
|
|
9580
9740
|
style: {
|
|
9581
9741
|
backgroundColor: bar.color,
|
|
9582
9742
|
borderRadius: radius,
|
|
@@ -9742,7 +9902,7 @@ function RadialGauge({
|
|
|
9742
9902
|
strokeWidth: ring,
|
|
9743
9903
|
strokeDasharray: `${arc * fraction} ${circumference - arc * fraction}`,
|
|
9744
9904
|
strokeLinecap: "round",
|
|
9745
|
-
className: "transition-all"
|
|
9905
|
+
className: "transition-all motion-reduce:transition-none"
|
|
9746
9906
|
}
|
|
9747
9907
|
)
|
|
9748
9908
|
]
|
|
@@ -9925,12 +10085,12 @@ var SHAPE = {
|
|
|
9925
10085
|
square: { sm: "size-1.5 rounded-[2px]", md: "size-2 rounded-[3px]" },
|
|
9926
10086
|
line: { sm: "h-0.5 w-3 rounded-full", md: "h-0.5 w-4 rounded-full" }
|
|
9927
10087
|
};
|
|
9928
|
-
function LegendDot({ tone, color, size: size2 = "md", shape = "dot", className }) {
|
|
10088
|
+
function LegendDot({ tone, color, hue, size: size2 = "md", shape = "dot", className }) {
|
|
9929
10089
|
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
9930
10090
|
"span",
|
|
9931
10091
|
{
|
|
9932
10092
|
className: (0, import_clsx77.default)("inline-block shrink-0", SHAPE[shape][size2], className),
|
|
9933
|
-
style: { backgroundColor: resolveChartColor(color, tone) },
|
|
10093
|
+
style: { backgroundColor: color || !hue ? resolveChartColor(color, tone) : `var(--badge-${hue}-text)` },
|
|
9934
10094
|
"aria-hidden": true
|
|
9935
10095
|
}
|
|
9936
10096
|
);
|
|
@@ -9973,7 +10133,7 @@ function ChartLegend({
|
|
|
9973
10133
|
|
|
9974
10134
|
// src/components/charts/trend-label.tsx
|
|
9975
10135
|
var import_clsx79 = __toESM(require("clsx"), 1);
|
|
9976
|
-
var
|
|
10136
|
+
var import_lucide_react27 = require("lucide-react");
|
|
9977
10137
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
9978
10138
|
var SIZE17 = {
|
|
9979
10139
|
sm: "text-body-xs",
|
|
@@ -10007,7 +10167,7 @@ function TrendLabel({
|
|
|
10007
10167
|
const rising = value > 0;
|
|
10008
10168
|
const flat = value === 0;
|
|
10009
10169
|
const good = direction === "up-is-good" ? rising : !rising;
|
|
10010
|
-
const Arrow = rising ?
|
|
10170
|
+
const Arrow = rising ? import_lucide_react27.TrendingUpIcon : import_lucide_react27.TrendingDownIcon;
|
|
10011
10171
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
10012
10172
|
"span",
|
|
10013
10173
|
{
|
|
@@ -10029,9 +10189,117 @@ function TrendLabel({
|
|
|
10029
10189
|
);
|
|
10030
10190
|
}
|
|
10031
10191
|
|
|
10032
|
-
// src/components/lists/
|
|
10192
|
+
// src/components/lists/listbox.tsx
|
|
10193
|
+
var import_react69 = require("react");
|
|
10033
10194
|
var import_clsx80 = __toESM(require("clsx"), 1);
|
|
10034
10195
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
10196
|
+
var isGroup3 = (entry) => "options" in entry;
|
|
10197
|
+
function Listbox({
|
|
10198
|
+
options,
|
|
10199
|
+
value: valueProp,
|
|
10200
|
+
defaultValue,
|
|
10201
|
+
onValueChange,
|
|
10202
|
+
label,
|
|
10203
|
+
selectionFollowsFocus = true,
|
|
10204
|
+
maxHeight,
|
|
10205
|
+
empty,
|
|
10206
|
+
className
|
|
10207
|
+
}) {
|
|
10208
|
+
const id = (0, import_react69.useId)();
|
|
10209
|
+
const [value, setValue] = useControllableState({
|
|
10210
|
+
value: valueProp,
|
|
10211
|
+
defaultValue,
|
|
10212
|
+
onChange: onValueChange
|
|
10213
|
+
});
|
|
10214
|
+
const flat = (0, import_react69.useMemo)(
|
|
10215
|
+
() => options.flatMap((entry) => isGroup3(entry) ? entry.options : [entry]),
|
|
10216
|
+
[options]
|
|
10217
|
+
);
|
|
10218
|
+
const selectedIndex = flat.findIndex((option) => option.value === value);
|
|
10219
|
+
const roving = useRovingFocus({
|
|
10220
|
+
orientation: "vertical",
|
|
10221
|
+
loop: false,
|
|
10222
|
+
typeahead: true,
|
|
10223
|
+
defaultIndex: Math.max(0, selectedIndex)
|
|
10224
|
+
});
|
|
10225
|
+
const { setActiveIndex } = roving;
|
|
10226
|
+
(0, import_react69.useEffect)(() => {
|
|
10227
|
+
if (selectedIndex >= 0) setActiveIndex(selectedIndex);
|
|
10228
|
+
}, [selectedIndex, setActiveIndex]);
|
|
10229
|
+
let index = -1;
|
|
10230
|
+
const renderOption = (option) => {
|
|
10231
|
+
index += 1;
|
|
10232
|
+
const position = index;
|
|
10233
|
+
const selected = option.value === value;
|
|
10234
|
+
const item = roving.itemProps(position, {
|
|
10235
|
+
disabled: option.disabled,
|
|
10236
|
+
label: option.textValue ?? (typeof option.label === "string" ? option.label : void 0)
|
|
10237
|
+
});
|
|
10238
|
+
const select = () => {
|
|
10239
|
+
if (!option.disabled) setValue(option.value);
|
|
10240
|
+
};
|
|
10241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
10242
|
+
"div",
|
|
10243
|
+
{
|
|
10244
|
+
ref: item.ref,
|
|
10245
|
+
tabIndex: item.tabIndex,
|
|
10246
|
+
"data-roving-index": item["data-roving-index"],
|
|
10247
|
+
role: "option",
|
|
10248
|
+
"aria-selected": selected,
|
|
10249
|
+
"aria-disabled": option.disabled || void 0,
|
|
10250
|
+
"data-state": selected ? "selected" : void 0,
|
|
10251
|
+
onFocus: () => {
|
|
10252
|
+
item.onFocus();
|
|
10253
|
+
if (selectionFollowsFocus) select();
|
|
10254
|
+
},
|
|
10255
|
+
onClick: select,
|
|
10256
|
+
onKeyDown: (event) => {
|
|
10257
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
10258
|
+
event.preventDefault();
|
|
10259
|
+
select();
|
|
10260
|
+
}
|
|
10261
|
+
},
|
|
10262
|
+
className: (0, import_clsx80.default)(
|
|
10263
|
+
"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",
|
|
10264
|
+
"hover:bg-default-secondary",
|
|
10265
|
+
"data-[state=selected]:bg-brand-tertiary data-[state=selected]:font-semibold",
|
|
10266
|
+
"aria-disabled:cursor-not-allowed aria-disabled:text-disabled",
|
|
10267
|
+
FOCUS_RING_INSET
|
|
10268
|
+
),
|
|
10269
|
+
children: [
|
|
10270
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "min-w-0 flex-1", children: option.label }),
|
|
10271
|
+
option.meta !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "shrink-0 whitespace-nowrap font-normal text-default-secondary", children: option.meta })
|
|
10272
|
+
]
|
|
10273
|
+
},
|
|
10274
|
+
option.value
|
|
10275
|
+
);
|
|
10276
|
+
};
|
|
10277
|
+
if (flat.length === 0 && empty) {
|
|
10278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: cn("px-4 py-6 text-center text-body-xs text-default-secondary", className), children: empty });
|
|
10279
|
+
}
|
|
10280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
10281
|
+
"div",
|
|
10282
|
+
{
|
|
10283
|
+
role: "listbox",
|
|
10284
|
+
"aria-label": label,
|
|
10285
|
+
...roving.containerProps,
|
|
10286
|
+
className: cn(maxHeight !== void 0 && ["overflow-auto overscroll-contain", SCROLLBAR_CLASSES], className),
|
|
10287
|
+
style: maxHeight !== void 0 ? { maxHeight } : void 0,
|
|
10288
|
+
children: options.map((entry, groupIndex) => {
|
|
10289
|
+
if (!isGroup3(entry)) return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_react69.Fragment, { children: renderOption(entry) }, entry.value);
|
|
10290
|
+
const headerId = `${id}-group-${groupIndex}`;
|
|
10291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { role: "group", "aria-labelledby": headerId, children: [
|
|
10292
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { id: headerId, className: "border-b border-default bg-default-secondary px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(EyebrowLabel, { children: entry.label }) }),
|
|
10293
|
+
entry.options.map(renderOption)
|
|
10294
|
+
] }, `${groupIndex}-${entry.label}`);
|
|
10295
|
+
})
|
|
10296
|
+
}
|
|
10297
|
+
);
|
|
10298
|
+
}
|
|
10299
|
+
|
|
10300
|
+
// src/components/lists/list-row.tsx
|
|
10301
|
+
var import_clsx81 = __toESM(require("clsx"), 1);
|
|
10302
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
10035
10303
|
var DENSITY = {
|
|
10036
10304
|
default: {
|
|
10037
10305
|
pad: "py-4",
|
|
@@ -10092,24 +10360,24 @@ function ListRow({
|
|
|
10092
10360
|
className
|
|
10093
10361
|
)
|
|
10094
10362
|
};
|
|
10095
|
-
const body = /* @__PURE__ */ (0,
|
|
10096
|
-
/* @__PURE__ */ (0,
|
|
10097
|
-
hasTitleLine && /* @__PURE__ */ (0,
|
|
10098
|
-
/* @__PURE__ */ (0,
|
|
10363
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
10364
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: (0, import_clsx81.default)("flex min-w-0 flex-1 flex-col", d.gap), children: [
|
|
10365
|
+
hasTitleLine && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
10366
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
10099
10367
|
leading,
|
|
10100
|
-
title != null && /* @__PURE__ */ (0,
|
|
10101
|
-
titleMeta && /* @__PURE__ */ (0,
|
|
10368
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: (0, import_clsx81.default)("truncate", d.title), children: title }),
|
|
10369
|
+
titleMeta && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "shrink-0", children: titleMeta })
|
|
10102
10370
|
] }),
|
|
10103
|
-
meta && /* @__PURE__ */ (0,
|
|
10371
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "shrink-0", children: meta })
|
|
10104
10372
|
] }),
|
|
10105
|
-
description && /* @__PURE__ */ (0,
|
|
10373
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("p", { className: d.description, children: description }),
|
|
10106
10374
|
footer && // These two wrappers are propagation barriers, not controls — they add no
|
|
10107
10375
|
// behaviour of their own and must not be focusable or take a role.
|
|
10108
10376
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
10109
|
-
/* @__PURE__ */ (0,
|
|
10377
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { onClick: stopIfInteractive, onKeyDown: stopIfInteractive, children: footer })
|
|
10110
10378
|
] }),
|
|
10111
10379
|
trailing && // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
10112
|
-
/* @__PURE__ */ (0,
|
|
10380
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
10113
10381
|
"div",
|
|
10114
10382
|
{
|
|
10115
10383
|
className: "ml-3 flex shrink-0 items-center self-center",
|
|
@@ -10120,7 +10388,7 @@ function ListRow({
|
|
|
10120
10388
|
)
|
|
10121
10389
|
] });
|
|
10122
10390
|
if (asChild) {
|
|
10123
|
-
return /* @__PURE__ */ (0,
|
|
10391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
10124
10392
|
Slot,
|
|
10125
10393
|
{
|
|
10126
10394
|
...rootProps,
|
|
@@ -10133,7 +10401,7 @@ function ListRow({
|
|
|
10133
10401
|
}
|
|
10134
10402
|
);
|
|
10135
10403
|
}
|
|
10136
|
-
return /* @__PURE__ */ (0,
|
|
10404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
10137
10405
|
Tag,
|
|
10138
10406
|
{
|
|
10139
10407
|
...rootProps,
|
|
@@ -10162,11 +10430,11 @@ function refusePress(event) {
|
|
|
10162
10430
|
}
|
|
10163
10431
|
|
|
10164
10432
|
// src/components/lists/file-row.tsx
|
|
10165
|
-
var
|
|
10166
|
-
var
|
|
10167
|
-
var
|
|
10433
|
+
var import_clsx82 = __toESM(require("clsx"), 1);
|
|
10434
|
+
var import_lucide_react28 = require("lucide-react");
|
|
10435
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
10168
10436
|
function FileTypeBadge({ type }) {
|
|
10169
|
-
return /* @__PURE__ */ (0,
|
|
10437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("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 });
|
|
10170
10438
|
}
|
|
10171
10439
|
function FileRow({
|
|
10172
10440
|
name,
|
|
@@ -10180,24 +10448,24 @@ function FileRow({
|
|
|
10180
10448
|
actions,
|
|
10181
10449
|
className
|
|
10182
10450
|
}) {
|
|
10183
|
-
const lead = leading ?? (fileType ? /* @__PURE__ */ (0,
|
|
10184
|
-
return /* @__PURE__ */ (0,
|
|
10451
|
+
const lead = leading ?? (fileType ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(FileTypeBadge, { type: fileType }) : null);
|
|
10452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
10185
10453
|
"div",
|
|
10186
10454
|
{
|
|
10187
|
-
className: (0,
|
|
10455
|
+
className: (0, import_clsx82.default)(
|
|
10188
10456
|
"flex items-center gap-3 rounded-lg border border-default bg-default px-3 py-2.5",
|
|
10189
10457
|
className
|
|
10190
10458
|
),
|
|
10191
10459
|
children: [
|
|
10192
10460
|
lead,
|
|
10193
|
-
/* @__PURE__ */ (0,
|
|
10194
|
-
/* @__PURE__ */ (0,
|
|
10195
|
-
detail && /* @__PURE__ */ (0,
|
|
10461
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
10462
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "truncate text-body-sm font-medium text-default", children: name }),
|
|
10463
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "text-body-xs text-default-secondary", children: detail })
|
|
10196
10464
|
] }),
|
|
10197
|
-
(onDownload || onRemove || actions) && /* @__PURE__ */ (0,
|
|
10198
|
-
onDownload && /* @__PURE__ */ (0,
|
|
10199
|
-
onRemove && /* @__PURE__ */ (0,
|
|
10200
|
-
actions && /* @__PURE__ */ (0,
|
|
10465
|
+
(onDownload || onRemove || actions) && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
10466
|
+
onDownload && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Tooltip, { title: downloadLabel, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(IconButton, { variant: "subtle", size: "sm", "aria-label": `${downloadLabel} ${name}`, onClick: onDownload, className: "touch-hit", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_lucide_react28.DownloadIcon, { "aria-hidden": true }) }) }),
|
|
10467
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Tooltip, { title: removeLabel, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(IconButton, { variant: "subtle", size: "sm", "aria-label": `${removeLabel} ${name}`, onClick: onRemove, className: "touch-hit", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_lucide_react28.Trash2Icon, { "aria-hidden": true }) }) }),
|
|
10468
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "ml-2 flex items-center gap-2", children: actions })
|
|
10201
10469
|
] })
|
|
10202
10470
|
]
|
|
10203
10471
|
}
|
|
@@ -10205,8 +10473,8 @@ function FileRow({
|
|
|
10205
10473
|
}
|
|
10206
10474
|
|
|
10207
10475
|
// src/components/lists/scored-row.tsx
|
|
10208
|
-
var
|
|
10209
|
-
var
|
|
10476
|
+
var import_clsx83 = __toESM(require("clsx"), 1);
|
|
10477
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
10210
10478
|
var GAP5 = {
|
|
10211
10479
|
sm: "gap-2",
|
|
10212
10480
|
md: "gap-3",
|
|
@@ -10233,11 +10501,11 @@ function ScoredRow({
|
|
|
10233
10501
|
align = "center",
|
|
10234
10502
|
className
|
|
10235
10503
|
}) {
|
|
10236
|
-
return /* @__PURE__ */ (0,
|
|
10237
|
-
/* @__PURE__ */ (0,
|
|
10504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: (0, import_clsx83.default)("flex w-full", ALIGN3[align], GAP5[gap], className), children: [
|
|
10505
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
|
|
10238
10506
|
"div",
|
|
10239
10507
|
{
|
|
10240
|
-
className: (0,
|
|
10508
|
+
className: (0, import_clsx83.default)(
|
|
10241
10509
|
"flex min-w-0",
|
|
10242
10510
|
ALIGN3[align],
|
|
10243
10511
|
GAP5[leadingGap ?? gap],
|
|
@@ -10246,39 +10514,39 @@ function ScoredRow({
|
|
|
10246
10514
|
style: titleWidth ? { width: titleWidth } : void 0,
|
|
10247
10515
|
children: [
|
|
10248
10516
|
leading,
|
|
10249
|
-
/* @__PURE__ */ (0,
|
|
10250
|
-
/* @__PURE__ */ (0,
|
|
10251
|
-
subtitle && /* @__PURE__ */ (0,
|
|
10517
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
10518
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "truncate text-body-sm font-medium leading-none text-default", children: title }),
|
|
10519
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "mt-0.5 truncate text-body-xs text-default-secondary", children: subtitle })
|
|
10252
10520
|
] })
|
|
10253
10521
|
]
|
|
10254
10522
|
}
|
|
10255
10523
|
),
|
|
10256
|
-
aside && /* @__PURE__ */ (0,
|
|
10524
|
+
aside && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10257
10525
|
"div",
|
|
10258
10526
|
{
|
|
10259
|
-
className: (0,
|
|
10527
|
+
className: (0, import_clsx83.default)("min-w-0", asideWidth ? "shrink-0" : "flex-1"),
|
|
10260
10528
|
style: asideWidth ? { width: asideWidth } : void 0,
|
|
10261
10529
|
children: aside
|
|
10262
10530
|
}
|
|
10263
10531
|
),
|
|
10264
|
-
meter && /* @__PURE__ */ (0,
|
|
10532
|
+
meter && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10265
10533
|
"div",
|
|
10266
10534
|
{
|
|
10267
|
-
className: (0,
|
|
10535
|
+
className: (0, import_clsx83.default)("min-w-0", meterWidth ? "shrink-0" : "flex-1"),
|
|
10268
10536
|
style: meterWidth ? { width: meterWidth } : void 0,
|
|
10269
10537
|
children: meter
|
|
10270
10538
|
}
|
|
10271
10539
|
),
|
|
10272
|
-
trailing && /* @__PURE__ */ (0,
|
|
10540
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "shrink-0 text-right", style: trailingWidth ? { width: trailingWidth } : void 0, children: trailing })
|
|
10273
10541
|
] });
|
|
10274
10542
|
}
|
|
10275
10543
|
|
|
10276
10544
|
// src/components/lists/numbered-list.tsx
|
|
10277
|
-
var
|
|
10545
|
+
var import_clsx84 = __toESM(require("clsx"), 1);
|
|
10278
10546
|
|
|
10279
10547
|
// src/components/feedback/progress-bar.tsx
|
|
10280
|
-
var
|
|
10281
|
-
var
|
|
10548
|
+
var import_react70 = require("react");
|
|
10549
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
10282
10550
|
var SIZE18 = {
|
|
10283
10551
|
xs: "h-1",
|
|
10284
10552
|
sm: "h-1.5",
|
|
@@ -10306,9 +10574,9 @@ function ProgressBar({
|
|
|
10306
10574
|
}) {
|
|
10307
10575
|
const clamped = Math.min(100, Math.max(0, value));
|
|
10308
10576
|
const rounded = radius ? void 0 : "rounded-full";
|
|
10309
|
-
const labelId = (0,
|
|
10577
|
+
const labelId = (0, import_react70.useId)();
|
|
10310
10578
|
const filledSegments = segments ? Math.round(clamped / 100 * segments) : 0;
|
|
10311
|
-
const track = segments ? /* @__PURE__ */ (0,
|
|
10579
|
+
const track = segments ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10312
10580
|
"div",
|
|
10313
10581
|
{
|
|
10314
10582
|
role: "progressbar",
|
|
@@ -10320,7 +10588,7 @@ function ProgressBar({
|
|
|
10320
10588
|
"aria-label": label ? void 0 : ariaLabel,
|
|
10321
10589
|
"data-tone": tone,
|
|
10322
10590
|
className: cn("flex w-full gap-1", className),
|
|
10323
|
-
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ (0,
|
|
10591
|
+
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10324
10592
|
"span",
|
|
10325
10593
|
{
|
|
10326
10594
|
"data-filled": index < filledSegments || void 0,
|
|
@@ -10330,7 +10598,7 @@ function ProgressBar({
|
|
|
10330
10598
|
index
|
|
10331
10599
|
))
|
|
10332
10600
|
}
|
|
10333
|
-
) : /* @__PURE__ */ (0,
|
|
10601
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10334
10602
|
"div",
|
|
10335
10603
|
{
|
|
10336
10604
|
role: "progressbar",
|
|
@@ -10343,20 +10611,20 @@ function ProgressBar({
|
|
|
10343
10611
|
"aria-label": label ? void 0 : ariaLabel,
|
|
10344
10612
|
className: cn("w-full overflow-hidden bg-default-tertiary", SIZE18[size2], rounded, className),
|
|
10345
10613
|
style: radius ? { borderRadius: radius } : void 0,
|
|
10346
|
-
children: /* @__PURE__ */ (0,
|
|
10614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10347
10615
|
"div",
|
|
10348
10616
|
{
|
|
10349
|
-
className: cn("h-full transition-all", rounded, FILL[tone]),
|
|
10617
|
+
className: cn("h-full transition-all motion-reduce:transition-none", rounded, FILL[tone]),
|
|
10350
10618
|
style: { width: `${clamped}%`, ...radius ? { borderRadius: radius } : void 0 }
|
|
10351
10619
|
}
|
|
10352
10620
|
)
|
|
10353
10621
|
}
|
|
10354
10622
|
);
|
|
10355
10623
|
if (!label && !showValue) return track;
|
|
10356
|
-
return /* @__PURE__ */ (0,
|
|
10357
|
-
/* @__PURE__ */ (0,
|
|
10358
|
-
label && /* @__PURE__ */ (0,
|
|
10359
|
-
showValue && /* @__PURE__ */ (0,
|
|
10624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { children: [
|
|
10625
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
|
|
10626
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("span", { id: labelId, className: "text-body-xs text-default-secondary", children: label }),
|
|
10627
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("span", { className: "ml-auto text-body-xs font-medium tabular-nums text-default", children: [
|
|
10360
10628
|
Math.round(clamped),
|
|
10361
10629
|
"%"
|
|
10362
10630
|
] })
|
|
@@ -10366,7 +10634,7 @@ function ProgressBar({
|
|
|
10366
10634
|
}
|
|
10367
10635
|
|
|
10368
10636
|
// src/components/lists/numbered-list.tsx
|
|
10369
|
-
var
|
|
10637
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
10370
10638
|
var GAP6 = {
|
|
10371
10639
|
sm: "gap-2",
|
|
10372
10640
|
md: "gap-3"
|
|
@@ -10380,18 +10648,18 @@ function NumberedList({
|
|
|
10380
10648
|
gap = "md",
|
|
10381
10649
|
className
|
|
10382
10650
|
}) {
|
|
10383
|
-
return /* @__PURE__ */ (0,
|
|
10651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("ol", { className: (0, import_clsx84.default)("flex list-none flex-col p-0", GAP6[gap], className), children: items.map((item, index) => {
|
|
10384
10652
|
const tone = !item.tone || item.tone === "auto" ? getScoreTone(item.score, { direction }) : item.tone;
|
|
10385
|
-
return /* @__PURE__ */ (0,
|
|
10386
|
-
/* @__PURE__ */ (0,
|
|
10387
|
-
/* @__PURE__ */ (0,
|
|
10388
|
-
/* @__PURE__ */ (0,
|
|
10389
|
-
/* @__PURE__ */ (0,
|
|
10390
|
-
/* @__PURE__ */ (0,
|
|
10391
|
-
item.subtitle && /* @__PURE__ */ (0,
|
|
10653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("li", { className: "flex w-full shrink-0 flex-col gap-1.5", children: [
|
|
10654
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "flex w-full items-center justify-between", children: [
|
|
10655
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
10656
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "w-[14px] shrink-0 text-body-xs font-bold text-default-secondary", children: startAt + index }),
|
|
10657
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "flex min-w-0 flex-col gap-px", children: [
|
|
10658
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "truncate text-body-sm font-medium leading-none text-default", children: item.title }),
|
|
10659
|
+
item.subtitle && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "text-body-tiny text-default-tertiary", children: item.subtitle })
|
|
10392
10660
|
] })
|
|
10393
10661
|
] }),
|
|
10394
|
-
/* @__PURE__ */ (0,
|
|
10662
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
10395
10663
|
ScoreValue,
|
|
10396
10664
|
{
|
|
10397
10665
|
value: item.score,
|
|
@@ -10402,43 +10670,43 @@ function NumberedList({
|
|
|
10402
10670
|
}
|
|
10403
10671
|
)
|
|
10404
10672
|
] }),
|
|
10405
|
-
/* @__PURE__ */ (0,
|
|
10673
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(ProgressBar, { value: item.score, tone, "aria-label": `${item.title} score` })
|
|
10406
10674
|
] }, `${item.title}-${index}`);
|
|
10407
10675
|
}) });
|
|
10408
10676
|
}
|
|
10409
10677
|
|
|
10410
10678
|
// src/components/lists/icon-text-row.tsx
|
|
10411
|
-
var
|
|
10412
|
-
var
|
|
10679
|
+
var import_clsx85 = __toESM(require("clsx"), 1);
|
|
10680
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
10413
10681
|
function IconTextRow({ icon, title, detail, className }) {
|
|
10414
|
-
return /* @__PURE__ */ (0,
|
|
10415
|
-
/* @__PURE__ */ (0,
|
|
10416
|
-
/* @__PURE__ */ (0,
|
|
10417
|
-
/* @__PURE__ */ (0,
|
|
10418
|
-
/* @__PURE__ */ (0,
|
|
10682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: (0, import_clsx85.default)("flex items-start gap-3", className), children: [
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-brand-tertiary text-brand", children: icon }),
|
|
10684
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "min-w-0", children: [
|
|
10685
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("p", { className: "text-body-sm font-semibold text-default", children: title }),
|
|
10686
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("p", { className: "mt-0.5 text-body-xs text-default-secondary", children: detail })
|
|
10419
10687
|
] })
|
|
10420
10688
|
] });
|
|
10421
10689
|
}
|
|
10422
10690
|
|
|
10423
10691
|
// src/components/lists/checklist-row.tsx
|
|
10424
|
-
var
|
|
10425
|
-
var
|
|
10426
|
-
var
|
|
10692
|
+
var import_clsx86 = __toESM(require("clsx"), 1);
|
|
10693
|
+
var import_lucide_react29 = require("lucide-react");
|
|
10694
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
10427
10695
|
function ChecklistRow({ label, state, className }) {
|
|
10428
|
-
return /* @__PURE__ */ (0,
|
|
10429
|
-
/* @__PURE__ */ (0,
|
|
10696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("li", { "data-state": state, className: (0, import_clsx86.default)("flex items-center gap-3", className), children: [
|
|
10697
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "flex size-5 shrink-0 items-center justify-center", children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_lucide_react29.CheckIcon, { className: "size-4 text-positive", strokeWidth: 2.5, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
10430
10698
|
"span",
|
|
10431
10699
|
{
|
|
10432
|
-
className: (0,
|
|
10700
|
+
className: (0, import_clsx86.default)(
|
|
10433
10701
|
"size-3.5 rounded-full border-2",
|
|
10434
|
-
state === "active" ? "animate-pulse border-brand-emphasis border-t-transparent" : "border-disabled"
|
|
10702
|
+
state === "active" ? "motion-safe:animate-pulse border-brand-emphasis border-t-transparent" : "border-disabled"
|
|
10435
10703
|
)
|
|
10436
10704
|
}
|
|
10437
10705
|
) }),
|
|
10438
|
-
/* @__PURE__ */ (0,
|
|
10706
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
10439
10707
|
"span",
|
|
10440
10708
|
{
|
|
10441
|
-
className: (0,
|
|
10709
|
+
className: (0, import_clsx86.default)(
|
|
10442
10710
|
"text-body-sm",
|
|
10443
10711
|
state === "pending" ? "text-default-tertiary" : "font-semibold text-default"
|
|
10444
10712
|
),
|
|
@@ -10449,22 +10717,22 @@ function ChecklistRow({ label, state, className }) {
|
|
|
10449
10717
|
}
|
|
10450
10718
|
|
|
10451
10719
|
// src/components/lists/steps-list.tsx
|
|
10452
|
-
var
|
|
10453
|
-
var
|
|
10720
|
+
var import_clsx87 = __toESM(require("clsx"), 1);
|
|
10721
|
+
var import_jsx_runtime109 = (
|
|
10454
10722
|
// `text-[12px]` was off the type scale; 12 sits midway between Scale 01 (11) and
|
|
10455
10723
|
// Scale 02 (13), so it rounds up to 13 like every other snap in this pass.
|
|
10456
10724
|
require("react/jsx-runtime")
|
|
10457
10725
|
);
|
|
10458
10726
|
function StepsList({ steps, className }) {
|
|
10459
|
-
return /* @__PURE__ */ (0,
|
|
10460
|
-
/* @__PURE__ */ (0,
|
|
10727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("ol", { className: (0, import_clsx87.default)("flex flex-col gap-1.5", className), children: steps.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("li", { className: "flex items-start gap-2 text-body-xs text-default", children: [
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("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 }),
|
|
10461
10729
|
step
|
|
10462
10730
|
] }, i)) });
|
|
10463
10731
|
}
|
|
10464
10732
|
|
|
10465
10733
|
// src/components/lists/detail-item.tsx
|
|
10466
|
-
var
|
|
10467
|
-
var
|
|
10734
|
+
var import_clsx88 = __toESM(require("clsx"), 1);
|
|
10735
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
10468
10736
|
var SPAN = {
|
|
10469
10737
|
1: "",
|
|
10470
10738
|
2: "sm:col-span-2",
|
|
@@ -10481,18 +10749,18 @@ function DetailItem({
|
|
|
10481
10749
|
}) {
|
|
10482
10750
|
const shown = value === null || value === void 0 || value === "" ? "\u2014" : value;
|
|
10483
10751
|
if (layout === "inline") {
|
|
10484
|
-
return /* @__PURE__ */ (0,
|
|
10485
|
-
/* @__PURE__ */ (0,
|
|
10486
|
-
/* @__PURE__ */ (0,
|
|
10487
|
-
/* @__PURE__ */ (0,
|
|
10488
|
-
detail && /* @__PURE__ */ (0,
|
|
10752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: (0, import_clsx88.default)("flex gap-3 text-body-xs", SPAN[span], className), children: [
|
|
10753
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: (0, import_clsx88.default)("shrink-0 text-default-secondary", labelWidth), children: label }),
|
|
10754
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]", children: [
|
|
10755
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "text-default", children: shown }),
|
|
10756
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: "text-default-secondary", children: detail })
|
|
10489
10757
|
] })
|
|
10490
10758
|
] });
|
|
10491
10759
|
}
|
|
10492
|
-
return /* @__PURE__ */ (0,
|
|
10493
|
-
/* @__PURE__ */ (0,
|
|
10494
|
-
/* @__PURE__ */ (0,
|
|
10495
|
-
detail && /* @__PURE__ */ (0,
|
|
10760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: (0, import_clsx88.default)("flex min-w-0 flex-col gap-0.5", SPAN[span], className), children: [
|
|
10761
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { className: "text-body-tiny font-medium text-default-secondary", children: label }),
|
|
10762
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { className: "text-body-sm font-medium text-default [overflow-wrap:anywhere]", children: shown }),
|
|
10763
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { className: "text-body-xs text-default-secondary [overflow-wrap:anywhere]", children: detail })
|
|
10496
10764
|
] });
|
|
10497
10765
|
}
|
|
10498
10766
|
var COLUMNS3 = {
|
|
@@ -10503,38 +10771,38 @@ var COLUMNS3 = {
|
|
|
10503
10771
|
4: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"
|
|
10504
10772
|
};
|
|
10505
10773
|
function DetailGrid({ children, columns = "auto", className }) {
|
|
10506
|
-
return /* @__PURE__ */ (0,
|
|
10774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: (0, import_clsx88.default)("grid gap-x-4 gap-y-4", COLUMNS3[columns], className), children });
|
|
10507
10775
|
}
|
|
10508
10776
|
|
|
10509
10777
|
// src/components/lists/description-list.tsx
|
|
10510
|
-
var
|
|
10511
|
-
var
|
|
10512
|
-
var
|
|
10513
|
-
var
|
|
10778
|
+
var import_react71 = require("react");
|
|
10779
|
+
var import_clsx89 = __toESM(require("clsx"), 1);
|
|
10780
|
+
var import_lucide_react30 = require("lucide-react");
|
|
10781
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
10514
10782
|
function DescriptionList({ children, className }) {
|
|
10515
|
-
return /* @__PURE__ */ (0,
|
|
10783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("dl", { className: cn("flex flex-col gap-3", className), children });
|
|
10516
10784
|
}
|
|
10517
10785
|
function DescriptionItem({ label, value, copyValue, className }) {
|
|
10518
10786
|
const shown = value === null || value === void 0 || value === "" ? "\u2014" : value;
|
|
10519
|
-
return /* @__PURE__ */ (0,
|
|
10520
|
-
/* @__PURE__ */ (0,
|
|
10521
|
-
/* @__PURE__ */ (0,
|
|
10522
|
-
/* @__PURE__ */ (0,
|
|
10523
|
-
copyValue && /* @__PURE__ */ (0,
|
|
10787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: cn("flex flex-wrap items-start gap-x-4 gap-y-0.5 text-body-xs", className), children: [
|
|
10788
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("dt", { className: "shrink-0 grow-0 basis-28 text-default-secondary", children: label }),
|
|
10789
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("dd", { className: "flex min-w-0 flex-[1_1_10rem] items-start gap-1.5 text-default", children: [
|
|
10790
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "min-w-0 [overflow-wrap:anywhere]", children: shown }),
|
|
10791
|
+
copyValue && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(CopyButton, { value: copyValue, label: `Copy ${label.toLowerCase()}` })
|
|
10524
10792
|
] })
|
|
10525
10793
|
] });
|
|
10526
10794
|
}
|
|
10527
10795
|
function CopyButton({ value, label, copiedLabel = "Copied", className }) {
|
|
10528
|
-
const [copied, setCopied] = (0,
|
|
10529
|
-
(0,
|
|
10796
|
+
const [copied, setCopied] = (0, import_react71.useState)(false);
|
|
10797
|
+
(0, import_react71.useEffect)(() => {
|
|
10530
10798
|
if (!copied) return;
|
|
10531
10799
|
const timer = window.setTimeout(() => setCopied(false), 2e3);
|
|
10532
10800
|
return () => window.clearTimeout(timer);
|
|
10533
10801
|
}, [copied]);
|
|
10534
10802
|
return (
|
|
10535
10803
|
// relative: keeps the sr-only status (absolutely positioned) inside a scrolling container.
|
|
10536
|
-
/* @__PURE__ */ (0,
|
|
10537
|
-
/* @__PURE__ */ (0,
|
|
10804
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: "relative inline-flex", children: [
|
|
10805
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
10538
10806
|
IconButton,
|
|
10539
10807
|
{
|
|
10540
10808
|
variant: "subtle",
|
|
@@ -10548,10 +10816,10 @@ function CopyButton({ value, label, copiedLabel = "Copied", className }) {
|
|
|
10548
10816
|
() => void 0
|
|
10549
10817
|
);
|
|
10550
10818
|
},
|
|
10551
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
10819
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react30.CheckIcon, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react30.CopyIcon, { "aria-hidden": true })
|
|
10552
10820
|
}
|
|
10553
10821
|
),
|
|
10554
|
-
/* @__PURE__ */ (0,
|
|
10822
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "status", className: "sr-only", children: copied ? copiedLabel : "" })
|
|
10555
10823
|
] })
|
|
10556
10824
|
);
|
|
10557
10825
|
}
|
|
@@ -10559,16 +10827,16 @@ function EmailText({ email, className }) {
|
|
|
10559
10827
|
const at = email.lastIndexOf("@");
|
|
10560
10828
|
const local = at > 0 ? email.slice(0, at) : email;
|
|
10561
10829
|
const domain = at > 0 ? email.slice(at) : "";
|
|
10562
|
-
return /* @__PURE__ */ (0,
|
|
10563
|
-
/* @__PURE__ */ (0,
|
|
10564
|
-
domain && /* @__PURE__ */ (0,
|
|
10830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { title: email, "data-slot": "email-text", className: (0, import_clsx89.default)("flex min-w-0 max-w-full", className), children: [
|
|
10831
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: local }),
|
|
10832
|
+
domain && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap [flex-shrink:0.001]", children: domain })
|
|
10565
10833
|
] });
|
|
10566
10834
|
}
|
|
10567
10835
|
|
|
10568
10836
|
// src/components/lists/checked-group-list.tsx
|
|
10569
|
-
var
|
|
10570
|
-
var
|
|
10571
|
-
var
|
|
10837
|
+
var import_clsx90 = __toESM(require("clsx"), 1);
|
|
10838
|
+
var import_lucide_react31 = require("lucide-react");
|
|
10839
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
10572
10840
|
var COLUMNS4 = {
|
|
10573
10841
|
1: "columns-1",
|
|
10574
10842
|
2: "columns-2",
|
|
@@ -10582,23 +10850,23 @@ function CheckedGroupList({
|
|
|
10582
10850
|
className
|
|
10583
10851
|
}) {
|
|
10584
10852
|
if (groups.length === 0) {
|
|
10585
|
-
return /* @__PURE__ */ (0,
|
|
10853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("p", { className: (0, import_clsx90.default)("text-body-xs text-default-secondary", className), children: emptyLabel });
|
|
10586
10854
|
}
|
|
10587
|
-
const glyph = icon === void 0 ? /* @__PURE__ */ (0,
|
|
10588
|
-
return /* @__PURE__ */ (0,
|
|
10589
|
-
/* @__PURE__ */ (0,
|
|
10590
|
-
/* @__PURE__ */ (0,
|
|
10591
|
-
glyph && /* @__PURE__ */ (0,
|
|
10855
|
+
const glyph = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_lucide_react31.CheckIcon, { className: "size-3.5", strokeWidth: 2.5, "aria-hidden": true }) : icon;
|
|
10856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: (0, import_clsx90.default)(COLUMNS4[columns], "gap-x-6", className), children: groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "mb-5 break-inside-avoid last:mb-0", children: [
|
|
10857
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("p", { className: "mb-2 text-body-tiny font-semibold uppercase tracking-wide text-default-secondary", children: group.label }),
|
|
10858
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("ul", { className: "space-y-1.5", children: group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("li", { className: "flex items-center gap-2 text-body-xs text-default", children: [
|
|
10859
|
+
glyph && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "shrink-0", children: glyph }),
|
|
10592
10860
|
item
|
|
10593
10861
|
] }, item)) })
|
|
10594
10862
|
] }, group.label)) });
|
|
10595
10863
|
}
|
|
10596
10864
|
|
|
10597
10865
|
// src/components/lists/tree-view.tsx
|
|
10598
|
-
var
|
|
10599
|
-
var
|
|
10600
|
-
var
|
|
10601
|
-
var
|
|
10866
|
+
var import_react72 = require("react");
|
|
10867
|
+
var import_clsx91 = __toESM(require("clsx"), 1);
|
|
10868
|
+
var import_lucide_react32 = require("lucide-react");
|
|
10869
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
10602
10870
|
var ROW = {
|
|
10603
10871
|
sm: "min-h-8 py-1 text-body-xs",
|
|
10604
10872
|
md: "min-h-10 py-2 text-body-sm"
|
|
@@ -10628,10 +10896,10 @@ function TreeView({
|
|
|
10628
10896
|
value: selectedProp,
|
|
10629
10897
|
defaultValue: defaultSelected
|
|
10630
10898
|
});
|
|
10631
|
-
const [focusedId, setFocusedId] = (0,
|
|
10632
|
-
const rowRefs = (0,
|
|
10633
|
-
const expandedSet = (0,
|
|
10634
|
-
const visible = (0,
|
|
10899
|
+
const [focusedId, setFocusedId] = (0, import_react72.useState)(null);
|
|
10900
|
+
const rowRefs = (0, import_react72.useRef)(/* @__PURE__ */ new Map());
|
|
10901
|
+
const expandedSet = (0, import_react72.useMemo)(() => new Set(expanded), [expanded]);
|
|
10902
|
+
const visible = (0, import_react72.useMemo)(() => {
|
|
10635
10903
|
const out = [];
|
|
10636
10904
|
const walk = (nodes, level, parentId) => {
|
|
10637
10905
|
for (const item of nodes) {
|
|
@@ -10702,7 +10970,7 @@ function TreeView({
|
|
|
10702
10970
|
if (!node) return null;
|
|
10703
10971
|
const children = getChildren?.(item) ?? [];
|
|
10704
10972
|
const isSelected = selected === id;
|
|
10705
|
-
return /* @__PURE__ */ (0,
|
|
10973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
10706
10974
|
"li",
|
|
10707
10975
|
{
|
|
10708
10976
|
role: "treeitem",
|
|
@@ -10724,7 +10992,7 @@ function TreeView({
|
|
|
10724
10992
|
},
|
|
10725
10993
|
className: "outline-none [&:focus-visible>div]:ring-2 [&:focus-visible>div]:ring-inset [&:focus-visible>div]:ring-brand",
|
|
10726
10994
|
children: [
|
|
10727
|
-
/* @__PURE__ */ (0,
|
|
10995
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
10728
10996
|
"div",
|
|
10729
10997
|
{
|
|
10730
10998
|
onClick: () => {
|
|
@@ -10732,7 +11000,7 @@ function TreeView({
|
|
|
10732
11000
|
choose(node);
|
|
10733
11001
|
},
|
|
10734
11002
|
style: { paddingLeft: 8 + (level - 1) * INDENT },
|
|
10735
|
-
className: (0,
|
|
11003
|
+
className: (0, import_clsx91.default)(
|
|
10736
11004
|
"flex w-full cursor-pointer items-center gap-1.5 rounded-md pr-2 transition-colors",
|
|
10737
11005
|
ROW[size2],
|
|
10738
11006
|
isSelected ? "bg-brand-secondary text-default" : "text-default hover:bg-default-secondary"
|
|
@@ -10742,7 +11010,7 @@ function TreeView({
|
|
|
10742
11010
|
// Not a button: the treeitem is the one tab stop, and Left/Right already toggle.
|
|
10743
11011
|
// A pointer user still needs a target that toggles without selecting.
|
|
10744
11012
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
10745
|
-
/* @__PURE__ */ (0,
|
|
11013
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
10746
11014
|
"span",
|
|
10747
11015
|
{
|
|
10748
11016
|
"aria-hidden": true,
|
|
@@ -10753,11 +11021,11 @@ function TreeView({
|
|
|
10753
11021
|
focus(id);
|
|
10754
11022
|
},
|
|
10755
11023
|
className: "flex size-5 shrink-0 items-center justify-center rounded text-icon-default-secondary hover:bg-default-tertiary",
|
|
10756
|
-
children: /* @__PURE__ */ (0,
|
|
11024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_lucide_react32.ChevronRightIcon, { className: (0, import_clsx91.default)("size-3.5 transition-transform motion-reduce:transition-none", node.expanded && "rotate-90") })
|
|
10757
11025
|
}
|
|
10758
11026
|
)
|
|
10759
|
-
) : /* @__PURE__ */ (0,
|
|
10760
|
-
/* @__PURE__ */ (0,
|
|
11027
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { "aria-hidden": true, className: "size-5 shrink-0" }),
|
|
11028
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "min-w-0 flex-1", children: renderItem(item, {
|
|
10761
11029
|
level,
|
|
10762
11030
|
hasChildren: node.hasChildren,
|
|
10763
11031
|
expanded: node.expanded,
|
|
@@ -10766,38 +11034,38 @@ function TreeView({
|
|
|
10766
11034
|
]
|
|
10767
11035
|
}
|
|
10768
11036
|
),
|
|
10769
|
-
node.expanded && /* @__PURE__ */ (0,
|
|
11037
|
+
node.expanded && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("ul", { role: "group", className: "m-0 list-none p-0", children: renderLevel(children, level + 1) })
|
|
10770
11038
|
]
|
|
10771
11039
|
},
|
|
10772
11040
|
id
|
|
10773
11041
|
);
|
|
10774
11042
|
});
|
|
10775
|
-
return /* @__PURE__ */ (0,
|
|
11043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("ul", { role: "tree", "aria-label": label, className: (0, import_clsx91.default)("m-0 flex list-none flex-col p-0", className), children: renderLevel(items, 1) });
|
|
10776
11044
|
}
|
|
10777
11045
|
|
|
10778
11046
|
// src/components/lists/table.tsx
|
|
10779
|
-
var
|
|
10780
|
-
var
|
|
10781
|
-
var
|
|
10782
|
-
var
|
|
10783
|
-
var Table = (0,
|
|
11047
|
+
var import_react73 = require("react");
|
|
11048
|
+
var import_clsx92 = __toESM(require("clsx"), 1);
|
|
11049
|
+
var import_lucide_react33 = require("lucide-react");
|
|
11050
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
11051
|
+
var Table = (0, import_react73.forwardRef)(function Table2({ label, density = "default", fixed = false, maxHeight, className, children, ...rest }, ref) {
|
|
10784
11052
|
return (
|
|
10785
11053
|
// The scroll container is separate from the table so the header stays inside the
|
|
10786
11054
|
// scrolling region — a table that is its own scroll container cannot have a sticky
|
|
10787
11055
|
// header.
|
|
10788
11056
|
// The scroll wrapper is required for a <table>, which cannot itself scroll, so this
|
|
10789
11057
|
// takes the scrollbar styling rather than ScrollArea.
|
|
10790
|
-
/* @__PURE__ */ (0,
|
|
11058
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10791
11059
|
"div",
|
|
10792
11060
|
{
|
|
10793
|
-
className: (0,
|
|
11061
|
+
className: (0, import_clsx92.default)(
|
|
10794
11062
|
"w-full",
|
|
10795
|
-
maxHeight ? (0,
|
|
11063
|
+
maxHeight ? (0, import_clsx92.default)("overflow-auto overscroll-contain", FOCUS_RING_INSET) : "overflow-x-auto",
|
|
10796
11064
|
SCROLLBAR_CLASSES
|
|
10797
11065
|
),
|
|
10798
11066
|
style: maxHeight ? { maxHeight } : void 0,
|
|
10799
11067
|
...maxHeight ? { role: "region", tabIndex: 0, "aria-label": label ? `${label} (scrolls)` : "Table (scrolls)" } : {},
|
|
10800
|
-
children: /* @__PURE__ */ (0,
|
|
11068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10801
11069
|
"table",
|
|
10802
11070
|
{
|
|
10803
11071
|
ref,
|
|
@@ -10813,9 +11081,9 @@ var Table = (0, import_react72.forwardRef)(function Table2({ label, density = "d
|
|
|
10813
11081
|
)
|
|
10814
11082
|
);
|
|
10815
11083
|
});
|
|
10816
|
-
var TableCaption = (0,
|
|
11084
|
+
var TableCaption = (0, import_react73.forwardRef)(
|
|
10817
11085
|
function TableCaption2({ className, ...rest }, ref) {
|
|
10818
|
-
return /* @__PURE__ */ (0,
|
|
11086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10819
11087
|
"caption",
|
|
10820
11088
|
{
|
|
10821
11089
|
ref,
|
|
@@ -10825,19 +11093,19 @@ var TableCaption = (0, import_react72.forwardRef)(
|
|
|
10825
11093
|
);
|
|
10826
11094
|
}
|
|
10827
11095
|
);
|
|
10828
|
-
var TableHeader = (0,
|
|
11096
|
+
var TableHeader = (0, import_react73.forwardRef)(
|
|
10829
11097
|
function TableHeader2({ className, ...rest }, ref) {
|
|
10830
|
-
return /* @__PURE__ */ (0,
|
|
11098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("thead", { ref, className: cn("border-b border-default", className), ...rest });
|
|
10831
11099
|
}
|
|
10832
11100
|
);
|
|
10833
|
-
var TableBody = (0,
|
|
11101
|
+
var TableBody = (0, import_react73.forwardRef)(
|
|
10834
11102
|
function TableBody2({ className, ...rest }, ref) {
|
|
10835
|
-
return /* @__PURE__ */ (0,
|
|
11103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("tbody", { ref, className, ...rest });
|
|
10836
11104
|
}
|
|
10837
11105
|
);
|
|
10838
|
-
var TableFooter = (0,
|
|
11106
|
+
var TableFooter = (0, import_react73.forwardRef)(
|
|
10839
11107
|
function TableFooter2({ className, ...rest }, ref) {
|
|
10840
|
-
return /* @__PURE__ */ (0,
|
|
11108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10841
11109
|
"tfoot",
|
|
10842
11110
|
{
|
|
10843
11111
|
ref,
|
|
@@ -10847,15 +11115,15 @@ var TableFooter = (0, import_react72.forwardRef)(
|
|
|
10847
11115
|
);
|
|
10848
11116
|
}
|
|
10849
11117
|
);
|
|
10850
|
-
var ROW_TONE = (0,
|
|
11118
|
+
var ROW_TONE = (0, import_clsx92.default)(
|
|
10851
11119
|
"data-[tone=muted]:bg-default-secondary",
|
|
10852
11120
|
"data-[tone=brand]:bg-brand-tertiary",
|
|
10853
11121
|
"data-[tone=positive]:bg-positive-tertiary",
|
|
10854
11122
|
"data-[tone=warning]:bg-warning-tertiary",
|
|
10855
11123
|
"data-[tone=danger]:bg-danger-tertiary"
|
|
10856
11124
|
);
|
|
10857
|
-
var TableRow = (0,
|
|
10858
|
-
return /* @__PURE__ */ (0,
|
|
11125
|
+
var TableRow = (0, import_react73.forwardRef)(function TableRow2({ selected, tone = "default", dimmed = false, className, ...rest }, ref) {
|
|
11126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10859
11127
|
"tr",
|
|
10860
11128
|
{
|
|
10861
11129
|
ref,
|
|
@@ -10876,9 +11144,9 @@ var TableRow = (0, import_react72.forwardRef)(function TableRow2({ selected, ton
|
|
|
10876
11144
|
);
|
|
10877
11145
|
});
|
|
10878
11146
|
var ALIGN4 = { left: "text-left", center: "text-center", right: "text-right" };
|
|
10879
|
-
var TableHead = (0,
|
|
11147
|
+
var TableHead = (0, import_react73.forwardRef)(function TableHead2({ sort, onSort, align = "left", sticky = false, className, children, ...rest }, ref) {
|
|
10880
11148
|
const sortable = sort !== void 0 && onSort !== void 0;
|
|
10881
|
-
return /* @__PURE__ */ (0,
|
|
11149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10882
11150
|
"th",
|
|
10883
11151
|
{
|
|
10884
11152
|
ref,
|
|
@@ -10891,27 +11159,27 @@ var TableHead = (0, import_react72.forwardRef)(function TableHead2({ sort, onSor
|
|
|
10891
11159
|
className
|
|
10892
11160
|
),
|
|
10893
11161
|
...rest,
|
|
10894
|
-
children: sortable ? /* @__PURE__ */ (0,
|
|
11162
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
|
|
10895
11163
|
"button",
|
|
10896
11164
|
{
|
|
10897
11165
|
type: "button",
|
|
10898
11166
|
onClick: onSort,
|
|
10899
|
-
className: (0,
|
|
11167
|
+
className: (0, import_clsx92.default)(
|
|
10900
11168
|
"inline-flex items-center gap-1.5 rounded transition-colors hover:text-default",
|
|
10901
11169
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default"
|
|
10902
11170
|
),
|
|
10903
11171
|
children: [
|
|
10904
11172
|
children,
|
|
10905
|
-
sort === false ? /* @__PURE__ */ (0,
|
|
11173
|
+
sort === false ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_lucide_react33.ChevronsUpDownIcon, { "aria-hidden": true, className: "size-3.5 opacity-50" }) : sort === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_lucide_react33.ChevronUpIcon, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_lucide_react33.ChevronDownIcon, { "aria-hidden": true, className: "size-3.5" })
|
|
10906
11174
|
]
|
|
10907
11175
|
}
|
|
10908
11176
|
) : children
|
|
10909
11177
|
}
|
|
10910
11178
|
);
|
|
10911
11179
|
});
|
|
10912
|
-
var TableCell = (0,
|
|
11180
|
+
var TableCell = (0, import_react73.forwardRef)(function TableCell2({ align = "left", density = "default", header = false, className, ...rest }, ref) {
|
|
10913
11181
|
const Tag = header ? "th" : "td";
|
|
10914
|
-
return /* @__PURE__ */ (0,
|
|
11182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10915
11183
|
Tag,
|
|
10916
11184
|
{
|
|
10917
11185
|
ref,
|
|
@@ -10929,13 +11197,13 @@ var TableCell = (0, import_react72.forwardRef)(function TableCell2({ align = "le
|
|
|
10929
11197
|
});
|
|
10930
11198
|
|
|
10931
11199
|
// src/components/lists/data-table.tsx
|
|
10932
|
-
var
|
|
10933
|
-
var
|
|
11200
|
+
var import_react75 = require("react");
|
|
11201
|
+
var import_clsx96 = __toESM(require("clsx"), 1);
|
|
10934
11202
|
var import_react_table = require("@tanstack/react-table");
|
|
10935
11203
|
|
|
10936
11204
|
// src/components/feedback/empty-state.tsx
|
|
10937
|
-
var
|
|
10938
|
-
var
|
|
11205
|
+
var import_clsx93 = __toESM(require("clsx"), 1);
|
|
11206
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
10939
11207
|
var SIZES = {
|
|
10940
11208
|
sm: "py-8",
|
|
10941
11209
|
md: "py-12",
|
|
@@ -10954,11 +11222,11 @@ function EmptyState({
|
|
|
10954
11222
|
action,
|
|
10955
11223
|
className
|
|
10956
11224
|
}) {
|
|
10957
|
-
return /* @__PURE__ */ (0,
|
|
11225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
10958
11226
|
"div",
|
|
10959
11227
|
{
|
|
10960
11228
|
"data-variant": variant,
|
|
10961
|
-
className: (0,
|
|
11229
|
+
className: (0, import_clsx93.default)(
|
|
10962
11230
|
"flex flex-col items-center justify-center gap-2 px-4 text-center text-body-sm",
|
|
10963
11231
|
SIZES[size2],
|
|
10964
11232
|
TONES[variant],
|
|
@@ -10966,8 +11234,8 @@ function EmptyState({
|
|
|
10966
11234
|
),
|
|
10967
11235
|
"aria-live": variant === "empty" ? void 0 : "polite",
|
|
10968
11236
|
children: [
|
|
10969
|
-
icon && /* @__PURE__ */ (0,
|
|
10970
|
-
/* @__PURE__ */ (0,
|
|
11237
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: "text-default-tertiary", children: icon }),
|
|
11238
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { children: message }),
|
|
10971
11239
|
action
|
|
10972
11240
|
]
|
|
10973
11241
|
}
|
|
@@ -10975,21 +11243,21 @@ function EmptyState({
|
|
|
10975
11243
|
}
|
|
10976
11244
|
|
|
10977
11245
|
// src/components/feedback/skeleton.tsx
|
|
10978
|
-
var
|
|
10979
|
-
var
|
|
10980
|
-
var
|
|
11246
|
+
var import_react74 = require("react");
|
|
11247
|
+
var import_clsx94 = __toESM(require("clsx"), 1);
|
|
11248
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
10981
11249
|
var SHAPE2 = {
|
|
10982
11250
|
line: "h-4 rounded",
|
|
10983
11251
|
block: "h-full w-full rounded-lg",
|
|
10984
11252
|
circle: "aspect-square rounded-full"
|
|
10985
11253
|
};
|
|
10986
|
-
var Skeleton = (0,
|
|
11254
|
+
var Skeleton = (0, import_react74.forwardRef)(function Skeleton2({ shape = "line", lines = 1, className, ...rest }, ref) {
|
|
10987
11255
|
if (shape === "line" && lines > 1) {
|
|
10988
|
-
return /* @__PURE__ */ (0,
|
|
11256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { ref, "aria-hidden": true, "data-slot": "skeleton-group", className: "flex flex-col gap-2", ...rest, children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
10989
11257
|
"div",
|
|
10990
11258
|
{
|
|
10991
|
-
className: (0,
|
|
10992
|
-
"animate-pulse bg-default-tertiary",
|
|
11259
|
+
className: (0, import_clsx94.default)(
|
|
11260
|
+
"motion-safe:animate-pulse bg-default-tertiary",
|
|
10993
11261
|
SHAPE2.line,
|
|
10994
11262
|
// A ragged last line reads as a paragraph rather than a solid slab.
|
|
10995
11263
|
index === lines - 1 ? "w-3/5" : "w-full",
|
|
@@ -10999,13 +11267,13 @@ var Skeleton = (0, import_react73.forwardRef)(function Skeleton2({ shape = "line
|
|
|
10999
11267
|
index
|
|
11000
11268
|
)) });
|
|
11001
11269
|
}
|
|
11002
|
-
return /* @__PURE__ */ (0,
|
|
11270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
11003
11271
|
"div",
|
|
11004
11272
|
{
|
|
11005
11273
|
ref,
|
|
11006
11274
|
"aria-hidden": true,
|
|
11007
11275
|
"data-slot": "skeleton",
|
|
11008
|
-
className: (0,
|
|
11276
|
+
className: (0, import_clsx94.default)("motion-safe:animate-pulse bg-default-tertiary", SHAPE2[shape], className),
|
|
11009
11277
|
...rest
|
|
11010
11278
|
}
|
|
11011
11279
|
);
|
|
@@ -11040,8 +11308,8 @@ function cardSlots(columns) {
|
|
|
11040
11308
|
}
|
|
11041
11309
|
|
|
11042
11310
|
// src/components/lists/data-table-parts.tsx
|
|
11043
|
-
var
|
|
11044
|
-
var
|
|
11311
|
+
var import_lucide_react34 = require("lucide-react");
|
|
11312
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
11045
11313
|
var SELECT_COLUMN_ID = "select";
|
|
11046
11314
|
function columnLabel(column) {
|
|
11047
11315
|
const meta = column.columnDef.meta;
|
|
@@ -11057,11 +11325,11 @@ function DataTableColumnHeader({
|
|
|
11057
11325
|
const text = title ?? columnLabel(column);
|
|
11058
11326
|
const hidden = column.columnDef.meta?.hideHeader;
|
|
11059
11327
|
if (!column.getCanSort()) {
|
|
11060
|
-
return /* @__PURE__ */ (0,
|
|
11328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: cn(hidden ? "sr-only" : "inline-block w-max whitespace-nowrap", className), children: text });
|
|
11061
11329
|
}
|
|
11062
11330
|
const sorted = column.getIsSorted();
|
|
11063
|
-
const Icon = sorted === "asc" ?
|
|
11064
|
-
return /* @__PURE__ */ (0,
|
|
11331
|
+
const Icon = sorted === "asc" ? import_lucide_react34.ChevronUpIcon : sorted === "desc" ? import_lucide_react34.ChevronDownIcon : import_lucide_react34.ChevronsUpDownIcon;
|
|
11332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
11065
11333
|
"button",
|
|
11066
11334
|
{
|
|
11067
11335
|
type: "button",
|
|
@@ -11075,8 +11343,8 @@ function DataTableColumnHeader({
|
|
|
11075
11343
|
className
|
|
11076
11344
|
),
|
|
11077
11345
|
children: [
|
|
11078
|
-
/* @__PURE__ */ (0,
|
|
11079
|
-
/* @__PURE__ */ (0,
|
|
11346
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: cn(hidden && "sr-only"), children: text }),
|
|
11347
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11080
11348
|
Icon,
|
|
11081
11349
|
{
|
|
11082
11350
|
"aria-hidden": true,
|
|
@@ -11092,7 +11360,7 @@ function createSelectColumn(options = {}) {
|
|
|
11092
11360
|
const { getRowLabel, selectAllLabel = "Select all rows on this page" } = options;
|
|
11093
11361
|
return {
|
|
11094
11362
|
id: SELECT_COLUMN_ID,
|
|
11095
|
-
header: ({ table }) => /* @__PURE__ */ (0,
|
|
11363
|
+
header: ({ table }) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11096
11364
|
Checkbox,
|
|
11097
11365
|
{
|
|
11098
11366
|
"aria-label": selectAllLabel,
|
|
@@ -11101,7 +11369,7 @@ function createSelectColumn(options = {}) {
|
|
|
11101
11369
|
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(checked)
|
|
11102
11370
|
}
|
|
11103
11371
|
),
|
|
11104
|
-
cell: ({ row }) => /* @__PURE__ */ (0,
|
|
11372
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11105
11373
|
Checkbox,
|
|
11106
11374
|
{
|
|
11107
11375
|
"aria-label": getRowLabel ? getRowLabel(row.original) : "Select row",
|
|
@@ -11119,11 +11387,11 @@ function createSelectColumn(options = {}) {
|
|
|
11119
11387
|
function DataTableViewOptions({ table, label = "Columns" }) {
|
|
11120
11388
|
const columns = table.getAllLeafColumns().filter((column) => column.getCanHide());
|
|
11121
11389
|
if (columns.length === 0) return null;
|
|
11122
|
-
return /* @__PURE__ */ (0,
|
|
11123
|
-
/* @__PURE__ */ (0,
|
|
11124
|
-
/* @__PURE__ */ (0,
|
|
11125
|
-
/* @__PURE__ */ (0,
|
|
11126
|
-
columns.map((column) => /* @__PURE__ */ (0,
|
|
11390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(DropdownMenu, { children: [
|
|
11391
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Button, { variant: "neutral", size: "md", leadingIcon: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_lucide_react34.Columns3Icon, { "aria-hidden": true }), children: label }) }),
|
|
11392
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
11393
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(DropdownMenuLabel, { children: "Show columns" }),
|
|
11394
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11127
11395
|
DropdownMenuCheckboxItem,
|
|
11128
11396
|
{
|
|
11129
11397
|
checked: column.getIsVisible(),
|
|
@@ -11141,7 +11409,7 @@ function DataTablePagination({
|
|
|
11141
11409
|
summary
|
|
11142
11410
|
}) {
|
|
11143
11411
|
const { pageIndex, pageSize } = table.getState().pagination;
|
|
11144
|
-
return /* @__PURE__ */ (0,
|
|
11412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11145
11413
|
PaginationBar,
|
|
11146
11414
|
{
|
|
11147
11415
|
page: pageIndex + 1,
|
|
@@ -11157,8 +11425,8 @@ function DataTablePagination({
|
|
|
11157
11425
|
}
|
|
11158
11426
|
|
|
11159
11427
|
// src/components/lists/data-table-cells.tsx
|
|
11160
|
-
var
|
|
11161
|
-
var
|
|
11428
|
+
var import_clsx95 = __toESM(require("clsx"), 1);
|
|
11429
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
11162
11430
|
function textFromNode(node) {
|
|
11163
11431
|
if (typeof node === "string") return node;
|
|
11164
11432
|
if (typeof node === "number") return String(node);
|
|
@@ -11169,23 +11437,23 @@ function textFromNode(node) {
|
|
|
11169
11437
|
return void 0;
|
|
11170
11438
|
}
|
|
11171
11439
|
function TableCellLeadText({ primary, secondary, size: size2 = "md", className }) {
|
|
11172
|
-
return /* @__PURE__ */ (0,
|
|
11173
|
-
/* @__PURE__ */ (0,
|
|
11440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_clsx95.default)("flex min-w-0 flex-col gap-0.5", className), children: [
|
|
11441
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11174
11442
|
"span",
|
|
11175
11443
|
{
|
|
11176
11444
|
title: primary,
|
|
11177
|
-
className: (0,
|
|
11445
|
+
className: (0, import_clsx95.default)(
|
|
11178
11446
|
"block truncate font-medium leading-snug text-default",
|
|
11179
11447
|
size2 === "sm" ? "text-body-xs" : "text-body-sm"
|
|
11180
11448
|
),
|
|
11181
11449
|
children: primary
|
|
11182
11450
|
}
|
|
11183
11451
|
),
|
|
11184
|
-
secondary && (typeof secondary === "string" || typeof secondary === "number" ? /* @__PURE__ */ (0,
|
|
11452
|
+
secondary && (typeof secondary === "string" || typeof secondary === "number" ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11185
11453
|
"span",
|
|
11186
11454
|
{
|
|
11187
11455
|
title: String(secondary),
|
|
11188
|
-
className: (0,
|
|
11456
|
+
className: (0, import_clsx95.default)(
|
|
11189
11457
|
"block truncate font-normal leading-tight text-default-secondary",
|
|
11190
11458
|
size2 === "sm" ? "text-body-tiny" : "text-body-xs"
|
|
11191
11459
|
),
|
|
@@ -11194,10 +11462,10 @@ function TableCellLeadText({ primary, secondary, size: size2 = "md", className }
|
|
|
11194
11462
|
) : (
|
|
11195
11463
|
// An element brings its own overflow handling, so it gets no `truncate` here,
|
|
11196
11464
|
// which a card layout's touch un-truncation would otherwise turn into wrapping.
|
|
11197
|
-
/* @__PURE__ */ (0,
|
|
11465
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11198
11466
|
"span",
|
|
11199
11467
|
{
|
|
11200
|
-
className: (0,
|
|
11468
|
+
className: (0, import_clsx95.default)(
|
|
11201
11469
|
"block min-w-0 font-normal leading-tight text-default-secondary",
|
|
11202
11470
|
size2 === "sm" ? "text-body-tiny" : "text-body-xs"
|
|
11203
11471
|
),
|
|
@@ -11214,11 +11482,11 @@ function TableCellText({
|
|
|
11214
11482
|
truncate = true,
|
|
11215
11483
|
className
|
|
11216
11484
|
}) {
|
|
11217
|
-
return /* @__PURE__ */ (0,
|
|
11485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11218
11486
|
"span",
|
|
11219
11487
|
{
|
|
11220
11488
|
title: truncate ? textFromNode(children) : void 0,
|
|
11221
|
-
className: (0,
|
|
11489
|
+
className: (0, import_clsx95.default)(
|
|
11222
11490
|
"font-normal leading-snug",
|
|
11223
11491
|
size2 === "sm" ? "text-body-tiny" : "text-body-xs",
|
|
11224
11492
|
truncate ? "block min-w-0 truncate" : "whitespace-nowrap",
|
|
@@ -11230,15 +11498,15 @@ function TableCellText({
|
|
|
11230
11498
|
);
|
|
11231
11499
|
}
|
|
11232
11500
|
function TableCellBadge({ label, className }) {
|
|
11233
|
-
return /* @__PURE__ */ (0,
|
|
11501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11234
11502
|
"span",
|
|
11235
11503
|
{
|
|
11236
11504
|
title: label,
|
|
11237
|
-
className: (0,
|
|
11505
|
+
className: (0, import_clsx95.default)(
|
|
11238
11506
|
"inline-flex max-w-full items-center rounded-md border border-default bg-default-secondary px-2 py-0.5 text-body-tiny font-medium text-default-secondary",
|
|
11239
11507
|
className
|
|
11240
11508
|
),
|
|
11241
|
-
children: /* @__PURE__ */ (0,
|
|
11509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "truncate", children: label })
|
|
11242
11510
|
}
|
|
11243
11511
|
);
|
|
11244
11512
|
}
|
|
@@ -11250,8 +11518,8 @@ function TableCellProgress({
|
|
|
11250
11518
|
className
|
|
11251
11519
|
}) {
|
|
11252
11520
|
const clamped = Math.round(Math.min(100, Math.max(0, percent)));
|
|
11253
|
-
return /* @__PURE__ */ (0,
|
|
11254
|
-
/* @__PURE__ */ (0,
|
|
11521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_clsx95.default)("flex w-full min-w-0 items-center gap-2", className), children: [
|
|
11522
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11255
11523
|
ProgressBar,
|
|
11256
11524
|
{
|
|
11257
11525
|
value: clamped,
|
|
@@ -11261,7 +11529,7 @@ function TableCellProgress({
|
|
|
11261
11529
|
"aria-label": label ?? `${clamped}%`
|
|
11262
11530
|
}
|
|
11263
11531
|
),
|
|
11264
|
-
/* @__PURE__ */ (0,
|
|
11532
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "shrink-0 text-body-tiny leading-none tabular-nums text-default-secondary", children: [
|
|
11265
11533
|
clamped,
|
|
11266
11534
|
"%"
|
|
11267
11535
|
] })
|
|
@@ -11269,7 +11537,7 @@ function TableCellProgress({
|
|
|
11269
11537
|
}
|
|
11270
11538
|
|
|
11271
11539
|
// src/components/lists/data-table.tsx
|
|
11272
|
-
var
|
|
11540
|
+
var import_jsx_runtime119 = (
|
|
11273
11541
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
11274
11542
|
require("react/jsx-runtime")
|
|
11275
11543
|
);
|
|
@@ -11299,14 +11567,14 @@ function resolve(updater, previous) {
|
|
|
11299
11567
|
return typeof updater === "function" ? updater(previous) : updater;
|
|
11300
11568
|
}
|
|
11301
11569
|
function useTableState(controlled, initial, onChange) {
|
|
11302
|
-
const [inner, setInner] = (0,
|
|
11570
|
+
const [inner, setInner] = (0, import_react75.useState)(initial);
|
|
11303
11571
|
const value = controlled ?? inner;
|
|
11304
|
-
const latest = (0,
|
|
11572
|
+
const latest = (0, import_react75.useRef)(value);
|
|
11305
11573
|
latest.current = value;
|
|
11306
11574
|
const isControlled = controlled !== void 0;
|
|
11307
|
-
const onChangeRef = (0,
|
|
11575
|
+
const onChangeRef = (0, import_react75.useRef)(onChange);
|
|
11308
11576
|
onChangeRef.current = onChange;
|
|
11309
|
-
const set = (0,
|
|
11577
|
+
const set = (0, import_react75.useCallback)(
|
|
11310
11578
|
(updater) => {
|
|
11311
11579
|
const next = resolve(updater, latest.current);
|
|
11312
11580
|
if (!isControlled) setInner(next);
|
|
@@ -11317,7 +11585,7 @@ function useTableState(controlled, initial, onChange) {
|
|
|
11317
11585
|
return [value, set];
|
|
11318
11586
|
}
|
|
11319
11587
|
function CellInteractionGuard({ children }) {
|
|
11320
|
-
return /* @__PURE__ */ (0,
|
|
11588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11321
11589
|
"div",
|
|
11322
11590
|
{
|
|
11323
11591
|
className: "contents",
|
|
@@ -11330,9 +11598,9 @@ function CellInteractionGuard({ children }) {
|
|
|
11330
11598
|
}
|
|
11331
11599
|
var HEADER_PADDING_PX = { default: 32, compact: 24 };
|
|
11332
11600
|
function useHeaderWidths(padding2, deps) {
|
|
11333
|
-
const nodes = (0,
|
|
11334
|
-
const [widths, setWidths] = (0,
|
|
11335
|
-
const measure = (0,
|
|
11601
|
+
const nodes = (0, import_react75.useRef)(/* @__PURE__ */ new Map());
|
|
11602
|
+
const [widths, setWidths] = (0, import_react75.useState)({});
|
|
11603
|
+
const measure = (0, import_react75.useCallback)(() => {
|
|
11336
11604
|
const next = {};
|
|
11337
11605
|
nodes.current.forEach((node, id) => {
|
|
11338
11606
|
next[id] = Math.ceil(node.getBoundingClientRect().width) + padding2;
|
|
@@ -11343,15 +11611,15 @@ function useHeaderWidths(padding2, deps) {
|
|
|
11343
11611
|
return same ? previous : next;
|
|
11344
11612
|
});
|
|
11345
11613
|
}, [padding2]);
|
|
11346
|
-
(0,
|
|
11347
|
-
(0,
|
|
11614
|
+
(0, import_react75.useLayoutEffect)(measure, [measure, deps]);
|
|
11615
|
+
(0, import_react75.useLayoutEffect)(() => {
|
|
11348
11616
|
let live = true;
|
|
11349
11617
|
void document.fonts?.ready.then(() => live && measure());
|
|
11350
11618
|
return () => {
|
|
11351
11619
|
live = false;
|
|
11352
11620
|
};
|
|
11353
11621
|
}, [measure]);
|
|
11354
|
-
const register = (0,
|
|
11622
|
+
const register = (0, import_react75.useCallback)(
|
|
11355
11623
|
(id) => (node) => {
|
|
11356
11624
|
if (node) nodes.current.set(id, node);
|
|
11357
11625
|
else nodes.current.delete(id);
|
|
@@ -11361,9 +11629,9 @@ function useHeaderWidths(padding2, deps) {
|
|
|
11361
11629
|
return { widths, register };
|
|
11362
11630
|
}
|
|
11363
11631
|
function useScrollEdges() {
|
|
11364
|
-
const [node, setNode] = (0,
|
|
11365
|
-
const [edges, setEdges] = (0,
|
|
11366
|
-
const measure = (0,
|
|
11632
|
+
const [node, setNode] = (0, import_react75.useState)(null);
|
|
11633
|
+
const [edges, setEdges] = (0, import_react75.useState)({ overflowing: false, atStart: true, atEnd: true, overflowingY: false, atTop: true });
|
|
11634
|
+
const measure = (0, import_react75.useCallback)(() => {
|
|
11367
11635
|
if (!node) return;
|
|
11368
11636
|
const { scrollLeft, scrollWidth, clientWidth, scrollTop, scrollHeight, clientHeight } = node;
|
|
11369
11637
|
const next = {
|
|
@@ -11377,7 +11645,7 @@ function useScrollEdges() {
|
|
|
11377
11645
|
(previous) => previous.overflowing === next.overflowing && previous.atStart === next.atStart && previous.atEnd === next.atEnd && previous.overflowingY === next.overflowingY && previous.atTop === next.atTop ? previous : next
|
|
11378
11646
|
);
|
|
11379
11647
|
}, [node]);
|
|
11380
|
-
(0,
|
|
11648
|
+
(0, import_react75.useLayoutEffect)(() => {
|
|
11381
11649
|
if (!node) return;
|
|
11382
11650
|
measure();
|
|
11383
11651
|
if (typeof ResizeObserver === "undefined") return;
|
|
@@ -11388,8 +11656,9 @@ function useScrollEdges() {
|
|
|
11388
11656
|
}, [node, measure]);
|
|
11389
11657
|
return { ref: setNode, onScroll: measure, ...edges };
|
|
11390
11658
|
}
|
|
11659
|
+
var serverSortedValue = () => void 0;
|
|
11391
11660
|
function defaultRowLink({ children, ...props }) {
|
|
11392
|
-
return /* @__PURE__ */ (0,
|
|
11661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("a", { ...props, children });
|
|
11393
11662
|
}
|
|
11394
11663
|
function DataTable({
|
|
11395
11664
|
columns,
|
|
@@ -11430,6 +11699,7 @@ function DataTable({
|
|
|
11430
11699
|
onColumnVisibilityChange,
|
|
11431
11700
|
onRowSelectionChange,
|
|
11432
11701
|
tableOptions,
|
|
11702
|
+
bordered = true,
|
|
11433
11703
|
className
|
|
11434
11704
|
}) {
|
|
11435
11705
|
if (!label && !caption) {
|
|
@@ -11452,11 +11722,16 @@ function DataTable({
|
|
|
11452
11722
|
onColumnVisibilityChange
|
|
11453
11723
|
);
|
|
11454
11724
|
const [rowSelection, setRowSelection] = useTableState(state.rowSelection, {}, onRowSelectionChange);
|
|
11455
|
-
const allColumns = (0,
|
|
11456
|
-
|
|
11725
|
+
const allColumns = (0, import_react75.useMemo)(() => {
|
|
11726
|
+
let cols = columns;
|
|
11727
|
+
if (manual.sorting) {
|
|
11728
|
+
cols = cols.map(
|
|
11729
|
+
(column) => column.enableSorting === true && !("accessorFn" in column) && !("accessorKey" in column) ? { ...column, accessorFn: serverSortedValue } : column
|
|
11730
|
+
);
|
|
11731
|
+
}
|
|
11457
11732
|
if (!enableRowSelection || cols.some((column) => column.id === SELECT_COLUMN_ID)) return cols;
|
|
11458
11733
|
return [createSelectColumn({ getRowLabel: getRowLabel && ((row) => `Select ${getRowLabel(row)}`) }), ...cols];
|
|
11459
|
-
}, [columns, enableRowSelection, getRowLabel]);
|
|
11734
|
+
}, [columns, enableRowSelection, getRowLabel, manual.sorting]);
|
|
11460
11735
|
const table = (0, import_react_table.useReactTable)({
|
|
11461
11736
|
data,
|
|
11462
11737
|
columns: allColumns,
|
|
@@ -11477,10 +11752,14 @@ function DataTable({
|
|
|
11477
11752
|
manualFiltering: manual.filtering,
|
|
11478
11753
|
manualPagination: !paginated || manual.pagination,
|
|
11479
11754
|
rowCount: manual.rowCount,
|
|
11755
|
+
// Two states from 0.9.4: a third click no longer clears the sort. "Off" is not a direction a
|
|
11756
|
+
// person can see or ask for, and it silently reverted to an order nobody chose. Pass
|
|
11757
|
+
// `tableOptions={{ enableSortingRemoval: true }}` for the three-state cycle.
|
|
11758
|
+
enableSortingRemoval: false,
|
|
11480
11759
|
...tableOptions
|
|
11481
11760
|
});
|
|
11482
|
-
const selectionReported = (0,
|
|
11483
|
-
(0,
|
|
11761
|
+
const selectionReported = (0, import_react75.useRef)(false);
|
|
11762
|
+
(0, import_react75.useEffect)(() => {
|
|
11484
11763
|
if (!onSelectionChange) return;
|
|
11485
11764
|
if (!selectionReported.current) {
|
|
11486
11765
|
selectionReported.current = true;
|
|
@@ -11489,8 +11768,9 @@ function DataTable({
|
|
|
11489
11768
|
onSelectionChange(table.getSelectedRowModel().rows.map((row) => row.original));
|
|
11490
11769
|
}, [rowSelection]);
|
|
11491
11770
|
const [wrapRef, containerWidth] = useElementWidth();
|
|
11771
|
+
const captionId = (0, import_react75.useId)();
|
|
11492
11772
|
const breakpoint = responsive === false ? 0 : typeof responsive === "object" ? responsive.breakpoint ?? DEFAULT_CARD_BREAKPOINT_PX : DEFAULT_CARD_BREAKPOINT_PX;
|
|
11493
|
-
const modeRef = (0,
|
|
11773
|
+
const modeRef = (0, import_react75.useRef)("table");
|
|
11494
11774
|
const mode = nextLayoutMode(modeRef.current, containerWidth, breakpoint);
|
|
11495
11775
|
modeRef.current = mode;
|
|
11496
11776
|
const search = searchable === true ? {} : searchable || void 0;
|
|
@@ -11503,16 +11783,16 @@ function DataTable({
|
|
|
11503
11783
|
const filtering = Boolean(globalFilter) || columnFilters.length > 0;
|
|
11504
11784
|
const rows = table.getRowModel().rows;
|
|
11505
11785
|
const isEmpty = !loading && !error && rows.length === 0;
|
|
11506
|
-
const placeholder = error ? /* @__PURE__ */ (0,
|
|
11786
|
+
const placeholder = error ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11507
11787
|
EmptyState,
|
|
11508
11788
|
{
|
|
11509
11789
|
message: typeof error === "string" ? error : "Something went wrong loading this data.",
|
|
11510
11790
|
variant: "error",
|
|
11511
11791
|
size: "md",
|
|
11512
|
-
action: onRetry ? /* @__PURE__ */ (0,
|
|
11792
|
+
action: onRetry ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "neutral", size: "sm", onClick: onRetry, children: "Retry" }) : void 0,
|
|
11513
11793
|
className: "mx-auto max-w-[520px]"
|
|
11514
11794
|
}
|
|
11515
|
-
) : isEmpty ? typeof empty === "string" ? /* @__PURE__ */ (0,
|
|
11795
|
+
) : isEmpty ? typeof empty === "string" ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(EmptyState, { message: empty, size: "md", className: "mx-auto max-w-[520px]" }) : empty : null;
|
|
11516
11796
|
const resultCount = manual.filtering ? table.getRowCount() : table.getFilteredRowModel().rows.length;
|
|
11517
11797
|
const showToolbar = Boolean(search || toolbar || showColumnMenu);
|
|
11518
11798
|
const showPager = paginated && !error && table.getRowCount() > 0;
|
|
@@ -11520,6 +11800,7 @@ function DataTable({
|
|
|
11520
11800
|
table,
|
|
11521
11801
|
label,
|
|
11522
11802
|
caption,
|
|
11803
|
+
captionId,
|
|
11523
11804
|
density,
|
|
11524
11805
|
align,
|
|
11525
11806
|
loading,
|
|
@@ -11533,9 +11814,9 @@ function DataTable({
|
|
|
11533
11814
|
getRowLabel,
|
|
11534
11815
|
maxHeight
|
|
11535
11816
|
};
|
|
11536
|
-
return /* @__PURE__ */ (0,
|
|
11537
|
-
showToolbar && /* @__PURE__ */ (0,
|
|
11538
|
-
search && /* @__PURE__ */ (0,
|
|
11817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { "data-slot": "data-table", className: cn("relative flex flex-col gap-3", className), children: [
|
|
11818
|
+
showToolbar && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: cn("flex flex-wrap items-center gap-2", !bordered && "px-4 pt-3"), children: [
|
|
11819
|
+
search && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11539
11820
|
SearchInput,
|
|
11540
11821
|
{
|
|
11541
11822
|
size: "md",
|
|
@@ -11548,13 +11829,14 @@ function DataTable({
|
|
|
11548
11829
|
}
|
|
11549
11830
|
),
|
|
11550
11831
|
toolbar,
|
|
11551
|
-
showColumnMenu && /* @__PURE__ */ (0,
|
|
11832
|
+
showColumnMenu && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "ml-auto", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(DataTableViewOptions, { table }) })
|
|
11552
11833
|
] }),
|
|
11553
|
-
/* @__PURE__ */ (0,
|
|
11554
|
-
/* @__PURE__ */ (0,
|
|
11555
|
-
mode === "cards"
|
|
11556
|
-
|
|
11557
|
-
|
|
11834
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { role: "status", "aria-live": "polite", className: "sr-only", children: filtering && !loading ? `${resultCount} ${resultCount === 1 ? "result" : "results"}` : "" }),
|
|
11835
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { ref: wrapRef, className: cn("overflow-hidden bg-default", bordered && "rounded-xl border border-default"), children: [
|
|
11836
|
+
mode === "cards" && caption && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { id: captionId, className: "px-4 pt-3 text-left text-body-sm text-default-secondary", children: caption }),
|
|
11837
|
+
mode === "cards" ? maxHeight ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CardScroll, { label, maxHeight, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CardList, { ...view }) }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CardList, { ...view }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(TableView, { ...view }),
|
|
11838
|
+
showPager && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "border-t border-default px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(DataTablePagination, { table, pageSizeOptions }) }),
|
|
11839
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "border-t border-default px-4 py-3", children: footer })
|
|
11558
11840
|
] })
|
|
11559
11841
|
] });
|
|
11560
11842
|
}
|
|
@@ -11592,7 +11874,7 @@ function TableView({
|
|
|
11592
11874
|
const hasSticky = Boolean(stickyStart || stickyEnd);
|
|
11593
11875
|
const titleId = titleColumnId(columns);
|
|
11594
11876
|
const rowAction = getRowHref ? "link" : onRowClick ? "click" : null;
|
|
11595
|
-
const stickyClass = (id, header) => (0,
|
|
11877
|
+
const stickyClass = (id, header) => (0, import_clsx96.default)(
|
|
11596
11878
|
id === stickyStart && [
|
|
11597
11879
|
"sticky left-0 z-raised",
|
|
11598
11880
|
// A hairline where content slides under the pinned column, once it has scrolled.
|
|
@@ -11607,9 +11889,9 @@ function TableView({
|
|
|
11607
11889
|
const scrolls = scroll.overflowing || Boolean(maxHeight) && scroll.overflowingY;
|
|
11608
11890
|
const direction = scroll.overflowing && maxHeight && scroll.overflowingY ? "scrolls" : scroll.overflowing ? "scrolls horizontally" : "scrolls vertically";
|
|
11609
11891
|
const regionLabel = `${label ?? "Table"} (${direction})`;
|
|
11610
|
-
const pinnedHeader = maxHeight ? (0,
|
|
11611
|
-
return /* @__PURE__ */ (0,
|
|
11612
|
-
/* @__PURE__ */ (0,
|
|
11892
|
+
const pinnedHeader = maxHeight ? (0, import_clsx96.default)("sticky top-0 z-sticky bg-default-secondary", !scroll.atTop && "shadow-[inset_0_-1px_0_var(--color-border-default-default)]") : void 0;
|
|
11893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "relative", children: [
|
|
11894
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11613
11895
|
"div",
|
|
11614
11896
|
{
|
|
11615
11897
|
ref: scroll.ref,
|
|
@@ -11621,18 +11903,18 @@ function TableView({
|
|
|
11621
11903
|
),
|
|
11622
11904
|
style: maxHeight ? { maxHeight } : void 0,
|
|
11623
11905
|
...scrolls ? { role: "region", tabIndex: 0, "aria-label": regionLabel } : {},
|
|
11624
|
-
children: /* @__PURE__ */ (0,
|
|
11906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
11625
11907
|
"table",
|
|
11626
11908
|
{
|
|
11627
11909
|
className: "w-full table-fixed border-collapse text-left",
|
|
11628
11910
|
style: showPlaceholder ? void 0 : { minWidth },
|
|
11629
11911
|
"aria-busy": loading || void 0,
|
|
11630
11912
|
children: [
|
|
11631
|
-
caption ? /* @__PURE__ */ (0,
|
|
11632
|
-
/* @__PURE__ */ (0,
|
|
11913
|
+
caption ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("caption", { className: "px-4 pt-3 text-left text-body-sm text-default-secondary", children: caption }) : label && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("caption", { className: "sr-only", children: label }),
|
|
11914
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("colgroup", { children: columns.map((column) => {
|
|
11633
11915
|
const meta = column.columnDef.meta;
|
|
11634
11916
|
const floor = headers.widths[column.id] ?? 0;
|
|
11635
|
-
return /* @__PURE__ */ (0,
|
|
11917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11636
11918
|
"col",
|
|
11637
11919
|
{
|
|
11638
11920
|
style: meta?.grow || !meta?.width ? void 0 : { width: floor > widthToPx(meta.width) ? floor : meta.width }
|
|
@@ -11640,12 +11922,12 @@ function TableView({
|
|
|
11640
11922
|
column.id
|
|
11641
11923
|
);
|
|
11642
11924
|
}) }),
|
|
11643
|
-
/* @__PURE__ */ (0,
|
|
11925
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("thead", { children: table.getHeaderGroups().map((group) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("tr", { className: "bg-default-secondary", children: group.headers.map((header) => {
|
|
11644
11926
|
const meta = header.column.columnDef.meta;
|
|
11645
11927
|
const sortable = header.column.getCanSort();
|
|
11646
11928
|
const sorted = header.column.getIsSorted();
|
|
11647
11929
|
const definition = header.column.columnDef.header;
|
|
11648
|
-
return /* @__PURE__ */ (0,
|
|
11930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11649
11931
|
"th",
|
|
11650
11932
|
{
|
|
11651
11933
|
scope: "col",
|
|
@@ -11660,12 +11942,12 @@ function TableView({
|
|
|
11660
11942
|
pinnedHeader,
|
|
11661
11943
|
meta?.headerClassName
|
|
11662
11944
|
),
|
|
11663
|
-
children: header.isPlaceholder ? null : typeof definition === "string" || definition === void 0 ? /* @__PURE__ */ (0,
|
|
11945
|
+
children: header.isPlaceholder ? null : typeof definition === "string" || definition === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { ref: meta?.hideHeader ? void 0 : headers.register(header.column.id), className: "inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(DataTableColumnHeader, { column: header.column }) }) : (0, import_react_table.flexRender)(definition, header.getContext())
|
|
11664
11946
|
},
|
|
11665
11947
|
header.id
|
|
11666
11948
|
);
|
|
11667
11949
|
}) }, group.id)) }),
|
|
11668
|
-
/* @__PURE__ */ (0,
|
|
11950
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("tbody", { children: loading && !placeholder ? Array.from({ length: loadingRows }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("tr", { className: (0, import_clsx96.default)(index > 0 && "border-t border-default"), children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("td", { className: (0, import_clsx96.default)(d.bodyCell, "align-middle"), children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Skeleton, { className: column.columnDef.meta?.grow ? "w-[70%]" : "w-[55%]" }) }, column.id)) }, `skeleton-${index}`)) : placeholder ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("td", { colSpan: columns.length, className: "px-4", children: placeholder }) }) : table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11669
11951
|
BodyRow,
|
|
11670
11952
|
{
|
|
11671
11953
|
row,
|
|
@@ -11688,8 +11970,8 @@ function TableView({
|
|
|
11688
11970
|
)
|
|
11689
11971
|
}
|
|
11690
11972
|
),
|
|
11691
|
-
scroll.overflowing && !scroll.atStart && !stickyStart && /* @__PURE__ */ (0,
|
|
11692
|
-
scroll.overflowing && !scroll.atEnd && !stickyEnd && /* @__PURE__ */ (0,
|
|
11973
|
+
scroll.overflowing && !scroll.atStart && !stickyStart && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-y-0 left-0 w-6 bg-gradient-to-r from-default-secondary to-transparent" }),
|
|
11974
|
+
scroll.overflowing && !scroll.atEnd && !stickyEnd && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-y-0 right-0 w-6 bg-gradient-to-l from-default-secondary to-transparent" })
|
|
11693
11975
|
] });
|
|
11694
11976
|
}
|
|
11695
11977
|
function BodyRow({
|
|
@@ -11708,7 +11990,7 @@ function BodyRow({
|
|
|
11708
11990
|
}) {
|
|
11709
11991
|
const d = DENSITY2[density];
|
|
11710
11992
|
const href = getRowHref?.(row.original);
|
|
11711
|
-
return /* @__PURE__ */ (0,
|
|
11993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11712
11994
|
TableRow,
|
|
11713
11995
|
{
|
|
11714
11996
|
selected: row.getIsSelected() || void 0,
|
|
@@ -11733,7 +12015,7 @@ function BodyRow({
|
|
|
11733
12015
|
onRowClick(row.original);
|
|
11734
12016
|
}
|
|
11735
12017
|
} : void 0,
|
|
11736
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
12018
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11737
12019
|
BodyCell,
|
|
11738
12020
|
{
|
|
11739
12021
|
cell,
|
|
@@ -11762,7 +12044,7 @@ function BodyCell({
|
|
|
11762
12044
|
children: content
|
|
11763
12045
|
}, cell.row.original);
|
|
11764
12046
|
}
|
|
11765
|
-
return /* @__PURE__ */ (0,
|
|
12047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11766
12048
|
"td",
|
|
11767
12049
|
{
|
|
11768
12050
|
className: cn(
|
|
@@ -11773,13 +12055,13 @@ function BodyCell({
|
|
|
11773
12055
|
!meta?.interactive && "overflow-hidden",
|
|
11774
12056
|
meta?.cellClassName
|
|
11775
12057
|
),
|
|
11776
|
-
children: meta?.interactive ? /* @__PURE__ */ (0,
|
|
12058
|
+
children: meta?.interactive ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CellInteractionGuard, { children: content }) : content
|
|
11777
12059
|
}
|
|
11778
12060
|
);
|
|
11779
12061
|
}
|
|
11780
12062
|
function CardScroll({ label, maxHeight, children }) {
|
|
11781
12063
|
const scroll = useScrollEdges();
|
|
11782
|
-
return /* @__PURE__ */ (0,
|
|
12064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11783
12065
|
"div",
|
|
11784
12066
|
{
|
|
11785
12067
|
ref: scroll.ref,
|
|
@@ -11794,6 +12076,8 @@ function CardScroll({ label, maxHeight, children }) {
|
|
|
11794
12076
|
function CardList({
|
|
11795
12077
|
table,
|
|
11796
12078
|
label,
|
|
12079
|
+
caption,
|
|
12080
|
+
captionId,
|
|
11797
12081
|
loading,
|
|
11798
12082
|
loadingRows,
|
|
11799
12083
|
placeholder,
|
|
@@ -11804,12 +12088,12 @@ function CardList({
|
|
|
11804
12088
|
getRowDimmed,
|
|
11805
12089
|
getRowLabel
|
|
11806
12090
|
}) {
|
|
11807
|
-
if (placeholder) return /* @__PURE__ */ (0,
|
|
12091
|
+
if (placeholder) return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "px-4", children: placeholder });
|
|
11808
12092
|
if (loading) {
|
|
11809
|
-
return /* @__PURE__ */ (0,
|
|
11810
|
-
/* @__PURE__ */ (0,
|
|
11811
|
-
/* @__PURE__ */ (0,
|
|
11812
|
-
/* @__PURE__ */ (0,
|
|
12093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("ul", { "aria-label": label, "aria-labelledby": !label && caption ? captionId : void 0, "aria-busy": "true", className: "divide-y divide-default", children: Array.from({ length: loadingRows }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("li", { className: "flex flex-col gap-3 p-4", children: [
|
|
12094
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Skeleton, { className: "w-2/3" }),
|
|
12095
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Skeleton, { className: "w-1/2" }),
|
|
12096
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Skeleton, { className: "w-5/6" })
|
|
11813
12097
|
] }, index)) });
|
|
11814
12098
|
}
|
|
11815
12099
|
const columns = table.getVisibleLeafColumns();
|
|
@@ -11817,7 +12101,7 @@ function CardList({
|
|
|
11817
12101
|
const slots = cardSlots(
|
|
11818
12102
|
columns.filter((column) => column.id !== SELECT_COLUMN_ID).map((column) => ({ id: column.id, mobile: column.columnDef.meta?.mobile, column }))
|
|
11819
12103
|
);
|
|
11820
|
-
const trigger = (0,
|
|
12104
|
+
const trigger = (0, import_clsx96.default)(
|
|
11821
12105
|
"block w-full min-w-0 text-left focus-visible:outline-none",
|
|
11822
12106
|
"after:absolute after:inset-0 after:content-['']",
|
|
11823
12107
|
"focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-brand"
|
|
@@ -11825,10 +12109,11 @@ function CardList({
|
|
|
11825
12109
|
return (
|
|
11826
12110
|
// Card mode un-truncates: on touch there is no hover tooltip, so a clipped value would be
|
|
11827
12111
|
// unreadable. `.truncate` cell renderers wrap here instead.
|
|
11828
|
-
/* @__PURE__ */ (0,
|
|
12112
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11829
12113
|
"ul",
|
|
11830
12114
|
{
|
|
11831
12115
|
"aria-label": label,
|
|
12116
|
+
"aria-labelledby": !label && caption ? captionId : void 0,
|
|
11832
12117
|
className: "divide-y divide-default [&_.truncate]:whitespace-normal [&_.truncate]:[overflow-wrap:anywhere]",
|
|
11833
12118
|
children: table.getRowModel().rows.map((row) => {
|
|
11834
12119
|
const cells = new Map(row.getVisibleCells().map((cell) => [cell.column.id, cell]));
|
|
@@ -11839,7 +12124,7 @@ function CardList({
|
|
|
11839
12124
|
const href = getRowHref?.(row.original);
|
|
11840
12125
|
const titleContent = render(slots.title?.id);
|
|
11841
12126
|
const tone = getRowTone?.(row.original);
|
|
11842
|
-
return /* @__PURE__ */ (0,
|
|
12127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
11843
12128
|
"li",
|
|
11844
12129
|
{
|
|
11845
12130
|
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
@@ -11854,9 +12139,9 @@ function CardList({
|
|
|
11854
12139
|
"data-[state=selected]:bg-brand-tertiary"
|
|
11855
12140
|
),
|
|
11856
12141
|
children: [
|
|
11857
|
-
/* @__PURE__ */ (0,
|
|
11858
|
-
selectable && /* @__PURE__ */ (0,
|
|
11859
|
-
/* @__PURE__ */ (0,
|
|
12142
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
12143
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "relative z-raised shrink-0 pt-0.5", children: render(SELECT_COLUMN_ID) }),
|
|
12144
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "min-w-0 flex-1", children: href ? renderRowLink({ href, [ROW_LINK_ATTR]: "", className: trigger, children: titleContent }, row.original) : onRowClick ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11860
12145
|
"button",
|
|
11861
12146
|
{
|
|
11862
12147
|
type: "button",
|
|
@@ -11868,12 +12153,12 @@ function CardList({
|
|
|
11868
12153
|
) : titleContent }),
|
|
11869
12154
|
slots.status && // A status pill is `nowrap`, so a long label would spill off the card. Let it
|
|
11870
12155
|
// wrap inside the cap instead.
|
|
11871
|
-
/* @__PURE__ */ (0,
|
|
11872
|
-
slots.actions && /* @__PURE__ */ (0,
|
|
12156
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "flex max-w-[45%] shrink-0 justify-end [&_.whitespace-nowrap]:whitespace-normal", children: render(slots.status.id) }),
|
|
12157
|
+
slots.actions && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "relative z-raised shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CellInteractionGuard, { children: render(slots.actions.id) }) })
|
|
11873
12158
|
] }),
|
|
11874
|
-
slots.fields.length > 0 && /* @__PURE__ */ (0,
|
|
11875
|
-
/* @__PURE__ */ (0,
|
|
11876
|
-
/* @__PURE__ */ (0,
|
|
12159
|
+
slots.fields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("dl", { className: "grid grid-cols-[repeat(auto-fit,minmax(min(100%,8.5rem),1fr))] gap-x-4 gap-y-2.5", children: slots.fields.map(({ id, column }) => /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: (0, import_clsx96.default)("min-w-0", column.columnDef.meta?.interactive && "relative z-raised"), children: [
|
|
12160
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("dt", { className: "text-body-tiny text-default-secondary", children: columnLabel(column) }),
|
|
12161
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("dd", { className: "mt-0.5 min-w-0 text-body-xs text-default", children: column.columnDef.meta?.interactive ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CellInteractionGuard, { children: render(id) }) : render(id) })
|
|
11877
12162
|
] }, id)) })
|
|
11878
12163
|
]
|
|
11879
12164
|
},
|
|
@@ -11885,49 +12170,51 @@ function CardList({
|
|
|
11885
12170
|
);
|
|
11886
12171
|
}
|
|
11887
12172
|
|
|
11888
|
-
// src/
|
|
12173
|
+
// src/data-table.tsx
|
|
11889
12174
|
var import_react_table2 = require("@tanstack/react-table");
|
|
11890
12175
|
|
|
11891
12176
|
// src/components/feedback/inline-alert.tsx
|
|
11892
|
-
var
|
|
11893
|
-
var
|
|
11894
|
-
var
|
|
12177
|
+
var import_clsx97 = __toESM(require("clsx"), 1);
|
|
12178
|
+
var import_lucide_react35 = require("lucide-react");
|
|
12179
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
11895
12180
|
var toneStyles3 = {
|
|
11896
12181
|
info: "border-brand-tertiary bg-brand-tertiary text-brand",
|
|
11897
12182
|
warning: "border-warning-tertiary bg-warning-tertiary text-warning",
|
|
11898
12183
|
danger: "border-danger-tertiary bg-danger-tertiary text-danger",
|
|
11899
|
-
positive: "border-positive-tertiary bg-positive-tertiary text-positive"
|
|
12184
|
+
positive: "border-positive-tertiary bg-positive-tertiary text-positive",
|
|
12185
|
+
neutral: "border-default bg-default text-default-secondary"
|
|
11900
12186
|
};
|
|
11901
12187
|
var toneIcons = {
|
|
11902
|
-
info: /* @__PURE__ */ (0,
|
|
11903
|
-
warning: /* @__PURE__ */ (0,
|
|
11904
|
-
danger: /* @__PURE__ */ (0,
|
|
11905
|
-
positive: /* @__PURE__ */ (0,
|
|
12188
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react35.InfoIcon, { className: "size-4" }),
|
|
12189
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react35.TriangleAlertIcon, { className: "size-4" }),
|
|
12190
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react35.TriangleAlertIcon, { className: "size-4" }),
|
|
12191
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react35.CircleCheckBigIcon, { className: "size-4" }),
|
|
12192
|
+
neutral: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react35.InfoIcon, { className: "size-4 text-icon-default-secondary" })
|
|
11906
12193
|
};
|
|
11907
|
-
function InlineAlert({ tone, children, icon, className }) {
|
|
12194
|
+
function InlineAlert({ tone, children, icon, role, className }) {
|
|
11908
12195
|
const glyph = icon === void 0 ? toneIcons[tone] : icon;
|
|
11909
|
-
return /* @__PURE__ */ (0,
|
|
12196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
11910
12197
|
"div",
|
|
11911
12198
|
{
|
|
11912
12199
|
"data-tone": tone,
|
|
11913
|
-
role: tone === "danger" ? "alert" : "status",
|
|
11914
|
-
className: (0,
|
|
12200
|
+
role: role ?? (tone === "danger" ? "alert" : "status"),
|
|
12201
|
+
className: (0, import_clsx97.default)(
|
|
11915
12202
|
"flex items-start gap-3 rounded-xl border p-4 text-body-xs",
|
|
11916
12203
|
toneStyles3[tone],
|
|
11917
12204
|
className
|
|
11918
12205
|
),
|
|
11919
12206
|
children: [
|
|
11920
|
-
glyph && /* @__PURE__ */ (0,
|
|
11921
|
-
/* @__PURE__ */ (0,
|
|
12207
|
+
glyph && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { "aria-hidden": true, className: "mt-px shrink-0", children: glyph }),
|
|
12208
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "min-w-0", children })
|
|
11922
12209
|
]
|
|
11923
12210
|
}
|
|
11924
12211
|
);
|
|
11925
12212
|
}
|
|
11926
12213
|
|
|
11927
12214
|
// src/components/feedback/error-boundary.tsx
|
|
11928
|
-
var
|
|
11929
|
-
var
|
|
11930
|
-
var ErrorBoundary = class extends
|
|
12215
|
+
var import_react76 = require("react");
|
|
12216
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
12217
|
+
var ErrorBoundary = class extends import_react76.Component {
|
|
11931
12218
|
constructor() {
|
|
11932
12219
|
super(...arguments);
|
|
11933
12220
|
this.state = { error: null };
|
|
@@ -11946,7 +12233,7 @@ var ErrorBoundary = class extends import_react75.Component {
|
|
|
11946
12233
|
}
|
|
11947
12234
|
render() {
|
|
11948
12235
|
if (!this.state.error) return this.props.children;
|
|
11949
|
-
return this.props.fallback ?? /* @__PURE__ */ (0,
|
|
12236
|
+
return this.props.fallback ?? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11950
12237
|
"div",
|
|
11951
12238
|
{
|
|
11952
12239
|
role: "status",
|
|
@@ -11959,29 +12246,32 @@ var ErrorBoundary = class extends import_react75.Component {
|
|
|
11959
12246
|
};
|
|
11960
12247
|
|
|
11961
12248
|
// src/components/feedback/banner.tsx
|
|
11962
|
-
var
|
|
11963
|
-
var
|
|
11964
|
-
var
|
|
11965
|
-
var
|
|
12249
|
+
var import_react77 = require("react");
|
|
12250
|
+
var import_clsx98 = __toESM(require("clsx"), 1);
|
|
12251
|
+
var import_lucide_react36 = require("lucide-react");
|
|
12252
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
11966
12253
|
var TONE_STYLES3 = {
|
|
11967
12254
|
info: "border-brand-tertiary bg-brand-tertiary text-default",
|
|
11968
12255
|
positive: "border-positive-tertiary bg-positive-tertiary text-default",
|
|
11969
12256
|
warning: "border-warning-tertiary bg-warning-tertiary text-default",
|
|
11970
|
-
danger: "border-danger-tertiary bg-danger-tertiary text-default"
|
|
12257
|
+
danger: "border-danger-tertiary bg-danger-tertiary text-default",
|
|
12258
|
+
neutral: "border-default bg-default text-default"
|
|
11971
12259
|
};
|
|
11972
12260
|
var TONE_ICON_COLOR = {
|
|
11973
12261
|
info: "text-icon-brand",
|
|
11974
12262
|
positive: "text-icon-positive",
|
|
11975
12263
|
warning: "text-icon-warning",
|
|
11976
|
-
danger: "text-icon-danger"
|
|
12264
|
+
danger: "text-icon-danger",
|
|
12265
|
+
neutral: "text-icon-default-secondary"
|
|
11977
12266
|
};
|
|
11978
12267
|
var TONE_ICON2 = {
|
|
11979
|
-
info: /* @__PURE__ */ (0,
|
|
11980
|
-
positive: /* @__PURE__ */ (0,
|
|
11981
|
-
warning: /* @__PURE__ */ (0,
|
|
11982
|
-
danger: /* @__PURE__ */ (0,
|
|
12268
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react36.InfoIcon, { "aria-hidden": true, className: "size-5" }),
|
|
12269
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react36.CircleCheckBigIcon, { "aria-hidden": true, className: "size-5" }),
|
|
12270
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react36.TriangleAlertIcon, { "aria-hidden": true, className: "size-5" }),
|
|
12271
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react36.TriangleAlertIcon, { "aria-hidden": true, className: "size-5" }),
|
|
12272
|
+
neutral: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react36.InfoIcon, { "aria-hidden": true, className: "size-5" })
|
|
11983
12273
|
};
|
|
11984
|
-
var Banner = (0,
|
|
12274
|
+
var Banner = (0, import_react77.forwardRef)(function Banner2({
|
|
11985
12275
|
title,
|
|
11986
12276
|
children,
|
|
11987
12277
|
variant = "message",
|
|
@@ -11992,9 +12282,9 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
11992
12282
|
className,
|
|
11993
12283
|
...rest
|
|
11994
12284
|
}, ref) {
|
|
11995
|
-
const titleId = (0,
|
|
12285
|
+
const titleId = (0, import_react77.useId)();
|
|
11996
12286
|
const glyph = icon === void 0 ? TONE_ICON2[tone] : icon;
|
|
11997
|
-
return /* @__PURE__ */ (0,
|
|
12287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
11998
12288
|
"div",
|
|
11999
12289
|
{
|
|
12000
12290
|
"data-tone": tone,
|
|
@@ -12003,20 +12293,20 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
12003
12293
|
role: variant === "alert" ? "alert" : "status",
|
|
12004
12294
|
"aria-labelledby": titleId,
|
|
12005
12295
|
"data-slot": "banner",
|
|
12006
|
-
className: (0,
|
|
12296
|
+
className: (0, import_clsx98.default)(
|
|
12007
12297
|
"flex w-full items-start gap-3 rounded-xl border p-4",
|
|
12008
12298
|
TONE_STYLES3[tone],
|
|
12009
12299
|
className
|
|
12010
12300
|
),
|
|
12011
12301
|
...rest,
|
|
12012
12302
|
children: [
|
|
12013
|
-
glyph && /* @__PURE__ */ (0,
|
|
12014
|
-
/* @__PURE__ */ (0,
|
|
12015
|
-
/* @__PURE__ */ (0,
|
|
12016
|
-
children && /* @__PURE__ */ (0,
|
|
12017
|
-
action && /* @__PURE__ */ (0,
|
|
12303
|
+
glyph && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { "aria-hidden": true, className: (0, import_clsx98.default)("mt-px shrink-0", TONE_ICON_COLOR[tone]), children: glyph }),
|
|
12304
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
12305
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { id: titleId, className: "text-body-sm font-semibold text-default", children: title }),
|
|
12306
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "mt-1 text-body-xs text-default-secondary", children }),
|
|
12307
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "mt-3 flex items-center gap-2", children: action })
|
|
12018
12308
|
] }),
|
|
12019
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
12309
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
12020
12310
|
IconButton,
|
|
12021
12311
|
{
|
|
12022
12312
|
variant: "subtle",
|
|
@@ -12024,7 +12314,7 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
12024
12314
|
"aria-label": typeof title === "string" ? `Dismiss: ${title}` : "Dismiss",
|
|
12025
12315
|
onClick: onDismiss,
|
|
12026
12316
|
className: "-mr-1 -mt-1 shrink-0",
|
|
12027
|
-
children: /* @__PURE__ */ (0,
|
|
12317
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react36.XIcon, { "aria-hidden": true, size: 16 })
|
|
12028
12318
|
}
|
|
12029
12319
|
)
|
|
12030
12320
|
]
|
|
@@ -12033,27 +12323,29 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
12033
12323
|
});
|
|
12034
12324
|
|
|
12035
12325
|
// src/components/feedback/toast.tsx
|
|
12036
|
-
var
|
|
12037
|
-
var
|
|
12038
|
-
var
|
|
12039
|
-
var
|
|
12040
|
-
var ToastContext = (0,
|
|
12326
|
+
var import_react78 = require("react");
|
|
12327
|
+
var import_clsx99 = __toESM(require("clsx"), 1);
|
|
12328
|
+
var import_lucide_react37 = require("lucide-react");
|
|
12329
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
12330
|
+
var ToastContext = (0, import_react78.createContext)(null);
|
|
12041
12331
|
function useToast() {
|
|
12042
|
-
const context = (0,
|
|
12332
|
+
const context = (0, import_react78.useContext)(ToastContext);
|
|
12043
12333
|
if (!context) throw new Error("useToast() must be used inside <Toaster>");
|
|
12044
12334
|
return context;
|
|
12045
12335
|
}
|
|
12046
12336
|
var TONE_ICON3 = {
|
|
12047
|
-
info: /* @__PURE__ */ (0,
|
|
12048
|
-
positive: /* @__PURE__ */ (0,
|
|
12049
|
-
warning: /* @__PURE__ */ (0,
|
|
12050
|
-
danger: /* @__PURE__ */ (0,
|
|
12337
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react37.InfoIcon, { "aria-hidden": true, className: "size-4" }),
|
|
12338
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react37.CircleCheckBigIcon, { "aria-hidden": true, className: "size-4" }),
|
|
12339
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react37.TriangleAlertIcon, { "aria-hidden": true, className: "size-4" }),
|
|
12340
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react37.TriangleAlertIcon, { "aria-hidden": true, className: "size-4" }),
|
|
12341
|
+
neutral: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react37.InfoIcon, { "aria-hidden": true, className: "size-4" })
|
|
12051
12342
|
};
|
|
12052
12343
|
var TONE_ICON_COLOR2 = {
|
|
12053
12344
|
info: "text-icon-brand",
|
|
12054
12345
|
positive: "text-icon-positive",
|
|
12055
12346
|
warning: "text-icon-warning",
|
|
12056
|
-
danger: "text-icon-danger"
|
|
12347
|
+
danger: "text-icon-danger",
|
|
12348
|
+
neutral: "text-icon-default-secondary"
|
|
12057
12349
|
};
|
|
12058
12350
|
var POSITION = {
|
|
12059
12351
|
"top-left": "top-[var(--toaster-mobile-offset)] md:top-[var(--toaster-offset)] left-4 items-start",
|
|
@@ -12074,10 +12366,10 @@ function Toaster({
|
|
|
12074
12366
|
offset: offset2 = 16,
|
|
12075
12367
|
mobileOffset
|
|
12076
12368
|
}) {
|
|
12077
|
-
const [toasts, setToasts] = (0,
|
|
12078
|
-
const timers = (0,
|
|
12079
|
-
const counter = (0,
|
|
12080
|
-
const dismiss = (0,
|
|
12369
|
+
const [toasts, setToasts] = (0, import_react78.useState)([]);
|
|
12370
|
+
const timers = (0, import_react78.useRef)(/* @__PURE__ */ new Map());
|
|
12371
|
+
const counter = (0, import_react78.useRef)(0);
|
|
12372
|
+
const dismiss = (0, import_react78.useCallback)((id) => {
|
|
12081
12373
|
const timer = timers.current.get(id);
|
|
12082
12374
|
if (timer) {
|
|
12083
12375
|
clearTimeout(timer);
|
|
@@ -12085,12 +12377,12 @@ function Toaster({
|
|
|
12085
12377
|
}
|
|
12086
12378
|
setToasts((current) => current.filter((entry) => entry.id !== id));
|
|
12087
12379
|
}, []);
|
|
12088
|
-
const dismissAll = (0,
|
|
12380
|
+
const dismissAll = (0, import_react78.useCallback)(() => {
|
|
12089
12381
|
for (const timer of timers.current.values()) clearTimeout(timer);
|
|
12090
12382
|
timers.current.clear();
|
|
12091
12383
|
setToasts([]);
|
|
12092
12384
|
}, []);
|
|
12093
|
-
const toast = (0,
|
|
12385
|
+
const toast = (0, import_react78.useCallback)(
|
|
12094
12386
|
(options) => {
|
|
12095
12387
|
counter.current += 1;
|
|
12096
12388
|
const id = `toast-${counter.current}`;
|
|
@@ -12106,23 +12398,23 @@ function Toaster({
|
|
|
12106
12398
|
},
|
|
12107
12399
|
[duration, max, dismiss]
|
|
12108
12400
|
);
|
|
12109
|
-
(0,
|
|
12401
|
+
(0, import_react78.useEffect)(() => {
|
|
12110
12402
|
const map = timers.current;
|
|
12111
12403
|
return () => {
|
|
12112
12404
|
for (const timer of map.values()) clearTimeout(timer);
|
|
12113
12405
|
map.clear();
|
|
12114
12406
|
};
|
|
12115
12407
|
}, []);
|
|
12116
|
-
const context = (0,
|
|
12117
|
-
return /* @__PURE__ */ (0,
|
|
12408
|
+
const context = (0, import_react78.useMemo)(() => ({ toast, dismiss, dismissAll }), [toast, dismiss, dismissAll]);
|
|
12409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(ToastContext.Provider, { value: context, children: [
|
|
12118
12410
|
children,
|
|
12119
|
-
/* @__PURE__ */ (0,
|
|
12411
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12120
12412
|
"div",
|
|
12121
12413
|
{
|
|
12122
12414
|
"aria-live": "polite",
|
|
12123
12415
|
"aria-atomic": "false",
|
|
12124
12416
|
...{ [TOASTER_ATTRIBUTE]: "" },
|
|
12125
|
-
className: (0,
|
|
12417
|
+
className: (0, import_clsx99.default)(
|
|
12126
12418
|
"pointer-events-none fixed z-toast flex w-[calc(100%-2rem)] max-w-[380px] flex-col gap-2",
|
|
12127
12419
|
POSITION[position]
|
|
12128
12420
|
),
|
|
@@ -12130,29 +12422,29 @@ function Toaster({
|
|
|
12130
12422
|
"--toaster-offset": toLength(offset2),
|
|
12131
12423
|
"--toaster-mobile-offset": toLength(mobileOffset ?? offset2)
|
|
12132
12424
|
},
|
|
12133
|
-
children: toasts.map((entry) => /* @__PURE__ */ (0,
|
|
12425
|
+
children: toasts.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ToastItem, { toast: entry, onDismiss: () => dismiss(entry.id) }, entry.id))
|
|
12134
12426
|
}
|
|
12135
12427
|
) })
|
|
12136
12428
|
] });
|
|
12137
12429
|
}
|
|
12138
12430
|
function ToastItem({ toast, onDismiss }) {
|
|
12139
12431
|
const tone = toast.tone ?? "info";
|
|
12140
|
-
return /* @__PURE__ */ (0,
|
|
12432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
12141
12433
|
"div",
|
|
12142
12434
|
{
|
|
12143
12435
|
role: tone === "danger" ? "alert" : "status",
|
|
12144
|
-
className: (0,
|
|
12436
|
+
className: (0, import_clsx99.default)(
|
|
12145
12437
|
"pointer-events-auto flex w-full items-start gap-3 rounded-xl border border-default",
|
|
12146
12438
|
"bg-default p-4 shadow-400"
|
|
12147
12439
|
),
|
|
12148
12440
|
children: [
|
|
12149
|
-
/* @__PURE__ */ (0,
|
|
12150
|
-
/* @__PURE__ */ (0,
|
|
12151
|
-
/* @__PURE__ */ (0,
|
|
12152
|
-
toast.description && /* @__PURE__ */ (0,
|
|
12153
|
-
toast.action && /* @__PURE__ */ (0,
|
|
12441
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { "aria-hidden": true, className: (0, import_clsx99.default)("mt-px shrink-0", TONE_ICON_COLOR2[tone]), children: TONE_ICON3[tone] }),
|
|
12442
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
12443
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "text-body-sm font-semibold text-default", children: toast.title }),
|
|
12444
|
+
toast.description && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "mt-0.5 text-body-xs text-default-secondary", children: toast.description }),
|
|
12445
|
+
toast.action && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "mt-2 flex items-center gap-2", children: toast.action })
|
|
12154
12446
|
] }),
|
|
12155
|
-
/* @__PURE__ */ (0,
|
|
12447
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12156
12448
|
IconButton,
|
|
12157
12449
|
{
|
|
12158
12450
|
variant: "subtle",
|
|
@@ -12160,7 +12452,7 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
12160
12452
|
"aria-label": typeof toast.title === "string" ? `Dismiss: ${toast.title}` : "Dismiss",
|
|
12161
12453
|
onClick: onDismiss,
|
|
12162
12454
|
className: "-mr-1 -mt-1 shrink-0",
|
|
12163
|
-
children: /* @__PURE__ */ (0,
|
|
12455
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react37.XIcon, { "aria-hidden": true, size: 14 })
|
|
12164
12456
|
}
|
|
12165
12457
|
)
|
|
12166
12458
|
]
|
|
@@ -12169,25 +12461,25 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
12169
12461
|
}
|
|
12170
12462
|
|
|
12171
12463
|
// src/components/forms/password-input.tsx
|
|
12172
|
-
var
|
|
12173
|
-
var
|
|
12174
|
-
var
|
|
12175
|
-
var PasswordInput = (0,
|
|
12176
|
-
const [visible, setVisible] = (0,
|
|
12177
|
-
return /* @__PURE__ */ (0,
|
|
12464
|
+
var import_react79 = require("react");
|
|
12465
|
+
var import_lucide_react38 = require("lucide-react");
|
|
12466
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
12467
|
+
var PasswordInput = (0, import_react79.forwardRef)(function PasswordInput2(props, ref) {
|
|
12468
|
+
const [visible, setVisible] = (0, import_react79.useState)(false);
|
|
12469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12178
12470
|
Input,
|
|
12179
12471
|
{
|
|
12180
12472
|
ref,
|
|
12181
12473
|
...props,
|
|
12182
12474
|
type: visible ? "text" : "password",
|
|
12183
|
-
trailingAction: /* @__PURE__ */ (0,
|
|
12475
|
+
trailingAction: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12184
12476
|
"button",
|
|
12185
12477
|
{
|
|
12186
12478
|
type: "button",
|
|
12187
12479
|
"aria-label": visible ? "Hide password" : "Show password",
|
|
12188
12480
|
onClick: () => setVisible((v) => !v),
|
|
12189
12481
|
className: "flex items-center justify-center rounded transition-colors hover:text-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",
|
|
12190
|
-
children: visible ? /* @__PURE__ */ (0,
|
|
12482
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_lucide_react38.EyeOffIcon, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_lucide_react38.EyeIcon, { "aria-hidden": true, className: "size-4" })
|
|
12191
12483
|
}
|
|
12192
12484
|
)
|
|
12193
12485
|
}
|
|
@@ -12195,31 +12487,31 @@ var PasswordInput = (0, import_react78.forwardRef)(function PasswordInput2(props
|
|
|
12195
12487
|
});
|
|
12196
12488
|
|
|
12197
12489
|
// src/components/ai/ai-chat-bar.tsx
|
|
12198
|
-
var
|
|
12199
|
-
var
|
|
12200
|
-
var
|
|
12490
|
+
var import_clsx100 = __toESM(require("clsx"), 1);
|
|
12491
|
+
var import_lucide_react39 = require("lucide-react");
|
|
12492
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
12201
12493
|
function AIChatBar({
|
|
12202
12494
|
placeholder = "Ask Intelligence about any entity, supplier, or risk\u2026",
|
|
12203
12495
|
className
|
|
12204
12496
|
}) {
|
|
12205
|
-
return /* @__PURE__ */ (0,
|
|
12497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
12206
12498
|
"div",
|
|
12207
12499
|
{
|
|
12208
|
-
className: (0,
|
|
12500
|
+
className: (0, import_clsx100.default)(
|
|
12209
12501
|
"flex h-16 items-center gap-3 rounded-2xl border border-default bg-default px-6 shadow-panel",
|
|
12210
12502
|
className
|
|
12211
12503
|
),
|
|
12212
12504
|
children: [
|
|
12213
|
-
/* @__PURE__ */ (0,
|
|
12214
|
-
/* @__PURE__ */ (0,
|
|
12215
|
-
/* @__PURE__ */ (0,
|
|
12505
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_lucide_react39.SearchIcon, { className: "size-4" }) }),
|
|
12506
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("p", { className: "flex-1 text-body-sm text-default-tertiary truncate", children: placeholder }),
|
|
12507
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
12216
12508
|
"button",
|
|
12217
12509
|
{
|
|
12218
12510
|
type: "button",
|
|
12219
12511
|
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",
|
|
12220
12512
|
children: [
|
|
12221
12513
|
"Ask",
|
|
12222
|
-
/* @__PURE__ */ (0,
|
|
12514
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_lucide_react39.ArrowRightIcon, { "aria-hidden": true, className: "size-4" })
|
|
12223
12515
|
]
|
|
12224
12516
|
}
|
|
12225
12517
|
)
|
|
@@ -12229,42 +12521,42 @@ function AIChatBar({
|
|
|
12229
12521
|
}
|
|
12230
12522
|
|
|
12231
12523
|
// src/components/ai/ai-suggestion-chip.tsx
|
|
12232
|
-
var
|
|
12233
|
-
var
|
|
12234
|
-
var
|
|
12524
|
+
var import_clsx101 = __toESM(require("clsx"), 1);
|
|
12525
|
+
var import_lucide_react40 = require("lucide-react");
|
|
12526
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
12235
12527
|
function AISuggestionChip({ prompt, onClick, className }) {
|
|
12236
|
-
return /* @__PURE__ */ (0,
|
|
12528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
12237
12529
|
"button",
|
|
12238
12530
|
{
|
|
12239
12531
|
type: "button",
|
|
12240
12532
|
onClick,
|
|
12241
|
-
className: (0,
|
|
12533
|
+
className: (0, import_clsx101.default)(
|
|
12242
12534
|
"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",
|
|
12243
12535
|
className
|
|
12244
12536
|
),
|
|
12245
12537
|
children: [
|
|
12246
|
-
/* @__PURE__ */ (0,
|
|
12247
|
-
/* @__PURE__ */ (0,
|
|
12248
|
-
/* @__PURE__ */ (0,
|
|
12538
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-brand", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_lucide_react40.CpuIcon, { className: "size-4" }) }),
|
|
12539
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "flex-1 text-body-sm text-default truncate", children: prompt }),
|
|
12540
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_lucide_react40.ArrowRightIcon, { className: "size-3.5", strokeWidth: 2.5 }) })
|
|
12249
12541
|
]
|
|
12250
12542
|
}
|
|
12251
12543
|
);
|
|
12252
12544
|
}
|
|
12253
12545
|
|
|
12254
12546
|
// src/components/ai/quick-actions-bar.tsx
|
|
12255
|
-
var
|
|
12256
|
-
var
|
|
12547
|
+
var import_clsx102 = __toESM(require("clsx"), 1);
|
|
12548
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
12257
12549
|
function QuickActionsBar({ actions, active, onSelect, className }) {
|
|
12258
|
-
return /* @__PURE__ */ (0,
|
|
12550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: (0, import_clsx102.default)("flex flex-wrap items-center gap-3", className), children: actions.map((action) => {
|
|
12259
12551
|
const isActive = active === action.value;
|
|
12260
|
-
return /* @__PURE__ */ (0,
|
|
12552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
12261
12553
|
"button",
|
|
12262
12554
|
{
|
|
12263
12555
|
type: "button",
|
|
12264
12556
|
"aria-pressed": isActive,
|
|
12265
12557
|
onClick: () => onSelect?.(action.value),
|
|
12266
12558
|
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",
|
|
12267
|
-
children: /* @__PURE__ */ (0,
|
|
12559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(TagPill, { label: action.label, tone: isActive ? "brand" : "default" })
|
|
12268
12560
|
},
|
|
12269
12561
|
action.value
|
|
12270
12562
|
);
|
|
@@ -12272,25 +12564,25 @@ function QuickActionsBar({ actions, active, onSelect, className }) {
|
|
|
12272
12564
|
}
|
|
12273
12565
|
|
|
12274
12566
|
// src/components/ai/chat.tsx
|
|
12275
|
-
var
|
|
12276
|
-
var
|
|
12277
|
-
var
|
|
12567
|
+
var import_clsx103 = __toESM(require("clsx"), 1);
|
|
12568
|
+
var import_lucide_react41 = require("lucide-react");
|
|
12569
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
12278
12570
|
function AiAvatar({ className, icon }) {
|
|
12279
|
-
return /* @__PURE__ */ (0,
|
|
12571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
12280
12572
|
"span",
|
|
12281
12573
|
{
|
|
12282
12574
|
"aria-hidden": true,
|
|
12283
12575
|
className: cn("flex size-8 shrink-0 items-center justify-center rounded-full bg-brand text-icon-brand-on-brand", className),
|
|
12284
|
-
children: icon ?? /* @__PURE__ */ (0,
|
|
12576
|
+
children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_lucide_react41.CpuIcon, { className: "size-3.5" })
|
|
12285
12577
|
}
|
|
12286
12578
|
);
|
|
12287
12579
|
}
|
|
12288
12580
|
function TypingIndicator({ label = "Assistant is typing", className }) {
|
|
12289
|
-
return /* @__PURE__ */ (0,
|
|
12290
|
-
/* @__PURE__ */ (0,
|
|
12291
|
-
/* @__PURE__ */ (0,
|
|
12292
|
-
/* @__PURE__ */ (0,
|
|
12293
|
-
/* @__PURE__ */ (0,
|
|
12581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { role: "status", "aria-live": "polite", className: cn("flex items-center gap-3", className), children: [
|
|
12582
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(AiAvatar, {}),
|
|
12583
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-2 rounded-2xl rounded-tl-sm border border-default bg-default-secondary px-5 py-3", children: [
|
|
12584
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "text-body-xs text-default-secondary", children: label }),
|
|
12585
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { "aria-hidden": true, className: "flex gap-1", children: [0, 1, 2].map((index) => /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
12294
12586
|
"span",
|
|
12295
12587
|
{
|
|
12296
12588
|
className: "inline-block size-1.5 rounded-full bg-default-tertiary motion-safe:animate-bounce",
|
|
@@ -12303,16 +12595,16 @@ function TypingIndicator({ label = "Assistant is typing", className }) {
|
|
|
12303
12595
|
}
|
|
12304
12596
|
function ChatBubble({ sender, children, failed = false, className }) {
|
|
12305
12597
|
if (sender === "user") {
|
|
12306
|
-
return /* @__PURE__ */ (0,
|
|
12598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { "data-sender": "user", className: cn("flex justify-end", className), children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("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 }) });
|
|
12307
12599
|
}
|
|
12308
|
-
return /* @__PURE__ */ (0,
|
|
12600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
12309
12601
|
"div",
|
|
12310
12602
|
{
|
|
12311
12603
|
"data-sender": "assistant",
|
|
12312
12604
|
"data-state": failed ? "failed" : void 0,
|
|
12313
12605
|
className: cn(
|
|
12314
12606
|
"rounded-2xl rounded-tl-sm border px-5 py-4 text-body-sm leading-relaxed",
|
|
12315
|
-
(0,
|
|
12607
|
+
(0, import_clsx103.default)(
|
|
12316
12608
|
"border-default bg-default-secondary text-default",
|
|
12317
12609
|
"data-[state=failed]:border-danger-secondary data-[state=failed]:bg-danger-tertiary data-[state=failed]:text-danger"
|
|
12318
12610
|
),
|
|
@@ -12324,17 +12616,17 @@ function ChatBubble({ sender, children, failed = false, className }) {
|
|
|
12324
12616
|
}
|
|
12325
12617
|
|
|
12326
12618
|
// src/components/decorative/aurora-backdrop.tsx
|
|
12327
|
-
var
|
|
12619
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
12328
12620
|
function blob(primitive, alpha) {
|
|
12329
12621
|
return `radial-gradient(ellipse, color-mix(in srgb, var(${primitive}) ${alpha}%, transparent) 0%, transparent 70%)`;
|
|
12330
12622
|
}
|
|
12331
12623
|
function AuroraBackdrop() {
|
|
12332
|
-
return /* @__PURE__ */ (0,
|
|
12333
|
-
/* @__PURE__ */ (0,
|
|
12334
|
-
/* @__PURE__ */ (0,
|
|
12335
|
-
/* @__PURE__ */ (0,
|
|
12336
|
-
/* @__PURE__ */ (0,
|
|
12337
|
-
/* @__PURE__ */ (0,
|
|
12624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "pointer-events-none absolute inset-0", "aria-hidden": true, children: [
|
|
12625
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "absolute -left-24 -top-28", style: { width: 380, height: 380, background: blob("--prim-red-400", 45) } }),
|
|
12626
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "absolute -top-24 right-[-4%]", style: { width: 320, height: 320, background: blob("--prim-red-300", 40) } }),
|
|
12627
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "absolute bottom-[-10%] right-[14%]", style: { width: 420, height: 420, background: blob("--prim-violet-400", 30) } }),
|
|
12628
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "absolute bottom-[-6%] left-[4%]", style: { width: 280, height: 280, background: blob("--prim-blue-400", 25) } }),
|
|
12629
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "absolute left-[20%] top-[30%]", style: { width: 240, height: 240, background: blob("--prim-blue-300", 18) } })
|
|
12338
12630
|
] });
|
|
12339
12631
|
}
|
|
12340
12632
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -12352,6 +12644,7 @@ function AuroraBackdrop() {
|
|
|
12352
12644
|
Avatar,
|
|
12353
12645
|
AvatarBlock,
|
|
12354
12646
|
AvatarGroup,
|
|
12647
|
+
BADGE_COLORS,
|
|
12355
12648
|
Badge,
|
|
12356
12649
|
Banner,
|
|
12357
12650
|
BarChart,
|
|
@@ -12492,6 +12785,7 @@ function AuroraBackdrop() {
|
|
|
12492
12785
|
Label,
|
|
12493
12786
|
LegendDot,
|
|
12494
12787
|
ListRow,
|
|
12788
|
+
Listbox,
|
|
12495
12789
|
Menubar,
|
|
12496
12790
|
MenubarCheckboxItem,
|
|
12497
12791
|
MenubarContent,
|