@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,30 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
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 buttonVariants = cva(
|
|
8
|
-
"
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default:
|
|
13
|
-
"
|
|
13
|
+
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
14
14
|
destructive:
|
|
15
|
-
"
|
|
15
|
+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
16
16
|
outline:
|
|
17
|
-
"
|
|
17
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
18
18
|
secondary:
|
|
19
|
-
"
|
|
20
|
-
ghost:
|
|
21
|
-
|
|
19
|
+
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
20
|
+
ghost:
|
|
21
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
23
|
},
|
|
23
24
|
size: {
|
|
24
|
-
default: "
|
|
25
|
-
sm: "
|
|
26
|
-
lg: "
|
|
27
|
-
icon: "
|
|
25
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
26
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
27
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
28
|
+
icon: "size-9",
|
|
28
29
|
},
|
|
29
30
|
},
|
|
30
31
|
defaultVariants: {
|
|
@@ -34,25 +35,25 @@ const buttonVariants = cva(
|
|
|
34
35
|
},
|
|
35
36
|
);
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
function Button({
|
|
39
|
+
className,
|
|
40
|
+
variant,
|
|
41
|
+
size,
|
|
42
|
+
asChild = false,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<"button"> &
|
|
45
|
+
VariantProps<typeof buttonVariants> & {
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
}) {
|
|
48
|
+
const Comp = asChild ? Slot : "button";
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
},
|
|
55
|
-
);
|
|
56
|
-
Button.displayName = "Button";
|
|
50
|
+
return (
|
|
51
|
+
<Comp
|
|
52
|
+
data-slot="button"
|
|
53
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
57
58
|
|
|
58
59
|
export { Button, buttonVariants };
|
|
@@ -1,86 +1,92 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import { cn } from "../../lib/utils
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
));
|
|
18
|
-
Card.displayName = "Card";
|
|
5
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
data-slot="card"
|
|
9
|
+
className={cn(
|
|
10
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
11
|
+
className,
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
data-slot="card-header"
|
|
22
|
+
className={cn(
|
|
23
|
+
"@container/card-header has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6 grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6",
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
));
|
|
45
|
-
CardTitle.displayName = "CardTitle";
|
|
31
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
data-slot="card-title"
|
|
35
|
+
className={cn("font-semibold leading-none", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
));
|
|
57
|
-
CardDescription.displayName = "CardDescription";
|
|
41
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
data-slot="card-description"
|
|
45
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
58
50
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
data-slot="card-action"
|
|
55
|
+
className={cn(
|
|
56
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
CardFooter
|
|
64
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
data-slot="card-content"
|
|
68
|
+
className={cn("px-6", className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
75
|
+
return (
|
|
76
|
+
<div
|
|
77
|
+
data-slot="card-footer"
|
|
78
|
+
className={cn("[.border-t]:pt-6 flex items-center px-6", className)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
78
83
|
|
|
79
84
|
export {
|
|
80
85
|
Card,
|
|
81
|
-
CardContent,
|
|
82
|
-
CardDescription,
|
|
83
|
-
CardFooter,
|
|
84
86
|
CardHeader,
|
|
87
|
+
CardFooter,
|
|
85
88
|
CardTitle,
|
|
89
|
+
CardAction,
|
|
90
|
+
CardDescription,
|
|
91
|
+
CardContent,
|
|
86
92
|
};
|