startx 1.0.1 → 1.0.3

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 (147) hide show
  1. package/.dockerignore +4 -0
  2. package/apps/cli/src/commands/index.ts +1 -1
  3. package/apps/cli/src/commands/{common → test}/test.ts +4 -2
  4. package/apps/cli/tsconfig.json +0 -1
  5. package/apps/core-server/Dockerfile +5 -4
  6. package/apps/core-server/package.json +1 -1
  7. package/apps/core-server/tsconfig.json +1 -1
  8. package/apps/queue-worker/package.json +1 -1
  9. package/apps/queue-worker/tsconfig.json +1 -1
  10. package/apps/startx-cli/dist/index.mjs +68 -53
  11. package/apps/startx-cli/src/commands/package.ts +453 -0
  12. package/apps/startx-cli/src/configs/scripts.ts +18 -2
  13. package/apps/startx-cli/src/index.ts +2 -4
  14. package/apps/startx-cli/src/types.ts +2 -4
  15. package/apps/startx-cli/src/utils/inquirer.ts +8 -1
  16. package/apps/web-client/.dockerignore +4 -0
  17. package/apps/web-client/app/app.css +1 -0
  18. package/apps/web-client/app/components.json +23 -0
  19. package/apps/web-client/app/config/auth/auth-state.ts +59 -0
  20. package/apps/web-client/app/config/axios-client.ts +87 -0
  21. package/apps/web-client/app/config/env.ts +5 -0
  22. package/apps/web-client/app/entry.client.tsx +7 -0
  23. package/apps/web-client/app/eslint.config.ts +4 -0
  24. package/apps/web-client/app/root.tsx +77 -0
  25. package/apps/web-client/app/routes/home.tsx +12 -0
  26. package/apps/web-client/app/routes.ts +3 -0
  27. package/apps/web-client/eslint.config.ts +4 -0
  28. package/apps/web-client/package.json +55 -0
  29. package/apps/web-client/react-router.config.ts +7 -0
  30. package/apps/web-client/tsconfig.json +22 -0
  31. package/apps/web-client/vite-env.d.ts +8 -0
  32. package/apps/web-client/vite.config.ts +30 -0
  33. package/biome.json +5 -0
  34. package/configs/eslint-config/eslint.config.ts +1 -0
  35. package/configs/eslint-config/src/configs/base.ts +0 -1
  36. package/configs/eslint-config/src/configs/frontend.ts +1 -1
  37. package/configs/eslint-config/tsconfig.json +1 -1
  38. package/configs/typescript-config/tsconfig.frontend.json +1 -1
  39. package/configs/vitest-config/tsconfig.json +1 -1
  40. package/package.json +1 -1
  41. package/packages/@db/drizzle/tsconfig.json +1 -1
  42. package/packages/@db/sqlite/tsconfig.json +1 -1
  43. package/packages/@repo/env/package.json +1 -2
  44. package/packages/@repo/env/src/utils.ts +17 -11
  45. package/packages/@repo/lib/package.json +3 -1
  46. package/packages/@repo/lib/src/session-module/i-session.ts +108 -0
  47. package/packages/@repo/lib/src/session-module/index.ts +8 -111
  48. package/packages/@repo/lib/src/session-module/redis-session.ts +44 -0
  49. package/packages/@repo/lib/tsconfig.json +0 -1
  50. package/packages/@repo/logger/package.json +0 -1
  51. package/packages/@repo/logger/tsconfig.json +1 -1
  52. package/packages/@repo/mail/tsconfig.json +1 -1
  53. package/packages/@repo/redis/tsconfig.json +1 -1
  54. package/packages/aix/package.json +2 -0
  55. package/packages/aix/src/providers/ai-interface.ts +4 -4
  56. package/packages/aix/src/providers/bedrock/bedrock.ts +261 -0
  57. package/packages/aix/src/providers/default-models.ts +65 -0
  58. package/packages/aix/src/providers/openai/openai.ts +2 -2
  59. package/packages/aix/src/providers/providers.ts +11 -0
  60. package/packages/aix/src/providers/types.ts +1 -1
  61. package/packages/{constants → common}/package.json +4 -2
  62. package/packages/{constants/src/index.ts → common/src/constants.ts} +0 -5
  63. package/packages/common/src/types/users.ts +10 -0
  64. package/packages/{constants → common}/tsconfig.json +0 -3
  65. package/packages/ui/components.json +15 -8
  66. package/packages/ui/package.json +23 -36
  67. package/packages/ui/src/api/axios/i-client.ts +40 -0
  68. package/packages/ui/src/api/index.ts +6 -0
  69. package/packages/ui/src/api/query-provider.tsx +34 -0
  70. package/packages/ui/src/api/use-api/api-builder.ts +139 -0
  71. package/packages/ui/src/api/use-api/api-helpers.ts +165 -0
  72. package/packages/ui/src/api/use-api/api-types.ts +138 -0
  73. package/packages/ui/src/api/use-api/query-factory.ts +66 -0
  74. package/packages/ui/src/api/use-api/react-query/types.ts +64 -0
  75. package/packages/ui/src/api/use-api/react-query/use-api-client.ts +56 -0
  76. package/packages/ui/src/api/use-api/react-query/use-api.ts +297 -0
  77. package/packages/ui/src/components/custom/form-wrapper.tsx +113 -160
  78. package/packages/ui/src/components/custom/grid-component.tsx +4 -4
  79. package/packages/ui/src/components/custom/hover-tool.tsx +1 -1
  80. package/packages/ui/src/components/custom/image-picker.tsx +18 -20
  81. package/packages/ui/src/components/custom/no-content.tsx +6 -16
  82. package/packages/ui/src/components/custom/page-section.tsx +14 -17
  83. package/packages/ui/src/components/custom/simple-popover.tsx +5 -9
  84. package/packages/ui/src/components/custom/theme-provider.tsx +117 -42
  85. package/packages/ui/src/components/custom/typography.tsx +20 -22
  86. package/packages/ui/src/components/extensions/timeline.tsx +100 -0
  87. package/packages/ui/src/components/ui/alert-dialog.tsx +46 -108
  88. package/packages/ui/src/components/ui/avatar.tsx +79 -42
  89. package/packages/ui/src/components/ui/badge.tsx +29 -34
  90. package/packages/ui/src/components/ui/breadcrumb.tsx +65 -81
  91. package/packages/ui/src/components/ui/button.tsx +80 -80
  92. package/packages/ui/src/components/ui/card.tsx +48 -69
  93. package/packages/ui/src/components/ui/carousel.tsx +184 -211
  94. package/packages/ui/src/components/ui/checkbox.tsx +21 -24
  95. package/packages/ui/src/components/ui/command.tsx +121 -102
  96. package/packages/ui/src/components/ui/dialog.tsx +45 -32
  97. package/packages/ui/src/components/ui/dropdown-menu.tsx +45 -33
  98. package/packages/ui/src/components/ui/field.tsx +218 -0
  99. package/packages/ui/src/components/ui/form.tsx +63 -76
  100. package/packages/ui/src/components/ui/input-group.tsx +137 -0
  101. package/packages/ui/src/components/ui/input-otp.tsx +60 -50
  102. package/packages/ui/src/components/ui/input.tsx +16 -15
  103. package/packages/ui/src/components/ui/label.tsx +14 -17
  104. package/packages/ui/src/components/ui/multiple-select.tsx +22 -33
  105. package/packages/ui/src/components/ui/popover.tsx +20 -8
  106. package/packages/ui/src/components/ui/select.tsx +33 -34
  107. package/packages/ui/src/components/ui/separator.tsx +8 -8
  108. package/packages/ui/src/components/ui/sheet.tsx +32 -59
  109. package/packages/ui/src/components/ui/sidebar.tsx +654 -0
  110. package/packages/ui/src/components/ui/skeleton.tsx +2 -8
  111. package/packages/ui/src/components/ui/sonner.tsx +39 -0
  112. package/packages/ui/src/components/ui/spinner.tsx +6 -13
  113. package/packages/ui/src/components/ui/switch.tsx +15 -10
  114. package/packages/ui/src/components/ui/table.tsx +48 -89
  115. package/packages/ui/src/components/ui/tabs.tsx +37 -15
  116. package/packages/ui/src/components/ui/textarea.tsx +13 -13
  117. package/packages/ui/src/components/ui/tooltip.tsx +37 -23
  118. package/packages/ui/src/{components/hooks → hooks}/event/use-click.tsx +6 -10
  119. package/packages/ui/src/hooks/time/use-timer.tsx +51 -0
  120. package/packages/ui/src/hooks/use-media-query.tsx +19 -0
  121. package/packages/ui/src/hooks/use-mobile.tsx +17 -0
  122. package/packages/ui/src/{components/hooks → hooks}/use-update-effect.tsx +2 -2
  123. package/packages/ui/src/lib/utils.ts +113 -0
  124. package/packages/ui/src/styles/globals.css +311 -0
  125. package/packages/ui/src/styles/tailwind.css +89 -0
  126. package/packages/ui/tsconfig.json +7 -9
  127. package/pnpm-workspace.yaml +74 -64
  128. package/packages/ui/postcss.config.mjs +0 -9
  129. package/packages/ui/src/components/extensions/carousel.tsx +0 -392
  130. package/packages/ui/src/components/hooks/time/useTimer.tsx +0 -51
  131. package/packages/ui/src/components/hooks/use-media-query.tsx +0 -19
  132. package/packages/ui/src/components/lib/utils.ts +0 -242
  133. package/packages/ui/src/components/ui/timeline.tsx +0 -118
  134. package/packages/ui/src/components/util/n-formattor.ts +0 -22
  135. package/packages/ui/src/components/util/storage.ts +0 -37
  136. package/packages/ui/src/globals.css +0 -87
  137. package/packages/ui/tailwind.config.ts +0 -94
  138. /package/packages/{constants → common}/eslint.config.ts +0 -0
  139. /package/packages/{constants → common}/src/api.ts +0 -0
  140. /package/packages/{constants → common}/src/time.ts +0 -0
  141. /package/packages/{constants → common}/vitest.config.ts +0 -0
  142. /package/packages/ui/src/{components/hooks/time/useDebounce.tsx → hooks/time/use-debounce.tsx} +0 -0
  143. /package/packages/ui/src/{components/hooks/time/useInterval.tsx → hooks/time/use-interval.tsx} +0 -0
  144. /package/packages/ui/src/{components/hooks/time/useTimeout.tsx → hooks/time/use-timeout.tsx} +0 -0
  145. /package/packages/ui/src/{components/hooks → hooks}/use-persistent-storage.tsx +0 -0
  146. /package/packages/ui/src/{components/hooks → hooks}/use-window-dimension.tsx +0 -0
  147. /package/packages/ui/src/{components/sonner.tsx → sonner.ts} +0 -0
