@bizapps/ui 1.13.0 → 1.14.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/main.js CHANGED
@@ -404,7 +404,7 @@ var buttonVariants = cva(
404
404
  primary: "cursor-pointer bg-primary text-primary-foreground hover:bg-primary/80 focus-visible:ring-primary/30",
405
405
  secondary: "cursor-pointer bg-secondary text-secondary-foreground hover:bg-[var(--color-orange-700)] focus-visible:ring-secondary/30",
406
406
  cancel: "cursor-pointer bg-destructive text-secondary-foreground hover:bg-[var(--color-red-600)] focus-visible:ring-destructive/30",
407
- outline: "border border-foreground/50 bg-transparent text-muted-foreground hover:bg-foreground/50 hover:text-white",
407
+ outline: "cursor-pointer border-[1.5px] border-muted-foreground/35 bg-transparent text-muted-foreground hover:border-primary/30 hover:bg-primary/10 hover:text-primary focus-visible:ring-primary/30",
408
408
  ghost: "cursor-pointer bg-transparent text-muted-foreground hover:bg-foreground/10 hover:text-primary focus-visible:ring-ring/30 border-none",
409
409
  cancelGhost: "cursor-pointer bg-destructive/10 text-red-600 hover:bg-destructive/15 hover:text-red-600 focus-visible:ring-ring/30"
410
410
  },
@@ -7243,6 +7243,21 @@ function Checkbox({
7243
7243
  }
7244
7244
  );
7245
7245
  }
7246
+
7247
+ // src/components/compounds/Pagination/table-pagination-labels.ts
7248
+ var DEFAULT_TABLE_PAGINATION_LABELS = {
7249
+ navigation: "Table pagination",
7250
+ range: (from, to, total) => `Showing ${from}\u2013${to} of ${total}`,
7251
+ previous: "Previous",
7252
+ next: "Next",
7253
+ goToPreviousPage: "Go to previous page",
7254
+ goToNextPage: "Go to next page",
7255
+ rowsPerPage: "Rows per page",
7256
+ selectedRows: (count) => `${count} row${count > 1 ? "s" : ""} selected`
7257
+ };
7258
+ function resolveTablePaginationLabels(labels) {
7259
+ return { ...DEFAULT_TABLE_PAGINATION_LABELS, ...labels };
7260
+ }
7246
7261
  function Pagination({ className, ...props }) {
7247
7262
  return /* @__PURE__ */ jsx(
7248
7263
  "nav",
@@ -7365,8 +7380,10 @@ function TablePaginationBase({
7365
7380
  totalRecords,
7366
7381
  rowsPerPageOptions = DEFAULT_ROWS_PER_PAGE,
7367
7382
  onPageChange,
7368
- onPerPageChange
7383
+ onPerPageChange,
7384
+ labels: labelsProp
7369
7385
  }) {
7386
+ const labels = resolveTablePaginationLabels(labelsProp);
7370
7387
  const rowsPerPageLabelId = useId();
7371
7388
  const pageItems = getPageItems(page, totalPages);
7372
7389
  const hasRecords = totalRecords !== void 0 && totalRecords > 0;
@@ -7384,30 +7401,23 @@ function TablePaginationBase({
7384
7401
  "nav",
7385
7402
  {
7386
7403
  role: "navigation",
7387
- "aria-label": "Table pagination",
7404
+ "aria-label": labels.navigation,
7388
7405
  "data-slot": "table-pagination",
7389
7406
  className: "flex flex-wrap items-center justify-between gap-4 py-2",
7390
7407
  children: [
7391
- totalRecords !== void 0 && totalRecords > 0 && /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
7392
- "Showing ",
7393
- from,
7394
- "\u2013",
7395
- to,
7396
- " of ",
7397
- totalRecords
7398
- ] }),
7408
+ totalRecords !== void 0 && totalRecords > 0 && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: labels.range(from, to, totalRecords) }),
7399
7409
  /* @__PURE__ */ jsxs("ul", { "data-slot": "pagination-content", className: "flex items-center gap-1", children: [
7400
7410
  /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
7401
7411
  Button,
7402
7412
  {
7403
7413
  variant: "ghost",
7404
7414
  size: "sm",
7405
- "aria-label": "Go to previous page",
7415
+ "aria-label": labels.goToPreviousPage,
7406
7416
  disabled: page <= 1,
7407
7417
  onClick: () => onPageChange(page - 1),
7408
7418
  children: [
7409
7419
  /* @__PURE__ */ jsx(ChevronLeftIcon, { "data-icon": "inline-start" }),
7410
- /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: "Previous" })
7420
+ /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: labels.previous })
7411
7421
  ]
7412
7422
  }
7413
7423
  ) }),
