@bizapps/ui 1.12.3 → 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/editor.cjs +1 -1
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +1 -1
- package/dist/editor.js.map +1 -1
- package/dist/main.cjs +62 -32
- package/dist/main.cjs.map +1 -1
- package/dist/main.css +1 -1
- package/dist/main.d.cts +36 -5
- package/dist/main.d.ts +36 -5
- package/dist/main.js +62 -32
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -430,7 +430,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
430
430
|
primary: "cursor-pointer bg-primary text-primary-foreground hover:bg-primary/80 focus-visible:ring-primary/30",
|
|
431
431
|
secondary: "cursor-pointer bg-secondary text-secondary-foreground hover:bg-[var(--color-orange-700)] focus-visible:ring-secondary/30",
|
|
432
432
|
cancel: "cursor-pointer bg-destructive text-secondary-foreground hover:bg-[var(--color-red-600)] focus-visible:ring-destructive/30",
|
|
433
|
-
outline: "border border-foreground/
|
|
433
|
+
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",
|
|
434
434
|
ghost: "cursor-pointer bg-transparent text-muted-foreground hover:bg-foreground/10 hover:text-primary focus-visible:ring-ring/30 border-none",
|
|
435
435
|
cancelGhost: "cursor-pointer bg-destructive/10 text-red-600 hover:bg-destructive/15 hover:text-red-600 focus-visible:ring-ring/30"
|
|
436
436
|
},
|
|
@@ -7269,6 +7269,21 @@ function Checkbox({
|
|
|
7269
7269
|
}
|
|
7270
7270
|
);
|
|
7271
7271
|
}
|
|
7272
|
+
|
|
7273
|
+
// src/components/compounds/Pagination/table-pagination-labels.ts
|
|
7274
|
+
var DEFAULT_TABLE_PAGINATION_LABELS = {
|
|
7275
|
+
navigation: "Table pagination",
|
|
7276
|
+
range: (from, to, total) => `Showing ${from}\u2013${to} of ${total}`,
|
|
7277
|
+
previous: "Previous",
|
|
7278
|
+
next: "Next",
|
|
7279
|
+
goToPreviousPage: "Go to previous page",
|
|
7280
|
+
goToNextPage: "Go to next page",
|
|
7281
|
+
rowsPerPage: "Rows per page",
|
|
7282
|
+
selectedRows: (count) => `${count} row${count > 1 ? "s" : ""} selected`
|
|
7283
|
+
};
|
|
7284
|
+
function resolveTablePaginationLabels(labels) {
|
|
7285
|
+
return { ...DEFAULT_TABLE_PAGINATION_LABELS, ...labels };
|
|
7286
|
+
}
|
|
7272
7287
|
function Pagination({ className, ...props }) {
|
|
7273
7288
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7274
7289
|
"nav",
|
|
@@ -7391,8 +7406,10 @@ function TablePaginationBase({
|
|
|
7391
7406
|
totalRecords,
|
|
7392
7407
|
rowsPerPageOptions = DEFAULT_ROWS_PER_PAGE,
|
|
7393
7408
|
onPageChange,
|
|
7394
|
-
onPerPageChange
|
|
7409
|
+
onPerPageChange,
|
|
7410
|
+
labels: labelsProp
|
|
7395
7411
|
}) {
|
|
7412
|
+
const labels = resolveTablePaginationLabels(labelsProp);
|
|
7396
7413
|
const rowsPerPageLabelId = react.useId();
|
|
7397
7414
|
const pageItems = getPageItems(page, totalPages);
|
|
7398
7415
|
const hasRecords = totalRecords !== void 0 && totalRecords > 0;
|
|
@@ -7410,30 +7427,23 @@ function TablePaginationBase({
|
|
|
7410
7427
|
"nav",
|
|
7411
7428
|
{
|
|
7412
7429
|
role: "navigation",
|
|
7413
|
-
"aria-label":
|
|
7430
|
+
"aria-label": labels.navigation,
|
|
7414
7431
|
"data-slot": "table-pagination",
|
|
7415
7432
|
className: "flex flex-wrap items-center justify-between gap-4 py-2",
|
|
7416
7433
|
children: [
|
|
7417
|
-
totalRecords !== void 0 && totalRecords > 0 && /* @__PURE__ */ jsxRuntime.
|
|
7418
|
-
"Showing ",
|
|
7419
|
-
from,
|
|
7420
|
-
"\u2013",
|
|
7421
|
-
to,
|
|
7422
|
-
" of ",
|
|
7423
|
-
totalRecords
|
|
7424
|
-
] }),
|
|
7434
|
+
totalRecords !== void 0 && totalRecords > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: labels.range(from, to, totalRecords) }),
|
|
7425
7435
|
/* @__PURE__ */ jsxRuntime.jsxs("ul", { "data-slot": "pagination-content", className: "flex items-center gap-1", children: [
|
|
7426
7436
|
/* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7427
7437
|
Button,
|
|
7428
7438
|
{
|
|
7429
7439
|
variant: "ghost",
|
|
7430
7440
|
size: "sm",
|
|
7431
|
-
"aria-label":
|
|
7441
|
+
"aria-label": labels.goToPreviousPage,
|
|
7432
7442
|
disabled: page <= 1,
|
|
7433
7443
|
onClick: () => onPageChange(page - 1),
|
|
7434
7444
|
children: [
|
|
7435
7445
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { "data-icon": "inline-start" }),
|
|
7436
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children:
|
|
7446
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: labels.previous })
|
|
7437
7447
|
]
|
|
7438
7448
|
}
|
|
7439
7449
|
) }),
|
|
@@ -7454,18 +7464,18 @@ function TablePaginationBase({
|
|
|
7454
7464
|
{
|
|
7455
7465
|
variant: "ghost",
|
|
7456
7466
|
size: "sm",
|
|
7457
|
-
"aria-label":
|
|
7467
|
+
"aria-label": labels.goToNextPage,
|
|
7458
7468
|
disabled: page >= totalPages,
|
|
7459
7469
|
onClick: () => onPageChange(page + 1),
|
|
7460
7470
|
children: [
|
|
7461
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children:
|
|
7471
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: labels.next }),
|
|
7462
7472
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { "data-icon": "inline-end" })
|
|
7463
7473
|
]
|
|
7464
7474
|
}
|
|
7465
7475
|
) })
|
|
7466
7476
|
] }),
|
|
7467
7477
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7468
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { id: rowsPerPageLabelId, className: "text-muted-foreground text-sm", children:
|
|
7478
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { id: rowsPerPageLabelId, className: "text-muted-foreground text-sm", children: labels.rowsPerPage }),
|
|
7469
7479
|
/* @__PURE__ */ jsxRuntime.jsxs(Select, { value: String(perPage), onValueChange: (v) => onPerPageChange(Number(v)), children: [
|
|
7470
7480
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { "aria-labelledby": rowsPerPageLabelId, className: "w-20", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
|
|
7471
7481
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: rowsPerPageOptions.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: String(opt), children: opt }, opt)) })
|
|
@@ -8883,15 +8893,20 @@ function DataTableRowActions({
|
|
|
8883
8893
|
}) })
|
|
8884
8894
|
] });
|
|
8885
8895
|
}
|
|
8886
|
-
function DataTableFooter({ pagination, selectedCount, className }) {
|
|
8896
|
+
function DataTableFooter({ pagination, selectedCount, labels, className }) {
|
|
8897
|
+
const mergedLabels = react.useMemo(
|
|
8898
|
+
() => ({ ...pagination.labels, ...labels }),
|
|
8899
|
+
[pagination.labels, labels]
|
|
8900
|
+
);
|
|
8901
|
+
const { selectedRows } = resolveTablePaginationLabels(mergedLabels);
|
|
8887
8902
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8888
8903
|
"div",
|
|
8889
8904
|
{
|
|
8890
8905
|
"data-slot": "data-table-footer",
|
|
8891
8906
|
className: cn("flex items-center justify-between border-t px-4 py-2", className),
|
|
8892
8907
|
children: [
|
|
8893
|
-
selectedCount != null && selectedCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-live": "polite", className: "text-muted-foreground text-xs", children:
|
|
8894
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(TablePagination, { ...pagination }) })
|
|
8908
|
+
selectedCount != null && selectedCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-live": "polite", className: "text-muted-foreground text-xs", children: selectedRows(selectedCount) }),
|
|
8909
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(TablePagination, { ...pagination, labels: mergedLabels }) })
|
|
8895
8910
|
]
|
|
8896
8911
|
}
|
|
8897
8912
|
);
|
|
@@ -9989,7 +10004,7 @@ function ModuleCard({
|
|
|
9989
10004
|
onTooltipOpenChange,
|
|
9990
10005
|
onFlyoutClose,
|
|
9991
10006
|
list,
|
|
9992
|
-
query,
|
|
10007
|
+
query: rawQuery,
|
|
9993
10008
|
onQueryChange,
|
|
9994
10009
|
onHeaderClick,
|
|
9995
10010
|
onSelect
|
|
@@ -10021,6 +10036,8 @@ function ModuleCard({
|
|
|
10021
10036
|
setToggle({ collapsed, open, accordion: toggle.collapsed === collapsed });
|
|
10022
10037
|
}
|
|
10023
10038
|
const accordion = toggle.accordion && !reduced;
|
|
10039
|
+
const searchable = module.searchable !== false;
|
|
10040
|
+
const query = searchable ? rawQuery : "";
|
|
10024
10041
|
const items = filterItems(module.items, query);
|
|
10025
10042
|
const isEmpty = module.items.length === 0;
|
|
10026
10043
|
const emptyMessage = /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10210,7 +10227,7 @@ function ModuleCard({
|
|
|
10210
10227
|
},
|
|
10211
10228
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "floating-sidebar-module-body", style: { width: bodyWidth }, children: [
|
|
10212
10229
|
isEmpty && emptyMessage,
|
|
10213
|
-
!isEmpty && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10230
|
+
!isEmpty && searchable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10214
10231
|
"div",
|
|
10215
10232
|
{
|
|
10216
10233
|
"data-slot": "floating-sidebar-search-bar",
|
|
@@ -10304,7 +10321,7 @@ function ModuleCard({
|
|
|
10304
10321
|
}
|
|
10305
10322
|
),
|
|
10306
10323
|
isEmpty && emptyMessage,
|
|
10307
|
-
!isEmpty && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10324
|
+
!isEmpty && searchable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10308
10325
|
ModuleSearch,
|
|
10309
10326
|
{
|
|
10310
10327
|
moduleLabel: module.label,
|
|
@@ -10592,16 +10609,29 @@ function filterApps(apps, query) {
|
|
|
10592
10609
|
(app) => `${app.label} ${app.description ?? ""}`.toLowerCase().includes(needle)
|
|
10593
10610
|
);
|
|
10594
10611
|
}
|
|
10612
|
+
var toneClasses = {
|
|
10613
|
+
green: "bg-green-100 text-green-800",
|
|
10614
|
+
yellow: "bg-yellow-200 text-yellow-800",
|
|
10615
|
+
navy: "bg-main-blue-primary/10 text-main-blue-primary",
|
|
10616
|
+
orange: "bg-orange-100 text-orange-800",
|
|
10617
|
+
purple: "bg-purple-100 text-purple-600",
|
|
10618
|
+
grey: "bg-light-200 text-main-grey",
|
|
10619
|
+
// Remaining apps catalogue colours, with the catalogue's own tile and ink pairs.
|
|
10620
|
+
// They have no DS scale, so they resolve to the Tailwind default palette.
|
|
10621
|
+
sky: "bg-sky-100 text-sky-600",
|
|
10622
|
+
rose: "bg-rose-100 text-rose-600",
|
|
10623
|
+
teal: "bg-teal-100 text-teal-600",
|
|
10624
|
+
indigo: "bg-indigo-100 text-indigo-600",
|
|
10625
|
+
slate: "bg-slate-100 text-slate-500",
|
|
10626
|
+
fuchsia: "bg-fuchsia-100 text-fuchsia-600"
|
|
10627
|
+
};
|
|
10628
|
+
function getAppHubTone(app) {
|
|
10629
|
+
if (app.locked || app.tone === void 0 || !Object.hasOwn(toneClasses, app.tone)) return "grey";
|
|
10630
|
+
return app.tone;
|
|
10631
|
+
}
|
|
10595
10632
|
var appHubIconVariants = classVarianceAuthority.cva("relative flex shrink-0 items-center justify-center", {
|
|
10596
10633
|
variants: {
|
|
10597
|
-
tone:
|
|
10598
|
-
green: "bg-green-100 text-green-800",
|
|
10599
|
-
yellow: "bg-yellow-200 text-yellow-800",
|
|
10600
|
-
navy: "bg-main-blue-primary/10 text-main-blue-primary",
|
|
10601
|
-
orange: "bg-orange-100 text-orange-800",
|
|
10602
|
-
purple: "bg-purple-100 text-purple-600",
|
|
10603
|
-
grey: "bg-light-200 text-main-grey"
|
|
10604
|
-
},
|
|
10634
|
+
tone: toneClasses,
|
|
10605
10635
|
size: {
|
|
10606
10636
|
tile: "size-12 rounded-2xl [&_svg]:size-5",
|
|
10607
10637
|
row: "size-9 rounded-xl [&_svg]:size-4.5",
|
|
@@ -10650,7 +10680,7 @@ function AppHubCounter({ count, className }) {
|
|
|
10650
10680
|
function AppHubTile({ app, current = false }) {
|
|
10651
10681
|
const { labels, appName } = useAppHubContext();
|
|
10652
10682
|
const name = getAppAccessibleName(app, labels, appName);
|
|
10653
|
-
const tone = app
|
|
10683
|
+
const tone = getAppHubTone(app);
|
|
10654
10684
|
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
10655
10685
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, "aria-describedby": void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10656
10686
|
AppHubLink,
|
|
@@ -10738,7 +10768,7 @@ function AppHubRow({
|
|
|
10738
10768
|
{
|
|
10739
10769
|
"aria-hidden": "true",
|
|
10740
10770
|
className: appHubIconVariants({
|
|
10741
|
-
tone:
|
|
10771
|
+
tone: getAppHubTone(app),
|
|
10742
10772
|
size: variant === "panel" ? "row" : "sheet"
|
|
10743
10773
|
}),
|
|
10744
10774
|
children: app.icon
|