@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
|
@@ -8,9 +8,9 @@ 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
|
-
import { Button, buttonVariants } from '
|
|
13
|
+
import { Button, buttonVariants } from '../atoms/button';
|
|
14
14
|
|
|
15
15
|
type CalendarButtonVariant = 'default' | 'outline' | 'secondary' | 'ghost' | 'destructive' | 'link';
|
|
16
16
|
|
|
@@ -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 }) => {
|
|
@@ -158,9 +158,8 @@ function Calendar({
|
|
|
158
158
|
function CalendarDayButton({
|
|
159
159
|
day,
|
|
160
160
|
modifiers,
|
|
161
|
-
className: _className,
|
|
162
161
|
...props
|
|
163
|
-
}: React.ComponentProps<typeof DayButton>) {
|
|
162
|
+
}: Omit<React.ComponentProps<typeof DayButton>, 'className'>) {
|
|
164
163
|
const ref = React.useRef<HTMLButtonElement>(null);
|
|
165
164
|
React.useEffect(() => {
|
|
166
165
|
if (modifiers.focused) ref.current?.focus();
|
|
@@ -2,9 +2,9 @@ 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
|
-
import { buttonVariants } from '
|
|
7
|
+
import { buttonVariants } from '../atoms/button';
|
|
8
8
|
|
|
9
9
|
type CarouselApi = UseEmblaCarouselType[1];
|
|
10
10
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
@@ -44,10 +44,9 @@ function Carousel({
|
|
|
44
44
|
opts,
|
|
45
45
|
setApi,
|
|
46
46
|
plugins,
|
|
47
|
-
className,
|
|
48
47
|
children,
|
|
49
48
|
...props
|
|
50
|
-
}: React.ComponentProps<'div'> & CarouselProps) {
|
|
49
|
+
}: Omit<React.ComponentProps<'div'>, 'className'> & CarouselProps) {
|
|
51
50
|
const [carouselRef, api] = useEmblaCarousel(
|
|
52
51
|
{
|
|
53
52
|
...opts,
|
|
@@ -116,7 +115,7 @@ function Carousel({
|
|
|
116
115
|
>
|
|
117
116
|
<div
|
|
118
117
|
onKeyDownCapture={handleKeyDown}
|
|
119
|
-
className=
|
|
118
|
+
className="relative"
|
|
120
119
|
role="region"
|
|
121
120
|
aria-roledescription="carousel"
|
|
122
121
|
data-slot="carousel"
|
|
@@ -128,20 +127,20 @@ function Carousel({
|
|
|
128
127
|
);
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
function CarouselContent({
|
|
130
|
+
function CarouselContent({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
|
|
132
131
|
const { carouselRef, orientation } = useCarousel();
|
|
133
132
|
|
|
134
133
|
return (
|
|
135
134
|
<div ref={carouselRef} className="overflow-hidden" data-slot="carousel-content">
|
|
136
135
|
<div
|
|
137
|
-
className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col'
|
|
136
|
+
className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col')}
|
|
138
137
|
{...props}
|
|
139
138
|
/>
|
|
140
139
|
</div>
|
|
141
140
|
);
|
|
142
141
|
}
|
|
143
142
|
|
|
144
|
-
function CarouselItem({
|
|
143
|
+
function CarouselItem({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
|
|
145
144
|
const { orientation } = useCarousel();
|
|
146
145
|
|
|
147
146
|
return (
|
|
@@ -152,7 +151,6 @@ function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
152
151
|
className={cn(
|
|
153
152
|
'min-w-0 shrink-0 grow-0 basis-full',
|
|
154
153
|
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
155
|
-
className,
|
|
156
154
|
)}
|
|
157
155
|
{...props}
|
|
158
156
|
/>
|
|
@@ -176,7 +174,7 @@ function CarouselPrevious({ ...props }: Omit<ButtonPrimitive.Props, 'className'>
|
|
|
176
174
|
onClick={scrollPrev}
|
|
177
175
|
{...props}
|
|
178
176
|
>
|
|
179
|
-
<
|
|
177
|
+
<ChevronLeft />
|
|
180
178
|
<span className="sr-only">Previous slide</span>
|
|
181
179
|
</ButtonPrimitive>
|
|
182
180
|
);
|
|
@@ -199,7 +197,7 @@ function CarouselNext({ ...props }: Omit<ButtonPrimitive.Props, 'className'>) {
|
|
|
199
197
|
onClick={scrollNext}
|
|
200
198
|
{...props}
|
|
201
199
|
>
|
|
202
|
-
<
|
|
200
|
+
<ChevronRight />
|
|
203
201
|
<span className="sr-only">Next slide</span>
|
|
204
202
|
</ButtonPrimitive>
|
|
205
203
|
);
|
|
@@ -36,11 +36,10 @@ function useChart() {
|
|
|
36
36
|
|
|
37
37
|
function ChartContainer({
|
|
38
38
|
id,
|
|
39
|
-
className,
|
|
40
39
|
children,
|
|
41
40
|
config,
|
|
42
41
|
...props
|
|
43
|
-
}: React.ComponentProps<'div'> & {
|
|
42
|
+
}: Omit<React.ComponentProps<'div'>, 'className'> & {
|
|
44
43
|
config: ChartConfig;
|
|
45
44
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
46
45
|
}) {
|
|
@@ -52,10 +51,7 @@ function ChartContainer({
|
|
|
52
51
|
<div
|
|
53
52
|
data-slot="chart"
|
|
54
53
|
data-chart={chartId}
|
|
55
|
-
className=
|
|
56
|
-
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
57
|
-
className,
|
|
58
|
-
)}
|
|
54
|
+
className="[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden"
|
|
59
55
|
{...props}
|
|
60
56
|
>
|
|
61
57
|
<ChartStyle id={chartId} config={config} />
|
|
@@ -99,19 +95,17 @@ const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
|
99
95
|
function ChartTooltipContent({
|
|
100
96
|
active,
|
|
101
97
|
payload,
|
|
102
|
-
className,
|
|
103
98
|
indicator = 'dot',
|
|
104
99
|
hideLabel = false,
|
|
105
100
|
hideIndicator = false,
|
|
106
101
|
label,
|
|
107
102
|
labelFormatter,
|
|
108
|
-
labelClassName,
|
|
109
103
|
formatter,
|
|
110
104
|
color,
|
|
111
105
|
nameKey,
|
|
112
106
|
labelKey,
|
|
113
|
-
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
|
114
|
-
React.ComponentProps<'div'> & {
|
|
107
|
+
}: Omit<React.ComponentProps<typeof RechartsPrimitive.Tooltip>, 'className'> &
|
|
108
|
+
Omit<React.ComponentProps<'div'>, 'className'> & {
|
|
115
109
|
hideLabel?: boolean;
|
|
116
110
|
hideIndicator?: boolean;
|
|
117
111
|
indicator?: 'line' | 'dot' | 'dashed';
|
|
@@ -134,17 +128,15 @@ function ChartTooltipContent({
|
|
|
134
128
|
: itemConfig?.label;
|
|
135
129
|
|
|
136
130
|
if (labelFormatter) {
|
|
137
|
-
return (
|
|
138
|
-
<div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
|
|
139
|
-
);
|
|
131
|
+
return <div className="font-medium">{labelFormatter(value, payload)}</div>;
|
|
140
132
|
}
|
|
141
133
|
|
|
142
134
|
if (!value) {
|
|
143
135
|
return null;
|
|
144
136
|
}
|
|
145
137
|
|
|
146
|
-
return <div className=
|
|
147
|
-
}, [label, labelFormatter, payload, hideLabel,
|
|
138
|
+
return <div className="font-medium">{value}</div>;
|
|
139
|
+
}, [label, labelFormatter, payload, hideLabel, config, labelKey]);
|
|
148
140
|
|
|
149
141
|
if (!active || !payload?.length) {
|
|
150
142
|
return null;
|
|
@@ -153,12 +145,7 @@ function ChartTooltipContent({
|
|
|
153
145
|
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
154
146
|
|
|
155
147
|
return (
|
|
156
|
-
<div
|
|
157
|
-
className={cn(
|
|
158
|
-
'border-border/50 bg-background gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl grid min-w-[8rem] items-start',
|
|
159
|
-
className,
|
|
160
|
-
)}
|
|
161
|
-
>
|
|
148
|
+
<div className="border-border/50 bg-background gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl grid min-w-[8rem] items-start">
|
|
162
149
|
{!nestLabel ? tooltipLabel : null}
|
|
163
150
|
<div className="grid gap-1.5">
|
|
164
151
|
{payload
|
|
@@ -235,12 +222,11 @@ function ChartTooltipContent({
|
|
|
235
222
|
const ChartLegend = RechartsPrimitive.Legend;
|
|
236
223
|
|
|
237
224
|
function ChartLegendContent({
|
|
238
|
-
className,
|
|
239
225
|
hideIcon = false,
|
|
240
226
|
payload,
|
|
241
227
|
verticalAlign = 'bottom',
|
|
242
228
|
nameKey,
|
|
243
|
-
}: React.ComponentProps<'div'> &
|
|
229
|
+
}: Omit<React.ComponentProps<'div'>, 'className'> &
|
|
244
230
|
Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
245
231
|
hideIcon?: boolean;
|
|
246
232
|
nameKey?: string;
|
|
@@ -256,7 +242,6 @@ function ChartLegendContent({
|
|
|
256
242
|
className={cn(
|
|
257
243
|
'flex items-center justify-center gap-4',
|
|
258
244
|
verticalAlign === 'top' ? 'pb-3' : 'pt-3',
|
|
259
|
-
className,
|
|
260
245
|
)}
|
|
261
246
|
>
|
|
262
247
|
{payload
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
import { Button } from '
|
|
8
|
-
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '
|
|
7
|
+
import { Button } from '../atoms/button';
|
|
8
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '../molecules/input-group';
|
|
9
9
|
|
|
10
10
|
const Combobox = ComboboxPrimitive.Root;
|
|
11
11
|
|
|
@@ -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,8 +1,6 @@
|
|
|
1
1
|
import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
|
|
4
|
-
import {
|
|
5
|
-
import { cn } from '../../../lib/utils';
|
|
3
|
+
import { Checkmark, ChevronRight } from '@carbon/icons-react';
|
|
6
4
|
|
|
7
5
|
function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
|
|
8
6
|
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
|
|
@@ -12,24 +10,23 @@ function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {
|
|
|
12
10
|
return <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
function ContextMenuTrigger({
|
|
13
|
+
function ContextMenuTrigger({ ...props }: Omit<ContextMenuPrimitive.Trigger.Props, 'className'>) {
|
|
16
14
|
return (
|
|
17
15
|
<ContextMenuPrimitive.Trigger
|
|
18
16
|
data-slot="context-menu-trigger"
|
|
19
|
-
className=
|
|
17
|
+
className="select-none"
|
|
20
18
|
{...props}
|
|
21
19
|
/>
|
|
22
20
|
);
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
function ContextMenuContent({
|
|
26
|
-
className,
|
|
27
24
|
align = 'start',
|
|
28
25
|
alignOffset = 4,
|
|
29
26
|
side = 'right',
|
|
30
27
|
sideOffset = 0,
|
|
31
28
|
...props
|
|
32
|
-
}: ContextMenuPrimitive.Popup.Props &
|
|
29
|
+
}: Omit<ContextMenuPrimitive.Popup.Props, 'className'> &
|
|
33
30
|
Pick<ContextMenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
|
|
34
31
|
return (
|
|
35
32
|
<ContextMenuPrimitive.Portal>
|
|
@@ -42,10 +39,7 @@ function ContextMenuContent({
|
|
|
42
39
|
>
|
|
43
40
|
<ContextMenuPrimitive.Popup
|
|
44
41
|
data-slot="context-menu-content"
|
|
45
|
-
className=
|
|
46
|
-
'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none',
|
|
47
|
-
className,
|
|
48
|
-
)}
|
|
42
|
+
className="data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none"
|
|
49
43
|
{...props}
|
|
50
44
|
/>
|
|
51
45
|
</ContextMenuPrimitive.Positioner>
|
|
@@ -58,31 +52,26 @@ function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {
|
|
|
58
52
|
}
|
|
59
53
|
|
|
60
54
|
function ContextMenuLabel({
|
|
61
|
-
className,
|
|
62
55
|
inset,
|
|
63
56
|
...props
|
|
64
|
-
}: ContextMenuPrimitive.GroupLabel.Props & {
|
|
57
|
+
}: Omit<ContextMenuPrimitive.GroupLabel.Props, 'className'> & {
|
|
65
58
|
inset?: boolean;
|
|
66
59
|
}) {
|
|
67
60
|
return (
|
|
68
61
|
<ContextMenuPrimitive.GroupLabel
|
|
69
62
|
data-slot="context-menu-label"
|
|
70
63
|
data-inset={inset}
|
|
71
|
-
className=
|
|
72
|
-
'text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8',
|
|
73
|
-
className,
|
|
74
|
-
)}
|
|
64
|
+
className="text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8"
|
|
75
65
|
{...props}
|
|
76
66
|
/>
|
|
77
67
|
);
|
|
78
68
|
}
|
|
79
69
|
|
|
80
70
|
function ContextMenuItem({
|
|
81
|
-
className,
|
|
82
71
|
inset,
|
|
83
72
|
variant = 'default',
|
|
84
73
|
...props
|
|
85
|
-
}: ContextMenuPrimitive.Item.Props & {
|
|
74
|
+
}: Omit<ContextMenuPrimitive.Item.Props, 'className'> & {
|
|
86
75
|
inset?: boolean;
|
|
87
76
|
variant?: 'default' | 'destructive';
|
|
88
77
|
}) {
|
|
@@ -91,10 +80,7 @@ function ContextMenuItem({
|
|
|
91
80
|
data-slot="context-menu-item"
|
|
92
81
|
data-inset={inset}
|
|
93
82
|
data-variant={variant}
|
|
94
|
-
className=
|
|
95
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
96
|
-
className,
|
|
97
|
-
)}
|
|
83
|
+
className="focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
98
84
|
{...props}
|
|
99
85
|
/>
|
|
100
86
|
);
|
|
@@ -105,34 +91,29 @@ function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {
|
|
|
105
91
|
}
|
|
106
92
|
|
|
107
93
|
function ContextMenuSubTrigger({
|
|
108
|
-
className,
|
|
109
94
|
inset,
|
|
110
95
|
children,
|
|
111
96
|
...props
|
|
112
|
-
}: ContextMenuPrimitive.SubmenuTrigger.Props & {
|
|
97
|
+
}: Omit<ContextMenuPrimitive.SubmenuTrigger.Props, 'className'> & {
|
|
113
98
|
inset?: boolean;
|
|
114
99
|
}) {
|
|
115
100
|
return (
|
|
116
101
|
<ContextMenuPrimitive.SubmenuTrigger
|
|
117
102
|
data-slot="context-menu-sub-trigger"
|
|
118
103
|
data-inset={inset}
|
|
119
|
-
className=
|
|
120
|
-
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
121
|
-
className,
|
|
122
|
-
)}
|
|
104
|
+
className="focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
123
105
|
{...props}
|
|
124
106
|
>
|
|
125
107
|
{children}
|
|
126
|
-
<
|
|
108
|
+
<ChevronRight className="ml-auto" />
|
|
127
109
|
</ContextMenuPrimitive.SubmenuTrigger>
|
|
128
110
|
);
|
|
129
111
|
}
|
|
130
112
|
|
|
131
|
-
function ContextMenuSubContent({ ...props }: React.ComponentProps<typeof ContextMenuContent>) {
|
|
113
|
+
function ContextMenuSubContent({ ...props }: Omit<React.ComponentProps<typeof ContextMenuContent>, 'className'>) {
|
|
132
114
|
return (
|
|
133
115
|
<ContextMenuContent
|
|
134
116
|
data-slot="context-menu-sub-content"
|
|
135
|
-
className="shadow-lg"
|
|
136
117
|
side="right"
|
|
137
118
|
{...props}
|
|
138
119
|
/>
|
|
@@ -140,24 +121,20 @@ function ContextMenuSubContent({ ...props }: React.ComponentProps<typeof Context
|
|
|
140
121
|
}
|
|
141
122
|
|
|
142
123
|
function ContextMenuCheckboxItem({
|
|
143
|
-
className,
|
|
144
124
|
children,
|
|
145
125
|
checked,
|
|
146
126
|
...props
|
|
147
|
-
}: ContextMenuPrimitive.CheckboxItem.Props) {
|
|
127
|
+
}: Omit<ContextMenuPrimitive.CheckboxItem.Props, 'className'>) {
|
|
148
128
|
return (
|
|
149
129
|
<ContextMenuPrimitive.CheckboxItem
|
|
150
130
|
data-slot="context-menu-checkbox-item"
|
|
151
|
-
className=
|
|
152
|
-
"focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
153
|
-
className,
|
|
154
|
-
)}
|
|
131
|
+
className="focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
155
132
|
checked={checked}
|
|
156
133
|
{...props}
|
|
157
134
|
>
|
|
158
135
|
<span className="absolute right-2 pointer-events-none">
|
|
159
136
|
<ContextMenuPrimitive.CheckboxItemIndicator>
|
|
160
|
-
<
|
|
137
|
+
<Checkmark />
|
|
161
138
|
</ContextMenuPrimitive.CheckboxItemIndicator>
|
|
162
139
|
</span>
|
|
163
140
|
{children}
|
|
@@ -170,22 +147,18 @@ function ContextMenuRadioGroup({ ...props }: ContextMenuPrimitive.RadioGroup.Pro
|
|
|
170
147
|
}
|
|
171
148
|
|
|
172
149
|
function ContextMenuRadioItem({
|
|
173
|
-
className,
|
|
174
150
|
children,
|
|
175
151
|
...props
|
|
176
|
-
}: ContextMenuPrimitive.RadioItem.Props) {
|
|
152
|
+
}: Omit<ContextMenuPrimitive.RadioItem.Props, 'className'>) {
|
|
177
153
|
return (
|
|
178
154
|
<ContextMenuPrimitive.RadioItem
|
|
179
155
|
data-slot="context-menu-radio-item"
|
|
180
|
-
className=
|
|
181
|
-
"focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
182
|
-
className,
|
|
183
|
-
)}
|
|
156
|
+
className="focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
184
157
|
{...props}
|
|
185
158
|
>
|
|
186
159
|
<span className="absolute right-2 pointer-events-none">
|
|
187
160
|
<ContextMenuPrimitive.RadioItemIndicator>
|
|
188
|
-
<
|
|
161
|
+
<Checkmark />
|
|
189
162
|
</ContextMenuPrimitive.RadioItemIndicator>
|
|
190
163
|
</span>
|
|
191
164
|
{children}
|
|
@@ -193,24 +166,21 @@ function ContextMenuRadioItem({
|
|
|
193
166
|
);
|
|
194
167
|
}
|
|
195
168
|
|
|
196
|
-
function ContextMenuSeparator({
|
|
169
|
+
function ContextMenuSeparator({ ...props }: Omit<ContextMenuPrimitive.Separator.Props, 'className'>) {
|
|
197
170
|
return (
|
|
198
171
|
<ContextMenuPrimitive.Separator
|
|
199
172
|
data-slot="context-menu-separator"
|
|
200
|
-
className=
|
|
173
|
+
className="bg-border -mx-1 my-1 h-px"
|
|
201
174
|
{...props}
|
|
202
175
|
/>
|
|
203
176
|
);
|
|
204
177
|
}
|
|
205
178
|
|
|
206
|
-
function ContextMenuShortcut({
|
|
179
|
+
function ContextMenuShortcut({ ...props }: Omit<React.ComponentProps<'span'>, 'className'>) {
|
|
207
180
|
return (
|
|
208
181
|
<span
|
|
209
182
|
data-slot="context-menu-shortcut"
|
|
210
|
-
className=
|
|
211
|
-
'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest',
|
|
212
|
-
className,
|
|
213
|
-
)}
|
|
183
|
+
className="text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest"
|
|
214
184
|
{...props}
|
|
215
185
|
/>
|
|
216
186
|
);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { Button } from '
|
|
6
|
+
import { Close } from '@carbon/icons-react';
|
|
7
|
+
import { Button } from '../atoms/button';
|
|
8
8
|
|
|
9
9
|
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
10
10
|
return <DialogPrimitive.Root data-slot="dialog" {...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}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './alert-dialog';
|
|
2
|
+
export * from './app-shell';
|
|
3
|
+
export * from './calendar';
|
|
4
|
+
export * from './carousel';
|
|
5
|
+
export * from './chart';
|
|
6
|
+
export * from './combobox';
|
|
7
|
+
export * from './command';
|
|
8
|
+
export * from './context-menu';
|
|
9
|
+
export * from './dialog';
|
|
10
|
+
export * from './drawer';
|
|
11
|
+
export * from './dropdown-menu';
|
|
12
|
+
export * from './menubar';
|
|
13
|
+
export * from './navigation-menu';
|
|
14
|
+
export * from './page-layout';
|
|
15
|
+
export * from './sheet';
|
|
16
|
+
export * from './sidebar';
|
|
17
|
+
export * from './sonner';
|
|
@@ -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}
|