@blocknote/shadcn 0.47.3 → 0.48.1

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.
@@ -1,1791 +1,1141 @@
1
- import { jsx as o, jsxs as v, Fragment as H } from "react/jsx-runtime";
2
- import { assertEmpty as m, mergeCSSClasses as K } from "@blocknote/core";
3
- import { elementOverflow as _, mergeRefs as R, useFocusWithin as Q, useDictionary as W, useBlockNoteContext as Z, FormattingToolbarController as J, getFormattingToolbarItems as X, FormattingToolbar as Y, ComponentsContext as ee, BlockNoteViewRaw as te } from "@blocknote/react";
4
- import * as F from "react";
5
- import { createContext as ne, useContext as oe, forwardRef as p, useMemo as L, useRef as E, useEffect as A, useState as ae } from "react";
6
- import { FormProvider as re, useForm as se } from "react-hook-form";
7
- import * as D from "@radix-ui/react-avatar";
8
- import { clsx as ie } from "clsx";
9
- import { twMerge as de } from "tailwind-merge";
10
- import { Slot as V } from "@radix-ui/react-slot";
11
- import { cva as I } from "class-variance-authority";
12
- import * as w from "@radix-ui/react-dropdown-menu";
13
- import { ChevronRightIcon as le, CheckIcon as j, ChevronDownIcon as q, ChevronUpIcon as ce, ChevronRight as ue } from "lucide-react";
14
- import * as me from "@radix-ui/react-label";
15
- import * as B from "@radix-ui/react-popover";
16
- import * as x from "@radix-ui/react-select";
17
- import * as S from "@radix-ui/react-tabs";
18
- import * as pe from "@radix-ui/react-toggle";
19
- import * as N from "@radix-ui/react-tooltip";
20
- function d(...e) {
21
- return de(ie(e));
1
+ import { assertEmpty as e, mergeCSSClasses as t } from "@blocknote/core";
2
+ import { BlockNoteViewRaw as n, ComponentsContext as r, FormattingToolbar as i, FormattingToolbarController as a, elementOverflow as o, getFormattingToolbarItems as s, mergeRefs as c, useBlockNoteContext as l, useDictionary as u, useFocusWithin as d } from "@blocknote/react";
3
+ import * as f from "react";
4
+ import { createContext as p, forwardRef as m, useContext as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
5
+ import { FormProvider as ee, useForm as te } from "react-hook-form";
6
+ import * as b from "@radix-ui/react-avatar";
7
+ import { clsx as ne } from "clsx";
8
+ import { twMerge as re } from "tailwind-merge";
9
+ import { Fragment as ie, jsx as x, jsxs as S } from "react/jsx-runtime";
10
+ import { Slot as C } from "@radix-ui/react-slot";
11
+ import { cva as w } from "class-variance-authority";
12
+ import * as T from "@radix-ui/react-dropdown-menu";
13
+ import { CheckIcon as E, ChevronDownIcon as D, ChevronRight as ae, ChevronRightIcon as oe, ChevronUpIcon as se } from "lucide-react";
14
+ import * as ce from "@radix-ui/react-label";
15
+ import * as O from "@radix-ui/react-popover";
16
+ import * as k from "@radix-ui/react-select";
17
+ import * as A from "@radix-ui/react-tabs";
18
+ import * as le from "@radix-ui/react-toggle";
19
+ import * as j from "@radix-ui/react-tooltip";
20
+ import { createPortal as ue } from "react-dom";
21
+ //#region src/lib/utils.ts
22
+ function M(...e) {
23
+ return re(ne(e));
22
24
  }
23
- function ge({
24
- className: e,
25
- ...t
26
- }) {
27
- return /* @__PURE__ */ o(
28
- D.Root,
29
- {
30
- "data-slot": "avatar",
31
- className: d(
32
- "relative flex size-8 shrink-0 overflow-hidden rounded-full",
33
- e
34
- ),
35
- ...t
36
- }
37
- );
25
+ //#endregion
26
+ //#region src/components/ui/avatar.tsx
27
+ function de({ className: e, ...t }) {
28
+ return /* @__PURE__ */ x(b.Root, {
29
+ "data-slot": "avatar",
30
+ className: M("relative flex size-8 shrink-0 overflow-hidden rounded-full", e),
31
+ ...t
32
+ });
38
33
  }
39
- function ve({
40
- className: e,
41
- ...t
42
- }) {
43
- return /* @__PURE__ */ o(
44
- D.Image,
45
- {
46
- "data-slot": "avatar-image",
47
- className: d("aspect-square size-full", e),
48
- ...t
49
- }
50
- );
34
+ function N({ className: e, ...t }) {
35
+ return /* @__PURE__ */ x(b.Image, {
36
+ "data-slot": "avatar-image",
37
+ className: M("aspect-square size-full", e),
38
+ ...t
39
+ });
51
40
  }
52
- function fe({
53
- className: e,
54
- ...t
55
- }) {
56
- return /* @__PURE__ */ o(
57
- D.Fallback,
58
- {
59
- "data-slot": "avatar-fallback",
60
- className: d(
61
- "bg-muted flex size-full items-center justify-center rounded-full",
62
- e
63
- ),
64
- ...t
65
- }
66
- );
41
+ function P({ className: e, ...t }) {
42
+ return /* @__PURE__ */ x(b.Fallback, {
43
+ "data-slot": "avatar-fallback",
44
+ className: M("bg-muted flex size-full items-center justify-center rounded-full", e),
45
+ ...t
46
+ });
67
47
  }
68
- const be = I(
69
- "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden",
70
- {
71
- variants: {
72
- variant: {
73
- default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
74
- secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
75
- destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
76
- outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
77
- }
78
- },
79
- defaultVariants: {
80
- variant: "default"
81
- }
82
- }
83
- );
84
- function he({
85
- className: e,
86
- variant: t,
87
- asChild: n = !1,
88
- ...a
89
- }) {
90
- return /* @__PURE__ */ o(
91
- n ? V : "span",
92
- {
93
- "data-slot": "badge",
94
- className: d(be({ variant: t }), e),
95
- ...a
96
- }
97
- );
48
+ //#endregion
49
+ //#region src/components/ui/badge.tsx
50
+ var F = w("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden", {
51
+ variants: { variant: {
52
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
53
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
54
+ destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
55
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
56
+ } },
57
+ defaultVariants: { variant: "default" }
58
+ });
59
+ function I({ className: e, variant: t, asChild: n = !1, ...r }) {
60
+ return /* @__PURE__ */ x(n ? C : "span", {
61
+ "data-slot": "badge",
62
+ className: M(F({ variant: t }), e),
63
+ ...r
64
+ });
98
65
  }
99
- const xe = I(
100
- "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",
101
- {
102
- variants: {
103
- variant: {
104
- default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
105
- destructive: "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",
106
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
107
- secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
108
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
109
- link: "text-primary underline-offset-4 hover:underline"
110
- },
111
- size: {
112
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
113
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
114
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
115
- icon: "size-9"
116
- }
117
- },
118
- defaultVariants: {
119
- variant: "default",
120
- size: "default"
121
- }
122
- }
123
- );
124
- function we({
125
- className: e,
126
- variant: t,
127
- size: n,
128
- asChild: a = !1,
129
- ...r
130
- }) {
131
- return /* @__PURE__ */ o(
132
- a ? V : "button",
133
- {
134
- "data-slot": "button",
135
- className: d(xe({ variant: t, size: n, className: e })),
136
- ...r
137
- }
138
- );
66
+ //#endregion
67
+ //#region src/components/ui/button.tsx
68
+ var L = w("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", {
69
+ variants: {
70
+ variant: {
71
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
72
+ destructive: "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",
73
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
74
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
75
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
76
+ link: "text-primary underline-offset-4 hover:underline"
77
+ },
78
+ size: {
79
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
80
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
81
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
82
+ icon: "size-9"
83
+ }
84
+ },
85
+ defaultVariants: {
86
+ variant: "default",
87
+ size: "default"
88
+ }
89
+ });
90
+ function R({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
91
+ return /* @__PURE__ */ x(r ? C : "button", {
92
+ "data-slot": "button",
93
+ className: M(L({
94
+ variant: t,
95
+ size: n,
96
+ className: e
97
+ })),
98
+ ...i
99
+ });
139
100
  }
140
- function Ce({ className: e, ...t }) {
141
- return /* @__PURE__ */ o(
142
- "div",
143
- {
144
- "data-slot": "card",
145
- className: d(
146
- "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
147
- e
148
- ),
149
- ...t
150
- }
151
- );
101
+ //#endregion
102
+ //#region src/components/ui/card.tsx
103
+ function z({ className: e, ...t }) {
104
+ return /* @__PURE__ */ x("div", {
105
+ "data-slot": "card",
106
+ className: M("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", e),
107
+ ...t
108
+ });
152
109
  }
153
- function Ne({ className: e, ...t }) {
154
- return /* @__PURE__ */ o(
155
- "div",
156
- {
157
- "data-slot": "card-content",
158
- className: d("px-6", e),
159
- ...t
160
- }
161
- );
110
+ function B({ className: e, ...t }) {
111
+ return /* @__PURE__ */ x("div", {
112
+ "data-slot": "card-content",
113
+ className: M("px-6", e),
114
+ ...t
115
+ });
162
116
  }
163
- function Te({
164
- ...e
165
- }) {
166
- return /* @__PURE__ */ o(w.Root, { "data-slot": "dropdown-menu", ...e });
117
+ //#endregion
118
+ //#region src/components/ui/dropdown-menu.tsx
119
+ function V({ ...e }) {
120
+ return /* @__PURE__ */ x(T.Root, {
121
+ "data-slot": "dropdown-menu",
122
+ ...e
123
+ });
167
124
  }
168
- function Se({
169
- ...e
170
- }) {
171
- return /* @__PURE__ */ o(
172
- w.Trigger,
173
- {
174
- "data-slot": "dropdown-menu-trigger",
175
- ...e
176
- }
177
- );
125
+ function H({ ...e }) {
126
+ return /* @__PURE__ */ x(T.Trigger, {
127
+ "data-slot": "dropdown-menu-trigger",
128
+ ...e
129
+ });
178
130
  }
179
- function ye({
180
- className: e,
181
- sideOffset: t = 4,
182
- ...n
183
- }) {
184
- return /* @__PURE__ */ o(
185
- w.Content,
186
- {
187
- "data-slot": "dropdown-menu-content",
188
- sideOffset: t,
189
- className: d(
190
- "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-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md",
191
- e
192
- ),
193
- ...n
194
- }
195
- );
131
+ function fe({ className: e, sideOffset: t = 4, ...n }) {
132
+ return /* @__PURE__ */ x(T.Content, {
133
+ "data-slot": "dropdown-menu-content",
134
+ sideOffset: t,
135
+ className: M("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-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md", e),
136
+ ...n
137
+ });
196
138
  }
197
- function ke({
198
- className: e,
199
- inset: t,
200
- variant: n = "default",
201
- ...a
202
- }) {
203
- return /* @__PURE__ */ o(
204
- w.Item,
205
- {
206
- "data-slot": "dropdown-menu-item",
207
- "data-inset": t,
208
- "data-variant": n,
209
- className: d(
210
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
211
- e
212
- ),
213
- ...a
214
- }
215
- );
139
+ function pe({ className: e, inset: t, variant: n = "default", ...r }) {
140
+ return /* @__PURE__ */ x(T.Item, {
141
+ "data-slot": "dropdown-menu-item",
142
+ "data-inset": t,
143
+ "data-variant": n,
144
+ className: M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
145
+ ...r
146
+ });
216
147
  }
217
- function Me({
218
- className: e,
219
- children: t,
220
- checked: n,
221
- ...a
222
- }) {
223
- return /* @__PURE__ */ v(
224
- w.CheckboxItem,
225
- {
226
- "data-slot": "dropdown-menu-checkbox-item",
227
- className: d(
228
- "focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
229
- e
230
- ),
231
- checked: n,
232
- ...a,
233
- children: [
234
- /* @__PURE__ */ o("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ o(w.ItemIndicator, { children: /* @__PURE__ */ o(j, { className: "size-4" }) }) }),
235
- t
236
- ]
237
- }
238
- );
148
+ function me({ className: e, children: t, checked: n, ...r }) {
149
+ return /* @__PURE__ */ S(T.CheckboxItem, {
150
+ "data-slot": "dropdown-menu-checkbox-item",
151
+ className: M("focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
152
+ checked: n,
153
+ ...r,
154
+ children: [/* @__PURE__ */ x("span", {
155
+ className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
156
+ children: /* @__PURE__ */ x(T.ItemIndicator, { children: /* @__PURE__ */ x(E, { className: "size-4" }) })
157
+ }), t]
158
+ });
239
159
  }
240
- function ze({
241
- className: e,
242
- inset: t,
243
- ...n
244
- }) {
245
- return /* @__PURE__ */ o(
246
- w.Label,
247
- {
248
- "data-slot": "dropdown-menu-label",
249
- "data-inset": t,
250
- className: d(
251
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
252
- e
253
- ),
254
- ...n
255
- }
256
- );
160
+ function he({ className: e, inset: t, ...n }) {
161
+ return /* @__PURE__ */ x(T.Label, {
162
+ "data-slot": "dropdown-menu-label",
163
+ "data-inset": t,
164
+ className: M("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", e),
165
+ ...n
166
+ });
257
167
  }
258
- function De({
259
- className: e,
260
- ...t
261
- }) {
262
- return /* @__PURE__ */ o(
263
- w.Separator,
264
- {
265
- "data-slot": "dropdown-menu-separator",
266
- className: d("bg-border -mx-1 my-1 h-px", e),
267
- ...t
268
- }
269
- );
168
+ function ge({ className: e, ...t }) {
169
+ return /* @__PURE__ */ x(T.Separator, {
170
+ "data-slot": "dropdown-menu-separator",
171
+ className: M("bg-border -mx-1 my-1 h-px", e),
172
+ ...t
173
+ });
270
174
  }
271
- function Ie({
272
- ...e
273
- }) {
274
- return /* @__PURE__ */ o(w.Sub, { "data-slot": "dropdown-menu-sub", ...e });
175
+ function _e({ ...e }) {
176
+ return /* @__PURE__ */ x(T.Sub, {
177
+ "data-slot": "dropdown-menu-sub",
178
+ ...e
179
+ });
275
180
  }
276
- function Be({
277
- className: e,
278
- inset: t,
279
- children: n,
280
- ...a
281
- }) {
282
- return /* @__PURE__ */ v(
283
- w.SubTrigger,
284
- {
285
- "data-slot": "dropdown-menu-sub-trigger",
286
- "data-inset": t,
287
- className: d(
288
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm data-[inset]:pl-8",
289
- e
290
- ),
291
- ...a,
292
- children: [
293
- n,
294
- /* @__PURE__ */ o(le, { className: "ml-auto size-4" })
295
- ]
296
- }
297
- );
181
+ function ve({ className: e, inset: t, children: n, ...r }) {
182
+ return /* @__PURE__ */ S(T.SubTrigger, {
183
+ "data-slot": "dropdown-menu-sub-trigger",
184
+ "data-inset": t,
185
+ className: M("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground outline-hidden flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm data-[inset]:pl-8", e),
186
+ ...r,
187
+ children: [n, /* @__PURE__ */ x(oe, { className: "ml-auto size-4" })]
188
+ });
298
189
  }
299
- function Pe({
300
- className: e,
301
- ...t
302
- }) {
303
- return /* @__PURE__ */ o(
304
- w.SubContent,
305
- {
306
- "data-slot": "dropdown-menu-sub-content",
307
- className: d(
308
- "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-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg",
309
- e
310
- ),
311
- ...t
312
- }
313
- );
190
+ function ye({ className: e, ...t }) {
191
+ return /* @__PURE__ */ x(T.SubContent, {
192
+ "data-slot": "dropdown-menu-sub-content",
193
+ className: M("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-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg", e),
194
+ ...t
195
+ });
314
196
  }
315
- function _e({
316
- className: e,
317
- ...t
318
- }) {
319
- return /* @__PURE__ */ o(
320
- me.Root,
321
- {
322
- "data-slot": "label",
323
- className: d(
324
- "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",
325
- e
326
- ),
327
- ...t
328
- }
329
- );
197
+ //#endregion
198
+ //#region src/components/ui/label.tsx
199
+ function be({ className: e, ...t }) {
200
+ return /* @__PURE__ */ x(ce.Root, {
201
+ "data-slot": "label",
202
+ className: M("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", e),
203
+ ...t
204
+ });
330
205
  }
331
- const Re = re;
332
- F.createContext(
333
- {}
334
- );
335
- F.createContext(
336
- {}
337
- );
338
- function Fe({ className: e, type: t, ...n }) {
339
- return /* @__PURE__ */ o(
340
- "input",
341
- {
342
- type: t,
343
- "data-slot": "input",
344
- className: d(
345
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base outline-none transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
346
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
347
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
348
- e
349
- ),
350
- ...n
351
- }
352
- );
206
+ //#endregion
207
+ //#region src/components/ui/form.tsx
208
+ var xe = ee;
209
+ f.createContext({}), f.createContext({});
210
+ //#endregion
211
+ //#region src/components/ui/input.tsx
212
+ function Se({ className: e, type: t, ...n }) {
213
+ return /* @__PURE__ */ x("input", {
214
+ type: t,
215
+ "data-slot": "input",
216
+ className: M("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base outline-none transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "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", e),
217
+ ...n
218
+ });
353
219
  }
354
- function Le({
355
- ...e
356
- }) {
357
- return /* @__PURE__ */ o(B.Root, { "data-slot": "popover", ...e });
220
+ //#endregion
221
+ //#region src/components/ui/popover.tsx
222
+ function Ce({ ...e }) {
223
+ return /* @__PURE__ */ x(O.Root, {
224
+ "data-slot": "popover",
225
+ ...e
226
+ });
358
227
  }
359
- function Ee({
360
- ...e
361
- }) {
362
- return /* @__PURE__ */ o(B.Trigger, { "data-slot": "popover-trigger", ...e });
228
+ function we({ ...e }) {
229
+ return /* @__PURE__ */ x(O.Trigger, {
230
+ "data-slot": "popover-trigger",
231
+ ...e
232
+ });
363
233
  }
364
- function Ae({
365
- className: e,
366
- align: t = "center",
367
- sideOffset: n = 4,
368
- ...a
369
- }) {
370
- return /* @__PURE__ */ o(
371
- B.Content,
372
- {
373
- "data-slot": "popover-content",
374
- align: t,
375
- sideOffset: n,
376
- className: d(
377
- "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",
378
- e
379
- ),
380
- ...a
381
- }
382
- );
234
+ function Te({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
235
+ return /* @__PURE__ */ x(O.Content, {
236
+ "data-slot": "popover-content",
237
+ align: t,
238
+ sideOffset: n,
239
+ className: M("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", e),
240
+ ...r
241
+ });
383
242
  }
384
- function Ve({
385
- ...e
386
- }) {
387
- return /* @__PURE__ */ o(x.Root, { "data-slot": "select", ...e });
243
+ //#endregion
244
+ //#region src/components/ui/select.tsx
245
+ function Ee({ ...e }) {
246
+ return /* @__PURE__ */ x(k.Root, {
247
+ "data-slot": "select",
248
+ ...e
249
+ });
388
250
  }
389
- function je({
390
- ...e
391
- }) {
392
- return /* @__PURE__ */ o(x.Value, { "data-slot": "select-value", ...e });
251
+ function De({ ...e }) {
252
+ return /* @__PURE__ */ x(k.Value, {
253
+ "data-slot": "select-value",
254
+ ...e
255
+ });
393
256
  }
394
- function qe({
395
- className: e,
396
- size: t = "default",
397
- children: n,
398
- ...a
399
- }) {
400
- return /* @__PURE__ */ v(
401
- x.Trigger,
402
- {
403
- "data-slot": "select-trigger",
404
- "data-size": t,
405
- className: d(
406
- "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",
407
- e
408
- ),
409
- ...a,
410
- children: [
411
- n,
412
- /* @__PURE__ */ o(x.Icon, { asChild: !0, children: /* @__PURE__ */ o(q, { className: "size-4 opacity-50" }) })
413
- ]
414
- }
415
- );
257
+ function Oe({ className: e, size: t = "default", children: n, ...r }) {
258
+ return /* @__PURE__ */ S(k.Trigger, {
259
+ "data-slot": "select-trigger",
260
+ "data-size": t,
261
+ className: M("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", e),
262
+ ...r,
263
+ children: [n, /* @__PURE__ */ x(k.Icon, {
264
+ asChild: !0,
265
+ children: /* @__PURE__ */ x(D, { className: "size-4 opacity-50" })
266
+ })]
267
+ });
416
268
  }
417
- function $e({
418
- className: e,
419
- children: t,
420
- position: n = "popper",
421
- ...a
422
- }) {
423
- return /* @__PURE__ */ v(
424
- x.Content,
425
- {
426
- "data-slot": "select-content",
427
- className: d(
428
- "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",
429
- n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
430
- e
431
- ),
432
- position: n,
433
- ...a,
434
- children: [
435
- /* @__PURE__ */ o(Oe, {}),
436
- /* @__PURE__ */ o(
437
- x.Viewport,
438
- {
439
- className: d(
440
- "p-1",
441
- n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
442
- ),
443
- children: t
444
- }
445
- ),
446
- /* @__PURE__ */ o(Ue, {})
447
- ]
448
- }
449
- );
269
+ function ke({ className: e, children: t, position: n = "popper", ...r }) {
270
+ return /* @__PURE__ */ S(k.Content, {
271
+ "data-slot": "select-content",
272
+ className: M("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", n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", e),
273
+ position: n,
274
+ ...r,
275
+ children: [
276
+ /* @__PURE__ */ x(je, {}),
277
+ /* @__PURE__ */ x(k.Viewport, {
278
+ className: M("p-1", n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
279
+ children: t
280
+ }),
281
+ /* @__PURE__ */ x(Me, {})
282
+ ]
283
+ });
450
284
  }
451
- function Ge({
452
- className: e,
453
- children: t,
454
- ...n
455
- }) {
456
- return /* @__PURE__ */ v(
457
- x.Item,
458
- {
459
- "data-slot": "select-item",
460
- className: d(
461
- "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",
462
- e
463
- ),
464
- ...n,
465
- children: [
466
- /* @__PURE__ */ o("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ o(x.ItemIndicator, { children: /* @__PURE__ */ o(j, { className: "size-4" }) }) }),
467
- /* @__PURE__ */ o(x.ItemText, { children: t })
468
- ]
469
- }
470
- );
285
+ function Ae({ className: e, children: t, ...n }) {
286
+ return /* @__PURE__ */ S(k.Item, {
287
+ "data-slot": "select-item",
288
+ className: M("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", e),
289
+ ...n,
290
+ children: [/* @__PURE__ */ x("span", {
291
+ className: "absolute right-2 flex size-3.5 items-center justify-center",
292
+ children: /* @__PURE__ */ x(k.ItemIndicator, { children: /* @__PURE__ */ x(E, { className: "size-4" }) })
293
+ }), /* @__PURE__ */ x(k.ItemText, { children: t })]
294
+ });
471
295
  }
472
- function Oe({
473
- className: e,
474
- ...t
475
- }) {
476
- return /* @__PURE__ */ o(
477
- x.ScrollUpButton,
478
- {
479
- "data-slot": "select-scroll-up-button",
480
- className: d(
481
- "flex cursor-default items-center justify-center py-1",
482
- e
483
- ),
484
- ...t,
485
- children: /* @__PURE__ */ o(ce, { className: "size-4" })
486
- }
487
- );
296
+ function je({ className: e, ...t }) {
297
+ return /* @__PURE__ */ x(k.ScrollUpButton, {
298
+ "data-slot": "select-scroll-up-button",
299
+ className: M("flex cursor-default items-center justify-center py-1", e),
300
+ ...t,
301
+ children: /* @__PURE__ */ x(se, { className: "size-4" })
302
+ });
488
303
  }
489
- function Ue({
490
- className: e,
491
- ...t
492
- }) {
493
- return /* @__PURE__ */ o(
494
- x.ScrollDownButton,
495
- {
496
- "data-slot": "select-scroll-down-button",
497
- className: d(
498
- "flex cursor-default items-center justify-center py-1",
499
- e
500
- ),
501
- ...t,
502
- children: /* @__PURE__ */ o(q, { className: "size-4" })
503
- }
504
- );
304
+ function Me({ className: e, ...t }) {
305
+ return /* @__PURE__ */ x(k.ScrollDownButton, {
306
+ "data-slot": "select-scroll-down-button",
307
+ className: M("flex cursor-default items-center justify-center py-1", e),
308
+ ...t,
309
+ children: /* @__PURE__ */ x(D, { className: "size-4" })
310
+ });
505
311
  }
506
- function He({ className: e, ...t }) {
507
- return /* @__PURE__ */ o(
508
- "div",
509
- {
510
- "data-slot": "skeleton",
511
- className: d("bg-accent animate-pulse rounded-md", e),
512
- ...t
513
- }
514
- );
312
+ //#endregion
313
+ //#region src/components/ui/skeleton.tsx
314
+ function Ne({ className: e, ...t }) {
315
+ return /* @__PURE__ */ x("div", {
316
+ "data-slot": "skeleton",
317
+ className: M("bg-accent animate-pulse rounded-md", e),
318
+ ...t
319
+ });
515
320
  }
516
- function Ke({
517
- className: e,
518
- ...t
519
- }) {
520
- return /* @__PURE__ */ o(
521
- S.Root,
522
- {
523
- "data-slot": "tabs",
524
- className: d("flex flex-col gap-2", e),
525
- ...t
526
- }
527
- );
321
+ //#endregion
322
+ //#region src/components/ui/tabs.tsx
323
+ function Pe({ className: e, ...t }) {
324
+ return /* @__PURE__ */ x(A.Root, {
325
+ "data-slot": "tabs",
326
+ className: M("flex flex-col gap-2", e),
327
+ ...t
328
+ });
528
329
  }
529
- function Qe({
530
- className: e,
531
- ...t
532
- }) {
533
- return /* @__PURE__ */ o(
534
- S.List,
535
- {
536
- "data-slot": "tabs-list",
537
- className: d(
538
- "bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
539
- e
540
- ),
541
- ...t
542
- }
543
- );
330
+ function Fe({ className: e, ...t }) {
331
+ return /* @__PURE__ */ x(A.List, {
332
+ "data-slot": "tabs-list",
333
+ className: M("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", e),
334
+ ...t
335
+ });
544
336
  }
545
- function We({
546
- className: e,
547
- ...t
548
- }) {
549
- return /* @__PURE__ */ o(
550
- S.Trigger,
551
- {
552
- "data-slot": "tabs-trigger",
553
- className: d(
554
- "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",
555
- e
556
- ),
557
- ...t
558
- }
559
- );
337
+ function Ie({ className: e, ...t }) {
338
+ return /* @__PURE__ */ x(A.Trigger, {
339
+ "data-slot": "tabs-trigger",
340
+ className: M("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", e),
341
+ ...t
342
+ });
560
343
  }
561
- function Ze({
562
- className: e,
563
- ...t
564
- }) {
565
- return /* @__PURE__ */ o(
566
- S.Content,
567
- {
568
- "data-slot": "tabs-content",
569
- className: d("flex-1 outline-none", e),
570
- ...t
571
- }
572
- );
344
+ function Le({ className: e, ...t }) {
345
+ return /* @__PURE__ */ x(A.Content, {
346
+ "data-slot": "tabs-content",
347
+ className: M("flex-1 outline-none", e),
348
+ ...t
349
+ });
573
350
  }
574
- const Je = I(
575
- "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",
576
- {
577
- variants: {
578
- variant: {
579
- default: "bg-transparent",
580
- outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
581
- },
582
- size: {
583
- default: "h-9 px-2 min-w-9",
584
- sm: "h-8 px-1.5 min-w-8",
585
- lg: "h-10 px-2.5 min-w-10"
586
- }
587
- },
588
- defaultVariants: {
589
- variant: "default",
590
- size: "default"
591
- }
592
- }
593
- );
594
- function Xe({
595
- className: e,
596
- variant: t,
597
- size: n,
598
- ...a
599
- }) {
600
- return /* @__PURE__ */ o(
601
- pe.Root,
602
- {
603
- "data-slot": "toggle",
604
- className: d(Je({ variant: t, size: n, className: e })),
605
- ...a
606
- }
607
- );
351
+ //#endregion
352
+ //#region src/components/ui/toggle.tsx
353
+ var Re = w("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", {
354
+ variants: {
355
+ variant: {
356
+ default: "bg-transparent",
357
+ outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
358
+ },
359
+ size: {
360
+ default: "h-9 px-2 min-w-9",
361
+ sm: "h-8 px-1.5 min-w-8",
362
+ lg: "h-10 px-2.5 min-w-10"
363
+ }
364
+ },
365
+ defaultVariants: {
366
+ variant: "default",
367
+ size: "default"
368
+ }
369
+ });
370
+ function ze({ className: e, variant: t, size: n, ...r }) {
371
+ return /* @__PURE__ */ x(le.Root, {
372
+ "data-slot": "toggle",
373
+ className: M(Re({
374
+ variant: t,
375
+ size: n,
376
+ className: e
377
+ })),
378
+ ...r
379
+ });
608
380
  }
609
- function $({
610
- delayDuration: e = 0,
611
- ...t
612
- }) {
613
- return /* @__PURE__ */ o(
614
- N.Provider,
615
- {
616
- "data-slot": "tooltip-provider",
617
- delayDuration: e,
618
- ...t
619
- }
620
- );
381
+ //#endregion
382
+ //#region src/components/ui/tooltip.tsx
383
+ function U({ delayDuration: e = 0, ...t }) {
384
+ return /* @__PURE__ */ x(j.Provider, {
385
+ "data-slot": "tooltip-provider",
386
+ delayDuration: e,
387
+ ...t
388
+ });
621
389
  }
622
- function Ye({
623
- ...e
624
- }) {
625
- return /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(N.Root, { "data-slot": "tooltip", ...e }) });
390
+ function Be({ ...e }) {
391
+ return /* @__PURE__ */ x(U, { children: /* @__PURE__ */ x(j.Root, {
392
+ "data-slot": "tooltip",
393
+ ...e
394
+ }) });
626
395
  }
627
- function et({
628
- ...e
629
- }) {
630
- return /* @__PURE__ */ o(N.Trigger, { "data-slot": "tooltip-trigger", ...e });
396
+ function Ve({ ...e }) {
397
+ return /* @__PURE__ */ x(j.Trigger, {
398
+ "data-slot": "tooltip-trigger",
399
+ ...e
400
+ });
631
401
  }
632
- function tt({
633
- className: e,
634
- sideOffset: t = 0,
635
- children: n,
636
- ...a
637
- }) {
638
- return /* @__PURE__ */ v(
639
- N.Content,
640
- {
641
- "data-slot": "tooltip-content",
642
- sideOffset: t,
643
- className: d(
644
- "bg-primary text-primary-foreground 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 origin-(--radix-tooltip-content-transform-origin) z-50 w-fit text-balance rounded-md px-3 py-1.5 text-xs",
645
- e
646
- ),
647
- ...a,
648
- children: [
649
- n,
650
- /* @__PURE__ */ o(N.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
651
- ]
652
- }
653
- );
402
+ function He({ className: e, sideOffset: t = 0, children: n, ...r }) {
403
+ return /* @__PURE__ */ S(j.Content, {
404
+ "data-slot": "tooltip-content",
405
+ sideOffset: t,
406
+ className: M("bg-primary text-primary-foreground 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 origin-(--radix-tooltip-content-transform-origin) z-50 w-fit text-balance rounded-md px-3 py-1.5 text-xs", e),
407
+ ...r,
408
+ children: [n, /* @__PURE__ */ x(j.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]
409
+ });
654
410
  }
655
- const nt = {
656
- Avatar: {
657
- Avatar: ge,
658
- AvatarFallback: fe,
659
- AvatarImage: ve
660
- },
661
- Badge: {
662
- Badge: he
663
- },
664
- Button: {
665
- Button: we
666
- },
667
- Card: {
668
- Card: Ce,
669
- CardContent: Ne
670
- },
671
- DropdownMenu: {
672
- DropdownMenu: Te,
673
- DropdownMenuCheckboxItem: Me,
674
- DropdownMenuContent: ye,
675
- DropdownMenuItem: ke,
676
- DropdownMenuLabel: ze,
677
- DropdownMenuSeparator: De,
678
- DropdownMenuSub: Ie,
679
- DropdownMenuSubContent: Pe,
680
- DropdownMenuSubTrigger: Be,
681
- DropdownMenuTrigger: Se
682
- },
683
- Form: {
684
- Form: Re
685
- },
686
- Input: {
687
- Input: Fe
688
- },
689
- Label: {
690
- Label: _e
691
- },
692
- Popover: {
693
- Popover: Le,
694
- PopoverContent: Ae,
695
- PopoverTrigger: Ee
696
- },
697
- Select: {
698
- Select: Ve,
699
- SelectContent: $e,
700
- SelectItem: Ge,
701
- SelectTrigger: qe,
702
- SelectValue: je
703
- },
704
- Skeleton: {
705
- Skeleton: He
706
- },
707
- Tabs: {
708
- Tabs: Ke,
709
- TabsContent: Ze,
710
- TabsList: Qe,
711
- TabsTrigger: We
712
- },
713
- Toggle: {
714
- Toggle: Xe
715
- },
716
- Tooltip: {
717
- Tooltip: Ye,
718
- TooltipContent: tt,
719
- TooltipProvider: $,
720
- TooltipTrigger: et
721
- }
722
- }, G = ne(void 0);
723
- function f() {
724
- return oe(G);
411
+ //#endregion
412
+ //#region src/ShadCNComponentsContext.tsx
413
+ var W = {
414
+ Avatar: {
415
+ Avatar: de,
416
+ AvatarFallback: P,
417
+ AvatarImage: N
418
+ },
419
+ Badge: { Badge: I },
420
+ Button: { Button: R },
421
+ Card: {
422
+ Card: z,
423
+ CardContent: B
424
+ },
425
+ DropdownMenu: {
426
+ DropdownMenu: V,
427
+ DropdownMenuCheckboxItem: me,
428
+ DropdownMenuContent: fe,
429
+ DropdownMenuItem: pe,
430
+ DropdownMenuLabel: he,
431
+ DropdownMenuSeparator: ge,
432
+ DropdownMenuSub: _e,
433
+ DropdownMenuSubContent: ye,
434
+ DropdownMenuSubTrigger: ve,
435
+ DropdownMenuTrigger: H
436
+ },
437
+ Form: { Form: xe },
438
+ Input: { Input: Se },
439
+ Label: { Label: be },
440
+ Popover: {
441
+ Popover: Ce,
442
+ PopoverContent: Te,
443
+ PopoverTrigger: we
444
+ },
445
+ Select: {
446
+ Select: Ee,
447
+ SelectContent: ke,
448
+ SelectItem: Ae,
449
+ SelectTrigger: Oe,
450
+ SelectValue: De
451
+ },
452
+ Skeleton: { Skeleton: Ne },
453
+ Tabs: {
454
+ Tabs: Pe,
455
+ TabsContent: Le,
456
+ TabsList: Fe,
457
+ TabsTrigger: Ie
458
+ },
459
+ Toggle: { Toggle: ze },
460
+ Tooltip: {
461
+ Tooltip: Be,
462
+ TooltipContent: He,
463
+ TooltipProvider: U,
464
+ TooltipTrigger: Ve
465
+ }
466
+ }, G = p(void 0);
467
+ function K() {
468
+ return h(G);
725
469
  }
726
- const ot = (e) => {
727
- const { children: t, ...n } = e;
728
- m(n);
729
- const a = f(), r = se();
730
- return /* @__PURE__ */ o(a.Form.Form, { ...r, children: t });
731
- }, at = p((e, t) => {
732
- const {
733
- className: n,
734
- name: a,
735
- label: r,
736
- variant: s,
737
- icon: i,
738
- // TODO: implement
739
- value: c,
740
- autoFocus: u,
741
- placeholder: l,
742
- disabled: g,
743
- onKeyDown: b,
744
- onChange: h,
745
- onSubmit: C,
746
- autoComplete: T,
747
- "aria-activedescendant": y,
748
- rightSection: O,
749
- // TODO: add rightSection
750
- ...U
751
- } = e;
752
- m(U);
753
- const P = f();
754
- return /* @__PURE__ */ v(
755
- "div",
756
- {
757
- className: d(
758
- n,
759
- "border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
760
- "text-foreground items-center gap-2"
761
- ),
762
- children: [
763
- i,
764
- /* @__PURE__ */ v("div", { className: "flex-1", children: [
765
- r && /* @__PURE__ */ o(P.Label.Label, { htmlFor: r, children: r }),
766
- /* @__PURE__ */ o(
767
- P.Input.Input,
768
- {
769
- className: d(n, "h-auto border-none p-0"),
770
- id: r,
771
- name: a,
772
- autoFocus: u,
773
- placeholder: l,
774
- disabled: g,
775
- value: c,
776
- onKeyDown: b,
777
- onChange: h,
778
- onSubmit: C,
779
- ref: t,
780
- "aria-activedescendant": y
781
- }
782
- )
783
- ] }),
784
- O
785
- ]
786
- }
787
- );
788
- }), rt = (e) => p(
789
- (t, n) => /* @__PURE__ */ o(
790
- e,
791
- {
792
- onPointerDown: (a) => {
793
- a.nativeEvent.fakeEvent || (a.ctrlKey = !0);
794
- },
795
- onPointerUp: (a) => {
796
- const r = new PointerEvent("pointerdown", a.nativeEvent);
797
- r.fakeEvent = !0, a.target.dispatchEvent(r);
798
- },
799
- ...t,
800
- ref: n
801
- }
802
- )
803
- ), st = (e) => {
804
- const {
805
- children: t,
806
- onOpenChange: n,
807
- position: a,
808
- // Unused
809
- sub: r,
810
- ...s
811
- } = e;
812
- m(s);
813
- const i = f();
814
- return r ? /* @__PURE__ */ o(
815
- i.DropdownMenu.DropdownMenuSub,
816
- {
817
- onOpenChange: n,
818
- children: t
819
- }
820
- ) : /* @__PURE__ */ o(
821
- i.DropdownMenu.DropdownMenu,
822
- {
823
- modal: !1,
824
- onOpenChange: n,
825
- children: t
826
- }
827
- );
828
- }, it = (e) => {
829
- const { children: t, sub: n, ...a } = e;
830
- m(a);
831
- const r = f(), s = L(
832
- () => rt(
833
- r.DropdownMenu.DropdownMenuTrigger
834
- ),
835
- [r.DropdownMenu.DropdownMenuTrigger]
836
- );
837
- return n ? /* @__PURE__ */ o(r.DropdownMenu.DropdownMenuSubTrigger, { children: t }) : /* @__PURE__ */ o(s, { asChild: !0, ...a, children: t });
838
- }, dt = p((e, t) => {
839
- const { className: n, children: a, sub: r, ...s } = e;
840
- m(s);
841
- const i = f();
842
- return r ? /* @__PURE__ */ o(
843
- i.DropdownMenu.DropdownMenuSubContent,
844
- {
845
- className: n,
846
- ref: t,
847
- children: a
848
- }
849
- ) : /* @__PURE__ */ o(
850
- i.DropdownMenu.DropdownMenuContent,
851
- {
852
- className: n,
853
- ref: t,
854
- children: a
855
- }
856
- );
857
- }), lt = p((e, t) => {
858
- const { className: n, children: a, icon: r, checked: s, subTrigger: i, onClick: c, ...u } = e;
859
- m(u);
860
- const l = f();
861
- return i ? /* @__PURE__ */ v(H, { children: [
862
- r,
863
- a
864
- ] }) : s !== void 0 ? /* @__PURE__ */ v(
865
- l.DropdownMenu.DropdownMenuCheckboxItem,
866
- {
867
- className: d(n, "gap-1", s ? "" : "px-2"),
868
- ref: t,
869
- checked: s,
870
- onClick: c,
871
- ...u,
872
- children: [
873
- r,
874
- a
875
- ]
876
- }
877
- ) : /* @__PURE__ */ v(
878
- l.DropdownMenu.DropdownMenuItem,
879
- {
880
- className: n,
881
- ref: t,
882
- onClick: c,
883
- ...u,
884
- children: [
885
- r,
886
- a,
887
- i && /* @__PURE__ */ o(ue, { className: "ml-auto h-4 w-4" })
888
- ]
889
- }
890
- );
891
- }), ct = p((e, t) => {
892
- const { className: n, ...a } = e;
893
- m(a);
894
- const r = f();
895
- return /* @__PURE__ */ o(
896
- r.DropdownMenu.DropdownMenuSeparator,
897
- {
898
- className: n,
899
- ref: t
900
- }
901
- );
902
- }), ut = p((e, t) => {
903
- const { className: n, children: a, ...r } = e;
904
- m(r);
905
- const s = f();
906
- return /* @__PURE__ */ o(
907
- s.DropdownMenu.DropdownMenuLabel,
908
- {
909
- className: n,
910
- ref: t,
911
- children: a
912
- }
913
- );
914
- }), mt = p((e, t) => {
915
- const {
916
- className: n,
917
- children: a,
918
- icon: r,
919
- onClick: s,
920
- onDragEnd: i,
921
- onDragStart: c,
922
- draggable: u,
923
- label: l,
924
- ...g
925
- } = e;
926
- m(g, !1);
927
- const b = f();
928
- return /* @__PURE__ */ v(
929
- b.Button.Button,
930
- {
931
- variant: "ghost",
932
- className: d(n, "text-gray-400"),
933
- ref: t,
934
- "aria-label": l,
935
- onClick: s,
936
- onDragStart: c,
937
- onDragEnd: i,
938
- draggable: u,
939
- ...g,
940
- children: [
941
- r,
942
- a
943
- ]
944
- }
945
- );
946
- }), pt = p((e, t) => {
947
- const {
948
- className: n,
949
- tabs: a,
950
- defaultOpenTab: r,
951
- openTab: s,
952
- setOpenTab: i,
953
- loading: c,
954
- // TODO: implement loader
955
- ...u
956
- } = e;
957
- m(u);
958
- const l = f();
959
- return /* @__PURE__ */ v(
960
- l.Tabs.Tabs,
961
- {
962
- className: d(n, "bg-popover max-w-screen rounded-lg p-2"),
963
- ref: t,
964
- value: s,
965
- defaultValue: r,
966
- onValueChange: i,
967
- children: [
968
- /* @__PURE__ */ o(l.Tabs.TabsList, { children: a.map((g) => /* @__PURE__ */ o(l.Tabs.TabsTrigger, { value: g.name, children: g.name }, g.name)) }),
969
- a.map((g) => /* @__PURE__ */ o(l.Tabs.TabsContent, { value: g.name, children: /* @__PURE__ */ o(l.Card.Card, { children: /* @__PURE__ */ o(l.Card.CardContent, { className: "p-4", children: g.tabPanel }) }) }, g.name))
970
- ]
971
- }
972
- );
973
- }), gt = p((e, t) => {
974
- const { className: n, children: a, ...r } = e;
975
- return m(r), /* @__PURE__ */ o(
976
- "div",
977
- {
978
- className: d(
979
- n,
980
- "flex flex-col items-start justify-center gap-2"
981
- ),
982
- ref: t,
983
- children: a
984
- }
985
- );
986
- }), vt = p((e, t) => {
987
- const { className: n, value: a, placeholder: r, onKeyDown: s, onChange: i, ...c } = e;
988
- m(c);
989
- const u = f();
990
- return /* @__PURE__ */ o(
991
- u.Input.Input,
992
- {
993
- "data-test": "embed-input",
994
- className: d(n, "w-80 max-w-full"),
995
- ref: t,
996
- value: a,
997
- placeholder: r,
998
- onKeyDown: s,
999
- onChange: i
1000
- }
1001
- );
1002
- }), ft = (e) => {
1003
- const {
1004
- children: t,
1005
- open: n,
1006
- onOpenChange: a,
1007
- position: r,
1008
- // unused
1009
- ...s
1010
- } = e;
1011
- m(s);
1012
- const i = f();
1013
- return /* @__PURE__ */ o(i.Popover.Popover, { open: n, onOpenChange: a, children: t });
1014
- }, bt = p(
1015
- (e, t) => {
1016
- const { children: n, ...a } = e;
1017
- m(a);
1018
- const r = f();
1019
- return /* @__PURE__ */ o(r.Popover.PopoverTrigger, { ref: t, asChild: !0, children: n });
1020
- }
1021
- ), ht = p((e, t) => {
1022
- const { className: n, variant: a, children: r, ...s } = e;
1023
- m(s);
1024
- const i = f();
1025
- return /* @__PURE__ */ o(
1026
- i.Popover.PopoverContent,
1027
- {
1028
- sideOffset: 8,
1029
- className: d(
1030
- n,
1031
- "z-[10000] flex flex-col gap-2",
1032
- a === "panel-popover" ? "w-fit max-w-none border-none p-0 shadow-none" : ""
1033
- ),
1034
- ref: t,
1035
- children: r
1036
- }
1037
- );
1038
- }), xt = p((e, t) => {
1039
- const { className: n, children: a, ...r } = e;
1040
- return m(r, !1), /* @__PURE__ */ o("div", { className: n, ref: t, ...r, children: a });
1041
- }), wt = p((e, t) => {
1042
- const {
1043
- className: n,
1044
- children: a,
1045
- icon: r,
1046
- onClick: s,
1047
- onDragEnd: i,
1048
- onDragStart: c,
1049
- draggable: u,
1050
- label: l,
1051
- ...g
1052
- } = e;
1053
- m(g, !1);
1054
- const b = f();
1055
- return /* @__PURE__ */ v(
1056
- b.Button.Button,
1057
- {
1058
- variant: "ghost",
1059
- className: d(n, "text-gray-400"),
1060
- ref: t,
1061
- "aria-label": l,
1062
- onClick: s,
1063
- onDragStart: c,
1064
- onDragEnd: i,
1065
- draggable: u,
1066
- ...g,
1067
- children: [
1068
- r,
1069
- a
1070
- ]
1071
- }
1072
- );
1073
- }), Ct = p((e, t) => {
1074
- const { className: n, children: a, id: r, columns: s, ...i } = e;
1075
- return m(i), /* @__PURE__ */ o(
1076
- "div",
1077
- {
1078
- className: d(
1079
- "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-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md",
1080
- "grid",
1081
- n
1082
- ),
1083
- style: { gridTemplateColumns: `repeat(${s}, 1fr)` },
1084
- ref: t,
1085
- id: r,
1086
- role: "grid",
1087
- children: a
1088
- }
1089
- );
1090
- }), Nt = p((e, t) => {
1091
- const { className: n, children: a, columns: r, ...s } = e;
1092
- return m(s), /* @__PURE__ */ o(
1093
- "div",
1094
- {
1095
- className: n,
1096
- style: { gridColumn: `1 / ${r + 1}` },
1097
- ref: t,
1098
- children: a
1099
- }
1100
- );
1101
- }), Tt = p((e, t) => {
1102
- const { className: n, children: a, id: r, ...s } = e;
1103
- return m(s), /* @__PURE__ */ o(
1104
- "div",
1105
- {
1106
- id: r,
1107
- role: "listbox",
1108
- className: d(
1109
- "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-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md",
1110
- n
1111
- ),
1112
- ref: t,
1113
- children: a
1114
- }
1115
- );
1116
- }), St = p((e, t) => {
1117
- const { className: n, children: a, ...r } = e;
1118
- return m(r), /* @__PURE__ */ o(
1119
- "div",
1120
- {
1121
- className: d(
1122
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1123
- "hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive",
1124
- "aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive",
1125
- n
1126
- ),
1127
- ref: t,
1128
- children: /* @__PURE__ */ o("div", { children: a })
1129
- }
1130
- );
1131
- }), yt = p((e, t) => {
1132
- const n = f(), { className: a, item: r, isSelected: s, onClick: i, id: c, ...u } = e;
1133
- m(u);
1134
- const l = E(null);
1135
- return A(() => {
1136
- if (!l.current || !s)
1137
- return;
1138
- _(
1139
- l.current,
1140
- l.current.closest(".bn-suggestion-menu, #ai-suggestion-menu")
1141
- ) !== "none" && l.current.scrollIntoView({ block: "nearest" });
1142
- }, [s]), /* @__PURE__ */ v(
1143
- "div",
1144
- {
1145
- className: d(
1146
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1147
- "hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive",
1148
- "aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive",
1149
- e.item.size === "small" ? "gap-3 py-1" : "",
1150
- a
1151
- ),
1152
- "data-highlighted": !0,
1153
- ref: R([t, l]),
1154
- id: c,
1155
- onMouseDown: (g) => g.preventDefault(),
1156
- onClick: i,
1157
- role: "option",
1158
- "aria-selected": s || void 0,
1159
- children: [
1160
- r.icon && /* @__PURE__ */ o(
1161
- "div",
1162
- {
1163
- className: d(
1164
- "p-3",
1165
- e.item.size === "small" ? "p-0" : "",
1166
- a
1167
- ),
1168
- "data-position": "left",
1169
- children: r.icon
1170
- }
1171
- ),
1172
- /* @__PURE__ */ v("div", { className: "flex-1", children: [
1173
- /* @__PURE__ */ o(
1174
- "div",
1175
- {
1176
- className: d(
1177
- "text-base",
1178
- e.item.size === "small" ? "text-sm" : "",
1179
- a
1180
- ),
1181
- children: r.title
1182
- }
1183
- ),
1184
- /* @__PURE__ */ o(
1185
- "div",
1186
- {
1187
- className: d(
1188
- "text-xs",
1189
- e.item.size === "small" ? "hidden" : "",
1190
- a
1191
- ),
1192
- children: r.subtext
1193
- }
1194
- )
1195
- ] }),
1196
- r.badge && /* @__PURE__ */ o("div", { "data-position": "right", className: "text-xs", children: /* @__PURE__ */ o(n.Badge.Badge, { variant: "secondary", children: r.badge }) })
1197
- ]
1198
- }
1199
- );
1200
- }), kt = p((e, t) => {
1201
- const { className: n, children: a, ...r } = e;
1202
- return m(r), /* @__PURE__ */ o(
1203
- "div",
1204
- {
1205
- className: d(
1206
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
1207
- n
1208
- ),
1209
- ref: t,
1210
- children: a
1211
- }
1212
- );
1213
- }), Mt = p((e, t) => {
1214
- const { className: n, ...a } = e;
1215
- return m(a), /* @__PURE__ */ o("div", { className: d(n, "animate-spin"), ref: t, children: /* @__PURE__ */ o(
1216
- "svg",
1217
- {
1218
- xmlns: "http://www.w3.org/2000/svg",
1219
- height: "1em",
1220
- viewBox: "0 -960 960 960",
1221
- width: "1em",
1222
- fill: "#e8eaed",
1223
- children: /* @__PURE__ */ o("path", { d: "M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z" })
1224
- }
1225
- ) });
1226
- }), zt = p((e, t) => {
1227
- const { className: n, children: a, onMouseDown: r, onClick: s, ...i } = e;
1228
- m(i, !1);
1229
- const c = f();
1230
- return /* @__PURE__ */ o(
1231
- c.Button.Button,
1232
- {
1233
- variant: "ghost",
1234
- className: d(
1235
- n,
1236
- "h-full w-full p-0 text-gray-400",
1237
- n != null && n.includes("extend-button-add-remove-columns") ? "ml-1" : "mt-1",
1238
- n != null && n.includes("extend-button-editing") ? "bg-accent text-accent-foreground" : ""
1239
- ),
1240
- ref: t,
1241
- onClick: s,
1242
- onMouseDown: r,
1243
- ...i,
1244
- children: a
1245
- }
1246
- );
1247
- }), Dt = p((e, t) => {
1248
- const {
1249
- className: n,
1250
- children: a,
1251
- draggable: r,
1252
- onDragStart: s,
1253
- onDragEnd: i,
1254
- style: c,
1255
- label: u,
1256
- ...l
1257
- } = e;
1258
- m(l, !1);
1259
- const g = f();
1260
- return /* @__PURE__ */ o(
1261
- g.Button.Button,
1262
- {
1263
- variant: "ghost",
1264
- className: d(n, "h-fit w-fit p-0 text-gray-400"),
1265
- ref: t,
1266
- "aria-label": u,
1267
- draggable: r,
1268
- onDragStart: s,
1269
- onDragEnd: i,
1270
- style: c,
1271
- ...l,
1272
- children: a
1273
- }
1274
- );
1275
- }), k = p(
1276
- (e, t) => {
1277
- const {
1278
- className: n,
1279
- children: a,
1280
- onMouseEnter: r,
1281
- onMouseLeave: s,
1282
- variant: i,
1283
- ...c
1284
- } = e;
1285
- m(c);
1286
- const u = f();
1287
- return /* @__PURE__ */ o(u.Tooltip.TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ o(
1288
- "div",
1289
- {
1290
- className: d(
1291
- n,
1292
- "bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md",
1293
- i === "action-toolbar" ? "w-fit" : ""
1294
- ),
1295
- ref: t,
1296
- onMouseEnter: r,
1297
- onMouseLeave: s,
1298
- children: a
1299
- }
1300
- ) });
1301
- }
1302
- ), M = p(
1303
- (e, t) => {
1304
- const {
1305
- className: n,
1306
- children: a,
1307
- mainTooltip: r,
1308
- secondaryTooltip: s,
1309
- icon: i,
1310
- isSelected: c,
1311
- isDisabled: u,
1312
- onClick: l,
1313
- label: g,
1314
- variant: b,
1315
- ...h
1316
- } = e;
1317
- m(h, !1);
1318
- const C = f(), T = c === void 0 ? /* @__PURE__ */ v(
1319
- C.Button.Button,
1320
- {
1321
- className: d(
1322
- n,
1323
- b === "compact" ? "h-6 min-w-6 p-0" : ""
1324
- ),
1325
- variant: "ghost",
1326
- size: b === "compact" ? "sm" : "default",
1327
- disabled: u,
1328
- onClick: l,
1329
- ref: t,
1330
- "aria-label": g,
1331
- ...h,
1332
- children: [
1333
- i,
1334
- a
1335
- ]
1336
- }
1337
- ) : /* @__PURE__ */ v(
1338
- C.Toggle.Toggle,
1339
- {
1340
- className: d(
1341
- n,
1342
- "data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground",
1343
- b === "compact" ? "h-6 min-w-6 p-0" : ""
1344
- ),
1345
- size: b === "compact" ? "sm" : "default",
1346
- "aria-label": g,
1347
- onClick: l,
1348
- pressed: c,
1349
- disabled: u,
1350
- "data-state": c ? "on" : "off",
1351
- "data-disabled": u,
1352
- ref: t,
1353
- ...h,
1354
- children: [
1355
- i,
1356
- a
1357
- ]
1358
- }
1359
- );
1360
- return /* @__PURE__ */ v(C.Tooltip.Tooltip, { children: [
1361
- /* @__PURE__ */ o(C.Tooltip.TooltipTrigger, { asChild: !0, children: T }),
1362
- /* @__PURE__ */ v(
1363
- C.Tooltip.TooltipContent,
1364
- {
1365
- className: "flex flex-col items-center whitespace-pre-wrap",
1366
- children: [
1367
- /* @__PURE__ */ o("span", { children: r }),
1368
- s && /* @__PURE__ */ o("span", { children: s })
1369
- ]
1370
- }
1371
- )
1372
- ] });
1373
- }
1374
- ), z = p((e, t) => {
1375
- const { className: n, items: a, isDisabled: r, ...s } = e;
1376
- m(s);
1377
- const i = f(), c = (l) => /* @__PURE__ */ v("div", { className: "flex items-center gap-1", children: [
1378
- l.icon,
1379
- l.text
1380
- ] }), u = a.filter((l) => l.isSelected)[0];
1381
- return u ? /* @__PURE__ */ v(
1382
- i.Select.Select,
1383
- {
1384
- value: u.text,
1385
- onValueChange: (l) => {
1386
- var g, b;
1387
- return (b = (g = a.find((h) => h.text === l)).onClick) == null ? void 0 : b.call(g);
1388
- },
1389
- disabled: r,
1390
- children: [
1391
- /* @__PURE__ */ o(i.Select.SelectTrigger, { className: "border-none", children: /* @__PURE__ */ o(i.Select.SelectValue, {}) }),
1392
- /* @__PURE__ */ o(i.Select.SelectContent, { className: n, ref: t, children: a.map((l) => /* @__PURE__ */ o(
1393
- i.Select.SelectItem,
1394
- {
1395
- disabled: l.isDisabled,
1396
- value: l.text,
1397
- children: /* @__PURE__ */ o(c, { ...l })
1398
- },
1399
- l.text
1400
- )) })
1401
- ]
1402
- }
1403
- ) : null;
1404
- }), It = p((e, t) => {
1405
- const {
1406
- className: n,
1407
- children: a,
1408
- selected: r,
1409
- headerText: s,
1410
- onFocus: i,
1411
- onBlur: c,
1412
- tabIndex: u,
1413
- ...l
1414
- } = e;
1415
- m(l);
1416
- const g = f();
1417
- return /* @__PURE__ */ v(
1418
- g.Card.Card,
1419
- {
1420
- className: d(
1421
- n,
1422
- "w-[300px]",
1423
- r ? "bg-accent text-accent-foreground" : ""
1424
- ),
1425
- onFocus: i,
1426
- onBlur: c,
1427
- tabIndex: u,
1428
- ref: t,
1429
- children: [
1430
- s && /* @__PURE__ */ o("div", { className: "px-4 pt-4 text-sm italic", children: s }),
1431
- a
1432
- ]
1433
- }
1434
- );
1435
- }), Bt = p((e, t) => {
1436
- const { className: n, children: a, ...r } = e;
1437
- return m(r), /* @__PURE__ */ o(
1438
- "div",
1439
- {
1440
- className: d(
1441
- n,
1442
- "p-4",
1443
- n != null && n.includes("thread-comments") ? "flex flex-col gap-6 border-b" : ""
1444
- ),
1445
- ref: t,
1446
- children: a
1447
- }
1448
- );
1449
- }), Pt = p((e, t) => {
1450
- const { className: n, children: a, ...r } = e;
1451
- m(r, !1);
1452
- const s = f();
1453
- return /* @__PURE__ */ o(
1454
- s.Button.Button,
1455
- {
1456
- className: d(
1457
- n,
1458
- "text-foreground w-fit bg-transparent p-0 hover:bg-transparent"
1459
- ),
1460
- ref: t,
1461
- children: a
1462
- }
1463
- );
1464
- }), _t = p((e, t) => {
1465
- const { authorInfo: n, timeString: a, edited: r, ...s } = e, i = W();
1466
- m(s, !1);
1467
- const c = f();
1468
- return n === "loading" ? /* @__PURE__ */ v("div", { className: "flex flex-row flex-nowrap items-center gap-4", children: [
1469
- /* @__PURE__ */ o(
1470
- c.Skeleton.Skeleton,
1471
- {
1472
- className: "size-7 animate-pulse rounded-full bg-neutral-400"
1473
- }
1474
- ),
1475
- /* @__PURE__ */ o(
1476
- c.Skeleton.Skeleton,
1477
- {
1478
- className: "h-3 w-32 animate-pulse rounded-full bg-neutral-400"
1479
- }
1480
- )
1481
- ] }) : /* @__PURE__ */ v("div", { className: "flex flex-row flex-nowrap items-center gap-4", children: [
1482
- /* @__PURE__ */ v(c.Avatar.Avatar, { children: [
1483
- /* @__PURE__ */ o(
1484
- c.Avatar.AvatarImage,
1485
- {
1486
- src: n.avatarUrl,
1487
- alt: n.username,
1488
- className: "h-7 rounded-full"
1489
- }
1490
- ),
1491
- /* @__PURE__ */ o(c.Avatar.AvatarFallback, { children: n.username[0] })
1492
- ] }),
1493
- /* @__PURE__ */ v("div", { className: "flex flex-row flex-nowrap items-center gap-2", children: [
1494
- /* @__PURE__ */ o("span", { className: "text-sm font-bold", children: n.username }),
1495
- /* @__PURE__ */ v("span", { className: "text-xs", children: [
1496
- a,
1497
- " ",
1498
- r && `(${i.comments.edited})`
1499
- ] })
1500
- ] })
1501
- ] });
1502
- }), Rt = p((e, t) => {
1503
- const {
1504
- className: n,
1505
- showActions: a,
1506
- authorInfo: r,
1507
- timeString: s,
1508
- actions: i,
1509
- edited: c,
1510
- emojiPickerOpen: u,
1511
- // Unused
1512
- children: l,
1513
- ...g
1514
- } = e;
1515
- m(g);
1516
- const [b, h] = ae(!1), { focused: C, ref: T } = Q(), y = i && (a === !0 || a === void 0 || a === "hover" && b || C);
1517
- return /* @__PURE__ */ v(
1518
- "div",
1519
- {
1520
- ref: t,
1521
- className: d(n, "relative flex flex-col gap-2"),
1522
- onMouseEnter: () => h(!0),
1523
- onMouseLeave: () => h(!1),
1524
- children: [
1525
- y ? /* @__PURE__ */ o("div", { className: "absolute right-0 top-0 z-10", ref: T, children: i }) : null,
1526
- /* @__PURE__ */ o(_t, { ...e }),
1527
- l
1528
- ]
1529
- }
1530
- );
1531
- }), Ft = p((e, t) => {
1532
- const { className: n, onFocus: a, onBlur: r, autoFocus: s, editor: i, editable: c, ...u } = e;
1533
- m(u);
1534
- const l = Z();
1535
- return /* @__PURE__ */ o(
1536
- Ot,
1537
- {
1538
- autoFocus: s,
1539
- className: d(n, ""),
1540
- theme: l == null ? void 0 : l.colorSchemePreference,
1541
- editor: e.editor,
1542
- sideMenu: !1,
1543
- slashMenu: !1,
1544
- tableHandles: !1,
1545
- filePanel: !1,
1546
- formattingToolbar: !1,
1547
- editable: c,
1548
- ref: t,
1549
- onFocus: a,
1550
- onBlur: r,
1551
- children: /* @__PURE__ */ o(
1552
- J,
1553
- {
1554
- formattingToolbar: Lt
1555
- }
1556
- )
1557
- }
1558
- );
1559
- }), Lt = () => {
1560
- const e = X([]).filter(
1561
- (t) => t.key !== "nestBlockButton" && t.key !== "unnestBlockButton"
1562
- );
1563
- return /* @__PURE__ */ o(Y, { blockTypeSelectItems: [], children: e });
1564
- }, Et = p((e, t) => {
1565
- const {
1566
- className: n,
1567
- text: a,
1568
- icon: r,
1569
- isSelected: s,
1570
- mainTooltip: i,
1571
- secondaryTooltip: c,
1572
- onClick: u,
1573
- onMouseEnter: l,
1574
- ...g
1575
- } = e;
1576
- m(g, !1);
1577
- const b = f(), h = /* @__PURE__ */ v(
1578
- b.Button.Button,
1579
- {
1580
- variant: s ? "secondary" : "outline",
1581
- className: d(
1582
- n,
1583
- "flex h-7 items-center gap-1 rounded-full px-2.5"
1584
- ),
1585
- onClick: u,
1586
- onMouseEnter: l,
1587
- ref: t,
1588
- children: [
1589
- /* @__PURE__ */ o("span", { children: r }),
1590
- /* @__PURE__ */ o("span", { children: a })
1591
- ]
1592
- }
1593
- );
1594
- return i ? /* @__PURE__ */ v(b.Tooltip.Tooltip, { children: [
1595
- /* @__PURE__ */ o(b.Tooltip.TooltipTrigger, { asChild: !0, children: h }),
1596
- /* @__PURE__ */ v(
1597
- b.Tooltip.TooltipContent,
1598
- {
1599
- className: "flex flex-col items-center whitespace-pre-wrap",
1600
- children: [
1601
- /* @__PURE__ */ o("span", { children: i }),
1602
- c && /* @__PURE__ */ o("span", { children: c })
1603
- ]
1604
- }
1605
- )
1606
- ] }) : h;
1607
- }), At = p((e, t) => {
1608
- const { className: n, children: a, ...r } = e;
1609
- m(r);
1610
- const s = f();
1611
- return /* @__PURE__ */ o(s.Tooltip.TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ o(
1612
- "div",
1613
- {
1614
- className: d(n, "flex w-full flex-row flex-wrap gap-1"),
1615
- ref: t,
1616
- children: a
1617
- }
1618
- ) });
1619
- }), Vt = p((e, t) => {
1620
- const { className: n, children: a, onClick: r, label: s, ...i } = e;
1621
- m(i);
1622
- const c = f();
1623
- return /* @__PURE__ */ o(
1624
- c.Button.Button,
1625
- {
1626
- type: "submit",
1627
- className: n,
1628
- "aria-label": s,
1629
- ref: t,
1630
- onClick: r,
1631
- children: a
1632
- }
1633
- );
1634
- }), jt = p((e, t) => {
1635
- const { className: n, accept: a, value: r, placeholder: s, onChange: i, ...c } = e;
1636
- m(c);
1637
- const u = f();
1638
- return /* @__PURE__ */ o(
1639
- u.Input.Input,
1640
- {
1641
- type: "file",
1642
- className: n,
1643
- ref: t,
1644
- accept: a,
1645
- value: r ? r.name : void 0,
1646
- onChange: async (l) => i == null ? void 0 : i(l.target.files[0]),
1647
- placeholder: s
1648
- }
1649
- );
1650
- }), qt = p((e, t) => {
1651
- const { className: n, isSelected: a, onClick: r, item: s, id: i, ...c } = e;
1652
- m(c);
1653
- const u = E(null);
1654
- return A(() => {
1655
- if (!u.current || !a)
1656
- return;
1657
- _(
1658
- u.current,
1659
- u.current.closest(".bn-grid-suggestion-menu")
1660
- ) !== "none" && u.current.scrollIntoView({ block: "nearest" });
1661
- }, [a]), /* @__PURE__ */ o(
1662
- "div",
1663
- {
1664
- className: d(
1665
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1666
- "hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive",
1667
- "aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive",
1668
- "text-lg!",
1669
- n
1670
- ),
1671
- ref: R([t, u]),
1672
- id: i,
1673
- role: "option",
1674
- onClick: r,
1675
- "aria-selected": a || void 0,
1676
- children: s.icon
1677
- }
1678
- );
1679
- }), $t = p((e, t) => {
1680
- const {
1681
- className: n,
1682
- children: a,
1683
- // unused, using "dots" instead
1684
- columns: r,
1685
- ...s
1686
- } = e;
1687
- return m(s), /* @__PURE__ */ o(
1688
- "div",
1689
- {
1690
- className: n,
1691
- style: { gridColumn: `1 / ${r + 1}` },
1692
- ref: t,
1693
- children: a
1694
- }
1695
- );
1696
- }), Gt = {
1697
- FormattingToolbar: {
1698
- Root: k,
1699
- Button: M,
1700
- Select: z
1701
- },
1702
- FilePanel: {
1703
- Root: pt,
1704
- Button: Vt,
1705
- FileInput: jt,
1706
- TabPanel: gt,
1707
- TextInput: vt
1708
- },
1709
- LinkToolbar: {
1710
- Root: k,
1711
- Button: M,
1712
- Select: z
1713
- },
1714
- SideMenu: {
1715
- Root: xt,
1716
- Button: wt
1717
- },
1718
- SuggestionMenu: {
1719
- Root: Tt,
1720
- Item: yt,
1721
- EmptyItem: St,
1722
- Label: kt,
1723
- Loader: Mt
1724
- },
1725
- GridSuggestionMenu: {
1726
- Root: Ct,
1727
- Item: qt,
1728
- EmptyItem: Nt,
1729
- Loader: $t
1730
- },
1731
- TableHandle: {
1732
- Root: Dt,
1733
- ExtendButton: zt
1734
- },
1735
- Comments: {
1736
- Comment: Rt,
1737
- Editor: Ft,
1738
- Card: It,
1739
- CardSection: Bt,
1740
- ExpandSectionsPrompt: Pt
1741
- },
1742
- Generic: {
1743
- Badge: {
1744
- Root: Et,
1745
- Group: At
1746
- },
1747
- Toolbar: {
1748
- Root: k,
1749
- Button: M,
1750
- Select: z
1751
- },
1752
- Form: {
1753
- Root: ot,
1754
- TextInput: at
1755
- },
1756
- Menu: {
1757
- Root: st,
1758
- Trigger: it,
1759
- Dropdown: dt,
1760
- Divider: ct,
1761
- Label: ut,
1762
- Item: lt,
1763
- Button: mt
1764
- },
1765
- Popover: {
1766
- Root: ft,
1767
- Trigger: bt,
1768
- Content: ht
1769
- }
1770
- }
1771
- }, Ot = (e) => {
1772
- const { className: t, shadCNComponents: n, ...a } = e, r = L(() => ({
1773
- ...nt,
1774
- ...n
1775
- }), [n]);
1776
- return /* @__PURE__ */ o(G.Provider, { value: r, children: /* @__PURE__ */ o(ee.Provider, { value: Gt, children: /* @__PURE__ */ o(
1777
- te,
1778
- {
1779
- className: K("bn-shadcn", t || ""),
1780
- ...a
1781
- }
1782
- ) }) });
1783
- };
1784
- export {
1785
- Ot as BlockNoteView,
1786
- G as ShadCNComponentsContext,
1787
- nt as ShadCNDefaultComponents,
1788
- Gt as components,
1789
- f as useShadCNComponentsContext
470
+ //#endregion
471
+ //#region src/form/Form.tsx
472
+ var Ue = (t) => {
473
+ let { children: n, ...r } = t;
474
+ e(r);
475
+ let i = K(), a = te();
476
+ return /* @__PURE__ */ x(i.Form.Form, {
477
+ ...a,
478
+ children: n
479
+ });
480
+ }, We = m((t, n) => {
481
+ let { className: r, name: i, label: a, variant: o, icon: s, value: c, autoFocus: l, placeholder: u, disabled: d, onKeyDown: f, onChange: p, onSubmit: m, autoComplete: h, "aria-activedescendant": g, rightSection: _, ...v } = t;
482
+ e(v);
483
+ let y = K();
484
+ return /* @__PURE__ */ S("div", {
485
+ className: M(r, "border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", "text-foreground items-center gap-2"),
486
+ children: [
487
+ s,
488
+ /* @__PURE__ */ S("div", {
489
+ className: "flex-1",
490
+ children: [a && /* @__PURE__ */ x(y.Label.Label, {
491
+ htmlFor: a,
492
+ children: a
493
+ }), /* @__PURE__ */ x(y.Input.Input, {
494
+ className: M(r, "h-auto border-none p-0"),
495
+ id: a,
496
+ name: i,
497
+ autoFocus: l,
498
+ placeholder: u,
499
+ disabled: d,
500
+ value: c,
501
+ onKeyDown: f,
502
+ onChange: p,
503
+ onSubmit: m,
504
+ ref: n,
505
+ "aria-activedescendant": g
506
+ })]
507
+ }),
508
+ _
509
+ ]
510
+ });
511
+ }), Ge = (e) => m((t, n) => /* @__PURE__ */ x(e, {
512
+ onPointerDown: (e) => {
513
+ e.nativeEvent.fakeEvent || (e.ctrlKey = !0);
514
+ },
515
+ onPointerUp: (e) => {
516
+ let t = new PointerEvent("pointerdown", e.nativeEvent);
517
+ t.fakeEvent = !0, e.target.dispatchEvent(t);
518
+ },
519
+ ...t,
520
+ ref: n
521
+ })), Ke = (t) => {
522
+ let { children: n, onOpenChange: r, position: i, sub: a, ...o } = t;
523
+ e(o);
524
+ let s = K();
525
+ return a ? /* @__PURE__ */ x(s.DropdownMenu.DropdownMenuSub, {
526
+ onOpenChange: r,
527
+ children: n
528
+ }) : /* @__PURE__ */ x(s.DropdownMenu.DropdownMenu, {
529
+ modal: !1,
530
+ onOpenChange: r,
531
+ children: n
532
+ });
533
+ }, qe = (t) => {
534
+ let { children: n, sub: r, ...i } = t;
535
+ e(i);
536
+ let a = K(), o = _(() => Ge(a.DropdownMenu.DropdownMenuTrigger), [a.DropdownMenu.DropdownMenuTrigger]);
537
+ return r ? /* @__PURE__ */ x(a.DropdownMenu.DropdownMenuSubTrigger, { children: n }) : /* @__PURE__ */ x(o, {
538
+ asChild: !0,
539
+ ...i,
540
+ children: n
541
+ });
542
+ }, Je = m((t, n) => {
543
+ let { className: r, children: i, sub: a, ...o } = t;
544
+ e(o);
545
+ let s = K();
546
+ return x(a ? s.DropdownMenu.DropdownMenuSubContent : s.DropdownMenu.DropdownMenuContent, {
547
+ className: r,
548
+ ref: n,
549
+ children: i
550
+ });
551
+ }), Ye = m((t, n) => {
552
+ let { className: r, children: i, icon: a, checked: o, subTrigger: s, onClick: c, ...l } = t;
553
+ e(l);
554
+ let u = K();
555
+ return s ? /* @__PURE__ */ S(ie, { children: [a, i] }) : o === void 0 ? /* @__PURE__ */ S(u.DropdownMenu.DropdownMenuItem, {
556
+ className: r,
557
+ ref: n,
558
+ onClick: c,
559
+ ...l,
560
+ children: [
561
+ a,
562
+ i,
563
+ s && /* @__PURE__ */ x(ae, { className: "ml-auto h-4 w-4" })
564
+ ]
565
+ }) : /* @__PURE__ */ S(u.DropdownMenu.DropdownMenuCheckboxItem, {
566
+ className: M(r, "gap-1", o ? "" : "px-2"),
567
+ ref: n,
568
+ checked: o,
569
+ onClick: c,
570
+ ...l,
571
+ children: [a, i]
572
+ });
573
+ }), Xe = m((t, n) => {
574
+ let { className: r, ...i } = t;
575
+ return e(i), /* @__PURE__ */ x(K().DropdownMenu.DropdownMenuSeparator, {
576
+ className: r,
577
+ ref: n
578
+ });
579
+ }), Ze = m((t, n) => {
580
+ let { className: r, children: i, ...a } = t;
581
+ return e(a), /* @__PURE__ */ x(K().DropdownMenu.DropdownMenuLabel, {
582
+ className: r,
583
+ ref: n,
584
+ children: i
585
+ });
586
+ }), Qe = m((t, n) => {
587
+ let { className: r, children: i, icon: a, onClick: o, onDragEnd: s, onDragStart: c, draggable: l, label: u, ...d } = t;
588
+ return e(d, !1), /* @__PURE__ */ S(K().Button.Button, {
589
+ variant: "ghost",
590
+ className: M(r, "text-gray-400"),
591
+ ref: n,
592
+ "aria-label": u,
593
+ onClick: o,
594
+ onDragStart: c,
595
+ onDragEnd: s,
596
+ draggable: l,
597
+ ...d,
598
+ children: [a, i]
599
+ });
600
+ }), $e = m((t, n) => {
601
+ let { className: r, tabs: i, defaultOpenTab: a, openTab: o, setOpenTab: s, loading: c, ...l } = t;
602
+ e(l);
603
+ let u = K();
604
+ return /* @__PURE__ */ S(u.Tabs.Tabs, {
605
+ className: M(r, "bg-popover max-w-screen rounded-lg p-2"),
606
+ ref: n,
607
+ value: o,
608
+ defaultValue: a,
609
+ onValueChange: s,
610
+ children: [/* @__PURE__ */ x(u.Tabs.TabsList, { children: i.map((e) => /* @__PURE__ */ x(u.Tabs.TabsTrigger, {
611
+ value: e.name,
612
+ children: e.name
613
+ }, e.name)) }), i.map((e) => /* @__PURE__ */ x(u.Tabs.TabsContent, {
614
+ value: e.name,
615
+ children: /* @__PURE__ */ x(u.Card.Card, { children: /* @__PURE__ */ x(u.Card.CardContent, {
616
+ className: "p-4",
617
+ children: e.tabPanel
618
+ }) })
619
+ }, e.name))]
620
+ });
621
+ }), et = m((t, n) => {
622
+ let { className: r, children: i, ...a } = t;
623
+ return e(a), /* @__PURE__ */ x("div", {
624
+ className: M(r, "flex flex-col items-start justify-center gap-2"),
625
+ ref: n,
626
+ children: i
627
+ });
628
+ }), tt = m((t, n) => {
629
+ let { className: r, value: i, placeholder: a, onKeyDown: o, onChange: s, ...c } = t;
630
+ return e(c), /* @__PURE__ */ x(K().Input.Input, {
631
+ "data-test": "embed-input",
632
+ className: M(r, "w-80 max-w-full"),
633
+ ref: n,
634
+ value: i,
635
+ placeholder: a,
636
+ onKeyDown: o,
637
+ onChange: s
638
+ });
639
+ }), q = p(void 0), nt = (t) => {
640
+ let { children: n, open: r, onOpenChange: i, position: a, portalRoot: o, ...s } = t;
641
+ return e(s), /* @__PURE__ */ x(K().Popover.Popover, {
642
+ open: r,
643
+ onOpenChange: i,
644
+ children: /* @__PURE__ */ x(q.Provider, {
645
+ value: o,
646
+ children: n
647
+ })
648
+ });
649
+ }, rt = m((t, n) => {
650
+ let { children: r, ...i } = t;
651
+ return e(i), /* @__PURE__ */ x(K().Popover.PopoverTrigger, {
652
+ ref: n,
653
+ asChild: !0,
654
+ children: r
655
+ });
656
+ }), it = m((t, n) => {
657
+ let { className: r, variant: i, children: a, ...o } = t;
658
+ e(o);
659
+ let s = K(), c = h(q), l = /* @__PURE__ */ x(s.Popover.PopoverContent, {
660
+ sideOffset: 8,
661
+ className: M(r, "flex flex-col gap-2", i === "panel-popover" ? "w-fit max-w-none border-none p-0 shadow-none" : ""),
662
+ ref: n,
663
+ children: a
664
+ });
665
+ return c ? ue(l, c) : l;
666
+ }), at = m((t, n) => {
667
+ let { className: r, children: i, ...a } = t;
668
+ return e(a, !1), /* @__PURE__ */ x("div", {
669
+ className: r,
670
+ ref: n,
671
+ ...a,
672
+ children: i
673
+ });
674
+ }), ot = m((t, n) => {
675
+ let { className: r, children: i, icon: a, onClick: o, onDragEnd: s, onDragStart: c, draggable: l, label: u, ...d } = t;
676
+ return e(d, !1), /* @__PURE__ */ S(K().Button.Button, {
677
+ variant: "ghost",
678
+ className: M(r, "text-gray-400"),
679
+ ref: n,
680
+ "aria-label": u,
681
+ onClick: o,
682
+ onDragStart: c,
683
+ onDragEnd: s,
684
+ draggable: l,
685
+ ...d,
686
+ children: [a, i]
687
+ });
688
+ }), st = m((t, n) => {
689
+ let { className: r, children: i, id: a, columns: o, ...s } = t;
690
+ return e(s), /* @__PURE__ */ x("div", {
691
+ className: M("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-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md", "grid", r),
692
+ style: { gridTemplateColumns: `repeat(${o}, 1fr)` },
693
+ ref: n,
694
+ id: a,
695
+ role: "grid",
696
+ children: i
697
+ });
698
+ }), ct = m((t, n) => {
699
+ let { className: r, children: i, columns: a, ...o } = t;
700
+ return e(o), /* @__PURE__ */ x("div", {
701
+ className: r,
702
+ style: { gridColumn: `1 / ${a + 1}` },
703
+ ref: n,
704
+ children: i
705
+ });
706
+ }), lt = m((t, n) => {
707
+ let { className: r, children: i, id: a, ...o } = t;
708
+ return e(o), /* @__PURE__ */ x("div", {
709
+ id: a,
710
+ role: "listbox",
711
+ className: M("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-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin) z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md", r),
712
+ ref: n,
713
+ children: i
714
+ });
715
+ }), ut = m((t, n) => {
716
+ let { className: r, children: i, ...a } = t;
717
+ return e(a), /* @__PURE__ */ x("div", {
718
+ className: M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", "hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive", "aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive", r),
719
+ ref: n,
720
+ children: /* @__PURE__ */ x("div", { children: i })
721
+ });
722
+ }), dt = m((t, n) => {
723
+ let r = K(), { className: i, item: a, isSelected: s, onClick: l, id: u, ...d } = t;
724
+ e(d);
725
+ let f = v(null);
726
+ return g(() => {
727
+ !f.current || !s || o(f.current, f.current.closest(".bn-suggestion-menu, #ai-suggestion-menu")) !== "none" && f.current.scrollIntoView({ block: "nearest" });
728
+ }, [s]), /* @__PURE__ */ S("div", {
729
+ className: M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", "hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive", "aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive", t.item.size === "small" ? "gap-3 py-1" : "", i),
730
+ "data-highlighted": !0,
731
+ ref: c([n, f]),
732
+ id: u,
733
+ onMouseDown: (e) => e.preventDefault(),
734
+ onClick: l,
735
+ role: "option",
736
+ "aria-selected": s || void 0,
737
+ children: [
738
+ a.icon && /* @__PURE__ */ x("div", {
739
+ className: M("p-3", t.item.size === "small" ? "p-0" : "", i),
740
+ "data-position": "left",
741
+ children: a.icon
742
+ }),
743
+ /* @__PURE__ */ S("div", {
744
+ className: "flex-1",
745
+ children: [/* @__PURE__ */ x("div", {
746
+ className: M("text-base", t.item.size === "small" ? "text-sm" : "", i),
747
+ children: a.title
748
+ }), /* @__PURE__ */ x("div", {
749
+ className: M("text-xs", t.item.size === "small" ? "hidden" : "", i),
750
+ children: a.subtext
751
+ })]
752
+ }),
753
+ a.badge && /* @__PURE__ */ x("div", {
754
+ "data-position": "right",
755
+ className: "text-xs",
756
+ children: /* @__PURE__ */ x(r.Badge.Badge, {
757
+ variant: "secondary",
758
+ children: a.badge
759
+ })
760
+ })
761
+ ]
762
+ });
763
+ }), ft = m((t, n) => {
764
+ let { className: r, children: i, ...a } = t;
765
+ return e(a), /* @__PURE__ */ x("div", {
766
+ className: M("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", r),
767
+ ref: n,
768
+ children: i
769
+ });
770
+ }), pt = m((t, n) => {
771
+ let { className: r, ...i } = t;
772
+ return e(i), /* @__PURE__ */ x("div", {
773
+ className: M(r, "animate-spin"),
774
+ ref: n,
775
+ children: /* @__PURE__ */ x("svg", {
776
+ xmlns: "http://www.w3.org/2000/svg",
777
+ height: "1em",
778
+ viewBox: "0 -960 960 960",
779
+ width: "1em",
780
+ fill: "#e8eaed",
781
+ children: /* @__PURE__ */ x("path", { d: "M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z" })
782
+ })
783
+ });
784
+ }), mt = m((t, n) => {
785
+ let { className: r, children: i, onMouseDown: a, onClick: o, ...s } = t;
786
+ return e(s, !1), /* @__PURE__ */ x(K().Button.Button, {
787
+ variant: "ghost",
788
+ className: M(r, "h-full w-full p-0 text-gray-400", r?.includes("extend-button-add-remove-columns") ? "ml-1" : "mt-1", r?.includes("extend-button-editing") ? "bg-accent text-accent-foreground" : ""),
789
+ ref: n,
790
+ onClick: o,
791
+ onMouseDown: a,
792
+ ...s,
793
+ children: i
794
+ });
795
+ }), ht = m((t, n) => {
796
+ let { className: r, children: i, draggable: a, onDragStart: o, onDragEnd: s, style: c, label: l, ...u } = t;
797
+ return e(u, !1), /* @__PURE__ */ x(K().Button.Button, {
798
+ variant: "ghost",
799
+ className: M(r, "h-fit w-fit p-0 text-gray-400"),
800
+ ref: n,
801
+ "aria-label": l,
802
+ draggable: a,
803
+ onDragStart: o,
804
+ onDragEnd: s,
805
+ style: c,
806
+ ...u,
807
+ children: i
808
+ });
809
+ }), J = m((t, n) => {
810
+ let { className: r, children: i, onMouseEnter: a, onMouseLeave: o, variant: s, ...c } = t;
811
+ return e(c), /* @__PURE__ */ x(K().Tooltip.TooltipProvider, {
812
+ delayDuration: 0,
813
+ children: /* @__PURE__ */ x("div", {
814
+ className: M(r, "bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md", s === "action-toolbar" ? "w-fit" : ""),
815
+ ref: n,
816
+ onMouseEnter: a,
817
+ onMouseLeave: o,
818
+ children: i
819
+ })
820
+ });
821
+ }), Y = m((t, n) => {
822
+ let { className: r, children: i, mainTooltip: a, secondaryTooltip: o, icon: s, isSelected: c, isDisabled: l, onClick: u, label: d, variant: f, ...p } = t;
823
+ e(p, !1);
824
+ let m = K(), h = c === void 0 ? /* @__PURE__ */ S(m.Button.Button, {
825
+ className: M(r, f === "compact" ? "h-6 min-w-6 p-0" : ""),
826
+ variant: "ghost",
827
+ size: f === "compact" ? "sm" : "default",
828
+ disabled: l,
829
+ onClick: u,
830
+ ref: n,
831
+ "aria-label": d,
832
+ ...p,
833
+ children: [s, i]
834
+ }) : /* @__PURE__ */ S(m.Toggle.Toggle, {
835
+ className: M(r, "data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground", f === "compact" ? "h-6 min-w-6 p-0" : ""),
836
+ size: f === "compact" ? "sm" : "default",
837
+ "aria-label": d,
838
+ onClick: u,
839
+ pressed: c,
840
+ disabled: l,
841
+ "data-state": c ? "on" : "off",
842
+ "data-disabled": l,
843
+ ref: n,
844
+ ...p,
845
+ children: [s, i]
846
+ });
847
+ return /* @__PURE__ */ S(m.Tooltip.Tooltip, { children: [/* @__PURE__ */ x(m.Tooltip.TooltipTrigger, {
848
+ asChild: !0,
849
+ children: h
850
+ }), /* @__PURE__ */ S(m.Tooltip.TooltipContent, {
851
+ className: "flex flex-col items-center whitespace-pre-wrap",
852
+ children: [/* @__PURE__ */ x("span", { children: a }), o && /* @__PURE__ */ x("span", { children: o })]
853
+ })] });
854
+ }), X = m((t, n) => {
855
+ let { className: r, items: i, isDisabled: a, ...o } = t;
856
+ e(o);
857
+ let s = K(), c = (e) => /* @__PURE__ */ S("div", {
858
+ className: "flex items-center gap-1",
859
+ children: [e.icon, e.text]
860
+ }), l = i.filter((e) => e.isSelected)[0];
861
+ return l ? /* @__PURE__ */ S(s.Select.Select, {
862
+ value: l.text,
863
+ onValueChange: (e) => i.find((t) => t.text === e).onClick?.(),
864
+ disabled: a,
865
+ children: [/* @__PURE__ */ x(s.Select.SelectTrigger, {
866
+ className: "border-none",
867
+ children: /* @__PURE__ */ x(s.Select.SelectValue, {})
868
+ }), /* @__PURE__ */ x(s.Select.SelectContent, {
869
+ className: r,
870
+ ref: n,
871
+ children: i.map((e) => /* @__PURE__ */ x(s.Select.SelectItem, {
872
+ disabled: e.isDisabled,
873
+ value: e.text,
874
+ children: /* @__PURE__ */ x(c, { ...e })
875
+ }, e.text))
876
+ })]
877
+ }) : null;
878
+ }), gt = m((t, n) => {
879
+ let { className: r, children: i, selected: a, headerText: o, onFocus: s, onBlur: c, tabIndex: l, ...u } = t;
880
+ return e(u), /* @__PURE__ */ S(K().Card.Card, {
881
+ className: M(r, "w-[300px]", a ? "bg-accent text-accent-foreground" : ""),
882
+ onFocus: s,
883
+ onBlur: c,
884
+ tabIndex: l,
885
+ ref: n,
886
+ children: [o && /* @__PURE__ */ x("div", {
887
+ className: "px-4 pt-4 text-sm italic",
888
+ children: o
889
+ }), i]
890
+ });
891
+ }), _t = m((t, n) => {
892
+ let { className: r, children: i, ...a } = t;
893
+ return e(a), /* @__PURE__ */ x("div", {
894
+ className: M(r, "p-4", r?.includes("thread-comments") ? "flex flex-col gap-6 border-b" : ""),
895
+ ref: n,
896
+ children: i
897
+ });
898
+ }), vt = m((t, n) => {
899
+ let { className: r, children: i, ...a } = t;
900
+ return e(a, !1), /* @__PURE__ */ x(K().Button.Button, {
901
+ className: M(r, "text-foreground w-fit bg-transparent p-0 hover:bg-transparent"),
902
+ ref: n,
903
+ children: i
904
+ });
905
+ }), yt = m((t, n) => {
906
+ let { authorInfo: r, timeString: i, edited: a, ...o } = t, s = u();
907
+ e(o, !1);
908
+ let c = K();
909
+ return r === "loading" ? /* @__PURE__ */ S("div", {
910
+ className: "flex flex-row flex-nowrap items-center gap-4",
911
+ children: [/* @__PURE__ */ x(c.Skeleton.Skeleton, { className: "size-7 animate-pulse rounded-full bg-neutral-400" }), /* @__PURE__ */ x(c.Skeleton.Skeleton, { className: "h-3 w-32 animate-pulse rounded-full bg-neutral-400" })]
912
+ }) : /* @__PURE__ */ S("div", {
913
+ className: "flex flex-row flex-nowrap items-center gap-4",
914
+ children: [/* @__PURE__ */ S(c.Avatar.Avatar, { children: [/* @__PURE__ */ x(c.Avatar.AvatarImage, {
915
+ src: r.avatarUrl,
916
+ alt: r.username,
917
+ className: "h-7 rounded-full"
918
+ }), /* @__PURE__ */ x(c.Avatar.AvatarFallback, { children: r.username[0] })] }), /* @__PURE__ */ S("div", {
919
+ className: "flex flex-row flex-nowrap items-center gap-2",
920
+ children: [/* @__PURE__ */ x("span", {
921
+ className: "text-sm font-bold",
922
+ children: r.username
923
+ }), /* @__PURE__ */ S("span", {
924
+ className: "text-xs",
925
+ children: [
926
+ i,
927
+ " ",
928
+ a && `(${s.comments.edited})`
929
+ ]
930
+ })]
931
+ })]
932
+ });
933
+ }), bt = m((t, n) => {
934
+ let { className: r, showActions: i, authorInfo: a, timeString: o, actions: s, edited: c, emojiPickerOpen: l, children: u, ...f } = t;
935
+ e(f);
936
+ let [p, m] = y(!1), { focused: h, ref: g } = d(), _ = s && (i === !0 || i === void 0 || i === "hover" && p || h || l);
937
+ return /* @__PURE__ */ S("div", {
938
+ ref: n,
939
+ className: M(r, "relative flex flex-col gap-2"),
940
+ onMouseEnter: () => m(!0),
941
+ onMouseLeave: () => m(!1),
942
+ children: [
943
+ _ ? /* @__PURE__ */ x("div", {
944
+ className: "absolute right-0 top-0 z-10",
945
+ ref: g,
946
+ children: s
947
+ }) : null,
948
+ /* @__PURE__ */ x(yt, { ...t }),
949
+ u
950
+ ]
951
+ });
952
+ }), xt = m((t, n) => {
953
+ let { className: r, onFocus: i, onBlur: o, autoFocus: s, editor: c, editable: u, ...d } = t;
954
+ e(d);
955
+ let f = l();
956
+ return /* @__PURE__ */ x($, {
957
+ autoFocus: s,
958
+ className: M(r, ""),
959
+ theme: f?.colorSchemePreference,
960
+ editor: t.editor,
961
+ sideMenu: !1,
962
+ slashMenu: !1,
963
+ tableHandles: !1,
964
+ filePanel: !1,
965
+ formattingToolbar: !1,
966
+ editable: u,
967
+ ref: n,
968
+ onFocus: i,
969
+ onBlur: o,
970
+ children: /* @__PURE__ */ x(a, { formattingToolbar: St })
971
+ });
972
+ }), St = () => /* @__PURE__ */ x(i, {
973
+ blockTypeSelectItems: [],
974
+ children: s([]).filter((e) => e.key !== "nestBlockButton" && e.key !== "unnestBlockButton")
975
+ }), Ct = m((t, n) => {
976
+ let { className: r, text: i, icon: a, isSelected: o, mainTooltip: s, secondaryTooltip: c, onClick: l, onMouseEnter: u, ...d } = t;
977
+ e(d, !1);
978
+ let f = K(), p = /* @__PURE__ */ S(f.Button.Button, {
979
+ variant: o ? "secondary" : "outline",
980
+ className: M(r, "flex h-7 items-center gap-1 rounded-full px-2.5"),
981
+ onClick: l,
982
+ onMouseEnter: u,
983
+ ref: n,
984
+ children: [/* @__PURE__ */ x("span", { children: a }), /* @__PURE__ */ x("span", { children: i })]
985
+ });
986
+ return s ? /* @__PURE__ */ S(f.Tooltip.Tooltip, { children: [/* @__PURE__ */ x(f.Tooltip.TooltipTrigger, {
987
+ asChild: !0,
988
+ children: p
989
+ }), /* @__PURE__ */ S(f.Tooltip.TooltipContent, {
990
+ className: "flex flex-col items-center whitespace-pre-wrap",
991
+ children: [/* @__PURE__ */ x("span", { children: s }), c && /* @__PURE__ */ x("span", { children: c })]
992
+ })] }) : p;
993
+ }), wt = m((t, n) => {
994
+ let { className: r, children: i, ...a } = t;
995
+ return e(a), /* @__PURE__ */ x(K().Tooltip.TooltipProvider, {
996
+ delayDuration: 0,
997
+ children: /* @__PURE__ */ x("div", {
998
+ className: M(r, "flex w-full flex-row flex-wrap gap-1"),
999
+ ref: n,
1000
+ children: i
1001
+ })
1002
+ });
1003
+ }), Tt = m((t, n) => {
1004
+ let { className: r, children: i, onClick: a, label: o, ...s } = t;
1005
+ return e(s), /* @__PURE__ */ x(K().Button.Button, {
1006
+ type: "submit",
1007
+ className: r,
1008
+ "aria-label": o,
1009
+ ref: n,
1010
+ onClick: a,
1011
+ children: i
1012
+ });
1013
+ }), Et = m((t, n) => {
1014
+ let { className: r, accept: i, value: a, placeholder: o, onChange: s, ...c } = t;
1015
+ return e(c), /* @__PURE__ */ x(K().Input.Input, {
1016
+ type: "file",
1017
+ className: r,
1018
+ ref: n,
1019
+ accept: i,
1020
+ value: a ? a.name : void 0,
1021
+ onChange: async (e) => s?.(e.target.files[0]),
1022
+ placeholder: o
1023
+ });
1024
+ }), Dt = m((t, n) => {
1025
+ let { className: r, isSelected: i, onClick: a, item: s, id: l, ...u } = t;
1026
+ e(u);
1027
+ let d = v(null);
1028
+ return g(() => {
1029
+ !d.current || !i || o(d.current, d.current.closest(".bn-grid-suggestion-menu")) !== "none" && d.current.scrollIntoView({ block: "nearest" });
1030
+ }, [i]), /* @__PURE__ */ x("div", {
1031
+ className: M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", "hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive", "aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive", "text-lg!", r),
1032
+ ref: c([n, d]),
1033
+ id: l,
1034
+ role: "option",
1035
+ onClick: a,
1036
+ "aria-selected": i || void 0,
1037
+ children: s.icon
1038
+ });
1039
+ }), Z = m((t, n) => {
1040
+ let { className: r, children: i, columns: a, ...o } = t;
1041
+ return e(o), /* @__PURE__ */ x("div", {
1042
+ className: r,
1043
+ style: { gridColumn: `1 / ${a + 1}` },
1044
+ ref: n,
1045
+ children: i
1046
+ });
1047
+ }), Q = {
1048
+ FormattingToolbar: {
1049
+ Root: J,
1050
+ Button: Y,
1051
+ Select: X
1052
+ },
1053
+ FilePanel: {
1054
+ Root: $e,
1055
+ Button: Tt,
1056
+ FileInput: Et,
1057
+ TabPanel: et,
1058
+ TextInput: tt
1059
+ },
1060
+ LinkToolbar: {
1061
+ Root: J,
1062
+ Button: Y,
1063
+ Select: X
1064
+ },
1065
+ SideMenu: {
1066
+ Root: at,
1067
+ Button: ot
1068
+ },
1069
+ SuggestionMenu: {
1070
+ Root: lt,
1071
+ Item: dt,
1072
+ EmptyItem: ut,
1073
+ Label: ft,
1074
+ Loader: pt
1075
+ },
1076
+ GridSuggestionMenu: {
1077
+ Root: st,
1078
+ Item: Dt,
1079
+ EmptyItem: ct,
1080
+ Loader: Z
1081
+ },
1082
+ TableHandle: {
1083
+ Root: ht,
1084
+ ExtendButton: mt
1085
+ },
1086
+ Comments: {
1087
+ Comment: bt,
1088
+ Editor: xt,
1089
+ Card: gt,
1090
+ CardSection: _t,
1091
+ ExpandSectionsPrompt: vt
1092
+ },
1093
+ Generic: {
1094
+ Badge: {
1095
+ Root: Ct,
1096
+ Group: wt
1097
+ },
1098
+ Toolbar: {
1099
+ Root: J,
1100
+ Button: Y,
1101
+ Select: X
1102
+ },
1103
+ Form: {
1104
+ Root: Ue,
1105
+ TextInput: We
1106
+ },
1107
+ Menu: {
1108
+ Root: Ke,
1109
+ Trigger: qe,
1110
+ Dropdown: Je,
1111
+ Divider: Xe,
1112
+ Label: Ze,
1113
+ Item: Ye,
1114
+ Button: Qe
1115
+ },
1116
+ Popover: {
1117
+ Root: nt,
1118
+ Trigger: rt,
1119
+ Content: it
1120
+ }
1121
+ }
1122
+ }, $ = (e) => {
1123
+ let { className: i, shadCNComponents: a, ...o } = e, s = _(() => ({
1124
+ ...W,
1125
+ ...a
1126
+ }), [a]);
1127
+ return /* @__PURE__ */ x(G.Provider, {
1128
+ value: s,
1129
+ children: /* @__PURE__ */ x(r.Provider, {
1130
+ value: Q,
1131
+ children: /* @__PURE__ */ x(n, {
1132
+ className: t("bn-shadcn", i || ""),
1133
+ ...o
1134
+ })
1135
+ })
1136
+ });
1790
1137
  };
1791
- //# sourceMappingURL=blocknote-shadcn.js.map
1138
+ //#endregion
1139
+ export { $ as BlockNoteView, G as ShadCNComponentsContext, W as ShadCNDefaultComponents, Q as components, K as useShadCNComponentsContext };
1140
+
1141
+ //# sourceMappingURL=blocknote-shadcn.js.map