create-reactivite 1.4.0 → 1.7.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.
Files changed (150) hide show
  1. package/README.md +326 -290
  2. package/index.js +77 -2
  3. package/package.json +4 -2
  4. package/template/.storybook/main.ts +20 -0
  5. package/template/.storybook/preview.tsx +55 -0
  6. package/template/_gitignore +3 -0
  7. package/template/index.html +1 -1
  8. package/template/package.json +29 -23
  9. package/template/src/components/author-credit.tsx +25 -25
  10. package/template/src/components/ui-lib/auth-form.stories.tsx +26 -0
  11. package/template/src/components/ui-lib/auth-form.tsx +116 -0
  12. package/template/src/components/ui-lib/empty-state.stories.tsx +32 -0
  13. package/template/src/components/ui-lib/empty-state.tsx +54 -0
  14. package/template/src/components/ui-lib/feature-card.stories.tsx +45 -0
  15. package/template/src/components/ui-lib/feature-card.tsx +52 -0
  16. package/template/src/components/ui-lib/index.ts +13 -0
  17. package/template/src/components/ui-lib/page-header.stories.tsx +49 -0
  18. package/template/src/components/ui-lib/page-header.tsx +46 -0
  19. package/template/src/components/ui-lib/pricing-card.stories.tsx +58 -0
  20. package/template/src/components/ui-lib/pricing-card.tsx +86 -0
  21. package/template/src/components/ui-lib/stat-card.stories.tsx +55 -0
  22. package/template/src/components/ui-lib/stat-card.tsx +73 -0
  23. package/template/src/components/ui-lib/themes.stories.tsx +68 -0
  24. package/template/src/global.css +122 -0
  25. package/template2/.env.example +8 -8
  26. package/template2/.husky/pre-commit +4 -4
  27. package/template2/.prettierrc +5 -5
  28. package/template2/README.md +73 -73
  29. package/template2/__tests__/example.test.ts +20 -20
  30. package/template2/_gitignore +37 -37
  31. package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -52
  32. package/template2/app/[locale]/(public)/login/page.tsx +83 -83
  33. package/template2/app/[locale]/layout.tsx +58 -58
  34. package/template2/app/[locale]/locales.ts +10 -10
  35. package/template2/app/[locale]/page.tsx +38 -38
  36. package/template2/app/api/clear-session/route.ts +10 -10
  37. package/template2/app/globals.css +127 -127
  38. package/template2/app/layout.tsx +7 -7
  39. package/template2/app/page.tsx +6 -6
  40. package/template2/components/AuthEventListener.tsx +22 -22
  41. package/template2/components/author-credit.tsx +25 -25
  42. package/template2/components/theme-provider.tsx +78 -78
  43. package/template2/components/ui/button.tsx +60 -60
  44. package/template2/components/ui/card.tsx +92 -92
  45. package/template2/components/ui/input.tsx +21 -21
  46. package/template2/components/ui/label.tsx +24 -24
  47. package/template2/components/ui/sonner.tsx +40 -40
  48. package/template2/components.json +22 -22
  49. package/template2/config/constants.ts +7 -7
  50. package/template2/config/env.ts +5 -5
  51. package/template2/contexts/translation-context.tsx +70 -70
  52. package/template2/eslint.config.mjs +18 -18
  53. package/template2/hoc/provider.tsx +27 -27
  54. package/template2/lib/paramsSerializer.ts +40 -40
  55. package/template2/lib/utils.ts +6 -6
  56. package/template2/locales/az.json +20 -20
  57. package/template2/locales/en.json +20 -20
  58. package/template2/next-env.d.ts +1 -1
  59. package/template2/next.config.ts +17 -17
  60. package/template2/orval.config.ts +66 -66
  61. package/template2/package.json +62 -62
  62. package/template2/postcss.config.mjs +7 -7
  63. package/template2/scripts/fix-generated-types.mjs +13 -13
  64. package/template2/services/generated/.gitkeep +2 -2
  65. package/template2/services/httpClient/httpClient.ts +70 -70
  66. package/template2/services/httpClient/orvalMutator.ts +10 -10
  67. package/template2/store/example-store.tsx +16 -16
  68. package/template2/store/user-store.tsx +29 -29
  69. package/template2/testing/msw/handlers/index.ts +6 -6
  70. package/template2/testing/msw/server.ts +4 -4
  71. package/template2/tsconfig.json +34 -34
  72. package/template2/vitest.config.ts +17 -17
  73. package/template2/vitest.setup.ts +7 -7
  74. package/template3/README.md +34 -34
  75. package/template3/_gitignore +16 -16
  76. package/template3/components.json +21 -0
  77. package/template3/index.html +8 -2
  78. package/template3/package.json +48 -22
  79. package/template3/postcss.config.mjs +5 -0
  80. package/template3/rspack.config.mjs +59 -51
  81. package/template3/src/App.tsx +16 -11
  82. package/template3/src/components/author-credit.tsx +42 -42
  83. package/template3/src/components/layout.tsx +59 -0
  84. package/template3/src/components/matrix-rain.tsx +71 -0
  85. package/template3/src/components/ui/accordion.tsx +64 -0
  86. package/template3/src/components/ui/alert-dialog.tsx +196 -0
  87. package/template3/src/components/ui/alert.tsx +66 -0
  88. package/template3/src/components/ui/aspect-ratio.tsx +11 -0
  89. package/template3/src/components/ui/avatar.tsx +107 -0
  90. package/template3/src/components/ui/badge.tsx +48 -0
  91. package/template3/src/components/ui/breadcrumb.tsx +109 -0
  92. package/template3/src/components/ui/button-group.tsx +83 -0
  93. package/template3/src/components/ui/button.tsx +64 -0
  94. package/template3/src/components/ui/calendar.tsx +218 -0
  95. package/template3/src/components/ui/card.tsx +92 -0
  96. package/template3/src/components/ui/carousel.tsx +241 -0
  97. package/template3/src/components/ui/chart.tsx +372 -0
  98. package/template3/src/components/ui/checkbox.tsx +32 -0
  99. package/template3/src/components/ui/collapsible.tsx +31 -0
  100. package/template3/src/components/ui/combobox.tsx +310 -0
  101. package/template3/src/components/ui/command.tsx +184 -0
  102. package/template3/src/components/ui/context-menu.tsx +252 -0
  103. package/template3/src/components/ui/dialog.tsx +156 -0
  104. package/template3/src/components/ui/direction.tsx +22 -0
  105. package/template3/src/components/ui/drawer.tsx +133 -0
  106. package/template3/src/components/ui/dropdown-menu.tsx +257 -0
  107. package/template3/src/components/ui/empty.tsx +104 -0
  108. package/template3/src/components/ui/field.tsx +248 -0
  109. package/template3/src/components/ui/form.tsx +165 -0
  110. package/template3/src/components/ui/hover-card.tsx +42 -0
  111. package/template3/src/components/ui/input-group.tsx +168 -0
  112. package/template3/src/components/ui/input-otp.tsx +77 -0
  113. package/template3/src/components/ui/input.tsx +21 -0
  114. package/template3/src/components/ui/item.tsx +193 -0
  115. package/template3/src/components/ui/kbd.tsx +28 -0
  116. package/template3/src/components/ui/label.tsx +22 -0
  117. package/template3/src/components/ui/menubar.tsx +276 -0
  118. package/template3/src/components/ui/native-select.tsx +62 -0
  119. package/template3/src/components/ui/navigation-menu.tsx +168 -0
  120. package/template3/src/components/ui/pagination.tsx +127 -0
  121. package/template3/src/components/ui/popover.tsx +87 -0
  122. package/template3/src/components/ui/progress.tsx +31 -0
  123. package/template3/src/components/ui/radio-group.tsx +43 -0
  124. package/template3/src/components/ui/resizable.tsx +53 -0
  125. package/template3/src/components/ui/scroll-area.tsx +56 -0
  126. package/template3/src/components/ui/select.tsx +190 -0
  127. package/template3/src/components/ui/separator.tsx +26 -0
  128. package/template3/src/components/ui/sheet.tsx +143 -0
  129. package/template3/src/components/ui/sidebar.tsx +724 -0
  130. package/template3/src/components/ui/skeleton.tsx +13 -0
  131. package/template3/src/components/ui/slider.tsx +61 -0
  132. package/template3/src/components/ui/sonner.tsx +40 -0
  133. package/template3/src/components/ui/spinner.tsx +16 -0
  134. package/template3/src/components/ui/switch.tsx +33 -0
  135. package/template3/src/components/ui/table.tsx +116 -0
  136. package/template3/src/components/ui/tabs.tsx +89 -0
  137. package/template3/src/components/ui/textarea.tsx +18 -0
  138. package/template3/src/components/ui/toggle-group.tsx +83 -0
  139. package/template3/src/components/ui/toggle.tsx +47 -0
  140. package/template3/src/components/ui/tooltip.tsx +55 -0
  141. package/template3/src/hooks/use-mobile.ts +19 -0
  142. package/template3/src/index.css +175 -32
  143. package/template3/src/lib/utils.ts +6 -0
  144. package/template3/src/main.tsx +10 -10
  145. package/template3/src/pages/about.tsx +113 -0
  146. package/template3/src/pages/contact.tsx +111 -0
  147. package/template3/src/pages/home.tsx +81 -0
  148. package/template3/tsconfig.json +24 -20
  149. package/template/pnpm-lock.yaml +0 -3274
  150. package/template2/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,13 @@
