create-brainerce-store 1.51.0 → 1.52.1

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.
Files changed (173) hide show
  1. package/README.md +71 -0
  2. package/dist/index.js +24 -80
  3. package/messages/en.json +32 -0
  4. package/messages/he.json +32 -0
  5. package/package.json +1 -1
  6. package/templates/nextjs/base/.claude/commands/design.md +9 -0
  7. package/templates/nextjs/base/AI-GUIDE.md +52 -3
  8. package/templates/nextjs/base/CLAUDE.md +10 -0
  9. package/templates/nextjs/base/package.json.ejs +52 -39
  10. package/templates/nextjs/base/src/app/globals.css +36 -30
  11. package/templates/nextjs/base/src/components/checkout/payment-step.tsx +14 -10
  12. package/templates/nextjs/base/src/components/ui/accordion.tsx +53 -0
  13. package/templates/nextjs/base/src/components/ui/badge.tsx +32 -0
  14. package/templates/nextjs/base/src/components/ui/button.tsx +49 -0
  15. package/templates/nextjs/base/src/components/ui/card.tsx +55 -0
  16. package/templates/nextjs/base/src/components/ui/checkbox.tsx +28 -0
  17. package/templates/nextjs/base/src/components/ui/dialog.tsx +107 -0
  18. package/templates/nextjs/base/src/components/ui/input.tsx +22 -0
  19. package/templates/nextjs/base/src/components/ui/label.tsx +21 -0
  20. package/templates/nextjs/base/src/components/ui/radio-group.tsx +38 -0
  21. package/templates/nextjs/base/src/components/ui/select.tsx +153 -0
  22. package/templates/nextjs/base/src/components/ui/separator.tsx +26 -0
  23. package/templates/nextjs/base/src/components/ui/sheet.tsx +125 -0
  24. package/templates/nextjs/base/src/components/ui/skeleton.tsx +7 -0
  25. package/templates/nextjs/base/src/components/ui/tabs.tsx +55 -0
  26. package/templates/nextjs/base/src/components/ui/textarea.tsx +21 -0
  27. package/templates/nextjs/base/src/components/ui/tooltip.tsx +32 -0
  28. package/templates/nextjs/base/src/ui/cart/cart-bundle-offer.tsx +17 -11
  29. package/templates/nextjs/base/src/ui/cart/cart-item.tsx +2 -8
  30. package/templates/nextjs/base/src/ui/cart/cart-nudges.tsx +28 -39
  31. package/templates/nextjs/base/src/ui/cart/cart-summary.tsx +3 -1
  32. package/templates/nextjs/base/src/ui/cart/cart-upgrade-banner.tsx +8 -23
  33. package/templates/nextjs/base/src/ui/cart/cart-view.tsx +18 -27
  34. package/templates/nextjs/base/src/ui/cart/coupon-input.tsx +10 -21
  35. package/templates/nextjs/base/src/ui/cart/free-shipping-bar.tsx +2 -3
  36. package/templates/nextjs/base/src/ui/cart/reservation-countdown.tsx +95 -103
  37. package/templates/nextjs/base/src/ui/home/hero-section.tsx +4 -6
  38. package/templates/nextjs/base/src/ui/layout/announcement-bar.tsx.ejs +116 -125
  39. package/templates/nextjs/base/src/ui/layout/faq-section.tsx.ejs +90 -103
  40. package/templates/nextjs/base/src/ui/layout/header-account.tsx +2 -17
  41. package/templates/nextjs/base/src/ui/layout/language-switcher.tsx.ejs +80 -70
  42. package/templates/nextjs/base/src/ui/layout/site-footer.tsx.ejs +144 -164
  43. package/templates/nextjs/base/src/ui/layout/site-header.tsx.ejs +152 -182
  44. package/templates/nextjs/base/src/ui/product/customization-fields.tsx +456 -444
  45. package/templates/nextjs/base/src/ui/product/discount-badge.tsx +18 -22
  46. package/templates/nextjs/base/src/ui/product/frequently-bought-together.tsx +15 -27
  47. package/templates/nextjs/base/src/ui/product/modifier-group-selector.tsx +206 -175
  48. package/templates/nextjs/base/src/ui/product/price-display.tsx +3 -2
  49. package/templates/nextjs/base/src/ui/product/product-card.tsx +238 -271
  50. package/templates/nextjs/base/src/ui/product/product-client-section.tsx +455 -470
  51. package/templates/nextjs/base/src/ui/product/product-listing.tsx +96 -79
  52. package/templates/nextjs/base/src/ui/product/recommendation-section.tsx +102 -107
  53. package/templates/nextjs/base/src/ui/product/review-form.tsx +44 -43
  54. package/templates/nextjs/{designs/passepartout → base/src}/ui/product/reviews-section.tsx.ejs +108 -96
  55. package/templates/nextjs/base/src/ui/product/stock-badge.tsx +61 -63
  56. package/templates/nextjs/base/tailwind.config.ts +69 -42
  57. package/templates/nextjs/designs/{passepartout → atelier}/app-overlay/layout.tsx.ejs +23 -25
  58. package/templates/nextjs/designs/atelier/globals.css +396 -0
  59. package/templates/nextjs/designs/atelier/messages-patch/en.json +99 -0
  60. package/templates/nextjs/designs/atelier/messages-patch/he.json +99 -0
  61. package/templates/nextjs/designs/{passepartout → atelier}/ui/cart/cart-bundle-offer.tsx +110 -111
  62. package/templates/nextjs/designs/atelier/ui/cart/cart-drawer.tsx +163 -0
  63. package/templates/nextjs/designs/atelier/ui/cart/cart-item.tsx +140 -0
  64. package/templates/nextjs/designs/atelier/ui/cart/cart-nudges.tsx +34 -0
  65. package/templates/nextjs/designs/atelier/ui/cart/cart-summary.tsx +107 -0
  66. package/templates/nextjs/designs/{passepartout → atelier}/ui/cart/cart-upgrade-banner.tsx +123 -141
  67. package/templates/nextjs/designs/atelier/ui/cart/cart-view.tsx +147 -0
  68. package/templates/nextjs/designs/atelier/ui/cart/coupon-input.tsx +142 -0
  69. package/templates/nextjs/designs/{passepartout → atelier}/ui/cart/free-shipping-bar.tsx +77 -62
  70. package/templates/nextjs/designs/{passepartout → atelier}/ui/cart/reservation-countdown.tsx +89 -103
  71. package/templates/nextjs/designs/atelier/ui/home/benefits-band.tsx +34 -0
  72. package/templates/nextjs/designs/atelier/ui/home/category-tiles.tsx +148 -0
  73. package/templates/nextjs/designs/atelier/ui/home/discount-banner-strip.tsx +27 -0
  74. package/templates/nextjs/designs/atelier/ui/home/editorial-band.tsx +73 -0
  75. package/templates/nextjs/designs/atelier/ui/home/featured-products-section.tsx +36 -0
  76. package/templates/nextjs/designs/atelier/ui/home/hero-section.tsx +148 -0
  77. package/templates/nextjs/designs/atelier/ui/home/home-client.tsx +54 -0
  78. package/templates/nextjs/designs/atelier/ui/home/newsletter-section.tsx +78 -0
  79. package/templates/nextjs/designs/atelier/ui/home/testimonials-band.tsx +46 -0
  80. package/templates/nextjs/designs/atelier/ui/layout/announcement-bar.tsx +118 -0
  81. package/templates/nextjs/designs/atelier/ui/layout/faq-section.tsx +96 -0
  82. package/templates/nextjs/designs/atelier/ui/layout/header-account.tsx +36 -0
  83. package/templates/nextjs/designs/atelier/ui/layout/header-cart.tsx +36 -0
  84. package/templates/nextjs/designs/atelier/ui/layout/language-switcher.tsx.ejs +137 -0
  85. package/templates/nextjs/designs/atelier/ui/layout/nav-url.ts +14 -0
  86. package/templates/nextjs/designs/atelier/ui/layout/rich-text-block.tsx +34 -0
  87. package/templates/nextjs/designs/atelier/ui/layout/site-footer.tsx.ejs +141 -0
  88. package/templates/nextjs/designs/atelier/ui/layout/site-header.tsx.ejs +138 -0
  89. package/templates/nextjs/designs/atelier/ui/product/customization-fields.tsx +466 -0
  90. package/templates/nextjs/designs/{passepartout → atelier}/ui/product/discount-badge.tsx +17 -22
  91. package/templates/nextjs/designs/{passepartout → atelier}/ui/product/frequently-bought-together.tsx +196 -205
  92. package/templates/nextjs/designs/atelier/ui/product/modifier-group-selector.tsx +193 -0
  93. package/templates/nextjs/designs/atelier/ui/product/price-display.tsx +69 -0
  94. package/templates/nextjs/designs/atelier/ui/product/product-card.tsx +260 -0
  95. package/templates/nextjs/designs/atelier/ui/product/product-client-section.tsx +471 -0
  96. package/templates/nextjs/designs/atelier/ui/product/product-grid.tsx +47 -0
  97. package/templates/nextjs/designs/atelier/ui/product/product-listing.tsx +260 -0
  98. package/templates/nextjs/designs/atelier/ui/product/recommendation-section.tsx +95 -0
  99. package/templates/nextjs/designs/{passepartout → atelier}/ui/product/review-form.tsx +267 -294
  100. package/templates/nextjs/designs/atelier/ui/product/reviews-section.tsx.ejs +148 -0
  101. package/templates/nextjs/designs/atelier/ui/product/stock-badge.tsx +66 -0
  102. package/templates/nextjs/designs/atelier/ui/product/variant-selector.tsx +206 -0
  103. package/templates/nextjs/designs/atelier/ui/shared/cdn-image.tsx +29 -0
  104. package/templates/nextjs/designs/{passepartout → atelier}/ui/shared/fly-to-cart.ts +86 -85
  105. package/templates/nextjs/designs/atelier/ui/shared/icons.tsx +269 -0
  106. package/templates/nextjs/designs/atelier/ui/shared/loading-spinner.tsx +64 -0
  107. package/templates/nextjs/designs/atelier/ui/shared/reveal.tsx +71 -0
  108. package/templates/nextjs/designs/atelier/ui/shared/select-menu.tsx +125 -0
  109. package/templates/nextjs/ui-canvas/cart/cart-bundle-offer.tsx +2 -0
  110. package/templates/nextjs/ui-canvas/cart/cart-item.tsx +2 -0
  111. package/templates/nextjs/ui-canvas/cart/cart-nudges.tsx +2 -0
  112. package/templates/nextjs/ui-canvas/cart/cart-summary.tsx +2 -0
  113. package/templates/nextjs/ui-canvas/cart/cart-upgrade-banner.tsx +2 -0
  114. package/templates/nextjs/ui-canvas/cart/cart-view.tsx +2 -2
  115. package/templates/nextjs/ui-canvas/cart/coupon-input.tsx +2 -0
  116. package/templates/nextjs/ui-canvas/cart/free-shipping-bar.tsx +2 -0
  117. package/templates/nextjs/ui-canvas/cart/reservation-countdown.tsx +2 -0
  118. package/templates/nextjs/ui-canvas/home/discount-banner-strip.tsx +1 -1
  119. package/templates/nextjs/ui-canvas/home/featured-products-section.tsx +1 -1
  120. package/templates/nextjs/ui-canvas/home/hero-section.tsx +1 -1
  121. package/templates/nextjs/ui-canvas/home/home-client.tsx +1 -1
  122. package/templates/nextjs/ui-canvas/layout/announcement-bar.tsx.ejs +1 -1
  123. package/templates/nextjs/ui-canvas/layout/faq-section.tsx.ejs +2 -2
  124. package/templates/nextjs/ui-canvas/layout/header-account.tsx +1 -1
  125. package/templates/nextjs/ui-canvas/layout/language-switcher.tsx.ejs +2 -0
  126. package/templates/nextjs/ui-canvas/layout/rich-text-block.tsx.ejs +2 -0
  127. package/templates/nextjs/ui-canvas/layout/site-footer.tsx.ejs +2 -2
  128. package/templates/nextjs/ui-canvas/layout/site-header.tsx.ejs +2 -2
  129. package/templates/nextjs/ui-canvas/product/customization-fields.tsx +2 -0
  130. package/templates/nextjs/ui-canvas/product/discount-badge.tsx +2 -0
  131. package/templates/nextjs/ui-canvas/product/frequently-bought-together.tsx +2 -0
  132. package/templates/nextjs/ui-canvas/product/modifier-group-selector.tsx +2 -0
  133. package/templates/nextjs/ui-canvas/product/price-display.tsx +2 -0
  134. package/templates/nextjs/ui-canvas/product/product-card.tsx +1 -1
  135. package/templates/nextjs/ui-canvas/product/product-client-section.tsx +1 -1
  136. package/templates/nextjs/ui-canvas/product/product-grid.tsx +1 -1
  137. package/templates/nextjs/ui-canvas/product/product-listing.tsx +1 -1
  138. package/templates/nextjs/ui-canvas/product/recommendation-section.tsx +4 -0
  139. package/templates/nextjs/ui-canvas/product/review-form.tsx +29 -32
  140. package/templates/nextjs/ui-canvas/product/{reviews-section.tsx → reviews-section.tsx.ejs} +26 -8
  141. package/templates/nextjs/ui-canvas/product/stock-badge.tsx +2 -0
  142. package/templates/nextjs/ui-canvas/product/variant-selector.tsx +2 -0
  143. package/templates/nextjs/ui-canvas/shared/cdn-image.tsx +2 -0
  144. package/templates/nextjs/ui-canvas/shared/loading-spinner.tsx +2 -0
  145. package/templates/nextjs/base/src/ui/product/reviews-section.tsx +0 -85
  146. package/templates/nextjs/designs/passepartout/globals.css +0 -412
  147. package/templates/nextjs/designs/passepartout/messages-patch/en.json +0 -87
  148. package/templates/nextjs/designs/passepartout/messages-patch/he.json +0 -87
  149. package/templates/nextjs/designs/passepartout/ui/cart/cart-nudges.tsx +0 -39
  150. package/templates/nextjs/designs/passepartout/ui/cart/cart-view.tsx +0 -149
  151. package/templates/nextjs/designs/passepartout/ui/home/home-client.tsx +0 -401
  152. package/templates/nextjs/designs/passepartout/ui/layout/announcement-bar.tsx +0 -139
  153. package/templates/nextjs/designs/passepartout/ui/layout/cart-link.tsx +0 -45
  154. package/templates/nextjs/designs/passepartout/ui/layout/faq-section.tsx +0 -103
  155. package/templates/nextjs/designs/passepartout/ui/layout/site-footer.tsx +0 -159
  156. package/templates/nextjs/designs/passepartout/ui/layout/site-header.tsx.ejs +0 -155
  157. package/templates/nextjs/designs/passepartout/ui/layout/trust-icons.tsx +0 -60
  158. package/templates/nextjs/designs/passepartout/ui/layout/whatsapp-button.tsx +0 -34
  159. package/templates/nextjs/designs/passepartout/ui/product/price-display.tsx +0 -111
  160. package/templates/nextjs/designs/passepartout/ui/product/product-card.tsx +0 -265
  161. package/templates/nextjs/designs/passepartout/ui/product/product-client-section.tsx +0 -667
  162. package/templates/nextjs/designs/passepartout/ui/product/product-grid.tsx +0 -35
  163. package/templates/nextjs/designs/passepartout/ui/product/product-listing.tsx +0 -427
  164. package/templates/nextjs/designs/passepartout/ui/product/recommendation-section.tsx +0 -113
  165. package/templates/nextjs/designs/passepartout/ui/product/stock-badge.tsx +0 -52
  166. package/templates/nextjs/designs/passepartout/ui/product/variant-selector.tsx +0 -307
  167. package/templates/nextjs/designs/passepartout/ui/shared/loading-spinner.tsx +0 -33
  168. package/templates/nextjs/themes/luxury/globals.css +0 -399
  169. package/templates/nextjs/themes/luxury/theme.json +0 -23
  170. package/templates/nextjs/themes/minimal/globals.css +0 -30
  171. package/templates/nextjs/themes/minimal/theme.json +0 -23
  172. package/templates/nextjs/themes/playful/globals.css +0 -400
  173. package/templates/nextjs/themes/playful/theme.json +0 -23
