@blocknote/shadcn 0.36.1 → 0.38.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/dist/blocknote-shadcn.cjs +1 -1
- package/dist/blocknote-shadcn.cjs.map +1 -1
- package/dist/blocknote-shadcn.js +1237 -1187
- package/dist/blocknote-shadcn.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +17 -19
- package/src/BlockNoteView.tsx +2 -0
- package/src/badge/Badge.tsx +3 -6
- package/src/comments/Card.tsx +7 -9
- package/src/comments/Comment.tsx +10 -27
- package/src/components/ui/avatar.tsx +44 -39
- package/src/components/ui/badge.tsx +22 -12
- package/src/components/ui/button.tsx +33 -32
- package/src/components/ui/card.tsx +78 -72
- package/src/components/ui/dropdown-menu.tsx +230 -176
- package/src/components/ui/form.tsx +40 -51
- package/src/components/ui/input.tsx +16 -20
- package/src/components/ui/label.tsx +19 -19
- package/src/components/ui/popover.tsx +40 -23
- package/src/components/ui/select.tsx +153 -133
- package/src/components/ui/skeleton.tsx +3 -5
- package/src/components/ui/tabs.tsx +59 -46
- package/src/components/ui/toggle.tsx +23 -21
- package/src/components/ui/tooltip.tsx +50 -21
- package/src/components.ts +0 -1
- package/src/form/TextInput.tsx +4 -4
- package/src/index.tsx +1 -2
- package/src/lib/utils.ts +2 -8
- package/src/menu/Button.tsx +1 -1
- package/src/menu/Menu.tsx +2 -2
- package/src/panel/Panel.tsx +2 -2
- package/src/panel/PanelTab.tsx +1 -1
- package/src/panel/PanelTextInput.tsx +1 -1
- package/src/popover/popover.tsx +2 -2
- package/src/sideMenu/SideMenuButton.tsx +1 -1
- package/src/style.css +6 -127
- package/src/suggestionMenu/SuggestionMenu.tsx +1 -1
- package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +3 -1
- package/src/suggestionMenu/SuggestionMenuItem.tsx +13 -10
- package/src/suggestionMenu/SuggestionMenuLabel.tsx +4 -1
- package/src/suggestionMenu/SuggestionMenuLoader.tsx +3 -2
- package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenu.tsx +8 -1
- package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.tsx +10 -1
- package/src/tableHandle/ExtendButton.tsx +6 -6
- package/src/tableHandle/TableHandle.tsx +1 -1
- package/src/toolbar/Toolbar.tsx +7 -9
- package/types/src/BlockNoteView.d.ts +1 -0
- package/types/src/ShadCNComponentsContext.d.ts +116 -132
- package/types/src/components/ui/avatar.d.ts +3 -3
- package/types/src/components/ui/badge.d.ts +5 -5
- package/types/src/components/ui/button.d.ts +4 -5
- package/types/src/components/ui/card.d.ts +8 -7
- package/types/src/components/ui/dropdown-menu.d.ts +21 -23
- package/types/src/components/ui/form.d.ts +10 -9
- package/types/src/components/ui/input.d.ts +1 -3
- package/types/src/components/ui/label.d.ts +2 -3
- package/types/src/components/ui/popover.d.ts +6 -5
- package/types/src/components/ui/select.d.ts +13 -11
- package/types/src/components/ui/skeleton.d.ts +1 -1
- package/types/src/components/ui/tabs.d.ts +6 -6
- package/types/src/components/ui/toggle.d.ts +3 -6
- package/types/src/components/ui/tooltip.d.ts +6 -6
- package/types/src/components.d.ts +0 -1
- package/types/src/index.d.ts +1 -1
- package/src/tailwindStyles.css +0 -421
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
1
|
+
"use client";
|
|
4
2
|
|
|
5
|
-
import
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
"bn-text-sm bn-font-medium bn-leading-none peer-disabled:bn-cursor-not-allowed peer-disabled:bn-opacity-70",
|
|
9
|
-
);
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
)
|
|
22
|
-
|
|
8
|
+
function Label({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<LabelPrimitive.Root
|
|
14
|
+
data-slot="label"
|
|
15
|
+
className={cn(
|
|
16
|
+
"flex select-none items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
23
|
|
|
24
24
|
export { Label };
|
|
@@ -1,29 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
2
3
|
import * as React from "react";
|
|
4
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
3
7
|
|
|
4
|
-
|
|
8
|
+
function Popover({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
11
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
12
|
+
}
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
function PopoverTrigger({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
17
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
18
|
+
}
|
|
7
19
|
|
|
8
|
-
|
|
20
|
+
function PopoverContent({
|
|
21
|
+
className,
|
|
22
|
+
align = "center",
|
|
23
|
+
sideOffset = 4,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
26
|
+
return (
|
|
27
|
+
<PopoverPrimitive.Content
|
|
28
|
+
data-slot="popover-content"
|
|
29
|
+
align={align}
|
|
30
|
+
sideOffset={sideOffset}
|
|
31
|
+
className={cn(
|
|
32
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 origin-(--radix-popover-content-transform-origin) outline-hidden z-50 w-72 rounded-md border p-4 shadow-md",
|
|
33
|
+
className,
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
9
39
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<PopoverPrimitive.Content
|
|
16
|
-
ref={ref}
|
|
17
|
-
align={align}
|
|
18
|
-
sideOffset={sideOffset}
|
|
19
|
-
className={cn(
|
|
20
|
-
"bn-z-50 bn-w-72 bn-rounded-md bn-border bn-bg-popover bn-p-4 bn-text-popover-foreground bn-shadow-md bn-outline-none data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
// </PopoverPrimitive.Portal>
|
|
26
|
-
));
|
|
27
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
40
|
+
function PopoverAnchor({
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
43
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
|
|
44
|
+
}
|
|
28
45
|
|
|
29
|
-
export { Popover, PopoverContent,
|
|
46
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -1,151 +1,171 @@
|
|
|
1
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
-
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
3
1
|
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
4
4
|
|
|
5
|
-
import { cn } from "../../lib/utils
|
|
6
|
-
|
|
7
|
-
const Select = SelectPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
function Select({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
10
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn(
|
|
20
|
-
"bn-flex bn-h-10 bn-w-full bn-items-center bn-justify-between bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background placeholder:bn-text-muted-foreground focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50 [&>span]:bn-line-clamp-1",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
<SelectPrimitive.Icon asChild>
|
|
27
|
-
<ChevronDown className="bn-h-4 bn-w-4 bn-opacity-50" />
|
|
28
|
-
</SelectPrimitive.Icon>
|
|
29
|
-
</SelectPrimitive.Trigger>
|
|
30
|
-
));
|
|
31
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
13
|
+
function SelectGroup({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
16
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
|
|
17
|
+
}
|
|
32
18
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
ref={ref}
|
|
39
|
-
className={cn(
|
|
40
|
-
"bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",
|
|
41
|
-
className,
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
<ChevronUp className="bn-h-4 bn-w-4" />
|
|
46
|
-
</SelectPrimitive.ScrollUpButton>
|
|
47
|
-
));
|
|
48
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
19
|
+
function SelectValue({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
22
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
23
|
+
}
|
|
49
24
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
25
|
+
function SelectTrigger({
|
|
26
|
+
className,
|
|
27
|
+
size = "default",
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
31
|
+
size?: "sm" | "default";
|
|
32
|
+
}) {
|
|
33
|
+
return (
|
|
34
|
+
<SelectPrimitive.Trigger
|
|
35
|
+
data-slot="select-trigger"
|
|
36
|
+
data-size={size}
|
|
37
|
+
className={cn(
|
|
38
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*=text-])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 shadow-xs flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
<SelectPrimitive.Icon asChild>
|
|
45
|
+
<ChevronDownIcon className="size-4 opacity-50" />
|
|
46
|
+
</SelectPrimitive.Icon>
|
|
47
|
+
</SelectPrimitive.Trigger>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
67
50
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
position === "popper" &&
|
|
78
|
-
"data-[side=bottom]:bn-translate-y-1 data-[side=left]:bn--translate-x-1 data-[side=right]:bn-translate-x-1 data-[side=top]:bn--translate-y-1",
|
|
79
|
-
className,
|
|
80
|
-
)}
|
|
81
|
-
position={position}
|
|
82
|
-
{...props}
|
|
83
|
-
>
|
|
84
|
-
<SelectScrollUpButton />
|
|
85
|
-
<SelectPrimitive.Viewport
|
|
51
|
+
function SelectContent({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
position = "popper",
|
|
55
|
+
...props
|
|
56
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
57
|
+
return (
|
|
58
|
+
<SelectPrimitive.Content
|
|
59
|
+
data-slot="select-content"
|
|
86
60
|
className={cn(
|
|
87
|
-
"
|
|
61
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) relative z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border shadow-md",
|
|
88
62
|
position === "popper" &&
|
|
89
|
-
"
|
|
63
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
64
|
+
className,
|
|
90
65
|
)}
|
|
66
|
+
position={position}
|
|
67
|
+
{...props}
|
|
91
68
|
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
))
|
|
98
|
-
|
|
69
|
+
<SelectScrollUpButton />
|
|
70
|
+
<SelectPrimitive.Viewport
|
|
71
|
+
className={cn(
|
|
72
|
+
"p-1",
|
|
73
|
+
position === "popper" &&
|
|
74
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1",
|
|
75
|
+
)}
|
|
76
|
+
>
|
|
77
|
+
{children}
|
|
78
|
+
</SelectPrimitive.Viewport>
|
|
79
|
+
<SelectScrollDownButton />
|
|
80
|
+
</SelectPrimitive.Content>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
99
83
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
));
|
|
113
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
84
|
+
function SelectLabel({
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
88
|
+
return (
|
|
89
|
+
<SelectPrimitive.Label
|
|
90
|
+
data-slot="select-label"
|
|
91
|
+
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
114
96
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
className
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
97
|
+
function SelectItem({
|
|
98
|
+
className,
|
|
99
|
+
children,
|
|
100
|
+
...props
|
|
101
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
102
|
+
return (
|
|
103
|
+
<SelectPrimitive.Item
|
|
104
|
+
data-slot="select-item"
|
|
105
|
+
className={cn(
|
|
106
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-2 pr-8 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
107
|
+
className,
|
|
108
|
+
)}
|
|
109
|
+
{...props}
|
|
110
|
+
>
|
|
111
|
+
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
112
|
+
<SelectPrimitive.ItemIndicator>
|
|
113
|
+
<CheckIcon className="size-4" />
|
|
114
|
+
</SelectPrimitive.ItemIndicator>
|
|
115
|
+
</span>
|
|
116
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
117
|
+
</SelectPrimitive.Item>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
132
120
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
121
|
+
function SelectSeparator({
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
125
|
+
return (
|
|
126
|
+
<SelectPrimitive.Separator
|
|
127
|
+
data-slot="select-separator"
|
|
128
|
+
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
137
133
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
134
|
+
function SelectScrollUpButton({
|
|
135
|
+
className,
|
|
136
|
+
...props
|
|
137
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
138
|
+
return (
|
|
139
|
+
<SelectPrimitive.ScrollUpButton
|
|
140
|
+
data-slot="select-scroll-up-button"
|
|
141
|
+
className={cn(
|
|
142
|
+
"flex cursor-default items-center justify-center py-1",
|
|
143
|
+
className,
|
|
144
|
+
)}
|
|
145
|
+
{...props}
|
|
146
|
+
>
|
|
147
|
+
<ChevronUpIcon className="size-4" />
|
|
148
|
+
</SelectPrimitive.ScrollUpButton>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function SelectScrollDownButton({
|
|
153
|
+
className,
|
|
154
|
+
...props
|
|
155
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
156
|
+
return (
|
|
157
|
+
<SelectPrimitive.ScrollDownButton
|
|
158
|
+
data-slot="select-scroll-down-button"
|
|
159
|
+
className={cn(
|
|
160
|
+
"flex cursor-default items-center justify-center py-1",
|
|
161
|
+
className,
|
|
162
|
+
)}
|
|
163
|
+
{...props}
|
|
164
|
+
>
|
|
165
|
+
<ChevronDownIcon className="size-4" />
|
|
166
|
+
</SelectPrimitive.ScrollDownButton>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
149
169
|
|
|
150
170
|
export {
|
|
151
171
|
Select,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { cn } from "../../lib/utils";
|
|
2
2
|
|
|
3
|
-
function Skeleton({
|
|
4
|
-
className,
|
|
5
|
-
...props
|
|
6
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
3
|
+
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
7
4
|
return (
|
|
8
5
|
<div
|
|
9
|
-
|
|
6
|
+
data-slot="skeleton"
|
|
7
|
+
className={cn("bg-accent animate-pulse rounded-md", className)}
|
|
10
8
|
{...props}
|
|
11
9
|
/>
|
|
12
10
|
);
|
|
@@ -1,53 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
2
3
|
import * as React from "react";
|
|
4
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
5
|
|
|
4
|
-
import { cn } from "../../lib/utils
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
function Tabs({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<TabsPrimitive.Root
|
|
14
|
+
data-slot="tabs"
|
|
15
|
+
className={cn("flex flex-col gap-2", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
7
20
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
function TabsList({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof TabsPrimitive.List>) {
|
|
25
|
+
return (
|
|
26
|
+
<TabsPrimitive.List
|
|
27
|
+
data-slot="tabs-list"
|
|
28
|
+
className={cn(
|
|
29
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
function TabsTrigger({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
41
|
+
return (
|
|
42
|
+
<TabsPrimitive.Trigger
|
|
43
|
+
data-slot="tabs-trigger"
|
|
44
|
+
className={cn(
|
|
45
|
+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-2 py-1 text-sm font-medium transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
37
52
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
));
|
|
51
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
53
|
+
function TabsContent({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
57
|
+
return (
|
|
58
|
+
<TabsPrimitive.Content
|
|
59
|
+
data-slot="tabs-content"
|
|
60
|
+
className={cn("flex-1 outline-none", className)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
52
65
|
|
|
53
|
-
export { Tabs,
|
|
66
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
2
3
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
4
4
|
|
|
5
|
-
import { cn } from "../../lib/utils
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
6
|
|
|
7
7
|
const toggleVariants = cva(
|
|
8
|
-
"
|
|
8
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: "
|
|
12
|
+
default: "bg-transparent",
|
|
13
13
|
outline:
|
|
14
|
-
"
|
|
14
|
+
"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
|
-
default: "
|
|
18
|
-
sm: "
|
|
19
|
-
lg: "
|
|
17
|
+
default: "h-9 px-2 min-w-9",
|
|
18
|
+
sm: "h-8 px-1.5 min-w-8",
|
|
19
|
+
lg: "h-10 px-2.5 min-w-10",
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
defaultVariants: {
|
|
@@ -26,18 +26,20 @@ const toggleVariants = cva(
|
|
|
26
26
|
},
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
))
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
function Toggle({
|
|
30
|
+
className,
|
|
31
|
+
variant,
|
|
32
|
+
size,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
35
|
+
VariantProps<typeof toggleVariants>) {
|
|
36
|
+
return (
|
|
37
|
+
<TogglePrimitive.Root
|
|
38
|
+
data-slot="toggle"
|
|
39
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
42
44
|
|
|
43
45
|
export { Toggle, toggleVariants };
|