@@ -1,91 +1,70 @@
1
+ import * as React from "react";
1
2
 
2
- import { cn } from "../lib/utils";
3
+ import { cn } from "@repo/ui/lib/utils";
3
4
 
4
- function Card({ className, ...props }: React.ComponentProps<"div">) {
5
- return (
6
- <div
7
- data-slot="card"
8
- className={cn(
9
- "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
10
- className
11
- )}
12
- {...props}
13
- />
14
- );
5
+ function Card({ className, size = "default", ...props }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
6
+ return (
7
+ <div
8
+ data-slot="card"
9
+ data-size={size}
10
+ className={cn(
11
+ "group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
12
+ className
13
+ )}
14
+ {...props}
15
+ />
16
+ );
15
17
  }
16
18
 
17
19
  function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
18
- return (
19
- <div
20
- data-slot="card-header"
21
- className={cn(
22
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
23
- className
24
- )}
25
- {...props}
26
- />
27
- );
20
+ return (
21
+ <div
22
+ data-slot="card-header"
23
+ className={cn(
24
+ "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
25
+ className
26
+ )}
27
+ {...props}
28
+ />
29
+ );
28
30
  }
29
31
 
30
32
  function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
31
- return (
32
- <div
33
- data-slot="card-title"
34
- className={cn("leading-none font-semibold", className)}
35
- {...props}
36
- />
37
- );
33
+ return (
34
+ <div
35
+ data-slot="card-title"
36
+ className={cn("cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className)}
37
+ {...props}
38
+ />
39
+ );
38
40
  }
39
41
 
40
42
  function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
41
- return (
42
- <div
43
- data-slot="card-description"
44
- className={cn("text-muted-foreground text-sm", className)}
45
- {...props}
46
- />
47
- );
43
+ return <div data-slot="card-description" className={cn("text-sm text-muted-foreground", className)} {...props} />;
48
44
  }
