@trycompai/design-system 1.0.0 → 1.0.2
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/package.json +6 -3
- package/src/components/atoms/badge.tsx +49 -0
- package/src/components/{ui → atoms}/button.tsx +6 -1
- package/src/components/{ui → atoms}/checkbox.tsx +3 -3
- package/src/components/{ui → atoms}/heading.tsx +6 -6
- package/src/components/atoms/index.ts +21 -0
- package/src/components/atoms/kbd.tsx +21 -0
- package/src/components/atoms/logo.tsx +52 -0
- package/src/components/{ui → atoms}/slider.tsx +4 -4
- package/src/components/{ui → atoms}/spinner.tsx +3 -3
- package/src/components/atoms/stack.tsx +97 -0
- package/src/components/{ui → atoms}/switch.tsx +1 -1
- package/src/components/{ui → atoms}/text.tsx +5 -1
- package/src/components/{ui → atoms}/textarea.tsx +8 -2
- package/src/components/{ui → atoms}/toggle.tsx +3 -6
- package/src/components/{ui → molecules}/accordion.tsx +3 -3
- package/src/components/molecules/ai-chat.tsx +217 -0
- package/src/components/{ui → molecules}/alert.tsx +5 -5
- package/src/components/{ui → molecules}/breadcrumb.tsx +9 -8
- package/src/components/{ui → molecules}/card.tsx +24 -5
- package/src/components/molecules/command-search.tsx +147 -0
- package/src/components/molecules/empty.tsx +82 -0
- package/src/components/{ui → molecules}/field.tsx +16 -37
- package/src/components/{ui → molecules}/hover-card.tsx +2 -8
- package/src/components/molecules/index.ts +29 -0
- package/src/components/{ui → molecules}/input-group.tsx +1 -1
- package/src/components/molecules/input-otp.tsx +70 -0
- package/src/components/{ui → molecules}/item.tsx +18 -36
- package/src/components/molecules/page-header.tsx +80 -0
- package/src/components/{ui → molecules}/pagination.tsx +14 -23
- package/src/components/{ui → molecules}/popover.tsx +4 -2
- package/src/components/molecules/radio-group.tsx +33 -0
- package/src/components/{ui → molecules}/scroll-area.tsx +8 -11
- package/src/components/{ui → molecules}/section.tsx +3 -3
- package/src/components/{ui → molecules}/select.tsx +22 -10
- package/src/components/molecules/settings.tsx +169 -0
- package/src/components/{ui → molecules}/table.tsx +16 -3
- package/src/components/molecules/tabs.tsx +70 -0
- package/src/components/molecules/theme-switcher.tsx +176 -0
- package/src/components/{ui → molecules}/toggle-group.tsx +1 -1
- package/src/components/organisms/alert-dialog.tsx +135 -0
- package/src/components/organisms/app-shell.tsx +822 -0
- package/src/components/{ui → organisms}/calendar.tsx +6 -7
- package/src/components/{ui → organisms}/carousel.tsx +9 -11
- package/src/components/{ui → organisms}/chart.tsx +9 -24
- package/src/components/{ui → organisms}/combobox.tsx +7 -7
- package/src/components/{ui → organisms}/command.tsx +3 -3
- package/src/components/{ui → organisms}/context-menu.tsx +23 -53
- package/src/components/{ui → organisms}/dialog.tsx +3 -3
- package/src/components/{ui → organisms}/dropdown-menu.tsx +8 -6
- package/src/components/organisms/index.ts +17 -0
- package/src/components/{ui → organisms}/menubar.tsx +3 -3
- package/src/components/organisms/navigation-menu.tsx +137 -0
- package/src/components/organisms/page-layout.tsx +95 -0
- package/src/components/{ui → organisms}/sheet.tsx +7 -7
- package/src/components/{ui → organisms}/sidebar.tsx +61 -86
- package/src/components/organisms/sonner.tsx +41 -0
- package/src/components/ui/index.ts +3 -61
- package/src/fonts/TWKLausanne/TWKLausanne-300-Italic.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-300-Italic.woff2 +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-300.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-300.woff2 +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-350-Italic.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-350-Italic.woff2 +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-350.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-350.woff2 +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-400-Italic.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-400-Italic.woff2 +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-400.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-400.woff2 +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-700-Italic.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-700-Italic.woff2 +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-700.woff +0 -0
- package/src/fonts/TWKLausanne/TWKLausanne-700.woff2 +0 -0
- package/src/styles/globals.css +167 -23
- package/src/components/ui/alert-dialog.tsx +0 -161
- package/src/components/ui/badge.tsx +0 -48
- package/src/components/ui/empty.tsx +0 -94
- package/src/components/ui/input-otp.tsx +0 -84
- package/src/components/ui/kbd.tsx +0 -26
- package/src/components/ui/navigation-menu.tsx +0 -147
- package/src/components/ui/page-header.tsx +0 -51
- package/src/components/ui/page-layout.tsx +0 -65
- package/src/components/ui/radio-group.tsx +0 -37
- package/src/components/ui/sonner.tsx +0 -43
- package/src/components/ui/stack.tsx +0 -72
- package/src/components/ui/tabs.tsx +0 -69
- /package/src/components/{ui → atoms}/aspect-ratio.tsx +0 -0
- /package/src/components/{ui → atoms}/avatar.tsx +0 -0
- /package/src/components/{ui → atoms}/container.tsx +0 -0
- /package/src/components/{ui → atoms}/input.tsx +0 -0
- /package/src/components/{ui → atoms}/label.tsx +0 -0
- /package/src/components/{ui → atoms}/progress.tsx +0 -0
- /package/src/components/{ui → atoms}/separator.tsx +0 -0
- /package/src/components/{ui → atoms}/skeleton.tsx +0 -0
- /package/src/components/{ui → molecules}/button-group.tsx +0 -0
- /package/src/components/{ui → molecules}/collapsible.tsx +0 -0
- /package/src/components/{ui → molecules}/grid.tsx +0 -0
- /package/src/components/{ui → molecules}/resizable.tsx +0 -0
- /package/src/components/{ui → molecules}/tooltip.tsx +0 -0
- /package/src/components/{ui → organisms}/drawer.tsx +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { NavigationMenu as NavigationMenuPrimitive } from '@base-ui/react/navigation-menu';
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
import { ChevronDownIcon } from 'lucide-react';
|
|
5
|
-
import { cn } from '../../../lib/utils';
|
|
6
|
-
|
|
7
|
-
function NavigationMenu({ className, children, ...props }: NavigationMenuPrimitive.Root.Props) {
|
|
8
|
-
return (
|
|
9
|
-
<NavigationMenuPrimitive.Root
|
|
10
|
-
data-slot="navigation-menu"
|
|
11
|
-
className={cn(
|
|
12
|
-
'max-w-max group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',
|
|
13
|
-
className,
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
>
|
|
17
|
-
{children}
|
|
18
|
-
<NavigationMenuPositioner />
|
|
19
|
-
</NavigationMenuPrimitive.Root>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function NavigationMenuList({ className, ...props }: NavigationMenuPrimitive.List.Props) {
|
|
24
|
-
return (
|
|
25
|
-
<NavigationMenuPrimitive.List
|
|
26
|
-
data-slot="navigation-menu-list"
|
|
27
|
-
className={cn('gap-0 group flex flex-1 list-none items-center justify-center', className)}
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function NavigationMenuItem({ className, ...props }: NavigationMenuPrimitive.Item.Props) {
|
|
34
|
-
return (
|
|
35
|
-
<NavigationMenuPrimitive.Item
|
|
36
|
-
data-slot="navigation-menu-item"
|
|
37
|
-
className={cn('relative', className)}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const navigationMenuTriggerStyle = cva(
|
|
44
|
-
'bg-background hover:bg-muted focus:bg-muted data-open:hover:bg-muted data-open:focus:bg-muted data-open:bg-muted/50 focus-visible:ring-ring/50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted rounded-md px-4 py-2 text-sm font-medium transition-all focus-visible:ring-[3px] focus-visible:outline-1 disabled:opacity-50 group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center disabled:pointer-events-none outline-none',
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
function NavigationMenuTrigger({
|
|
48
|
-
className,
|
|
49
|
-
children,
|
|
50
|
-
...props
|
|
51
|
-
}: NavigationMenuPrimitive.Trigger.Props) {
|
|
52
|
-
return (
|
|
53
|
-
<NavigationMenuPrimitive.Trigger
|
|
54
|
-
data-slot="navigation-menu-trigger"
|
|
55
|
-
className={cn(navigationMenuTriggerStyle(), 'group', className)}
|
|
56
|
-
{...props}
|
|
57
|
-
>
|
|
58
|
-
{children}{' '}
|
|
59
|
-
<ChevronDownIcon
|
|
60
|
-
className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-open/navigation-menu-trigger:rotate-180 group-data-popup-open/navigation-menu-trigger:rotate-180"
|
|
61
|
-
aria-hidden="true"
|
|
62
|
-
/>
|
|
63
|
-
</NavigationMenuPrimitive.Trigger>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function NavigationMenuContent({ className, ...props }: NavigationMenuPrimitive.Content.Props) {
|
|
68
|
-
return (
|
|
69
|
-
<NavigationMenuPrimitive.Content
|
|
70
|
-
data-slot="navigation-menu-content"
|
|
71
|
-
className={cn(
|
|
72
|
-
'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:ring-foreground/10 p-2 pr-2.5 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:duration-300 h-full w-auto **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none',
|
|
73
|
-
className,
|
|
74
|
-
)}
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function NavigationMenuPositioner({
|
|
81
|
-
className,
|
|
82
|
-
side = 'bottom',
|
|
83
|
-
sideOffset = 8,
|
|
84
|
-
align = 'start',
|
|
85
|
-
alignOffset = 0,
|
|
86
|
-
...props
|
|
87
|
-
}: NavigationMenuPrimitive.Positioner.Props) {
|
|
88
|
-
return (
|
|
89
|
-
<NavigationMenuPrimitive.Portal>
|
|
90
|
-
<NavigationMenuPrimitive.Positioner
|
|
91
|
-
side={side}
|
|
92
|
-
sideOffset={sideOffset}
|
|
93
|
-
align={align}
|
|
94
|
-
alignOffset={alignOffset}
|
|
95
|
-
className={cn(
|
|
96
|
-
'transition-[top,left,right,bottom] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0 isolate z-50 h-[var(--positioner-height)] w-[var(--positioner-width)] max-w-[var(--available-width)] data-[instant]:transition-none',
|
|
97
|
-
className,
|
|
98
|
-
)}
|
|
99
|
-
{...props}
|
|
100
|
-
>
|
|
101
|
-
<NavigationMenuPrimitive.Popup className="bg-popover text-popover-foreground ring-foreground/10 rounded-lg shadow ring-1 transition-all ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin)">
|
|
102
|
-
<NavigationMenuPrimitive.Viewport className="relative size-full overflow-hidden" />
|
|
103
|
-
</NavigationMenuPrimitive.Popup>
|
|
104
|
-
</NavigationMenuPrimitive.Positioner>
|
|
105
|
-
</NavigationMenuPrimitive.Portal>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function NavigationMenuLink({ className, ...props }: NavigationMenuPrimitive.Link.Props) {
|
|
110
|
-
return (
|
|
111
|
-
<NavigationMenuPrimitive.Link
|
|
112
|
-
data-slot="navigation-menu-link"
|
|
113
|
-
className={cn(
|
|
114
|
-
"data-[active=true]:focus:bg-muted data-[active=true]:hover:bg-muted data-[active=true]:bg-muted/50 focus-visible:ring-ring/50 hover:bg-muted focus:bg-muted flex items-center gap-1.5 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
115
|
-
className,
|
|
116
|
-
)}
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function NavigationMenuIndicator({ className, ...props }: NavigationMenuPrimitive.Icon.Props) {
|
|
123
|
-
return (
|
|
124
|
-
<NavigationMenuPrimitive.Icon
|
|
125
|
-
data-slot="navigation-menu-indicator"
|
|
126
|
-
className={cn(
|
|
127
|
-
'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden',
|
|
128
|
-
className,
|
|
129
|
-
)}
|
|
130
|
-
{...props}
|
|
131
|
-
>
|
|
132
|
-
<div className="bg-border rounded-tl-sm shadow-md relative top-[60%] h-2 w-2 rotate-45" />
|
|
133
|
-
</NavigationMenuPrimitive.Icon>
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export {
|
|
138
|
-
NavigationMenu,
|
|
139
|
-
NavigationMenuContent,
|
|
140
|
-
NavigationMenuIndicator,
|
|
141
|
-
NavigationMenuItem,
|
|
142
|
-
NavigationMenuLink,
|
|
143
|
-
NavigationMenuList,
|
|
144
|
-
NavigationMenuPositioner,
|
|
145
|
-
NavigationMenuTrigger,
|
|
146
|
-
navigationMenuTriggerStyle,
|
|
147
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Heading } from './heading';
|
|
4
|
-
import { Stack } from './stack';
|
|
5
|
-
import { Text } from './text';
|
|
6
|
-
|
|
7
|
-
interface PageHeaderProps extends Omit<React.ComponentProps<'div'>, 'className'> {
|
|
8
|
-
title: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
/** Additional descriptive text below description */
|
|
11
|
-
meta?: string;
|
|
12
|
-
actions?: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function PageHeader({ title, description, meta, actions, children, ...props }: PageHeaderProps) {
|
|
16
|
-
return (
|
|
17
|
-
<div data-slot="page-header" className="flex items-center justify-between gap-4" {...props}>
|
|
18
|
-
<Stack gap="1">
|
|
19
|
-
<Heading level="1">{title}</Heading>
|
|
20
|
-
{description && (
|
|
21
|
-
<Text size="sm" variant="muted">
|
|
22
|
-
{description}
|
|
23
|
-
</Text>
|
|
24
|
-
)}
|
|
25
|
-
{meta && (
|
|
26
|
-
<Text size="xs" variant="muted">
|
|
27
|
-
{meta}
|
|
28
|
-
</Text>
|
|
29
|
-
)}
|
|
30
|
-
{children}
|
|
31
|
-
</Stack>
|
|
32
|
-
{actions && <div className="flex shrink-0 items-center gap-3">{actions}</div>}
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function PageHeaderTitle({ ...props }: Omit<React.ComponentProps<typeof Heading>, 'className'>) {
|
|
38
|
-
return <Heading data-slot="page-header-title" level="1" {...props} />;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function PageHeaderDescription({ ...props }: Omit<React.ComponentProps<typeof Text>, 'className'>) {
|
|
42
|
-
return <Text data-slot="page-header-description" size="sm" variant="muted" {...props} />;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function PageHeaderActions({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
|
|
46
|
-
return (
|
|
47
|
-
<div data-slot="page-header-actions" className="flex shrink-0 items-center gap-3" {...props} />
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { PageHeader, PageHeaderActions, PageHeaderDescription, PageHeaderTitle };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
const pageLayoutVariants = cva('min-h-dvh bg-background text-foreground', {
|
|
5
|
-
variants: {
|
|
6
|
-
variant: {
|
|
7
|
-
default: 'flex flex-col',
|
|
8
|
-
center: 'flex items-center justify-center',
|
|
9
|
-
},
|
|
10
|
-
contentWidth: {
|
|
11
|
-
auto: '',
|
|
12
|
-
sm: 'w-full max-w-sm',
|
|
13
|
-
md: 'w-full max-w-md',
|
|
14
|
-
lg: 'w-full max-w-lg',
|
|
15
|
-
xl: 'w-full max-w-xl',
|
|
16
|
-
'2xl': 'w-full max-w-2xl',
|
|
17
|
-
'3xl': 'w-full max-w-3xl',
|
|
18
|
-
full: 'w-full max-w-full',
|
|
19
|
-
},
|
|
20
|
-
padding: {
|
|
21
|
-
none: '',
|
|
22
|
-
sm: 'px-4 py-6',
|
|
23
|
-
default: 'px-4 py-10 sm:px-6 lg:px-8',
|
|
24
|
-
lg: 'px-6 py-12 sm:px-8 lg:px-12',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
defaultVariants: {
|
|
28
|
-
variant: 'default',
|
|
29
|
-
contentWidth: 'auto',
|
|
30
|
-
padding: 'default',
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
interface PageLayoutProps
|
|
35
|
-
extends
|
|
36
|
-
Omit<React.ComponentProps<'div'>, 'className' | 'children'>,
|
|
37
|
-
VariantProps<typeof pageLayoutVariants> {
|
|
38
|
-
children?: React.ReactNode;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function PageLayout({ variant, padding, contentWidth, children, ...props }: PageLayoutProps) {
|
|
42
|
-
const resolvedContentWidth = contentWidth ?? (variant === 'center' ? 'lg' : 'auto');
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div
|
|
46
|
-
data-slot="page-layout"
|
|
47
|
-
data-variant={variant}
|
|
48
|
-
className={pageLayoutVariants({ variant, padding })}
|
|
49
|
-
{...props}
|
|
50
|
-
>
|
|
51
|
-
{resolvedContentWidth !== 'auto' ? (
|
|
52
|
-
<div
|
|
53
|
-
data-slot="page-layout-content"
|
|
54
|
-
className={pageLayoutVariants({ contentWidth: resolvedContentWidth })}
|
|
55
|
-
>
|
|
56
|
-
{children}
|
|
57
|
-
</div>
|
|
58
|
-
) : (
|
|
59
|
-
children
|
|
60
|
-
)}
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { PageLayout, pageLayoutVariants };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
2
|
-
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
3
|
-
|
|
4
|
-
import { CircleIcon } from 'lucide-react';
|
|
5
|
-
import { cn } from '../../../lib/utils';
|
|
6
|
-
|
|
7
|
-
function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
|
|
8
|
-
return (
|
|
9
|
-
<RadioGroupPrimitive
|
|
10
|
-
data-slot="radio-group"
|
|
11
|
-
className={cn('grid gap-2 w-full', className)}
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
|
|
18
|
-
return (
|
|
19
|
-
<RadioPrimitive.Root
|
|
20
|
-
data-slot="radio-group-item"
|
|
21
|
-
className={cn(
|
|
22
|
-
'border-input text-primary dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 flex size-4 rounded-full shadow-xs focus-visible:ring-[3px] aria-invalid:ring-[3px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
>
|
|
27
|
-
<RadioPrimitive.Indicator
|
|
28
|
-
data-slot="radio-group-indicator"
|
|
29
|
-
className="group-aria-invalid/radio-group-item:text-destructive text-primary flex size-4 items-center justify-center"
|
|
30
|
-
>
|
|
31
|
-
<CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current" />
|
|
32
|
-
</RadioPrimitive.Indicator>
|
|
33
|
-
</RadioPrimitive.Root>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CircleCheckIcon,
|
|
3
|
-
InfoIcon,
|
|
4
|
-
Loader2Icon,
|
|
5
|
-
OctagonXIcon,
|
|
6
|
-
TriangleAlertIcon,
|
|
7
|
-
} from 'lucide-react';
|
|
8
|
-
import { useTheme } from 'next-themes';
|
|
9
|
-
import { Toaster as Sonner, type ToasterProps } from 'sonner';
|
|
10
|
-
|
|
11
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
12
|
-
const { theme = 'system' } = useTheme();
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Sonner
|
|
16
|
-
theme={theme as ToasterProps['theme']}
|
|
17
|
-
className="toaster group"
|
|
18
|
-
icons={{
|
|
19
|
-
success: <CircleCheckIcon className="size-4" />,
|
|
20
|
-
info: <InfoIcon className="size-4" />,
|
|
21
|
-
warning: <TriangleAlertIcon className="size-4" />,
|
|
22
|
-
error: <OctagonXIcon className="size-4" />,
|
|
23
|
-
loading: <Loader2Icon className="size-4 animate-spin" />,
|
|
24
|
-
}}
|
|
25
|
-
style={
|
|
26
|
-
{
|
|
27
|
-
'--normal-bg': 'var(--popover)',
|
|
28
|
-
'--normal-text': 'var(--popover-foreground)',
|
|
29
|
-
'--normal-border': 'var(--border)',
|
|
30
|
-
'--border-radius': 'var(--radius)',
|
|
31
|
-
} as React.CSSProperties
|
|
32
|
-
}
|
|
33
|
-
toastOptions={{
|
|
34
|
-
classNames: {
|
|
35
|
-
toast: 'cn-toast',
|
|
36
|
-
},
|
|
37
|
-
}}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { Toaster };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
const stackVariants = cva('flex', {
|
|
5
|
-
variants: {
|
|
6
|
-
direction: {
|
|
7
|
-
row: 'flex-row',
|
|
8
|
-
column: 'flex-col',
|
|
9
|
-
'row-reverse': 'flex-row-reverse',
|
|
10
|
-
'column-reverse': 'flex-col-reverse',
|
|
11
|
-
},
|
|
12
|
-
align: {
|
|
13
|
-
start: 'items-start',
|
|
14
|
-
center: 'items-center',
|
|
15
|
-
end: 'items-end',
|
|
16
|
-
stretch: 'items-stretch',
|
|
17
|
-
baseline: 'items-baseline',
|
|
18
|
-
},
|
|
19
|
-
textAlign: {
|
|
20
|
-
left: 'text-left',
|
|
21
|
-
center: 'text-center',
|
|
22
|
-
right: 'text-right',
|
|
23
|
-
},
|
|
24
|
-
justify: {
|
|
25
|
-
start: 'justify-start',
|
|
26
|
-
center: 'justify-center',
|
|
27
|
-
end: 'justify-end',
|
|
28
|
-
between: 'justify-between',
|
|
29
|
-
around: 'justify-around',
|
|
30
|
-
evenly: 'justify-evenly',
|
|
31
|
-
},
|
|
32
|
-
gap: {
|
|
33
|
-
'0': 'gap-0',
|
|
34
|
-
'0.5': 'gap-0.5',
|
|
35
|
-
'1': 'gap-1',
|
|
36
|
-
'1.5': 'gap-1.5',
|
|
37
|
-
'2': 'gap-2',
|
|
38
|
-
'2.5': 'gap-2.5',
|
|
39
|
-
'3': 'gap-3',
|
|
40
|
-
'4': 'gap-4',
|
|
41
|
-
'5': 'gap-5',
|
|
42
|
-
'6': 'gap-6',
|
|
43
|
-
'8': 'gap-8',
|
|
44
|
-
'10': 'gap-10',
|
|
45
|
-
'12': 'gap-12',
|
|
46
|
-
},
|
|
47
|
-
wrap: {
|
|
48
|
-
true: 'flex-wrap',
|
|
49
|
-
false: 'flex-nowrap',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
defaultVariants: {
|
|
53
|
-
direction: 'column',
|
|
54
|
-
gap: '0',
|
|
55
|
-
wrap: false,
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
interface StackProps
|
|
60
|
-
extends Omit<React.ComponentProps<'div'>, 'className'>, VariantProps<typeof stackVariants> {}
|
|
61
|
-
|
|
62
|
-
function Stack({ direction, align, justify, gap, wrap, textAlign, ...props }: StackProps) {
|
|
63
|
-
return (
|
|
64
|
-
<div
|
|
65
|
-
data-slot="stack"
|
|
66
|
-
className={stackVariants({ direction, align, justify, gap, wrap, textAlign })}
|
|
67
|
-
{...props}
|
|
68
|
-
/>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export { Stack, stackVariants };
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
4
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
5
|
-
|
|
6
|
-
function Tabs({
|
|
7
|
-
orientation = 'horizontal',
|
|
8
|
-
...props
|
|
9
|
-
}: Omit<TabsPrimitive.Root.Props, 'className'>) {
|
|
10
|
-
return (
|
|
11
|
-
<TabsPrimitive.Root
|
|
12
|
-
data-slot="tabs"
|
|
13
|
-
data-orientation={orientation}
|
|
14
|
-
className="gap-2 group/tabs flex data-[orientation=horizontal]:flex-col"
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const tabsListVariants = cva(
|
|
21
|
-
'rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col',
|
|
22
|
-
{
|
|
23
|
-
variants: {
|
|
24
|
-
variant: {
|
|
25
|
-
default: 'bg-muted',
|
|
26
|
-
line: 'gap-1 bg-transparent',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: 'default',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
function TabsList({
|
|
36
|
-
variant = 'default',
|
|
37
|
-
...props
|
|
38
|
-
}: Omit<TabsPrimitive.List.Props, 'className'> & VariantProps<typeof tabsListVariants>) {
|
|
39
|
-
return (
|
|
40
|
-
<TabsPrimitive.List
|
|
41
|
-
data-slot="tabs-list"
|
|
42
|
-
data-variant={variant}
|
|
43
|
-
className={tabsListVariants({ variant })}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function TabsTrigger({ ...props }: Omit<TabsPrimitive.Tab.Props, 'className'>) {
|
|
50
|
-
return (
|
|
51
|
-
<TabsPrimitive.Tab
|
|
52
|
-
data-slot="tabs-trigger"
|
|
53
|
-
className="gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100"
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function TabsContent({ ...props }: Omit<TabsPrimitive.Panel.Props, 'className'>) {
|
|
60
|
-
return (
|
|
61
|
-
<TabsPrimitive.Panel
|
|
62
|
-
data-slot="tabs-content"
|
|
63
|
-
className="text-sm flex-1 outline-none"
|
|
64
|
-
{...props}
|
|
65
|
-
/>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { Tabs, TabsContent, TabsList, tabsListVariants, TabsTrigger };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|