@platned/ui 0.9.4 → 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/{data-table-gr08E5aX.d.ts → data-table-JX-vnL0F.d.ts} +7 -1
- package/dist/data-table.cjs +10 -3
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +11 -3
- package/dist/data-table.js.map +1 -1
- package/dist/index.cjs +637 -452
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +146 -11
- package/dist/index.js +484 -308
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
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,
|
|
@@ -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
|
{
|
|
@@ -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
|
|
@@ -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;
|
|
@@ -9142,15 +9198,20 @@ var Blockquote = (0, import_react65.forwardRef)(function Blockquote2({ children,
|
|
|
9142
9198
|
}
|
|
9143
9199
|
);
|
|
9144
9200
|
});
|
|
9145
|
-
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) {
|
|
9146
9206
|
const Root = asChild ? Slot : "a";
|
|
9147
9207
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
9148
9208
|
Root,
|
|
9149
9209
|
{
|
|
9150
9210
|
ref,
|
|
9211
|
+
"data-tone": tone,
|
|
9151
9212
|
className: (0, import_clsx63.default)(
|
|
9152
|
-
"rounded
|
|
9153
|
-
|
|
9213
|
+
"rounded underline-offset-2 transition-colors",
|
|
9214
|
+
TEXT_LINK_TONE[tone],
|
|
9154
9215
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
9155
9216
|
className
|
|
9156
9217
|
),
|
|
@@ -10024,12 +10085,12 @@ var SHAPE = {
|
|
|
10024
10085
|
square: { sm: "size-1.5 rounded-[2px]", md: "size-2 rounded-[3px]" },
|
|
10025
10086
|
line: { sm: "h-0.5 w-3 rounded-full", md: "h-0.5 w-4 rounded-full" }
|
|
10026
10087
|
};
|
|
10027
|
-
function LegendDot({ tone, color, size: size2 = "md", shape = "dot", className }) {
|
|
10088
|
+
function LegendDot({ tone, color, hue, size: size2 = "md", shape = "dot", className }) {
|
|
10028
10089
|
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10029
10090
|
"span",
|
|
10030
10091
|
{
|
|
10031
10092
|
className: (0, import_clsx77.default)("inline-block shrink-0", SHAPE[shape][size2], className),
|
|
10032
|
-
style: { backgroundColor: resolveChartColor(color, tone) },
|
|
10093
|
+
style: { backgroundColor: color || !hue ? resolveChartColor(color, tone) : `var(--badge-${hue}-text)` },
|
|
10033
10094
|
"aria-hidden": true
|
|
10034
10095
|
}
|
|
10035
10096
|
);
|
|
@@ -10128,9 +10189,117 @@ function TrendLabel({
|
|
|
10128
10189
|
);
|
|
10129
10190
|
}
|
|
10130
10191
|
|
|
10131
|
-
// src/components/lists/
|
|
10192
|
+
// src/components/lists/listbox.tsx
|
|
10193
|
+
var import_react69 = require("react");
|
|
10132
10194
|
var import_clsx80 = __toESM(require("clsx"), 1);
|
|
10133
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");
|
|
10134
10303
|
var DENSITY = {
|
|
10135
10304
|
default: {
|
|
10136
10305
|
pad: "py-4",
|
|
@@ -10191,24 +10360,24 @@ function ListRow({
|
|
|
10191
10360
|
className
|
|
10192
10361
|
)
|
|
10193
10362
|
};
|
|
10194
|
-
const body = /* @__PURE__ */ (0,
|
|
10195
|
-
/* @__PURE__ */ (0,
|
|
10196
|
-
hasTitleLine && /* @__PURE__ */ (0,
|
|
10197
|
-
/* @__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: [
|
|
10198
10367
|
leading,
|
|
10199
|
-
title != null && /* @__PURE__ */ (0,
|
|
10200
|
-
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 })
|
|
10201
10370
|
] }),
|
|
10202
|
-
meta && /* @__PURE__ */ (0,
|
|
10371
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "shrink-0", children: meta })
|
|
10203
10372
|
] }),
|
|
10204
|
-
description && /* @__PURE__ */ (0,
|
|
10373
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("p", { className: d.description, children: description }),
|
|
10205
10374
|
footer && // These two wrappers are propagation barriers, not controls — they add no
|
|
10206
10375
|
// behaviour of their own and must not be focusable or take a role.
|
|
10207
10376
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
10208
|
-
/* @__PURE__ */ (0,
|
|
10377
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { onClick: stopIfInteractive, onKeyDown: stopIfInteractive, children: footer })
|
|
10209
10378
|
] }),
|
|
10210
10379
|
trailing && // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
10211
|
-
/* @__PURE__ */ (0,
|
|
10380
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
10212
10381
|
"div",
|
|
10213
10382
|
{
|
|
10214
10383
|
className: "ml-3 flex shrink-0 items-center self-center",
|
|
@@ -10219,7 +10388,7 @@ function ListRow({
|
|
|
10219
10388
|
)
|
|
10220
10389
|
] });
|
|
10221
10390
|
if (asChild) {
|
|
10222
|
-
return /* @__PURE__ */ (0,
|
|
10391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
10223
10392
|
Slot,
|
|
10224
10393
|
{
|
|
10225
10394
|
...rootProps,
|
|
@@ -10232,7 +10401,7 @@ function ListRow({
|
|
|
10232
10401
|
}
|
|
10233
10402
|
);
|
|
10234
10403
|
}
|
|
10235
|
-
return /* @__PURE__ */ (0,
|
|
10404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
10236
10405
|
Tag,
|
|
10237
10406
|
{
|
|
10238
10407
|
...rootProps,
|
|
@@ -10261,11 +10430,11 @@ function refusePress(event) {
|
|
|
10261
10430
|
}
|
|
10262
10431
|
|
|
10263
10432
|
// src/components/lists/file-row.tsx
|
|
10264
|
-
var
|
|
10433
|
+
var import_clsx82 = __toESM(require("clsx"), 1);
|
|
10265
10434
|
var import_lucide_react28 = require("lucide-react");
|
|
10266
|
-
var
|
|
10435
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
10267
10436
|
function FileTypeBadge({ type }) {
|
|
10268
|
-
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 });
|
|
10269
10438
|
}
|
|
10270
10439
|
function FileRow({
|
|
10271
10440
|
name,
|
|
@@ -10279,24 +10448,24 @@ function FileRow({
|
|
|
10279
10448
|
actions,
|
|
10280
10449
|
className
|
|
10281
10450
|
}) {
|
|
10282
|
-
const lead = leading ?? (fileType ? /* @__PURE__ */ (0,
|
|
10283
|
-
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)(
|
|
10284
10453
|
"div",
|
|
10285
10454
|
{
|
|
10286
|
-
className: (0,
|
|
10455
|
+
className: (0, import_clsx82.default)(
|
|
10287
10456
|
"flex items-center gap-3 rounded-lg border border-default bg-default px-3 py-2.5",
|
|
10288
10457
|
className
|
|
10289
10458
|
),
|
|
10290
10459
|
children: [
|
|
10291
10460
|
lead,
|
|
10292
|
-
/* @__PURE__ */ (0,
|
|
10293
|
-
/* @__PURE__ */ (0,
|
|
10294
|
-
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 })
|
|
10295
10464
|
] }),
|
|
10296
|
-
(onDownload || onRemove || actions) && /* @__PURE__ */ (0,
|
|
10297
|
-
onDownload && /* @__PURE__ */ (0,
|
|
10298
|
-
onRemove && /* @__PURE__ */ (0,
|
|
10299
|
-
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 })
|
|
10300
10469
|
] })
|
|
10301
10470
|
]
|
|
10302
10471
|
}
|
|
@@ -10304,8 +10473,8 @@ function FileRow({
|
|
|
10304
10473
|
}
|
|
10305
10474
|
|
|
10306
10475
|
// src/components/lists/scored-row.tsx
|
|
10307
|
-
var
|
|
10308
|
-
var
|
|
10476
|
+
var import_clsx83 = __toESM(require("clsx"), 1);
|
|
10477
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
10309
10478
|
var GAP5 = {
|
|
10310
10479
|
sm: "gap-2",
|
|
10311
10480
|
md: "gap-3",
|
|
@@ -10332,11 +10501,11 @@ function ScoredRow({
|
|
|
10332
10501
|
align = "center",
|
|
10333
10502
|
className
|
|
10334
10503
|
}) {
|
|
10335
|
-
return /* @__PURE__ */ (0,
|
|
10336
|
-
/* @__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)(
|
|
10337
10506
|
"div",
|
|
10338
10507
|
{
|
|
10339
|
-
className: (0,
|
|
10508
|
+
className: (0, import_clsx83.default)(
|
|
10340
10509
|
"flex min-w-0",
|
|
10341
10510
|
ALIGN3[align],
|
|
10342
10511
|
GAP5[leadingGap ?? gap],
|
|
@@ -10345,39 +10514,39 @@ function ScoredRow({
|
|
|
10345
10514
|
style: titleWidth ? { width: titleWidth } : void 0,
|
|
10346
10515
|
children: [
|
|
10347
10516
|
leading,
|
|
10348
|
-
/* @__PURE__ */ (0,
|
|
10349
|
-
/* @__PURE__ */ (0,
|
|
10350
|
-
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 })
|
|
10351
10520
|
] })
|
|
10352
10521
|
]
|
|
10353
10522
|
}
|
|
10354
10523
|
),
|
|
10355
|
-
aside && /* @__PURE__ */ (0,
|
|
10524
|
+
aside && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10356
10525
|
"div",
|
|
10357
10526
|
{
|
|
10358
|
-
className: (0,
|
|
10527
|
+
className: (0, import_clsx83.default)("min-w-0", asideWidth ? "shrink-0" : "flex-1"),
|
|
10359
10528
|
style: asideWidth ? { width: asideWidth } : void 0,
|
|
10360
10529
|
children: aside
|
|
10361
10530
|
}
|
|
10362
10531
|
),
|
|
10363
|
-
meter && /* @__PURE__ */ (0,
|
|
10532
|
+
meter && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10364
10533
|
"div",
|
|
10365
10534
|
{
|
|
10366
|
-
className: (0,
|
|
10535
|
+
className: (0, import_clsx83.default)("min-w-0", meterWidth ? "shrink-0" : "flex-1"),
|
|
10367
10536
|
style: meterWidth ? { width: meterWidth } : void 0,
|
|
10368
10537
|
children: meter
|
|
10369
10538
|
}
|
|
10370
10539
|
),
|
|
10371
|
-
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 })
|
|
10372
10541
|
] });
|
|
10373
10542
|
}
|
|
10374
10543
|
|
|
10375
10544
|
// src/components/lists/numbered-list.tsx
|
|
10376
|
-
var
|
|
10545
|
+
var import_clsx84 = __toESM(require("clsx"), 1);
|
|
10377
10546
|
|
|
10378
10547
|
// src/components/feedback/progress-bar.tsx
|
|
10379
|
-
var
|
|
10380
|
-
var
|
|
10548
|
+
var import_react70 = require("react");
|
|
10549
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
10381
10550
|
var SIZE18 = {
|
|
10382
10551
|
xs: "h-1",
|
|
10383
10552
|
sm: "h-1.5",
|
|
@@ -10405,9 +10574,9 @@ function ProgressBar({
|
|
|
10405
10574
|
}) {
|
|
10406
10575
|
const clamped = Math.min(100, Math.max(0, value));
|
|
10407
10576
|
const rounded = radius ? void 0 : "rounded-full";
|
|
10408
|
-
const labelId = (0,
|
|
10577
|
+
const labelId = (0, import_react70.useId)();
|
|
10409
10578
|
const filledSegments = segments ? Math.round(clamped / 100 * segments) : 0;
|
|
10410
|
-
const track = segments ? /* @__PURE__ */ (0,
|
|
10579
|
+
const track = segments ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10411
10580
|
"div",
|
|
10412
10581
|
{
|
|
10413
10582
|
role: "progressbar",
|
|
@@ -10419,7 +10588,7 @@ function ProgressBar({
|
|
|
10419
10588
|
"aria-label": label ? void 0 : ariaLabel,
|
|
10420
10589
|
"data-tone": tone,
|
|
10421
10590
|
className: cn("flex w-full gap-1", className),
|
|
10422
|
-
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ (0,
|
|
10591
|
+
children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10423
10592
|
"span",
|
|
10424
10593
|
{
|
|
10425
10594
|
"data-filled": index < filledSegments || void 0,
|
|
@@ -10429,7 +10598,7 @@ function ProgressBar({
|
|
|
10429
10598
|
index
|
|
10430
10599
|
))
|
|
10431
10600
|
}
|
|
10432
|
-
) : /* @__PURE__ */ (0,
|
|
10601
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10433
10602
|
"div",
|
|
10434
10603
|
{
|
|
10435
10604
|
role: "progressbar",
|
|
@@ -10442,7 +10611,7 @@ function ProgressBar({
|
|
|
10442
10611
|
"aria-label": label ? void 0 : ariaLabel,
|
|
10443
10612
|
className: cn("w-full overflow-hidden bg-default-tertiary", SIZE18[size2], rounded, className),
|
|
10444
10613
|
style: radius ? { borderRadius: radius } : void 0,
|
|
10445
|
-
children: /* @__PURE__ */ (0,
|
|
10614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10446
10615
|
"div",
|
|
10447
10616
|
{
|
|
10448
10617
|
className: cn("h-full transition-all motion-reduce:transition-none", rounded, FILL[tone]),
|
|
@@ -10452,10 +10621,10 @@ function ProgressBar({
|
|
|
10452
10621
|
}
|
|
10453
10622
|
);
|
|
10454
10623
|
if (!label && !showValue) return track;
|
|
10455
|
-
return /* @__PURE__ */ (0,
|
|
10456
|
-
/* @__PURE__ */ (0,
|
|
10457
|
-
label && /* @__PURE__ */ (0,
|
|
10458
|
-
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: [
|
|
10459
10628
|
Math.round(clamped),
|
|
10460
10629
|
"%"
|
|
10461
10630
|
] })
|
|
@@ -10465,7 +10634,7 @@ function ProgressBar({
|
|
|
10465
10634
|
}
|
|
10466
10635
|
|
|
10467
10636
|
// src/components/lists/numbered-list.tsx
|
|
10468
|
-
var
|
|
10637
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
10469
10638
|
var GAP6 = {
|
|
10470
10639
|
sm: "gap-2",
|
|
10471
10640
|
md: "gap-3"
|
|
@@ -10479,18 +10648,18 @@ function NumberedList({
|
|
|
10479
10648
|
gap = "md",
|
|
10480
10649
|
className
|
|
10481
10650
|
}) {
|
|
10482
|
-
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) => {
|
|
10483
10652
|
const tone = !item.tone || item.tone === "auto" ? getScoreTone(item.score, { direction }) : item.tone;
|
|
10484
|
-
return /* @__PURE__ */ (0,
|
|
10485
|
-
/* @__PURE__ */ (0,
|
|
10486
|
-
/* @__PURE__ */ (0,
|
|
10487
|
-
/* @__PURE__ */ (0,
|
|
10488
|
-
/* @__PURE__ */ (0,
|
|
10489
|
-
/* @__PURE__ */ (0,
|
|
10490
|
-
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 })
|
|
10491
10660
|
] })
|
|
10492
10661
|
] }),
|
|
10493
|
-
/* @__PURE__ */ (0,
|
|
10662
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
10494
10663
|
ScoreValue,
|
|
10495
10664
|
{
|
|
10496
10665
|
value: item.score,
|
|
@@ -10501,43 +10670,43 @@ function NumberedList({
|
|
|
10501
10670
|
}
|
|
10502
10671
|
)
|
|
10503
10672
|
] }),
|
|
10504
|
-
/* @__PURE__ */ (0,
|
|
10673
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(ProgressBar, { value: item.score, tone, "aria-label": `${item.title} score` })
|
|
10505
10674
|
] }, `${item.title}-${index}`);
|
|
10506
10675
|
}) });
|
|
10507
10676
|
}
|
|
10508
10677
|
|
|
10509
10678
|
// src/components/lists/icon-text-row.tsx
|
|
10510
|
-
var
|
|
10511
|
-
var
|
|
10679
|
+
var import_clsx85 = __toESM(require("clsx"), 1);
|
|
10680
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
10512
10681
|
function IconTextRow({ icon, title, detail, className }) {
|
|
10513
|
-
return /* @__PURE__ */ (0,
|
|
10514
|
-
/* @__PURE__ */ (0,
|
|
10515
|
-
/* @__PURE__ */ (0,
|
|
10516
|
-
/* @__PURE__ */ (0,
|
|
10517
|
-
/* @__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 })
|
|
10518
10687
|
] })
|
|
10519
10688
|
] });
|
|
10520
10689
|
}
|
|
10521
10690
|
|
|
10522
10691
|
// src/components/lists/checklist-row.tsx
|
|
10523
|
-
var
|
|
10692
|
+
var import_clsx86 = __toESM(require("clsx"), 1);
|
|
10524
10693
|
var import_lucide_react29 = require("lucide-react");
|
|
10525
|
-
var
|
|
10694
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
10526
10695
|
function ChecklistRow({ label, state, className }) {
|
|
10527
|
-
return /* @__PURE__ */ (0,
|
|
10528
|
-
/* @__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)(
|
|
10529
10698
|
"span",
|
|
10530
10699
|
{
|
|
10531
|
-
className: (0,
|
|
10700
|
+
className: (0, import_clsx86.default)(
|
|
10532
10701
|
"size-3.5 rounded-full border-2",
|
|
10533
10702
|
state === "active" ? "motion-safe:animate-pulse border-brand-emphasis border-t-transparent" : "border-disabled"
|
|
10534
10703
|
)
|
|
10535
10704
|
}
|
|
10536
10705
|
) }),
|
|
10537
|
-
/* @__PURE__ */ (0,
|
|
10706
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
10538
10707
|
"span",
|
|
10539
10708
|
{
|
|
10540
|
-
className: (0,
|
|
10709
|
+
className: (0, import_clsx86.default)(
|
|
10541
10710
|
"text-body-sm",
|
|
10542
10711
|
state === "pending" ? "text-default-tertiary" : "font-semibold text-default"
|
|
10543
10712
|
),
|
|
@@ -10548,22 +10717,22 @@ function ChecklistRow({ label, state, className }) {
|
|
|
10548
10717
|
}
|
|
10549
10718
|
|
|
10550
10719
|
// src/components/lists/steps-list.tsx
|
|
10551
|
-
var
|
|
10552
|
-
var
|
|
10720
|
+
var import_clsx87 = __toESM(require("clsx"), 1);
|
|
10721
|
+
var import_jsx_runtime109 = (
|
|
10553
10722
|
// `text-[12px]` was off the type scale; 12 sits midway between Scale 01 (11) and
|
|
10554
10723
|
// Scale 02 (13), so it rounds up to 13 like every other snap in this pass.
|
|
10555
10724
|
require("react/jsx-runtime")
|
|
10556
10725
|
);
|
|
10557
10726
|
function StepsList({ steps, className }) {
|
|
10558
|
-
return /* @__PURE__ */ (0,
|
|
10559
|
-
/* @__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 }),
|
|
10560
10729
|
step
|
|
10561
10730
|
] }, i)) });
|
|
10562
10731
|
}
|
|
10563
10732
|
|
|
10564
10733
|
// src/components/lists/detail-item.tsx
|
|
10565
|
-
var
|
|
10566
|
-
var
|
|
10734
|
+
var import_clsx88 = __toESM(require("clsx"), 1);
|
|
10735
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
10567
10736
|
var SPAN = {
|
|
10568
10737
|
1: "",
|
|
10569
10738
|
2: "sm:col-span-2",
|
|
@@ -10580,18 +10749,18 @@ function DetailItem({
|
|
|
10580
10749
|
}) {
|
|
10581
10750
|
const shown = value === null || value === void 0 || value === "" ? "\u2014" : value;
|
|
10582
10751
|
if (layout === "inline") {
|
|
10583
|
-
return /* @__PURE__ */ (0,
|
|
10584
|
-
/* @__PURE__ */ (0,
|
|
10585
|
-
/* @__PURE__ */ (0,
|
|
10586
|
-
/* @__PURE__ */ (0,
|
|
10587
|
-
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 })
|
|
10588
10757
|
] })
|
|
10589
10758
|
] });
|
|
10590
10759
|
}
|
|
10591
|
-
return /* @__PURE__ */ (0,
|
|
10592
|
-
/* @__PURE__ */ (0,
|
|
10593
|
-
/* @__PURE__ */ (0,
|
|
10594
|
-
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 })
|
|
10595
10764
|
] });
|
|
10596
10765
|
}
|
|
10597
10766
|
var COLUMNS3 = {
|
|
@@ -10602,38 +10771,38 @@ var COLUMNS3 = {
|
|
|
10602
10771
|
4: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"
|
|
10603
10772
|
};
|
|
10604
10773
|
function DetailGrid({ children, columns = "auto", className }) {
|
|
10605
|
-
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 });
|
|
10606
10775
|
}
|
|
10607
10776
|
|
|
10608
10777
|
// src/components/lists/description-list.tsx
|
|
10609
|
-
var
|
|
10610
|
-
var
|
|
10778
|
+
var import_react71 = require("react");
|
|
10779
|
+
var import_clsx89 = __toESM(require("clsx"), 1);
|
|
10611
10780
|
var import_lucide_react30 = require("lucide-react");
|
|
10612
|
-
var
|
|
10781
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
10613
10782
|
function DescriptionList({ children, className }) {
|
|
10614
|
-
return /* @__PURE__ */ (0,
|
|
10783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("dl", { className: cn("flex flex-col gap-3", className), children });
|
|
10615
10784
|
}
|
|
10616
10785
|
function DescriptionItem({ label, value, copyValue, className }) {
|
|
10617
10786
|
const shown = value === null || value === void 0 || value === "" ? "\u2014" : value;
|
|
10618
|
-
return /* @__PURE__ */ (0,
|
|
10619
|
-
/* @__PURE__ */ (0,
|
|
10620
|
-
/* @__PURE__ */ (0,
|
|
10621
|
-
/* @__PURE__ */ (0,
|
|
10622
|
-
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()}` })
|
|
10623
10792
|
] })
|
|
10624
10793
|
] });
|
|
10625
10794
|
}
|
|
10626
10795
|
function CopyButton({ value, label, copiedLabel = "Copied", className }) {
|
|
10627
|
-
const [copied, setCopied] = (0,
|
|
10628
|
-
(0,
|
|
10796
|
+
const [copied, setCopied] = (0, import_react71.useState)(false);
|
|
10797
|
+
(0, import_react71.useEffect)(() => {
|
|
10629
10798
|
if (!copied) return;
|
|
10630
10799
|
const timer = window.setTimeout(() => setCopied(false), 2e3);
|
|
10631
10800
|
return () => window.clearTimeout(timer);
|
|
10632
10801
|
}, [copied]);
|
|
10633
10802
|
return (
|
|
10634
10803
|
// relative: keeps the sr-only status (absolutely positioned) inside a scrolling container.
|
|
10635
|
-
/* @__PURE__ */ (0,
|
|
10636
|
-
/* @__PURE__ */ (0,
|
|
10804
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: "relative inline-flex", children: [
|
|
10805
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
10637
10806
|
IconButton,
|
|
10638
10807
|
{
|
|
10639
10808
|
variant: "subtle",
|
|
@@ -10647,10 +10816,10 @@ function CopyButton({ value, label, copiedLabel = "Copied", className }) {
|
|
|
10647
10816
|
() => void 0
|
|
10648
10817
|
);
|
|
10649
10818
|
},
|
|
10650
|
-
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 })
|
|
10651
10820
|
}
|
|
10652
10821
|
),
|
|
10653
|
-
/* @__PURE__ */ (0,
|
|
10822
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { role: "status", className: "sr-only", children: copied ? copiedLabel : "" })
|
|
10654
10823
|
] })
|
|
10655
10824
|
);
|
|
10656
10825
|
}
|
|
@@ -10658,16 +10827,16 @@ function EmailText({ email, className }) {
|
|
|
10658
10827
|
const at = email.lastIndexOf("@");
|
|
10659
10828
|
const local = at > 0 ? email.slice(0, at) : email;
|
|
10660
10829
|
const domain = at > 0 ? email.slice(at) : "";
|
|
10661
|
-
return /* @__PURE__ */ (0,
|
|
10662
|
-
/* @__PURE__ */ (0,
|
|
10663
|
-
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 })
|
|
10664
10833
|
] });
|
|
10665
10834
|
}
|
|
10666
10835
|
|
|
10667
10836
|
// src/components/lists/checked-group-list.tsx
|
|
10668
|
-
var
|
|
10837
|
+
var import_clsx90 = __toESM(require("clsx"), 1);
|
|
10669
10838
|
var import_lucide_react31 = require("lucide-react");
|
|
10670
|
-
var
|
|
10839
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
10671
10840
|
var COLUMNS4 = {
|
|
10672
10841
|
1: "columns-1",
|
|
10673
10842
|
2: "columns-2",
|
|
@@ -10681,23 +10850,23 @@ function CheckedGroupList({
|
|
|
10681
10850
|
className
|
|
10682
10851
|
}) {
|
|
10683
10852
|
if (groups.length === 0) {
|
|
10684
|
-
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 });
|
|
10685
10854
|
}
|
|
10686
|
-
const glyph = icon === void 0 ? /* @__PURE__ */ (0,
|
|
10687
|
-
return /* @__PURE__ */ (0,
|
|
10688
|
-
/* @__PURE__ */ (0,
|
|
10689
|
-
/* @__PURE__ */ (0,
|
|
10690
|
-
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 }),
|
|
10691
10860
|
item
|
|
10692
10861
|
] }, item)) })
|
|
10693
10862
|
] }, group.label)) });
|
|
10694
10863
|
}
|
|
10695
10864
|
|
|
10696
10865
|
// src/components/lists/tree-view.tsx
|
|
10697
|
-
var
|
|
10698
|
-
var
|
|
10866
|
+
var import_react72 = require("react");
|
|
10867
|
+
var import_clsx91 = __toESM(require("clsx"), 1);
|
|
10699
10868
|
var import_lucide_react32 = require("lucide-react");
|
|
10700
|
-
var
|
|
10869
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
10701
10870
|
var ROW = {
|
|
10702
10871
|
sm: "min-h-8 py-1 text-body-xs",
|
|
10703
10872
|
md: "min-h-10 py-2 text-body-sm"
|
|
@@ -10727,10 +10896,10 @@ function TreeView({
|
|
|
10727
10896
|
value: selectedProp,
|
|
10728
10897
|
defaultValue: defaultSelected
|
|
10729
10898
|
});
|
|
10730
|
-
const [focusedId, setFocusedId] = (0,
|
|
10731
|
-
const rowRefs = (0,
|
|
10732
|
-
const expandedSet = (0,
|
|
10733
|
-
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)(() => {
|
|
10734
10903
|
const out = [];
|
|
10735
10904
|
const walk = (nodes, level, parentId) => {
|
|
10736
10905
|
for (const item of nodes) {
|
|
@@ -10801,7 +10970,7 @@ function TreeView({
|
|
|
10801
10970
|
if (!node) return null;
|
|
10802
10971
|
const children = getChildren?.(item) ?? [];
|
|
10803
10972
|
const isSelected = selected === id;
|
|
10804
|
-
return /* @__PURE__ */ (0,
|
|
10973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
10805
10974
|
"li",
|
|
10806
10975
|
{
|
|
10807
10976
|
role: "treeitem",
|
|
@@ -10823,7 +10992,7 @@ function TreeView({
|
|
|
10823
10992
|
},
|
|
10824
10993
|
className: "outline-none [&:focus-visible>div]:ring-2 [&:focus-visible>div]:ring-inset [&:focus-visible>div]:ring-brand",
|
|
10825
10994
|
children: [
|
|
10826
|
-
/* @__PURE__ */ (0,
|
|
10995
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
10827
10996
|
"div",
|
|
10828
10997
|
{
|
|
10829
10998
|
onClick: () => {
|
|
@@ -10831,7 +11000,7 @@ function TreeView({
|
|
|
10831
11000
|
choose(node);
|
|
10832
11001
|
},
|
|
10833
11002
|
style: { paddingLeft: 8 + (level - 1) * INDENT },
|
|
10834
|
-
className: (0,
|
|
11003
|
+
className: (0, import_clsx91.default)(
|
|
10835
11004
|
"flex w-full cursor-pointer items-center gap-1.5 rounded-md pr-2 transition-colors",
|
|
10836
11005
|
ROW[size2],
|
|
10837
11006
|
isSelected ? "bg-brand-secondary text-default" : "text-default hover:bg-default-secondary"
|
|
@@ -10841,7 +11010,7 @@ function TreeView({
|
|
|
10841
11010
|
// Not a button: the treeitem is the one tab stop, and Left/Right already toggle.
|
|
10842
11011
|
// A pointer user still needs a target that toggles without selecting.
|
|
10843
11012
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
10844
|
-
/* @__PURE__ */ (0,
|
|
11013
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
10845
11014
|
"span",
|
|
10846
11015
|
{
|
|
10847
11016
|
"aria-hidden": true,
|
|
@@ -10852,11 +11021,11 @@ function TreeView({
|
|
|
10852
11021
|
focus(id);
|
|
10853
11022
|
},
|
|
10854
11023
|
className: "flex size-5 shrink-0 items-center justify-center rounded text-icon-default-secondary hover:bg-default-tertiary",
|
|
10855
|
-
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") })
|
|
10856
11025
|
}
|
|
10857
11026
|
)
|
|
10858
|
-
) : /* @__PURE__ */ (0,
|
|
10859
|
-
/* @__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, {
|
|
10860
11029
|
level,
|
|
10861
11030
|
hasChildren: node.hasChildren,
|
|
10862
11031
|
expanded: node.expanded,
|
|
@@ -10865,38 +11034,38 @@ function TreeView({
|
|
|
10865
11034
|
]
|
|
10866
11035
|
}
|
|
10867
11036
|
),
|
|
10868
|
-
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) })
|
|
10869
11038
|
]
|
|
10870
11039
|
},
|
|
10871
11040
|
id
|
|
10872
11041
|
);
|
|
10873
11042
|
});
|
|
10874
|
-
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) });
|
|
10875
11044
|
}
|
|
10876
11045
|
|
|
10877
11046
|
// src/components/lists/table.tsx
|
|
10878
|
-
var
|
|
10879
|
-
var
|
|
11047
|
+
var import_react73 = require("react");
|
|
11048
|
+
var import_clsx92 = __toESM(require("clsx"), 1);
|
|
10880
11049
|
var import_lucide_react33 = require("lucide-react");
|
|
10881
|
-
var
|
|
10882
|
-
var Table = (0,
|
|
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) {
|
|
10883
11052
|
return (
|
|
10884
11053
|
// The scroll container is separate from the table so the header stays inside the
|
|
10885
11054
|
// scrolling region — a table that is its own scroll container cannot have a sticky
|
|
10886
11055
|
// header.
|
|
10887
11056
|
// The scroll wrapper is required for a <table>, which cannot itself scroll, so this
|
|
10888
11057
|
// takes the scrollbar styling rather than ScrollArea.
|
|
10889
|
-
/* @__PURE__ */ (0,
|
|
11058
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10890
11059
|
"div",
|
|
10891
11060
|
{
|
|
10892
|
-
className: (0,
|
|
11061
|
+
className: (0, import_clsx92.default)(
|
|
10893
11062
|
"w-full",
|
|
10894
|
-
maxHeight ? (0,
|
|
11063
|
+
maxHeight ? (0, import_clsx92.default)("overflow-auto overscroll-contain", FOCUS_RING_INSET) : "overflow-x-auto",
|
|
10895
11064
|
SCROLLBAR_CLASSES
|
|
10896
11065
|
),
|
|
10897
11066
|
style: maxHeight ? { maxHeight } : void 0,
|
|
10898
11067
|
...maxHeight ? { role: "region", tabIndex: 0, "aria-label": label ? `${label} (scrolls)` : "Table (scrolls)" } : {},
|
|
10899
|
-
children: /* @__PURE__ */ (0,
|
|
11068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10900
11069
|
"table",
|
|
10901
11070
|
{
|
|
10902
11071
|
ref,
|
|
@@ -10912,9 +11081,9 @@ var Table = (0, import_react72.forwardRef)(function Table2({ label, density = "d
|
|
|
10912
11081
|
)
|
|
10913
11082
|
);
|
|
10914
11083
|
});
|
|
10915
|
-
var TableCaption = (0,
|
|
11084
|
+
var TableCaption = (0, import_react73.forwardRef)(
|
|
10916
11085
|
function TableCaption2({ className, ...rest }, ref) {
|
|
10917
|
-
return /* @__PURE__ */ (0,
|
|
11086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10918
11087
|
"caption",
|
|
10919
11088
|
{
|
|
10920
11089
|
ref,
|
|
@@ -10924,19 +11093,19 @@ var TableCaption = (0, import_react72.forwardRef)(
|
|
|
10924
11093
|
);
|
|
10925
11094
|
}
|
|
10926
11095
|
);
|
|
10927
|
-
var TableHeader = (0,
|
|
11096
|
+
var TableHeader = (0, import_react73.forwardRef)(
|
|
10928
11097
|
function TableHeader2({ className, ...rest }, ref) {
|
|
10929
|
-
return /* @__PURE__ */ (0,
|
|
11098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("thead", { ref, className: cn("border-b border-default", className), ...rest });
|
|
10930
11099
|
}
|
|
10931
11100
|
);
|
|
10932
|
-
var TableBody = (0,
|
|
11101
|
+
var TableBody = (0, import_react73.forwardRef)(
|
|
10933
11102
|
function TableBody2({ className, ...rest }, ref) {
|
|
10934
|
-
return /* @__PURE__ */ (0,
|
|
11103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("tbody", { ref, className, ...rest });
|
|
10935
11104
|
}
|
|
10936
11105
|
);
|
|
10937
|
-
var TableFooter = (0,
|
|
11106
|
+
var TableFooter = (0, import_react73.forwardRef)(
|
|
10938
11107
|
function TableFooter2({ className, ...rest }, ref) {
|
|
10939
|
-
return /* @__PURE__ */ (0,
|
|
11108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10940
11109
|
"tfoot",
|
|
10941
11110
|
{
|
|
10942
11111
|
ref,
|
|
@@ -10946,15 +11115,15 @@ var TableFooter = (0, import_react72.forwardRef)(
|
|
|
10946
11115
|
);
|
|
10947
11116
|
}
|
|
10948
11117
|
);
|
|
10949
|
-
var ROW_TONE = (0,
|
|
11118
|
+
var ROW_TONE = (0, import_clsx92.default)(
|
|
10950
11119
|
"data-[tone=muted]:bg-default-secondary",
|
|
10951
11120
|
"data-[tone=brand]:bg-brand-tertiary",
|
|
10952
11121
|
"data-[tone=positive]:bg-positive-tertiary",
|
|
10953
11122
|
"data-[tone=warning]:bg-warning-tertiary",
|
|
10954
11123
|
"data-[tone=danger]:bg-danger-tertiary"
|
|
10955
11124
|
);
|
|
10956
|
-
var TableRow = (0,
|
|
10957
|
-
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)(
|
|
10958
11127
|
"tr",
|
|
10959
11128
|
{
|
|
10960
11129
|
ref,
|
|
@@ -10975,9 +11144,9 @@ var TableRow = (0, import_react72.forwardRef)(function TableRow2({ selected, ton
|
|
|
10975
11144
|
);
|
|
10976
11145
|
});
|
|
10977
11146
|
var ALIGN4 = { left: "text-left", center: "text-center", right: "text-right" };
|
|
10978
|
-
var TableHead = (0,
|
|
11147
|
+
var TableHead = (0, import_react73.forwardRef)(function TableHead2({ sort, onSort, align = "left", sticky = false, className, children, ...rest }, ref) {
|
|
10979
11148
|
const sortable = sort !== void 0 && onSort !== void 0;
|
|
10980
|
-
return /* @__PURE__ */ (0,
|
|
11149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10981
11150
|
"th",
|
|
10982
11151
|
{
|
|
10983
11152
|
ref,
|
|
@@ -10990,27 +11159,27 @@ var TableHead = (0, import_react72.forwardRef)(function TableHead2({ sort, onSor
|
|
|
10990
11159
|
className
|
|
10991
11160
|
),
|
|
10992
11161
|
...rest,
|
|
10993
|
-
children: sortable ? /* @__PURE__ */ (0,
|
|
11162
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
|
|
10994
11163
|
"button",
|
|
10995
11164
|
{
|
|
10996
11165
|
type: "button",
|
|
10997
11166
|
onClick: onSort,
|
|
10998
|
-
className: (0,
|
|
11167
|
+
className: (0, import_clsx92.default)(
|
|
10999
11168
|
"inline-flex items-center gap-1.5 rounded transition-colors hover:text-default",
|
|
11000
11169
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default"
|
|
11001
11170
|
),
|
|
11002
11171
|
children: [
|
|
11003
11172
|
children,
|
|
11004
|
-
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" })
|
|
11005
11174
|
]
|
|
11006
11175
|
}
|
|
11007
11176
|
) : children
|
|
11008
11177
|
}
|
|
11009
11178
|
);
|
|
11010
11179
|
});
|
|
11011
|
-
var TableCell = (0,
|
|
11180
|
+
var TableCell = (0, import_react73.forwardRef)(function TableCell2({ align = "left", density = "default", header = false, className, ...rest }, ref) {
|
|
11012
11181
|
const Tag = header ? "th" : "td";
|
|
11013
|
-
return /* @__PURE__ */ (0,
|
|
11182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
11014
11183
|
Tag,
|
|
11015
11184
|
{
|
|
11016
11185
|
ref,
|
|
@@ -11028,13 +11197,13 @@ var TableCell = (0, import_react72.forwardRef)(function TableCell2({ align = "le
|
|
|
11028
11197
|
});
|
|
11029
11198
|
|
|
11030
11199
|
// src/components/lists/data-table.tsx
|
|
11031
|
-
var
|
|
11032
|
-
var
|
|
11200
|
+
var import_react75 = require("react");
|
|
11201
|
+
var import_clsx96 = __toESM(require("clsx"), 1);
|
|
11033
11202
|
var import_react_table = require("@tanstack/react-table");
|
|
11034
11203
|
|
|
11035
11204
|
// src/components/feedback/empty-state.tsx
|
|
11036
|
-
var
|
|
11037
|
-
var
|
|
11205
|
+
var import_clsx93 = __toESM(require("clsx"), 1);
|
|
11206
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
11038
11207
|
var SIZES = {
|
|
11039
11208
|
sm: "py-8",
|
|
11040
11209
|
md: "py-12",
|
|
@@ -11053,11 +11222,11 @@ function EmptyState({
|
|
|
11053
11222
|
action,
|
|
11054
11223
|
className
|
|
11055
11224
|
}) {
|
|
11056
|
-
return /* @__PURE__ */ (0,
|
|
11225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
11057
11226
|
"div",
|
|
11058
11227
|
{
|
|
11059
11228
|
"data-variant": variant,
|
|
11060
|
-
className: (0,
|
|
11229
|
+
className: (0, import_clsx93.default)(
|
|
11061
11230
|
"flex flex-col items-center justify-center gap-2 px-4 text-center text-body-sm",
|
|
11062
11231
|
SIZES[size2],
|
|
11063
11232
|
TONES[variant],
|
|
@@ -11065,8 +11234,8 @@ function EmptyState({
|
|
|
11065
11234
|
),
|
|
11066
11235
|
"aria-live": variant === "empty" ? void 0 : "polite",
|
|
11067
11236
|
children: [
|
|
11068
|
-
icon && /* @__PURE__ */ (0,
|
|
11069
|
-
/* @__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 }),
|
|
11070
11239
|
action
|
|
11071
11240
|
]
|
|
11072
11241
|
}
|
|
@@ -11074,20 +11243,20 @@ function EmptyState({
|
|
|
11074
11243
|
}
|
|
11075
11244
|
|
|
11076
11245
|
// src/components/feedback/skeleton.tsx
|
|
11077
|
-
var
|
|
11078
|
-
var
|
|
11079
|
-
var
|
|
11246
|
+
var import_react74 = require("react");
|
|
11247
|
+
var import_clsx94 = __toESM(require("clsx"), 1);
|
|
11248
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
11080
11249
|
var SHAPE2 = {
|
|
11081
11250
|
line: "h-4 rounded",
|
|
11082
11251
|
block: "h-full w-full rounded-lg",
|
|
11083
11252
|
circle: "aspect-square rounded-full"
|
|
11084
11253
|
};
|
|
11085
|
-
var Skeleton = (0,
|
|
11254
|
+
var Skeleton = (0, import_react74.forwardRef)(function Skeleton2({ shape = "line", lines = 1, className, ...rest }, ref) {
|
|
11086
11255
|
if (shape === "line" && lines > 1) {
|
|
11087
|
-
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)(
|
|
11088
11257
|
"div",
|
|
11089
11258
|
{
|
|
11090
|
-
className: (0,
|
|
11259
|
+
className: (0, import_clsx94.default)(
|
|
11091
11260
|
"motion-safe:animate-pulse bg-default-tertiary",
|
|
11092
11261
|
SHAPE2.line,
|
|
11093
11262
|
// A ragged last line reads as a paragraph rather than a solid slab.
|
|
@@ -11098,13 +11267,13 @@ var Skeleton = (0, import_react73.forwardRef)(function Skeleton2({ shape = "line
|
|
|
11098
11267
|
index
|
|
11099
11268
|
)) });
|
|
11100
11269
|
}
|
|
11101
|
-
return /* @__PURE__ */ (0,
|
|
11270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
11102
11271
|
"div",
|
|
11103
11272
|
{
|
|
11104
11273
|
ref,
|
|
11105
11274
|
"aria-hidden": true,
|
|
11106
11275
|
"data-slot": "skeleton",
|
|
11107
|
-
className: (0,
|
|
11276
|
+
className: (0, import_clsx94.default)("motion-safe:animate-pulse bg-default-tertiary", SHAPE2[shape], className),
|
|
11108
11277
|
...rest
|
|
11109
11278
|
}
|
|
11110
11279
|
);
|
|
@@ -11140,7 +11309,7 @@ function cardSlots(columns) {
|
|
|
11140
11309
|
|
|
11141
11310
|
// src/components/lists/data-table-parts.tsx
|
|
11142
11311
|
var import_lucide_react34 = require("lucide-react");
|
|
11143
|
-
var
|
|
11312
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
11144
11313
|
var SELECT_COLUMN_ID = "select";
|
|
11145
11314
|
function columnLabel(column) {
|
|
11146
11315
|
const meta = column.columnDef.meta;
|
|
@@ -11156,11 +11325,11 @@ function DataTableColumnHeader({
|
|
|
11156
11325
|
const text = title ?? columnLabel(column);
|
|
11157
11326
|
const hidden = column.columnDef.meta?.hideHeader;
|
|
11158
11327
|
if (!column.getCanSort()) {
|
|
11159
|
-
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 });
|
|
11160
11329
|
}
|
|
11161
11330
|
const sorted = column.getIsSorted();
|
|
11162
11331
|
const Icon = sorted === "asc" ? import_lucide_react34.ChevronUpIcon : sorted === "desc" ? import_lucide_react34.ChevronDownIcon : import_lucide_react34.ChevronsUpDownIcon;
|
|
11163
|
-
return /* @__PURE__ */ (0,
|
|
11332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
11164
11333
|
"button",
|
|
11165
11334
|
{
|
|
11166
11335
|
type: "button",
|
|
@@ -11174,8 +11343,8 @@ function DataTableColumnHeader({
|
|
|
11174
11343
|
className
|
|
11175
11344
|
),
|
|
11176
11345
|
children: [
|
|
11177
|
-
/* @__PURE__ */ (0,
|
|
11178
|
-
/* @__PURE__ */ (0,
|
|
11346
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: cn(hidden && "sr-only"), children: text }),
|
|
11347
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11179
11348
|
Icon,
|
|
11180
11349
|
{
|
|
11181
11350
|
"aria-hidden": true,
|
|
@@ -11191,7 +11360,7 @@ function createSelectColumn(options = {}) {
|
|
|
11191
11360
|
const { getRowLabel, selectAllLabel = "Select all rows on this page" } = options;
|
|
11192
11361
|
return {
|
|
11193
11362
|
id: SELECT_COLUMN_ID,
|
|
11194
|
-
header: ({ table }) => /* @__PURE__ */ (0,
|
|
11363
|
+
header: ({ table }) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11195
11364
|
Checkbox,
|
|
11196
11365
|
{
|
|
11197
11366
|
"aria-label": selectAllLabel,
|
|
@@ -11200,7 +11369,7 @@ function createSelectColumn(options = {}) {
|
|
|
11200
11369
|
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(checked)
|
|
11201
11370
|
}
|
|
11202
11371
|
),
|
|
11203
|
-
cell: ({ row }) => /* @__PURE__ */ (0,
|
|
11372
|
+
cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11204
11373
|
Checkbox,
|
|
11205
11374
|
{
|
|
11206
11375
|
"aria-label": getRowLabel ? getRowLabel(row.original) : "Select row",
|
|
@@ -11218,11 +11387,11 @@ function createSelectColumn(options = {}) {
|
|
|
11218
11387
|
function DataTableViewOptions({ table, label = "Columns" }) {
|
|
11219
11388
|
const columns = table.getAllLeafColumns().filter((column) => column.getCanHide());
|
|
11220
11389
|
if (columns.length === 0) return null;
|
|
11221
|
-
return /* @__PURE__ */ (0,
|
|
11222
|
-
/* @__PURE__ */ (0,
|
|
11223
|
-
/* @__PURE__ */ (0,
|
|
11224
|
-
/* @__PURE__ */ (0,
|
|
11225
|
-
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)(
|
|
11226
11395
|
DropdownMenuCheckboxItem,
|
|
11227
11396
|
{
|
|
11228
11397
|
checked: column.getIsVisible(),
|
|
@@ -11240,7 +11409,7 @@ function DataTablePagination({
|
|
|
11240
11409
|
summary
|
|
11241
11410
|
}) {
|
|
11242
11411
|
const { pageIndex, pageSize } = table.getState().pagination;
|
|
11243
|
-
return /* @__PURE__ */ (0,
|
|
11412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11244
11413
|
PaginationBar,
|
|
11245
11414
|
{
|
|
11246
11415
|
page: pageIndex + 1,
|
|
@@ -11256,8 +11425,8 @@ function DataTablePagination({
|
|
|
11256
11425
|
}
|
|
11257
11426
|
|
|
11258
11427
|
// src/components/lists/data-table-cells.tsx
|
|
11259
|
-
var
|
|
11260
|
-
var
|
|
11428
|
+
var import_clsx95 = __toESM(require("clsx"), 1);
|
|
11429
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
11261
11430
|
function textFromNode(node) {
|
|
11262
11431
|
if (typeof node === "string") return node;
|
|
11263
11432
|
if (typeof node === "number") return String(node);
|
|
@@ -11268,23 +11437,23 @@ function textFromNode(node) {
|
|
|
11268
11437
|
return void 0;
|
|
11269
11438
|
}
|
|
11270
11439
|
function TableCellLeadText({ primary, secondary, size: size2 = "md", className }) {
|
|
11271
|
-
return /* @__PURE__ */ (0,
|
|
11272
|
-
/* @__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)(
|
|
11273
11442
|
"span",
|
|
11274
11443
|
{
|
|
11275
11444
|
title: primary,
|
|
11276
|
-
className: (0,
|
|
11445
|
+
className: (0, import_clsx95.default)(
|
|
11277
11446
|
"block truncate font-medium leading-snug text-default",
|
|
11278
11447
|
size2 === "sm" ? "text-body-xs" : "text-body-sm"
|
|
11279
11448
|
),
|
|
11280
11449
|
children: primary
|
|
11281
11450
|
}
|
|
11282
11451
|
),
|
|
11283
|
-
secondary && (typeof secondary === "string" || typeof secondary === "number" ? /* @__PURE__ */ (0,
|
|
11452
|
+
secondary && (typeof secondary === "string" || typeof secondary === "number" ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11284
11453
|
"span",
|
|
11285
11454
|
{
|
|
11286
11455
|
title: String(secondary),
|
|
11287
|
-
className: (0,
|
|
11456
|
+
className: (0, import_clsx95.default)(
|
|
11288
11457
|
"block truncate font-normal leading-tight text-default-secondary",
|
|
11289
11458
|
size2 === "sm" ? "text-body-tiny" : "text-body-xs"
|
|
11290
11459
|
),
|
|
@@ -11293,10 +11462,10 @@ function TableCellLeadText({ primary, secondary, size: size2 = "md", className }
|
|
|
11293
11462
|
) : (
|
|
11294
11463
|
// An element brings its own overflow handling, so it gets no `truncate` here,
|
|
11295
11464
|
// which a card layout's touch un-truncation would otherwise turn into wrapping.
|
|
11296
|
-
/* @__PURE__ */ (0,
|
|
11465
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11297
11466
|
"span",
|
|
11298
11467
|
{
|
|
11299
|
-
className: (0,
|
|
11468
|
+
className: (0, import_clsx95.default)(
|
|
11300
11469
|
"block min-w-0 font-normal leading-tight text-default-secondary",
|
|
11301
11470
|
size2 === "sm" ? "text-body-tiny" : "text-body-xs"
|
|
11302
11471
|
),
|
|
@@ -11313,11 +11482,11 @@ function TableCellText({
|
|
|
11313
11482
|
truncate = true,
|
|
11314
11483
|
className
|
|
11315
11484
|
}) {
|
|
11316
|
-
return /* @__PURE__ */ (0,
|
|
11485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11317
11486
|
"span",
|
|
11318
11487
|
{
|
|
11319
11488
|
title: truncate ? textFromNode(children) : void 0,
|
|
11320
|
-
className: (0,
|
|
11489
|
+
className: (0, import_clsx95.default)(
|
|
11321
11490
|
"font-normal leading-snug",
|
|
11322
11491
|
size2 === "sm" ? "text-body-tiny" : "text-body-xs",
|
|
11323
11492
|
truncate ? "block min-w-0 truncate" : "whitespace-nowrap",
|
|
@@ -11329,15 +11498,15 @@ function TableCellText({
|
|
|
11329
11498
|
);
|
|
11330
11499
|
}
|
|
11331
11500
|
function TableCellBadge({ label, className }) {
|
|
11332
|
-
return /* @__PURE__ */ (0,
|
|
11501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11333
11502
|
"span",
|
|
11334
11503
|
{
|
|
11335
11504
|
title: label,
|
|
11336
|
-
className: (0,
|
|
11505
|
+
className: (0, import_clsx95.default)(
|
|
11337
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",
|
|
11338
11507
|
className
|
|
11339
11508
|
),
|
|
11340
|
-
children: /* @__PURE__ */ (0,
|
|
11509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "truncate", children: label })
|
|
11341
11510
|
}
|
|
11342
11511
|
);
|
|
11343
11512
|
}
|
|
@@ -11349,8 +11518,8 @@ function TableCellProgress({
|
|
|
11349
11518
|
className
|
|
11350
11519
|
}) {
|
|
11351
11520
|
const clamped = Math.round(Math.min(100, Math.max(0, percent)));
|
|
11352
|
-
return /* @__PURE__ */ (0,
|
|
11353
|
-
/* @__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)(
|
|
11354
11523
|
ProgressBar,
|
|
11355
11524
|
{
|
|
11356
11525
|
value: clamped,
|
|
@@ -11360,7 +11529,7 @@ function TableCellProgress({
|
|
|
11360
11529
|
"aria-label": label ?? `${clamped}%`
|
|
11361
11530
|
}
|
|
11362
11531
|
),
|
|
11363
|
-
/* @__PURE__ */ (0,
|
|
11532
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("span", { className: "shrink-0 text-body-tiny leading-none tabular-nums text-default-secondary", children: [
|
|
11364
11533
|
clamped,
|
|
11365
11534
|
"%"
|
|
11366
11535
|
] })
|
|
@@ -11368,7 +11537,7 @@ function TableCellProgress({
|
|
|
11368
11537
|
}
|
|
11369
11538
|
|
|
11370
11539
|
// src/components/lists/data-table.tsx
|
|
11371
|
-
var
|
|
11540
|
+
var import_jsx_runtime119 = (
|
|
11372
11541
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
11373
11542
|
require("react/jsx-runtime")
|
|
11374
11543
|
);
|
|
@@ -11398,14 +11567,14 @@ function resolve(updater, previous) {
|
|
|
11398
11567
|
return typeof updater === "function" ? updater(previous) : updater;
|
|
11399
11568
|
}
|
|
11400
11569
|
function useTableState(controlled, initial, onChange) {
|
|
11401
|
-
const [inner, setInner] = (0,
|
|
11570
|
+
const [inner, setInner] = (0, import_react75.useState)(initial);
|
|
11402
11571
|
const value = controlled ?? inner;
|
|
11403
|
-
const latest = (0,
|
|
11572
|
+
const latest = (0, import_react75.useRef)(value);
|
|
11404
11573
|
latest.current = value;
|
|
11405
11574
|
const isControlled = controlled !== void 0;
|
|
11406
|
-
const onChangeRef = (0,
|
|
11575
|
+
const onChangeRef = (0, import_react75.useRef)(onChange);
|
|
11407
11576
|
onChangeRef.current = onChange;
|
|
11408
|
-
const set = (0,
|
|
11577
|
+
const set = (0, import_react75.useCallback)(
|
|
11409
11578
|
(updater) => {
|
|
11410
11579
|
const next = resolve(updater, latest.current);
|
|
11411
11580
|
if (!isControlled) setInner(next);
|
|
@@ -11416,7 +11585,7 @@ function useTableState(controlled, initial, onChange) {
|
|
|
11416
11585
|
return [value, set];
|
|
11417
11586
|
}
|
|
11418
11587
|
function CellInteractionGuard({ children }) {
|
|
11419
|
-
return /* @__PURE__ */ (0,
|
|
11588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11420
11589
|
"div",
|
|
11421
11590
|
{
|
|
11422
11591
|
className: "contents",
|
|
@@ -11429,9 +11598,9 @@ function CellInteractionGuard({ children }) {
|
|
|
11429
11598
|
}
|
|
11430
11599
|
var HEADER_PADDING_PX = { default: 32, compact: 24 };
|
|
11431
11600
|
function useHeaderWidths(padding2, deps) {
|
|
11432
|
-
const nodes = (0,
|
|
11433
|
-
const [widths, setWidths] = (0,
|
|
11434
|
-
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)(() => {
|
|
11435
11604
|
const next = {};
|
|
11436
11605
|
nodes.current.forEach((node, id) => {
|
|
11437
11606
|
next[id] = Math.ceil(node.getBoundingClientRect().width) + padding2;
|
|
@@ -11442,15 +11611,15 @@ function useHeaderWidths(padding2, deps) {
|
|
|
11442
11611
|
return same ? previous : next;
|
|
11443
11612
|
});
|
|
11444
11613
|
}, [padding2]);
|
|
11445
|
-
(0,
|
|
11446
|
-
(0,
|
|
11614
|
+
(0, import_react75.useLayoutEffect)(measure, [measure, deps]);
|
|
11615
|
+
(0, import_react75.useLayoutEffect)(() => {
|
|
11447
11616
|
let live = true;
|
|
11448
11617
|
void document.fonts?.ready.then(() => live && measure());
|
|
11449
11618
|
return () => {
|
|
11450
11619
|
live = false;
|
|
11451
11620
|
};
|
|
11452
11621
|
}, [measure]);
|
|
11453
|
-
const register = (0,
|
|
11622
|
+
const register = (0, import_react75.useCallback)(
|
|
11454
11623
|
(id) => (node) => {
|
|
11455
11624
|
if (node) nodes.current.set(id, node);
|
|
11456
11625
|
else nodes.current.delete(id);
|
|
@@ -11460,9 +11629,9 @@ function useHeaderWidths(padding2, deps) {
|
|
|
11460
11629
|
return { widths, register };
|
|
11461
11630
|
}
|
|
11462
11631
|
function useScrollEdges() {
|
|
11463
|
-
const [node, setNode] = (0,
|
|
11464
|
-
const [edges, setEdges] = (0,
|
|
11465
|
-
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)(() => {
|
|
11466
11635
|
if (!node) return;
|
|
11467
11636
|
const { scrollLeft, scrollWidth, clientWidth, scrollTop, scrollHeight, clientHeight } = node;
|
|
11468
11637
|
const next = {
|
|
@@ -11476,7 +11645,7 @@ function useScrollEdges() {
|
|
|
11476
11645
|
(previous) => previous.overflowing === next.overflowing && previous.atStart === next.atStart && previous.atEnd === next.atEnd && previous.overflowingY === next.overflowingY && previous.atTop === next.atTop ? previous : next
|
|
11477
11646
|
);
|
|
11478
11647
|
}, [node]);
|
|
11479
|
-
(0,
|
|
11648
|
+
(0, import_react75.useLayoutEffect)(() => {
|
|
11480
11649
|
if (!node) return;
|
|
11481
11650
|
measure();
|
|
11482
11651
|
if (typeof ResizeObserver === "undefined") return;
|
|
@@ -11489,7 +11658,7 @@ function useScrollEdges() {
|
|
|
11489
11658
|
}
|
|
11490
11659
|
var serverSortedValue = () => void 0;
|
|
11491
11660
|
function defaultRowLink({ children, ...props }) {
|
|
11492
|
-
return /* @__PURE__ */ (0,
|
|
11661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("a", { ...props, children });
|
|
11493
11662
|
}
|
|
11494
11663
|
function DataTable({
|
|
11495
11664
|
columns,
|
|
@@ -11530,6 +11699,7 @@ function DataTable({
|
|
|
11530
11699
|
onColumnVisibilityChange,
|
|
11531
11700
|
onRowSelectionChange,
|
|
11532
11701
|
tableOptions,
|
|
11702
|
+
bordered = true,
|
|
11533
11703
|
className
|
|
11534
11704
|
}) {
|
|
11535
11705
|
if (!label && !caption) {
|
|
@@ -11552,7 +11722,7 @@ function DataTable({
|
|
|
11552
11722
|
onColumnVisibilityChange
|
|
11553
11723
|
);
|
|
11554
11724
|
const [rowSelection, setRowSelection] = useTableState(state.rowSelection, {}, onRowSelectionChange);
|
|
11555
|
-
const allColumns = (0,
|
|
11725
|
+
const allColumns = (0, import_react75.useMemo)(() => {
|
|
11556
11726
|
let cols = columns;
|
|
11557
11727
|
if (manual.sorting) {
|
|
11558
11728
|
cols = cols.map(
|
|
@@ -11588,8 +11758,8 @@ function DataTable({
|
|
|
11588
11758
|
enableSortingRemoval: false,
|
|
11589
11759
|
...tableOptions
|
|
11590
11760
|
});
|
|
11591
|
-
const selectionReported = (0,
|
|
11592
|
-
(0,
|
|
11761
|
+
const selectionReported = (0, import_react75.useRef)(false);
|
|
11762
|
+
(0, import_react75.useEffect)(() => {
|
|
11593
11763
|
if (!onSelectionChange) return;
|
|
11594
11764
|
if (!selectionReported.current) {
|
|
11595
11765
|
selectionReported.current = true;
|
|
@@ -11598,8 +11768,9 @@ function DataTable({
|
|
|
11598
11768
|
onSelectionChange(table.getSelectedRowModel().rows.map((row) => row.original));
|
|
11599
11769
|
}, [rowSelection]);
|
|
11600
11770
|
const [wrapRef, containerWidth] = useElementWidth();
|
|
11771
|
+
const captionId = (0, import_react75.useId)();
|
|
11601
11772
|
const breakpoint = responsive === false ? 0 : typeof responsive === "object" ? responsive.breakpoint ?? DEFAULT_CARD_BREAKPOINT_PX : DEFAULT_CARD_BREAKPOINT_PX;
|
|
11602
|
-
const modeRef = (0,
|
|
11773
|
+
const modeRef = (0, import_react75.useRef)("table");
|
|
11603
11774
|
const mode = nextLayoutMode(modeRef.current, containerWidth, breakpoint);
|
|
11604
11775
|
modeRef.current = mode;
|
|
11605
11776
|
const search = searchable === true ? {} : searchable || void 0;
|
|
@@ -11612,16 +11783,16 @@ function DataTable({
|
|
|
11612
11783
|
const filtering = Boolean(globalFilter) || columnFilters.length > 0;
|
|
11613
11784
|
const rows = table.getRowModel().rows;
|
|
11614
11785
|
const isEmpty = !loading && !error && rows.length === 0;
|
|
11615
|
-
const placeholder = error ? /* @__PURE__ */ (0,
|
|
11786
|
+
const placeholder = error ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11616
11787
|
EmptyState,
|
|
11617
11788
|
{
|
|
11618
11789
|
message: typeof error === "string" ? error : "Something went wrong loading this data.",
|
|
11619
11790
|
variant: "error",
|
|
11620
11791
|
size: "md",
|
|
11621
|
-
action: onRetry ? /* @__PURE__ */ (0,
|
|
11792
|
+
action: onRetry ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "neutral", size: "sm", onClick: onRetry, children: "Retry" }) : void 0,
|
|
11622
11793
|
className: "mx-auto max-w-[520px]"
|
|
11623
11794
|
}
|
|
11624
|
-
) : 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;
|
|
11625
11796
|
const resultCount = manual.filtering ? table.getRowCount() : table.getFilteredRowModel().rows.length;
|
|
11626
11797
|
const showToolbar = Boolean(search || toolbar || showColumnMenu);
|
|
11627
11798
|
const showPager = paginated && !error && table.getRowCount() > 0;
|
|
@@ -11629,6 +11800,7 @@ function DataTable({
|
|
|
11629
11800
|
table,
|
|
11630
11801
|
label,
|
|
11631
11802
|
caption,
|
|
11803
|
+
captionId,
|
|
11632
11804
|
density,
|
|
11633
11805
|
align,
|
|
11634
11806
|
loading,
|
|
@@ -11642,9 +11814,9 @@ function DataTable({
|
|
|
11642
11814
|
getRowLabel,
|
|
11643
11815
|
maxHeight
|
|
11644
11816
|
};
|
|
11645
|
-
return /* @__PURE__ */ (0,
|
|
11646
|
-
showToolbar && /* @__PURE__ */ (0,
|
|
11647
|
-
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)(
|
|
11648
11820
|
SearchInput,
|
|
11649
11821
|
{
|
|
11650
11822
|
size: "md",
|
|
@@ -11657,13 +11829,14 @@ function DataTable({
|
|
|
11657
11829
|
}
|
|
11658
11830
|
),
|
|
11659
11831
|
toolbar,
|
|
11660
|
-
showColumnMenu && /* @__PURE__ */ (0,
|
|
11832
|
+
showColumnMenu && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "ml-auto", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(DataTableViewOptions, { table }) })
|
|
11661
11833
|
] }),
|
|
11662
|
-
/* @__PURE__ */ (0,
|
|
11663
|
-
/* @__PURE__ */ (0,
|
|
11664
|
-
mode === "cards"
|
|
11665
|
-
|
|
11666
|
-
|
|
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 })
|
|
11667
11840
|
] })
|
|
11668
11841
|
] });
|
|
11669
11842
|
}
|
|
@@ -11701,7 +11874,7 @@ function TableView({
|
|
|
11701
11874
|
const hasSticky = Boolean(stickyStart || stickyEnd);
|
|
11702
11875
|
const titleId = titleColumnId(columns);
|
|
11703
11876
|
const rowAction = getRowHref ? "link" : onRowClick ? "click" : null;
|
|
11704
|
-
const stickyClass = (id, header) => (0,
|
|
11877
|
+
const stickyClass = (id, header) => (0, import_clsx96.default)(
|
|
11705
11878
|
id === stickyStart && [
|
|
11706
11879
|
"sticky left-0 z-raised",
|
|
11707
11880
|
// A hairline where content slides under the pinned column, once it has scrolled.
|
|
@@ -11716,9 +11889,9 @@ function TableView({
|
|
|
11716
11889
|
const scrolls = scroll.overflowing || Boolean(maxHeight) && scroll.overflowingY;
|
|
11717
11890
|
const direction = scroll.overflowing && maxHeight && scroll.overflowingY ? "scrolls" : scroll.overflowing ? "scrolls horizontally" : "scrolls vertically";
|
|
11718
11891
|
const regionLabel = `${label ?? "Table"} (${direction})`;
|
|
11719
|
-
const pinnedHeader = maxHeight ? (0,
|
|
11720
|
-
return /* @__PURE__ */ (0,
|
|
11721
|
-
/* @__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)(
|
|
11722
11895
|
"div",
|
|
11723
11896
|
{
|
|
11724
11897
|
ref: scroll.ref,
|
|
@@ -11730,18 +11903,18 @@ function TableView({
|
|
|
11730
11903
|
),
|
|
11731
11904
|
style: maxHeight ? { maxHeight } : void 0,
|
|
11732
11905
|
...scrolls ? { role: "region", tabIndex: 0, "aria-label": regionLabel } : {},
|
|
11733
|
-
children: /* @__PURE__ */ (0,
|
|
11906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
11734
11907
|
"table",
|
|
11735
11908
|
{
|
|
11736
11909
|
className: "w-full table-fixed border-collapse text-left",
|
|
11737
11910
|
style: showPlaceholder ? void 0 : { minWidth },
|
|
11738
11911
|
"aria-busy": loading || void 0,
|
|
11739
11912
|
children: [
|
|
11740
|
-
caption ? /* @__PURE__ */ (0,
|
|
11741
|
-
/* @__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) => {
|
|
11742
11915
|
const meta = column.columnDef.meta;
|
|
11743
11916
|
const floor = headers.widths[column.id] ?? 0;
|
|
11744
|
-
return /* @__PURE__ */ (0,
|
|
11917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11745
11918
|
"col",
|
|
11746
11919
|
{
|
|
11747
11920
|
style: meta?.grow || !meta?.width ? void 0 : { width: floor > widthToPx(meta.width) ? floor : meta.width }
|
|
@@ -11749,12 +11922,12 @@ function TableView({
|
|
|
11749
11922
|
column.id
|
|
11750
11923
|
);
|
|
11751
11924
|
}) }),
|
|
11752
|
-
/* @__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) => {
|
|
11753
11926
|
const meta = header.column.columnDef.meta;
|
|
11754
11927
|
const sortable = header.column.getCanSort();
|
|
11755
11928
|
const sorted = header.column.getIsSorted();
|
|
11756
11929
|
const definition = header.column.columnDef.header;
|
|
11757
|
-
return /* @__PURE__ */ (0,
|
|
11930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11758
11931
|
"th",
|
|
11759
11932
|
{
|
|
11760
11933
|
scope: "col",
|
|
@@ -11769,12 +11942,12 @@ function TableView({
|
|
|
11769
11942
|
pinnedHeader,
|
|
11770
11943
|
meta?.headerClassName
|
|
11771
11944
|
),
|
|
11772
|
-
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())
|
|
11773
11946
|
},
|
|
11774
11947
|
header.id
|
|
11775
11948
|
);
|
|
11776
11949
|
}) }, group.id)) }),
|
|
11777
|
-
/* @__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)(
|
|
11778
11951
|
BodyRow,
|
|
11779
11952
|
{
|
|
11780
11953
|
row,
|
|
@@ -11797,8 +11970,8 @@ function TableView({
|
|
|
11797
11970
|
)
|
|
11798
11971
|
}
|
|
11799
11972
|
),
|
|
11800
|
-
scroll.overflowing && !scroll.atStart && !stickyStart && /* @__PURE__ */ (0,
|
|
11801
|
-
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" })
|
|
11802
11975
|
] });
|
|
11803
11976
|
}
|
|
11804
11977
|
function BodyRow({
|
|
@@ -11817,7 +11990,7 @@ function BodyRow({
|
|
|
11817
11990
|
}) {
|
|
11818
11991
|
const d = DENSITY2[density];
|
|
11819
11992
|
const href = getRowHref?.(row.original);
|
|
11820
|
-
return /* @__PURE__ */ (0,
|
|
11993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11821
11994
|
TableRow,
|
|
11822
11995
|
{
|
|
11823
11996
|
selected: row.getIsSelected() || void 0,
|
|
@@ -11842,7 +12015,7 @@ function BodyRow({
|
|
|
11842
12015
|
onRowClick(row.original);
|
|
11843
12016
|
}
|
|
11844
12017
|
} : void 0,
|
|
11845
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
12018
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11846
12019
|
BodyCell,
|
|
11847
12020
|
{
|
|
11848
12021
|
cell,
|
|
@@ -11871,7 +12044,7 @@ function BodyCell({
|
|
|
11871
12044
|
children: content
|
|
11872
12045
|
}, cell.row.original);
|
|
11873
12046
|
}
|
|
11874
|
-
return /* @__PURE__ */ (0,
|
|
12047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11875
12048
|
"td",
|
|
11876
12049
|
{
|
|
11877
12050
|
className: cn(
|
|
@@ -11882,13 +12055,13 @@ function BodyCell({
|
|
|
11882
12055
|
!meta?.interactive && "overflow-hidden",
|
|
11883
12056
|
meta?.cellClassName
|
|
11884
12057
|
),
|
|
11885
|
-
children: meta?.interactive ? /* @__PURE__ */ (0,
|
|
12058
|
+
children: meta?.interactive ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CellInteractionGuard, { children: content }) : content
|
|
11886
12059
|
}
|
|
11887
12060
|
);
|
|
11888
12061
|
}
|
|
11889
12062
|
function CardScroll({ label, maxHeight, children }) {
|
|
11890
12063
|
const scroll = useScrollEdges();
|
|
11891
|
-
return /* @__PURE__ */ (0,
|
|
12064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11892
12065
|
"div",
|
|
11893
12066
|
{
|
|
11894
12067
|
ref: scroll.ref,
|
|
@@ -11903,6 +12076,8 @@ function CardScroll({ label, maxHeight, children }) {
|
|
|
11903
12076
|
function CardList({
|
|
11904
12077
|
table,
|
|
11905
12078
|
label,
|
|
12079
|
+
caption,
|
|
12080
|
+
captionId,
|
|
11906
12081
|
loading,
|
|
11907
12082
|
loadingRows,
|
|
11908
12083
|
placeholder,
|
|
@@ -11913,12 +12088,12 @@ function CardList({
|
|
|
11913
12088
|
getRowDimmed,
|
|
11914
12089
|
getRowLabel
|
|
11915
12090
|
}) {
|
|
11916
|
-
if (placeholder) return /* @__PURE__ */ (0,
|
|
12091
|
+
if (placeholder) return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "px-4", children: placeholder });
|
|
11917
12092
|
if (loading) {
|
|
11918
|
-
return /* @__PURE__ */ (0,
|
|
11919
|
-
/* @__PURE__ */ (0,
|
|
11920
|
-
/* @__PURE__ */ (0,
|
|
11921
|
-
/* @__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" })
|
|
11922
12097
|
] }, index)) });
|
|
11923
12098
|
}
|
|
11924
12099
|
const columns = table.getVisibleLeafColumns();
|
|
@@ -11926,7 +12101,7 @@ function CardList({
|
|
|
11926
12101
|
const slots = cardSlots(
|
|
11927
12102
|
columns.filter((column) => column.id !== SELECT_COLUMN_ID).map((column) => ({ id: column.id, mobile: column.columnDef.meta?.mobile, column }))
|
|
11928
12103
|
);
|
|
11929
|
-
const trigger = (0,
|
|
12104
|
+
const trigger = (0, import_clsx96.default)(
|
|
11930
12105
|
"block w-full min-w-0 text-left focus-visible:outline-none",
|
|
11931
12106
|
"after:absolute after:inset-0 after:content-['']",
|
|
11932
12107
|
"focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-brand"
|
|
@@ -11934,10 +12109,11 @@ function CardList({
|
|
|
11934
12109
|
return (
|
|
11935
12110
|
// Card mode un-truncates: on touch there is no hover tooltip, so a clipped value would be
|
|
11936
12111
|
// unreadable. `.truncate` cell renderers wrap here instead.
|
|
11937
|
-
/* @__PURE__ */ (0,
|
|
12112
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11938
12113
|
"ul",
|
|
11939
12114
|
{
|
|
11940
12115
|
"aria-label": label,
|
|
12116
|
+
"aria-labelledby": !label && caption ? captionId : void 0,
|
|
11941
12117
|
className: "divide-y divide-default [&_.truncate]:whitespace-normal [&_.truncate]:[overflow-wrap:anywhere]",
|
|
11942
12118
|
children: table.getRowModel().rows.map((row) => {
|
|
11943
12119
|
const cells = new Map(row.getVisibleCells().map((cell) => [cell.column.id, cell]));
|
|
@@ -11948,7 +12124,7 @@ function CardList({
|
|
|
11948
12124
|
const href = getRowHref?.(row.original);
|
|
11949
12125
|
const titleContent = render(slots.title?.id);
|
|
11950
12126
|
const tone = getRowTone?.(row.original);
|
|
11951
|
-
return /* @__PURE__ */ (0,
|
|
12127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
11952
12128
|
"li",
|
|
11953
12129
|
{
|
|
11954
12130
|
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
@@ -11963,9 +12139,9 @@ function CardList({
|
|
|
11963
12139
|
"data-[state=selected]:bg-brand-tertiary"
|
|
11964
12140
|
),
|
|
11965
12141
|
children: [
|
|
11966
|
-
/* @__PURE__ */ (0,
|
|
11967
|
-
selectable && /* @__PURE__ */ (0,
|
|
11968
|
-
/* @__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)(
|
|
11969
12145
|
"button",
|
|
11970
12146
|
{
|
|
11971
12147
|
type: "button",
|
|
@@ -11977,12 +12153,12 @@ function CardList({
|
|
|
11977
12153
|
) : titleContent }),
|
|
11978
12154
|
slots.status && // A status pill is `nowrap`, so a long label would spill off the card. Let it
|
|
11979
12155
|
// wrap inside the cap instead.
|
|
11980
|
-
/* @__PURE__ */ (0,
|
|
11981
|
-
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) }) })
|
|
11982
12158
|
] }),
|
|
11983
|
-
slots.fields.length > 0 && /* @__PURE__ */ (0,
|
|
11984
|
-
/* @__PURE__ */ (0,
|
|
11985
|
-
/* @__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) })
|
|
11986
12162
|
] }, id)) })
|
|
11987
12163
|
]
|
|
11988
12164
|
},
|
|
@@ -11998,45 +12174,47 @@ function CardList({
|
|
|
11998
12174
|
var import_react_table2 = require("@tanstack/react-table");
|
|
11999
12175
|
|
|
12000
12176
|
// src/components/feedback/inline-alert.tsx
|
|
12001
|
-
var
|
|
12177
|
+
var import_clsx97 = __toESM(require("clsx"), 1);
|
|
12002
12178
|
var import_lucide_react35 = require("lucide-react");
|
|
12003
|
-
var
|
|
12179
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
12004
12180
|
var toneStyles3 = {
|
|
12005
12181
|
info: "border-brand-tertiary bg-brand-tertiary text-brand",
|
|
12006
12182
|
warning: "border-warning-tertiary bg-warning-tertiary text-warning",
|
|
12007
12183
|
danger: "border-danger-tertiary bg-danger-tertiary text-danger",
|
|
12008
|
-
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"
|
|
12009
12186
|
};
|
|
12010
12187
|
var toneIcons = {
|
|
12011
|
-
info: /* @__PURE__ */ (0,
|
|
12012
|
-
warning: /* @__PURE__ */ (0,
|
|
12013
|
-
danger: /* @__PURE__ */ (0,
|
|
12014
|
-
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" })
|
|
12015
12193
|
};
|
|
12016
|
-
function InlineAlert({ tone, children, icon, className }) {
|
|
12194
|
+
function InlineAlert({ tone, children, icon, role, className }) {
|
|
12017
12195
|
const glyph = icon === void 0 ? toneIcons[tone] : icon;
|
|
12018
|
-
return /* @__PURE__ */ (0,
|
|
12196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
12019
12197
|
"div",
|
|
12020
12198
|
{
|
|
12021
12199
|
"data-tone": tone,
|
|
12022
|
-
role: tone === "danger" ? "alert" : "status",
|
|
12023
|
-
className: (0,
|
|
12200
|
+
role: role ?? (tone === "danger" ? "alert" : "status"),
|
|
12201
|
+
className: (0, import_clsx97.default)(
|
|
12024
12202
|
"flex items-start gap-3 rounded-xl border p-4 text-body-xs",
|
|
12025
12203
|
toneStyles3[tone],
|
|
12026
12204
|
className
|
|
12027
12205
|
),
|
|
12028
12206
|
children: [
|
|
12029
|
-
glyph && /* @__PURE__ */ (0,
|
|
12030
|
-
/* @__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 })
|
|
12031
12209
|
]
|
|
12032
12210
|
}
|
|
12033
12211
|
);
|
|
12034
12212
|
}
|
|
12035
12213
|
|
|
12036
12214
|
// src/components/feedback/error-boundary.tsx
|
|
12037
|
-
var
|
|
12038
|
-
var
|
|
12039
|
-
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 {
|
|
12040
12218
|
constructor() {
|
|
12041
12219
|
super(...arguments);
|
|
12042
12220
|
this.state = { error: null };
|
|
@@ -12055,7 +12233,7 @@ var ErrorBoundary = class extends import_react75.Component {
|
|
|
12055
12233
|
}
|
|
12056
12234
|
render() {
|
|
12057
12235
|
if (!this.state.error) return this.props.children;
|
|
12058
|
-
return this.props.fallback ?? /* @__PURE__ */ (0,
|
|
12236
|
+
return this.props.fallback ?? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
12059
12237
|
"div",
|
|
12060
12238
|
{
|
|
12061
12239
|
role: "status",
|
|
@@ -12068,29 +12246,32 @@ var ErrorBoundary = class extends import_react75.Component {
|
|
|
12068
12246
|
};
|
|
12069
12247
|
|
|
12070
12248
|
// src/components/feedback/banner.tsx
|
|
12071
|
-
var
|
|
12072
|
-
var
|
|
12249
|
+
var import_react77 = require("react");
|
|
12250
|
+
var import_clsx98 = __toESM(require("clsx"), 1);
|
|
12073
12251
|
var import_lucide_react36 = require("lucide-react");
|
|
12074
|
-
var
|
|
12252
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
12075
12253
|
var TONE_STYLES3 = {
|
|
12076
12254
|
info: "border-brand-tertiary bg-brand-tertiary text-default",
|
|
12077
12255
|
positive: "border-positive-tertiary bg-positive-tertiary text-default",
|
|
12078
12256
|
warning: "border-warning-tertiary bg-warning-tertiary text-default",
|
|
12079
|
-
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"
|
|
12080
12259
|
};
|
|
12081
12260
|
var TONE_ICON_COLOR = {
|
|
12082
12261
|
info: "text-icon-brand",
|
|
12083
12262
|
positive: "text-icon-positive",
|
|
12084
12263
|
warning: "text-icon-warning",
|
|
12085
|
-
danger: "text-icon-danger"
|
|
12264
|
+
danger: "text-icon-danger",
|
|
12265
|
+
neutral: "text-icon-default-secondary"
|
|
12086
12266
|
};
|
|
12087
12267
|
var TONE_ICON2 = {
|
|
12088
|
-
info: /* @__PURE__ */ (0,
|
|
12089
|
-
positive: /* @__PURE__ */ (0,
|
|
12090
|
-
warning: /* @__PURE__ */ (0,
|
|
12091
|
-
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" })
|
|
12092
12273
|
};
|
|
12093
|
-
var Banner = (0,
|
|
12274
|
+
var Banner = (0, import_react77.forwardRef)(function Banner2({
|
|
12094
12275
|
title,
|
|
12095
12276
|
children,
|
|
12096
12277
|
variant = "message",
|
|
@@ -12101,9 +12282,9 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
12101
12282
|
className,
|
|
12102
12283
|
...rest
|
|
12103
12284
|
}, ref) {
|
|
12104
|
-
const titleId = (0,
|
|
12285
|
+
const titleId = (0, import_react77.useId)();
|
|
12105
12286
|
const glyph = icon === void 0 ? TONE_ICON2[tone] : icon;
|
|
12106
|
-
return /* @__PURE__ */ (0,
|
|
12287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
12107
12288
|
"div",
|
|
12108
12289
|
{
|
|
12109
12290
|
"data-tone": tone,
|
|
@@ -12112,20 +12293,20 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
12112
12293
|
role: variant === "alert" ? "alert" : "status",
|
|
12113
12294
|
"aria-labelledby": titleId,
|
|
12114
12295
|
"data-slot": "banner",
|
|
12115
|
-
className: (0,
|
|
12296
|
+
className: (0, import_clsx98.default)(
|
|
12116
12297
|
"flex w-full items-start gap-3 rounded-xl border p-4",
|
|
12117
12298
|
TONE_STYLES3[tone],
|
|
12118
12299
|
className
|
|
12119
12300
|
),
|
|
12120
12301
|
...rest,
|
|
12121
12302
|
children: [
|
|
12122
|
-
glyph && /* @__PURE__ */ (0,
|
|
12123
|
-
/* @__PURE__ */ (0,
|
|
12124
|
-
/* @__PURE__ */ (0,
|
|
12125
|
-
children && /* @__PURE__ */ (0,
|
|
12126
|
-
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 })
|
|
12127
12308
|
] }),
|
|
12128
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
12309
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
12129
12310
|
IconButton,
|
|
12130
12311
|
{
|
|
12131
12312
|
variant: "subtle",
|
|
@@ -12133,7 +12314,7 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
12133
12314
|
"aria-label": typeof title === "string" ? `Dismiss: ${title}` : "Dismiss",
|
|
12134
12315
|
onClick: onDismiss,
|
|
12135
12316
|
className: "-mr-1 -mt-1 shrink-0",
|
|
12136
|
-
children: /* @__PURE__ */ (0,
|
|
12317
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react36.XIcon, { "aria-hidden": true, size: 16 })
|
|
12137
12318
|
}
|
|
12138
12319
|
)
|
|
12139
12320
|
]
|
|
@@ -12142,27 +12323,29 @@ var Banner = (0, import_react76.forwardRef)(function Banner2({
|
|
|
12142
12323
|
});
|
|
12143
12324
|
|
|
12144
12325
|
// src/components/feedback/toast.tsx
|
|
12145
|
-
var
|
|
12146
|
-
var
|
|
12326
|
+
var import_react78 = require("react");
|
|
12327
|
+
var import_clsx99 = __toESM(require("clsx"), 1);
|
|
12147
12328
|
var import_lucide_react37 = require("lucide-react");
|
|
12148
|
-
var
|
|
12149
|
-
var ToastContext = (0,
|
|
12329
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
12330
|
+
var ToastContext = (0, import_react78.createContext)(null);
|
|
12150
12331
|
function useToast() {
|
|
12151
|
-
const context = (0,
|
|
12332
|
+
const context = (0, import_react78.useContext)(ToastContext);
|
|
12152
12333
|
if (!context) throw new Error("useToast() must be used inside <Toaster>");
|
|
12153
12334
|
return context;
|
|
12154
12335
|
}
|
|
12155
12336
|
var TONE_ICON3 = {
|
|
12156
|
-
info: /* @__PURE__ */ (0,
|
|
12157
|
-
positive: /* @__PURE__ */ (0,
|
|
12158
|
-
warning: /* @__PURE__ */ (0,
|
|
12159
|
-
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" })
|
|
12160
12342
|
};
|
|
12161
12343
|
var TONE_ICON_COLOR2 = {
|
|
12162
12344
|
info: "text-icon-brand",
|
|
12163
12345
|
positive: "text-icon-positive",
|
|
12164
12346
|
warning: "text-icon-warning",
|
|
12165
|
-
danger: "text-icon-danger"
|
|
12347
|
+
danger: "text-icon-danger",
|
|
12348
|
+
neutral: "text-icon-default-secondary"
|
|
12166
12349
|
};
|
|
12167
12350
|
var POSITION = {
|
|
12168
12351
|
"top-left": "top-[var(--toaster-mobile-offset)] md:top-[var(--toaster-offset)] left-4 items-start",
|
|
@@ -12183,10 +12366,10 @@ function Toaster({
|
|
|
12183
12366
|
offset: offset2 = 16,
|
|
12184
12367
|
mobileOffset
|
|
12185
12368
|
}) {
|
|
12186
|
-
const [toasts, setToasts] = (0,
|
|
12187
|
-
const timers = (0,
|
|
12188
|
-
const counter = (0,
|
|
12189
|
-
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) => {
|
|
12190
12373
|
const timer = timers.current.get(id);
|
|
12191
12374
|
if (timer) {
|
|
12192
12375
|
clearTimeout(timer);
|
|
@@ -12194,12 +12377,12 @@ function Toaster({
|
|
|
12194
12377
|
}
|
|
12195
12378
|
setToasts((current) => current.filter((entry) => entry.id !== id));
|
|
12196
12379
|
}, []);
|
|
12197
|
-
const dismissAll = (0,
|
|
12380
|
+
const dismissAll = (0, import_react78.useCallback)(() => {
|
|
12198
12381
|
for (const timer of timers.current.values()) clearTimeout(timer);
|
|
12199
12382
|
timers.current.clear();
|
|
12200
12383
|
setToasts([]);
|
|
12201
12384
|
}, []);
|
|
12202
|
-
const toast = (0,
|
|
12385
|
+
const toast = (0, import_react78.useCallback)(
|
|
12203
12386
|
(options) => {
|
|
12204
12387
|
counter.current += 1;
|
|
12205
12388
|
const id = `toast-${counter.current}`;
|
|
@@ -12215,23 +12398,23 @@ function Toaster({
|
|
|
12215
12398
|
},
|
|
12216
12399
|
[duration, max, dismiss]
|
|
12217
12400
|
);
|
|
12218
|
-
(0,
|
|
12401
|
+
(0, import_react78.useEffect)(() => {
|
|
12219
12402
|
const map = timers.current;
|
|
12220
12403
|
return () => {
|
|
12221
12404
|
for (const timer of map.values()) clearTimeout(timer);
|
|
12222
12405
|
map.clear();
|
|
12223
12406
|
};
|
|
12224
12407
|
}, []);
|
|
12225
|
-
const context = (0,
|
|
12226
|
-
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: [
|
|
12227
12410
|
children,
|
|
12228
|
-
/* @__PURE__ */ (0,
|
|
12411
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12229
12412
|
"div",
|
|
12230
12413
|
{
|
|
12231
12414
|
"aria-live": "polite",
|
|
12232
12415
|
"aria-atomic": "false",
|
|
12233
12416
|
...{ [TOASTER_ATTRIBUTE]: "" },
|
|
12234
|
-
className: (0,
|
|
12417
|
+
className: (0, import_clsx99.default)(
|
|
12235
12418
|
"pointer-events-none fixed z-toast flex w-[calc(100%-2rem)] max-w-[380px] flex-col gap-2",
|
|
12236
12419
|
POSITION[position]
|
|
12237
12420
|
),
|
|
@@ -12239,29 +12422,29 @@ function Toaster({
|
|
|
12239
12422
|
"--toaster-offset": toLength(offset2),
|
|
12240
12423
|
"--toaster-mobile-offset": toLength(mobileOffset ?? offset2)
|
|
12241
12424
|
},
|
|
12242
|
-
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))
|
|
12243
12426
|
}
|
|
12244
12427
|
) })
|
|
12245
12428
|
] });
|
|
12246
12429
|
}
|
|
12247
12430
|
function ToastItem({ toast, onDismiss }) {
|
|
12248
12431
|
const tone = toast.tone ?? "info";
|
|
12249
|
-
return /* @__PURE__ */ (0,
|
|
12432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
12250
12433
|
"div",
|
|
12251
12434
|
{
|
|
12252
12435
|
role: tone === "danger" ? "alert" : "status",
|
|
12253
|
-
className: (0,
|
|
12436
|
+
className: (0, import_clsx99.default)(
|
|
12254
12437
|
"pointer-events-auto flex w-full items-start gap-3 rounded-xl border border-default",
|
|
12255
12438
|
"bg-default p-4 shadow-400"
|
|
12256
12439
|
),
|
|
12257
12440
|
children: [
|
|
12258
|
-
/* @__PURE__ */ (0,
|
|
12259
|
-
/* @__PURE__ */ (0,
|
|
12260
|
-
/* @__PURE__ */ (0,
|
|
12261
|
-
toast.description && /* @__PURE__ */ (0,
|
|
12262
|
-
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 })
|
|
12263
12446
|
] }),
|
|
12264
|
-
/* @__PURE__ */ (0,
|
|
12447
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12265
12448
|
IconButton,
|
|
12266
12449
|
{
|
|
12267
12450
|
variant: "subtle",
|
|
@@ -12269,7 +12452,7 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
12269
12452
|
"aria-label": typeof toast.title === "string" ? `Dismiss: ${toast.title}` : "Dismiss",
|
|
12270
12453
|
onClick: onDismiss,
|
|
12271
12454
|
className: "-mr-1 -mt-1 shrink-0",
|
|
12272
|
-
children: /* @__PURE__ */ (0,
|
|
12455
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react37.XIcon, { "aria-hidden": true, size: 14 })
|
|
12273
12456
|
}
|
|
12274
12457
|
)
|
|
12275
12458
|
]
|
|
@@ -12278,25 +12461,25 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
12278
12461
|
}
|
|
12279
12462
|
|
|
12280
12463
|
// src/components/forms/password-input.tsx
|
|
12281
|
-
var
|
|
12464
|
+
var import_react79 = require("react");
|
|
12282
12465
|
var import_lucide_react38 = require("lucide-react");
|
|
12283
|
-
var
|
|
12284
|
-
var PasswordInput = (0,
|
|
12285
|
-
const [visible, setVisible] = (0,
|
|
12286
|
-
return /* @__PURE__ */ (0,
|
|
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)(
|
|
12287
12470
|
Input,
|
|
12288
12471
|
{
|
|
12289
12472
|
ref,
|
|
12290
12473
|
...props,
|
|
12291
12474
|
type: visible ? "text" : "password",
|
|
12292
|
-
trailingAction: /* @__PURE__ */ (0,
|
|
12475
|
+
trailingAction: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12293
12476
|
"button",
|
|
12294
12477
|
{
|
|
12295
12478
|
type: "button",
|
|
12296
12479
|
"aria-label": visible ? "Hide password" : "Show password",
|
|
12297
12480
|
onClick: () => setVisible((v) => !v),
|
|
12298
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",
|
|
12299
|
-
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" })
|
|
12300
12483
|
}
|
|
12301
12484
|
)
|
|
12302
12485
|
}
|
|
@@ -12304,31 +12487,31 @@ var PasswordInput = (0, import_react78.forwardRef)(function PasswordInput2(props
|
|
|
12304
12487
|
});
|
|
12305
12488
|
|
|
12306
12489
|
// src/components/ai/ai-chat-bar.tsx
|
|
12307
|
-
var
|
|
12490
|
+
var import_clsx100 = __toESM(require("clsx"), 1);
|
|
12308
12491
|
var import_lucide_react39 = require("lucide-react");
|
|
12309
|
-
var
|
|
12492
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
12310
12493
|
function AIChatBar({
|
|
12311
12494
|
placeholder = "Ask Intelligence about any entity, supplier, or risk\u2026",
|
|
12312
12495
|
className
|
|
12313
12496
|
}) {
|
|
12314
|
-
return /* @__PURE__ */ (0,
|
|
12497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
12315
12498
|
"div",
|
|
12316
12499
|
{
|
|
12317
|
-
className: (0,
|
|
12500
|
+
className: (0, import_clsx100.default)(
|
|
12318
12501
|
"flex h-16 items-center gap-3 rounded-2xl border border-default bg-default px-6 shadow-panel",
|
|
12319
12502
|
className
|
|
12320
12503
|
),
|
|
12321
12504
|
children: [
|
|
12322
|
-
/* @__PURE__ */ (0,
|
|
12323
|
-
/* @__PURE__ */ (0,
|
|
12324
|
-
/* @__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)(
|
|
12325
12508
|
"button",
|
|
12326
12509
|
{
|
|
12327
12510
|
type: "button",
|
|
12328
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",
|
|
12329
12512
|
children: [
|
|
12330
12513
|
"Ask",
|
|
12331
|
-
/* @__PURE__ */ (0,
|
|
12514
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_lucide_react39.ArrowRightIcon, { "aria-hidden": true, className: "size-4" })
|
|
12332
12515
|
]
|
|
12333
12516
|
}
|
|
12334
12517
|
)
|
|
@@ -12338,42 +12521,42 @@ function AIChatBar({
|
|
|
12338
12521
|
}
|
|
12339
12522
|
|
|
12340
12523
|
// src/components/ai/ai-suggestion-chip.tsx
|
|
12341
|
-
var
|
|
12524
|
+
var import_clsx101 = __toESM(require("clsx"), 1);
|
|
12342
12525
|
var import_lucide_react40 = require("lucide-react");
|
|
12343
|
-
var
|
|
12526
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
12344
12527
|
function AISuggestionChip({ prompt, onClick, className }) {
|
|
12345
|
-
return /* @__PURE__ */ (0,
|
|
12528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
12346
12529
|
"button",
|
|
12347
12530
|
{
|
|
12348
12531
|
type: "button",
|
|
12349
12532
|
onClick,
|
|
12350
|
-
className: (0,
|
|
12533
|
+
className: (0, import_clsx101.default)(
|
|
12351
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",
|
|
12352
12535
|
className
|
|
12353
12536
|
),
|
|
12354
12537
|
children: [
|
|
12355
|
-
/* @__PURE__ */ (0,
|
|
12356
|
-
/* @__PURE__ */ (0,
|
|
12357
|
-
/* @__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 }) })
|
|
12358
12541
|
]
|
|
12359
12542
|
}
|
|
12360
12543
|
);
|
|
12361
12544
|
}
|
|
12362
12545
|
|
|
12363
12546
|
// src/components/ai/quick-actions-bar.tsx
|
|
12364
|
-
var
|
|
12365
|
-
var
|
|
12547
|
+
var import_clsx102 = __toESM(require("clsx"), 1);
|
|
12548
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
12366
12549
|
function QuickActionsBar({ actions, active, onSelect, className }) {
|
|
12367
|
-
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) => {
|
|
12368
12551
|
const isActive = active === action.value;
|
|
12369
|
-
return /* @__PURE__ */ (0,
|
|
12552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
12370
12553
|
"button",
|
|
12371
12554
|
{
|
|
12372
12555
|
type: "button",
|
|
12373
12556
|
"aria-pressed": isActive,
|
|
12374
12557
|
onClick: () => onSelect?.(action.value),
|
|
12375
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",
|
|
12376
|
-
children: /* @__PURE__ */ (0,
|
|
12559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(TagPill, { label: action.label, tone: isActive ? "brand" : "default" })
|
|
12377
12560
|
},
|
|
12378
12561
|
action.value
|
|
12379
12562
|
);
|
|
@@ -12381,25 +12564,25 @@ function QuickActionsBar({ actions, active, onSelect, className }) {
|
|
|
12381
12564
|
}
|
|
12382
12565
|
|
|
12383
12566
|
// src/components/ai/chat.tsx
|
|
12384
|
-
var
|
|
12567
|
+
var import_clsx103 = __toESM(require("clsx"), 1);
|
|
12385
12568
|
var import_lucide_react41 = require("lucide-react");
|
|
12386
|
-
var
|
|
12569
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
12387
12570
|
function AiAvatar({ className, icon }) {
|
|
12388
|
-
return /* @__PURE__ */ (0,
|
|
12571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
12389
12572
|
"span",
|
|
12390
12573
|
{
|
|
12391
12574
|
"aria-hidden": true,
|
|
12392
12575
|
className: cn("flex size-8 shrink-0 items-center justify-center rounded-full bg-brand text-icon-brand-on-brand", className),
|
|
12393
|
-
children: icon ?? /* @__PURE__ */ (0,
|
|
12576
|
+
children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_lucide_react41.CpuIcon, { className: "size-3.5" })
|
|
12394
12577
|
}
|
|
12395
12578
|
);
|
|
12396
12579
|
}
|
|
12397
12580
|
function TypingIndicator({ label = "Assistant is typing", className }) {
|
|
12398
|
-
return /* @__PURE__ */ (0,
|
|
12399
|
-
/* @__PURE__ */ (0,
|
|
12400
|
-
/* @__PURE__ */ (0,
|
|
12401
|
-
/* @__PURE__ */ (0,
|
|
12402
|
-
/* @__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)(
|
|
12403
12586
|
"span",
|
|
12404
12587
|
{
|
|
12405
12588
|
className: "inline-block size-1.5 rounded-full bg-default-tertiary motion-safe:animate-bounce",
|
|
@@ -12412,16 +12595,16 @@ function TypingIndicator({ label = "Assistant is typing", className }) {
|
|
|
12412
12595
|
}
|
|
12413
12596
|
function ChatBubble({ sender, children, failed = false, className }) {
|
|
12414
12597
|
if (sender === "user") {
|
|
12415
|
-
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 }) });
|
|
12416
12599
|
}
|
|
12417
|
-
return /* @__PURE__ */ (0,
|
|
12600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
12418
12601
|
"div",
|
|
12419
12602
|
{
|
|
12420
12603
|
"data-sender": "assistant",
|
|
12421
12604
|
"data-state": failed ? "failed" : void 0,
|
|
12422
12605
|
className: cn(
|
|
12423
12606
|
"rounded-2xl rounded-tl-sm border px-5 py-4 text-body-sm leading-relaxed",
|
|
12424
|
-
(0,
|
|
12607
|
+
(0, import_clsx103.default)(
|
|
12425
12608
|
"border-default bg-default-secondary text-default",
|
|
12426
12609
|
"data-[state=failed]:border-danger-secondary data-[state=failed]:bg-danger-tertiary data-[state=failed]:text-danger"
|
|
12427
12610
|
),
|
|
@@ -12433,17 +12616,17 @@ function ChatBubble({ sender, children, failed = false, className }) {
|
|
|
12433
12616
|
}
|
|
12434
12617
|
|
|
12435
12618
|
// src/components/decorative/aurora-backdrop.tsx
|
|
12436
|
-
var
|
|
12619
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
12437
12620
|
function blob(primitive, alpha) {
|
|
12438
12621
|
return `radial-gradient(ellipse, color-mix(in srgb, var(${primitive}) ${alpha}%, transparent) 0%, transparent 70%)`;
|
|
12439
12622
|
}
|
|
12440
12623
|
function AuroraBackdrop() {
|
|
12441
|
-
return /* @__PURE__ */ (0,
|
|
12442
|
-
/* @__PURE__ */ (0,
|
|
12443
|
-
/* @__PURE__ */ (0,
|
|
12444
|
-
/* @__PURE__ */ (0,
|
|
12445
|
-
/* @__PURE__ */ (0,
|
|
12446
|
-
/* @__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) } })
|
|
12447
12630
|
] });
|
|
12448
12631
|
}
|
|
12449
12632
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -12461,6 +12644,7 @@ function AuroraBackdrop() {
|
|
|
12461
12644
|
Avatar,
|
|
12462
12645
|
AvatarBlock,
|
|
12463
12646
|
AvatarGroup,
|
|
12647
|
+
BADGE_COLORS,
|
|
12464
12648
|
Badge,
|
|
12465
12649
|
Banner,
|
|
12466
12650
|
BarChart,
|
|
@@ -12601,6 +12785,7 @@ function AuroraBackdrop() {
|
|
|
12601
12785
|
Label,
|
|
12602
12786
|
LegendDot,
|
|
12603
12787
|
ListRow,
|
|
12788
|
+
Listbox,
|
|
12604
12789
|
Menubar,
|
|
12605
12790
|
MenubarCheckboxItem,
|
|
12606
12791
|
MenubarContent,
|