@stagewise/ui 0.1.0 → 0.2.0
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/README.md +9 -3
- package/package.json +9 -15
- package/src/components/ui/accordion.tsx +13 -15
- package/src/components/ui/alert-dialog.tsx +38 -38
- package/src/components/ui/alert.tsx +22 -22
- package/src/components/ui/aspect-ratio.tsx +6 -6
- package/src/components/ui/avatar.tsx +30 -30
- package/src/components/ui/badge.tsx +24 -22
- package/src/components/ui/breadcrumb.tsx +34 -37
- package/src/components/ui/bubble.tsx +48 -48
- package/src/components/ui/button-group.tsx +24 -24
- package/src/components/ui/button.tsx +24 -24
- package/src/components/ui/calendar.tsx +94 -81
- package/src/components/ui/card.tsx +30 -30
- package/src/components/ui/carousel.tsx +95 -92
- package/src/components/ui/chart.tsx +110 -110
- package/src/components/ui/checkbox.tsx +9 -10
- package/src/components/ui/collapsible.tsx +5 -5
- package/src/components/ui/combobox.tsx +51 -44
- package/src/components/ui/command.tsx +173 -190
- package/src/components/ui/context-menu.tsx +60 -50
- package/src/components/ui/dialog.tsx +33 -34
- package/src/components/ui/direction.tsx +1 -1
- package/src/components/ui/drawer.tsx +61 -61
- package/src/components/ui/dropdown-menu.tsx +54 -50
- package/src/components/ui/empty.tsx +30 -30
- package/src/components/ui/field.tsx +64 -64
- package/src/components/ui/hover-card.tsx +12 -12
- package/src/components/ui/input-group.tsx +54 -54
- package/src/components/ui/input-otp.tsx +24 -25
- package/src/components/ui/input.tsx +8 -8
- package/src/components/ui/item.tsx +64 -64
- package/src/components/ui/kbd.tsx +8 -8
- package/src/components/ui/klex-logo-combo.tsx +69 -0
- package/src/components/ui/klex-logo-text.tsx +70 -0
- package/src/components/ui/klex-logo.tsx +146 -0
- package/src/components/ui/label.tsx +8 -8
- package/src/components/ui/marker.tsx +25 -25
- package/src/components/ui/menubar.tsx +54 -50
- package/src/components/ui/message-scroller.tsx +130 -0
- package/src/components/ui/message.tsx +27 -27
- package/src/components/ui/native-select.tsx +22 -18
- package/src/components/ui/navigation-menu.tsx +37 -34
- package/src/components/ui/pagination.tsx +34 -31
- package/src/components/ui/popover.tsx +19 -19
- package/src/components/ui/progress.tsx +16 -16
- package/src/components/ui/questionnaire.tsx +72 -69
- package/src/components/ui/radio-group.tsx +9 -9
- package/src/components/ui/resizable.tsx +19 -12
- package/src/components/ui/scroll-area.tsx +10 -10
- package/src/components/ui/select.tsx +39 -34
- package/src/components/ui/separator.tsx +7 -7
- package/src/components/ui/sheet.tsx +31 -32
- package/src/components/ui/sidebar.tsx +244 -232
- package/src/components/ui/skeleton.tsx +5 -5
- package/src/components/ui/slider.tsx +11 -7
- package/src/components/ui/spinner.tsx +15 -6
- package/src/components/ui/stagewise-logo-combo.tsx +43 -0
- package/src/components/ui/stagewise-logo-text.tsx +30 -0
- package/src/components/ui/stagewise-logo.tsx +42 -0
- package/src/components/ui/switch.tsx +9 -9
- package/src/components/ui/table.tsx +31 -31
- package/src/components/ui/tabs.tsx +37 -26
- package/src/components/ui/textarea.tsx +7 -7
- package/src/components/ui/toast.tsx +70 -70
- package/src/components/ui/toggle-group.tsx +26 -26
- package/src/components/ui/toggle.tsx +15 -15
- package/src/components/ui/tooltip.tsx +13 -13
- package/src/hooks/use-mobile.ts +13 -11
- package/src/icons/custom/ui-outline-18/IconKlexOutline18.tsx +39 -0
- package/src/icons/custom/ui-outline-18/IconLaptop.tsx +35 -0
- package/src/icons/custom/ui-outline-18/IconSignOut.tsx +33 -0
- package/src/icons/custom/ui-outline-18/index.ts +4 -1
- package/src/icons/index.ts +42 -20
- package/src/icons/nucleo/social-media/IconMicrosoftEntraId.tsx +56 -0
- package/src/icons/nucleo/social-media/index.ts +1 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowDownOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconArrowTurnRightOutline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconArrowUpOutline18.tsx +35 -0
- package/src/icons/nucleo/ui-outline-18/IconChartPieOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconChevronMaximizeDiagonal2Outline18.tsx +33 -0
- package/src/icons/nucleo/ui-outline-18/IconChevronUpOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconEmptyOutline18.tsx +41 -0
- package/src/icons/nucleo/ui-outline-18/IconEyeOffOutline18.tsx +18 -0
- package/src/icons/nucleo/ui-outline-18/IconLinkBrokenOutline18.tsx +66 -0
- package/src/icons/nucleo/ui-outline-18/IconLock18Outline.tsx +48 -0
- package/src/icons/nucleo/ui-outline-18/IconMinusOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconMsgs2Outline18.tsx +32 -0
- package/src/icons/nucleo/ui-outline-18/IconPanelLeftOutline18.tsx +4 -3
- package/src/icons/nucleo/ui-outline-18/IconSidebarLeft2HideOutline18.tsx +63 -0
- package/src/icons/nucleo/ui-outline-18/IconSidebarRight2HideOutline18.tsx +63 -0
- package/src/icons/nucleo/ui-outline-18/index.ts +11 -1
- package/src/icons/provider/IconAnthropic.tsx +15 -0
- package/src/icons/provider/IconCodex.tsx +18 -0
- package/src/icons/provider/IconDiscord.tsx +17 -0
- package/src/icons/provider/IconGemini.tsx +152 -0
- package/src/icons/provider/IconLinear.tsx +9 -0
- package/src/icons/provider/IconOpenAI.tsx +15 -0
- package/src/icons/provider/IconOpenRouter.tsx +24 -0
- package/src/icons/provider/IconSlack.tsx +24 -0
- package/src/icons/provider/IconTelegram.tsx +29 -0
- package/src/icons/provider/IconWhatsapp.tsx +14 -0
- package/src/icons/provider/LICENSE +21 -0
- package/src/icons/provider/index.ts +10 -0
- package/src/index.ts +68 -61
- package/src/lib/utils.ts +3 -3
- package/src/styles/bridge.css +7 -3
- package/src/styles/derived-utilities.css +129 -50
- package/src/styles/index.css +17 -2
- package/src/styles/palette.css +266 -105
- package/src/styles/scroll-fade.css +116 -0
- package/src/styles/tailwind-tokens.css +3 -0
- package/src/styles/theme.css +57 -43
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { cva, type VariantProps } from
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { Button } from
|
|
8
|
-
import { Input } from
|
|
9
|
-
import { Textarea } from
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Button } from './button';
|
|
8
|
+
import { Input } from './input';
|
|
9
|
+
import { Textarea } from './textarea';
|
|
10
10
|
|
|
11
|
-
function InputGroup({ className, ...props }: React.ComponentProps<
|
|
11
|
+
function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
12
12
|
return (
|
|
13
13
|
<div
|
|
14
14
|
data-slot="input-group"
|
|
15
15
|
role="group"
|
|
16
16
|
className={cn(
|
|
17
|
-
|
|
18
|
-
className
|
|
17
|
+
'group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-derived-strong transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5',
|
|
18
|
+
className,
|
|
19
19
|
)}
|
|
20
20
|
{...props}
|
|
21
21
|
/>
|
|
22
|
-
)
|
|
22
|
+
);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const inputGroupAddonVariants = cva(
|
|
@@ -27,27 +27,27 @@ const inputGroupAddonVariants = cva(
|
|
|
27
27
|
{
|
|
28
28
|
variants: {
|
|
29
29
|
align: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
'inline-start':
|
|
31
|
+
'order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]',
|
|
32
|
+
'inline-end':
|
|
33
|
+
'order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]',
|
|
34
|
+
'block-start':
|
|
35
|
+
'order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2',
|
|
36
|
+
'block-end':
|
|
37
|
+
'order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2',
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
defaultVariants: {
|
|
41
|
-
align:
|
|
41
|
+
align: 'inline-start',
|
|
42
42
|
},
|
|
43
|
-
}
|
|
44
|
-
)
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
45
|
|
|
46
46
|
function InputGroupAddon({
|
|
47
47
|
className,
|
|
48
|
-
align =
|
|
48
|
+
align = 'inline-start',
|
|
49
49
|
...props
|
|
50
|
-
}: React.ComponentProps<
|
|
50
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {
|
|
51
51
|
return (
|
|
52
52
|
<div
|
|
53
53
|
role="group"
|
|
@@ -55,43 +55,43 @@ function InputGroupAddon({
|
|
|
55
55
|
data-align={align}
|
|
56
56
|
className={cn(inputGroupAddonVariants({ align }), className)}
|
|
57
57
|
onClick={(e) => {
|
|
58
|
-
if ((e.target as HTMLElement).closest(
|
|
59
|
-
return
|
|
58
|
+
if ((e.target as HTMLElement).closest('button')) {
|
|
59
|
+
return;
|
|
60
60
|
}
|
|
61
|
-
e.currentTarget.parentElement?.querySelector(
|
|
61
|
+
e.currentTarget.parentElement?.querySelector('input')?.focus();
|
|
62
62
|
}}
|
|
63
63
|
{...props}
|
|
64
64
|
/>
|
|
65
|
-
)
|
|
65
|
+
);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const inputGroupButtonVariants = cva(
|
|
69
|
-
|
|
69
|
+
'flex items-center gap-2 text-sm shadow-none',
|
|
70
70
|
{
|
|
71
71
|
variants: {
|
|
72
72
|
size: {
|
|
73
73
|
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
74
|
-
sm:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
sm: '',
|
|
75
|
+
'icon-xs':
|
|
76
|
+
'size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0',
|
|
77
|
+
'icon-sm': 'size-8 p-0 has-[>svg]:p-0',
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
80
|
defaultVariants: {
|
|
81
|
-
size:
|
|
81
|
+
size: 'xs',
|
|
82
82
|
},
|
|
83
|
-
}
|
|
84
|
-
)
|
|
83
|
+
},
|
|
84
|
+
);
|
|
85
85
|
|
|
86
86
|
function InputGroupButton({
|
|
87
87
|
className,
|
|
88
|
-
type =
|
|
89
|
-
variant =
|
|
90
|
-
size =
|
|
88
|
+
type = 'button',
|
|
89
|
+
variant = 'ghost',
|
|
90
|
+
size = 'xs',
|
|
91
91
|
...props
|
|
92
|
-
}: Omit<React.ComponentProps<typeof Button>,
|
|
92
|
+
}: Omit<React.ComponentProps<typeof Button>, 'size' | 'type'> &
|
|
93
93
|
VariantProps<typeof inputGroupButtonVariants> & {
|
|
94
|
-
type?:
|
|
94
|
+
type?: 'button' | 'submit' | 'reset';
|
|
95
95
|
}) {
|
|
96
96
|
return (
|
|
97
97
|
<Button
|
|
@@ -101,51 +101,51 @@ function InputGroupButton({
|
|
|
101
101
|
className={cn(inputGroupButtonVariants({ size }), className)}
|
|
102
102
|
{...props}
|
|
103
103
|
/>
|
|
104
|
-
)
|
|
104
|
+
);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
function InputGroupText({ className, ...props }: React.ComponentProps<
|
|
107
|
+
function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {
|
|
108
108
|
return (
|
|
109
109
|
<span
|
|
110
110
|
className={cn(
|
|
111
111
|
"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
112
|
-
className
|
|
112
|
+
className,
|
|
113
113
|
)}
|
|
114
114
|
{...props}
|
|
115
115
|
/>
|
|
116
|
-
)
|
|
116
|
+
);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
function InputGroupInput({
|
|
120
120
|
className,
|
|
121
121
|
...props
|
|
122
|
-
}: React.ComponentProps<
|
|
122
|
+
}: React.ComponentProps<'input'>) {
|
|
123
123
|
return (
|
|
124
124
|
<Input
|
|
125
125
|
data-slot="input-group-control"
|
|
126
126
|
className={cn(
|
|
127
|
-
|
|
128
|
-
className
|
|
127
|
+
'flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',
|
|
128
|
+
className,
|
|
129
129
|
)}
|
|
130
130
|
{...props}
|
|
131
131
|
/>
|
|
132
|
-
)
|
|
132
|
+
);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
function InputGroupTextarea({
|
|
136
136
|
className,
|
|
137
137
|
...props
|
|
138
|
-
}: React.ComponentProps<
|
|
138
|
+
}: React.ComponentProps<'textarea'>) {
|
|
139
139
|
return (
|
|
140
140
|
<Textarea
|
|
141
141
|
data-slot="input-group-control"
|
|
142
142
|
className={cn(
|
|
143
|
-
|
|
144
|
-
className
|
|
143
|
+
'flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',
|
|
144
|
+
className,
|
|
145
145
|
)}
|
|
146
146
|
{...props}
|
|
147
147
|
/>
|
|
148
|
-
)
|
|
148
|
+
);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
export {
|
|
@@ -155,4 +155,4 @@ export {
|
|
|
155
155
|
InputGroupText,
|
|
156
156
|
InputGroupInput,
|
|
157
157
|
InputGroupTextarea,
|
|
158
|
-
}
|
|
158
|
+
};
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { OTPInput, OTPInputContext } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
5
|
-
import { IconMinusOutline18 } from
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { IconMinusOutline18 } from '../../icons';
|
|
6
6
|
|
|
7
7
|
function InputOTP({
|
|
8
8
|
className,
|
|
9
9
|
containerClassName,
|
|
10
10
|
...props
|
|
11
11
|
}: React.ComponentProps<typeof OTPInput> & {
|
|
12
|
-
containerClassName?: string
|
|
12
|
+
containerClassName?: string;
|
|
13
13
|
}) {
|
|
14
14
|
return (
|
|
15
15
|
<OTPInput
|
|
16
16
|
data-slot="input-otp"
|
|
17
17
|
containerClassName={cn(
|
|
18
|
-
|
|
19
|
-
containerClassName
|
|
18
|
+
'cn-input-otp flex items-center justify-center has-disabled:opacity-50',
|
|
19
|
+
containerClassName,
|
|
20
20
|
)}
|
|
21
21
|
spellCheck={false}
|
|
22
|
-
className={cn(
|
|
22
|
+
className={cn('disabled:cursor-not-allowed', className)}
|
|
23
23
|
{...props}
|
|
24
24
|
/>
|
|
25
|
-
)
|
|
25
|
+
);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function InputOTPGroup({ className, ...props }: React.ComponentProps<
|
|
28
|
+
function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
29
29
|
return (
|
|
30
30
|
<div
|
|
31
31
|
data-slot="input-otp-group"
|
|
32
32
|
className={cn(
|
|
33
|
-
|
|
34
|
-
className
|
|
33
|
+
'flex items-center rounded-lg has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40',
|
|
34
|
+
className,
|
|
35
35
|
)}
|
|
36
36
|
{...props}
|
|
37
37
|
/>
|
|
38
|
-
)
|
|
38
|
+
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function InputOTPSlot({
|
|
42
42
|
index,
|
|
43
43
|
className,
|
|
44
44
|
...props
|
|
45
|
-
}: React.ComponentProps<
|
|
46
|
-
index: number
|
|
45
|
+
}: React.ComponentProps<'div'> & {
|
|
46
|
+
index: number;
|
|
47
47
|
}) {
|
|
48
|
-
const inputOTPContext = React.useContext(OTPInputContext)
|
|
49
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
|
|
48
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
49
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
<div
|
|
53
53
|
data-slot="input-otp-slot"
|
|
54
54
|
data-active={isActive}
|
|
55
55
|
className={cn(
|
|
56
|
-
|
|
57
|
-
className
|
|
56
|
+
'relative flex size-10 items-center justify-center border-y border-r border-derived-strong text-lg transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40',
|
|
57
|
+
className,
|
|
58
58
|
)}
|
|
59
59
|
{...props}
|
|
60
60
|
>
|
|
@@ -65,10 +65,10 @@ function InputOTPSlot({
|
|
|
65
65
|
</div>
|
|
66
66
|
)}
|
|
67
67
|
</div>
|
|
68
|
-
)
|
|
68
|
+
);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
function InputOTPSeparator({ ...props }: React.ComponentProps<
|
|
71
|
+
function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {
|
|
72
72
|
return (
|
|
73
73
|
<div
|
|
74
74
|
data-slot="input-otp-separator"
|
|
@@ -76,10 +76,9 @@ function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
|
|
76
76
|
role="separator"
|
|
77
77
|
{...props}
|
|
78
78
|
>
|
|
79
|
-
<IconMinusOutline18
|
|
80
|
-
/>
|
|
79
|
+
<IconMinusOutline18 />
|
|
81
80
|
</div>
|
|
82
|
-
)
|
|
81
|
+
);
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
|
84
|
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { Input as InputPrimitive } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Input as InputPrimitive } from '@base-ui/react/input';
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
5
|
|
|
6
|
-
function Input({ className, type, ...props }: React.ComponentProps<
|
|
6
|
+
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
|
7
7
|
return (
|
|
8
8
|
<InputPrimitive
|
|
9
9
|
type={type}
|
|
10
10
|
data-slot="input"
|
|
11
11
|
className={cn(
|
|
12
|
-
|
|
13
|
-
className
|
|
12
|
+
'h-8 w-full min-w-0 rounded-lg border border-derived-strong bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',
|
|
13
|
+
className,
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
17
|
-
)
|
|
17
|
+
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export { Input }
|
|
20
|
+
export { Input };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { mergeProps } from
|
|
3
|
-
import { useRender } from
|
|
4
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { Separator } from
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Separator } from './separator';
|
|
8
8
|
|
|
9
|
-
function ItemGroup({ className, ...props }: React.ComponentProps<
|
|
9
|
+
function ItemGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
10
10
|
return (
|
|
11
11
|
<div
|
|
12
12
|
role="list"
|
|
13
13
|
data-slot="item-group"
|
|
14
14
|
className={cn(
|
|
15
|
-
|
|
16
|
-
className
|
|
15
|
+
'group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2',
|
|
16
|
+
className,
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
|
-
)
|
|
20
|
+
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function ItemSeparator({
|
|
@@ -28,80 +28,80 @@ function ItemSeparator({
|
|
|
28
28
|
<Separator
|
|
29
29
|
data-slot="item-separator"
|
|
30
30
|
orientation="horizontal"
|
|
31
|
-
className={cn(
|
|
31
|
+
className={cn('my-2', className)}
|
|
32
32
|
{...props}
|
|
33
33
|
/>
|
|
34
|
-
)
|
|
34
|
+
);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const itemVariants = cva(
|
|
38
|
-
|
|
38
|
+
'group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted',
|
|
39
39
|
{
|
|
40
40
|
variants: {
|
|
41
41
|
variant: {
|
|
42
|
-
default:
|
|
43
|
-
outline:
|
|
44
|
-
muted:
|
|
42
|
+
default: 'border-transparent',
|
|
43
|
+
outline: 'border-derived-subtle',
|
|
44
|
+
muted: 'border-transparent bg-muted/50',
|
|
45
45
|
},
|
|
46
46
|
size: {
|
|
47
|
-
default:
|
|
48
|
-
sm:
|
|
49
|
-
xs:
|
|
47
|
+
default: 'gap-2.5 px-3 py-2.5',
|
|
48
|
+
sm: 'gap-2.5 px-3 py-2.5',
|
|
49
|
+
xs: 'gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0',
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
defaultVariants: {
|
|
53
|
-
variant:
|
|
54
|
-
size:
|
|
53
|
+
variant: 'default',
|
|
54
|
+
size: 'default',
|
|
55
55
|
},
|
|
56
|
-
}
|
|
57
|
-
)
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
58
|
|
|
59
59
|
function Item({
|
|
60
60
|
className,
|
|
61
|
-
variant =
|
|
62
|
-
size =
|
|
61
|
+
variant = 'default',
|
|
62
|
+
size = 'default',
|
|
63
63
|
render,
|
|
64
64
|
...props
|
|
65
|
-
}: useRender.ComponentProps<
|
|
65
|
+
}: useRender.ComponentProps<'div'> & VariantProps<typeof itemVariants>) {
|
|
66
66
|
return useRender({
|
|
67
|
-
defaultTagName:
|
|
68
|
-
props: mergeProps<
|
|
67
|
+
defaultTagName: 'div',
|
|
68
|
+
props: mergeProps<'div'>(
|
|
69
69
|
{
|
|
70
70
|
className: cn(itemVariants({ variant, size, className })),
|
|
71
71
|
},
|
|
72
|
-
props
|
|
72
|
+
props,
|
|
73
73
|
),
|
|
74
74
|
render,
|
|
75
75
|
state: {
|
|
76
|
-
slot:
|
|
76
|
+
slot: 'item',
|
|
77
77
|
variant,
|
|
78
78
|
size,
|
|
79
79
|
},
|
|
80
|
-
})
|
|
80
|
+
});
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const itemMediaVariants = cva(
|
|
84
|
-
|
|
84
|
+
'flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none',
|
|
85
85
|
{
|
|
86
86
|
variants: {
|
|
87
87
|
variant: {
|
|
88
|
-
default:
|
|
88
|
+
default: 'bg-transparent',
|
|
89
89
|
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
90
90
|
image:
|
|
91
|
-
|
|
91
|
+
'size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover',
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
94
|
defaultVariants: {
|
|
95
|
-
variant:
|
|
95
|
+
variant: 'default',
|
|
96
96
|
},
|
|
97
|
-
}
|
|
98
|
-
)
|
|
97
|
+
},
|
|
98
|
+
);
|
|
99
99
|
|
|
100
100
|
function ItemMedia({
|
|
101
101
|
className,
|
|
102
|
-
variant =
|
|
102
|
+
variant = 'default',
|
|
103
103
|
...props
|
|
104
|
-
}: React.ComponentProps<
|
|
104
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof itemMediaVariants>) {
|
|
105
105
|
return (
|
|
106
106
|
<div
|
|
107
107
|
data-slot="item-media"
|
|
@@ -109,82 +109,82 @@ function ItemMedia({
|
|
|
109
109
|
className={cn(itemMediaVariants({ variant, className }))}
|
|
110
110
|
{...props}
|
|
111
111
|
/>
|
|
112
|
-
)
|
|
112
|
+
);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
function ItemContent({ className, ...props }: React.ComponentProps<
|
|
115
|
+
function ItemContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
116
116
|
return (
|
|
117
117
|
<div
|
|
118
118
|
data-slot="item-content"
|
|
119
119
|
className={cn(
|
|
120
|
-
|
|
121
|
-
className
|
|
120
|
+
'flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none',
|
|
121
|
+
className,
|
|
122
122
|
)}
|
|
123
123
|
{...props}
|
|
124
124
|
/>
|
|
125
|
-
)
|
|
125
|
+
);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
function ItemTitle({ className, ...props }: React.ComponentProps<
|
|
128
|
+
function ItemTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
129
129
|
return (
|
|
130
130
|
<div
|
|
131
131
|
data-slot="item-title"
|
|
132
132
|
className={cn(
|
|
133
|
-
|
|
134
|
-
className
|
|
133
|
+
'line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4',
|
|
134
|
+
className,
|
|
135
135
|
)}
|
|
136
136
|
{...props}
|
|
137
137
|
/>
|
|
138
|
-
)
|
|
138
|
+
);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
function ItemDescription({ className, ...props }: React.ComponentProps<
|
|
141
|
+
function ItemDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
142
142
|
return (
|
|
143
143
|
<p
|
|
144
144
|
data-slot="item-description"
|
|
145
145
|
className={cn(
|
|
146
|
-
|
|
147
|
-
className
|
|
146
|
+
'line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
147
|
+
className,
|
|
148
148
|
)}
|
|
149
149
|
{...props}
|
|
150
150
|
/>
|
|
151
|
-
)
|
|
151
|
+
);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
function ItemActions({ className, ...props }: React.ComponentProps<
|
|
154
|
+
function ItemActions({ className, ...props }: React.ComponentProps<'div'>) {
|
|
155
155
|
return (
|
|
156
156
|
<div
|
|
157
157
|
data-slot="item-actions"
|
|
158
|
-
className={cn(
|
|
158
|
+
className={cn('flex items-center gap-2', className)}
|
|
159
159
|
{...props}
|
|
160
160
|
/>
|
|
161
|
-
)
|
|
161
|
+
);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
function ItemHeader({ className, ...props }: React.ComponentProps<
|
|
164
|
+
function ItemHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
165
165
|
return (
|
|
166
166
|
<div
|
|
167
167
|
data-slot="item-header"
|
|
168
168
|
className={cn(
|
|
169
|
-
|
|
170
|
-
className
|
|
169
|
+
'flex basis-full items-center justify-between gap-2',
|
|
170
|
+
className,
|
|
171
171
|
)}
|
|
172
172
|
{...props}
|
|
173
173
|
/>
|
|
174
|
-
)
|
|
174
|
+
);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
function ItemFooter({ className, ...props }: React.ComponentProps<
|
|
177
|
+
function ItemFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
178
178
|
return (
|
|
179
179
|
<div
|
|
180
180
|
data-slot="item-footer"
|
|
181
181
|
className={cn(
|
|
182
|
-
|
|
183
|
-
className
|
|
182
|
+
'flex basis-full items-center justify-between gap-2',
|
|
183
|
+
className,
|
|
184
184
|
)}
|
|
185
185
|
{...props}
|
|
186
186
|
/>
|
|
187
|
-
)
|
|
187
|
+
);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
export {
|
|
@@ -198,4 +198,4 @@ export {
|
|
|
198
198
|
ItemDescription,
|
|
199
199
|
ItemHeader,
|
|
200
200
|
ItemFooter,
|
|
201
|
-
}
|
|
201
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { cn } from
|
|
1
|
+
import { cn } from '../../lib/utils';
|
|
2
2
|
|
|
3
|
-
function Kbd({ className, ...props }: React.ComponentProps<
|
|
3
|
+
function Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {
|
|
4
4
|
return (
|
|
5
5
|
<kbd
|
|
6
6
|
data-slot="kbd"
|
|
7
7
|
className={cn(
|
|
8
8
|
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",
|
|
9
|
-
className
|
|
9
|
+
className,
|
|
10
10
|
)}
|
|
11
11
|
{...props}
|
|
12
12
|
/>
|
|
13
|
-
)
|
|
13
|
+
);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function KbdGroup({ className, ...props }: React.ComponentProps<
|
|
16
|
+
function KbdGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
17
17
|
return (
|
|
18
18
|
<kbd
|
|
19
19
|
data-slot="kbd-group"
|
|
20
|
-
className={cn(
|
|
20
|
+
className={cn('inline-flex items-center gap-1', className)}
|
|
21
21
|
{...props}
|
|
22
22
|
/>
|
|
23
|
-
)
|
|
23
|
+
);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export { Kbd, KbdGroup }
|
|
26
|
+
export { Kbd, KbdGroup };
|