@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.
Files changed (66) hide show
  1. package/dist/blocknote-shadcn.cjs +1 -1
  2. package/dist/blocknote-shadcn.cjs.map +1 -1
  3. package/dist/blocknote-shadcn.js +1237 -1187
  4. package/dist/blocknote-shadcn.js.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +17 -19
  8. package/src/BlockNoteView.tsx +2 -0
  9. package/src/badge/Badge.tsx +3 -6
  10. package/src/comments/Card.tsx +7 -9
  11. package/src/comments/Comment.tsx +10 -27
  12. package/src/components/ui/avatar.tsx +44 -39
  13. package/src/components/ui/badge.tsx +22 -12
  14. package/src/components/ui/button.tsx +33 -32
  15. package/src/components/ui/card.tsx +78 -72
  16. package/src/components/ui/dropdown-menu.tsx +230 -176
  17. package/src/components/ui/form.tsx +40 -51
  18. package/src/components/ui/input.tsx +16 -20
  19. package/src/components/ui/label.tsx +19 -19
  20. package/src/components/ui/popover.tsx +40 -23
  21. package/src/components/ui/select.tsx +153 -133
  22. package/src/components/ui/skeleton.tsx +3 -5
  23. package/src/components/ui/tabs.tsx +59 -46
  24. package/src/components/ui/toggle.tsx +23 -21
  25. package/src/components/ui/tooltip.tsx +50 -21
  26. package/src/components.ts +0 -1
  27. package/src/form/TextInput.tsx +4 -4
  28. package/src/index.tsx +1 -2
  29. package/src/lib/utils.ts +2 -8
  30. package/src/menu/Button.tsx +1 -1
  31. package/src/menu/Menu.tsx +2 -2
  32. package/src/panel/Panel.tsx +2 -2
  33. package/src/panel/PanelTab.tsx +1 -1
  34. package/src/panel/PanelTextInput.tsx +1 -1
  35. package/src/popover/popover.tsx +2 -2
  36. package/src/sideMenu/SideMenuButton.tsx +1 -1
  37. package/src/style.css +6 -127
  38. package/src/suggestionMenu/SuggestionMenu.tsx +1 -1
  39. package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +3 -1
  40. package/src/suggestionMenu/SuggestionMenuItem.tsx +13 -10
  41. package/src/suggestionMenu/SuggestionMenuLabel.tsx +4 -1
  42. package/src/suggestionMenu/SuggestionMenuLoader.tsx +3 -2
  43. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenu.tsx +8 -1
  44. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.tsx +10 -1
  45. package/src/tableHandle/ExtendButton.tsx +6 -6
  46. package/src/tableHandle/TableHandle.tsx +1 -1
  47. package/src/toolbar/Toolbar.tsx +7 -9
  48. package/types/src/BlockNoteView.d.ts +1 -0
  49. package/types/src/ShadCNComponentsContext.d.ts +116 -132
  50. package/types/src/components/ui/avatar.d.ts +3 -3
  51. package/types/src/components/ui/badge.d.ts +5 -5
  52. package/types/src/components/ui/button.d.ts +4 -5
  53. package/types/src/components/ui/card.d.ts +8 -7
  54. package/types/src/components/ui/dropdown-menu.d.ts +21 -23
  55. package/types/src/components/ui/form.d.ts +10 -9
  56. package/types/src/components/ui/input.d.ts +1 -3
  57. package/types/src/components/ui/label.d.ts +2 -3
  58. package/types/src/components/ui/popover.d.ts +6 -5
  59. package/types/src/components/ui/select.d.ts +13 -11
  60. package/types/src/components/ui/skeleton.d.ts +1 -1
  61. package/types/src/components/ui/tabs.d.ts +6 -6
  62. package/types/src/components/ui/toggle.d.ts +3 -6
  63. package/types/src/components/ui/tooltip.d.ts +6 -6
  64. package/types/src/components.d.ts +0 -1
  65. package/types/src/index.d.ts +1 -1
  66. package/src/tailwindStyles.css +0 -421
