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,19 +1,20 @@
1
- import { cn } from "../lib/utils";
2
- export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@repo/ui/lib/utils";
4
+
3
5
  function Input({ className, type, ...props }: React.ComponentProps<"input">) {
4
- return (
5
- <input
6
- type={type}
7
- data-slot="input"
8
- className={cn(
9
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-background border-b-1 border-b-primary/40 shadow px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
10
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
11
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
12
- className
13
- )}
14
- {...props}
15
- />
16
- );
6
+ return (
7
+ <input
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
12
+ className
13
+ )}
14
+ {...props}
15
+ />
16
+ );
17
17
  }
18
18
 
19
+ export type InputProps = React.ComponentProps<"input">;
19
20
  export { Input };
@@ -1,24 +1,21 @@
1
1
  "use client";
2
2
 
3
- import * as LabelPrimitive from "@radix-ui/react-label";
4
- import type * as React from "react";
3
+ import { Label as LabelPrimitive } from "radix-ui";
4
+ import * as React from "react";
5
5
 
6
- import { cn } from "../lib/utils";
6
+ import { cn } from "@repo/ui/lib/utils";
7
7
 
8
- function Label({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
- return (
13
- <LabelPrimitive.Root
14
- data-slot="label"
15
- className={cn(
16
- "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
- className
18
- )}
19
- {...props}
20
- />
21
- );
8
+ function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
9
+ return (
10
+ <LabelPrimitive.Root
11
+ data-slot="label"
12
+ className={cn(
13
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ );
22
19
  }
23
20
 
24
21
  export { Label };
@@ -5,8 +5,8 @@ import { X } from "lucide-react";
5
5
  import * as React from "react";
6
6
  import { forwardRef, useEffect } from "react";
7
7
 
8
+ import { cn } from "@repo/ui/lib/utils";
8
9
  import { Command, CommandGroup, CommandItem, CommandList } from "./command";
9
- import { cn } from "../lib/utils";
10
10
  import { Badge } from "../ui/badge";
11
11
 
12
12
  export interface Option {
@@ -135,24 +135,23 @@ function isOptionsExist(groupOption: GroupOption, targetOption: Option[]) {
135
135
  *
136
136
  * @reference: https://github.com/hsuanyi-chou/shadcn-ui-expansions/issues/34#issuecomment-1949561607
137
137
  **/
138
- const CommandEmpty = forwardRef<
139
- HTMLDivElement,
140
- React.ComponentProps<typeof CommandPrimitive.Empty>
141
- >(({ className, ...props }, forwardedRef) => {
142
- const render = useCommandState(state => state.filtered.count === 0);
143
-
144
- if (!render) return null;
145
-
146
- return (
147
- <div
148
- ref={forwardedRef}
149
- className={cn("py-6 text-center text-sm", className)}
150
- // cmdk-empty=""
151
- role="presentation"
152
- {...props}
153
- />
154
- );
155
- });
138
+ const CommandEmpty = forwardRef<HTMLDivElement, React.ComponentProps<typeof CommandPrimitive.Empty>>(
139
+ ({ className, ...props }, forwardedRef) => {
140
+ const render = useCommandState(state => state.filtered.count === 0);
141
+
142
+ if (!render) return null;
143
+
144
+ return (
145
+ <div
146
+ ref={forwardedRef}
147
+ className={cn("py-6 text-center text-sm", className)}
148
+ // cmdk-empty=""
149
+ role="presentation"
150
+ {...props}
151
+ />
152
+ );
153
+ }
154
+ );
156
155
 
157
156
  CommandEmpty.displayName = "CommandEmpty";
158
157
 
@@ -188,9 +187,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
188
187
  const [isLoading, setIsLoading] = React.useState(false);
189
188
 
190
189
  const [selected, setSelected] = React.useState<Option[]>(value ?? []);
191
- const [options, setOptions] = React.useState<GroupOption>(
192
- transToGroupOption(arrayDefaultOptions, groupBy)
193
- );
190
+ const [options, setOptions] = React.useState<GroupOption>(transToGroupOption(arrayDefaultOptions, groupBy));
194
191
  const [inputValue, setInputValue] = React.useState("");
195
192
  const debouncedSearchTerm = useDebounce(inputValue, delay ?? 500);
196
193
 
@@ -334,10 +331,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
334
331
  return <CommandEmpty>{emptyIndicator}</CommandEmpty>;
335
332
  }, [creatable, emptyIndicator, onSearch, options]);
336
333
 
337
- const selectables = React.useMemo<GroupOption>(
338
- () => removePickedOption(options, selected),
339
- [options, selected]
340
- );
334
+ const selectables = React.useMemo<GroupOption>(() => removePickedOption(options, selected), [options, selected]);
341
335
 
342
336
  /** Avoid Creatable Selector freezing or lagging when paste a long string. */
343
337
  const commandFilter = React.useCallback(() => {
@@ -362,9 +356,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
362
356
  commandProps?.onKeyDown?.(e);
363
357
  }}
364
358
  className={cn("h-auto max-h-fit overflow-visible bg-transparent", commandProps?.className)}
365
- shouldFilter={
366
- commandProps?.shouldFilter !== undefined ? commandProps.shouldFilter : !onSearch
367
- } // When onSearch is provided, we don't want to filter the options. You can still override it.
359
+ shouldFilter={commandProps?.shouldFilter !== undefined ? commandProps.shouldFilter : !onSearch} // When onSearch is provided, we don't want to filter the options. You can still override it.
368
360
  filter={commandFilter()}
369
361
  >
370
362
  <div
@@ -484,10 +476,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
484
476
  setSelected(newOptions);
485
477
  onChange?.(newOptions);
486
478
  }}
487
- className={cn(
488
- "cursor-pointer",
489
- option.disable && "cursor-default text-muted-foreground"
490
- )}
479
+ className={cn("cursor-pointer", option.disable && "cursor-default text-muted-foreground")}
491
480
  >
492
481
  {option.label}
493
482
  </CommandItem>
@@ -1,9 +1,9 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
- import * as PopoverPrimitive from '@radix-ui/react-popover';
4
- import type * as React from 'react';
3
+ import { Popover as PopoverPrimitive } from "radix-ui";
4
+ import * as React from "react";
5
5
 
6
- import { cn } from '../lib/utils';
6
+ import { cn } from "@repo/ui/lib/utils";
7
7
 
8
8
  function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
9
9
  return <PopoverPrimitive.Root data-slot="popover" {...props} />;
@@ -15,7 +15,7 @@ function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimiti
15
15
 
16
16
  function PopoverContent({
17
17
  className,
18
- align = 'center',
18
+ align = "center",
19
19
  sideOffset = 4,
20
20
  ...props
21
21
  }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
@@ -26,8 +26,8 @@ function PopoverContent({
26
26
  align={align}
27
27
  sideOffset={sideOffset}
28
28
  className={cn(
29
- 'bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
30
- className,
29
+ "z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
30
+ className
31
31
  )}
32
32
  {...props}
33
33
  />
@@ -39,4 +39,16 @@ function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitiv
39
39
  return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
40
40
  }
41
41
 
42
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
42
+ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
43
+ return <div data-slot="popover-header" className={cn("flex flex-col gap-0.5 text-sm", className)} {...props} />;
44
+ }
45
+
46
+ function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
47
+ return <div data-slot="popover-title" className={cn("font-medium", className)} {...props} />;
48
+ }
49
+
50
+ function PopoverDescription({ className, ...props }: React.ComponentProps<"p">) {
51
+ return <p data-slot="popover-description" className={cn("text-muted-foreground", className)} {...props} />;
52
+ }
53
+
54
+ export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
 
3
- import * as SelectPrimitive from "@radix-ui/react-select";
4
3
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
5
- import type * as React from "react";
4
+ import { Select as SelectPrimitive } 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
9
  function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
10
10
  return <SelectPrimitive.Root data-slot="select" {...props} />;
11
11
  }
