@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
package/primitives/dialog.tsx
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import * as React from "react"
|
|
3
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
4
|
-
import { X } from "lucide-react"
|
|
5
|
-
import { cn } from "../util"
|
|
6
|
-
|
|
7
|
-
const Dialog = DialogPrimitive.Root
|
|
8
|
-
|
|
9
|
-
const DialogTrigger = DialogPrimitive.Trigger
|
|
10
|
-
|
|
11
|
-
interface DialogPortalProps extends React.PropsWithChildren<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>> {
|
|
12
|
-
className?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const DialogPortal = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof DialogPrimitive.Portal>,
|
|
17
|
-
DialogPortalProps
|
|
18
|
-
>(({ className, children, ...props }, ref) => (
|
|
19
|
-
<DialogPrimitive.Portal {...props}>
|
|
20
|
-
<div className={cn("fixed inset-0 z-50 flex items-end justify-center sm:items-center", className)}>
|
|
21
|
-
{children}
|
|
22
|
-
</div>
|
|
23
|
-
</DialogPrimitive.Portal>
|
|
24
|
-
))
|
|
25
|
-
DialogPortal.displayName = 'DialogPortal'
|
|
26
|
-
|
|
27
|
-
interface DialogOverlayProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> {
|
|
28
|
-
className?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const DialogOverlay = React.forwardRef<
|
|
32
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
33
|
-
DialogOverlayProps
|
|
34
|
-
>(({ className, ...props }, ref) => (
|
|
35
|
-
<DialogPrimitive.Overlay
|
|
36
|
-
ref={ref}
|
|
37
|
-
className={cn(
|
|
38
|
-
"fixed inset-0 z-50 bg-overlay backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
43
|
-
))
|
|
44
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
interface DialogCloseProps extends React.PropsWithChildren<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>> {
|
|
48
|
-
className?: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const DialogClose = React.forwardRef<
|
|
52
|
-
React.ElementRef<typeof DialogPrimitive.Close>,
|
|
53
|
-
DialogCloseProps
|
|
54
|
-
>(({ className, ...props }, ref) => (
|
|
55
|
-
<DialogPrimitive.Close
|
|
56
|
-
ref={ref}
|
|
57
|
-
className={cn(
|
|
58
|
-
"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",
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
<X className="h-4 w-4" />
|
|
64
|
-
<span className="sr-only">Close</span>
|
|
65
|
-
</DialogPrimitive.Close>
|
|
66
|
-
))
|
|
67
|
-
|
|
68
|
-
DialogClose.displayName = DialogPrimitive.Close.displayName
|
|
69
|
-
|
|
70
|
-
const DialogContent = React.forwardRef<
|
|
71
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
72
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
73
|
-
>(({ className, children, ...props }, ref) => (
|
|
74
|
-
<DialogPortal>
|
|
75
|
-
<DialogOverlay />
|
|
76
|
-
<DialogPrimitive.Content
|
|
77
|
-
ref={ref}
|
|
78
|
-
className={cn(
|
|
79
|
-
"fixed z-50 grid w-full gap-4 rounded-t-lg bg-level-1 p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",
|
|
80
|
-
className
|
|
81
|
-
)}
|
|
82
|
-
{...props}
|
|
83
|
-
>
|
|
84
|
-
{children}
|
|
85
|
-
<DialogClose />
|
|
86
|
-
</DialogPrimitive.Content>
|
|
87
|
-
</DialogPortal>
|
|
88
|
-
))
|
|
89
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName
|
|
90
|
-
|
|
91
|
-
const DialogHeader = ({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
95
|
-
<div
|
|
96
|
-
className={cn(
|
|
97
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
98
|
-
className
|
|
99
|
-
)}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
)
|
|
103
|
-
DialogHeader.displayName = "DialogHeader"
|
|
104
|
-
|
|
105
|
-
const DialogFooter = ({
|
|
106
|
-
className,
|
|
107
|
-
...props
|
|
108
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
109
|
-
<div
|
|
110
|
-
className={cn(
|
|
111
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
112
|
-
className
|
|
113
|
-
)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
)
|
|
117
|
-
DialogFooter.displayName = "DialogFooter"
|
|
118
|
-
|
|
119
|
-
const DialogTitle = React.forwardRef<
|
|
120
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
121
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
122
|
-
>(({ className, ...props }, ref) => (
|
|
123
|
-
<DialogPrimitive.Title
|
|
124
|
-
ref={ref}
|
|
125
|
-
className={cn(
|
|
126
|
-
"text-lg font-semibold leading-none tracking-tight text-foreground",
|
|
127
|
-
className
|
|
128
|
-
)}
|
|
129
|
-
{...props}
|
|
130
|
-
/>
|
|
131
|
-
))
|
|
132
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName
|
|
133
|
-
|
|
134
|
-
const DialogDescription = React.forwardRef<
|
|
135
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
136
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
137
|
-
>(({ className, ...props }, ref) => (
|
|
138
|
-
<DialogPrimitive.Description
|
|
139
|
-
ref={ref}
|
|
140
|
-
className={cn("text-sm text-muted-1", className)}
|
|
141
|
-
{...props}
|
|
142
|
-
/>
|
|
143
|
-
))
|
|
144
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName
|
|
145
|
-
|
|
146
|
-
export {
|
|
147
|
-
Dialog,
|
|
148
|
-
DialogTrigger,
|
|
149
|
-
DialogOverlay,
|
|
150
|
-
DialogClose,
|
|
151
|
-
DialogPortal,
|
|
152
|
-
DialogContent,
|
|
153
|
-
DialogHeader,
|
|
154
|
-
DialogFooter,
|
|
155
|
-
DialogTitle,
|
|
156
|
-
DialogDescription,
|
|
157
|
-
}
|
package/primitives/drawer.tsx
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import { Drawer as DrawerPrimitive } from '@hanzo/react-drawer'
|
|
5
|
-
|
|
6
|
-
import { cn } from '../util'
|
|
7
|
-
|
|
8
|
-
const Drawer = ({
|
|
9
|
-
shouldScaleBackground = false,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
|
|
12
|
-
<DrawerPrimitive.Root
|
|
13
|
-
shouldScaleBackground={shouldScaleBackground}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
)
|
|
17
|
-
Drawer.displayName = 'Drawer'
|
|
18
|
-
|
|
19
|
-
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
20
|
-
const DrawerPortal = DrawerPrimitive.Portal
|
|
21
|
-
const DrawerHandle = DrawerPrimitive.Handle
|
|
22
|
-
const DrawerClose = DrawerPrimitive.Close
|
|
23
|
-
|
|
24
|
-
const DrawerOverlay = React.forwardRef<
|
|
25
|
-
React.ElementRef<typeof DrawerPrimitive.Overlay>,
|
|
26
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
27
|
-
>(({ className, ...props }, ref) => (
|
|
28
|
-
<DrawerPrimitive.Overlay
|
|
29
|
-
ref={ref}
|
|
30
|
-
className={cn('fixed inset-0 bg-overlay backdrop-blur-sm', className)}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
))
|
|
34
|
-
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
|
|
35
|
-
|
|
36
|
-
const DrawerContent = React.forwardRef<
|
|
37
|
-
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
38
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
|
|
39
|
-
overlayClx?: string
|
|
40
|
-
defaultHandle?: boolean
|
|
41
|
-
}
|
|
42
|
-
>(({
|
|
43
|
-
className,
|
|
44
|
-
children,
|
|
45
|
-
overlayClx='',
|
|
46
|
-
defaultHandle=true,
|
|
47
|
-
...props
|
|
48
|
-
}, ref) => {
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<DrawerPortal>
|
|
52
|
-
{/* If no or same z index, overlay should precede content */}
|
|
53
|
-
<DrawerOverlay className={cn('z-below-modal', overlayClx)}/>
|
|
54
|
-
<DrawerPrimitive.Content
|
|
55
|
-
ref={ref}
|
|
56
|
-
className={cn('fixed left-0 right-0 bottom-0 z-modal',
|
|
57
|
-
'mt-24 flex flex-col rounded-t-[10px] pt-6 border bg-background',
|
|
58
|
-
// 'h-[80%]'
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
{defaultHandle && (
|
|
64
|
-
<div className='absolute left-0 right-0 mx-auto top-2 h-2 w-[100px] rounded-full bg-level-3 shrink-0' />
|
|
65
|
-
)}
|
|
66
|
-
{children}
|
|
67
|
-
</DrawerPrimitive.Content>
|
|
68
|
-
</DrawerPortal>
|
|
69
|
-
)
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
DrawerContent.displayName = 'DrawerContent'
|
|
73
|
-
|
|
74
|
-
const DrawerHeader = ({
|
|
75
|
-
className,
|
|
76
|
-
...props
|
|
77
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
78
|
-
<div
|
|
79
|
-
className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
)
|
|
83
|
-
DrawerHeader.displayName = 'DrawerHeader'
|
|
84
|
-
|
|
85
|
-
const DrawerFooter = ({
|
|
86
|
-
className,
|
|
87
|
-
...props
|
|
88
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
89
|
-
<div
|
|
90
|
-
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
)
|
|
94
|
-
DrawerFooter.displayName = 'DrawerFooter'
|
|
95
|
-
|
|
96
|
-
const DrawerTitle = React.forwardRef<
|
|
97
|
-
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
98
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
99
|
-
>(({ className, ...props }, ref) => (
|
|
100
|
-
<DrawerPrimitive.Title
|
|
101
|
-
ref={ref}
|
|
102
|
-
className={cn(
|
|
103
|
-
'text-lg font-semibold leading-none tracking-tight',
|
|
104
|
-
className
|
|
105
|
-
)}
|
|
106
|
-
{...props}
|
|
107
|
-
/>
|
|
108
|
-
))
|
|
109
|
-
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
|
|
110
|
-
|
|
111
|
-
const DrawerDescription = React.forwardRef<
|
|
112
|
-
React.ElementRef<typeof DrawerPrimitive.Description>,
|
|
113
|
-
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
|
|
114
|
-
>(({ className, ...props }, ref) => (
|
|
115
|
-
<DrawerPrimitive.Description
|
|
116
|
-
ref={ref}
|
|
117
|
-
className={cn('text-sm text-muted', className)}
|
|
118
|
-
{...props}
|
|
119
|
-
/>
|
|
120
|
-
))
|
|
121
|
-
DrawerDescription.displayName = DrawerPrimitive.Description.displayName
|
|
122
|
-
|
|
123
|
-
type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>
|
|
124
|
-
|
|
125
|
-
export {
|
|
126
|
-
type DrawerProps,
|
|
127
|
-
Drawer,
|
|
128
|
-
DrawerPortal,
|
|
129
|
-
DrawerOverlay,
|
|
130
|
-
DrawerTrigger,
|
|
131
|
-
DrawerClose,
|
|
132
|
-
DrawerContent,
|
|
133
|
-
DrawerHandle,
|
|
134
|
-
DrawerHeader,
|
|
135
|
-
DrawerFooter,
|
|
136
|
-
DrawerTitle,
|
|
137
|
-
DrawerDescription
|
|
138
|
-
}
|
package/primitives/form.tsx
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import * as React from "react"
|
|
3
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
4
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
Controller,
|
|
8
|
-
type ControllerProps,
|
|
9
|
-
type FieldPath,
|
|
10
|
-
type FieldValues,
|
|
11
|
-
FormProvider,
|
|
12
|
-
useFormContext,
|
|
13
|
-
} from "react-hook-form"
|
|
14
|
-
|
|
15
|
-
import { cn } from "../util"
|
|
16
|
-
import Label from "./label"
|
|
17
|
-
|
|
18
|
-
const Form = FormProvider
|
|
19
|
-
|
|
20
|
-
type FormFieldContextValue<
|
|
21
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
22
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
|
|
23
|
-
> = {
|
|
24
|
-
name: TName
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const FormFieldContext = React.createContext<FormFieldContextValue>(
|
|
28
|
-
{} as FormFieldContextValue
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
const FormField = <
|
|
32
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
33
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
|
|
34
|
-
>({
|
|
35
|
-
...props
|
|
36
|
-
}: ControllerProps<TFieldValues, TName>) => {
|
|
37
|
-
return (
|
|
38
|
-
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
39
|
-
<Controller {...props} />
|
|
40
|
-
</FormFieldContext.Provider>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const useFormField = () => {
|
|
45
|
-
const fieldContext = React.useContext(FormFieldContext)
|
|
46
|
-
const itemContext = React.useContext(FormItemContext)
|
|
47
|
-
const { getFieldState, formState } = useFormContext()
|
|
48
|
-
|
|
49
|
-
const fieldState = getFieldState(fieldContext.name, formState)
|
|
50
|
-
|
|
51
|
-
if (!fieldContext) {
|
|
52
|
-
throw new Error("useFormField should be used within <FormField>")
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const { id } = itemContext
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
id,
|
|
59
|
-
name: fieldContext.name,
|
|
60
|
-
formItemId: `${id}-form-item`,
|
|
61
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
62
|
-
formMessageId: `${id}-form-item-message`,
|
|
63
|
-
...fieldState,
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
type FormItemContextValue = {
|
|
68
|
-
id: string
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const FormItemContext = React.createContext<FormItemContextValue>(
|
|
72
|
-
{} as FormItemContextValue
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
const FormItem = React.forwardRef<
|
|
76
|
-
HTMLDivElement,
|
|
77
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
78
|
-
>(({ className, ...props }, ref) => {
|
|
79
|
-
const id = React.useId()
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<FormItemContext.Provider value={{ id }}>
|
|
83
|
-
<div ref={ref} className={cn("space-y-2", className)} {...props} />
|
|
84
|
-
</FormItemContext.Provider>
|
|
85
|
-
)
|
|
86
|
-
})
|
|
87
|
-
FormItem.displayName = "FormItem"
|
|
88
|
-
|
|
89
|
-
const FormLabel = React.forwardRef<
|
|
90
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
91
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
92
|
-
>(({ className, ...props }, ref) => {
|
|
93
|
-
const { error, formItemId } = useFormField()
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<Label
|
|
97
|
-
ref={ref}
|
|
98
|
-
className={cn(error && "text-destructive", className)}
|
|
99
|
-
htmlFor={formItemId}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
)
|
|
103
|
-
})
|
|
104
|
-
FormLabel.displayName = "FormLabel"
|
|
105
|
-
|
|
106
|
-
const FormControl = React.forwardRef<
|
|
107
|
-
React.ElementRef<typeof Slot>,
|
|
108
|
-
React.ComponentPropsWithoutRef<typeof Slot>
|
|
109
|
-
>(({ ...props }, ref) => {
|
|
110
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
111
|
-
|
|
112
|
-
return (
|
|
113
|
-
<Slot
|
|
114
|
-
ref={ref}
|
|
115
|
-
id={formItemId}
|
|
116
|
-
aria-describedby={
|
|
117
|
-
!error
|
|
118
|
-
? `${formDescriptionId}`
|
|
119
|
-
: `${formDescriptionId} ${formMessageId}`
|
|
120
|
-
}
|
|
121
|
-
aria-invalid={!!error}
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
)
|
|
125
|
-
})
|
|
126
|
-
FormControl.displayName = "FormControl"
|
|
127
|
-
|
|
128
|
-
const FormDescription = React.forwardRef<
|
|
129
|
-
HTMLParagraphElement,
|
|
130
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
131
|
-
>(({ className, ...props }, ref) => {
|
|
132
|
-
const { formDescriptionId } = useFormField()
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<p
|
|
136
|
-
ref={ref}
|
|
137
|
-
id={formDescriptionId}
|
|
138
|
-
className={cn("text-sm text-muted-1", className)}
|
|
139
|
-
{...props}
|
|
140
|
-
/>
|
|
141
|
-
)
|
|
142
|
-
})
|
|
143
|
-
FormDescription.displayName = "FormDescription"
|
|
144
|
-
|
|
145
|
-
const FormMessage = React.forwardRef<
|
|
146
|
-
HTMLParagraphElement,
|
|
147
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
148
|
-
>(({ className, children, ...props }, ref) => {
|
|
149
|
-
const { error, formMessageId } = useFormField()
|
|
150
|
-
const body = error ? String(error?.message) : children
|
|
151
|
-
|
|
152
|
-
const classes = 'text-xs font-medium py-1 ' +
|
|
153
|
-
(error ? 'text-destructive' : 'text-muted-1') +
|
|
154
|
-
(body ? '' : ' invisible') // Hold space in the layout
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<p
|
|
158
|
-
ref={ref}
|
|
159
|
-
id={formMessageId}
|
|
160
|
-
className={cn(classes, className)}
|
|
161
|
-
{...props}
|
|
162
|
-
>
|
|
163
|
-
{body ? body : 'dummy'}
|
|
164
|
-
</p>
|
|
165
|
-
)
|
|
166
|
-
})
|
|
167
|
-
FormMessage.displayName = "FormMessage"
|
|
168
|
-
|
|
169
|
-
export {
|
|
170
|
-
useFormField,
|
|
171
|
-
Form,
|
|
172
|
-
FormItem,
|
|
173
|
-
FormLabel,
|
|
174
|
-
FormControl,
|
|
175
|
-
FormDescription,
|
|
176
|
-
FormMessage,
|
|
177
|
-
FormField,
|
|
178
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { type LucideProps } from 'lucide-react'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const GitHub: React.FC<LucideProps> = (props: LucideProps) => (
|
|
6
|
-
<svg viewBox="0 0 438.549 438.549" {...props}>
|
|
7
|
-
<path
|
|
8
|
-
fill="currentColor"
|
|
9
|
-
d="M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"
|
|
10
|
-
></path>
|
|
11
|
-
</svg>
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
export default GitHub
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Moon as moon,
|
|
3
|
-
SunMedium as sun,
|
|
4
|
-
Menu as burger,
|
|
5
|
-
ArrowUpRight as linkOut,
|
|
6
|
-
} from 'lucide-react'
|
|
7
|
-
|
|
8
|
-
import youtube from './youtube-logo'
|
|
9
|
-
import gitHub from './github'
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
sun,
|
|
13
|
-
moon,
|
|
14
|
-
burger,
|
|
15
|
-
gitHub,
|
|
16
|
-
linkOut,
|
|
17
|
-
youtube,
|
|
18
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { type LucideProps } from 'lucide-react'
|
|
3
|
-
|
|
4
|
-
const YouTubeLogo: React.FC<LucideProps> = (props: LucideProps) => (
|
|
5
|
-
<svg
|
|
6
|
-
viewBox="0 0 256 256"
|
|
7
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
{...props}
|
|
9
|
-
>
|
|
10
|
-
<g
|
|
11
|
-
style={{
|
|
12
|
-
stroke: 'none',
|
|
13
|
-
strokeWidth: 0,
|
|
14
|
-
strokeDasharray: 'none',
|
|
15
|
-
strokeLinecap: 'butt',
|
|
16
|
-
strokeLinejoin: 'miter',
|
|
17
|
-
strokeMiterlimit: 10,
|
|
18
|
-
fill: 'none',
|
|
19
|
-
fillRule: 'nonzero',
|
|
20
|
-
opacity: 1
|
|
21
|
-
}}
|
|
22
|
-
transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"
|
|
23
|
-
>
|
|
24
|
-
<path
|
|
25
|
-
d="M 88.119 23.338 c -1.035 -3.872 -4.085 -6.922 -7.957 -7.957 C 73.144 13.5 45 13.5 45 13.5 s -28.144 0 -35.162 1.881 c -3.872 1.035 -6.922 4.085 -7.957 7.957 C 0 30.356 0 45 0 45 s 0 14.644 1.881 21.662 c 1.035 3.872 4.085 6.922 7.957 7.957 C 16.856 76.5 45 76.5 45 76.5 s 28.144 0 35.162 -1.881 c 3.872 -1.035 6.922 -4.085 7.957 -7.957 C 90 59.644 90 45 90 45 S 90 30.356 88.119 23.338 z"
|
|
26
|
-
style={{
|
|
27
|
-
stroke: 'none',
|
|
28
|
-
strokeWidth: 1,
|
|
29
|
-
strokeDasharray: 'none',
|
|
30
|
-
strokeLinecap: 'butt',
|
|
31
|
-
strokeLinejoin: 'miter',
|
|
32
|
-
strokeMiterlimit: 10,
|
|
33
|
-
fill: 'red',
|
|
34
|
-
fillRule: 'nonzero',
|
|
35
|
-
opacity: 1
|
|
36
|
-
}}
|
|
37
|
-
transform=" matrix(1 0 0 1 0 0) "
|
|
38
|
-
strokeLinecap="round"
|
|
39
|
-
/>
|
|
40
|
-
<polygon
|
|
41
|
-
points="36,58.5 59.38,45 36,31.5 "
|
|
42
|
-
style={{
|
|
43
|
-
stroke: 'none',
|
|
44
|
-
strokeWidth: 1,
|
|
45
|
-
strokeDasharray: 'none',
|
|
46
|
-
strokeLinecap: 'butt',
|
|
47
|
-
strokeLinejoin: 'miter',
|
|
48
|
-
strokeMiterlimit: 10,
|
|
49
|
-
fill: 'white',
|
|
50
|
-
fillRule: 'nonzero',
|
|
51
|
-
opacity: 1
|
|
52
|
-
}}
|
|
53
|
-
transform="matrix(1 0 0 1 0 0)"
|
|
54
|
-
/>
|
|
55
|
-
</g>
|
|
56
|
-
</svg>
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
export default YouTubeLogo
|