@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.
Files changed (203) hide show
  1. package/README.md +229 -0
  2. package/bin/create-registry.js +1 -1
  3. package/bin/test-mcp.sh +1 -1
  4. package/bin/update-registry.js +2 -2
  5. package/dist/index.d.mts +16 -0
  6. package/dist/index.d.ts +16 -0
  7. package/dist/index.js +9458 -0
  8. package/dist/index.mjs +9449 -0
  9. package/dist/lib/utils.d.mts +2 -0
  10. package/dist/lib/utils.d.ts +2 -0
  11. package/dist/lib/utils.js +47 -0
  12. package/dist/lib/utils.mjs +28 -0
  13. package/dist/src/utils.d.mts +7 -0
  14. package/dist/src/utils.d.ts +7 -0
  15. package/dist/src/utils.js +47 -0
  16. package/dist/src/utils.mjs +28 -0
  17. package/dist/tailwind/index.d.mts +2 -0
  18. package/dist/tailwind/index.d.ts +2 -0
  19. package/dist/tailwind/index.js +2048 -0
  20. package/dist/tailwind/index.mjs +2017 -0
  21. package/dist/types/index.d.mts +12 -0
  22. package/dist/types/index.d.ts +12 -0
  23. package/dist/types/index.js +79 -0
  24. package/dist/types/index.mjs +56 -0
  25. package/package.json +170 -23
  26. package/style/theme-provider.tsx +1 -1
  27. package/MCP-INSTRUCTIONS.md +0 -73
  28. package/README-MCP.md +0 -175
  29. package/blocks/components/accordian-block.tsx +0 -48
  30. package/blocks/components/block-component-props.ts +0 -11
  31. package/blocks/components/bullet-cards-block.tsx +0 -46
  32. package/blocks/components/card-block/index.tsx +0 -171
  33. package/blocks/components/card-block/link-out-button.tsx +0 -20
  34. package/blocks/components/card-block/util.ts +0 -28
  35. package/blocks/components/carte-blanche-block/index.tsx +0 -127
  36. package/blocks/components/carte-blanche-block/variant-content-left.tsx +0 -49
  37. package/blocks/components/content.tsx +0 -70
  38. package/blocks/components/cta-block.tsx +0 -115
  39. package/blocks/components/enh-heading-block.tsx +0 -204
  40. package/blocks/components/grid-block/grid-block-mutator.ts +0 -12
  41. package/blocks/components/grid-block/index.tsx +0 -83
  42. package/blocks/components/grid-block/mutator-registry.ts +0 -10
  43. package/blocks/components/grid-block/table-borders.mutator.ts +0 -47
  44. package/blocks/components/group-block.tsx +0 -83
  45. package/blocks/components/heading-block.tsx +0 -88
  46. package/blocks/components/image-block.tsx +0 -111
  47. package/blocks/components/index.ts +0 -30
  48. package/blocks/components/screenful-block/content.tsx +0 -123
  49. package/blocks/components/screenful-block/index.tsx +0 -107
  50. package/blocks/components/screenful-block/poster-background.tsx +0 -34
  51. package/blocks/components/screenful-block/video-background.tsx +0 -45
  52. package/blocks/components/space-block.tsx +0 -66
  53. package/blocks/components/video-block.tsx +0 -138
  54. package/blocks/def/accordian-block.ts +0 -14
  55. package/blocks/def/block.ts +0 -7
  56. package/blocks/def/bullet-cards-block.ts +0 -22
  57. package/blocks/def/card-block.ts +0 -22
  58. package/blocks/def/carte-blanche-block.ts +0 -21
  59. package/blocks/def/cta-block.ts +0 -19
  60. package/blocks/def/element-block.ts +0 -11
  61. package/blocks/def/enh-heading-block.ts +0 -44
  62. package/blocks/def/grid-block.ts +0 -16
  63. package/blocks/def/group-block.ts +0 -11
  64. package/blocks/def/heading-block.ts +0 -15
  65. package/blocks/def/image-block.ts +0 -31
  66. package/blocks/def/index.ts +0 -35
  67. package/blocks/def/screenful-block.ts +0 -54
  68. package/blocks/def/space-block.ts +0 -64
  69. package/blocks/def/video-block.ts +0 -9
  70. package/blocks/index.ts +0 -2
  71. package/dist/mcp/enhanced-server.d.ts +0 -29
  72. package/dist/mcp/enhanced-server.js +0 -1128
  73. package/dist/mcp/index.d.ts +0 -28
  74. package/dist/mcp/index.js +0 -436
  75. package/dist/registry/api.d.ts +0 -37
  76. package/dist/registry/api.js +0 -129
  77. package/dist/registry/index.d.ts +0 -353
  78. package/dist/registry/index.js +0 -45
  79. package/environment.d.ts +0 -6
  80. package/primitives/accordion.tsx +0 -66
  81. package/primitives/action-button.tsx +0 -42
  82. package/primitives/apply-typography.tsx +0 -55
  83. package/primitives/aspect-ratio.tsx +0 -5
  84. package/primitives/avatar.tsx +0 -49
  85. package/primitives/badge.tsx +0 -36
  86. package/primitives/breadcrumb.tsx +0 -115
  87. package/primitives/breakpoint-indicator.tsx +0 -19
  88. package/primitives/button.tsx +0 -85
  89. package/primitives/calendar.tsx +0 -72
  90. package/primitives/card.tsx +0 -83
  91. package/primitives/carousel.tsx +0 -237
  92. package/primitives/checkbox.tsx +0 -32
  93. package/primitives/combobox.tsx +0 -239
  94. package/primitives/command.tsx +0 -157
  95. package/primitives/context-menu.tsx +0 -200
  96. package/primitives/dialog-video-controller.tsx +0 -38
  97. package/primitives/dialog.tsx +0 -157
  98. package/primitives/drawer.tsx +0 -138
  99. package/primitives/form.tsx +0 -178
  100. package/primitives/icons/github.tsx +0 -14
  101. package/primitives/icons/index.ts +0 -18
  102. package/primitives/icons/youtube-logo.tsx +0 -59
  103. package/primitives/index-common.ts +0 -224
  104. package/primitives/index-next.ts +0 -2
  105. package/primitives/input-otp.tsx +0 -65
  106. package/primitives/input.tsx +0 -30
  107. package/primitives/label.tsx +0 -28
  108. package/primitives/list-adaptor.ts +0 -12
  109. package/primitives/list-box.tsx +0 -74
  110. package/primitives/loading-spinner.tsx +0 -33
  111. package/primitives/navigation-menu.tsx +0 -147
  112. package/primitives/next/image.tsx +0 -90
  113. package/primitives/next/index.ts +0 -7
  114. package/primitives/next/inline-icon.tsx +0 -36
  115. package/primitives/next/link-element.tsx +0 -109
  116. package/primitives/next/mdx-link.tsx +0 -22
  117. package/primitives/next/media-stack.tsx +0 -69
  118. package/primitives/next/nav-items.tsx +0 -45
  119. package/primitives/next/youtube-embed.tsx +0 -83
  120. package/primitives/popover.tsx +0 -37
  121. package/primitives/progress.tsx +0 -27
  122. package/primitives/radio-group.tsx +0 -56
  123. package/primitives/scroll-area.tsx +0 -47
  124. package/primitives/select.tsx +0 -169
  125. package/primitives/separator.tsx +0 -29
  126. package/primitives/sheet.tsx +0 -178
  127. package/primitives/skeleton.tsx +0 -20
  128. package/primitives/slider.tsx +0 -72
  129. package/primitives/sonner.tsx +0 -35
  130. package/primitives/step-indicator.tsx +0 -69
  131. package/primitives/switch.tsx +0 -35
  132. package/primitives/table.tsx +0 -117
  133. package/primitives/tabs.tsx +0 -60
  134. package/primitives/text-area.tsx +0 -26
  135. package/primitives/toggle-group.tsx +0 -63
  136. package/primitives/toggle.tsx +0 -73
  137. package/primitives/tooltip.tsx +0 -48
  138. package/primitives/video-player.tsx +0 -23
  139. package/public/r/accordion.json +0 -11
  140. package/public/r/alert.json +0 -11
  141. package/public/r/avatar.json +0 -11
  142. package/public/r/badge.json +0 -11
  143. package/public/r/button.json +0 -11
  144. package/public/r/card.json +0 -11
  145. package/public/r/checkbox.json +0 -11
  146. package/public/r/default.json +0 -6
  147. package/public/r/dialog.json +0 -11
  148. package/public/r/input.json +0 -11
  149. package/public/r/label.json +0 -11
  150. package/public/r/new-york.json +0 -6
  151. package/public/r/popover.json +0 -11
  152. package/public/r/select.json +0 -11
  153. package/public/r/table.json +0 -11
  154. package/public/r/tabs.json +0 -11
  155. package/public/r/toast.json +0 -11
  156. package/registry.json +0 -184
  157. package/src/mcp/README.md +0 -141
  158. package/src/mcp/enhanced-server.ts +0 -1208
  159. package/src/mcp/index.ts +0 -518
  160. package/src/mcp/package.json +0 -10
  161. package/src/registry/api.ts +0 -164
  162. package/src/registry/index.ts +0 -60
  163. package/src/registry/package.json +0 -10
  164. package/tailwind/colors.tailwind.js +0 -53
  165. package/tailwind/fontFamily.tailwind.ts +0 -7
  166. package/tailwind/fontSize.tailwind.ts +0 -13
  167. package/tailwind/index.ts +0 -7
  168. package/tailwind/safelist.tailwind.js +0 -26
  169. package/tailwind/screens.tailwind.js +0 -8
  170. package/tailwind/spacing.tailwind.js +0 -65
  171. package/tailwind/tailwind.config.hanzo-preset.d.ts +0 -5
  172. package/tailwind/tailwind.config.hanzo-preset.js +0 -915
  173. package/tailwind/tw-font-desc.ts +0 -15
  174. package/tailwind/typo-plugin/get-plugin-styles.js +0 -679
  175. package/tailwind/typo-plugin/index.d.ts +0 -9
  176. package/tailwind/typo-plugin/index.js +0 -141
  177. package/tailwind/typo-plugin/utils.js +0 -60
  178. package/tailwind/typography-test.mdx +0 -35
  179. package/tailwind/z-index.tailwind.js +0 -71
  180. package/test/test-registry.js +0 -73
  181. package/tsconfig.json +0 -22
  182. package/types/animation-def.ts +0 -3
  183. package/types/breakpoints.ts +0 -11
  184. package/types/bullet-item.ts +0 -10
  185. package/types/button-def.ts +0 -39
  186. package/types/dimensions.ts +0 -8
  187. package/types/grid-def.ts +0 -56
  188. package/types/image-def.ts +0 -32
  189. package/types/index.ts +0 -29
  190. package/types/link-def.ts +0 -56
  191. package/types/media-stack-def.ts +0 -31
  192. package/types/t-shirt-size.ts +0 -5
  193. package/types/tshirt-dimensions.ts +0 -20
  194. package/types/video-def.ts +0 -25
  195. package/util/format-and-abbreviate-as-currency.ts +0 -125
  196. package/util/format-to-max-char.ts +0 -68
  197. package/util/index-client.ts +0 -3
  198. package/util/index.ts +0 -78
  199. package/util/number-abbreviate.ts +0 -49
  200. package/util/specifier.ts +0 -43
  201. package/util/spread-to-transform.ts +0 -24
  202. package/util/step-animation.ts +0 -90
  203. 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
-
@@ -1,2 +0,0 @@
1
- export * from './index-common'
2
- export * from './next'
@@ -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 }
@@ -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
@@ -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
- }
@@ -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
- }