@cosmicdrift/kumiko-renderer-web 0.133.0 → 0.135.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/ui/select.tsx DELETED
@@ -1,191 +0,0 @@
1
- // @ts-nocheck — vendored shadcn, regenerate via scripts/sync-shadcn.ts
2
- "use client"
3
-
4
- import * as React from "react"
5
- import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
6
- import { Select as SelectPrimitive } from "radix-ui"
7
-
8
- import { cn } from "../lib/cn"
9
-
10
- function Select({
11
- ...props
12
- }: React.ComponentProps<typeof SelectPrimitive.Root>) {
13
- return <SelectPrimitive.Root data-slot="select" {...props} />
14
- }
15
-
16
- function SelectGroup({
17
- ...props
18
- }: React.ComponentProps<typeof SelectPrimitive.Group>) {
19
- return <SelectPrimitive.Group data-slot="select-group" {...props} />
20
- }
21
-
22
- function SelectValue({
23
- ...props
24
- }: React.ComponentProps<typeof SelectPrimitive.Value>) {
25
- return <SelectPrimitive.Value data-slot="select-value" {...props} />
26
- }
27
-
28
- function SelectTrigger({
29
- className,
30
- size = "default",
31
- children,
32
- ...props
33
- }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
34
- size?: "sm" | "default"
35
- }) {
36
- return (
37
- <SelectPrimitive.Trigger
38
- data-slot="select-trigger"
39
- data-size={size}
40
- className={cn(
41
- "flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
42
- className
43
- )}
44
- {...props}
45
- >
46
- {children}
47
- <SelectPrimitive.Icon asChild>
48
- <ChevronDownIcon className="size-4 opacity-50" />
49
- </SelectPrimitive.Icon>
50
- </SelectPrimitive.Trigger>
51
- )
52
- }
53
-
54
- function SelectContent({
55
- className,
56
- children,
57
- position = "item-aligned",
58
- align = "center",
59
- ...props
60
- }: React.ComponentProps<typeof SelectPrimitive.Content>) {
61
- return (
62
- <SelectPrimitive.Portal>
63
- <SelectPrimitive.Content
64
- data-slot="select-content"
65
- className={cn(
66
- "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 bg-popover text-popover-foreground shadow-md 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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
67
- position === "popper" &&
68
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
69
- className
70
- )}
71
- position={position}
72
- align={align}
73
- {...props}
74
- >
75
- <SelectScrollUpButton />
76
- <SelectPrimitive.Viewport
77
- className={cn(
78
- "p-1",
79
- position === "popper" &&
80
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
81
- )}
82
- >
83
- {children}
84
- </SelectPrimitive.Viewport>
85
- <SelectScrollDownButton />
86
- </SelectPrimitive.Content>
87
- </SelectPrimitive.Portal>
88
- )
89
- }
90
-
91
- function SelectLabel({
92
- className,
93
- ...props
94
- }: React.ComponentProps<typeof SelectPrimitive.Label>) {
95
- return (
96
- <SelectPrimitive.Label
97
- data-slot="select-label"
98
- className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
99
- {...props}
100
- />
101
- )
102
- }
103
-
104
- function SelectItem({
105
- className,
106
- children,
107
- ...props
108
- }: React.ComponentProps<typeof SelectPrimitive.Item>) {
109
- return (
110
- <SelectPrimitive.Item
111
- data-slot="select-item"
112
- className={cn(
113
- "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 focus:bg-accent 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 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
114
- className
115
- )}
116
- {...props}
117
- >
118
- <span
119
- data-slot="select-item-indicator"
120
- className="absolute right-2 flex size-3.5 items-center justify-center"
121
- >
122
- <SelectPrimitive.ItemIndicator>
123
- <CheckIcon className="size-4" />
124
- </SelectPrimitive.ItemIndicator>
125
- </span>
126
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
127
- </SelectPrimitive.Item>
128
- )
129
- }
130
-
131
- function SelectSeparator({
132
- className,
133
- ...props
134
- }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
135
- return (
136
- <SelectPrimitive.Separator
137
- data-slot="select-separator"
138
- className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
139
- {...props}
140
- />
141
- )
142
- }
143
-
144
- function SelectScrollUpButton({
145
- className,
146
- ...props
147
- }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
148
- return (
149
- <SelectPrimitive.ScrollUpButton
150
- data-slot="select-scroll-up-button"
151
- className={cn(
152
- "flex cursor-default items-center justify-center py-1",
153
- className
154
- )}
155
- {...props}
156
- >
157
- <ChevronUpIcon className="size-4" />
158
- </SelectPrimitive.ScrollUpButton>
159
- )
160
- }
161
-
162
- function SelectScrollDownButton({
163
- className,
164
- ...props
165
- }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
166
- return (
167
- <SelectPrimitive.ScrollDownButton
168
- data-slot="select-scroll-down-button"
169
- className={cn(
170
- "flex cursor-default items-center justify-center py-1",
171
- className
172
- )}
173
- {...props}
174
- >
175
- <ChevronDownIcon className="size-4" />
176
- </SelectPrimitive.ScrollDownButton>
177
- )
178
- }
179
-
180
- export {
181
- Select,
182
- SelectContent,
183
- SelectGroup,
184
- SelectItem,
185
- SelectLabel,
186
- SelectScrollDownButton,
187
- SelectScrollUpButton,
188
- SelectSeparator,
189
- SelectTrigger,
190
- SelectValue,
191
- }