@omnibase/shadcn 0.5.3 → 0.5.4
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/index.cjs +33 -35
- package/dist/index.d.cts +8 -21
- package/dist/index.d.ts +8 -21
- package/dist/index.js +33 -35
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -147,7 +147,7 @@ var alertVariants = (0, import_class_variance_authority.cva)(
|
|
|
147
147
|
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
148
148
|
warning: "border-yellow-500/50 text-yellow-700 bg-yellow-50 dark:border-yellow-500 dark:text-yellow-200 dark:bg-yellow-950/20 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-200",
|
|
149
149
|
success: "border-green-500/50 text-green-700 bg-green-50 dark:border-green-500 dark:text-green-200 dark:bg-green-950/20 [&>svg]:text-green-600 dark:[&>svg]:text-green-200",
|
|
150
|
-
info: "border-blue-500/50 text-blue-
|
|
150
|
+
info: "border-blue-500/50 text-blue-700 bg-blue-50 dark:border-blue-500 dark:text-blue-200 dark:bg-blue-950/20 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-200"
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
defaultVariants: {
|
|
@@ -1086,21 +1086,20 @@ var getCurrencySymbol = (currency) => {
|
|
|
1086
1086
|
};
|
|
1087
1087
|
var formatPrice = (price) => {
|
|
1088
1088
|
const priceUI = price.ui || {};
|
|
1089
|
-
if (priceUI.
|
|
1090
|
-
return priceUI.price_display.custom_text;
|
|
1089
|
+
if (priceUI.priceDisplay?.customText) return priceUI.priceDisplay.customText;
|
|
1091
1090
|
if (!price.amount || price.amount === 0) return "Free";
|
|
1092
1091
|
const amount = price.amount / 100;
|
|
1093
|
-
const currency = price.currency.toUpperCase();
|
|
1094
|
-
let formattedPrice = priceUI.
|
|
1095
|
-
if (priceUI.
|
|
1096
|
-
formattedPrice += ` ${priceUI.
|
|
1092
|
+
const currency = (price.currency || "USD").toUpperCase();
|
|
1093
|
+
let formattedPrice = priceUI.priceDisplay?.showCurrency !== false ? `${getCurrencySymbol(currency)}${amount.toFixed(2)}` : amount.toFixed(2);
|
|
1094
|
+
if (priceUI.priceDisplay?.suffix)
|
|
1095
|
+
formattedPrice += ` ${priceUI.priceDisplay.suffix}`;
|
|
1097
1096
|
return formattedPrice;
|
|
1098
1097
|
};
|
|
1099
1098
|
var formatBillingPeriod = (price) => {
|
|
1100
1099
|
const priceUI = price.ui || {};
|
|
1101
|
-
if (priceUI.
|
|
1100
|
+
if (priceUI.billingPeriod) return priceUI.billingPeriod;
|
|
1102
1101
|
if (price.interval) {
|
|
1103
|
-
const count = price.
|
|
1102
|
+
const count = price.intervalCount || 1;
|
|
1104
1103
|
return `per ${count === 1 ? price.interval : `${count} ${price.interval}s`}`;
|
|
1105
1104
|
}
|
|
1106
1105
|
return "one-time";
|
|
@@ -1135,7 +1134,7 @@ function PricingCard({
|
|
|
1135
1134
|
),
|
|
1136
1135
|
children: [
|
|
1137
1136
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(CardHeader, { className: "text-center", children: [
|
|
1138
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardTitle, { className: "text-xl font-bold", children: ui.
|
|
1137
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardTitle, { className: "text-xl font-bold", children: ui.displayName || product.name }),
|
|
1139
1138
|
ui.tagline && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardDescription, { className: "text-base", children: ui.tagline })
|
|
1140
1139
|
] }),
|
|
1141
1140
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(CardContent, { className: "flex-1 space-y-6", children: [
|
|
@@ -1143,7 +1142,7 @@ function PricingCard({
|
|
|
1143
1142
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "text-3xl font-bold", children: formatPrice(displayedPrice) }),
|
|
1144
1143
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "text-sm text-muted-foreground", children: formatBillingPeriod(displayedPrice) })
|
|
1145
1144
|
] }),
|
|
1146
|
-
(ui.features && ui.features.length > 0 || displayedPrice.ui?.features?.length > 0 || displayedPrice.ui?.limits?.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-4", children: [
|
|
1145
|
+
(ui.features && ui.features.length > 0 || (displayedPrice.ui?.features?.length ?? 0) > 0 || (displayedPrice.ui?.limits?.length ?? 0) > 0) && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-4", children: [
|
|
1147
1146
|
ui.features && ui.features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-2", children: [
|
|
1148
1147
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Features" }),
|
|
1149
1148
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-2", children: ui.features.map((feature, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
@@ -1162,16 +1161,14 @@ function PricingCard({
|
|
|
1162
1161
|
] }),
|
|
1163
1162
|
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-2", children: [
|
|
1164
1163
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Usage Limits" }),
|
|
1165
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-1", children: displayedPrice.ui.limits.map(
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
)
|
|
1174
|
-
) })
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-1", children: displayedPrice.ui.limits.map((limit, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1165
|
+
"li",
|
|
1166
|
+
{
|
|
1167
|
+
className: "text-sm text-muted-foreground",
|
|
1168
|
+
children: limit.text || ""
|
|
1169
|
+
},
|
|
1170
|
+
index
|
|
1171
|
+
)) })
|
|
1175
1172
|
] })
|
|
1176
1173
|
] })
|
|
1177
1174
|
] }),
|
|
@@ -1182,7 +1179,7 @@ function PricingCard({
|
|
|
1182
1179
|
variant: isHighlighted ? "default" : "outline",
|
|
1183
1180
|
size: "lg",
|
|
1184
1181
|
onClick: () => onPriceSelect?.(displayedPrice.id, product.id),
|
|
1185
|
-
children: ui.
|
|
1182
|
+
children: ui.ctaText || "Choose Plan"
|
|
1186
1183
|
}
|
|
1187
1184
|
) })
|
|
1188
1185
|
]
|
|
@@ -1206,7 +1203,7 @@ function PricingTable({
|
|
|
1206
1203
|
const [carouselIndex, setCarouselIndex] = React11.useState(0);
|
|
1207
1204
|
const sortedProducts = React11.useMemo(
|
|
1208
1205
|
() => [...products].sort(
|
|
1209
|
-
(a, b) => (a.ui?.
|
|
1206
|
+
(a, b) => (a.ui?.sortOrder ?? 999) - (b.ui?.sortOrder ?? 999)
|
|
1210
1207
|
),
|
|
1211
1208
|
[products]
|
|
1212
1209
|
);
|
|
@@ -1597,7 +1594,8 @@ function UserInvite({ roles, onInvite }) {
|
|
|
1597
1594
|
try {
|
|
1598
1595
|
const inviteData = {
|
|
1599
1596
|
email: email.trim(),
|
|
1600
|
-
role: selectedRole
|
|
1597
|
+
role: selectedRole,
|
|
1598
|
+
inviteUrl: ""
|
|
1601
1599
|
};
|
|
1602
1600
|
await onInvite?.(inviteData);
|
|
1603
1601
|
setEmail("");
|
|
@@ -1749,12 +1747,12 @@ function RoleCreator({
|
|
|
1749
1747
|
};
|
|
1750
1748
|
}, [definitions]);
|
|
1751
1749
|
const roleSuggestions = (0, import_react3.useMemo)(() => {
|
|
1752
|
-
return roles.map((role) => role.
|
|
1750
|
+
return roles.map((role) => role.roleName);
|
|
1753
1751
|
}, [roles]);
|
|
1754
1752
|
const handleRoleNameChange = (value) => {
|
|
1755
1753
|
setRoleName(value);
|
|
1756
1754
|
const existingRole = roles.find(
|
|
1757
|
-
(role) => role.
|
|
1755
|
+
(role) => role.roleName.toLowerCase() === value.toLowerCase()
|
|
1758
1756
|
);
|
|
1759
1757
|
if (existingRole) {
|
|
1760
1758
|
setIsEditMode(true);
|
|
@@ -2159,7 +2157,7 @@ function UserViewer({
|
|
|
2159
2157
|
if (!searchQuery.trim()) return users;
|
|
2160
2158
|
const query = searchQuery.toLowerCase();
|
|
2161
2159
|
return users.filter(
|
|
2162
|
-
(user) => user.
|
|
2160
|
+
(user) => user.firstName.toLowerCase().includes(query) || user.lastName.toLowerCase().includes(query) || user.email.toLowerCase().includes(query) || user.role.toLowerCase().includes(query)
|
|
2163
2161
|
);
|
|
2164
2162
|
}, [users, searchQuery]);
|
|
2165
2163
|
const handleRoleUpdate = async (userId, newRole) => {
|
|
@@ -2227,12 +2225,12 @@ function UserViewer({
|
|
|
2227
2225
|
] }) }),
|
|
2228
2226
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableBody, { children: filteredUsers.map((user) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(TableRow, { children: [
|
|
2229
2227
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TableCell, { className: "font-medium", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2230
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Avatar, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AvatarFallback, { children: getInitials(user.
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Avatar, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AvatarFallback, { children: getInitials(user.firstName, user.lastName) }) }),
|
|
2231
2229
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
2232
2230
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "font-medium", children: [
|
|
2233
|
-
user.
|
|
2231
|
+
user.firstName,
|
|
2234
2232
|
" ",
|
|
2235
|
-
user.
|
|
2233
|
+
user.lastName
|
|
2236
2234
|
] }),
|
|
2237
2235
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "text-xs text-muted-foreground md:hidden", children: user.email })
|
|
2238
2236
|
] })
|
|
@@ -2242,8 +2240,8 @@ function UserViewer({
|
|
|
2242
2240
|
Select,
|
|
2243
2241
|
{
|
|
2244
2242
|
value: user.role,
|
|
2245
|
-
onValueChange: (newRole) => handleRoleUpdate(user.
|
|
2246
|
-
disabled: isUpdating[user.
|
|
2243
|
+
onValueChange: (newRole) => handleRoleUpdate(user.userId, newRole),
|
|
2244
|
+
disabled: isUpdating[user.userId],
|
|
2247
2245
|
children: [
|
|
2248
2246
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectValue, {}) }),
|
|
2249
2247
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectContent, { children: availableRoles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectItem, { value: role, children: role }, role)) })
|
|
@@ -2255,8 +2253,8 @@ function UserViewer({
|
|
|
2255
2253
|
{
|
|
2256
2254
|
variant: "ghost",
|
|
2257
2255
|
size: "icon",
|
|
2258
|
-
onClick: () => handleRemoveUser(user.
|
|
2259
|
-
disabled: isUpdating[user.
|
|
2256
|
+
onClick: () => handleRemoveUser(user.userId),
|
|
2257
|
+
disabled: isUpdating[user.userId],
|
|
2260
2258
|
className: "h-8 w-8",
|
|
2261
2259
|
children: [
|
|
2262
2260
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react4.UserX, { className: "h-4 w-4" }),
|
|
@@ -2264,7 +2262,7 @@ function UserViewer({
|
|
|
2264
2262
|
]
|
|
2265
2263
|
}
|
|
2266
2264
|
) })
|
|
2267
|
-
] }, user.
|
|
2265
|
+
] }, user.userId)) })
|
|
2268
2266
|
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "text-center py-12 border rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-muted-foreground", children: searchQuery ? "No users found matching your search" : "No users in this organization yet" }) })
|
|
2269
2267
|
] })
|
|
2270
2268
|
] });
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { LoginFlow, RegistrationFlow, VerificationFlow, RecoveryFlow, SettingsFlow, UiNode, UiNodeInputAttributes } from '@ory/client-fetch';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { Product } from '@omnibase/core-js/payments';
|
|
6
|
-
import { NamespaceDefinition, Role } from '@omnibase/core-js';
|
|
4
|
+
import { ModelsTenant, ModelsProduct, TenantsCreateTenantUserInviteRequest, ModelsNamespaceDefinition, ModelsRole, TenantsTenantUserResponse } from '@omnibase/core-js';
|
|
7
5
|
|
|
8
6
|
type LoginFormProps = {
|
|
9
7
|
flow: LoginFlow;
|
|
@@ -55,7 +53,7 @@ declare function groupNodesByGroup(nodes: UiNode[]): Record<string, UiNode[]>;
|
|
|
55
53
|
|
|
56
54
|
interface SwitchActiveTenantProps {
|
|
57
55
|
/** Array of tenants available to the user */
|
|
58
|
-
tenants:
|
|
56
|
+
tenants: ModelsTenant[];
|
|
59
57
|
/** Currently active tenant ID */
|
|
60
58
|
currentTenantId?: string;
|
|
61
59
|
/** Custom form action to handle tenant switching */
|
|
@@ -83,7 +81,7 @@ interface SwitchActiveTenantProps {
|
|
|
83
81
|
declare function SwitchActiveTenant({ tenants, currentTenantId, formAction, placeholder, className, onTenantChange, }: SwitchActiveTenantProps): react_jsx_runtime.JSX.Element;
|
|
84
82
|
|
|
85
83
|
interface PricingTableProps {
|
|
86
|
-
products:
|
|
84
|
+
products: ModelsProduct[];
|
|
87
85
|
selectedPriceId?: string;
|
|
88
86
|
onPriceSelect?: (priceId: string, productId: string) => void;
|
|
89
87
|
className?: string;
|
|
@@ -127,13 +125,9 @@ interface TenantCreatorProps {
|
|
|
127
125
|
}
|
|
128
126
|
declare function TenantCreator({ config, formActions, className, }: TenantCreatorProps): react_jsx_runtime.JSX.Element;
|
|
129
127
|
|
|
130
|
-
interface UserInviteData {
|
|
131
|
-
email: string;
|
|
132
|
-
role: string;
|
|
133
|
-
}
|
|
134
128
|
interface UserInviteProps {
|
|
135
129
|
roles: string[];
|
|
136
|
-
onInvite?: (inviteData:
|
|
130
|
+
onInvite?: (inviteData: TenantsCreateTenantUserInviteRequest) => void | Promise<void>;
|
|
137
131
|
}
|
|
138
132
|
declare function UserInvite({ roles, onInvite }: UserInviteProps): react_jsx_runtime.JSX.Element;
|
|
139
133
|
|
|
@@ -142,8 +136,8 @@ interface NamespaceMapEntry {
|
|
|
142
136
|
label: string;
|
|
143
137
|
}
|
|
144
138
|
interface RoleCreatorProps {
|
|
145
|
-
definitions:
|
|
146
|
-
roles:
|
|
139
|
+
definitions: ModelsNamespaceDefinition[];
|
|
140
|
+
roles: ModelsRole[];
|
|
147
141
|
namespaceMap?: Record<string, NamespaceMapEntry[]>;
|
|
148
142
|
onRoleCreate?: (roleData: {
|
|
149
143
|
role_name: string;
|
|
@@ -157,15 +151,8 @@ interface RoleCreatorProps {
|
|
|
157
151
|
}
|
|
158
152
|
declare function RoleCreator({ definitions, roles, namespaceMap, onRoleCreate, onRoleUpdate, }: RoleCreatorProps): react_jsx_runtime.JSX.Element;
|
|
159
153
|
|
|
160
|
-
interface TenantUser {
|
|
161
|
-
user_id: string;
|
|
162
|
-
first_name: string;
|
|
163
|
-
last_name: string;
|
|
164
|
-
email: string;
|
|
165
|
-
role: string;
|
|
166
|
-
}
|
|
167
154
|
interface UserViewerProps {
|
|
168
|
-
users:
|
|
155
|
+
users: TenantsTenantUserResponse[];
|
|
169
156
|
availableRoles: string[];
|
|
170
157
|
canEditUsers: boolean;
|
|
171
158
|
onRoleUpdate?: (userId: string, newRole: string) => void | Promise<void>;
|
|
@@ -173,4 +160,4 @@ interface UserViewerProps {
|
|
|
173
160
|
}
|
|
174
161
|
declare function UserViewer({ users, availableRoles, canEditUsers, onRoleUpdate, onRemoveUser, }: UserViewerProps): react_jsx_runtime.JSX.Element;
|
|
175
162
|
|
|
176
|
-
export { type CustomFormProps, type FlowType, LoginForm, type LoginFormProps, type NodesByGroup, PricingTable, type PricingTableProps, RecoveryForm, type RecoveryFormProps, RegistrationForm, type RegistrationFormProps, RoleCreator, SettingsForm, type SettingsFormProps, SwitchActiveTenant, type SwitchActiveTenantProps, TenantCreator, type TenantCreatorConfig, type TenantCreatorFormActions, type TenantCreatorProps,
|
|
163
|
+
export { type CustomFormProps, type FlowType, LoginForm, type LoginFormProps, type NodesByGroup, PricingTable, type PricingTableProps, RecoveryForm, type RecoveryFormProps, RegistrationForm, type RegistrationFormProps, RoleCreator, SettingsForm, type SettingsFormProps, SwitchActiveTenant, type SwitchActiveTenantProps, TenantCreator, type TenantCreatorConfig, type TenantCreatorFormActions, type TenantCreatorProps, UserInvite, UserViewer, VerificationForm, type VerificationFormProps, filterInputNodes, findAnchorNode, findCsrfToken, findSubmitButton, groupNodesByGroup, isUiNodeInputAttributes, sortNodes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { LoginFlow, RegistrationFlow, VerificationFlow, RecoveryFlow, SettingsFlow, UiNode, UiNodeInputAttributes } from '@ory/client-fetch';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { Product } from '@omnibase/core-js/payments';
|
|
6
|
-
import { NamespaceDefinition, Role } from '@omnibase/core-js';
|
|
4
|
+
import { ModelsTenant, ModelsProduct, TenantsCreateTenantUserInviteRequest, ModelsNamespaceDefinition, ModelsRole, TenantsTenantUserResponse } from '@omnibase/core-js';
|
|
7
5
|
|
|
8
6
|
type LoginFormProps = {
|
|
9
7
|
flow: LoginFlow;
|
|
@@ -55,7 +53,7 @@ declare function groupNodesByGroup(nodes: UiNode[]): Record<string, UiNode[]>;
|
|
|
55
53
|
|
|
56
54
|
interface SwitchActiveTenantProps {
|
|
57
55
|
/** Array of tenants available to the user */
|
|
58
|
-
tenants:
|
|
56
|
+
tenants: ModelsTenant[];
|
|
59
57
|
/** Currently active tenant ID */
|
|
60
58
|
currentTenantId?: string;
|
|
61
59
|
/** Custom form action to handle tenant switching */
|
|
@@ -83,7 +81,7 @@ interface SwitchActiveTenantProps {
|
|
|
83
81
|
declare function SwitchActiveTenant({ tenants, currentTenantId, formAction, placeholder, className, onTenantChange, }: SwitchActiveTenantProps): react_jsx_runtime.JSX.Element;
|
|
84
82
|
|
|
85
83
|
interface PricingTableProps {
|
|
86
|
-
products:
|
|
84
|
+
products: ModelsProduct[];
|
|
87
85
|
selectedPriceId?: string;
|
|
88
86
|
onPriceSelect?: (priceId: string, productId: string) => void;
|
|
89
87
|
className?: string;
|
|
@@ -127,13 +125,9 @@ interface TenantCreatorProps {
|
|
|
127
125
|
}
|
|
128
126
|
declare function TenantCreator({ config, formActions, className, }: TenantCreatorProps): react_jsx_runtime.JSX.Element;
|
|
129
127
|
|
|
130
|
-
interface UserInviteData {
|
|
131
|
-
email: string;
|
|
132
|
-
role: string;
|
|
133
|
-
}
|
|
134
128
|
interface UserInviteProps {
|
|
135
129
|
roles: string[];
|
|
136
|
-
onInvite?: (inviteData:
|
|
130
|
+
onInvite?: (inviteData: TenantsCreateTenantUserInviteRequest) => void | Promise<void>;
|
|
137
131
|
}
|
|
138
132
|
declare function UserInvite({ roles, onInvite }: UserInviteProps): react_jsx_runtime.JSX.Element;
|
|
139
133
|
|
|
@@ -142,8 +136,8 @@ interface NamespaceMapEntry {
|
|
|
142
136
|
label: string;
|
|
143
137
|
}
|
|
144
138
|
interface RoleCreatorProps {
|
|
145
|
-
definitions:
|
|
146
|
-
roles:
|
|
139
|
+
definitions: ModelsNamespaceDefinition[];
|
|
140
|
+
roles: ModelsRole[];
|
|
147
141
|
namespaceMap?: Record<string, NamespaceMapEntry[]>;
|
|
148
142
|
onRoleCreate?: (roleData: {
|
|
149
143
|
role_name: string;
|
|
@@ -157,15 +151,8 @@ interface RoleCreatorProps {
|
|
|
157
151
|
}
|
|
158
152
|
declare function RoleCreator({ definitions, roles, namespaceMap, onRoleCreate, onRoleUpdate, }: RoleCreatorProps): react_jsx_runtime.JSX.Element;
|
|
159
153
|
|
|
160
|
-
interface TenantUser {
|
|
161
|
-
user_id: string;
|
|
162
|
-
first_name: string;
|
|
163
|
-
last_name: string;
|
|
164
|
-
email: string;
|
|
165
|
-
role: string;
|
|
166
|
-
}
|
|
167
154
|
interface UserViewerProps {
|
|
168
|
-
users:
|
|
155
|
+
users: TenantsTenantUserResponse[];
|
|
169
156
|
availableRoles: string[];
|
|
170
157
|
canEditUsers: boolean;
|
|
171
158
|
onRoleUpdate?: (userId: string, newRole: string) => void | Promise<void>;
|
|
@@ -173,4 +160,4 @@ interface UserViewerProps {
|
|
|
173
160
|
}
|
|
174
161
|
declare function UserViewer({ users, availableRoles, canEditUsers, onRoleUpdate, onRemoveUser, }: UserViewerProps): react_jsx_runtime.JSX.Element;
|
|
175
162
|
|
|
176
|
-
export { type CustomFormProps, type FlowType, LoginForm, type LoginFormProps, type NodesByGroup, PricingTable, type PricingTableProps, RecoveryForm, type RecoveryFormProps, RegistrationForm, type RegistrationFormProps, RoleCreator, SettingsForm, type SettingsFormProps, SwitchActiveTenant, type SwitchActiveTenantProps, TenantCreator, type TenantCreatorConfig, type TenantCreatorFormActions, type TenantCreatorProps,
|
|
163
|
+
export { type CustomFormProps, type FlowType, LoginForm, type LoginFormProps, type NodesByGroup, PricingTable, type PricingTableProps, RecoveryForm, type RecoveryFormProps, RegistrationForm, type RegistrationFormProps, RoleCreator, SettingsForm, type SettingsFormProps, SwitchActiveTenant, type SwitchActiveTenantProps, TenantCreator, type TenantCreatorConfig, type TenantCreatorFormActions, type TenantCreatorProps, UserInvite, UserViewer, VerificationForm, type VerificationFormProps, filterInputNodes, findAnchorNode, findCsrfToken, findSubmitButton, groupNodesByGroup, isUiNodeInputAttributes, sortNodes };
|
package/dist/index.js
CHANGED
|
@@ -95,7 +95,7 @@ var alertVariants = cva(
|
|
|
95
95
|
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
96
96
|
warning: "border-yellow-500/50 text-yellow-700 bg-yellow-50 dark:border-yellow-500 dark:text-yellow-200 dark:bg-yellow-950/20 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-200",
|
|
97
97
|
success: "border-green-500/50 text-green-700 bg-green-50 dark:border-green-500 dark:text-green-200 dark:bg-green-950/20 [&>svg]:text-green-600 dark:[&>svg]:text-green-200",
|
|
98
|
-
info: "border-blue-500/50 text-blue-
|
|
98
|
+
info: "border-blue-500/50 text-blue-700 bg-blue-50 dark:border-blue-500 dark:text-blue-200 dark:bg-blue-950/20 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-200"
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
defaultVariants: {
|
|
@@ -1034,21 +1034,20 @@ var getCurrencySymbol = (currency) => {
|
|
|
1034
1034
|
};
|
|
1035
1035
|
var formatPrice = (price) => {
|
|
1036
1036
|
const priceUI = price.ui || {};
|
|
1037
|
-
if (priceUI.
|
|
1038
|
-
return priceUI.price_display.custom_text;
|
|
1037
|
+
if (priceUI.priceDisplay?.customText) return priceUI.priceDisplay.customText;
|
|
1039
1038
|
if (!price.amount || price.amount === 0) return "Free";
|
|
1040
1039
|
const amount = price.amount / 100;
|
|
1041
|
-
const currency = price.currency.toUpperCase();
|
|
1042
|
-
let formattedPrice = priceUI.
|
|
1043
|
-
if (priceUI.
|
|
1044
|
-
formattedPrice += ` ${priceUI.
|
|
1040
|
+
const currency = (price.currency || "USD").toUpperCase();
|
|
1041
|
+
let formattedPrice = priceUI.priceDisplay?.showCurrency !== false ? `${getCurrencySymbol(currency)}${amount.toFixed(2)}` : amount.toFixed(2);
|
|
1042
|
+
if (priceUI.priceDisplay?.suffix)
|
|
1043
|
+
formattedPrice += ` ${priceUI.priceDisplay.suffix}`;
|
|
1045
1044
|
return formattedPrice;
|
|
1046
1045
|
};
|
|
1047
1046
|
var formatBillingPeriod = (price) => {
|
|
1048
1047
|
const priceUI = price.ui || {};
|
|
1049
|
-
if (priceUI.
|
|
1048
|
+
if (priceUI.billingPeriod) return priceUI.billingPeriod;
|
|
1050
1049
|
if (price.interval) {
|
|
1051
|
-
const count = price.
|
|
1050
|
+
const count = price.intervalCount || 1;
|
|
1052
1051
|
return `per ${count === 1 ? price.interval : `${count} ${price.interval}s`}`;
|
|
1053
1052
|
}
|
|
1054
1053
|
return "one-time";
|
|
@@ -1083,7 +1082,7 @@ function PricingCard({
|
|
|
1083
1082
|
),
|
|
1084
1083
|
children: [
|
|
1085
1084
|
/* @__PURE__ */ jsxs12(CardHeader, { className: "text-center", children: [
|
|
1086
|
-
/* @__PURE__ */ jsx21(CardTitle, { className: "text-xl font-bold", children: ui.
|
|
1085
|
+
/* @__PURE__ */ jsx21(CardTitle, { className: "text-xl font-bold", children: ui.displayName || product.name }),
|
|
1087
1086
|
ui.tagline && /* @__PURE__ */ jsx21(CardDescription, { className: "text-base", children: ui.tagline })
|
|
1088
1087
|
] }),
|
|
1089
1088
|
/* @__PURE__ */ jsxs12(CardContent, { className: "flex-1 space-y-6", children: [
|
|
@@ -1091,7 +1090,7 @@ function PricingCard({
|
|
|
1091
1090
|
/* @__PURE__ */ jsx21("div", { className: "text-3xl font-bold", children: formatPrice(displayedPrice) }),
|
|
1092
1091
|
/* @__PURE__ */ jsx21("div", { className: "text-sm text-muted-foreground", children: formatBillingPeriod(displayedPrice) })
|
|
1093
1092
|
] }),
|
|
1094
|
-
(ui.features && ui.features.length > 0 || displayedPrice.ui?.features?.length > 0 || displayedPrice.ui?.limits?.length > 0) && /* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
|
|
1093
|
+
(ui.features && ui.features.length > 0 || (displayedPrice.ui?.features?.length ?? 0) > 0 || (displayedPrice.ui?.limits?.length ?? 0) > 0) && /* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
|
|
1095
1094
|
ui.features && ui.features.length > 0 && /* @__PURE__ */ jsxs12("div", { className: "space-y-2", children: [
|
|
1096
1095
|
/* @__PURE__ */ jsx21("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Features" }),
|
|
1097
1096
|
/* @__PURE__ */ jsx21("ul", { className: "space-y-2", children: ui.features.map((feature, index) => /* @__PURE__ */ jsxs12("li", { className: "flex items-start gap-2", children: [
|
|
@@ -1110,16 +1109,14 @@ function PricingCard({
|
|
|
1110
1109
|
] }),
|
|
1111
1110
|
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */ jsxs12("div", { className: "space-y-2", children: [
|
|
1112
1111
|
/* @__PURE__ */ jsx21("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Usage Limits" }),
|
|
1113
|
-
/* @__PURE__ */ jsx21("ul", { className: "space-y-1", children: displayedPrice.ui.limits.map(
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
)
|
|
1122
|
-
) })
|
|
1112
|
+
/* @__PURE__ */ jsx21("ul", { className: "space-y-1", children: displayedPrice.ui.limits.map((limit, index) => /* @__PURE__ */ jsx21(
|
|
1113
|
+
"li",
|
|
1114
|
+
{
|
|
1115
|
+
className: "text-sm text-muted-foreground",
|
|
1116
|
+
children: limit.text || ""
|
|
1117
|
+
},
|
|
1118
|
+
index
|
|
1119
|
+
)) })
|
|
1123
1120
|
] })
|
|
1124
1121
|
] })
|
|
1125
1122
|
] }),
|
|
@@ -1130,7 +1127,7 @@ function PricingCard({
|
|
|
1130
1127
|
variant: isHighlighted ? "default" : "outline",
|
|
1131
1128
|
size: "lg",
|
|
1132
1129
|
onClick: () => onPriceSelect?.(displayedPrice.id, product.id),
|
|
1133
|
-
children: ui.
|
|
1130
|
+
children: ui.ctaText || "Choose Plan"
|
|
1134
1131
|
}
|
|
1135
1132
|
) })
|
|
1136
1133
|
]
|
|
@@ -1154,7 +1151,7 @@ function PricingTable({
|
|
|
1154
1151
|
const [carouselIndex, setCarouselIndex] = React11.useState(0);
|
|
1155
1152
|
const sortedProducts = React11.useMemo(
|
|
1156
1153
|
() => [...products].sort(
|
|
1157
|
-
(a, b) => (a.ui?.
|
|
1154
|
+
(a, b) => (a.ui?.sortOrder ?? 999) - (b.ui?.sortOrder ?? 999)
|
|
1158
1155
|
),
|
|
1159
1156
|
[products]
|
|
1160
1157
|
);
|
|
@@ -1545,7 +1542,8 @@ function UserInvite({ roles, onInvite }) {
|
|
|
1545
1542
|
try {
|
|
1546
1543
|
const inviteData = {
|
|
1547
1544
|
email: email.trim(),
|
|
1548
|
-
role: selectedRole
|
|
1545
|
+
role: selectedRole,
|
|
1546
|
+
inviteUrl: ""
|
|
1549
1547
|
};
|
|
1550
1548
|
await onInvite?.(inviteData);
|
|
1551
1549
|
setEmail("");
|
|
@@ -1697,12 +1695,12 @@ function RoleCreator({
|
|
|
1697
1695
|
};
|
|
1698
1696
|
}, [definitions]);
|
|
1699
1697
|
const roleSuggestions = useMemo2(() => {
|
|
1700
|
-
return roles.map((role) => role.
|
|
1698
|
+
return roles.map((role) => role.roleName);
|
|
1701
1699
|
}, [roles]);
|
|
1702
1700
|
const handleRoleNameChange = (value) => {
|
|
1703
1701
|
setRoleName(value);
|
|
1704
1702
|
const existingRole = roles.find(
|
|
1705
|
-
(role) => role.
|
|
1703
|
+
(role) => role.roleName.toLowerCase() === value.toLowerCase()
|
|
1706
1704
|
);
|
|
1707
1705
|
if (existingRole) {
|
|
1708
1706
|
setIsEditMode(true);
|
|
@@ -2107,7 +2105,7 @@ function UserViewer({
|
|
|
2107
2105
|
if (!searchQuery.trim()) return users;
|
|
2108
2106
|
const query = searchQuery.toLowerCase();
|
|
2109
2107
|
return users.filter(
|
|
2110
|
-
(user) => user.
|
|
2108
|
+
(user) => user.firstName.toLowerCase().includes(query) || user.lastName.toLowerCase().includes(query) || user.email.toLowerCase().includes(query) || user.role.toLowerCase().includes(query)
|
|
2111
2109
|
);
|
|
2112
2110
|
}, [users, searchQuery]);
|
|
2113
2111
|
const handleRoleUpdate = async (userId, newRole) => {
|
|
@@ -2175,12 +2173,12 @@ function UserViewer({
|
|
|
2175
2173
|
] }) }),
|
|
2176
2174
|
/* @__PURE__ */ jsx29(TableBody, { children: filteredUsers.map((user) => /* @__PURE__ */ jsxs16(TableRow, { children: [
|
|
2177
2175
|
/* @__PURE__ */ jsx29(TableCell, { className: "font-medium", children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3", children: [
|
|
2178
|
-
/* @__PURE__ */ jsx29(Avatar, { children: /* @__PURE__ */ jsx29(AvatarFallback, { children: getInitials(user.
|
|
2176
|
+
/* @__PURE__ */ jsx29(Avatar, { children: /* @__PURE__ */ jsx29(AvatarFallback, { children: getInitials(user.firstName, user.lastName) }) }),
|
|
2179
2177
|
/* @__PURE__ */ jsxs16("div", { children: [
|
|
2180
2178
|
/* @__PURE__ */ jsxs16("div", { className: "font-medium", children: [
|
|
2181
|
-
user.
|
|
2179
|
+
user.firstName,
|
|
2182
2180
|
" ",
|
|
2183
|
-
user.
|
|
2181
|
+
user.lastName
|
|
2184
2182
|
] }),
|
|
2185
2183
|
/* @__PURE__ */ jsx29("div", { className: "text-xs text-muted-foreground md:hidden", children: user.email })
|
|
2186
2184
|
] })
|
|
@@ -2190,8 +2188,8 @@ function UserViewer({
|
|
|
2190
2188
|
Select,
|
|
2191
2189
|
{
|
|
2192
2190
|
value: user.role,
|
|
2193
|
-
onValueChange: (newRole) => handleRoleUpdate(user.
|
|
2194
|
-
disabled: isUpdating[user.
|
|
2191
|
+
onValueChange: (newRole) => handleRoleUpdate(user.userId, newRole),
|
|
2192
|
+
disabled: isUpdating[user.userId],
|
|
2195
2193
|
children: [
|
|
2196
2194
|
/* @__PURE__ */ jsx29(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx29(SelectValue, {}) }),
|
|
2197
2195
|
/* @__PURE__ */ jsx29(SelectContent, { children: availableRoles.map((role) => /* @__PURE__ */ jsx29(SelectItem, { value: role, children: role }, role)) })
|
|
@@ -2203,8 +2201,8 @@ function UserViewer({
|
|
|
2203
2201
|
{
|
|
2204
2202
|
variant: "ghost",
|
|
2205
2203
|
size: "icon",
|
|
2206
|
-
onClick: () => handleRemoveUser(user.
|
|
2207
|
-
disabled: isUpdating[user.
|
|
2204
|
+
onClick: () => handleRemoveUser(user.userId),
|
|
2205
|
+
disabled: isUpdating[user.userId],
|
|
2208
2206
|
className: "h-8 w-8",
|
|
2209
2207
|
children: [
|
|
2210
2208
|
/* @__PURE__ */ jsx29(UserX, { className: "h-4 w-4" }),
|
|
@@ -2212,7 +2210,7 @@ function UserViewer({
|
|
|
2212
2210
|
]
|
|
2213
2211
|
}
|
|
2214
2212
|
) })
|
|
2215
|
-
] }, user.
|
|
2213
|
+
] }, user.userId)) })
|
|
2216
2214
|
] }) }) : /* @__PURE__ */ jsx29("div", { className: "text-center py-12 border rounded-lg", children: /* @__PURE__ */ jsx29("p", { className: "text-muted-foreground", children: searchQuery ? "No users found matching your search" : "No users in this organization yet" }) })
|
|
2217
2215
|
] })
|
|
2218
2216
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnibase/shadcn",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "OmniBase ShadCN UI Package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"react-dom": "^19.1.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@
|
|
39
|
+
"@omnibase/core-js": "^0.9.4",
|
|
40
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
40
41
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
41
|
-
"@radix-ui/react-label": "^2.1.
|
|
42
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
42
43
|
"@radix-ui/react-select": "^2.2.6",
|
|
43
|
-
"@radix-ui/react-separator": "^1.1.
|
|
44
|
-
"@radix-ui/react-slot": "^1.2.
|
|
45
|
-
"@types/node": "^24.
|
|
44
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
45
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
46
|
+
"@types/node": "^24.10.0",
|
|
46
47
|
"class-variance-authority": "^0.7.1",
|
|
47
48
|
"clsx": "^2.1.1",
|
|
48
49
|
"lucide-react": "^0.544.0",
|
|
49
50
|
"tailwind-merge": "^2.6.0"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"@storybook/
|
|
54
|
-
"@storybook/react-vite": "^9.1.15",
|
|
53
|
+
"@storybook/addon-docs": "^9.1.16",
|
|
54
|
+
"@storybook/react-vite": "^9.1.16",
|
|
55
55
|
"@tailwindcss/vite": "^4.1.16",
|
|
56
56
|
"@types/react": "^19.2.2",
|
|
57
57
|
"@types/react-dom": "^19.2.2",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"autoprefixer": "^10.4.21",
|
|
63
63
|
"eslint": "^8.57.1",
|
|
64
64
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
65
|
-
"eslint-plugin-storybook": "^9.1.
|
|
65
|
+
"eslint-plugin-storybook": "^9.1.16",
|
|
66
66
|
"react": "^19.2.0",
|
|
67
67
|
"react-dom": "^19.2.0",
|
|
68
|
-
"storybook": "^9.1.
|
|
68
|
+
"storybook": "^9.1.16",
|
|
69
69
|
"tailwindcss": "^4.1.16",
|
|
70
70
|
"tsup": "^8.5.0",
|
|
71
71
|
"typescript": "^5.9.3",
|
|
72
|
-
"vite": "^7.1
|
|
72
|
+
"vite": "^7.2.1",
|
|
73
73
|
"vite-plugin-dts": "^4.5.4"
|
|
74
74
|
}
|
|
75
75
|
}
|