49
45
 
50
46
  function CardAction({ className, ...props }: React.ComponentProps<"div">) {
51
- return (
52
- <div
53
- data-slot="card-action"
54
- className={cn(
55
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
56
- className
57
- )}
58
- {...props}
59
- />
60
- );
47
+ return (
48
+ <div
49
+ data-slot="card-action"
50
+ className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
51
+ {...props}
52
+ />
53
+ );
61
54
  }
62
55
 
63
56
  function CardContent({ className, ...props }: React.ComponentProps<"div">) {
64
- return (
65
- <div
66
- data-slot="card-content"
67
- className={cn("px-6", className)}
68
- {...props}
69
- />
70
- );
57
+ return <div data-slot="card-content" className={cn("px-4 group-data-[size=sm]/card:px-3", className)} {...props} />;
71
58
  }
72
59
 
73
60
  function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
74
- return (
75
- <div
76
- data-slot="card-footer"
77
- className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
78
- {...props}
79
- />
80
- );
61
+ return (
62
+ <div
63
+ data-slot="card-footer"
64
+ className={cn("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3", className)}
65
+ {...props}
66
+ />
67
+ );
81
68
  }
82
69
 
83
- export {
84
- Card,
85
- CardHeader,
86
- CardFooter,
87
- CardTitle,
88
- CardAction,
89
- CardDescription,
90
- CardContent,
91
- };
70
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
@@ -1,243 +1,216 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import useEmblaCarousel, {
4
- type UseEmblaCarouselType,
5
- } from "embla-carousel-react"
6
- import { ArrowLeft, ArrowRight } from "lucide-react"
7
- import * as React from "react"
3
+ import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
4
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
5
+ import * as React from "react";
8
6
 
