create-reactivite 1.0.4 → 1.2.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 (87) hide show
  1. package/README.md +119 -98
  2. package/index.js +33 -1
  3. package/package.json +4 -3
  4. package/template/README.md +73 -73
  5. package/template/_gitignore +24 -0
  6. package/template/components.json +22 -22
  7. package/template/eslint.config.js +30 -23
  8. package/template/index.html +13 -13
  9. package/template/package.json +53 -53
  10. package/template/pnpm-lock.yaml +1281 -1856
  11. package/template/src/App.tsx +27 -27
  12. package/template/src/components/home-page-components/header.tsx +2 -2
  13. package/template/src/components/ui/accordion.tsx +64 -64
  14. package/template/src/components/ui/alert.tsx +66 -66
  15. package/template/src/components/ui/avatar.tsx +51 -51
  16. package/template/src/components/ui/badge.tsx +46 -46
  17. package/template/src/components/ui/button-group.tsx +83 -83
  18. package/template/src/components/ui/button.tsx +60 -60
  19. package/template/src/components/ui/calendar.tsx +210 -211
  20. package/template/src/components/ui/card.tsx +92 -92
  21. package/template/src/components/ui/checkbox.tsx +30 -30
  22. package/template/src/components/ui/collapsible.tsx +31 -31
  23. package/template/src/components/ui/dialog.tsx +141 -141
  24. package/template/src/components/ui/input.tsx +21 -21
  25. package/template/src/components/ui/select.tsx +185 -185
  26. package/template/src/components/ui/separator.tsx +26 -26
  27. package/template/src/components/ui/sonner.tsx +38 -38
  28. package/template/src/components/ui/spinner.tsx +16 -16
  29. package/template/src/components/ui/table.tsx +114 -114
  30. package/template/src/components/ui/toggle.tsx +45 -45
  31. package/template/src/components/ui/tooltip.tsx +59 -59
  32. package/template/src/lib/utils.ts +6 -6
  33. package/template/src/main.tsx +10 -10
  34. package/template/tsconfig.app.json +31 -28
  35. package/template/tsconfig.json +2 -4
  36. package/template/tsconfig.node.json +26 -26
  37. package/template2/.env.example +8 -0
  38. package/template2/.husky/pre-commit +4 -0
  39. package/template2/.prettierrc +5 -0
  40. package/template2/README.md +73 -0
  41. package/template2/__tests__/example.test.ts +20 -0
  42. package/template2/_gitignore +37 -0
  43. package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -0
  44. package/template2/app/[locale]/(public)/login/page.tsx +83 -0
  45. package/template2/app/[locale]/layout.tsx +56 -0
  46. package/template2/app/[locale]/locales.ts +10 -0
  47. package/template2/app/[locale]/page.tsx +38 -0
  48. package/template2/app/api/clear-session/route.ts +10 -0
  49. package/template2/app/globals.css +127 -0
  50. package/template2/app/layout.tsx +7 -0
  51. package/template2/app/page.tsx +6 -0
  52. package/template2/components/AuthEventListener.tsx +22 -0
  53. package/template2/components/theme-provider.tsx +78 -0
  54. package/template2/components/ui/button.tsx +60 -0
  55. package/template2/components/ui/card.tsx +92 -0
  56. package/template2/components/ui/input.tsx +21 -0
  57. package/template2/components/ui/label.tsx +24 -0
  58. package/template2/components/ui/sonner.tsx +40 -0
  59. package/template2/components.json +22 -0
  60. package/template2/config/constants.ts +7 -0
  61. package/template2/config/env.ts +5 -0
  62. package/template2/contexts/translation-context.tsx +70 -0
  63. package/template2/eslint.config.mjs +18 -0
  64. package/template2/hoc/provider.tsx +27 -0
  65. package/template2/lib/paramsSerializer.ts +40 -0
  66. package/template2/lib/utils.ts +6 -0
  67. package/template2/locales/az.json +20 -0
  68. package/template2/locales/en.json +20 -0
  69. package/template2/next-env.d.ts +6 -0
  70. package/template2/next.config.ts +17 -0
  71. package/template2/orval.config.ts +66 -0
  72. package/template2/package.json +62 -0
  73. package/template2/pnpm-lock.yaml +6804 -0
  74. package/template2/postcss.config.mjs +7 -0
  75. package/template2/public/.gitkeep +0 -0
  76. package/template2/scripts/fix-generated-types.mjs +13 -0
  77. package/template2/services/generated/.gitkeep +2 -0
  78. package/template2/services/httpClient/httpClient.ts +70 -0
  79. package/template2/services/httpClient/orvalMutator.ts +10 -0
  80. package/template2/store/example-store.tsx +16 -0
  81. package/template2/store/user-store.tsx +29 -0
  82. package/template2/testing/msw/handlers/index.ts +6 -0
  83. package/template2/testing/msw/server.ts +4 -0
  84. package/template2/tsconfig.json +34 -0
  85. package/template2/tsconfig.tsbuildinfo +1 -0
  86. package/template2/vitest.config.ts +17 -0
  87. package/template2/vitest.setup.ts +7 -0