@@ -1,24 +1,24 @@
1
- import * as LabelPrimitive from "@radix-ui/react-label";
2
- import { cva, type VariantProps } from "class-variance-authority";
3
- import * as React from "react";
1
+ "use client";
4
2
 
5
- import { cn } from "../../lib/utils.js";
3
+ import * as React from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
6
5
 
7
- const labelVariants = cva(
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
- const Label = React.forwardRef<
12
- React.ElementRef<typeof LabelPrimitive.Root>,
13
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
- VariantProps<typeof labelVariants>
15
- >(({ className, ...props }, ref) => (
16
- <LabelPrimitive.Root
17
- ref={ref}
18
- className={cn(labelVariants(), className)}
19
- {...props}
20
- />
21
- ));
22
- Label.displayName = LabelPrimitive.Root.displayName;
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
- import * as PopoverPrimitive from "@radix-ui/react-popover";
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
- import { cn } from "../../lib/utils.js";
8
+ function Popover({
9
+ ...props
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />;
12
+ }
5
13
 
6
- const Popover = PopoverPrimitive.Root;
14
+ function PopoverTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
18
+ }
7
19
 
8
- const PopoverTrigger = PopoverPrimitive.Trigger;
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
- const PopoverContent = React.forwardRef<
11
- React.ElementRef<typeof PopoverPrimitive.Content>,
12
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
13
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
- // <PopoverPrimitive.Portal>
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, PopoverTrigger };
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.js";
6
-
7
- const Select = SelectPrimitive.Root;
8
-
9
- const SelectGroup = SelectPrimitive.Group;
5
+ import { cn } from "../../lib/utils";
10
6
 
11
- const SelectValue = SelectPrimitive.Value;
7
+ function Select({
8
+ ...props
9
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
10
+ return <SelectPrimitive.Root data-slot="select" {...props} />;
11
+ }
12
12
 
13
- const SelectTrigger = React.forwardRef<
14
- React.ElementRef<typeof SelectPrimitive.Trigger>,
15
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
- >(({ className, children, ...props }, ref) => (
17
- <SelectPrimitive.Trigger
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
- const SelectScrollUpButton = React.forwardRef<
34
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
35
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
36
- >(({ className, ...props }, ref) => (
37
- <SelectPrimitive.ScrollUpButton
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
- const SelectScrollDownButton = React.forwardRef<
51
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
52
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
53
- >(({ className, ...props }, ref) => (
54
- <SelectPrimitive.ScrollDownButton
55
- ref={ref}
56
- className={cn(
57
- "bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",
58
- className,
59
- )}
60
- {...props}
61
- >
62
- <ChevronDown className="bn-h-4 bn-w-4" />
63
- </SelectPrimitive.ScrollDownButton>
64
- ));
65
- SelectScrollDownButton.displayName =
66
- SelectPrimitive.ScrollDownButton.displayName;
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
- const SelectContent = React.forwardRef<
69
- React.ElementRef<typeof SelectPrimitive.Content>,
70
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
71
- >(({ className, children, position = "popper", ...props }, ref) => (
72
- // <SelectPrimitive.Portal>
73
- <SelectPrimitive.Content
74
- ref={ref}
75
- className={cn(
76
- "bn-relative bn-z-50 bn-max-h-96 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-text-popover-foreground bn-shadow-md 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",
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
- "bn-p-1",
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
- "bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]",
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
- {children}
93
- </SelectPrimitive.Viewport>
94
- <SelectScrollDownButton />
95
- </SelectPrimitive.Content>
96
- // </SelectPrimitive.Portal>
97
- ));
98
- SelectContent.displayName = SelectPrimitive.Content.displayName;
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
- const SelectLabel = React.forwardRef<
101
- React.ElementRef<typeof SelectPrimitive.Label>,
102
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
103
- >(({ className, ...props }, ref) => (
104
- <SelectPrimitive.Label
105
- ref={ref}
106
- className={cn(
107
- "bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",
108
- className,
109
- )}
110
- {...props}
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
- const SelectItem = React.forwardRef<
116
- React.ElementRef<typeof SelectPrimitive.Item>,
117
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
118
- >(({ className, children, ...props }, ref) => (
119
- <SelectPrimitive.Item
120
- ref={ref}
121
- className={cn(
122
- "bn-relative bn-flex bn-w-full bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",
123
- className,
124
- )}
125
- {...props}
126
- >
127
- <span className="bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center">
128
- <SelectPrimitive.ItemIndicator>
129
- <Check className="bn-h-4 bn-w-4" />
130
- </SelectPrimitive.ItemIndicator>
131
- </span>
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
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
134
- </SelectPrimitive.Item>
135
- ));
136
- SelectItem.displayName = SelectPrimitive.Item.displayName;
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
- const SelectSeparator = React.forwardRef<
139
- React.ElementRef<typeof SelectPrimitive.Separator>,
140
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
141
- >(({ className, ...props }, ref) => (
142
- <SelectPrimitive.Separator
143
- ref={ref}
144
- className={cn("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted", className)}
145
- {...props}
146
- />
147
- ));
148
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
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
- className={cn("bg-primary/10 animate-pulse rounded-md", className)}
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
- import * as TabsPrimitive from "@radix-ui/react-tabs";
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.js";
6
+ import { cn } from "../../lib/utils";
5
7
 
6
- const Tabs = TabsPrimitive.Root;
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
- const TabsList = React.forwardRef<
9
- React.ElementRef<typeof TabsPrimitive.List>,
10
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
11
- >(({ className, ...props }, ref) => (
12
- <TabsPrimitive.List
13
- ref={ref}
14
- className={cn(
15
- "bn-inline-flex bn-h-10 bn-items-center bn-justify-center bn-rounded-md bn-bg-muted bn-p-1 bn-text-muted-foreground",
16
- className,
17
- )}
18
- {...props}
19
- />
20
- ));
21
- TabsList.displayName = TabsPrimitive.List.displayName;
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
- const TabsTrigger = React.forwardRef<
24
- React.ElementRef<typeof TabsPrimitive.Trigger>,
25
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
26
- >(({ className, ...props }, ref) => (
27
- <TabsPrimitive.Trigger
28
- ref={ref}
29
- className={cn(
30
- "bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-sm bn-px-3 bn-py-1.5 bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-all focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=active]:bn-bg-background data-[state=active]:bn-text-foreground data-[state=active]:bn-shadow-sm",
31
- className,
32
- )}
33
- {...props}
34
- />
35
- ));
36
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
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
- const TabsContent = React.forwardRef<
39
- React.ElementRef<typeof TabsPrimitive.Content>,
40
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
41
- >(({ className, ...props }, ref) => (
42
- <TabsPrimitive.Content
43
- ref={ref}
44
- className={cn(
45
- "bn-mt-2 bn-ring-offset-background focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2",
46
- className,
47
- )}
48
- {...props}
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, TabsContent, TabsList, TabsTrigger };
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.js";
5
+ import { cn } from "../../lib/utils";
6
6
 
7
7
  const toggleVariants = cva(
8
- "bn-inline-flex bn-items-center bn-justify-center bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors hover:bn-bg-muted hover:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=on]:bn-bg-accent data-[state=on]:bn-text-accent-foreground",
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: "bn-bg-transparent",
12
+ default: "bg-transparent",
13
13
  outline:
14
- "bn-border bn-border-input bn-bg-transparent hover:bn-bg-accent hover:bn-text-accent-foreground",
14
+ "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
15
15
  },
16
16
  size: {
17
- default: "bn-h-10 bn-px-3",
18
- sm: "bn-h-9 bn-px-2.5",
19
- lg: "bn-h-11 bn-px-5",
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
- const Toggle = React.forwardRef<
30
- React.ElementRef<typeof TogglePrimitive.Root>,
31
- React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
32
- VariantProps<typeof toggleVariants>
33
- >(({ className, variant, size, ...props }, ref) => (
34
- <TogglePrimitive.Root
35
- ref={ref}
36
- className={cn(toggleVariants({ variant, size, className }))}
37
- {...props}
38
- />
39
- ));
40
-
41
- Toggle.displayName = TogglePrimitive.Root.displayName;
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 };