@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.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/
|
|
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":
|
|
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__ */
|
|
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":
|
|
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:
|
|
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":
|
|
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:
|
|
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:
|
|
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:
|
|
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,
|
|
@@ -10566,16 +10583,29 @@ function filterApps(apps, query) {
|
|
|
10566
10583
|
(app) => `${app.label} ${app.description ?? ""}`.toLowerCase().includes(needle)
|
|
10567
10584
|
);
|
|
10568
10585
|
}
|
|
10586
|
+
var toneClasses = {
|
|
10587
|
+
green: "bg-green-100 text-green-800",
|
|
10588
|
+
yellow: "bg-yellow-200 text-yellow-800",
|
|
10589
|
+
navy: "bg-main-blue-primary/10 text-main-blue-primary",
|
|
10590
|
+
orange: "bg-orange-100 text-orange-800",
|
|
10591
|
+
purple: "bg-purple-100 text-purple-600",
|
|
10592
|
+
grey: "bg-light-200 text-main-grey",
|
|
10593
|
+
// Remaining apps catalogue colours, with the catalogue's own tile and ink pairs.
|
|
10594
|
+
// They have no DS scale, so they resolve to the Tailwind default palette.
|
|
10595
|
+
sky: "bg-sky-100 text-sky-600",
|
|
10596
|
+
rose: "bg-rose-100 text-rose-600",
|
|
10597
|
+
teal: "bg-teal-100 text-teal-600",
|
|
10598
|
+
indigo: "bg-indigo-100 text-indigo-600",
|
|
10599
|
+
slate: "bg-slate-100 text-slate-500",
|
|
10600
|
+
fuchsia: "bg-fuchsia-100 text-fuchsia-600"
|
|
10601
|
+
};
|
|
10602
|
+
function getAppHubTone(app) {
|
|
10603
|
+
if (app.locked || app.tone === void 0 || !Object.hasOwn(toneClasses, app.tone)) return "grey";
|
|
10604
|
+
return app.tone;
|
|
10605
|
+
}
|
|
10569
10606
|
var appHubIconVariants = cva("relative flex shrink-0 items-center justify-center", {
|
|
10570
10607
|
variants: {
|
|
10571
|
-
tone:
|
|
10572
|
-
green: "bg-green-100 text-green-800",
|
|
10573
|
-
yellow: "bg-yellow-200 text-yellow-800",
|
|
10574
|
-
navy: "bg-main-blue-primary/10 text-main-blue-primary",
|
|
10575
|
-
orange: "bg-orange-100 text-orange-800",
|
|
10576
|
-
purple: "bg-purple-100 text-purple-600",
|
|
10577
|
-
grey: "bg-light-200 text-main-grey"
|
|
10578
|
-
},
|
|
10608
|
+
tone: toneClasses,
|
|
10579
10609
|
size: {
|
|
10580
10610
|
tile: "size-12 rounded-2xl [&_svg]:size-5",
|
|
10581
10611
|
row: "size-9 rounded-xl [&_svg]:size-4.5",
|
|
@@ -10624,7 +10654,7 @@ function AppHubCounter({ count, className }) {
|
|
|
10624
10654
|
function AppHubTile({ app, current = false }) {
|
|
10625
10655
|
const { labels, appName } = useAppHubContext();
|
|
10626
10656
|
const name = getAppAccessibleName(app, labels, appName);
|
|
10627
|
-
const tone = app
|
|
10657
|
+
const tone = getAppHubTone(app);
|
|
10628
10658
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
10629
10659
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, "aria-describedby": void 0, children: /* @__PURE__ */ jsxs(
|
|
10630
10660
|
AppHubLink,
|
|
@@ -10712,7 +10742,7 @@ function AppHubRow({
|
|
|
10712
10742
|
{
|
|
10713
10743
|
"aria-hidden": "true",
|
|
10714
10744
|
className: appHubIconVariants({
|
|
10715
|
-
tone:
|
|
10745
|
+
tone: getAppHubTone(app),
|
|
10716
10746
|
size: variant === "panel" ? "row" : "sheet"
|
|
10717
10747
|
}),
|
|
10718
10748
|
children: app.icon
|