@hanzo/ui 4.5.4 → 4.7.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/README.md +229 -0
- package/bin/create-registry.js +1 -1
- package/bin/test-mcp.sh +1 -1
- package/bin/update-registry.js +2 -2
- package/dist/index.d.mts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +9458 -0
- package/dist/index.mjs +9449 -0
- package/dist/lib/utils.d.mts +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +47 -0
- package/dist/lib/utils.mjs +28 -0
- package/dist/src/utils.d.mts +7 -0
- package/dist/src/utils.d.ts +7 -0
- package/dist/src/utils.js +47 -0
- package/dist/src/utils.mjs +28 -0
- package/dist/tailwind/index.d.mts +2 -0
- package/dist/tailwind/index.d.ts +2 -0
- package/dist/tailwind/index.js +2048 -0
- package/dist/tailwind/index.mjs +2017 -0
- package/dist/types/index.d.mts +12 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +79 -0
- package/dist/types/index.mjs +56 -0
- package/package.json +170 -23
- package/style/theme-provider.tsx +1 -1
- package/MCP-INSTRUCTIONS.md +0 -73
- package/README-MCP.md +0 -175
- package/blocks/components/accordian-block.tsx +0 -48
- package/blocks/components/block-component-props.ts +0 -11
- package/blocks/components/bullet-cards-block.tsx +0 -46
- package/blocks/components/card-block/index.tsx +0 -171
- package/blocks/components/card-block/link-out-button.tsx +0 -20
- package/blocks/components/card-block/util.ts +0 -28
- package/blocks/components/carte-blanche-block/index.tsx +0 -127
- package/blocks/components/carte-blanche-block/variant-content-left.tsx +0 -49
- package/blocks/components/content.tsx +0 -70
- package/blocks/components/cta-block.tsx +0 -115
- package/blocks/components/enh-heading-block.tsx +0 -204
- package/blocks/components/grid-block/grid-block-mutator.ts +0 -12
- package/blocks/components/grid-block/index.tsx +0 -83
- package/blocks/components/grid-block/mutator-registry.ts +0 -10
- package/blocks/components/grid-block/table-borders.mutator.ts +0 -47
- package/blocks/components/group-block.tsx +0 -83
- package/blocks/components/heading-block.tsx +0 -88
- package/blocks/components/image-block.tsx +0 -111
- package/blocks/components/index.ts +0 -30
- package/blocks/components/screenful-block/content.tsx +0 -123
- package/blocks/components/screenful-block/index.tsx +0 -107
- package/blocks/components/screenful-block/poster-background.tsx +0 -34
- package/blocks/components/screenful-block/video-background.tsx +0 -45
- package/blocks/components/space-block.tsx +0 -66
- package/blocks/components/video-block.tsx +0 -138
- package/blocks/def/accordian-block.ts +0 -14
- package/blocks/def/block.ts +0 -7
- package/blocks/def/bullet-cards-block.ts +0 -22
- package/blocks/def/card-block.ts +0 -22
- package/blocks/def/carte-blanche-block.ts +0 -21
- package/blocks/def/cta-block.ts +0 -19
- package/blocks/def/element-block.ts +0 -11
- package/blocks/def/enh-heading-block.ts +0 -44
- package/blocks/def/grid-block.ts +0 -16
- package/blocks/def/group-block.ts +0 -11
- package/blocks/def/heading-block.ts +0 -15
- package/blocks/def/image-block.ts +0 -31
- package/blocks/def/index.ts +0 -35
- package/blocks/def/screenful-block.ts +0 -54
- package/blocks/def/space-block.ts +0 -64
- package/blocks/def/video-block.ts +0 -9
- package/blocks/index.ts +0 -2
- package/dist/mcp/enhanced-server.d.ts +0 -29
- package/dist/mcp/enhanced-server.js +0 -1128
- package/dist/mcp/index.d.ts +0 -28
- package/dist/mcp/index.js +0 -436
- package/dist/registry/api.d.ts +0 -37
- package/dist/registry/api.js +0 -129
- package/dist/registry/index.d.ts +0 -353
- package/dist/registry/index.js +0 -45
- package/environment.d.ts +0 -6
- package/primitives/accordion.tsx +0 -66
- package/primitives/action-button.tsx +0 -42
- package/primitives/apply-typography.tsx +0 -55
- package/primitives/aspect-ratio.tsx +0 -5
- package/primitives/avatar.tsx +0 -49
- package/primitives/badge.tsx +0 -36
- package/primitives/breadcrumb.tsx +0 -115
- package/primitives/breakpoint-indicator.tsx +0 -19
- package/primitives/button.tsx +0 -85
- package/primitives/calendar.tsx +0 -72
- package/primitives/card.tsx +0 -83
- package/primitives/carousel.tsx +0 -237
- package/primitives/checkbox.tsx +0 -32
- package/primitives/combobox.tsx +0 -239
- package/primitives/command.tsx +0 -157
- package/primitives/context-menu.tsx +0 -200
- package/primitives/dialog-video-controller.tsx +0 -38
- package/primitives/dialog.tsx +0 -157
- package/primitives/drawer.tsx +0 -138
- package/primitives/form.tsx +0 -178
- package/primitives/icons/github.tsx +0 -14
- package/primitives/icons/index.ts +0 -18
- package/primitives/icons/youtube-logo.tsx +0 -59
- package/primitives/index-common.ts +0 -224
- package/primitives/index-next.ts +0 -2
- package/primitives/input-otp.tsx +0 -65
- package/primitives/input.tsx +0 -30
- package/primitives/label.tsx +0 -28
- package/primitives/list-adaptor.ts +0 -12
- package/primitives/list-box.tsx +0 -74
- package/primitives/loading-spinner.tsx +0 -33
- package/primitives/navigation-menu.tsx +0 -147
- package/primitives/next/image.tsx +0 -90
- package/primitives/next/index.ts +0 -7
- package/primitives/next/inline-icon.tsx +0 -36
- package/primitives/next/link-element.tsx +0 -109
- package/primitives/next/mdx-link.tsx +0 -22
- package/primitives/next/media-stack.tsx +0 -69
- package/primitives/next/nav-items.tsx +0 -45
- package/primitives/next/youtube-embed.tsx +0 -83
- package/primitives/popover.tsx +0 -37
- package/primitives/progress.tsx +0 -27
- package/primitives/radio-group.tsx +0 -56
- package/primitives/scroll-area.tsx +0 -47
- package/primitives/select.tsx +0 -169
- package/primitives/separator.tsx +0 -29
- package/primitives/sheet.tsx +0 -178
- package/primitives/skeleton.tsx +0 -20
- package/primitives/slider.tsx +0 -72
- package/primitives/sonner.tsx +0 -35
- package/primitives/step-indicator.tsx +0 -69
- package/primitives/switch.tsx +0 -35
- package/primitives/table.tsx +0 -117
- package/primitives/tabs.tsx +0 -60
- package/primitives/text-area.tsx +0 -26
- package/primitives/toggle-group.tsx +0 -63
- package/primitives/toggle.tsx +0 -73
- package/primitives/tooltip.tsx +0 -48
- package/primitives/video-player.tsx +0 -23
- package/public/r/accordion.json +0 -11
- package/public/r/alert.json +0 -11
- package/public/r/avatar.json +0 -11
- package/public/r/badge.json +0 -11
- package/public/r/button.json +0 -11
- package/public/r/card.json +0 -11
- package/public/r/checkbox.json +0 -11
- package/public/r/default.json +0 -6
- package/public/r/dialog.json +0 -11
- package/public/r/input.json +0 -11
- package/public/r/label.json +0 -11
- package/public/r/new-york.json +0 -6
- package/public/r/popover.json +0 -11
- package/public/r/select.json +0 -11
- package/public/r/table.json +0 -11
- package/public/r/tabs.json +0 -11
- package/public/r/toast.json +0 -11
- package/registry.json +0 -184
- package/src/mcp/README.md +0 -141
- package/src/mcp/enhanced-server.ts +0 -1208
- package/src/mcp/index.ts +0 -518
- package/src/mcp/package.json +0 -10
- package/src/registry/api.ts +0 -164
- package/src/registry/index.ts +0 -60
- package/src/registry/package.json +0 -10
- package/tailwind/colors.tailwind.js +0 -53
- package/tailwind/fontFamily.tailwind.ts +0 -7
- package/tailwind/fontSize.tailwind.ts +0 -13
- package/tailwind/index.ts +0 -7
- package/tailwind/safelist.tailwind.js +0 -26
- package/tailwind/screens.tailwind.js +0 -8
- package/tailwind/spacing.tailwind.js +0 -65
- package/tailwind/tailwind.config.hanzo-preset.d.ts +0 -5
- package/tailwind/tailwind.config.hanzo-preset.js +0 -915
- package/tailwind/tw-font-desc.ts +0 -15
- package/tailwind/typo-plugin/get-plugin-styles.js +0 -679
- package/tailwind/typo-plugin/index.d.ts +0 -9
- package/tailwind/typo-plugin/index.js +0 -141
- package/tailwind/typo-plugin/utils.js +0 -60
- package/tailwind/typography-test.mdx +0 -35
- package/tailwind/z-index.tailwind.js +0 -71
- package/test/test-registry.js +0 -73
- package/tsconfig.json +0 -22
- package/types/animation-def.ts +0 -3
- package/types/breakpoints.ts +0 -11
- package/types/bullet-item.ts +0 -10
- package/types/button-def.ts +0 -39
- package/types/dimensions.ts +0 -8
- package/types/grid-def.ts +0 -56
- package/types/image-def.ts +0 -32
- package/types/index.ts +0 -29
- package/types/link-def.ts +0 -56
- package/types/media-stack-def.ts +0 -31
- package/types/t-shirt-size.ts +0 -5
- package/types/tshirt-dimensions.ts +0 -20
- package/types/video-def.ts +0 -25
- package/util/format-and-abbreviate-as-currency.ts +0 -125
- package/util/format-to-max-char.ts +0 -68
- package/util/index-client.ts +0 -3
- package/util/index.ts +0 -78
- package/util/number-abbreviate.ts +0 -49
- package/util/specifier.ts +0 -43
- package/util/spread-to-transform.ts +0 -24
- package/util/step-animation.ts +0 -90
- package/util/two-way-map.ts +0 -19
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Accordion,
|
|
3
|
-
AccordionItem,
|
|
4
|
-
AccordionTrigger,
|
|
5
|
-
AccordionContent
|
|
6
|
-
} from './accordion'
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
Avatar,
|
|
10
|
-
AvatarImage,
|
|
11
|
-
AvatarFallback
|
|
12
|
-
} from './avatar'
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
Breadcrumb,
|
|
16
|
-
BreadcrumbList,
|
|
17
|
-
BreadcrumbItem,
|
|
18
|
-
BreadcrumbLink,
|
|
19
|
-
BreadcrumbPage,
|
|
20
|
-
BreadcrumbSeparator,
|
|
21
|
-
BreadcrumbEllipsis,
|
|
22
|
-
} from './breadcrumb'
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
default as Button,
|
|
26
|
-
type ButtonProps,
|
|
27
|
-
buttonVariants,
|
|
28
|
-
} from './button'
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
Card,
|
|
32
|
-
CardHeader,
|
|
33
|
-
CardFooter,
|
|
34
|
-
CardTitle,
|
|
35
|
-
CardDescription,
|
|
36
|
-
CardContent
|
|
37
|
-
} from './card'
|
|
38
|
-
|
|
39
|
-
export {
|
|
40
|
-
type CarouselApi,
|
|
41
|
-
type CarouselOptions,
|
|
42
|
-
Carousel,
|
|
43
|
-
CarouselContent,
|
|
44
|
-
CarouselItem,
|
|
45
|
-
CarouselNext,
|
|
46
|
-
CarouselPrevious,
|
|
47
|
-
} from './carousel'
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
Command,
|
|
51
|
-
CommandDialog,
|
|
52
|
-
CommandInput,
|
|
53
|
-
CommandList,
|
|
54
|
-
CommandEmpty,
|
|
55
|
-
CommandGroup,
|
|
56
|
-
CommandItem,
|
|
57
|
-
CommandShortcut,
|
|
58
|
-
CommandSeparator,
|
|
59
|
-
} from './command'
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
ContextMenu,
|
|
64
|
-
ContextMenuTrigger,
|
|
65
|
-
ContextMenuContent,
|
|
66
|
-
ContextMenuItem,
|
|
67
|
-
ContextMenuCheckboxItem,
|
|
68
|
-
ContextMenuRadioItem,
|
|
69
|
-
ContextMenuLabel,
|
|
70
|
-
ContextMenuSeparator,
|
|
71
|
-
ContextMenuShortcut,
|
|
72
|
-
ContextMenuGroup,
|
|
73
|
-
ContextMenuPortal,
|
|
74
|
-
ContextMenuSub,
|
|
75
|
-
ContextMenuSubContent,
|
|
76
|
-
ContextMenuSubTrigger,
|
|
77
|
-
ContextMenuRadioGroup,
|
|
78
|
-
} from './context-menu'
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
type DrawerProps,
|
|
83
|
-
Drawer,
|
|
84
|
-
DrawerPortal,
|
|
85
|
-
DrawerOverlay,
|
|
86
|
-
DrawerTrigger,
|
|
87
|
-
DrawerClose,
|
|
88
|
-
DrawerContent,
|
|
89
|
-
DrawerHandle,
|
|
90
|
-
DrawerHeader,
|
|
91
|
-
DrawerFooter,
|
|
92
|
-
DrawerTitle,
|
|
93
|
-
DrawerDescription,
|
|
94
|
-
} from './drawer'
|
|
95
|
-
|
|
96
|
-
export {
|
|
97
|
-
Dialog,
|
|
98
|
-
DialogPortal,
|
|
99
|
-
DialogOverlay,
|
|
100
|
-
DialogClose,
|
|
101
|
-
DialogTrigger,
|
|
102
|
-
DialogContent,
|
|
103
|
-
DialogHeader,
|
|
104
|
-
DialogFooter,
|
|
105
|
-
DialogTitle,
|
|
106
|
-
DialogDescription,
|
|
107
|
-
} from './dialog'
|
|
108
|
-
|
|
109
|
-
export {
|
|
110
|
-
useFormField,
|
|
111
|
-
Form,
|
|
112
|
-
FormItem,
|
|
113
|
-
FormLabel,
|
|
114
|
-
FormControl,
|
|
115
|
-
FormDescription,
|
|
116
|
-
FormMessage,
|
|
117
|
-
FormField,
|
|
118
|
-
} from './form'
|
|
119
|
-
|
|
120
|
-
export {
|
|
121
|
-
InputOTP,
|
|
122
|
-
InputOTPGroup,
|
|
123
|
-
InputOTPSeparator,
|
|
124
|
-
InputOTPSlot,
|
|
125
|
-
} from './input-otp'
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
navigationMenuTriggerStyle,
|
|
129
|
-
NavigationMenu,
|
|
130
|
-
NavigationMenuList,
|
|
131
|
-
NavigationMenuItem,
|
|
132
|
-
NavigationMenuContent,
|
|
133
|
-
NavigationMenuTrigger,
|
|
134
|
-
NavigationMenuLink,
|
|
135
|
-
NavigationMenuIndicator,
|
|
136
|
-
NavigationMenuViewport,
|
|
137
|
-
} from './navigation-menu'
|
|
138
|
-
|
|
139
|
-
export {
|
|
140
|
-
Popover,
|
|
141
|
-
PopoverAnchor,
|
|
142
|
-
PopoverArrow,
|
|
143
|
-
PopoverClose,
|
|
144
|
-
PopoverContent,
|
|
145
|
-
PopoverTrigger,
|
|
146
|
-
} from './popover'
|
|
147
|
-
|
|
148
|
-
export {
|
|
149
|
-
Select,
|
|
150
|
-
SelectGroup,
|
|
151
|
-
SelectValue,
|
|
152
|
-
SelectTrigger,
|
|
153
|
-
SelectContent,
|
|
154
|
-
SelectLabel,
|
|
155
|
-
SelectItem,
|
|
156
|
-
SelectSeparator,
|
|
157
|
-
SelectScrollUpButton,
|
|
158
|
-
SelectScrollDownButton,
|
|
159
|
-
} from './select'
|
|
160
|
-
|
|
161
|
-
export {
|
|
162
|
-
Sheet,
|
|
163
|
-
SheetPortal,
|
|
164
|
-
SheetOverlay,
|
|
165
|
-
SheetTrigger,
|
|
166
|
-
SheetClose,
|
|
167
|
-
SheetContent,
|
|
168
|
-
SheetHeader,
|
|
169
|
-
SheetFooter,
|
|
170
|
-
SheetTitle,
|
|
171
|
-
SheetDescription,
|
|
172
|
-
} from './sheet'
|
|
173
|
-
|
|
174
|
-
export {
|
|
175
|
-
Table,
|
|
176
|
-
TableHeader,
|
|
177
|
-
TableBody,
|
|
178
|
-
TableFooter,
|
|
179
|
-
TableHead,
|
|
180
|
-
TableRow,
|
|
181
|
-
TableCell,
|
|
182
|
-
TableCaption,
|
|
183
|
-
} from './table'
|
|
184
|
-
|
|
185
|
-
export {
|
|
186
|
-
Tabs,
|
|
187
|
-
TabsList,
|
|
188
|
-
TabsTrigger,
|
|
189
|
-
TabsContent
|
|
190
|
-
} from './tabs'
|
|
191
|
-
|
|
192
|
-
export * from './tooltip'
|
|
193
|
-
|
|
194
|
-
export { default as ActionButton } from './action-button'
|
|
195
|
-
export { default as ApplyTypography, type TypographySize} from './apply-typography'
|
|
196
|
-
export { default as AspectRatio } from './aspect-ratio'
|
|
197
|
-
export { default as Badge } from './badge'
|
|
198
|
-
export { default as BreakpointIndicator } from './breakpoint-indicator'
|
|
199
|
-
export { default as Calendar } from './calendar'
|
|
200
|
-
export { default as Checkbox } from './checkbox'
|
|
201
|
-
export { default as Combobox, type ComboboxTriggerProps } from './combobox'
|
|
202
|
-
export { default as DialogVideoController } from './dialog-video-controller'
|
|
203
|
-
export { default as Input } from './input'
|
|
204
|
-
export { default as Label } from './label'
|
|
205
|
-
export type { default as ListAdaptor } from './list-adaptor'
|
|
206
|
-
export { default as ListBox } from './list-box'
|
|
207
|
-
export { default as LoadingSpinner } from './loading-spinner'
|
|
208
|
-
export { default as Progress } from './progress'
|
|
209
|
-
export { RadioGroup, RadioGroupItem } from './radio-group'
|
|
210
|
-
export { ScrollArea, ScrollBar } from './scroll-area'
|
|
211
|
-
export { default as Separator } from './separator'
|
|
212
|
-
export { default as Slider } from './slider'
|
|
213
|
-
export { default as Skeleton } from './skeleton'
|
|
214
|
-
export { default as StepIndicator } from './step-indicator'
|
|
215
|
-
export { default as Switch } from './switch'
|
|
216
|
-
export { default as TextArea } from './text-area'
|
|
217
|
-
export { Toaster, toast } from './sonner'
|
|
218
|
-
export { Toggle, toggleVariants } from './toggle'
|
|
219
|
-
export { ToggleGroup, ToggleGroupItem } from './toggle-group'
|
|
220
|
-
export { default as VideoPlayer } from './video-player'
|
|
221
|
-
|
|
222
|
-
export * as Icons from './icons'
|
|
223
|
-
|
|
224
|
-
|
package/primitives/index-next.ts
DELETED
package/primitives/input-otp.tsx
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import { OTPInput, type SlotProps } from 'input-otp'
|
|
5
|
-
import { Dot } from 'lucide-react'
|
|
6
|
-
|
|
7
|
-
import { cn } from '../util'
|
|
8
|
-
|
|
9
|
-
const InputOTP = React.forwardRef<
|
|
10
|
-
React.ElementRef<typeof OTPInput>,
|
|
11
|
-
React.ComponentPropsWithoutRef<typeof OTPInput>
|
|
12
|
-
>(({ className, ...props }, ref) => (
|
|
13
|
-
<OTPInput
|
|
14
|
-
ref={ref}
|
|
15
|
-
containerClassName={cn('flex items-center gap-2', className)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
))
|
|
19
|
-
InputOTP.displayName = 'InputOTP'
|
|
20
|
-
|
|
21
|
-
const InputOTPGroup = React.forwardRef<
|
|
22
|
-
React.ElementRef<'div'>,
|
|
23
|
-
React.ComponentPropsWithoutRef<'div'>
|
|
24
|
-
>(({ className, ...props }, ref) => (
|
|
25
|
-
<div ref={ref} className={cn('flex items-center', className)} {...props} />
|
|
26
|
-
))
|
|
27
|
-
InputOTPGroup.displayName = 'InputOTPGroup'
|
|
28
|
-
|
|
29
|
-
const InputOTPSlot = React.forwardRef<
|
|
30
|
-
React.ElementRef<'div'>,
|
|
31
|
-
SlotProps & React.ComponentPropsWithoutRef<'div'>
|
|
32
|
-
>(({ char, hasFakeCaret, isActive, className, ...props }, ref) => {
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(
|
|
37
|
-
'relative flex h-10 w-10 items-center justify-center border-y border-r border-muted-3 text-sm ',
|
|
38
|
-
'transition-all first:rounded-l-md first:border-l last:rounded-r-md',
|
|
39
|
-
isActive && 'z-above-content ring-2 ring-muted', // TODO: couldn't find: 'ring-offset-background'
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{char}
|
|
45
|
-
{hasFakeCaret && (
|
|
46
|
-
<div className='pointer-events-none absolute inset-0 flex items-center justify-center'>
|
|
47
|
-
<div className='animate-caret-blink h-4 w-px bg-foreground duration-1000' />
|
|
48
|
-
</div>
|
|
49
|
-
)}
|
|
50
|
-
</div>
|
|
51
|
-
)
|
|
52
|
-
})
|
|
53
|
-
InputOTPSlot.displayName = 'InputOTPSlot'
|
|
54
|
-
|
|
55
|
-
const InputOTPSeparator = React.forwardRef<
|
|
56
|
-
React.ElementRef<'div'>,
|
|
57
|
-
React.ComponentPropsWithoutRef<'div'>
|
|
58
|
-
>(({ ...props }, ref) => (
|
|
59
|
-
<div ref={ref} role='separator' {...props}>
|
|
60
|
-
<Dot />
|
|
61
|
-
</div>
|
|
62
|
-
))
|
|
63
|
-
InputOTPSeparator.displayName = 'InputOTPSeparator'
|
|
64
|
-
|
|
65
|
-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
package/primitives/input.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React from "react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "../util"
|
|
6
|
-
|
|
7
|
-
export interface InputProps
|
|
8
|
-
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
9
|
-
|
|
10
|
-
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
11
|
-
({ className, type, ...props }, ref) => {
|
|
12
|
-
return (
|
|
13
|
-
<input
|
|
14
|
-
type={type}
|
|
15
|
-
className={cn(
|
|
16
|
-
'flex h-10 w-full rounded-md border border-muted-3 bg-inherit px-3 py-2 text-sm ring-offset-background ' +
|
|
17
|
-
'file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-2 ' +
|
|
18
|
-
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 ' +
|
|
19
|
-
'first-letter:disabled:cursor-not-allowed disabled:opacity-50',
|
|
20
|
-
className
|
|
21
|
-
)}
|
|
22
|
-
ref={ref}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
)
|
|
28
|
-
Input.displayName = "Input"
|
|
29
|
-
|
|
30
|
-
export default Input
|
package/primitives/label.tsx
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
"use client"
|
|
3
|
-
|
|
4
|
-
import React from "react"
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
7
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
8
|
-
|
|
9
|
-
import { cn } from "../util"
|
|
10
|
-
|
|
11
|
-
const labelVariants = cva(
|
|
12
|
-
"font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
const Label = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
18
|
-
VariantProps<typeof labelVariants>
|
|
19
|
-
>(({ className, ...props }, ref) => (
|
|
20
|
-
<LabelPrimitive.Root
|
|
21
|
-
ref={ref}
|
|
22
|
-
className={cn(labelVariants(), className)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
))
|
|
26
|
-
Label.displayName = LabelPrimitive.Root.displayName
|
|
27
|
-
|
|
28
|
-
export default Label
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface ListAdaptor<T> {
|
|
2
|
-
getValue: (el: T) => string
|
|
3
|
-
equals: (el1: T, el2: T) => boolean
|
|
4
|
-
valueEquals: (el: T, v: string) => boolean
|
|
5
|
-
getLabel?: (el: T) => string
|
|
6
|
-
getImageUrl?: (el: T) => string | null
|
|
7
|
-
isDisabled?: (el: T) => boolean
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
type ListAdaptor as default
|
|
12
|
-
}
|
package/primitives/list-box.tsx
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { cn } from '../util'
|
|
4
|
-
|
|
5
|
-
function Item<T>({
|
|
6
|
-
value,
|
|
7
|
-
label,
|
|
8
|
-
className,
|
|
9
|
-
onClick,
|
|
10
|
-
first=false,
|
|
11
|
-
last=false,
|
|
12
|
-
selected=false
|
|
13
|
-
}:{
|
|
14
|
-
value: T
|
|
15
|
-
label: string
|
|
16
|
-
className: string
|
|
17
|
-
onClick: (val: T) => void
|
|
18
|
-
first?: boolean
|
|
19
|
-
last?: boolean
|
|
20
|
-
selected?: boolean
|
|
21
|
-
}) {
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div
|
|
25
|
-
className={cn(
|
|
26
|
-
'font-normal text-muted-1 px-3 py-1 cursor-pointer hover:text-foreground ',
|
|
27
|
-
last ? '' : 'border-b',
|
|
28
|
-
selected ? 'font-semibold text-accent hover:text-accent' : '',
|
|
29
|
-
className
|
|
30
|
-
)}
|
|
31
|
-
onClick={() => {onClick(value)}}
|
|
32
|
-
>
|
|
33
|
-
<span>{label}</span>
|
|
34
|
-
</div>
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function ListBox<T>({
|
|
39
|
-
values,
|
|
40
|
-
labels,
|
|
41
|
-
onValueChange,
|
|
42
|
-
value,
|
|
43
|
-
isEqual,
|
|
44
|
-
clx = '',
|
|
45
|
-
itemClx = ''
|
|
46
|
-
}:{
|
|
47
|
-
values: T[]
|
|
48
|
-
labels: string[]
|
|
49
|
-
onValueChange: (val: T) => void
|
|
50
|
-
value: T | undefined
|
|
51
|
-
isEqual: (v1: T, v2: T) => boolean
|
|
52
|
-
clx?: string
|
|
53
|
-
itemClx?: string
|
|
54
|
-
}): JSX.Element {
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div className={cn('border rounded-md select-none', clx)} >
|
|
58
|
-
{values.map((val, i) => (
|
|
59
|
-
<Item<T>
|
|
60
|
-
value={val}
|
|
61
|
-
label={labels[i]}
|
|
62
|
-
onClick={onValueChange}
|
|
63
|
-
className={itemClx}
|
|
64
|
-
first={i === 0}
|
|
65
|
-
last={i === values.length - 1}
|
|
66
|
-
selected={value && isEqual(val, value)}
|
|
67
|
-
key={labels[i]}
|
|
68
|
-
/>
|
|
69
|
-
))}
|
|
70
|
-
</div>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default ListBox
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { cn } from '../util'
|
|
2
|
-
|
|
3
|
-
// cf: https://github.com/shadcn-ui/ui/discussions/1694#discussioncomment-7851248
|
|
4
|
-
const LoadingSpinner: React.FC<
|
|
5
|
-
{
|
|
6
|
-
size?: number
|
|
7
|
-
className?: string
|
|
8
|
-
}
|
|
9
|
-
& React.SVGProps<SVGSVGElement>
|
|
10
|
-
> = ({
|
|
11
|
-
size = 24,
|
|
12
|
-
className='',
|
|
13
|
-
...props
|
|
14
|
-
}) => {
|
|
15
|
-
return (
|
|
16
|
-
<svg
|
|
17
|
-
width={size}
|
|
18
|
-
height={size}
|
|
19
|
-
{...props}
|
|
20
|
-
viewBox="0 0 24 24"
|
|
21
|
-
fill="none"
|
|
22
|
-
stroke="currentColor"
|
|
23
|
-
strokeWidth="2"
|
|
24
|
-
strokeLinecap="round"
|
|
25
|
-
strokeLinejoin="round"
|
|
26
|
-
className={cn("animate-spin", className)}
|
|
27
|
-
>
|
|
28
|
-
<path d="M21 12a9 9 0 1 1-6.219-8.56" />
|
|
29
|
-
</svg>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default LoadingSpinner
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'
|
|
5
|
-
import { cva } from 'class-variance-authority'
|
|
6
|
-
import { ChevronDown } from 'lucide-react'
|
|
7
|
-
|
|
8
|
-
import { cn } from '../util'
|
|
9
|
-
|
|
10
|
-
const NavigationMenu = React.forwardRef<
|
|
11
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
12
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
|
|
13
|
-
>(({ className, children, ...props }, ref) => (
|
|
14
|
-
<NavigationMenuPrimitive.Root
|
|
15
|
-
ref={ref}
|
|
16
|
-
className={cn(
|
|
17
|
-
'relative z-10 flex max-w-max flex-1 items-center justify-center',
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
{children}
|
|
23
|
-
{/* <NavigationMenuViewport /> */}
|
|
24
|
-
</NavigationMenuPrimitive.Root>
|
|
25
|
-
))
|
|
26
|
-
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
|
27
|
-
|
|
28
|
-
const NavigationMenuList = React.forwardRef<
|
|
29
|
-
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
|
30
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
|
|
31
|
-
>(({ className, ...props }, ref) => (
|
|
32
|
-
<NavigationMenuPrimitive.List
|
|
33
|
-
ref={ref}
|
|
34
|
-
className={cn(
|
|
35
|
-
'group flex flex-1 list-none items-center justify-center space-x-1',
|
|
36
|
-
className
|
|
37
|
-
)}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
))
|
|
41
|
-
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
42
|
-
|
|
43
|
-
const NavigationMenuItem = React.forwardRef<
|
|
44
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Item>,
|
|
45
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>
|
|
46
|
-
>(({ className, ...props }, ref) => (
|
|
47
|
-
<NavigationMenuPrimitive.Item
|
|
48
|
-
ref={ref}
|
|
49
|
-
className={cn("relative", className)}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
))
|
|
53
|
-
NavigationMenuItem.displayName = 'NavigationMenuItem'
|
|
54
|
-
|
|
55
|
-
const navigationMenuTriggerStyle = cva(
|
|
56
|
-
'group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 ' +
|
|
57
|
-
'text-sm font-medium transition-colors hover:bg-level-1 text-foreground hover:text-accent ' +
|
|
58
|
-
' focus:text-accent focus:outline-none disabled:pointer-events-none disabled:opacity-50 ' +
|
|
59
|
-
'data-[active]:bg-level-1/50 data-[state=open]:bg-level-1/50'
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
const NavigationMenuTrigger = React.forwardRef<
|
|
63
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
64
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
|
|
65
|
-
>(({ className, children, ...props }, ref) => (
|
|
66
|
-
<NavigationMenuPrimitive.Trigger
|
|
67
|
-
ref={ref}
|
|
68
|
-
className={cn(navigationMenuTriggerStyle(), 'group', className)}
|
|
69
|
-
{...props}
|
|
70
|
-
>
|
|
71
|
-
{children}{' '}
|
|
72
|
-
<ChevronDown
|
|
73
|
-
className='relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180'
|
|
74
|
-
aria-hidden='true'
|
|
75
|
-
/>
|
|
76
|
-
</NavigationMenuPrimitive.Trigger>
|
|
77
|
-
))
|
|
78
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
|
79
|
-
|
|
80
|
-
const NavigationMenuContent = React.forwardRef<
|
|
81
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
82
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
|
|
83
|
-
>(({ className, ...props }, ref) => (
|
|
84
|
-
<NavigationMenuPrimitive.Content
|
|
85
|
-
ref={ref}
|
|
86
|
-
className={cn(
|
|
87
|
-
"right-0 absolute",
|
|
88
|
-
"absolute top-full w-fit bg-popover mt-[5px]",
|
|
89
|
-
"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 bg-background overflow-hidden rounded-md border",
|
|
90
|
-
className
|
|
91
|
-
)}
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
))
|
|
95
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
|
96
|
-
|
|
97
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
|
98
|
-
|
|
99
|
-
const NavigationMenuViewport = React.forwardRef<
|
|
100
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
101
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
|
|
102
|
-
>(({ className, ...props }, ref) => (
|
|
103
|
-
<div className={cn('absolute left-0 top-full flex justify-center')}>
|
|
104
|
-
<NavigationMenuPrimitive.Viewport
|
|
105
|
-
className={cn(
|
|
106
|
-
'origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border ',
|
|
107
|
-
'bg-background text-foreground shadow-lg 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)]',
|
|
108
|
-
className
|
|
109
|
-
)}
|
|
110
|
-
ref={ref}
|
|
111
|
-
{...props}
|
|
112
|
-
/>
|
|
113
|
-
</div>
|
|
114
|
-
))
|
|
115
|
-
NavigationMenuViewport.displayName =
|
|
116
|
-
NavigationMenuPrimitive.Viewport.displayName
|
|
117
|
-
|
|
118
|
-
const NavigationMenuIndicator = React.forwardRef<
|
|
119
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
120
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
|
|
121
|
-
>(({ className, ...props }, ref) => (
|
|
122
|
-
<NavigationMenuPrimitive.Indicator
|
|
123
|
-
ref={ref}
|
|
124
|
-
className={cn(
|
|
125
|
-
'top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden',
|
|
126
|
-
'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in',
|
|
127
|
-
className
|
|
128
|
-
)}
|
|
129
|
-
{...props}
|
|
130
|
-
>
|
|
131
|
-
<div className='relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md' />
|
|
132
|
-
</NavigationMenuPrimitive.Indicator>
|
|
133
|
-
))
|
|
134
|
-
NavigationMenuIndicator.displayName =
|
|
135
|
-
NavigationMenuPrimitive.Indicator.displayName
|
|
136
|
-
|
|
137
|
-
export {
|
|
138
|
-
navigationMenuTriggerStyle,
|
|
139
|
-
NavigationMenu,
|
|
140
|
-
NavigationMenuList,
|
|
141
|
-
NavigationMenuItem,
|
|
142
|
-
NavigationMenuContent,
|
|
143
|
-
NavigationMenuTrigger,
|
|
144
|
-
NavigationMenuLink,
|
|
145
|
-
NavigationMenuIndicator,
|
|
146
|
-
NavigationMenuViewport,
|
|
147
|
-
}
|