@voyantjs/pricing-ui 0.33.0 → 0.34.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/README.md
CHANGED
|
@@ -18,6 +18,10 @@ pnpm add @voyantjs/pricing-ui @voyantjs/pricing-react @voyantjs/ui @tanstack/rea
|
|
|
18
18
|
|
|
19
19
|
All components accept a `className` prop and merge it with `cn()`. Wrap or compose to extend; use the registry copy-paste path (`npx shadcn add @voyant/...`) for components you want to fork outright.
|
|
20
20
|
|
|
21
|
+
Page components render with `p-6` outer padding by default and are intended to
|
|
22
|
+
mount directly into an app route outlet. Pass `className` to extend or override
|
|
23
|
+
that spacing when a shell owns the page chrome.
|
|
24
|
+
|
|
21
25
|
## I18n
|
|
22
26
|
|
|
23
27
|
Components render English by default. To localize them, wrap your UI in
|
|
@@ -47,7 +47,7 @@ export function PriceCatalogsPage({ pageSize = DEFAULT_PAGE_SIZE, className, } =
|
|
|
47
47
|
const catalogs = data?.data ?? [];
|
|
48
48
|
const total = data?.total ?? 0;
|
|
49
49
|
const pageCount = Math.max(1, Math.ceil(total / pageSize));
|
|
50
|
-
return (_jsxs("div", { "data-slot": "price-catalogs-page", className: cn("flex flex-col gap-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: () => {
|
|
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
53
|
}, children: [_jsx(Plus, { className: "mr-1.5 size-3.5" }), pageMessages.addCatalog] })] }), isPending ? (_jsx(PriceCatalogsListLoading, { loadingLabel: messages.common.loading })) : (_jsx("div", { className: "rounded-lg 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: () => {
|
|
@@ -5,5 +5,5 @@ import { usePricingUiMessagesOrDefault } from "../i18n/index.js";
|
|
|
5
5
|
import { PricingCategoryList } from "./pricing-category-list.js";
|
|
6
6
|
export function PricingCategoriesPage({ pageSize, className } = {}) {
|
|
7
7
|
const messages = usePricingUiMessagesOrDefault().pricingCategoriesPage;
|
|
8
|
-
return (_jsxs("div", { "data-slot": "pricing-categories-page", className: cn("flex flex-col gap-6", className), children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold tracking-tight", children: messages.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.description })] }), _jsx(PricingCategoryList, { pageSize: pageSize })] }));
|
|
8
|
+
return (_jsxs("div", { "data-slot": "pricing-categories-page", className: cn("flex flex-col gap-6 p-6", className), children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold tracking-tight", children: messages.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.description })] }), _jsx(PricingCategoryList, { pageSize: pageSize })] }));
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/pricing-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"react-dom": "^19.0.0",
|
|
47
47
|
"react-hook-form": "^7.60.0",
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@voyantjs/pricing-react": "0.
|
|
50
|
-
"@voyantjs/products-react": "0.
|
|
51
|
-
"@voyantjs/ui": "0.
|
|
52
|
-
"@voyantjs/utils": "0.
|
|
49
|
+
"@voyantjs/pricing-react": "0.34.0",
|
|
50
|
+
"@voyantjs/products-react": "0.34.0",
|
|
51
|
+
"@voyantjs/ui": "0.34.0",
|
|
52
|
+
"@voyantjs/utils": "0.34.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@voyantjs/i18n": "0.
|
|
55
|
+
"@voyantjs/i18n": "0.34.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"typescript": "^6.0.2",
|
|
67
67
|
"vitest": "^4.1.2",
|
|
68
68
|
"zod": "^4.3.6",
|
|
69
|
-
"@voyantjs/i18n": "0.
|
|
70
|
-
"@voyantjs/pricing-react": "0.
|
|
71
|
-
"@voyantjs/products-react": "0.
|
|
69
|
+
"@voyantjs/i18n": "0.34.0",
|
|
70
|
+
"@voyantjs/pricing-react": "0.34.0",
|
|
71
|
+
"@voyantjs/products-react": "0.34.0",
|
|
72
72
|
"@voyantjs/voyant-typescript-config": "0.1.0",
|
|
73
|
-
"@voyantjs/ui": "0.
|
|
74
|
-
"@voyantjs/utils": "0.
|
|
73
|
+
"@voyantjs/ui": "0.34.0",
|
|
74
|
+
"@voyantjs/utils": "0.34.0"
|
|
75
75
|
},
|
|
76
76
|
"files": [
|
|
77
77
|
"dist",
|