1
+ import { cn } from "@/lib/utils"
2
+
3
+ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
+ return (
5
+ <div
6
+ data-slot="skeleton"
7
+ className={cn("animate-pulse rounded-md bg-accent", className)}
8
+ {...props}
9
+ />
10
+ )
11
+ }
12
+
13
+ export { Skeleton }
@@ -0,0 +1,61 @@
1
+ import * as React from "react"
2
+ import { Slider as SliderPrimitive } from "radix-ui"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Slider({
7
+ className,
8
+ defaultValue,
9
+ value,
10
+ min = 0,
11
+ max = 100,
12
+ ...props
13
+ }: React.ComponentProps<typeof SliderPrimitive.Root>) {
14
+ const _values = React.useMemo(
15
+ () =>
16
+ Array.isArray(value)
17
+ ? value
18
+ : Array.isArray(defaultValue)
19
+ ? defaultValue
20
+ : [min, max],
21
+ [value, defaultValue, min, max]
22
+ )
23
+
24
+ return (
25
+ <SliderPrimitive.Root
26
+ data-slot="slider"
27
+ defaultValue={defaultValue}
28
+ value={value}
29
+ min={min}
30
+ max={max}
31
+ className={cn(
32
+ "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
33
+ className
34
+ )}
35
+ {...props}
36
+ >
37
+ <SliderPrimitive.Track
38
+ data-slot="slider-track"
39
+ className={cn(
40
+ "relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
41
+ )}
42
+ >
43
+ <SliderPrimitive.Range
44
+ data-slot="slider-range"
45
+ className={cn(
46
+ "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
47
+ )}
48
+ />
49
+ </SliderPrimitive.Track>
50
+ {Array.from({ length: _values.length }, (_, index) => (
51
+ <SliderPrimitive.Thumb
52
+ data-slot="slider-thumb"
53
+ key={index}
54
+ className="block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
55
+ />
56
+ ))}
57
+ </SliderPrimitive.Root>
58
+ )
59
+ }
60
+
61
+ export { Slider }
@@ -0,0 +1,40 @@
1
+ "use client"
2
+
3
+ import {
4
+ CircleCheckIcon,
5
+ InfoIcon,
6
+ Loader2Icon,
7
+ OctagonXIcon,
8
+ TriangleAlertIcon,
9
+ } from "lucide-react"
10
+ import { useTheme } from "next-themes"
11
+ import { Toaster as Sonner, type ToasterProps } from "sonner"
12
+
13
+ const Toaster = ({ ...props }: ToasterProps) => {
14
+ const { theme = "system" } = useTheme()
15
+
16
+ return (
17
+ <Sonner
18
+ theme={theme as ToasterProps["theme"]}
19
+ className="toaster group"
20
+ icons={{
21
+ success: <CircleCheckIcon className="size-4" />,
22
+ info: <InfoIcon className="size-4" />,
23
+ warning: <TriangleAlertIcon className="size-4" />,
24
+ error: <OctagonXIcon className="size-4" />,
25
+ loading: <Loader2Icon className="size-4 animate-spin" />,
26
+ }}
27
+ style={
28
+ {
29
+ "--normal-bg": "var(--popover)",
30
+ "--normal-text": "var(--popover-foreground)",
31
+ "--normal-border": "var(--border)",
32
+ "--border-radius": "var(--radius)",
33
+ } as React.CSSProperties
34
+ }
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ export { Toaster }
@@ -0,0 +1,16 @@
1
+ import { Loader2Icon } from "lucide-react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
6
+ return (
7
+ <Loader2Icon
8
+ role="status"
9
+ aria-label="Loading"
10
+ className={cn("size-4 animate-spin", className)}
11
+ {...props}
12
+ />
13
+ )
14
+ }
15
+
16
+ export { Spinner }
@@ -0,0 +1,33 @@
1
+ import * as React from "react"
2
+ import { Switch as SwitchPrimitive } from "radix-ui"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Switch({
7
+ className,
8
+ size = "default",
9
+ ...props
10
+ }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
11
+ size?: "sm" | "default"
12
+ }) {
13
+ return (
14
+ <SwitchPrimitive.Root
15
+ data-slot="switch"
16
+ data-size={size}
17
+ className={cn(
18
+ "peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",
19
+ className
20
+ )}
21
+ {...props}
22
+ >
23
+ <SwitchPrimitive.Thumb
24
+ data-slot="switch-thumb"
25
+ className={cn(
26
+ "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"
27
+ )}
28
+ />
29
+ </SwitchPrimitive.Root>
30
+ )
31
+ }
32
+
33
+ export { Switch }
@@ -0,0 +1,116 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Table({ className, ...props }: React.ComponentProps<"table">) {
8
+ return (
9
+ <div
10
+ data-slot="table-container"
11
+ className="relative w-full overflow-x-auto"
12
+ >
13
+ <table
14
+ data-slot="table"
15
+ className={cn("w-full caption-bottom text-sm", className)}
16
+ {...props}
17
+ />
18
+ </div>
19
+ )
20
+ }
21
+
22
+ function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
23
+ return (
24
+ <thead
25
+ data-slot="table-header"
26
+ className={cn("[&_tr]:border-b", className)}
27
+ {...props}
28
+ />
29
+ )
30
+ }
31
+
32
+ function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
33
+ return (
34
+ <tbody
35
+ data-slot="table-body"
36
+ className={cn("[&_tr:last-child]:border-0", className)}
37
+ {...props}
38
+ />
39
+ )
40
+ }
41
+
42
+ function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
43
+ return (
44
+ <tfoot
45
+ data-slot="table-footer"
46
+ className={cn(
47
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ )
53
+ }
54
+
55
+ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
56
+ return (
57
+ <tr
58
+ data-slot="table-row"
59
+ className={cn(
60
+ "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
61
+ className
62
+ )}
63
+ {...props}
64
+ />
65
+ )
66
+ }
67
+
68
+ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
69
+ return (
70
+ <th
71
+ data-slot="table-head"
72
+ className={cn(
73
+ "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
74
+ className
75
+ )}
76
+ {...props}
77
+ />
78
+ )
79
+ }
80
+
81
+ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
82
+ return (
83
+ <td
84
+ data-slot="table-cell"
85
+ className={cn(
86
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
87
+ className
88
+ )}
89
+ {...props}
90
+ />
91
+ )
92
+ }
93
+
94
+ function TableCaption({
95
+ className,
96
+ ...props
97
+ }: React.ComponentProps<"caption">) {
98
+ return (
99
+ <caption
100
+ data-slot="table-caption"
101
+ className={cn("mt-4 text-sm text-muted-foreground", className)}
102
+ {...props}
103
+ />
104
+ )
105
+ }
106
+
107
+ export {
108
+ Table,
109
+ TableHeader,
110
+ TableBody,
111
+ TableFooter,
112
+ TableHead,
113
+ TableRow,
114
+ TableCell,
115
+ TableCaption,
116
+ }
@@ -0,0 +1,89 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { Tabs as TabsPrimitive } from "radix-ui"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Tabs({
8
+ className,
9
+ orientation = "horizontal",
10
+ ...props
11
+ }: React.ComponentProps<typeof TabsPrimitive.Root>) {
12
+ return (
13
+ <TabsPrimitive.Root
14
+ data-slot="tabs"
15
+ data-orientation={orientation}
16
+ orientation={orientation}
17
+ className={cn(
18
+ "group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ )
24
+ }
25
+
26
+ const tabsListVariants = cva(
27
+ "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",
28
+ {
29
+ variants: {
30
+ variant: {
31
+ default: "bg-muted",
32
+ line: "gap-1 bg-transparent",
33
+ },
34
+ },
35
+ defaultVariants: {
36
+ variant: "default",
37
+ },
38
+ }
39
+ )
40
+
41
+ function TabsList({
42
+ className,
43
+ variant = "default",
44
+ ...props
45
+ }: React.ComponentProps<typeof TabsPrimitive.List> &
46
+ VariantProps<typeof tabsListVariants>) {
47
+ return (
48
+ <TabsPrimitive.List
49
+ data-slot="tabs-list"
50
+ data-variant={variant}
51
+ className={cn(tabsListVariants({ variant }), className)}
52
+ {...props}
53
+ />
54
+ )
55
+ }
56
+
57
+ function TabsTrigger({
58
+ className,
59
+ ...props
60
+ }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
61
+ return (
62
+ <TabsPrimitive.Trigger
63
+ data-slot="tabs-trigger"
64
+ className={cn(
65
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
66
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
67
+ "data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground",
68
+ "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
69
+ className
70
+ )}
71
+ {...props}
72
+ />
73
+ )
74
+ }
75
+
76
+ function TabsContent({
77
+ className,
78
+ ...props
79
+ }: React.ComponentProps<typeof TabsPrimitive.Content>) {
80
+ return (
81
+ <TabsPrimitive.Content
82
+ data-slot="tabs-content"
83
+ className={cn("flex-1 outline-none", className)}
84
+ {...props}
85
+ />
86
+ )
87
+ }
88
+
89
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
@@ -0,0 +1,18 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
+ return (
7
+ <textarea
8
+ data-slot="textarea"
9
+ className={cn(
10
+ "flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+
18
+ export { Textarea }
@@ -0,0 +1,83 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { type VariantProps } from "class-variance-authority"
5
+ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+ import { toggleVariants } from "@/components/ui/toggle"
9
+
10
+ const ToggleGroupContext = React.createContext<
11
+ VariantProps<typeof toggleVariants> & {
12
+ spacing?: number
13
+ }
14
+ >({
15
+ size: "default",
16
+ variant: "default",
17
+ spacing: 0,
18
+ })
19
+
20
+ function ToggleGroup({
21
+ className,
22
+ variant,
23
+ size,
24
+ spacing = 0,
25
+ children,
26
+ ...props
27
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
28
+ VariantProps<typeof toggleVariants> & {
29
+ spacing?: number
30
+ }) {
31
+ return (
32
+ <ToggleGroupPrimitive.Root
33
+ data-slot="toggle-group"
34
+ data-variant={variant}
35
+ data-size={size}
36
+ data-spacing={spacing}
37
+ style={{ "--gap": spacing } as React.CSSProperties}
38
+ className={cn(
39
+ "group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
40
+ className
41
+ )}
42
+ {...props}
43
+ >
44
+ <ToggleGroupContext.Provider value={{ variant, size, spacing }}>
45
+ {children}
46
+ </ToggleGroupContext.Provider>
47
+ </ToggleGroupPrimitive.Root>
48
+ )
49
+ }
50
+
51
+ function ToggleGroupItem({
52
+ className,
53
+ children,
54
+ variant,
55
+ size,
56
+ ...props
57
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
58
+ VariantProps<typeof toggleVariants>) {
59
+ const context = React.useContext(ToggleGroupContext)
60
+
61
+ return (
62
+ <ToggleGroupPrimitive.Item
63
+ data-slot="toggle-group-item"
64
+ data-variant={context.variant || variant}
65
+ data-size={context.size || size}
66
+ data-spacing={context.spacing}
67
+ className={cn(
68
+ toggleVariants({
69
+ variant: context.variant || variant,
70
+ size: context.size || size,
71
+ }),
72
+ "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
73
+ "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
74
+ className
75
+ )}
76
+ {...props}
77
+ >
78
+ {children}
79
+ </ToggleGroupPrimitive.Item>
80
+ )
81
+ }
82
+
83
+ export { ToggleGroup, ToggleGroupItem }
@@ -0,0 +1,47 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+ import { Toggle as TogglePrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ const toggleVariants = cva(
10
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default: "bg-transparent",
15
+ outline:
16
+ "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
17
+ },
18
+ size: {
19
+ default: "h-9 min-w-9 px-2",
20
+ sm: "h-8 min-w-8 px-1.5",
21
+ lg: "h-10 min-w-10 px-2.5",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default",
27
+ },
28
+ }
29
+ )
30
+
31
+ function Toggle({
32
+ className,
33
+ variant,
34
+ size,
35
+ ...props
36
+ }: React.ComponentProps<typeof TogglePrimitive.Root> &
37
+ VariantProps<typeof toggleVariants>) {
38
+ return (
39
+ <TogglePrimitive.Root
40
+ data-slot="toggle"
41
+ className={cn(toggleVariants({ variant, size, className }))}
42
+ {...props}
43
+ />
44
+ )
45
+ }
46
+
47
+ export { Toggle, toggleVariants }
@@ -0,0 +1,55 @@
1
+ import * as React from "react"
2
+ import { Tooltip as TooltipPrimitive } from "radix-ui"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function TooltipProvider({
7
+ delayDuration = 0,
8
+ ...props
9
+ }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
10
+ return (
11
+ <TooltipPrimitive.Provider
12
+ data-slot="tooltip-provider"
13
+ delayDuration={delayDuration}
14
+ {...props}
15
+ />
16
+ )
17
+ }
18
+
19
+ function Tooltip({
20
+ ...props
21
+ }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
22
+ return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
23
+ }
24
+
25
+ function TooltipTrigger({
26
+ ...props
27
+ }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
28
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
29
+ }
30
+
31
+ function TooltipContent({
32
+ className,
33
+ sideOffset = 0,
34
+ children,
35
+ ...props
36
+ }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
37
+ return (
38
+ <TooltipPrimitive.Portal>
39
+ <TooltipPrimitive.Content
40
+ data-slot="tooltip-content"
41
+ sideOffset={sideOffset}
42
+ className={cn(
43
+ "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
44
+ className
45
+ )}
46
+ {...props}
47
+ >
48
+ {children}
49
+ <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
50
+ </TooltipPrimitive.Content>
51
+ </TooltipPrimitive.Portal>
52
+ )
53
+ }
54
+
55
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
@@ -0,0 +1,19 @@
1
+ import * as React from "react"
2
+
3
+ const MOBILE_BREAKPOINT = 768
4
+
5
+ export function useIsMobile() {
6
+ const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
7
+
8
+ React.useEffect(() => {
9
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
10
+ const onChange = () => {
11
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
12
+ }
13
+ mql.addEventListener("change", onChange)
14
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
15
+ return () => mql.removeEventListener("change", onChange)
16
+ }, [])
17
+
18
+ return !!isMobile
19
+ }