@codefast/ui 0.0.66 → 0.0.68
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/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +70 -102
- package/dist/chunk-DH3YP4ZC.cjs +0 -2
- package/dist/chunk-DH3YP4ZC.cjs.map +0 -1
- package/dist/chunk-DTSAQICV.js +0 -2
- package/dist/chunk-DTSAQICV.js.map +0 -1
- package/dist/chunk-NH6X3FON.js +0 -2
- package/dist/chunk-NH6X3FON.js.map +0 -1
- package/dist/chunk-P563ILDJ.cjs +0 -2
- package/dist/chunk-P563ILDJ.cjs.map +0 -1
- package/dist/chunk-VVA2EE5V.js +0 -2
- package/dist/chunk-VVA2EE5V.js.map +0 -1
- package/dist/chunk-VZ6P3BCB.cjs +0 -2
- package/dist/chunk-VZ6P3BCB.cjs.map +0 -1
- package/dist/hooks/use-media-query.cjs +0 -2
- package/dist/hooks/use-media-query.cjs.map +0 -1
- package/dist/hooks/use-media-query.d.cts +0 -3
- package/dist/hooks/use-media-query.d.ts +0 -3
- package/dist/hooks/use-media-query.js +0 -2
- package/dist/hooks/use-media-query.js.map +0 -1
- package/dist/hooks/use-mutation-observer.cjs +0 -2
- package/dist/hooks/use-mutation-observer.cjs.map +0 -1
- package/dist/hooks/use-mutation-observer.d.cts +0 -5
- package/dist/hooks/use-mutation-observer.d.ts +0 -5
- package/dist/hooks/use-mutation-observer.js +0 -2
- package/dist/hooks/use-mutation-observer.js.map +0 -1
- package/dist/lib/colors.cjs +0 -2
- package/dist/lib/colors.cjs.map +0 -1
- package/dist/lib/colors.d.cts +0 -1759
- package/dist/lib/colors.d.ts +0 -1759
- package/dist/lib/colors.js +0 -2
- package/dist/lib/colors.js.map +0 -1
- package/dist/plugin/animate.plugin.cjs +0 -2
- package/dist/plugin/animate.plugin.cjs.map +0 -1
- package/dist/plugin/animate.plugin.js +0 -2
- package/dist/plugin/animate.plugin.js.map +0 -1
- package/dist/plugin/base.plugin.cjs +0 -2
- package/dist/plugin/base.plugin.cjs.map +0 -1
- package/dist/plugin/base.plugin.js +0 -2
- package/dist/plugin/base.plugin.js.map +0 -1
- package/dist/plugin/perspective.plugin.cjs +0 -2
- package/dist/plugin/perspective.plugin.cjs.map +0 -1
- package/dist/plugin/perspective.plugin.js +0 -2
- package/dist/plugin/perspective.plugin.js.map +0 -1
- package/dist/tailwind.config.cjs +0 -2
- package/dist/tailwind.config.cjs.map +0 -1
- package/dist/tailwind.config.js +0 -2
- package/dist/tailwind.config.js.map +0 -1
- package/plugin/animate.plugin.ts +0 -319
- package/plugin/base.plugin.ts +0 -21
- package/plugin/perspective.plugin.ts +0 -11
- package/src/hooks/use-media-query.ts +0 -22
- package/src/hooks/use-mutation-observer.ts +0 -26
- package/src/lib/colors.ts +0 -1757
- package/src/lib/utils.ts +0 -6
- package/src/react/accordion.tsx +0 -88
- package/src/react/alert-dialog.tsx +0 -185
- package/src/react/alert.tsx +0 -73
- package/src/react/aspect-ratio.tsx +0 -17
- package/src/react/avatar.tsx +0 -60
- package/src/react/badge.tsx +0 -39
- package/src/react/blockquote.tsx +0 -26
- package/src/react/box.tsx +0 -34
- package/src/react/breadcrumb.tsx +0 -154
- package/src/react/button.tsx +0 -94
- package/src/react/calendar.tsx +0 -79
- package/src/react/card.tsx +0 -109
- package/src/react/carousel.tsx +0 -299
- package/src/react/checkbox-cards.tsx +0 -61
- package/src/react/checkbox-group.primitive.tsx +0 -206
- package/src/react/checkbox-group.tsx +0 -55
- package/src/react/checkbox.tsx +0 -36
- package/src/react/code.tsx +0 -26
- package/src/react/collapsible.tsx +0 -54
- package/src/react/command.tsx +0 -209
- package/src/react/container.tsx +0 -29
- package/src/react/context-menu.tsx +0 -306
- package/src/react/data-table.tsx +0 -249
- package/src/react/dialog.tsx +0 -160
- package/src/react/drawer.tsx +0 -136
- package/src/react/dropdown-menu.tsx +0 -290
- package/src/react/em.tsx +0 -26
- package/src/react/form.tsx +0 -234
- package/src/react/heading.tsx +0 -29
- package/src/react/hover-card.tsx +0 -75
- package/src/react/input-otp.tsx +0 -120
- package/src/react/input.tsx +0 -145
- package/src/react/kbd.tsx +0 -36
- package/src/react/label.tsx +0 -31
- package/src/react/menubar.tsx +0 -322
- package/src/react/navigation-menu.tsx +0 -192
- package/src/react/pagination.tsx +0 -150
- package/src/react/popover.tsx +0 -84
- package/src/react/pre.tsx +0 -26
- package/src/react/progress.tsx +0 -35
- package/src/react/quote.tsx +0 -26
- package/src/react/radio-cards.tsx +0 -48
- package/src/react/radio-group.tsx +0 -50
- package/src/react/radio.tsx +0 -40
- package/src/react/resizable.tsx +0 -62
- package/src/react/scroll-area.tsx +0 -106
- package/src/react/section.tsx +0 -26
- package/src/react/select.tsx +0 -219
- package/src/react/separator.tsx +0 -32
- package/src/react/sheet.tsx +0 -178
- package/src/react/skeleton.tsx +0 -18
- package/src/react/slider.tsx +0 -41
- package/src/react/sonner.tsx +0 -40
- package/src/react/spinner.tsx +0 -68
- package/src/react/strong.tsx +0 -26
- package/src/react/switch.tsx +0 -33
- package/src/react/table.tsx +0 -148
- package/src/react/tabs.tsx +0 -87
- package/src/react/text-input.tsx +0 -36
- package/src/react/text.tsx +0 -34
- package/src/react/textarea.tsx +0 -30
- package/src/react/toggle-group.tsx +0 -84
- package/src/react/toggle.tsx +0 -49
- package/src/react/tooltip.tsx +0 -83
- package/src/styles/styles.css +0 -3
- package/tailwind.config.ts +0 -126
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from '@radix-ui/react-icons';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: DropdownMenu
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
13
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
14
|
-
|
|
15
|
-
/* -----------------------------------------------------------------------------
|
|
16
|
-
* Component: DropdownMenuTrigger
|
|
17
|
-
* -------------------------------------------------------------------------- */
|
|
18
|
-
|
|
19
|
-
type DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>;
|
|
20
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Component: DropdownMenuGroup
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
type DropdownMenuGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>;
|
|
27
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
28
|
-
|
|
29
|
-
/* -----------------------------------------------------------------------------
|
|
30
|
-
* Component: DropdownMenuSub
|
|
31
|
-
* -------------------------------------------------------------------------- */
|
|
32
|
-
|
|
33
|
-
type DropdownMenuSubProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub>;
|
|
34
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
35
|
-
|
|
36
|
-
/* -----------------------------------------------------------------------------
|
|
37
|
-
* Component: DropdownMenuSubTrigger
|
|
38
|
-
* -------------------------------------------------------------------------- */
|
|
39
|
-
|
|
40
|
-
type DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>;
|
|
41
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
42
|
-
|
|
43
|
-
/* -----------------------------------------------------------------------------
|
|
44
|
-
* Component: DropdownMenuSubTrigger
|
|
45
|
-
* -------------------------------------------------------------------------- */
|
|
46
|
-
|
|
47
|
-
type DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;
|
|
48
|
-
|
|
49
|
-
interface DropdownMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {
|
|
50
|
-
inset?: boolean;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const DropdownMenuSubTrigger = React.forwardRef<DropdownMenuSubTriggerElement, DropdownMenuSubTriggerProps>(
|
|
54
|
-
({ children, className, inset, ...props }, forwardedRef) => (
|
|
55
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
56
|
-
ref={forwardedRef}
|
|
57
|
-
className={cn(
|
|
58
|
-
'focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',
|
|
59
|
-
inset && 'pl-8',
|
|
60
|
-
className,
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
{children}
|
|
65
|
-
<ChevronRightIcon className="ml-auto size-4" />
|
|
66
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
67
|
-
),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
71
|
-
|
|
72
|
-
/* -----------------------------------------------------------------------------
|
|
73
|
-
* Component: DropdownMenuSubContent
|
|
74
|
-
* -------------------------------------------------------------------------- */
|
|
75
|
-
|
|
76
|
-
type DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;
|
|
77
|
-
|
|
78
|
-
const DropdownMenuSubContent = React.forwardRef<
|
|
79
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
80
|
-
DropdownMenuSubContentProps
|
|
81
|
-
>(({ className, ...props }, forwardedRef) => (
|
|
82
|
-
<DropdownMenuPrimitive.Portal>
|
|
83
|
-
<DropdownMenuPrimitive.SubContent
|
|
84
|
-
ref={forwardedRef}
|
|
85
|
-
className={cn(
|
|
86
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',
|
|
87
|
-
className,
|
|
88
|
-
)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
</DropdownMenuPrimitive.Portal>
|
|
92
|
-
));
|
|
93
|
-
|
|
94
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
95
|
-
|
|
96
|
-
/* -----------------------------------------------------------------------------
|
|
97
|
-
* Component: DropdownMenuContent
|
|
98
|
-
* -------------------------------------------------------------------------- */
|
|
99
|
-
|
|
100
|
-
type DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;
|
|
101
|
-
type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;
|
|
102
|
-
|
|
103
|
-
const DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(
|
|
104
|
-
({ className, sideOffset = 6, ...props }, forwardedRef) => (
|
|
105
|
-
<DropdownMenuPrimitive.Portal>
|
|
106
|
-
<DropdownMenuPrimitive.Content
|
|
107
|
-
ref={forwardedRef}
|
|
108
|
-
className={cn(
|
|
109
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',
|
|
110
|
-
className,
|
|
111
|
-
)}
|
|
112
|
-
sideOffset={sideOffset}
|
|
113
|
-
{...props}
|
|
114
|
-
/>
|
|
115
|
-
</DropdownMenuPrimitive.Portal>
|
|
116
|
-
),
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
120
|
-
|
|
121
|
-
/* -----------------------------------------------------------------------------
|
|
122
|
-
* Component: DropdownMenuItem
|
|
123
|
-
* -------------------------------------------------------------------------- */
|
|
124
|
-
|
|
125
|
-
type DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;
|
|
126
|
-
|
|
127
|
-
interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
|
|
128
|
-
inset?: boolean;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(
|
|
132
|
-
({ className, inset, ...props }, forwardedRef) => (
|
|
133
|
-
<DropdownMenuPrimitive.Item
|
|
134
|
-
ref={forwardedRef}
|
|
135
|
-
className={cn(
|
|
136
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
137
|
-
inset && 'pl-8',
|
|
138
|
-
className,
|
|
139
|
-
)}
|
|
140
|
-
{...props}
|
|
141
|
-
/>
|
|
142
|
-
),
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
146
|
-
|
|
147
|
-
/* -----------------------------------------------------------------------------
|
|
148
|
-
* Component: DropdownMenuCheckboxItem
|
|
149
|
-
* -------------------------------------------------------------------------- */
|
|
150
|
-
|
|
151
|
-
type DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
152
|
-
type DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
153
|
-
|
|
154
|
-
const DropdownMenuCheckboxItem = React.forwardRef<DropdownMenuCheckboxItemElement, DropdownMenuCheckboxItemProps>(
|
|
155
|
-
({ children, className, checked, ...props }, forwardedRef) => (
|
|
156
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
157
|
-
ref={forwardedRef}
|
|
158
|
-
checked={checked}
|
|
159
|
-
className={cn(
|
|
160
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
161
|
-
className,
|
|
162
|
-
)}
|
|
163
|
-
{...props}
|
|
164
|
-
>
|
|
165
|
-
<span className="absolute left-2 flex size-3.5 items-center justify-center">
|
|
166
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
167
|
-
<CheckIcon className="size-4" />
|
|
168
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
169
|
-
</span>
|
|
170
|
-
{children}
|
|
171
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
172
|
-
),
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
176
|
-
|
|
177
|
-
/* -----------------------------------------------------------------------------
|
|
178
|
-
* Component: DropdownMenuRadioItem
|
|
179
|
-
* -------------------------------------------------------------------------- */
|
|
180
|
-
|
|
181
|
-
type DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;
|
|
182
|
-
type DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;
|
|
183
|
-
|
|
184
|
-
const DropdownMenuRadioItem = React.forwardRef<DropdownMenuRadioItemElement, DropdownMenuRadioItemProps>(
|
|
185
|
-
({ children, className, ...props }, forwardedRef) => (
|
|
186
|
-
<DropdownMenuPrimitive.RadioItem
|
|
187
|
-
ref={forwardedRef}
|
|
188
|
-
className={cn(
|
|
189
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
190
|
-
className,
|
|
191
|
-
)}
|
|
192
|
-
{...props}
|
|
193
|
-
>
|
|
194
|
-
<span className="absolute left-2 flex size-3.5 items-center justify-center">
|
|
195
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
196
|
-
<DotFilledIcon className="size-4 fill-current" />
|
|
197
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
198
|
-
</span>
|
|
199
|
-
{children}
|
|
200
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
201
|
-
),
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
205
|
-
|
|
206
|
-
/* -----------------------------------------------------------------------------
|
|
207
|
-
* Component: DropdownMenuLabel
|
|
208
|
-
* -------------------------------------------------------------------------- */
|
|
209
|
-
|
|
210
|
-
type DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;
|
|
211
|
-
|
|
212
|
-
interface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {
|
|
213
|
-
inset?: boolean;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
const DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(
|
|
217
|
-
({ className, inset, ...props }, forwardedRef) => (
|
|
218
|
-
<DropdownMenuPrimitive.Label
|
|
219
|
-
ref={forwardedRef}
|
|
220
|
-
className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
|
|
221
|
-
{...props}
|
|
222
|
-
/>
|
|
223
|
-
),
|
|
224
|
-
);
|
|
225
|
-
|
|
226
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
227
|
-
|
|
228
|
-
/* -----------------------------------------------------------------------------
|
|
229
|
-
* Component: DropdownMenuSeparator
|
|
230
|
-
* -------------------------------------------------------------------------- */
|
|
231
|
-
|
|
232
|
-
type DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;
|
|
233
|
-
type DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;
|
|
234
|
-
|
|
235
|
-
const DropdownMenuSeparator = React.forwardRef<DropdownMenuSeparatorElement, DropdownMenuSeparatorProps>(
|
|
236
|
-
({ className, ...props }, forwardedRef) => (
|
|
237
|
-
<DropdownMenuPrimitive.Separator
|
|
238
|
-
ref={forwardedRef}
|
|
239
|
-
className={cn('bg-muted -mx-1 my-1 h-px', className)}
|
|
240
|
-
{...props}
|
|
241
|
-
/>
|
|
242
|
-
),
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
246
|
-
|
|
247
|
-
/* -----------------------------------------------------------------------------
|
|
248
|
-
* Component: DropdownMenuShortcut
|
|
249
|
-
* -------------------------------------------------------------------------- */
|
|
250
|
-
|
|
251
|
-
type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
252
|
-
|
|
253
|
-
function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element {
|
|
254
|
-
return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/* -----------------------------------------------------------------------------
|
|
258
|
-
* Exports
|
|
259
|
-
* -------------------------------------------------------------------------- */
|
|
260
|
-
|
|
261
|
-
export {
|
|
262
|
-
DropdownMenu,
|
|
263
|
-
DropdownMenuTrigger,
|
|
264
|
-
DropdownMenuContent,
|
|
265
|
-
DropdownMenuItem,
|
|
266
|
-
DropdownMenuCheckboxItem,
|
|
267
|
-
DropdownMenuRadioItem,
|
|
268
|
-
DropdownMenuLabel,
|
|
269
|
-
DropdownMenuSeparator,
|
|
270
|
-
DropdownMenuShortcut,
|
|
271
|
-
DropdownMenuGroup,
|
|
272
|
-
DropdownMenuSub,
|
|
273
|
-
DropdownMenuSubContent,
|
|
274
|
-
DropdownMenuSubTrigger,
|
|
275
|
-
DropdownMenuRadioGroup,
|
|
276
|
-
type DropdownMenuProps,
|
|
277
|
-
type DropdownMenuTriggerProps,
|
|
278
|
-
type DropdownMenuContentProps,
|
|
279
|
-
type DropdownMenuItemProps,
|
|
280
|
-
type DropdownMenuCheckboxItemProps,
|
|
281
|
-
type DropdownMenuRadioItemProps,
|
|
282
|
-
type DropdownMenuLabelProps,
|
|
283
|
-
type DropdownMenuSeparatorProps,
|
|
284
|
-
type DropdownMenuShortcutProps,
|
|
285
|
-
type DropdownMenuGroupProps,
|
|
286
|
-
type DropdownMenuSubProps,
|
|
287
|
-
type DropdownMenuSubContentProps,
|
|
288
|
-
type DropdownMenuSubTriggerProps,
|
|
289
|
-
type DropdownMenuRadioGroupProps,
|
|
290
|
-
};
|
package/src/react/em.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Em
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type EmElement = HTMLElement;
|
|
9
|
-
|
|
10
|
-
interface EmProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
|
-
const Component = asChild ? Slot : 'em';
|
|
16
|
-
|
|
17
|
-
return <Component ref={forwardedRef} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Em.displayName = 'Em';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Em, type EmProps };
|
package/src/react/form.tsx
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
-
import {
|
|
6
|
-
Controller,
|
|
7
|
-
type ControllerProps,
|
|
8
|
-
type FieldError,
|
|
9
|
-
type FieldErrorsImpl,
|
|
10
|
-
type FieldPath,
|
|
11
|
-
type FieldValues,
|
|
12
|
-
FormProvider,
|
|
13
|
-
type Merge,
|
|
14
|
-
useFormContext,
|
|
15
|
-
} from 'react-hook-form';
|
|
16
|
-
import type * as LabelPrimitive from '@radix-ui/react-label';
|
|
17
|
-
import { cn } from '../lib/utils';
|
|
18
|
-
import { Label } from './label';
|
|
19
|
-
|
|
20
|
-
/* -----------------------------------------------------------------------------
|
|
21
|
-
* Context: Form
|
|
22
|
-
* -------------------------------------------------------------------------- */
|
|
23
|
-
|
|
24
|
-
interface FormFieldContextValue<
|
|
25
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
26
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
27
|
-
> {
|
|
28
|
-
name: TName;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface FormItemContextValue {
|
|
32
|
-
id: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const FormFieldContext = React.createContext<FormFieldContextValue | null>(null);
|
|
36
|
-
|
|
37
|
-
const FormItemContext = React.createContext<FormItemContextValue | null>(null);
|
|
38
|
-
|
|
39
|
-
const useFormField = (): {
|
|
40
|
-
formDescriptionId: string;
|
|
41
|
-
formItemId: string;
|
|
42
|
-
formMessageId: string;
|
|
43
|
-
id: string;
|
|
44
|
-
invalid: boolean;
|
|
45
|
-
isDirty: boolean;
|
|
46
|
-
isTouched: boolean;
|
|
47
|
-
isValidating: boolean;
|
|
48
|
-
name: string;
|
|
49
|
-
error?: FieldError | Merge<FieldError, FieldErrorsImpl> | undefined;
|
|
50
|
-
} => {
|
|
51
|
-
const fieldContext = React.useContext(FormFieldContext);
|
|
52
|
-
const itemContext = React.useContext(FormItemContext);
|
|
53
|
-
const { getFieldState, formState } = useFormContext();
|
|
54
|
-
|
|
55
|
-
if (!fieldContext || !itemContext) {
|
|
56
|
-
throw new Error('useFormField should be used within <FormField>');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const fieldState = getFieldState(fieldContext.name, formState);
|
|
60
|
-
|
|
61
|
-
const { id } = itemContext;
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
id,
|
|
65
|
-
name: fieldContext.name,
|
|
66
|
-
formItemId: `form-item-${id}`,
|
|
67
|
-
formDescriptionId: `form-item-description-${id}`,
|
|
68
|
-
formMessageId: `form-item-message-${id}`,
|
|
69
|
-
...fieldState,
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/* -----------------------------------------------------------------------------
|
|
74
|
-
* Component: Form
|
|
75
|
-
* -------------------------------------------------------------------------- */
|
|
76
|
-
|
|
77
|
-
type FormProps = React.ComponentProps<typeof FormProvider>;
|
|
78
|
-
const Form = FormProvider;
|
|
79
|
-
|
|
80
|
-
/* -----------------------------------------------------------------------------
|
|
81
|
-
* Component: FormField
|
|
82
|
-
* -------------------------------------------------------------------------- */
|
|
83
|
-
|
|
84
|
-
type FormFieldProps<
|
|
85
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
86
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
87
|
-
> = ControllerProps<TFieldValues, TName>;
|
|
88
|
-
|
|
89
|
-
function FormField<
|
|
90
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
91
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
92
|
-
>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {
|
|
93
|
-
return (
|
|
94
|
-
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
95
|
-
<Controller {...props} />
|
|
96
|
-
</FormFieldContext.Provider>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* -----------------------------------------------------------------------------
|
|
101
|
-
* Component: FormItem
|
|
102
|
-
* -------------------------------------------------------------------------- */
|
|
103
|
-
|
|
104
|
-
type FormItemElement = HTMLDivElement;
|
|
105
|
-
type FormItemProps = React.HTMLAttributes<HTMLDivElement>;
|
|
106
|
-
|
|
107
|
-
const FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, forwardedRef) => {
|
|
108
|
-
const id = React.useId();
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<FormItemContext.Provider value={{ id }}>
|
|
112
|
-
<div ref={forwardedRef} className={cn('space-y-2', className)} {...props} />
|
|
113
|
-
</FormItemContext.Provider>
|
|
114
|
-
);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
FormItem.displayName = 'FormItem';
|
|
118
|
-
|
|
119
|
-
/* -----------------------------------------------------------------------------
|
|
120
|
-
* Component: FormLabel
|
|
121
|
-
* -------------------------------------------------------------------------- */
|
|
122
|
-
|
|
123
|
-
type FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;
|
|
124
|
-
type FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;
|
|
125
|
-
|
|
126
|
-
const FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, forwardedRef) => {
|
|
127
|
-
const { error, formItemId } = useFormField();
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<Label ref={forwardedRef} className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />
|
|
131
|
-
);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
FormLabel.displayName = 'FormLabel';
|
|
135
|
-
|
|
136
|
-
/* -----------------------------------------------------------------------------
|
|
137
|
-
* Component: FormControl
|
|
138
|
-
* -------------------------------------------------------------------------- */
|
|
139
|
-
|
|
140
|
-
type FormControlElement = React.ElementRef<typeof Slot>;
|
|
141
|
-
type FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;
|
|
142
|
-
|
|
143
|
-
const FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, forwardedRef) => {
|
|
144
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<Slot
|
|
148
|
-
ref={forwardedRef}
|
|
149
|
-
aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}
|
|
150
|
-
aria-invalid={Boolean(error)}
|
|
151
|
-
id={formItemId}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
FormControl.displayName = 'FormControl';
|
|
158
|
-
|
|
159
|
-
/* -----------------------------------------------------------------------------
|
|
160
|
-
* Component: FormDescription
|
|
161
|
-
* -------------------------------------------------------------------------- */
|
|
162
|
-
|
|
163
|
-
type FormDescriptionElement = HTMLParagraphElement;
|
|
164
|
-
type FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
165
|
-
|
|
166
|
-
const FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(
|
|
167
|
-
({ className, ...props }, forwardedRef) => {
|
|
168
|
-
const { formDescriptionId } = useFormField();
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<p
|
|
172
|
-
ref={forwardedRef}
|
|
173
|
-
className={cn('text-muted-foreground text-xs', className)}
|
|
174
|
-
id={formDescriptionId}
|
|
175
|
-
{...props}
|
|
176
|
-
/>
|
|
177
|
-
);
|
|
178
|
-
},
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
FormDescription.displayName = 'FormDescription';
|
|
182
|
-
|
|
183
|
-
/* -----------------------------------------------------------------------------
|
|
184
|
-
* Component: FormMessage
|
|
185
|
-
* -------------------------------------------------------------------------- */
|
|
186
|
-
|
|
187
|
-
type FormMessageElement = HTMLParagraphElement;
|
|
188
|
-
type FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
189
|
-
|
|
190
|
-
const FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(
|
|
191
|
-
({ children, className, ...props }, forwardedRef) => {
|
|
192
|
-
const { error, formMessageId } = useFormField();
|
|
193
|
-
const body = error?.message ? String(error.message) : children;
|
|
194
|
-
|
|
195
|
-
if (!body) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return (
|
|
200
|
-
<p
|
|
201
|
-
ref={forwardedRef}
|
|
202
|
-
className={cn('text-destructive text-xs font-medium', className)}
|
|
203
|
-
id={formMessageId}
|
|
204
|
-
{...props}
|
|
205
|
-
>
|
|
206
|
-
{body}
|
|
207
|
-
</p>
|
|
208
|
-
);
|
|
209
|
-
},
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
FormMessage.displayName = 'FormMessage';
|
|
213
|
-
|
|
214
|
-
/* -----------------------------------------------------------------------------
|
|
215
|
-
* Exports
|
|
216
|
-
* -------------------------------------------------------------------------- */
|
|
217
|
-
|
|
218
|
-
export {
|
|
219
|
-
useFormField,
|
|
220
|
-
Form,
|
|
221
|
-
FormItem,
|
|
222
|
-
FormLabel,
|
|
223
|
-
FormControl,
|
|
224
|
-
FormDescription,
|
|
225
|
-
FormMessage,
|
|
226
|
-
FormField,
|
|
227
|
-
type FormProps,
|
|
228
|
-
type FormItemProps,
|
|
229
|
-
type FormLabelProps,
|
|
230
|
-
type FormControlProps,
|
|
231
|
-
type FormDescriptionProps,
|
|
232
|
-
type FormMessageProps,
|
|
233
|
-
type FormFieldProps,
|
|
234
|
-
};
|
package/src/react/heading.tsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Heading
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type HeadingElement = HTMLHeadingElement;
|
|
9
|
-
|
|
10
|
-
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
11
|
-
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
12
|
-
asChild?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Heading = React.forwardRef<HeadingElement, HeadingProps>(
|
|
16
|
-
({ asChild, as: Tag = 'h1', ...props }, forwardedRef) => {
|
|
17
|
-
const Component = asChild ? Slot : Tag;
|
|
18
|
-
|
|
19
|
-
return <Component ref={forwardedRef} {...props} />;
|
|
20
|
-
},
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
Heading.displayName = 'Heading';
|
|
24
|
-
|
|
25
|
-
/* -----------------------------------------------------------------------------
|
|
26
|
-
* Exports
|
|
27
|
-
* -------------------------------------------------------------------------- */
|
|
28
|
-
|
|
29
|
-
export { Heading, type HeadingProps };
|
package/src/react/hover-card.tsx
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: HoverCard
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type HoverCardProps = React.ComponentProps<typeof HoverCardPrimitive.Root>;
|
|
12
|
-
const HoverCard = HoverCardPrimitive.Root;
|
|
13
|
-
|
|
14
|
-
/* -----------------------------------------------------------------------------
|
|
15
|
-
* Component: HoverCardTrigger
|
|
16
|
-
* -------------------------------------------------------------------------- */
|
|
17
|
-
|
|
18
|
-
type HoverCardTriggerProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Trigger>;
|
|
19
|
-
const HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
20
|
-
|
|
21
|
-
/* -----------------------------------------------------------------------------
|
|
22
|
-
* Component: HoverCardContent
|
|
23
|
-
* -------------------------------------------------------------------------- */
|
|
24
|
-
|
|
25
|
-
type HoverCardContentElement = React.ElementRef<typeof HoverCardPrimitive.Content>;
|
|
26
|
-
type HoverCardContentProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>;
|
|
27
|
-
|
|
28
|
-
const HoverCardContent = React.forwardRef<HoverCardContentElement, HoverCardContentProps>(
|
|
29
|
-
({ className, align = 'center', sideOffset = 6, ...props }, forwardedRef) => (
|
|
30
|
-
<HoverCardPrimitive.Portal>
|
|
31
|
-
<HoverCardPrimitive.Content
|
|
32
|
-
ref={forwardedRef}
|
|
33
|
-
align={align}
|
|
34
|
-
className={cn(
|
|
35
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 z-50 min-w-32 rounded-md border p-4 shadow-md',
|
|
36
|
-
className,
|
|
37
|
-
)}
|
|
38
|
-
sideOffset={sideOffset}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
</HoverCardPrimitive.Portal>
|
|
42
|
-
),
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
46
|
-
|
|
47
|
-
/* -----------------------------------------------------------------------------
|
|
48
|
-
* Component: HoverCardArrow
|
|
49
|
-
* -------------------------------------------------------------------------- */
|
|
50
|
-
|
|
51
|
-
type HoverCardArrowElement = React.ElementRef<typeof HoverCardPrimitive.Arrow>;
|
|
52
|
-
type HoverCardArrowProps = React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Arrow>;
|
|
53
|
-
|
|
54
|
-
const HoverCardArrow = React.forwardRef<HoverCardArrowElement, HoverCardArrowProps>(
|
|
55
|
-
({ className, ...props }, forwardedRef) => (
|
|
56
|
-
<HoverCardPrimitive.Arrow ref={forwardedRef} className={cn('fill-popover', className)} {...props} />
|
|
57
|
-
),
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
HoverCardArrow.displayName = HoverCardPrimitive.Arrow.displayName;
|
|
61
|
-
|
|
62
|
-
/* -----------------------------------------------------------------------------
|
|
63
|
-
* Exports
|
|
64
|
-
* -------------------------------------------------------------------------- */
|
|
65
|
-
|
|
66
|
-
export {
|
|
67
|
-
HoverCard,
|
|
68
|
-
HoverCardTrigger,
|
|
69
|
-
HoverCardContent,
|
|
70
|
-
HoverCardArrow,
|
|
71
|
-
type HoverCardProps,
|
|
72
|
-
type HoverCardTriggerProps,
|
|
73
|
-
type HoverCardContentProps,
|
|
74
|
-
type HoverCardArrowProps,
|
|
75
|
-
};
|