@omnibase/shadcn 0.1.2 → 0.3.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/index.cjs +318 -158
- package/dist/index.js +303 -143
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -204,101 +204,261 @@ function Label({
|
|
|
204
204
|
);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
// src/
|
|
207
|
+
// src/components/ui/messages.tsx
|
|
208
|
+
var React6 = __toESM(require("react"), 1);
|
|
209
|
+
|
|
210
|
+
// src/components/ui/alert.tsx
|
|
211
|
+
var React5 = __toESM(require("react"), 1);
|
|
212
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
208
213
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
214
|
+
var alertVariants = (0, import_class_variance_authority2.cva)(
|
|
215
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
216
|
+
{
|
|
217
|
+
variants: {
|
|
218
|
+
variant: {
|
|
219
|
+
default: "bg-background text-foreground",
|
|
220
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
221
|
+
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",
|
|
222
|
+
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",
|
|
223
|
+
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"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
defaultVariants: {
|
|
227
|
+
variant: "default"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
var Alert = React5.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
232
|
+
"div",
|
|
233
|
+
{
|
|
234
|
+
ref,
|
|
235
|
+
role: "alert",
|
|
236
|
+
className: cn(alertVariants({ variant }), className),
|
|
237
|
+
...props
|
|
238
|
+
}
|
|
239
|
+
));
|
|
240
|
+
Alert.displayName = "Alert";
|
|
241
|
+
var AlertTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
242
|
+
"h5",
|
|
243
|
+
{
|
|
244
|
+
ref,
|
|
245
|
+
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
246
|
+
...props
|
|
247
|
+
}
|
|
248
|
+
));
|
|
249
|
+
AlertTitle.displayName = "AlertTitle";
|
|
250
|
+
var AlertDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
ref,
|
|
254
|
+
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
255
|
+
...props
|
|
256
|
+
}
|
|
257
|
+
));
|
|
258
|
+
AlertDescription.displayName = "AlertDescription";
|
|
259
|
+
|
|
260
|
+
// src/components/ui/messages.tsx
|
|
261
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
262
|
+
var getMessageVariant = (type) => {
|
|
263
|
+
switch (type) {
|
|
264
|
+
case "error":
|
|
265
|
+
return "destructive";
|
|
266
|
+
case "success":
|
|
267
|
+
return "success";
|
|
268
|
+
case "info":
|
|
269
|
+
return "info";
|
|
270
|
+
case "11184809":
|
|
271
|
+
return "warning";
|
|
272
|
+
default:
|
|
273
|
+
return "default";
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
var Messages = React6.forwardRef(
|
|
277
|
+
({ flow, className, ...props }, ref) => {
|
|
278
|
+
if (!flow?.ui) return null;
|
|
279
|
+
const allMessages = [];
|
|
280
|
+
if (flow.ui.messages) {
|
|
281
|
+
allMessages.push(...flow.ui.messages);
|
|
282
|
+
}
|
|
283
|
+
if (flow.ui.nodes) {
|
|
284
|
+
flow.ui.nodes.forEach((node) => {
|
|
285
|
+
if (node.messages) {
|
|
286
|
+
allMessages.push(...node.messages);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (allMessages.length === 0) return null;
|
|
291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
292
|
+
"div",
|
|
293
|
+
{
|
|
294
|
+
ref,
|
|
295
|
+
className: cn("w-full max-w-md mx-auto space-y-2 mb-4", className),
|
|
296
|
+
...props,
|
|
297
|
+
children: allMessages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Alert, { variant: getMessageVariant(message.type), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AlertDescription, { children: message.text }) }, message.id))
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
Messages.displayName = "Messages";
|
|
303
|
+
|
|
304
|
+
// src/form/index.tsx
|
|
305
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
209
306
|
function isUiNodeInputAttributes(attributes) {
|
|
210
307
|
return attributes && typeof attributes === "object" && "name" in attributes && "type" in attributes;
|
|
211
308
|
}
|
|
212
309
|
function CustomFlowForm({ flow, Header }) {
|
|
310
|
+
const nodesByGroup = flow.ui.nodes.reduce((groups, node) => {
|
|
311
|
+
const group = node.group || "default";
|
|
312
|
+
if (!groups[group]) {
|
|
313
|
+
groups[group] = [];
|
|
314
|
+
}
|
|
315
|
+
groups[group].push(node);
|
|
316
|
+
return groups;
|
|
317
|
+
}, {});
|
|
318
|
+
const oidcNodes = nodesByGroup.oidc || [];
|
|
319
|
+
const regularNodes = Object.entries(nodesByGroup).filter(([group]) => group !== "oidc").flatMap(([, nodes]) => nodes);
|
|
320
|
+
const csrfToken = regularNodes.find(
|
|
321
|
+
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.name === "csrf_token"
|
|
322
|
+
);
|
|
213
323
|
const hasSubmitButton = flow.ui.nodes.some(
|
|
214
324
|
(node) => isUiNodeInputAttributes(node.attributes) && node.attributes.type === "submit"
|
|
215
325
|
);
|
|
216
|
-
return /* @__PURE__ */ (0,
|
|
217
|
-
|
|
218
|
-
/* @__PURE__ */ (0,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
327
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Messages, { flow }),
|
|
328
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Card, { className: "w-full max-w-md mx-auto", children: [
|
|
329
|
+
Header && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardTitle, { className: "text-center pb-1", children: Header }) }),
|
|
330
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(CardContent, { className: "space-y-6", children: [
|
|
331
|
+
oidcNodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-3", children: [
|
|
332
|
+
oidcNodes.map((node, index) => {
|
|
333
|
+
if (isUiNodeInputAttributes(node.attributes) && node.attributes.type === "submit") {
|
|
334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
335
|
+
"form",
|
|
336
|
+
{
|
|
337
|
+
action: flow.ui.action,
|
|
338
|
+
method: flow.ui.method,
|
|
339
|
+
className: "w-full",
|
|
340
|
+
children: [
|
|
341
|
+
csrfToken && isUiNodeInputAttributes(csrfToken.attributes) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
342
|
+
"input",
|
|
343
|
+
{
|
|
344
|
+
name: csrfToken.attributes.name,
|
|
345
|
+
type: "hidden",
|
|
346
|
+
value: csrfToken.attributes.value || "",
|
|
347
|
+
readOnly: true
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
351
|
+
Button,
|
|
352
|
+
{
|
|
353
|
+
type: "submit",
|
|
354
|
+
name: node.attributes.name,
|
|
355
|
+
value: node.attributes.value || "",
|
|
356
|
+
variant: "outline",
|
|
357
|
+
className: "w-full",
|
|
358
|
+
children: node.meta.label?.text || node.attributes.value || "Sign in"
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
`oidc-${index}`
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
return null;
|
|
367
|
+
}),
|
|
368
|
+
regularNodes.some(
|
|
369
|
+
(node) => isUiNodeInputAttributes(node.attributes) && !["hidden", "submit"].includes(node.attributes.type)
|
|
370
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative my-6", children: [
|
|
371
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w-full border-t border-border" }) }),
|
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative flex justify-center text-xs uppercase", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "bg-background px-3 text-muted-foreground font-medium", children: "Or continue with email" }) })
|
|
373
|
+
] })
|
|
374
|
+
] }),
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { action: flow.ui.action, method: flow.ui.method, children: [
|
|
376
|
+
regularNodes.map((node) => {
|
|
377
|
+
if (isUiNodeInputAttributes(node.attributes)) {
|
|
378
|
+
const isSubmitButton = node.attributes.type === "submit";
|
|
379
|
+
const isHiddenField = node.attributes.type === "hidden";
|
|
380
|
+
const isVisibleField = !isHiddenField && !isSubmitButton;
|
|
381
|
+
if (isHiddenField) {
|
|
382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
383
|
+
"input",
|
|
384
|
+
{
|
|
385
|
+
name: node.attributes.name,
|
|
386
|
+
type: "hidden",
|
|
387
|
+
value: node.attributes.value || "",
|
|
388
|
+
readOnly: true
|
|
389
|
+
},
|
|
390
|
+
node.attributes.name
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
if (isSubmitButton) {
|
|
394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
395
|
+
Button,
|
|
396
|
+
{
|
|
397
|
+
type: "submit",
|
|
398
|
+
name: node.attributes.name,
|
|
399
|
+
value: node.attributes.value || "",
|
|
400
|
+
className: "w-full mt-2",
|
|
401
|
+
children: node.meta.label?.text || node.attributes.value || "Submit"
|
|
402
|
+
},
|
|
403
|
+
node.attributes.name
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
if (isVisibleField && [
|
|
407
|
+
"default",
|
|
408
|
+
"password",
|
|
409
|
+
"code",
|
|
410
|
+
"webauthn",
|
|
411
|
+
"passkey",
|
|
412
|
+
"totp",
|
|
413
|
+
"lookup_secret",
|
|
414
|
+
"profile"
|
|
415
|
+
].includes(node.group)) {
|
|
416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
417
|
+
"div",
|
|
418
|
+
{
|
|
419
|
+
className: "space-y-2 mb-4",
|
|
420
|
+
children: [
|
|
421
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Label, { htmlFor: node.attributes.name, children: [
|
|
422
|
+
node.meta.label?.text,
|
|
423
|
+
node.attributes.required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-destructive ml-1", children: "*" })
|
|
424
|
+
] }),
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
426
|
+
Input,
|
|
427
|
+
{
|
|
428
|
+
id: node.attributes.name,
|
|
429
|
+
name: node.attributes.name,
|
|
430
|
+
type: node.attributes.type,
|
|
431
|
+
defaultValue: node.attributes.value || "",
|
|
432
|
+
required: node.attributes.required,
|
|
433
|
+
placeholder: `Enter your ${node.meta.label?.text?.toLowerCase() || node.attributes.name}`
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
]
|
|
437
|
+
},
|
|
438
|
+
node.meta.label?.id || node.attributes.name
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return null;
|
|
443
|
+
}),
|
|
444
|
+
!hasSubmitButton && !oidcNodes.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", className: "w-full", children: "Submit" })
|
|
445
|
+
] })
|
|
446
|
+
] })
|
|
287
447
|
] })
|
|
288
|
-
] })
|
|
448
|
+
] });
|
|
289
449
|
}
|
|
290
450
|
|
|
291
451
|
// src/tenant-switcher/index.tsx
|
|
292
|
-
var
|
|
452
|
+
var React8 = __toESM(require("react"), 1);
|
|
293
453
|
|
|
294
454
|
// src/components/ui/select.tsx
|
|
295
|
-
var
|
|
455
|
+
var React7 = __toESM(require("react"), 1);
|
|
296
456
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
297
457
|
var import_lucide_react = require("lucide-react");
|
|
298
|
-
var
|
|
458
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
299
459
|
var Select = SelectPrimitive.Root;
|
|
300
460
|
var SelectValue = SelectPrimitive.Value;
|
|
301
|
-
var SelectTrigger =
|
|
461
|
+
var SelectTrigger = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
302
462
|
SelectPrimitive.Trigger,
|
|
303
463
|
{
|
|
304
464
|
ref,
|
|
@@ -309,12 +469,12 @@ var SelectTrigger = React5.forwardRef(({ className, children, ...props }, ref) =
|
|
|
309
469
|
...props,
|
|
310
470
|
children: [
|
|
311
471
|
children,
|
|
312
|
-
/* @__PURE__ */ (0,
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
313
473
|
]
|
|
314
474
|
}
|
|
315
475
|
));
|
|
316
476
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
317
|
-
var SelectScrollUpButton =
|
|
477
|
+
var SelectScrollUpButton = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
318
478
|
SelectPrimitive.ScrollUpButton,
|
|
319
479
|
{
|
|
320
480
|
ref,
|
|
@@ -323,11 +483,11 @@ var SelectScrollUpButton = React5.forwardRef(({ className, ...props }, ref) => /
|
|
|
323
483
|
className
|
|
324
484
|
),
|
|
325
485
|
...props,
|
|
326
|
-
children: /* @__PURE__ */ (0,
|
|
486
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react.ChevronUp, { className: "h-4 w-4" })
|
|
327
487
|
}
|
|
328
488
|
));
|
|
329
489
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
330
|
-
var SelectScrollDownButton =
|
|
490
|
+
var SelectScrollDownButton = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
331
491
|
SelectPrimitive.ScrollDownButton,
|
|
332
492
|
{
|
|
333
493
|
ref,
|
|
@@ -336,11 +496,11 @@ var SelectScrollDownButton = React5.forwardRef(({ className, ...props }, ref) =>
|
|
|
336
496
|
className
|
|
337
497
|
),
|
|
338
498
|
...props,
|
|
339
|
-
children: /* @__PURE__ */ (0,
|
|
499
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react.ChevronDown, { className: "h-4 w-4" })
|
|
340
500
|
}
|
|
341
501
|
));
|
|
342
502
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
343
|
-
var SelectContent =
|
|
503
|
+
var SelectContent = React7.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
344
504
|
SelectPrimitive.Content,
|
|
345
505
|
{
|
|
346
506
|
ref,
|
|
@@ -352,8 +512,8 @@ var SelectContent = React5.forwardRef(({ className, children, position = "popper
|
|
|
352
512
|
position,
|
|
353
513
|
...props,
|
|
354
514
|
children: [
|
|
355
|
-
/* @__PURE__ */ (0,
|
|
356
|
-
/* @__PURE__ */ (0,
|
|
515
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SelectScrollUpButton, {}),
|
|
516
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
357
517
|
SelectPrimitive.Viewport,
|
|
358
518
|
{
|
|
359
519
|
className: cn(
|
|
@@ -363,12 +523,12 @@ var SelectContent = React5.forwardRef(({ className, children, position = "popper
|
|
|
363
523
|
children
|
|
364
524
|
}
|
|
365
525
|
),
|
|
366
|
-
/* @__PURE__ */ (0,
|
|
526
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SelectScrollDownButton, {})
|
|
367
527
|
]
|
|
368
528
|
}
|
|
369
529
|
) }));
|
|
370
530
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
371
|
-
var SelectLabel =
|
|
531
|
+
var SelectLabel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
372
532
|
SelectPrimitive.Label,
|
|
373
533
|
{
|
|
374
534
|
ref,
|
|
@@ -377,7 +537,7 @@ var SelectLabel = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
377
537
|
}
|
|
378
538
|
));
|
|
379
539
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
380
|
-
var SelectItem =
|
|
540
|
+
var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
381
541
|
SelectPrimitive.Item,
|
|
382
542
|
{
|
|
383
543
|
ref,
|
|
@@ -387,13 +547,13 @@ var SelectItem = React5.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
387
547
|
),
|
|
388
548
|
...props,
|
|
389
549
|
children: [
|
|
390
|
-
/* @__PURE__ */ (0,
|
|
391
|
-
/* @__PURE__ */ (0,
|
|
550
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react.Check, { className: "h-4 w-4" }) }) }),
|
|
551
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SelectPrimitive.ItemText, { children })
|
|
392
552
|
]
|
|
393
553
|
}
|
|
394
554
|
));
|
|
395
555
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
396
|
-
var SelectSeparator =
|
|
556
|
+
var SelectSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
397
557
|
SelectPrimitive.Separator,
|
|
398
558
|
{
|
|
399
559
|
ref,
|
|
@@ -404,7 +564,7 @@ var SelectSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
404
564
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
405
565
|
|
|
406
566
|
// src/tenant-switcher/index.tsx
|
|
407
|
-
var
|
|
567
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
408
568
|
function SwitchActiveTenant({
|
|
409
569
|
tenants,
|
|
410
570
|
currentTenantId,
|
|
@@ -413,7 +573,7 @@ function SwitchActiveTenant({
|
|
|
413
573
|
className,
|
|
414
574
|
onTenantChange
|
|
415
575
|
}) {
|
|
416
|
-
const [isLoading, setIsLoading] =
|
|
576
|
+
const [isLoading, setIsLoading] = React8.useState(false);
|
|
417
577
|
const handleTenantChange = async (tenantId) => {
|
|
418
578
|
if (tenantId === currentTenantId) return;
|
|
419
579
|
setIsLoading(true);
|
|
@@ -431,24 +591,24 @@ function SwitchActiveTenant({
|
|
|
431
591
|
}
|
|
432
592
|
};
|
|
433
593
|
const currentTenant = tenants.find((tenant) => tenant.id === currentTenantId);
|
|
434
|
-
return /* @__PURE__ */ (0,
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
435
595
|
Select,
|
|
436
596
|
{
|
|
437
597
|
value: currentTenantId,
|
|
438
598
|
onValueChange: handleTenantChange,
|
|
439
599
|
disabled: isLoading,
|
|
440
600
|
children: [
|
|
441
|
-
/* @__PURE__ */ (0,
|
|
442
|
-
/* @__PURE__ */ (0,
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectTrigger, { className: cn("max-w-64", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectValue, { placeholder, children: currentTenant ? currentTenant.name : placeholder }) }),
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectContent, { children: tenants.map((tenant) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectItem, { value: tenant.id, children: tenant.name }, tenant.id)) })
|
|
443
603
|
]
|
|
444
604
|
}
|
|
445
605
|
);
|
|
446
606
|
}
|
|
447
607
|
|
|
448
608
|
// src/pricing-table/index.tsx
|
|
449
|
-
var
|
|
609
|
+
var React9 = __toESM(require("react"), 1);
|
|
450
610
|
var import_lucide_react2 = require("lucide-react");
|
|
451
|
-
var
|
|
611
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
452
612
|
var getCurrencySymbol = (currency) => {
|
|
453
613
|
const symbols = {
|
|
454
614
|
USD: "$",
|
|
@@ -489,7 +649,7 @@ function PricingCard({
|
|
|
489
649
|
}) {
|
|
490
650
|
const ui = product.ui || {};
|
|
491
651
|
const isHighlighted = ui.highlighted;
|
|
492
|
-
return /* @__PURE__ */ (0,
|
|
652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
493
653
|
"div",
|
|
494
654
|
{
|
|
495
655
|
className: cn(
|
|
@@ -497,11 +657,11 @@ function PricingCard({
|
|
|
497
657
|
isHighlighted ? "relative" : ""
|
|
498
658
|
),
|
|
499
659
|
children: [
|
|
500
|
-
/* @__PURE__ */ (0,
|
|
501
|
-
ui.badge === "Most Popular" && /* @__PURE__ */ (0,
|
|
660
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-4 flex-shrink-0 relative", children: ui.badge && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute top-0 left-1/2 transform -translate-x-1/2 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-primary text-primary-foreground px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1 whitespace-nowrap shadow-md", children: [
|
|
661
|
+
ui.badge === "Most Popular" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Star, { className: "w-3 h-3" }),
|
|
502
662
|
ui.badge
|
|
503
663
|
] }) }) }),
|
|
504
|
-
/* @__PURE__ */ (0,
|
|
664
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
505
665
|
Card,
|
|
506
666
|
{
|
|
507
667
|
className: cn(
|
|
@@ -510,36 +670,36 @@ function PricingCard({
|
|
|
510
670
|
isSelected && "ring-2 ring-primary"
|
|
511
671
|
),
|
|
512
672
|
children: [
|
|
513
|
-
/* @__PURE__ */ (0,
|
|
514
|
-
/* @__PURE__ */ (0,
|
|
515
|
-
ui.tagline && /* @__PURE__ */ (0,
|
|
673
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(CardHeader, { className: "text-center", children: [
|
|
674
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CardTitle, { className: "text-xl font-bold", children: ui.display_name || product.name }),
|
|
675
|
+
ui.tagline && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CardDescription, { className: "text-base", children: ui.tagline })
|
|
516
676
|
] }),
|
|
517
|
-
/* @__PURE__ */ (0,
|
|
518
|
-
/* @__PURE__ */ (0,
|
|
519
|
-
/* @__PURE__ */ (0,
|
|
520
|
-
/* @__PURE__ */ (0,
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(CardContent, { className: "flex-1 space-y-6", children: [
|
|
678
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "text-center", children: [
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-3xl font-bold", children: formatPrice(displayedPrice) }),
|
|
680
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm text-muted-foreground", children: formatBillingPeriod(displayedPrice) })
|
|
521
681
|
] }),
|
|
522
|
-
(ui.features && ui.features.length > 0 || displayedPrice.ui?.features?.length > 0 || displayedPrice.ui?.limits?.length > 0) && /* @__PURE__ */ (0,
|
|
523
|
-
ui.features && ui.features.length > 0 && /* @__PURE__ */ (0,
|
|
524
|
-
/* @__PURE__ */ (0,
|
|
525
|
-
/* @__PURE__ */ (0,
|
|
526
|
-
/* @__PURE__ */ (0,
|
|
527
|
-
/* @__PURE__ */ (0,
|
|
682
|
+
(ui.features && ui.features.length > 0 || displayedPrice.ui?.features?.length > 0 || displayedPrice.ui?.limits?.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
683
|
+
ui.features && ui.features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2", children: [
|
|
684
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Features" }),
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "space-y-2", children: ui.features.map((feature, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Check, { className: "w-4 h-4 text-green-500 mt-0.5 flex-shrink-0" }),
|
|
687
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm", children: feature })
|
|
528
688
|
] }, index)) })
|
|
529
689
|
] }),
|
|
530
|
-
displayedPrice.ui?.features && displayedPrice.ui.features.length > 0 && /* @__PURE__ */ (0,
|
|
531
|
-
/* @__PURE__ */ (0,
|
|
532
|
-
/* @__PURE__ */ (0,
|
|
533
|
-
(feature, index) => /* @__PURE__ */ (0,
|
|
534
|
-
/* @__PURE__ */ (0,
|
|
535
|
-
/* @__PURE__ */ (0,
|
|
690
|
+
displayedPrice.ui?.features && displayedPrice.ui.features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2", children: [
|
|
691
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "This Plan" }),
|
|
692
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "space-y-2", children: displayedPrice.ui.features.map(
|
|
693
|
+
(feature, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
694
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Check, { className: "w-4 h-4 text-blue-500 mt-0.5 flex-shrink-0" }),
|
|
695
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm", children: feature })
|
|
536
696
|
] }, index)
|
|
537
697
|
) })
|
|
538
698
|
] }),
|
|
539
|
-
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */ (0,
|
|
540
|
-
/* @__PURE__ */ (0,
|
|
541
|
-
/* @__PURE__ */ (0,
|
|
542
|
-
(limit, index) => /* @__PURE__ */ (0,
|
|
699
|
+
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2", children: [
|
|
700
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Usage Limits" }),
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "space-y-1", children: displayedPrice.ui.limits.map(
|
|
702
|
+
(limit, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
543
703
|
"li",
|
|
544
704
|
{
|
|
545
705
|
className: "text-sm text-muted-foreground",
|
|
@@ -551,7 +711,7 @@ function PricingCard({
|
|
|
551
711
|
] })
|
|
552
712
|
] })
|
|
553
713
|
] }),
|
|
554
|
-
/* @__PURE__ */ (0,
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CardFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
555
715
|
Button,
|
|
556
716
|
{
|
|
557
717
|
className: "w-full",
|
|
@@ -578,15 +738,15 @@ function PricingTable({
|
|
|
578
738
|
showPricingToggle = false,
|
|
579
739
|
defaultInterval = "month"
|
|
580
740
|
}) {
|
|
581
|
-
const [selectedInterval, setSelectedInterval] =
|
|
582
|
-
const [carouselIndex, setCarouselIndex] =
|
|
583
|
-
const sortedProducts =
|
|
741
|
+
const [selectedInterval, setSelectedInterval] = React9.useState(defaultInterval);
|
|
742
|
+
const [carouselIndex, setCarouselIndex] = React9.useState(0);
|
|
743
|
+
const sortedProducts = React9.useMemo(
|
|
584
744
|
() => [...products].sort(
|
|
585
745
|
(a, b) => (a.ui?.sort_order ?? 999) - (b.ui?.sort_order ?? 999)
|
|
586
746
|
),
|
|
587
747
|
[products]
|
|
588
748
|
);
|
|
589
|
-
const hasMultipleIntervals =
|
|
749
|
+
const hasMultipleIntervals = React9.useMemo(
|
|
590
750
|
() => products.some(
|
|
591
751
|
(p) => new Set(p.prices.map((price) => price.interval)).size > 1
|
|
592
752
|
),
|
|
@@ -595,7 +755,7 @@ function PricingTable({
|
|
|
595
755
|
const getDisplayedPrice = (product) => product.prices.find((p) => p.interval === selectedInterval) || product.prices[0];
|
|
596
756
|
const renderCard = (product) => {
|
|
597
757
|
const displayedPrice = getDisplayedPrice(product);
|
|
598
|
-
return /* @__PURE__ */ (0,
|
|
758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
599
759
|
PricingCard,
|
|
600
760
|
{
|
|
601
761
|
product,
|
|
@@ -605,8 +765,8 @@ function PricingTable({
|
|
|
605
765
|
}
|
|
606
766
|
);
|
|
607
767
|
};
|
|
608
|
-
const desktopCarousel = /* @__PURE__ */ (0,
|
|
609
|
-
/* @__PURE__ */ (0,
|
|
768
|
+
const desktopCarousel = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative max-w-7xl mx-auto", children: [
|
|
769
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
610
770
|
Button,
|
|
611
771
|
{
|
|
612
772
|
variant: "ghost",
|
|
@@ -614,15 +774,15 @@ function PricingTable({
|
|
|
614
774
|
className: "absolute left-0 top-1/2 transform -translate-y-1/2 -translate-x-4 z-10 bg-white shadow-lg border hover:bg-gray-50 disabled:opacity-50",
|
|
615
775
|
onClick: () => setCarouselIndex(Math.max(0, carouselIndex - 1)),
|
|
616
776
|
disabled: carouselIndex === 0,
|
|
617
|
-
children: /* @__PURE__ */ (0,
|
|
777
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ChevronLeft, { className: "w-4 h-4" })
|
|
618
778
|
}
|
|
619
779
|
),
|
|
620
|
-
/* @__PURE__ */ (0,
|
|
780
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
621
781
|
"div",
|
|
622
782
|
{
|
|
623
783
|
className: "overflow-hidden mx-auto",
|
|
624
784
|
style: { width: `${3 * CARD_WIDTH + 2 * GAP}px` },
|
|
625
|
-
children: /* @__PURE__ */ (0,
|
|
785
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
626
786
|
"div",
|
|
627
787
|
{
|
|
628
788
|
className: "flex items-stretch transition-transform duration-300 ease-in-out",
|
|
@@ -630,7 +790,7 @@ function PricingTable({
|
|
|
630
790
|
transform: `translateX(-${carouselIndex * (CARD_WIDTH + GAP)}px)`,
|
|
631
791
|
gap: `${GAP}px`
|
|
632
792
|
},
|
|
633
|
-
children: sortedProducts.map((p) => /* @__PURE__ */ (0,
|
|
793
|
+
children: sortedProducts.map((p) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
634
794
|
"div",
|
|
635
795
|
{
|
|
636
796
|
style: { width: `${CARD_WIDTH}px` },
|
|
@@ -643,7 +803,7 @@ function PricingTable({
|
|
|
643
803
|
)
|
|
644
804
|
}
|
|
645
805
|
),
|
|
646
|
-
/* @__PURE__ */ (0,
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
647
807
|
Button,
|
|
648
808
|
{
|
|
649
809
|
variant: "ghost",
|
|
@@ -653,12 +813,12 @@ function PricingTable({
|
|
|
653
813
|
Math.min(sortedProducts.length - 3, carouselIndex + 1)
|
|
654
814
|
),
|
|
655
815
|
disabled: carouselIndex >= sortedProducts.length - 3,
|
|
656
|
-
children: /* @__PURE__ */ (0,
|
|
816
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ChevronRight, { className: "w-4 h-4" })
|
|
657
817
|
}
|
|
658
818
|
),
|
|
659
|
-
/* @__PURE__ */ (0,
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex justify-center mt-6 space-x-2", children: Array.from(
|
|
660
820
|
{ length: Math.max(1, sortedProducts.length - 2) },
|
|
661
|
-
(_, i) => /* @__PURE__ */ (0,
|
|
821
|
+
(_, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
662
822
|
"button",
|
|
663
823
|
{
|
|
664
824
|
onClick: () => setCarouselIndex(i),
|
|
@@ -672,12 +832,12 @@ function PricingTable({
|
|
|
672
832
|
)
|
|
673
833
|
) })
|
|
674
834
|
] });
|
|
675
|
-
const staticLayout = /* @__PURE__ */ (0,
|
|
835
|
+
const staticLayout = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
676
836
|
"div",
|
|
677
837
|
{
|
|
678
838
|
className: "flex flex-row items-stretch justify-center",
|
|
679
839
|
style: { gap: `${GAP}px` },
|
|
680
|
-
children: sortedProducts.map((p) => /* @__PURE__ */ (0,
|
|
840
|
+
children: sortedProducts.map((p) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
681
841
|
"div",
|
|
682
842
|
{
|
|
683
843
|
style: { width: `${CARD_WIDTH}px` },
|
|
@@ -688,9 +848,9 @@ function PricingTable({
|
|
|
688
848
|
))
|
|
689
849
|
}
|
|
690
850
|
);
|
|
691
|
-
return /* @__PURE__ */ (0,
|
|
692
|
-
showPricingToggle && hasMultipleIntervals && /* @__PURE__ */ (0,
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("w-full", className), children: [
|
|
852
|
+
showPricingToggle && hasMultipleIntervals && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex bg-gray-100 p-1 rounded-lg", children: [
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
694
854
|
Button,
|
|
695
855
|
{
|
|
696
856
|
variant: selectedInterval === "month" ? "default" : "ghost",
|
|
@@ -700,7 +860,7 @@ function PricingTable({
|
|
|
700
860
|
children: "Monthly"
|
|
701
861
|
}
|
|
702
862
|
),
|
|
703
|
-
/* @__PURE__ */ (0,
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
704
864
|
Button,
|
|
705
865
|
{
|
|
706
866
|
variant: selectedInterval === "year" ? "default" : "ghost",
|
|
@@ -711,20 +871,20 @@ function PricingTable({
|
|
|
711
871
|
}
|
|
712
872
|
)
|
|
713
873
|
] }) }),
|
|
714
|
-
/* @__PURE__ */ (0,
|
|
715
|
-
/* @__PURE__ */ (0,
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "lg:hidden relative", children: [
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
716
876
|
"div",
|
|
717
877
|
{
|
|
718
878
|
className: "overflow-hidden mx-auto",
|
|
719
879
|
style: { width: `${CARD_WIDTH}px` },
|
|
720
|
-
children: /* @__PURE__ */ (0,
|
|
880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
721
881
|
"div",
|
|
722
882
|
{
|
|
723
883
|
className: "flex transition-transform duration-300 ease-in-out items-stretch",
|
|
724
884
|
style: {
|
|
725
885
|
transform: `translateX(-${carouselIndex * CARD_WIDTH}px)`
|
|
726
886
|
},
|
|
727
|
-
children: sortedProducts.map((product) => /* @__PURE__ */ (0,
|
|
887
|
+
children: sortedProducts.map((product) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
728
888
|
"div",
|
|
729
889
|
{
|
|
730
890
|
className: "flex-shrink-0",
|
|
@@ -737,8 +897,8 @@ function PricingTable({
|
|
|
737
897
|
)
|
|
738
898
|
}
|
|
739
899
|
),
|
|
740
|
-
sortedProducts.length > 1 && /* @__PURE__ */ (0,
|
|
741
|
-
/* @__PURE__ */ (0,
|
|
900
|
+
sortedProducts.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
901
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
742
902
|
Button,
|
|
743
903
|
{
|
|
744
904
|
variant: "ghost",
|
|
@@ -746,10 +906,10 @@ function PricingTable({
|
|
|
746
906
|
className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-2 z-10 bg-white shadow-lg border hover:bg-gray-50 disabled:opacity-50",
|
|
747
907
|
onClick: () => setCarouselIndex((prev) => Math.max(0, prev - 1)),
|
|
748
908
|
disabled: carouselIndex === 0,
|
|
749
|
-
children: /* @__PURE__ */ (0,
|
|
909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ChevronLeft, { className: "w-5 h-5" })
|
|
750
910
|
}
|
|
751
911
|
),
|
|
752
|
-
/* @__PURE__ */ (0,
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
753
913
|
Button,
|
|
754
914
|
{
|
|
755
915
|
variant: "ghost",
|
|
@@ -759,10 +919,10 @@ function PricingTable({
|
|
|
759
919
|
(prev) => Math.min(sortedProducts.length - 1, prev + 1)
|
|
760
920
|
),
|
|
761
921
|
disabled: carouselIndex >= sortedProducts.length - 1,
|
|
762
|
-
children: /* @__PURE__ */ (0,
|
|
922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.ChevronRight, { className: "w-5 h-5" })
|
|
763
923
|
}
|
|
764
924
|
),
|
|
765
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex justify-center mt-6 space-x-2", children: Array.from({ length: sortedProducts.length }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
766
926
|
"button",
|
|
767
927
|
{
|
|
768
928
|
onClick: () => setCarouselIndex(i),
|
|
@@ -776,7 +936,7 @@ function PricingTable({
|
|
|
776
936
|
)) })
|
|
777
937
|
] })
|
|
778
938
|
] }),
|
|
779
|
-
/* @__PURE__ */ (0,
|
|
939
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hidden lg:block", children: sortedProducts.length <= 3 ? staticLayout : desktopCarousel })
|
|
780
940
|
] });
|
|
781
941
|
}
|
|
782
942
|
// Annotate the CommonJS export names for ESM import in node:
|