@voyant-travel/commerce-react 0.4.0 → 0.6.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.
|
@@ -50,7 +50,7 @@ export function PriceCatalogsPage({ pageSize = DEFAULT_PAGE_SIZE, className, } =
|
|
|
50
50
|
return (_jsxs("div", { "data-slot": "price-catalogs-page", className: cn("flex flex-col gap-6 p-6", className), children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold tracking-tight", children: pageMessages.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: pageMessages.description })] }), _jsxs(Button, { size: "sm", onClick: () => {
|
|
51
51
|
setEditing(undefined);
|
|
52
52
|
setSheetOpen(true);
|
|
53
|
-
}, children: [_jsx(Plus, { className: "mr-1.5 size-3.5" }), pageMessages.addCatalog] })] }), isPending ? (_jsx(PriceCatalogsListLoading, { loadingLabel: messages.common.loading })) : (_jsx("div", { className: "rounded-
|
|
53
|
+
}, children: [_jsx(Plus, { className: "mr-1.5 size-3.5" }), pageMessages.addCatalog] })] }), isPending ? (_jsx(PriceCatalogsListLoading, { loadingLabel: messages.common.loading })) : (_jsx("div", { className: "rounded-md border bg-card text-card-foreground shadow-sm", children: catalogs.length === 0 ? (_jsx("p", { className: "py-12 text-center text-sm text-muted-foreground", children: pageMessages.empty })) : (_jsx("div", { className: "flex flex-col divide-y", children: catalogs.map((catalog) => (_jsxs("div", { className: "flex items-center justify-between gap-4 px-6 py-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-sm font-medium", children: catalog.name }), _jsx("span", { className: "font-mono text-xs text-muted-foreground", children: catalog.code }), _jsx(Badge, { variant: "outline", className: "text-xs", children: catalog.currencyCode ?? messages.common.none }), _jsx(Badge, { variant: "outline", className: "text-xs", children: pageMessages.catalogTypeLabels[catalog.catalogType] }), catalog.isDefault ? (_jsx(Badge, { variant: "default", className: "text-xs", children: pageMessages.default })) : null, !catalog.active ? (_jsx(Badge, { variant: "secondary", className: "text-xs", children: messages.common.inactive })) : null] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", className: "size-8 text-muted-foreground", children: _jsx(MoreHorizontal, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsxs(DropdownMenuItem, { onClick: () => {
|
|
54
54
|
setEditing(catalog);
|
|
55
55
|
setSheetOpen(true);
|
|
56
56
|
}, children: [_jsx(Pencil, { className: "size-4" }), pageMessages.edit] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { variant: "destructive", onClick: () => {
|
|
@@ -66,7 +66,7 @@ export function PriceCatalogsPage({ pageSize = DEFAULT_PAGE_SIZE, className, } =
|
|
|
66
66
|
} })] }));
|
|
67
67
|
}
|
|
68
68
|
function PriceCatalogsListLoading({ loadingLabel }) {
|
|
69
|
-
return (_jsx("div", { className: "rounded-
|
|
69
|
+
return (_jsx("div", { className: "rounded-md border bg-card text-card-foreground shadow-sm", children: _jsxs("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "mr-2 size-4 animate-spin" }), loadingLabel] }) }));
|
|
70
70
|
}
|
|
71
71
|
function CurrencyCombobox({ value, onChange, emptyLabel, inputPlaceholder, }) {
|
|
72
72
|
return (_jsxs(Combobox, { items: CURRENCY_OPTIONS, value: value, onValueChange: (next) => onChange(String(next ?? "")), children: [_jsx(ComboboxInput, { placeholder: inputPlaceholder }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: emptyLabel }), _jsx(ComboboxList, { children: CURRENCY_OPTIONS.map((option) => (_jsx(ComboboxItem, { value: option.value, children: option.label }, option.value))) })] })] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/commerce-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -235,11 +235,11 @@
|
|
|
235
235
|
"react-dom": "^19.0.0",
|
|
236
236
|
"react-hook-form": "^7.60.0",
|
|
237
237
|
"zod": "^4.0.0",
|
|
238
|
-
"@voyant-travel/
|
|
239
|
-
"@voyant-travel/
|
|
240
|
-
"@voyant-travel/
|
|
241
|
-
"@voyant-travel/
|
|
242
|
-
"@voyant-travel/
|
|
238
|
+
"@voyant-travel/admin": "^0.113.0",
|
|
239
|
+
"@voyant-travel/commerce": "^0.6.0",
|
|
240
|
+
"@voyant-travel/distribution-react": "^0.114.0",
|
|
241
|
+
"@voyant-travel/inventory-react": "^0.6.0",
|
|
242
|
+
"@voyant-travel/ui": "^0.107.0"
|
|
243
243
|
},
|
|
244
244
|
"peerDependenciesMeta": {
|
|
245
245
|
"@voyant-travel/admin": {
|
|
@@ -274,13 +274,13 @@
|
|
|
274
274
|
"typescript": "^6.0.2",
|
|
275
275
|
"vitest": "^4.1.2",
|
|
276
276
|
"zod": "^4.3.6",
|
|
277
|
-
"@voyant-travel/admin": "^0.
|
|
278
|
-
"@voyant-travel/commerce": "^0.
|
|
279
|
-
"@voyant-travel/distribution-react": "^0.
|
|
277
|
+
"@voyant-travel/admin": "^0.113.0",
|
|
278
|
+
"@voyant-travel/commerce": "^0.6.0",
|
|
279
|
+
"@voyant-travel/distribution-react": "^0.114.0",
|
|
280
280
|
"@voyant-travel/i18n": "^0.106.1",
|
|
281
|
-
"@voyant-travel/inventory-react": "^0.
|
|
281
|
+
"@voyant-travel/inventory-react": "^0.6.0",
|
|
282
282
|
"@voyant-travel/react": "^0.104.1",
|
|
283
|
-
"@voyant-travel/ui": "^0.
|
|
283
|
+
"@voyant-travel/ui": "^0.107.0",
|
|
284
284
|
"@voyant-travel/utils": "^0.105.2",
|
|
285
285
|
"@voyant-travel/voyant-typescript-config": "^0.1.0"
|
|
286
286
|
},
|