@krak-stack/registry 0.1.38 → 0.1.39
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/README.md +106 -29
- package/dist/components/ui/app-brand.js +17 -17
- package/dist/components/ui/code-block.js +4 -4
- package/dist/components/ui/copy-button.js +2 -2
- package/dist/components/ui/data-table.js +55 -55
- package/dist/components/ui/editing-locale-switcher.js +8 -8
- package/dist/components/ui/effect-form.js +12 -12
- package/dist/components/ui/error-component.js +6 -6
- package/dist/components/ui/file-picker.js +2 -2
- package/dist/components/ui/form.js +24 -24
- package/dist/components/ui/icon-input.js +5 -5
- package/dist/components/ui/locale-switcher.js +2 -2
- package/dist/components/ui/search-menu.js +2 -2
- package/dist/components/ui/sidebar-layout.js +1 -1
- package/dist/components/ui/theme-switcher.js +3 -3
- package/dist/lib/docs.js +52 -111
- package/dist/lib/docs.server.js +0 -28
- package/dist/lib/documentation-toolkit.js +0 -28
- package/dist/lib/httpapi-adapter.d.ts +73 -0
- package/dist/lib/httpapi-adapter.js +189 -0
- package/dist/lib/httpapi-cli.d.ts +4 -22
- package/dist/lib/httpapi-cli.js +199 -313
- package/dist/lib/httpapi-toolkit.d.ts +7 -16
- package/dist/lib/httpapi-toolkit.js +158 -214
- package/dist/lib/query.d.ts +2 -2
- package/dist/lib/query.js +2 -2
- package/dist/lib/webfetch-toolkit.d.ts +1 -1
- package/dist/lib/webfetch-toolkit.js +48 -50
- package/dist/oxlint/anti-slop/index.js +2 -2
- package/dist/services/agent/client/index.js +6 -6
- package/dist/services/agent/index.js +2 -2
- package/package.json +4 -12
- package/dist/lib/httpapi-client.d.ts +0 -34
- package/dist/lib/httpapi-client.js +0 -122
- package/dist/lib/httpapi-helpers.d.ts +0 -79
- package/dist/lib/httpapi-helpers.js +0 -130
- package/dist/lib/httpapi-mcp.d.ts +0 -25
- package/dist/lib/httpapi-mcp.js +0 -321
|
@@ -699,7 +699,7 @@ function Pagination({
|
|
|
699
699
|
totalRows
|
|
700
700
|
}) {
|
|
701
701
|
const locale = useKrakstackLocale2(localeOverride);
|
|
702
|
-
const
|
|
702
|
+
const labels = paginationMessages(locale, messageOverrides);
|
|
703
703
|
const pageSizeId = useId();
|
|
704
704
|
const canGoBack = page > 0;
|
|
705
705
|
const canGoForward = page + 1 < pageCount;
|
|
@@ -710,10 +710,10 @@ function Pagination({
|
|
|
710
710
|
className: "text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",
|
|
711
711
|
children: [
|
|
712
712
|
/* @__PURE__ */ jsx10("span", {
|
|
713
|
-
children:
|
|
713
|
+
children: labels.results(totalRows)
|
|
714
714
|
}),
|
|
715
715
|
selectedRows > 0 ? /* @__PURE__ */ jsx10("span", {
|
|
716
|
-
children:
|
|
716
|
+
children: labels.selectedOf(selectedRows, totalRows)
|
|
717
717
|
}) : null
|
|
718
718
|
]
|
|
719
719
|
}) : null,
|
|
@@ -726,7 +726,7 @@ function Pagination({
|
|
|
726
726
|
/* @__PURE__ */ jsx10(Label, {
|
|
727
727
|
htmlFor: pageSizeId,
|
|
728
728
|
className: cn("hidden text-sm sm:block", compact && "block"),
|
|
729
|
-
children:
|
|
729
|
+
children: labels.pageSize
|
|
730
730
|
}),
|
|
731
731
|
/* @__PURE__ */ jsxs5(Select, {
|
|
732
732
|
items: pageSizes.map((size) => ({
|
|
@@ -759,7 +759,7 @@ function Pagination({
|
|
|
759
759
|
children: [
|
|
760
760
|
/* @__PURE__ */ jsx10("div", {
|
|
761
761
|
className: "flex items-center justify-center text-sm font-medium sm:block",
|
|
762
|
-
children:
|
|
762
|
+
children: labels.pageOf(page + 1, pageCount)
|
|
763
763
|
}),
|
|
764
764
|
/* @__PURE__ */ jsxs5("div", {
|
|
765
765
|
className: "flex items-center gap-1",
|
|
@@ -772,7 +772,7 @@ function Pagination({
|
|
|
772
772
|
children: [
|
|
773
773
|
/* @__PURE__ */ jsx10("span", {
|
|
774
774
|
className: "sr-only",
|
|
775
|
-
children:
|
|
775
|
+
children: labels.goToFirstPage
|
|
776
776
|
}),
|
|
777
777
|
/* @__PURE__ */ jsx10(ChevronsLeft, {})
|
|
778
778
|
]
|
|
@@ -785,7 +785,7 @@ function Pagination({
|
|
|
785
785
|
children: [
|
|
786
786
|
/* @__PURE__ */ jsx10("span", {
|
|
787
787
|
className: "sr-only",
|
|
788
|
-
children:
|
|
788
|
+
children: labels.goToPreviousPage
|
|
789
789
|
}),
|
|
790
790
|
/* @__PURE__ */ jsx10(ChevronLeft, {})
|
|
791
791
|
]
|
|
@@ -798,7 +798,7 @@ function Pagination({
|
|
|
798
798
|
children: [
|
|
799
799
|
/* @__PURE__ */ jsx10("span", {
|
|
800
800
|
className: "sr-only",
|
|
801
|
-
children:
|
|
801
|
+
children: labels.goToNextPage
|
|
802
802
|
}),
|
|
803
803
|
/* @__PURE__ */ jsx10(ChevronRight, {})
|
|
804
804
|
]
|
|
@@ -811,7 +811,7 @@ function Pagination({
|
|
|
811
811
|
children: [
|
|
812
812
|
/* @__PURE__ */ jsx10("span", {
|
|
813
813
|
className: "sr-only",
|
|
814
|
-
children:
|
|
814
|
+
children: labels.goToLastPage
|
|
815
815
|
}),
|
|
816
816
|
/* @__PURE__ */ jsx10(ChevronsRight, {})
|
|
817
817
|
]
|
|
@@ -1223,9 +1223,9 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1223
1223
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1224
1224
|
return leftScalar === undefined ? nullOrder : -nullOrder;
|
|
1225
1225
|
}
|
|
1226
|
-
const
|
|
1227
|
-
if (
|
|
1228
|
-
return sort.direction === "desc" ? -
|
|
1226
|
+
const comparison = leftScalar - rightScalar;
|
|
1227
|
+
if (comparison !== 0)
|
|
1228
|
+
return sort.direction === "desc" ? -comparison : comparison;
|
|
1229
1229
|
continue;
|
|
1230
1230
|
}
|
|
1231
1231
|
if (!colDef.comparator && (colDef.type === "date" || colDef.type === "dateTime")) {
|
|
@@ -1237,9 +1237,9 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1237
1237
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1238
1238
|
return !leftDate ? nullOrder : -nullOrder;
|
|
1239
1239
|
}
|
|
1240
|
-
const
|
|
1241
|
-
if (
|
|
1242
|
-
return sort.direction === "desc" ? -
|
|
1240
|
+
const comparison = DateTime.toEpochMillis(leftDate.instant) - DateTime.toEpochMillis(rightDate.instant);
|
|
1241
|
+
if (comparison !== 0)
|
|
1242
|
+
return sort.direction === "desc" ? -comparison : comparison;
|
|
1243
1243
|
continue;
|
|
1244
1244
|
}
|
|
1245
1245
|
const comparison = column.colDef.comparator ? column.colDef.comparator(leftValue, rightValue, left.row.data, right.row.data) : Object.is(leftValue, rightValue) ? 0 : leftValue === null || leftValue === undefined ? 1 : rightValue === null || rightValue === undefined ? -1 : Schema.is(Schema.Number)(leftValue) && Schema.is(Schema.Number)(rightValue) ? leftValue - rightValue : String(leftValue).localeCompare(String(rightValue), undefined, { numeric: true, sensitivity: "base" });
|
|
@@ -1427,7 +1427,7 @@ var canMoveRowsToGroups = (store) => getActiveGrouping(store).some((field) => !!
|
|
|
1427
1427
|
var canDragRows = (store) => getActiveGrouping(store).length ? canMoveRowsToGroups(store) : canReorderRows(store);
|
|
1428
1428
|
var hasRowActionMenu = (store) => !!store.config.features.rowActions || canReorderRows(store);
|
|
1429
1429
|
var getSelectedRows = (store, model) => model.rows.filter((row) => store.state.rowSelection[row.id]).map((row) => row.data);
|
|
1430
|
-
var renderCell = (row, column, locale = "en",
|
|
1430
|
+
var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)) => {
|
|
1431
1431
|
const value = row.values.get(column.id);
|
|
1432
1432
|
const params = {
|
|
1433
1433
|
data: row.data,
|
|
@@ -1496,11 +1496,11 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1496
1496
|
itemActions,
|
|
1497
1497
|
items: config.getItems(row.data),
|
|
1498
1498
|
locale,
|
|
1499
|
-
messages: { [locale]:
|
|
1499
|
+
messages: { [locale]: labels },
|
|
1500
1500
|
options: config.getOptions(row.data),
|
|
1501
1501
|
totalCount: config.getTotalCount?.(row.data),
|
|
1502
|
-
onAdd: config.onAdd ? (
|
|
1503
|
-
onRemove: config.onRemove ? (
|
|
1502
|
+
onAdd: config.onAdd ? (value) => config.onAdd?.({ value, row: row.data }) : undefined,
|
|
1503
|
+
onRemove: config.onRemove ? (value) => config.onRemove?.({ value, row: row.data }) : undefined
|
|
1504
1504
|
});
|
|
1505
1505
|
}
|
|
1506
1506
|
return /* @__PURE__ */ jsx14(DataTableListCell, {
|
|
@@ -1508,7 +1508,7 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1508
1508
|
itemActions,
|
|
1509
1509
|
items: config.getItems(row.data),
|
|
1510
1510
|
locale,
|
|
1511
|
-
messages: { [locale]:
|
|
1511
|
+
messages: { [locale]: labels },
|
|
1512
1512
|
totalCount: config.getTotalCount?.(row.data)
|
|
1513
1513
|
});
|
|
1514
1514
|
}
|
|
@@ -1641,7 +1641,7 @@ var DataTableToolbar = ({
|
|
|
1641
1641
|
tableAtom
|
|
1642
1642
|
}) => {
|
|
1643
1643
|
const [store, setStore] = useTableAtom(tableAtom);
|
|
1644
|
-
const { features, labels
|
|
1644
|
+
const { features, labels } = store.config;
|
|
1645
1645
|
const model = deriveModel(store);
|
|
1646
1646
|
const selectedRows = getSelectedRows(store, model);
|
|
1647
1647
|
const grouping = features.grouping;
|
|
@@ -1669,11 +1669,11 @@ var DataTableToolbar = ({
|
|
|
1669
1669
|
globalFilter: event.target.value,
|
|
1670
1670
|
page: 0
|
|
1671
1671
|
})),
|
|
1672
|
-
placeholder:
|
|
1672
|
+
placeholder: labels.filter,
|
|
1673
1673
|
value: store.state.globalFilter ?? ""
|
|
1674
1674
|
}),
|
|
1675
1675
|
store.state.globalFilter ? /* @__PURE__ */ jsx14(Button, {
|
|
1676
|
-
"aria-label":
|
|
1676
|
+
"aria-label": labels.filter,
|
|
1677
1677
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2",
|
|
1678
1678
|
onClick: () => update((state) => ({
|
|
1679
1679
|
...state,
|
|
@@ -1697,7 +1697,7 @@ var DataTableToolbar = ({
|
|
|
1697
1697
|
/* @__PURE__ */ jsxs8(MenubarTrigger, {
|
|
1698
1698
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 aria-expanded:bg-primary/90",
|
|
1699
1699
|
children: [
|
|
1700
|
-
|
|
1700
|
+
labels.selected,
|
|
1701
1701
|
/* @__PURE__ */ jsx14(Badge, {
|
|
1702
1702
|
variant: "secondary",
|
|
1703
1703
|
children: selectedRows.length
|
|
@@ -1711,7 +1711,7 @@ var DataTableToolbar = ({
|
|
|
1711
1711
|
children: /* @__PURE__ */ jsxs8(MenubarGroup, {
|
|
1712
1712
|
children: [
|
|
1713
1713
|
/* @__PURE__ */ jsx14(MenubarLabel, {
|
|
1714
|
-
children: bulkActions && bulkActions.label ? bulkActions.label :
|
|
1714
|
+
children: bulkActions && bulkActions.label ? bulkActions.label : labels.actions
|
|
1715
1715
|
}),
|
|
1716
1716
|
/* @__PURE__ */ jsx14(MenubarSeparator, {}),
|
|
1717
1717
|
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs8(MenubarItem, {
|
|
@@ -1730,12 +1730,12 @@ var DataTableToolbar = ({
|
|
|
1730
1730
|
grouping ? /* @__PURE__ */ jsxs8(MenubarMenu, {
|
|
1731
1731
|
children: [
|
|
1732
1732
|
/* @__PURE__ */ jsxs8(MenubarTrigger, {
|
|
1733
|
-
"aria-label":
|
|
1733
|
+
"aria-label": labels.groupBy,
|
|
1734
1734
|
children: [
|
|
1735
1735
|
/* @__PURE__ */ jsx14(Rows3, {}),
|
|
1736
1736
|
/* @__PURE__ */ jsx14("span", {
|
|
1737
1737
|
className: "hidden sm:inline",
|
|
1738
|
-
children:
|
|
1738
|
+
children: labels.groupBy
|
|
1739
1739
|
})
|
|
1740
1740
|
]
|
|
1741
1741
|
}),
|
|
@@ -1744,7 +1744,7 @@ var DataTableToolbar = ({
|
|
|
1744
1744
|
children: /* @__PURE__ */ jsxs8(MenubarGroup, {
|
|
1745
1745
|
children: [
|
|
1746
1746
|
/* @__PURE__ */ jsx14(MenubarLabel, {
|
|
1747
|
-
children:
|
|
1747
|
+
children: labels.groupBy
|
|
1748
1748
|
}),
|
|
1749
1749
|
/* @__PURE__ */ jsx14(MenubarSeparator, {}),
|
|
1750
1750
|
grouping.fields.map((field) => /* @__PURE__ */ jsx14(MenubarCheckboxItem, {
|
|
@@ -1771,13 +1771,13 @@ var DataTableToolbar = ({
|
|
|
1771
1771
|
}) : null,
|
|
1772
1772
|
features.refresh ? /* @__PURE__ */ jsx14(MenubarMenu, {
|
|
1773
1773
|
children: /* @__PURE__ */ jsxs8(MenubarTrigger, {
|
|
1774
|
-
"aria-label":
|
|
1774
|
+
"aria-label": labels.refresh,
|
|
1775
1775
|
onClick: features.refresh,
|
|
1776
1776
|
children: [
|
|
1777
1777
|
/* @__PURE__ */ jsx14(RefreshCw, {}),
|
|
1778
1778
|
/* @__PURE__ */ jsx14("span", {
|
|
1779
1779
|
className: "hidden sm:inline",
|
|
1780
|
-
children:
|
|
1780
|
+
children: labels.refresh
|
|
1781
1781
|
})
|
|
1782
1782
|
]
|
|
1783
1783
|
})
|
|
@@ -1785,13 +1785,13 @@ var DataTableToolbar = ({
|
|
|
1785
1785
|
features.export ? /* @__PURE__ */ jsxs8(MenubarMenu, {
|
|
1786
1786
|
children: [
|
|
1787
1787
|
/* @__PURE__ */ jsxs8(MenubarTrigger, {
|
|
1788
|
-
"aria-label":
|
|
1788
|
+
"aria-label": labels.export,
|
|
1789
1789
|
disabled: !exportRows.length,
|
|
1790
1790
|
children: [
|
|
1791
1791
|
/* @__PURE__ */ jsx14(Download, {}),
|
|
1792
1792
|
/* @__PURE__ */ jsx14("span", {
|
|
1793
1793
|
className: "hidden sm:inline",
|
|
1794
|
-
children:
|
|
1794
|
+
children: labels.export
|
|
1795
1795
|
})
|
|
1796
1796
|
]
|
|
1797
1797
|
}),
|
|
@@ -1800,14 +1800,14 @@ var DataTableToolbar = ({
|
|
|
1800
1800
|
children: /* @__PURE__ */ jsxs8(MenubarGroup, {
|
|
1801
1801
|
children: [
|
|
1802
1802
|
/* @__PURE__ */ jsx14(MenubarLabel, {
|
|
1803
|
-
children:
|
|
1803
|
+
children: labels.export
|
|
1804
1804
|
}),
|
|
1805
1805
|
/* @__PURE__ */ jsx14(MenubarSeparator, {}),
|
|
1806
1806
|
/* @__PURE__ */ jsxs8(MenubarItem, {
|
|
1807
1807
|
onClick: () => downloadCsv(model.visibleColumns.map(columnLabel), exportRows.map((row) => model.visibleColumns.map((column) => String(getDataTableExportValue(row, column, store.config.locale) ?? ""))), features.export ? features.export.baseName : "table"),
|
|
1808
1808
|
children: [
|
|
1809
1809
|
/* @__PURE__ */ jsx14(FileText, {}),
|
|
1810
|
-
|
|
1810
|
+
labels.exportCsv
|
|
1811
1811
|
]
|
|
1812
1812
|
}),
|
|
1813
1813
|
/* @__PURE__ */ jsxs8(MenubarItem, {
|
|
@@ -1817,7 +1817,7 @@ var DataTableToolbar = ({
|
|
|
1817
1817
|
]))), features.export ? features.export.baseName : "table"),
|
|
1818
1818
|
children: [
|
|
1819
1819
|
/* @__PURE__ */ jsx14(FileJson, {}),
|
|
1820
|
-
|
|
1820
|
+
labels.exportJson
|
|
1821
1821
|
]
|
|
1822
1822
|
})
|
|
1823
1823
|
]
|
|
@@ -2834,7 +2834,7 @@ var HydratedDataTable = ({
|
|
|
2834
2834
|
const config = {
|
|
2835
2835
|
getRowId: selection && selection.getRowId || props.getRowId || undefined,
|
|
2836
2836
|
onStateChange: props.onStateChange,
|
|
2837
|
-
onUiStateChange: (
|
|
2837
|
+
onUiStateChange: (state) => setUiState(state),
|
|
2838
2838
|
status: props.status ?? {},
|
|
2839
2839
|
features,
|
|
2840
2840
|
onRowClicked: props.onRowClicked,
|
|
@@ -2955,7 +2955,7 @@ var DataTableListCell = (props) => {
|
|
|
2955
2955
|
});
|
|
2956
2956
|
}
|
|
2957
2957
|
const { actionsLabel, itemActions, ...summaryProps } = resolvedProps;
|
|
2958
|
-
const
|
|
2958
|
+
const labels = dataTableMessages(locale, resolvedProps.messages);
|
|
2959
2959
|
const totalCount = resolvedProps.totalCount ?? resolvedProps.items.length;
|
|
2960
2960
|
const overflow = totalCount > Math.min(resolvedProps.items.length, resolvedProps.visibleCount ?? 3);
|
|
2961
2961
|
if (!itemActions?.length && !overflow) {
|
|
@@ -2963,7 +2963,7 @@ var DataTableListCell = (props) => {
|
|
|
2963
2963
|
...summaryProps
|
|
2964
2964
|
});
|
|
2965
2965
|
}
|
|
2966
|
-
const menuLabel = actionsLabel ?? (itemActions?.length ?
|
|
2966
|
+
const menuLabel = actionsLabel ?? (itemActions?.length ? labels.actions : labels.listDetails);
|
|
2967
2967
|
return /* @__PURE__ */ jsx14("div", {
|
|
2968
2968
|
className: "grid min-h-16 in-[[data-slot=table-cell]]:absolute in-[[data-slot=table-cell]]:inset-0 in-[[data-slot=table-cell]]:min-h-0",
|
|
2969
2969
|
"data-slot": "data-table-list-cell",
|
|
@@ -3005,7 +3005,7 @@ var EditableDataTableListCell = ({
|
|
|
3005
3005
|
actionsLabel,
|
|
3006
3006
|
itemActions,
|
|
3007
3007
|
locale = "en",
|
|
3008
|
-
messages
|
|
3008
|
+
messages
|
|
3009
3009
|
}) => {
|
|
3010
3010
|
const [selected, setSelected] = useState([...items]);
|
|
3011
3011
|
useLayoutEffect(() => setSelected([...items]), [items]);
|
|
@@ -3013,14 +3013,14 @@ var EditableDataTableListCell = ({
|
|
|
3013
3013
|
const available = options.filter((item) => !selectedValues.has(item.value));
|
|
3014
3014
|
const canAdd = !!onAdd && available.length > 0;
|
|
3015
3015
|
const selectedTotal = totalCount === undefined ? selected.length : totalCount + selected.length - items.length;
|
|
3016
|
-
const
|
|
3016
|
+
const labels = dataTableMessages(locale, messages);
|
|
3017
3017
|
const actions = [
|
|
3018
3018
|
...itemActions ?? [],
|
|
3019
3019
|
...onRemove ? [
|
|
3020
3020
|
{
|
|
3021
3021
|
id: "data-table-list-remove",
|
|
3022
3022
|
closeOnClick: false,
|
|
3023
|
-
name:
|
|
3023
|
+
name: labels.removeItem,
|
|
3024
3024
|
icon: /* @__PURE__ */ jsx14(Trash2, {}),
|
|
3025
3025
|
variant: "destructive",
|
|
3026
3026
|
onClick: (item) => {
|
|
@@ -3040,7 +3040,7 @@ var EditableDataTableListCell = ({
|
|
|
3040
3040
|
children: /* @__PURE__ */ jsx14(DataTableListMenu, {
|
|
3041
3041
|
actions,
|
|
3042
3042
|
addEmptyLabel: emptyLabel,
|
|
3043
|
-
addLabel:
|
|
3043
|
+
addLabel: labels.addItem,
|
|
3044
3044
|
addOptions: canAdd ? available : undefined,
|
|
3045
3045
|
addSearchLabel: manageLabel,
|
|
3046
3046
|
display,
|
|
@@ -3048,7 +3048,7 @@ var EditableDataTableListCell = ({
|
|
|
3048
3048
|
items: selected,
|
|
3049
3049
|
label: actionsLabel ?? manageLabel,
|
|
3050
3050
|
locale,
|
|
3051
|
-
messages
|
|
3051
|
+
messages,
|
|
3052
3052
|
onAdd: canAdd ? (item) => {
|
|
3053
3053
|
onAdd(item.value);
|
|
3054
3054
|
setSelected((current) => [...current, item]);
|
|
@@ -3084,7 +3084,7 @@ var DataTableListMenu = ({
|
|
|
3084
3084
|
items,
|
|
3085
3085
|
label,
|
|
3086
3086
|
locale = "en",
|
|
3087
|
-
messages
|
|
3087
|
+
messages,
|
|
3088
3088
|
onAdd,
|
|
3089
3089
|
trigger
|
|
3090
3090
|
}) => {
|
|
@@ -3096,8 +3096,8 @@ var DataTableListMenu = ({
|
|
|
3096
3096
|
const hasActions = entries.some(({ visibleActions }) => visibleActions.length);
|
|
3097
3097
|
if (!force && !hasActions && !onAdd)
|
|
3098
3098
|
return null;
|
|
3099
|
-
const
|
|
3100
|
-
const resolvedLabel = label ?? (hasActions ?
|
|
3099
|
+
const labels = dataTableMessages(locale, messages);
|
|
3100
|
+
const resolvedLabel = label ?? (hasActions ? labels.actions : labels.listDetails);
|
|
3101
3101
|
return /* @__PURE__ */ jsxs8(DropdownMenu, {
|
|
3102
3102
|
children: [
|
|
3103
3103
|
/* @__PURE__ */ jsx14(DropdownMenuTrigger, {
|
|
@@ -3159,12 +3159,12 @@ var DataTableListMenu = ({
|
|
|
3159
3159
|
entries.length ? /* @__PURE__ */ jsx14(DropdownMenuSeparator, {}) : null,
|
|
3160
3160
|
/* @__PURE__ */ jsx14(DataTableListAddMenu, {
|
|
3161
3161
|
emptyLabel: addEmptyLabel,
|
|
3162
|
-
label: addLabel ??
|
|
3162
|
+
label: addLabel ?? labels.addItem,
|
|
3163
3163
|
locale,
|
|
3164
|
-
messages
|
|
3164
|
+
messages,
|
|
3165
3165
|
onAdd,
|
|
3166
3166
|
options: addOptions,
|
|
3167
|
-
searchLabel: addSearchLabel ??
|
|
3167
|
+
searchLabel: addSearchLabel ?? labels.filter,
|
|
3168
3168
|
display
|
|
3169
3169
|
})
|
|
3170
3170
|
]
|
|
@@ -3180,7 +3180,7 @@ var DataTableListAddMenu = ({
|
|
|
3180
3180
|
display,
|
|
3181
3181
|
label,
|
|
3182
3182
|
locale = "en",
|
|
3183
|
-
messages
|
|
3183
|
+
messages,
|
|
3184
3184
|
onAdd,
|
|
3185
3185
|
options,
|
|
3186
3186
|
searchLabel
|
|
@@ -3189,7 +3189,7 @@ var DataTableListAddMenu = ({
|
|
|
3189
3189
|
const focusSearch = useCallback((input) => {
|
|
3190
3190
|
input?.focus({ preventScroll: true });
|
|
3191
3191
|
}, []);
|
|
3192
|
-
const
|
|
3192
|
+
const labels = dataTableMessages(locale, messages);
|
|
3193
3193
|
const normalizedSearch = search.trim().toLocaleLowerCase(locale);
|
|
3194
3194
|
const filtered = normalizedSearch ? options.filter((item) => item.label.toLocaleLowerCase(locale).includes(normalizedSearch)) : options;
|
|
3195
3195
|
return /* @__PURE__ */ jsxs8(DropdownMenuSub, {
|
|
@@ -3221,7 +3221,7 @@ var DataTableListAddMenu = ({
|
|
|
3221
3221
|
if (event.key !== "Escape")
|
|
3222
3222
|
event.stopPropagation();
|
|
3223
3223
|
},
|
|
3224
|
-
placeholder:
|
|
3224
|
+
placeholder: labels.filter,
|
|
3225
3225
|
ref: focusSearch,
|
|
3226
3226
|
value: search
|
|
3227
3227
|
})
|
|
@@ -3248,7 +3248,7 @@ var DataTableListSummaryContent = ({
|
|
|
3248
3248
|
emptyLabel,
|
|
3249
3249
|
items,
|
|
3250
3250
|
locale,
|
|
3251
|
-
messages
|
|
3251
|
+
messages,
|
|
3252
3252
|
totalCount = items.length,
|
|
3253
3253
|
display = "list",
|
|
3254
3254
|
showMenu,
|
|
@@ -3284,7 +3284,7 @@ var DataTableListSummaryContent = ({
|
|
|
3284
3284
|
force: true,
|
|
3285
3285
|
items: normalized,
|
|
3286
3286
|
locale,
|
|
3287
|
-
messages
|
|
3287
|
+
messages
|
|
3288
3288
|
}) : null
|
|
3289
3289
|
]
|
|
3290
3290
|
})
|
|
@@ -3306,7 +3306,7 @@ var DataTableListSummaryContent = ({
|
|
|
3306
3306
|
force: true,
|
|
3307
3307
|
items: normalized,
|
|
3308
3308
|
locale,
|
|
3309
|
-
messages
|
|
3309
|
+
messages
|
|
3310
3310
|
}) : null
|
|
3311
3311
|
]
|
|
3312
3312
|
});
|
|
@@ -154,16 +154,16 @@ var editingLocaleMessages = (locale, translations) => {
|
|
|
154
154
|
function EditingLocaleSwitcher({
|
|
155
155
|
locale: localeOverride,
|
|
156
156
|
locales: localeOverrides,
|
|
157
|
-
messages
|
|
157
|
+
messages,
|
|
158
158
|
value,
|
|
159
159
|
onValueChange
|
|
160
160
|
}) {
|
|
161
161
|
const locale = useKrakstackLocale(localeOverride);
|
|
162
162
|
const locales = useKrakstackLocales(localeOverrides);
|
|
163
|
-
const labels = editingLocaleMessages(locale,
|
|
164
|
-
const localeOptions = locales.map((
|
|
165
|
-
value
|
|
166
|
-
label: labels.localeName(
|
|
163
|
+
const labels = editingLocaleMessages(locale, messages);
|
|
164
|
+
const localeOptions = locales.map((value) => ({
|
|
165
|
+
value,
|
|
166
|
+
label: labels.localeName(value)
|
|
167
167
|
}));
|
|
168
168
|
return /* @__PURE__ */ jsxs2(Select, {
|
|
169
169
|
items: localeOptions,
|
|
@@ -194,10 +194,10 @@ function EditingLocaleSwitcher({
|
|
|
194
194
|
]
|
|
195
195
|
}),
|
|
196
196
|
/* @__PURE__ */ jsx3(SelectContent, {
|
|
197
|
-
children: localeOptions.map(({ value
|
|
198
|
-
value
|
|
197
|
+
children: localeOptions.map(({ value, label }) => /* @__PURE__ */ jsx3(SelectItem, {
|
|
198
|
+
value,
|
|
199
199
|
children: label
|
|
200
|
-
},
|
|
200
|
+
}, value))
|
|
201
201
|
})
|
|
202
202
|
]
|
|
203
203
|
});
|
|
@@ -362,7 +362,7 @@ var FilePicker = ({
|
|
|
362
362
|
image,
|
|
363
363
|
invalid = false,
|
|
364
364
|
locale: localeOverride,
|
|
365
|
-
messages
|
|
365
|
+
messages,
|
|
366
366
|
multiple = false,
|
|
367
367
|
name,
|
|
368
368
|
onBlur,
|
|
@@ -373,7 +373,7 @@ var FilePicker = ({
|
|
|
373
373
|
title
|
|
374
374
|
}) => {
|
|
375
375
|
const locale = useKrakstackLocale(localeOverride);
|
|
376
|
-
const labels = filePickerMessages(locale,
|
|
376
|
+
const labels = filePickerMessages(locale, messages);
|
|
377
377
|
const inputRef = useRef(null);
|
|
378
378
|
const dragDepthRef = useRef(0);
|
|
379
379
|
const [dragging, setDragging] = useState(false);
|
|
@@ -1362,7 +1362,7 @@ var SubmitButton = ({
|
|
|
1362
1362
|
children,
|
|
1363
1363
|
form,
|
|
1364
1364
|
locale,
|
|
1365
|
-
messages
|
|
1365
|
+
messages,
|
|
1366
1366
|
onSubmit
|
|
1367
1367
|
}) => {
|
|
1368
1368
|
const submit = useAtomSet(form.submit);
|
|
@@ -1370,7 +1370,7 @@ var SubmitButton = ({
|
|
|
1370
1370
|
const isDirty = useAtomValue(form.isDirty);
|
|
1371
1371
|
const hasChangedSinceSubmit = useAtomValue(form.hasChangedSinceSubmit);
|
|
1372
1372
|
const lastSubmittedValues = useAtomValue(form.lastSubmittedValues);
|
|
1373
|
-
const labels = useEffectFormMessages(locale,
|
|
1373
|
+
const labels = useEffectFormMessages(locale, messages);
|
|
1374
1374
|
const hasPendingChanges = Option.isNone(lastSubmittedValues) ? isDirty : hasChangedSinceSubmit;
|
|
1375
1375
|
return /* @__PURE__ */ jsxs6(Button, {
|
|
1376
1376
|
type: "button",
|
|
@@ -1439,8 +1439,8 @@ var NameField = ({
|
|
|
1439
1439
|
field,
|
|
1440
1440
|
props
|
|
1441
1441
|
}) => {
|
|
1442
|
-
const { locale, messages
|
|
1443
|
-
const labels = useEffectFormMessages(locale,
|
|
1442
|
+
const { locale, messages, ...fieldProps } = props;
|
|
1443
|
+
const labels = useEffectFormMessages(locale, messages);
|
|
1444
1444
|
return /* @__PURE__ */ jsx13(TextField, {
|
|
1445
1445
|
field,
|
|
1446
1446
|
props: {
|
|
@@ -1486,8 +1486,8 @@ var TextAreaField = ({ field, props }) => {
|
|
|
1486
1486
|
});
|
|
1487
1487
|
};
|
|
1488
1488
|
var DescriptionField = ({ field, props }) => {
|
|
1489
|
-
const { locale, messages
|
|
1490
|
-
const labels = useEffectFormMessages(locale,
|
|
1489
|
+
const { locale, messages, ...fieldProps } = props;
|
|
1490
|
+
const labels = useEffectFormMessages(locale, messages);
|
|
1491
1491
|
return /* @__PURE__ */ jsx13(TextAreaField, {
|
|
1492
1492
|
field,
|
|
1493
1493
|
props: {
|
|
@@ -2038,10 +2038,10 @@ var ImageField = ({ field, props }) => {
|
|
|
2038
2038
|
};
|
|
2039
2039
|
var NavigationBlock = ({
|
|
2040
2040
|
locale,
|
|
2041
|
-
messages
|
|
2041
|
+
messages,
|
|
2042
2042
|
shouldBlock
|
|
2043
2043
|
}) => {
|
|
2044
|
-
const labels = useEffectFormMessages(locale,
|
|
2044
|
+
const labels = useEffectFormMessages(locale, messages);
|
|
2045
2045
|
return /* @__PURE__ */ jsx13(Block, {
|
|
2046
2046
|
enableBeforeUnload: () => shouldBlock,
|
|
2047
2047
|
shouldBlockFn: () => shouldBlock,
|
|
@@ -2080,7 +2080,7 @@ var NavigationBlock = ({
|
|
|
2080
2080
|
var FormBlockNavigation = ({
|
|
2081
2081
|
form,
|
|
2082
2082
|
locale,
|
|
2083
|
-
messages
|
|
2083
|
+
messages
|
|
2084
2084
|
}) => {
|
|
2085
2085
|
const submitResult = useAtomValue(form.submit);
|
|
2086
2086
|
const isDirty = useAtomValue(form.isDirty);
|
|
@@ -2089,7 +2089,7 @@ var FormBlockNavigation = ({
|
|
|
2089
2089
|
const shouldBlock = !submitResult.waiting && (Option.isNone(lastSubmittedValues) ? isDirty : hasChangedSinceSubmit);
|
|
2090
2090
|
return /* @__PURE__ */ jsx13(NavigationBlock, {
|
|
2091
2091
|
locale,
|
|
2092
|
-
messages
|
|
2092
|
+
messages,
|
|
2093
2093
|
shouldBlock
|
|
2094
2094
|
});
|
|
2095
2095
|
};
|
|
@@ -75,7 +75,7 @@ function CopyButton({
|
|
|
75
75
|
valueDescription,
|
|
76
76
|
copyVariant = "default",
|
|
77
77
|
locale: localeOverride,
|
|
78
|
-
messages
|
|
78
|
+
messages,
|
|
79
79
|
onCopied,
|
|
80
80
|
onCopyError,
|
|
81
81
|
resetDelay = 1500,
|
|
@@ -87,7 +87,7 @@ function CopyButton({
|
|
|
87
87
|
const locale = useKrakstackLocale(localeOverride);
|
|
88
88
|
const [copyState, setCopyState] = useState("idle");
|
|
89
89
|
const copyTimeout = useRef(undefined);
|
|
90
|
-
const labels = copyButtonMessages(locale,
|
|
90
|
+
const labels = copyButtonMessages(locale, messages);
|
|
91
91
|
const accessibleLabel = ariaLabel ?? (valueDescription ? `${labels.copy} ${valueDescription}` : labels.copy);
|
|
92
92
|
const isLarge = copyVariant === "large";
|
|
93
93
|
const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
|
|
@@ -275,7 +275,7 @@ var defaultMessages = {
|
|
|
275
275
|
var ErrorComponent = ({
|
|
276
276
|
error,
|
|
277
277
|
locale: localeOverride,
|
|
278
|
-
messages
|
|
278
|
+
messages,
|
|
279
279
|
retryable = true,
|
|
280
280
|
className,
|
|
281
281
|
diagnostics
|
|
@@ -286,9 +286,9 @@ var ErrorComponent = ({
|
|
|
286
286
|
});
|
|
287
287
|
const labels = useMemo(() => ({
|
|
288
288
|
...defaultMessages[locale.startsWith("fr") ? "fr" : "en"],
|
|
289
|
-
...
|
|
290
|
-
...
|
|
291
|
-
}), [locale,
|
|
289
|
+
...messages?.[locale.split("-")[0] ?? locale],
|
|
290
|
+
...messages?.[locale]
|
|
291
|
+
}), [locale, messages]);
|
|
292
292
|
const reference = diagnostics?.reference ?? getErrorTraceId(error);
|
|
293
293
|
const report = useMemo(() => [
|
|
294
294
|
`${labels.errorLabel}: ${error.name}`,
|
|
@@ -245,7 +245,7 @@ var FilePicker = ({
|
|
|
245
245
|
image,
|
|
246
246
|
invalid = false,
|
|
247
247
|
locale: localeOverride,
|
|
248
|
-
messages
|
|
248
|
+
messages,
|
|
249
249
|
multiple = false,
|
|
250
250
|
name,
|
|
251
251
|
onBlur,
|
|
@@ -256,7 +256,7 @@ var FilePicker = ({
|
|
|
256
256
|
title
|
|
257
257
|
}) => {
|
|
258
258
|
const locale = useKrakstackLocale(localeOverride);
|
|
259
|
-
const labels = filePickerMessages(locale,
|
|
259
|
+
const labels = filePickerMessages(locale, messages);
|
|
260
260
|
const inputRef = useRef(null);
|
|
261
261
|
const dragDepthRef = useRef(0);
|
|
262
262
|
const [dragging, setDragging] = useState(false);
|