@@ -76,16 +76,6 @@ export function PaymentStep({ checkoutId, className }: PaymentStepProps) {
76
76
  const t = useTranslations('checkout');
77
77
  const { storeInfo } = useStoreInfo();
78
78
 
79
- // Defense in depth: the parent already validates checkoutId from URL params,
80
- // but we re-check here so the component is safe to render in any context.
81
- if (!isValidCheckoutId(checkoutId)) {
82
- return (
83
- <div className={cn('border-destructive/50 rounded-md border p-4', className)}>
84
- <p className="text-destructive text-sm">{t('paymentError')}</p>
85
- </div>
86
- );
87
- }
88
-
89
79
  const [paymentIntent, setPaymentIntent] = useState<PaymentIntent | null>(null);
90
80
  const [preloadedSdk, setPreloadedSdk] = useState<PaymentClientSdk | null>(null);
91
81
  const [loading, setLoading] = useState(true);
@@ -174,6 +164,10 @@ export function PaymentStep({ checkoutId, className }: PaymentStepProps) {
174
164
  // "call createPaymentProcess right before you need to render the wallet"
175
165
  // =========================================================================
176
166
  useEffect(() => {
167
+ // Defense in depth: the parent already validates checkoutId from URL
168
+ // params, but we re-check here so the component is safe to render in any
169
+ // context. Invalid id → no SDK loading, no API calls (error UI below).
170
+ if (!isValidCheckoutId(checkoutId)) return;
177
171
  if (initialized.current) return;
178
172
  initialized.current = true;
179
173
 
@@ -488,6 +482,16 @@ export function PaymentStep({ checkoutId, className }: PaymentStepProps) {
488
482
 
489
483
  // --- UI ---
490
484
 
485
+ // Invalid checkout id — render the error box instead of ever spinning.
486
+ // (Checked after the hooks above so hook order is stable across renders.)
487
+ if (!isValidCheckoutId(checkoutId)) {
488
+ return (
489
+ <div className={cn('border-destructive/50 rounded-md border p-4', className)}>
490
+ <p className="text-destructive text-sm">{t('paymentError')}</p>
491
+ </div>
492
+ );
493
+ }
494
+
491
495
  if (loading) {
492
496
  return (
493
497
  <div className={cn('flex flex-col items-center justify-center py-12', className)}>
@@ -0,0 +1,53 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
5
+ import { ChevronDown } from 'lucide-react';
6
+
7
+ import { cn } from '@/core/lib/utils';
8
+
9
+ const Accordion = AccordionPrimitive.Root;
10
+
11
+ const AccordionItem = React.forwardRef<
12
+ React.ElementRef<typeof AccordionPrimitive.Item>,
13
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
14
+ >(({ className, ...props }, ref) => (
15
+ <AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />
16
+ ));
17
+ AccordionItem.displayName = 'AccordionItem';
18
+
19
+ const AccordionTrigger = React.forwardRef<
20
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
21
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
22
+ >(({ className, children, ...props }, ref) => (
23
+ <AccordionPrimitive.Header className="flex">
24
+ <AccordionPrimitive.Trigger
25
+ ref={ref}
26
+ className={cn(
27
+ 'flex flex-1 items-center justify-between py-4 text-start font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
28
+ className
29
+ )}
30
+ {...props}
31
+ >
32
+ {children}
33
+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
34
+ </AccordionPrimitive.Trigger>
35
+ </AccordionPrimitive.Header>
36
+ ));
37
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
38
+
39
+ const AccordionContent = React.forwardRef<
40
+ React.ElementRef<typeof AccordionPrimitive.Content>,
41
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
42
+ >(({ className, children, ...props }, ref) => (
43
+ <AccordionPrimitive.Content
44
+ ref={ref}
45
+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
46
+ {...props}
47
+ >
48
+ <div className={cn('pb-4 pt-0', className)}>{children}</div>
49
+ </AccordionPrimitive.Content>
50
+ ));
51
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
52
+
53
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+
4
+ import { cn } from '@/core/lib/utils';
5
+
6
+ const badgeVariants = cva(
7
+ 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
12
+ secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
13
+ destructive:
14
+ 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
15
+ outline: 'text-foreground',
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ variant: 'default',
20
+ },
21
+ }
22
+ );
23
+
24
+ export interface BadgeProps
25
+ extends React.HTMLAttributes<HTMLDivElement>,
26
+ VariantProps<typeof badgeVariants> {}
27
+
28
+ function Badge({ className, variant, ...props }: BadgeProps) {
29
+ return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
30
+ }
31
+
32
+ export { Badge, badgeVariants };
@@ -0,0 +1,49 @@
1
+ import * as React from 'react';
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+
5
+ import { cn } from '@/core/lib/utils';
6
+
7
+ const buttonVariants = cva(
8
+ 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13
+ destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
14
+ outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
15
+ secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
16
+ ghost: 'hover:bg-accent hover:text-accent-foreground',
17
+ link: 'text-primary underline-offset-4 hover:underline',
18
+ },
19
+ size: {
20
+ default: 'h-10 px-4 py-2',
21
+ sm: 'h-9 rounded-md px-3',
22
+ lg: 'h-11 rounded-md px-8',
23
+ icon: 'h-10 w-10',
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: 'default',
28
+ size: 'default',
29
+ },
30
+ }
31
+ );
32
+
33
+ export interface ButtonProps
34
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
35
+ VariantProps<typeof buttonVariants> {
36
+ asChild?: boolean;
37
+ }
38
+
39
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
40
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
41
+ const Comp = asChild ? Slot : 'button';
42
+ return (
43
+ <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
44
+ );
45
+ }
46
+ );
47
+ Button.displayName = 'Button';
48
+
49
+ export { Button, buttonVariants };
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+
3
+ import { cn } from '@/core/lib/utils';
4
+
5
+ const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
6
+ ({ className, ...props }, ref) => (
7
+ <div
8
+ ref={ref}
9
+ className={cn('rounded-lg border bg-card text-card-foreground shadow-sm', className)}
10
+ {...props}
11
+ />
12
+ )
13
+ );
14
+ Card.displayName = 'Card';
15
+
16
+ const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
17
+ ({ className, ...props }, ref) => (
18
+ <div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
19
+ )
20
+ );
21
+ CardHeader.displayName = 'CardHeader';
22
+
23
+ const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
24
+ ({ className, ...props }, ref) => (
25
+ <div
26
+ ref={ref}
27
+ className={cn('text-2xl font-semibold leading-none tracking-tight', className)}
28
+ {...props}
29
+ />
30
+ )
31
+ );
32
+ CardTitle.displayName = 'CardTitle';
33
+
34
+ const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
35
+ ({ className, ...props }, ref) => (
36
+ <div ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
37
+ )
38
+ );
39
+ CardDescription.displayName = 'CardDescription';
40
+
41
+ const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
42
+ ({ className, ...props }, ref) => (
43
+ <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
44
+ )
45
+ );
46
+ CardContent.displayName = 'CardContent';
47
+
48
+ const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
49
+ ({ className, ...props }, ref) => (
50
+ <div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
51
+ )
52
+ );
53
+ CardFooter.displayName = 'CardFooter';
54
+
55
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
5
+ import { Check } from 'lucide-react';
6
+
7
+ import { cn } from '@/core/lib/utils';
8
+
9
+ const Checkbox = React.forwardRef<
10
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
11
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12
+ >(({ className, ...props }, ref) => (
13
+ <CheckboxPrimitive.Root
14
+ ref={ref}
15
+ className={cn(
16
+ 'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
17
+ className
18
+ )}
19
+ {...props}
20
+ >
21
+ <CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
22
+ <Check className="h-4 w-4" />
23
+ </CheckboxPrimitive.Indicator>
24
+ </CheckboxPrimitive.Root>
25
+ ));
26
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
27
+
28
+ export { Checkbox };
@@ -0,0 +1,107 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
5
+ import { X } from 'lucide-react';
6
+
7
+ import { cn } from '@/core/lib/utils';
8
+
9
+ const Dialog = DialogPrimitive.Root;
10
+
11
+ const DialogTrigger = DialogPrimitive.Trigger;
12
+
13
+ const DialogPortal = DialogPrimitive.Portal;
14
+
15
+ const DialogClose = DialogPrimitive.Close;
16
+
17
+ const DialogOverlay = React.forwardRef<
18
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
19
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
20
+ >(({ className, ...props }, ref) => (
21
+ <DialogPrimitive.Overlay
22
+ ref={ref}
23
+ className={cn(
24
+ 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
25
+ className
26
+ )}
27
+ {...props}
28
+ />
29
+ ));
30
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
31
+
32
+ const DialogContent = React.forwardRef<
33
+ React.ElementRef<typeof DialogPrimitive.Content>,
34
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
35
+ >(({ className, children, ...props }, ref) => (
36
+ <DialogPortal>
37
+ <DialogOverlay />
38
+ <DialogPrimitive.Content
39
+ ref={ref}
40
+ className={cn(
41
+ 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
42
+ className
43
+ )}
44
+ {...props}
45
+ >
46
+ {children}
47
+ <DialogPrimitive.Close className="absolute end-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
48
+ <X className="h-4 w-4" />
49
+ <span className="sr-only">Close</span>
50
+ </DialogPrimitive.Close>
51
+ </DialogPrimitive.Content>
52
+ </DialogPortal>
53
+ ));
54
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
55
+
56
+ const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
57
+ <div
58
+ className={cn('flex flex-col space-y-1.5 text-center sm:text-start', className)}
59
+ {...props}
60
+ />
61
+ );
62
+ DialogHeader.displayName = 'DialogHeader';
63
+
64
+ const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
65
+ <div
66
+ className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
67
+ {...props}
68
+ />
69
+ );
70
+ DialogFooter.displayName = 'DialogFooter';
71
+
72
+ const DialogTitle = React.forwardRef<
73
+ React.ElementRef<typeof DialogPrimitive.Title>,
74
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
75
+ >(({ className, ...props }, ref) => (
76
+ <DialogPrimitive.Title
77
+ ref={ref}
78
+ className={cn('text-lg font-semibold leading-none tracking-tight', className)}
79
+ {...props}
80
+ />
81
+ ));
82
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
83
+
84
+ const DialogDescription = React.forwardRef<
85
+ React.ElementRef<typeof DialogPrimitive.Description>,
86
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
87
+ >(({ className, ...props }, ref) => (
88
+ <DialogPrimitive.Description
89
+ ref={ref}
90
+ className={cn('text-sm text-muted-foreground', className)}
91
+ {...props}
92
+ />
93
+ ));
94
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
95
+
96
+ export {
97
+ Dialog,
98
+ DialogPortal,
99
+ DialogOverlay,
100
+ DialogClose,
101
+ DialogTrigger,
102
+ DialogContent,
103
+ DialogHeader,
104
+ DialogFooter,
105
+ DialogTitle,
106
+ DialogDescription,
107
+ };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+
3
+ import { cn } from '@/core/lib/utils';
4
+
5
+ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
6
+ ({ className, type, ...props }, ref) => {
7
+ return (
8
+ <input
9
+ type={type}
10
+ className={cn(
11
+ 'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
12
+ className
13
+ )}
14
+ ref={ref}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+ );
20
+ Input.displayName = 'Input';
21
+
22
+ export { Input };
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as LabelPrimitive from '@radix-ui/react-label';
5
+ import { cva, type VariantProps } from 'class-variance-authority';
6
+
7
+ import { cn } from '@/core/lib/utils';
8
+
9
+ const labelVariants = cva(
10
+ 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
11
+ );
12
+
13
+ const Label = React.forwardRef<
14
+ React.ElementRef<typeof LabelPrimitive.Root>,
15
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
16
+ >(({ className, ...props }, ref) => (
17
+ <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
18
+ ));
19
+ Label.displayName = LabelPrimitive.Root.displayName;
20
+
21
+ export { Label };
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
5
+ import { Circle } from 'lucide-react';
6
+
7
+ import { cn } from '@/core/lib/utils';
8
+
9
+ const RadioGroup = React.forwardRef<
10
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
11
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
12
+ >(({ className, ...props }, ref) => {
13
+ return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref} />;
14
+ });
15
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
16
+
17
+ const RadioGroupItem = React.forwardRef<
18
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
19
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
20
+ >(({ className, ...props }, ref) => {
21
+ return (
22
+ <RadioGroupPrimitive.Item
23
+ ref={ref}
24
+ className={cn(
25
+ 'aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
26
+ className
27
+ )}
28
+ {...props}
29
+ >
30
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
31
+ <Circle className="h-2.5 w-2.5 fill-current text-current" />
32
+ </RadioGroupPrimitive.Indicator>
33
+ </RadioGroupPrimitive.Item>
34
+ );
35
+ });
36
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
37
+
38
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,153 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as SelectPrimitive from '@radix-ui/react-select';
5
+ import { Check, ChevronDown, ChevronUp } from 'lucide-react';
6
+
7
+ import { cn } from '@/core/lib/utils';
8
+
9
+ const Select = SelectPrimitive.Root;
10
+
11
+ const SelectGroup = SelectPrimitive.Group;
12
+
13
+ const SelectValue = SelectPrimitive.Value;
14
+
15
+ const SelectTrigger = React.forwardRef<
16
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
17
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
18
+ >(({ className, children, ...props }, ref) => (
19
+ <SelectPrimitive.Trigger
20
+ ref={ref}
21
+ className={cn(
22
+ 'flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
23
+ className
24
+ )}
25
+ {...props}
26
+ >
27
+ {children}
28
+ <SelectPrimitive.Icon asChild>
29
+ <ChevronDown className="h-4 w-4 opacity-50" />
30
+ </SelectPrimitive.Icon>
31
+ </SelectPrimitive.Trigger>
32
+ ));
33
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
34
+
35
+ const SelectScrollUpButton = React.forwardRef<
36
+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
37
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
38
+ >(({ className, ...props }, ref) => (
39
+ <SelectPrimitive.ScrollUpButton
40
+ ref={ref}
41
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
42
+ {...props}
43
+ >
44
+ <ChevronUp className="h-4 w-4" />
45
+ </SelectPrimitive.ScrollUpButton>
46
+ ));
47
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
48
+
49
+ const SelectScrollDownButton = React.forwardRef<
50
+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
51
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
52
+ >(({ className, ...props }, ref) => (
53
+ <SelectPrimitive.ScrollDownButton
54
+ ref={ref}
55
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
56
+ {...props}
57
+ >
58
+ <ChevronDown className="h-4 w-4" />
59
+ </SelectPrimitive.ScrollDownButton>
60
+ ));
61
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
62
+
63
+ const SelectContent = React.forwardRef<
64
+ React.ElementRef<typeof SelectPrimitive.Content>,
65
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
66
+ >(({ className, children, position = 'popper', ...props }, ref) => (
67
+ <SelectPrimitive.Portal>
68
+ <SelectPrimitive.Content
69
+ ref={ref}
70
+ className={cn(
71
+ 'relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
72
+ position === 'popper' &&
73
+ 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
74
+ className
75
+ )}
76
+ position={position}
77
+ {...props}
78
+ >
79
+ <SelectScrollUpButton />
80
+ <SelectPrimitive.Viewport
81
+ className={cn(
82
+ 'p-1',
83
+ position === 'popper' &&
84
+ 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'
85
+ )}
86
+ >
87
+ {children}
88
+ </SelectPrimitive.Viewport>
89
+ <SelectScrollDownButton />
90
+ </SelectPrimitive.Content>
91
+ </SelectPrimitive.Portal>
92
+ ));
93
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
94
+
95
+ const SelectLabel = React.forwardRef<
96
+ React.ElementRef<typeof SelectPrimitive.Label>,
97
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
98
+ >(({ className, ...props }, ref) => (
99
+ <SelectPrimitive.Label
100
+ ref={ref}
101
+ className={cn('py-1.5 pe-2 ps-8 text-sm font-semibold', className)}
102
+ {...props}
103
+ />
104
+ ));
105
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
106
+
107
+ const SelectItem = React.forwardRef<
108
+ React.ElementRef<typeof SelectPrimitive.Item>,
109
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
110
+ >(({ className, children, ...props }, ref) => (
111
+ <SelectPrimitive.Item
112
+ ref={ref}
113
+ className={cn(
114
+ 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pe-2 ps-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
115
+ className
116
+ )}
117
+ {...props}
118
+ >
119
+ <span className="absolute start-2 flex h-3.5 w-3.5 items-center justify-center">
120
+ <SelectPrimitive.ItemIndicator>
121
+ <Check className="h-4 w-4" />
122
+ </SelectPrimitive.ItemIndicator>
123
+ </span>
124
+
125
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
126
+ </SelectPrimitive.Item>
127
+ ));
128
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
129
+
130
+ const SelectSeparator = React.forwardRef<
131
+ React.ElementRef<typeof SelectPrimitive.Separator>,
132
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
133
+ >(({ className, ...props }, ref) => (
134
+ <SelectPrimitive.Separator
135
+ ref={ref}
136
+ className={cn('-mx-1 my-1 h-px bg-muted', className)}
137
+ {...props}
138
+ />
139
+ ));
140
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
141
+
142
+ export {
143
+ Select,
144
+ SelectGroup,
145
+ SelectValue,
146
+ SelectTrigger,
147
+ SelectContent,
148
+ SelectLabel,
149
+ SelectItem,
150
+ SelectSeparator,
151
+ SelectScrollUpButton,
152
+ SelectScrollDownButton,
153
+ };
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
5
+
6
+ import { cn } from '@/core/lib/utils';
7
+
8
+ const Separator = React.forwardRef<
9
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
11
+ >(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
12
+ <SeparatorPrimitive.Root
13
+ ref={ref}
14
+ decorative={decorative}
15
+ orientation={orientation}
16
+ className={cn(
17
+ 'shrink-0 bg-border',
18
+ orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ ));
24
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
25
+
26
+ export { Separator };