@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,52 +1,54 @@
|
|
|
1
|
-
import { mergeProps } from
|
|
2
|
-
import { useRender } from
|
|
3
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
6
|
|
|
7
7
|
const badgeVariants = cva(
|
|
8
|
-
|
|
8
|
+
'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap select-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
12
|
+
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
13
13
|
secondary:
|
|
14
|
-
|
|
14
|
+
'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',
|
|
15
|
+
warning:
|
|
16
|
+
'bg-warning-background text-warning-foreground [a]:hover:bg-warning-background/80',
|
|
15
17
|
destructive:
|
|
16
|
-
|
|
18
|
+
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',
|
|
17
19
|
outline:
|
|
18
|
-
|
|
20
|
+
'border-derived-subtle text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
19
21
|
ghost:
|
|
20
|
-
|
|
21
|
-
link:
|
|
22
|
+
'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
|
|
23
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
22
24
|
},
|
|
23
25
|
},
|
|
24
26
|
defaultVariants: {
|
|
25
|
-
variant:
|
|
27
|
+
variant: 'default',
|
|
26
28
|
},
|
|
27
|
-
}
|
|
28
|
-
)
|
|
29
|
+
},
|
|
30
|
+
);
|
|
29
31
|
|
|
30
32
|
function Badge({
|
|
31
33
|
className,
|
|
32
|
-
variant =
|
|
34
|
+
variant = 'default',
|
|
33
35
|
render,
|
|
34
36
|
...props
|
|
35
|
-
}: useRender.ComponentProps<
|
|
37
|
+
}: useRender.ComponentProps<'span'> & VariantProps<typeof badgeVariants>) {
|
|
36
38
|
return useRender({
|
|
37
|
-
defaultTagName:
|
|
38
|
-
props: mergeProps<
|
|
39
|
+
defaultTagName: 'span',
|
|
40
|
+
props: mergeProps<'span'>(
|
|
39
41
|
{
|
|
40
42
|
className: cn(badgeVariants({ variant }), className),
|
|
41
43
|
},
|
|
42
|
-
props
|
|
44
|
+
props,
|
|
43
45
|
),
|
|
44
46
|
render,
|
|
45
47
|
state: {
|
|
46
|
-
slot:
|
|
48
|
+
slot: 'badge',
|
|
47
49
|
variant,
|
|
48
50
|
},
|
|
49
|
-
})
|
|
51
|
+
});
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
export { Badge, badgeVariants }
|
|
54
|
+
export { Badge, badgeVariants };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { mergeProps } from
|
|
3
|
-
import { useRender } 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
4
|
|
|
5
|
-
import { cn } from
|
|
6
|
-
import { IconChevronRightOutline18, IconDotsOutline18 } from
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { IconChevronRightOutline18, IconDotsOutline18 } from '../../icons';
|
|
7
7
|
|
|
8
|
-
function Breadcrumb({ className, ...props }: React.ComponentProps<
|
|
8
|
+
function Breadcrumb({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
9
9
|
return (
|
|
10
10
|
<nav
|
|
11
11
|
aria-label="breadcrumb"
|
|
@@ -13,105 +13,102 @@ function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
|
|
|
13
13
|
className={cn(className)}
|
|
14
14
|
{...props}
|
|
15
15
|
/>
|
|
16
|
-
)
|
|
16
|
+
);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function BreadcrumbList({ className, ...props }: React.ComponentProps<
|
|
19
|
+
function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
|
|
20
20
|
return (
|
|
21
21
|
<ol
|
|
22
22
|
data-slot="breadcrumb-list"
|
|
23
23
|
className={cn(
|
|
24
|
-
|
|
25
|
-
className
|
|
24
|
+
'flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground',
|
|
25
|
+
className,
|
|
26
26
|
)}
|
|
27
27
|
{...props}
|
|
28
28
|
/>
|
|
29
|
-
)
|
|
29
|
+
);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function BreadcrumbItem({ className, ...props }: React.ComponentProps<
|
|
32
|
+
function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
|
|
33
33
|
return (
|
|
34
34
|
<li
|
|
35
35
|
data-slot="breadcrumb-item"
|
|
36
|
-
className={cn(
|
|
36
|
+
className={cn('inline-flex items-center gap-1', className)}
|
|
37
37
|
{...props}
|
|
38
38
|
/>
|
|
39
|
-
)
|
|
39
|
+
);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function BreadcrumbLink({
|
|
43
43
|
className,
|
|
44
44
|
render,
|
|
45
45
|
...props
|
|
46
|
-
}: useRender.ComponentProps<
|
|
46
|
+
}: useRender.ComponentProps<'a'>) {
|
|
47
47
|
return useRender({
|
|
48
|
-
defaultTagName:
|
|
49
|
-
props: mergeProps<
|
|
48
|
+
defaultTagName: 'a',
|
|
49
|
+
props: mergeProps<'a'>(
|
|
50
50
|
{
|
|
51
|
-
className: cn(
|
|
51
|
+
className: cn('transition-colors hover:text-foreground', className),
|
|
52
52
|
},
|
|
53
|
-
props
|
|
53
|
+
props,
|
|
54
54
|
),
|
|
55
55
|
render,
|
|
56
56
|
state: {
|
|
57
|
-
slot:
|
|
57
|
+
slot: 'breadcrumb-link',
|
|
58
58
|
},
|
|
59
|
-
})
|
|
59
|
+
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
function BreadcrumbPage({ className, ...props }: React.ComponentProps<
|
|
62
|
+
function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
|
|
63
63
|
return (
|
|
64
64
|
<span
|
|
65
65
|
data-slot="breadcrumb-page"
|
|
66
66
|
role="link"
|
|
67
67
|
aria-disabled="true"
|
|
68
68
|
aria-current="page"
|
|
69
|
-
className={cn(
|
|
69
|
+
className={cn('font-normal text-foreground', className)}
|
|
70
70
|
{...props}
|
|
71
71
|
/>
|
|
72
|
-
)
|
|
72
|
+
);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function BreadcrumbSeparator({
|
|
76
76
|
children,
|
|
77
77
|
className,
|
|
78
78
|
...props
|
|
79
|
-
}: React.ComponentProps<
|
|
79
|
+
}: React.ComponentProps<'li'>) {
|
|
80
80
|
return (
|
|
81
81
|
<li
|
|
82
82
|
data-slot="breadcrumb-separator"
|
|
83
83
|
role="presentation"
|
|
84
84
|
aria-hidden="true"
|
|
85
|
-
className={cn(
|
|
85
|
+
className={cn('[&>svg]:size-3', className)}
|
|
86
86
|
{...props}
|
|
87
87
|
>
|
|
88
|
-
{children ??
|
|
89
|
-
<IconChevronRightOutline18 />
|
|
90
|
-
)}
|
|
88
|
+
{children ?? <IconChevronRightOutline18 />}
|
|
91
89
|
</li>
|
|
92
|
-
)
|
|
90
|
+
);
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
function BreadcrumbEllipsis({
|
|
96
94
|
className,
|
|
97
95
|
...props
|
|
98
|
-
}: React.ComponentProps<
|
|
96
|
+
}: React.ComponentProps<'span'>) {
|
|
99
97
|
return (
|
|
100
98
|
<span
|
|
101
99
|
data-slot="breadcrumb-ellipsis"
|
|
102
100
|
role="presentation"
|
|
103
101
|
aria-hidden="true"
|
|
104
102
|
className={cn(
|
|
105
|
-
|
|
106
|
-
className
|
|
103
|
+
'flex size-5 items-center justify-center [&>svg]:size-4',
|
|
104
|
+
className,
|
|
107
105
|
)}
|
|
108
106
|
{...props}
|
|
109
107
|
>
|
|
110
|
-
<IconDotsOutline18
|
|
111
|
-
/>
|
|
108
|
+
<IconDotsOutline18 />
|
|
112
109
|
<span className="sr-only">More</span>
|
|
113
110
|
</span>
|
|
114
|
-
)
|
|
111
|
+
);
|
|
115
112
|
}
|
|
116
113
|
|
|
117
114
|
export {
|
|
@@ -122,4 +119,4 @@ export {
|
|
|
122
119
|
BreadcrumbPage,
|
|
123
120
|
BreadcrumbSeparator,
|
|
124
121
|
BreadcrumbEllipsis,
|
|
125
|
-
}
|
|
122
|
+
};
|
|
@@ -1,55 +1,55 @@
|
|
|
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
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
7
|
|
|
8
|
-
function BubbleGroup({ className, ...props }: React.ComponentProps<
|
|
8
|
+
function BubbleGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
9
9
|
return (
|
|
10
10
|
<div
|
|
11
11
|
data-slot="bubble-group"
|
|
12
|
-
className={cn(
|
|
12
|
+
className={cn('flex min-w-0 flex-col gap-2', className)}
|
|
13
13
|
{...props}
|
|
14
14
|
/>
|
|
15
|
-
)
|
|
15
|
+
);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const bubbleVariants = cva(
|
|
19
|
-
|
|
19
|
+
'group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full',
|
|
20
20
|
{
|
|
21
21
|
variants: {
|
|
22
22
|
variant: {
|
|
23
23
|
default:
|
|
24
|
-
|
|
24
|
+
'*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80',
|
|
25
25
|
secondary:
|
|
26
|
-
|
|
26
|
+
'*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]',
|
|
27
27
|
muted:
|
|
28
|
-
|
|
28
|
+
'*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]',
|
|
29
29
|
tinted:
|
|
30
|
-
|
|
30
|
+
'*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]',
|
|
31
31
|
outline:
|
|
32
|
-
|
|
32
|
+
'*:data-[slot=bubble-content]:border-derived-subtle *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30',
|
|
33
33
|
ghost:
|
|
34
|
-
|
|
34
|
+
'border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50',
|
|
35
35
|
destructive:
|
|
36
|
-
|
|
36
|
+
'*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30',
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
defaultVariants: {
|
|
40
|
-
variant:
|
|
40
|
+
variant: 'default',
|
|
41
41
|
},
|
|
42
|
-
}
|
|
43
|
-
)
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
44
|
|
|
45
45
|
function Bubble({
|
|
46
|
-
variant =
|
|
47
|
-
align =
|
|
46
|
+
variant = 'default',
|
|
47
|
+
align = 'start',
|
|
48
48
|
className,
|
|
49
49
|
...props
|
|
50
|
-
}: React.ComponentProps<
|
|
50
|
+
}: React.ComponentProps<'div'> &
|
|
51
51
|
VariantProps<typeof bubbleVariants> & {
|
|
52
|
-
align?:
|
|
52
|
+
align?: 'start' | 'end';
|
|
53
53
|
}) {
|
|
54
54
|
return (
|
|
55
55
|
<div
|
|
@@ -59,60 +59,60 @@ function Bubble({
|
|
|
59
59
|
className={cn(bubbleVariants({ variant }), className)}
|
|
60
60
|
{...props}
|
|
61
61
|
/>
|
|
62
|
-
)
|
|
62
|
+
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function BubbleContent({
|
|
66
66
|
className,
|
|
67
67
|
render,
|
|
68
68
|
...props
|
|
69
|
-
}: useRender.ComponentProps<
|
|
69
|
+
}: useRender.ComponentProps<'div'>) {
|
|
70
70
|
return useRender({
|
|
71
|
-
defaultTagName:
|
|
72
|
-
props: mergeProps<
|
|
71
|
+
defaultTagName: 'div',
|
|
72
|
+
props: mergeProps<'div'>(
|
|
73
73
|
{
|
|
74
74
|
className: cn(
|
|
75
|
-
|
|
76
|
-
className
|
|
75
|
+
'w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3 py-2.5 text-sm leading-relaxed wrap-break-word [corner-shape:round] group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/30',
|
|
76
|
+
className,
|
|
77
77
|
),
|
|
78
78
|
},
|
|
79
|
-
props
|
|
79
|
+
props,
|
|
80
80
|
),
|
|
81
81
|
render,
|
|
82
82
|
state: {
|
|
83
|
-
slot:
|
|
83
|
+
slot: 'bubble-content',
|
|
84
84
|
},
|
|
85
|
-
})
|
|
85
|
+
});
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
const bubbleReactionsVariants = cva(
|
|
89
|
-
|
|
89
|
+
'absolute z-10 flex w-fit shrink-0 items-center justify-center gap-[7px] text-sm',
|
|
90
90
|
{
|
|
91
91
|
variants: {
|
|
92
92
|
side: {
|
|
93
|
-
top:
|
|
94
|
-
bottom:
|
|
93
|
+
top: 'top-0 -translate-y-3/4',
|
|
94
|
+
bottom: 'bottom-0 translate-y-3/4',
|
|
95
95
|
},
|
|
96
96
|
align: {
|
|
97
|
-
start:
|
|
98
|
-
end:
|
|
97
|
+
start: 'left-3',
|
|
98
|
+
end: 'right-3',
|
|
99
99
|
},
|
|
100
100
|
},
|
|
101
101
|
defaultVariants: {
|
|
102
|
-
side:
|
|
103
|
-
align:
|
|
102
|
+
side: 'bottom',
|
|
103
|
+
align: 'end',
|
|
104
104
|
},
|
|
105
|
-
}
|
|
106
|
-
)
|
|
105
|
+
},
|
|
106
|
+
);
|
|
107
107
|
|
|
108
108
|
function BubbleReactions({
|
|
109
|
-
side =
|
|
110
|
-
align =
|
|
109
|
+
side = 'bottom',
|
|
110
|
+
align = 'end',
|
|
111
111
|
className,
|
|
112
112
|
...props
|
|
113
|
-
}: React.ComponentProps<
|
|
114
|
-
align?:
|
|
115
|
-
side?:
|
|
113
|
+
}: React.ComponentProps<'div'> & {
|
|
114
|
+
align?: 'start' | 'end';
|
|
115
|
+
side?: 'top' | 'bottom';
|
|
116
116
|
}) {
|
|
117
117
|
return (
|
|
118
118
|
<div
|
|
@@ -122,7 +122,7 @@ function BubbleReactions({
|
|
|
122
122
|
className={cn(bubbleReactionsVariants({ side, align }), className)}
|
|
123
123
|
{...props}
|
|
124
124
|
/>
|
|
125
|
-
)
|
|
125
|
+
);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
export { BubbleGroup, Bubble, BubbleContent, BubbleReactions }
|
|
128
|
+
export { BubbleGroup, Bubble, BubbleContent, BubbleReactions };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mergeProps } from
|
|
2
|
-
import { useRender } from
|
|
3
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
6
|
-
import { Separator } from
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { Separator } from './separator';
|
|
7
7
|
|
|
8
8
|
const buttonGroupVariants = cva(
|
|
9
9
|
"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
@@ -11,22 +11,22 @@ const buttonGroupVariants = cva(
|
|
|
11
11
|
variants: {
|
|
12
12
|
orientation: {
|
|
13
13
|
horizontal:
|
|
14
|
-
|
|
14
|
+
'*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0',
|
|
15
15
|
vertical:
|
|
16
|
-
|
|
16
|
+
'flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0',
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
defaultVariants: {
|
|
20
|
-
orientation:
|
|
20
|
+
orientation: 'horizontal',
|
|
21
21
|
},
|
|
22
|
-
}
|
|
23
|
-
)
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
24
|
|
|
25
25
|
function ButtonGroup({
|
|
26
26
|
className,
|
|
27
27
|
orientation,
|
|
28
28
|
...props
|
|
29
|
-
}: React.ComponentProps<
|
|
29
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>) {
|
|
30
30
|
return (
|
|
31
31
|
<div
|
|
32
32
|
role="group"
|
|
@@ -35,35 +35,35 @@ function ButtonGroup({
|
|
|
35
35
|
className={cn(buttonGroupVariants({ orientation }), className)}
|
|
36
36
|
{...props}
|
|
37
37
|
/>
|
|
38
|
-
)
|
|
38
|
+
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function ButtonGroupText({
|
|
42
42
|
className,
|
|
43
43
|
render,
|
|
44
44
|
...props
|
|
45
|
-
}: useRender.ComponentProps<
|
|
45
|
+
}: useRender.ComponentProps<'div'>) {
|
|
46
46
|
return useRender({
|
|
47
|
-
defaultTagName:
|
|
48
|
-
props: mergeProps<
|
|
47
|
+
defaultTagName: 'div',
|
|
48
|
+
props: mergeProps<'div'>(
|
|
49
49
|
{
|
|
50
50
|
className: cn(
|
|
51
51
|
"flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
52
|
-
className
|
|
52
|
+
className,
|
|
53
53
|
),
|
|
54
54
|
},
|
|
55
|
-
props
|
|
55
|
+
props,
|
|
56
56
|
),
|
|
57
57
|
render,
|
|
58
58
|
state: {
|
|
59
|
-
slot:
|
|
59
|
+
slot: 'button-group-text',
|
|
60
60
|
},
|
|
61
|
-
})
|
|
61
|
+
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
function ButtonGroupSeparator({
|
|
65
65
|
className,
|
|
66
|
-
orientation =
|
|
66
|
+
orientation = 'vertical',
|
|
67
67
|
...props
|
|
68
68
|
}: React.ComponentProps<typeof Separator>) {
|
|
69
69
|
return (
|
|
@@ -71,12 +71,12 @@ function ButtonGroupSeparator({
|
|
|
71
71
|
data-slot="button-group-separator"
|
|
72
72
|
orientation={orientation}
|
|
73
73
|
className={cn(
|
|
74
|
-
|
|
75
|
-
className
|
|
74
|
+
'relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto',
|
|
75
|
+
className,
|
|
76
76
|
)}
|
|
77
77
|
{...props}
|
|
78
78
|
/>
|
|
79
|
-
)
|
|
79
|
+
);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export {
|
|
@@ -84,4 +84,4 @@ export {
|
|
|
84
84
|
ButtonGroupSeparator,
|
|
85
85
|
ButtonGroupText,
|
|
86
86
|
buttonGroupVariants,
|
|
87
|
-
}
|
|
87
|
+
};
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { Button as ButtonPrimitive } from
|
|
2
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
5
|
|
|
6
6
|
const buttonVariants = cva(
|
|
7
7
|
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default:
|
|
11
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
12
12
|
outline:
|
|
13
|
-
|
|
13
|
+
'border-derived-strong bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30 dark:hover:bg-input/50',
|
|
14
14
|
secondary:
|
|
15
|
-
|
|
15
|
+
'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
16
16
|
ghost:
|
|
17
|
-
|
|
17
|
+
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
18
18
|
destructive:
|
|
19
|
-
|
|
20
|
-
link:
|
|
19
|
+
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive focus-visible:ring-destructive/40 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
20
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
21
21
|
},
|
|
22
22
|
size: {
|
|
23
23
|
default:
|
|
24
|
-
|
|
24
|
+
'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
25
25
|
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
26
26
|
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
27
|
-
lg:
|
|
28
|
-
icon:
|
|
29
|
-
|
|
27
|
+
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
28
|
+
icon: 'size-8',
|
|
29
|
+
'icon-xs':
|
|
30
30
|
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
'icon-sm':
|
|
32
|
+
'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
33
|
+
'icon-lg': 'size-9',
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
defaultVariants: {
|
|
37
|
-
variant:
|
|
38
|
-
size:
|
|
37
|
+
variant: 'default',
|
|
38
|
+
size: 'default',
|
|
39
39
|
},
|
|
40
|
-
}
|
|
41
|
-
)
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
42
|
|
|
43
43
|
function Button({
|
|
44
44
|
className,
|
|
45
|
-
variant =
|
|
46
|
-
size =
|
|
45
|
+
variant = 'default',
|
|
46
|
+
size = 'default',
|
|
47
47
|
...props
|
|
48
48
|
}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
|
|
49
49
|
return (
|
|
@@ -52,7 +52,7 @@ function Button({
|
|
|
52
52
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
53
53
|
{...props}
|
|
54
54
|
/>
|
|
55
|
-
)
|
|
55
|
+
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export { Button, buttonVariants }
|
|
58
|
+
export { Button, buttonVariants };
|