@codefast/ui 0.0.66 → 0.0.67
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,192 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { ChevronDownIcon } from '@radix-ui/react-icons';
|
|
5
|
-
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
6
|
-
import { tv } from 'tailwind-variants';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
|
|
9
|
-
/* -----------------------------------------------------------------------------
|
|
10
|
-
* Variant: NavigationMenu
|
|
11
|
-
* -------------------------------------------------------------------------- */
|
|
12
|
-
|
|
13
|
-
const navigationMenuTriggerVariants = tv({
|
|
14
|
-
base: 'bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent/50 data-[active]:bg-accent/50 group inline-flex h-10 w-max items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
/* -----------------------------------------------------------------------------
|
|
18
|
-
* Component: NavigationMenu
|
|
19
|
-
* -------------------------------------------------------------------------- */
|
|
20
|
-
|
|
21
|
-
type NavigationMenuElement = React.ElementRef<typeof NavigationMenuPrimitive.Root>;
|
|
22
|
-
type NavigationMenuProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>;
|
|
23
|
-
|
|
24
|
-
const NavigationMenu = React.forwardRef<NavigationMenuElement, NavigationMenuProps>(
|
|
25
|
-
({ children, className, ...props }, forwardedRef) => (
|
|
26
|
-
<NavigationMenuPrimitive.Root
|
|
27
|
-
ref={forwardedRef}
|
|
28
|
-
className={cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className)}
|
|
29
|
-
{...props}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
<NavigationMenuViewport />
|
|
33
|
-
</NavigationMenuPrimitive.Root>
|
|
34
|
-
),
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
38
|
-
|
|
39
|
-
/* -----------------------------------------------------------------------------
|
|
40
|
-
* Component: NavigationMenuList
|
|
41
|
-
* -------------------------------------------------------------------------- */
|
|
42
|
-
|
|
43
|
-
type NavigationMenuListElement = React.ElementRef<typeof NavigationMenuPrimitive.List>;
|
|
44
|
-
type NavigationMenuListProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>;
|
|
45
|
-
|
|
46
|
-
const NavigationMenuList = React.forwardRef<NavigationMenuListElement, NavigationMenuListProps>(
|
|
47
|
-
({ children, className, ...props }, forwardedRef) => (
|
|
48
|
-
<NavigationMenuPrimitive.List
|
|
49
|
-
ref={forwardedRef}
|
|
50
|
-
className={cn('group flex flex-1 list-none items-center justify-center space-x-1', className)}
|
|
51
|
-
{...props}
|
|
52
|
-
>
|
|
53
|
-
{children}
|
|
54
|
-
<NavigationMenuIndicator />
|
|
55
|
-
</NavigationMenuPrimitive.List>
|
|
56
|
-
),
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
60
|
-
|
|
61
|
-
/* -----------------------------------------------------------------------------
|
|
62
|
-
* Component: NavigationMenuItem
|
|
63
|
-
* -------------------------------------------------------------------------- */
|
|
64
|
-
|
|
65
|
-
type NavigationMenuItemProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>;
|
|
66
|
-
|
|
67
|
-
const NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
68
|
-
|
|
69
|
-
/* -----------------------------------------------------------------------------
|
|
70
|
-
* Component: NavigationMenuContent
|
|
71
|
-
* -------------------------------------------------------------------------- */
|
|
72
|
-
|
|
73
|
-
type NavigationMenuTriggerElement = React.ElementRef<typeof NavigationMenuPrimitive.Trigger>;
|
|
74
|
-
type NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>;
|
|
75
|
-
|
|
76
|
-
const NavigationMenuTrigger = React.forwardRef<NavigationMenuTriggerElement, NavigationMenuTriggerProps>(
|
|
77
|
-
({ children, className, ...props }, forwardedRef) => (
|
|
78
|
-
<NavigationMenuPrimitive.Trigger
|
|
79
|
-
ref={forwardedRef}
|
|
80
|
-
className={navigationMenuTriggerVariants({
|
|
81
|
-
className: ['group', className],
|
|
82
|
-
})}
|
|
83
|
-
{...props}
|
|
84
|
-
>
|
|
85
|
-
{children}
|
|
86
|
-
<ChevronDownIcon
|
|
87
|
-
aria-hidden="true"
|
|
88
|
-
className="relative top-px ml-1 size-3 transition group-data-[state=open]:rotate-180"
|
|
89
|
-
/>
|
|
90
|
-
</NavigationMenuPrimitive.Trigger>
|
|
91
|
-
),
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
95
|
-
|
|
96
|
-
/* -----------------------------------------------------------------------------
|
|
97
|
-
* Component: NavigationMenuContent
|
|
98
|
-
* -------------------------------------------------------------------------- */
|
|
99
|
-
|
|
100
|
-
type NavigationMenuContentElement = React.ElementRef<typeof NavigationMenuPrimitive.Content>;
|
|
101
|
-
type NavigationMenuContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>;
|
|
102
|
-
|
|
103
|
-
const NavigationMenuContent = React.forwardRef<NavigationMenuContentElement, NavigationMenuContentProps>(
|
|
104
|
-
({ className, ...props }, forwardedRef) => (
|
|
105
|
-
<NavigationMenuPrimitive.Content
|
|
106
|
-
ref={forwardedRef}
|
|
107
|
-
className={cn(
|
|
108
|
-
'data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 left-0 top-0 w-full md:absolute md:w-auto',
|
|
109
|
-
className,
|
|
110
|
-
)}
|
|
111
|
-
{...props}
|
|
112
|
-
/>
|
|
113
|
-
),
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
117
|
-
|
|
118
|
-
/* -----------------------------------------------------------------------------
|
|
119
|
-
* Component: NavigationMenuLink
|
|
120
|
-
* -------------------------------------------------------------------------- */
|
|
121
|
-
|
|
122
|
-
type NavigationMenuLinkProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link>;
|
|
123
|
-
|
|
124
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
125
|
-
|
|
126
|
-
/* -----------------------------------------------------------------------------
|
|
127
|
-
* Component: NavigationMenuViewport
|
|
128
|
-
* -------------------------------------------------------------------------- */
|
|
129
|
-
|
|
130
|
-
type NavigationMenuViewportElement = React.ElementRef<typeof NavigationMenuPrimitive.Viewport>;
|
|
131
|
-
type NavigationMenuViewportProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>;
|
|
132
|
-
|
|
133
|
-
const NavigationMenuViewport = React.forwardRef<NavigationMenuViewportElement, NavigationMenuViewportProps>(
|
|
134
|
-
({ className, ...props }, forwardedRef) => (
|
|
135
|
-
<div className="perspective-[125rem] absolute left-0 top-full flex justify-center">
|
|
136
|
-
<NavigationMenuPrimitive.Viewport
|
|
137
|
-
ref={forwardedRef}
|
|
138
|
-
className={cn(
|
|
139
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden rounded-md border transition-[width,height] sm:w-[var(--radix-navigation-menu-viewport-width)]',
|
|
140
|
-
className,
|
|
141
|
-
)}
|
|
142
|
-
{...props}
|
|
143
|
-
/>
|
|
144
|
-
</div>
|
|
145
|
-
),
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
149
|
-
|
|
150
|
-
/* -----------------------------------------------------------------------------
|
|
151
|
-
* Component: NavigationMenuIndicator
|
|
152
|
-
* -------------------------------------------------------------------------- */
|
|
153
|
-
|
|
154
|
-
type NavigationMenuIndicatorElement = React.ElementRef<typeof NavigationMenuPrimitive.Indicator>;
|
|
155
|
-
type NavigationMenuIndicatorProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>;
|
|
156
|
-
|
|
157
|
-
const NavigationMenuIndicator = React.forwardRef<NavigationMenuIndicatorElement, NavigationMenuIndicatorProps>(
|
|
158
|
-
({ className, ...props }, forwardedRef) => (
|
|
159
|
-
<NavigationMenuPrimitive.Indicator
|
|
160
|
-
ref={forwardedRef}
|
|
161
|
-
className={cn(
|
|
162
|
-
'data-[state=visible]:animate-fade-in data-[state=hidden]:animate-fade-out top-full z-10 flex h-1.5 items-center justify-center overflow-hidden transition',
|
|
163
|
-
className,
|
|
164
|
-
)}
|
|
165
|
-
{...props}
|
|
166
|
-
>
|
|
167
|
-
<div className="bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm" />
|
|
168
|
-
</NavigationMenuPrimitive.Indicator>
|
|
169
|
-
),
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
173
|
-
|
|
174
|
-
/* -----------------------------------------------------------------------------
|
|
175
|
-
* Exports
|
|
176
|
-
* -------------------------------------------------------------------------- */
|
|
177
|
-
|
|
178
|
-
export {
|
|
179
|
-
navigationMenuTriggerVariants,
|
|
180
|
-
NavigationMenu,
|
|
181
|
-
NavigationMenuList,
|
|
182
|
-
NavigationMenuItem,
|
|
183
|
-
NavigationMenuContent,
|
|
184
|
-
NavigationMenuTrigger,
|
|
185
|
-
NavigationMenuLink,
|
|
186
|
-
type NavigationMenuProps,
|
|
187
|
-
type NavigationMenuListProps,
|
|
188
|
-
type NavigationMenuItemProps,
|
|
189
|
-
type NavigationMenuContentProps,
|
|
190
|
-
type NavigationMenuTriggerProps,
|
|
191
|
-
type NavigationMenuLinkProps,
|
|
192
|
-
};
|
package/src/react/pagination.tsx
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ChevronLeftIcon, ChevronRightIcon, DotsHorizontalIcon } from '@radix-ui/react-icons';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
import { type ButtonProps, buttonVariants } from './button';
|
|
5
|
-
|
|
6
|
-
/* -----------------------------------------------------------------------------
|
|
7
|
-
* Component: Pagination
|
|
8
|
-
* -------------------------------------------------------------------------- */
|
|
9
|
-
|
|
10
|
-
type PaginationProps = React.HTMLAttributes<HTMLElement>;
|
|
11
|
-
|
|
12
|
-
function Pagination({ className, ...props }: PaginationProps): React.JSX.Element {
|
|
13
|
-
return (
|
|
14
|
-
<nav
|
|
15
|
-
aria-label="pagination"
|
|
16
|
-
className={cn('mx-auto flex w-full justify-center', className)}
|
|
17
|
-
role="navigation"
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* -----------------------------------------------------------------------------
|
|
24
|
-
* Component: PaginationContent
|
|
25
|
-
* -------------------------------------------------------------------------- */
|
|
26
|
-
|
|
27
|
-
type PaginationContentElement = HTMLUListElement;
|
|
28
|
-
type PaginationContentProps = React.HTMLAttributes<HTMLUListElement>;
|
|
29
|
-
|
|
30
|
-
const PaginationContent = React.forwardRef<PaginationContentElement, PaginationContentProps>(
|
|
31
|
-
({ className, ...props }, forwardedRef) => (
|
|
32
|
-
<ul ref={forwardedRef} className={cn('flex flex-row items-center gap-1', className)} {...props} />
|
|
33
|
-
),
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
PaginationContent.displayName = 'PaginationContent';
|
|
37
|
-
|
|
38
|
-
/* -----------------------------------------------------------------------------
|
|
39
|
-
* Component: PaginationItem
|
|
40
|
-
* -------------------------------------------------------------------------- */
|
|
41
|
-
|
|
42
|
-
type PaginationItemElement = HTMLLIElement;
|
|
43
|
-
type PaginationItemProps = React.LiHTMLAttributes<HTMLLIElement>;
|
|
44
|
-
|
|
45
|
-
const PaginationItem = React.forwardRef<PaginationItemElement, PaginationItemProps>((props, forwardedRef) => (
|
|
46
|
-
<li ref={forwardedRef} {...props} />
|
|
47
|
-
));
|
|
48
|
-
|
|
49
|
-
PaginationItem.displayName = 'PaginationItem';
|
|
50
|
-
|
|
51
|
-
/* -----------------------------------------------------------------------------
|
|
52
|
-
* Component: PaginationLink
|
|
53
|
-
* -------------------------------------------------------------------------- */
|
|
54
|
-
|
|
55
|
-
interface PaginationLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>, Pick<ButtonProps, 'size'> {
|
|
56
|
-
isActive?: boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function PaginationLink({
|
|
60
|
-
className,
|
|
61
|
-
isActive,
|
|
62
|
-
size = 'icon',
|
|
63
|
-
children,
|
|
64
|
-
...props
|
|
65
|
-
}: PaginationLinkProps): React.JSX.Element {
|
|
66
|
-
return (
|
|
67
|
-
<a
|
|
68
|
-
aria-current={isActive ? 'page' : undefined}
|
|
69
|
-
className={buttonVariants({
|
|
70
|
-
variant: isActive ? 'outline' : 'ghost',
|
|
71
|
-
size,
|
|
72
|
-
className,
|
|
73
|
-
})}
|
|
74
|
-
{...props}
|
|
75
|
-
>
|
|
76
|
-
{children}
|
|
77
|
-
</a>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* -----------------------------------------------------------------------------
|
|
82
|
-
* Component: PaginationPrevious
|
|
83
|
-
* -------------------------------------------------------------------------- */
|
|
84
|
-
|
|
85
|
-
type PaginationPreviousProps = PaginationLinkProps;
|
|
86
|
-
|
|
87
|
-
function PaginationPrevious({ className, ...props }: PaginationPreviousProps): React.JSX.Element {
|
|
88
|
-
return (
|
|
89
|
-
<PaginationLink
|
|
90
|
-
aria-label="Go to previous page"
|
|
91
|
-
className={cn('gap-1 pl-2.5', className)}
|
|
92
|
-
size="default"
|
|
93
|
-
{...props}
|
|
94
|
-
>
|
|
95
|
-
<ChevronLeftIcon className="size-4" />
|
|
96
|
-
<span>Previous</span>
|
|
97
|
-
</PaginationLink>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* -----------------------------------------------------------------------------
|
|
102
|
-
* Component: PaginationNext
|
|
103
|
-
* -------------------------------------------------------------------------- */
|
|
104
|
-
|
|
105
|
-
type PaginationNextProps = PaginationLinkProps;
|
|
106
|
-
|
|
107
|
-
function PaginationNext({ className, ...props }: PaginationNextProps): React.JSX.Element {
|
|
108
|
-
return (
|
|
109
|
-
<PaginationLink aria-label="Go to next page" className={cn('gap-1 pr-2.5', className)} size="default" {...props}>
|
|
110
|
-
<span>Next</span>
|
|
111
|
-
<ChevronRightIcon className="size-4" />
|
|
112
|
-
</PaginationLink>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* -----------------------------------------------------------------------------
|
|
117
|
-
* Component: PaginationEllipsis
|
|
118
|
-
* -------------------------------------------------------------------------- */
|
|
119
|
-
|
|
120
|
-
type PaginationEllipsisProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
121
|
-
|
|
122
|
-
function PaginationEllipsis({ className, ...props }: PaginationEllipsisProps): React.JSX.Element {
|
|
123
|
-
return (
|
|
124
|
-
<span aria-hidden className={cn('flex size-10 items-center justify-center', className)} {...props}>
|
|
125
|
-
<DotsHorizontalIcon className="size-4" />
|
|
126
|
-
<span className="sr-only">More pages</span>
|
|
127
|
-
</span>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* -----------------------------------------------------------------------------
|
|
132
|
-
* Exports
|
|
133
|
-
* -------------------------------------------------------------------------- */
|
|
134
|
-
|
|
135
|
-
export {
|
|
136
|
-
Pagination,
|
|
137
|
-
PaginationContent,
|
|
138
|
-
PaginationLink,
|
|
139
|
-
PaginationItem,
|
|
140
|
-
PaginationPrevious,
|
|
141
|
-
PaginationNext,
|
|
142
|
-
PaginationEllipsis,
|
|
143
|
-
type PaginationProps,
|
|
144
|
-
type PaginationContentProps,
|
|
145
|
-
type PaginationLinkProps,
|
|
146
|
-
type PaginationItemProps,
|
|
147
|
-
type PaginationPreviousProps,
|
|
148
|
-
type PaginationNextProps,
|
|
149
|
-
type PaginationEllipsisProps,
|
|
150
|
-
};
|
package/src/react/popover.tsx
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Popover
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type PopoverProps = React.ComponentProps<typeof PopoverPrimitive.Root>;
|
|
12
|
-
const Popover = PopoverPrimitive.Root;
|
|
13
|
-
|
|
14
|
-
/* -----------------------------------------------------------------------------
|
|
15
|
-
* Component: PopoverTrigger
|
|
16
|
-
* -------------------------------------------------------------------------- */
|
|
17
|
-
|
|
18
|
-
type PopoverTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;
|
|
19
|
-
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
20
|
-
|
|
21
|
-
/* -----------------------------------------------------------------------------
|
|
22
|
-
* Component: PopoverAnchor
|
|
23
|
-
* -------------------------------------------------------------------------- */
|
|
24
|
-
|
|
25
|
-
type PopoverAnchorProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>;
|
|
26
|
-
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
27
|
-
|
|
28
|
-
/* -----------------------------------------------------------------------------
|
|
29
|
-
* Component: PopoverContent
|
|
30
|
-
* -------------------------------------------------------------------------- */
|
|
31
|
-
|
|
32
|
-
type PopoverContentElement = React.ElementRef<typeof PopoverPrimitive.Content>;
|
|
33
|
-
type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>;
|
|
34
|
-
|
|
35
|
-
const PopoverContent = React.forwardRef<PopoverContentElement, PopoverContentProps>(
|
|
36
|
-
({ className, align = 'center', sideOffset = 6, ...props }, forwardedRef) => (
|
|
37
|
-
<PopoverPrimitive.Portal>
|
|
38
|
-
<PopoverPrimitive.Content
|
|
39
|
-
ref={forwardedRef}
|
|
40
|
-
align={align}
|
|
41
|
-
className={cn(
|
|
42
|
-
'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=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',
|
|
43
|
-
className,
|
|
44
|
-
)}
|
|
45
|
-
sideOffset={sideOffset}
|
|
46
|
-
{...props}
|
|
47
|
-
/>
|
|
48
|
-
</PopoverPrimitive.Portal>
|
|
49
|
-
),
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
53
|
-
|
|
54
|
-
/* -----------------------------------------------------------------------------
|
|
55
|
-
* Component: PopoverArrow
|
|
56
|
-
* -------------------------------------------------------------------------- */
|
|
57
|
-
|
|
58
|
-
type PopoverArrowElement = React.ElementRef<typeof PopoverPrimitive.Arrow>;
|
|
59
|
-
type PopoverArrowProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Arrow>;
|
|
60
|
-
|
|
61
|
-
const PopoverArrow = React.forwardRef<PopoverArrowElement, PopoverArrowProps>(
|
|
62
|
-
({ className, ...props }, forwardedRef) => (
|
|
63
|
-
<PopoverPrimitive.Arrow ref={forwardedRef} className={cn('fill-popover', className)} {...props} />
|
|
64
|
-
),
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
PopoverArrow.displayName = PopoverPrimitive.Arrow.displayName;
|
|
68
|
-
|
|
69
|
-
/* -----------------------------------------------------------------------------
|
|
70
|
-
* Exports
|
|
71
|
-
* -------------------------------------------------------------------------- */
|
|
72
|
-
|
|
73
|
-
export {
|
|
74
|
-
Popover,
|
|
75
|
-
PopoverTrigger,
|
|
76
|
-
PopoverContent,
|
|
77
|
-
PopoverAnchor,
|
|
78
|
-
PopoverArrow,
|
|
79
|
-
type PopoverProps,
|
|
80
|
-
type PopoverTriggerProps,
|
|
81
|
-
type PopoverContentProps,
|
|
82
|
-
type PopoverAnchorProps,
|
|
83
|
-
type PopoverArrowProps,
|
|
84
|
-
};
|
package/src/react/pre.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Pre
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type PreElement = HTMLPreElement;
|
|
9
|
-
|
|
10
|
-
interface PreProps extends React.HTMLAttributes<HTMLPreElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Pre = React.forwardRef<PreElement, PreProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
|
-
const Component = asChild ? Slot : 'pre';
|
|
16
|
-
|
|
17
|
-
return <Component ref={forwardedRef} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Pre.displayName = 'Pre';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Pre, type PreProps };
|
package/src/react/progress.tsx
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Progress
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;
|
|
12
|
-
type ProgressProps = React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>;
|
|
13
|
-
|
|
14
|
-
const Progress = React.forwardRef<ProgressElement, ProgressProps>(({ className, value, ...props }, forwardedRef) => (
|
|
15
|
-
<ProgressPrimitive.Root
|
|
16
|
-
ref={forwardedRef}
|
|
17
|
-
className={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<ProgressPrimitive.Indicator
|
|
21
|
-
className="bg-primary size-full flex-1 transition"
|
|
22
|
-
style={{
|
|
23
|
-
transform: `translateX(-${String(100 - (value ?? 0))}%)`,
|
|
24
|
-
}}
|
|
25
|
-
/>
|
|
26
|
-
</ProgressPrimitive.Root>
|
|
27
|
-
));
|
|
28
|
-
|
|
29
|
-
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
30
|
-
|
|
31
|
-
/* -----------------------------------------------------------------------------
|
|
32
|
-
* Exports
|
|
33
|
-
* -------------------------------------------------------------------------- */
|
|
34
|
-
|
|
35
|
-
export { Progress, type ProgressProps };
|
package/src/react/quote.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Quote
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type QuoteElement = HTMLQuoteElement;
|
|
9
|
-
|
|
10
|
-
interface QuoteProps extends React.QuoteHTMLAttributes<HTMLQuoteElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Quote = React.forwardRef<QuoteElement, QuoteProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
|
-
const Component = asChild ? Slot : 'q';
|
|
16
|
-
|
|
17
|
-
return <Component ref={forwardedRef} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Quote.displayName = 'Quote';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Quote, type QuoteProps };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: RadioCards
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type RadioCardsElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;
|
|
12
|
-
type RadioCardsProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
|
|
13
|
-
|
|
14
|
-
const RadioCards = React.forwardRef<RadioCardsElement, RadioCardsProps>(({ className, ...props }, forwardedRef) => {
|
|
15
|
-
return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={forwardedRef} />;
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
RadioCards.displayName = RadioGroupPrimitive.Root.displayName;
|
|
19
|
-
|
|
20
|
-
/* -----------------------------------------------------------------------------
|
|
21
|
-
* Component: RadioCardsItem
|
|
22
|
-
* -------------------------------------------------------------------------- */
|
|
23
|
-
|
|
24
|
-
type RadioCardsItemElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;
|
|
25
|
-
type RadioCardsItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;
|
|
26
|
-
|
|
27
|
-
const RadioCardsItem = React.forwardRef<RadioCardsItemElement, RadioCardsItemProps>(
|
|
28
|
-
({ className, ...props }, forwardedRef) => {
|
|
29
|
-
return (
|
|
30
|
-
<RadioGroupPrimitive.Item
|
|
31
|
-
ref={forwardedRef}
|
|
32
|
-
className={cn(
|
|
33
|
-
'text-foreground focus-visible:bg-primary/10 group peer flex cursor-pointer items-center justify-center rounded-md border p-4 focus-visible:outline focus-visible:outline-2 disabled:cursor-default disabled:opacity-50 aria-checked:outline aria-checked:outline-2',
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
},
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
RadioCardsItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
43
|
-
|
|
44
|
-
/* -----------------------------------------------------------------------------
|
|
45
|
-
* Exports
|
|
46
|
-
* -------------------------------------------------------------------------- */
|
|
47
|
-
|
|
48
|
-
export { RadioCards, RadioCardsItem, type RadioCardsProps, type RadioCardsItemProps };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: RadioGroup
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type RadioGroupElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;
|
|
12
|
-
type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
|
|
13
|
-
|
|
14
|
-
const RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(({ className, ...props }, forwardedRef) => {
|
|
15
|
-
return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={forwardedRef} />;
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
19
|
-
|
|
20
|
-
/* -----------------------------------------------------------------------------
|
|
21
|
-
* Component: RadioGroupItem
|
|
22
|
-
* -------------------------------------------------------------------------- */
|
|
23
|
-
|
|
24
|
-
type RadioGroupItemElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;
|
|
25
|
-
type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;
|
|
26
|
-
|
|
27
|
-
const RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(
|
|
28
|
-
({ className, ...props }, forwardedRef) => {
|
|
29
|
-
return (
|
|
30
|
-
<RadioGroupPrimitive.Item
|
|
31
|
-
ref={forwardedRef}
|
|
32
|
-
className={cn(
|
|
33
|
-
'border-input hover:border-primary text-foreground aria-checked:border-primary group peer aspect-square size-4 rounded-full border focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
>
|
|
38
|
-
<RadioGroupPrimitive.Indicator className="after:bg-primary relative flex size-full items-center justify-center after:block after:size-2.5 after:rounded-full" />
|
|
39
|
-
</RadioGroupPrimitive.Item>
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
45
|
-
|
|
46
|
-
/* -----------------------------------------------------------------------------
|
|
47
|
-
* Exports
|
|
48
|
-
* -------------------------------------------------------------------------- */
|
|
49
|
-
|
|
50
|
-
export { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps };
|
package/src/react/radio.tsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { composeEventHandlers } from '@radix-ui/primitive';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Radio
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type RadioElement = HTMLInputElement;
|
|
12
|
-
|
|
13
|
-
interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
14
|
-
onValueChange?: (value: string) => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const Radio = React.forwardRef<RadioElement, RadioProps>(
|
|
18
|
-
({ className, onValueChange, onChange, ...props }, forwardedRef) => {
|
|
19
|
-
return (
|
|
20
|
-
<input
|
|
21
|
-
ref={forwardedRef}
|
|
22
|
-
className={cn(
|
|
23
|
-
'before:border-input hover:before:border-primary checked:before:border-primary checked:after:bg-primary peer relative flex appearance-none items-center justify-center rounded-full before:size-4 before:rounded-full before:border checked:after:absolute checked:after:size-2.5 checked:after:rounded-full focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
24
|
-
className,
|
|
25
|
-
)}
|
|
26
|
-
type="radio"
|
|
27
|
-
onChange={composeEventHandlers(onChange, (event) => onValueChange?.(event.currentTarget.value))}
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
},
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
Radio.displayName = 'Radio';
|
|
35
|
-
|
|
36
|
-
/* -----------------------------------------------------------------------------
|
|
37
|
-
* Exports
|
|
38
|
-
* -------------------------------------------------------------------------- */
|
|
39
|
-
|
|
40
|
-
export { Radio };
|