@blocknote/shadcn 0.14.1 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-shadcn.js +921 -910
- package/dist/blocknote-shadcn.js.map +1 -1
- package/dist/blocknote-shadcn.umd.cjs +11 -11
- 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 +7 -7
- package/src/components/ui/badge.tsx +5 -5
- package/src/components/ui/button.tsx +12 -11
- package/src/components/ui/card.tsx +6 -6
- package/src/components/ui/dropdown-menu.tsx +20 -17
- package/src/components/ui/form.tsx +4 -4
- package/src/components/ui/input.tsx +3 -2
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/select.tsx +18 -15
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/toggle.tsx +6 -6
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/form/TextInput.tsx +51 -49
- package/src/index.tsx +12 -4
- package/src/lib/utils.ts +7 -1
- package/src/menu/Menu.tsx +2 -2
- package/src/panel/Panel.tsx +2 -2
- package/src/panel/PanelTab.tsx +1 -1
- package/src/panel/PanelTextInput.tsx +1 -1
- package/src/popover/popover.tsx +2 -2
- package/src/sideMenu/SideMenuButton.tsx +1 -1
- package/src/style.css +17 -16
- package/src/suggestionMenu/SuggestionMenu.tsx +1 -1
- package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +1 -1
- package/src/suggestionMenu/SuggestionMenuItem.tsx +6 -6
- package/src/suggestionMenu/SuggestionMenuLabel.tsx +1 -1
- package/src/tableHandle/TableHandle.tsx +1 -1
- package/src/tailwindStyles.css +420 -0
- package/src/toolbar/Toolbar.tsx +4 -4
- package/types/src/components/ui/form.d.ts +1 -1
- package/types/src/components/ui/input.d.ts +2 -1
- package/types/src/form/TextInput.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
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
|
|
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
|
|
18
|
-
`+ce+e}}var ue=!1,
|
|
19
|
-
`),M=
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
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
|
+
`),M=f.stack.split(`
|
|
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
|
|
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} />`,be,$,xn,$),ht[$+be]=!0}}return e===a?pn(P):fn(P),P}}function mn(e,s,l){return yt(e,s,l,!0)}function vn(e,s,l){return yt(e,s,l,!1)}var gn=vn,bn=mn;J.Fragment=a,J.jsx=gn,J.jsxs=bn}()),J}process.env.NODE_ENV==="production"?ie.exports=Pt():ie.exports=Dt();var o=ie.exports;function u(...t){return Ct.twMerge(wt.clsx(t))}const It=Q.cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Mt({className:t,variant:n,...r}){return o.jsx("div",{className:u(It({variant:n}),t),...r})}const kt=Q.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),je=m.forwardRef(({className:t,variant:n,size:r,asChild:a=!1,...i},d)=>{const c=a?xe.Slot:"button";return o.jsx(c,{className:u(kt({variant:n,size:r,className:t})),ref:d,...i})});je.displayName="Button";const Ne=m.forwardRef(({className:t,...n},r)=>o.jsx("div",{ref:r,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",t),...n}));Ne.displayName="Card";const Ot=m.forwardRef(({className:t,...n},r)=>o.jsx("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",t),...n}));Ot.displayName="CardHeader";const Ft=m.forwardRef(({className:t,...n},r)=>o.jsx("h3",{ref:r,className:u("text-2xl font-semibold leading-none tracking-tight",t),...n}));Ft.displayName="CardTitle";const Lt=m.forwardRef(({className:t,...n},r)=>o.jsx("p",{ref:r,className:u("text-sm text-muted-foreground",t),...n}));Lt.displayName="CardDescription";const Te=m.forwardRef(({className:t,...n},r)=>o.jsx("div",{ref:r,className:u("p-6 pt-0",t),...n}));Te.displayName="CardContent";const Bt=m.forwardRef(({className:t,...n},r)=>o.jsx("div",{ref:r,className:u("flex items-center p-6 pt-0",t),...n}));Bt.displayName="CardFooter";const Vt=T.Root,At=T.Trigger,$t=T.Sub,Se=m.forwardRef(({className:t,inset:n,children:r,...a},i)=>o.jsxs(T.SubTrigger,{ref:i,className:u("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",t),...a,children:[r,o.jsx(L.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Se.displayName=T.SubTrigger.displayName;const Re=m.forwardRef(({className:t,...n},r)=>o.jsx(T.SubContent,{ref:r,className:u("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Re.displayName=T.SubContent.displayName;const Ee=m.forwardRef(({className:t,sideOffset:n=4,...r},a)=>o.jsx(T.Content,{ref:a,sideOffset:n,className:u("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));Ee.displayName=T.Content.displayName;const _e=m.forwardRef(({className:t,inset:n,...r},a)=>o.jsx(T.Item,{ref:a,className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",t),...r}));_e.displayName=T.Item.displayName;const Pe=m.forwardRef(({className:t,children:n,checked:r,...a},i)=>o.jsxs(T.CheckboxItem,{ref:i,className:u("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...a,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(T.ItemIndicator,{children:o.jsx(L.Check,{className:"h-4 w-4"})})}),n]}));Pe.displayName=T.CheckboxItem.displayName;const zt=m.forwardRef(({className:t,children:n,...r},a)=>o.jsxs(T.RadioItem,{ref:a,className:u("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(T.ItemIndicator,{children:o.jsx(L.Circle,{className:"h-2 w-2 fill-current"})})}),n]}));zt.displayName=T.RadioItem.displayName;const De=m.forwardRef(({className:t,inset:n,...r},a)=>o.jsx(T.Label,{ref:a,className:u("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...r}));De.displayName=T.Label.displayName;const Ie=m.forwardRef(({className:t,...n},r)=>o.jsx(T.Separator,{ref:r,className:u("-mx-1 my-1 h-px bg-muted",t),...n}));Ie.displayName=T.Separator.displayName;const Wt=Q.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),le=m.forwardRef(({className:t,...n},r)=>o.jsx(he.Root,{ref:r,className:u(Wt(),t),...n}));le.displayName=he.Root.displayName;const qt=se.FormProvider,Yt=m.createContext({}),te=()=>{const t=m.useContext(Yt),n=m.useContext(Me),{getFieldState:r,formState:a}=se.useFormContext(),i=r(t.name,a);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:d}=n;return{id:d,name:t.name,formItemId:`${d}-form-item`,formDescriptionId:`${d}-form-item-description`,formMessageId:`${d}-form-item-message`,...i}},Me=m.createContext({}),Ut=m.forwardRef(({className:t,...n},r)=>{const a=m.useId();return o.jsx(Me.Provider,{value:{id:a},children:o.jsx("div",{ref:r,className:u("space-y-2",t),...n})})});Ut.displayName="FormItem";const Kt=m.forwardRef(({className:t,...n},r)=>{const{error:a,formItemId:i}=te();return o.jsx(le,{ref:r,className:u(a&&"text-destructive",t),htmlFor:i,...n})});Kt.displayName="FormLabel";const Jt=m.forwardRef(({...t},n)=>{const{error:r,formItemId:a,formDescriptionId:i,formMessageId:d}=te();return o.jsx(xe.Slot,{ref:n,id:a,"aria-describedby":r?`${i} ${d}`:`${i}`,"aria-invalid":!!r,...t})});Jt.displayName="FormControl";const Gt=m.forwardRef(({className:t,...n},r)=>{const{formDescriptionId:a}=te();return o.jsx("p",{ref:r,id:a,className:u("text-sm text-muted-foreground",t),...n})});Gt.displayName="FormDescription";const Ht=m.forwardRef(({className:t,children:n,...r},a)=>{const{error:i,formMessageId:d}=te(),c=i?String(i==null?void 0:i.message):n;return c?o.jsx("p",{ref:a,id:d,className:u("text-sm font-medium text-destructive",t),...r,children:c}):null});Ht.displayName="FormMessage";const ke=m.forwardRef(({className:t,type:n,...r},a)=>o.jsx("input",{type:n,className:u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...r}));ke.displayName="Input";const Xt=ee.Root,Zt=ee.Trigger,Oe=m.forwardRef(({className:t,align:n="center",sideOffset:r=4,...a},i)=>o.jsx(ee.Content,{ref:i,align:n,sideOffset:r,className:u("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));Oe.displayName=ee.Content.displayName;const Qt=E.Root,er=E.Value,Fe=m.forwardRef(({className:t,children:n,...r},a)=>o.jsxs(E.Trigger,{ref:a,className:u("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[n,o.jsx(E.Icon,{asChild:!0,children:o.jsx(L.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Fe.displayName=E.Trigger.displayName;const Le=m.forwardRef(({className:t,...n},r)=>o.jsx(E.ScrollUpButton,{ref:r,className:u("flex cursor-default items-center justify-center py-1",t),...n,children:o.jsx(L.ChevronUp,{className:"h-4 w-4"})}));Le.displayName=E.ScrollUpButton.displayName;const Be=m.forwardRef(({className:t,...n},r)=>o.jsx(E.ScrollDownButton,{ref:r,className:u("flex cursor-default items-center justify-center py-1",t),...n,children:o.jsx(L.ChevronDown,{className:"h-4 w-4"})}));Be.displayName=E.ScrollDownButton.displayName;const Ve=m.forwardRef(({className:t,children:n,position:r="popper",...a},i)=>o.jsxs(E.Content,{ref:i,className:u("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...a,children:[o.jsx(Le,{}),o.jsx(E.Viewport,{className:u("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),o.jsx(Be,{})]}));Ve.displayName=E.Content.displayName;const tr=m.forwardRef(({className:t,...n},r)=>o.jsx(E.Label,{ref:r,className:u("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...n}));tr.displayName=E.Label.displayName;const Ae=m.forwardRef(({className:t,children:n,...r},a)=>o.jsxs(E.Item,{ref:a,className:u("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(E.ItemIndicator,{children:o.jsx(L.Check,{className:"h-4 w-4"})})}),o.jsx(E.ItemText,{children:n})]}));Ae.displayName=E.Item.displayName;const rr=m.forwardRef(({className:t,...n},r)=>o.jsx(E.Separator,{ref:r,className:u("-mx-1 my-1 h-px bg-muted",t),...n}));rr.displayName=E.Separator.displayName;const nr=V.Root,$e=m.forwardRef(({className:t,...n},r)=>o.jsx(V.List,{ref:r,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...n}));$e.displayName=V.List.displayName;const ze=m.forwardRef(({className:t,...n},r)=>o.jsx(V.Trigger,{ref:r,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...n}));ze.displayName=V.Trigger.displayName;const We=m.forwardRef(({className:t,...n},r)=>o.jsx(V.Content,{ref:r,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...n}));We.displayName=V.Content.displayName;const or=Q.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),qe=m.forwardRef(({className:t,variant:n,size:r,...a},i)=>o.jsx(ye.Root,{ref:i,className:u(or({variant:n,size:r,className:t})),...a}));qe.displayName=ye.Root.displayName;const ar=U.Provider,sr=U.Root,ir=U.Trigger,Ye=m.forwardRef(({className:t,sideOffset:n=4,...r},a)=>o.jsx(U.Content,{ref:a,sideOffset:n,className:u("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));Ye.displayName=U.Content.displayName;const lr={Badge:{Badge:Mt},Button:{Button:je},Card:{Card:Ne,CardContent:Te},DropdownMenu:{DropdownMenu:Vt,DropdownMenuCheckboxItem:Pe,DropdownMenuContent:Ee,DropdownMenuItem:_e,DropdownMenuLabel:De,DropdownMenuSeparator:Ie,DropdownMenuSub:$t,DropdownMenuSubContent:Re,DropdownMenuSubTrigger:Se,DropdownMenuTrigger:At},Form:{Form:qt},Input:{Input:ke},Label:{Label:le},Popover:{Popover:Xt,PopoverContent:Oe,PopoverTrigger:Zt},Select:{Select:Qt,SelectContent:Ve,SelectItem:Ae,SelectTrigger:Fe,SelectValue:er},Tabs:{Tabs:nr,TabsContent:We,TabsList:$e,TabsTrigger:ze},Toggle:{Toggle:qe},Tooltip:{Tooltip:sr,TooltipContent:Ye,TooltipProvider:ar,TooltipTrigger:ir}},Ue=x.createContext(void 0);function S(){return x.useContext(Ue)}const dr=t=>{const{children:n,...r}=t;C.assertEmpty(r);const a=S(),i=se.useForm();return o.jsx(a.Form.Form,{...i,children:n})},cr=t=>x.forwardRef((n,r)=>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)},...n,ref:r})),ur=t=>{const{children:n,onOpenChange:r,position:a,sub:i,...d}=t;C.assertEmpty(d);const c=S();return i?o.jsx(c.DropdownMenu.DropdownMenuSub,{onOpenChange:r,children:n}):o.jsx(c.DropdownMenu.DropdownMenu,{onOpenChange:r,children:n})},fr=t=>{const{children:n,sub:r,...a}=t;C.assertEmpty(a);const i=S(),d=x.useMemo(()=>cr(i.DropdownMenu.DropdownMenuTrigger),[i.DropdownMenu.DropdownMenuTrigger]);return r?o.jsx(i.DropdownMenu.DropdownMenuSubTrigger,{children:n}):o.jsx(d,{asChild:!0,...a,children:n})},pr=x.forwardRef((t,n)=>{const{className:r,children:a,sub:i,...d}=t;C.assertEmpty(d);const c=S();return i?o.jsx(c.DropdownMenu.DropdownMenuSubContent,{className:r,ref:n,children:a}):o.jsx(c.DropdownMenu.DropdownMenuContent,{className:r,ref:n,children:a})}),mr=x.forwardRef((t,n)=>{const{className:r,children:a,icon:i,checked:d,subTrigger:c,onClick:h,...v}=t;C.assertEmpty(v);const f=S();return c?o.jsxs(o.Fragment,{children:[i,a]}):d!==void 0?o.jsxs(f.DropdownMenu.DropdownMenuCheckboxItem,{className:u(r,"gap-1"),ref:n,checked:d,onClick:h,...v,children:[i,a]}):o.jsxs(f.DropdownMenu.DropdownMenuItem,{className:r,ref:n,onClick:h,...v,children:[i,a,c&&o.jsx(L.ChevronRight,{className:"ml-auto h-4 w-4"})]})}),vr=x.forwardRef((t,n)=>{const{className:r,...a}=t;C.assertEmpty(a);const i=S();return o.jsx(i.DropdownMenu.DropdownMenuSeparator,{className:r,ref:n})}),gr=x.forwardRef((t,n)=>{const{className:r,children:a,...i}=t;C.assertEmpty(i);const d=S();return o.jsx(d.DropdownMenu.DropdownMenuLabel,{className:r,ref:n,children:a})}),br=x.forwardRef((t,n)=>{const{className:r,tabs:a,defaultOpenTab:i,openTab:d,setOpenTab:c,loading:h,...v}=t;C.assertEmpty(v);const f=S();return o.jsxs(f.Tabs.Tabs,{className:u(r,"bg-popover p-2 rounded-lg"),ref:n,value:d,defaultValue:i,onValueChange:c,children:[o.jsx(f.Tabs.TabsList,{children:a.map(g=>o.jsx(f.Tabs.TabsTrigger,{value:g.name,children:g.name},g.name))}),a.map(g=>o.jsx(f.Tabs.TabsContent,{value:g.name,children:o.jsx(f.Card.Card,{children:o.jsx(f.Card.CardContent,{className:"p-4",children:g.tabPanel})})},g.name))]})}),xr=x.forwardRef((t,n)=>{const{className:r,children:a,onClick:i,label:d,...c}=t;C.assertEmpty(c);const h=S();return o.jsx(h.Button.Button,{type:"submit",className:r,"aria-label":d,ref:n,onClick:i,children:a})}),hr=x.forwardRef((t,n)=>{const{className:r,accept:a,value:i,placeholder:d,onChange:c,...h}=t;C.assertEmpty(h);const v=S();return o.jsx(v.Input.Input,{type:"file",className:r,ref:n,accept:a,value:i?i.name:void 0,onChange:async f=>c==null?void 0:c(f.target.files[0]),placeholder:d})}),yr=x.forwardRef((t,n)=>{const{className:r,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:u(r,"flex flex-col gap-2 items-start justify-center"),ref:n,children:a})}),wr=x.forwardRef((t,n)=>{const{className:r,value:a,placeholder:i,onKeyDown:d,onChange:c,...h}=t;C.assertEmpty(h);const v=S();return o.jsx(v.Input.Input,{"data-test":"embed-input",className:u(r,"w-80"),ref:n,value:a,placeholder:i,onKeyDown:d,onChange:c})}),Cr=t=>{const{children:n,opened:r,position:a,...i}=t;C.assertEmpty(i);const d=S();return o.jsx(d.Popover.Popover,{open:r,children:n})},jr=x.forwardRef((t,n)=>{const{children:r,...a}=t;C.assertEmpty(a);const i=S();return o.jsx(i.Popover.PopoverTrigger,{ref:n,asChild:!0,children:r})}),Nr=x.forwardRef((t,n)=>{const{className:r,variant:a,children:i,...d}=t;C.assertEmpty(d);const c=S();return o.jsx(c.Popover.PopoverContent,{sideOffset:8,className:u(r,"flex flex-col gap-2",a==="panel-popover"?"p-0 border-none shadow-none max-w-none w-fit":""),ref:n,children:i})}),Tr=x.forwardRef((t,n)=>{const{className:r,children:a,...i}=t;return C.assertEmpty(i,!1),o.jsx("div",{className:r,ref:n,...i,children:a})}),Sr=x.forwardRef((t,n)=>{const{className:r,children:a,icon:i,onClick:d,onDragEnd:c,onDragStart:h,draggable:v,label:f,...g}=t;C.assertEmpty(g,!1);const _=S();return o.jsxs(_.Button.Button,{variant:"ghost",className:u(r,"text-gray-400"),ref:n,"aria-label":f,onClick:d,onDragStart:h,onDragEnd:c,draggable:v,...g,children:[i,a]})}),Rr=x.forwardRef((t,n)=>{const{className:r,children:a,id:i,...d}=t;return C.assertEmpty(d),o.jsx("div",{id:i,role:"listbox",className:u("z-50 min-w-[8rem] overflow-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),ref:n,children:a})}),Er=x.forwardRef((t,n)=>{const{className:r,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),ref:n,children:o.jsx("div",{children:a})})}),_r=x.forwardRef((t,n)=>{const r=S(),{className:a,item:i,isSelected:d,onClick:c,id:h,...v}=t;C.assertEmpty(v);const f=x.useRef(null);return x.useEffect(()=>{if(!f.current||!d)return;const g=Z.elementOverflow(f.current);g==="top"?f.current.scrollIntoView(!0):g==="bottom"&&f.current.scrollIntoView(!1)},[d]),o.jsxs("div",{className:u("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),ref:Z.mergeRefs([n,f]),id:h,onClick:c,role:"option","aria-selected":d||void 0,children:[i.icon&&o.jsx("div",{className:"p-3","data-position":"left",children:i.icon}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"text-base",children:i.title}),o.jsx("div",{className:"text-xs",children:i.subtext})]}),i.badge&&o.jsx("div",{"data-position":"right",className:"text-xs",children:o.jsx(r.Badge.Badge,{variant:"secondary",children:i.badge})})]})}),Pr=x.forwardRef((t,n)=>{const{className:r,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:u("px-2 py-1.5 text-sm font-semibold",r),ref:n,children:a})}),Dr=x.forwardRef((t,n)=>{const{className:r,children:a,...i}=t;return C.assertEmpty(i),o.jsx("div",{className:r,ref:n,children:a})}),Ir=x.forwardRef((t,n)=>{const{className:r,children:a,draggable:i,onDragStart:d,onDragEnd:c,style:h,label:v,...f}=t;C.assertEmpty(f,!1);const g=S();return o.jsx(g.Button.Button,{variant:"ghost",className:u(r,"p-0 h-fit w-fit text-gray-400"),ref:n,"aria-label":v,draggable:i,onDragStart:d,onDragEnd:c,style:h,...f,children:a})}),Mr=x.forwardRef(t=>{const{className:n,name:r,label:a,icon:i,value:d,autoFocus:c,placeholder:h,onKeyDown:v,onChange:f,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:n,id:a,name:r,autoFocus:c,placeholder:h,value:d,onKeyDown:v,onChange:f,onSubmit:g})]}):o.jsx(D.Input.Input,{"aria-label":r,name:r,autoFocus:c,placeholder:h,value:d,onKeyDown:v,onChange:f,onSubmit:g})}),Ke=x.forwardRef((t,n)=>{const{className:r,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(r,"flex gap-1 p-1 bg-popover text-popover-foreground border rounded-lg shadow-md"),ref:n,onMouseEnter:i,onMouseLeave:d,children:a})})}),Je=x.forwardRef((t,n)=>{const{className:r,children:a,mainTooltip:i,secondaryTooltip:d,icon:c,isSelected:h,isDisabled:v,onClick:f,label:g,..._}=t;C.assertEmpty(_,!1);const D=S(),z=h===void 0?o.jsxs(D.Button.Button,{className:r,variant:"ghost",disabled:v,onClick:f,ref:n,"aria-label":g,..._,children:[c,a]}):o.jsxs(D.Toggle.Toggle,{className:u(r,"data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground"),"aria-label":g,onClick:f,pressed:h,disabled:v,"data-state":h?"on":"off","data-disabled":v,ref:n,..._,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:"flex flex-col items-center",children:[o.jsx("span",{children:i}),d&&o.jsx("span",{children:d})]})]})}),kr=x.forwardRef((t,n)=>{const{className:r,items:a,isDisabled:i,...d}=t;C.assertEmpty(d);const c=S(),h=f=>o.jsxs("div",{className:"flex gap-1 items-center",children:[f.icon,f.text]}),v=a.filter(f=>f.isSelected)[0];return v?o.jsxs(c.Select.Select,{value:v.text,onValueChange:f=>{var g,_;return(_=(g=a.find(D=>D.text===f)).onClick)==null?void 0:_.call(g)},disabled:i,children:[o.jsx(c.Select.SelectTrigger,{className:"border-none",children:o.jsx(c.Select.SelectValue,{})}),o.jsx(c.Select.SelectContent,{className:r,ref:n,children:a.map(f=>o.jsx(c.Select.SelectItem,{disabled:f.isDisabled,value:f.text,children:o.jsx(h,{...f})},f.text))})]}):null}),yn="",Ge={FormattingToolbar:{Root:Ke,Button:Je,Select:kr},FilePanel:{Root:br,Button:xr,FileInput:hr,TabPanel:yr,TextInput:wr},LinkToolbar:{Root:Ke,Button:Je},SideMenu:{Root:Tr,Button:Sr},SuggestionMenu:{Root:Rr,Item:_r,EmptyItem:Er,Label:Pr,Loader:Dr},TableHandle:{Root:Ir},Generic:{Form:{Root:dr,TextInput:Mr},Menu:{Root:ur,Trigger:fr,Dropdown:pr,Divider:vr,Label:gr,Item:mr},Popover:{Root:Cr,Trigger:jr,Content:Nr}}},Or=t=>{const{shadCNComponents:n,...r}=t,a=x.useMemo(()=>({...n,...lr}),[n]);return o.jsx(Ue.Provider,{value:a,children:o.jsx(Z.ComponentsContext.Provider,{value:Ge,children:o.jsx(Z.BlockNoteViewRaw,{...r})})})};N.BlockNoteView=Or,N.components=Ge,Object.defineProperty(N,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
|