@tscircuit/cli 0.0.394 → 0.1.2
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/.github/workflows/bun-formatcheck.yml +26 -0
- package/.github/workflows/bun-pver-release.yml +25 -0
- package/.github/workflows/{typecheck.yml → bun-typecheck.yml} +0 -3
- package/LICENSE +21 -0
- package/README.md +33 -36
- package/biome.json +9 -9
- package/bun.lockb +0 -0
- package/cli/CliContext.ts +8 -0
- package/cli/auth/login/register.ts +73 -0
- package/cli/auth/logout/register.ts +11 -0
- package/cli/auth/register.ts +5 -0
- package/cli/clone/register.ts +99 -0
- package/cli/config/print/register.ts +12 -0
- package/cli/config/register.ts +5 -0
- package/cli/dev/register.ts +111 -0
- package/cli/main.ts +33 -0
- package/dist/main.js +537 -0
- package/docs/file-server-api-usage.md +57 -0
- package/docs/run-frame-usage.md +14 -0
- package/example-dir/manual-edits.json +1 -0
- package/example-dir/snippet.d.ts +13 -0
- package/example-dir/snippet.tsx +20 -0
- package/example-dir/types.d.ts +11 -0
- package/lib/cli-config/TypedConfigStore.ts +50 -0
- package/lib/cli-config/index.ts +16 -0
- package/lib/dependency-analysis/DependencyAnalyzer.ts +129 -0
- package/lib/dependency-analysis/getLocalFileDependencies.ts +101 -0
- package/lib/dependency-analysis/installNodeModuleTypes.ts +74 -0
- package/lib/index.ts +2 -0
- package/lib/project-config/index.ts +5 -0
- package/lib/registry-api/endpoint-types.ts +20 -0
- package/lib/registry-api/get-ky.ts +30 -0
- package/lib/server/EventsWatcher.ts +75 -0
- package/lib/server/createServer.ts +62 -0
- package/lib/site/getIndex.ts +18 -0
- package/package.json +27 -144
- package/tsconfig.json +25 -22
- package/.github/workflows/formatbot.yml +0 -63
- package/.github/workflows/release.yml +0 -40
- package/.github/workflows/test.yml +0 -32
- package/.github/workflows/windows-tests.yml +0 -32
- package/.prettierrc +0 -1
- package/DEVELOPMENT.md +0 -7
- package/api/README.md +0 -3
- package/api/db/generic-json-level.ts +0 -123
- package/api/db/get-db.ts +0 -26
- package/api/db/schema.ts +0 -65
- package/api/db/zod-level-db.ts +0 -148
- package/api/index.ts +0 -4
- package/api/lib/middlewares/with-db.ts +0 -18
- package/api/lib/middlewares/with-debug-request-logging.ts +0 -13
- package/api/lib/middlewares/with-error-response.ts +0 -37
- package/api/lib/with-winter-spec.ts +0 -9
- package/api/lib/zod/export_parameters.ts +0 -25
- package/api/routes/api/db/download.ts +0 -25
- package/api/routes/api/dev_package_examples/create.ts +0 -43
- package/api/routes/api/dev_package_examples/get.ts +0 -46
- package/api/routes/api/dev_package_examples/list.ts +0 -36
- package/api/routes/api/dev_package_examples/update.ts +0 -59
- package/api/routes/api/dev_server/reset.ts +0 -13
- package/api/routes/api/export_files/create.ts +0 -27
- package/api/routes/api/export_files/download.ts +0 -25
- package/api/routes/api/export_requests/create.ts +0 -30
- package/api/routes/api/export_requests/get.ts +0 -43
- package/api/routes/api/export_requests/list.ts +0 -26
- package/api/routes/api/export_requests/update.ts +0 -34
- package/api/routes/api/health.ts +0 -11
- package/api/routes/api/package_info/create.ts +0 -26
- package/api/routes/api/package_info/get.ts +0 -16
- package/api/routes/health.ts +0 -11
- package/api/routes/index.ts +0 -16
- package/api/server.ts +0 -20
- package/api/static-routes.ts +0 -24
- package/api/tests/fixtures/get-test-server.ts +0 -31
- package/api/tests/fixtures/start-server.ts +0 -41
- package/api/tests/routes/dev_package_examples/create.test.ts +0 -19
- package/api/tests/routes/dev_package_examples/get.test.ts +0 -25
- package/api/tests/routes/dev_package_examples/list.test.ts +0 -32
- package/api/tests/routes/dev_package_examples/update.test.ts +0 -38
- package/api/tests/routes/export_files/create.test.ts +0 -18
- package/api/tests/routes/export_files/download.test.ts +0 -29
- package/api/tests/routes/export_requests/create.test.ts +0 -24
- package/api/tests/routes/export_requests/get.test.ts +0 -41
- package/api/tests/routes/export_requests/list.test.ts +0 -35
- package/api/tests/routes/export_requests/update.test.ts +0 -50
- package/api/tests/routes/health.test.ts +0 -10
- package/bunfig.toml +0 -2
- package/cli/cli.ts +0 -13
- package/cli/lib/cmd-fns/add.ts +0 -34
- package/cli/lib/cmd-fns/auth-login.ts +0 -59
- package/cli/lib/cmd-fns/auth-logout.ts +0 -7
- package/cli/lib/cmd-fns/auth-sessions-create.ts +0 -3
- package/cli/lib/cmd-fns/auth-sessions-get.ts +0 -3
- package/cli/lib/cmd-fns/auth-sessions-list.ts +0 -5
- package/cli/lib/cmd-fns/config-clear.ts +0 -5
- package/cli/lib/cmd-fns/config-print-config.ts +0 -6
- package/cli/lib/cmd-fns/config-reveal-location.ts +0 -5
- package/cli/lib/cmd-fns/config-set-log-requests.ts +0 -7
- package/cli/lib/cmd-fns/config-set-registry.ts +0 -9
- package/cli/lib/cmd-fns/config-set-runtime.ts +0 -7
- package/cli/lib/cmd-fns/config-set-session.ts +0 -7
- package/cli/lib/cmd-fns/dev/check-if-initialized.ts +0 -22
- package/cli/lib/cmd-fns/dev/derive-selector-from-pcb-component-id.ts +0 -23
- package/cli/lib/cmd-fns/dev/dev-server-request-handler.ts +0 -61
- package/cli/lib/cmd-fns/dev/find-available-port.ts +0 -32
- package/cli/lib/cmd-fns/dev/fulfill-export-requests.ts +0 -162
- package/cli/lib/cmd-fns/dev/get-dev-server-axios.ts +0 -29
- package/cli/lib/cmd-fns/dev/index.ts +0 -168
- package/cli/lib/cmd-fns/dev/infer-export-name-from-source.ts +0 -17
- package/cli/lib/cmd-fns/dev/mark-all-examples-loading.ts +0 -18
- package/cli/lib/cmd-fns/dev/soupify-and-upload-example-file.ts +0 -62
- package/cli/lib/cmd-fns/dev/start-dev-server.ts +0 -34
- package/cli/lib/cmd-fns/dev/start-edit-event-watcher.ts +0 -347
- package/cli/lib/cmd-fns/dev/start-export-request-watcher.ts +0 -33
- package/cli/lib/cmd-fns/dev/start-fs-watcher.ts +0 -54
- package/cli/lib/cmd-fns/dev/upload-examples-from-directory.ts +0 -42
- package/cli/lib/cmd-fns/dev-server-fulfill-export-requests.ts +0 -43
- package/cli/lib/cmd-fns/dev-server-upload.ts +0 -56
- package/cli/lib/cmd-fns/export-gerbers.ts +0 -28
- package/cli/lib/cmd-fns/export-kicad-pcb.ts +0 -36
- package/cli/lib/cmd-fns/export-pnp-csv.ts +0 -32
- package/cli/lib/cmd-fns/gen-jlcpcb-component.ts +0 -64
- package/cli/lib/cmd-fns/go.ts +0 -14
- package/cli/lib/cmd-fns/index.ts +0 -46
- package/cli/lib/cmd-fns/init/create-or-modify-npmrc.ts +0 -21
- package/cli/lib/cmd-fns/init/get-generated-npmrc.ts +0 -8
- package/cli/lib/cmd-fns/init/get-generated-readme.ts +0 -41
- package/cli/lib/cmd-fns/init/get-generated-tsconfig.ts +0 -34
- package/cli/lib/cmd-fns/init/index.ts +0 -193
- package/cli/lib/cmd-fns/install.ts +0 -34
- package/cli/lib/cmd-fns/lint.ts +0 -43
- package/cli/lib/cmd-fns/open.ts +0 -19
- package/cli/lib/cmd-fns/package-examples-create.ts +0 -36
- package/cli/lib/cmd-fns/package-examples-get.ts +0 -20
- package/cli/lib/cmd-fns/package-examples-list.ts +0 -18
- package/cli/lib/cmd-fns/package-files-create.ts +0 -31
- package/cli/lib/cmd-fns/package-files-download.ts +0 -29
- package/cli/lib/cmd-fns/package-files-get.ts +0 -3
- package/cli/lib/cmd-fns/package-files-list.ts +0 -28
- package/cli/lib/cmd-fns/package-files-upload-directory.ts +0 -6
- package/cli/lib/cmd-fns/package-releases-create.ts +0 -35
- package/cli/lib/cmd-fns/package-releases-get.ts +0 -3
- package/cli/lib/cmd-fns/package-releases-list.ts +0 -32
- package/cli/lib/cmd-fns/package-releases-update.ts +0 -45
- package/cli/lib/cmd-fns/packages-create.ts +0 -16
- package/cli/lib/cmd-fns/packages-get.ts +0 -16
- package/cli/lib/cmd-fns/packages-list.ts +0 -16
- package/cli/lib/cmd-fns/publish/index.ts +0 -336
- package/cli/lib/cmd-fns/remove.ts +0 -31
- package/cli/lib/cmd-fns/render.ts +0 -45
- package/cli/lib/cmd-fns/soupify.ts +0 -31
- package/cli/lib/cmd-fns/uninstall.ts +0 -31
- package/cli/lib/cmd-fns/version.ts +0 -38
- package/cli/lib/create-config-manager.ts +0 -97
- package/cli/lib/export-fns/export-bom-csv.ts +0 -32
- package/cli/lib/export-fns/export-gerbers.ts +0 -108
- package/cli/lib/export-fns/export-kicad-pcb.ts +0 -32
- package/cli/lib/export-fns/export-pnp-csv.ts +0 -31
- package/cli/lib/get-program.ts +0 -387
- package/cli/lib/param-handlers/index.ts +0 -21
- package/cli/lib/param-handlers/interact-for-local-directory.ts +0 -58
- package/cli/lib/param-handlers/interact-for-local-file.ts +0 -59
- package/cli/lib/param-handlers/interact-for-package-example-id.ts +0 -25
- package/cli/lib/param-handlers/interact-for-package-name-with-version.ts +0 -63
- package/cli/lib/param-handlers/interact-for-package-name.ts +0 -45
- package/cli/lib/param-handlers/interact-for-package-release-id.ts +0 -15
- package/cli/lib/param-handlers/interact-for-registry-url.ts +0 -27
- package/cli/lib/param-handlers/interact-for-runtime.ts +0 -33
- package/cli/lib/param-handlers/param-handler-type.ts +0 -7
- package/cli/lib/posthog.ts +0 -23
- package/cli/lib/soupify/get-export-name-from-file.ts +0 -29
- package/cli/lib/soupify/get-tmp-entrpoint-filepath.ts +0 -15
- package/cli/lib/soupify/index.ts +0 -1
- package/cli/lib/soupify/run-entrypoint-file.ts +0 -59
- package/cli/lib/soupify/soupify-with-core.ts +0 -74
- package/cli/lib/soupify/soupify.ts +0 -6
- package/cli/lib/util/app-context.ts +0 -17
- package/cli/lib/util/create-context-and-run-program.ts +0 -168
- package/cli/lib/util/get-all-package-files.ts +0 -66
- package/cli/lib/util/lint-project.ts +0 -137
- package/cli/tests/export-gerber-keyboard.test.ts +0 -16
- package/cli/tests/export-gerber.test.ts +0 -49
- package/cli/tests/export-kicad-pcb.test.ts +0 -23
- package/cli/tests/export-pnp-csv.test.ts +0 -24
- package/cli/tests/fixtures/preload.ts +0 -54
- package/cli/tests/init.test.ts +0 -9
- package/cli/tests/open.test.ts +0 -9
- package/cli/tests/soupify-builder.test.ts +0 -9
- package/cli/tests/soupify-core.test.ts +0 -9
- package/dist/cli.js +0 -3676
- package/docs/EDIT_EVENT_PIPELINE.md +0 -34
- package/example-project/README.md +0 -18
- package/example-project/examples/basic-capacitor.tsx +0 -5
- package/example-project/examples/basic-chip.tsx +0 -26
- package/example-project/examples/basic-resistor.tsx +0 -3
- package/example-project/examples/macrokeypad.tsx +0 -59
- package/example-project/index.ts +0 -1
- package/example-project/package.json +0 -5
- package/example-project/src/ArduinoProMicroBreakout.tsx +0 -37
- package/example-project/src/Key.tsx +0 -46
- package/example-project/src/Keyswitch.tsx +0 -26
- package/example-project/src/KeyswitchSocket.tsx +0 -56
- package/example-project/src/MyCircuit.tsx +0 -38
- package/example-project/src/manual-edits.ts +0 -93
- package/frontend/README.md +0 -3
- package/frontend/bun.lockb +0 -0
- package/frontend/components/command-k.tsx +0 -86
- package/frontend/components/dialogs/generic-export-dialog.tsx +0 -189
- package/frontend/components/dialogs/gerber-export-dialog.tsx +0 -168
- package/frontend/components/global-context-providers.tsx +0 -11
- package/frontend/components/select-example-search.tsx +0 -118
- package/frontend/components/ui/alert-dialog.tsx +0 -139
- package/frontend/components/ui/alert.tsx +0 -59
- package/frontend/components/ui/breadcrumb.tsx +0 -115
- package/frontend/components/ui/button.tsx +0 -57
- package/frontend/components/ui/card.tsx +0 -76
- package/frontend/components/ui/command.tsx +0 -153
- package/frontend/components/ui/context-menu.tsx +0 -202
- package/frontend/components/ui/dialog.tsx +0 -120
- package/frontend/components/ui/menubar.tsx +0 -238
- package/frontend/components/ui/navigation-menu.tsx +0 -128
- package/frontend/components/ui/popover.tsx +0 -31
- package/frontend/components/ui/select.tsx +0 -162
- package/frontend/components/ui/tabs.tsx +0 -53
- package/frontend/components/ui/toggle-group.tsx +0 -59
- package/frontend/components/ui/toggle.tsx +0 -43
- package/frontend/components/ui/tooltip.tsx +0 -28
- package/frontend/components.json +0 -17
- package/frontend/hooks/toast-if-api-not-connected.ts +0 -23
- package/frontend/hooks/use-active-dev-package-example-lite.ts +0 -39
- package/frontend/hooks/use-dev-package-examples.tsx +0 -18
- package/frontend/hooks/use-global-store.ts +0 -42
- package/frontend/index.css +0 -76
- package/frontend/index.html +0 -13
- package/frontend/lib/utils.ts +0 -6
- package/frontend/main.tsx +0 -13
- package/frontend/tailwind.config.js +0 -74
- package/frontend/views/App.tsx +0 -22
- package/frontend/views/Header.tsx +0 -55
- package/frontend/views/HeaderMenu.tsx +0 -326
- package/frontend/views/MainContentView.tsx +0 -172
- package/frontend/vite-env.d.ts +0 -1
- package/frontend/vite.config.ts +0 -50
- package/renovate.json +0 -16
- package/scripts/build-cli.ts +0 -12
- package/tsup.config.ts +0 -7
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
3
|
-
import { Cross2Icon } from "@radix-ui/react-icons"
|
|
4
|
-
|
|
5
|
-
import { cn } from "frontend/lib/utils"
|
|
6
|
-
|
|
7
|
-
const Dialog = DialogPrimitive.Root
|
|
8
|
-
|
|
9
|
-
const DialogTrigger = DialogPrimitive.Trigger
|
|
10
|
-
|
|
11
|
-
const DialogPortal = DialogPrimitive.Portal
|
|
12
|
-
|
|
13
|
-
const DialogClose = DialogPrimitive.Close
|
|
14
|
-
|
|
15
|
-
const DialogOverlay = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<DialogPrimitive.Overlay
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
))
|
|
28
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
|
|
29
|
-
|
|
30
|
-
const DialogContent = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
33
|
-
>(({ className, children, ...props }, ref) => (
|
|
34
|
-
<DialogPortal>
|
|
35
|
-
<DialogOverlay />
|
|
36
|
-
<DialogPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
46
|
-
<Cross2Icon className="h-4 w-4" />
|
|
47
|
-
<span className="sr-only">Close</span>
|
|
48
|
-
</DialogPrimitive.Close>
|
|
49
|
-
</DialogPrimitive.Content>
|
|
50
|
-
</DialogPortal>
|
|
51
|
-
))
|
|
52
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName
|
|
53
|
-
|
|
54
|
-
const DialogHeader = ({
|
|
55
|
-
className,
|
|
56
|
-
...props
|
|
57
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
58
|
-
<div
|
|
59
|
-
className={cn(
|
|
60
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
61
|
-
className,
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
)
|
|
66
|
-
DialogHeader.displayName = "DialogHeader"
|
|
67
|
-
|
|
68
|
-
const DialogFooter = ({
|
|
69
|
-
className,
|
|
70
|
-
...props
|
|
71
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
72
|
-
<div
|
|
73
|
-
className={cn(
|
|
74
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
75
|
-
className,
|
|
76
|
-
)}
|
|
77
|
-
{...props}
|
|
78
|
-
/>
|
|
79
|
-
)
|
|
80
|
-
DialogFooter.displayName = "DialogFooter"
|
|
81
|
-
|
|
82
|
-
const DialogTitle = React.forwardRef<
|
|
83
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
84
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
85
|
-
>(({ className, ...props }, ref) => (
|
|
86
|
-
<DialogPrimitive.Title
|
|
87
|
-
ref={ref}
|
|
88
|
-
className={cn(
|
|
89
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
90
|
-
className,
|
|
91
|
-
)}
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
))
|
|
95
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName
|
|
96
|
-
|
|
97
|
-
const DialogDescription = React.forwardRef<
|
|
98
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
99
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
100
|
-
>(({ className, ...props }, ref) => (
|
|
101
|
-
<DialogPrimitive.Description
|
|
102
|
-
ref={ref}
|
|
103
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
106
|
-
))
|
|
107
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName
|
|
108
|
-
|
|
109
|
-
export {
|
|
110
|
-
Dialog,
|
|
111
|
-
DialogPortal,
|
|
112
|
-
DialogOverlay,
|
|
113
|
-
DialogTrigger,
|
|
114
|
-
DialogClose,
|
|
115
|
-
DialogContent,
|
|
116
|
-
DialogHeader,
|
|
117
|
-
DialogFooter,
|
|
118
|
-
DialogTitle,
|
|
119
|
-
DialogDescription,
|
|
120
|
-
}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import {
|
|
3
|
-
CheckIcon,
|
|
4
|
-
ChevronRightIcon,
|
|
5
|
-
DotFilledIcon,
|
|
6
|
-
} from "@radix-ui/react-icons"
|
|
7
|
-
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
|
8
|
-
|
|
9
|
-
import { cn } from "frontend/lib/utils"
|
|
10
|
-
|
|
11
|
-
const MenubarMenu = MenubarPrimitive.Menu
|
|
12
|
-
|
|
13
|
-
const MenubarGroup = MenubarPrimitive.Group
|
|
14
|
-
|
|
15
|
-
const MenubarPortal = MenubarPrimitive.Portal
|
|
16
|
-
|
|
17
|
-
const MenubarSub = MenubarPrimitive.Sub
|
|
18
|
-
|
|
19
|
-
const MenubarRadioGroup = MenubarPrimitive.RadioGroup
|
|
20
|
-
|
|
21
|
-
const Menubar = React.forwardRef<
|
|
22
|
-
React.ElementRef<typeof MenubarPrimitive.Root>,
|
|
23
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
|
|
24
|
-
>(({ className, ...props }, ref) => (
|
|
25
|
-
<MenubarPrimitive.Root
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
"flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
))
|
|
34
|
-
Menubar.displayName = MenubarPrimitive.Root.displayName
|
|
35
|
-
|
|
36
|
-
const MenubarTrigger = React.forwardRef<
|
|
37
|
-
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
|
38
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
|
|
39
|
-
>(({ className, ...props }, ref) => (
|
|
40
|
-
<MenubarPrimitive.Trigger
|
|
41
|
-
ref={ref}
|
|
42
|
-
className={cn(
|
|
43
|
-
"flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
/>
|
|
48
|
-
))
|
|
49
|
-
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
|
|
50
|
-
|
|
51
|
-
const MenubarSubTrigger = React.forwardRef<
|
|
52
|
-
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
|
53
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
|
54
|
-
inset?: boolean
|
|
55
|
-
}
|
|
56
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
57
|
-
<MenubarPrimitive.SubTrigger
|
|
58
|
-
ref={ref}
|
|
59
|
-
className={cn(
|
|
60
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
61
|
-
inset && "pl-8",
|
|
62
|
-
className,
|
|
63
|
-
)}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
{children}
|
|
67
|
-
<ChevronRightIcon className="ml-auto h-4 w-4" />
|
|
68
|
-
</MenubarPrimitive.SubTrigger>
|
|
69
|
-
))
|
|
70
|
-
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
|
|
71
|
-
|
|
72
|
-
const MenubarSubContent = React.forwardRef<
|
|
73
|
-
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
|
74
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
|
|
75
|
-
>(({ className, ...props }, ref) => (
|
|
76
|
-
<MenubarPrimitive.SubContent
|
|
77
|
-
ref={ref}
|
|
78
|
-
className={cn(
|
|
79
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
80
|
-
className,
|
|
81
|
-
)}
|
|
82
|
-
{...props}
|
|
83
|
-
/>
|
|
84
|
-
))
|
|
85
|
-
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
|
|
86
|
-
|
|
87
|
-
const MenubarContent = React.forwardRef<
|
|
88
|
-
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
89
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
|
|
90
|
-
>(
|
|
91
|
-
(
|
|
92
|
-
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
93
|
-
ref,
|
|
94
|
-
) => (
|
|
95
|
-
<MenubarPrimitive.Portal>
|
|
96
|
-
<MenubarPrimitive.Content
|
|
97
|
-
ref={ref}
|
|
98
|
-
align={align}
|
|
99
|
-
alignOffset={alignOffset}
|
|
100
|
-
sideOffset={sideOffset}
|
|
101
|
-
className={cn(
|
|
102
|
-
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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",
|
|
103
|
-
className,
|
|
104
|
-
)}
|
|
105
|
-
{...props}
|
|
106
|
-
/>
|
|
107
|
-
</MenubarPrimitive.Portal>
|
|
108
|
-
),
|
|
109
|
-
)
|
|
110
|
-
MenubarContent.displayName = MenubarPrimitive.Content.displayName
|
|
111
|
-
|
|
112
|
-
const MenubarItem = React.forwardRef<
|
|
113
|
-
React.ElementRef<typeof MenubarPrimitive.Item>,
|
|
114
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
|
115
|
-
inset?: boolean
|
|
116
|
-
}
|
|
117
|
-
>(({ className, inset, ...props }, ref) => (
|
|
118
|
-
<MenubarPrimitive.Item
|
|
119
|
-
ref={ref}
|
|
120
|
-
className={cn(
|
|
121
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
122
|
-
inset && "pl-8",
|
|
123
|
-
className,
|
|
124
|
-
)}
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
))
|
|
128
|
-
MenubarItem.displayName = MenubarPrimitive.Item.displayName
|
|
129
|
-
|
|
130
|
-
const MenubarCheckboxItem = React.forwardRef<
|
|
131
|
-
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
|
132
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
|
|
133
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
134
|
-
<MenubarPrimitive.CheckboxItem
|
|
135
|
-
ref={ref}
|
|
136
|
-
className={cn(
|
|
137
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
138
|
-
className,
|
|
139
|
-
)}
|
|
140
|
-
checked={checked}
|
|
141
|
-
{...props}
|
|
142
|
-
>
|
|
143
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
144
|
-
<MenubarPrimitive.ItemIndicator>
|
|
145
|
-
<CheckIcon className="h-4 w-4" />
|
|
146
|
-
</MenubarPrimitive.ItemIndicator>
|
|
147
|
-
</span>
|
|
148
|
-
{children}
|
|
149
|
-
</MenubarPrimitive.CheckboxItem>
|
|
150
|
-
))
|
|
151
|
-
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
|
|
152
|
-
|
|
153
|
-
const MenubarRadioItem = React.forwardRef<
|
|
154
|
-
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
|
155
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
|
|
156
|
-
>(({ className, children, ...props }, ref) => (
|
|
157
|
-
<MenubarPrimitive.RadioItem
|
|
158
|
-
ref={ref}
|
|
159
|
-
className={cn(
|
|
160
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
161
|
-
className,
|
|
162
|
-
)}
|
|
163
|
-
{...props}
|
|
164
|
-
>
|
|
165
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
166
|
-
<MenubarPrimitive.ItemIndicator>
|
|
167
|
-
<DotFilledIcon className="h-4 w-4 fill-current" />
|
|
168
|
-
</MenubarPrimitive.ItemIndicator>
|
|
169
|
-
</span>
|
|
170
|
-
{children}
|
|
171
|
-
</MenubarPrimitive.RadioItem>
|
|
172
|
-
))
|
|
173
|
-
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
|
|
174
|
-
|
|
175
|
-
const MenubarLabel = React.forwardRef<
|
|
176
|
-
React.ElementRef<typeof MenubarPrimitive.Label>,
|
|
177
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
|
178
|
-
inset?: boolean
|
|
179
|
-
}
|
|
180
|
-
>(({ className, inset, ...props }, ref) => (
|
|
181
|
-
<MenubarPrimitive.Label
|
|
182
|
-
ref={ref}
|
|
183
|
-
className={cn(
|
|
184
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
185
|
-
inset && "pl-8",
|
|
186
|
-
className,
|
|
187
|
-
)}
|
|
188
|
-
{...props}
|
|
189
|
-
/>
|
|
190
|
-
))
|
|
191
|
-
MenubarLabel.displayName = MenubarPrimitive.Label.displayName
|
|
192
|
-
|
|
193
|
-
const MenubarSeparator = React.forwardRef<
|
|
194
|
-
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
|
195
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
|
|
196
|
-
>(({ className, ...props }, ref) => (
|
|
197
|
-
<MenubarPrimitive.Separator
|
|
198
|
-
ref={ref}
|
|
199
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
200
|
-
{...props}
|
|
201
|
-
/>
|
|
202
|
-
))
|
|
203
|
-
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
|
|
204
|
-
|
|
205
|
-
const MenubarShortcut = ({
|
|
206
|
-
className,
|
|
207
|
-
...props
|
|
208
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
209
|
-
return (
|
|
210
|
-
<span
|
|
211
|
-
className={cn(
|
|
212
|
-
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
213
|
-
className,
|
|
214
|
-
)}
|
|
215
|
-
{...props}
|
|
216
|
-
/>
|
|
217
|
-
)
|
|
218
|
-
}
|
|
219
|
-
MenubarShortcut.displayname = "MenubarShortcut"
|
|
220
|
-
|
|
221
|
-
export {
|
|
222
|
-
Menubar,
|
|
223
|
-
MenubarMenu,
|
|
224
|
-
MenubarTrigger,
|
|
225
|
-
MenubarContent,
|
|
226
|
-
MenubarItem,
|
|
227
|
-
MenubarSeparator,
|
|
228
|
-
MenubarLabel,
|
|
229
|
-
MenubarCheckboxItem,
|
|
230
|
-
MenubarRadioGroup,
|
|
231
|
-
MenubarRadioItem,
|
|
232
|
-
MenubarPortal,
|
|
233
|
-
MenubarSubContent,
|
|
234
|
-
MenubarSubTrigger,
|
|
235
|
-
MenubarGroup,
|
|
236
|
-
MenubarSub,
|
|
237
|
-
MenubarShortcut,
|
|
238
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { ChevronDownIcon } from "@radix-ui/react-icons"
|
|
3
|
-
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
4
|
-
import { cva } from "class-variance-authority"
|
|
5
|
-
|
|
6
|
-
import { cn } from "frontend/lib/utils"
|
|
7
|
-
|
|
8
|
-
const NavigationMenu = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
|
|
11
|
-
>(({ className, children, ...props }, ref) => (
|
|
12
|
-
<NavigationMenuPrimitive.Root
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
"relative z-10 flex max-w-max flex-1 items-center justify-center",
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
{children}
|
|
21
|
-
<NavigationMenuViewport />
|
|
22
|
-
</NavigationMenuPrimitive.Root>
|
|
23
|
-
))
|
|
24
|
-
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
|
25
|
-
|
|
26
|
-
const NavigationMenuList = React.forwardRef<
|
|
27
|
-
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
|
28
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
|
|
29
|
-
>(({ className, ...props }, ref) => (
|
|
30
|
-
<NavigationMenuPrimitive.List
|
|
31
|
-
ref={ref}
|
|
32
|
-
className={cn(
|
|
33
|
-
"group flex flex-1 list-none items-center justify-center space-x-1",
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
))
|
|
39
|
-
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
40
|
-
|
|
41
|
-
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
|
42
|
-
|
|
43
|
-
const navigationMenuTriggerStyle = cva(
|
|
44
|
-
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
const NavigationMenuTrigger = React.forwardRef<
|
|
48
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
49
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
|
|
50
|
-
>(({ className, children, ...props }, ref) => (
|
|
51
|
-
<NavigationMenuPrimitive.Trigger
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
54
|
-
{...props}
|
|
55
|
-
>
|
|
56
|
-
{children}{" "}
|
|
57
|
-
<ChevronDownIcon
|
|
58
|
-
className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
59
|
-
aria-hidden="true"
|
|
60
|
-
/>
|
|
61
|
-
</NavigationMenuPrimitive.Trigger>
|
|
62
|
-
))
|
|
63
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
|
64
|
-
|
|
65
|
-
const NavigationMenuContent = React.forwardRef<
|
|
66
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
67
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
|
|
68
|
-
>(({ className, ...props }, ref) => (
|
|
69
|
-
<NavigationMenuPrimitive.Content
|
|
70
|
-
ref={ref}
|
|
71
|
-
className={cn(
|
|
72
|
-
"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
|
|
73
|
-
className,
|
|
74
|
-
)}
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
))
|
|
78
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
|
79
|
-
|
|
80
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
|
81
|
-
|
|
82
|
-
const NavigationMenuViewport = React.forwardRef<
|
|
83
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
84
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
|
|
85
|
-
>(({ className, ...props }, ref) => (
|
|
86
|
-
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
|
87
|
-
<NavigationMenuPrimitive.Viewport
|
|
88
|
-
className={cn(
|
|
89
|
-
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
90
|
-
className,
|
|
91
|
-
)}
|
|
92
|
-
ref={ref}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
))
|
|
97
|
-
NavigationMenuViewport.displayName =
|
|
98
|
-
NavigationMenuPrimitive.Viewport.displayName
|
|
99
|
-
|
|
100
|
-
const NavigationMenuIndicator = React.forwardRef<
|
|
101
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
102
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
|
|
103
|
-
>(({ className, ...props }, ref) => (
|
|
104
|
-
<NavigationMenuPrimitive.Indicator
|
|
105
|
-
ref={ref}
|
|
106
|
-
className={cn(
|
|
107
|
-
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
108
|
-
className,
|
|
109
|
-
)}
|
|
110
|
-
{...props}
|
|
111
|
-
>
|
|
112
|
-
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
113
|
-
</NavigationMenuPrimitive.Indicator>
|
|
114
|
-
))
|
|
115
|
-
NavigationMenuIndicator.displayName =
|
|
116
|
-
NavigationMenuPrimitive.Indicator.displayName
|
|
117
|
-
|
|
118
|
-
export {
|
|
119
|
-
navigationMenuTriggerStyle,
|
|
120
|
-
NavigationMenu,
|
|
121
|
-
NavigationMenuList,
|
|
122
|
-
NavigationMenuItem,
|
|
123
|
-
NavigationMenuContent,
|
|
124
|
-
NavigationMenuTrigger,
|
|
125
|
-
NavigationMenuLink,
|
|
126
|
-
NavigationMenuIndicator,
|
|
127
|
-
NavigationMenuViewport,
|
|
128
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
3
|
-
|
|
4
|
-
import { cn } from "frontend/lib/utils"
|
|
5
|
-
|
|
6
|
-
const Popover = PopoverPrimitive.Root
|
|
7
|
-
|
|
8
|
-
const PopoverTrigger = PopoverPrimitive.Trigger
|
|
9
|
-
|
|
10
|
-
const PopoverAnchor = PopoverPrimitive.Anchor
|
|
11
|
-
|
|
12
|
-
const PopoverContent = React.forwardRef<
|
|
13
|
-
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
14
|
-
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
15
|
-
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
16
|
-
<PopoverPrimitive.Portal>
|
|
17
|
-
<PopoverPrimitive.Content
|
|
18
|
-
ref={ref}
|
|
19
|
-
align={align}
|
|
20
|
-
sideOffset={sideOffset}
|
|
21
|
-
className={cn(
|
|
22
|
-
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
</PopoverPrimitive.Portal>
|
|
28
|
-
))
|
|
29
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
30
|
-
|
|
31
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import {
|
|
3
|
-
CaretSortIcon,
|
|
4
|
-
CheckIcon,
|
|
5
|
-
ChevronDownIcon,
|
|
6
|
-
ChevronUpIcon,
|
|
7
|
-
} from "@radix-ui/react-icons"
|
|
8
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
9
|
-
|
|
10
|
-
import { cn } from "frontend/lib/utils"
|
|
11
|
-
|
|
12
|
-
const Select = SelectPrimitive.Root
|
|
13
|
-
|
|
14
|
-
const SelectGroup = SelectPrimitive.Group
|
|
15
|
-
|
|
16
|
-
const SelectValue = SelectPrimitive.Value
|
|
17
|
-
|
|
18
|
-
const SelectTrigger = React.forwardRef<
|
|
19
|
-
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
20
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
21
|
-
>(({ className, children, ...props }, ref) => (
|
|
22
|
-
<SelectPrimitive.Trigger
|
|
23
|
-
ref={ref}
|
|
24
|
-
className={cn(
|
|
25
|
-
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
26
|
-
className,
|
|
27
|
-
)}
|
|
28
|
-
{...props}
|
|
29
|
-
>
|
|
30
|
-
{children}
|
|
31
|
-
<SelectPrimitive.Icon asChild>
|
|
32
|
-
<CaretSortIcon className="h-4 w-4 opacity-50" />
|
|
33
|
-
</SelectPrimitive.Icon>
|
|
34
|
-
</SelectPrimitive.Trigger>
|
|
35
|
-
))
|
|
36
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
37
|
-
|
|
38
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
39
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
40
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
41
|
-
>(({ className, ...props }, ref) => (
|
|
42
|
-
<SelectPrimitive.ScrollUpButton
|
|
43
|
-
ref={ref}
|
|
44
|
-
className={cn(
|
|
45
|
-
"flex cursor-default items-center justify-center py-1",
|
|
46
|
-
className,
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
>
|
|
50
|
-
<ChevronUpIcon />
|
|
51
|
-
</SelectPrimitive.ScrollUpButton>
|
|
52
|
-
))
|
|
53
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
|
|
54
|
-
|
|
55
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
56
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
57
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
58
|
-
>(({ className, ...props }, ref) => (
|
|
59
|
-
<SelectPrimitive.ScrollDownButton
|
|
60
|
-
ref={ref}
|
|
61
|
-
className={cn(
|
|
62
|
-
"flex cursor-default items-center justify-center py-1",
|
|
63
|
-
className,
|
|
64
|
-
)}
|
|
65
|
-
{...props}
|
|
66
|
-
>
|
|
67
|
-
<ChevronDownIcon />
|
|
68
|
-
</SelectPrimitive.ScrollDownButton>
|
|
69
|
-
))
|
|
70
|
-
SelectScrollDownButton.displayName =
|
|
71
|
-
SelectPrimitive.ScrollDownButton.displayName
|
|
72
|
-
|
|
73
|
-
const SelectContent = React.forwardRef<
|
|
74
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
75
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
76
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
77
|
-
<SelectPrimitive.Portal>
|
|
78
|
-
<SelectPrimitive.Content
|
|
79
|
-
ref={ref}
|
|
80
|
-
className={cn(
|
|
81
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
|
|
82
|
-
position === "popper" &&
|
|
83
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
84
|
-
className,
|
|
85
|
-
)}
|
|
86
|
-
position={position}
|
|
87
|
-
{...props}
|
|
88
|
-
>
|
|
89
|
-
<SelectScrollUpButton />
|
|
90
|
-
<SelectPrimitive.Viewport
|
|
91
|
-
className={cn(
|
|
92
|
-
"p-1",
|
|
93
|
-
position === "popper" &&
|
|
94
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
95
|
-
)}
|
|
96
|
-
>
|
|
97
|
-
{children}
|
|
98
|
-
</SelectPrimitive.Viewport>
|
|
99
|
-
<SelectScrollDownButton />
|
|
100
|
-
</SelectPrimitive.Content>
|
|
101
|
-
</SelectPrimitive.Portal>
|
|
102
|
-
))
|
|
103
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
104
|
-
|
|
105
|
-
const SelectLabel = React.forwardRef<
|
|
106
|
-
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
107
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
108
|
-
>(({ className, ...props }, ref) => (
|
|
109
|
-
<SelectPrimitive.Label
|
|
110
|
-
ref={ref}
|
|
111
|
-
className={cn("px-2 py-1.5 text-sm font-semibold", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
))
|
|
115
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
116
|
-
|
|
117
|
-
const SelectItem = React.forwardRef<
|
|
118
|
-
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
119
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
120
|
-
>(({ className, children, ...props }, ref) => (
|
|
121
|
-
<SelectPrimitive.Item
|
|
122
|
-
ref={ref}
|
|
123
|
-
className={cn(
|
|
124
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
125
|
-
className,
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
>
|
|
129
|
-
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
130
|
-
<SelectPrimitive.ItemIndicator>
|
|
131
|
-
<CheckIcon className="h-4 w-4" />
|
|
132
|
-
</SelectPrimitive.ItemIndicator>
|
|
133
|
-
</span>
|
|
134
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
135
|
-
</SelectPrimitive.Item>
|
|
136
|
-
))
|
|
137
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
138
|
-
|
|
139
|
-
const SelectSeparator = React.forwardRef<
|
|
140
|
-
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
141
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
142
|
-
>(({ className, ...props }, ref) => (
|
|
143
|
-
<SelectPrimitive.Separator
|
|
144
|
-
ref={ref}
|
|
145
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
146
|
-
{...props}
|
|
147
|
-
/>
|
|
148
|
-
))
|
|
149
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
150
|
-
|
|
151
|
-
export {
|
|
152
|
-
Select,
|
|
153
|
-
SelectGroup,
|
|
154
|
-
SelectValue,
|
|
155
|
-
SelectTrigger,
|
|
156
|
-
SelectContent,
|
|
157
|
-
SelectLabel,
|
|
158
|
-
SelectItem,
|
|
159
|
-
SelectSeparator,
|
|
160
|
-
SelectScrollUpButton,
|
|
161
|
-
SelectScrollDownButton,
|
|
162
|
-
}
|