@@ -7428,18 +7438,18 @@ function TablePaginationBase({
7428
7438
  {
7429
7439
  variant: "ghost",
7430
7440
  size: "sm",
7431
- "aria-label": "Go to next page",
7441
+ "aria-label": labels.goToNextPage,
7432
7442
  disabled: page >= totalPages,
7433
7443
  onClick: () => onPageChange(page + 1),
7434
7444
  children: [
7435
- /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: "Next" }),
7445
+ /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: labels.next }),
7436
7446
  /* @__PURE__ */ jsx(ChevronRightIcon, { "data-icon": "inline-end" })
7437
7447
  ]
7438
7448
  }
7439
7449
  ) })
7440
7450
  ] }),
7441
7451
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7442
- /* @__PURE__ */ jsx("span", { id: rowsPerPageLabelId, className: "text-muted-foreground text-sm", children: "Rows per page" }),
7452
+ /* @__PURE__ */ jsx("span", { id: rowsPerPageLabelId, className: "text-muted-foreground text-sm", children: labels.rowsPerPage }),
7443
7453
  /* @__PURE__ */ jsxs(Select, { value: String(perPage), onValueChange: (v) => onPerPageChange(Number(v)), children: [
7444
7454
  /* @__PURE__ */ jsx(SelectTrigger, { "aria-labelledby": rowsPerPageLabelId, className: "w-20", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
7445
7455
  /* @__PURE__ */ jsx(SelectContent, { children: rowsPerPageOptions.map((opt) => /* @__PURE__ */ jsx(SelectItem, { value: String(opt), children: opt }, opt)) })
@@ -8857,15 +8867,20 @@ function DataTableRowActions({
8857
8867
  }) })
8858
8868
  ] });
8859
8869
  }
8860
- function DataTableFooter({ pagination, selectedCount, className }) {
8870
+ function DataTableFooter({ pagination, selectedCount, labels, className }) {
8871
+ const mergedLabels = useMemo(
8872
+ () => ({ ...pagination.labels, ...labels }),
8873
+ [pagination.labels, labels]
8874
+ );
8875
+ const { selectedRows } = resolveTablePaginationLabels(mergedLabels);
8861
8876
  return /* @__PURE__ */ jsxs(
8862
8877
  "div",
8863
8878
  {
8864
8879
  "data-slot": "data-table-footer",
8865
8880
  className: cn("flex items-center justify-between border-t px-4 py-2", className),
8866
8881
  children: [
8867
- selectedCount != null && selectedCount > 0 && /* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "text-muted-foreground text-xs", children: `${selectedCount} row${selectedCount > 1 ? "s" : ""} selected` }),
8868
- /* @__PURE__ */ jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsx(TablePagination, { ...pagination }) })
8882
+ selectedCount != null && selectedCount > 0 && /* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "text-muted-foreground text-xs", children: selectedRows(selectedCount) }),
8883
+ /* @__PURE__ */ jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsx(TablePagination, { ...pagination, labels: mergedLabels }) })
8869
8884
  ]
8870
8885
  }
8871
8886
  );
@@ -9963,7 +9978,7 @@ function ModuleCard({
9963
9978
  onTooltipOpenChange,
9964
9979
  onFlyoutClose,
9965
9980
  list,
9966
- query,
9981
+ query: rawQuery,
9967
9982
  onQueryChange,
9968
9983
  onHeaderClick,
9969
9984
  onSelect
@@ -9995,6 +10010,8 @@ function ModuleCard({
9995
10010
  setToggle({ collapsed, open, accordion: toggle.collapsed === collapsed });
9996
10011
  }
9997
10012
  const accordion = toggle.accordion && !reduced;
10013
+ const searchable = module.searchable !== false;
10014
+ const query = searchable ? rawQuery : "";
9998
10015
  const items = filterItems(module.items, query);
9999
10016
  const isEmpty = module.items.length === 0;
10000
10017
  const emptyMessage = /* @__PURE__ */ jsx(
@@ -10184,7 +10201,7 @@ function ModuleCard({
10184
10201
  },
10185
10202
  children: /* @__PURE__ */ jsxs("div", { "data-slot": "floating-sidebar-module-body", style: { width: bodyWidth }, children: [
10186
10203
  isEmpty && emptyMessage,
10187
- !isEmpty && /* @__PURE__ */ jsx(
10204
+ !isEmpty && searchable && /* @__PURE__ */ jsx(
10188
10205
  "div",
10189
10206
  {
10190
10207
  "data-slot": "floating-sidebar-search-bar",
@@ -10278,7 +10295,7 @@ function ModuleCard({
10278
10295
  }
10279
10296
  ),
10280
10297
  isEmpty && emptyMessage,
10281
- !isEmpty && /* @__PURE__ */ jsx(
10298
+ !isEmpty && searchable && /* @__PURE__ */ jsx(
10282
10299
  ModuleSearch,
10283
10300
  {
10284
10301
  moduleLabel: module.label,