9
- import { Button } from "@/components/ui/button"
7
+ import { Button } from "@repo/ui/components/ui/button";
8
+ import { cn } from "@repo/ui/lib/utils";
10
9
 
11
- import { cn } from "../lib/utils"
12
-
13
-
14
- type CarouselApi = UseEmblaCarouselType[1]
15
- type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
16
- type CarouselOptions = UseCarouselParameters[0]
17
- type CarouselPlugin = UseCarouselParameters[1]
10
+ type CarouselApi = UseEmblaCarouselType[1];
11
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
12
+ type CarouselOptions = UseCarouselParameters[0];
13
+ type CarouselPlugin = UseCarouselParameters[1];
18
14
 
19
15
  type CarouselProps = {
20
- opts?: CarouselOptions;
21
- plugins?: CarouselPlugin;
22
- orientation?: "horizontal" | "vertical";
23
- setApi?: (api: CarouselApi) => void;
24
- }
16
+ opts?: CarouselOptions;
17
+ plugins?: CarouselPlugin;
18
+ orientation?: "horizontal" | "vertical";
19
+ setApi?: (api: CarouselApi) => void;
20
+ };
25
21
 
26
22
  type CarouselContextProps = {
27
- carouselRef: ReturnType<typeof useEmblaCarousel>[0];
28
- api: ReturnType<typeof useEmblaCarousel>[1];
29
- scrollPrev: () => void;
30
- scrollNext: () => void;
31
- canScrollPrev: boolean;
32
- canScrollNext: boolean;
33
- } & CarouselProps
23
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
24
+ api: ReturnType<typeof useEmblaCarousel>[1];
25
+ scrollPrev: () => void;
26
+ scrollNext: () => void;
27
+ canScrollPrev: boolean;
28
+ canScrollNext: boolean;
29
+ } & CarouselProps;
34
30
 
