@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/slider.tsx
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Slider
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type SliderElement = React.ElementRef<typeof SliderPrimitive.Root>;
|
|
12
|
-
type SliderProps = React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>;
|
|
13
|
-
|
|
14
|
-
const Slider = React.forwardRef<SliderElement, SliderProps>(({ className, ...props }, forwardedRef) => (
|
|
15
|
-
<SliderPrimitive.Root
|
|
16
|
-
ref={forwardedRef}
|
|
17
|
-
className={cn('relative flex w-full touch-none select-none items-center', className)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<SliderPrimitive.Track className="bg-primary/20 relative h-1.5 w-full grow overflow-hidden rounded-full">
|
|
21
|
-
<SliderPrimitive.Range className="bg-primary absolute h-full" />
|
|
22
|
-
</SliderPrimitive.Track>
|
|
23
|
-
|
|
24
|
-
{(props.value ?? props.defaultValue ?? []).map((value, index) => (
|
|
25
|
-
<SliderPrimitive.Thumb
|
|
26
|
-
// eslint-disable-next-line react/no-array-index-key -- index is stable
|
|
27
|
-
key={index}
|
|
28
|
-
className="border-primary/50 bg-background block size-4 rounded-full border shadow transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
29
|
-
{...(props.tabIndex !== undefined ? { tabIndex: props.tabIndex } : undefined)}
|
|
30
|
-
/>
|
|
31
|
-
))}
|
|
32
|
-
</SliderPrimitive.Root>
|
|
33
|
-
));
|
|
34
|
-
|
|
35
|
-
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
36
|
-
|
|
37
|
-
/* -----------------------------------------------------------------------------
|
|
38
|
-
* Exports
|
|
39
|
-
* -------------------------------------------------------------------------- */
|
|
40
|
-
|
|
41
|
-
export { Slider, type SliderProps };
|
package/src/react/sonner.tsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { useTheme } from 'next-themes';
|
|
5
|
-
import { toast, Toaster as Sonner } from 'sonner';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Sonner
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
12
|
-
type Theme = 'light' | 'dark' | 'system' | undefined;
|
|
13
|
-
|
|
14
|
-
function Toaster({ ...props }: ToasterProps): React.JSX.Element {
|
|
15
|
-
const { theme = 'system' } = useTheme() as { theme: Theme };
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Sonner
|
|
19
|
-
className="toaster group"
|
|
20
|
-
theme={theme}
|
|
21
|
-
toastOptions={{
|
|
22
|
-
classNames: {
|
|
23
|
-
actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
|
|
24
|
-
cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
|
|
25
|
-
content: 'w-full flex flex-col gap-1',
|
|
26
|
-
description: 'group-[.toast]:text-muted-foreground',
|
|
27
|
-
toast:
|
|
28
|
-
'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
|
|
29
|
-
},
|
|
30
|
-
}}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* -----------------------------------------------------------------------------
|
|
37
|
-
* Exports
|
|
38
|
-
* -------------------------------------------------------------------------- */
|
|
39
|
-
|
|
40
|
-
export { Toaster, toast, type ToasterProps };
|
package/src/react/spinner.tsx
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
/* -----------------------------------------------------------------------------
|
|
6
|
-
* Component: Spinner
|
|
7
|
-
* -------------------------------------------------------------------------- */
|
|
8
|
-
|
|
9
|
-
const spinnerCount = 8;
|
|
10
|
-
|
|
11
|
-
type SpinnerElement = HTMLSpanElement;
|
|
12
|
-
|
|
13
|
-
interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
14
|
-
loading?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const Spinner = React.forwardRef<SpinnerElement, SpinnerProps>(
|
|
18
|
-
({ children, className, loading = true, ...props }, forwardedRef) => {
|
|
19
|
-
if (!loading) {
|
|
20
|
-
return children;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const spinner = (
|
|
24
|
-
<span
|
|
25
|
-
ref={forwardedRef}
|
|
26
|
-
className={cn('relative flex size-4 items-center justify-center opacity-60', className)}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
{Array.from({ length: spinnerCount }, (_, i) => (
|
|
30
|
-
<span
|
|
31
|
-
key={i}
|
|
32
|
-
className="before:fade-out-25 before:animate-out before:animate-repeat-infinite before:animate-delay-[var(--spinner-delay)] before:animate-duration-[var(--spinner-duration)] absolute h-full rotate-[var(--spinner-rotate)] before:block before:h-1/3 before:w-full before:rounded-full before:bg-current"
|
|
33
|
-
style={
|
|
34
|
-
{
|
|
35
|
-
width: `${(100 / spinnerCount).toString()}%`,
|
|
36
|
-
'--spinner-delay': `-${((spinnerCount - i) * 100).toString()}ms`,
|
|
37
|
-
'--spinner-rotate': `${((360 / spinnerCount) * i).toString()}deg`,
|
|
38
|
-
'--spinner-duration': `${(spinnerCount * 100).toString()}ms`,
|
|
39
|
-
} as React.CSSProperties
|
|
40
|
-
}
|
|
41
|
-
/>
|
|
42
|
-
))}
|
|
43
|
-
</span>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
if (children === undefined) {
|
|
47
|
-
return spinner;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<span className="relative">
|
|
52
|
-
<span aria-hidden className="invisible contents">
|
|
53
|
-
{children}
|
|
54
|
-
</span>
|
|
55
|
-
<VisuallyHidden>{children}</VisuallyHidden>
|
|
56
|
-
<span className="absolute inset-0 flex items-center justify-center">{spinner}</span>
|
|
57
|
-
</span>
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
Spinner.displayName = 'Spinner';
|
|
63
|
-
|
|
64
|
-
/* -----------------------------------------------------------------------------
|
|
65
|
-
* Exports
|
|
66
|
-
* -------------------------------------------------------------------------- */
|
|
67
|
-
|
|
68
|
-
export { Spinner, type SpinnerProps };
|
package/src/react/strong.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Strong
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type StrongElement = HTMLElement;
|
|
9
|
-
|
|
10
|
-
interface StrongProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Strong = React.forwardRef<StrongElement, StrongProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
|
-
const Component = asChild ? Slot : 'strong';
|
|
16
|
-
|
|
17
|
-
return <Component ref={forwardedRef} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Strong.displayName = 'Strong';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Strong, type StrongProps };
|
package/src/react/switch.tsx
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Switch
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type SwitchElement = React.ElementRef<typeof SwitchPrimitives.Root>;
|
|
12
|
-
type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>;
|
|
13
|
-
|
|
14
|
-
const Switch = React.forwardRef<SwitchElement, SwitchProps>(({ className, ...props }, forwardedRef) => (
|
|
15
|
-
<SwitchPrimitives.Root
|
|
16
|
-
className={cn(
|
|
17
|
-
'data-[state=checked]:bg-primary data-[state=unchecked]:bg-input peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-sm transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-50',
|
|
18
|
-
className,
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
ref={forwardedRef}
|
|
22
|
-
>
|
|
23
|
-
<SwitchPrimitives.Thumb className="bg-background pointer-events-none block size-4 rounded-full shadow-lg transition data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0" />
|
|
24
|
-
</SwitchPrimitives.Root>
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
28
|
-
|
|
29
|
-
/* -----------------------------------------------------------------------------
|
|
30
|
-
* Exports
|
|
31
|
-
* -------------------------------------------------------------------------- */
|
|
32
|
-
|
|
33
|
-
export { Switch, type SwitchProps };
|
package/src/react/table.tsx
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Table
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type TableElement = HTMLTableElement;
|
|
9
|
-
type TableProps = React.HTMLAttributes<HTMLTableElement>;
|
|
10
|
-
|
|
11
|
-
const Table = React.forwardRef<TableElement, TableProps>(({ className, ...props }, forwardedRef) => (
|
|
12
|
-
<div className="relative w-full overflow-auto">
|
|
13
|
-
<table ref={forwardedRef} className={cn('w-full caption-bottom text-sm', className)} {...props} />
|
|
14
|
-
</div>
|
|
15
|
-
));
|
|
16
|
-
|
|
17
|
-
Table.displayName = 'Table';
|
|
18
|
-
|
|
19
|
-
/* -----------------------------------------------------------------------------
|
|
20
|
-
* Component: TableHeader
|
|
21
|
-
* -------------------------------------------------------------------------- */
|
|
22
|
-
|
|
23
|
-
type TableHeaderElement = HTMLTableSectionElement;
|
|
24
|
-
type TableHeaderProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
25
|
-
|
|
26
|
-
const TableHeader = React.forwardRef<TableHeaderElement, TableHeaderProps>(({ className, ...props }, forwardedRef) => (
|
|
27
|
-
<thead ref={forwardedRef} className={cn('[&_tr]:border-b', className)} {...props} />
|
|
28
|
-
));
|
|
29
|
-
|
|
30
|
-
TableHeader.displayName = 'TableHeader';
|
|
31
|
-
|
|
32
|
-
/* -----------------------------------------------------------------------------
|
|
33
|
-
* Component: TableBody
|
|
34
|
-
* -------------------------------------------------------------------------- */
|
|
35
|
-
|
|
36
|
-
type TableBodyElement = HTMLTableSectionElement;
|
|
37
|
-
type TableBodyProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
38
|
-
|
|
39
|
-
const TableBody = React.forwardRef<TableBodyElement, TableBodyProps>(({ className, ...props }, forwardedRef) => (
|
|
40
|
-
<tbody ref={forwardedRef} className={cn('[&_tr:last-child]:border-0', className)} {...props} />
|
|
41
|
-
));
|
|
42
|
-
|
|
43
|
-
TableBody.displayName = 'TableBody';
|
|
44
|
-
|
|
45
|
-
/* -----------------------------------------------------------------------------
|
|
46
|
-
* Component: TableFooter
|
|
47
|
-
* -------------------------------------------------------------------------- */
|
|
48
|
-
|
|
49
|
-
type TableFooterElement = HTMLTableSectionElement;
|
|
50
|
-
type TableFooterProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
51
|
-
|
|
52
|
-
const TableFooter = React.forwardRef<TableFooterElement, TableFooterProps>(({ className, ...props }, forwardedRef) => (
|
|
53
|
-
<tfoot
|
|
54
|
-
ref={forwardedRef}
|
|
55
|
-
className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}
|
|
56
|
-
{...props}
|
|
57
|
-
/>
|
|
58
|
-
));
|
|
59
|
-
|
|
60
|
-
TableFooter.displayName = 'TableFooter';
|
|
61
|
-
|
|
62
|
-
/* -----------------------------------------------------------------------------
|
|
63
|
-
* Component: TableRow
|
|
64
|
-
* -------------------------------------------------------------------------- */
|
|
65
|
-
|
|
66
|
-
type TableRowElement = HTMLTableRowElement;
|
|
67
|
-
type TableRowProps = React.HTMLAttributes<HTMLTableRowElement>;
|
|
68
|
-
|
|
69
|
-
const TableRow = React.forwardRef<TableRowElement, TableRowProps>(({ className, ...props }, forwardedRef) => (
|
|
70
|
-
<tr
|
|
71
|
-
ref={forwardedRef}
|
|
72
|
-
className={cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition', className)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
));
|
|
76
|
-
|
|
77
|
-
TableRow.displayName = 'TableRow';
|
|
78
|
-
|
|
79
|
-
/* -----------------------------------------------------------------------------
|
|
80
|
-
* Component: TableHead
|
|
81
|
-
* -------------------------------------------------------------------------- */
|
|
82
|
-
|
|
83
|
-
type TableHeadElement = HTMLTableCellElement;
|
|
84
|
-
type TableHeadProps = React.ThHTMLAttributes<HTMLTableCellElement>;
|
|
85
|
-
|
|
86
|
-
const TableHead = React.forwardRef<TableHeadElement, TableHeadProps>(({ className, ...props }, forwardedRef) => (
|
|
87
|
-
<th
|
|
88
|
-
ref={forwardedRef}
|
|
89
|
-
className={cn(
|
|
90
|
-
'text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0',
|
|
91
|
-
className,
|
|
92
|
-
)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
));
|
|
96
|
-
|
|
97
|
-
TableHead.displayName = 'TableHead';
|
|
98
|
-
|
|
99
|
-
/* -----------------------------------------------------------------------------
|
|
100
|
-
* Component: TableCell
|
|
101
|
-
* -------------------------------------------------------------------------- */
|
|
102
|
-
|
|
103
|
-
type TableCellElement = HTMLTableCellElement;
|
|
104
|
-
type TableCellProps = React.TdHTMLAttributes<HTMLTableCellElement>;
|
|
105
|
-
|
|
106
|
-
const TableCell = React.forwardRef<TableCellElement, TableCellProps>(({ className, ...props }, forwardedRef) => (
|
|
107
|
-
<td ref={forwardedRef} className={cn('p-4 align-middle [&:has([role=checkbox])]:pr-0', className)} {...props} />
|
|
108
|
-
));
|
|
109
|
-
|
|
110
|
-
TableCell.displayName = 'TableCell';
|
|
111
|
-
|
|
112
|
-
/* -----------------------------------------------------------------------------
|
|
113
|
-
* Component: TableCaption
|
|
114
|
-
* -------------------------------------------------------------------------- */
|
|
115
|
-
|
|
116
|
-
type TableCaptionElement = HTMLTableCaptionElement;
|
|
117
|
-
type TableCaptionProps = React.HTMLAttributes<HTMLTableCaptionElement>;
|
|
118
|
-
|
|
119
|
-
const TableCaption = React.forwardRef<TableCaptionElement, TableCaptionProps>(
|
|
120
|
-
({ className, ...props }, forwardedRef) => (
|
|
121
|
-
<caption ref={forwardedRef} className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />
|
|
122
|
-
),
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
TableCaption.displayName = 'TableCaption';
|
|
126
|
-
|
|
127
|
-
/* -----------------------------------------------------------------------------
|
|
128
|
-
* Exports
|
|
129
|
-
* -------------------------------------------------------------------------- */
|
|
130
|
-
|
|
131
|
-
export {
|
|
132
|
-
Table,
|
|
133
|
-
TableHeader,
|
|
134
|
-
TableBody,
|
|
135
|
-
TableFooter,
|
|
136
|
-
TableHead,
|
|
137
|
-
TableRow,
|
|
138
|
-
TableCell,
|
|
139
|
-
TableCaption,
|
|
140
|
-
type TableProps,
|
|
141
|
-
type TableHeaderProps,
|
|
142
|
-
type TableBodyProps,
|
|
143
|
-
type TableFooterProps,
|
|
144
|
-
type TableHeadProps,
|
|
145
|
-
type TableRowProps,
|
|
146
|
-
type TableCellProps,
|
|
147
|
-
type TableCaptionProps,
|
|
148
|
-
};
|
package/src/react/tabs.tsx
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Tabs
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type TabsProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>;
|
|
12
|
-
const Tabs = TabsPrimitive.Root;
|
|
13
|
-
|
|
14
|
-
/* -----------------------------------------------------------------------------
|
|
15
|
-
* Component: TabsList
|
|
16
|
-
* -------------------------------------------------------------------------- */
|
|
17
|
-
|
|
18
|
-
type TabsListElement = React.ElementRef<typeof TabsPrimitive.List>;
|
|
19
|
-
type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
|
|
20
|
-
|
|
21
|
-
const TabsList = React.forwardRef<TabsListElement, TabsListProps>(({ className, ...props }, forwardedRef) => (
|
|
22
|
-
<TabsPrimitive.List
|
|
23
|
-
ref={forwardedRef}
|
|
24
|
-
className={cn(
|
|
25
|
-
'bg-muted text-muted-foreground inline-flex h-10 items-center justify-center gap-1 rounded-md p-1',
|
|
26
|
-
className,
|
|
27
|
-
)}
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
));
|
|
31
|
-
|
|
32
|
-
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
33
|
-
|
|
34
|
-
/* -----------------------------------------------------------------------------
|
|
35
|
-
* Component: TabsTrigger
|
|
36
|
-
* -------------------------------------------------------------------------- */
|
|
37
|
-
|
|
38
|
-
type TabsTriggerElement = React.ElementRef<typeof TabsPrimitive.Trigger>;
|
|
39
|
-
type TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;
|
|
40
|
-
|
|
41
|
-
const TabsTrigger = React.forwardRef<TabsTriggerElement, TabsTriggerProps>(({ className, ...props }, forwardedRef) => (
|
|
42
|
-
<TabsPrimitive.Trigger
|
|
43
|
-
ref={forwardedRef}
|
|
44
|
-
className={cn(
|
|
45
|
-
'data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium outline-transparent transition-all focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm',
|
|
46
|
-
className,
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
));
|
|
51
|
-
|
|
52
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
53
|
-
|
|
54
|
-
/* -----------------------------------------------------------------------------
|
|
55
|
-
* Component: TabsContent
|
|
56
|
-
* -------------------------------------------------------------------------- */
|
|
57
|
-
|
|
58
|
-
type TabsContentElement = React.ElementRef<typeof TabsPrimitive.Content>;
|
|
59
|
-
type TabsContentProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;
|
|
60
|
-
|
|
61
|
-
const TabsContent = React.forwardRef<TabsContentElement, TabsContentProps>(({ className, ...props }, forwardedRef) => (
|
|
62
|
-
<TabsPrimitive.Content
|
|
63
|
-
ref={forwardedRef}
|
|
64
|
-
className={cn(
|
|
65
|
-
'mt-2 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2',
|
|
66
|
-
className,
|
|
67
|
-
)}
|
|
68
|
-
{...props}
|
|
69
|
-
/>
|
|
70
|
-
));
|
|
71
|
-
|
|
72
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
73
|
-
|
|
74
|
-
/* -----------------------------------------------------------------------------
|
|
75
|
-
* Exports
|
|
76
|
-
* -------------------------------------------------------------------------- */
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
Tabs,
|
|
80
|
-
TabsList,
|
|
81
|
-
TabsTrigger,
|
|
82
|
-
TabsContent,
|
|
83
|
-
type TabsProps,
|
|
84
|
-
type TabsListProps,
|
|
85
|
-
type TabsTriggerProps,
|
|
86
|
-
type TabsContentProps,
|
|
87
|
-
};
|
package/src/react/text-input.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Input, type InputProps, InputSlot, type InputSlotProps } from './input';
|
|
5
|
-
|
|
6
|
-
/* -----------------------------------------------------------------------------
|
|
7
|
-
* Component: TextInput
|
|
8
|
-
* -------------------------------------------------------------------------- */
|
|
9
|
-
|
|
10
|
-
type TextInputElement = HTMLInputElement;
|
|
11
|
-
interface TextInputProps extends InputProps, Omit<InputSlotProps, 'prefix'> {}
|
|
12
|
-
|
|
13
|
-
const TextInput = React.forwardRef<TextInputElement, TextInputProps>(
|
|
14
|
-
({ className, loading, loaderPosition, prefix, suffix, inputSize, ...props }, ref) => {
|
|
15
|
-
return (
|
|
16
|
-
<Input
|
|
17
|
-
className={className}
|
|
18
|
-
inputSize={inputSize}
|
|
19
|
-
loaderPosition={loaderPosition}
|
|
20
|
-
loading={loading}
|
|
21
|
-
prefix={prefix}
|
|
22
|
-
suffix={suffix}
|
|
23
|
-
>
|
|
24
|
-
<InputSlot ref={ref} {...props} />
|
|
25
|
-
</Input>
|
|
26
|
-
);
|
|
27
|
-
},
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
TextInput.displayName = 'TextInput';
|
|
31
|
-
|
|
32
|
-
/* -----------------------------------------------------------------------------
|
|
33
|
-
* Exports
|
|
34
|
-
* -------------------------------------------------------------------------- */
|
|
35
|
-
|
|
36
|
-
export { TextInput, type TextInputProps };
|
package/src/react/text.tsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Text
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type TextElement = HTMLParagraphElement;
|
|
9
|
-
|
|
10
|
-
interface TextParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
11
|
-
as?: 'p';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface TextSpanProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
15
|
-
as: 'span';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type TextProps = (TextParagraphProps | TextSpanProps) & {
|
|
19
|
-
asChild?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const Text = React.forwardRef<TextElement, TextProps>(({ as: Tag = 'p', asChild, ...props }, forwardedRef) => {
|
|
23
|
-
const Component = asChild ? Slot : Tag;
|
|
24
|
-
|
|
25
|
-
return <Component ref={forwardedRef} {...props} />;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
Text.displayName = 'Text';
|
|
29
|
-
|
|
30
|
-
/* -----------------------------------------------------------------------------
|
|
31
|
-
* Exports
|
|
32
|
-
* -------------------------------------------------------------------------- */
|
|
33
|
-
|
|
34
|
-
export { Text, type TextProps };
|
package/src/react/textarea.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Textarea
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type TextareaElement = HTMLTextAreaElement;
|
|
9
|
-
type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
10
|
-
|
|
11
|
-
const Textarea = React.forwardRef<TextareaElement, TextareaProps>(({ className, ...props }, forwardedRef) => {
|
|
12
|
-
return (
|
|
13
|
-
<textarea
|
|
14
|
-
ref={forwardedRef}
|
|
15
|
-
className={cn(
|
|
16
|
-
'border-input placeholder:text-muted-foreground flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-50',
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
Textarea.displayName = 'Textarea';
|
|
25
|
-
|
|
26
|
-
/* -----------------------------------------------------------------------------
|
|
27
|
-
* Exports
|
|
28
|
-
* -------------------------------------------------------------------------- */
|
|
29
|
-
|
|
30
|
-
export { Textarea, type TextareaProps };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
5
|
-
import { createToggleGroupScope } from '@radix-ui/react-toggle-group';
|
|
6
|
-
import { createContextScope, type Scope } from '@radix-ui/react-context';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
import { toggleVariants, type ToggleVariantsProps } from './toggle';
|
|
9
|
-
|
|
10
|
-
/* -----------------------------------------------------------------------------
|
|
11
|
-
* Component: ToggleGroup
|
|
12
|
-
* -------------------------------------------------------------------------- */
|
|
13
|
-
|
|
14
|
-
const TOGGLE_GROUP_NAME = 'ToggleGroup';
|
|
15
|
-
|
|
16
|
-
type ScopedProps<P> = P & { __scopeToggleGroup?: Scope };
|
|
17
|
-
|
|
18
|
-
const [createToggleGroupContext] = createContextScope(TOGGLE_GROUP_NAME, [createToggleGroupScope]);
|
|
19
|
-
|
|
20
|
-
const useToggleGroupScope = createToggleGroupScope();
|
|
21
|
-
|
|
22
|
-
const [ToggleGroupProvider, useToggleGroupContext] = createToggleGroupContext<ToggleVariantsProps>(TOGGLE_GROUP_NAME);
|
|
23
|
-
|
|
24
|
-
type ToggleGroupElement = React.ElementRef<typeof ToggleGroupPrimitive.Root>;
|
|
25
|
-
type ToggleGroupProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & ToggleVariantsProps;
|
|
26
|
-
|
|
27
|
-
const ToggleGroup = React.forwardRef<ToggleGroupElement, ToggleGroupProps>(
|
|
28
|
-
(
|
|
29
|
-
{ __scopeToggleGroup, children, className, variant, size, ...props }: ScopedProps<ToggleGroupProps>,
|
|
30
|
-
forwardedRef,
|
|
31
|
-
) => {
|
|
32
|
-
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<ToggleGroupProvider scope={__scopeToggleGroup} size={size} variant={variant}>
|
|
36
|
-
<ToggleGroupPrimitive.Root
|
|
37
|
-
ref={forwardedRef}
|
|
38
|
-
className={cn('flex items-center justify-center gap-1', className)}
|
|
39
|
-
{...toggleGroupScope}
|
|
40
|
-
{...props}
|
|
41
|
-
>
|
|
42
|
-
{children}
|
|
43
|
-
</ToggleGroupPrimitive.Root>
|
|
44
|
-
</ToggleGroupProvider>
|
|
45
|
-
);
|
|
46
|
-
},
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
ToggleGroup.displayName = TOGGLE_GROUP_NAME;
|
|
50
|
-
|
|
51
|
-
/* -----------------------------------------------------------------------------
|
|
52
|
-
* Component: ToggleGroupItem
|
|
53
|
-
* -------------------------------------------------------------------------- */
|
|
54
|
-
|
|
55
|
-
const TOGGLE_GROUP_ITEM_NAME = 'ToggleGroupItem';
|
|
56
|
-
|
|
57
|
-
type ToggleGroupItemElement = React.ElementRef<typeof ToggleGroupPrimitive.Item>;
|
|
58
|
-
type ToggleGroupItemProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>;
|
|
59
|
-
|
|
60
|
-
const ToggleGroupItem = React.forwardRef<ToggleGroupItemElement, ToggleGroupItemProps>(
|
|
61
|
-
({ __scopeToggleGroup, children, className, ...props }: ScopedProps<ToggleGroupItemProps>, forwardedRef) => {
|
|
62
|
-
const context = useToggleGroupContext(TOGGLE_GROUP_ITEM_NAME, __scopeToggleGroup);
|
|
63
|
-
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<ToggleGroupPrimitive.Item
|
|
67
|
-
ref={forwardedRef}
|
|
68
|
-
className={toggleVariants({ ...context, className })}
|
|
69
|
-
{...toggleGroupScope}
|
|
70
|
-
{...props}
|
|
71
|
-
>
|
|
72
|
-
{children}
|
|
73
|
-
</ToggleGroupPrimitive.Item>
|
|
74
|
-
);
|
|
75
|
-
},
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
|
|
79
|
-
|
|
80
|
-
/* -----------------------------------------------------------------------------
|
|
81
|
-
* Exports
|
|
82
|
-
* -------------------------------------------------------------------------- */
|
|
83
|
-
|
|
84
|
-
export { ToggleGroup, ToggleGroupItem, type ToggleGroupProps, type ToggleGroupItemProps };
|