@platned/ui 1.1.0 → 1.1.2
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/blocks.cjs +1464 -1163
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.d.cts +146 -12
- package/dist/blocks.d.ts +146 -12
- package/dist/blocks.js +1294 -988
- package/dist/blocks.js.map +1 -1
- package/dist/{data-table-Dec6t8NO.d.ts → data-table-CcIINjPg.d.ts} +30 -3
- package/dist/data-table.cjs +199 -124
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +152 -76
- package/dist/data-table.js.map +1 -1
- package/dist/index.cjs +257 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/dist/map.d.cts +2 -0
- package/dist/map.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8547,6 +8547,9 @@ function NavParentRow({ item }) {
|
|
|
8547
8547
|
const row = useRow();
|
|
8548
8548
|
const children = item.children ?? [];
|
|
8549
8549
|
const childActive = children.some((child) => isRowActive(child, row));
|
|
8550
|
+
const links = Boolean(item.to || item.href);
|
|
8551
|
+
const ownActive = links && !childActive && isRowActive(item, row);
|
|
8552
|
+
const ownCurrent = ownActive ? { "aria-current": "page" } : {};
|
|
8550
8553
|
if (row.submenus === "dropdown") {
|
|
8551
8554
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(SidebarMenuItem, { children: [
|
|
8552
8555
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(DropdownMenu, { children: [
|
|
@@ -8554,7 +8557,7 @@ function NavParentRow({ item }) {
|
|
|
8554
8557
|
SidebarMenuButton,
|
|
8555
8558
|
{
|
|
8556
8559
|
tooltip: item.label,
|
|
8557
|
-
isActive: childActive,
|
|
8560
|
+
isActive: childActive || ownActive,
|
|
8558
8561
|
disabled: item.disabled,
|
|
8559
8562
|
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
8560
8563
|
children: [
|
|
@@ -8563,14 +8566,31 @@ function NavParentRow({ item }) {
|
|
|
8563
8566
|
]
|
|
8564
8567
|
}
|
|
8565
8568
|
) }),
|
|
8566
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8569
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(DropdownMenuContent, { side: row.isMobile ? "bottom" : "right", align: "start", className: "min-w-48", children: [
|
|
8570
|
+
links && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
8571
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DropdownMenuItem, { asChild: true, disabled: item.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLink, { item, row, ...ownCurrent, children: item.label }) }),
|
|
8572
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DropdownMenuSeparator, {})
|
|
8573
|
+
] }),
|
|
8574
|
+
children.map((child) => {
|
|
8575
|
+
const active = isRowActive(child, row);
|
|
8576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DropdownMenuItem, { asChild: true, disabled: child.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLink, { item: child, row, ...active ? { "aria-current": "page" } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLabel, { item: child }) }) }, itemKey(child));
|
|
8577
|
+
})
|
|
8578
|
+
] })
|
|
8570
8579
|
] }),
|
|
8571
8580
|
rowAction(item)
|
|
8572
8581
|
] });
|
|
8573
8582
|
}
|
|
8583
|
+
const sub = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SidebarMenuSub, { children: children.map((child) => {
|
|
8584
|
+
const active = isRowActive(child, row);
|
|
8585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SidebarMenuSubItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SidebarMenuSubButton, { asChild: true, isActive: active, ...active ? { "aria-current": "page" } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLink, { item: child, row, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLabel, { item: child }) }) }) }, itemKey(child));
|
|
8586
|
+
}) }) });
|
|
8587
|
+
if (links) {
|
|
8588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Collapsible, { asChild: true, defaultOpen: item.defaultOpen ?? (childActive || ownActive), className: "group/collapsible", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(SidebarMenuItem, { children: [
|
|
8589
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SidebarMenuButton, { asChild: true, tooltip: item.label, isActive: childActive || ownActive, ...ownCurrent, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLink, { item, row, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLabel, { item }) }) }),
|
|
8590
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SidebarMenuAction, { "aria-label": `${item.label} pages`, disabled: item.disabled, className: "data-[state=open]:[&>svg]:rotate-90", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react19.ChevronRightIcon, { className: "transition-transform duration-200 rtl:rotate-180" }) }) }),
|
|
8591
|
+
sub
|
|
8592
|
+
] }) });
|
|
8593
|
+
}
|
|
8574
8594
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Collapsible, { asChild: true, defaultOpen: item.defaultOpen ?? childActive, className: "group/collapsible", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(SidebarMenuItem, { children: [
|
|
8575
8595
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8576
8596
|
SidebarMenuButton,
|
|
@@ -8585,10 +8605,7 @@ function NavParentRow({ item }) {
|
|
|
8585
8605
|
]
|
|
8586
8606
|
}
|
|
8587
8607
|
) }),
|
|
8588
|
-
|
|
8589
|
-
const active = isRowActive(child, row);
|
|
8590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SidebarMenuSubItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SidebarMenuSubButton, { asChild: true, isActive: active, ...active ? { "aria-current": "page" } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLink, { item: child, row, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowLabel, { item: child }) }) }) }, itemKey(child));
|
|
8591
|
-
}) }) })
|
|
8608
|
+
sub
|
|
8592
8609
|
] }) });
|
|
8593
8610
|
}
|
|
8594
8611
|
function filterNav(groups, isVisible) {
|
|
@@ -9928,7 +9945,7 @@ var TableCaption = (0, import_react61.forwardRef)(function TableCaption2({ class
|
|
|
9928
9945
|
});
|
|
9929
9946
|
|
|
9930
9947
|
// src/components/lists/data-table.tsx
|
|
9931
|
-
var
|
|
9948
|
+
var import_react67 = require("react");
|
|
9932
9949
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
9933
9950
|
var import_react_table = require("@tanstack/react-table");
|
|
9934
9951
|
var import_lucide_react28 = require("lucide-react");
|
|
@@ -10185,28 +10202,60 @@ function createSelectColumn(options = {}) {
|
|
|
10185
10202
|
meta: { width: "48px", interactive: true, mobile: "hidden", label: "Select" }
|
|
10186
10203
|
};
|
|
10187
10204
|
}
|
|
10205
|
+
function hideableColumns(table) {
|
|
10206
|
+
return table.getAllLeafColumns().filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide() && !column.id.startsWith("__"));
|
|
10207
|
+
}
|
|
10188
10208
|
function DataTableViewOptions({ table, label = "View" }) {
|
|
10189
|
-
const columns = table
|
|
10209
|
+
const columns = hideableColumns(table);
|
|
10190
10210
|
if (columns.length === 0) return null;
|
|
10211
|
+
const hidden = columns.filter((column) => !column.getIsVisible()).length;
|
|
10191
10212
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DropdownMenu, { children: [
|
|
10192
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10213
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
10214
|
+
Button,
|
|
10215
|
+
{
|
|
10216
|
+
variant: "outline",
|
|
10217
|
+
size: "sm",
|
|
10218
|
+
className: "ms-auto h-8",
|
|
10219
|
+
"aria-label": hidden ? `${label}, ${hidden} ${hidden === 1 ? "column" : "columns"} hidden` : void 0,
|
|
10220
|
+
children: [
|
|
10221
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react25.Settings2Icon, {}),
|
|
10222
|
+
label,
|
|
10223
|
+
hidden > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { variant: "secondary", className: "h-5 min-w-5 rounded-full px-1.5 font-normal tabular-nums", children: hidden })
|
|
10224
|
+
]
|
|
10225
|
+
}
|
|
10226
|
+
) }),
|
|
10227
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DropdownMenuContent, { align: "end", className: "min-w-[180px]", children: [
|
|
10197
10228
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
10198
10229
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuSeparator, {}),
|
|
10199
10230
|
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10200
10231
|
DropdownMenuCheckboxItem,
|
|
10201
10232
|
{
|
|
10202
|
-
className: "capitalize",
|
|
10203
10233
|
checked: column.getIsVisible(),
|
|
10204
10234
|
onCheckedChange: (visible) => column.toggleVisibility(visible),
|
|
10205
10235
|
onSelect: (event) => event.preventDefault(),
|
|
10206
10236
|
children: columnLabel(column)
|
|
10207
10237
|
},
|
|
10208
10238
|
column.id
|
|
10209
|
-
))
|
|
10239
|
+
)),
|
|
10240
|
+
hidden > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
10241
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DropdownMenuSeparator, {}),
|
|
10242
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
10243
|
+
DropdownMenuItem,
|
|
10244
|
+
{
|
|
10245
|
+
onClick: () => (
|
|
10246
|
+
// One update: toggling the columns one by one would each start from the same state.
|
|
10247
|
+
table.setColumnVisibility((visibility) => ({
|
|
10248
|
+
...visibility,
|
|
10249
|
+
...Object.fromEntries(columns.map((column) => [column.id, true]))
|
|
10250
|
+
}))
|
|
10251
|
+
),
|
|
10252
|
+
children: [
|
|
10253
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react25.EyeIcon, {}),
|
|
10254
|
+
"Show all columns"
|
|
10255
|
+
]
|
|
10256
|
+
}
|
|
10257
|
+
)
|
|
10258
|
+
] })
|
|
10210
10259
|
] })
|
|
10211
10260
|
] });
|
|
10212
10261
|
}
|
|
@@ -10303,6 +10352,7 @@ function DataTablePagination({
|
|
|
10303
10352
|
}
|
|
10304
10353
|
|
|
10305
10354
|
// src/components/lists/data-table-fields.tsx
|
|
10355
|
+
var import_react64 = require("react");
|
|
10306
10356
|
var import_lucide_react26 = require("lucide-react");
|
|
10307
10357
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
10308
10358
|
var ROW_ACTIONS_COLUMN_ID = "actions";
|
|
@@ -10365,6 +10415,7 @@ function fieldToColumn(field2, format = {}) {
|
|
|
10365
10415
|
options: typeof field2.filter === "object" ? field2.filter.options : void 0,
|
|
10366
10416
|
variant: typeof field2.filter === "object" && field2.filter.variant || "menu",
|
|
10367
10417
|
allLabel: typeof field2.filter === "object" && field2.filter.allLabel || "All",
|
|
10418
|
+
disabled: typeof field2.filter === "object" ? field2.filter.disabled : void 0,
|
|
10368
10419
|
describe: describeFor(field2)
|
|
10369
10420
|
} : void 0;
|
|
10370
10421
|
const mobile = field2.mobile ?? (field2.type === "avatar" ? "title" : field2.type === "status" ? "status" : void 0);
|
|
@@ -10504,20 +10555,31 @@ var DOT = {
|
|
|
10504
10555
|
slate: "bg-badge-dot-slate",
|
|
10505
10556
|
violet: "bg-badge-dot-violet"
|
|
10506
10557
|
};
|
|
10507
|
-
|
|
10558
|
+
var DataTableFacetsContext = (0, import_react64.createContext)({ manual: false });
|
|
10559
|
+
function useFacets(column) {
|
|
10560
|
+
const server = (0, import_react64.useContext)(DataTableFacetsContext);
|
|
10508
10561
|
const meta = column.columnDef.meta?.filter;
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10562
|
+
let counts;
|
|
10563
|
+
let total;
|
|
10564
|
+
if (server.manual) {
|
|
10565
|
+
const own = server.counts?.[column.id];
|
|
10566
|
+
counts = own ? new Map(Object.entries(own)) : null;
|
|
10567
|
+
total = own ? Object.values(own).reduce((sum, n) => sum + n, 0) : void 0;
|
|
10568
|
+
} else {
|
|
10569
|
+
counts = /* @__PURE__ */ new Map();
|
|
10570
|
+
for (const row of column.getFacetedRowModel().rows) {
|
|
10571
|
+
if (row.getIsGrouped()) continue;
|
|
10572
|
+
for (const value of filterValues(row.getValue(column.id))) counts.set(value, (counts.get(value) ?? 0) + 1);
|
|
10573
|
+
}
|
|
10574
|
+
total = column.getFacetedRowModel().rows.filter((row) => !row.getIsGrouped()).length;
|
|
10513
10575
|
}
|
|
10514
|
-
const
|
|
10576
|
+
const known = counts ? [...counts.keys()] : [...new Set(column.getFacetedRowModel().rows.flatMap((row) => filterValues(row.getValue(column.id))))];
|
|
10577
|
+
const values = meta?.options ?? known.sort((a, b) => a.localeCompare(b, void 0, { numeric: true }));
|
|
10515
10578
|
const items = values.map((value) => ({
|
|
10516
10579
|
value,
|
|
10517
10580
|
...meta?.describe(value) ?? { label: value },
|
|
10518
10581
|
icon: void 0
|
|
10519
10582
|
}));
|
|
10520
|
-
const total = column.getFacetedRowModel().rows.filter((row) => !row.getIsGrouped()).length;
|
|
10521
10583
|
return { counts, items, total };
|
|
10522
10584
|
}
|
|
10523
10585
|
function singleValue(column) {
|
|
@@ -10529,10 +10591,10 @@ function singleValue(column) {
|
|
|
10529
10591
|
}
|
|
10530
10592
|
function DataTableButtonFilter({ column, title }) {
|
|
10531
10593
|
const meta = column.columnDef.meta?.filter;
|
|
10532
|
-
const { items } =
|
|
10594
|
+
const { items } = useFacets(column);
|
|
10533
10595
|
const { value, set } = singleValue(column);
|
|
10534
10596
|
const heading = title ?? meta?.title ?? column.columnDef.meta?.label ?? column.id;
|
|
10535
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
10597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DisabledReason, { reason: meta?.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
10536
10598
|
ToggleGroup,
|
|
10537
10599
|
{
|
|
10538
10600
|
type: "single",
|
|
@@ -10540,6 +10602,7 @@ function DataTableButtonFilter({ column, title }) {
|
|
|
10540
10602
|
size: "sm",
|
|
10541
10603
|
spacing: 0,
|
|
10542
10604
|
"aria-label": heading,
|
|
10605
|
+
disabled: Boolean(meta?.disabled),
|
|
10543
10606
|
value: value || "__all",
|
|
10544
10607
|
onValueChange: (next) => set(next === "__all" || !next ? "" : next),
|
|
10545
10608
|
children: [
|
|
@@ -10550,28 +10613,33 @@ function DataTableButtonFilter({ column, title }) {
|
|
|
10550
10613
|
] }, item.value))
|
|
10551
10614
|
]
|
|
10552
10615
|
}
|
|
10553
|
-
);
|
|
10616
|
+
) });
|
|
10617
|
+
}
|
|
10618
|
+
function DisabledReason({ reason, children }) {
|
|
10619
|
+
if (typeof reason !== "string") return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_jsx_runtime62.Fragment, { children });
|
|
10620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "data-slot": "data-table-disabled", title: reason, className: "inline-flex cursor-not-allowed", children });
|
|
10554
10621
|
}
|
|
10555
10622
|
function DataTableTabsFilter({ column, title }) {
|
|
10556
10623
|
const meta = column.columnDef.meta?.filter;
|
|
10557
|
-
const { counts, items, total } =
|
|
10624
|
+
const { counts, items, total } = useFacets(column);
|
|
10558
10625
|
const { value, set } = singleValue(column);
|
|
10559
10626
|
const heading = title ?? meta?.title ?? column.columnDef.meta?.label ?? column.id;
|
|
10560
|
-
const count = (n) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge, { variant: "secondary", className: "ms-1 h-5 min-w-5 rounded-full px-1.5 font-normal tabular-nums", children: n ?? 0 });
|
|
10561
|
-
|
|
10562
|
-
|
|
10627
|
+
const count = (n) => counts && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge, { variant: "secondary", className: "ms-1 h-5 min-w-5 rounded-full px-1.5 font-normal tabular-nums", children: n ?? 0 });
|
|
10628
|
+
const disabled = Boolean(meta?.disabled);
|
|
10629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DisabledReason, { reason: meta?.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Tabs, { value: value || "__all", onValueChange: (next) => set(next === "__all" ? "" : next), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(TabsList, { "aria-label": heading, children: [
|
|
10630
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(TabsTrigger, { value: "__all", disabled, children: [
|
|
10563
10631
|
meta?.allLabel ?? "All",
|
|
10564
10632
|
count(total)
|
|
10565
10633
|
] }),
|
|
10566
|
-
items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(TabsTrigger, { value: item.value, children: [
|
|
10634
|
+
items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(TabsTrigger, { value: item.value, disabled, children: [
|
|
10567
10635
|
item.label,
|
|
10568
|
-
count(counts
|
|
10636
|
+
count(counts?.get(item.value))
|
|
10569
10637
|
] }, item.value))
|
|
10570
|
-
] }) });
|
|
10638
|
+
] }) }) });
|
|
10571
10639
|
}
|
|
10572
10640
|
function DataTableFacetedFilter({ column, title, options }) {
|
|
10573
10641
|
const meta = column.columnDef.meta?.filter;
|
|
10574
|
-
const { counts, items: facetItems } =
|
|
10642
|
+
const { counts, items: facetItems } = useFacets(column);
|
|
10575
10643
|
const items = options ?? facetItems;
|
|
10576
10644
|
const selected = new Set(column.getFilterValue() ?? []);
|
|
10577
10645
|
const heading = title ?? meta?.title ?? column.columnDef.meta?.label ?? column.id;
|
|
@@ -10581,8 +10649,8 @@ function DataTableFacetedFilter({ column, title, options }) {
|
|
|
10581
10649
|
else next.add(value);
|
|
10582
10650
|
column.setFilterValue(next.size ? [...next] : void 0);
|
|
10583
10651
|
};
|
|
10584
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Popover, { children: [
|
|
10585
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Button, { variant: "outline", size: "sm", className: "h-8 border-dashed", children: [
|
|
10652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DisabledReason, { reason: meta?.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Popover, { children: [
|
|
10653
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Button, { variant: "outline", size: "sm", className: "h-8 border-dashed", disabled: Boolean(meta?.disabled), children: [
|
|
10586
10654
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react26.PlusCircleIcon, {}),
|
|
10587
10655
|
heading,
|
|
10588
10656
|
selected.size > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
@@ -10621,9 +10689,9 @@ function DataTableFacetedFilter({ column, title, options }) {
|
|
|
10621
10689
|
item.color && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-hidden": "true", className: cn("size-2 rounded-full", DOT[item.color]) }),
|
|
10622
10690
|
item.icon,
|
|
10623
10691
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: item.label }),
|
|
10624
|
-
counts
|
|
10692
|
+
counts?.get(item.value) ? (
|
|
10625
10693
|
// A shortcut slot, so it takes the item's end (and the item's own check hides).
|
|
10626
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CommandShortcut, { className: "font-mono tracking-normal", children: counts
|
|
10694
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CommandShortcut, { className: "font-mono tracking-normal", children: counts?.get(item.value) })
|
|
10627
10695
|
) : null
|
|
10628
10696
|
]
|
|
10629
10697
|
},
|
|
@@ -10636,11 +10704,11 @@ function DataTableFacetedFilter({ column, title, options }) {
|
|
|
10636
10704
|
] })
|
|
10637
10705
|
] })
|
|
10638
10706
|
] }) })
|
|
10639
|
-
] });
|
|
10707
|
+
] }) });
|
|
10640
10708
|
}
|
|
10641
10709
|
|
|
10642
10710
|
// src/components/lists/data-table-features.tsx
|
|
10643
|
-
var
|
|
10711
|
+
var import_react65 = require("react");
|
|
10644
10712
|
var import_lucide_react27 = require("lucide-react");
|
|
10645
10713
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
10646
10714
|
var EXPAND_COLUMN_ID = "expand";
|
|
@@ -10680,9 +10748,9 @@ function expandColumn() {
|
|
|
10680
10748
|
};
|
|
10681
10749
|
}
|
|
10682
10750
|
var detailId = (rowId) => `data-table-detail-${rowId.replace(/[^\w-]/g, "_")}`;
|
|
10683
|
-
var RowDragContext = (0,
|
|
10751
|
+
var RowDragContext = (0, import_react65.createContext)(null);
|
|
10684
10752
|
function DragHandle() {
|
|
10685
|
-
const drag = (0,
|
|
10753
|
+
const drag = (0, import_react65.useContext)(RowDragContext);
|
|
10686
10754
|
if (!drag) return null;
|
|
10687
10755
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10688
10756
|
Button,
|
|
@@ -10779,7 +10847,7 @@ var import_utilities = require("@dnd-kit/utilities");
|
|
|
10779
10847
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
10780
10848
|
|
|
10781
10849
|
// src/components/feedback/progress.tsx
|
|
10782
|
-
var
|
|
10850
|
+
var import_react66 = require("react");
|
|
10783
10851
|
var import_radix_ui25 = require("radix-ui");
|
|
10784
10852
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
10785
10853
|
var FILL2 = {
|
|
@@ -10789,7 +10857,7 @@ var FILL2 = {
|
|
|
10789
10857
|
danger: "bg-destructive",
|
|
10790
10858
|
neutral: "bg-muted-foreground"
|
|
10791
10859
|
};
|
|
10792
|
-
var Progress = (0,
|
|
10860
|
+
var Progress = (0, import_react66.forwardRef)(function Progress2({ className, value, max = 100, tone = "brand", ...props }, ref) {
|
|
10793
10861
|
const clamped = value == null ? value : Math.min(max, Math.max(0, value));
|
|
10794
10862
|
const percent = clamped == null ? 0 : clamped / max * 100;
|
|
10795
10863
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
@@ -10944,14 +11012,14 @@ function resolve(updater, previous) {
|
|
|
10944
11012
|
return typeof updater === "function" ? updater(previous) : updater;
|
|
10945
11013
|
}
|
|
10946
11014
|
function useTableState(controlled, initial, onChange) {
|
|
10947
|
-
const [inner, setInner] = (0,
|
|
11015
|
+
const [inner, setInner] = (0, import_react67.useState)(initial);
|
|
10948
11016
|
const value = controlled ?? inner;
|
|
10949
|
-
const latest = (0,
|
|
11017
|
+
const latest = (0, import_react67.useRef)(value);
|
|
10950
11018
|
latest.current = value;
|
|
10951
11019
|
const isControlled = controlled !== void 0;
|
|
10952
|
-
const onChangeRef = (0,
|
|
11020
|
+
const onChangeRef = (0, import_react67.useRef)(onChange);
|
|
10953
11021
|
onChangeRef.current = onChange;
|
|
10954
|
-
const set = (0,
|
|
11022
|
+
const set = (0, import_react67.useCallback)(
|
|
10955
11023
|
(updater) => {
|
|
10956
11024
|
const next = resolve(updater, latest.current);
|
|
10957
11025
|
if (!isControlled) setInner(next);
|
|
@@ -10975,9 +11043,9 @@ function CellInteractionGuard({ children }) {
|
|
|
10975
11043
|
}
|
|
10976
11044
|
var HEADER_PADDING_PX = 16;
|
|
10977
11045
|
function useHeaderWidths(padding, deps) {
|
|
10978
|
-
const nodes = (0,
|
|
10979
|
-
const [widths, setWidths] = (0,
|
|
10980
|
-
const measure = (0,
|
|
11046
|
+
const nodes = (0, import_react67.useRef)(/* @__PURE__ */ new Map());
|
|
11047
|
+
const [widths, setWidths] = (0, import_react67.useState)({});
|
|
11048
|
+
const measure = (0, import_react67.useCallback)(() => {
|
|
10981
11049
|
const next = {};
|
|
10982
11050
|
nodes.current.forEach((node, id) => {
|
|
10983
11051
|
next[id] = Math.ceil(node.getBoundingClientRect().width) + padding;
|
|
@@ -10988,15 +11056,15 @@ function useHeaderWidths(padding, deps) {
|
|
|
10988
11056
|
return same ? previous : next;
|
|
10989
11057
|
});
|
|
10990
11058
|
}, [padding]);
|
|
10991
|
-
(0,
|
|
10992
|
-
(0,
|
|
11059
|
+
(0, import_react67.useLayoutEffect)(measure, [measure, deps]);
|
|
11060
|
+
(0, import_react67.useLayoutEffect)(() => {
|
|
10993
11061
|
let live = true;
|
|
10994
11062
|
void document.fonts?.ready.then(() => live && measure());
|
|
10995
11063
|
return () => {
|
|
10996
11064
|
live = false;
|
|
10997
11065
|
};
|
|
10998
11066
|
}, [measure]);
|
|
10999
|
-
const register = (0,
|
|
11067
|
+
const register = (0, import_react67.useCallback)(
|
|
11000
11068
|
(id) => (node) => {
|
|
11001
11069
|
if (node) nodes.current.set(id, node);
|
|
11002
11070
|
else nodes.current.delete(id);
|
|
@@ -11006,9 +11074,9 @@ function useHeaderWidths(padding, deps) {
|
|
|
11006
11074
|
return { widths, register };
|
|
11007
11075
|
}
|
|
11008
11076
|
function useScrollEdges() {
|
|
11009
|
-
const [node, setNode] = (0,
|
|
11010
|
-
const [edges, setEdges] = (0,
|
|
11011
|
-
const measure = (0,
|
|
11077
|
+
const [node, setNode] = (0, import_react67.useState)(null);
|
|
11078
|
+
const [edges, setEdges] = (0, import_react67.useState)({ overflowing: false, atStart: true, atEnd: true, overflowingY: false, atTop: true });
|
|
11079
|
+
const measure = (0, import_react67.useCallback)(() => {
|
|
11012
11080
|
if (!node) return;
|
|
11013
11081
|
const { scrollLeft, scrollWidth, clientWidth, scrollTop, scrollHeight, clientHeight } = node;
|
|
11014
11082
|
const next = {
|
|
@@ -11022,7 +11090,7 @@ function useScrollEdges() {
|
|
|
11022
11090
|
(previous) => previous.overflowing === next.overflowing && previous.atStart === next.atStart && previous.atEnd === next.atEnd && previous.overflowingY === next.overflowingY && previous.atTop === next.atTop ? previous : next
|
|
11023
11091
|
);
|
|
11024
11092
|
}, [node]);
|
|
11025
|
-
(0,
|
|
11093
|
+
(0, import_react67.useLayoutEffect)(() => {
|
|
11026
11094
|
if (!node) return;
|
|
11027
11095
|
measure();
|
|
11028
11096
|
if (typeof ResizeObserver === "undefined") return;
|
|
@@ -11088,6 +11156,11 @@ function DataTable({
|
|
|
11088
11156
|
bordered = true,
|
|
11089
11157
|
className
|
|
11090
11158
|
}) {
|
|
11159
|
+
const fill = maxHeight === "fill";
|
|
11160
|
+
const facetCounts = (0, import_react67.useMemo)(
|
|
11161
|
+
() => ({ manual: Boolean(manual.filtering), counts: manual.facets }),
|
|
11162
|
+
[manual.filtering, manual.facets]
|
|
11163
|
+
);
|
|
11091
11164
|
if (!label && !caption) {
|
|
11092
11165
|
devWarn('DataTable needs `label` or `caption`: an unnamed table is announced as just "table".');
|
|
11093
11166
|
}
|
|
@@ -11102,8 +11175,8 @@ function DataTable({
|
|
|
11102
11175
|
})),
|
|
11103
11176
|
onSortingChange
|
|
11104
11177
|
);
|
|
11105
|
-
const [ownOrder, setOwnOrder] = (0,
|
|
11106
|
-
(0,
|
|
11178
|
+
const [ownOrder, setOwnOrder] = (0, import_react67.useState)(null);
|
|
11179
|
+
(0, import_react67.useEffect)(() => setOwnOrder(null), [data]);
|
|
11107
11180
|
const tableData = ownOrder ?? data;
|
|
11108
11181
|
const moveRow = (from, to) => {
|
|
11109
11182
|
const next = (0, import_sortable.arrayMove)(tableData, from, to);
|
|
@@ -11111,10 +11184,10 @@ function DataTable({
|
|
|
11111
11184
|
else setOwnOrder(next);
|
|
11112
11185
|
};
|
|
11113
11186
|
const group = typeof groupBy === "string" ? { key: groupBy } : groupBy;
|
|
11114
|
-
const [groupsExpanded, setGroupsExpanded] = (0,
|
|
11115
|
-
const [openRows, setOpenRows] = (0,
|
|
11116
|
-
const [pinOverrides, setPinOverrides] = (0,
|
|
11117
|
-
const [widthOverrides, setWidthOverrides] = (0,
|
|
11187
|
+
const [groupsExpanded, setGroupsExpanded] = (0, import_react67.useState)(group?.defaultCollapsed ? {} : true);
|
|
11188
|
+
const [openRows, setOpenRows] = (0, import_react67.useState)(() => new Set(expand?.defaultExpanded ?? []));
|
|
11189
|
+
const [pinOverrides, setPinOverrides] = (0, import_react67.useState)({});
|
|
11190
|
+
const [widthOverrides, setWidthOverrides] = (0, import_react67.useState)({});
|
|
11118
11191
|
const getRowHref = getRowHrefProp ?? (rowHref ? (row) => fillTemplate(rowHref, row) : void 0);
|
|
11119
11192
|
const format = useFormat();
|
|
11120
11193
|
const [globalFilter, setGlobalFilter] = useTableState(state.globalFilter, "", onGlobalFilterChange);
|
|
@@ -11131,7 +11204,7 @@ function DataTable({
|
|
|
11131
11204
|
);
|
|
11132
11205
|
const [rowSelection, setRowSelection] = useTableState(state.rowSelection, {}, onRowSelectionChange);
|
|
11133
11206
|
const hasExpand = Boolean(expand);
|
|
11134
|
-
const allColumns = (0,
|
|
11207
|
+
const allColumns = (0, import_react67.useMemo)(() => {
|
|
11135
11208
|
let cols = columns.map(
|
|
11136
11209
|
(column) => isFieldColumn(column) ? fieldToColumn(column, format) : column
|
|
11137
11210
|
);
|
|
@@ -11182,7 +11255,7 @@ function DataTable({
|
|
|
11182
11255
|
group?.by,
|
|
11183
11256
|
reorderable
|
|
11184
11257
|
]);
|
|
11185
|
-
const fieldsByKey = (0,
|
|
11258
|
+
const fieldsByKey = (0, import_react67.useMemo)(() => {
|
|
11186
11259
|
const map = /* @__PURE__ */ new Map();
|
|
11187
11260
|
for (const column of columns) if (isFieldColumn(column)) map.set(column.key, column);
|
|
11188
11261
|
return map;
|
|
@@ -11206,16 +11279,16 @@ function DataTable({
|
|
|
11206
11279
|
...columnIds.filter((id) => !isUtility(id) && !pinOf(id)),
|
|
11207
11280
|
...columnIds.filter((id) => !isUtility(id) && pinOf(id) === "end")
|
|
11208
11281
|
].join("\0");
|
|
11209
|
-
const columnOrder = (0,
|
|
11282
|
+
const columnOrder = (0, import_react67.useMemo)(() => orderKey.split("\0"), [orderKey]);
|
|
11210
11283
|
const anyStartPin = columnIds.some((id) => !isUtility(id) && pinOf(id) === "start");
|
|
11211
11284
|
const effectivePin = (id) => isUtility(id) ? anyStartPin ? "start" : void 0 : pinOf(id);
|
|
11212
11285
|
const grouped = Boolean(group);
|
|
11213
11286
|
const groupDesc = group?.order === "desc";
|
|
11214
|
-
const effectiveSorting = (0,
|
|
11287
|
+
const effectiveSorting = (0, import_react67.useMemo)(
|
|
11215
11288
|
() => grouped ? [{ id: GROUP_COLUMN_ID, desc: groupDesc }, ...sorting.filter((sort) => sort.id !== GROUP_COLUMN_ID)] : sorting,
|
|
11216
11289
|
[grouped, groupDesc, sorting]
|
|
11217
11290
|
);
|
|
11218
|
-
const effectiveVisibility = (0,
|
|
11291
|
+
const effectiveVisibility = (0, import_react67.useMemo)(
|
|
11219
11292
|
() => grouped ? { ...columnVisibility, [GROUP_COLUMN_ID]: false } : columnVisibility,
|
|
11220
11293
|
[grouped, columnVisibility]
|
|
11221
11294
|
);
|
|
@@ -11239,7 +11312,7 @@ function DataTable({
|
|
|
11239
11312
|
}
|
|
11240
11313
|
) : expand.fields ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DetailFields, { row, fields: expand.fields }) : null
|
|
11241
11314
|
} : void 0;
|
|
11242
|
-
const searchTextById = (0,
|
|
11315
|
+
const searchTextById = (0, import_react67.useMemo)(() => {
|
|
11243
11316
|
const map = /* @__PURE__ */ new Map();
|
|
11244
11317
|
for (const column of allColumns) {
|
|
11245
11318
|
const text = column.meta?.searchText;
|
|
@@ -11307,8 +11380,8 @@ function DataTable({
|
|
|
11307
11380
|
enableSortingRemoval: false,
|
|
11308
11381
|
...tableOptions
|
|
11309
11382
|
});
|
|
11310
|
-
const selectionReported = (0,
|
|
11311
|
-
(0,
|
|
11383
|
+
const selectionReported = (0, import_react67.useRef)(false);
|
|
11384
|
+
(0, import_react67.useEffect)(() => {
|
|
11312
11385
|
if (!onSelectionChange) return;
|
|
11313
11386
|
if (!selectionReported.current) {
|
|
11314
11387
|
selectionReported.current = true;
|
|
@@ -11317,9 +11390,9 @@ function DataTable({
|
|
|
11317
11390
|
onSelectionChange(table.getSelectedRowModel().rows.map((row) => row.original));
|
|
11318
11391
|
}, [rowSelection]);
|
|
11319
11392
|
const [wrapRef, containerWidth] = useElementWidth();
|
|
11320
|
-
const captionId = (0,
|
|
11393
|
+
const captionId = (0, import_react67.useId)();
|
|
11321
11394
|
const breakpoint = responsive === false ? 0 : typeof responsive === "object" ? responsive.breakpoint ?? DEFAULT_CARD_BREAKPOINT_PX : DEFAULT_CARD_BREAKPOINT_PX;
|
|
11322
|
-
const modeRef = (0,
|
|
11395
|
+
const modeRef = (0, import_react67.useRef)("table");
|
|
11323
11396
|
const mode = nextLayoutMode(modeRef.current, containerWidth, breakpoint);
|
|
11324
11397
|
modeRef.current = mode;
|
|
11325
11398
|
const search = searchable === true ? {} : searchable || void 0;
|
|
@@ -11346,7 +11419,8 @@ function DataTable({
|
|
|
11346
11419
|
const filterColumns = table.getAllLeafColumns().filter((column) => column.columnDef.meta?.filter);
|
|
11347
11420
|
const tabsFilters = filterColumns.filter((column) => column.columnDef.meta?.filter?.variant === "tabs");
|
|
11348
11421
|
const isToolbarFilter = (id) => filterColumns.some((c) => c.id === id && c.columnDef.meta?.filter?.variant !== "tabs");
|
|
11349
|
-
const
|
|
11422
|
+
const viewMenu = showColumnMenu || hideableColumns(table).some((column) => !column.getIsVisible());
|
|
11423
|
+
const showToolbar = Boolean(search || toolbar || viewMenu || filterColumns.length > tabsFilters.length);
|
|
11350
11424
|
const reorderActive = reorderable && sorting.length === 0 && !filtering && !group;
|
|
11351
11425
|
const showPager = paginated && !error && table.getRowCount() > 0;
|
|
11352
11426
|
const view = {
|
|
@@ -11389,48 +11463,64 @@ function DataTable({
|
|
|
11389
11463
|
summary: (row) => groupSummary(row, group.summary ?? [], formatOf, format)
|
|
11390
11464
|
} : void 0
|
|
11391
11465
|
};
|
|
11392
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataTableFacetsContext.Provider, { value: facetCounts, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
11467
|
+
"div",
|
|
11468
|
+
{
|
|
11469
|
+
"data-slot": "data-table",
|
|
11470
|
+
"data-fill": fill || void 0,
|
|
11471
|
+
className: cn("relative flex flex-col gap-4", fill && "h-full min-h-0 flex-1", className),
|
|
11472
|
+
children: [
|
|
11473
|
+
tabsFilters.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: cn("flex shrink-0 flex-wrap items-center gap-2", !bordered && "px-4 pt-3"), children: tabsFilters.map((column) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataTableTabsFilter, { column }, column.id)) }),
|
|
11474
|
+
showToolbar && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: cn("flex shrink-0 items-center justify-between gap-2", !bordered && "px-4 pt-3"), children: [
|
|
11475
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
|
|
11476
|
+
search && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DisabledReason, { reason: search.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11477
|
+
Input,
|
|
11478
|
+
{
|
|
11479
|
+
type: "search",
|
|
11480
|
+
"aria-label": search.label ?? "Filter",
|
|
11481
|
+
placeholder: search.placeholder ?? "Filter...",
|
|
11482
|
+
value: searchValue,
|
|
11483
|
+
onChange: (event) => setSearchValue(event.target.value),
|
|
11484
|
+
disabled: Boolean(search.disabled),
|
|
11485
|
+
className: "h-8 w-[150px] lg:w-[250px]"
|
|
11486
|
+
}
|
|
11487
|
+
) }),
|
|
11488
|
+
filterColumns.map(
|
|
11489
|
+
(column) => column.columnDef.meta?.filter?.variant === "buttons" ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataTableButtonFilter, { column }, column.id) : column.columnDef.meta?.filter?.variant === "tabs" ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataTableFacetedFilter, { column }, column.id)
|
|
11490
|
+
),
|
|
11491
|
+
columnFilters.some((f) => isToolbarFilter(f.id)) && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
11492
|
+
Button,
|
|
11493
|
+
{
|
|
11494
|
+
variant: "ghost",
|
|
11495
|
+
size: "sm",
|
|
11496
|
+
onClick: () => table.setColumnFilters((current) => current.filter((f) => !isToolbarFilter(f.id))),
|
|
11497
|
+
children: [
|
|
11498
|
+
"Reset",
|
|
11499
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react28.XIcon, {})
|
|
11500
|
+
]
|
|
11501
|
+
}
|
|
11502
|
+
),
|
|
11503
|
+
toolbar
|
|
11504
|
+
] }),
|
|
11505
|
+
viewMenu && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataTableViewOptions, { table }) })
|
|
11506
|
+
] }),
|
|
11507
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { role: "status", "aria-live": "polite", className: "sr-only", children: filtering && !loading ? `${resultCount} ${resultCount === 1 ? "result" : "results"}` : "" }),
|
|
11508
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
11509
|
+
"div",
|
|
11412
11510
|
{
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
onClick: () => table.setColumnFilters((current) => current.filter((f) => !isToolbarFilter(f.id))),
|
|
11511
|
+
ref: wrapRef,
|
|
11512
|
+
className: cn("overflow-hidden bg-background", bordered && "rounded-md border", fill && "flex min-h-0 flex-1 flex-col"),
|
|
11416
11513
|
children: [
|
|
11417
|
-
"
|
|
11418
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11514
|
+
mode === "cards" && caption && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { id: captionId, className: "shrink-0 px-4 pt-3 text-left text-sm text-muted-foreground", children: caption }),
|
|
11515
|
+
mode === "cards" ? maxHeight ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CardScroll, { label, maxHeight, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CardList, { ...view }) }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CardList, { ...view }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TableView, { ...view }),
|
|
11516
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "shrink-0 border-t p-2", children: footer })
|
|
11419
11517
|
]
|
|
11420
11518
|
}
|
|
11421
11519
|
),
|
|
11422
|
-
|
|
11423
|
-
]
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { role: "status", "aria-live": "polite", className: "sr-only", children: filtering && !loading ? `${resultCount} ${resultCount === 1 ? "result" : "results"}` : "" }),
|
|
11427
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { ref: wrapRef, className: cn("overflow-hidden bg-background", bordered && "rounded-md border"), children: [
|
|
11428
|
-
mode === "cards" && caption && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { id: captionId, className: "px-4 pt-3 text-left text-sm text-muted-foreground", children: caption }),
|
|
11429
|
-
mode === "cards" ? maxHeight ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CardScroll, { label, maxHeight, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CardList, { ...view }) }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CardList, { ...view }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TableView, { ...view }),
|
|
11430
|
-
footer && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "border-t p-2", children: footer })
|
|
11431
|
-
] }),
|
|
11432
|
-
showPager && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: cn(!bordered && "px-2 pb-3"), children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataTablePagination, { table, pageSizeOptions }) })
|
|
11433
|
-
] });
|
|
11520
|
+
showPager && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: cn("shrink-0", !bordered && "px-2 pb-3"), children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DataTablePagination, { table, pageSizeOptions }) })
|
|
11521
|
+
]
|
|
11522
|
+
}
|
|
11523
|
+
) });
|
|
11434
11524
|
}
|
|
11435
11525
|
var verticalOnly = ({ transform }) => ({ ...transform, x: 0 });
|
|
11436
11526
|
function titleColumnId(columns) {
|
|
@@ -11505,7 +11595,7 @@ function TableView({
|
|
|
11505
11595
|
const direction = scroll.overflowing && maxHeight && scroll.overflowingY ? "scrolls" : scroll.overflowing ? "scrolls horizontally" : "scrolls vertically";
|
|
11506
11596
|
const regionLabel = `${label ?? "Table"} (${direction})`;
|
|
11507
11597
|
const pinnedHeader = maxHeight ? (0, import_clsx7.default)("sticky top-0 z-sticky bg-background", !scroll.atTop && "shadow-[inset_0_-1px_0_var(--border)]") : void 0;
|
|
11508
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative", children: [
|
|
11598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: cn("relative", maxHeight === "fill" && "flex min-h-0 flex-1 flex-col"), children: [
|
|
11509
11599
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11510
11600
|
"div",
|
|
11511
11601
|
{
|
|
@@ -11513,10 +11603,11 @@ function TableView({
|
|
|
11513
11603
|
onScroll: scroll.onScroll,
|
|
11514
11604
|
className: cn(
|
|
11515
11605
|
maxHeight ? "overflow-auto overscroll-contain" : "overflow-x-auto overscroll-x-contain",
|
|
11606
|
+
maxHeight === "fill" && "min-h-0 flex-1",
|
|
11516
11607
|
SCROLLBAR_CLASSES,
|
|
11517
11608
|
scrolls && FOCUS_RING_INSET
|
|
11518
11609
|
),
|
|
11519
|
-
style: maxHeight ? { maxHeight } : void 0,
|
|
11610
|
+
style: maxHeight && maxHeight !== "fill" ? { maxHeight } : void 0,
|
|
11520
11611
|
...scrolls ? { role: "region", tabIndex: 0, "aria-label": regionLabel } : {},
|
|
11521
11612
|
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11522
11613
|
DndWrapper,
|
|
@@ -11607,7 +11698,7 @@ function TableView({
|
|
|
11607
11698
|
getRowTone,
|
|
11608
11699
|
getRowDimmed
|
|
11609
11700
|
};
|
|
11610
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
11701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react67.Fragment, { children: [
|
|
11611
11702
|
reorder ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11612
11703
|
SortableBodyRow,
|
|
11613
11704
|
{
|
|
@@ -11810,12 +11901,12 @@ function GroupRow({
|
|
|
11810
11901
|
) }) });
|
|
11811
11902
|
}
|
|
11812
11903
|
function usePinOffsets(key) {
|
|
11813
|
-
const nodes = (0,
|
|
11814
|
-
const [offsets, setOffsets] = (0,
|
|
11904
|
+
const nodes = (0, import_react67.useRef)(/* @__PURE__ */ new Map());
|
|
11905
|
+
const [offsets, setOffsets] = (0, import_react67.useState)({
|
|
11815
11906
|
start: {},
|
|
11816
11907
|
end: {}
|
|
11817
11908
|
});
|
|
11818
|
-
(0,
|
|
11909
|
+
(0, import_react67.useLayoutEffect)(() => {
|
|
11819
11910
|
const cells = [...nodes.current.entries()].filter(([, node]) => node.isConnected);
|
|
11820
11911
|
cells.sort(([, a], [, b]) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
|
|
11821
11912
|
const start = {};
|
|
@@ -11834,7 +11925,7 @@ function usePinOffsets(key) {
|
|
|
11834
11925
|
(current) => JSON.stringify(current) === JSON.stringify({ start, end }) ? current : { start, end }
|
|
11835
11926
|
);
|
|
11836
11927
|
}, [key]);
|
|
11837
|
-
const register = (0,
|
|
11928
|
+
const register = (0, import_react67.useCallback)(
|
|
11838
11929
|
(id) => (node) => {
|
|
11839
11930
|
if (node) nodes.current.set(id, node);
|
|
11840
11931
|
else nodes.current.delete(id);
|
|
@@ -11850,7 +11941,7 @@ function ResizeHandle({
|
|
|
11850
11941
|
width,
|
|
11851
11942
|
onResize
|
|
11852
11943
|
}) {
|
|
11853
|
-
const [now, setNow] = (0,
|
|
11944
|
+
const [now, setNow] = (0, import_react67.useState)();
|
|
11854
11945
|
const set = (next) => {
|
|
11855
11946
|
const clamped = next === void 0 ? void 0 : Math.max(floor, Math.round(next));
|
|
11856
11947
|
setNow(clamped);
|
|
@@ -11905,13 +11996,14 @@ function ResizeHandle({
|
|
|
11905
11996
|
}
|
|
11906
11997
|
function CardScroll({ label, maxHeight, children }) {
|
|
11907
11998
|
const scroll = useScrollEdges();
|
|
11999
|
+
const fill = maxHeight === "fill";
|
|
11908
12000
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11909
12001
|
"div",
|
|
11910
12002
|
{
|
|
11911
12003
|
ref: scroll.ref,
|
|
11912
12004
|
onScroll: scroll.onScroll,
|
|
11913
|
-
style: { maxHeight },
|
|
11914
|
-
className: cn("overflow-y-auto overscroll-contain", SCROLLBAR_CLASSES, scroll.overflowingY && FOCUS_RING_INSET),
|
|
12005
|
+
style: fill ? void 0 : { maxHeight },
|
|
12006
|
+
className: cn("overflow-y-auto overscroll-contain", fill && "min-h-0 flex-1", SCROLLBAR_CLASSES, scroll.overflowingY && FOCUS_RING_INSET),
|
|
11915
12007
|
...scroll.overflowingY ? { role: "region", tabIndex: 0, "aria-label": `${label ?? "Table"} (scrolls vertically)` } : {},
|
|
11916
12008
|
children
|
|
11917
12009
|
}
|
|
@@ -12056,7 +12148,7 @@ function CardList({
|
|
|
12056
12148
|
var import_react_table2 = require("@tanstack/react-table");
|
|
12057
12149
|
|
|
12058
12150
|
// src/components/feedback/alert.tsx
|
|
12059
|
-
var
|
|
12151
|
+
var import_react68 = require("react");
|
|
12060
12152
|
var import_lucide_react29 = require("lucide-react");
|
|
12061
12153
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
12062
12154
|
var VARIANT5 = {
|
|
@@ -12075,7 +12167,7 @@ var ICON = {
|
|
|
12075
12167
|
};
|
|
12076
12168
|
var PARTS2 = /* @__PURE__ */ new Set();
|
|
12077
12169
|
function isComposed2(children) {
|
|
12078
|
-
return
|
|
12170
|
+
return import_react68.Children.toArray(children).some((child) => (0, import_react68.isValidElement)(child) && PARTS2.has(child.type));
|
|
12079
12171
|
}
|
|
12080
12172
|
function Alert({
|
|
12081
12173
|
variant = "default",
|
|
@@ -12150,7 +12242,7 @@ PARTS2.add(AlertDescription);
|
|
|
12150
12242
|
PARTS2.add(AlertAction);
|
|
12151
12243
|
|
|
12152
12244
|
// src/components/feedback/sonner.tsx
|
|
12153
|
-
var
|
|
12245
|
+
var import_react69 = require("react");
|
|
12154
12246
|
var import_sonner = require("sonner");
|
|
12155
12247
|
var import_lucide_react30 = require("lucide-react");
|
|
12156
12248
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
@@ -12182,8 +12274,8 @@ function Toaster({ theme, style, toastOptions, ...props }) {
|
|
|
12182
12274
|
}
|
|
12183
12275
|
function usePageTheme() {
|
|
12184
12276
|
const read = () => typeof document !== "undefined" && document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
12185
|
-
const [theme, setTheme] = (0,
|
|
12186
|
-
(0,
|
|
12277
|
+
const [theme, setTheme] = (0, import_react69.useState)(read);
|
|
12278
|
+
(0, import_react69.useEffect)(() => {
|
|
12187
12279
|
if (typeof MutationObserver === "undefined") return;
|
|
12188
12280
|
const observer = new MutationObserver(() => setTheme(read()));
|
|
12189
12281
|
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
|
|
@@ -12193,12 +12285,12 @@ function usePageTheme() {
|
|
|
12193
12285
|
}
|
|
12194
12286
|
|
|
12195
12287
|
// src/components/ai/message.tsx
|
|
12196
|
-
var
|
|
12288
|
+
var import_react70 = require("react");
|
|
12197
12289
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
12198
|
-
var MessageGroup = (0,
|
|
12290
|
+
var MessageGroup = (0, import_react70.forwardRef)(function MessageGroup2({ className, ...props }, ref) {
|
|
12199
12291
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { ref, "data-slot": "message-group", className: cn("flex min-w-0 flex-col gap-2", className), ...props });
|
|
12200
12292
|
});
|
|
12201
|
-
var Message = (0,
|
|
12293
|
+
var Message = (0, import_react70.forwardRef)(function Message2({ className, align = "start", avatar, header, footer, children, ...props }, ref) {
|
|
12202
12294
|
const shorthand = avatar != null || header != null || footer != null;
|
|
12203
12295
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
12204
12296
|
"div",
|
|
@@ -12222,7 +12314,7 @@ var Message = (0, import_react69.forwardRef)(function Message2({ className, alig
|
|
|
12222
12314
|
}
|
|
12223
12315
|
);
|
|
12224
12316
|
});
|
|
12225
|
-
var MessageAvatar = (0,
|
|
12317
|
+
var MessageAvatar = (0, import_react70.forwardRef)(function MessageAvatar2({ className, ...props }, ref) {
|
|
12226
12318
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
12227
12319
|
"div",
|
|
12228
12320
|
{
|
|
@@ -12237,7 +12329,7 @@ var MessageAvatar = (0, import_react69.forwardRef)(function MessageAvatar2({ cla
|
|
|
12237
12329
|
}
|
|
12238
12330
|
);
|
|
12239
12331
|
});
|
|
12240
|
-
var MessageContent = (0,
|
|
12332
|
+
var MessageContent = (0, import_react70.forwardRef)(function MessageContent2({ className, ...props }, ref) {
|
|
12241
12333
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
12242
12334
|
"div",
|
|
12243
12335
|
{
|
|
@@ -12252,7 +12344,7 @@ var MessageContent = (0, import_react69.forwardRef)(function MessageContent2({ c
|
|
|
12252
12344
|
);
|
|
12253
12345
|
});
|
|
12254
12346
|
var META = "text-xs font-medium text-muted-foreground px-3 group-has-data-[variant=ghost]/message:px-0";
|
|
12255
|
-
var MessageHeader = (0,
|
|
12347
|
+
var MessageHeader = (0, import_react70.forwardRef)(function MessageHeader2({ className, ...props }, ref) {
|
|
12256
12348
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
12257
12349
|
"div",
|
|
12258
12350
|
{
|
|
@@ -12263,7 +12355,7 @@ var MessageHeader = (0, import_react69.forwardRef)(function MessageHeader2({ cla
|
|
|
12263
12355
|
}
|
|
12264
12356
|
);
|
|
12265
12357
|
});
|
|
12266
|
-
var MessageFooter = (0,
|
|
12358
|
+
var MessageFooter = (0, import_react70.forwardRef)(function MessageFooter2({ className, ...props }, ref) {
|
|
12267
12359
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
12268
12360
|
"div",
|
|
12269
12361
|
{
|
|
@@ -12276,7 +12368,7 @@ var MessageFooter = (0, import_react69.forwardRef)(function MessageFooter2({ cla
|
|
|
12276
12368
|
});
|
|
12277
12369
|
|
|
12278
12370
|
// src/components/ai/message-scroller.tsx
|
|
12279
|
-
var
|
|
12371
|
+
var import_react71 = require("react");
|
|
12280
12372
|
|
|
12281
12373
|
// src/vendor/headless/message-scroller/components.tsx
|
|
12282
12374
|
var React12 = __toESM(require("react"), 1);
|
|
@@ -13820,8 +13912,8 @@ function MessageScroller3({
|
|
|
13820
13912
|
scrollMargin,
|
|
13821
13913
|
...props
|
|
13822
13914
|
}) {
|
|
13823
|
-
const composed =
|
|
13824
|
-
(child) => (0,
|
|
13915
|
+
const composed = import_react71.Children.toArray(children).some(
|
|
13916
|
+
(child) => (0, import_react71.isValidElement)(child) && child.type === MessageScrollerViewport2
|
|
13825
13917
|
);
|
|
13826
13918
|
const root = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
13827
13919
|
MessageScroller2.Root,
|
|
@@ -13915,7 +14007,7 @@ function MessageScrollerButton2({
|
|
|
13915
14007
|
}
|
|
13916
14008
|
|
|
13917
14009
|
// src/components/ai/marker.tsx
|
|
13918
|
-
var
|
|
14010
|
+
var import_react72 = require("react");
|
|
13919
14011
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
13920
14012
|
var VARIANT6 = {
|
|
13921
14013
|
default: "",
|
|
@@ -13923,11 +14015,11 @@ var VARIANT6 = {
|
|
|
13923
14015
|
separator: "before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border"
|
|
13924
14016
|
};
|
|
13925
14017
|
function isParts(children) {
|
|
13926
|
-
return
|
|
13927
|
-
(child) => (0,
|
|
14018
|
+
return import_react72.Children.toArray(children).some(
|
|
14019
|
+
(child) => (0, import_react72.isValidElement)(child) && (child.type === MarkerIcon || child.type === MarkerContent)
|
|
13928
14020
|
);
|
|
13929
14021
|
}
|
|
13930
|
-
var Marker = (0,
|
|
14022
|
+
var Marker = (0, import_react72.forwardRef)(function Marker2({ className, variant = "default", asChild = false, icon, children, ...props }, ref) {
|
|
13931
14023
|
const parts4 = (content) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
|
|
13932
14024
|
icon != null && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(MarkerIcon, { children: icon }),
|
|
13933
14025
|
isParts(content) || content == null || content === false ? content : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(MarkerContent, { children: content })
|
|
@@ -13943,11 +14035,11 @@ var Marker = (0, import_react71.forwardRef)(function Marker2({ className, varian
|
|
|
13943
14035
|
...props
|
|
13944
14036
|
};
|
|
13945
14037
|
if (asChild) {
|
|
13946
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Slot, { ref, ...rootProps, wrapChildren: parts4, children: (0,
|
|
14038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Slot, { ref, ...rootProps, wrapChildren: parts4, children: (0, import_react72.isValidElement)(children) ? children : null });
|
|
13947
14039
|
}
|
|
13948
14040
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { ref, ...rootProps, children: parts4(children) });
|
|
13949
14041
|
});
|
|
13950
|
-
var MarkerIcon = (0,
|
|
14042
|
+
var MarkerIcon = (0, import_react72.forwardRef)(function MarkerIcon2({ className, ...props }, ref) {
|
|
13951
14043
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
13952
14044
|
"span",
|
|
13953
14045
|
{
|
|
@@ -13959,7 +14051,7 @@ var MarkerIcon = (0, import_react71.forwardRef)(function MarkerIcon2({ className
|
|
|
13959
14051
|
}
|
|
13960
14052
|
);
|
|
13961
14053
|
});
|
|
13962
|
-
var MarkerContent = (0,
|
|
14054
|
+
var MarkerContent = (0, import_react72.forwardRef)(function MarkerContent2({ className, ...props }, ref) {
|
|
13963
14055
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
13964
14056
|
"span",
|
|
13965
14057
|
{
|
|
@@ -13975,11 +14067,11 @@ var MarkerContent = (0, import_react71.forwardRef)(function MarkerContent2({ cla
|
|
|
13975
14067
|
});
|
|
13976
14068
|
|
|
13977
14069
|
// src/components/ai/trace.tsx
|
|
13978
|
-
var
|
|
14070
|
+
var import_react73 = require("react");
|
|
13979
14071
|
var import_radix_ui26 = require("radix-ui");
|
|
13980
14072
|
var import_lucide_react32 = require("lucide-react");
|
|
13981
14073
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
13982
|
-
var Trace = (0,
|
|
14074
|
+
var Trace = (0, import_react73.forwardRef)(function Trace2({ className, ...props }, ref) {
|
|
13983
14075
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
13984
14076
|
"div",
|
|
13985
14077
|
{
|
|
@@ -13993,7 +14085,7 @@ var Trace = (0, import_react72.forwardRef)(function Trace2({ className, ...props
|
|
|
13993
14085
|
}
|
|
13994
14086
|
);
|
|
13995
14087
|
});
|
|
13996
|
-
var TraceLine = (0,
|
|
14088
|
+
var TraceLine = (0, import_react73.forwardRef)(function TraceLine2({ className, status, icon, title, description, children, ...props }, ref) {
|
|
13997
14089
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
13998
14090
|
"span",
|
|
13999
14091
|
{
|
|
@@ -14014,7 +14106,7 @@ var TraceLine = (0, import_react72.forwardRef)(function TraceLine2({ className,
|
|
|
14014
14106
|
}
|
|
14015
14107
|
);
|
|
14016
14108
|
});
|
|
14017
|
-
var TraceIcon = (0,
|
|
14109
|
+
var TraceIcon = (0, import_react73.forwardRef)(function TraceIcon2({ className, ...props }, ref) {
|
|
14018
14110
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14019
14111
|
"span",
|
|
14020
14112
|
{
|
|
@@ -14029,7 +14121,7 @@ var TraceIcon = (0, import_react72.forwardRef)(function TraceIcon2({ className,
|
|
|
14029
14121
|
}
|
|
14030
14122
|
);
|
|
14031
14123
|
});
|
|
14032
|
-
var TraceTitle = (0,
|
|
14124
|
+
var TraceTitle = (0, import_react73.forwardRef)(function TraceTitle2({ className, ...props }, ref) {
|
|
14033
14125
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14034
14126
|
"span",
|
|
14035
14127
|
{
|
|
@@ -14040,7 +14132,7 @@ var TraceTitle = (0, import_react72.forwardRef)(function TraceTitle2({ className
|
|
|
14040
14132
|
}
|
|
14041
14133
|
);
|
|
14042
14134
|
});
|
|
14043
|
-
var TraceDescription = (0,
|
|
14135
|
+
var TraceDescription = (0, import_react73.forwardRef)(function TraceDescription2({ className, ...props }, ref) {
|
|
14044
14136
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14045
14137
|
"span",
|
|
14046
14138
|
{
|
|
@@ -14051,7 +14143,7 @@ var TraceDescription = (0, import_react72.forwardRef)(function TraceDescription2
|
|
|
14051
14143
|
}
|
|
14052
14144
|
);
|
|
14053
14145
|
});
|
|
14054
|
-
var TraceCollapsible = (0,
|
|
14146
|
+
var TraceCollapsible = (0, import_react73.forwardRef)(
|
|
14055
14147
|
function TraceCollapsible2({ className, ...props }, ref) {
|
|
14056
14148
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14057
14149
|
import_radix_ui26.Collapsible.Root,
|
|
@@ -14064,7 +14156,7 @@ var TraceCollapsible = (0, import_react72.forwardRef)(
|
|
|
14064
14156
|
);
|
|
14065
14157
|
}
|
|
14066
14158
|
);
|
|
14067
|
-
var TraceCollapsibleTrigger = (0,
|
|
14159
|
+
var TraceCollapsibleTrigger = (0, import_react73.forwardRef)(function TraceCollapsibleTrigger2({ className, children, ...props }, ref) {
|
|
14068
14160
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
14069
14161
|
import_radix_ui26.Collapsible.Trigger,
|
|
14070
14162
|
{
|
|
@@ -14082,7 +14174,7 @@ var TraceCollapsibleTrigger = (0, import_react72.forwardRef)(function TraceColla
|
|
|
14082
14174
|
}
|
|
14083
14175
|
);
|
|
14084
14176
|
});
|
|
14085
|
-
var TraceCollapsibleContent = (0,
|
|
14177
|
+
var TraceCollapsibleContent = (0, import_react73.forwardRef)(function TraceCollapsibleContent2({ className, children, ...props }, ref) {
|
|
14086
14178
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14087
14179
|
import_radix_ui26.Collapsible.Content,
|
|
14088
14180
|
{
|
|
@@ -14106,7 +14198,7 @@ var TraceCollapsibleContent = (0, import_react72.forwardRef)(function TraceColla
|
|
|
14106
14198
|
});
|
|
14107
14199
|
|
|
14108
14200
|
// src/components/ai/bubble.tsx
|
|
14109
|
-
var
|
|
14201
|
+
var import_react74 = require("react");
|
|
14110
14202
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
14111
14203
|
var VARIANT7 = {
|
|
14112
14204
|
default: "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",
|
|
@@ -14117,12 +14209,12 @@ var VARIANT7 = {
|
|
|
14117
14209
|
ghost: "border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",
|
|
14118
14210
|
destructive: "*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"
|
|
14119
14211
|
};
|
|
14120
|
-
var BubbleGroup = (0,
|
|
14212
|
+
var BubbleGroup = (0, import_react74.forwardRef)(function BubbleGroup2({ className, ...props }, ref) {
|
|
14121
14213
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { ref, "data-slot": "bubble-group", className: cn("flex min-w-0 flex-col gap-2", className), ...props });
|
|
14122
14214
|
});
|
|
14123
14215
|
var PARTS3 = /* @__PURE__ */ new Set();
|
|
14124
|
-
var isComposed3 = (children) =>
|
|
14125
|
-
var Bubble = (0,
|
|
14216
|
+
var isComposed3 = (children) => import_react74.Children.toArray(children).some((child) => (0, import_react74.isValidElement)(child) && PARTS3.has(child.type));
|
|
14217
|
+
var Bubble = (0, import_react74.forwardRef)(function Bubble2({ variant = "default", align = "start", className, children, ...props }, ref) {
|
|
14126
14218
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
14127
14219
|
"div",
|
|
14128
14220
|
{
|
|
@@ -14140,7 +14232,7 @@ var Bubble = (0, import_react73.forwardRef)(function Bubble2({ variant = "defaul
|
|
|
14140
14232
|
}
|
|
14141
14233
|
);
|
|
14142
14234
|
});
|
|
14143
|
-
var BubbleContent = (0,
|
|
14235
|
+
var BubbleContent = (0, import_react74.forwardRef)(function BubbleContent2({ asChild = false, className, ...props }, ref) {
|
|
14144
14236
|
const Comp = asChild ? Slot : "div";
|
|
14145
14237
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
14146
14238
|
Comp,
|
|
@@ -14158,7 +14250,7 @@ var BubbleContent = (0, import_react73.forwardRef)(function BubbleContent2({ asC
|
|
|
14158
14250
|
});
|
|
14159
14251
|
var SIDE = { top: "top-0 -translate-y-3/4", bottom: "bottom-0 translate-y-3/4" };
|
|
14160
14252
|
var ALIGN = { start: "left-3", end: "right-3" };
|
|
14161
|
-
var BubbleReactions = (0,
|
|
14253
|
+
var BubbleReactions = (0, import_react74.forwardRef)(function BubbleReactions2({ side = "bottom", align = "end", className, ...props }, ref) {
|
|
14162
14254
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
14163
14255
|
"div",
|
|
14164
14256
|
{
|
|
@@ -14180,7 +14272,7 @@ PARTS3.add(BubbleContent);
|
|
|
14180
14272
|
PARTS3.add(BubbleReactions);
|
|
14181
14273
|
|
|
14182
14274
|
// src/components/ai/code-block.tsx
|
|
14183
|
-
var
|
|
14275
|
+
var import_react75 = require("react");
|
|
14184
14276
|
var import_lucide_react33 = require("lucide-react");
|
|
14185
14277
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
14186
14278
|
var VARIANT8 = {
|
|
@@ -14193,7 +14285,7 @@ var LINE_VARIANT = {
|
|
|
14193
14285
|
added: "bg-foreground/5 after:content-['+']",
|
|
14194
14286
|
removed: "bg-destructive/10 after:text-destructive after:content-['\u2212']"
|
|
14195
14287
|
};
|
|
14196
|
-
var CodeBlock = (0,
|
|
14288
|
+
var CodeBlock = (0, import_react75.forwardRef)(function CodeBlock2({
|
|
14197
14289
|
variant = "default",
|
|
14198
14290
|
size = "default",
|
|
14199
14291
|
code,
|
|
@@ -14279,8 +14371,8 @@ function CodeBlockActions({ className, ...props }) {
|
|
|
14279
14371
|
);
|
|
14280
14372
|
}
|
|
14281
14373
|
function CodeBlockCopyButton({ value, variant = "ghost", size = "icon-xs", className, onClick, ...props }) {
|
|
14282
|
-
const [copied, setCopied] = (0,
|
|
14283
|
-
(0,
|
|
14374
|
+
const [copied, setCopied] = (0, import_react75.useState)(false);
|
|
14375
|
+
(0, import_react75.useEffect)(() => {
|
|
14284
14376
|
if (!copied) return;
|
|
14285
14377
|
const timeout = setTimeout(() => setCopied(false), 2e3);
|
|
14286
14378
|
return () => clearTimeout(timeout);
|