35
- const CarouselContext = React.createContext<CarouselContextProps | null>(null)
31
+ const CarouselContext = React.createContext<CarouselContextProps | null>(null);
36
32
 
37
33
  function useCarousel() {
38
- const context = React.useContext(CarouselContext)
34
+ const context = React.useContext(CarouselContext);
39
35
 
40
- if (!context) {
41
- throw new Error("useCarousel must be used within a <Carousel />")
42
- }
36
+ if (!context) {
37
+ throw new Error("useCarousel must be used within a <Carousel />");
38
+ }
43
39
 
44
- return context
40
+ return context;
45
41
  }
46
42
 
47
43
  function Carousel({
48
- orientation = "horizontal",
49
- opts,
50
- setApi,
51
- plugins,
52
- className,
53
- children,
54
- ...props
44
+ orientation = "horizontal",
45
+ opts,
46
+ setApi,
47
+ plugins,
48
+ className,
49
+ children,
50
+ ...props
55
51
  }: React.ComponentProps<"div"> & CarouselProps) {
56
- const [carouselRef, api] = useEmblaCarousel(
57
- {
58
- ...opts,
59
- axis: orientation === "horizontal" ? "x" : "y",
60
- },
61
- plugins
62
- )
63
- const [canScrollPrev, setCanScrollPrev] = React.useState(false)
64
- const [canScrollNext, setCanScrollNext] = React.useState(false)
65
-
66
- const onSelect = React.useCallback((api: CarouselApi) => {
67
- if (!api) return
68
- setCanScrollPrev(api.canScrollPrev())
69
- setCanScrollNext(api.canScrollNext())
70
- }, [])
71
-
72
- const scrollPrev = React.useCallback(() => {
73
- api?.scrollPrev()
74
- }, [api])
75
-
76
- const scrollNext = React.useCallback(() => {
77
- api?.scrollNext()
78
- }, [api])
79
-
80
- const handleKeyDown = React.useCallback(
81
- (event: React.KeyboardEvent<HTMLDivElement>) => {
82
- if (event.key === "ArrowLeft") {
83
- event.preventDefault()
84
- scrollPrev()
85
- } else if (event.key === "ArrowRight") {
86
- event.preventDefault()
87
- scrollNext()
88
- }
89
- },
90
- [scrollPrev, scrollNext]
91
- )
92
-
93
- React.useEffect(() => {
94
- if (!api || !setApi) return
95
- setApi(api)
96
- }, [api, setApi])
97
-
98
- React.useEffect(() => {
99
- if (!api) return
100
- onSelect(api)
101
- api.on("reInit", onSelect)
102
- api.on("select", onSelect)
103
-
104
- return () => {
105
- api?.off("select", onSelect)
106
- }
107
- }, [api, onSelect])
108
-
109
- return (
110
- <CarouselContext.Provider
111
- value={{
112
- carouselRef,
113
- api,
114
- opts,
115
- orientation:
116
- orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
117
- scrollPrev,
118
- scrollNext,
119
- canScrollPrev,
120
- canScrollNext,
121
- }}
122
- >
123
- <div
124
- onKeyDownCapture={handleKeyDown}
125
- className={cn("relative", className)}
126
- role="region"
127
- aria-roledescription="carousel"
128
- data-slot="carousel"
129
- {...props}
130
- >
131
- {children}
132
- </div>
133
- </CarouselContext.Provider>
134
- )
52
+ const [carouselRef, api] = useEmblaCarousel(
53
+ {
54
+ ...opts,
55
+ axis: orientation === "horizontal" ? "x" : "y",
56
+ },
57
+ plugins
58
+ );
59
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
60
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
61
+
62
+ const onSelect = React.useCallback((api: CarouselApi) => {
63
+ if (!api) return;
64
+ setCanScrollPrev(api.canScrollPrev());
65
+ setCanScrollNext(api.canScrollNext());
66
+ }, []);
67
+
68
+ const scrollPrev = React.useCallback(() => {
69
+ api?.scrollPrev();
70
+ }, [api]);
71
+
72
+ const scrollNext = React.useCallback(() => {
73
+ api?.scrollNext();
74
+ }, [api]);
75
+
76
+ const handleKeyDown = React.useCallback(
77
+ (event: React.KeyboardEvent<HTMLDivElement>) => {
78
+ if (event.key === "ArrowLeft") {
79
+ event.preventDefault();
80
+ scrollPrev();
81
+ } else if (event.key === "ArrowRight") {
82
+ event.preventDefault();
83
+ scrollNext();
84
+ }
85
+ },
86
+ [scrollPrev, scrollNext]
87
+ );
88
+
89
+ React.useEffect(() => {
90
+ if (!api || !setApi) return;
91
+ setApi(api);
92
+ }, [api, setApi]);
93
+
94
+ React.useEffect(() => {
95
+ if (!api) return;
96
+ onSelect(api);
97
+ api.on("reInit", onSelect);
98
+ api.on("select", onSelect);
99
+
100
+ return () => {
101
+ api?.off("select", onSelect);
102
+ };
103
+ }, [api, onSelect]);
104
+
105
+ return (
106
+ <CarouselContext.Provider
107
+ value={{
108
+ carouselRef,
109
+ api,
110
+ opts,
111
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
112
+ scrollPrev,
113
+ scrollNext,
114
+ canScrollPrev,
115
+ canScrollNext,
116
+ }}
117
+ >
118
+ <div
119
+ onKeyDownCapture={handleKeyDown}
120
+ className={cn("relative", className)}
121
+ role="region"
122
+ aria-roledescription="carousel"
123
+ data-slot="carousel"
124
+ {...props}
125
+ >
126
+ {children}
127
+ </div>
128
+ </CarouselContext.Provider>
129
+ );
135
130
  }
