@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
package/src/react/resizable.tsx
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
5
|
-
import { DragHandleDots2Icon } from '@radix-ui/react-icons';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: ResizablePanelGroup
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
function ResizablePanelGroup({
|
|
13
|
-
className,
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): React.JSX.Element {
|
|
16
|
-
return (
|
|
17
|
-
<ResizablePrimitive.PanelGroup
|
|
18
|
-
className={cn('flex size-full data-[panel-group-direction=vertical]:flex-col', className)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* -----------------------------------------------------------------------------
|
|
25
|
-
* Component: ResizablePanel
|
|
26
|
-
* -------------------------------------------------------------------------- */
|
|
27
|
-
|
|
28
|
-
const ResizablePanel = ResizablePrimitive.Panel;
|
|
29
|
-
|
|
30
|
-
/* -----------------------------------------------------------------------------
|
|
31
|
-
* Component: ResizableHandle
|
|
32
|
-
* -------------------------------------------------------------------------- */
|
|
33
|
-
|
|
34
|
-
function ResizableHandle({
|
|
35
|
-
withHandle,
|
|
36
|
-
className,
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
39
|
-
withHandle?: boolean;
|
|
40
|
-
}): React.JSX.Element {
|
|
41
|
-
return (
|
|
42
|
-
<ResizablePrimitive.PanelResizeHandle
|
|
43
|
-
className={cn(
|
|
44
|
-
'bg-border relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90',
|
|
45
|
-
className,
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
>
|
|
49
|
-
{withHandle ? (
|
|
50
|
-
<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border">
|
|
51
|
-
<DragHandleDots2Icon className="size-2.5" />
|
|
52
|
-
</div>
|
|
53
|
-
) : null}
|
|
54
|
-
</ResizablePrimitive.PanelResizeHandle>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* -----------------------------------------------------------------------------
|
|
59
|
-
* Exports
|
|
60
|
-
* -------------------------------------------------------------------------- */
|
|
61
|
-
|
|
62
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
5
|
-
import { createContextScope, type Scope } from '@radix-ui/react-context';
|
|
6
|
-
import { tv, type VariantProps } from 'tailwind-variants';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
|
|
9
|
-
/* -----------------------------------------------------------------------------
|
|
10
|
-
* Component: ScrollArea
|
|
11
|
-
* -------------------------------------------------------------------------- */
|
|
12
|
-
|
|
13
|
-
const SCROLL_AREA_NAME = 'ScrollArea';
|
|
14
|
-
|
|
15
|
-
type ScopedProps<P> = P & { __scopeScrollArea?: Scope };
|
|
16
|
-
|
|
17
|
-
const [createCarouselContext] = createContextScope(SCROLL_AREA_NAME);
|
|
18
|
-
|
|
19
|
-
type ScrollAreaContextValue = Pick<ScrollAreaScrollbarVariantsProps, 'size'>;
|
|
20
|
-
|
|
21
|
-
const [CarouselProvider, useCarouselContext] = createCarouselContext<ScrollAreaContextValue>(SCROLL_AREA_NAME);
|
|
22
|
-
|
|
23
|
-
type ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Root>;
|
|
24
|
-
type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue;
|
|
25
|
-
|
|
26
|
-
const ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>(
|
|
27
|
-
({ __scopeScrollArea, children, className, size = '2', ...props }: ScopedProps<ScrollAreaProps>, forwardedRef) => (
|
|
28
|
-
<CarouselProvider scope={__scopeScrollArea} size={size}>
|
|
29
|
-
<ScrollAreaPrimitive.Root ref={forwardedRef} className={cn('relative overflow-hidden', className)} {...props}>
|
|
30
|
-
<ScrollAreaPrimitive.Viewport className="size-full rounded-[inherit] [&>*]:h-full">
|
|
31
|
-
{children}
|
|
32
|
-
</ScrollAreaPrimitive.Viewport>
|
|
33
|
-
<ScrollAreaScrollbar orientation="vertical" />
|
|
34
|
-
<ScrollAreaScrollbar orientation="horizontal" />
|
|
35
|
-
<ScrollAreaPrimitive.Corner />
|
|
36
|
-
</ScrollAreaPrimitive.Root>
|
|
37
|
-
</CarouselProvider>
|
|
38
|
-
),
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
42
|
-
|
|
43
|
-
/* -----------------------------------------------------------------------------
|
|
44
|
-
* Variant: ScrollAreaScrollbar
|
|
45
|
-
* -------------------------------------------------------------------------- */
|
|
46
|
-
|
|
47
|
-
const scrollAreaScrollbarVariants = tv({
|
|
48
|
-
base: 'flex touch-none select-none p-px transition',
|
|
49
|
-
variants: {
|
|
50
|
-
orientation: {
|
|
51
|
-
vertical: 'h-full flex-row border-l border-l-transparent',
|
|
52
|
-
horizontal: 'w-full flex-col border-t border-t-transparent',
|
|
53
|
-
},
|
|
54
|
-
size: {
|
|
55
|
-
none: '',
|
|
56
|
-
'1': '',
|
|
57
|
-
'2': '',
|
|
58
|
-
'3': '',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
compoundVariants: [
|
|
62
|
-
{ orientation: 'vertical', size: '1', className: 'w-1.5' },
|
|
63
|
-
{ orientation: 'vertical', size: '2', className: 'w-2' },
|
|
64
|
-
{ orientation: 'vertical', size: '3', className: 'w-2.5' },
|
|
65
|
-
{ orientation: 'horizontal', size: '1', className: 'h-1.5' },
|
|
66
|
-
{ orientation: 'horizontal', size: '2', className: 'h-2' },
|
|
67
|
-
{ orientation: 'horizontal', size: '3', className: 'h-2.5' },
|
|
68
|
-
],
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
type ScrollAreaScrollbarVariantsProps = VariantProps<typeof scrollAreaScrollbarVariants>;
|
|
72
|
-
|
|
73
|
-
/* -----------------------------------------------------------------------------
|
|
74
|
-
* Component: ScrollAreaScrollbar
|
|
75
|
-
* -------------------------------------------------------------------------- */
|
|
76
|
-
|
|
77
|
-
type ScrollAreaScrollbarElement = React.ElementRef<typeof ScrollAreaPrimitive.Scrollbar>;
|
|
78
|
-
type ScrollAreaScrollbarProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Scrollbar>;
|
|
79
|
-
|
|
80
|
-
const ScrollAreaScrollbar = React.forwardRef<ScrollAreaScrollbarElement, ScrollAreaScrollbarProps>(
|
|
81
|
-
(
|
|
82
|
-
{ __scopeScrollArea, className, orientation = 'vertical', ...props }: ScopedProps<ScrollAreaScrollbarProps>,
|
|
83
|
-
forwardedRef,
|
|
84
|
-
) => {
|
|
85
|
-
const { size } = useCarouselContext(SCROLL_AREA_NAME, __scopeScrollArea);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<ScrollAreaPrimitive.Scrollbar
|
|
89
|
-
ref={forwardedRef}
|
|
90
|
-
className={scrollAreaScrollbarVariants({ orientation, size, className })}
|
|
91
|
-
orientation={orientation}
|
|
92
|
-
{...props}
|
|
93
|
-
>
|
|
94
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="bg-border relative flex-1 rounded-full" />
|
|
95
|
-
</ScrollAreaPrimitive.Scrollbar>
|
|
96
|
-
);
|
|
97
|
-
},
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
ScrollAreaScrollbar.displayName = ScrollAreaPrimitive.Scrollbar.displayName;
|
|
101
|
-
|
|
102
|
-
/* -----------------------------------------------------------------------------
|
|
103
|
-
* Exports
|
|
104
|
-
* -------------------------------------------------------------------------- */
|
|
105
|
-
|
|
106
|
-
export { ScrollArea, ScrollAreaScrollbar, type ScrollAreaProps, type ScrollAreaScrollbarProps };
|
package/src/react/section.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Section
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type SectionElement = HTMLElement;
|
|
9
|
-
|
|
10
|
-
interface SectionProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Section = React.forwardRef<SectionElement, SectionProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
|
-
const Component = asChild ? Slot : 'section';
|
|
16
|
-
|
|
17
|
-
return <Component ref={forwardedRef} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Section.displayName = 'Section';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Section, type SectionProps };
|
package/src/react/select.tsx
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';
|
|
5
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: Select
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;
|
|
13
|
-
const Select = SelectPrimitive.Root;
|
|
14
|
-
|
|
15
|
-
/* -----------------------------------------------------------------------------
|
|
16
|
-
* Component: SelectGroup
|
|
17
|
-
* -------------------------------------------------------------------------- */
|
|
18
|
-
|
|
19
|
-
type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;
|
|
20
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Component: SelectValue
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
type SelectValueProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;
|
|
27
|
-
const SelectValue = SelectPrimitive.Value;
|
|
28
|
-
|
|
29
|
-
/* -----------------------------------------------------------------------------
|
|
30
|
-
* Component: SelectTrigger
|
|
31
|
-
* -------------------------------------------------------------------------- */
|
|
32
|
-
|
|
33
|
-
type SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;
|
|
34
|
-
type SelectTriggerProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
|
|
35
|
-
|
|
36
|
-
const SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(
|
|
37
|
-
({ children, className, ...props }, forwardedRef) => (
|
|
38
|
-
<SelectPrimitive.Trigger
|
|
39
|
-
ref={forwardedRef}
|
|
40
|
-
className={cn(
|
|
41
|
-
'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
<SelectPrimitive.Icon asChild>
|
|
48
|
-
<CaretSortIcon className="size-4 opacity-50" />
|
|
49
|
-
</SelectPrimitive.Icon>
|
|
50
|
-
</SelectPrimitive.Trigger>
|
|
51
|
-
),
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
55
|
-
|
|
56
|
-
/* -----------------------------------------------------------------------------
|
|
57
|
-
* Component: SelectScrollUpButton
|
|
58
|
-
* -------------------------------------------------------------------------- */
|
|
59
|
-
|
|
60
|
-
type SelectScrollUpButtonElement = React.ElementRef<typeof SelectPrimitive.ScrollUpButton>;
|
|
61
|
-
type SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>;
|
|
62
|
-
|
|
63
|
-
const SelectScrollUpButton = React.forwardRef<SelectScrollUpButtonElement, SelectScrollUpButtonProps>(
|
|
64
|
-
({ className, ...props }, forwardedRef) => (
|
|
65
|
-
<SelectPrimitive.ScrollUpButton
|
|
66
|
-
ref={forwardedRef}
|
|
67
|
-
className={cn('flex cursor-pointer items-center justify-center py-1', className)}
|
|
68
|
-
{...props}
|
|
69
|
-
>
|
|
70
|
-
<ChevronUpIcon />
|
|
71
|
-
</SelectPrimitive.ScrollUpButton>
|
|
72
|
-
),
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
76
|
-
|
|
77
|
-
/* -----------------------------------------------------------------------------
|
|
78
|
-
* Component: SelectScrollDownButton
|
|
79
|
-
* -------------------------------------------------------------------------- */
|
|
80
|
-
|
|
81
|
-
type SelectScrollDownButtonElement = React.ElementRef<typeof SelectPrimitive.ScrollDownButton>;
|
|
82
|
-
type SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>;
|
|
83
|
-
|
|
84
|
-
const SelectScrollDownButton = React.forwardRef<SelectScrollDownButtonElement, SelectScrollDownButtonProps>(
|
|
85
|
-
({ className, ...props }, forwardedRef) => (
|
|
86
|
-
<SelectPrimitive.ScrollDownButton
|
|
87
|
-
ref={forwardedRef}
|
|
88
|
-
className={cn('flex cursor-pointer items-center justify-center py-1', className)}
|
|
89
|
-
{...props}
|
|
90
|
-
>
|
|
91
|
-
<ChevronDownIcon />
|
|
92
|
-
</SelectPrimitive.ScrollDownButton>
|
|
93
|
-
),
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
97
|
-
|
|
98
|
-
/* -----------------------------------------------------------------------------
|
|
99
|
-
* Component: SelectContent
|
|
100
|
-
* -------------------------------------------------------------------------- */
|
|
101
|
-
|
|
102
|
-
type SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;
|
|
103
|
-
type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
|
|
104
|
-
|
|
105
|
-
const SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(
|
|
106
|
-
({ children, className, position = 'popper', ...props }, forwardedRef) => (
|
|
107
|
-
<SelectPrimitive.Portal>
|
|
108
|
-
<SelectPrimitive.Content
|
|
109
|
-
ref={forwardedRef}
|
|
110
|
-
className={cn(
|
|
111
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',
|
|
112
|
-
position === 'popper' &&
|
|
113
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
114
|
-
className,
|
|
115
|
-
)}
|
|
116
|
-
position={position}
|
|
117
|
-
{...props}
|
|
118
|
-
>
|
|
119
|
-
<SelectScrollUpButton />
|
|
120
|
-
<SelectPrimitive.Viewport
|
|
121
|
-
className={cn(
|
|
122
|
-
'p-1',
|
|
123
|
-
position === 'popper' &&
|
|
124
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',
|
|
125
|
-
)}
|
|
126
|
-
>
|
|
127
|
-
{children}
|
|
128
|
-
</SelectPrimitive.Viewport>
|
|
129
|
-
<SelectScrollDownButton />
|
|
130
|
-
</SelectPrimitive.Content>
|
|
131
|
-
</SelectPrimitive.Portal>
|
|
132
|
-
),
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
136
|
-
|
|
137
|
-
/* -----------------------------------------------------------------------------
|
|
138
|
-
* Component: SelectLabel
|
|
139
|
-
* -------------------------------------------------------------------------- */
|
|
140
|
-
|
|
141
|
-
type SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;
|
|
142
|
-
type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
|
|
143
|
-
|
|
144
|
-
const SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(({ className, ...props }, forwardedRef) => (
|
|
145
|
-
<SelectPrimitive.Label ref={forwardedRef} className={cn('px-2 py-1.5 text-sm font-semibold', className)} {...props} />
|
|
146
|
-
));
|
|
147
|
-
|
|
148
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
149
|
-
|
|
150
|
-
/* -----------------------------------------------------------------------------
|
|
151
|
-
* Component: SelectItem
|
|
152
|
-
* -------------------------------------------------------------------------- */
|
|
153
|
-
|
|
154
|
-
type SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;
|
|
155
|
-
type SelectItemProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;
|
|
156
|
-
|
|
157
|
-
const SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(
|
|
158
|
-
({ children, className, ...props }, forwardedRef) => (
|
|
159
|
-
<SelectPrimitive.Item
|
|
160
|
-
ref={forwardedRef}
|
|
161
|
-
className={cn(
|
|
162
|
-
'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
163
|
-
className,
|
|
164
|
-
)}
|
|
165
|
-
{...props}
|
|
166
|
-
>
|
|
167
|
-
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
168
|
-
<SelectPrimitive.ItemIndicator>
|
|
169
|
-
<CheckIcon className="size-4" />
|
|
170
|
-
</SelectPrimitive.ItemIndicator>
|
|
171
|
-
</span>
|
|
172
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
173
|
-
</SelectPrimitive.Item>
|
|
174
|
-
),
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
178
|
-
|
|
179
|
-
/* -----------------------------------------------------------------------------
|
|
180
|
-
* Component: SelectSeparator
|
|
181
|
-
* -------------------------------------------------------------------------- */
|
|
182
|
-
|
|
183
|
-
type SelectSeparatorElement = React.ElementRef<typeof SelectPrimitive.Separator>;
|
|
184
|
-
type SelectSeparatorProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;
|
|
185
|
-
|
|
186
|
-
const SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(
|
|
187
|
-
({ className, ...props }, forwardedRef) => (
|
|
188
|
-
<SelectPrimitive.Separator ref={forwardedRef} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />
|
|
189
|
-
),
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
193
|
-
|
|
194
|
-
/* -----------------------------------------------------------------------------
|
|
195
|
-
* Exports
|
|
196
|
-
* -------------------------------------------------------------------------- */
|
|
197
|
-
|
|
198
|
-
export {
|
|
199
|
-
Select,
|
|
200
|
-
SelectGroup,
|
|
201
|
-
SelectValue,
|
|
202
|
-
SelectTrigger,
|
|
203
|
-
SelectContent,
|
|
204
|
-
SelectLabel,
|
|
205
|
-
SelectItem,
|
|
206
|
-
SelectSeparator,
|
|
207
|
-
SelectScrollUpButton,
|
|
208
|
-
SelectScrollDownButton,
|
|
209
|
-
type SelectProps,
|
|
210
|
-
type SelectGroupProps,
|
|
211
|
-
type SelectValueProps,
|
|
212
|
-
type SelectTriggerProps,
|
|
213
|
-
type SelectContentProps,
|
|
214
|
-
type SelectLabelProps,
|
|
215
|
-
type SelectItemProps,
|
|
216
|
-
type SelectSeparatorProps,
|
|
217
|
-
type SelectScrollUpButtonProps,
|
|
218
|
-
type SelectScrollDownButtonProps,
|
|
219
|
-
};
|
package/src/react/separator.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Separator
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type SeparatorElement = React.ElementRef<typeof SeparatorPrimitive.Root>;
|
|
12
|
-
type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>;
|
|
13
|
-
|
|
14
|
-
const Separator = React.forwardRef<SeparatorElement, SeparatorProps>(
|
|
15
|
-
({ className, orientation = 'horizontal', decorative = true, ...props }, forwardedRef) => (
|
|
16
|
-
<SeparatorPrimitive.Root
|
|
17
|
-
ref={forwardedRef}
|
|
18
|
-
className={cn('bg-border shrink-0', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className)}
|
|
19
|
-
decorative={decorative}
|
|
20
|
-
orientation={orientation}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
),
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
27
|
-
|
|
28
|
-
/* -----------------------------------------------------------------------------
|
|
29
|
-
* Exports
|
|
30
|
-
* -------------------------------------------------------------------------- */
|
|
31
|
-
|
|
32
|
-
export { Separator, type SeparatorProps };
|
package/src/react/sheet.tsx
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
5
|
-
import { Cross2Icon } from '@radix-ui/react-icons';
|
|
6
|
-
import { tv, type VariantProps } from 'tailwind-variants';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
|
|
9
|
-
/* -----------------------------------------------------------------------------
|
|
10
|
-
* Component: Sheet
|
|
11
|
-
* -------------------------------------------------------------------------- */
|
|
12
|
-
|
|
13
|
-
type SheetProps = React.ComponentProps<typeof SheetPrimitive.Root>;
|
|
14
|
-
const Sheet = SheetPrimitive.Root;
|
|
15
|
-
|
|
16
|
-
/* -----------------------------------------------------------------------------
|
|
17
|
-
* Component: SheetTrigger
|
|
18
|
-
* -------------------------------------------------------------------------- */
|
|
19
|
-
|
|
20
|
-
type SheetTriggerProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Trigger>;
|
|
21
|
-
const SheetTrigger = SheetPrimitive.Trigger;
|
|
22
|
-
|
|
23
|
-
/* -----------------------------------------------------------------------------
|
|
24
|
-
* Component: SheetClose
|
|
25
|
-
* -------------------------------------------------------------------------- */
|
|
26
|
-
|
|
27
|
-
type SheetCloseProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Close>;
|
|
28
|
-
const SheetClose = SheetPrimitive.Close;
|
|
29
|
-
|
|
30
|
-
/* -----------------------------------------------------------------------------
|
|
31
|
-
* Variant: SheetContent
|
|
32
|
-
* -------------------------------------------------------------------------- */
|
|
33
|
-
|
|
34
|
-
const sheetContentVariants = tv({
|
|
35
|
-
base: 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:animate-duration-300 data-[state=open]:animate-duration-500 animate-ease-in-out fixed z-50 flex flex-col overflow-auto shadow-lg',
|
|
36
|
-
variants: {
|
|
37
|
-
side: {
|
|
38
|
-
top: 'data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top inset-x-0 top-0 max-h-screen border-b',
|
|
39
|
-
bottom:
|
|
40
|
-
'data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom inset-x-0 bottom-0 max-h-screen border-t',
|
|
41
|
-
left: 'data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
42
|
-
right:
|
|
43
|
-
'data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
defaultVariants: {
|
|
47
|
-
side: 'right',
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
type SheetContentVariantsProps = VariantProps<typeof sheetContentVariants>;
|
|
52
|
-
|
|
53
|
-
/* -----------------------------------------------------------------------------
|
|
54
|
-
* Component: SheetContent
|
|
55
|
-
* -------------------------------------------------------------------------- */
|
|
56
|
-
|
|
57
|
-
type SheetContentElement = React.ElementRef<typeof SheetPrimitive.Content>;
|
|
58
|
-
type SheetContentProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & SheetContentVariantsProps;
|
|
59
|
-
|
|
60
|
-
const SheetContent = React.forwardRef<SheetContentElement, SheetContentProps>(
|
|
61
|
-
({ children, side = 'right', className, ...props }, forwardedRef) => (
|
|
62
|
-
<SheetPrimitive.Portal>
|
|
63
|
-
<SheetPrimitive.Overlay className="data-[state=closed]:animate-duration-300 data-[state=open]:animate-duration-500 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80" />
|
|
64
|
-
<SheetPrimitive.Content ref={forwardedRef} className={sheetContentVariants({ side, className })} {...props}>
|
|
65
|
-
{children}
|
|
66
|
-
<SheetPrimitive.Close className="data-[state=open]:bg-secondary absolute right-4 top-4 rounded-sm p-1 opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none">
|
|
67
|
-
<Cross2Icon className="size-4" />
|
|
68
|
-
<span className="sr-only">Close</span>
|
|
69
|
-
</SheetPrimitive.Close>
|
|
70
|
-
</SheetPrimitive.Content>
|
|
71
|
-
</SheetPrimitive.Portal>
|
|
72
|
-
),
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
76
|
-
|
|
77
|
-
/* -----------------------------------------------------------------------------
|
|
78
|
-
* Component: SheetHeader
|
|
79
|
-
* -------------------------------------------------------------------------- */
|
|
80
|
-
|
|
81
|
-
type SheetHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
82
|
-
|
|
83
|
-
function SheetHeader({ className, ...props }: SheetHeaderProps): React.JSX.Element {
|
|
84
|
-
return (
|
|
85
|
-
<header
|
|
86
|
-
className={cn('flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left', className)}
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* -----------------------------------------------------------------------------
|
|
93
|
-
* Component: SheetBody
|
|
94
|
-
* -------------------------------------------------------------------------- */
|
|
95
|
-
|
|
96
|
-
type SheetBodyProps = React.HTMLAttributes<HTMLDivElement>;
|
|
97
|
-
|
|
98
|
-
function SheetBody({ className, ...props }: SheetHeaderProps): React.JSX.Element {
|
|
99
|
-
return <main className={cn('px-6 py-2', className)} {...props} />;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* -----------------------------------------------------------------------------
|
|
103
|
-
* Component: SheetFooter
|
|
104
|
-
* -------------------------------------------------------------------------- */
|
|
105
|
-
|
|
106
|
-
type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
107
|
-
|
|
108
|
-
function SheetFooter({ className, ...props }: SheetFooterProps): React.JSX.Element {
|
|
109
|
-
return (
|
|
110
|
-
<footer
|
|
111
|
-
className={cn('flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end', className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
SheetFooter.displayName = 'SheetFooter';
|
|
118
|
-
|
|
119
|
-
/* -----------------------------------------------------------------------------
|
|
120
|
-
* Component: SheetTitle
|
|
121
|
-
* -------------------------------------------------------------------------- */
|
|
122
|
-
|
|
123
|
-
type SheetTitleElement = React.ElementRef<typeof SheetPrimitive.Title>;
|
|
124
|
-
type SheetTitleProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>;
|
|
125
|
-
|
|
126
|
-
const SheetTitle = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ className, ...props }, forwardedRef) => (
|
|
127
|
-
<SheetPrimitive.Title
|
|
128
|
-
ref={forwardedRef}
|
|
129
|
-
className={cn('text-foreground text-lg font-semibold', className)}
|
|
130
|
-
{...props}
|
|
131
|
-
/>
|
|
132
|
-
));
|
|
133
|
-
|
|
134
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
135
|
-
|
|
136
|
-
/* -----------------------------------------------------------------------------
|
|
137
|
-
* Component: SheetDescription
|
|
138
|
-
* -------------------------------------------------------------------------- */
|
|
139
|
-
|
|
140
|
-
type SheetDescriptionElement = React.ElementRef<typeof SheetPrimitive.Description>;
|
|
141
|
-
type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>;
|
|
142
|
-
|
|
143
|
-
const SheetDescription = React.forwardRef<SheetDescriptionElement, SheetDescriptionProps>(
|
|
144
|
-
({ className, ...props }, forwardedRef) => (
|
|
145
|
-
<SheetPrimitive.Description
|
|
146
|
-
ref={forwardedRef}
|
|
147
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
148
|
-
{...props}
|
|
149
|
-
/>
|
|
150
|
-
),
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
154
|
-
|
|
155
|
-
/* -----------------------------------------------------------------------------
|
|
156
|
-
* Exports
|
|
157
|
-
* -------------------------------------------------------------------------- */
|
|
158
|
-
|
|
159
|
-
export {
|
|
160
|
-
Sheet,
|
|
161
|
-
SheetTrigger,
|
|
162
|
-
SheetClose,
|
|
163
|
-
SheetContent,
|
|
164
|
-
SheetHeader,
|
|
165
|
-
SheetBody,
|
|
166
|
-
SheetFooter,
|
|
167
|
-
SheetTitle,
|
|
168
|
-
SheetDescription,
|
|
169
|
-
type SheetProps,
|
|
170
|
-
type SheetTriggerProps,
|
|
171
|
-
type SheetCloseProps,
|
|
172
|
-
type SheetContentProps,
|
|
173
|
-
type SheetHeaderProps,
|
|
174
|
-
type SheetBodyProps,
|
|
175
|
-
type SheetFooterProps,
|
|
176
|
-
type SheetTitleProps,
|
|
177
|
-
type SheetDescriptionProps,
|
|
178
|
-
};
|
package/src/react/skeleton.tsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Skeleton
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type SkeletonProps = React.HTMLAttributes<HTMLDivElement>;
|
|
9
|
-
|
|
10
|
-
function Skeleton({ className, ...props }: SkeletonProps): React.JSX.Element {
|
|
11
|
-
return <div className={cn('bg-primary/10 animate-pulse rounded', className)} {...props} />;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* -----------------------------------------------------------------------------
|
|
15
|
-
* Exports
|
|
16
|
-
* -------------------------------------------------------------------------- */
|
|
17
|
-
|
|
18
|
-
export { Skeleton, type SkeletonProps };
|