@trycompai/design-system 1.0.1 → 1.0.3
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 +11 -3
- package/src/components/atoms/badge.tsx +8 -7
- package/src/components/atoms/button.tsx +6 -1
- package/src/components/atoms/checkbox.tsx +3 -3
- package/src/components/atoms/heading.tsx +6 -6
- package/src/components/atoms/index.ts +2 -0
- package/src/components/atoms/logo.tsx +52 -0
- package/src/components/atoms/spinner.tsx +3 -3
- package/src/components/atoms/stack.tsx +97 -0
- package/src/components/atoms/switch.tsx +1 -1
- package/src/components/atoms/text.tsx +5 -1
- package/src/components/atoms/toggle.tsx +1 -1
- package/src/components/molecules/accordion.tsx +3 -3
- package/src/components/molecules/ai-chat.tsx +217 -0
- package/src/components/molecules/alert.tsx +5 -5
- package/src/components/molecules/breadcrumb.tsx +8 -7
- package/src/components/molecules/card.tsx +24 -5
- package/src/components/molecules/command-search.tsx +147 -0
- package/src/components/molecules/index.ts +4 -1
- package/src/components/molecules/input-otp.tsx +2 -2
- package/src/components/molecules/page-header.tsx +33 -4
- package/src/components/molecules/pagination.tsx +4 -4
- package/src/components/molecules/popover.tsx +4 -2
- package/src/components/molecules/radio-group.tsx +2 -2
- package/src/components/molecules/section.tsx +1 -1
- package/src/components/molecules/select.tsx +5 -5
- package/src/components/molecules/settings.tsx +169 -0
- package/src/components/molecules/table.tsx +5 -1
- package/src/components/molecules/tabs.tsx +5 -4
- package/src/components/molecules/theme-switcher.tsx +176 -0
- package/src/components/organisms/app-shell.tsx +822 -0
- package/src/components/organisms/calendar.tsx +4 -4
- package/src/components/organisms/carousel.tsx +3 -3
- package/src/components/organisms/combobox.tsx +5 -5
- package/src/components/organisms/command.tsx +3 -3
- package/src/components/organisms/context-menu.tsx +4 -4
- package/src/components/organisms/dialog.tsx +2 -2
- package/src/components/organisms/dropdown-menu.tsx +8 -6
- package/src/components/organisms/index.ts +1 -0
- package/src/components/organisms/menubar.tsx +3 -3
- package/src/components/organisms/navigation-menu.tsx +2 -2
- package/src/components/organisms/page-layout.tsx +50 -20
- package/src/components/organisms/sheet.tsx +2 -2
- package/src/components/organisms/sidebar.tsx +22 -6
- package/src/components/organisms/sonner.tsx +11 -11
- 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/icons.ts +2 -0
- package/src/index.ts +2 -2
- package/src/styles/globals.css +155 -23
- package/src/components/molecules/stack.tsx +0 -72
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type DayPickerProps,
|
|
9
9
|
} from 'react-day-picker';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from '@carbon/icons-react';
|
|
12
12
|
import { cn } from '../../../lib/utils';
|
|
13
13
|
import { Button, buttonVariants } from '../atoms/button';
|
|
14
14
|
|
|
@@ -129,14 +129,14 @@ function Calendar({
|
|
|
129
129
|
},
|
|
130
130
|
Chevron: ({ orientation, ...componentProps }) => {
|
|
131
131
|
if (orientation === 'left') {
|
|
132
|
-
return <
|
|
132
|
+
return <ChevronLeft className="size-4" {...componentProps} />;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
if (orientation === 'right') {
|
|
136
|
-
return <
|
|
136
|
+
return <ChevronRight className="size-4" {...componentProps} />;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
return <
|
|
139
|
+
return <ChevronDown className="size-4" {...componentProps} />;
|
|
140
140
|
},
|
|
141
141
|
DayButton: CalendarDayButton,
|
|
142
142
|
WeekNumber: ({ children, ...componentProps }) => {
|
|
@@ -2,7 +2,7 @@ import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-reac
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
5
|
-
import {
|
|
5
|
+
import { ChevronLeft, ChevronRight } from '@carbon/icons-react';
|
|
6
6
|
import { cn } from '../../../lib/utils';
|
|
7
7
|
import { buttonVariants } from '../atoms/button';
|
|
8
8
|
|
|
@@ -174,7 +174,7 @@ function CarouselPrevious({ ...props }: Omit<ButtonPrimitive.Props, 'className'>
|
|
|
174
174
|
onClick={scrollPrev}
|
|
175
175
|
{...props}
|
|
176
176
|
>
|
|
177
|
-
<
|
|
177
|
+
<ChevronLeft />
|
|
178
178
|
<span className="sr-only">Previous slide</span>
|
|
179
179
|
</ButtonPrimitive>
|
|
180
180
|
);
|
|
@@ -197,7 +197,7 @@ function CarouselNext({ ...props }: Omit<ButtonPrimitive.Props, 'className'>) {
|
|
|
197
197
|
onClick={scrollNext}
|
|
198
198
|
{...props}
|
|
199
199
|
>
|
|
200
|
-
<
|
|
200
|
+
<ChevronRight />
|
|
201
201
|
<span className="sr-only">Next slide</span>
|
|
202
202
|
</ButtonPrimitive>
|
|
203
203
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Combobox as ComboboxPrimitive } from '@base-ui/react';
|
|
4
|
-
import {
|
|
4
|
+
import { Checkmark, ChevronDown, Close } from '@carbon/icons-react';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Button } from '../atoms/button';
|
|
@@ -24,7 +24,7 @@ function ComboboxTrigger({
|
|
|
24
24
|
{...props}
|
|
25
25
|
>
|
|
26
26
|
{children}
|
|
27
|
-
<
|
|
27
|
+
<ChevronDown className="text-muted-foreground size-4 pointer-events-none" />
|
|
28
28
|
</ComboboxPrimitive.Trigger>
|
|
29
29
|
);
|
|
30
30
|
}
|
|
@@ -36,7 +36,7 @@ function ComboboxClear({ ...props }: Omit<ComboboxPrimitive.Clear.Props, 'classN
|
|
|
36
36
|
render={<InputGroupButton variant="ghost" size="icon-xs" />}
|
|
37
37
|
{...props}
|
|
38
38
|
>
|
|
39
|
-
<
|
|
39
|
+
<Close className="pointer-events-none" />
|
|
40
40
|
</ComboboxPrimitive.Clear>
|
|
41
41
|
);
|
|
42
42
|
}
|
|
@@ -127,7 +127,7 @@ function ComboboxItem({ children, ...props }: Omit<ComboboxPrimitive.Item.Props,
|
|
|
127
127
|
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
|
|
128
128
|
}
|
|
129
129
|
>
|
|
130
|
-
<
|
|
130
|
+
<Checkmark className="pointer-events-none" />
|
|
131
131
|
</ComboboxPrimitive.ItemIndicator>
|
|
132
132
|
</ComboboxPrimitive.Item>
|
|
133
133
|
);
|
|
@@ -206,7 +206,7 @@ function ComboboxChip({
|
|
|
206
206
|
className="-ml-1 opacity-50 hover:opacity-100"
|
|
207
207
|
data-slot="combobox-chip-remove"
|
|
208
208
|
>
|
|
209
|
-
<
|
|
209
|
+
<Close className="pointer-events-none" />
|
|
210
210
|
</ComboboxPrimitive.ChipRemove>
|
|
211
211
|
)}
|
|
212
212
|
</ComboboxPrimitive.Chip>
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
7
7
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
8
|
-
import {
|
|
8
|
+
import { Checkmark, Search } from '@carbon/icons-react';
|
|
9
9
|
|
|
10
10
|
const commandVariants = cva(
|
|
11
11
|
'bg-popover text-popover-foreground rounded-xl p-1 flex size-full flex-col overflow-hidden',
|
|
@@ -95,7 +95,7 @@ function CommandInput({
|
|
|
95
95
|
data-align="inline-end"
|
|
96
96
|
className="text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 pr-2 text-sm font-medium select-none"
|
|
97
97
|
>
|
|
98
|
-
<
|
|
98
|
+
<Search className="size-4 shrink-0 opacity-50" />
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
</div>
|
|
@@ -161,7 +161,7 @@ function CommandItem({
|
|
|
161
161
|
{...props}
|
|
162
162
|
>
|
|
163
163
|
{children}
|
|
164
|
-
<
|
|
164
|
+
<Checkmark className="ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
165
165
|
</CommandPrimitive.Item>
|
|
166
166
|
);
|
|
167
167
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Checkmark, ChevronRight } from '@carbon/icons-react';
|
|
4
4
|
|
|
5
5
|
function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
|
|
6
6
|
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
|
|
@@ -105,7 +105,7 @@ function ContextMenuSubTrigger({
|
|
|
105
105
|
{...props}
|
|
106
106
|
>
|
|
107
107
|
{children}
|
|
108
|
-
<
|
|
108
|
+
<ChevronRight className="ml-auto" />
|
|
109
109
|
</ContextMenuPrimitive.SubmenuTrigger>
|
|
110
110
|
);
|
|
111
111
|
}
|
|
@@ -134,7 +134,7 @@ function ContextMenuCheckboxItem({
|
|
|
134
134
|
>
|
|
135
135
|
<span className="absolute right-2 pointer-events-none">
|
|
136
136
|
<ContextMenuPrimitive.CheckboxItemIndicator>
|
|
137
|
-
<
|
|
137
|
+
<Checkmark />
|
|
138
138
|
</ContextMenuPrimitive.CheckboxItemIndicator>
|
|
139
139
|
</span>
|
|
140
140
|
{children}
|
|
@@ -158,7 +158,7 @@ function ContextMenuRadioItem({
|
|
|
158
158
|
>
|
|
159
159
|
<span className="absolute right-2 pointer-events-none">
|
|
160
160
|
<ContextMenuPrimitive.RadioItemIndicator>
|
|
161
|
-
<
|
|
161
|
+
<Checkmark />
|
|
162
162
|
</ContextMenuPrimitive.RadioItemIndicator>
|
|
163
163
|
</span>
|
|
164
164
|
{children}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { Close } from '@carbon/icons-react';
|
|
7
7
|
import { Button } from '../atoms/button';
|
|
8
8
|
|
|
9
9
|
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
@@ -54,7 +54,7 @@ function DialogContent({
|
|
|
54
54
|
render={<Button variant="ghost" size="icon-sm" />}
|
|
55
55
|
className="absolute top-2 right-2"
|
|
56
56
|
>
|
|
57
|
-
<
|
|
57
|
+
<Close />
|
|
58
58
|
<span className="sr-only">Close</span>
|
|
59
59
|
</DialogPrimitive.Close>
|
|
60
60
|
)}
|
|
@@ -2,7 +2,8 @@ import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Checkmark, ChevronRight } from '@carbon/icons-react';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
6
7
|
|
|
7
8
|
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
8
9
|
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
@@ -29,13 +30,14 @@ const dropdownMenuTriggerVariants = cva('', {
|
|
|
29
30
|
|
|
30
31
|
function DropdownMenuTrigger({
|
|
31
32
|
variant = 'default',
|
|
33
|
+
className,
|
|
32
34
|
...props
|
|
33
|
-
}:
|
|
35
|
+
}: MenuPrimitive.Trigger.Props &
|
|
34
36
|
VariantProps<typeof dropdownMenuTriggerVariants>) {
|
|
35
37
|
return (
|
|
36
38
|
<MenuPrimitive.Trigger
|
|
37
39
|
data-slot="dropdown-menu-trigger"
|
|
38
|
-
className={dropdownMenuTriggerVariants({ variant })}
|
|
40
|
+
className={cn(dropdownMenuTriggerVariants({ variant }), className)}
|
|
39
41
|
{...props}
|
|
40
42
|
/>
|
|
41
43
|
);
|
|
@@ -126,7 +128,7 @@ function DropdownMenuSubTrigger({
|
|
|
126
128
|
{...props}
|
|
127
129
|
>
|
|
128
130
|
{children}
|
|
129
|
-
<
|
|
131
|
+
<ChevronRight className="ml-auto" />
|
|
130
132
|
</MenuPrimitive.SubmenuTrigger>
|
|
131
133
|
);
|
|
132
134
|
}
|
|
@@ -167,7 +169,7 @@ function DropdownMenuCheckboxItem({
|
|
|
167
169
|
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
168
170
|
>
|
|
169
171
|
<MenuPrimitive.CheckboxItemIndicator>
|
|
170
|
-
<
|
|
172
|
+
<Checkmark className="size-4" />
|
|
171
173
|
</MenuPrimitive.CheckboxItemIndicator>
|
|
172
174
|
</span>
|
|
173
175
|
{children}
|
|
@@ -194,7 +196,7 @@ function DropdownMenuRadioItem({
|
|
|
194
196
|
data-slot="dropdown-menu-radio-item-indicator"
|
|
195
197
|
>
|
|
196
198
|
<MenuPrimitive.RadioItemIndicator>
|
|
197
|
-
<
|
|
199
|
+
<Checkmark className="size-4" />
|
|
198
200
|
</MenuPrimitive.RadioItemIndicator>
|
|
199
201
|
</span>
|
|
200
202
|
{children}
|
|
@@ -2,7 +2,7 @@ import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
|
2
2
|
import { Menubar as MenubarPrimitive } from '@base-ui/react/menubar';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Checkmark } from '@carbon/icons-react';
|
|
6
6
|
import {
|
|
7
7
|
DropdownMenu,
|
|
8
8
|
DropdownMenuContent,
|
|
@@ -84,7 +84,7 @@ function MenubarCheckboxItem({
|
|
|
84
84
|
>
|
|
85
85
|
<span className="left-2 size-4 [&_svg:not([class*='size-'])]:size-4 pointer-events-none absolute flex items-center justify-center">
|
|
86
86
|
<MenuPrimitive.CheckboxItemIndicator>
|
|
87
|
-
<
|
|
87
|
+
<Checkmark />
|
|
88
88
|
</MenuPrimitive.CheckboxItemIndicator>
|
|
89
89
|
</span>
|
|
90
90
|
{children}
|
|
@@ -108,7 +108,7 @@ function MenubarRadioItem({
|
|
|
108
108
|
>
|
|
109
109
|
<span className="left-2 size-4 [&_svg:not([class*='size-'])]:size-4 pointer-events-none absolute flex items-center justify-center">
|
|
110
110
|
<MenuPrimitive.RadioItemIndicator>
|
|
111
|
-
<
|
|
111
|
+
<Checkmark />
|
|
112
112
|
</MenuPrimitive.RadioItemIndicator>
|
|
113
113
|
</span>
|
|
114
114
|
{children}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NavigationMenu as NavigationMenuPrimitive } from '@base-ui/react/navigation-menu';
|
|
2
2
|
import { cva } from 'class-variance-authority';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ChevronDown } from '@carbon/icons-react';
|
|
5
5
|
import { cn } from '../../../lib/utils';
|
|
6
6
|
|
|
7
7
|
function NavigationMenu({
|
|
@@ -55,7 +55,7 @@ function NavigationMenuTrigger({
|
|
|
55
55
|
{...props}
|
|
56
56
|
>
|
|
57
57
|
{children}{' '}
|
|
58
|
-
<
|
|
58
|
+
<ChevronDown
|
|
59
59
|
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"
|
|
60
60
|
aria-hidden="true"
|
|
61
61
|
/>
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
+
import { cn } from '../../../lib/utils';
|
|
5
|
+
import { Stack } from '../atoms/stack';
|
|
6
|
+
|
|
4
7
|
const pageLayoutVariants = cva('min-h-dvh bg-background text-foreground', {
|
|
5
8
|
variants: {
|
|
6
9
|
variant: {
|
|
7
10
|
default: 'flex flex-col',
|
|
8
11
|
center: 'flex items-center justify-center',
|
|
9
12
|
},
|
|
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
13
|
padding: {
|
|
21
14
|
none: '',
|
|
22
15
|
sm: 'px-4 py-6',
|
|
@@ -26,20 +19,54 @@ const pageLayoutVariants = cva('min-h-dvh bg-background text-foreground', {
|
|
|
26
19
|
},
|
|
27
20
|
defaultVariants: {
|
|
28
21
|
variant: 'default',
|
|
29
|
-
contentWidth: 'auto',
|
|
30
22
|
padding: 'default',
|
|
31
23
|
},
|
|
32
24
|
});
|
|
33
25
|
|
|
26
|
+
const containerVariants = cva('mx-auto w-full', {
|
|
27
|
+
variants: {
|
|
28
|
+
maxWidth: {
|
|
29
|
+
sm: 'max-w-screen-sm', // 640px
|
|
30
|
+
md: 'max-w-screen-md', // 768px
|
|
31
|
+
lg: 'max-w-screen-lg', // 1024px
|
|
32
|
+
xl: 'max-w-[1200px]',
|
|
33
|
+
'2xl': 'max-w-[1400px]',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
maxWidth: 'xl',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
34
41
|
interface PageLayoutProps
|
|
35
|
-
extends
|
|
36
|
-
Omit<React.ComponentProps<'div'>, 'className' | 'children'>,
|
|
42
|
+
extends Omit<React.ComponentProps<'div'>, 'className' | 'children'>,
|
|
37
43
|
VariantProps<typeof pageLayoutVariants> {
|
|
38
44
|
children?: React.ReactNode;
|
|
45
|
+
/** Whether to wrap content in a centered container. Defaults to true. */
|
|
46
|
+
container?: boolean;
|
|
47
|
+
/** Max width of the container. Only applies when container is true. */
|
|
48
|
+
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
49
|
+
/** Vertical gap between children. Defaults to 'lg' (gap-6). */
|
|
50
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '0' | '1' | '2' | '3' | '4' | '6' | '8';
|
|
39
51
|
}
|
|
40
52
|
|
|
41
|
-
function PageLayout({
|
|
42
|
-
|
|
53
|
+
function PageLayout({
|
|
54
|
+
variant,
|
|
55
|
+
padding,
|
|
56
|
+
container = true,
|
|
57
|
+
maxWidth,
|
|
58
|
+
gap = 'lg',
|
|
59
|
+
children,
|
|
60
|
+
...props
|
|
61
|
+
}: PageLayoutProps) {
|
|
62
|
+
// For center variant, default to smaller max-width (sm) for auth-style pages
|
|
63
|
+
const resolvedMaxWidth = maxWidth ?? (variant === 'center' ? 'sm' : 'lg');
|
|
64
|
+
|
|
65
|
+
const content = (
|
|
66
|
+
<Stack gap={gap}>
|
|
67
|
+
{children}
|
|
68
|
+
</Stack>
|
|
69
|
+
);
|
|
43
70
|
|
|
44
71
|
return (
|
|
45
72
|
<div
|
|
@@ -48,15 +75,18 @@ function PageLayout({ variant, padding, contentWidth, children, ...props }: Page
|
|
|
48
75
|
className={pageLayoutVariants({ variant, padding })}
|
|
49
76
|
{...props}
|
|
50
77
|
>
|
|
51
|
-
{
|
|
78
|
+
{container ? (
|
|
52
79
|
<div
|
|
53
|
-
data-slot="page-layout-
|
|
54
|
-
className={
|
|
80
|
+
data-slot="page-layout-container"
|
|
81
|
+
className={cn(
|
|
82
|
+
containerVariants({ maxWidth: resolvedMaxWidth }),
|
|
83
|
+
variant === 'center' && 'flex items-center justify-center'
|
|
84
|
+
)}
|
|
55
85
|
>
|
|
56
|
-
{
|
|
86
|
+
{content}
|
|
57
87
|
</div>
|
|
58
88
|
) : (
|
|
59
|
-
|
|
89
|
+
content
|
|
60
90
|
)}
|
|
61
91
|
</div>
|
|
62
92
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Close } from '@carbon/icons-react';
|
|
5
5
|
import { Button } from '../atoms/button';
|
|
6
6
|
|
|
7
7
|
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
|
@@ -55,7 +55,7 @@ function SheetContent({
|
|
|
55
55
|
render={<Button variant="ghost" size="icon-sm" />}
|
|
56
56
|
className="absolute top-4 right-4"
|
|
57
57
|
>
|
|
58
|
-
<
|
|
58
|
+
<Close className="size-4" />
|
|
59
59
|
<span className="sr-only">Close</span>
|
|
60
60
|
</SheetPrimitive.Close>
|
|
61
61
|
)}
|
|
@@ -7,7 +7,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
7
7
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { SidePanelOpen } from '@carbon/icons-react';
|
|
11
11
|
import { useIsMobile } from '../../../hooks/use-mobile';
|
|
12
12
|
import { cn } from '../../../lib/utils';
|
|
13
13
|
import { buttonVariants } from '../atoms/button';
|
|
@@ -203,7 +203,7 @@ function Sidebar({
|
|
|
203
203
|
|
|
204
204
|
return (
|
|
205
205
|
<div
|
|
206
|
-
className="group peer text-sidebar-foreground hidden md:block"
|
|
206
|
+
className="group peer text-sidebar-foreground hidden w-fit md:block"
|
|
207
207
|
data-state={state}
|
|
208
208
|
data-collapsible={state === 'collapsed' ? collapsible : ''}
|
|
209
209
|
data-variant={variant}
|
|
@@ -262,7 +262,7 @@ function SidebarTrigger({ onClick, ...props }: Omit<ButtonPrimitive.Props, 'clas
|
|
|
262
262
|
}}
|
|
263
263
|
{...props}
|
|
264
264
|
>
|
|
265
|
-
<
|
|
265
|
+
<SidePanelOpen />
|
|
266
266
|
<span className="sr-only">Toggle Sidebar</span>
|
|
267
267
|
</ButtonPrimitive>
|
|
268
268
|
);
|
|
@@ -350,12 +350,27 @@ function SidebarContent({ ...props }: Omit<React.ComponentProps<'div'>, 'classNa
|
|
|
350
350
|
);
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
|
|
353
|
+
const sidebarGroupVariants = cva('relative flex w-full min-w-0 flex-col', {
|
|
354
|
+
variants: {
|
|
355
|
+
padding: {
|
|
356
|
+
default: 'p-2',
|
|
357
|
+
none: 'p-0',
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
defaultVariants: {
|
|
361
|
+
padding: 'default',
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
function SidebarGroup({
|
|
366
|
+
padding = 'default',
|
|
367
|
+
...props
|
|
368
|
+
}: Omit<React.ComponentProps<'div'>, 'className'> & VariantProps<typeof sidebarGroupVariants>) {
|
|
354
369
|
return (
|
|
355
370
|
<div
|
|
356
371
|
data-slot="sidebar-group"
|
|
357
372
|
data-sidebar="group"
|
|
358
|
-
className=
|
|
373
|
+
className={sidebarGroupVariants({ padding })}
|
|
359
374
|
{...props}
|
|
360
375
|
/>
|
|
361
376
|
);
|
|
@@ -544,7 +559,7 @@ function SidebarMenuBadge({ ...props }: Omit<React.ComponentProps<'div'>, 'class
|
|
|
544
559
|
<div
|
|
545
560
|
data-slot="sidebar-menu-badge"
|
|
546
561
|
data-sidebar="menu-badge"
|
|
547
|
-
className="text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1
|
|
562
|
+
className="text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden"
|
|
548
563
|
{...props}
|
|
549
564
|
/>
|
|
550
565
|
);
|
|
@@ -643,6 +658,7 @@ export {
|
|
|
643
658
|
SidebarContent,
|
|
644
659
|
SidebarFooter,
|
|
645
660
|
SidebarGroup,
|
|
661
|
+
sidebarGroupVariants,
|
|
646
662
|
SidebarGroupAction,
|
|
647
663
|
SidebarGroupContent,
|
|
648
664
|
SidebarGroupLabel,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '
|
|
2
|
+
CheckmarkFilled,
|
|
3
|
+
Information,
|
|
4
|
+
Misuse,
|
|
5
|
+
Renew,
|
|
6
|
+
Warning,
|
|
7
|
+
} from '@carbon/icons-react';
|
|
8
8
|
import { Toaster as Sonner, type ToasterProps } from 'sonner';
|
|
9
9
|
|
|
10
10
|
const Toaster = ({ theme = 'system', ...props }: ToasterProps) => {
|
|
@@ -13,11 +13,11 @@ const Toaster = ({ theme = 'system', ...props }: ToasterProps) => {
|
|
|
13
13
|
theme={theme}
|
|
14
14
|
className="toaster group"
|
|
15
15
|
icons={{
|
|
16
|
-
success: <
|
|
17
|
-
info: <
|
|
18
|
-
warning: <
|
|
19
|
-
error: <
|
|
20
|
-
loading: <
|
|
16
|
+
success: <CheckmarkFilled className="size-4 text-success" />,
|
|
17
|
+
info: <Information className="size-4 text-info" />,
|
|
18
|
+
warning: <Warning className="size-4 text-warning" />,
|
|
19
|
+
error: <Misuse className="size-4 text-destructive" />,
|
|
20
|
+
loading: <Renew className="size-4 animate-spin" />,
|
|
21
21
|
}}
|
|
22
22
|
style={
|
|
23
23
|
{
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/icons.ts
ADDED
package/src/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { cn } from
|
|
1
|
+
export { cn } from "../lib/utils";
|
|
2
2
|
|
|
3
|
-
export * from
|
|
3
|
+
export * from "./components/ui";
|