@@ -1,83 +1,83 @@
1
- import { Slot } from "@radix-ui/react-slot"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "@/lib/utils"
5
- import { Separator } from "@/components/ui/separator"
6
-
7
- const buttonGroupVariants = cva(
8
- "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
9
- {
10
- variants: {
11
- orientation: {
12
- horizontal:
13
- "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
14
- vertical:
15
- "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
16
- },
17
- },
18
- defaultVariants: {
19
- orientation: "horizontal",
20
- },
21
- }
22
- )
23
-
24
- function ButtonGroup({
25
- className,
26
- orientation,
27
- ...props
28
- }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
29
- return (
30
- <div
31
- role="group"
32
- data-slot="button-group"
33
- data-orientation={orientation}
34
- className={cn(buttonGroupVariants({ orientation }), className)}
35
- {...props}
36
- />
37
- )
38
- }
39
-
40
- function ButtonGroupText({
41
- className,
42
- asChild = false,
43
- ...props
44
- }: React.ComponentProps<"div"> & {
45
- asChild?: boolean
46
- }) {
47
- const Comp = asChild ? Slot : "div"
48
-
49
- return (
50
- <Comp
51
- className={cn(
52
- "bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
53
- className
54
- )}
55
- {...props}
56
- />
57
- )
58
- }
59
-
60
- function ButtonGroupSeparator({
61
- className,
62
- orientation = "vertical",
63
- ...props
64
- }: React.ComponentProps<typeof Separator>) {
65
- return (
66
- <Separator
67
- data-slot="button-group-separator"
68
- orientation={orientation}
69
- className={cn(
70
- "bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
71
- className
72
- )}
73
- {...props}
74
- />
75
- )
76
- }
77
-
78
- export {
79
- ButtonGroup,
80
- ButtonGroupSeparator,
81
- ButtonGroupText,
82
- buttonGroupVariants,
83
- }
1
+ import { Slot } from "@radix-ui/react-slot"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+
4
+ import { cn } from "@/lib/utils"
5
+ import { Separator } from "@/components/ui/separator"
6
+
7
+ const buttonGroupVariants = cva(
8
+ "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
9
+ {
10
+ variants: {
11
+ orientation: {
12
+ horizontal:
13
+ "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
14
+ vertical:
15
+ "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ orientation: "horizontal",
20
+ },
21
+ }
22
+ )
23
+
24
+ function ButtonGroup({
25
+ className,
26
+ orientation,
27
+ ...props
28
+ }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
29
+ return (
30
+ <div
31
+ role="group"
32
+ data-slot="button-group"
33
+ data-orientation={orientation}
34
+ className={cn(buttonGroupVariants({ orientation }), className)}
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ function ButtonGroupText({
41
+ className,
42
+ asChild = false,
43
+ ...props
44
+ }: React.ComponentProps<"div"> & {
45
+ asChild?: boolean
46
+ }) {
47
+ const Comp = asChild ? Slot : "div"
48
+
49
+ return (
50
+ <Comp
51
+ className={cn(
52
+ "bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
53
+ className
54
+ )}
55
+ {...props}
56
+ />
57
+ )
58
+ }
59
+
60
+ function ButtonGroupSeparator({
61
+ className,
62
+ orientation = "vertical",
63
+ ...props
64
+ }: React.ComponentProps<typeof Separator>) {
65
+ return (
66
+ <Separator
67
+ data-slot="button-group-separator"
68
+ orientation={orientation}
69
+ className={cn(
70
+ "bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
71
+ className
72
+ )}
73
+ {...props}
74
+ />
75
+ )
76
+ }
77
+
78
+ export {
79
+ ButtonGroup,
80
+ ButtonGroupSeparator,
81
+ ButtonGroupText,
82
+ buttonGroupVariants,
83
+ }
@@ -1,60 +1,60 @@
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 "@/lib/utils"
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
- destructive:
14
- "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15
- outline:
16
- "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
17
- secondary:
18
- "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
- ghost:
20
- "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
21
- link: "text-primary underline-offset-4 hover:underline",
22
- },
23
- size: {
24
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
25
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
26
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
27
- icon: "size-9",
28
- "icon-sm": "size-8",
29
- "icon-lg": "size-10",
30
- },
31
- },
32
- defaultVariants: {
33
- variant: "default",
34
- size: "default",
35
- },
36
- }
37
- )
38
-
39
- function Button({
40
- className,
41
- variant,
42
- size,
43
- asChild = false,
44
- ...props
45
- }: React.ComponentProps<"button"> &
46
- VariantProps<typeof buttonVariants> & {
47
- asChild?: boolean
48
- }) {
49
- const Comp = asChild ? Slot : "button"
50
-
51
- return (
52
- <Comp
53
- data-slot="button"
54
- className={cn(buttonVariants({ variant, size, className }))}
55
- {...props}
56
- />
57
- )
58
- }
59
-
60
- export { Button, buttonVariants }
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 "@/lib/utils"
6
+
7
+ const buttonVariants = cva(
8
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
+ destructive:
14
+ "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15
+ outline:
16
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
17
+ secondary:
18
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
+ ghost:
20
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
21
+ link: "text-primary underline-offset-4 hover:underline",
22
+ },
23
+ size: {
24
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
25
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
26
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
27
+ icon: "size-9",
28
+ "icon-sm": "size-8",
29
+ "icon-lg": "size-10",
30
+ },
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ size: "default",
35
+ },
36
+ }
37
+ )
38
+
39
+ function Button({
40
+ className,
41
+ variant,
42
+ size,
43
+ asChild = false,
44
+ ...props
45
+ }: React.ComponentProps<"button"> &
46
+ VariantProps<typeof buttonVariants> & {
47
+ asChild?: boolean
48
+ }) {
49
+ const Comp = asChild ? Slot : "button"
50
+
51
+ return (
52
+ <Comp
53
+ data-slot="button"
54
+ className={cn(buttonVariants({ variant, size, className }))}
55
+ {...props}
56
+ />
57
+ )
58
+ }
59
+
60
+ export { Button, buttonVariants }