@blocknote/shadcn 0.14.2 → 0.14.4
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 +296 -297
- package/dist/blocknote-shadcn.js.map +1 -1
- package/dist/blocknote-shadcn.umd.cjs +10 -10
- package/dist/blocknote-shadcn.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/form/TextInput.tsx +51 -49
- package/src/style.css +2 -1
- package/src/tailwindStyles.css +420 -0
- package/types/src/components/ui/form.d.ts +1 -1
- package/types/src/form/TextInput.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(j,x){typeof exports=="object"&&typeof module<"u"?x(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("react-hook-form"),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","class-variance-authority","clsx","tailwind-merge","@radix-ui/react-slot","@radix-ui/react-dropdown-menu","lucide-react","react-hook-form","@radix-ui/react-label","@radix-ui/react-popover","@radix-ui/react-select","@radix-ui/react-tabs","@radix-ui/react-toggle","@radix-ui/react-tooltip"],x):(j=typeof globalThis<"u"?globalThis:j||self,x(j["blocknote-shadcn"]={},j.React,j.core,j.react,j.classVarianceAuthority,j.clsx,j.tailwindMerge,j.reactSlot,j.DropdownMenuPrimitive,j.lucideReact,j.reactHookForm,j.LabelPrimitive,j.PopoverPrimitive,j.SelectPrimitive,j.TabsPrimitive,j.TogglePrimitive,j.TooltipPrimitive))})(this,function(j,x,C,Z,Q,Cn,Nn,xe,jn,
|
|
1
|
+
(function(j,x){typeof exports=="object"&&typeof module<"u"?x(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("react-hook-form"),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","class-variance-authority","clsx","tailwind-merge","@radix-ui/react-slot","@radix-ui/react-dropdown-menu","lucide-react","react-hook-form","@radix-ui/react-label","@radix-ui/react-popover","@radix-ui/react-select","@radix-ui/react-tabs","@radix-ui/react-toggle","@radix-ui/react-tooltip"],x):(j=typeof globalThis<"u"?globalThis:j||self,x(j["blocknote-shadcn"]={},j.React,j.core,j.react,j.classVarianceAuthority,j.clsx,j.tailwindMerge,j.reactSlot,j.DropdownMenuPrimitive,j.lucideReact,j.reactHookForm,j.LabelPrimitive,j.PopoverPrimitive,j.SelectPrimitive,j.TabsPrimitive,j.TogglePrimitive,j.TooltipPrimitive))})(this,function(j,x,C,Z,Q,Cn,Nn,xe,jn,B,se,Tn,Sn,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 a=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const p=V(x),T=V(jn),he=V(Tn),ee=V(Sn),_=V(Rn),A=V(En),ye=V(_n),U=V(Pn);var ie={exports:{}},K={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var we;function Dn(){if(we)return K;we=1;var
|
|
9
|
+
*/var we;function Dn(){if(we)return K;we=1;var n=p.default,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function c(h,m,b){var g,R={},D=null,F=null;b!==void 0&&(D=""+b),m.key!==void 0&&(D=""+m.key),m.ref!==void 0&&(F=m.ref);for(g in m)a.call(m,g)&&!d.hasOwnProperty(g)&&(R[g]=m[g]);if(h&&h.defaultProps)for(g in m=h.defaultProps,m)R[g]===void 0&&(R[g]=m[g]);return{$$typeof:r,type:h,key:D,ref:F,props:R,_owner:s.current}}return K.Fragment=t,K.jsx=c,K.jsxs=c,K}var J={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ce;function In(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var
|
|
18
|
-
`+ce+e}}var ue=!1,re;{var Ht=typeof WeakMap=="function"?WeakMap:Map;re=new Ht}function ln(e,
|
|
17
|
+
*/var Ce;function In(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var n=p.default,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),He=Symbol.iterator,Bt="@@iterator";function Vt(e){if(e===null||typeof e!="object")return null;var i=He&&e[He]||e[Bt];return typeof i=="function"?i:null}var W=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function I(e){{for(var i=arguments.length,l=new Array(i>1?i-1:0),f=1;f<i;f++)l[f-1]=arguments[f];At("error",e,l)}}function At(e,i,l){{var f=W.ReactDebugCurrentFrame,w=f.getStackAddendum();w!==""&&(i+="%s",l=l.concat([w]));var N=l.map(function(y){return String(y)});N.unshift("Warning: "+i),Function.prototype.apply.call(console[e],console,N)}}var $t=!1,zt=!1,Wt=!1,qt=!1,Yt=!1,Xe;Xe=Symbol.for("react.module.reference");function Ut(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===d||Yt||e===s||e===b||e===g||qt||e===F||$t||zt||Wt||typeof e=="object"&&e!==null&&(e.$$typeof===D||e.$$typeof===R||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===Xe||e.getModuleId!==void 0))}function Kt(e,i,l){var f=e.displayName;if(f)return f;var w=i.displayName||i.name||"";return w!==""?l+"("+w+")":l}function Ze(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&I("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case t:return"Portal";case d:return"Profiler";case s:return"StrictMode";case b:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var i=e;return Ze(i)+".Consumer";case c:var l=e;return Ze(l._context)+".Provider";case m:return Kt(e,e.render,"ForwardRef");case R:var f=e.displayName||null;return f!==null?f:L(e.type)||"Memo";case D:{var w=e,N=w._payload,y=w._init;try{return L(y(N))}catch{return null}}}return null}var $=Object.assign,G=0,Qe,en,nn,tn,rn,on,an;function sn(){}sn.__reactDisabledLog=!0;function Jt(){{if(G===0){Qe=console.log,en=console.info,nn=console.warn,tn=console.error,rn=console.group,on=console.groupCollapsed,an=console.groupEnd;var e={configurable:!0,enumerable:!0,value:sn,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}G++}}function Gt(){{if(G--,G===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},e,{value:Qe}),info:$({},e,{value:en}),warn:$({},e,{value:nn}),error:$({},e,{value:tn}),group:$({},e,{value:rn}),groupCollapsed:$({},e,{value:on}),groupEnd:$({},e,{value:an})})}G<0&&I("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=W.ReactCurrentDispatcher,ce;function te(e,i,l){{if(ce===void 0)try{throw Error()}catch(w){var f=w.stack.trim().match(/\n( *(at )?)/);ce=f&&f[1]||""}return`
|
|
18
|
+
`+ce+e}}var ue=!1,re;{var Ht=typeof WeakMap=="function"?WeakMap:Map;re=new Ht}function ln(e,i){if(!e||ue)return"";{var l=re.get(e);if(l!==void 0)return l}var f;ue=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var N;N=de.current,de.current=null,Jt();try{if(i){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(k){f=k}Reflect.construct(e,[],y)}else{try{y.call()}catch(k){f=k}e.call(y.prototype)}}else{try{throw Error()}catch(k){f=k}e()}}catch(k){if(k&&f&&typeof k.stack=="string"){for(var v=k.stack.split(`
|
|
19
19
|
`),M=f.stack.split(`
|
|
20
|
-
`),
|
|
21
|
-
`+v[
|
|
20
|
+
`),E=v.length-1,P=M.length-1;E>=1&&P>=0&&v[E]!==M[P];)P--;for(;E>=1&&P>=0;E--,P--)if(v[E]!==M[P]){if(E!==1||P!==1)do if(E--,P--,P<0||v[E]!==M[P]){var O=`
|
|
21
|
+
`+v[E].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&re.set(e,O),O}while(E>=1&&P>=0);break}}}finally{ue=!1,de.current=N,Gt(),Error.prepareStackTrace=w}var Y=e?e.displayName||e.name:"",z=Y?te(Y):"";return typeof e=="function"&&re.set(e,z),z}function Xt(e,i,l){return ln(e,!1)}function Zt(e){var i=e.prototype;return!!(i&&i.isReactComponent)}function oe(e,i,l){if(e==null)return"";if(typeof e=="function")return ln(e,Zt(e));if(typeof e=="string")return te(e);switch(e){case b:return te("Suspense");case g:return te("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case m:return Xt(e.render);case R:return oe(e.type,i,l);case D:{var f=e,w=f._payload,N=f._init;try{return oe(N(w),i,l)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,dn={},cn=W.ReactDebugCurrentFrame;function ae(e){if(e){var i=e._owner,l=oe(e.type,e._source,i?i.type:null);cn.setExtraStackFrame(l)}else cn.setExtraStackFrame(null)}function Qt(e,i,l,f,w){{var N=Function.call.bind(H);for(var y in e)if(N(e,y)){var v=void 0;try{if(typeof e[y]!="function"){var M=Error((f||"React class")+": "+l+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw M.name="Invariant Violation",M}v=e[y](i,y,f,l,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){v=E}v&&!(v instanceof Error)&&(ae(w),I("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",f||"React class",l,y,typeof v),ae(null)),v instanceof Error&&!(v.message in dn)&&(dn[v.message]=!0,ae(w),I("Failed %s type: %s",l,v.message),ae(null))}}}var er=Array.isArray;function be(e){return er(e)}function nr(e){{var i=typeof Symbol=="function"&&Symbol.toStringTag,l=i&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l}}function tr(e){try{return un(e),!1}catch{return!0}}function un(e){return""+e}function bn(e){if(tr(e))return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(e)),un(e)}var X=W.ReactCurrentOwner,rr={key:!0,ref:!0,__self:!0,__source:!0},fn,pn,fe;fe={};function or(e){if(H.call(e,"ref")){var i=Object.getOwnPropertyDescriptor(e,"ref").get;if(i&&i.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if(H.call(e,"key")){var i=Object.getOwnPropertyDescriptor(e,"key").get;if(i&&i.isReactWarning)return!1}return e.key!==void 0}function sr(e,i){if(typeof e.ref=="string"&&X.current&&i&&X.current.stateNode!==i){var l=L(X.current.type);fe[l]||(I('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L(X.current.type),e.ref),fe[l]=!0)}}function ir(e,i){{var l=function(){fn||(fn=!0,I("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}}function lr(e,i){{var l=function(){pn||(pn=!0,I("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};l.isReactWarning=!0,Object.defineProperty(e,"ref",{get:l,configurable:!0})}}var dr=function(e,i,l,f,w,N,y){var v={$$typeof:r,type:e,key:i,ref:l,props:y,_owner:N};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function cr(e,i,l,f,w){{var N,y={},v=null,M=null;l!==void 0&&(bn(l),v=""+l),ar(i)&&(bn(i.key),v=""+i.key),or(i)&&(M=i.ref,sr(i,w));for(N in i)H.call(i,N)&&!rr.hasOwnProperty(N)&&(y[N]=i[N]);if(e&&e.defaultProps){var E=e.defaultProps;for(N in E)y[N]===void 0&&(y[N]=E[N])}if(v||M){var P=typeof e=="function"?e.displayName||e.name||"Unknown":e;v&&ir(y,P),M&&lr(y,P)}return dr(e,v,M,w,f,X.current,y)}}var pe=W.ReactCurrentOwner,mn=W.ReactDebugCurrentFrame;function q(e){if(e){var i=e._owner,l=oe(e.type,e._source,i?i.type:null);mn.setExtraStackFrame(l)}else mn.setExtraStackFrame(null)}var me;me=!1;function ge(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function gn(){{if(pe.current){var e=L(pe.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function ur(e){{if(e!==void 0){var
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function ur(e){{if(e!==void 0){var i=e.fileName.replace(/^.*[\\\/]/,""),l=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+
|
|
25
|
+
Check your code at `+i+":"+l+"."}return""}}var vn={};function br(e){{var i=gn();if(!i){var l=typeof e=="string"?e:e.displayName||e.name;l&&(i=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+l+">.")}return
|
|
27
|
+
Check the top-level render call using <`+l+">.")}return i}}function xn(e,i){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var l=br(i);if(vn[l])return;vn[l]=!0;var f="";e&&e._owner&&e._owner!==pe.current&&(f=" It was passed a child from "+L(e._owner.type)+"."),q(e),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',l,f),q(null)}}function hn(e,i){{if(typeof e!="object")return;if(be(e))for(var l=0;l<e.length;l++){var f=e[l];ge(f)&&xn(f,i)}else if(ge(e))e._store&&(e._store.validated=!0);else if(e){var w=Vt(e);if(typeof w=="function"&&w!==e.entries)for(var N=w.call(e),y;!(y=N.next()).done;)ge(y.value)&&xn(y.value,i)}}}function fr(e){{var i=e.type;if(i==null||typeof i=="string")return;var l;if(typeof i=="function")l=i.propTypes;else if(typeof i=="object"&&(i.$$typeof===m||i.$$typeof===R))l=i.propTypes;else return;if(l){var f=L(i);Qt(l,e.props,"prop",f,e)}else if(i.PropTypes!==void 0&&!me){me=!0;var w=L(i);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof i.getDefaultProps=="function"&&!i.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pr(e){{for(var i=Object.keys(e.props),l=0;l<i.length;l++){var f=i[l];if(f!=="children"&&f!=="key"){q(e),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),q(null);break}}e.ref!==null&&(q(e),I("Invalid attribute `ref` supplied to `React.Fragment`."),q(null))}}var yn={};function wn(e,i,l,f,w,N){{var y=Ut(e);if(!y){var v="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var M=ur(w);M?v+=M:v+=gn();var E;e===null?E="null":be(e)?E="array":e!==void 0&&e.$$typeof===r?(E="<"+(L(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,v)}var P=cr(e,i,l,w,N);if(P==null)return P;if(y){var O=i.children;if(O!==void 0)if(f)if(be(O)){for(var Y=0;Y<O.length;Y++)hn(O[Y],e);Object.freeze&&Object.freeze(O)}else I("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else hn(O,e)}if(H.call(i,"key")){var z=L(e),k=Object.keys(i).filter(function(yr){return yr!=="key"}),ve=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!yn[z+ve]){var hr=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";I(`A props object containing a "key" prop is being spread into JSX:
|
|
28
28
|
let props = %s;
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,ve,$,hr,$),yn[$+ve]=!0}}return e===a?pr(P):fr(P),P}}function mr(e,s,l){return wn(e,s,l,!0)}function gr(e,s,l){return wn(e,s,l,!1)}var vr=gr,xr=mr;J.Fragment=a,J.jsx=vr,J.jsxs=xr}()),J}process.env.NODE_ENV==="production"?ie.exports=Dn():ie.exports=In();var o=ie.exports;const Mn=Nn.extendTailwindMerge({prefix:"bn-"});function u(...t){return Mn(Cn.clsx(t))}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:t,variant:r,...n}){return o.jsx("div",{className:u(kn({variant:r}),t),...n})}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"}}),Ne=p.forwardRef(({className:t,variant:r,size:n,asChild:a=!1,...i},d)=>{const c=a?xe.Slot:"button";return o.jsx(c,{className:u(Fn({variant:r,size:n,className:t})),ref:d,...i})});Ne.displayName="Button";const je=p.forwardRef(({className:t,...r},n)=>o.jsx("div",{ref:n,className:u("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",t),...r}));je.displayName="Card";const Ln=p.forwardRef(({className:t,...r},n)=>o.jsx("div",{ref:n,className:u("bn-flex bn-flex-col bn-space-y-1.5 bn-p-6",t),...r}));Ln.displayName="CardHeader";const Bn=p.forwardRef(({className:t,...r},n)=>o.jsx("h3",{ref:n,className:u("bn-text-2xl bn-font-semibold bn-leading-none bn-tracking-tight",t),...r}));Bn.displayName="CardTitle";const Vn=p.forwardRef(({className:t,...r},n)=>o.jsx("p",{ref:n,className:u("bn-text-sm bn-text-muted-foreground",t),...r}));Vn.displayName="CardDescription";const Te=p.forwardRef(({className:t,...r},n)=>o.jsx("div",{ref:n,className:u("bn-p-6 bn-pt-0",t),...r}));Te.displayName="CardContent";const An=p.forwardRef(({className:t,...r},n)=>o.jsx("div",{ref:n,className:u("bn-flex bn-items-center bn-p-6 bn-pt-0",t),...r}));An.displayName="CardFooter";const $n=T.Root,zn=T.Trigger,Wn=T.Sub,Se=p.forwardRef(({className:t,inset:r,children:n,...a},i)=>o.jsxs(T.SubTrigger,{ref:i,className:u("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",t),...a,children:[n,o.jsx(L.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));Se.displayName=T.SubTrigger.displayName;const Re=p.forwardRef(({className:t,...r},n)=>o.jsx(T.SubContent,{ref:n,className:u("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",t),...r}));Re.displayName=T.SubContent.displayName;const Ee=p.forwardRef(({className:t,sideOffset:r=4,...n},a)=>o.jsx(T.Content,{ref:a,sideOffset:r,className:u("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",t),...n}));Ee.displayName=T.Content.displayName;const _e=p.forwardRef(({className:t,inset:r,...n},a)=>o.jsx(T.Item,{ref:a,className:u("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",t),...n}));_e.displayName=T.Item.displayName;const Pe=p.forwardRef(({className:t,children:r,checked:n,...a},i)=>o.jsxs(T.CheckboxItem,{ref:i,className:u("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",t),checked:n,...a,children:[o.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:o.jsx(T.ItemIndicator,{children:o.jsx(L.Check,{className:"bn-h-4 bn-w-4"})})}),r]}));Pe.displayName=T.CheckboxItem.displayName;const qn=p.forwardRef(({className:t,children:r,...n},a)=>o.jsxs(T.RadioItem,{ref:a,className:u("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",t),...n,children:[o.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:o.jsx(T.ItemIndicator,{children:o.jsx(L.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),r]}));qn.displayName=T.RadioItem.displayName;const De=p.forwardRef(({className:t,inset:r,...n},a)=>o.jsx(T.Label,{ref:a,className:u("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",r&&"bn-pl-8",t),...n}));De.displayName=T.Label.displayName;const Ie=p.forwardRef(({className:t,...r},n)=>o.jsx(T.Separator,{ref:n,className:u("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",t),...r}));Ie.displayName=T.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:t,...r},n)=>o.jsx(he.Root,{ref:n,className:u(Yn(),t),...r}));le.displayName=he.Root.displayName;const Un=se.FormProvider,Kn=p.createContext({}),ne=()=>{const t=p.useContext(Kn),r=p.useContext(Me),{getFieldState:n,formState:a}=se.useFormContext(),i=n(t.name,a);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:d}=r;return{id:d,name:t.name,formItemId:`${d}-form-item`,formDescriptionId:`${d}-form-item-description`,formMessageId:`${d}-form-item-message`,...i}},Me=p.createContext({}),Jn=p.forwardRef(({className:t,...r},n)=>{const a=p.useId();return o.jsx(Me.Provider,{value:{id:a},children:o.jsx("div",{ref:n,className:u("bn-space-y-2",t),...r})})});Jn.displayName="FormItem";const Gn=p.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:i}=ne();return o.jsx(le,{ref:n,className:u(a&&"bn-text-destructive",t),htmlFor:i,...r})});Gn.displayName="FormLabel";const Hn=p.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:i,formMessageId:d}=ne();return o.jsx(xe.Slot,{ref:r,id:a,"aria-describedby":n?`${i} ${d}`:`${i}`,"aria-invalid":!!n,...t})});Hn.displayName="FormControl";const Xn=p.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=ne();return o.jsx("p",{ref:n,id:a,className:u("bn-text-sm bn-text-muted-foreground",t),...r})});Xn.displayName="FormDescription";const Zn=p.forwardRef(({className:t,children:r,...n},a)=>{const{error:i,formMessageId:d}=ne(),c=i?String(i==null?void 0:i.message):r;return c?o.jsx("p",{ref:a,id:d,className:u("bn-text-sm bn-font-medium bn-text-destructive",t),...n,children:c}):null});Zn.displayName="FormMessage";const ke=p.forwardRef(({className:t,type:r,...n},a)=>o.jsx("input",{type:r,className:u("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",t),ref:a,...n}));ke.displayName="Input";const Qn=ee.Root,et=ee.Trigger,Oe=p.forwardRef(({className:t,align:r="center",sideOffset:n=4,...a},i)=>o.jsx(ee.Content,{ref:i,align:r,sideOffset:n,className:u("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",t),...a}));Oe.displayName=ee.Content.displayName;const nt=E.Root,tt=E.Value,Fe=p.forwardRef(({className:t,children:r,...n},a)=>o.jsxs(E.Trigger,{ref:a,className:u("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",t),...n,children:[r,o.jsx(E.Icon,{asChild:!0,children:o.jsx(L.ChevronDown,{className:"bn-h-4 bn-w-4 bn-opacity-50"})})]}));Fe.displayName=E.Trigger.displayName;const Le=p.forwardRef(({className:t,...r},n)=>o.jsx(E.ScrollUpButton,{ref:n,className:u("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",t),...r,children:o.jsx(L.ChevronUp,{className:"bn-h-4 bn-w-4"})}));Le.displayName=E.ScrollUpButton.displayName;const Be=p.forwardRef(({className:t,...r},n)=>o.jsx(E.ScrollDownButton,{ref:n,className:u("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",t),...r,children:o.jsx(L.ChevronDown,{className:"bn-h-4 bn-w-4"})}));Be.displayName=E.ScrollDownButton.displayName;const Ve=p.forwardRef(({className:t,children:r,position:n="popper",...a},i)=>o.jsxs(E.Content,{ref:i,className:u("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",n==="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",t),position:n,...a,children:[o.jsx(Le,{}),o.jsx(E.Viewport,{className:u("bn-p-1",n==="popper"&&"bn-h-[var(--radix-select-trigger-height)] bn-w-full bn-min-w-[var(--radix-select-trigger-width)]"),children:r}),o.jsx(Be,{})]}));Ve.displayName=E.Content.displayName;const rt=p.forwardRef(({className:t,...r},n)=>o.jsx(E.Label,{ref:n,className:u("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",t),...r}));rt.displayName=E.Label.displayName;const Ae=p.forwardRef(({className:t,children:r,...n},a)=>o.jsxs(E.Item,{ref:a,className:u("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",t),...n,children:[o.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:o.jsx(E.ItemIndicator,{children:o.jsx(L.Check,{className:"bn-h-4 bn-w-4"})})}),o.jsx(E.ItemText,{children:r})]}));Ae.displayName=E.Item.displayName;const ot=p.forwardRef(({className:t,...r},n)=>o.jsx(E.Separator,{ref:n,className:u("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",t),...r}));ot.displayName=E.Separator.displayName;const at=V.Root,$e=p.forwardRef(({className:t,...r},n)=>o.jsx(V.List,{ref:n,className:u("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",t),...r}));$e.displayName=V.List.displayName;const ze=p.forwardRef(({className:t,...r},n)=>o.jsx(V.Trigger,{ref:n,className:u("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",t),...r}));ze.displayName=V.Trigger.displayName;const We=p.forwardRef(({className:t,...r},n)=>o.jsx(V.Content,{ref:n,className:u("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",t),...r}));We.displayName=V.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:t,variant:r,size:n,...a},i)=>o.jsx(ye.Root,{ref:i,className:u(st({variant:r,size:n,className:t})),...a}));qe.displayName=ye.Root.displayName;const it=U.Provider,lt=U.Root,dt=U.Trigger,Ye=p.forwardRef(({className:t,sideOffset:r=4,...n},a)=>o.jsx(U.Content,{ref:a,sideOffset:r,className:u("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",t),...n}));Ye.displayName=U.Content.displayName;const ct={Badge:{Badge:On},Button:{Button:Ne},Card:{Card:je,CardContent:Te},DropdownMenu:{DropdownMenu:$n,DropdownMenuCheckboxItem:Pe,DropdownMenuContent:Ee,DropdownMenuItem:_e,DropdownMenuLabel:De,DropdownMenuSeparator:Ie,DropdownMenuSub:Wn,DropdownMenuSubContent:Re,DropdownMenuSubTrigger:Se,DropdownMenuTrigger:zn},Form:{Form:Un},Input:{Input:ke},Label:{Label:le},Popover:{Popover:Qn,PopoverContent:Oe,PopoverTrigger:et},Select:{Select:nt,SelectContent:Ve,SelectItem:Ae,SelectTrigger:Fe,SelectValue:tt},Tabs:{Tabs:at,TabsContent:We,TabsList:$e,TabsTrigger:ze},Toggle:{Toggle:qe},Tooltip:{Tooltip:lt,TooltipContent:Ye,TooltipProvider:it,TooltipTrigger:dt}},Ue=x.createContext(void 0);function S(){return x.useContext(Ue)}const ut=t=>{const{children:r,...n}=t;C.assertEmpty(n);const a=S(),i=se.useForm();return o.jsx(a.Form.Form,{...i,children:r})},bt=t=>x.forwardRef((r,n)=>o.jsx(t,{onPointerDown:a=>{a.nativeEvent.fakeEvent||(a.ctrlKey=!0)},onPointerUp:a=>{const i=new PointerEvent("pointerdown",a.nativeEvent);i.fakeEvent=!0,a.target.dispatchEvent(i)},...r,ref:n})),ft=t=>{const{children:r,onOpenChange:n,position:a,sub:i,...d}=t;C.assertEmpty(d);const c=S();return i?o.jsx(c.DropdownMenu.DropdownMenuSub,{onOpenChange:n,children:r}):o.jsx(c.DropdownMenu.DropdownMenu,{onOpenChange:n,children:r})},pt=t=>{const{children:r,sub:n,...a}=t;C.assertEmpty(a);const i=S(),d=x.useMemo(()=>bt(i.DropdownMenu.DropdownMenuTrigger),[i.DropdownMenu.DropdownMenuTrigger]);return n?o.jsx(i.DropdownMenu.DropdownMenuSubTrigger,{children:r}):o.jsx(d,{asChild:!0,...a,children:r})},mt=x.forwardRef((t,r)=>{const{className:n,children:a,sub:i,...d}=t;C.assertEmpty(d);const c=S();return i?o.jsx(c.DropdownMenu.DropdownMenuSubContent,{className:n,ref:r,children:a}):o.jsx(c.DropdownMenu.DropdownMenuContent,{className:n,ref:r,children:a})}),gt=x.forwardRef((t,r)=>{const{className:n,children:a,icon:i,checked:d,subTrigger:c,onClick:h,...m}=t;C.assertEmpty(m);const b=S();return c?o.jsxs(o.Fragment,{children:[i,a]}):d!==void 0?o.jsxs(b.DropdownMenu.DropdownMenuCheckboxItem,{className:u(n,"bn-gap-1"),ref:r,checked:d,onClick:h,...m,children:[i,a]}):o.jsxs(b.DropdownMenu.DropdownMenuItem,{className:n,ref:r,onClick:h,...m,children:[i,a,c&&o.jsx(L.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),vt=x.forwardRef((t,r)=>{const{className:n,...a}=t;C.assertEmpty(a);const i=S();return o.jsx(i.DropdownMenu.DropdownMenuSeparator,{className:n,ref:r})}),xt=x.forwardRef((t,r)=>{const{className:n,children:a,...i}=t;C.assertEmpty(i);const d=S();return o.jsx(d.DropdownMenu.DropdownMenuLabel,{className:n,ref:r,children:a})}),ht=x.forwardRef((t,r)=>{const{className:n,tabs:a,defaultOpenTab:i,openTab:d,setOpenTab:c,loading:h,...m}=t;C.assertEmpty(m);const b=S();return o.jsxs(b.Tabs.Tabs,{className:u(n,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:r,value:d,defaultValue:i,onValueChange:c,children:[o.jsx(b.Tabs.TabsList,{children:a.map(g=>o.jsx(b.Tabs.TabsTrigger,{value:g.name,children:g.name},g.name))}),a.map(g=>o.jsx(b.Tabs.TabsContent,{value:g.name,children:o.jsx(b.Card.Card,{children:o.jsx(b.Card.CardContent,{className:"bn-p-4",children:g.tabPanel})})},g.name))]})}),yt=x.forwardRef((t,r)=>{const{className:n,children:a,onClick:i,label:d,...c}=t;C.assertEmpty(c);const h=S();return o.jsx(h.Button.Button,{type:"submit",className:n,"aria-label":d,ref:r,onClick:i,children:a})}),wt=x.forwardRef((t,r)=>{const{className:n,accept:a,value:i,placeholder:d,onChange:c,...h}=t;C.assertEmpty(h);const m=S();return o.jsx(m.Input.Input,{type:"file",className:n,ref:r,accept:a,value:i?i.name:void 0,onChange:async b=>c==null?void 0:c(b.target.files[0]),placeholder:d})}),Ct=x.forwardRef((t,r)=>{const{className:n,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:u(n,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:r,children:a})}),Nt=x.forwardRef((t,r)=>{const{className:n,value:a,placeholder:i,onKeyDown:d,onChange:c,...h}=t;C.assertEmpty(h);const m=S();return o.jsx(m.Input.Input,{"data-test":"embed-input",className:u(n,"bn-w-80"),ref:r,value:a,placeholder:i,onKeyDown:d,onChange:c})}),jt=t=>{const{children:r,opened:n,position:a,...i}=t;C.assertEmpty(i);const d=S();return o.jsx(d.Popover.Popover,{open:n,children:r})},Tt=x.forwardRef((t,r)=>{const{children:n,...a}=t;C.assertEmpty(a);const i=S();return o.jsx(i.Popover.PopoverTrigger,{ref:r,asChild:!0,children:n})}),St=x.forwardRef((t,r)=>{const{className:n,variant:a,children:i,...d}=t;C.assertEmpty(d);const c=S();return o.jsx(c.Popover.PopoverContent,{sideOffset:8,className:u(n,"bn-flex bn-flex-col bn-gap-2",a==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:r,children:i})}),Rt=x.forwardRef((t,r)=>{const{className:n,children:a,...i}=t;return C.assertEmpty(i,!1),o.jsx("div",{className:n,ref:r,...i,children:a})}),Et=x.forwardRef((t,r)=>{const{className:n,children:a,icon:i,onClick:d,onDragEnd:c,onDragStart:h,draggable:m,label:b,...g}=t;C.assertEmpty(g,!1);const _=S();return o.jsxs(_.Button.Button,{variant:"ghost",className:u(n,"bn-text-gray-400"),ref:r,"aria-label":b,onClick:d,onDragStart:h,onDragEnd:c,draggable:m,...g,children:[i,a]})}),_t=x.forwardRef((t,r)=>{const{className:n,children:a,id:i,...d}=t;return C.assertEmpty(d),o.jsx("div",{id:i,role:"listbox",className:u("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",n),ref:r,children:a})}),Pt=x.forwardRef((t,r)=>{const{className:n,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:u("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",n),ref:r,children:o.jsx("div",{children:a})})}),Dt=x.forwardRef((t,r)=>{const n=S(),{className:a,item:i,isSelected:d,onClick:c,id:h,...m}=t;C.assertEmpty(m);const b=x.useRef(null);return x.useEffect(()=>{if(!b.current||!d)return;const g=Z.elementOverflow(b.current);g==="top"?b.current.scrollIntoView(!0):g==="bottom"&&b.current.scrollIntoView(!1)},[d]),o.jsxs("div",{className:u("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",a),ref:Z.mergeRefs([r,b]),id:h,onClick:c,role:"option","aria-selected":d||void 0,children:[i.icon&&o.jsx("div",{className:"bn-p-3","data-position":"left",children:i.icon}),o.jsxs("div",{className:"bn-flex-1",children:[o.jsx("div",{className:"bn-text-base",children:i.title}),o.jsx("div",{className:"bn-text-xs",children:i.subtext})]}),i.badge&&o.jsx("div",{"data-position":"right",className:"bn-text-xs",children:o.jsx(n.Badge.Badge,{variant:"secondary",children:i.badge})})]})}),It=x.forwardRef((t,r)=>{const{className:n,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:u("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",n),ref:r,children:a})}),Mt=x.forwardRef((t,r)=>{const{className:n,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:n,ref:r,children:a})}),kt=x.forwardRef((t,r)=>{const{className:n,children:a,draggable:i,onDragStart:d,onDragEnd:c,style:h,label:m,...b}=t;C.assertEmpty(b,!1);const g=S();return o.jsx(g.Button.Button,{variant:"ghost",className:u(n,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:r,"aria-label":m,draggable:i,onDragStart:d,onDragEnd:c,style:h,...b,children:a})}),Ot=x.forwardRef(t=>{const{className:r,name:n,label:a,icon:i,value:d,autoFocus:c,placeholder:h,onKeyDown:m,onChange:b,onSubmit:g,..._}=t;C.assertEmpty(_);const D=S();return a?o.jsxs("div",{children:[o.jsx(D.Label.Label,{htmlFor:a,children:a}),o.jsx(D.Input.Input,{className:r,id:a,name:n,autoFocus:c,placeholder:h,value:d,onKeyDown:m,onChange:b,onSubmit:g})]}):o.jsx(D.Input.Input,{"aria-label":n,name:n,autoFocus:c,placeholder:h,value:d,onKeyDown:m,onChange:b,onSubmit:g})}),Ke=x.forwardRef((t,r)=>{const{className:n,children:a,onMouseEnter:i,onMouseLeave:d,...c}=t;C.assertEmpty(c);const h=S();return o.jsx(h.Tooltip.TooltipProvider,{delayDuration:0,children:o.jsx("div",{className:u(n,"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:i,onMouseLeave:d,children:a})})}),Je=x.forwardRef((t,r)=>{const{className:n,children:a,mainTooltip:i,secondaryTooltip:d,icon:c,isSelected:h,isDisabled:m,onClick:b,label:g,..._}=t;C.assertEmpty(_,!1);const D=S(),z=h===void 0?o.jsxs(D.Button.Button,{className:n,variant:"ghost",disabled:m,onClick:b,ref:r,"aria-label":g,..._,children:[c,a]}):o.jsxs(D.Toggle.Toggle,{className:u(n,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground"),"aria-label":g,onClick:b,pressed:h,disabled:m,"data-state":h?"on":"off","data-disabled":m,ref:r,..._,children:[c,a]});return o.jsxs(D.Tooltip.Tooltip,{children:[o.jsx(D.Tooltip.TooltipTrigger,{asChild:!0,children:z}),o.jsxs(D.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center",children:[o.jsx("span",{children:i}),d&&o.jsx("span",{children:d})]})]})}),Ft=x.forwardRef((t,r)=>{const{className:n,items:a,isDisabled:i,...d}=t;C.assertEmpty(d);const c=S(),h=b=>o.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[b.icon,b.text]}),m=a.filter(b=>b.isSelected)[0];return m?o.jsxs(c.Select.Select,{value:m.text,onValueChange:b=>{var g,_;return(_=(g=a.find(D=>D.text===b)).onClick)==null?void 0:_.call(g)},disabled:i,children:[o.jsx(c.Select.SelectTrigger,{className:"bn-border-none",children:o.jsx(c.Select.SelectValue,{})}),o.jsx(c.Select.SelectContent,{className:n,ref:r,children:a.map(b=>o.jsx(c.Select.SelectItem,{disabled:b.isDisabled,value:b.text,children:o.jsx(h,{...b})},b.text))})]}):null}),wr="",Ge={FormattingToolbar:{Root:Ke,Button:Je,Select:Ft},FilePanel:{Root:ht,Button:yt,FileInput:wt,TabPanel:Ct,TextInput:Nt},LinkToolbar:{Root:Ke,Button:Je},SideMenu:{Root:Rt,Button:Et},SuggestionMenu:{Root:_t,Item:Dt,EmptyItem:Pt,Label:It,Loader:Mt},TableHandle:{Root:kt},Generic:{Form:{Root:ut,TextInput:Ot},Menu:{Root:ft,Trigger:pt,Dropdown:mt,Divider:vt,Label:xt,Item:gt},Popover:{Root:jt,Trigger:Tt,Content:St}}},Lt=t=>{const{className:r,shadCNComponents:n,...a}=t,i=x.useMemo(()=>({...ct,...n}),[n]);return o.jsx(Ue.Provider,{value:i,children:o.jsx(Z.ComponentsContext.Provider,{value:Ge,children:o.jsx(Z.BlockNoteViewRaw,{className:C.mergeCSSClasses("bn-shadcn",r||""),...a})})})};j.BlockNoteView=Lt,j.components=Ge,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
|
32
|
+
<%s key={someKey} {...props} />`,ve,z,hr,z),yn[z+ve]=!0}}return e===a?pr(P):fr(P),P}}function mr(e,i,l){return wn(e,i,l,!0)}function gr(e,i,l){return wn(e,i,l,!1)}var vr=gr,xr=mr;J.Fragment=a,J.jsx=vr,J.jsxs=xr}()),J}process.env.NODE_ENV==="production"?ie.exports=Dn():ie.exports=In();var o=ie.exports;const Mn=Nn.extendTailwindMerge({prefix:"bn-"});function u(...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 o.jsx("div",{className:u(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"}}),Ne=p.forwardRef(({className:n,variant:r,size:t,asChild:a=!1,...s},d)=>{const c=a?xe.Slot:"button";return o.jsx(c,{className:u(Fn({variant:r,size:t,className:n})),ref:d,...s})});Ne.displayName="Button";const je=p.forwardRef(({className:n,...r},t)=>o.jsx("div",{ref:t,className:u("bn-rounded-lg bn-border bn-bg-card bn-text-card-foreground bn-shadow-sm",n),...r}));je.displayName="Card";const Ln=p.forwardRef(({className:n,...r},t)=>o.jsx("div",{ref:t,className:u("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)=>o.jsx("h3",{ref:t,className:u("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)=>o.jsx("p",{ref:t,className:u("bn-text-sm bn-text-muted-foreground",n),...r}));Vn.displayName="CardDescription";const Te=p.forwardRef(({className:n,...r},t)=>o.jsx("div",{ref:t,className:u("bn-p-6 bn-pt-0",n),...r}));Te.displayName="CardContent";const An=p.forwardRef(({className:n,...r},t)=>o.jsx("div",{ref:t,className:u("bn-flex bn-items-center bn-p-6 bn-pt-0",n),...r}));An.displayName="CardFooter";const $n=T.Root,zn=T.Trigger,Wn=T.Sub,Se=p.forwardRef(({className:n,inset:r,children:t,...a},s)=>o.jsxs(T.SubTrigger,{ref:s,className:u("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),...a,children:[t,o.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]}));Se.displayName=T.SubTrigger.displayName;const Re=p.forwardRef(({className:n,...r},t)=>o.jsx(T.SubContent,{ref:t,className:u("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=T.SubContent.displayName;const Ee=p.forwardRef(({className:n,sideOffset:r=4,...t},a)=>o.jsx(T.Content,{ref:a,sideOffset:r,className:u("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=T.Content.displayName;const _e=p.forwardRef(({className:n,inset:r,...t},a)=>o.jsx(T.Item,{ref:a,className:u("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=T.Item.displayName;const Pe=p.forwardRef(({className:n,children:r,checked:t,...a},s)=>o.jsxs(T.CheckboxItem,{ref:s,className:u("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,...a,children:[o.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:o.jsx(T.ItemIndicator,{children:o.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),r]}));Pe.displayName=T.CheckboxItem.displayName;const qn=p.forwardRef(({className:n,children:r,...t},a)=>o.jsxs(T.RadioItem,{ref:a,className:u("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:[o.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:o.jsx(T.ItemIndicator,{children:o.jsx(B.Circle,{className:"bn-h-2 bn-w-2 bn-fill-current"})})}),r]}));qn.displayName=T.RadioItem.displayName;const De=p.forwardRef(({className:n,inset:r,...t},a)=>o.jsx(T.Label,{ref:a,className:u("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",r&&"bn-pl-8",n),...t}));De.displayName=T.Label.displayName;const Ie=p.forwardRef(({className:n,...r},t)=>o.jsx(T.Separator,{ref:t,className:u("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));Ie.displayName=T.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)=>o.jsx(he.Root,{ref:t,className:u(Yn(),n),...r}));le.displayName=he.Root.displayName;const Un=se.FormProvider,Kn=p.createContext({}),ne=()=>{const n=p.useContext(Kn),r=p.useContext(Me),{getFieldState:t,formState:a}=se.useFormContext(),s=t(n.name,a);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({}),Jn=p.forwardRef(({className:n,...r},t)=>{const a=p.useId();return o.jsx(Me.Provider,{value:{id:a},children:o.jsx("div",{ref:t,className:u("bn-space-y-2",n),...r})})});Jn.displayName="FormItem";const Gn=p.forwardRef(({className:n,...r},t)=>{const{error:a,formItemId:s}=ne();return o.jsx(le,{ref:t,className:u(a&&"bn-text-destructive",n),htmlFor:s,...r})});Gn.displayName="FormLabel";const Hn=p.forwardRef(({...n},r)=>{const{error:t,formItemId:a,formDescriptionId:s,formMessageId:d}=ne();return o.jsx(xe.Slot,{ref:r,id:a,"aria-describedby":t?`${s} ${d}`:`${s}`,"aria-invalid":!!t,...n})});Hn.displayName="FormControl";const Xn=p.forwardRef(({className:n,...r},t)=>{const{formDescriptionId:a}=ne();return o.jsx("p",{ref:t,id:a,className:u("bn-text-sm bn-text-muted-foreground",n),...r})});Xn.displayName="FormDescription";const Zn=p.forwardRef(({className:n,children:r,...t},a)=>{const{error:s,formMessageId:d}=ne(),c=s?String(s==null?void 0:s.message):r;return c?o.jsx("p",{ref:a,id:d,className:u("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},a)=>o.jsx("input",{type:r,className:u("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:a,...t}));ke.displayName="Input";const Qn=ee.Root,et=ee.Trigger,Oe=p.forwardRef(({className:n,align:r="center",sideOffset:t=4,...a},s)=>o.jsx(ee.Content,{ref:s,align:r,sideOffset:t,className:u("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),...a}));Oe.displayName=ee.Content.displayName;const nt=_.Root,tt=_.Value,Fe=p.forwardRef(({className:n,children:r,...t},a)=>o.jsxs(_.Trigger,{ref:a,className:u("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,o.jsx(_.Icon,{asChild:!0,children:o.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)=>o.jsx(_.ScrollUpButton,{ref:t,className:u("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:o.jsx(B.ChevronUp,{className:"bn-h-4 bn-w-4"})}));Le.displayName=_.ScrollUpButton.displayName;const Be=p.forwardRef(({className:n,...r},t)=>o.jsx(_.ScrollDownButton,{ref:t,className:u("bn-flex bn-cursor-default bn-items-center bn-justify-center bn-py-1",n),...r,children:o.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",...a},s)=>o.jsxs(_.Content,{ref:s,className:u("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,...a,children:[o.jsx(Le,{}),o.jsx(_.Viewport,{className:u("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}),o.jsx(Be,{})]}));Ve.displayName=_.Content.displayName;const rt=p.forwardRef(({className:n,...r},t)=>o.jsx(_.Label,{ref:t,className:u("bn-py-1.5 bn-pl-8 bn-pr-2 bn-text-sm bn-font-semibold",n),...r}));rt.displayName=_.Label.displayName;const Ae=p.forwardRef(({className:n,children:r,...t},a)=>o.jsxs(_.Item,{ref:a,className:u("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:[o.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:o.jsx(_.ItemIndicator,{children:o.jsx(B.Check,{className:"bn-h-4 bn-w-4"})})}),o.jsx(_.ItemText,{children:r})]}));Ae.displayName=_.Item.displayName;const ot=p.forwardRef(({className:n,...r},t)=>o.jsx(_.Separator,{ref:t,className:u("bn--mx-1 bn-my-1 bn-h-px bn-bg-muted",n),...r}));ot.displayName=_.Separator.displayName;const at=A.Root,$e=p.forwardRef(({className:n,...r},t)=>o.jsx(A.List,{ref:t,className:u("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}));$e.displayName=A.List.displayName;const ze=p.forwardRef(({className:n,...r},t)=>o.jsx(A.Trigger,{ref:t,className:u("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=A.Trigger.displayName;const We=p.forwardRef(({className:n,...r},t)=>o.jsx(A.Content,{ref:t,className:u("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=A.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,...a},s)=>o.jsx(ye.Root,{ref:s,className:u(st({variant:r,size:t,className:n})),...a}));qe.displayName=ye.Root.displayName;const it=U.Provider,lt=U.Root,dt=U.Trigger,Ye=p.forwardRef(({className:n,sideOffset:r=4,...t},a)=>o.jsx(U.Content,{ref:a,sideOffset:r,className:u("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=U.Content.displayName;const ct={Badge:{Badge:On},Button:{Button:Ne},Card:{Card:je,CardContent:Te},DropdownMenu:{DropdownMenu:$n,DropdownMenuCheckboxItem:Pe,DropdownMenuContent:Ee,DropdownMenuItem:_e,DropdownMenuLabel:De,DropdownMenuSeparator:Ie,DropdownMenuSub:Wn,DropdownMenuSubContent:Re,DropdownMenuSubTrigger:Se,DropdownMenuTrigger:zn},Form:{Form:Un},Input:{Input:ke},Label:{Label:le},Popover:{Popover:Qn,PopoverContent:Oe,PopoverTrigger:et},Select:{Select:nt,SelectContent:Ve,SelectItem:Ae,SelectTrigger:Fe,SelectValue:tt},Tabs:{Tabs:at,TabsContent:We,TabsList:$e,TabsTrigger:ze},Toggle:{Toggle:qe},Tooltip:{Tooltip:lt,TooltipContent:Ye,TooltipProvider:it,TooltipTrigger:dt}},Ue=x.createContext(void 0);function S(){return x.useContext(Ue)}const ut=n=>{const{children:r,...t}=n;C.assertEmpty(t);const a=S(),s=se.useForm();return o.jsx(a.Form.Form,{...s,children:r})},bt=n=>x.forwardRef((r,t)=>o.jsx(n,{onPointerDown:a=>{a.nativeEvent.fakeEvent||(a.ctrlKey=!0)},onPointerUp:a=>{const s=new PointerEvent("pointerdown",a.nativeEvent);s.fakeEvent=!0,a.target.dispatchEvent(s)},...r,ref:t})),ft=n=>{const{children:r,onOpenChange:t,position:a,sub:s,...d}=n;C.assertEmpty(d);const c=S();return s?o.jsx(c.DropdownMenu.DropdownMenuSub,{onOpenChange:t,children:r}):o.jsx(c.DropdownMenu.DropdownMenu,{onOpenChange:t,children:r})},pt=n=>{const{children:r,sub:t,...a}=n;C.assertEmpty(a);const s=S(),d=x.useMemo(()=>bt(s.DropdownMenu.DropdownMenuTrigger),[s.DropdownMenu.DropdownMenuTrigger]);return t?o.jsx(s.DropdownMenu.DropdownMenuSubTrigger,{children:r}):o.jsx(d,{asChild:!0,...a,children:r})},mt=x.forwardRef((n,r)=>{const{className:t,children:a,sub:s,...d}=n;C.assertEmpty(d);const c=S();return s?o.jsx(c.DropdownMenu.DropdownMenuSubContent,{className:t,ref:r,children:a}):o.jsx(c.DropdownMenu.DropdownMenuContent,{className:t,ref:r,children:a})}),gt=x.forwardRef((n,r)=>{const{className:t,children:a,icon:s,checked:d,subTrigger:c,onClick:h,...m}=n;C.assertEmpty(m);const b=S();return c?o.jsxs(o.Fragment,{children:[s,a]}):d!==void 0?o.jsxs(b.DropdownMenu.DropdownMenuCheckboxItem,{className:u(t,"bn-gap-1"),ref:r,checked:d,onClick:h,...m,children:[s,a]}):o.jsxs(b.DropdownMenu.DropdownMenuItem,{className:t,ref:r,onClick:h,...m,children:[s,a,c&&o.jsx(B.ChevronRight,{className:"bn-ml-auto bn-h-4 bn-w-4"})]})}),vt=x.forwardRef((n,r)=>{const{className:t,...a}=n;C.assertEmpty(a);const s=S();return o.jsx(s.DropdownMenu.DropdownMenuSeparator,{className:t,ref:r})}),xt=x.forwardRef((n,r)=>{const{className:t,children:a,...s}=n;C.assertEmpty(s);const d=S();return o.jsx(d.DropdownMenu.DropdownMenuLabel,{className:t,ref:r,children:a})}),ht=x.forwardRef((n,r)=>{const{className:t,tabs:a,defaultOpenTab:s,openTab:d,setOpenTab:c,loading:h,...m}=n;C.assertEmpty(m);const b=S();return o.jsxs(b.Tabs.Tabs,{className:u(t,"bn-bg-popover bn-p-2 bn-rounded-lg"),ref:r,value:d,defaultValue:s,onValueChange:c,children:[o.jsx(b.Tabs.TabsList,{children:a.map(g=>o.jsx(b.Tabs.TabsTrigger,{value:g.name,children:g.name},g.name))}),a.map(g=>o.jsx(b.Tabs.TabsContent,{value:g.name,children:o.jsx(b.Card.Card,{children:o.jsx(b.Card.CardContent,{className:"bn-p-4",children:g.tabPanel})})},g.name))]})}),yt=x.forwardRef((n,r)=>{const{className:t,children:a,onClick:s,label:d,...c}=n;C.assertEmpty(c);const h=S();return o.jsx(h.Button.Button,{type:"submit",className:t,"aria-label":d,ref:r,onClick:s,children:a})}),wt=x.forwardRef((n,r)=>{const{className:t,accept:a,value:s,placeholder:d,onChange:c,...h}=n;C.assertEmpty(h);const m=S();return o.jsx(m.Input.Input,{type:"file",className:t,ref:r,accept:a,value:s?s.name:void 0,onChange:async b=>c==null?void 0:c(b.target.files[0]),placeholder:d})}),Ct=x.forwardRef((n,r)=>{const{className:t,children:a,...s}=n;return C.assertEmpty(s),o.jsx("div",{className:u(t,"bn-flex bn-flex-col bn-gap-2 bn-items-start bn-justify-center"),ref:r,children:a})}),Nt=x.forwardRef((n,r)=>{const{className:t,value:a,placeholder:s,onKeyDown:d,onChange:c,...h}=n;C.assertEmpty(h);const m=S();return o.jsx(m.Input.Input,{"data-test":"embed-input",className:u(t,"bn-w-80"),ref:r,value:a,placeholder:s,onKeyDown:d,onChange:c})}),jt=n=>{const{children:r,opened:t,position:a,...s}=n;C.assertEmpty(s);const d=S();return o.jsx(d.Popover.Popover,{open:t,children:r})},Tt=x.forwardRef((n,r)=>{const{children:t,...a}=n;C.assertEmpty(a);const s=S();return o.jsx(s.Popover.PopoverTrigger,{ref:r,asChild:!0,children:t})}),St=x.forwardRef((n,r)=>{const{className:t,variant:a,children:s,...d}=n;C.assertEmpty(d);const c=S();return o.jsx(c.Popover.PopoverContent,{sideOffset:8,className:u(t,"bn-flex bn-flex-col bn-gap-2",a==="panel-popover"?"bn-p-0 bn-border-none bn-shadow-none bn-max-w-none bn-w-fit":""),ref:r,children:s})}),Rt=x.forwardRef((n,r)=>{const{className:t,children:a,...s}=n;return C.assertEmpty(s,!1),o.jsx("div",{className:t,ref:r,...s,children:a})}),Et=x.forwardRef((n,r)=>{const{className:t,children:a,icon:s,onClick:d,onDragEnd:c,onDragStart:h,draggable:m,label:b,...g}=n;C.assertEmpty(g,!1);const R=S();return o.jsxs(R.Button.Button,{variant:"ghost",className:u(t,"bn-text-gray-400"),ref:r,"aria-label":b,onClick:d,onDragStart:h,onDragEnd:c,draggable:m,...g,children:[s,a]})}),_t=x.forwardRef((n,r)=>{const{className:t,children:a,id:s,...d}=n;return C.assertEmpty(d),o.jsx("div",{id:s,role:"listbox",className:u("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:a})}),Pt=x.forwardRef((n,r)=>{const{className:t,children:a,...s}=n;return C.assertEmpty(s),o.jsx("div",{className:u("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:o.jsx("div",{children:a})})}),Dt=x.forwardRef((n,r)=>{const t=S(),{className:a,item:s,isSelected:d,onClick:c,id:h,...m}=n;C.assertEmpty(m);const b=x.useRef(null);return x.useEffect(()=>{if(!b.current||!d)return;const g=Z.elementOverflow(b.current);g==="top"?b.current.scrollIntoView(!0):g==="bottom"&&b.current.scrollIntoView(!1)},[d]),o.jsxs("div",{className:u("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",a),ref:Z.mergeRefs([r,b]),id:h,onClick:c,role:"option","aria-selected":d||void 0,children:[s.icon&&o.jsx("div",{className:"bn-p-3","data-position":"left",children:s.icon}),o.jsxs("div",{className:"bn-flex-1",children:[o.jsx("div",{className:"bn-text-base",children:s.title}),o.jsx("div",{className:"bn-text-xs",children:s.subtext})]}),s.badge&&o.jsx("div",{"data-position":"right",className:"bn-text-xs",children:o.jsx(t.Badge.Badge,{variant:"secondary",children:s.badge})})]})}),It=x.forwardRef((n,r)=>{const{className:t,children:a,...s}=n;return C.assertEmpty(s),o.jsx("div",{className:u("bn-px-2 bn-py-1.5 bn-text-sm bn-font-semibold",t),ref:r,children:a})}),Mt=x.forwardRef((n,r)=>{const{className:t,children:a,...s}=n;return C.assertEmpty(s),o.jsx("div",{className:t,ref:r,children:a})}),kt=x.forwardRef((n,r)=>{const{className:t,children:a,draggable:s,onDragStart:d,onDragEnd:c,style:h,label:m,...b}=n;C.assertEmpty(b,!1);const g=S();return o.jsx(g.Button.Button,{variant:"ghost",className:u(t,"bn-p-0 bn-h-fit bn-w-fit bn-text-gray-400"),ref:r,"aria-label":m,draggable:s,onDragStart:d,onDragEnd:c,style:h,...b,children:a})}),Ot=x.forwardRef((n,r)=>{const{className:t,name:a,label:s,icon:d,value:c,autoFocus:h,placeholder:m,onKeyDown:b,onChange:g,onSubmit:R,...D}=n;C.assertEmpty(D);const F=S();return s?o.jsxs("div",{children:[o.jsx(F.Label.Label,{htmlFor:s,children:s}),o.jsx(F.Input.Input,{className:t,id:s,name:a,autoFocus:h,placeholder:m,value:c,onKeyDown:b,onChange:g,onSubmit:R})]}):o.jsx(F.Input.Input,{"aria-label":a,name:a,autoFocus:h,placeholder:m,value:c,onKeyDown:b,onChange:g,onSubmit:R,ref:r})}),Ke=x.forwardRef((n,r)=>{const{className:t,children:a,onMouseEnter:s,onMouseLeave:d,...c}=n;C.assertEmpty(c);const h=S();return o.jsx(h.Tooltip.TooltipProvider,{delayDuration:0,children:o.jsx("div",{className:u(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:a})})}),Je=x.forwardRef((n,r)=>{const{className:t,children:a,mainTooltip:s,secondaryTooltip:d,icon:c,isSelected:h,isDisabled:m,onClick:b,label:g,...R}=n;C.assertEmpty(R,!1);const D=S(),F=h===void 0?o.jsxs(D.Button.Button,{className:t,variant:"ghost",disabled:m,onClick:b,ref:r,"aria-label":g,...R,children:[c,a]}):o.jsxs(D.Toggle.Toggle,{className:u(t,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground"),"aria-label":g,onClick:b,pressed:h,disabled:m,"data-state":h?"on":"off","data-disabled":m,ref:r,...R,children:[c,a]});return o.jsxs(D.Tooltip.Tooltip,{children:[o.jsx(D.Tooltip.TooltipTrigger,{asChild:!0,children:F}),o.jsxs(D.Tooltip.TooltipContent,{className:"bn-flex bn-flex-col bn-items-center",children:[o.jsx("span",{children:s}),d&&o.jsx("span",{children:d})]})]})}),Ft=x.forwardRef((n,r)=>{const{className:t,items:a,isDisabled:s,...d}=n;C.assertEmpty(d);const c=S(),h=b=>o.jsxs("div",{className:"bn-flex bn-gap-1 bn-items-center",children:[b.icon,b.text]}),m=a.filter(b=>b.isSelected)[0];return m?o.jsxs(c.Select.Select,{value:m.text,onValueChange:b=>{var g,R;return(R=(g=a.find(D=>D.text===b)).onClick)==null?void 0:R.call(g)},disabled:s,children:[o.jsx(c.Select.SelectTrigger,{className:"bn-border-none",children:o.jsx(c.Select.SelectValue,{})}),o.jsx(c.Select.SelectContent,{className:t,ref:r,children:a.map(b=>o.jsx(c.Select.SelectItem,{disabled:b.isDisabled,value:b.text,children:o.jsx(h,{...b})},b.text))})]}):null}),wr="",Ge={FormattingToolbar:{Root:Ke,Button:Je,Select:Ft},FilePanel:{Root:ht,Button:yt,FileInput:wt,TabPanel:Ct,TextInput:Nt},LinkToolbar:{Root:Ke,Button:Je},SideMenu:{Root:Rt,Button:Et},SuggestionMenu:{Root:_t,Item:Dt,EmptyItem:Pt,Label:It,Loader:Mt},TableHandle:{Root:kt},Generic:{Form:{Root:ut,TextInput:Ot},Menu:{Root:ft,Trigger:pt,Dropdown:mt,Divider:vt,Label:xt,Item:gt},Popover:{Root:jt,Trigger:Tt,Content:St}}},Lt=n=>{const{className:r,shadCNComponents:t,...a}=n,s=x.useMemo(()=>({...ct,...t}),[t]);return o.jsx(Ue.Provider,{value:s,children:o.jsx(Z.ComponentsContext.Provider,{value:Ge,children:o.jsx(Z.BlockNoteViewRaw,{className:C.mergeCSSClasses("bn-shadcn",r||""),...a})})})};j.BlockNoteView=Lt,j.components=Ge,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
|
33
33
|
//# sourceMappingURL=blocknote-shadcn.umd.cjs.map
|