136
131
 
137
132
  function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
138
- const { carouselRef, orientation } = useCarousel()
139
-
140
- return (
141
- <div
142
- ref={carouselRef}
143
- className="overflow-hidden"
144
- data-slot="carousel-content"
145
- >
146
- <div
147
- className={cn(
148
- "flex",
149
- orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
150
- className
151
- )}
152
- {...props}
153
- />
154
- </div>
155
- )
133
+ const { carouselRef, orientation } = useCarousel();
134
+
135
+ return (
136
+ <div ref={carouselRef} className="overflow-hidden" data-slot="carousel-content">
137
+ <div className={cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)} {...props} />
138
+ </div>
139
+ );
156
140
  }
157
141
 
158
142
  function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
159
- const { orientation } = useCarousel()
160
-
161
- return (
162
- <div
163
- role="group"
164
- aria-roledescription="slide"
165
- data-slot="carousel-item"
166
- className={cn(
167
- "min-w-0 shrink-0 grow-0 basis-full",
168
- orientation === "horizontal" ? "pl-4" : "pt-4",
169
- className
170
- )}
171
- {...props}
172
- />
173
- )
143
+ const { orientation } = useCarousel();
144
+
145
+ return (
146
+ <div
147
+ role="group"
148
+ aria-roledescription="slide"
149
+ data-slot="carousel-item"
150
+ className={cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className)}
151
+ {...props}
152
+ />
153
+ );
174
154
  }
175
155
 
176
156
  function CarouselPrevious({
177
- className,
178
- variant = "outline",
179
- size = "icon",
180
- ...props
157
+ className,
158
+ variant = "outline",
159
+ size = "icon-sm",
160
+ ...props
181
161
  }: React.ComponentProps<typeof Button>) {
182
- const { orientation, scrollPrev, canScrollPrev } = useCarousel()
183
-
184
- return (
185
- <Button
186
- data-slot="carousel-previous"
187
- variant={variant}
188
- size={size}
189
- className={cn(
190
- "absolute size-8 rounded-full",
191
- orientation === "horizontal"
192
- ? "top-1/2 -left-12 -translate-y-1/2"
193
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
194
- className
195
- )}
196
- disabled={!canScrollPrev}
197
- onClick={scrollPrev}
198
- {...props}
199
- >
200
- <ArrowLeft />
201
- <span className="sr-only">Previous slide</span>
202
- </Button>
203
- )
162
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
163
+
164
+ return (
165
+ <Button
166
+ data-slot="carousel-previous"
167
+ variant={variant}
168
+ size={size}
169
+ className={cn(
170
+ "absolute touch-manipulation rounded-full",
171
+ orientation === "horizontal"
172
+ ? "top-1/2 -left-12 -translate-y-1/2"
173
+ : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
174
+ className
175
+ )}
176
+ disabled={!canScrollPrev}
177
+ onClick={scrollPrev}
178
+ {...props}
179
+ >
180
+ <ChevronLeftIcon className="cn-rtl-flip" />
181
+ <span className="sr-only">Previous slide</span>
182
+ </Button>
183
+ );
204
184
  }
