@upbound/monarch-blocks 0.4.0 → 0.5.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.js CHANGED
@@ -1219,6 +1219,7 @@ function CelFilterBar({
1219
1219
  (_a = onCompileResultChangeRef.current) == null ? void 0 : _a.call(onCompileResultChangeRef, __spreadProps(__spreadValues({}, displayResult), { isEmitReady }));
1220
1220
  }, [displayResult, isEmitReady]);
1221
1221
  const conditions = tree.root.children.filter(isCelFilterCondition);
1222
+ const containerRef = React.useRef(null);
1222
1223
  function handleAddFilter(columnId) {
1223
1224
  const condition = createDefaultCondition({ schema, columnId });
1224
1225
  onChange(appendCondition(tree, condition));
@@ -1233,8 +1234,8 @@ function CelFilterBar({
1233
1234
  onChange({ root: __spreadProps(__spreadValues({}, tree.root), { children: [] }) });
1234
1235
  editor.clearSuppress();
1235
1236
  }
1236
- return /* @__PURE__ */ jsxs("div", { "data-slot": "cel-filter-bar", className: cn("flex flex-wrap items-center gap-2", className), children: [
1237
- /* @__PURE__ */ jsx(CelAddFilterButton, { schema, conditions, onSelect: handleAddFilter }),
1237
+ return /* @__PURE__ */ jsxs("div", { "data-slot": "cel-filter-bar", className: cn("flex flex-wrap items-center gap-2", className), ref: containerRef, children: [
1238
+ /* @__PURE__ */ jsx(CelAddFilterButton, { schema, conditions, onSelect: handleAddFilter, container: containerRef }),
1238
1239
  conditions.map((condition) => {
1239
1240
  const columnDef = resolveColumnDefinition(condition, schema);
1240
1241
  if (!columnDef) return null;
@@ -1249,7 +1250,8 @@ function CelFilterBar({
1249
1250
  controller: editor.getController(condition.id),
1250
1251
  issues: displayResult.issues.filter((issue) => issue.nodeId === condition.id),
1251
1252
  onRemove: () => handleRemove(condition.id),
1252
- onRestrictedOptionSelect
1253
+ onRestrictedOptionSelect,
1254
+ container: containerRef
1253
1255
  },
1254
1256
  condition.id
1255
1257
  );
@@ -1260,7 +1262,8 @@ function CelFilterBar({
1260
1262
  function CelAddFilterButton({
1261
1263
  schema,
1262
1264
  conditions,
1263
- onSelect
1265
+ onSelect,
1266
+ container
1264
1267
  }) {
1265
1268
  var _a, _b;
1266
1269
  const usedSingleInstanceColumnIds = new Set(
@@ -1291,7 +1294,7 @@ function CelAddFilterButton({
1291
1294
  /* @__PURE__ */ jsx(Icon, { name: "plus", "data-icon": "inline-start" }),
1292
1295
  "Add filter"
1293
1296
  ] }),
1294
- /* @__PURE__ */ jsxs(ComboboxContent, { align: "start", className: "w-64", children: [
1297
+ /* @__PURE__ */ jsxs(ComboboxContent, { container, align: "start", className: "w-64", children: [
1295
1298
  /* @__PURE__ */ jsx(ComboboxInput, { showTrigger: false, placeholder: "Search filters\u2026" }),
1296
1299
  /* @__PURE__ */ jsx(ComboboxEmpty, { children: "No filters found." }),
1297
1300
  /* @__PURE__ */ jsx(ComboboxList, { children: (group) => /* @__PURE__ */ jsxs(ComboboxGroup, { items: group.items, children: [
@@ -1355,7 +1358,8 @@ function CelFilterPill({
1355
1358
  controller,
1356
1359
  issues,
1357
1360
  onRemove,
1358
- onRestrictedOptionSelect
1361
+ onRestrictedOptionSelect,
1362
+ container
1359
1363
  }) {
1360
1364
  var _a;
1361
1365
  const shape = (_a = resolveFilterShape(condition, schema)) != null ? _a : columnDef.filterType;
@@ -1372,7 +1376,8 @@ function CelFilterPill({
1372
1376
  controller,
1373
1377
  issues,
1374
1378
  onRemove,
1375
- onRestrictedOptionSelect
1379
+ onRestrictedOptionSelect,
1380
+ container
1376
1381
  }
1377
1382
  );
1378
1383
  }
@@ -1387,7 +1392,8 @@ function CelFilterPill({
1387
1392
  controller,
1388
1393
  issues,
1389
1394
  onRemove,
1390
- onRestrictedOptionSelect
1395
+ onRestrictedOptionSelect,
1396
+ container
1391
1397
  }
1392
1398
  );
1393
1399
  }
@@ -1497,7 +1503,8 @@ function CelCheckboxComboboxPill({
1497
1503
  controller,
1498
1504
  issues,
1499
1505
  onRemove,
1500
- onRestrictedOptionSelect
1506
+ onRestrictedOptionSelect,
1507
+ container
1501
1508
  }) {
1502
1509
  var _a;
1503
1510
  const options = (_a = columnDef.options) != null ? _a : [];
@@ -1556,7 +1563,7 @@ function CelCheckboxComboboxPill({
1556
1563
  ),
1557
1564
  /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", "aria-label": `Remove ${columnDef.title} filter`, onClick: onRemove, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
1558
1565
  ] }),
1559
- /* @__PURE__ */ jsxs(ComboboxContent, { className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
1566
+ /* @__PURE__ */ jsxs(ComboboxContent, { container, className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
1560
1567
  /* @__PURE__ */ jsx(ComboboxInput, { showTrigger: false, placeholder: `Search ${columnDef.title.toLowerCase()}\u2026` }),
1561
1568
  selected.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
1562
1569
  /* @__PURE__ */ jsxs(ComboboxSelectedChips, { children: [
@@ -1585,7 +1592,8 @@ function CelRadioComboboxPill({
1585
1592
  controller,
1586
1593
  issues,
1587
1594
  onRemove,
1588
- onRestrictedOptionSelect
1595
+ onRestrictedOptionSelect,
1596
+ container
1589
1597
  }) {
1590
1598
  var _a, _b;
1591
1599
  const options = (_a = columnDef.options) != null ? _a : [];
@@ -1640,7 +1648,7 @@ function CelRadioComboboxPill({
1640
1648
  ),
1641
1649
  /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", "aria-label": `Remove ${columnDef.title} filter`, onClick: onRemove, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
1642
1650
  ] }),
1643
- /* @__PURE__ */ jsxs(ComboboxContent, { className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
1651
+ /* @__PURE__ */ jsxs(ComboboxContent, { container, className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
1644
1652
  /* @__PURE__ */ jsx(ComboboxInput, { showTrigger: false, placeholder: `Search ${columnDef.title.toLowerCase()}\u2026` }),
1645
1653
  /* @__PURE__ */ jsxs(ComboboxEmpty, { children: [
1646
1654
  "No ",
@@ -3217,6 +3225,14 @@ function isFilterOnlyColumn(column) {
3217
3225
  var _a;
3218
3226
  return ((_a = column.columnDef.meta) == null ? void 0 : _a.filterOnly) === true;
3219
3227
  }
3228
+ function hasFilterableColumns(columns) {
3229
+ return columns.some(
3230
+ (column) => {
3231
+ var _a;
3232
+ return !isFilterOnlyColumn(column) && column.getCanFilter() && !!((_a = column.columnDef.meta) == null ? void 0 : _a.filter);
3233
+ }
3234
+ );
3235
+ }
3220
3236
  function getTableState({
3221
3237
  error,
3222
3238
  loading,
@@ -3450,6 +3466,7 @@ function ColumnOptions({
3450
3466
  import { Button as Button4 } from "@upbound/monarch-core";
3451
3467
  import { DropdownMenu as DropdownMenu3, DropdownMenuContent as DropdownMenuContent3, DropdownMenuItem as DropdownMenuItem3, DropdownMenuTrigger as DropdownMenuTrigger3 } from "@upbound/monarch-core";
3452
3468
  import { Icon as Icon5 } from "@upbound/monarch-core";
3469
+ import { Link } from "@upbound/monarch-core";
3453
3470
  import { Tooltip as Tooltip4, TooltipContent as TooltipContent3, TooltipTrigger as TooltipTrigger3 } from "@upbound/monarch-core";
3454
3471
  import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
3455
3472
  function RowActions({
@@ -3528,7 +3545,7 @@ function getExpandColumnDefinition(options) {
3528
3545
  function DataTableValueCell({ content, title, className, href, onClick }) {
3529
3546
  const baseClassName = cn("text-body truncate", className);
3530
3547
  if (href) {
3531
- return /* @__PURE__ */ jsx9("p", { className: baseClassName, children: /* @__PURE__ */ jsx9("a", { href, title, className: "underline hover:no-underline", onClick, children: content }) });
3548
+ return /* @__PURE__ */ jsx9("p", { className: baseClassName, children: /* @__PURE__ */ jsx9(Link, { href, title, onClick, children: content }) });
3532
3549
  }
3533
3550
  if (title) {
3534
3551
  return /* @__PURE__ */ jsxs7(Tooltip4, { children: [
@@ -3555,7 +3572,7 @@ function TimestampCell({ timestamp }) {
3555
3572
  }
3556
3573
 
3557
3574
  // src/data-table/data-table.tsx
3558
- import * as React10 from "react";
3575
+ import * as React11 from "react";
3559
3576
  import {
3560
3577
  getCoreRowModel,
3561
3578
  getExpandedRowModel,
@@ -3568,7 +3585,7 @@ import {
3568
3585
  noop,
3569
3586
  useReactTable
3570
3587
  } from "@tanstack/react-table";
3571
- import { Icon as Icon10 } from "@upbound/monarch-core";
3588
+ import { Icon as Icon11 } from "@upbound/monarch-core";
3572
3589
  import { InputGroup as InputGroup3, InputGroupAddon as InputGroupAddon3, InputGroupInput as InputGroupInput2 } from "@upbound/monarch-core";
3573
3590
 
3574
3591
  // src/lib/data-table/contextual-filters.ts
@@ -4166,6 +4183,18 @@ function useGridLayout({
4166
4183
  };
4167
4184
  }
4168
4185
 
4186
+ // src/hooks/use-filter-visibility.ts
4187
+ import * as React7 from "react";
4188
+ function useFilterVisibility(filterVisibility) {
4189
+ var _a, _b, _c;
4190
+ const config = typeof filterVisibility === "object" ? filterVisibility : void 0;
4191
+ const [innerVisible, setInnerVisible] = React7.useState((_a = config == null ? void 0 : config.defaultVisible) != null ? _a : false);
4192
+ const showFilterToggle = filterVisibility !== false;
4193
+ const filterRowVisible = (_b = config == null ? void 0 : config.visible) != null ? _b : innerVisible;
4194
+ const setFilterRowVisible = (_c = config == null ? void 0 : config.onVisibleChange) != null ? _c : setInnerVisible;
4195
+ return { showFilterToggle, filterRowVisible, setFilterRowVisible };
4196
+ }
4197
+
4169
4198
  // src/data-table/empty-view.tsx
4170
4199
  import { Alert, AlertDescription } from "@upbound/monarch-core";
4171
4200
  import { Button as Button5 } from "@upbound/monarch-core";
@@ -4218,9 +4247,34 @@ function DataTableEmptyView({
4218
4247
  ] }) });
4219
4248
  }
4220
4249
 
4250
+ // src/data-table/filter-toggle.tsx
4251
+ import { Icon as Icon7, Toggle } from "@upbound/monarch-core";
4252
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4253
+ function FilterToggle({ pressed, onPressedChange, count }) {
4254
+ return /* @__PURE__ */ jsxs9(
4255
+ Toggle,
4256
+ {
4257
+ variant: "outline",
4258
+ pressed,
4259
+ onPressedChange,
4260
+ "aria-label": "Toggle filters",
4261
+ className: "shrink-0 gap-1.5",
4262
+ children: [
4263
+ /* @__PURE__ */ jsx11(Icon7, { name: "filter", "data-icon": "inline-start" }),
4264
+ "Filter",
4265
+ !!count && /* @__PURE__ */ jsxs9("span", { className: "tabular-nums", children: [
4266
+ "(",
4267
+ count,
4268
+ ")"
4269
+ ] })
4270
+ ]
4271
+ }
4272
+ );
4273
+ }
4274
+
4221
4275
  // src/data-table/pagination.tsx
4222
4276
  import { Button as Button6 } from "@upbound/monarch-core";
4223
- import { Icon as Icon7 } from "@upbound/monarch-core";
4277
+ import { Icon as Icon8 } from "@upbound/monarch-core";
4224
4278
  import { Label as Label2 } from "@upbound/monarch-core";
4225
4279
  import {
4226
4280
  Pagination,
@@ -4231,7 +4285,7 @@ import {
4231
4285
  } from "@upbound/monarch-core";
4232
4286
  import { Select as Select2, SelectContent as SelectContent2, SelectGroup as SelectGroup2, SelectItem as SelectItem2, SelectTrigger as SelectTrigger2, SelectValue as SelectValue2 } from "@upbound/monarch-core";
4233
4287
  import { Tooltip as Tooltip5, TooltipContent as TooltipContent4, TooltipTrigger as TooltipTrigger4 } from "@upbound/monarch-core";
4234
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4288
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
4235
4289
  var DEFAULT_PAGINATION_CONFIG = {
4236
4290
  summary: true,
4237
4291
  arrows: true,
@@ -4270,36 +4324,36 @@ function DataTablePagination({
4270
4324
  const currentPage = pageIndex + 1;
4271
4325
  const mounted = useMounted();
4272
4326
  const locale = mounted ? void 0 : "en-US";
4273
- return /* @__PURE__ */ jsxs9("div", { "data-testid": "table-footer", className: "flex items-center justify-between px-2 pt-4", children: [
4274
- resolved.summary ? /* @__PURE__ */ jsxs9("div", { className: "text-body text-muted-foreground", "data-testid": "table-pagination-summary", children: [
4327
+ return /* @__PURE__ */ jsxs10("div", { "data-testid": "table-footer", className: "flex items-center justify-between px-2 pt-4", children: [
4328
+ resolved.summary ? /* @__PURE__ */ jsxs10("div", { className: "text-body text-muted-foreground", "data-testid": "table-pagination-summary", children: [
4275
4329
  "Showing ",
4276
- /* @__PURE__ */ jsx11("span", { className: "text-foreground font-medium", children: itemStart.toLocaleString(locale) }),
4330
+ /* @__PURE__ */ jsx12("span", { className: "text-foreground font-medium", children: itemStart.toLocaleString(locale) }),
4277
4331
  " to",
4278
4332
  " ",
4279
- /* @__PURE__ */ jsx11("span", { className: "text-foreground font-medium", children: itemEnd.toLocaleString(locale) }),
4333
+ /* @__PURE__ */ jsx12("span", { className: "text-foreground font-medium", children: itemEnd.toLocaleString(locale) }),
4280
4334
  " of",
4281
4335
  " ",
4282
- /* @__PURE__ */ jsxs9("span", { className: "text-foreground font-medium", children: [
4336
+ /* @__PURE__ */ jsxs10("span", { className: "text-foreground font-medium", children: [
4283
4337
  rowCount.toLocaleString(locale),
4284
4338
  !isRowCountExact && "+"
4285
4339
  ] }),
4286
4340
  " ",
4287
4341
  "results",
4288
- !isRowCountExact && /* @__PURE__ */ jsxs9(Tooltip5, { children: [
4289
- /* @__PURE__ */ jsx11(TooltipTrigger4, { className: "ml-1 align-middle", children: /* @__PURE__ */ jsx11(Icon7, { name: "circle-info", size: "sm" }) }),
4290
- /* @__PURE__ */ jsx11(TooltipContent4, { children: "Add filters or refine your search to reduce the result set." })
4342
+ !isRowCountExact && /* @__PURE__ */ jsxs10(Tooltip5, { children: [
4343
+ /* @__PURE__ */ jsx12(TooltipTrigger4, { className: "ml-1 align-middle", children: /* @__PURE__ */ jsx12(Icon8, { name: "circle-info", size: "sm" }) }),
4344
+ /* @__PURE__ */ jsx12(TooltipContent4, { children: "Add filters or refine your search to reduce the result set." })
4291
4345
  ] })
4292
- ] }) : /* @__PURE__ */ jsx11("div", {}),
4293
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-4", children: [
4294
- resolved.pageSizeSelector && /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
4295
- /* @__PURE__ */ jsx11(Label2, { htmlFor: PAGE_SIZE_SELECT_ID, className: "font-semibold", children: "Rows per page" }),
4296
- /* @__PURE__ */ jsxs9(Select2, { value: String(effectivePageSize), onValueChange: (value) => onPageSizeChange(Number(value)), children: [
4297
- /* @__PURE__ */ jsx11(SelectTrigger2, { id: PAGE_SIZE_SELECT_ID, size: "sm", className: "w-18", "data-testid": "table-page-size-select", children: /* @__PURE__ */ jsx11(SelectValue2, {}) }),
4298
- /* @__PURE__ */ jsx11(SelectContent2, { align: "end", children: /* @__PURE__ */ jsx11(SelectGroup2, { children: normalizedPageSizeOptions.map((option) => /* @__PURE__ */ jsx11(SelectItem2, { value: String(option), children: option }, option)) }) })
4346
+ ] }) : /* @__PURE__ */ jsx12("div", {}),
4347
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-4", children: [
4348
+ resolved.pageSizeSelector && /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
4349
+ /* @__PURE__ */ jsx12(Label2, { htmlFor: PAGE_SIZE_SELECT_ID, className: "font-semibold", children: "Rows per page" }),
4350
+ /* @__PURE__ */ jsxs10(Select2, { value: String(effectivePageSize), onValueChange: (value) => onPageSizeChange(Number(value)), children: [
4351
+ /* @__PURE__ */ jsx12(SelectTrigger2, { id: PAGE_SIZE_SELECT_ID, size: "sm", className: "w-18", "data-testid": "table-page-size-select", children: /* @__PURE__ */ jsx12(SelectValue2, {}) }),
4352
+ /* @__PURE__ */ jsx12(SelectContent2, { align: "end", children: /* @__PURE__ */ jsx12(SelectGroup2, { children: normalizedPageSizeOptions.map((option) => /* @__PURE__ */ jsx12(SelectItem2, { value: String(option), children: option }, option)) }) })
4299
4353
  ] })
4300
4354
  ] }),
4301
- pageCount > 1 && (resolved.arrows || resolved.numbers) && /* @__PURE__ */ jsx11(Pagination, { className: "mx-0 w-auto justify-end", children: /* @__PURE__ */ jsxs9(PaginationContent, { children: [
4302
- resolved.arrows && /* @__PURE__ */ jsx11(PaginationItem, { children: /* @__PURE__ */ jsx11(
4355
+ pageCount > 1 && (resolved.arrows || resolved.numbers) && /* @__PURE__ */ jsx12(Pagination, { className: "mx-0 w-auto justify-end", children: /* @__PURE__ */ jsxs10(PaginationContent, { children: [
4356
+ resolved.arrows && /* @__PURE__ */ jsx12(PaginationItem, { children: /* @__PURE__ */ jsx12(
4303
4357
  Button6,
4304
4358
  {
4305
4359
  variant: "outline",
@@ -4307,10 +4361,10 @@ function DataTablePagination({
4307
4361
  "aria-label": "Go to first page",
4308
4362
  disabled: currentPage <= 1,
4309
4363
  onClick: () => onPageChange(1),
4310
- children: /* @__PURE__ */ jsx11(Icon7, { name: "chevrons-left", className: "cn-rtl-flip" })
4364
+ children: /* @__PURE__ */ jsx12(Icon8, { name: "chevrons-left", className: "cn-rtl-flip" })
4311
4365
  }
4312
4366
  ) }),
4313
- resolved.arrows && /* @__PURE__ */ jsx11(PaginationItem, { children: /* @__PURE__ */ jsx11(
4367
+ resolved.arrows && /* @__PURE__ */ jsx12(PaginationItem, { children: /* @__PURE__ */ jsx12(
4314
4368
  Button6,
4315
4369
  {
4316
4370
  variant: "outline",
@@ -4318,11 +4372,11 @@ function DataTablePagination({
4318
4372
  "aria-label": "Go to previous page",
4319
4373
  disabled: currentPage <= 1,
4320
4374
  onClick: () => onPageChange(currentPage - 1),
4321
- children: /* @__PURE__ */ jsx11(Icon7, { name: "chevron-left", className: "cn-rtl-flip" })
4375
+ children: /* @__PURE__ */ jsx12(Icon8, { name: "chevron-left", className: "cn-rtl-flip" })
4322
4376
  }
4323
4377
  ) }),
4324
4378
  resolved.numbers && visiblePages.map(
4325
- (page, index) => page === void 0 ? /* @__PURE__ */ jsx11(PaginationItem, { children: /* @__PURE__ */ jsx11(PaginationEllipsis, {}) }, `ellipsis-${index}`) : /* @__PURE__ */ jsx11(PaginationItem, { children: /* @__PURE__ */ jsx11(
4379
+ (page, index) => page === void 0 ? /* @__PURE__ */ jsx12(PaginationItem, { children: /* @__PURE__ */ jsx12(PaginationEllipsis, {}) }, `ellipsis-${index}`) : /* @__PURE__ */ jsx12(PaginationItem, { children: /* @__PURE__ */ jsx12(
4326
4380
  PaginationLink,
4327
4381
  {
4328
4382
  href: "#",
@@ -4335,7 +4389,7 @@ function DataTablePagination({
4335
4389
  }
4336
4390
  ) }, page)
4337
4391
  ),
4338
- resolved.arrows && /* @__PURE__ */ jsx11(PaginationItem, { children: /* @__PURE__ */ jsx11(
4392
+ resolved.arrows && /* @__PURE__ */ jsx12(PaginationItem, { children: /* @__PURE__ */ jsx12(
4339
4393
  Button6,
4340
4394
  {
4341
4395
  variant: "outline",
@@ -4343,10 +4397,10 @@ function DataTablePagination({
4343
4397
  "aria-label": "Go to next page",
4344
4398
  disabled: currentPage >= pageCount,
4345
4399
  onClick: () => onPageChange(currentPage + 1),
4346
- children: /* @__PURE__ */ jsx11(Icon7, { name: "chevron-right", className: "cn-rtl-flip" })
4400
+ children: /* @__PURE__ */ jsx12(Icon8, { name: "chevron-right", className: "cn-rtl-flip" })
4347
4401
  }
4348
4402
  ) }),
4349
- resolved.arrows && /* @__PURE__ */ jsx11(PaginationItem, { children: /* @__PURE__ */ jsx11(
4403
+ resolved.arrows && /* @__PURE__ */ jsx12(PaginationItem, { children: /* @__PURE__ */ jsx12(
4350
4404
  Button6,
4351
4405
  {
4352
4406
  variant: "outline",
@@ -4354,7 +4408,7 @@ function DataTablePagination({
4354
4408
  "aria-label": "Go to last page",
4355
4409
  disabled: currentPage >= pageCount,
4356
4410
  onClick: () => onPageChange(pageCount),
4357
- children: /* @__PURE__ */ jsx11(Icon7, { name: "chevrons-right", className: "cn-rtl-flip" })
4411
+ children: /* @__PURE__ */ jsx12(Icon8, { name: "chevrons-right", className: "cn-rtl-flip" })
4358
4412
  }
4359
4413
  ) })
4360
4414
  ] }) })
@@ -4363,7 +4417,7 @@ function DataTablePagination({
4363
4417
  }
4364
4418
 
4365
4419
  // src/data-table/table-primitives.tsx
4366
- import * as React7 from "react";
4420
+ import * as React8 from "react";
4367
4421
  import {
4368
4422
  flexRender as flexRender2
4369
4423
  } from "@tanstack/react-table";
@@ -4375,7 +4429,7 @@ import {
4375
4429
  DropdownMenuSeparator as DropdownMenuSeparator2,
4376
4430
  DropdownMenuTrigger as DropdownMenuTrigger4
4377
4431
  } from "@upbound/monarch-core";
4378
- import { Icon as Icon8 } from "@upbound/monarch-core";
4432
+ import { Icon as Icon9 } from "@upbound/monarch-core";
4379
4433
  import { Skeleton } from "@upbound/monarch-core";
4380
4434
  import {
4381
4435
  Table as BaseTable,
@@ -4386,7 +4440,7 @@ import {
4386
4440
  TableRow as BaseTableRow
4387
4441
  } from "@upbound/monarch-core";
4388
4442
  import { Tooltip as Tooltip6, TooltipContent as TooltipContent5, TooltipTrigger as TooltipTrigger5 } from "@upbound/monarch-core";
4389
- import { Fragment as Fragment7, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
4443
+ import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
4390
4444
  var HEADER_SURFACE_BG = "bg-[color-mix(in_oklch,var(--muted)_50%,var(--card))]";
4391
4445
  var TABLE_HEAD_CLASSES = "text-body-sm text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap has-[[role=checkbox]]:pr-0";
4392
4446
  var TABLE_CELL_CLASSES = "px-4 py-2 align-middle whitespace-nowrap has-[[role=checkbox]]:pr-0";
@@ -4400,7 +4454,7 @@ function DataTableRoot({
4400
4454
  children
4401
4455
  }) {
4402
4456
  if (layout === "grid") {
4403
- return /* @__PURE__ */ jsx12(
4457
+ return /* @__PURE__ */ jsx13(
4404
4458
  "div",
4405
4459
  {
4406
4460
  ref: gridRootRef,
@@ -4411,7 +4465,7 @@ function DataTableRoot({
4411
4465
  }
4412
4466
  );
4413
4467
  }
4414
- return /* @__PURE__ */ jsx12(BaseTable, { className, style, children });
4468
+ return /* @__PURE__ */ jsx13(BaseTable, { className, style, children });
4415
4469
  }
4416
4470
  function getColumnPinningProps(column, surface = "body") {
4417
4471
  const isPinned = column.getIsPinned();
@@ -4434,8 +4488,8 @@ function getColumnPinningProps(column, surface = "body") {
4434
4488
  }
4435
4489
  function DataTableSortIcon({ sortOrder }) {
4436
4490
  if (!sortOrder) return null;
4437
- return /* @__PURE__ */ jsx12(
4438
- Icon8,
4491
+ return /* @__PURE__ */ jsx13(
4492
+ Icon9,
4439
4493
  {
4440
4494
  name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
4441
4495
  size: "xs",
@@ -4454,57 +4508,57 @@ function ColumnActionsMenuItems({
4454
4508
  const canResize = header.column.getCanResize();
4455
4509
  const canHide = header.column.getCanHide();
4456
4510
  const canPin = !isGrid && header.column.getCanPin();
4457
- return /* @__PURE__ */ jsxs10(DropdownMenuContent4, { align: "start", className: "w-45", children: [
4458
- canSort && /* @__PURE__ */ jsxs10(Fragment7, { children: [
4459
- /* @__PURE__ */ jsxs10(
4511
+ return /* @__PURE__ */ jsxs11(DropdownMenuContent4, { align: "start", className: "w-45", children: [
4512
+ canSort && /* @__PURE__ */ jsxs11(Fragment7, { children: [
4513
+ /* @__PURE__ */ jsxs11(
4460
4514
  DropdownMenuItem4,
4461
4515
  {
4462
4516
  disabled: header.column.getIsSorted() === "asc",
4463
4517
  onClick: () => header.column.toggleSorting(false),
4464
4518
  children: [
4465
- /* @__PURE__ */ jsx12(Icon8, { name: "arrow-up" }),
4519
+ /* @__PURE__ */ jsx13(Icon9, { name: "arrow-up" }),
4466
4520
  "Sort ascending"
4467
4521
  ]
4468
4522
  }
4469
4523
  ),
4470
- /* @__PURE__ */ jsxs10(
4524
+ /* @__PURE__ */ jsxs11(
4471
4525
  DropdownMenuItem4,
4472
4526
  {
4473
4527
  disabled: header.column.getIsSorted() === "desc",
4474
4528
  onClick: () => header.column.toggleSorting(true),
4475
4529
  children: [
4476
- /* @__PURE__ */ jsx12(Icon8, { name: "arrow-down" }),
4530
+ /* @__PURE__ */ jsx13(Icon9, { name: "arrow-down" }),
4477
4531
  "Sort descending"
4478
4532
  ]
4479
4533
  }
4480
4534
  ),
4481
- !!header.column.getIsSorted() && /* @__PURE__ */ jsxs10(DropdownMenuItem4, { onClick: () => header.column.clearSorting(), children: [
4482
- /* @__PURE__ */ jsx12(Icon8, { name: "xmark" }),
4535
+ !!header.column.getIsSorted() && /* @__PURE__ */ jsxs11(DropdownMenuItem4, { onClick: () => header.column.clearSorting(), children: [
4536
+ /* @__PURE__ */ jsx13(Icon9, { name: "xmark" }),
4483
4537
  "Remove sorting"
4484
4538
  ] })
4485
4539
  ] }),
4486
- canResize && /* @__PURE__ */ jsxs10(Fragment7, { children: [
4487
- canSort && /* @__PURE__ */ jsx12(DropdownMenuSeparator2, {}),
4488
- !isGrid && /* @__PURE__ */ jsxs10(DropdownMenuItem4, { onClick: () => onAutosizeColumn(header.column.id), children: [
4489
- /* @__PURE__ */ jsx12(Icon8, { name: "arrows-left-right" }),
4540
+ canResize && /* @__PURE__ */ jsxs11(Fragment7, { children: [
4541
+ canSort && /* @__PURE__ */ jsx13(DropdownMenuSeparator2, {}),
4542
+ !isGrid && /* @__PURE__ */ jsxs11(DropdownMenuItem4, { onClick: () => onAutosizeColumn(header.column.id), children: [
4543
+ /* @__PURE__ */ jsx13(Icon9, { name: "arrows-left-right" }),
4490
4544
  "Autosize column"
4491
4545
  ] }),
4492
- /* @__PURE__ */ jsxs10(DropdownMenuItem4, { onClick: () => onAutosizeAll(), children: [
4493
- /* @__PURE__ */ jsx12(Icon8, { name: "table-columns" }),
4546
+ /* @__PURE__ */ jsxs11(DropdownMenuItem4, { onClick: () => onAutosizeAll(), children: [
4547
+ /* @__PURE__ */ jsx13(Icon9, { name: "table-columns" }),
4494
4548
  isGrid ? "Reset all columns" : "Autosize all columns"
4495
4549
  ] })
4496
4550
  ] }),
4497
- (canHide || canPin) && /* @__PURE__ */ jsxs10(Fragment7, { children: [
4498
- (canSort || canResize) && /* @__PURE__ */ jsx12(DropdownMenuSeparator2, {}),
4499
- canHide && /* @__PURE__ */ jsxs10(DropdownMenuItem4, { onClick: () => header.column.toggleVisibility(), children: [
4500
- /* @__PURE__ */ jsx12(Icon8, { name: "eye-slash" }),
4551
+ (canHide || canPin) && /* @__PURE__ */ jsxs11(Fragment7, { children: [
4552
+ (canSort || canResize) && /* @__PURE__ */ jsx13(DropdownMenuSeparator2, {}),
4553
+ canHide && /* @__PURE__ */ jsxs11(DropdownMenuItem4, { onClick: () => header.column.toggleVisibility(), children: [
4554
+ /* @__PURE__ */ jsx13(Icon9, { name: "eye-slash" }),
4501
4555
  "Hide column"
4502
4556
  ] }),
4503
- canPin && (header.column.getIsPinned() ? /* @__PURE__ */ jsxs10(DropdownMenuItem4, { onClick: () => header.column.pin(false), children: [
4504
- /* @__PURE__ */ jsx12(Icon8, { name: "thumbtack" }),
4557
+ canPin && (header.column.getIsPinned() ? /* @__PURE__ */ jsxs11(DropdownMenuItem4, { onClick: () => header.column.pin(false), children: [
4558
+ /* @__PURE__ */ jsx13(Icon9, { name: "thumbtack" }),
4505
4559
  "Unpin column"
4506
- ] }) : /* @__PURE__ */ jsxs10(DropdownMenuItem4, { onClick: () => header.column.pin("left"), children: [
4507
- /* @__PURE__ */ jsx12(Icon8, { name: "thumbtack" }),
4560
+ ] }) : /* @__PURE__ */ jsxs11(DropdownMenuItem4, { onClick: () => header.column.pin("left"), children: [
4561
+ /* @__PURE__ */ jsx13(Icon9, { name: "thumbtack" }),
4508
4562
  "Pin column"
4509
4563
  ] }))
4510
4564
  ] })
@@ -4524,7 +4578,7 @@ function HeaderCellContent({
4524
4578
  const resizeHandler = header.getResizeHandler();
4525
4579
  const headerTitle = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "";
4526
4580
  const sorted = header.column.getIsSorted();
4527
- const labelButton = /* @__PURE__ */ jsxs10(
4581
+ const labelButton = /* @__PURE__ */ jsxs11(
4528
4582
  "button",
4529
4583
  {
4530
4584
  type: "button",
@@ -4535,10 +4589,10 @@ function HeaderCellContent({
4535
4589
  shouldShowActionsMenu ? "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50 cursor-pointer" : "cursor-default"
4536
4590
  ),
4537
4591
  children: [
4538
- /* @__PURE__ */ jsx12(DataTableSortIcon, { sortOrder: sorted }),
4539
- /* @__PURE__ */ jsx12("span", { className: "min-w-0 truncate", children: flexRender2(header.column.columnDef.header, header.getContext()) }),
4540
- shouldShowActionsMenu && /* @__PURE__ */ jsx12(
4541
- Icon8,
4592
+ /* @__PURE__ */ jsx13(DataTableSortIcon, { sortOrder: sorted }),
4593
+ /* @__PURE__ */ jsx13("span", { className: "min-w-0 truncate", children: flexRender2(header.column.columnDef.header, header.getContext()) }),
4594
+ shouldShowActionsMenu && /* @__PURE__ */ jsx13(
4595
+ Icon9,
4542
4596
  {
4543
4597
  size: "sm",
4544
4598
  name: "ellipsis",
@@ -4548,9 +4602,9 @@ function HeaderCellContent({
4548
4602
  ]
4549
4603
  }
4550
4604
  );
4551
- const label = shouldShowActionsMenu ? /* @__PURE__ */ jsxs10(DropdownMenu4, { children: [
4552
- /* @__PURE__ */ jsx12(DropdownMenuTrigger4, { asChild: true, children: labelButton }),
4553
- /* @__PURE__ */ jsx12(
4605
+ const label = shouldShowActionsMenu ? /* @__PURE__ */ jsxs11(DropdownMenu4, { children: [
4606
+ /* @__PURE__ */ jsx13(DropdownMenuTrigger4, { asChild: true, children: labelButton }),
4607
+ /* @__PURE__ */ jsx13(
4554
4608
  ColumnActionsMenuItems,
4555
4609
  {
4556
4610
  header,
@@ -4560,12 +4614,12 @@ function HeaderCellContent({
4560
4614
  }
4561
4615
  )
4562
4616
  ] }) : labelButton;
4563
- return /* @__PURE__ */ jsxs10(Fragment7, { children: [
4564
- /* @__PURE__ */ jsx12("div", { className: "flex min-w-0 items-center gap-1", children: /* @__PURE__ */ jsx12("div", { className: "min-w-0 flex-1", children: !isActionColumn && !isGroupedColumn && (headerTitle ? /* @__PURE__ */ jsxs10(Tooltip6, { children: [
4565
- /* @__PURE__ */ jsx12(TooltipTrigger5, { asChild: true, children: label }),
4566
- /* @__PURE__ */ jsx12(TooltipContent5, { children: headerTitle })
4617
+ return /* @__PURE__ */ jsxs11(Fragment7, { children: [
4618
+ /* @__PURE__ */ jsx13("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: /* @__PURE__ */ jsx13("div", { className: "min-w-0 flex-1", children: !isActionColumn && !isGroupedColumn && (headerTitle ? /* @__PURE__ */ jsxs11(Tooltip6, { children: [
4619
+ /* @__PURE__ */ jsx13(TooltipTrigger5, { asChild: true, children: label }),
4620
+ /* @__PURE__ */ jsx13(TooltipContent5, { children: headerTitle })
4567
4621
  ] }) : label) }) }),
4568
- canResize && /* @__PURE__ */ jsx12(
4622
+ canResize && /* @__PURE__ */ jsx13(
4569
4623
  "button",
4570
4624
  {
4571
4625
  type: "button",
@@ -4581,7 +4635,7 @@ function HeaderCellContent({
4581
4635
  ] });
4582
4636
  }
4583
4637
  var DEFAULT_STICKY_HEADER_OFFSET_PX = 0;
4584
- var DEFAULT_STICKY_HEADER_ROW_HEIGHT_PX = 48;
4638
+ var DEFAULT_STICKY_HEADER_ROW_HEIGHT_PX = 40;
4585
4639
  function DataTableHeader({
4586
4640
  headerGroups,
4587
4641
  onAutosizeAll,
@@ -4609,7 +4663,7 @@ function DataTableHeader({
4609
4663
  const stickyTopPx = stickyHeader ? stickyHeaderOffset + headerGroupIndex * stickyHeaderRowHeight : void 0;
4610
4664
  const isPinned = !isGrid && header.column.getIsPinned();
4611
4665
  const pinning = isGrid ? { className: "", style: {} } : getColumnPinningProps(header.column, "header");
4612
- const content = /* @__PURE__ */ jsx12(
4666
+ const content = /* @__PURE__ */ jsx13(
4613
4667
  HeaderCellContent,
4614
4668
  {
4615
4669
  header,
@@ -4630,11 +4684,11 @@ function DataTableHeader({
4630
4684
  isPinned && "z-30"
4631
4685
  );
4632
4686
  if (isGrid) {
4633
- return /* @__PURE__ */ jsx12(
4687
+ return /* @__PURE__ */ jsx13(
4634
4688
  "div",
4635
4689
  {
4636
4690
  role: "columnheader",
4637
- className: cn(TABLE_HEAD_CLASSES, cellClassName, "h-auto py-1.5 whitespace-normal"),
4691
+ className: cn(TABLE_HEAD_CLASSES, cellClassName, "flex items-center whitespace-normal"),
4638
4692
  style: __spreadValues({
4639
4693
  minWidth: header.column.columnDef.minSize
4640
4694
  }, stickyTopPx !== void 0 ? { top: stickyTopPx } : {}),
@@ -4643,10 +4697,10 @@ function DataTableHeader({
4643
4697
  header.id
4644
4698
  );
4645
4699
  }
4646
- return /* @__PURE__ */ jsx12(
4700
+ return /* @__PURE__ */ jsx13(
4647
4701
  BaseTableHead,
4648
4702
  {
4649
- className: cn(cellClassName, "h-auto py-1.5 whitespace-normal"),
4703
+ className: cn(cellClassName, "whitespace-normal"),
4650
4704
  style: __spreadValues(__spreadValues(__spreadProps(__spreadValues({}, pinning.style), {
4651
4705
  minWidth: header.column.columnDef.minSize,
4652
4706
  maxWidth: header.column.columnDef.maxSize
@@ -4658,19 +4712,19 @@ function DataTableHeader({
4658
4712
  });
4659
4713
  };
4660
4714
  if (isGrid) {
4661
- return /* @__PURE__ */ jsx12(
4715
+ return /* @__PURE__ */ jsx13(
4662
4716
  "div",
4663
4717
  {
4664
4718
  role: "rowgroup",
4665
4719
  className: cn("col-span-full grid grid-cols-subgrid", HEADER_SURFACE_BG, !!stickyHeader && "sticky z-20"),
4666
4720
  style: stickyHeader ? { top: stickyHeaderOffset } : void 0,
4667
- children: headerGroups.map((headerGroup, headerGroupIndex) => /* @__PURE__ */ jsx12("div", { role: "row", className: "col-span-full grid grid-cols-subgrid border-b", children: renderHeaders(headerGroup, headerGroupIndex) }, headerGroup.id))
4721
+ children: headerGroups.map((headerGroup, headerGroupIndex) => /* @__PURE__ */ jsx13("div", { role: "row", className: "col-span-full grid grid-cols-subgrid border-b", children: renderHeaders(headerGroup, headerGroupIndex) }, headerGroup.id))
4668
4722
  }
4669
4723
  );
4670
4724
  }
4671
- return /* @__PURE__ */ jsx12(BaseTableHeader, { children: headerGroups.map((headerGroup, headerGroupIndex) => /* @__PURE__ */ jsx12(BaseTableRow, { children: renderHeaders(headerGroup, headerGroupIndex) }, headerGroup.id)) });
4725
+ return /* @__PURE__ */ jsx13(BaseTableHeader, { children: headerGroups.map((headerGroup, headerGroupIndex) => /* @__PURE__ */ jsx13(BaseTableRow, { children: renderHeaders(headerGroup, headerGroupIndex) }, headerGroup.id)) });
4672
4726
  }
4673
- var DataTableRow = React7.forwardRef(
4727
+ var DataTableRow = React8.forwardRef(
4674
4728
  (_a, ref) => {
4675
4729
  var _b = _a, { hoverable, disabled, className, layout = "auto" } = _b, props = __objRest(_b, ["hoverable", "disabled", "className", "layout"]);
4676
4730
  const classes = cn(
@@ -4680,7 +4734,7 @@ var DataTableRow = React7.forwardRef(
4680
4734
  className
4681
4735
  );
4682
4736
  if (layout === "grid") {
4683
- return /* @__PURE__ */ jsx12(
4737
+ return /* @__PURE__ */ jsx13(
4684
4738
  "div",
4685
4739
  __spreadValues({
4686
4740
  ref,
@@ -4689,7 +4743,7 @@ var DataTableRow = React7.forwardRef(
4689
4743
  }, props)
4690
4744
  );
4691
4745
  }
4692
- return /* @__PURE__ */ jsx12(BaseTableRow, __spreadValues({ ref, className: classes }, props));
4746
+ return /* @__PURE__ */ jsx13(BaseTableRow, __spreadValues({ ref, className: classes }, props));
4693
4747
  }
4694
4748
  );
4695
4749
  DataTableRow.displayName = "DataTableRow";
@@ -4720,7 +4774,7 @@ function DataTableCell({
4720
4774
  isPinned && "z-10",
4721
4775
  className
4722
4776
  );
4723
- const cellElement = isGrid ? /* @__PURE__ */ jsx12(
4777
+ const cellElement = isGrid ? /* @__PURE__ */ jsx13(
4724
4778
  "div",
4725
4779
  {
4726
4780
  role: "cell",
@@ -4728,7 +4782,7 @@ function DataTableCell({
4728
4782
  style: { minWidth: cell.column.columnDef.minSize },
4729
4783
  children: content
4730
4784
  }
4731
- ) : /* @__PURE__ */ jsx12(
4785
+ ) : /* @__PURE__ */ jsx13(
4732
4786
  BaseTableCell,
4733
4787
  {
4734
4788
  className: cellClassName,
@@ -4740,9 +4794,9 @@ function DataTableCell({
4740
4794
  }
4741
4795
  );
4742
4796
  if (!shouldShowContextualMenu || !onContextCell) return cellElement;
4743
- return /* @__PURE__ */ jsxs10(ContextMenu, { children: [
4744
- /* @__PURE__ */ jsx12(ContextMenuTrigger, { asChild: true, children: cellElement }),
4745
- /* @__PURE__ */ jsx12(
4797
+ return /* @__PURE__ */ jsxs11(ContextMenu, { children: [
4798
+ /* @__PURE__ */ jsx13(ContextMenuTrigger, { asChild: true, children: cellElement }),
4799
+ /* @__PURE__ */ jsx13(
4746
4800
  CellContextualFilter,
4747
4801
  {
4748
4802
  filter: contextualFilter,
@@ -4761,7 +4815,7 @@ function DataTableGroupRow({
4761
4815
  layout = "auto"
4762
4816
  }) {
4763
4817
  if (layout === "grid") {
4764
- return /* @__PURE__ */ jsx12("div", { role: "row", className: "bg-muted/50 hover:bg-muted/50 col-span-full grid grid-cols-subgrid", children: /* @__PURE__ */ jsx12(
4818
+ return /* @__PURE__ */ jsx13("div", { role: "row", className: "bg-muted/50 hover:bg-muted/50 col-span-full grid grid-cols-subgrid", children: /* @__PURE__ */ jsx13(
4765
4819
  "div",
4766
4820
  {
4767
4821
  role: "cell",
@@ -4771,7 +4825,7 @@ function DataTableGroupRow({
4771
4825
  }
4772
4826
  ) });
4773
4827
  }
4774
- return /* @__PURE__ */ jsx12(BaseTableRow, { className: "bg-muted/50 hover:bg-muted/50", children: /* @__PURE__ */ jsx12(BaseTableCell, { colSpan, className: "text-foreground border-b font-semibold whitespace-nowrap", children: groupLabel }) });
4828
+ return /* @__PURE__ */ jsx13(BaseTableRow, { className: "bg-muted/50 hover:bg-muted/50", children: /* @__PURE__ */ jsx13(BaseTableCell, { colSpan, className: "text-foreground border-b font-semibold whitespace-nowrap", children: groupLabel }) });
4775
4829
  }
4776
4830
  function DataTableSkeletonBody({
4777
4831
  rowCount = 10,
@@ -4780,32 +4834,32 @@ function DataTableSkeletonBody({
4780
4834
  layout = "auto"
4781
4835
  }) {
4782
4836
  const isGrid = layout === "grid";
4783
- const rows = Array.from({ length: rowCount }).map((_, rowIndex) => /* @__PURE__ */ jsx12(DataTableRow, { layout, children: columns.map(
4837
+ const rows = Array.from({ length: rowCount }).map((_, rowIndex) => /* @__PURE__ */ jsx13(DataTableRow, { layout, children: columns.map(
4784
4838
  (col) => {
4785
4839
  var _a, _b;
4786
- return isGrid ? /* @__PURE__ */ jsx12(
4840
+ return isGrid ? /* @__PURE__ */ jsx13(
4787
4841
  "div",
4788
4842
  {
4789
4843
  role: "cell",
4790
4844
  className: cn(TABLE_CELL_CLASSES, "flex items-center overflow-hidden"),
4791
4845
  style: { minWidth: col.minSize },
4792
- children: (_a = renderCell == null ? void 0 : renderCell(col.id)) != null ? _a : /* @__PURE__ */ jsx12(Skeleton, { className: "h-4 w-full" })
4846
+ children: (_a = renderCell == null ? void 0 : renderCell(col.id)) != null ? _a : /* @__PURE__ */ jsx13(Skeleton, { className: "h-4 w-full" })
4793
4847
  },
4794
4848
  `skeleton-col-${col.id}-row-${rowIndex}`
4795
- ) : /* @__PURE__ */ jsx12(
4849
+ ) : /* @__PURE__ */ jsx13(
4796
4850
  BaseTableCell,
4797
4851
  {
4798
4852
  style: { width: col.size, minWidth: col.minSize, maxWidth: col.maxSize },
4799
- children: (_b = renderCell == null ? void 0 : renderCell(col.id)) != null ? _b : /* @__PURE__ */ jsx12(Skeleton, { className: "h-4 w-full" })
4853
+ children: (_b = renderCell == null ? void 0 : renderCell(col.id)) != null ? _b : /* @__PURE__ */ jsx13(Skeleton, { className: "h-4 w-full" })
4800
4854
  },
4801
4855
  `skeleton-col-${col.id}-row-${rowIndex}`
4802
4856
  );
4803
4857
  }
4804
4858
  ) }, `skeleton-row-${rowIndex}`));
4805
4859
  if (isGrid) {
4806
- return /* @__PURE__ */ jsx12("div", { role: "rowgroup", className: "col-span-full grid grid-cols-subgrid", "data-testid": "table-skeleton-loader", children: rows });
4860
+ return /* @__PURE__ */ jsx13("div", { role: "rowgroup", className: "col-span-full grid grid-cols-subgrid", "data-testid": "table-skeleton-loader", children: rows });
4807
4861
  }
4808
- return /* @__PURE__ */ jsx12(BaseTableBody, { "data-testid": "table-skeleton-loader", children: rows });
4862
+ return /* @__PURE__ */ jsx13(BaseTableBody, { "data-testid": "table-skeleton-loader", children: rows });
4809
4863
  }
4810
4864
  function DataTableExpandedRow({
4811
4865
  colSpan,
@@ -4815,9 +4869,9 @@ function DataTableExpandedRow({
4815
4869
  }) {
4816
4870
  if (!show) return null;
4817
4871
  if (layout === "grid") {
4818
- return /* @__PURE__ */ jsx12("div", { role: "row", className: "col-span-full grid grid-cols-subgrid", children: /* @__PURE__ */ jsx12("div", { role: "cell", style: { gridColumn: `span ${colSpan}` }, className: "bg-card p-0 align-top whitespace-normal", children }) });
4872
+ return /* @__PURE__ */ jsx13("div", { role: "row", className: "col-span-full grid grid-cols-subgrid", children: /* @__PURE__ */ jsx13("div", { role: "cell", style: { gridColumn: `span ${colSpan}` }, className: "bg-card p-0 align-top whitespace-normal", children }) });
4819
4873
  }
4820
- return /* @__PURE__ */ jsx12(BaseTableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx12(BaseTableCell, { colSpan, className: "bg-card p-0 align-top whitespace-normal", children }) });
4874
+ return /* @__PURE__ */ jsx13(BaseTableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx13(BaseTableCell, { colSpan, className: "bg-card p-0 align-top whitespace-normal", children }) });
4821
4875
  }
4822
4876
  function DataTableBody({
4823
4877
  tableRows,
@@ -4843,7 +4897,7 @@ function DataTableBody({
4843
4897
  minSize: c.columnDef.minSize,
4844
4898
  maxSize: c.columnDef.maxSize
4845
4899
  }));
4846
- return /* @__PURE__ */ jsx12(
4900
+ return /* @__PURE__ */ jsx13(
4847
4901
  DataTableSkeletonBody,
4848
4902
  {
4849
4903
  columns: skeletonColumns,
@@ -4857,17 +4911,17 @@ function DataTableBody({
4857
4911
  var _a, _b, _c, _d;
4858
4912
  if ((_a = row.getIsGrouped) == null ? void 0 : _a.call(row)) {
4859
4913
  const groupLabel = (_c = row.groupingValue) != null ? _c : row.groupingColumnId ? (_b = row.getGroupingValue) == null ? void 0 : _b.call(row, row.groupingColumnId) : void 0;
4860
- return /* @__PURE__ */ jsx12(DataTableGroupRow, { groupLabel: String(groupLabel != null ? groupLabel : ""), colSpan, layout }, row.id);
4914
+ return /* @__PURE__ */ jsx13(DataTableGroupRow, { groupLabel: String(groupLabel != null ? groupLabel : ""), colSpan, layout }, row.id);
4861
4915
  }
4862
4916
  const isExpanded = !!(renderExpandedRow && ((_d = row.getIsExpanded) == null ? void 0 : _d.call(row)));
4863
4917
  const expandedRow = renderExpandedRow ? renderExpandedRow(row.original) : null;
4864
- return /* @__PURE__ */ jsxs10(React7.Fragment, { children: [
4865
- /* @__PURE__ */ jsx12(
4918
+ return /* @__PURE__ */ jsxs11(React8.Fragment, { children: [
4919
+ /* @__PURE__ */ jsx13(
4866
4920
  DataTableRow,
4867
4921
  __spreadProps(__spreadValues({}, onRowRender ? onRowRender(row.original) : {}), {
4868
4922
  "data-expanded": isExpanded || void 0,
4869
4923
  layout,
4870
- children: row.getVisibleCells().filter((cell) => !isFilterOnlyColumn(cell.column)).map((cell) => /* @__PURE__ */ jsx12(
4924
+ children: row.getVisibleCells().filter((cell) => !isFilterOnlyColumn(cell.column)).map((cell) => /* @__PURE__ */ jsx13(
4871
4925
  DataTableCell,
4872
4926
  {
4873
4927
  cell,
@@ -4881,21 +4935,21 @@ function DataTableBody({
4881
4935
  ))
4882
4936
  })
4883
4937
  ),
4884
- /* @__PURE__ */ jsx12(DataTableExpandedRow, { colSpan, show: isExpanded, layout, children: expandedRow })
4938
+ /* @__PURE__ */ jsx13(DataTableExpandedRow, { colSpan, show: isExpanded, layout, children: expandedRow })
4885
4939
  ] }, row.id);
4886
4940
  });
4887
4941
  if (isGrid) {
4888
- return /* @__PURE__ */ jsx12("div", { role: "rowgroup", className: "col-span-full grid grid-cols-subgrid", children: rows });
4942
+ return /* @__PURE__ */ jsx13("div", { role: "rowgroup", className: "col-span-full grid grid-cols-subgrid", children: rows });
4889
4943
  }
4890
- return /* @__PURE__ */ jsx12(BaseTableBody, { children: rows });
4944
+ return /* @__PURE__ */ jsx13(BaseTableBody, { children: rows });
4891
4945
  }
4892
4946
 
4893
4947
  // src/data-table/view-filter.tsx
4894
- import * as React9 from "react";
4948
+ import * as React10 from "react";
4895
4949
 
4896
4950
  // src/filter-bar/filter-bar.tsx
4897
- import * as React8 from "react";
4898
- import { Icon as Icon9 } from "@upbound/monarch-core";
4951
+ import * as React9 from "react";
4952
+ import { Icon as Icon10 } from "@upbound/monarch-core";
4899
4953
  import { Badge as Badge3 } from "@upbound/monarch-core";
4900
4954
  import { Button as Button7 } from "@upbound/monarch-core";
4901
4955
  import { ButtonGroup as ButtonGroup2, ButtonGroupText as ButtonGroupText2 } from "@upbound/monarch-core";
@@ -4918,7 +4972,6 @@ import {
4918
4972
  DropdownMenu as DropdownMenu5,
4919
4973
  DropdownMenuCheckboxItem as DropdownMenuCheckboxItem2,
4920
4974
  DropdownMenuContent as DropdownMenuContent5,
4921
- DropdownMenuItem as DropdownMenuItem5,
4922
4975
  DropdownMenuRadioGroup,
4923
4976
  DropdownMenuRadioItem,
4924
4977
  DropdownMenuTrigger as DropdownMenuTrigger5
@@ -4926,7 +4979,7 @@ import {
4926
4979
  import { Input as Input2 } from "@upbound/monarch-core";
4927
4980
  import { Label as Label3 } from "@upbound/monarch-core";
4928
4981
  import { Popover as Popover2, PopoverContent as PopoverContent2, PopoverTrigger as PopoverTrigger2 } from "@upbound/monarch-core";
4929
- import { Fragment as Fragment8, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
4982
+ import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
4930
4983
  function asCheckboxValue(value) {
4931
4984
  return Array.isArray(value) ? value : [];
4932
4985
  }
@@ -4960,6 +5013,14 @@ function applyTimeToDate(date, time) {
4960
5013
  function formatDateLabel(date) {
4961
5014
  return date.toLocaleDateString(void 0, { month: "short", day: "numeric" });
4962
5015
  }
5016
+ function composeRefs(...refs) {
5017
+ return (node) => {
5018
+ for (const ref of refs) {
5019
+ if (typeof ref === "function") ref(node);
5020
+ else if (ref) ref.current = node;
5021
+ }
5022
+ };
5023
+ }
4963
5024
  function FilterBar(_a) {
4964
5025
  var _b = _a, {
4965
5026
  filters,
@@ -4968,7 +5029,8 @@ function FilterBar(_a) {
4968
5029
  onRemoveFilter,
4969
5030
  onChangeFilter,
4970
5031
  className,
4971
- children
5032
+ children,
5033
+ ref
4972
5034
  } = _b, props = __objRest(_b, [
4973
5035
  "filters",
4974
5036
  "activeFilters",
@@ -4976,48 +5038,59 @@ function FilterBar(_a) {
4976
5038
  "onRemoveFilter",
4977
5039
  "onChangeFilter",
4978
5040
  "className",
4979
- "children"
5041
+ "children",
5042
+ "ref"
4980
5043
  ]);
4981
5044
  const usedKeys = new Set(activeFilters.map((f) => f.key));
4982
5045
  const availableFilters = filters.filter((f) => !usedKeys.has(f.key));
4983
5046
  const shouldShowFilters = availableFilters.length > 0 || activeFilters.length > 0;
4984
- const [pendingOpenKey, setPendingOpenKey] = React8.useState(null);
5047
+ const [pendingOpenKey, setPendingOpenKey] = React9.useState(null);
4985
5048
  function handleAddFilter(key) {
4986
5049
  onAddFilter(key);
4987
5050
  setPendingOpenKey(key);
4988
5051
  }
4989
- return /* @__PURE__ */ jsxs11(
5052
+ const containerRef = React9.useRef(null);
5053
+ return /* @__PURE__ */ jsxs12(
4990
5054
  "div",
4991
5055
  __spreadProps(__spreadValues({
4992
5056
  "data-slot": "filter-bar",
4993
5057
  "data-visible-filters": shouldShowFilters,
4994
- className: cn("flex flex-wrap items-center gap-2", className)
5058
+ className: cn("flex flex-wrap items-center gap-2", className),
5059
+ ref: composeRefs(containerRef, ref)
4995
5060
  }, props), {
4996
5061
  children: [
4997
- availableFilters.length > 0 && /* @__PURE__ */ jsxs11(DropdownMenu5, { children: [
4998
- /* @__PURE__ */ jsx13(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs11(Button7, { variant: "outline", children: [
4999
- /* @__PURE__ */ jsx13(Icon9, { name: "plus", "data-icon": "inline-start" }),
5000
- "Add filter"
5001
- ] }) }),
5002
- /* @__PURE__ */ jsx13(
5003
- DropdownMenuContent5,
5004
- {
5005
- align: "start",
5006
- className: "w-48",
5007
- onCloseAutoFocus: (e) => e.preventDefault(),
5008
- children: availableFilters.map((filter) => /* @__PURE__ */ jsx13(DropdownMenuItem5, { onSelect: () => handleAddFilter(filter.key), children: filter.label }, filter.key))
5009
- }
5010
- )
5011
- ] }),
5062
+ availableFilters.length > 0 && /* @__PURE__ */ jsxs12(
5063
+ Combobox2,
5064
+ {
5065
+ items: availableFilters,
5066
+ itemToStringValue: (item) => item.label,
5067
+ itemToStringLabel: (item) => item.label,
5068
+ onValueChange: (filter) => {
5069
+ if (filter) handleAddFilter(filter.key);
5070
+ },
5071
+ children: [
5072
+ /* @__PURE__ */ jsxs12(ComboboxTrigger2, { "aria-label": "Add filter", render: /* @__PURE__ */ jsx14(Button7, { variant: "outline" }), children: [
5073
+ /* @__PURE__ */ jsx14(Icon10, { name: "plus", "data-icon": "inline-start" }),
5074
+ "Add filter"
5075
+ ] }),
5076
+ /* @__PURE__ */ jsxs12(ComboboxContent2, { container: containerRef, align: "start", className: "w-48", children: [
5077
+ /* @__PURE__ */ jsx14(ComboboxInput2, { showTrigger: false, placeholder: "Search filters\u2026" }),
5078
+ /* @__PURE__ */ jsx14(ComboboxEmpty2, { children: "No filters found." }),
5079
+ /* @__PURE__ */ jsx14(ComboboxList2, { children: (filter) => /* @__PURE__ */ jsx14(ComboboxItem2, { value: filter, children: filter.label }, filter.key) })
5080
+ ] })
5081
+ ]
5082
+ }
5083
+ ),
5012
5084
  activeFilters.map((active) => {
5013
5085
  const definition = filters.find((f) => f.key === active.key);
5014
5086
  if (!definition) return null;
5015
- return /* @__PURE__ */ jsx13(
5087
+ return /* @__PURE__ */ jsx14(
5016
5088
  FilterChip,
5017
5089
  {
5018
5090
  definition,
5019
5091
  value: active.value,
5020
5092
  autoOpen: active.key === pendingOpenKey,
5093
+ container: containerRef,
5021
5094
  onChangeValue: (value) => onChangeFilter(active.key, value),
5022
5095
  onRemove: () => onRemoveFilter(active.key)
5023
5096
  },
@@ -5029,34 +5102,36 @@ function FilterBar(_a) {
5029
5102
  })
5030
5103
  );
5031
5104
  }
5032
- function FilterChip({ definition, value, autoOpen, onChangeValue, onRemove }) {
5105
+ function FilterChip({ definition, value, autoOpen, container, onChangeValue, onRemove }) {
5033
5106
  var _a;
5034
5107
  const type = (_a = definition.type) != null ? _a : "checkbox";
5035
5108
  switch (type) {
5036
5109
  case "checkbox":
5037
- return /* @__PURE__ */ jsx13(
5110
+ return /* @__PURE__ */ jsx14(
5038
5111
  CheckboxFilterChip,
5039
5112
  {
5040
5113
  definition,
5041
5114
  value,
5042
5115
  autoOpen,
5116
+ container,
5043
5117
  onChangeValue,
5044
5118
  onRemove
5045
5119
  }
5046
5120
  );
5047
5121
  case "radio":
5048
- return /* @__PURE__ */ jsx13(
5122
+ return /* @__PURE__ */ jsx14(
5049
5123
  RadioFilterChip,
5050
5124
  {
5051
5125
  definition,
5052
5126
  value,
5053
5127
  autoOpen,
5128
+ container,
5054
5129
  onChangeValue,
5055
5130
  onRemove
5056
5131
  }
5057
5132
  );
5058
5133
  case "text":
5059
- return /* @__PURE__ */ jsx13(
5134
+ return /* @__PURE__ */ jsx14(
5060
5135
  TextFilterChip,
5061
5136
  {
5062
5137
  definition,
@@ -5067,7 +5142,7 @@ function FilterChip({ definition, value, autoOpen, onChangeValue, onRemove }) {
5067
5142
  }
5068
5143
  );
5069
5144
  case "multiText":
5070
- return /* @__PURE__ */ jsx13(
5145
+ return /* @__PURE__ */ jsx14(
5071
5146
  MultiTextFilterChip,
5072
5147
  {
5073
5148
  definition,
@@ -5078,7 +5153,7 @@ function FilterChip({ definition, value, autoOpen, onChangeValue, onRemove }) {
5078
5153
  }
5079
5154
  );
5080
5155
  case "date":
5081
- return /* @__PURE__ */ jsx13(
5156
+ return /* @__PURE__ */ jsx14(
5082
5157
  DateFilterChip,
5083
5158
  {
5084
5159
  definition,
@@ -5091,12 +5166,13 @@ function FilterChip({ definition, value, autoOpen, onChangeValue, onRemove }) {
5091
5166
  }
5092
5167
  }
5093
5168
  function FilterChipRemoveButton({ label, onRemove }) {
5094
- return /* @__PURE__ */ jsx13(Button7, { variant: "outline", size: "icon", "aria-label": `Remove ${label} filter`, onClick: onRemove, children: /* @__PURE__ */ jsx13(Icon9, { name: "xmark" }) });
5169
+ return /* @__PURE__ */ jsx14(Button7, { variant: "outline", size: "icon", "aria-label": `Remove ${label} filter`, onClick: onRemove, children: /* @__PURE__ */ jsx14(Icon10, { name: "xmark" }) });
5095
5170
  }
5096
5171
  function CheckboxFilterChip({
5097
5172
  definition,
5098
5173
  value,
5099
5174
  autoOpen,
5175
+ container,
5100
5176
  onChangeValue,
5101
5177
  onRemove
5102
5178
  }) {
@@ -5108,9 +5184,9 @@ function CheckboxFilterChip({
5108
5184
  const next = values.includes(optionValue) ? values.filter((v) => v !== optionValue) : [...values, optionValue];
5109
5185
  onChangeValue(next);
5110
5186
  }
5111
- return /* @__PURE__ */ jsxs11(ButtonGroup2, { children: [
5112
- /* @__PURE__ */ jsx13(ButtonGroupText2, { children: label }),
5113
- searchable ? /* @__PURE__ */ jsxs11(
5187
+ return /* @__PURE__ */ jsxs12(ButtonGroup2, { children: [
5188
+ /* @__PURE__ */ jsx14(ButtonGroupText2, { children: label }),
5189
+ searchable ? /* @__PURE__ */ jsxs12(
5114
5190
  Combobox2,
5115
5191
  {
5116
5192
  items: options,
@@ -5120,40 +5196,48 @@ function CheckboxFilterChip({
5120
5196
  value: options.filter((o) => values.includes(o.value)),
5121
5197
  onValueChange: (selected) => onChangeValue(selected.map((s) => s.value)),
5122
5198
  children: [
5123
- /* @__PURE__ */ jsx13(
5199
+ /* @__PURE__ */ jsx14(
5124
5200
  ComboboxTrigger2,
5125
5201
  {
5126
- render: /* @__PURE__ */ jsx13(Button7, { variant: "outline", className: "gap-1 font-normal [&>svg:last-child]:size-(--icon-sm)" }),
5127
- children: /* @__PURE__ */ jsx13("span", { className: values.length === 0 ? "text-muted-foreground" : "", children: displayLabel })
5202
+ render: /* @__PURE__ */ jsx14(Button7, { variant: "outline", className: "gap-1 font-normal [&>svg:last-child]:size-(--icon-sm)" }),
5203
+ children: /* @__PURE__ */ jsx14("span", { className: values.length === 0 ? "text-muted-foreground" : "", children: displayLabel })
5128
5204
  }
5129
5205
  ),
5130
- /* @__PURE__ */ jsxs11(ComboboxContent2, { className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
5131
- /* @__PURE__ */ jsx13(ComboboxInput2, { showTrigger: false, placeholder: `Search ${label.toLowerCase()}\u2026` }),
5132
- values.length > 0 && /* @__PURE__ */ jsxs11(Fragment8, { children: [
5133
- /* @__PURE__ */ jsxs11(ComboboxSelectedChips2, { children: [
5134
- /* @__PURE__ */ jsx13(ComboboxValue2, { children: (selected) => /* @__PURE__ */ jsx13(Fragment8, { children: selected.map((item) => /* @__PURE__ */ jsx13(ComboboxChip2, { children: item.label }, item.value)) }) }),
5135
- /* @__PURE__ */ jsx13(ComboboxClearAll2, { onClick: () => onChangeValue([]) })
5136
- ] }),
5137
- /* @__PURE__ */ jsx13(ComboboxSeparator2, {})
5138
- ] }),
5139
- /* @__PURE__ */ jsxs11(ComboboxEmpty2, { children: [
5140
- "No ",
5141
- label.toLowerCase(),
5142
- " found."
5143
- ] }),
5144
- /* @__PURE__ */ jsx13(ComboboxList2, { children: (item) => /* @__PURE__ */ jsxs11(ComboboxItem2, { value: item, children: [
5145
- item.icon,
5146
- item.label
5147
- ] }, item.value) })
5148
- ] })
5206
+ /* @__PURE__ */ jsxs12(
5207
+ ComboboxContent2,
5208
+ {
5209
+ container,
5210
+ className: "min-w-64",
5211
+ collisionAvoidance: { side: "none", align: "shift" },
5212
+ children: [
5213
+ /* @__PURE__ */ jsx14(ComboboxInput2, { showTrigger: false, placeholder: `Search ${label.toLowerCase()}\u2026` }),
5214
+ values.length > 0 && /* @__PURE__ */ jsxs12(Fragment8, { children: [
5215
+ /* @__PURE__ */ jsxs12(ComboboxSelectedChips2, { children: [
5216
+ /* @__PURE__ */ jsx14(ComboboxValue2, { children: (selected) => /* @__PURE__ */ jsx14(Fragment8, { children: selected.map((item) => /* @__PURE__ */ jsx14(ComboboxChip2, { children: item.label }, item.value)) }) }),
5217
+ /* @__PURE__ */ jsx14(ComboboxClearAll2, { onClick: () => onChangeValue([]) })
5218
+ ] }),
5219
+ /* @__PURE__ */ jsx14(ComboboxSeparator2, {})
5220
+ ] }),
5221
+ /* @__PURE__ */ jsxs12(ComboboxEmpty2, { children: [
5222
+ "No ",
5223
+ label.toLowerCase(),
5224
+ " found."
5225
+ ] }),
5226
+ /* @__PURE__ */ jsx14(ComboboxList2, { children: (item) => /* @__PURE__ */ jsxs12(ComboboxItem2, { value: item, children: [
5227
+ item.icon,
5228
+ item.label
5229
+ ] }, item.value) })
5230
+ ]
5231
+ }
5232
+ )
5149
5233
  ]
5150
5234
  }
5151
- ) : /* @__PURE__ */ jsxs11(DropdownMenu5, { defaultOpen: autoOpen, children: [
5152
- /* @__PURE__ */ jsx13(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs11(Button7, { variant: "outline", className: "gap-1 font-normal", children: [
5153
- /* @__PURE__ */ jsx13("span", { className: values.length === 0 ? "text-muted-foreground" : "", children: displayLabel }),
5154
- /* @__PURE__ */ jsx13(Icon9, { name: "chevron-down", size: "sm", className: "text-muted-foreground" })
5235
+ ) : /* @__PURE__ */ jsxs12(DropdownMenu5, { defaultOpen: autoOpen, children: [
5236
+ /* @__PURE__ */ jsx14(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs12(Button7, { variant: "outline", className: "gap-1 font-normal", children: [
5237
+ /* @__PURE__ */ jsx14("span", { className: values.length === 0 ? "text-muted-foreground" : "", children: displayLabel }),
5238
+ /* @__PURE__ */ jsx14(Icon10, { name: "chevron-down", size: "sm", className: "text-muted-foreground" })
5155
5239
  ] }) }),
5156
- /* @__PURE__ */ jsx13(DropdownMenuContent5, { align: "start", className: "w-48", children: options.map((opt) => /* @__PURE__ */ jsxs11(
5240
+ /* @__PURE__ */ jsx14(DropdownMenuContent5, { align: "start", className: "w-48", children: options.map((opt) => /* @__PURE__ */ jsxs12(
5157
5241
  DropdownMenuCheckboxItem2,
5158
5242
  {
5159
5243
  checked: values.includes(opt.value),
@@ -5166,13 +5250,14 @@ function CheckboxFilterChip({
5166
5250
  opt.value
5167
5251
  )) })
5168
5252
  ] }),
5169
- /* @__PURE__ */ jsx13(FilterChipRemoveButton, { label, onRemove })
5253
+ /* @__PURE__ */ jsx14(FilterChipRemoveButton, { label, onRemove })
5170
5254
  ] });
5171
5255
  }
5172
5256
  function RadioFilterChip({
5173
5257
  definition,
5174
5258
  value,
5175
5259
  autoOpen,
5260
+ container,
5176
5261
  onChangeValue,
5177
5262
  onRemove
5178
5263
  }) {
@@ -5181,9 +5266,9 @@ function RadioFilterChip({
5181
5266
  const selectedValue = asRadioValue(value);
5182
5267
  const displayLabel = selectedValue ? (_b = (_a = options.find((o) => o.value === selectedValue)) == null ? void 0 : _a.label) != null ? _b : selectedValue : "Any";
5183
5268
  const selected = (_c = options.find((o) => o.value === selectedValue)) != null ? _c : null;
5184
- return /* @__PURE__ */ jsxs11(ButtonGroup2, { children: [
5185
- /* @__PURE__ */ jsx13(ButtonGroupText2, { children: label }),
5186
- searchable ? /* @__PURE__ */ jsxs11(
5269
+ return /* @__PURE__ */ jsxs12(ButtonGroup2, { children: [
5270
+ /* @__PURE__ */ jsx14(ButtonGroupText2, { children: label }),
5271
+ searchable ? /* @__PURE__ */ jsxs12(
5187
5272
  Combobox2,
5188
5273
  {
5189
5274
  items: options,
@@ -5195,38 +5280,46 @@ function RadioFilterChip({
5195
5280
  return onChangeValue((_a2 = next == null ? void 0 : next.value) != null ? _a2 : "");
5196
5281
  },
5197
5282
  children: [
5198
- /* @__PURE__ */ jsx13(
5283
+ /* @__PURE__ */ jsx14(
5199
5284
  ComboboxTrigger2,
5200
5285
  {
5201
- render: /* @__PURE__ */ jsx13(Button7, { variant: "outline", className: "gap-1 font-normal [&>svg:last-child]:size-(--icon-sm)" }),
5202
- children: /* @__PURE__ */ jsx13("span", { className: selectedValue ? "" : "text-muted-foreground", children: displayLabel })
5286
+ render: /* @__PURE__ */ jsx14(Button7, { variant: "outline", className: "gap-1 font-normal [&>svg:last-child]:size-(--icon-sm)" }),
5287
+ children: /* @__PURE__ */ jsx14("span", { className: selectedValue ? "" : "text-muted-foreground", children: displayLabel })
5203
5288
  }
5204
5289
  ),
5205
- /* @__PURE__ */ jsxs11(ComboboxContent2, { className: "min-w-64", collisionAvoidance: { side: "none", align: "shift" }, children: [
5206
- /* @__PURE__ */ jsx13(ComboboxInput2, { showTrigger: false, placeholder: `Search ${label.toLowerCase()}\u2026` }),
5207
- /* @__PURE__ */ jsxs11(ComboboxEmpty2, { children: [
5208
- "No ",
5209
- label.toLowerCase(),
5210
- " found."
5211
- ] }),
5212
- /* @__PURE__ */ jsx13(ComboboxList2, { children: (item) => /* @__PURE__ */ jsxs11(ComboboxItem2, { value: item, children: [
5213
- item.icon,
5214
- item.label
5215
- ] }, item.value) })
5216
- ] })
5290
+ /* @__PURE__ */ jsxs12(
5291
+ ComboboxContent2,
5292
+ {
5293
+ container,
5294
+ className: "min-w-64",
5295
+ collisionAvoidance: { side: "none", align: "shift" },
5296
+ children: [
5297
+ /* @__PURE__ */ jsx14(ComboboxInput2, { showTrigger: false, placeholder: `Search ${label.toLowerCase()}\u2026` }),
5298
+ /* @__PURE__ */ jsxs12(ComboboxEmpty2, { children: [
5299
+ "No ",
5300
+ label.toLowerCase(),
5301
+ " found."
5302
+ ] }),
5303
+ /* @__PURE__ */ jsx14(ComboboxList2, { children: (item) => /* @__PURE__ */ jsxs12(ComboboxItem2, { value: item, children: [
5304
+ item.icon,
5305
+ item.label
5306
+ ] }, item.value) })
5307
+ ]
5308
+ }
5309
+ )
5217
5310
  ]
5218
5311
  }
5219
- ) : /* @__PURE__ */ jsxs11(DropdownMenu5, { defaultOpen: autoOpen, children: [
5220
- /* @__PURE__ */ jsx13(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs11(Button7, { variant: "outline", className: "gap-1 font-normal", children: [
5221
- /* @__PURE__ */ jsx13("span", { className: selectedValue ? "" : "text-muted-foreground", children: displayLabel }),
5222
- /* @__PURE__ */ jsx13(Icon9, { name: "chevron-down", size: "sm", className: "text-muted-foreground" })
5312
+ ) : /* @__PURE__ */ jsxs12(DropdownMenu5, { defaultOpen: autoOpen, children: [
5313
+ /* @__PURE__ */ jsx14(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs12(Button7, { variant: "outline", className: "gap-1 font-normal", children: [
5314
+ /* @__PURE__ */ jsx14("span", { className: selectedValue ? "" : "text-muted-foreground", children: displayLabel }),
5315
+ /* @__PURE__ */ jsx14(Icon10, { name: "chevron-down", size: "sm", className: "text-muted-foreground" })
5223
5316
  ] }) }),
5224
- /* @__PURE__ */ jsx13(DropdownMenuContent5, { align: "start", className: "w-48", children: /* @__PURE__ */ jsx13(DropdownMenuRadioGroup, { value: selectedValue, onValueChange: onChangeValue, children: options.map((opt) => /* @__PURE__ */ jsxs11(DropdownMenuRadioItem, { value: opt.value, children: [
5317
+ /* @__PURE__ */ jsx14(DropdownMenuContent5, { align: "start", className: "w-48", children: /* @__PURE__ */ jsx14(DropdownMenuRadioGroup, { value: selectedValue, onValueChange: onChangeValue, children: options.map((opt) => /* @__PURE__ */ jsxs12(DropdownMenuRadioItem, { value: opt.value, children: [
5225
5318
  opt.icon,
5226
5319
  opt.label
5227
5320
  ] }, opt.value)) }) })
5228
5321
  ] }),
5229
- /* @__PURE__ */ jsx13(FilterChipRemoveButton, { label, onRemove })
5322
+ /* @__PURE__ */ jsx14(FilterChipRemoveButton, { label, onRemove })
5230
5323
  ] });
5231
5324
  }
5232
5325
  function TextFilterChip({
@@ -5238,12 +5331,12 @@ function TextFilterChip({
5238
5331
  }) {
5239
5332
  const { label, placeholder } = definition;
5240
5333
  const text = asTextValue(value);
5241
- const [open, setOpen] = React8.useState(!!autoOpen);
5242
- return /* @__PURE__ */ jsxs11(ButtonGroup2, { children: [
5243
- /* @__PURE__ */ jsx13(ButtonGroupText2, { children: label }),
5244
- /* @__PURE__ */ jsxs11(Popover2, { open, onOpenChange: setOpen, children: [
5245
- /* @__PURE__ */ jsx13(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx13(Button7, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx13("span", { className: text ? "" : "text-muted-foreground", children: text || "Any" }) }) }),
5246
- /* @__PURE__ */ jsx13(PopoverContent2, { align: "start", children: /* @__PURE__ */ jsx13(
5334
+ const [open, setOpen] = React9.useState(!!autoOpen);
5335
+ return /* @__PURE__ */ jsxs12(ButtonGroup2, { children: [
5336
+ /* @__PURE__ */ jsx14(ButtonGroupText2, { children: label }),
5337
+ /* @__PURE__ */ jsxs12(Popover2, { open, onOpenChange: setOpen, children: [
5338
+ /* @__PURE__ */ jsx14(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx14(Button7, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx14("span", { className: text ? "" : "text-muted-foreground", children: text || "Any" }) }) }),
5339
+ /* @__PURE__ */ jsx14(PopoverContent2, { align: "start", children: /* @__PURE__ */ jsx14(
5247
5340
  Input2,
5248
5341
  {
5249
5342
  autoFocus: true,
@@ -5256,7 +5349,7 @@ function TextFilterChip({
5256
5349
  }
5257
5350
  ) })
5258
5351
  ] }),
5259
- /* @__PURE__ */ jsx13(FilterChipRemoveButton, { label, onRemove })
5352
+ /* @__PURE__ */ jsx14(FilterChipRemoveButton, { label, onRemove })
5260
5353
  ] });
5261
5354
  }
5262
5355
  function MultiTextFilterChip({
@@ -5268,7 +5361,7 @@ function MultiTextFilterChip({
5268
5361
  }) {
5269
5362
  const { label, placeholder } = definition;
5270
5363
  const tokens = asMultiTextValue(value);
5271
- const [draft, setDraft] = React8.useState("");
5364
+ const [draft, setDraft] = React9.useState("");
5272
5365
  const displayLabel = tokens.length === 0 ? "Any" : tokens.length === 1 ? tokens[0] : `${tokens.length} values`;
5273
5366
  function addToken() {
5274
5367
  const token = draft.trim();
@@ -5282,25 +5375,25 @@ function MultiTextFilterChip({
5282
5375
  function removeToken(token) {
5283
5376
  onChangeValue(tokens.filter((t) => t !== token));
5284
5377
  }
5285
- return /* @__PURE__ */ jsxs11(ButtonGroup2, { children: [
5286
- /* @__PURE__ */ jsx13(ButtonGroupText2, { children: label }),
5287
- /* @__PURE__ */ jsxs11(Popover2, { defaultOpen: autoOpen, children: [
5288
- /* @__PURE__ */ jsx13(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx13(Button7, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx13("span", { className: tokens.length === 0 ? "text-muted-foreground" : "", children: displayLabel }) }) }),
5289
- /* @__PURE__ */ jsx13(PopoverContent2, { align: "start", children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2", children: [
5290
- tokens.length > 0 && /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-1", children: tokens.map((token) => /* @__PURE__ */ jsxs11(Badge3, { variant: "secondary", className: "gap-1", children: [
5378
+ return /* @__PURE__ */ jsxs12(ButtonGroup2, { children: [
5379
+ /* @__PURE__ */ jsx14(ButtonGroupText2, { children: label }),
5380
+ /* @__PURE__ */ jsxs12(Popover2, { defaultOpen: autoOpen, children: [
5381
+ /* @__PURE__ */ jsx14(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx14(Button7, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx14("span", { className: tokens.length === 0 ? "text-muted-foreground" : "", children: displayLabel }) }) }),
5382
+ /* @__PURE__ */ jsx14(PopoverContent2, { align: "start", children: /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2", children: [
5383
+ tokens.length > 0 && /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-1", children: tokens.map((token) => /* @__PURE__ */ jsxs12(Badge3, { variant: "secondary", className: "gap-1", children: [
5291
5384
  token,
5292
- /* @__PURE__ */ jsx13(
5385
+ /* @__PURE__ */ jsx14(
5293
5386
  "button",
5294
5387
  {
5295
5388
  type: "button",
5296
5389
  "aria-label": `Remove ${token}`,
5297
5390
  onClick: () => removeToken(token),
5298
5391
  className: "cursor-pointer",
5299
- children: /* @__PURE__ */ jsx13(Icon9, { name: "xmark", size: "xs" })
5392
+ children: /* @__PURE__ */ jsx14(Icon10, { name: "xmark", size: "xs" })
5300
5393
  }
5301
5394
  )
5302
5395
  ] }, token)) }),
5303
- /* @__PURE__ */ jsx13(
5396
+ /* @__PURE__ */ jsx14(
5304
5397
  Input2,
5305
5398
  {
5306
5399
  autoFocus: true,
@@ -5319,7 +5412,7 @@ function MultiTextFilterChip({
5319
5412
  )
5320
5413
  ] }) })
5321
5414
  ] }),
5322
- /* @__PURE__ */ jsx13(FilterChipRemoveButton, { label, onRemove })
5415
+ /* @__PURE__ */ jsx14(FilterChipRemoveButton, { label, onRemove })
5323
5416
  ] });
5324
5417
  }
5325
5418
  function DateFilterChip({
@@ -5349,12 +5442,12 @@ function DateFilterChip({
5349
5442
  if (!endDate) return;
5350
5443
  onChangeValue({ startDate, endDate: applyTimeToDate(endDate, time) });
5351
5444
  }
5352
- return /* @__PURE__ */ jsxs11(ButtonGroup2, { children: [
5353
- /* @__PURE__ */ jsx13(ButtonGroupText2, { children: label }),
5354
- /* @__PURE__ */ jsxs11(Popover2, { defaultOpen: autoOpen, children: [
5355
- /* @__PURE__ */ jsx13(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx13(Button7, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx13("span", { className: startDate ? "" : "text-muted-foreground", children: displayLabel }) }) }),
5356
- /* @__PURE__ */ jsx13(PopoverContent2, { align: "start", className: "w-fit", children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2", children: [
5357
- /* @__PURE__ */ jsx13(
5445
+ return /* @__PURE__ */ jsxs12(ButtonGroup2, { children: [
5446
+ /* @__PURE__ */ jsx14(ButtonGroupText2, { children: label }),
5447
+ /* @__PURE__ */ jsxs12(Popover2, { defaultOpen: autoOpen, children: [
5448
+ /* @__PURE__ */ jsx14(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx14(Button7, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx14("span", { className: startDate ? "" : "text-muted-foreground", children: displayLabel }) }) }),
5449
+ /* @__PURE__ */ jsx14(PopoverContent2, { align: "start", className: "w-fit", children: /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2", children: [
5450
+ /* @__PURE__ */ jsx14(
5358
5451
  Calendar2,
5359
5452
  {
5360
5453
  mode: "range",
@@ -5362,9 +5455,9 @@ function DateFilterChip({
5362
5455
  onSelect: pickRange
5363
5456
  }
5364
5457
  ),
5365
- showTimeInputs && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2", children: [
5366
- /* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center gap-2", children: [
5367
- /* @__PURE__ */ jsx13(
5458
+ showTimeInputs && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2", children: [
5459
+ /* @__PURE__ */ jsxs12("div", { className: "flex w-full items-center gap-2", children: [
5460
+ /* @__PURE__ */ jsx14(
5368
5461
  Label3,
5369
5462
  {
5370
5463
  htmlFor: `${definition.key}-start-time`,
@@ -5372,7 +5465,7 @@ function DateFilterChip({
5372
5465
  children: "Start"
5373
5466
  }
5374
5467
  ),
5375
- /* @__PURE__ */ jsx13(
5468
+ /* @__PURE__ */ jsx14(
5376
5469
  Input2,
5377
5470
  {
5378
5471
  id: `${definition.key}-start-time`,
@@ -5384,8 +5477,8 @@ function DateFilterChip({
5384
5477
  }
5385
5478
  )
5386
5479
  ] }),
5387
- /* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center gap-2", children: [
5388
- /* @__PURE__ */ jsx13(
5480
+ /* @__PURE__ */ jsxs12("div", { className: "flex w-full items-center gap-2", children: [
5481
+ /* @__PURE__ */ jsx14(
5389
5482
  Label3,
5390
5483
  {
5391
5484
  htmlFor: `${definition.key}-end-time`,
@@ -5393,7 +5486,7 @@ function DateFilterChip({
5393
5486
  children: "End"
5394
5487
  }
5395
5488
  ),
5396
- /* @__PURE__ */ jsx13(
5489
+ /* @__PURE__ */ jsx14(
5397
5490
  Input2,
5398
5491
  {
5399
5492
  id: `${definition.key}-end-time`,
@@ -5408,7 +5501,7 @@ function DateFilterChip({
5408
5501
  ] })
5409
5502
  ] }) })
5410
5503
  ] }),
5411
- /* @__PURE__ */ jsx13(FilterChipRemoveButton, { label, onRemove })
5504
+ /* @__PURE__ */ jsx14(FilterChipRemoveButton, { label, onRemove })
5412
5505
  ] });
5413
5506
  }
5414
5507
 
@@ -5419,7 +5512,7 @@ var isCheckboxColumnFilter = (definition) => definition.type === "checkbox";
5419
5512
  var isMultiTextColumnFilter = (definition) => definition.type === "multiText";
5420
5513
 
5421
5514
  // src/data-table/view-filter.tsx
5422
- import { jsx as jsx14 } from "react/jsx-runtime";
5515
+ import { jsx as jsx15 } from "react/jsx-runtime";
5423
5516
  function toFilterOption(opt) {
5424
5517
  return typeof opt === "string" ? { value: opt, label: opt } : { value: opt.value, label: opt.label };
5425
5518
  }
@@ -5462,7 +5555,7 @@ function ViewFilter({
5462
5555
  onColumnFiltersChange,
5463
5556
  className
5464
5557
  }) {
5465
- const filterableColumns = React9.useMemo(
5558
+ const filterableColumns = React10.useMemo(
5466
5559
  () => columns.filter((column) => !isFilterOnlyColumn(column) && column.getCanFilter()).flatMap((column) => {
5467
5560
  var _a;
5468
5561
  const filter = (_a = column.columnDef.meta) == null ? void 0 : _a.filter;
@@ -5470,19 +5563,19 @@ function ViewFilter({
5470
5563
  }),
5471
5564
  [columns]
5472
5565
  );
5473
- const filterDefinitions = React9.useMemo(
5566
+ const filterDefinitions = React10.useMemo(
5474
5567
  () => filterableColumns.map(({ key, filter }) => toFilterBarDefinition(key, filter)).sort((a, b) => a.order - b.order),
5475
5568
  [filterableColumns]
5476
5569
  );
5477
- const emptyValueByKey = React9.useMemo(
5570
+ const emptyValueByKey = React10.useMemo(
5478
5571
  () => new Map(filterableColumns.map(({ key, filter }) => [key, emptyValueFor(filter)])),
5479
5572
  [filterableColumns]
5480
5573
  );
5481
- const activeFilters = React9.useMemo(
5574
+ const activeFilters = React10.useMemo(
5482
5575
  () => columnFilters.map((filter) => ({ key: filter.id, value: filter.value })),
5483
5576
  [columnFilters]
5484
5577
  );
5485
- return /* @__PURE__ */ jsx14(
5578
+ return /* @__PURE__ */ jsx15(
5486
5579
  FilterBar,
5487
5580
  {
5488
5581
  className,
@@ -5496,10 +5589,10 @@ function ViewFilter({
5496
5589
  }
5497
5590
 
5498
5591
  // src/section-header.tsx
5499
- import { jsx as jsx15 } from "react/jsx-runtime";
5592
+ import { jsx as jsx16 } from "react/jsx-runtime";
5500
5593
  function SectionHeader(_a) {
5501
5594
  var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
5502
- return /* @__PURE__ */ jsx15(
5595
+ return /* @__PURE__ */ jsx16(
5503
5596
  "div",
5504
5597
  __spreadProps(__spreadValues({
5505
5598
  "data-slot": "section-header",
@@ -5511,19 +5604,19 @@ function SectionHeader(_a) {
5511
5604
  }
5512
5605
  function SectionHeaderContent(_a) {
5513
5606
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5514
- return /* @__PURE__ */ jsx15("div", __spreadValues({ "data-slot": "section-header-content", className: cn("flex flex-col gap-1", className) }, props));
5607
+ return /* @__PURE__ */ jsx16("div", __spreadValues({ "data-slot": "section-header-content", className: cn("flex flex-col gap-1", className) }, props));
5515
5608
  }
5516
5609
  function SectionHeaderTitle(_a) {
5517
5610
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5518
- return /* @__PURE__ */ jsx15("h2", __spreadValues({ "data-slot": "section-header-title", className: cn("text-h3 text-foreground", className) }, props));
5611
+ return /* @__PURE__ */ jsx16("h2", __spreadValues({ "data-slot": "section-header-title", className: cn("text-h3 text-foreground", className) }, props));
5519
5612
  }
5520
5613
  function SectionHeaderDescription(_a) {
5521
5614
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5522
- return /* @__PURE__ */ jsx15("p", __spreadValues({ "data-slot": "section-header-description", className: cn("text-body text-muted-foreground", className) }, props));
5615
+ return /* @__PURE__ */ jsx16("p", __spreadValues({ "data-slot": "section-header-description", className: cn("text-body text-muted-foreground", className) }, props));
5523
5616
  }
5524
5617
  function SectionHeaderMeta(_a) {
5525
5618
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5526
- return /* @__PURE__ */ jsx15(
5619
+ return /* @__PURE__ */ jsx16(
5527
5620
  "div",
5528
5621
  __spreadValues({
5529
5622
  "data-slot": "section-header-meta",
@@ -5537,15 +5630,15 @@ function SectionHeaderMeta(_a) {
5537
5630
  }
5538
5631
  function SectionHeaderActions(_a) {
5539
5632
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5540
- return /* @__PURE__ */ jsx15("div", __spreadValues({ "data-slot": "section-header-actions", className: cn("flex items-center gap-2", className) }, props));
5633
+ return /* @__PURE__ */ jsx16("div", __spreadValues({ "data-slot": "section-header-actions", className: cn("flex items-center gap-2", className) }, props));
5541
5634
  }
5542
5635
  function SectionHeaderTabs(_a) {
5543
5636
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5544
- return /* @__PURE__ */ jsx15("div", __spreadValues({ "data-slot": "section-header-tabs", className: cn("border-b", className) }, props));
5637
+ return /* @__PURE__ */ jsx16("div", __spreadValues({ "data-slot": "section-header-tabs", className: cn("border-b", className) }, props));
5545
5638
  }
5546
5639
 
5547
5640
  // src/data-table/data-table.tsx
5548
- import { Fragment as Fragment9, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
5641
+ import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
5549
5642
  var DEFAULT_PAGE_SIZE = 20;
5550
5643
  function DataTable({
5551
5644
  id,
@@ -5596,23 +5689,24 @@ function DataTable({
5596
5689
  initialColumnSizing,
5597
5690
  onColumnSizingPersist,
5598
5691
  stickyHeader = false,
5599
- celFilterConfig
5692
+ celFilterConfig,
5693
+ filterVisibility
5600
5694
  }) {
5601
5695
  var _a, _b, _c, _d, _e, _f;
5602
5696
  const isGrid = layout === "grid";
5603
- const tableBodyScrollRef = React10.useRef(null);
5604
- const [innerGlobalFilter, setInnerGlobalFilter] = React10.useState("");
5605
- const [innerColumnOrdering, setInnerColumnOrdering] = React10.useState([]);
5606
- const [innerColumnFilters, setInnerColumnFilters] = React10.useState([]);
5607
- const [innerSorting, setInnerSorting] = React10.useState(((_a = config.state) == null ? void 0 : _a.sorting) || []);
5608
- const [innerColumnPinning, setInnerColumnPinning] = React10.useState({ left: [], right: [] });
5609
- const [innerPagination, setInnerPagination] = React10.useState({
5697
+ const tableBodyScrollRef = React11.useRef(null);
5698
+ const [innerGlobalFilter, setInnerGlobalFilter] = React11.useState("");
5699
+ const [innerColumnOrdering, setInnerColumnOrdering] = React11.useState([]);
5700
+ const [innerColumnFilters, setInnerColumnFilters] = React11.useState([]);
5701
+ const [innerSorting, setInnerSorting] = React11.useState(((_a = config.state) == null ? void 0 : _a.sorting) || []);
5702
+ const [innerColumnPinning, setInnerColumnPinning] = React11.useState({ left: [], right: [] });
5703
+ const [innerPagination, setInnerPagination] = React11.useState({
5610
5704
  pageIndex: ((_c = (_b = config.state) == null ? void 0 : _b.pagination) == null ? void 0 : _c.pageIndex) || 0,
5611
5705
  pageSize: ((_e = (_d = config.state) == null ? void 0 : _d.pagination) == null ? void 0 : _e.pageSize) || DEFAULT_PAGE_SIZE
5612
5706
  });
5613
- const [innerGrouping, setInnerGrouping] = React10.useState([]);
5614
- const [innerColumnVisibility, setInnerColumnVisibility] = React10.useState({});
5615
- const [innerExpanded, setInnerExpanded] = React10.useState({});
5707
+ const [innerGrouping, setInnerGrouping] = React11.useState([]);
5708
+ const [innerColumnVisibility, setInnerColumnVisibility] = React11.useState({});
5709
+ const [innerExpanded, setInnerExpanded] = React11.useState({});
5616
5710
  const {
5617
5711
  columnSizing,
5618
5712
  handleColumnSizingChange,
@@ -5624,6 +5718,11 @@ function DataTable({
5624
5718
  onColumnSizingPersist,
5625
5719
  maxSize: isGrid ? RESIZE_MAX_UNBOUNDED : void 0
5626
5720
  });
5721
+ const {
5722
+ showFilterToggle: filterToggleRequested,
5723
+ filterRowVisible,
5724
+ setFilterRowVisible
5725
+ } = useFilterVisibility(filterVisibility);
5627
5726
  const globalFilter = parentGlobalFilter != null ? parentGlobalFilter : innerGlobalFilter;
5628
5727
  const applyGlobalFilter = parentSetGlobalFilter != null ? parentSetGlobalFilter : setInnerGlobalFilter;
5629
5728
  const columnFilters = parentColumnFilters || innerColumnFilters;
@@ -5631,25 +5730,25 @@ function DataTable({
5631
5730
  const pagination = parentPagination || innerPagination;
5632
5731
  const setPagination = parentSetPagination != null ? parentSetPagination : setInnerPagination;
5633
5732
  const shouldDisablePagination = paginationConfig === false;
5634
- const resetPageIndexOnFilterChange = React10.useCallback(() => {
5733
+ const resetPageIndexOnFilterChange = React11.useCallback(() => {
5635
5734
  if (!serverSidePagination || pagination.pageIndex === 0) return;
5636
5735
  setPagination((prev) => __spreadProps(__spreadValues({}, prev), { pageIndex: 0 }));
5637
5736
  }, [serverSidePagination, pagination.pageIndex, setPagination]);
5638
- const setGlobalFilter = React10.useCallback(
5737
+ const setGlobalFilter = React11.useCallback(
5639
5738
  (value) => {
5640
5739
  applyGlobalFilter(value);
5641
5740
  resetPageIndexOnFilterChange();
5642
5741
  },
5643
5742
  [applyGlobalFilter, resetPageIndexOnFilterChange]
5644
5743
  );
5645
- const setColumnFilters = React10.useCallback(
5744
+ const setColumnFilters = React11.useCallback(
5646
5745
  (value) => {
5647
5746
  applyColumnFilters(value);
5648
5747
  resetPageIndexOnFilterChange();
5649
5748
  },
5650
5749
  [applyColumnFilters, resetPageIndexOnFilterChange]
5651
5750
  );
5652
- React10.useLayoutEffect(() => {
5751
+ React11.useLayoutEffect(() => {
5653
5752
  var _a2;
5654
5753
  if (shouldDisablePagination) return;
5655
5754
  (_a2 = tableBodyScrollRef.current) == null ? void 0 : _a2.scrollTo({ top: 0 });
@@ -5731,7 +5830,9 @@ function DataTable({
5731
5830
  const flatColumns = table.getAllFlatColumns();
5732
5831
  const displayableColumns = flatColumns.filter((col) => !isFilterOnlyColumn(col));
5733
5832
  const orderedVisibleColumns = table.getVisibleLeafColumns().filter((col) => !isFilterOnlyColumn(col));
5734
- const [gridMeasuredMins, setGridMeasuredMins] = React10.useState({});
5833
+ const hasFilters = !!celFilterConfig || hasFilterableColumns(flatColumns);
5834
+ const showFilterToggle = filterToggleRequested && !disableFilters && hasFilters;
5835
+ const [gridMeasuredMins, setGridMeasuredMins] = React11.useState({});
5735
5836
  const { gridTemplateColumns, gridRootRef, handleAutosizeAll, handleAutosizeColumn, handleResetColumnSize } = useGridLayout({
5736
5837
  layout,
5737
5838
  table,
@@ -5745,7 +5846,7 @@ function DataTable({
5745
5846
  rawHandleAutosizeColumn,
5746
5847
  rawHandleResetColumnSize
5747
5848
  });
5748
- const handleContextCell = React10.useCallback(
5849
+ const handleContextCell = React11.useCallback(
5749
5850
  (filter, cell) => {
5750
5851
  var _a2, _b2;
5751
5852
  if (celFilterConfig == null ? void 0 : celFilterConfig.onContextualFilter) {
@@ -5762,13 +5863,13 @@ function DataTable({
5762
5863
  },
5763
5864
  [celFilterConfig, onContextCell, setColumnFilters, table]
5764
5865
  );
5765
- const handleContextSearch = React10.useCallback(
5866
+ const handleContextSearch = React11.useCallback(
5766
5867
  (searchTerm) => {
5767
5868
  setGlobalFilter(searchTerm);
5768
5869
  },
5769
5870
  [setGlobalFilter]
5770
5871
  );
5771
- const totalTableWidth = React10.useMemo(() => {
5872
+ const totalTableWidth = React11.useMemo(() => {
5772
5873
  if (isGrid) return 0;
5773
5874
  const firstGroup = headerGroups[0];
5774
5875
  if (!firstGroup) return 0;
@@ -5792,12 +5893,12 @@ function DataTable({
5792
5893
  }
5793
5894
  setGlobalFilter("");
5794
5895
  };
5795
- React10.useEffect(() => {
5896
+ React11.useEffect(() => {
5796
5897
  if (parentGlobalFilter !== void 0) {
5797
5898
  setInnerGlobalFilter(parentGlobalFilter);
5798
5899
  }
5799
5900
  }, [parentGlobalFilter]);
5800
- React10.useEffect(() => {
5901
+ React11.useEffect(() => {
5801
5902
  if (disableColumnReordering) return;
5802
5903
  const allColumnIds = flatColumns.map((col) => col.id);
5803
5904
  const normalizedColumnOrdering = normalizeColumnOrdering(columnOrdering, allColumnIds);
@@ -5807,9 +5908,9 @@ function DataTable({
5807
5908
  }, [columnOrdering, disableColumnReordering, flatColumns, setColumnOrdering]);
5808
5909
  const showViewHeader = !!title || !!Actions;
5809
5910
  const showColumnOptions = !disableColumnReordering || !disableColumnVisibility;
5810
- const toolbarSearch = !disableSearch && /* @__PURE__ */ jsxs12(InputGroup3, { className: "w-70", children: [
5811
- /* @__PURE__ */ jsx16(InputGroupAddon3, { align: "inline-start", children: /* @__PURE__ */ jsx16(Icon10, { name: "magnifying-glass" }) }),
5812
- /* @__PURE__ */ jsx16(
5911
+ const toolbarSearch = !disableSearch && /* @__PURE__ */ jsxs13(InputGroup3, { className: "w-70", children: [
5912
+ /* @__PURE__ */ jsx17(InputGroupAddon3, { align: "inline-start", children: /* @__PURE__ */ jsx17(Icon11, { name: "magnifying-glass" }) }),
5913
+ /* @__PURE__ */ jsx17(
5813
5914
  InputGroupInput2,
5814
5915
  {
5815
5916
  "aria-label": "Search",
@@ -5820,7 +5921,7 @@ function DataTable({
5820
5921
  }
5821
5922
  )
5822
5923
  ] });
5823
- const toolbarColumns = !!showColumnOptions && /* @__PURE__ */ jsx16(
5924
+ const toolbarColumns = !!showColumnOptions && /* @__PURE__ */ jsx17(
5824
5925
  ColumnOptions,
5825
5926
  {
5826
5927
  columns: flatColumns,
@@ -5829,7 +5930,7 @@ function DataTable({
5829
5930
  disableColumnOrdering: disableColumnReordering
5830
5931
  }
5831
5932
  );
5832
- return /* @__PURE__ */ jsxs12(
5933
+ return /* @__PURE__ */ jsxs13(
5833
5934
  "div",
5834
5935
  {
5835
5936
  id: `table-${id}`,
@@ -5840,18 +5941,19 @@ function DataTable({
5840
5941
  className
5841
5942
  ),
5842
5943
  children: [
5843
- showViewHeader && /* @__PURE__ */ jsx16(SectionHeader, { className: "mb-4 flex w-full gap-2", children: /* @__PURE__ */ jsxs12(SectionHeaderContent, { children: [
5844
- !!title && /* @__PURE__ */ jsx16(SectionHeaderTitle, { children: title }),
5845
- !!description && /* @__PURE__ */ jsx16(SectionHeaderDescription, { children: description })
5944
+ showViewHeader && /* @__PURE__ */ jsx17(SectionHeader, { className: "mb-4 flex w-full gap-2", children: /* @__PURE__ */ jsxs13(SectionHeaderContent, { children: [
5945
+ !!title && /* @__PURE__ */ jsx17(SectionHeaderTitle, { children: title }),
5946
+ !!description && /* @__PURE__ */ jsx17(SectionHeaderDescription, { children: description })
5846
5947
  ] }) }),
5847
- /* @__PURE__ */ jsxs12("div", { className: "mb-4 flex flex-row gap-2", children: [
5948
+ /* @__PURE__ */ jsxs13("div", { className: "mb-4 flex flex-row gap-2", children: [
5848
5949
  toolbarSearch,
5849
- /* @__PURE__ */ jsxs12("div", { className: "ml-auto flex items-center gap-2", children: [
5850
- !!Actions && /* @__PURE__ */ jsx16(Actions, { state: tableState }),
5950
+ /* @__PURE__ */ jsxs13("div", { className: "ml-auto flex items-center gap-2", children: [
5951
+ showFilterToggle && /* @__PURE__ */ jsx17(FilterToggle, { pressed: filterRowVisible, onPressedChange: setFilterRowVisible, count: filterCount }),
5952
+ !!Actions && /* @__PURE__ */ jsx17(Actions, { state: tableState }),
5851
5953
  toolbarColumns
5852
5954
  ] })
5853
5955
  ] }),
5854
- !disableFilters && /* @__PURE__ */ jsx16("div", { className: "flex w-full", children: celFilterConfig ? /* @__PURE__ */ jsx16("div", { className: cn("mr-2 mb-4 min-w-0 flex-1", celFilterClassName), children: /* @__PURE__ */ jsx16(
5956
+ !disableFilters && (!showFilterToggle || filterRowVisible) && /* @__PURE__ */ jsx17("div", { className: "flex w-full", children: celFilterConfig ? /* @__PURE__ */ jsx17("div", { className: cn("mr-2 mb-4 min-w-0 flex-1", celFilterClassName), children: /* @__PURE__ */ jsx17(
5855
5957
  CelFilterBar,
5856
5958
  {
5857
5959
  schema: celFilterConfig.schema,
@@ -5861,7 +5963,7 @@ function DataTable({
5861
5963
  onRestrictedOptionSelect: celFilterConfig.onRestrictedOptionSelect,
5862
5964
  showClearButton: celFilterConfig.showClearButton
5863
5965
  }
5864
- ) }) : /* @__PURE__ */ jsx16(
5966
+ ) }) : /* @__PURE__ */ jsx17(
5865
5967
  ViewFilter,
5866
5968
  {
5867
5969
  columns: flatColumns,
@@ -5870,8 +5972,8 @@ function DataTable({
5870
5972
  className: "data-[visible-filters=true]:mb-4"
5871
5973
  }
5872
5974
  ) }),
5873
- shouldRenderTableContent ? /* @__PURE__ */ jsxs12(Fragment9, { children: [
5874
- /* @__PURE__ */ jsx16("div", { className: "flex min-h-0 flex-1 flex-col", "data-testid": "table-main", children: /* @__PURE__ */ jsx16(
5975
+ shouldRenderTableContent ? /* @__PURE__ */ jsxs13(Fragment9, { children: [
5976
+ /* @__PURE__ */ jsx17("div", { className: "flex min-h-0 flex-1 flex-col", "data-testid": "table-main", children: /* @__PURE__ */ jsx17(
5875
5977
  "div",
5876
5978
  {
5877
5979
  ref: tableBodyScrollRef,
@@ -5879,7 +5981,7 @@ function DataTable({
5879
5981
  "min-h-0 flex-1 overflow-auto rounded-lg border **:data-[slot=table-container]:overflow-visible",
5880
5982
  !!stickyHeader && "max-h-[calc(100svh-250px)]"
5881
5983
  ),
5882
- children: /* @__PURE__ */ jsxs12(
5984
+ children: /* @__PURE__ */ jsxs13(
5883
5985
  DataTableRoot,
5884
5986
  {
5885
5987
  layout,
@@ -5887,7 +5989,7 @@ function DataTable({
5887
5989
  gridRootRef,
5888
5990
  style: isGrid ? { width: "100%" } : totalTableWidth > 0 ? { width: `max(100%, ${totalTableWidth}px)`, minWidth: "100%" } : { width: "100%" },
5889
5991
  children: [
5890
- /* @__PURE__ */ jsx16(
5992
+ /* @__PURE__ */ jsx17(
5891
5993
  DataTableHeader,
5892
5994
  {
5893
5995
  headerGroups,
@@ -5898,7 +6000,7 @@ function DataTable({
5898
6000
  layout
5899
6001
  }
5900
6002
  ),
5901
- /* @__PURE__ */ jsx16(
6003
+ /* @__PURE__ */ jsx17(
5902
6004
  DataTableBody,
5903
6005
  {
5904
6006
  tableRows,
@@ -5920,7 +6022,7 @@ function DataTable({
5920
6022
  )
5921
6023
  }
5922
6024
  ) }),
5923
- !shouldDisablePagination && !!pagination && /* @__PURE__ */ jsx16(
6025
+ !shouldDisablePagination && !!pagination && /* @__PURE__ */ jsx17(
5924
6026
  DataTablePagination,
5925
6027
  {
5926
6028
  rowCount,
@@ -5932,7 +6034,7 @@ function DataTable({
5932
6034
  onPageSizeChange: (nextPageSize) => setPagination((prev) => __spreadProps(__spreadValues({}, prev || pagination), { pageIndex: 0, pageSize: nextPageSize }))
5933
6035
  }
5934
6036
  )
5935
- ] }) : /* @__PURE__ */ jsx16(
6037
+ ] }) : /* @__PURE__ */ jsx17(
5936
6038
  DataTableEmptyView,
5937
6039
  {
5938
6040
  emptyView,
@@ -5947,19 +6049,19 @@ function DataTable({
5947
6049
  }
5948
6050
 
5949
6051
  // src/floating-widget.tsx
5950
- import * as React11 from "react";
6052
+ import * as React12 from "react";
5951
6053
  import { Button as Button8 } from "@upbound/monarch-core";
5952
6054
  import { DropdownMenu as DropdownMenu6, DropdownMenuContent as DropdownMenuContent6, DropdownMenuTrigger as DropdownMenuTrigger6 } from "@upbound/monarch-core";
5953
- import { Icon as Icon11 } from "@upbound/monarch-core";
6055
+ import { Icon as Icon12 } from "@upbound/monarch-core";
5954
6056
  import { Kbd as Kbd2 } from "@upbound/monarch-core";
5955
6057
  import { Tooltip as Tooltip7, TooltipContent as TooltipContent6, TooltipTrigger as TooltipTrigger6 } from "@upbound/monarch-core";
5956
- import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
5957
- var FloatingWidgetContext = React11.createContext(null);
6058
+ import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
6059
+ var FloatingWidgetContext = React12.createContext(null);
5958
6060
  function FloatingWidgetProvider({ children }) {
5959
- const [isOpen, setIsOpen] = React11.useState(false);
5960
- const [isCollapsed, setIsCollapsed] = React11.useState(false);
5961
- const [isExpanded, setIsExpanded] = React11.useState(false);
5962
- const value = React11.useMemo(
6061
+ const [isOpen, setIsOpen] = React12.useState(false);
6062
+ const [isCollapsed, setIsCollapsed] = React12.useState(false);
6063
+ const [isExpanded, setIsExpanded] = React12.useState(false);
6064
+ const value = React12.useMemo(
5963
6065
  () => ({
5964
6066
  isOpen,
5965
6067
  isCollapsed,
@@ -5991,10 +6093,10 @@ function FloatingWidgetProvider({ children }) {
5991
6093
  }),
5992
6094
  [isOpen, isCollapsed, isExpanded]
5993
6095
  );
5994
- return /* @__PURE__ */ jsx17(FloatingWidgetContext.Provider, { value, children });
6096
+ return /* @__PURE__ */ jsx18(FloatingWidgetContext.Provider, { value, children });
5995
6097
  }
5996
6098
  function useFloatingWidget() {
5997
- const ctx = React11.useContext(FloatingWidgetContext);
6099
+ const ctx = React12.useContext(FloatingWidgetContext);
5998
6100
  if (!ctx) {
5999
6101
  throw new Error("useFloatingWidget must be used inside <FloatingWidgetProvider>.");
6000
6102
  }
@@ -6002,14 +6104,14 @@ function useFloatingWidget() {
6002
6104
  }
6003
6105
  function FloatingWidget({ title = "Ask AI", subtitle, menuItems, children, className }) {
6004
6106
  const { isOpen, isCollapsed, isExpanded, close, collapse, restore, toggleExpand } = useFloatingWidget();
6005
- const [dragWidth, setDragWidth] = React11.useState(null);
6006
- const [isDragging, setIsDragging] = React11.useState(false);
6007
- React11.useEffect(() => {
6107
+ const [dragWidth, setDragWidth] = React12.useState(null);
6108
+ const [isDragging, setIsDragging] = React12.useState(false);
6109
+ React12.useEffect(() => {
6008
6110
  setDragWidth(null);
6009
6111
  }, [isExpanded]);
6010
6112
  const MIN_WIDTH = 420;
6011
- const widgetRef = React11.useRef(null);
6012
- const handleResizeMouseDown = React11.useCallback((e) => {
6113
+ const widgetRef = React12.useRef(null);
6114
+ const handleResizeMouseDown = React12.useCallback((e) => {
6013
6115
  var _a, _b;
6014
6116
  e.preventDefault();
6015
6117
  setIsDragging(true);
@@ -6029,7 +6131,7 @@ function FloatingWidget({ title = "Ask AI", subtitle, menuItems, children, class
6029
6131
  window.addEventListener("mousemove", onMove);
6030
6132
  window.addEventListener("mouseup", onUp);
6031
6133
  }, []);
6032
- React11.useEffect(() => {
6134
+ React12.useEffect(() => {
6033
6135
  if (!isOpen) return;
6034
6136
  function handleKeydown(e) {
6035
6137
  if (e.key === "Escape") {
@@ -6041,7 +6143,7 @@ function FloatingWidget({ title = "Ask AI", subtitle, menuItems, children, class
6041
6143
  }, [isOpen, close]);
6042
6144
  if (!isOpen) return null;
6043
6145
  const dragStyle = dragWidth != null && !isCollapsed ? { width: `${dragWidth}px`, minWidth: `${MIN_WIDTH}px` } : void 0;
6044
- return /* @__PURE__ */ jsxs13(
6146
+ return /* @__PURE__ */ jsxs14(
6045
6147
  "div",
6046
6148
  {
6047
6149
  ref: widgetRef,
@@ -6065,8 +6167,8 @@ function FloatingWidget({ title = "Ask AI", subtitle, menuItems, children, class
6065
6167
  className
6066
6168
  ),
6067
6169
  children: [
6068
- !isCollapsed && /* @__PURE__ */ jsxs13(Tooltip7, { children: [
6069
- /* @__PURE__ */ jsx17(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx17(
6170
+ !isCollapsed && /* @__PURE__ */ jsxs14(Tooltip7, { children: [
6171
+ /* @__PURE__ */ jsx18(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx18(
6070
6172
  "div",
6071
6173
  {
6072
6174
  role: "separator",
@@ -6074,79 +6176,79 @@ function FloatingWidget({ title = "Ask AI", subtitle, menuItems, children, class
6074
6176
  "aria-label": "Resize widget",
6075
6177
  onMouseDown: handleResizeMouseDown,
6076
6178
  className: "group absolute inset-y-0 left-0 z-20 hidden w-3 cursor-col-resize touch-none items-center justify-center bg-transparent select-none sm:flex",
6077
- children: /* @__PURE__ */ jsx17("div", { className: "bg-border h-12 w-1 shrink-0 rounded-lg opacity-0 transition-opacity duration-150 group-hover:opacity-100" })
6179
+ children: /* @__PURE__ */ jsx18("div", { className: "bg-border h-12 w-1 shrink-0 rounded-lg opacity-0 transition-opacity duration-150 group-hover:opacity-100" })
6078
6180
  }
6079
6181
  ) }),
6080
- /* @__PURE__ */ jsx17(TooltipContent6, { side: "left", children: "Resize" })
6182
+ /* @__PURE__ */ jsx18(TooltipContent6, { side: "left", children: "Resize" })
6081
6183
  ] }),
6082
- /* @__PURE__ */ jsxs13("header", { className: "flex min-h-12 shrink-0 items-center gap-1 border-b px-3 py-2", children: [
6083
- /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 flex-1 flex-col justify-center", children: [
6084
- /* @__PURE__ */ jsx17("span", { className: "text-body truncate font-medium", children: title }),
6085
- subtitle && /* @__PURE__ */ jsx17("span", { className: "text-body-sm text-muted-foreground truncate", children: subtitle })
6184
+ /* @__PURE__ */ jsxs14("header", { className: "flex min-h-12 shrink-0 items-center gap-1 border-b px-3 py-2", children: [
6185
+ /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 flex-1 flex-col justify-center", children: [
6186
+ /* @__PURE__ */ jsx18("span", { className: "text-body truncate font-medium", children: title }),
6187
+ subtitle && /* @__PURE__ */ jsx18("span", { className: "text-body-sm text-muted-foreground truncate", children: subtitle })
6086
6188
  ] }),
6087
- menuItems && !isCollapsed && /* @__PURE__ */ jsxs13(Tooltip7, { children: [
6088
- /* @__PURE__ */ jsxs13(DropdownMenu6, { children: [
6089
- /* @__PURE__ */ jsx17(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx17(DropdownMenuTrigger6, { asChild: true, children: /* @__PURE__ */ jsx17(Button8, { variant: "ghost", size: "icon-sm", "aria-label": "More options", children: /* @__PURE__ */ jsx17(Icon11, { name: "ellipsis-vertical" }) }) }) }),
6090
- /* @__PURE__ */ jsx17(DropdownMenuContent6, { align: "end", children: menuItems })
6189
+ menuItems && !isCollapsed && /* @__PURE__ */ jsxs14(Tooltip7, { children: [
6190
+ /* @__PURE__ */ jsxs14(DropdownMenu6, { children: [
6191
+ /* @__PURE__ */ jsx18(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx18(DropdownMenuTrigger6, { asChild: true, children: /* @__PURE__ */ jsx18(Button8, { variant: "ghost", size: "icon-sm", "aria-label": "More options", children: /* @__PURE__ */ jsx18(Icon12, { name: "ellipsis-vertical" }) }) }) }),
6192
+ /* @__PURE__ */ jsx18(DropdownMenuContent6, { align: "end", children: menuItems })
6091
6193
  ] }),
6092
- /* @__PURE__ */ jsx17(TooltipContent6, { children: "More options" })
6194
+ /* @__PURE__ */ jsx18(TooltipContent6, { children: "More options" })
6093
6195
  ] }),
6094
- !isCollapsed && /* @__PURE__ */ jsxs13(Tooltip7, { children: [
6095
- /* @__PURE__ */ jsx17(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx17(
6196
+ !isCollapsed && /* @__PURE__ */ jsxs14(Tooltip7, { children: [
6197
+ /* @__PURE__ */ jsx18(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx18(
6096
6198
  Button8,
6097
6199
  {
6098
6200
  variant: "ghost",
6099
6201
  size: "icon-sm",
6100
6202
  onClick: toggleExpand,
6101
6203
  "aria-label": isExpanded ? "Shrink widget" : "Expand widget",
6102
- children: /* @__PURE__ */ jsx17(Icon11, { name: isExpanded ? "shrink" : "arrow-up-right-and-arrow-down-left-from-center" })
6204
+ children: /* @__PURE__ */ jsx18(Icon12, { name: isExpanded ? "shrink" : "arrow-up-right-and-arrow-down-left-from-center" })
6103
6205
  }
6104
6206
  ) }),
6105
- /* @__PURE__ */ jsx17(TooltipContent6, { children: isExpanded ? "Shrink widget" : "Expand widget" })
6207
+ /* @__PURE__ */ jsx18(TooltipContent6, { children: isExpanded ? "Shrink widget" : "Expand widget" })
6106
6208
  ] }),
6107
- /* @__PURE__ */ jsxs13(Tooltip7, { children: [
6108
- /* @__PURE__ */ jsx17(TooltipTrigger6, { asChild: true, children: isCollapsed ? /* @__PURE__ */ jsx17(Button8, { variant: "ghost", size: "icon-sm", onClick: restore, "aria-label": "Restore widget", children: /* @__PURE__ */ jsx17(Icon11, { name: "window-maximize" }) }) : /* @__PURE__ */ jsx17(Button8, { variant: "ghost", size: "icon-sm", onClick: collapse, "aria-label": "Minimize widget", children: /* @__PURE__ */ jsx17(Icon11, { name: "minus" }) }) }),
6109
- /* @__PURE__ */ jsx17(TooltipContent6, { children: isCollapsed ? "Restore widget" : "Minimize widget" })
6209
+ /* @__PURE__ */ jsxs14(Tooltip7, { children: [
6210
+ /* @__PURE__ */ jsx18(TooltipTrigger6, { asChild: true, children: isCollapsed ? /* @__PURE__ */ jsx18(Button8, { variant: "ghost", size: "icon-sm", onClick: restore, "aria-label": "Restore widget", children: /* @__PURE__ */ jsx18(Icon12, { name: "window-maximize" }) }) : /* @__PURE__ */ jsx18(Button8, { variant: "ghost", size: "icon-sm", onClick: collapse, "aria-label": "Minimize widget", children: /* @__PURE__ */ jsx18(Icon12, { name: "minus" }) }) }),
6211
+ /* @__PURE__ */ jsx18(TooltipContent6, { children: isCollapsed ? "Restore widget" : "Minimize widget" })
6110
6212
  ] }),
6111
- /* @__PURE__ */ jsxs13(Tooltip7, { children: [
6112
- /* @__PURE__ */ jsx17(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx17(Button8, { variant: "ghost", size: "icon-sm", onClick: close, "aria-label": "Close widget", children: /* @__PURE__ */ jsx17(Icon11, { name: "xmark" }) }) }),
6113
- /* @__PURE__ */ jsxs13(TooltipContent6, { children: [
6213
+ /* @__PURE__ */ jsxs14(Tooltip7, { children: [
6214
+ /* @__PURE__ */ jsx18(TooltipTrigger6, { asChild: true, children: /* @__PURE__ */ jsx18(Button8, { variant: "ghost", size: "icon-sm", onClick: close, "aria-label": "Close widget", children: /* @__PURE__ */ jsx18(Icon12, { name: "xmark" }) }) }),
6215
+ /* @__PURE__ */ jsxs14(TooltipContent6, { children: [
6114
6216
  "Close widget",
6115
- /* @__PURE__ */ jsx17(Kbd2, { children: "Esc" })
6217
+ /* @__PURE__ */ jsx18(Kbd2, { children: "Esc" })
6116
6218
  ] })
6117
6219
  ] })
6118
6220
  ] }),
6119
- !isCollapsed && /* @__PURE__ */ jsx17("div", { className: "flex min-h-0 flex-1 flex-col", children })
6221
+ !isCollapsed && /* @__PURE__ */ jsx18("div", { className: "flex min-h-0 flex-1 flex-col", children })
6120
6222
  ]
6121
6223
  }
6122
6224
  );
6123
6225
  }
6124
6226
 
6125
6227
  // src/page-header.tsx
6126
- import { jsx as jsx18 } from "react/jsx-runtime";
6228
+ import { jsx as jsx19 } from "react/jsx-runtime";
6127
6229
  function PageHeader(_a) {
6128
6230
  var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
6129
- return /* @__PURE__ */ jsx18("div", __spreadProps(__spreadValues({ "data-slot": "page-header", className: cn("flex w-full items-start justify-between gap-4", className) }, props), { children }));
6231
+ return /* @__PURE__ */ jsx19("div", __spreadProps(__spreadValues({ "data-slot": "page-header", className: cn("flex w-full items-start justify-between gap-4", className) }, props), { children }));
6130
6232
  }
6131
6233
  function PageHeaderAvatar(_a) {
6132
6234
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6133
- return /* @__PURE__ */ jsx18("div", __spreadValues({ "data-slot": "page-header-avatar", className: cn("shrink-0 self-center", className) }, props));
6235
+ return /* @__PURE__ */ jsx19("div", __spreadValues({ "data-slot": "page-header-avatar", className: cn("shrink-0 self-center", className) }, props));
6134
6236
  }
6135
6237
  function PageHeaderContent(_a) {
6136
6238
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6137
- return /* @__PURE__ */ jsx18("div", __spreadValues({ "data-slot": "page-header-content", className: cn("flex flex-1 flex-col gap-1", className) }, props));
6239
+ return /* @__PURE__ */ jsx19("div", __spreadValues({ "data-slot": "page-header-content", className: cn("flex flex-1 flex-col gap-1", className) }, props));
6138
6240
  }
6139
6241
  function PageHeaderTitle(_a) {
6140
6242
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6141
- return /* @__PURE__ */ jsx18("h1", __spreadValues({ "data-slot": "page-header-title", className: cn("text-h1 text-foreground", className) }, props));
6243
+ return /* @__PURE__ */ jsx19("h1", __spreadValues({ "data-slot": "page-header-title", className: cn("text-h1 text-foreground", className) }, props));
6142
6244
  }
6143
6245
  function PageHeaderDescription(_a) {
6144
6246
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6145
- return /* @__PURE__ */ jsx18("p", __spreadValues({ "data-slot": "page-header-description", className: cn("text-body text-muted-foreground", className) }, props));
6247
+ return /* @__PURE__ */ jsx19("p", __spreadValues({ "data-slot": "page-header-description", className: cn("text-body text-muted-foreground", className) }, props));
6146
6248
  }
6147
6249
  function PageHeaderMeta(_a) {
6148
6250
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6149
- return /* @__PURE__ */ jsx18(
6251
+ return /* @__PURE__ */ jsx19(
6150
6252
  "div",
6151
6253
  __spreadValues({
6152
6254
  "data-slot": "page-header-meta",
@@ -6160,27 +6262,27 @@ function PageHeaderMeta(_a) {
6160
6262
  }
6161
6263
  function PageHeaderActions(_a) {
6162
6264
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6163
- return /* @__PURE__ */ jsx18("div", __spreadValues({ "data-slot": "page-header-actions", className: cn("flex items-center gap-2", className) }, props));
6265
+ return /* @__PURE__ */ jsx19("div", __spreadValues({ "data-slot": "page-header-actions", className: cn("flex items-center gap-2", className) }, props));
6164
6266
  }
6165
6267
  function PageHeaderTabs(_a) {
6166
6268
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6167
- return /* @__PURE__ */ jsx18("div", __spreadValues({ "data-slot": "page-header-tabs", className: cn("border-b", className) }, props));
6269
+ return /* @__PURE__ */ jsx19("div", __spreadValues({ "data-slot": "page-header-tabs", className: cn("border-b", className) }, props));
6168
6270
  }
6169
6271
 
6170
6272
  // src/timeline.tsx
6171
- import { Icon as Icon12 } from "@upbound/monarch-core";
6273
+ import { Icon as Icon13 } from "@upbound/monarch-core";
6172
6274
  import { Item as Item2, ItemGroup as ItemGroup2 } from "@upbound/monarch-core";
6173
- import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
6275
+ import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
6174
6276
  function Timeline(_a) {
6175
6277
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6176
- return /* @__PURE__ */ jsx19(ItemGroup2, __spreadValues({ "data-slot": "timeline", className: cn(className) }, props));
6278
+ return /* @__PURE__ */ jsx20(ItemGroup2, __spreadValues({ "data-slot": "timeline", className: cn(className) }, props));
6177
6279
  }
6178
6280
  function TimelineItem(_a) {
6179
6281
  var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
6180
- return /* @__PURE__ */ jsxs14(Item2, __spreadProps(__spreadValues({ "data-slot": "timeline-item", className: cn("group/timeline-item gap-3 py-4", className) }, props), { children: [
6181
- /* @__PURE__ */ jsxs14("div", { className: "relative flex flex-col items-center self-stretch", children: [
6182
- /* @__PURE__ */ jsx19(Icon12, { name: "circle-dot", size: "sm", className: "text-primary shrink-0" }),
6183
- /* @__PURE__ */ jsx19(
6282
+ return /* @__PURE__ */ jsxs15(Item2, __spreadProps(__spreadValues({ "data-slot": "timeline-item", className: cn("group/timeline-item gap-3 py-4", className) }, props), { children: [
6283
+ /* @__PURE__ */ jsxs15("div", { className: "relative flex flex-col items-center self-stretch", children: [
6284
+ /* @__PURE__ */ jsx20(Icon13, { name: "circle-dot", size: "sm", className: "text-primary shrink-0" }),
6285
+ /* @__PURE__ */ jsx20(
6184
6286
  "span",
6185
6287
  {
6186
6288
  "aria-hidden": "true",