@necto-react/components 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.global.js +64 -1
- package/dist/index.js +1 -0
- package/package.json +3 -2
package/README.md
ADDED
|
File without changes
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var p=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},R=(t,e,r,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of P(e))!v.call(t,n)&&n!==r&&p(t,n,{get:()=>e[n],enumerable:!(m=T(e,n))||m.enumerable});return t};var u=t=>R(p({},"__esModule",{value:!0}),t);var d={};c(d,{Primitive:()=>E});module.exports=u(d);var l=require("@necto/constants"),y=require("@necto/dom"),i=require("react"),f=require("react/jsx-runtime"),M=y.HTMLElements.Div,a=({as:t,asChild:e,children:r,...m},n)=>{let s=t??M;if(e){let o=i.Children.only(r);return(0,i.isValidElement)(o)?(0,i.cloneElement)(o,{...m,ref:o.ref??n}):null}return(0,f.jsx)(s,{ref:n,...m,children:r})},E=Object.assign((0,i.forwardRef)(a),l.DOM.HTML_TAGS.reduce((t,e)=>{let r=e,m=e[0].toUpperCase()+e.slice(1),n=(0,i.forwardRef)((s,o)=>a({...s,as:e},o));return t[r]=n,t[m]=n,t},{}));0&&(module.exports={Primitive});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,45 @@
|
|
|
1
|
+
import { HTMLElements } from '@necto/dom';
|
|
2
|
+
import { DOM } from '@necto/constants';
|
|
3
|
+
import { ElementType, ComponentPropsWithRef, ForwardRefExoticComponent, Ref, ReactElement } from 'react';
|
|
1
4
|
|
|
2
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Copyright (c) Corinvo, LLC. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Props for the polymorphic Primitive component.
|
|
15
|
+
*/
|
|
16
|
+
type PrimitiveProps<E extends ElementType> = ComponentPropsWithRef<E> & {
|
|
17
|
+
/** If true, clones the single child instead of rendering an extra element. */
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
/** The element type to render as (e.g., 'div', 'button', custom component). */
|
|
20
|
+
as?: E;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Map of HTML tag names to their corresponding Primitive components.
|
|
24
|
+
*
|
|
25
|
+
* Each entry is a forward-ref exotic component that accepts the appropriate
|
|
26
|
+
* props for its element type, plus Primitive-specific props.
|
|
27
|
+
*/
|
|
28
|
+
type Primitives = {
|
|
29
|
+
[E in (typeof DOM.HTML_TAGS)[number] as E extends ElementType ? E : never]: ForwardRefExoticComponent<PrimitiveProps<E & ElementType>>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The public Primitive component for Necto.
|
|
34
|
+
*
|
|
35
|
+
* @param {PrimitiveProps<any>} props - Props for the polymorphic Primitive component.
|
|
36
|
+
* @param {Ref<any>} ref - Forwarded ref for the rendered element or cloned child.
|
|
37
|
+
* @returns {ReactElement | null} The rendered element or null.
|
|
38
|
+
*/
|
|
39
|
+
declare const Primitive: (<E extends ElementType = (typeof HTMLElements)["Div"]>(props: PrimitiveProps<E> & {
|
|
40
|
+
ref?: Ref<any>;
|
|
41
|
+
}) => ReactElement | null) & Primitives & {
|
|
42
|
+
[k: string]: any;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { Primitive };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,45 @@
|
|
|
1
|
+
import { HTMLElements } from '@necto/dom';
|
|
2
|
+
import { DOM } from '@necto/constants';
|
|
3
|
+
import { ElementType, ComponentPropsWithRef, ForwardRefExoticComponent, Ref, ReactElement } from 'react';
|
|
1
4
|
|
|
2
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Copyright (c) Corinvo, LLC. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Props for the polymorphic Primitive component.
|
|
15
|
+
*/
|
|
16
|
+
type PrimitiveProps<E extends ElementType> = ComponentPropsWithRef<E> & {
|
|
17
|
+
/** If true, clones the single child instead of rendering an extra element. */
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
/** The element type to render as (e.g., 'div', 'button', custom component). */
|
|
20
|
+
as?: E;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Map of HTML tag names to their corresponding Primitive components.
|
|
24
|
+
*
|
|
25
|
+
* Each entry is a forward-ref exotic component that accepts the appropriate
|
|
26
|
+
* props for its element type, plus Primitive-specific props.
|
|
27
|
+
*/
|
|
28
|
+
type Primitives = {
|
|
29
|
+
[E in (typeof DOM.HTML_TAGS)[number] as E extends ElementType ? E : never]: ForwardRefExoticComponent<PrimitiveProps<E & ElementType>>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The public Primitive component for Necto.
|
|
34
|
+
*
|
|
35
|
+
* @param {PrimitiveProps<any>} props - Props for the polymorphic Primitive component.
|
|
36
|
+
* @param {Ref<any>} ref - Forwarded ref for the rendered element or cloned child.
|
|
37
|
+
* @returns {ReactElement | null} The rendered element or null.
|
|
38
|
+
*/
|
|
39
|
+
declare const Primitive: (<E extends ElementType = (typeof HTMLElements)["Div"]>(props: PrimitiveProps<E> & {
|
|
40
|
+
ref?: Ref<any>;
|
|
41
|
+
}) => ReactElement | null) & Primitives & {
|
|
42
|
+
[k: string]: any;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { Primitive };
|
package/dist/index.global.js
CHANGED
|
@@ -1 +1,64 @@
|
|
|
1
|
-
"use strict";(()=>{})();
|
|
1
|
+
"use strict";(()=>{var nr=Object.create;var Xe=Object.defineProperty;var or=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var ur=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty;var X=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports);var ir=(t,n,u,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let f of sr(n))!ar.call(t,f)&&f!==u&&Xe(t,f,{get:()=>n[f],enumerable:!(i=or(n,f))||i.enumerable});return t};var Ce=(t,n,u)=>(u=t!=null?nr(ur(t)):{},ir(n||!t||!t.__esModule?Xe(u,"default",{value:t,enumerable:!0}):u,t));var qt=X(E=>{"use strict";var Ne=Symbol.for("react.transitional.element"),yr=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),hr=Symbol.for("react.strict_mode"),gr=Symbol.for("react.profiler"),Rr=Symbol.for("react.consumer"),wr=Symbol.for("react.context"),br=Symbol.for("react.forward_ref"),Ar=Symbol.for("react.suspense"),Sr=Symbol.for("react.memo"),xt=Symbol.for("react.lazy"),It=Symbol.iterator;function Or(t){return t===null||typeof t!="object"?null:(t=It&&t[It]||t["@@iterator"],typeof t=="function"?t:null)}var Yt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$t=Object.assign,Gt={};function J(t,n,u){this.props=t,this.context=n,this.refs=Gt,this.updater=u||Yt}J.prototype.isReactComponent={};J.prototype.setState=function(t,n){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,n,"setState")};J.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Wt(){}Wt.prototype=J.prototype;function Le(t,n,u){this.props=t,this.context=n,this.refs=Gt,this.updater=u||Yt}var Me=Le.prototype=new Wt;Me.constructor=Le;$t(Me,J.prototype);Me.isPureReactComponent=!0;var jt=Array.isArray,w={H:null,A:null,T:null,S:null,V:null},Bt=Object.prototype.hasOwnProperty;function Ie(t,n,u,i,f,T){return u=T.ref,{$$typeof:Ne,type:t,key:n,ref:u!==void 0?u:null,props:T}}function Cr(t,n){return Ie(t.type,n,void 0,void 0,void 0,t.props)}function je(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ne}function kr(t){var n={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(u){return n[u]})}var Ut=/\/+/g;function Pe(t,n){return typeof t=="object"&&t!==null&&t.key!=null?kr(""+t.key):n.toString(36)}function Dt(){}function Pr(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Dt,Dt):(t.status="pending",t.then(function(n){t.status==="pending"&&(t.status="fulfilled",t.value=n)},function(n){t.status==="pending"&&(t.status="rejected",t.reason=n)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Z(t,n,u,i,f){var T=typeof t;(T==="undefined"||T==="boolean")&&(t=null);var l=!1;if(t===null)l=!0;else switch(T){case"bigint":case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case Ne:case yr:l=!0;break;case xt:return l=t._init,Z(l(t._payload),n,u,i,f)}}if(l)return f=f(t),l=i===""?"."+Pe(t,0):i,jt(f)?(u="",l!=null&&(u=l.replace(Ut,"$&/")+"/"),Z(f,n,u,"",function(W){return W})):f!=null&&(je(f)&&(f=Cr(f,u+(f.key==null||t&&t.key===f.key?"":(""+f.key).replace(Ut,"$&/")+"/")+l)),n.push(f)),1;l=0;var O=i===""?".":i+":";if(jt(t))for(var g=0;g<t.length;g++)i=t[g],T=O+Pe(i,g),l+=Z(i,n,u,T,f);else if(g=Or(t),typeof g=="function")for(t=g.call(t),g=0;!(i=t.next()).done;)i=i.value,T=O+Pe(i,g++),l+=Z(i,n,u,T,f);else if(T==="object"){if(typeof t.then=="function")return Z(Pr(t),n,u,i,f);throw n=String(t),Error("Objects are not valid as a React child (found: "+(n==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return l}function _e(t,n,u){if(t==null)return t;var i=[],f=0;return Z(t,i,"","",function(T){return n.call(u,T,f++)}),i}function Nr(t){if(t._status===-1){var n=t._result;n=n(),n.then(function(u){(t._status===0||t._status===-1)&&(t._status=1,t._result=u)},function(u){(t._status===0||t._status===-1)&&(t._status=2,t._result=u)}),t._status===-1&&(t._status=0,t._result=n)}if(t._status===1)return t._result.default;throw t._result}var Ht=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Lr(){}E.Children={map:_e,forEach:function(t,n,u){_e(t,function(){n.apply(this,arguments)},u)},count:function(t){var n=0;return _e(t,function(){n++}),n},toArray:function(t){return _e(t,function(n){return n})||[]},only:function(t){if(!je(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};E.Component=J;E.Fragment=Tr;E.Profiler=gr;E.PureComponent=Le;E.StrictMode=hr;E.Suspense=Ar;E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w;E.__COMPILER_RUNTIME={__proto__:null,c:function(t){return w.H.useMemoCache(t)}};E.cache=function(t){return function(){return t.apply(null,arguments)}};E.cloneElement=function(t,n,u){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=$t({},t.props),f=t.key,T=void 0;if(n!=null)for(l in n.ref!==void 0&&(T=void 0),n.key!==void 0&&(f=""+n.key),n)!Bt.call(n,l)||l==="key"||l==="__self"||l==="__source"||l==="ref"&&n.ref===void 0||(i[l]=n[l]);var l=arguments.length-2;if(l===1)i.children=u;else if(1<l){for(var O=Array(l),g=0;g<l;g++)O[g]=arguments[g+2];i.children=O}return Ie(t.type,f,void 0,void 0,T,i)};E.createContext=function(t){return t={$$typeof:wr,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:Rr,_context:t},t};E.createElement=function(t,n,u){var i,f={},T=null;if(n!=null)for(i in n.key!==void 0&&(T=""+n.key),n)Bt.call(n,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(f[i]=n[i]);var l=arguments.length-2;if(l===1)f.children=u;else if(1<l){for(var O=Array(l),g=0;g<l;g++)O[g]=arguments[g+2];f.children=O}if(t&&t.defaultProps)for(i in l=t.defaultProps,l)f[i]===void 0&&(f[i]=l[i]);return Ie(t,T,void 0,void 0,null,f)};E.createRef=function(){return{current:null}};E.forwardRef=function(t){return{$$typeof:br,render:t}};E.isValidElement=je;E.lazy=function(t){return{$$typeof:xt,_payload:{_status:-1,_result:t},_init:Nr}};E.memo=function(t,n){return{$$typeof:Sr,type:t,compare:n===void 0?null:n}};E.startTransition=function(t){var n=w.T,u={};w.T=u;try{var i=t(),f=w.S;f!==null&&f(u,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(Lr,Ht)}catch(T){Ht(T)}finally{w.T=n}};E.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()};E.use=function(t){return w.H.use(t)};E.useActionState=function(t,n,u){return w.H.useActionState(t,n,u)};E.useCallback=function(t,n){return w.H.useCallback(t,n)};E.useContext=function(t){return w.H.useContext(t)};E.useDebugValue=function(){};E.useDeferredValue=function(t,n){return w.H.useDeferredValue(t,n)};E.useEffect=function(t,n,u){var i=w.H;if(typeof u=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,n)};E.useId=function(){return w.H.useId()};E.useImperativeHandle=function(t,n,u){return w.H.useImperativeHandle(t,n,u)};E.useInsertionEffect=function(t,n){return w.H.useInsertionEffect(t,n)};E.useLayoutEffect=function(t,n){return w.H.useLayoutEffect(t,n)};E.useMemo=function(t,n){return w.H.useMemo(t,n)};E.useOptimistic=function(t,n){return w.H.useOptimistic(t,n)};E.useReducer=function(t,n,u){return w.H.useReducer(t,n,u)};E.useRef=function(t){return w.H.useRef(t)};E.useState=function(t){return w.H.useState(t)};E.useSyncExternalStore=function(t,n,u){return w.H.useSyncExternalStore(t,n,u)};E.useTransition=function(){return w.H.useTransition()};E.version="19.1.0"});var zt=X((d,ye)=>{"use strict";process.env.NODE_ENV!=="production"&&function(){function t(e,r){Object.defineProperty(i.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",r[0],r[1])}})}function n(e){return e===null||typeof e!="object"?null:(e=N&&e[N]||e["@@iterator"],typeof e=="function"?e:null)}function u(e,r){e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass";var s=e+"."+r;V[s]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",r,e),V[s]=!0)}function i(e,r,s){this.props=e,this.context=r,this.refs=Se,this.updater=s||fe}function f(){}function T(e,r,s){this.props=e,this.context=r,this.refs=Se,this.updater=s||fe}function l(e){return""+e}function O(e){try{l(e);var r=!1}catch{r=!0}if(r){r=console;var s=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),l(e)}}function g(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Zt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Q:return"Fragment";case o:return"Profiler";case oe:return"StrictMode";case P:return"Suspense";case C:return"SuspenseList";case S:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ne:return"Portal";case R:return(e.displayName||"Context")+".Provider";case p:return(e._context.displayName||"Context")+".Consumer";case A:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return r=e.displayName||null,r!==null?r:g(e.type)||"Memo";case D:r=e._payload,e=e._init;try{return g(e(r))}catch{}}return null}function W(e){if(e===Q)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===D)return"<...>";try{var r=g(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function ee(){var e=_.A;return e===null?null:e.getOwner()}function te(){return Error("react-stack-top-frame")}function x(e){if(pe.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ae(e,r){function s(){We||(We=!0,console.error("%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://react.dev/link/special-props)",r))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function ge(){var e=g(this.type);return qe[e]||(qe[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function Y(e,r,s,a,c,y,m,h){return s=y.ref,e={$$typeof:F,type:e,key:r,props:y,_owner:c},(s!==void 0?s:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:ge}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:m}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:h}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function Re(e,r){return r=Y(e.type,r,void 0,void 0,e._owner,e.props,e._debugStack,e._debugTask),e._store&&(r._store.validated=e._store.validated),r}function M(e){return typeof e=="object"&&e!==null&&e.$$typeof===F}function we(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(s){return r[s]})}function re(e,r){return typeof e=="object"&&e!==null&&e.key!=null?(O(e.key),we(""+e.key)):r.toString(36)}function ie(){}function be(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ie,ie):(e.status="pending",e.then(function(r){e.status==="pending"&&(e.status="fulfilled",e.value=r)},function(r){e.status==="pending"&&(e.status="rejected",e.reason=r)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function I(e,r,s,a,c){var y=typeof e;(y==="undefined"||y==="boolean")&&(e=null);var m=!1;if(e===null)m=!0;else switch(y){case"bigint":case"string":case"number":m=!0;break;case"object":switch(e.$$typeof){case F:case ne:m=!0;break;case D:return m=e._init,I(m(e._payload),r,s,a,c)}}if(m){m=e,c=c(m);var h=a===""?"."+re(m,0):a;return $e(c)?(s="",h!=null&&(s=h.replace(Fe,"$&/")+"/"),I(c,r,s,"",function(H){return H})):c!=null&&(M(c)&&(c.key!=null&&(m&&m.key===c.key||O(c.key)),s=Re(c,s+(c.key==null||m&&m.key===c.key?"":(""+c.key).replace(Fe,"$&/")+"/")+h),a!==""&&m!=null&&M(m)&&m.key==null&&m._store&&!m._store.validated&&(s._store.validated=2),c=s),r.push(c)),1}if(m=0,h=a===""?".":a+":",$e(e))for(var v=0;v<e.length;v++)a=e[v],y=h+re(a,v),m+=I(a,r,s,y,c);else if(v=n(e),typeof v=="function")for(v===e.entries&&(ze||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ze=!0),e=v.call(e),v=0;!(a=e.next()).done;)a=a.value,y=h+re(a,v++),m+=I(a,r,s,y,c);else if(y==="object"){if(typeof e.then=="function")return I(be(e),r,s,a,c);throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return m}function B(e,r,s){if(e==null)return e;var a=[],c=0;return I(e,a,"","",function(y){return r.call(s,y,c++)}),a}function ce(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s)},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return r=e._result,r===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
+
|
|
3
|
+
Your code should look like:
|
|
4
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
+
|
|
6
|
+
Did you accidentally put curly braces around the import?`,r),"default"in r||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
+
|
|
8
|
+
Your code should look like:
|
|
9
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,r),r.default;throw e._result}function b(){var e=_.H;return e===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
+
2. You might be breaking the Rules of Hooks
|
|
12
|
+
3. You might have more than one copy of React in the same app
|
|
13
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function Ae(){}function j(e){if(de===null)try{var r=("require"+Math.random()).slice(0,7);de=(ye&&ye[r]).call(ye,"timers").setImmediate}catch{de=function(a){Ve===!1&&(Ve=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var c=new MessageChannel;c.port1.onmessage=a,c.port2.postMessage(void 0)}}return de(e)}function U(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function q(e,r){r!==Ee-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Ee=r}function $(e,r,s){var a=_.actQueue;if(a!==null)if(a.length!==0)try{z(a),j(function(){return $(e,r,s)});return}catch(c){_.thrownErrors.push(c)}else _.actQueue=null;0<_.thrownErrors.length?(a=U(_.thrownErrors),_.thrownErrors.length=0,s(a)):r(e)}function z(e){if(!Oe){Oe=!0;var r=0;try{for(;r<e.length;r++){var s=e[r];do{_.didUsePromise=!1;var a=s(!1);if(a!==null){if(_.didUsePromise){e[r]=s,e.splice(0,r);return}s=a}else break}while(!0)}e.length=0}catch(c){e.splice(0,r+1),_.thrownErrors.push(c)}finally{Oe=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var F=Symbol.for("react.transitional.element"),ne=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler");Symbol.for("react.provider");var p=Symbol.for("react.consumer"),R=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),N=Symbol.iterator,V={},fe={isMounted:function(){return!1},enqueueForceUpdate:function(e){u(e,"forceUpdate")},enqueueReplaceState:function(e){u(e,"replaceState")},enqueueSetState:function(e){u(e,"setState")}},Ye=Object.assign,Se={};Object.freeze(Se),i.prototype.isReactComponent={},i.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var k={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},le;for(le in k)k.hasOwnProperty(le)&&t(le,k[le]);f.prototype=i.prototype,k=T.prototype=new f,k.constructor=T,Ye(k,i.prototype),k.isPureReactComponent=!0;var $e=Array.isArray,Zt=Symbol.for("react.client.reference"),_={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},pe=Object.prototype.hasOwnProperty,Ge=console.createTask?console.createTask:function(){return null};k={"react-stack-bottom-frame":function(e){return e()}};var We,Be,qe={},Jt=k["react-stack-bottom-frame"].bind(k,te)(),er=Ge(W(te)),ze=!1,Fe=/\/+/g,Qe=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ve=!1,de=null,Ee=0,me=!1,Oe=!1,Ke=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:j;k=Object.freeze({__proto__:null,c:function(e){return b().useMemoCache(e)}}),d.Children={map:B,forEach:function(e,r,s){B(e,function(){r.apply(this,arguments)},s)},count:function(e){var r=0;return B(e,function(){r++}),r},toArray:function(e){return B(e,function(r){return r})||[]},only:function(e){if(!M(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},d.Component=i,d.Fragment=Q,d.Profiler=o,d.PureComponent=T,d.StrictMode=oe,d.Suspense=P,d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,d.__COMPILER_RUNTIME=k,d.act=function(e){var r=_.actQueue,s=Ee;Ee++;var a=_.actQueue=r!==null?r:[],c=!1;try{var y=e()}catch(v){_.thrownErrors.push(v)}if(0<_.thrownErrors.length)throw q(r,s),e=U(_.thrownErrors),_.thrownErrors.length=0,e;if(y!==null&&typeof y=="object"&&typeof y.then=="function"){var m=y;return Ke(function(){c||me||(me=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(v,H){c=!0,m.then(function(K){if(q(r,s),s===0){try{z(a),j(function(){return $(K,v,H)})}catch(rr){_.thrownErrors.push(rr)}if(0<_.thrownErrors.length){var tr=U(_.thrownErrors);_.thrownErrors.length=0,H(tr)}}else v(K)},function(K){q(r,s),0<_.thrownErrors.length&&(K=U(_.thrownErrors),_.thrownErrors.length=0),H(K)})}}}var h=y;if(q(r,s),s===0&&(z(a),a.length!==0&&Ke(function(){c||me||(me=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),_.actQueue=null),0<_.thrownErrors.length)throw e=U(_.thrownErrors),_.thrownErrors.length=0,e;return{then:function(v,H){c=!0,s===0?(_.actQueue=a,j(function(){return $(h,v,H)})):v(h)}}},d.cache=function(e){return function(){return e.apply(null,arguments)}},d.captureOwnerStack=function(){var e=_.getCurrentStack;return e===null?null:e()},d.cloneElement=function(e,r,s){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=Ye({},e.props),c=e.key,y=e._owner;if(r!=null){var m;e:{if(pe.call(r,"ref")&&(m=Object.getOwnPropertyDescriptor(r,"ref").get)&&m.isReactWarning){m=!1;break e}m=r.ref!==void 0}m&&(y=ee()),x(r)&&(O(r.key),c=""+r.key);for(h in r)!pe.call(r,h)||h==="key"||h==="__self"||h==="__source"||h==="ref"&&r.ref===void 0||(a[h]=r[h])}var h=arguments.length-2;if(h===1)a.children=s;else if(1<h){m=Array(h);for(var v=0;v<h;v++)m[v]=arguments[v+2];a.children=m}for(a=Y(e.type,c,void 0,void 0,y,a,e._debugStack,e._debugTask),c=2;c<arguments.length;c++)y=arguments[c],M(y)&&y._store&&(y._store.validated=1);return a},d.createContext=function(e){return e={$$typeof:R,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:p,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},d.createElement=function(e,r,s){for(var a=2;a<arguments.length;a++){var c=arguments[a];M(c)&&c._store&&(c._store.validated=1)}if(a={},c=null,r!=null)for(v in Be||!("__self"in r)||"key"in r||(Be=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),x(r)&&(O(r.key),c=""+r.key),r)pe.call(r,v)&&v!=="key"&&v!=="__self"&&v!=="__source"&&(a[v]=r[v]);var y=arguments.length-2;if(y===1)a.children=s;else if(1<y){for(var m=Array(y),h=0;h<y;h++)m[h]=arguments[h+2];Object.freeze&&Object.freeze(m),a.children=m}if(e&&e.defaultProps)for(v in y=e.defaultProps,y)a[v]===void 0&&(a[v]=y[v]);c&&ae(a,typeof e=="function"?e.displayName||e.name||"Unknown":e);var v=1e4>_.recentlyCreatedOwnerStacks++;return Y(e,c,void 0,void 0,ee(),a,v?Error("react-stack-top-frame"):Jt,v?Ge(W(e)):er)},d.createRef=function(){var e={current:null};return Object.seal(e),e},d.forwardRef=function(e){e!=null&&e.$$typeof===G?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var r={$$typeof:A,render:e},s;return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return s},set:function(a){s=a,e.name||e.displayName||(Object.defineProperty(e,"name",{value:a}),e.displayName=a)}}),r},d.isValidElement=M,d.lazy=function(e){return{$$typeof:D,_payload:{_status:-1,_result:e},_init:ce}},d.memo=function(e,r){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),r={$$typeof:G,type:e,compare:r===void 0?null:r};var s;return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return s},set:function(a){s=a,e.name||e.displayName||(Object.defineProperty(e,"name",{value:a}),e.displayName=a)}}),r},d.startTransition=function(e){var r=_.T,s={};_.T=s,s._updatedFibers=new Set;try{var a=e(),c=_.S;c!==null&&c(s,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(Ae,Qe)}catch(y){Qe(y)}finally{r===null&&s._updatedFibers&&(e=s._updatedFibers.size,s._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),_.T=r}},d.unstable_useCacheRefresh=function(){return b().useCacheRefresh()},d.use=function(e){return b().use(e)},d.useActionState=function(e,r,s){return b().useActionState(e,r,s)},d.useCallback=function(e,r){return b().useCallback(e,r)},d.useContext=function(e){var r=b();return e.$$typeof===p&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),r.useContext(e)},d.useDebugValue=function(e,r){return b().useDebugValue(e,r)},d.useDeferredValue=function(e,r){return b().useDeferredValue(e,r)},d.useEffect=function(e,r,s){e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var a=b();if(typeof s=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return a.useEffect(e,r)},d.useId=function(){return b().useId()},d.useImperativeHandle=function(e,r,s){return b().useImperativeHandle(e,r,s)},d.useInsertionEffect=function(e,r){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),b().useInsertionEffect(e,r)},d.useLayoutEffect=function(e,r){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),b().useLayoutEffect(e,r)},d.useMemo=function(e,r){return b().useMemo(e,r)},d.useOptimistic=function(e,r){return b().useOptimistic(e,r)},d.useReducer=function(e,r,s){return b().useReducer(e,r,s)},d.useRef=function(e){return b().useRef(e)},d.useState=function(e){return b().useState(e)},d.useSyncExternalStore=function(e,r,s){return b().useSyncExternalStore(e,r,s)},d.useTransition=function(){return b().useTransition()},d.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()});var De=X((qr,Ue)=>{"use strict";process.env.NODE_ENV==="production"?Ue.exports=qt():Ue.exports=zt()});var Qt=X(Te=>{"use strict";var Mr=Symbol.for("react.transitional.element"),Ir=Symbol.for("react.fragment");function Ft(t,n,u){var i=null;if(u!==void 0&&(i=""+u),n.key!==void 0&&(i=""+n.key),"key"in n){u={};for(var f in n)f!=="key"&&(u[f]=n[f])}else u=n;return n=u.ref,{$$typeof:Mr,type:t,key:i,ref:n!==void 0?n:null,props:u}}Te.Fragment=Ir;Te.jsx=Ft;Te.jsxs=Ft});var Vt=X(he=>{"use strict";process.env.NODE_ENV!=="production"&&function(){function t(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===Ae?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case Y:return"Fragment";case M:return"Profiler";case Re:return"StrictMode";case be:return"Suspense";case I:return"SuspenseList";case b:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case ge:return"Portal";case re:return(o.displayName||"Context")+".Provider";case we:return(o._context.displayName||"Context")+".Consumer";case ie:var p=o.render;return o=o.displayName,o||(o=p.displayName||p.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case B:return p=o.displayName||null,p!==null?p:t(o.type)||"Memo";case ce:p=o._payload,o=o._init;try{return t(o(p))}catch{}}return null}function n(o){return""+o}function u(o){try{n(o);var p=!1}catch{p=!0}if(p){p=console;var R=p.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return R.call(p,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",A),n(o)}}function i(o){if(o===Y)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===ce)return"<...>";try{var p=t(o);return p?"<"+p+">":"<...>"}catch{return"<...>"}}function f(){var o=j.A;return o===null?null:o.getOwner()}function T(){return Error("react-stack-top-frame")}function l(o){if(U.call(o,"key")){var p=Object.getOwnPropertyDescriptor(o,"key").get;if(p&&p.isReactWarning)return!1}return o.key!==void 0}function O(o,p){function R(){z||(z=!0,console.error("%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://react.dev/link/special-props)",p))}R.isReactWarning=!0,Object.defineProperty(o,"key",{get:R,configurable:!0})}function g(){var o=t(this.type);return F[o]||(F[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function W(o,p,R,A,P,C,G,D){return R=C.ref,o={$$typeof:ae,type:o,key:p,props:C,_owner:P},(R!==void 0?R:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:g}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function ee(o,p,R,A,P,C,G,D){var S=p.children;if(S!==void 0)if(A)if(q(S)){for(A=0;A<S.length;A++)te(S[A]);Object.freeze&&Object.freeze(S)}else console.error("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 te(S);if(U.call(p,"key")){S=t(o);var N=Object.keys(p).filter(function(fe){return fe!=="key"});A=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",oe[S+A]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
14
|
+
let props = %s;
|
|
15
|
+
<%s {...props} />
|
|
16
|
+
React keys must be passed directly to JSX without using spread:
|
|
17
|
+
let props = %s;
|
|
18
|
+
<%s key={someKey} {...props} />`,A,S,N,S),oe[S+A]=!0)}if(S=null,R!==void 0&&(u(R),S=""+R),l(p)&&(u(p.key),S=""+p.key),"key"in p){R={};for(var V in p)V!=="key"&&(R[V]=p[V])}else R=p;return S&&O(R,typeof o=="function"?o.displayName||o.name||"Unknown":o),W(o,S,C,P,f(),R,G,D)}function te(o){typeof o=="object"&&o!==null&&o.$$typeof===ae&&o._store&&(o._store.validated=1)}var x=De(),ae=Symbol.for("react.transitional.element"),ge=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),Re=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler");Symbol.for("react.provider");var we=Symbol.for("react.consumer"),re=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),be=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),Ae=Symbol.for("react.client.reference"),j=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,q=Array.isArray,$=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(o){return o()}};var z,F={},ne=x["react-stack-bottom-frame"].bind(x,T)(),Q=$(i(T)),oe={};he.Fragment=Y,he.jsx=function(o,p,R,A,P){var C=1e4>j.recentlyCreatedOwnerStacks++;return ee(o,p,R,!1,A,P,C?Error("react-stack-top-frame"):ne,C?$(i(o)):Q)},he.jsxs=function(o,p,R,A,P){var C=1e4>j.recentlyCreatedOwnerStacks++;return ee(o,p,R,!0,A,P,C?Error("react-stack-top-frame"):ne,C?$(i(o)):Q)}}()});var xe=X((Qr,He)=>{"use strict";process.env.NODE_ENV==="production"?He.exports=Qt():He.exports=Vt()});var cr=Object.defineProperty,ve=(t,n)=>{for(var u in n)cr(t,u,{get:n[u],enumerable:!0})},se={};ve(se,{HTML_TAGS:()=>Je,PRIMITIVE_TAGS:()=>Ze,default:()=>fr});var Ze=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],fr={PRIMITIVE_TAGS:Ze,HTML_TAGS:Je},lr={};ve(lr,{NUMERIC_DIGITS:()=>et,default:()=>pr});var et=["1","2","3","4","5","6","7","8","9","0"],pr={NUMERIC_DIGITS:et},dr={};ve(dr,{AMPERSAND:()=>ft,ASTERISK:()=>pt,BACKSLASH:()=>wt,BOM:()=>tt,CARRIAGE_RETURN:()=>ot,COLON:()=>_t,COMMA:()=>Et,COMMERCIAL_AT:()=>gt,DOT:()=>vt,DOUBLE_QUOTE:()=>at,EXCLAMATION:()=>ut,GRAVE_ACCENT:()=>At,GREATER_THAN:()=>Tt,LEFT_CURLY_BRACKET:()=>St,LEFT_SQUARE_BRACKET:()=>Rt,LINE_FEED:()=>nt,MINUS:()=>mt,PERCENT:()=>ct,PLUS:()=>dt,QUESTION:()=>ht,RIGHT_CURLY_BRACKET:()=>Ct,RIGHT_SQUARE_BRACKET:()=>bt,SHARP:()=>it,SINGLE_QUOTE:()=>lt,SMALLER_THAN:()=>yt,SPACE:()=>st,TAB:()=>rt,VERTICAL_LINE:()=>Ot,default:()=>Er});var tt=65279,rt=9,nt=10,ot=13,st=32,ut=33,at=34,it=35,ct=37,ft=38,lt=39,pt=42,dt=43,Et=44,mt=45,vt=46,_t=58,yt=60,Tt=62,ht=63,gt=64,Rt=91,wt=92,bt=93,At=96,St=123,Ot=124,Ct=125,Er={BOM:tt,TAB:rt,LINE_FEED:nt,CARRIAGE_RETURN:ot,SPACE:st,EXCLAMATION:ut,DOUBLE_QUOTE:at,SHARP:it,PERCENT:ct,AMPERSAND:ft,SINGLE_QUOTE:lt,ASTERISK:pt,PLUS:dt,COMMA:Et,MINUS:mt,DOT:vt,COLON:_t,SMALLER_THAN:yt,GREATER_THAN:Tt,QUESTION:ht,COMMERCIAL_AT:gt,LEFT_SQUARE_BRACKET:Rt,BACKSLASH:wt,RIGHT_SQUARE_BRACKET:bt,GRAVE_ACCENT:At,LEFT_CURLY_BRACKET:St,VERTICAL_LINE:Ot,RIGHT_CURLY_BRACKET:Ct},mr={};ve(mr,{CAPITALIZED:()=>kt,LOWERCASE:()=>Pt,VOWELS:()=>Nt,default:()=>vr});var kt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Pt=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],Nt=["A","E","I","O","U","a","e","i","o","u"],vr={CAPITALIZED:kt,LOWERCASE:Pt,VOWELS:Nt};var ue=new Map,Lt=new Set;function _r(t){if(!("propertyName"in t)||!t.target)return;let n=ue.get(t.target);n||(n=new Set,ue.set(t.target,n),t.target.addEventListener("transitioncancel",ke,{once:!0})),n.add(t.propertyName)}function ke(t){if(!("propertyName"in t)||!t.target)return;let n=ue.get(t.target);if(n&&(n.delete(t.propertyName),n.size===0&&(t.target.removeEventListener("transitioncancel",ke),ue.delete(t.target)),ue.size===0)){for(let u of Lt)u();Lt.clear()}}if(typeof window<"u"&&typeof document<"u"){let t=()=>{let n=document.body;n&&(n.addEventListener("transitionrun",_r),n.addEventListener("transitionend",ke))};document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}var Mt=se.HTML_TAGS.reduce((t,n)=>{var u;return t[u=n,u.charAt(0).toUpperCase()+u.slice(1)]=n,t},{});var L=Ce(De(),1),Xt=Ce(xe(),1),jr=Mt.Div,Kt=({as:t,asChild:n,children:u,...i},f)=>{let T=t??jr;if(n){let l=L.Children.only(u);return(0,L.isValidElement)(l)?(0,L.cloneElement)(l,{...i,ref:l.ref??f}):null}return(0,Xt.jsx)(T,{ref:f,...i,children:u})},Ur=Object.assign((0,L.forwardRef)(Kt),se.HTML_TAGS.reduce((t,n)=>{let u=n,i=n[0].toUpperCase()+n.slice(1),f=(0,L.forwardRef)((T,l)=>Kt({...T,as:n},l));return t[u]=f,t[i]=f,t},{}));})();
|
|
19
|
+
/*! Bundled license information:
|
|
20
|
+
|
|
21
|
+
react/cjs/react.production.js:
|
|
22
|
+
(**
|
|
23
|
+
* @license React
|
|
24
|
+
* react.production.js
|
|
25
|
+
*
|
|
26
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the MIT license found in the
|
|
29
|
+
* LICENSE file in the root directory of this source tree.
|
|
30
|
+
*)
|
|
31
|
+
|
|
32
|
+
react/cjs/react.development.js:
|
|
33
|
+
(**
|
|
34
|
+
* @license React
|
|
35
|
+
* react.development.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*)
|
|
42
|
+
|
|
43
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
44
|
+
(**
|
|
45
|
+
* @license React
|
|
46
|
+
* react-jsx-runtime.production.js
|
|
47
|
+
*
|
|
48
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the MIT license found in the
|
|
51
|
+
* LICENSE file in the root directory of this source tree.
|
|
52
|
+
*)
|
|
53
|
+
|
|
54
|
+
react/cjs/react-jsx-runtime.development.js:
|
|
55
|
+
(**
|
|
56
|
+
* @license React
|
|
57
|
+
* react-jsx-runtime.development.js
|
|
58
|
+
*
|
|
59
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the MIT license found in the
|
|
62
|
+
* LICENSE file in the root directory of this source tree.
|
|
63
|
+
*)
|
|
64
|
+
*/
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DOM as a}from"@necto/constants";import{HTMLElements as l}from"@necto/dom";import{forwardRef as s,isValidElement as y,cloneElement as E,Children as f}from"react";import{jsx as v}from"react/jsx-runtime";var T=l.Div,p=({as:t,asChild:e,children:i,...m},n)=>{let o=t??T;if(e){let r=f.only(i);return y(r)?E(r,{...m,ref:r.ref??n}):null}return v(o,{ref:n,...m,children:i})},P=Object.assign(s(p),a.HTML_TAGS.reduce((t,e)=>{let i=e,m=e[0].toUpperCase()+e.slice(1),n=s((o,r)=>p({...o,as:e},r));return t[i]=n,t[m]=n,t},{}));export{P as Primitive};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@necto-react/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Necto's standard library for providing utility components for React applications.",
|
|
6
6
|
"files": [
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"react": "^19.1.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@necto/constants": "1.4.0"
|
|
29
|
+
"@necto/constants": "1.4.0",
|
|
30
|
+
"@necto/dom": "1.4.0"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
33
|
"test": "vitest",
|