12
12
 
13
- function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
14
- return <SelectPrimitive.Group data-slot="select-group" {...props} />;
13
+ function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
14
+ return <SelectPrimitive.Group data-slot="select-group" className={cn("scroll-my-1 p-1", className)} {...props} />;
15
15
  }
16
16
 
17
17
  function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
@@ -31,14 +31,14 @@ function SelectTrigger({
31
31
  data-slot="select-trigger"
32
32
  data-size={size}
33
33
  className={cn(
34
- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
34
+ "flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none 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 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
35
35
  className
36
36
  )}
37
37
  {...props}
38
38
  >
39
39
  {children}
40
40
  <SelectPrimitive.Icon asChild>
41
- <ChevronDownIcon className="size-4 opacity-50" />
41
+ <ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
42
42
  </SelectPrimitive.Icon>
43
43
  </SelectPrimitive.Trigger>
44
44
  );
@@ -47,28 +47,31 @@ function SelectTrigger({
47
47
  function SelectContent({
48
48
  className,
49
49
  children,
50
- position = "popper",
50
+ position = "item-aligned",
51
+ align = "center",
51
52
  ...props
52
53
  }: React.ComponentProps<typeof SelectPrimitive.Content>) {
53
54
  return (
54
55
  <SelectPrimitive.Portal>
55
56
  <SelectPrimitive.Content
56
57
  data-slot="select-content"
58
+ data-align-trigger={position === "item-aligned"}
57
59
  className={cn(
58
- "bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
60
+ "relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
59
61
  position === "popper" &&
60
62
  "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
61
63
  className
62
64
  )}
63
65
  position={position}
66
+ align={align}
64
67
  {...props}
65
68
  >
66
69
  <SelectScrollUpButton />
67
70
  <SelectPrimitive.Viewport
71
+ data-position={position}
68
72
  className={cn(
69
- "p-1",
70
- position === "popper" &&
71
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
73
+ "data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
74
+ position === "popper" && ""
72
75
  )}
73
76
  >
74
77
  {children}
@@ -83,29 +86,25 @@ function SelectLabel({ className, ...props }: React.ComponentProps<typeof Select
83
86
  return (
84
87
  <SelectPrimitive.Label
85
88
  data-slot="select-label"
86
- className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
89
+ className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
87
90
  {...props}
88
91
  />
89
92
  );
90
93
  }
91
94
 
92
- function SelectItem({
93
- className,
94
- children,
95
- ...props
96
- }: React.ComponentProps<typeof SelectPrimitive.Item>) {
95
+ function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {
97
96
  return (
98
97
  <SelectPrimitive.Item
99
98
  data-slot="select-item"
100
99
  className={cn(
101
- "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
100
+ "relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
102
101
  className
103
102
  )}
104
103
  {...props}
105
104
  >
106
- <span className="absolute right-2 flex size-3.5 items-center justify-center">
105
+ <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
107
106
  <SelectPrimitive.ItemIndicator>
108
- <CheckIcon className="size-4" />
107
+ <CheckIcon className="pointer-events-none" />
109
108
  </SelectPrimitive.ItemIndicator>
110
109
  </span>
111
110
  <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
@@ -113,30 +112,27 @@ function SelectItem({
113
112
  );
114
113
  }
115
114
 
116
- function SelectSeparator({
117
- className,
118
- ...props
119
- }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
115
+ function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
120
116
  return (
121
117
  <SelectPrimitive.Separator
122
118
  data-slot="select-separator"
123
- className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
119
+ className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
124
120
  {...props}
125
121
  />
126
122
  );
127
123
  }
128
124
 
129
- function SelectScrollUpButton({
130
- className,
131
- ...props
132
- }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
125
+ function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
133
126
  return (
134
127
  <SelectPrimitive.ScrollUpButton
135
128
  data-slot="select-scroll-up-button"
136
- className={cn("flex cursor-default items-center justify-center py-1", className)}
129
+ className={cn(
130
+ "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
131
+ className
132
+ )}
137
133
  {...props}
138
134
  >
139
- <ChevronUpIcon className="size-4" />
135
+ <ChevronUpIcon />
140
136
  </SelectPrimitive.ScrollUpButton>
141
137
  );
142
138
  }
@@ -148,10 +144,13 @@ function SelectScrollDownButton({
148
144
  return (
149
145
  <SelectPrimitive.ScrollDownButton
150
146
  data-slot="select-scroll-down-button"
151
- className={cn("flex cursor-default items-center justify-center py-1", className)}
147
+ className={cn(
148
+ "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
149
+ className
150
+ )}
152
151
  {...props}
153
152
  >
154
- <ChevronDownIcon className="size-4" />
153
+ <ChevronDownIcon />
155
154
  </SelectPrimitive.ScrollDownButton>
156
155
  );
157
156
  }
@@ -1,24 +1,24 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
4
- import type * as React from 'react';
3
+ import { Separator as SeparatorPrimitive } from "radix-ui";
4
+ import * as React from "react";
5
5
 
6
- import { cn } from '../lib/utils';
6
+ import { cn } from "@repo/ui/lib/utils";
7
7
 
8
8
  function Separator({
9
9
  className,
10
- orientation = 'horizontal',
10
+ orientation = "horizontal",
11
11
  decorative = true,
12
12
  ...props
13
13
  }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
14
14
  return (
15
15
  <SeparatorPrimitive.Root
16
- data-slot="separator-root"
16
+ data-slot="separator"
17
17
  decorative={decorative}
18
18
  orientation={orientation}
19
19
  className={cn(
20
- 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
21
- className,
20
+ "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
21
+ className
22
22
  )}
23
23
  {...props}
24
24
  />
@@ -1,10 +1,11 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
- import * as SheetPrimitive from '@radix-ui/react-dialog';
4
- import { XIcon } from 'lucide-react';
5
- import type * as React from 'react';
3
+ import { XIcon } from "lucide-react";
4
+ import { Dialog as SheetPrimitive } from "radix-ui";
5
+ import * as React from "react";
6
6
 
7
- import { cn } from '../lib/utils';
7
+ import { Button } from "@repo/ui/components/ui/button";
8
+ import { cn } from "@repo/ui/lib/utils";
8
9
 
9
10
  function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
11
  return <SheetPrimitive.Root data-slot="sheet" {...props} />;
@@ -22,16 +23,13 @@ function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Po
22
23
  return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
23
24
  }
24
25
 
25
- function SheetOverlay({
26
- className,
27
- ...props
28
- }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
26
+ function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
29
27
  return (
30
28
  <SheetPrimitive.Overlay
31
29
  data-slot="sheet-overlay"
32
30
  className={cn(
33
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
34
- className,
31
+ "fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
32
+ className
35
33
  )}
36
34
  {...props}
37
35
  />
@@ -41,90 +39,65 @@ function SheetOverlay({
41
39
  function SheetContent({
42
40
  className,
43
41
  children,
44
- side = 'right',
42
+ side = "right",
43
+ showCloseButton = true,
45
44
  ...props
46
45
  }: React.ComponentProps<typeof SheetPrimitive.Content> & {
47
- side?: 'top' | 'right' | 'bottom' | 'left';
46
+ side?: "top" | "right" | "bottom" | "left";
47
+ showCloseButton?: boolean;
48
48
  }) {
49
49
  return (
50
50
  <SheetPortal>
51
51
  <SheetOverlay />
52
52
  <SheetPrimitive.Content
53
53
  data-slot="sheet-content"
54
+ data-side={side}
54
55
  className={cn(
55
- 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
56
- side === 'right' &&
57
- 'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
58
- side === 'left' &&
59
- 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
60
- side === 'top' &&
61
- 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
62
- side === 'bottom' &&
63
- 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
64
- className,
56
+ "fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",
57
+ className
65
58
  )}
66
59
  {...props}
67
60
  >
68
61
  {children}
69
- <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
70
- <XIcon className="size-4" />
71
- <span className="sr-only">Close</span>
72
- </SheetPrimitive.Close>
62
+ {showCloseButton ? (
63
+ <SheetPrimitive.Close data-slot="sheet-close" asChild>
64
+ <Button variant="ghost" className="absolute top-3 right-3" size="icon-sm">
65
+ <XIcon />
66
+ <span className="sr-only">Close</span>
67
+ </Button>
68
+ </SheetPrimitive.Close>
69
+ ) : null}
73
70
  </SheetPrimitive.Content>
74
71
  </SheetPortal>
75
72
  );
76
73
  }
77
74
 
78
- function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
79
- return (
80
- <div
81
- data-slot="sheet-header"
82
- className={cn('flex flex-col gap-1.5 p-4', className)}
83
- {...props}
84
- />
85
- );
75
+ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
76
+ return <div data-slot="sheet-header" className={cn("flex flex-col gap-0.5 p-4", className)} {...props} />;
86
77
  }
87
78
 
88
- function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
89
- return (
90
- <div
91
- data-slot="sheet-footer"
92
- className={cn('mt-auto flex flex-col gap-2 p-4', className)}
93
- {...props}
94
- />
95
- );
79
+ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
80
+ return <div data-slot="sheet-footer" className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props} />;
96
81
  }
97
82
 
98
83
  function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
99
84
  return (
100
85
  <SheetPrimitive.Title
101
86
  data-slot="sheet-title"
102
- className={cn('text-foreground font-semibold', className)}
87
+ className={cn("cn-font-heading text-base font-medium text-foreground", className)}
103
88
  {...props}
104
89
  />
105
90
  );
106
91
  }
107
92
 
108
- function SheetDescription({
109
- className,
110
- ...props
111
- }: React.ComponentProps<typeof SheetPrimitive.Description>) {
93
+ function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {
112
94
  return (
113
95
  <SheetPrimitive.Description
114
96
  data-slot="sheet-description"
115
- className={cn('text-muted-foreground text-sm', className)}
97
+ className={cn("text-sm text-muted-foreground", className)}
116
98
  {...props}
117
99
  />
118
100
  );
119
101
  }
120
102
 
121
- export {
122
- Sheet,
123
- SheetTrigger,
124
- SheetClose,
125
- SheetContent,
126
- SheetHeader,
127
- SheetFooter,
128
- SheetTitle,
129
- SheetDescription,
130
- };
103
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription };