@blocknote/shadcn 0.14.1 → 0.14.3

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 (39) hide show
  1. package/dist/blocknote-shadcn.js +921 -910
  2. package/dist/blocknote-shadcn.js.map +1 -1
  3. package/dist/blocknote-shadcn.umd.cjs +11 -11
  4. package/dist/blocknote-shadcn.umd.cjs.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +7 -7
  8. package/src/components/ui/badge.tsx +5 -5
  9. package/src/components/ui/button.tsx +12 -11
  10. package/src/components/ui/card.tsx +6 -6
  11. package/src/components/ui/dropdown-menu.tsx +20 -17
  12. package/src/components/ui/form.tsx +4 -4
  13. package/src/components/ui/input.tsx +3 -2
  14. package/src/components/ui/label.tsx +1 -1
  15. package/src/components/ui/popover.tsx +1 -1
  16. package/src/components/ui/select.tsx +18 -15
  17. package/src/components/ui/tabs.tsx +3 -3
  18. package/src/components/ui/toggle.tsx +6 -6
  19. package/src/components/ui/tooltip.tsx +1 -1
  20. package/src/form/TextInput.tsx +51 -49
  21. package/src/index.tsx +12 -4
  22. package/src/lib/utils.ts +7 -1
  23. package/src/menu/Menu.tsx +2 -2
  24. package/src/panel/Panel.tsx +2 -2
  25. package/src/panel/PanelTab.tsx +1 -1
  26. package/src/panel/PanelTextInput.tsx +1 -1
  27. package/src/popover/popover.tsx +2 -2
  28. package/src/sideMenu/SideMenuButton.tsx +1 -1
  29. package/src/style.css +17 -16
  30. package/src/suggestionMenu/SuggestionMenu.tsx +1 -1
  31. package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +1 -1
  32. package/src/suggestionMenu/SuggestionMenuItem.tsx +6 -6
  33. package/src/suggestionMenu/SuggestionMenuLabel.tsx +1 -1
  34. package/src/tableHandle/TableHandle.tsx +1 -1
  35. package/src/tailwindStyles.css +420 -0
  36. package/src/toolbar/Toolbar.tsx +4 -4
  37. package/types/src/components/ui/form.d.ts +1 -1
  38. package/types/src/components/ui/input.d.ts +2 -1
  39. package/types/src/form/TextInput.d.ts +1 -1
@@ -17,13 +17,13 @@ const SelectTrigger = React.forwardRef<
17
17
  <SelectPrimitive.Trigger
18
18
  ref={ref}
19
19
  className={cn(
20
- "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
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
21
  className
22
22
  )}
23
23
  {...props}>
24
24
  {children}
25
25
  <SelectPrimitive.Icon asChild>
26
- <ChevronDown className="h-4 w-4 opacity-50" />
26
+ <ChevronDown className="bn-h-4 bn-w-4 bn-opacity-50" />
27
27
  </SelectPrimitive.Icon>
28
28
  </SelectPrimitive.Trigger>
29
29
  ));
@@ -36,11 +36,11 @@ const SelectScrollUpButton = React.forwardRef<
36
36
  <SelectPrimitive.ScrollUpButton
37
37
  ref={ref}
38
38
  className={cn(
39
- "flex cursor-default items-center justify-center py-1",
39
+ "bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",
40
40
  className
41
41
  )}
42
42
  {...props}>
43
- <ChevronUp className="h-4 w-4" />
43
+ <ChevronUp className="bn-h-4 bn-w-4" />
44
44
  </SelectPrimitive.ScrollUpButton>
45
45
  ));
46
46
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
@@ -52,11 +52,11 @@ const SelectScrollDownButton = React.forwardRef<
52
52
  <SelectPrimitive.ScrollDownButton
53
53
  ref={ref}
54
54
  className={cn(
55
- "flex cursor-default items-center justify-center py-1",
55
+ "bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",
56
56
  className
57
57
  )}
58
58
  {...props}>
59
- <ChevronDown className="h-4 w-4" />
59
+ <ChevronDown className="bn-h-4 bn-w-4" />
60
60
  </SelectPrimitive.ScrollDownButton>
61
61
  ));
62
62
  SelectScrollDownButton.displayName =
@@ -70,9 +70,9 @@ const SelectContent = React.forwardRef<
70
70
  <SelectPrimitive.Content
71
71
  ref={ref}
72
72
  className={cn(
73
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
73
+ "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",
74
74
  position === "popper" &&
75
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
75
+ "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",
76
76
  className
77
77
  )}
78
78
  position={position}
@@ -80,9 +80,9 @@ const SelectContent = React.forwardRef<
80
80
  <SelectScrollUpButton />
81
81
  <SelectPrimitive.Viewport
82
82
  className={cn(
83
- "p-1",
83
+ "bn-p-1",
84
84
  position === "popper" &&
85
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
85
+ "bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]"
86
86
  )}>
87
87
  {children}
88
88
  </SelectPrimitive.Viewport>
@@ -98,7 +98,10 @@ const SelectLabel = React.forwardRef<
98
98
  >(({ className, ...props }, ref) => (
99
99
  <SelectPrimitive.Label
100
100
  ref={ref}
101
- className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
101
+ className={cn(
102
+ "bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",
103
+ className
104
+ )}
102
105
  {...props}
103
106
  />
104
107
  ));
@@ -111,13 +114,13 @@ const SelectItem = React.forwardRef<
111
114
  <SelectPrimitive.Item
112
115
  ref={ref}
113
116
  className={cn(
114
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
117
+ "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",
115
118
  className
116
119
  )}
117
120
  {...props}>
118
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
121
+ <span className="bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center">
119
122
  <SelectPrimitive.ItemIndicator>
120
- <Check className="h-4 w-4" />
123
+ <Check className="bn-h-4 bn-w-4" />
121
124
  </SelectPrimitive.ItemIndicator>
122
125
  </span>
123
126
 
@@ -132,7 +135,7 @@ const SelectSeparator = React.forwardRef<
132
135
  >(({ className, ...props }, ref) => (
133
136
  <SelectPrimitive.Separator
134
137
  ref={ref}
135
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
138
+ className={cn("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted", className)}
136
139
  {...props}
137
140
  />
138
141
  ));
@@ -12,7 +12,7 @@ const TabsList = React.forwardRef<
12
12
  <TabsPrimitive.List
13
13
  ref={ref}
14
14
  className={cn(
15
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
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
16
  className
17
17
  )}
18
18
  {...props}
@@ -27,7 +27,7 @@ const TabsTrigger = React.forwardRef<
27
27
  <TabsPrimitive.Trigger
28
28
  ref={ref}
29
29
  className={cn(
30
- "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
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
31
  className
32
32
  )}
33
33
  {...props}
@@ -42,7 +42,7 @@ const TabsContent = React.forwardRef<
42
42
  <TabsPrimitive.Content
43
43
  ref={ref}
44
44
  className={cn(
45
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
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
46
  className
47
47
  )}
48
48
  {...props}
@@ -5,18 +5,18 @@ import { cva, type VariantProps } from "class-variance-authority";
5
5
  import { cn } from "../../lib/utils";
6
6
 
7
7
  const toggleVariants = cva(
8
- "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
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",
9
9
  {
10
10
  variants: {
11
11
  variant: {
12
- default: "bg-transparent",
12
+ default: "bn-bg-transparent",
13
13
  outline:
14
- "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
14
+ "bn-border bn-border-input bn-bg-transparent hover:bn-bg-accent hover:bn-text-accent-foreground",
15
15
  },
16
16
  size: {
17
- default: "h-10 px-3",
18
- sm: "h-9 px-2.5",
19
- lg: "h-11 px-5",
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",
20
20
  },
21
21
  },
22
22
  defaultVariants: {
@@ -17,7 +17,7 @@ const TooltipContent = React.forwardRef<
17
17
  ref={ref}
18
18
  sideOffset={sideOffset}
19
19
  className={cn(
20
- "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
20
+ "bn-z-50 bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-px-3 bn-py-1.5 bn-text-sm bn-text-popover-foreground bn-shadow-md bn-animate-in bn-fade-in-0 bn-zoom-in-95 data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=closed]:bn-zoom-out-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
21
  className
22
22
  )}
23
23
  {...props}
@@ -4,58 +4,60 @@ import { forwardRef } from "react";
4
4
 
5
5
  import { useShadCNComponentsContext } from "../ShadCNComponentsContext";
6
6
 
7
- export const TextInput = forwardRef(
8
- (props: ComponentProps["Generic"]["Form"]["TextInput"]) => {
9
- const {
10
- className,
11
- name,
12
- label,
13
- icon, // TODO: implement
14
- value,
15
- autoFocus,
16
- placeholder,
17
- onKeyDown,
18
- onChange,
19
- onSubmit,
20
- ...rest
21
- } = props;
7
+ export const TextInput = forwardRef<
8
+ HTMLInputElement,
9
+ ComponentProps["Generic"]["Form"]["TextInput"]
10
+ >((props, ref) => {
11
+ const {
12
+ className,
13
+ name,
14
+ label,
15
+ icon, // TODO: implement
16
+ value,
17
+ autoFocus,
18
+ placeholder,
19
+ onKeyDown,
20
+ onChange,
21
+ onSubmit,
22
+ ...rest
23
+ } = props;
22
24
 
23
- assertEmpty(rest);
25
+ assertEmpty(rest);
24
26
 
25
- const ShadCNComponents = useShadCNComponentsContext()!;
26
-
27
- if (!label) {
28
- return (
29
- <ShadCNComponents.Input.Input
30
- aria-label={name}
31
- name={name}
32
- autoFocus={autoFocus}
33
- placeholder={placeholder}
34
- value={value}
35
- onKeyDown={onKeyDown}
36
- onChange={onChange}
37
- onSubmit={onSubmit}
38
- />
39
- );
40
- }
27
+ const ShadCNComponents = useShadCNComponentsContext()!;
41
28
 
29
+ if (!label) {
42
30
  return (
43
- <div>
44
- <ShadCNComponents.Label.Label htmlFor={label}>
45
- {label}
46
- </ShadCNComponents.Label.Label>
47
- <ShadCNComponents.Input.Input
48
- className={className}
49
- id={label}
50
- name={name}
51
- autoFocus={autoFocus}
52
- placeholder={placeholder}
53
- value={value}
54
- onKeyDown={onKeyDown}
55
- onChange={onChange}
56
- onSubmit={onSubmit}
57
- />
58
- </div>
31
+ <ShadCNComponents.Input.Input
32
+ aria-label={name}
33
+ name={name}
34
+ autoFocus={autoFocus}
35
+ placeholder={placeholder}
36
+ value={value}
37
+ onKeyDown={onKeyDown}
38
+ onChange={onChange}
39
+ onSubmit={onSubmit}
40
+ ref={ref}
41
+ />
59
42
  );
60
43
  }
61
- );
44
+
45
+ return (
46
+ <div>
47
+ <ShadCNComponents.Label.Label htmlFor={label}>
48
+ {label}
49
+ </ShadCNComponents.Label.Label>
50
+ <ShadCNComponents.Input.Input
51
+ className={className}
52
+ id={label}
53
+ name={name}
54
+ autoFocus={autoFocus}
55
+ placeholder={placeholder}
56
+ value={value}
57
+ onKeyDown={onKeyDown}
58
+ onChange={onChange}
59
+ onSubmit={onSubmit}
60
+ />
61
+ </div>
62
+ );
63
+ });
package/src/index.tsx CHANGED
@@ -1,4 +1,9 @@
1
- import { BlockSchema, InlineContentSchema, StyleSchema } from "@blocknote/core";
1
+ import {
2
+ BlockSchema,
3
+ InlineContentSchema,
4
+ mergeCSSClasses,
5
+ StyleSchema,
6
+ } from "@blocknote/core";
2
7
  import {
3
8
  BlockNoteViewRaw,
4
9
  Components,
@@ -103,19 +108,22 @@ export const BlockNoteView = <
103
108
  shadCNComponents?: Partial<ShadCNComponents>;
104
109
  }
105
110
  ) => {
106
- const { shadCNComponents, ...rest } = props;
111
+ const { className, shadCNComponents, ...rest } = props;
107
112
 
108
113
  const componentsValue = useMemo(() => {
109
114
  return {
110
- ...shadCNComponents,
111
115
  ...ShadCNDefaultComponents,
116
+ ...shadCNComponents,
112
117
  };
113
118
  }, [shadCNComponents]);
114
119
 
115
120
  return (
116
121
  <ShadCNComponentsContext.Provider value={componentsValue}>
117
122
  <ComponentsContext.Provider value={components}>
118
- <BlockNoteViewRaw {...rest} />
123
+ <BlockNoteViewRaw
124
+ className={mergeCSSClasses("bn-shadcn", className || "")}
125
+ {...rest}
126
+ />
119
127
  </ComponentsContext.Provider>
120
128
  </ShadCNComponentsContext.Provider>
121
129
  );
package/src/lib/utils.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  import { type ClassValue, clsx } from "clsx";
2
- import { twMerge } from "tailwind-merge";
2
+ import { extendTailwindMerge } from "tailwind-merge";
3
+
4
+ // Ensures that `bn-` prefixed Tailwind classes are recognized as Tailwind
5
+ // classes, so they can be merged correctly.
6
+ const twMerge = extendTailwindMerge({
7
+ prefix: "bn-",
8
+ });
3
9
 
4
10
  export function cn(...inputs: ClassValue[]) {
5
11
  return twMerge(clsx(inputs));
package/src/menu/Menu.tsx CHANGED
@@ -147,7 +147,7 @@ export const MenuItem = forwardRef<
147
147
  if (checked !== undefined) {
148
148
  return (
149
149
  <ShadCNComponents.DropdownMenu.DropdownMenuCheckboxItem
150
- className={cn(className, "gap-1")}
150
+ className={cn(className, "bn-gap-1")}
151
151
  ref={ref}
152
152
  checked={checked}
153
153
  onClick={onClick}
@@ -166,7 +166,7 @@ export const MenuItem = forwardRef<
166
166
  {...rest}>
167
167
  {icon}
168
168
  {children}
169
- {subTrigger && <ChevronRight className="ml-auto h-4 w-4" />}
169
+ {subTrigger && <ChevronRight className="bn-ml-auto bn-h-4 bn-w-4" />}
170
170
  </ShadCNComponents.DropdownMenu.DropdownMenuItem>
171
171
  );
172
172
  });
@@ -25,7 +25,7 @@ export const Panel = forwardRef<
25
25
 
26
26
  return (
27
27
  <ShadCNComponents.Tabs.Tabs
28
- className={cn(className, "bg-popover p-2 rounded-lg")}
28
+ className={cn(className, "bn-bg-popover bn-p-2 bn-rounded-lg")}
29
29
  ref={ref}
30
30
  value={openTab}
31
31
  defaultValue={defaultOpenTab}
@@ -43,7 +43,7 @@ export const Panel = forwardRef<
43
43
  {tabs.map((tab) => (
44
44
  <ShadCNComponents.Tabs.TabsContent value={tab.name} key={tab.name}>
45
45
  <ShadCNComponents.Card.Card>
46
- <ShadCNComponents.Card.CardContent className={"p-4"}>
46
+ <ShadCNComponents.Card.CardContent className={"bn-p-4"}>
47
47
  {tab.tabPanel}
48
48
  </ShadCNComponents.Card.CardContent>
49
49
  </ShadCNComponents.Card.Card>
@@ -16,7 +16,7 @@ export const PanelTab = forwardRef<
16
16
  <div
17
17
  className={cn(
18
18
  className,
19
- "flex flex-col gap-2 items-start justify-center"
19
+ "bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"
20
20
  )}
21
21
  ref={ref}>
22
22
  {children}
@@ -18,7 +18,7 @@ export const PanelTextInput = forwardRef<
18
18
  return (
19
19
  <ShadCNComponents.Input.Input
20
20
  data-test={"embed-input"}
21
- className={cn(className, "w-80")}
21
+ className={cn(className, "bn-w-80")}
22
22
  ref={ref}
23
23
  value={value}
24
24
  placeholder={placeholder}
@@ -57,9 +57,9 @@ export const PopoverContent = forwardRef<
57
57
  sideOffset={8}
58
58
  className={cn(
59
59
  className,
60
- "flex flex-col gap-2",
60
+ "bn-flex bn-flex-col bn-gap-2",
61
61
  variant === "panel-popover"
62
- ? "p-0 border-none shadow-none max-w-none w-fit"
62
+ ? "bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit"
63
63
  : ""
64
64
  )}
65
65
  ref={ref}>
@@ -30,7 +30,7 @@ export const SideMenuButton = forwardRef<
30
30
  return (
31
31
  <ShadCNComponents.Button.Button
32
32
  variant={"ghost"}
33
- className={cn(className, "text-gray-400")}
33
+ className={cn(className, "bn-text-gray-400")}
34
34
  ref={ref}
35
35
  aria-label={label}
36
36
  onClick={onClick}
package/src/style.css CHANGED
@@ -1,10 +1,10 @@
1
+ @import "./tailwindStyles.css";
1
2
  @import url("@blocknote/react/style.css");
2
3
 
3
- @tailwind base;
4
4
  @tailwind components;
5
5
  @tailwind utilities;
6
6
 
7
- .bn-container {
7
+ .bn-shadcn {
8
8
  --background: 0 0% 100%;
9
9
  --foreground: 222.2 84% 4.9%;
10
10
 
@@ -36,7 +36,7 @@
36
36
  --radius: 0.5rem;
37
37
  }
38
38
 
39
- .bn-container.dark {
39
+ .bn-shadcn.dark {
40
40
  --background: 222.2 84% 4.9%;
41
41
  --foreground: 210 40% 98%;
42
42
 
@@ -66,45 +66,46 @@
66
66
  --ring: 212.7 26.8% 83.9%;
67
67
  }
68
68
 
69
- .bn-container * {
70
- @apply border-border;
69
+ .bn-shadcn * {
70
+ @apply bn-border-border;
71
71
  }
72
- .bn-editor {
73
- @apply bg-background text-foreground;
72
+
73
+ .bn-shadcn .bn-editor {
74
+ @apply bn-bg-background bn-text-foreground;
74
75
  }
75
76
 
76
- [data-radix-popper-content-wrapper] {
77
+ .bn-shadcn [data-radix-popper-content-wrapper] {
77
78
  z-index: 99999 !important;
78
79
  }
79
80
 
80
- .bn-editor:focus-visible {
81
+ .bn-shadcn .bn-editor:focus-visible {
81
82
  outline: none;
82
83
  }
83
84
 
84
- .bn-side-menu {
85
+ .bn-shadcn .bn-side-menu {
85
86
  align-items: center;
86
87
  display: flex;
87
88
  justify-content: center;
88
89
  }
89
90
 
90
- .bn-side-menu .bn-button {
91
+ .bn-shadcn .bn-side-menu .bn-button {
91
92
  padding: 0;
92
93
  height: 24px;
93
94
  }
94
95
 
95
- .bn-select {
96
+ .bn-shadcn .bn-select {
96
97
  max-height: var(--radix-select-content-available-height);
97
98
  }
98
99
 
99
- .bn-menu-dropdown {
100
+ .bn-shadcn .bn-menu-dropdown {
100
101
  max-height: var(--radix-dropdown-menu-content-available-height);
101
102
  }
102
103
 
103
- .bn-color-picker-dropdown {
104
+ .bn-shadcn .bn-color-picker-dropdown {
104
105
  overflow: auto;
105
106
  }
106
107
 
107
- .bn-suggestion-menu-item[aria-selected="true"],
108
- .bn-suggestion-menu-item:hover {
108
+ .bn-shadcn .bn-suggestion-menu-item[aria-selected="true"],
109
+ .bn-shadcn .bn-suggestion-menu-item:hover {
109
110
  background-color: hsl(var(--accent));
110
111
  }
@@ -18,7 +18,7 @@ export const SuggestionMenu = forwardRef<
18
18
  role="listbox"
19
19
  // Styles from ShadCN DropdownMenuContent component
20
20
  className={cn(
21
- "z-50 min-w-[8rem] overflow-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",
21
+ "bn-z-50 bn-min-w-[8rem] bn-overflow-auto bn-rounded-md bn-border bn-bg-popover bn-p-1 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",
22
22
  className
23
23
  )}
24
24
  ref={ref}>
@@ -16,7 +16,7 @@ export const SuggestionMenuEmptyItem = forwardRef<
16
16
  <div
17
17
  // Styles from ShadCN DropdownMenuItem component
18
18
  className={cn(
19
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
19
+ "bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",
20
20
  className
21
21
  )}
22
22
  ref={ref}>
@@ -35,7 +35,7 @@ export const SuggestionMenuItem = forwardRef<
35
35
  <div
36
36
  // Styles from ShadCN DropdownMenuItem component
37
37
  className={cn(
38
- "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
38
+ "bn-relative bn-flex bn-cursor-pointer bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",
39
39
  className
40
40
  )}
41
41
  ref={mergeRefs([ref, itemRef])}
@@ -44,16 +44,16 @@ export const SuggestionMenuItem = forwardRef<
44
44
  role="option"
45
45
  aria-selected={isSelected || undefined}>
46
46
  {item.icon && (
47
- <div className="p-3" data-position="left">
47
+ <div className="bn-p-3" data-position="left">
48
48
  {item.icon}
49
49
  </div>
50
50
  )}
51
- <div className="flex-1">
52
- <div className="text-base">{item.title}</div>
53
- <div className="text-xs">{item.subtext}</div>
51
+ <div className="bn-flex-1">
52
+ <div className="bn-text-base">{item.title}</div>
53
+ <div className="bn-text-xs">{item.subtext}</div>
54
54
  </div>
55
55
  {item.badge && (
56
- <div data-position="right" className="text-xs">
56
+ <div data-position="right" className="bn-text-xs">
57
57
  <ShadCNComponents.Badge.Badge variant={"secondary"}>
58
58
  {item.badge}
59
59
  </ShadCNComponents.Badge.Badge>
@@ -15,7 +15,7 @@ export const SuggestionMenuLabel = forwardRef<
15
15
  return (
16
16
  <div
17
17
  // Styles from ShadCN DropdownMenuLabel component
18
- className={cn("px-2 py-1.5 text-sm font-semibold", className)}
18
+ className={cn("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold", className)}
19
19
  ref={ref}>
20
20
  {children}
21
21
  </div>
@@ -29,7 +29,7 @@ export const TableHandle = forwardRef<
29
29
  return (
30
30
  <ShadCNComponents.Button.Button
31
31
  variant={"ghost"}
32
- className={cn(className, "p-0 h-fit w-fit text-gray-400")}
32
+ className={cn(className, "bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400")}
33
33
  ref={ref}
34
34
  aria-label={label}
35
35
  draggable={draggable}