@assure-one/design-system 1.4.3 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +441 -2
- package/dist/index.js +763 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8104,6 +8104,207 @@ var Slider = React38.forwardRef(
|
|
|
8104
8104
|
}
|
|
8105
8105
|
);
|
|
8106
8106
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
8107
|
+
var RAMP3 = [
|
|
8108
|
+
"var(--color-chart-1)",
|
|
8109
|
+
"var(--color-chart-2)",
|
|
8110
|
+
"var(--color-chart-3)",
|
|
8111
|
+
"var(--color-chart-4)"
|
|
8112
|
+
];
|
|
8113
|
+
var Y_GUTTER = 30;
|
|
8114
|
+
var defaultFormat2 = (n) => n.toLocaleString();
|
|
8115
|
+
function niceScale(max, tickCount) {
|
|
8116
|
+
if (max <= 0 || !Number.isFinite(max)) {
|
|
8117
|
+
return { niceMax: tickCount, ticks: Array.from({ length: tickCount + 1 }, (_, i) => i) };
|
|
8118
|
+
}
|
|
8119
|
+
const rawStep = max / tickCount;
|
|
8120
|
+
const mag = Math.pow(10, Math.floor(Math.log10(rawStep)));
|
|
8121
|
+
const norm = rawStep / mag;
|
|
8122
|
+
const niceNorm = norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 3 ? 3 : norm <= 5 ? 5 : 10;
|
|
8123
|
+
const niceStep = niceNorm * mag;
|
|
8124
|
+
const niceMax = niceStep * tickCount;
|
|
8125
|
+
const ticks = Array.from({ length: tickCount + 1 }, (_, i) => i * niceStep);
|
|
8126
|
+
return { niceMax, ticks };
|
|
8127
|
+
}
|
|
8128
|
+
var StackedBarChart = forwardRef(
|
|
8129
|
+
function StackedBarChart2({
|
|
8130
|
+
bars,
|
|
8131
|
+
series,
|
|
8132
|
+
height = 200,
|
|
8133
|
+
tickCount = 4,
|
|
8134
|
+
formatValue = defaultFormat2,
|
|
8135
|
+
showYAxis = true,
|
|
8136
|
+
showXAxis = true,
|
|
8137
|
+
showLegend = true,
|
|
8138
|
+
minBarWidth = 0,
|
|
8139
|
+
className,
|
|
8140
|
+
...props
|
|
8141
|
+
}, ref) {
|
|
8142
|
+
const anchorRef = useRef(null);
|
|
8143
|
+
const [hover, setHover] = useState(null);
|
|
8144
|
+
const [mounted, setMounted] = useState(false);
|
|
8145
|
+
useEffect(() => setMounted(true), []);
|
|
8146
|
+
const colorFor = useCallback(
|
|
8147
|
+
(key) => {
|
|
8148
|
+
const idx = series.findIndex((s) => s.key === key);
|
|
8149
|
+
return series[idx]?.color ?? RAMP3[idx % RAMP3.length];
|
|
8150
|
+
},
|
|
8151
|
+
[series]
|
|
8152
|
+
);
|
|
8153
|
+
const rawMax = bars.reduce((peak, bar) => {
|
|
8154
|
+
const total = series.reduce((sum, s) => sum + Math.max(0, bar.values[s.key] ?? 0), 0);
|
|
8155
|
+
return Math.max(peak, total);
|
|
8156
|
+
}, 0);
|
|
8157
|
+
const { niceMax, ticks } = niceScale(rawMax, tickCount);
|
|
8158
|
+
const handleMove = useCallback(
|
|
8159
|
+
(e, h) => {
|
|
8160
|
+
const rect = anchorRef.current?.getBoundingClientRect();
|
|
8161
|
+
if (!rect) return;
|
|
8162
|
+
setHover({ ...h, x: e.clientX - rect.left, y: e.clientY - rect.top });
|
|
8163
|
+
},
|
|
8164
|
+
[]
|
|
8165
|
+
);
|
|
8166
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-full", className), ...props, children: [
|
|
8167
|
+
showLegend && /* @__PURE__ */ jsx("div", { className: "mb-3 flex flex-wrap items-center gap-x-4 gap-y-1.5", children: series.map((s) => /* @__PURE__ */ jsxs("span", { className: "text-fg-3 inline-flex items-center gap-1.5 text-xs", children: [
|
|
8168
|
+
/* @__PURE__ */ jsx(
|
|
8169
|
+
"span",
|
|
8170
|
+
{
|
|
8171
|
+
"aria-hidden": true,
|
|
8172
|
+
className: "size-2.5 rounded-[3px]",
|
|
8173
|
+
style: { background: s.color ?? colorFor(s.key) }
|
|
8174
|
+
}
|
|
8175
|
+
),
|
|
8176
|
+
s.label
|
|
8177
|
+
] }, s.key)) }),
|
|
8178
|
+
/* @__PURE__ */ jsxs("div", { ref: anchorRef, className: "relative flex gap-2", children: [
|
|
8179
|
+
showYAxis && /* @__PURE__ */ jsx(
|
|
8180
|
+
"div",
|
|
8181
|
+
{
|
|
8182
|
+
className: "text-fg-4 relative shrink-0 text-[11px] tabular-nums",
|
|
8183
|
+
style: { width: Y_GUTTER, height },
|
|
8184
|
+
"aria-hidden": true,
|
|
8185
|
+
children: ticks.map((t) => /* @__PURE__ */ jsx(
|
|
8186
|
+
"span",
|
|
8187
|
+
{
|
|
8188
|
+
className: "absolute right-0 -translate-y-1/2 leading-none",
|
|
8189
|
+
style: { bottom: `${t / niceMax * 100}%` },
|
|
8190
|
+
children: formatValue(t)
|
|
8191
|
+
},
|
|
8192
|
+
t
|
|
8193
|
+
))
|
|
8194
|
+
}
|
|
8195
|
+
),
|
|
8196
|
+
/* @__PURE__ */ jsx("div", { className: cn("min-w-0 flex-1", minBarWidth > 0 && "overflow-x-auto"), children: /* @__PURE__ */ jsxs("div", { style: { minWidth: minBarWidth > 0 ? bars.length * minBarWidth : void 0 }, children: [
|
|
8197
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", style: { height }, children: [
|
|
8198
|
+
ticks.map((t) => /* @__PURE__ */ jsx(
|
|
8199
|
+
"div",
|
|
8200
|
+
{
|
|
8201
|
+
"aria-hidden": true,
|
|
8202
|
+
className: "border-rule absolute inset-x-0 border-t",
|
|
8203
|
+
style: { bottom: `${t / niceMax * 100}%` }
|
|
8204
|
+
},
|
|
8205
|
+
t
|
|
8206
|
+
)),
|
|
8207
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-end gap-3", children: bars.map((bar, barIndex) => {
|
|
8208
|
+
const total = series.reduce(
|
|
8209
|
+
(sum, s) => sum + Math.max(0, bar.values[s.key] ?? 0),
|
|
8210
|
+
0
|
|
8211
|
+
);
|
|
8212
|
+
const tipLabel = bar.tooltipLabel ?? (typeof bar.label === "string" ? bar.label : "");
|
|
8213
|
+
return /* @__PURE__ */ jsx(
|
|
8214
|
+
"div",
|
|
8215
|
+
{
|
|
8216
|
+
className: "flex h-full flex-1 items-end",
|
|
8217
|
+
style: { minWidth: minBarWidth || void 0 },
|
|
8218
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full flex-col-reverse overflow-hidden rounded-t-[5px]", children: [
|
|
8219
|
+
series.map((s, sIdx) => {
|
|
8220
|
+
const value = Math.max(0, bar.values[s.key] ?? 0);
|
|
8221
|
+
if (value <= 0) return null;
|
|
8222
|
+
const targetPct = value / niceMax * 100;
|
|
8223
|
+
const color = s.color ?? RAMP3[sIdx % RAMP3.length];
|
|
8224
|
+
const dimmed = hover != null && (hover.barIndex !== barIndex || hover.seriesKey !== s.key);
|
|
8225
|
+
return (
|
|
8226
|
+
// Segment is a labeled graphic (role="img" + aria-label exposes
|
|
8227
|
+
// the value); the hover tooltip is a supplementary pointer affordance.
|
|
8228
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
8229
|
+
/* @__PURE__ */ jsx(
|
|
8230
|
+
"div",
|
|
8231
|
+
{
|
|
8232
|
+
role: "img",
|
|
8233
|
+
"aria-label": `${tipLabel} ${s.label}: ${formatValue(value)}`,
|
|
8234
|
+
className: "w-full transition-[height,opacity] duration-[var(--duration-slow)] ease-[var(--ease-out-quart)] motion-reduce:transition-none",
|
|
8235
|
+
style: {
|
|
8236
|
+
height: `${mounted ? targetPct : 0}%`,
|
|
8237
|
+
background: color,
|
|
8238
|
+
opacity: dimmed ? 0.4 : 1,
|
|
8239
|
+
transitionDelay: mounted ? `${barIndex * 60}ms` : "0ms"
|
|
8240
|
+
},
|
|
8241
|
+
onMouseEnter: (e) => handleMove(e, {
|
|
8242
|
+
barIndex,
|
|
8243
|
+
seriesKey: s.key,
|
|
8244
|
+
label: s.label,
|
|
8245
|
+
value,
|
|
8246
|
+
color
|
|
8247
|
+
}),
|
|
8248
|
+
onMouseMove: (e) => handleMove(e, {
|
|
8249
|
+
barIndex,
|
|
8250
|
+
seriesKey: s.key,
|
|
8251
|
+
label: s.label,
|
|
8252
|
+
value,
|
|
8253
|
+
color
|
|
8254
|
+
}),
|
|
8255
|
+
onMouseLeave: () => setHover(null)
|
|
8256
|
+
},
|
|
8257
|
+
s.key
|
|
8258
|
+
)
|
|
8259
|
+
);
|
|
8260
|
+
}),
|
|
8261
|
+
total <= 0 && /* @__PURE__ */ jsx("div", { className: "h-px w-full", "aria-hidden": true })
|
|
8262
|
+
] })
|
|
8263
|
+
},
|
|
8264
|
+
barIndex
|
|
8265
|
+
);
|
|
8266
|
+
}) })
|
|
8267
|
+
] }),
|
|
8268
|
+
showXAxis && /* @__PURE__ */ jsx("div", { className: "text-fg-3 mt-2 flex gap-3 text-[11px]", children: bars.map((bar, i) => /* @__PURE__ */ jsx(
|
|
8269
|
+
"div",
|
|
8270
|
+
{
|
|
8271
|
+
className: "flex flex-1 items-center justify-center gap-1.5 truncate text-center",
|
|
8272
|
+
style: { minWidth: minBarWidth || void 0 },
|
|
8273
|
+
children: bar.label
|
|
8274
|
+
},
|
|
8275
|
+
i
|
|
8276
|
+
)) })
|
|
8277
|
+
] }) }),
|
|
8278
|
+
hover && /* @__PURE__ */ jsxs(
|
|
8279
|
+
"div",
|
|
8280
|
+
{
|
|
8281
|
+
className: "bg-fg text-bg pointer-events-none absolute z-[var(--z-tooltip)] -translate-x-1/2 -translate-y-[calc(100%+10px)] rounded-[var(--radius-icon)] px-2 py-1 text-center whitespace-nowrap shadow-[var(--shadow-pop)]",
|
|
8282
|
+
style: { left: hover.x, top: hover.y },
|
|
8283
|
+
children: [
|
|
8284
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-xs font-semibold tabular-nums", children: [
|
|
8285
|
+
/* @__PURE__ */ jsx(
|
|
8286
|
+
"span",
|
|
8287
|
+
{
|
|
8288
|
+
"aria-hidden": true,
|
|
8289
|
+
className: "size-2 rounded-[2px]",
|
|
8290
|
+
style: { background: hover.color }
|
|
8291
|
+
}
|
|
8292
|
+
),
|
|
8293
|
+
formatValue(hover.value)
|
|
8294
|
+
] }),
|
|
8295
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[10px] opacity-70", children: (() => {
|
|
8296
|
+
const col = bars[hover.barIndex];
|
|
8297
|
+
const colLabel = col?.tooltipLabel ?? (typeof col?.label === "string" ? col.label : "");
|
|
8298
|
+
return colLabel ? `${colLabel} \xB7 ${hover.label}` : hover.label;
|
|
8299
|
+
})() })
|
|
8300
|
+
]
|
|
8301
|
+
}
|
|
8302
|
+
)
|
|
8303
|
+
] })
|
|
8304
|
+
] });
|
|
8305
|
+
}
|
|
8306
|
+
);
|
|
8307
|
+
StackedBarChart.displayName = "StackedBarChart";
|
|
8107
8308
|
var starRatingVariants = cva("flex items-center gap-0.5", {
|
|
8108
8309
|
variants: {
|
|
8109
8310
|
sizeVariant: {
|
|
@@ -9243,6 +9444,95 @@ var VisuallyHidden = forwardRef(
|
|
|
9243
9444
|
}
|
|
9244
9445
|
);
|
|
9245
9446
|
VisuallyHidden.displayName = "VisuallyHidden";
|
|
9447
|
+
var TONE_DOT = {
|
|
9448
|
+
brand: "bg-brand",
|
|
9449
|
+
info: "bg-info",
|
|
9450
|
+
success: "bg-success",
|
|
9451
|
+
warning: "bg-warning",
|
|
9452
|
+
muted: "bg-muted-foreground/40",
|
|
9453
|
+
danger: "bg-destructive"
|
|
9454
|
+
};
|
|
9455
|
+
function ChannelTabs({ tabs, value, onChange, className, ...props }) {
|
|
9456
|
+
return /* @__PURE__ */ jsx(
|
|
9457
|
+
"div",
|
|
9458
|
+
{
|
|
9459
|
+
role: "tablist",
|
|
9460
|
+
"aria-label": "Channel",
|
|
9461
|
+
className: cn("flex items-center gap-1 border-b border-border bg-card px-3 py-2", className),
|
|
9462
|
+
...props,
|
|
9463
|
+
children: tabs.map((tab) => {
|
|
9464
|
+
const active = value === tab.value;
|
|
9465
|
+
const count = tab.count;
|
|
9466
|
+
return /* @__PURE__ */ jsxs(
|
|
9467
|
+
"button",
|
|
9468
|
+
{
|
|
9469
|
+
type: "button",
|
|
9470
|
+
role: "tab",
|
|
9471
|
+
"aria-selected": active,
|
|
9472
|
+
onClick: () => onChange(tab.value),
|
|
9473
|
+
className: cn(
|
|
9474
|
+
"flex items-center gap-2 rounded-md border px-3 py-1.5 text-sm font-medium transition-colors",
|
|
9475
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
9476
|
+
active ? "border-brand bg-brand/5 text-brand" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
9477
|
+
),
|
|
9478
|
+
children: [
|
|
9479
|
+
/* @__PURE__ */ jsx(
|
|
9480
|
+
"span",
|
|
9481
|
+
{
|
|
9482
|
+
className: cn(
|
|
9483
|
+
"size-1.5 rounded-full",
|
|
9484
|
+
active ? TONE_DOT[tab.tone ?? "muted"] : "bg-muted-foreground/40"
|
|
9485
|
+
),
|
|
9486
|
+
"aria-hidden": true
|
|
9487
|
+
}
|
|
9488
|
+
),
|
|
9489
|
+
tab.label,
|
|
9490
|
+
count !== void 0 && count > 0 && /* @__PURE__ */ jsx(
|
|
9491
|
+
"span",
|
|
9492
|
+
{
|
|
9493
|
+
className: cn(
|
|
9494
|
+
"ml-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-semibold tabular-nums",
|
|
9495
|
+
active ? "bg-background/60" : "bg-muted text-muted-foreground"
|
|
9496
|
+
),
|
|
9497
|
+
children: count
|
|
9498
|
+
}
|
|
9499
|
+
)
|
|
9500
|
+
]
|
|
9501
|
+
},
|
|
9502
|
+
tab.value
|
|
9503
|
+
);
|
|
9504
|
+
})
|
|
9505
|
+
}
|
|
9506
|
+
);
|
|
9507
|
+
}
|
|
9508
|
+
ChannelTabs.displayName = "ChannelTabs";
|
|
9509
|
+
var TONE_STYLES = {
|
|
9510
|
+
brand: "bg-brand/10 text-brand border-brand/30",
|
|
9511
|
+
info: "bg-info/10 text-info border-info/30",
|
|
9512
|
+
primary: "bg-primary/10 text-primary border-primary/30",
|
|
9513
|
+
success: "bg-success/10 text-success border-success/30",
|
|
9514
|
+
warning: "bg-warning/10 text-warning border-warning/30",
|
|
9515
|
+
danger: "bg-destructive/10 text-destructive border-destructive/30",
|
|
9516
|
+
muted: "bg-muted text-muted-foreground border-border"
|
|
9517
|
+
};
|
|
9518
|
+
function IntentBadge({ tone = "muted", icon, children, className, ...props }) {
|
|
9519
|
+
return /* @__PURE__ */ jsxs(
|
|
9520
|
+
"span",
|
|
9521
|
+
{
|
|
9522
|
+
className: cn(
|
|
9523
|
+
"inline-flex items-center gap-1 rounded-full border border-dashed px-2.5 py-1 text-xs font-medium",
|
|
9524
|
+
TONE_STYLES[tone],
|
|
9525
|
+
className
|
|
9526
|
+
),
|
|
9527
|
+
...props,
|
|
9528
|
+
children: [
|
|
9529
|
+
icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 [&>svg]:size-3", children: icon }),
|
|
9530
|
+
children
|
|
9531
|
+
]
|
|
9532
|
+
}
|
|
9533
|
+
);
|
|
9534
|
+
}
|
|
9535
|
+
IntentBadge.displayName = "IntentBadge";
|
|
9246
9536
|
function AiSpark({ size = 16, className }) {
|
|
9247
9537
|
const id = useId();
|
|
9248
9538
|
return /* @__PURE__ */ jsxs(
|
|
@@ -12013,6 +12303,197 @@ var DataTablePagination = forwardRef(
|
|
|
12013
12303
|
}
|
|
12014
12304
|
);
|
|
12015
12305
|
DataTablePagination.displayName = "DataTablePagination";
|
|
12306
|
+
var ALL = "__all";
|
|
12307
|
+
function colStyle(width) {
|
|
12308
|
+
if (!width) return void 0;
|
|
12309
|
+
const flexible = width.match(/minmax\(\s*([\d.]+)px/);
|
|
12310
|
+
if (flexible) return { minWidth: `${flexible[1]}px` };
|
|
12311
|
+
return { width, minWidth: width };
|
|
12312
|
+
}
|
|
12313
|
+
function DataTableView({
|
|
12314
|
+
columns,
|
|
12315
|
+
data,
|
|
12316
|
+
filters = [],
|
|
12317
|
+
searchKeys = [],
|
|
12318
|
+
searchPlaceholder = "Search\u2026",
|
|
12319
|
+
initialSort = null,
|
|
12320
|
+
onRowClick,
|
|
12321
|
+
rowKey = "id",
|
|
12322
|
+
pageSize = 15,
|
|
12323
|
+
itemLabel = "items",
|
|
12324
|
+
className
|
|
12325
|
+
}) {
|
|
12326
|
+
const [search, setSearch] = useState("");
|
|
12327
|
+
const [filterValues, setFilterValues] = useState({});
|
|
12328
|
+
const [sort, setSort] = useState(initialSort);
|
|
12329
|
+
const [page, setPage] = useState(1);
|
|
12330
|
+
const setFilter = (key, value) => {
|
|
12331
|
+
setFilterValues((prev) => ({ ...prev, [key]: value }));
|
|
12332
|
+
setPage(1);
|
|
12333
|
+
};
|
|
12334
|
+
const processed = useMemo(() => {
|
|
12335
|
+
const query = search.trim().toLowerCase();
|
|
12336
|
+
let rows = data.filter((row) => {
|
|
12337
|
+
for (const filter of filters) {
|
|
12338
|
+
const value = filterValues[filter.key];
|
|
12339
|
+
if (value && value !== ALL && !filter.match(row, value)) return false;
|
|
12340
|
+
}
|
|
12341
|
+
if (query && searchKeys.length) {
|
|
12342
|
+
const hit = searchKeys.some(
|
|
12343
|
+
(key) => String(row[key] ?? "").toLowerCase().includes(query)
|
|
12344
|
+
);
|
|
12345
|
+
if (!hit) return false;
|
|
12346
|
+
}
|
|
12347
|
+
return true;
|
|
12348
|
+
});
|
|
12349
|
+
if (sort) {
|
|
12350
|
+
const col = columns.find((c) => c.key === sort.key);
|
|
12351
|
+
const accessor = col?.sortValue ?? ((row) => row[sort.key]);
|
|
12352
|
+
const dir = sort.dir === "asc" ? 1 : -1;
|
|
12353
|
+
rows = [...rows].sort((a, b) => {
|
|
12354
|
+
let av = accessor(a);
|
|
12355
|
+
let bv = accessor(b);
|
|
12356
|
+
if (typeof av === "string") av = av.toLowerCase();
|
|
12357
|
+
if (typeof bv === "string") bv = bv.toLowerCase();
|
|
12358
|
+
if (av == null) av = sort.dir === "asc" ? "\uFFFF" : "";
|
|
12359
|
+
if (bv == null) bv = sort.dir === "asc" ? "\uFFFF" : "";
|
|
12360
|
+
return av < bv ? -dir : av > bv ? dir : 0;
|
|
12361
|
+
});
|
|
12362
|
+
}
|
|
12363
|
+
return rows;
|
|
12364
|
+
}, [data, filters, filterValues, search, searchKeys, sort, columns]);
|
|
12365
|
+
const total = processed.length;
|
|
12366
|
+
const pageCount = Math.max(1, Math.ceil(total / pageSize));
|
|
12367
|
+
const current = Math.min(page, pageCount);
|
|
12368
|
+
const pageRows = processed.slice((current - 1) * pageSize, current * pageSize);
|
|
12369
|
+
const hasToolbar = searchKeys.length > 0 || filters.length > 0;
|
|
12370
|
+
return /* @__PURE__ */ jsxs(DataTable, { withToolbar: hasToolbar, className, children: [
|
|
12371
|
+
hasToolbar && /* @__PURE__ */ jsxs(DataTableToolbar, { children: [
|
|
12372
|
+
searchKeys.length > 0 && /* @__PURE__ */ jsx(
|
|
12373
|
+
DataTableSearch,
|
|
12374
|
+
{
|
|
12375
|
+
placeholder: searchPlaceholder,
|
|
12376
|
+
value: search,
|
|
12377
|
+
onChange: (e) => {
|
|
12378
|
+
setSearch(e.target.value);
|
|
12379
|
+
setPage(1);
|
|
12380
|
+
}
|
|
12381
|
+
}
|
|
12382
|
+
),
|
|
12383
|
+
filters.map((filter) => {
|
|
12384
|
+
const options = [
|
|
12385
|
+
{ value: ALL, label: filter.allLabel ?? `All ${filter.label ?? ""}`.trim() },
|
|
12386
|
+
...filter.options.map((o) => typeof o === "string" ? { value: o, label: o } : o)
|
|
12387
|
+
];
|
|
12388
|
+
return /* @__PURE__ */ jsx(
|
|
12389
|
+
Select,
|
|
12390
|
+
{
|
|
12391
|
+
options,
|
|
12392
|
+
value: filterValues[filter.key] ?? ALL,
|
|
12393
|
+
onValueChange: (value) => setFilter(filter.key, value),
|
|
12394
|
+
"aria-label": filter.label ?? filter.key,
|
|
12395
|
+
className: "w-auto min-w-[150px]"
|
|
12396
|
+
},
|
|
12397
|
+
filter.key
|
|
12398
|
+
);
|
|
12399
|
+
}),
|
|
12400
|
+
/* @__PURE__ */ jsx(DataTableSpacer, {}),
|
|
12401
|
+
/* @__PURE__ */ jsx(DataTableResultsCount, { current: total, total: data.length })
|
|
12402
|
+
] }),
|
|
12403
|
+
/* @__PURE__ */ jsxs("table", { className: "table-auto", children: [
|
|
12404
|
+
/* @__PURE__ */ jsx("colgroup", { children: columns.map((c) => /* @__PURE__ */ jsx("col", { style: colStyle(c.width) }, c.key)) }),
|
|
12405
|
+
/* @__PURE__ */ jsx(DataTableHead, { children: /* @__PURE__ */ jsx(DataTableRow, { children: columns.map(
|
|
12406
|
+
(c) => c.sortable ? /* @__PURE__ */ jsx(
|
|
12407
|
+
DataTableHeader,
|
|
12408
|
+
{
|
|
12409
|
+
sortable: true,
|
|
12410
|
+
sort: sort?.key === c.key ? sort.dir : null,
|
|
12411
|
+
onSortChange: (next) => setSort(next ? { key: c.key, dir: next } : null),
|
|
12412
|
+
className: c.align === "right" ? "text-right [&>button]:ml-auto" : void 0,
|
|
12413
|
+
children: c.header
|
|
12414
|
+
},
|
|
12415
|
+
c.key
|
|
12416
|
+
) : /* @__PURE__ */ jsx(DataTableHeader, { className: c.align === "right" ? "text-right" : void 0, children: c.header }, c.key)
|
|
12417
|
+
) }) }),
|
|
12418
|
+
/* @__PURE__ */ jsx(DataTableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(DataTableCell, { colSpan: columns.length, className: "text-fg-3 py-12 text-center", children: [
|
|
12419
|
+
"No ",
|
|
12420
|
+
itemLabel,
|
|
12421
|
+
" match your filters."
|
|
12422
|
+
] }) }) : pageRows.map((row) => /* @__PURE__ */ jsx(
|
|
12423
|
+
DataTableRow,
|
|
12424
|
+
{
|
|
12425
|
+
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
12426
|
+
className: onRowClick ? "cursor-pointer" : void 0,
|
|
12427
|
+
children: columns.map((c) => /* @__PURE__ */ jsx(DataTableCell, { className: c.align === "right" ? "text-right" : void 0, children: c.render ? c.render(row) : row[c.key] ?? /* @__PURE__ */ jsx(Dash, {}) }, c.key))
|
|
12428
|
+
},
|
|
12429
|
+
String(row[rowKey])
|
|
12430
|
+
)) })
|
|
12431
|
+
] }),
|
|
12432
|
+
/* @__PURE__ */ jsx(
|
|
12433
|
+
DataTablePagination,
|
|
12434
|
+
{
|
|
12435
|
+
current,
|
|
12436
|
+
total,
|
|
12437
|
+
pageSize,
|
|
12438
|
+
onPageChange: setPage
|
|
12439
|
+
}
|
|
12440
|
+
)
|
|
12441
|
+
] });
|
|
12442
|
+
}
|
|
12443
|
+
var toneClass = {
|
|
12444
|
+
slate: "bg-bg-3 text-fg-3",
|
|
12445
|
+
blue: "bg-[color-mix(in_oklab,var(--color-brand-audit)_14%,transparent)] text-[color:var(--color-brand-audit)]",
|
|
12446
|
+
violet: "bg-pro-bg text-pro-fg",
|
|
12447
|
+
amber: "bg-warning-bg text-warning-fg",
|
|
12448
|
+
ok: "bg-success-bg text-success-fg",
|
|
12449
|
+
rose: "bg-danger-bg text-danger-fg"
|
|
12450
|
+
};
|
|
12451
|
+
function Dash() {
|
|
12452
|
+
return /* @__PURE__ */ jsx("span", { className: "text-fg-5", children: "\u2014" });
|
|
12453
|
+
}
|
|
12454
|
+
function StagePill({
|
|
12455
|
+
tone = "slate",
|
|
12456
|
+
dot = true,
|
|
12457
|
+
children
|
|
12458
|
+
}) {
|
|
12459
|
+
return /* @__PURE__ */ jsxs(
|
|
12460
|
+
"span",
|
|
12461
|
+
{
|
|
12462
|
+
className: cn(
|
|
12463
|
+
"inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-xs font-medium",
|
|
12464
|
+
toneClass[tone]
|
|
12465
|
+
),
|
|
12466
|
+
children: [
|
|
12467
|
+
dot && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-1.5 rounded-full bg-current" }),
|
|
12468
|
+
children
|
|
12469
|
+
]
|
|
12470
|
+
}
|
|
12471
|
+
);
|
|
12472
|
+
}
|
|
12473
|
+
function Assignee({ name }) {
|
|
12474
|
+
if (!name) return /* @__PURE__ */ jsx("span", { className: "text-fg-4 text-[13px]", children: "Unassigned" });
|
|
12475
|
+
return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
12476
|
+
/* @__PURE__ */ jsx(Avatar, { name, size: "xs" }),
|
|
12477
|
+
/* @__PURE__ */ jsx("span", { className: "text-fg-2 truncate text-[13px]", children: name })
|
|
12478
|
+
] });
|
|
12479
|
+
}
|
|
12480
|
+
function MoneyCell({ value }) {
|
|
12481
|
+
if (!value) return /* @__PURE__ */ jsx(Dash, {});
|
|
12482
|
+
return /* @__PURE__ */ jsxs("span", { className: "text-fg font-medium tabular-nums", children: [
|
|
12483
|
+
"$",
|
|
12484
|
+
value.toLocaleString()
|
|
12485
|
+
] });
|
|
12486
|
+
}
|
|
12487
|
+
function TagsCell({ items = [] }) {
|
|
12488
|
+
if (items.length === 0) return /* @__PURE__ */ jsx(Dash, {});
|
|
12489
|
+
return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
12490
|
+
/* @__PURE__ */ jsx("span", { className: "bg-bg-2 text-fg-3 border-rule rounded-pill border px-2 py-0.5 text-xs", children: items[0] }),
|
|
12491
|
+
items.length > 1 && /* @__PURE__ */ jsxs("span", { className: "text-fg-4 text-xs tabular-nums", children: [
|
|
12492
|
+
"+",
|
|
12493
|
+
items.length - 1
|
|
12494
|
+
] })
|
|
12495
|
+
] });
|
|
12496
|
+
}
|
|
12016
12497
|
var DetailGrid = forwardRef(function DetailGrid2({ className, ...props }, ref) {
|
|
12017
12498
|
return /* @__PURE__ */ jsx(
|
|
12018
12499
|
"div",
|
|
@@ -13436,7 +13917,288 @@ var KbdHint = forwardRef(function KbdHint2({ className, children, ...props }, re
|
|
|
13436
13917
|
);
|
|
13437
13918
|
});
|
|
13438
13919
|
KbdHint.displayName = "KbdHint";
|
|
13920
|
+
function SuggestionPills({
|
|
13921
|
+
suggestions,
|
|
13922
|
+
onPick,
|
|
13923
|
+
loading,
|
|
13924
|
+
label = "Smart replies",
|
|
13925
|
+
className
|
|
13926
|
+
}) {
|
|
13927
|
+
if (!loading && suggestions.length === 0) return null;
|
|
13928
|
+
return /* @__PURE__ */ jsxs(
|
|
13929
|
+
"div",
|
|
13930
|
+
{
|
|
13931
|
+
className: cn(
|
|
13932
|
+
"ds-suggestion-bar flex items-center gap-2 overflow-x-auto border-t border-border/60 bg-gradient-to-b from-brand-soft/40 to-transparent px-4 py-2.5 [scrollbar-width:none]",
|
|
13933
|
+
className
|
|
13934
|
+
),
|
|
13935
|
+
children: [
|
|
13936
|
+
/* @__PURE__ */ jsxs("span", { className: "flex shrink-0 items-center gap-1.5 text-[11px] font-medium text-muted-foreground", children: [
|
|
13937
|
+
/* @__PURE__ */ jsx(SparkleIcon, { className: "ds-suggestion-spark size-3.5 text-brand", "aria-hidden": "true" }),
|
|
13938
|
+
label
|
|
13939
|
+
] }),
|
|
13940
|
+
loading ? [0, 1].map((i) => /* @__PURE__ */ jsx("span", { className: "h-7 w-32 shrink-0 animate-pulse rounded-full bg-muted" }, i)) : suggestions.map((text, i) => /* @__PURE__ */ jsx(
|
|
13941
|
+
"button",
|
|
13942
|
+
{
|
|
13943
|
+
type: "button",
|
|
13944
|
+
onClick: () => onPick(text),
|
|
13945
|
+
title: text,
|
|
13946
|
+
style: { animationDelay: `${i * 110}ms` },
|
|
13947
|
+
className: cn(
|
|
13948
|
+
"ds-suggestion-pill max-w-[260px] shrink-0 truncate whitespace-nowrap rounded-full border px-3.5 py-1.5 text-[12px] font-medium",
|
|
13949
|
+
"border-brand/30 bg-brand-soft text-brand-soft-foreground shadow-[0_1px_6px_rgba(108,66,248,0.14)]",
|
|
13950
|
+
"transition-all hover:-translate-y-0.5 hover:border-brand/50 hover:bg-brand/10 hover:shadow-[0_3px_10px_rgba(108,66,248,0.22)]",
|
|
13951
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
13952
|
+
),
|
|
13953
|
+
children: text
|
|
13954
|
+
},
|
|
13955
|
+
text + i
|
|
13956
|
+
))
|
|
13957
|
+
]
|
|
13958
|
+
}
|
|
13959
|
+
);
|
|
13960
|
+
}
|
|
13961
|
+
SuggestionPills.displayName = "SuggestionPills";
|
|
13962
|
+
function AiDraftCard({
|
|
13963
|
+
state,
|
|
13964
|
+
title = "AI Draft",
|
|
13965
|
+
contextLine,
|
|
13966
|
+
subject,
|
|
13967
|
+
children,
|
|
13968
|
+
actions,
|
|
13969
|
+
error,
|
|
13970
|
+
onRetry,
|
|
13971
|
+
onDismiss,
|
|
13972
|
+
resetCollapseKey,
|
|
13973
|
+
className
|
|
13974
|
+
}) {
|
|
13975
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
13976
|
+
const [prevKey, setPrevKey] = useState(resetCollapseKey);
|
|
13977
|
+
if (resetCollapseKey !== prevKey) {
|
|
13978
|
+
setPrevKey(resetCollapseKey);
|
|
13979
|
+
setCollapsed(false);
|
|
13980
|
+
}
|
|
13981
|
+
if (state === "loading" || state === "refining") {
|
|
13982
|
+
const duration = state === "loading" ? "1200ms" : "800ms";
|
|
13983
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ds-ai-surface rounded-lg p-3", className), children: [
|
|
13984
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-2", children: [
|
|
13985
|
+
/* @__PURE__ */ jsx(SparkleIcon, { size: 14, className: "animate-pulse-soft text-brand" }),
|
|
13986
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-brand", children: state === "loading" ? "Generating draft..." : "Refining..." })
|
|
13987
|
+
] }),
|
|
13988
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: [90, 100, 75, 60].map((width, i) => /* @__PURE__ */ jsx(
|
|
13989
|
+
"div",
|
|
13990
|
+
{
|
|
13991
|
+
className: "h-3 animate-pulse-soft rounded bg-brand/20",
|
|
13992
|
+
style: { width: `${width}%`, animationDuration: duration }
|
|
13993
|
+
},
|
|
13994
|
+
i
|
|
13995
|
+
)) })
|
|
13996
|
+
] });
|
|
13997
|
+
}
|
|
13998
|
+
if (state === "error") {
|
|
13999
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border border-destructive/20 bg-destructive/5 p-3", className), children: [
|
|
14000
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: error ?? "Something went wrong." }),
|
|
14001
|
+
(onRetry || onDismiss) && /* @__PURE__ */ jsxs("div", { className: "mt-2 flex gap-2", children: [
|
|
14002
|
+
onRetry && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: onRetry, className: "text-destructive", children: "Retry" }),
|
|
14003
|
+
onDismiss && /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: onDismiss, children: "Dismiss" })
|
|
14004
|
+
] })
|
|
14005
|
+
] });
|
|
14006
|
+
}
|
|
14007
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ds-ai-surface rounded-lg p-3", className), children: [
|
|
14008
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", !collapsed && "mb-2"), children: [
|
|
14009
|
+
/* @__PURE__ */ jsx(SparkleIcon, { size: 14, className: "text-brand" }),
|
|
14010
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-bold text-brand", children: title }),
|
|
14011
|
+
contextLine && /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: contextLine }),
|
|
14012
|
+
/* @__PURE__ */ jsx(
|
|
14013
|
+
"button",
|
|
14014
|
+
{
|
|
14015
|
+
type: "button",
|
|
14016
|
+
onClick: () => setCollapsed((c) => !c),
|
|
14017
|
+
"aria-expanded": !collapsed,
|
|
14018
|
+
"aria-label": collapsed ? "Expand AI draft" : "Collapse AI draft",
|
|
14019
|
+
title: collapsed ? "Show draft" : "Hide draft",
|
|
14020
|
+
className: "ml-auto -mr-1 shrink-0 rounded p-1 text-brand/70 transition-colors hover:bg-brand/10 hover:text-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
14021
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: 16, className: cn("transition-transform", collapsed && "-rotate-90") })
|
|
14022
|
+
}
|
|
14023
|
+
)
|
|
14024
|
+
] }),
|
|
14025
|
+
!collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14026
|
+
subject && /* @__PURE__ */ jsx("p", { className: "mb-1.5 text-sm font-semibold text-foreground", children: subject }),
|
|
14027
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-[140px] overflow-y-auto text-sm font-medium leading-relaxed text-foreground", children }),
|
|
14028
|
+
actions && /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: actions })
|
|
14029
|
+
] })
|
|
14030
|
+
] });
|
|
14031
|
+
}
|
|
14032
|
+
AiDraftCard.displayName = "AiDraftCard";
|
|
14033
|
+
function EmailMessageCard({
|
|
14034
|
+
direction,
|
|
14035
|
+
senderName,
|
|
14036
|
+
subject,
|
|
14037
|
+
time,
|
|
14038
|
+
via = "Email",
|
|
14039
|
+
avatar,
|
|
14040
|
+
ccCount = 0,
|
|
14041
|
+
children,
|
|
14042
|
+
attachments,
|
|
14043
|
+
status,
|
|
14044
|
+
actions,
|
|
14045
|
+
clampHeight = 240,
|
|
14046
|
+
className,
|
|
14047
|
+
...props
|
|
14048
|
+
}) {
|
|
14049
|
+
const isOutbound = direction === "outbound";
|
|
14050
|
+
const subjectText = subject?.trim();
|
|
14051
|
+
const bodyRef = useRef(null);
|
|
14052
|
+
const [needsClamp, setNeedsClamp] = useState(false);
|
|
14053
|
+
const [expanded, setExpanded] = useState(false);
|
|
14054
|
+
useEffect(() => {
|
|
14055
|
+
const el = bodyRef.current;
|
|
14056
|
+
if (el) setNeedsClamp(el.scrollHeight > clampHeight);
|
|
14057
|
+
}, [children, clampHeight]);
|
|
14058
|
+
const clamped = needsClamp && !expanded;
|
|
14059
|
+
const hasFooter = Boolean(attachments || status || actions);
|
|
14060
|
+
return /* @__PURE__ */ jsxs(
|
|
14061
|
+
"div",
|
|
14062
|
+
{
|
|
14063
|
+
className: cn("group flex gap-2", isOutbound ? "flex-row-reverse" : "flex-row", className),
|
|
14064
|
+
...props,
|
|
14065
|
+
children: [
|
|
14066
|
+
!isOutbound && avatar && /* @__PURE__ */ jsx("span", { className: "mt-7 shrink-0", children: avatar }),
|
|
14067
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-col gap-1", isOutbound ? "items-end" : "items-start"), children: [
|
|
14068
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-1", children: [
|
|
14069
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-foreground", children: senderName }),
|
|
14070
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
14071
|
+
"via ",
|
|
14072
|
+
via
|
|
14073
|
+
] }),
|
|
14074
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: "\xB7" }),
|
|
14075
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: time })
|
|
14076
|
+
] }),
|
|
14077
|
+
/* @__PURE__ */ jsxs(
|
|
14078
|
+
"div",
|
|
14079
|
+
{
|
|
14080
|
+
className: cn(
|
|
14081
|
+
"w-full max-w-2xl overflow-hidden rounded-xl border bg-card shadow-sm",
|
|
14082
|
+
isOutbound ? "border-brand/30" : "border-border"
|
|
14083
|
+
),
|
|
14084
|
+
children: [
|
|
14085
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5 border-b border-border bg-brand/5 px-3.5 py-2.5", children: [
|
|
14086
|
+
/* @__PURE__ */ jsx("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-brand/20 bg-brand/10 text-brand", children: /* @__PURE__ */ jsx(MailIcon, { size: 16 }) }),
|
|
14087
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
14088
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
14089
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 rounded px-1.5 py-px text-[10px] font-bold uppercase tracking-wider text-brand", children: "Email" }),
|
|
14090
|
+
subjectText && /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-sm font-semibold text-foreground", children: subjectText })
|
|
14091
|
+
] }),
|
|
14092
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex flex-wrap items-center gap-1.5 text-[10px] text-muted-foreground", children: [
|
|
14093
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
14094
|
+
"From ",
|
|
14095
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground/80", children: senderName })
|
|
14096
|
+
] }),
|
|
14097
|
+
ccCount > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14098
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: "\xB7" }),
|
|
14099
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
14100
|
+
"Cc ",
|
|
14101
|
+
ccCount
|
|
14102
|
+
] })
|
|
14103
|
+
] })
|
|
14104
|
+
] })
|
|
14105
|
+
] }),
|
|
14106
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 whitespace-nowrap pt-0.5 text-[10px] text-muted-foreground", children: time })
|
|
14107
|
+
] }),
|
|
14108
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
14109
|
+
/* @__PURE__ */ jsx(
|
|
14110
|
+
"div",
|
|
14111
|
+
{
|
|
14112
|
+
ref: bodyRef,
|
|
14113
|
+
className: cn(
|
|
14114
|
+
"px-4 py-3 text-sm leading-relaxed text-foreground",
|
|
14115
|
+
clamped && "max-h-56 overflow-hidden"
|
|
14116
|
+
),
|
|
14117
|
+
children
|
|
14118
|
+
}
|
|
14119
|
+
),
|
|
14120
|
+
clamped && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-b from-transparent to-card" })
|
|
14121
|
+
] }),
|
|
14122
|
+
needsClamp && /* @__PURE__ */ jsxs(
|
|
14123
|
+
"button",
|
|
14124
|
+
{
|
|
14125
|
+
type: "button",
|
|
14126
|
+
onClick: () => setExpanded((v) => !v),
|
|
14127
|
+
"aria-expanded": expanded,
|
|
14128
|
+
className: "flex w-full items-center justify-center gap-1.5 border-t border-border/60 bg-card py-1.5 text-xs font-medium text-brand transition-colors hover:bg-muted/40",
|
|
14129
|
+
children: [
|
|
14130
|
+
expanded ? "Show less" : "Show full email",
|
|
14131
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 13, className: cn("transition-transform", expanded && "rotate-180") })
|
|
14132
|
+
]
|
|
14133
|
+
}
|
|
14134
|
+
),
|
|
14135
|
+
hasFooter && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border bg-muted/30 px-3 py-2", children: [
|
|
14136
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0", children: attachments }),
|
|
14137
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
14138
|
+
status,
|
|
14139
|
+
actions
|
|
14140
|
+
] })
|
|
14141
|
+
] })
|
|
14142
|
+
]
|
|
14143
|
+
}
|
|
14144
|
+
)
|
|
14145
|
+
] })
|
|
14146
|
+
]
|
|
14147
|
+
}
|
|
14148
|
+
);
|
|
14149
|
+
}
|
|
14150
|
+
EmailMessageCard.displayName = "EmailMessageCard";
|
|
14151
|
+
function SignatureEditor({
|
|
14152
|
+
title = "Email signature",
|
|
14153
|
+
children,
|
|
14154
|
+
loading = false,
|
|
14155
|
+
onAddImage,
|
|
14156
|
+
addingImage = false,
|
|
14157
|
+
onSave,
|
|
14158
|
+
saving = false,
|
|
14159
|
+
onInsert,
|
|
14160
|
+
className
|
|
14161
|
+
}) {
|
|
14162
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", className), children: [
|
|
14163
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [
|
|
14164
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-foreground", children: title }),
|
|
14165
|
+
onAddImage && /* @__PURE__ */ jsxs(
|
|
14166
|
+
Button,
|
|
14167
|
+
{
|
|
14168
|
+
type: "button",
|
|
14169
|
+
variant: "ghost",
|
|
14170
|
+
size: "sm",
|
|
14171
|
+
className: "h-7 gap-1.5 text-xs",
|
|
14172
|
+
disabled: addingImage || loading,
|
|
14173
|
+
loading: addingImage,
|
|
14174
|
+
onClick: onAddImage,
|
|
14175
|
+
children: [
|
|
14176
|
+
/* @__PURE__ */ jsx(UploadIcon, { size: 13 }),
|
|
14177
|
+
"Add image"
|
|
14178
|
+
]
|
|
14179
|
+
}
|
|
14180
|
+
)
|
|
14181
|
+
] }),
|
|
14182
|
+
/* @__PURE__ */ jsx("div", { className: "p-3", children: loading ? /* @__PURE__ */ jsx("div", { className: "h-32 animate-pulse rounded-md bg-muted" }) : children }),
|
|
14183
|
+
(onSave || onInsert) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2 border-t border-border px-3 py-2", children: [
|
|
14184
|
+
onSave && /* @__PURE__ */ jsx(
|
|
14185
|
+
Button,
|
|
14186
|
+
{
|
|
14187
|
+
type: "button",
|
|
14188
|
+
variant: "ghost",
|
|
14189
|
+
size: "sm",
|
|
14190
|
+
disabled: saving || loading,
|
|
14191
|
+
loading: saving,
|
|
14192
|
+
onClick: onSave,
|
|
14193
|
+
children: "Save"
|
|
14194
|
+
}
|
|
14195
|
+
),
|
|
14196
|
+
onInsert && /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", disabled: loading, onClick: onInsert, children: "Insert" })
|
|
14197
|
+
] })
|
|
14198
|
+
] });
|
|
14199
|
+
}
|
|
14200
|
+
SignatureEditor.displayName = "SignatureEditor";
|
|
13439
14201
|
|
|
13440
|
-
export { AIReceiptPanel, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityEventItem, ActivityItem, ActivityList, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, AppHeaderBreadcrumb, AppHeaderSearch, AppHeaderTitle, AreaChart, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, AttentionItem, Avatar, Badge, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, BulkActionBarSeparator, Button, COUNTRY_CODES, Calendar, CalendarIcon, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryDivider, CategoryTag, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleDotIcon, CircleIcon, ClientRailGroupHeader, ClientRailItem, ClientSelect, ClipboardCheckIcon, ClockIcon, CloseIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, ComingSoon, CommandIcon, CommandPalette, ConfirmActionButton, Content16 as Content, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DangerAction, DashGrid, DataItem, DataTable, DataTableBody, DataTableCell, DataTableCellDue, DataTableCellId, DataTableCellMono, DataTableCellName, DataTableCheckbox, DataTableHead, DataTableHeader, DataTablePagination, DataTableResultsCount, DataTableRow, DataTableSearch, DataTableSpacer, DataTableToolbar, DatePicker, DateRangePicker, DetailGrid, DetailMain, DetailSpine, DetailSpineHeader, DetailSpineSection, DetailSpineStats, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DocumentFileCard, DocumentFileRow, DocumentIcon, DocumentRequestField, DocumentsWorkspaceLayout, DollarSignIcon, DonutChart, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, EngagementCard, EngagementTimeline, EngagementTimelineStep, EyeIcon, EyeOffIcon, Eyebrow, FileChip, FileIcon, FileReturnIcon, FileTextIcon, FileTypeBadge, FileUpload, FilterChip, FilterIcon, FlagIcon, FolderClosedIcon, FolderOpenIcon, FolderPlusIcon, FolderTree, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, IconAction, IconTile, InboxIcon, InfoCircleSolidIcon, InfoIcon, Input, ItalicIcon, Kanban, KanbanCard, KanbanColumn, KanbanIcon, KbdHint, KeyIcon, KeyboardShortcutsDialog, KpiCard, Label4 as Label, LandmarkIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, MapPinIcon, MasterDetailLayout, MenuIcon, MessageBubble, MessageBubbleAction, MessageBubbleTombstone, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, MetadataGrid, MicrosoftBrandIcon, MinusIcon, MissingDocumentsPanel, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelectField, MutedSpec, NewMenu, NotificationFilter, NotificationItem, NotificationList, NotificationPanel, NotificationPanelFooter, NotificationPanelHeader, Numeric, OTPInput, PageHeader, PageHeaderSep, PageHeaderSpec, Pagination, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PaperclipIcon, PauseIcon, PenSignIcon, PenToolIcon, PencilIcon, PhoneCountryInput, PhoneIcon, PhoneInput, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, PrimaryAction, PriorityIcon, ProgressBar, ProgressRing, RadioGroup3 as RadioGroup, RadioGroupItem, RankedBars, ReceiptIcon, ReplyIcon, ResponsiveDialog, RotateCcwIcon, RouteTransition, SERVICE_TONES, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, SearchSelect, SecondaryAction, Section, SectionHead, SectionHeader, SegmentedProgress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, SendIcon, Separator4 as Separator, SettingsIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, SidebarBrandSwitcher, SidebarBrandSwitcherTile, SidebarBrandText, SidebarFooter, SidebarLink, SidebarLinkAction, SidebarLinkBadge, SidebarLinkGroup, SidebarLinkLabel, SidebarPinButton, SidebarProvider, SidebarSection, SidebarTrigger, SidebarUser, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, SparkleIcon, SparklesIcon, Spinner, StarIcon, StarRating, Stat, StatusDot, StatusIcon, StatusPill, Stepper, StickyActionBar, StopIcon, StrikethroughIcon, SubmitButton, SuiteProgress, SunIcon, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableIcon, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TeamIcon, TeamMemberSelect, Textarea, TimeLogger, TimeLoggerActions, TimeLoggerBillable, TimeLoggerContextRow, TimeLoggerEntry, TimeLoggerEntryList, TimeLoggerField, TimeLoggerFooter, TimeLoggerHeader, TimeLoggerNotes, TimeLoggerTimer, ToastProvider, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, UserCircleIcon, UserIcon, UsersIcon, VisuallyHidden, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, attachmentChipVariants, badgeVariants, buttonVariants, cardVariants, cn, colors, dateToIso, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getFlagEmoji, iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, radii, reference, searchInputVariants, serviceToneLabel, serviceToneStyle, shadows, sidebarLinkBadgeVariants, spacing, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, surfaces, systemTokens, textareaVariants, typography, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
|
|
14202
|
+
export { AIReceiptPanel, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityEventItem, ActivityItem, ActivityList, AiDraftCard, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, AppHeaderBreadcrumb, AppHeaderSearch, AppHeaderTitle, AreaChart, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, Assignee, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, AttentionItem, Avatar, Badge, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, BulkActionBarSeparator, Button, COUNTRY_CODES, Calendar, CalendarIcon, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryDivider, CategoryTag, ChannelTabs, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleDotIcon, CircleIcon, ClientRailGroupHeader, ClientRailItem, ClientSelect, ClipboardCheckIcon, ClockIcon, CloseIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, ComingSoon, CommandIcon, CommandPalette, ConfirmActionButton, Content16 as Content, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DangerAction, Dash, DashGrid, DataItem, DataTable, DataTableBody, DataTableCell, DataTableCellDue, DataTableCellId, DataTableCellMono, DataTableCellName, DataTableCheckbox, DataTableHead, DataTableHeader, DataTablePagination, DataTableResultsCount, DataTableRow, DataTableSearch, DataTableSpacer, DataTableToolbar, DataTableView, DatePicker, DateRangePicker, DetailGrid, DetailMain, DetailSpine, DetailSpineHeader, DetailSpineSection, DetailSpineStats, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DocumentFileCard, DocumentFileRow, DocumentIcon, DocumentRequestField, DocumentsWorkspaceLayout, DollarSignIcon, DonutChart, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmailMessageCard, EmptyState, EngagementCard, EngagementTimeline, EngagementTimelineStep, EyeIcon, EyeOffIcon, Eyebrow, FileChip, FileIcon, FileReturnIcon, FileTextIcon, FileTypeBadge, FileUpload, FilterChip, FilterIcon, FlagIcon, FolderClosedIcon, FolderOpenIcon, FolderPlusIcon, FolderTree, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, IconAction, IconTile, InboxIcon, InfoCircleSolidIcon, InfoIcon, Input, IntentBadge, ItalicIcon, Kanban, KanbanCard, KanbanColumn, KanbanIcon, KbdHint, KeyIcon, KeyboardShortcutsDialog, KpiCard, Label4 as Label, LandmarkIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, MapPinIcon, MasterDetailLayout, MenuIcon, MessageBubble, MessageBubbleAction, MessageBubbleTombstone, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, MetadataGrid, MicrosoftBrandIcon, MinusIcon, MissingDocumentsPanel, MoneyCell, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelectField, MutedSpec, NewMenu, NotificationFilter, NotificationItem, NotificationList, NotificationPanel, NotificationPanelFooter, NotificationPanelHeader, Numeric, OTPInput, PageHeader, PageHeaderSep, PageHeaderSpec, Pagination, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PaperclipIcon, PauseIcon, PenSignIcon, PenToolIcon, PencilIcon, PhoneCountryInput, PhoneIcon, PhoneInput, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, PrimaryAction, PriorityIcon, ProgressBar, ProgressRing, RadioGroup3 as RadioGroup, RadioGroupItem, RankedBars, ReceiptIcon, ReplyIcon, ResponsiveDialog, RotateCcwIcon, RouteTransition, SERVICE_TONES, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, SearchSelect, SecondaryAction, Section, SectionHead, SectionHeader, SegmentedProgress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, SendIcon, Separator4 as Separator, SettingsIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, SidebarBrandSwitcher, SidebarBrandSwitcherTile, SidebarBrandText, SidebarFooter, SidebarLink, SidebarLinkAction, SidebarLinkBadge, SidebarLinkGroup, SidebarLinkLabel, SidebarPinButton, SidebarProvider, SidebarSection, SidebarTrigger, SidebarUser, SignatureEditor, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, SparkleIcon, SparklesIcon, Spinner, StackedBarChart, StagePill, StarIcon, StarRating, Stat, StatusDot, StatusIcon, StatusPill, Stepper, StickyActionBar, StopIcon, StrikethroughIcon, SubmitButton, SuggestionPills, SuiteProgress, SunIcon, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableIcon, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TagsCell, TeamIcon, TeamMemberSelect, Textarea, TimeLogger, TimeLoggerActions, TimeLoggerBillable, TimeLoggerContextRow, TimeLoggerEntry, TimeLoggerEntryList, TimeLoggerField, TimeLoggerFooter, TimeLoggerHeader, TimeLoggerNotes, TimeLoggerTimer, ToastProvider, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, UserCircleIcon, UserIcon, UsersIcon, VisuallyHidden, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, attachmentChipVariants, badgeVariants, buttonVariants, cardVariants, cn, colors, dateToIso, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getFlagEmoji, iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, radii, reference, searchInputVariants, serviceToneLabel, serviceToneStyle, shadows, sidebarLinkBadgeVariants, spacing, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, surfaces, systemTokens, textareaVariants, typography, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
|
|
13441
14203
|
//# sourceMappingURL=index.js.map
|
|
13442
14204
|
//# sourceMappingURL=index.js.map
|