@blocknote/shadcn 0.15.11 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-shadcn.js +203 -203
- package/dist/blocknote-shadcn.js.map +1 -1
- package/dist/blocknote-shadcn.umd.cjs +2 -2
- package/dist/blocknote-shadcn.umd.cjs.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +7 -5
- package/src/ShadCNComponentsContext.tsx +12 -12
- package/src/components/ui/badge.tsx +2 -2
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/card.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +8 -8
- package/src/components/ui/form.tsx +7 -7
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +2 -2
- package/src/components/ui/popover.tsx +3 -3
- package/src/components/ui/select.tsx +8 -8
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/toggle.tsx +2 -2
- package/src/components/ui/tooltip.tsx +3 -3
- package/src/form/Form.tsx +1 -1
- package/src/form/TextInput.tsx +1 -1
- package/src/index.tsx +27 -27
- package/src/menu/Menu.tsx +3 -3
- package/src/panel/Panel.tsx +2 -2
- package/src/panel/PanelButton.tsx +1 -1
- package/src/panel/PanelFileInput.tsx +1 -1
- package/src/panel/PanelTab.tsx +1 -1
- package/src/panel/PanelTextInput.tsx +2 -2
- package/src/popover/popover.tsx +2 -2
- package/src/sideMenu/SideMenuButton.tsx +2 -2
- package/src/suggestionMenu/SuggestionMenu.tsx +1 -1
- package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +1 -1
- package/src/suggestionMenu/SuggestionMenuItem.tsx +2 -2
- package/src/suggestionMenu/SuggestionMenuLabel.tsx +1 -1
- package/src/tableHandle/TableHandle.tsx +2 -2
- package/src/toolbar/Toolbar.tsx +2 -2
- package/types/src/ShadCNComponentsContext.d.ts +13 -13
- package/types/src/components/ui/badge.d.ts +2 -2
- package/types/src/components/ui/button.d.ts +2 -2
- package/types/src/components/ui/card.d.ts +1 -1
- package/types/src/components/ui/dropdown-menu.d.ts +2 -2
- package/types/src/components/ui/form.d.ts +2 -2
- package/types/src/components/ui/label.d.ts +2 -2
- package/types/src/components/ui/popover.d.ts +2 -2
- package/types/src/components/ui/select.d.ts +2 -2
- package/types/src/components/ui/tabs.d.ts +2 -2
- package/types/src/components/ui/toggle.d.ts +3 -3
- package/types/src/components/ui/tooltip.d.ts +2 -2
- package/types/src/index.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(N,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@blocknote/core"),require("@blocknote/react"),require("class-variance-authority"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-slot"),require("@radix-ui/react-dropdown-menu"),require("lucide-react"),require("
|
|
1
|
+
(function(N,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@blocknote/core"),require("@blocknote/react"),require("react-hook-form"),require("class-variance-authority"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-slot"),require("@radix-ui/react-dropdown-menu"),require("lucide-react"),require("@radix-ui/react-label"),require("@radix-ui/react-popover"),require("@radix-ui/react-select"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tooltip")):typeof define=="function"&&define.amd?define(["exports","react","@blocknote/core","@blocknote/react","react-hook-form","class-variance-authority","clsx","tailwind-merge","@radix-ui/react-slot","@radix-ui/react-dropdown-menu","lucide-react","@radix-ui/react-label","@radix-ui/react-popover","@radix-ui/react-select","@radix-ui/react-tabs","@radix-ui/react-toggle","@radix-ui/react-tooltip"],g):(N=typeof globalThis<"u"?globalThis:N||self,g(N["blocknote-shadcn"]={},N.React,N.core,N.react,N.reactHookForm,N.classVarianceAuthority,N.clsx,N.tailwindMerge,N.reactSlot,N.DropdownMenuPrimitive,N.lucideReact,N.LabelPrimitive,N.PopoverPrimitive,N.SelectPrimitive,N.TabsPrimitive,N.TogglePrimitive,N.TooltipPrimitive))})(this,function(N,g,w,W,se,Q,Cn,jn,xe,Nn,B,Sn,Tn,Rn,En,_n,Pn){"use strict";function V(n){if(n&&typeof n=="object"&&"default"in n)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const p=V(g),S=V(Nn),he=V(Sn),ee=V(Tn),_=V(Rn),$=V(En),ye=V(_n),G=V(Pn);var ie={exports:{}},K={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -27,5 +27,5 @@ Check the top-level render call using <`+l+">.")}return i}}function xn(e,i){{if(
|
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,ve,z,jr,z),yn[z+ve]=!0}}return e===o?xr(P):vr(P),P}}function hr(e,i,l){return wn(e,i,l,!0)}function yr(e,i,l){return wn(e,i,l,!1)}var wr=yr,Cr=hr;J.Fragment=o,J.jsx=wr,J.jsxs=Cr}()),J}process.env.NODE_ENV==="production"?ie.exports=Dn():ie.exports=In();var a=ie.exports;const Mn=jn.extendTailwindMerge({prefix:"bn-"});function b(...n){return Mn(Cn.clsx(n))}const kn=Q.cva("bn-inline-flex bn-items-center bn-rounded-full bn-border bn-px-2.5 bn-py-0.5 bn-text-xs bn-font-semibold bn-transition-colors focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2",{variants:{variant:{default:"bn-border-transparent bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/80",secondary:"bn-border-transparent bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",destructive:"bn-border-transparent bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/80",outline:"bn-text-foreground"}},defaultVariants:{variant:"default"}});function On({className:n,variant:r,...t}){return a.jsx("div",{className:b(kn({variant:r}),n),...t})}const Fn=Q.cva("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50",{variants:{variant:{default:"bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/90",destructive:"bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/90",outline:"bn-border bn-border-input bn-bg-background hover:bn-bg-accent hover:bn-text-accent-foreground",secondary:"bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",ghost:"hover:bn-bg-accent hover:bn-text-accent-foreground",link:"bn-text-primary bn-underline-offset-4 hover:bn-underline"},size:{default:"bn-h-10 bn-px-4 bn-py-2",sm:"bn-h-9 bn-rounded-md bn-px-3",lg:"bn-h-11 bn-rounded-md bn-px-8",icon:"bn-h-10 bn-w-10"}},defaultVariants:{variant:"default",size:"default"}}),je=p.forwardRef(({className:n,variant:r,size:t,asChild:o=!1,...s},d)=>{const c=o?xe.Slot:"button";return a.jsx(c,{className:b(Fn({variant:r,size:t,className:n})),ref:d,...s})});je.displayName="Button";const Ne=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",n),...r}));Ne.displayName="Card";const Ln=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-flex bn-flex-col bn-space-y-1.5 bn-p-6",n),...r}));Ln.displayName="CardHeader";const Bn=p.forwardRef(({className:n,...r},t)=>a.jsx("h3",{ref:t,className:b("bn-text-2xl bn-font-semibold bn-leading-none bn-tracking-tight",n),...r}));Bn.displayName="CardTitle";const Vn=p.forwardRef(({className:n,...r},t)=>a.jsx("p",{ref:t,className:b("bn-text-sm bn-text-muted-foreground",n),...r}));Vn.displayName="CardDescription";const Se=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-p-6 bn-pt-0",n),...r}));Se.displayName="CardContent";const $n=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-flex bn-items-center bn-p-6 bn-pt-0",n),...r}));$n.displayName="CardFooter";const An=S.Root,zn=S.Trigger,Wn=S.Sub,Te=p.forwardRef(({className:n,inset:r,children:t,...o},s)=>a.jsxs(S.SubTrigger,{ref:s,className:b("bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none focus:bn-bg-accent data-[state=open]:bn-bg-accent",r&&"bn-pl-8",n),...o,children:[t,a.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));Te.displayName=S.SubTrigger.displayName;const Re=p.forwardRef(({className:n,...r},t)=>a.jsx(S.SubContent,{ref:t,className:b("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-lg data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...r}));Re.displayName=S.SubContent.displayName;const Ee=p.forwardRef(({className:n,sideOffset:r=4,...t},o)=>a.jsx(S.Content,{ref:o,sideOffset:r,className:b("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...t}));Ee.displayName=S.Content.displayName;const _e=p.forwardRef(({className:n,inset:r,...t},o)=>a.jsx(S.Item,{ref:o,className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",r&&"bn-pl-8",n),...t}));_e.displayName=S.Item.displayName;const Pe=p.forwardRef(({className:n,children:r,checked:t,...o},s)=>a.jsxs(S.CheckboxItem,{ref:s,className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),checked:t,...o,children:[a.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:a.jsx(S.ItemIndicator,{children:a.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),r]}));Pe.displayName=S.CheckboxItem.displayName;const qn=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(S.RadioItem,{ref:o,className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...t,children:[a.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:a.jsx(S.ItemIndicator,{children:a.jsx(B.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),r]}));qn.displayName=S.RadioItem.displayName;const De=p.forwardRef(({className:n,inset:r,...t},o)=>a.jsx(S.Label,{ref:o,className:b("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",r&&"bn-pl-8",n),...t}));De.displayName=S.Label.displayName;const Ie=p.forwardRef(({className:n,...r},t)=>a.jsx(S.Separator,{ref:t,className:b("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));Ie.displayName=S.Separator.displayName;const Yn=Q.cva("bn-text-sm bn-font-medium bn-leading-none peer-disabled:bn-cursor-not-allowed peer-disabled:bn-opacity-70"),le=p.forwardRef(({className:n,...r},t)=>a.jsx(he.Root,{ref:t,className:b(Yn(),n),...r}));le.displayName=he.Root.displayName;const Un=se.FormProvider,Gn=p.createContext({}),ne=()=>{const n=p.useContext(Gn),r=p.useContext(Me),{getFieldState:t,formState:o}=se.useFormContext(),s=t(n.name,o);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:d}=r;return{id:d,name:n.name,formItemId:`${d}-form-item`,formDescriptionId:`${d}-form-item-description`,formMessageId:`${d}-form-item-message`,...s}},Me=p.createContext({}),Kn=p.forwardRef(({className:n,...r},t)=>{const o=p.useId();return a.jsx(Me.Provider,{value:{id:o},children:a.jsx("div",{ref:t,className:b("bn-space-y-2",n),...r})})});Kn.displayName="FormItem";const Jn=p.forwardRef(({className:n,...r},t)=>{const{error:o,formItemId:s}=ne();return a.jsx(le,{ref:t,className:b(o&&"bn-text-destructive",n),htmlFor:s,...r})});Jn.displayName="FormLabel";const Hn=p.forwardRef(({...n},r)=>{const{error:t,formItemId:o,formDescriptionId:s,formMessageId:d}=ne();return a.jsx(xe.Slot,{ref:r,id:o,"aria-describedby":t?`${s} ${d}`:`${s}`,"aria-invalid":!!t,...n})});Hn.displayName="FormControl";const Xn=p.forwardRef(({className:n,...r},t)=>{const{formDescriptionId:o}=ne();return a.jsx("p",{ref:t,id:o,className:b("bn-text-sm bn-text-muted-foreground",n),...r})});Xn.displayName="FormDescription";const Zn=p.forwardRef(({className:n,children:r,...t},o)=>{const{error:s,formMessageId:d}=ne(),c=s?String(s==null?void 0:s.message):r;return c?a.jsx("p",{ref:o,id:d,className:b("bn-text-sm bn-font-medium bn-text-destructive",n),...t,children:c}):null});Zn.displayName="FormMessage";const ke=p.forwardRef(({className:n,type:r,...t},o)=>a.jsx("input",{type:r,className:b("bn-flex bn-h-10 bn-w-full bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background file:bn-border-0 file:bn-bg-transparent file:bn-text-sm file:bn-font-medium placeholder:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50",n),ref:o,...t}));ke.displayName="Input";const Qn=ee.Root,et=ee.Trigger,Oe=p.forwardRef(({className:n,align:r="center",sideOffset:t=4,...o},s)=>a.jsx(ee.Content,{ref:s,align:r,sideOffset:t,className:b("bn-z-50 bn-w-72 bn-rounded-md bn-border bn-bg-popover bn-p-4 bn-text-popover-foreground bn-shadow-md bn-outline-none data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...o}));Oe.displayName=ee.Content.displayName;const nt=_.Root,tt=_.Value,Fe=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(_.Trigger,{ref:o,className:b("bn-flex bn-h-10 bn-w-full bn-items-center bn-justify-between bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background placeholder:bn-text-muted-foreground focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50 [&>span]:bn-line-clamp-1",n),...t,children:[r,a.jsx(_.Icon,{asChild:!0,children:a.jsx(B.ChevronDown,{className:"bn-h-4 bn-w-4 bn-opacity-50"})})]}));Fe.displayName=_.Trigger.displayName;const Le=p.forwardRef(({className:n,...r},t)=>a.jsx(_.ScrollUpButton,{ref:t,className:b("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:a.jsx(B.ChevronUp,{className:"bn-h-4 bn-w-4"})}));Le.displayName=_.ScrollUpButton.displayName;const Be=p.forwardRef(({className:n,...r},t)=>a.jsx(_.ScrollDownButton,{ref:t,className:b("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:a.jsx(B.ChevronDown,{className:"bn-h-4 bn-w-4"})}));Be.displayName=_.ScrollDownButton.displayName;const Ve=p.forwardRef(({className:n,children:r,position:t="popper",...o},s)=>a.jsxs(_.Content,{ref:s,className:b("bn-relative bn-z-50 bn-max-h-96 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:bn-translate-y-1 data-[side=left]:bn--translate-x-1 data-[side=right]:bn-translate-x-1 data-[side=top]:bn--translate-y-1",n),position:t,...o,children:[a.jsx(Le,{}),a.jsx(_.Viewport,{className:b("bn-p-1",t==="popper"&&"bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]"),children:r}),a.jsx(Be,{})]}));Ve.displayName=_.Content.displayName;const rt=p.forwardRef(({className:n,...r},t)=>a.jsx(_.Label,{ref:t,className:b("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",n),...r}));rt.displayName=_.Label.displayName;const $e=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(_.Item,{ref:o,className:b("bn-relative bn-flex bn-w-full bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...t,children:[a.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:a.jsx(_.ItemIndicator,{children:a.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),a.jsx(_.ItemText,{children:r})]}));$e.displayName=_.Item.displayName;const ot=p.forwardRef(({className:n,...r},t)=>a.jsx(_.Separator,{ref:t,className:b("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));ot.displayName=_.Separator.displayName;const at=$.Root,Ae=p.forwardRef(({className:n,...r},t)=>a.jsx($.List,{ref:t,className:b("bn-inline-flex bn-h-10 bn-items-center bn-justify-center bn-rounded-md bn-bg-muted bn-p-1 bn-text-muted-foreground",n),...r}));Ae.displayName=$.List.displayName;const ze=p.forwardRef(({className:n,...r},t)=>a.jsx($.Trigger,{ref:t,className:b("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-sm bn-px-3 bn-py-1.5 bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-all focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=active]:bn-bg-background data-[state=active]:bn-text-foreground data-[state=active]:bn-shadow-sm",n),...r}));ze.displayName=$.Trigger.displayName;const We=p.forwardRef(({className:n,...r},t)=>a.jsx($.Content,{ref:t,className:b("bn-mt-2 bn-ring-offset-background focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2",n),...r}));We.displayName=$.Content.displayName;const st=Q.cva("bn-inline-flex bn-items-center bn-justify-center bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors hover:bn-bg-muted hover:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=on]:bn-bg-accent data-[state=on]:bn-text-accent-foreground",{variants:{variant:{default:"bn-bg-transparent",outline:"bn-border bn-border-input bn-bg-transparent hover:bn-bg-accent hover:bn-text-accent-foreground"},size:{default:"bn-h-10 bn-px-3",sm:"bn-h-9 bn-px-2.5",lg:"bn-h-11 bn-px-5"}},defaultVariants:{variant:"default",size:"default"}}),qe=p.forwardRef(({className:n,variant:r,size:t,...o},s)=>a.jsx(ye.Root,{ref:s,className:b(st({variant:r,size:t,className:n})),...o}));qe.displayName=ye.Root.displayName;const it=G.Provider,lt=G.Root,dt=G.Trigger,Ye=p.forwardRef(({className:n,sideOffset:r=4,...t},o)=>a.jsx(G.Content,{ref:o,sideOffset:r,className:b("bn-z-50 bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-px-3 bn-py-1.5 bn-text-sm bn-text-popover-foreground bn-shadow-md bn-animate-in bn-fade-in-0 bn-zoom-in-95 data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=closed]:bn-zoom-out-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...t}));Ye.displayName=G.Content.displayName;const ct={Badge:{Badge:On},Button:{Button:je},Card:{Card:Ne,CardContent:Se},DropdownMenu:{DropdownMenu:An,DropdownMenuCheckboxItem:Pe,DropdownMenuContent:Ee,DropdownMenuItem:_e,DropdownMenuLabel:De,DropdownMenuSeparator:Ie,DropdownMenuSub:Wn,DropdownMenuSubContent:Re,DropdownMenuSubTrigger:Te,DropdownMenuTrigger:zn},Form:{Form:Un},Input:{Input:ke},Label:{Label:le},Popover:{Popover:Qn,PopoverContent:Oe,PopoverTrigger:et},Select:{Select:nt,SelectContent:Ve,SelectItem:$e,SelectTrigger:Fe,SelectValue:tt},Tabs:{Tabs:at,TabsContent:We,TabsList:Ae,TabsTrigger:ze},Toggle:{Toggle:qe},Tooltip:{Tooltip:lt,TooltipContent:Ye,TooltipProvider:it,TooltipTrigger:dt}},Ue=g.createContext(void 0);function T(){return g.useContext(Ue)}const ut=n=>{const{children:r,...t}=n;w.assertEmpty(t);const o=T(),s=se.useForm();return a.jsx(o.Form.Form,{...s,children:r})},bt=g.forwardRef((n,r)=>{const{className:t,children:o,id:s,columns:d,...c}=n;return w.assertEmpty(c),a.jsx("div",{className:t,style:{gridTemplateColumns:`repeat(${d}, 1fr)`},ref:r,id:s,role:"grid",children:o})}),ft=g.forwardRef((n,r)=>{const{className:t,children:o,columns:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{className:t,style:{gridColumn:`1 / ${s+1}`},ref:r,children:o})}),mt=g.forwardRef((n,r)=>{const{className:t,isSelected:o,onClick:s,item:d,id:c,...x}=n;w.assertEmpty(x);const f=g.useRef(null);return g.useEffect(()=>{if(!f.current||!o)return;const u=W.elementOverflow(f.current,document.querySelector(".bn-grid-suggestion-menu"));u==="top"?f.current.scrollIntoView(!0):u==="bottom"&&f.current.scrollIntoView(!1)},[o]),a.jsx("div",{className:t,ref:W.mergeRefs([r,f]),id:c,role:"option",onClick:s,"aria-selected":o||void 0,children:d.icon})}),pt=g.forwardRef((n,r)=>{const{className:t,children:o,columns:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{className:t,style:{gridColumn:`1 / ${s+1}`},ref:r,children:o})}),gt=n=>g.forwardRef((r,t)=>a.jsx(n,{onPointerDown:o=>{o.nativeEvent.fakeEvent||(o.ctrlKey=!0)},onPointerUp:o=>{const s=new PointerEvent("pointerdown",o.nativeEvent);s.fakeEvent=!0,o.target.dispatchEvent(s)},...r,ref:t})),vt=n=>{const{children:r,onOpenChange:t,position:o,sub:s,...d}=n;w.assertEmpty(d);const c=T();return s?a.jsx(c.DropdownMenu.DropdownMenuSub,{onOpenChange:t,children:r}):a.jsx(c.DropdownMenu.DropdownMenu,{onOpenChange:t,children:r})},xt=n=>{const{children:r,sub:t,...o}=n;w.assertEmpty(o);const s=T(),d=g.useMemo(()=>gt(s.DropdownMenu.DropdownMenuTrigger),[s.DropdownMenu.DropdownMenuTrigger]);return t?a.jsx(s.DropdownMenu.DropdownMenuSubTrigger,{children:r}):a.jsx(d,{asChild:!0,...o,children:r})},ht=g.forwardRef((n,r)=>{const{className:t,children:o,sub:s,...d}=n;w.assertEmpty(d);const c=T();return s?a.jsx(c.DropdownMenu.DropdownMenuSubContent,{className:t,ref:r,children:o}):a.jsx(c.DropdownMenu.DropdownMenuContent,{className:t,ref:r,children:o})}),yt=g.forwardRef((n,r)=>{const{className:t,children:o,icon:s,checked:d,subTrigger:c,onClick:x,...f}=n;w.assertEmpty(f);const u=T();return c?a.jsxs(a.Fragment,{children:[s,o]}):d!==void 0?a.jsxs(u.DropdownMenu.DropdownMenuCheckboxItem,{className:b(t,"bn-gap-1"),ref:r,checked:d,onClick:x,...f,children:[s,o]}):a.jsxs(u.DropdownMenu.DropdownMenuItem,{className:t,ref:r,onClick:x,...f,children:[s,o,c&&a.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),wt=g.forwardRef((n,r)=>{const{className:t,...o}=n;w.assertEmpty(o);const s=T();return a.jsx(s.DropdownMenu.DropdownMenuSeparator,{className:t,ref:r})}),Ct=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;w.assertEmpty(s);const d=T();return a.jsx(d.DropdownMenu.DropdownMenuLabel,{className:t,ref:r,children:o})}),jt=g.forwardRef((n,r)=>{const{className:t,tabs:o,defaultOpenTab:s,openTab:d,setOpenTab:c,loading:x,...f}=n;w.assertEmpty(f);const u=T();return a.jsxs(u.Tabs.Tabs,{className:b(t,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:r,value:d,defaultValue:s,onValueChange:c,children:[a.jsx(u.Tabs.TabsList,{children:o.map(v=>a.jsx(u.Tabs.TabsTrigger,{value:v.name,children:v.name},v.name))}),o.map(v=>a.jsx(u.Tabs.TabsContent,{value:v.name,children:a.jsx(u.Card.Card,{children:a.jsx(u.Card.CardContent,{className:"bn-p-4",children:v.tabPanel})})},v.name))]})}),Nt=g.forwardRef((n,r)=>{const{className:t,children:o,onClick:s,label:d,...c}=n;w.assertEmpty(c);const x=T();return a.jsx(x.Button.Button,{type:"submit",className:t,"aria-label":d,ref:r,onClick:s,children:o})}),St=g.forwardRef((n,r)=>{const{className:t,accept:o,value:s,placeholder:d,onChange:c,...x}=n;w.assertEmpty(x);const f=T();return a.jsx(f.Input.Input,{type:"file",className:t,ref:r,accept:o,value:s?s.name:void 0,onChange:async u=>c==null?void 0:c(u.target.files[0]),placeholder:d})}),Tt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b(t,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:r,children:o})}),Rt=g.forwardRef((n,r)=>{const{className:t,value:o,placeholder:s,onKeyDown:d,onChange:c,...x}=n;w.assertEmpty(x);const f=T();return a.jsx(f.Input.Input,{"data-test":"embed-input",className:b(t,"bn-w-80"),ref:r,value:o,placeholder:s,onKeyDown:d,onChange:c})}),Et=n=>{const{children:r,opened:t,position:o,...s}=n;w.assertEmpty(s);const d=T();return a.jsx(d.Popover.Popover,{open:t,children:r})},_t=g.forwardRef((n,r)=>{const{children:t,...o}=n;w.assertEmpty(o);const s=T();return a.jsx(s.Popover.PopoverTrigger,{ref:r,asChild:!0,children:t})}),Pt=g.forwardRef((n,r)=>{const{className:t,variant:o,children:s,...d}=n;w.assertEmpty(d);const c=T();return a.jsx(c.Popover.PopoverContent,{sideOffset:8,className:b(t,"bn-flex bn-flex-col bn-gap-2",o==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:r,children:s})}),Dt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s,!1),a.jsx("div",{className:t,ref:r,...s,children:o})}),It=g.forwardRef((n,r)=>{const{className:t,children:o,icon:s,onClick:d,onDragEnd:c,onDragStart:x,draggable:f,label:u,...v}=n;w.assertEmpty(v,!1);const R=T();return a.jsxs(R.Button.Button,{variant:"ghost",className:b(t,"bn-text-gray-400"),ref:r,"aria-label":u,onClick:d,onDragStart:x,onDragEnd:c,draggable:f,...v,children:[s,o]})}),Mt=g.forwardRef((n,r)=>{const{className:t,children:o,id:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{id:s,role:"listbox",className:b("bn-z-50 bn-min-w-[8rem] bn-overflow-auto bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",t),ref:r,children:o})}),kt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",t),ref:r,children:a.jsx("div",{children:o})})}),Ot=g.forwardRef((n,r)=>{const t=T(),{className:o,item:s,isSelected:d,onClick:c,id:x,...f}=n;w.assertEmpty(f);const u=g.useRef(null);return g.useEffect(()=>{if(!u.current||!d)return;const v=W.elementOverflow(u.current,document.querySelector(".bn-suggestion-menu"));v==="top"?u.current.scrollIntoView(!0):v==="bottom"&&u.current.scrollIntoView(!1)},[d]),a.jsxs("div",{className:b("bn-relative bn-flex bn-cursor-pointer bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",o),ref:W.mergeRefs([r,u]),id:x,onClick:c,role:"option","aria-selected":d||void 0,children:[s.icon&&a.jsx("div",{className:"bn-p-3","data-position":"left",children:s.icon}),a.jsxs("div",{className:"bn-flex-1",children:[a.jsx("div",{className:"bn-text-base",children:s.title}),a.jsx("div",{className:"bn-text-xs",children:s.subtext})]}),s.badge&&a.jsx("div",{"data-position":"right",className:"bn-text-xs",children:a.jsx(t.Badge.Badge,{variant:"secondary",children:s.badge})})]})}),Ft=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",t),ref:r,children:o})}),Lt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:t,ref:r,children:o})}),Bt=g.forwardRef((n,r)=>{const{className:t,children:o,draggable:s,onDragStart:d,onDragEnd:c,style:x,label:f,...u}=n;w.assertEmpty(u,!1);const v=T();return a.jsx(v.Button.Button,{variant:"ghost",className:b(t,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:r,"aria-label":f,draggable:s,onDragStart:d,onDragEnd:c,style:x,...u,children:o})}),Vt=g.forwardRef((n,r)=>{const{className:t,name:o,label:s,icon:d,value:c,autoFocus:x,placeholder:f,onKeyDown:u,onChange:v,onSubmit:R,...D}=n;w.assertEmpty(D);const F=T();return s?a.jsxs("div",{children:[a.jsx(F.Label.Label,{htmlFor:s,children:s}),a.jsx(F.Input.Input,{className:t,id:s,name:o,autoFocus:x,placeholder:f,value:c,onKeyDown:u,onChange:v,onSubmit:R})]}):a.jsx(F.Input.Input,{"aria-label":o,name:o,autoFocus:x,placeholder:f,value:c,onKeyDown:u,onChange:v,onSubmit:R,ref:r})}),Ge=g.forwardRef((n,r)=>{const{className:t,children:o,onMouseEnter:s,onMouseLeave:d,...c}=n;w.assertEmpty(c);const x=T();return a.jsx(x.Tooltip.TooltipProvider,{delayDuration:0,children:a.jsx("div",{className:b(t,"bn-flex bn-gap-1 bn-p-1 bn-bg-popover bn-text-popover-foreground bn-border bn-rounded-lg bn-shadow-md"),ref:r,onMouseEnter:s,onMouseLeave:d,children:o})})}),Ke=g.forwardRef((n,r)=>{const{className:t,children:o,mainTooltip:s,secondaryTooltip:d,icon:c,isSelected:x,isDisabled:f,onClick:u,label:v,...R}=n;w.assertEmpty(R,!1);const D=T(),F=x===void 0?a.jsxs(D.Button.Button,{className:t,variant:"ghost",disabled:f,onClick:u,ref:r,"aria-label":v,...R,children:[c,o]}):a.jsxs(D.Toggle.Toggle,{className:b(t,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground"),"aria-label":v,onClick:u,pressed:x,disabled:f,"data-state":x?"on":"off","data-disabled":f,ref:r,...R,children:[c,o]});return a.jsxs(D.Tooltip.Tooltip,{children:[a.jsx(D.Tooltip.TooltipTrigger,{asChild:!0,children:F}),a.jsxs(D.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center",children:[a.jsx("span",{children:s}),d&&a.jsx("span",{children:d})]})]})}),$t=g.forwardRef((n,r)=>{const{className:t,items:o,isDisabled:s,...d}=n;w.assertEmpty(d);const c=T(),x=u=>a.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[u.icon,u.text]}),f=o.filter(u=>u.isSelected)[0];return f?a.jsxs(c.Select.Select,{value:f.text,onValueChange:u=>{var v,R;return(R=(v=o.find(D=>D.text===u)).onClick)==null?void 0:R.call(v)},disabled:s,children:[a.jsx(c.Select.SelectTrigger,{className:"bn-border-none",children:a.jsx(c.Select.SelectValue,{})}),a.jsx(c.Select.SelectContent,{className:t,ref:r,children:o.map(u=>a.jsx(c.Select.SelectItem,{disabled:u.isDisabled,value:u.text,children:a.jsx(x,{...u})},u.text))})]}):null}),Je={FormattingToolbar:{Root:Ge,Button:Ke,Select:$t},FilePanel:{Root:jt,Button:Nt,FileInput:St,TabPanel:Tt,TextInput:Rt},LinkToolbar:{Root:Ge,Button:Ke},SideMenu:{Root:Dt,Button:It},SuggestionMenu:{Root:Mt,Item:Ot,EmptyItem:kt,Label:Ft,Loader:Lt},GridSuggestionMenu:{Root:bt,Item:mt,EmptyItem:ft,Loader:pt},TableHandle:{Root:Bt},Generic:{Form:{Root:ut,TextInput:Vt},Menu:{Root:vt,Trigger:xt,Dropdown:ht,Divider:wt,Label:Ct,Item:yt},Popover:{Root:Et,Trigger:_t,Content:Pt}}},At=n=>{const{className:r,shadCNComponents:t,...o}=n,s=g.useMemo(()=>({...ct,...t}),[t]);return a.jsx(Ue.Provider,{value:s,children:a.jsx(W.ComponentsContext.Provider,{value:Je,children:a.jsx(W.BlockNoteViewRaw,{className:w.mergeCSSClasses("bn-shadcn",r||""),...o})})})};N.BlockNoteView=At,N.components=Je,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
30
|
+
<%s key={someKey} {...props} />`,ve,z,jr,z),yn[z+ve]=!0}}return e===o?xr(P):vr(P),P}}function hr(e,i,l){return wn(e,i,l,!0)}function yr(e,i,l){return wn(e,i,l,!1)}var wr=yr,Cr=hr;J.Fragment=o,J.jsx=wr,J.jsxs=Cr}()),J}process.env.NODE_ENV==="production"?ie.exports=Dn():ie.exports=In();var a=ie.exports;const Mn=jn.extendTailwindMerge({prefix:"bn-"});function b(...n){return Mn(Cn.clsx(n))}const kn=Q.cva("bn-inline-flex bn-items-center bn-rounded-full bn-border bn-px-2.5 bn-py-0.5 bn-text-xs bn-font-semibold bn-transition-colors focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2",{variants:{variant:{default:"bn-border-transparent bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/80",secondary:"bn-border-transparent bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",destructive:"bn-border-transparent bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/80",outline:"bn-text-foreground"}},defaultVariants:{variant:"default"}});function On({className:n,variant:r,...t}){return a.jsx("div",{className:b(kn({variant:r}),n),...t})}const Fn=Q.cva("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50",{variants:{variant:{default:"bn-bg-primary bn-text-primary-foreground hover:bn-bg-primary/90",destructive:"bn-bg-destructive bn-text-destructive-foreground hover:bn-bg-destructive/90",outline:"bn-border bn-border-input bn-bg-background hover:bn-bg-accent hover:bn-text-accent-foreground",secondary:"bn-bg-secondary bn-text-secondary-foreground hover:bn-bg-secondary/80",ghost:"hover:bn-bg-accent hover:bn-text-accent-foreground",link:"bn-text-primary bn-underline-offset-4 hover:bn-underline"},size:{default:"bn-h-10 bn-px-4 bn-py-2",sm:"bn-h-9 bn-rounded-md bn-px-3",lg:"bn-h-11 bn-rounded-md bn-px-8",icon:"bn-h-10 bn-w-10"}},defaultVariants:{variant:"default",size:"default"}}),je=p.forwardRef(({className:n,variant:r,size:t,asChild:o=!1,...s},d)=>{const c=o?xe.Slot:"button";return a.jsx(c,{className:b(Fn({variant:r,size:t,className:n})),ref:d,...s})});je.displayName="Button";const Ne=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",n),...r}));Ne.displayName="Card";const Ln=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-flex bn-flex-col bn-space-y-1.5 bn-p-6",n),...r}));Ln.displayName="CardHeader";const Bn=p.forwardRef(({className:n,...r},t)=>a.jsx("h3",{ref:t,className:b("bn-text-2xl bn-font-semibold bn-leading-none bn-tracking-tight",n),...r}));Bn.displayName="CardTitle";const Vn=p.forwardRef(({className:n,...r},t)=>a.jsx("p",{ref:t,className:b("bn-text-sm bn-text-muted-foreground",n),...r}));Vn.displayName="CardDescription";const Se=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-p-6 bn-pt-0",n),...r}));Se.displayName="CardContent";const $n=p.forwardRef(({className:n,...r},t)=>a.jsx("div",{ref:t,className:b("bn-flex bn-items-center bn-p-6 bn-pt-0",n),...r}));$n.displayName="CardFooter";const An=S.Root,zn=S.Trigger,Wn=S.Sub,Te=p.forwardRef(({className:n,inset:r,children:t,...o},s)=>a.jsxs(S.SubTrigger,{ref:s,className:b("bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none focus:bn-bg-accent data-[state=open]:bn-bg-accent",r&&"bn-pl-8",n),...o,children:[t,a.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));Te.displayName=S.SubTrigger.displayName;const Re=p.forwardRef(({className:n,...r},t)=>a.jsx(S.SubContent,{ref:t,className:b("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-lg data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...r}));Re.displayName=S.SubContent.displayName;const Ee=p.forwardRef(({className:n,sideOffset:r=4,...t},o)=>a.jsx(S.Content,{ref:o,sideOffset:r,className:b("bn-z-50 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...t}));Ee.displayName=S.Content.displayName;const _e=p.forwardRef(({className:n,inset:r,...t},o)=>a.jsx(S.Item,{ref:o,className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",r&&"bn-pl-8",n),...t}));_e.displayName=S.Item.displayName;const Pe=p.forwardRef(({className:n,children:r,checked:t,...o},s)=>a.jsxs(S.CheckboxItem,{ref:s,className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),checked:t,...o,children:[a.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:a.jsx(S.ItemIndicator,{children:a.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),r]}));Pe.displayName=S.CheckboxItem.displayName;const qn=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(S.RadioItem,{ref:o,className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...t,children:[a.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:a.jsx(S.ItemIndicator,{children:a.jsx(B.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),r]}));qn.displayName=S.RadioItem.displayName;const De=p.forwardRef(({className:n,inset:r,...t},o)=>a.jsx(S.Label,{ref:o,className:b("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",r&&"bn-pl-8",n),...t}));De.displayName=S.Label.displayName;const Ie=p.forwardRef(({className:n,...r},t)=>a.jsx(S.Separator,{ref:t,className:b("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));Ie.displayName=S.Separator.displayName;const Yn=Q.cva("bn-text-sm bn-font-medium bn-leading-none peer-disabled:bn-cursor-not-allowed peer-disabled:bn-opacity-70"),le=p.forwardRef(({className:n,...r},t)=>a.jsx(he.Root,{ref:t,className:b(Yn(),n),...r}));le.displayName=he.Root.displayName;const Un=se.FormProvider,Gn=p.createContext({}),ne=()=>{const n=p.useContext(Gn),r=p.useContext(Me),{getFieldState:t,formState:o}=se.useFormContext(),s=t(n.name,o);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:d}=r;return{id:d,name:n.name,formItemId:`${d}-form-item`,formDescriptionId:`${d}-form-item-description`,formMessageId:`${d}-form-item-message`,...s}},Me=p.createContext({}),Kn=p.forwardRef(({className:n,...r},t)=>{const o=p.useId();return a.jsx(Me.Provider,{value:{id:o},children:a.jsx("div",{ref:t,className:b("bn-space-y-2",n),...r})})});Kn.displayName="FormItem";const Jn=p.forwardRef(({className:n,...r},t)=>{const{error:o,formItemId:s}=ne();return a.jsx(le,{ref:t,className:b(o&&"bn-text-destructive",n),htmlFor:s,...r})});Jn.displayName="FormLabel";const Hn=p.forwardRef(({...n},r)=>{const{error:t,formItemId:o,formDescriptionId:s,formMessageId:d}=ne();return a.jsx(xe.Slot,{ref:r,id:o,"aria-describedby":t?`${s} ${d}`:`${s}`,"aria-invalid":!!t,...n})});Hn.displayName="FormControl";const Xn=p.forwardRef(({className:n,...r},t)=>{const{formDescriptionId:o}=ne();return a.jsx("p",{ref:t,id:o,className:b("bn-text-sm bn-text-muted-foreground",n),...r})});Xn.displayName="FormDescription";const Zn=p.forwardRef(({className:n,children:r,...t},o)=>{const{error:s,formMessageId:d}=ne(),c=s?String(s==null?void 0:s.message):r;return c?a.jsx("p",{ref:o,id:d,className:b("bn-text-sm bn-font-medium bn-text-destructive",n),...t,children:c}):null});Zn.displayName="FormMessage";const ke=p.forwardRef(({className:n,type:r,...t},o)=>a.jsx("input",{type:r,className:b("bn-flex bn-h-10 bn-w-full bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background file:bn-border-0 file:bn-bg-transparent file:bn-text-sm file:bn-font-medium placeholder:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50",n),ref:o,...t}));ke.displayName="Input";const Qn=ee.Root,et=ee.Trigger,Oe=p.forwardRef(({className:n,align:r="center",sideOffset:t=4,...o},s)=>a.jsx(ee.Content,{ref:s,align:r,sideOffset:t,className:b("bn-z-50 bn-w-72 bn-rounded-md bn-border bn-bg-popover bn-p-4 bn-text-popover-foreground bn-shadow-md bn-outline-none data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...o}));Oe.displayName=ee.Content.displayName;const nt=_.Root,tt=_.Value,Fe=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(_.Trigger,{ref:o,className:b("bn-flex bn-h-10 bn-w-full bn-items-center bn-justify-between bn-rounded-md bn-border bn-border-input bn-bg-background bn-px-3 bn-py-2 bn-text-sm bn-ring-offset-background placeholder:bn-text-muted-foreground focus:bn-outline-none focus:bn-ring-2 focus:bn-ring-ring focus:bn-ring-offset-2 disabled:bn-cursor-not-allowed disabled:bn-opacity-50 [&>span]:bn-line-clamp-1",n),...t,children:[r,a.jsx(_.Icon,{asChild:!0,children:a.jsx(B.ChevronDown,{className:"bn-h-4 bn-w-4 bn-opacity-50"})})]}));Fe.displayName=_.Trigger.displayName;const Le=p.forwardRef(({className:n,...r},t)=>a.jsx(_.ScrollUpButton,{ref:t,className:b("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:a.jsx(B.ChevronUp,{className:"bn-h-4 bn-w-4"})}));Le.displayName=_.ScrollUpButton.displayName;const Be=p.forwardRef(({className:n,...r},t)=>a.jsx(_.ScrollDownButton,{ref:t,className:b("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:a.jsx(B.ChevronDown,{className:"bn-h-4 bn-w-4"})}));Be.displayName=_.ScrollDownButton.displayName;const Ve=p.forwardRef(({className:n,children:r,position:t="popper",...o},s)=>a.jsxs(_.Content,{ref:s,className:b("bn-relative bn-z-50 bn-max-h-96 bn-min-w-[8rem] bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:bn-translate-y-1 data-[side=left]:bn--translate-x-1 data-[side=right]:bn-translate-x-1 data-[side=top]:bn--translate-y-1",n),position:t,...o,children:[a.jsx(Le,{}),a.jsx(_.Viewport,{className:b("bn-p-1",t==="popper"&&"bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]"),children:r}),a.jsx(Be,{})]}));Ve.displayName=_.Content.displayName;const rt=p.forwardRef(({className:n,...r},t)=>a.jsx(_.Label,{ref:t,className:b("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",n),...r}));rt.displayName=_.Label.displayName;const $e=p.forwardRef(({className:n,children:r,...t},o)=>a.jsxs(_.Item,{ref:o,className:b("bn-relative bn-flex bn-w-full bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-outline-none focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",n),...t,children:[a.jsx("span",{className:"bn-absolute bn-left-2 bn-flex bn-h-3.5 bn-w-3.5 bn-items-center bn-justify-center",children:a.jsx(_.ItemIndicator,{children:a.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),a.jsx(_.ItemText,{children:r})]}));$e.displayName=_.Item.displayName;const ot=p.forwardRef(({className:n,...r},t)=>a.jsx(_.Separator,{ref:t,className:b("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));ot.displayName=_.Separator.displayName;const at=$.Root,Ae=p.forwardRef(({className:n,...r},t)=>a.jsx($.List,{ref:t,className:b("bn-inline-flex bn-h-10 bn-items-center bn-justify-center bn-rounded-md bn-bg-muted bn-p-1 bn-text-muted-foreground",n),...r}));Ae.displayName=$.List.displayName;const ze=p.forwardRef(({className:n,...r},t)=>a.jsx($.Trigger,{ref:t,className:b("bn-inline-flex bn-items-center bn-justify-center bn-whitespace-nowrap bn-rounded-sm bn-px-3 bn-py-1.5 bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-all focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=active]:bn-bg-background data-[state=active]:bn-text-foreground data-[state=active]:bn-shadow-sm",n),...r}));ze.displayName=$.Trigger.displayName;const We=p.forwardRef(({className:n,...r},t)=>a.jsx($.Content,{ref:t,className:b("bn-mt-2 bn-ring-offset-background focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2",n),...r}));We.displayName=$.Content.displayName;const st=Q.cva("bn-inline-flex bn-items-center bn-justify-center bn-rounded-md bn-text-sm bn-font-medium bn-ring-offset-background bn-transition-colors hover:bn-bg-muted hover:bn-text-muted-foreground focus-visible:bn-outline-none focus-visible:bn-ring-2 focus-visible:bn-ring-ring focus-visible:bn-ring-offset-2 disabled:bn-pointer-events-none disabled:bn-opacity-50 data-[state=on]:bn-bg-accent data-[state=on]:bn-text-accent-foreground",{variants:{variant:{default:"bn-bg-transparent",outline:"bn-border bn-border-input bn-bg-transparent hover:bn-bg-accent hover:bn-text-accent-foreground"},size:{default:"bn-h-10 bn-px-3",sm:"bn-h-9 bn-px-2.5",lg:"bn-h-11 bn-px-5"}},defaultVariants:{variant:"default",size:"default"}}),qe=p.forwardRef(({className:n,variant:r,size:t,...o},s)=>a.jsx(ye.Root,{ref:s,className:b(st({variant:r,size:t,className:n})),...o}));qe.displayName=ye.Root.displayName;const it=G.Provider,lt=G.Root,dt=G.Trigger,Ye=p.forwardRef(({className:n,sideOffset:r=4,...t},o)=>a.jsx(G.Content,{ref:o,sideOffset:r,className:b("bn-z-50 bn-overflow-hidden bn-rounded-md bn-border bn-bg-popover bn-px-3 bn-py-1.5 bn-text-sm bn-text-popover-foreground bn-shadow-md bn-animate-in bn-fade-in-0 bn-zoom-in-95 data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=closed]:bn-zoom-out-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",n),...t}));Ye.displayName=G.Content.displayName;const ct={Badge:{Badge:On},Button:{Button:je},Card:{Card:Ne,CardContent:Se},DropdownMenu:{DropdownMenu:An,DropdownMenuCheckboxItem:Pe,DropdownMenuContent:Ee,DropdownMenuItem:_e,DropdownMenuLabel:De,DropdownMenuSeparator:Ie,DropdownMenuSub:Wn,DropdownMenuSubContent:Re,DropdownMenuSubTrigger:Te,DropdownMenuTrigger:zn},Form:{Form:Un},Input:{Input:ke},Label:{Label:le},Popover:{Popover:Qn,PopoverContent:Oe,PopoverTrigger:et},Select:{Select:nt,SelectContent:Ve,SelectItem:$e,SelectTrigger:Fe,SelectValue:tt},Tabs:{Tabs:at,TabsContent:We,TabsList:Ae,TabsTrigger:ze},Toggle:{Toggle:qe},Tooltip:{Tooltip:lt,TooltipContent:Ye,TooltipProvider:it,TooltipTrigger:dt}},Ue=g.createContext(void 0);function T(){return g.useContext(Ue)}const ut=n=>{const{children:r,...t}=n;w.assertEmpty(t);const o=T(),s=se.useForm();return a.jsx(o.Form.Form,{...s,children:r})},bt=g.forwardRef((n,r)=>{const{className:t,name:o,label:s,icon:d,value:c,autoFocus:x,placeholder:f,onKeyDown:u,onChange:v,onSubmit:R,...D}=n;w.assertEmpty(D);const F=T();return s?a.jsxs("div",{children:[a.jsx(F.Label.Label,{htmlFor:s,children:s}),a.jsx(F.Input.Input,{className:t,id:s,name:o,autoFocus:x,placeholder:f,value:c,onKeyDown:u,onChange:v,onSubmit:R})]}):a.jsx(F.Input.Input,{"aria-label":o,name:o,autoFocus:x,placeholder:f,value:c,onKeyDown:u,onChange:v,onSubmit:R,ref:r})}),ft=n=>g.forwardRef((r,t)=>a.jsx(n,{onPointerDown:o=>{o.nativeEvent.fakeEvent||(o.ctrlKey=!0)},onPointerUp:o=>{const s=new PointerEvent("pointerdown",o.nativeEvent);s.fakeEvent=!0,o.target.dispatchEvent(s)},...r,ref:t})),mt=n=>{const{children:r,onOpenChange:t,position:o,sub:s,...d}=n;w.assertEmpty(d);const c=T();return s?a.jsx(c.DropdownMenu.DropdownMenuSub,{onOpenChange:t,children:r}):a.jsx(c.DropdownMenu.DropdownMenu,{onOpenChange:t,children:r})},pt=n=>{const{children:r,sub:t,...o}=n;w.assertEmpty(o);const s=T(),d=g.useMemo(()=>ft(s.DropdownMenu.DropdownMenuTrigger),[s.DropdownMenu.DropdownMenuTrigger]);return t?a.jsx(s.DropdownMenu.DropdownMenuSubTrigger,{children:r}):a.jsx(d,{asChild:!0,...o,children:r})},gt=g.forwardRef((n,r)=>{const{className:t,children:o,sub:s,...d}=n;w.assertEmpty(d);const c=T();return s?a.jsx(c.DropdownMenu.DropdownMenuSubContent,{className:t,ref:r,children:o}):a.jsx(c.DropdownMenu.DropdownMenuContent,{className:t,ref:r,children:o})}),vt=g.forwardRef((n,r)=>{const{className:t,children:o,icon:s,checked:d,subTrigger:c,onClick:x,...f}=n;w.assertEmpty(f);const u=T();return c?a.jsxs(a.Fragment,{children:[s,o]}):d!==void 0?a.jsxs(u.DropdownMenu.DropdownMenuCheckboxItem,{className:b(t,"bn-gap-1"),ref:r,checked:d,onClick:x,...f,children:[s,o]}):a.jsxs(u.DropdownMenu.DropdownMenuItem,{className:t,ref:r,onClick:x,...f,children:[s,o,c&&a.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),xt=g.forwardRef((n,r)=>{const{className:t,...o}=n;w.assertEmpty(o);const s=T();return a.jsx(s.DropdownMenu.DropdownMenuSeparator,{className:t,ref:r})}),ht=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;w.assertEmpty(s);const d=T();return a.jsx(d.DropdownMenu.DropdownMenuLabel,{className:t,ref:r,children:o})}),yt=g.forwardRef((n,r)=>{const{className:t,tabs:o,defaultOpenTab:s,openTab:d,setOpenTab:c,loading:x,...f}=n;w.assertEmpty(f);const u=T();return a.jsxs(u.Tabs.Tabs,{className:b(t,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:r,value:d,defaultValue:s,onValueChange:c,children:[a.jsx(u.Tabs.TabsList,{children:o.map(v=>a.jsx(u.Tabs.TabsTrigger,{value:v.name,children:v.name},v.name))}),o.map(v=>a.jsx(u.Tabs.TabsContent,{value:v.name,children:a.jsx(u.Card.Card,{children:a.jsx(u.Card.CardContent,{className:"bn-p-4",children:v.tabPanel})})},v.name))]})}),wt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b(t,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:r,children:o})}),Ct=g.forwardRef((n,r)=>{const{className:t,value:o,placeholder:s,onKeyDown:d,onChange:c,...x}=n;w.assertEmpty(x);const f=T();return a.jsx(f.Input.Input,{"data-test":"embed-input",className:b(t,"bn-w-80"),ref:r,value:o,placeholder:s,onKeyDown:d,onChange:c})}),jt=n=>{const{children:r,opened:t,position:o,...s}=n;w.assertEmpty(s);const d=T();return a.jsx(d.Popover.Popover,{open:t,children:r})},Nt=g.forwardRef((n,r)=>{const{children:t,...o}=n;w.assertEmpty(o);const s=T();return a.jsx(s.Popover.PopoverTrigger,{ref:r,asChild:!0,children:t})}),St=g.forwardRef((n,r)=>{const{className:t,variant:o,children:s,...d}=n;w.assertEmpty(d);const c=T();return a.jsx(c.Popover.PopoverContent,{sideOffset:8,className:b(t,"bn-flex bn-flex-col bn-gap-2",o==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:r,children:s})}),Tt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s,!1),a.jsx("div",{className:t,ref:r,...s,children:o})}),Rt=g.forwardRef((n,r)=>{const{className:t,children:o,icon:s,onClick:d,onDragEnd:c,onDragStart:x,draggable:f,label:u,...v}=n;w.assertEmpty(v,!1);const R=T();return a.jsxs(R.Button.Button,{variant:"ghost",className:b(t,"bn-text-gray-400"),ref:r,"aria-label":u,onClick:d,onDragStart:x,onDragEnd:c,draggable:f,...v,children:[s,o]})}),Et=g.forwardRef((n,r)=>{const{className:t,children:o,id:s,columns:d,...c}=n;return w.assertEmpty(c),a.jsx("div",{className:t,style:{gridTemplateColumns:`repeat(${d}, 1fr)`},ref:r,id:s,role:"grid",children:o})}),_t=g.forwardRef((n,r)=>{const{className:t,children:o,columns:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{className:t,style:{gridColumn:`1 / ${s+1}`},ref:r,children:o})}),Pt=g.forwardRef((n,r)=>{const{className:t,children:o,id:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{id:s,role:"listbox",className:b("bn-z-50 bn-min-w-[8rem] bn-overflow-auto bn-rounded-md bn-border bn-bg-popover bn-p-1 bn-text-popover-foreground bn-shadow-md data-[state=open]:bn-animate-in data-[state=closed]:bn-animate-out data-[state=closed]:bn-fade-out-0 data-[state=open]:bn-fade-in-0 data-[state=closed]:bn-zoom-out-95 data-[state=open]:bn-zoom-in-95 data-[side=bottom]:bn-slide-in-from-top-2 data-[side=left]:bn-slide-in-from-right-2 data-[side=right]:bn-slide-in-from-left-2 data-[side=top]:bn-slide-in-from-bottom-2",t),ref:r,children:o})}),Dt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b("bn-relative bn-flex bn-cursor-default bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",t),ref:r,children:a.jsx("div",{children:o})})}),It=g.forwardRef((n,r)=>{const t=T(),{className:o,item:s,isSelected:d,onClick:c,id:x,...f}=n;w.assertEmpty(f);const u=g.useRef(null);return g.useEffect(()=>{if(!u.current||!d)return;const v=W.elementOverflow(u.current,document.querySelector(".bn-suggestion-menu"));v==="top"?u.current.scrollIntoView(!0):v==="bottom"&&u.current.scrollIntoView(!1)},[d]),a.jsxs("div",{className:b("bn-relative bn-flex bn-cursor-pointer bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",o),ref:W.mergeRefs([r,u]),id:x,onClick:c,role:"option","aria-selected":d||void 0,children:[s.icon&&a.jsx("div",{className:"bn-p-3","data-position":"left",children:s.icon}),a.jsxs("div",{className:"bn-flex-1",children:[a.jsx("div",{className:"bn-text-base",children:s.title}),a.jsx("div",{className:"bn-text-xs",children:s.subtext})]}),s.badge&&a.jsx("div",{"data-position":"right",className:"bn-text-xs",children:a.jsx(t.Badge.Badge,{variant:"secondary",children:s.badge})})]})}),Mt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:b("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",t),ref:r,children:o})}),kt=g.forwardRef((n,r)=>{const{className:t,children:o,...s}=n;return w.assertEmpty(s),a.jsx("div",{className:t,ref:r,children:o})}),Ot=g.forwardRef((n,r)=>{const{className:t,children:o,draggable:s,onDragStart:d,onDragEnd:c,style:x,label:f,...u}=n;w.assertEmpty(u,!1);const v=T();return a.jsx(v.Button.Button,{variant:"ghost",className:b(t,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:r,"aria-label":f,draggable:s,onDragStart:d,onDragEnd:c,style:x,...u,children:o})}),Ge=g.forwardRef((n,r)=>{const{className:t,children:o,onMouseEnter:s,onMouseLeave:d,...c}=n;w.assertEmpty(c);const x=T();return a.jsx(x.Tooltip.TooltipProvider,{delayDuration:0,children:a.jsx("div",{className:b(t,"bn-flex bn-gap-1 bn-p-1 bn-bg-popover bn-text-popover-foreground bn-border bn-rounded-lg bn-shadow-md"),ref:r,onMouseEnter:s,onMouseLeave:d,children:o})})}),Ke=g.forwardRef((n,r)=>{const{className:t,children:o,mainTooltip:s,secondaryTooltip:d,icon:c,isSelected:x,isDisabled:f,onClick:u,label:v,...R}=n;w.assertEmpty(R,!1);const D=T(),F=x===void 0?a.jsxs(D.Button.Button,{className:t,variant:"ghost",disabled:f,onClick:u,ref:r,"aria-label":v,...R,children:[c,o]}):a.jsxs(D.Toggle.Toggle,{className:b(t,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground"),"aria-label":v,onClick:u,pressed:x,disabled:f,"data-state":x?"on":"off","data-disabled":f,ref:r,...R,children:[c,o]});return a.jsxs(D.Tooltip.Tooltip,{children:[a.jsx(D.Tooltip.TooltipTrigger,{asChild:!0,children:F}),a.jsxs(D.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center",children:[a.jsx("span",{children:s}),d&&a.jsx("span",{children:d})]})]})}),Ft=g.forwardRef((n,r)=>{const{className:t,items:o,isDisabled:s,...d}=n;w.assertEmpty(d);const c=T(),x=u=>a.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[u.icon,u.text]}),f=o.filter(u=>u.isSelected)[0];return f?a.jsxs(c.Select.Select,{value:f.text,onValueChange:u=>{var v,R;return(R=(v=o.find(D=>D.text===u)).onClick)==null?void 0:R.call(v)},disabled:s,children:[a.jsx(c.Select.SelectTrigger,{className:"bn-border-none",children:a.jsx(c.Select.SelectValue,{})}),a.jsx(c.Select.SelectContent,{className:t,ref:r,children:o.map(u=>a.jsx(c.Select.SelectItem,{disabled:u.isDisabled,value:u.text,children:a.jsx(x,{...u})},u.text))})]}):null}),Lt=g.forwardRef((n,r)=>{const{className:t,children:o,onClick:s,label:d,...c}=n;w.assertEmpty(c);const x=T();return a.jsx(x.Button.Button,{type:"submit",className:t,"aria-label":d,ref:r,onClick:s,children:o})}),Bt=g.forwardRef((n,r)=>{const{className:t,accept:o,value:s,placeholder:d,onChange:c,...x}=n;w.assertEmpty(x);const f=T();return a.jsx(f.Input.Input,{type:"file",className:t,ref:r,accept:o,value:s?s.name:void 0,onChange:async u=>c==null?void 0:c(u.target.files[0]),placeholder:d})}),Vt=g.forwardRef((n,r)=>{const{className:t,isSelected:o,onClick:s,item:d,id:c,...x}=n;w.assertEmpty(x);const f=g.useRef(null);return g.useEffect(()=>{if(!f.current||!o)return;const u=W.elementOverflow(f.current,document.querySelector(".bn-grid-suggestion-menu"));u==="top"?f.current.scrollIntoView(!0):u==="bottom"&&f.current.scrollIntoView(!1)},[o]),a.jsx("div",{className:t,ref:W.mergeRefs([r,f]),id:c,role:"option",onClick:s,"aria-selected":o||void 0,children:d.icon})}),$t=g.forwardRef((n,r)=>{const{className:t,children:o,columns:s,...d}=n;return w.assertEmpty(d),a.jsx("div",{className:t,style:{gridColumn:`1 / ${s+1}`},ref:r,children:o})}),Je={FormattingToolbar:{Root:Ge,Button:Ke,Select:Ft},FilePanel:{Root:yt,Button:Lt,FileInput:Bt,TabPanel:wt,TextInput:Ct},LinkToolbar:{Root:Ge,Button:Ke},SideMenu:{Root:Tt,Button:Rt},SuggestionMenu:{Root:Pt,Item:It,EmptyItem:Dt,Label:Mt,Loader:kt},GridSuggestionMenu:{Root:Et,Item:Vt,EmptyItem:_t,Loader:$t},TableHandle:{Root:Ot},Generic:{Form:{Root:ut,TextInput:bt},Menu:{Root:mt,Trigger:pt,Dropdown:gt,Divider:xt,Label:ht,Item:vt},Popover:{Root:jt,Trigger:Nt,Content:St}}},At=n=>{const{className:r,shadCNComponents:t,...o}=n,s=g.useMemo(()=>({...ct,...t}),[t]);return a.jsx(Ue.Provider,{value:s,children:a.jsx(W.ComponentsContext.Provider,{value:Je,children:a.jsx(W.BlockNoteViewRaw,{className:w.mergeCSSClasses("bn-shadcn",r||""),...o})})})};N.BlockNoteView=At,N.components=Je,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
31
31
|
//# sourceMappingURL=blocknote-shadcn.umd.cjs.map
|