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.
- package/.dockerignore +4 -0
- package/apps/cli/src/commands/index.ts +1 -1
- package/apps/cli/src/commands/{common → test}/test.ts +4 -2
- package/apps/cli/tsconfig.json +0 -1
- package/apps/core-server/Dockerfile +5 -4
- package/apps/core-server/package.json +1 -1
- package/apps/core-server/tsconfig.json +1 -1
- package/apps/queue-worker/package.json +1 -1
- package/apps/queue-worker/tsconfig.json +1 -1
- package/apps/startx-cli/dist/index.mjs +68 -53
- package/apps/startx-cli/src/commands/package.ts +453 -0
- package/apps/startx-cli/src/configs/scripts.ts +18 -2
- package/apps/startx-cli/src/index.ts +2 -4
- package/apps/startx-cli/src/types.ts +2 -4
- package/apps/startx-cli/src/utils/inquirer.ts +8 -1
- package/apps/web-client/.dockerignore +4 -0
- package/apps/web-client/app/app.css +1 -0
- package/apps/web-client/app/components.json +23 -0
- package/apps/web-client/app/config/auth/auth-state.ts +59 -0
- package/apps/web-client/app/config/axios-client.ts +87 -0
- package/apps/web-client/app/config/env.ts +5 -0
- package/apps/web-client/app/entry.client.tsx +7 -0
- package/apps/web-client/app/eslint.config.ts +4 -0
- package/apps/web-client/app/root.tsx +77 -0
- package/apps/web-client/app/routes/home.tsx +12 -0
- package/apps/web-client/app/routes.ts +3 -0
- package/apps/web-client/eslint.config.ts +4 -0
- package/apps/web-client/package.json +55 -0
- package/apps/web-client/react-router.config.ts +7 -0
- package/apps/web-client/tsconfig.json +22 -0
- package/apps/web-client/vite-env.d.ts +8 -0
- package/apps/web-client/vite.config.ts +30 -0
- package/biome.json +5 -0
- package/configs/eslint-config/eslint.config.ts +1 -0
- package/configs/eslint-config/src/configs/base.ts +0 -1
- package/configs/eslint-config/src/configs/frontend.ts +1 -1
- package/configs/eslint-config/tsconfig.json +1 -1
- package/configs/typescript-config/tsconfig.frontend.json +1 -1
- package/configs/vitest-config/tsconfig.json +1 -1
- package/package.json +1 -1
- package/packages/@db/drizzle/tsconfig.json +1 -1
- package/packages/@db/sqlite/tsconfig.json +1 -1
- package/packages/@repo/env/package.json +1 -2
- package/packages/@repo/env/src/utils.ts +17 -11
- package/packages/@repo/lib/package.json +3 -1
- package/packages/@repo/lib/src/session-module/i-session.ts +108 -0
- package/packages/@repo/lib/src/session-module/index.ts +8 -111
- package/packages/@repo/lib/src/session-module/redis-session.ts +44 -0
- package/packages/@repo/lib/tsconfig.json +0 -1
- package/packages/@repo/logger/package.json +0 -1
- package/packages/@repo/logger/tsconfig.json +1 -1
- package/packages/@repo/mail/tsconfig.json +1 -1
- package/packages/@repo/redis/tsconfig.json +1 -1
- package/packages/aix/package.json +2 -0
- package/packages/aix/src/providers/ai-interface.ts +4 -4
- package/packages/aix/src/providers/bedrock/bedrock.ts +261 -0
- package/packages/aix/src/providers/default-models.ts +65 -0
- package/packages/aix/src/providers/openai/openai.ts +2 -2
- package/packages/aix/src/providers/providers.ts +11 -0
- package/packages/aix/src/providers/types.ts +1 -1
- package/packages/{constants → common}/package.json +4 -2
- package/packages/{constants/src/index.ts → common/src/constants.ts} +0 -5
- package/packages/common/src/types/users.ts +10 -0
- package/packages/{constants → common}/tsconfig.json +0 -3
- package/packages/ui/components.json +15 -8
- package/packages/ui/package.json +23 -36
- package/packages/ui/src/api/axios/i-client.ts +40 -0
- package/packages/ui/src/api/index.ts +6 -0
- package/packages/ui/src/api/query-provider.tsx +34 -0
- package/packages/ui/src/api/use-api/api-builder.ts +139 -0
- package/packages/ui/src/api/use-api/api-helpers.ts +165 -0
- package/packages/ui/src/api/use-api/api-types.ts +138 -0
- package/packages/ui/src/api/use-api/query-factory.ts +66 -0
- package/packages/ui/src/api/use-api/react-query/types.ts +64 -0
- package/packages/ui/src/api/use-api/react-query/use-api-client.ts +56 -0
- package/packages/ui/src/api/use-api/react-query/use-api.ts +297 -0
- package/packages/ui/src/components/custom/form-wrapper.tsx +113 -160
- package/packages/ui/src/components/custom/grid-component.tsx +4 -4
- package/packages/ui/src/components/custom/hover-tool.tsx +1 -1
- package/packages/ui/src/components/custom/image-picker.tsx +18 -20
- package/packages/ui/src/components/custom/no-content.tsx +6 -16
- package/packages/ui/src/components/custom/page-section.tsx +14 -17
- package/packages/ui/src/components/custom/simple-popover.tsx +5 -9
- package/packages/ui/src/components/custom/theme-provider.tsx +117 -42
- package/packages/ui/src/components/custom/typography.tsx +20 -22
- package/packages/ui/src/components/extensions/timeline.tsx +100 -0
- package/packages/ui/src/components/ui/alert-dialog.tsx +46 -108
- package/packages/ui/src/components/ui/avatar.tsx +79 -42
- package/packages/ui/src/components/ui/badge.tsx +29 -34
- package/packages/ui/src/components/ui/breadcrumb.tsx +65 -81
- package/packages/ui/src/components/ui/button.tsx +80 -80
- package/packages/ui/src/components/ui/card.tsx +48 -69
- package/packages/ui/src/components/ui/carousel.tsx +184 -211
- package/packages/ui/src/components/ui/checkbox.tsx +21 -24
- package/packages/ui/src/components/ui/command.tsx +121 -102
- package/packages/ui/src/components/ui/dialog.tsx +45 -32
- package/packages/ui/src/components/ui/dropdown-menu.tsx +45 -33
- package/packages/ui/src/components/ui/field.tsx +218 -0
- package/packages/ui/src/components/ui/form.tsx +63 -76
- package/packages/ui/src/components/ui/input-group.tsx +137 -0
- package/packages/ui/src/components/ui/input-otp.tsx +60 -50
- package/packages/ui/src/components/ui/input.tsx +16 -15
- package/packages/ui/src/components/ui/label.tsx +14 -17
- package/packages/ui/src/components/ui/multiple-select.tsx +22 -33
- package/packages/ui/src/components/ui/popover.tsx +20 -8
- package/packages/ui/src/components/ui/select.tsx +33 -34
- package/packages/ui/src/components/ui/separator.tsx +8 -8
- package/packages/ui/src/components/ui/sheet.tsx +32 -59
- package/packages/ui/src/components/ui/sidebar.tsx +654 -0
- package/packages/ui/src/components/ui/skeleton.tsx +2 -8
- package/packages/ui/src/components/ui/sonner.tsx +39 -0
- package/packages/ui/src/components/ui/spinner.tsx +6 -13
- package/packages/ui/src/components/ui/switch.tsx +15 -10
- package/packages/ui/src/components/ui/table.tsx +48 -89
- package/packages/ui/src/components/ui/tabs.tsx +37 -15
- package/packages/ui/src/components/ui/textarea.tsx +13 -13
- package/packages/ui/src/components/ui/tooltip.tsx +37 -23
- package/packages/ui/src/{components/hooks → hooks}/event/use-click.tsx +6 -10
- package/packages/ui/src/hooks/time/use-timer.tsx +51 -0
- package/packages/ui/src/hooks/use-media-query.tsx +19 -0
- package/packages/ui/src/hooks/use-mobile.tsx +17 -0
- package/packages/ui/src/{components/hooks → hooks}/use-update-effect.tsx +2 -2
- package/packages/ui/src/lib/utils.ts +113 -0
- package/packages/ui/src/styles/globals.css +311 -0
- package/packages/ui/src/styles/tailwind.css +89 -0
- package/packages/ui/tsconfig.json +7 -9
- package/pnpm-workspace.yaml +74 -64
- package/packages/ui/postcss.config.mjs +0 -9
- package/packages/ui/src/components/extensions/carousel.tsx +0 -392
- package/packages/ui/src/components/hooks/time/useTimer.tsx +0 -51
- package/packages/ui/src/components/hooks/use-media-query.tsx +0 -19
- package/packages/ui/src/components/lib/utils.ts +0 -242
- package/packages/ui/src/components/ui/timeline.tsx +0 -118
- package/packages/ui/src/components/util/n-formattor.ts +0 -22
- package/packages/ui/src/components/util/storage.ts +0 -37
- package/packages/ui/src/globals.css +0 -87
- package/packages/ui/tailwind.config.ts +0 -94
- /package/packages/{constants → common}/eslint.config.ts +0 -0
- /package/packages/{constants → common}/src/api.ts +0 -0
- /package/packages/{constants → common}/src/time.ts +0 -0
- /package/packages/{constants → common}/vitest.config.ts +0 -0
- /package/packages/ui/src/{components/hooks/time/useDebounce.tsx → hooks/time/use-debounce.tsx} +0 -0
- /package/packages/ui/src/{components/hooks/time/useInterval.tsx → hooks/time/use-interval.tsx} +0 -0
- /package/packages/ui/src/{components/hooks/time/useTimeout.tsx → hooks/time/use-timeout.tsx} +0 -0
- /package/packages/ui/src/{components/hooks → hooks}/use-persistent-storage.tsx +0 -0
- /package/packages/ui/src/{components/hooks → hooks}/use-window-dimension.tsx +0 -0
- /package/packages/ui/src/{components/sonner.tsx → sonner.ts} +0 -0
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
4
|
-
import
|
|
3
|
+
import { Label as LabelPrimitive } from "radix-ui";
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
|
|
6
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "@repo/ui/lib/utils";
|
|
7
7
|
|
|
8
|
-
function Label({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
4
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
5
|
+
import * as React from "react";
|
|
6
6
|
|
|
7
|
-
import { cn } from "
|
|
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
|
-
"
|
|
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
|
|
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 = "
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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("
|
|
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
|
-
"
|
|
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-
|
|
105
|
+
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
107
106
|
<SelectPrimitive.ItemIndicator>
|
|
108
|
-
<CheckIcon className="
|
|
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("
|
|
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(
|
|
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
|
|
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(
|
|
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
|
|
153
|
+
<ChevronDownIcon />
|
|
155
154
|
</SelectPrimitive.ScrollDownButton>
|
|
156
155
|
);
|
|
157
156
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from "@repo/ui/lib/utils";
|
|
7
7
|
|
|
8
8
|
function Separator({
|
|
9
9
|
className,
|
|
10
|
-
orientation =
|
|
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
|
|
16
|
+
data-slot="separator"
|
|
17
17
|
decorative={decorative}
|
|
18
18
|
orientation={orientation}
|
|
19
19
|
className={cn(
|
|
20
|
-
|
|
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
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
5
|
+
import * as React from "react";
|
|
6
6
|
|
|
7
|
-
import {
|
|
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
|
-
|
|
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 =
|
|
42
|
+
side = "right",
|
|
43
|
+
showCloseButton = true,
|
|
45
44
|
...props
|
|
46
45
|
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
47
|
-
side?:
|
|
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
|
-
|
|
56
|
-
|
|
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
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
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<
|
|
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<
|
|
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(
|
|
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(
|
|
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 };
|