205
185
 
206
186
  function CarouselNext({
207
- className,
208
- variant = "outline",
209
- size = "icon",
210
- ...props
187
+ className,
188
+ variant = "outline",
189
+ size = "icon-sm",
190
+ ...props
211
191
  }: React.ComponentProps<typeof Button>) {
212
- const { orientation, scrollNext, canScrollNext } = useCarousel()
213
-
214
- return (
215
- <Button
216
- data-slot="carousel-next"
217
- variant={variant}
218
- size={size}
219
- className={cn(
220
- "absolute size-8 rounded-full",
221
- orientation === "horizontal"
222
- ? "top-1/2 -right-12 -translate-y-1/2"
223
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
224
- className
225
- )}
226
- disabled={!canScrollNext}
227
- onClick={scrollNext}
228
- {...props}
229
- >
230
- <ArrowRight />
231
- <span className="sr-only">Next slide</span>
232
- </Button>
233
- )
192
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
193
+
194
+ return (
195
+ <Button
196
+ data-slot="carousel-next"
197
+ variant={variant}
198
+ size={size}
199
+ className={cn(
200
+ "absolute touch-manipulation rounded-full",
201
+ orientation === "horizontal"
202
+ ? "top-1/2 -right-12 -translate-y-1/2"
203
+ : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
204
+ className
205
+ )}
206
+ disabled={!canScrollNext}
207
+ onClick={scrollNext}
208
+ {...props}
209
+ >
210
+ <ChevronRightIcon className="cn-rtl-flip" />
211
+ <span className="sr-only">Next slide</span>
212
+ </Button>
213
+ );
234
214
  }
235
215
 
236
- export {
237
- type CarouselApi,
238
- Carousel,
239
- CarouselContent,
240
- CarouselItem,
241
- CarouselPrevious,
242
- CarouselNext,
243
- }
216
+ export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel };
@@ -1,32 +1,29 @@
1
1
  "use client";
2
2
 
3
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
3
  import { CheckIcon } from "lucide-react";
5
- import type * as React from "react";
4
+ import { Checkbox as CheckboxPrimitive } from "radix-ui";
5
+ import * as React from "react";
6
6
 
7
- import { cn } from "../lib/utils";
7
+ import { cn } from "@repo/ui/lib/utils";
8
8
 
9
- function Checkbox({
10
- className,
11
- ...props
12
- }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
13
- return (
14
- <CheckboxPrimitive.Root
15
- data-slot="checkbox"
16
- className={cn(
17
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
18
- className
19
- )}
20
- {...props}
21
- >
22
- <CheckboxPrimitive.Indicator
23
- data-slot="checkbox-indicator"
24
- className="flex items-center justify-center text-current transition-none"
25
- >
26
- <CheckIcon className="size-3.5" />
27
- </CheckboxPrimitive.Indicator>
28
- </CheckboxPrimitive.Root>
29
- );
9
+ function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
10
+ return (
11
+ <CheckboxPrimitive.Root
12
+ data-slot="checkbox"
13
+ className={cn(
14
+ "peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
15
+ className
16
+ )}
17
+ {...props}
18
+ >
19
+ <CheckboxPrimitive.Indicator
20
+ data-slot="checkbox-indicator"
21
+ className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
22
+ >
23
+ <CheckIcon />
24
+ </CheckboxPrimitive.Indicator>
25
+ </CheckboxPrimitive.Root>
26
+ );
30
27
  }
31
28
 
32
29
  export { Checkbox };