@a4banana/react-layout-primitives 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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),s={EQUAL_WEIGHT:"Equal Weight",SPACE_BETWEEN:"Space Between",SPACE_AROUND:"Space Around",SPACE_EVENLY:"Space Evenly",CENTER:"Center",START:"Start",END:"End",TOP:"Top",BOTTOM:"Bottom"},be={[s.EQUAL_WEIGHT]:"stretch",[s.SPACE_BETWEEN]:"space-between",[s.SPACE_AROUND]:"space-around",[s.SPACE_EVENLY]:"space-evenly",[s.CENTER]:"center",[s.START]:"flex-start",[s.END]:"flex-end",[s.TOP]:"flex-start",[s.BOTTOM]:"flex-end"};var P={exports:{}},O={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),ye={Start:"start",End:"end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},we={Top:"top",Bottom:"bottom",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},xe={Start:"start",Center:"center",End:"end",Stretch:"stretch"},Te={Top:"top",Center:"center",Bottom:"bottom",Stretch:"stretch"},ve={start:"flex-start",end:"flex-end",top:"flex-start",bottom:"flex-end",center:"center",stretch:"stretch","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"};var N={exports:{}},R={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.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 ge;function je(){if(ge)return O;ge=1;var f=Symbol.for("react.transitional.element"),A=Symbol.for("react.fragment");function g(R,i,c){var E=null;if(c!==void 0&&(E=""+c),i.key!==void 0&&(E=""+i.key),"key"in i){c={};for(var d in i)d!=="key"&&(c[d]=i[d])}else c=i;return i=c.ref,{$$typeof:f,type:R,key:E,ref:i!==void 0?i:null,props:c}}return O.Fragment=A,O.jsx=g,O.jsxs=g,O}var N={};/**
9
+ */var be;function Pe(){if(be)return R;be=1;var s=Symbol.for("react.transitional.element"),w=Symbol.for("react.fragment");function b(x,c,i){var f=null;if(i!==void 0&&(f=""+i),c.key!==void 0&&(f=""+c.key),"key"in c){i={};for(var d in c)d!=="key"&&(i[d]=c[d])}else i=c;return c=i.ref,{$$typeof:s,type:x,key:f,ref:c!==void 0?c:null,props:i}}return R.Fragment=w,R.jsx=b,R.jsxs=b,R}var h={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,18 +14,18 @@
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 Te;function he(){return Te||(Te=1,process.env.NODE_ENV!=="production"&&function(){function f(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case xe:return"Portal";case D:return"Profiler";case K:return"StrictMode";case V:return"Suspense";case G:return"SuspenseList"}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 re:return(e.displayName||"Context")+".Provider";case ee:return(e._context.displayName||"Context")+".Consumer";case B:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return r=e.displayName||null,r!==null?r:f(e.type)||"Memo";case L:r=e._payload,e=e._init;try{return f(e(r))}catch{}}return null}function A(e){return""+e}function g(e){try{A(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),A(e)}}function R(){}function i(){if(p===0){oe=console.log,ae=console.info,ue=console.warn,le=console.error,se=console.group,fe=console.groupCollapsed,ie=console.groupEnd;var e={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}p++}function c(){if(p--,p===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:_({},e,{value:oe}),info:_({},e,{value:ae}),warn:_({},e,{value:ue}),error:_({},e,{value:le}),group:_({},e,{value:se}),groupCollapsed:_({},e,{value:fe}),groupEnd:_({},e,{value:ie})})}0>p&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function E(e){if(H===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);H=r&&r[1]||"",ce=-1<t.stack.indexOf(`
17
+ */var ge;function Ye(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ke?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case he:return"Portal";case K:return"Profiler";case Q:return"StrictMode";case U:return"Suspense";case q:return"SuspenseList"}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 ee:return(e.displayName||"Context")+".Provider";case D:return(e._context.displayName||"Context")+".Consumer";case z:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case B:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function w(e){return""+e}function b(e){try{w(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),w(e)}}function x(){}function c(){if(A===0){ne=console.log,oe=console.info,ae=console.warn,ue=console.error,le=console.group,se=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:x,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}function i(){if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:p({},e,{value:ne}),info:p({},e,{value:oe}),warn:p({},e,{value:ae}),error:p({},e,{value:ue}),group:p({},e,{value:le}),groupCollapsed:p({},e,{value:se}),groupEnd:p({},e,{value:ce})})}0>A&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function f(e){if(G===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);G=r&&r[1]||"",fe=-1<t.stack.indexOf(`
18
18
  at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+H+e+ce}function d(e,r){if(!e||X)return"";var t=F.get(e);if(t!==void 0)return t;X=!0,t=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var o=null;o=T.H,T.H=null,i();try{var u={DetermineComponentFrameRoot:function(){try{if(r){var b=function(){throw Error()};if(Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(m){var k=m}Reflect.construct(e,[],b)}else{try{b.call()}catch(m){k=m}e.call(b.prototype)}}else{try{throw Error()}catch(m){k=m}(b=e())&&typeof b.catch=="function"&&b.catch(function(){})}}catch(m){if(m&&k&&typeof m.stack=="string")return[m.stack,k.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=u.DetermineComponentFrameRoot(),v=n[0],C=n[1];if(v&&C){var l=v.split(`
20
- `),y=C.split(`
21
- `);for(n=a=0;a<l.length&&!l[a].includes("DetermineComponentFrameRoot");)a++;for(;n<y.length&&!y[n].includes("DetermineComponentFrameRoot");)n++;if(a===l.length||n===y.length)for(a=l.length-1,n=y.length-1;1<=a&&0<=n&&l[a]!==y[n];)n--;for(;1<=a&&0<=n;a--,n--)if(l[a]!==y[n]){if(a!==1||n!==1)do if(a--,n--,0>n||l[a]!==y[n]){var w=`
22
- `+l[a].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&F.set(e,w),w}while(1<=a&&0<=n);break}}}finally{X=!1,T.H=o,c(),Error.prepareStackTrace=t}return l=(l=e?e.displayName||e.name:"")?E(l):"",typeof e=="function"&&F.set(e,l),l}function S(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return d(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return E(e);switch(e){case V:return E("Suspense");case G:return E("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case B:return e=d(e.render,!1),e;case J:return S(e.type);case L:r=e._payload,e=e._init;try{return S(e(r))}catch{}}return""}function x(){var e=T.A;return e===null?null:e.getOwner()}function j(e){if(ne.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Y(e,r){function t(){Ee||(Ee=!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))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function M(){var e=f(this.type);return de[e]||(de[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 W(e,r,t,o,u,a){return t=a.ref,e={$$typeof:U,type:e,key:r,props:a,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:M}):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.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function h(e,r,t,o,u,a){if(typeof e=="string"||typeof e=="function"||e===q||e===D||e===K||e===V||e===G||e===pe||typeof e=="object"&&e!==null&&(e.$$typeof===L||e.$$typeof===J||e.$$typeof===re||e.$$typeof===ee||e.$$typeof===B||e.$$typeof===Oe||e.getModuleId!==void 0)){var n=r.children;if(n!==void 0)if(o)if(z(n)){for(o=0;o<n.length;o++)Q(n[o],e);Object.freeze&&Object.freeze(n)}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 Q(n,e)}else n="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?o="null":z(e)?o="array":e!==void 0&&e.$$typeof===U?(o="<"+(f(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):o=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",o,n);if(ne.call(r,"key")){n=f(e);var v=Object.keys(r).filter(function(l){return l!=="key"});o=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",ve[n+o]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
19
+ `+G+e+fe}function d(e,r){if(!e||X)return"";var t=L.get(e);if(t!==void 0)return t;X=!0,t=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var o=null;o=g.H,g.H=null,c();try{var u={DetermineComponentFrameRoot:function(){try{if(r){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(m){var O=m}Reflect.construct(e,[],v)}else{try{v.call()}catch(m){O=m}e.call(v.prototype)}}else{try{throw Error()}catch(m){O=m}(v=e())&&typeof v.catch=="function"&&v.catch(function(){})}}catch(m){if(m&&O&&typeof m.stack=="string")return[m.stack,O.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=u.DetermineComponentFrameRoot(),E=n[0],T=n[1];if(E&&T){var l=E.split(`
20
+ `),y=T.split(`
21
+ `);for(n=a=0;a<l.length&&!l[a].includes("DetermineComponentFrameRoot");)a++;for(;n<y.length&&!y[n].includes("DetermineComponentFrameRoot");)n++;if(a===l.length||n===y.length)for(a=l.length-1,n=y.length-1;1<=a&&0<=n&&l[a]!==y[n];)n--;for(;1<=a&&0<=n;a--,n--)if(l[a]!==y[n]){if(a!==1||n!==1)do if(a--,n--,0>n||l[a]!==y[n]){var C=`
22
+ `+l[a].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,C),C}while(1<=a&&0<=n);break}}}finally{X=!1,g.H=o,i(),Error.prepareStackTrace=t}return l=(l=e?e.displayName||e.name:"")?f(l):"",typeof e=="function"&&L.set(e,l),l}function S(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return d(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return f(e);switch(e){case U:return f("Suspense");case q:return f("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case z:return e=d(e.render,!1),e;case H:return S(e.type);case B:r=e._payload,e=e._init;try{return S(e(r))}catch{}}return""}function _(){var e=g.A;return e===null?null:e.getOwner()}function j(e){if(te.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function P(e,r){function t(){ie||(ie=!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))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function Y(){var e=s(this.type);return de[e]||(de[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 M(e,r,t,o,u,a){return t=a.ref,e={$$typeof:W,type:e,key:r,props:a,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Y}):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.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function k(e,r,t,o,u,a){if(typeof e=="string"||typeof e=="function"||e===V||e===K||e===Q||e===U||e===q||e===je||typeof e=="object"&&e!==null&&(e.$$typeof===B||e.$$typeof===H||e.$$typeof===ee||e.$$typeof===D||e.$$typeof===z||e.$$typeof===Oe||e.getModuleId!==void 0)){var n=r.children;if(n!==void 0)if(o)if(J(n)){for(o=0;o<n.length;o++)I(n[o],e);Object.freeze&&Object.freeze(n)}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 I(n,e)}else n="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?o="null":J(e)?o="array":e!==void 0&&e.$$typeof===W?(o="<"+(s(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):o=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",o,n);if(te.call(r,"key")){n=s(e);var E=Object.keys(r).filter(function(l){return l!=="key"});o=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",Ee[n+o]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
23
  let props = %s;
24
24
  <%s {...props} />
25
25
  React keys must be passed directly to JSX without using spread:
26
26
  let props = %s;
27
- <%s key={someKey} {...props} />`,o,n,v,n),ve[n+o]=!0)}if(n=null,t!==void 0&&(g(t),n=""+t),j(r)&&(g(r.key),n=""+r.key),"key"in r){t={};for(var C in r)C!=="key"&&(t[C]=r[C])}else t=r;return n&&Y(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),W(e,n,a,u,x(),t)}function Q(e,r){if(typeof e=="object"&&e&&e.$$typeof!==Ne){if(z(e))for(var t=0;t<e.length;t++){var o=e[t];$(o)&&Z(o,r)}else if($(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?t=null:(t=te&&e[te]||e["@@iterator"],t=typeof t=="function"?t:null),typeof t=="function"&&t!==e.entries&&(t=t.call(e),t!==e))for(;!(e=t.next()).done;)$(e.value)&&Z(e.value,r)}}function $(e){return typeof e=="object"&&e!==null&&e.$$typeof===U}function Z(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=Ce(r),!me[r])){me[r]=!0;var t="";e&&e._owner!=null&&e._owner!==x()&&(t=null,typeof e._owner.tag=="number"?t=f(e._owner.type):typeof e._owner.name=="string"&&(t=e._owner.name),t=" It was passed a child from "+t+".");var o=T.getCurrentStack;T.getCurrentStack=function(){var u=S(e.type);return o&&(u+=o()||""),u},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,t),T.getCurrentStack=o}}function Ce(e){var r="",t=x();return t&&(t=f(t.type))&&(r=`
27
+ <%s key={someKey} {...props} />`,o,n,E,n),Ee[n+o]=!0)}if(n=null,t!==void 0&&(b(t),n=""+t),j(r)&&(b(r.key),n=""+r.key),"key"in r){t={};for(var T in r)T!=="key"&&(t[T]=r[T])}else t=r;return n&&P(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),M(e,n,a,u,_(),t)}function I(e,r){if(typeof e=="object"&&e&&e.$$typeof!==Ne){if(J(e))for(var t=0;t<e.length;t++){var o=e[t];$(o)&&Z(o,r)}else if($(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?t=null:(t=re&&e[re]||e["@@iterator"],t=typeof t=="function"?t:null),typeof t=="function"&&t!==e.entries&&(t=t.call(e),t!==e))for(;!(e=t.next()).done;)$(e.value)&&Z(e.value,r)}}function $(e){return typeof e=="object"&&e!==null&&e.$$typeof===W}function Z(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=Ce(r),!me[r])){me[r]=!0;var t="";e&&e._owner!=null&&e._owner!==_()&&(t=null,typeof e._owner.tag=="number"?t=s(e._owner.type):typeof e._owner.name=="string"&&(t=e._owner.name),t=" It was passed a child from "+t+".");var o=g.getCurrentStack;g.getCurrentStack=function(){var u=S(e.type);return o&&(u+=o()||""),u},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,t),g.getCurrentStack=o}}function Ce(e){var r="",t=_();return t&&(t=s(t.type))&&(r=`
28
28
 
29
- Check the render method of \``+t+"`."),r||(e=f(e))&&(r=`
29
+ Check the render method of \``+t+"`."),r||(e=s(e))&&(r=`
30
30
 
31
- Check the top-level render call using <`+e+">."),r}var Se=I,U=Symbol.for("react.transitional.element"),xe=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),re=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),pe=Symbol.for("react.offscreen"),te=Symbol.iterator,we=Symbol.for("react.client.reference"),T=Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=Object.prototype.hasOwnProperty,_=Object.assign,Oe=Symbol.for("react.client.reference"),z=Array.isArray,p=0,oe,ae,ue,le,se,fe,ie;R.__reactDisabledLog=!0;var H,ce,X=!1,F=new(typeof WeakMap=="function"?WeakMap:Map),Ne=Symbol.for("react.client.reference"),Ee,de={},ve={},me={};N.Fragment=q,N.jsx=function(e,r,t,o,u){return h(e,r,t,!1,o,u)},N.jsxs=function(e,r,t,o,u){return h(e,r,t,!0,o,u)}}()),N}var _e;function ke(){return _e||(_e=1,process.env.NODE_ENV==="production"?P.exports=je():P.exports=he()),P.exports}var Pe=ke();function ye(f){const{direction:A,defaultArrangement:g,defaultAlignment:R}=f;return I.forwardRef(({children:c=null,arrangement:E=g,alignment:d=R,style:S={},className:x="",gap:j=0,as:Y="div",...M},W)=>{const h=I.useMemo(()=>({display:"flex",flexDirection:A,gap:`${j}px`,justifyContent:be[E],alignItems:be[d]}),[j,E,d]);return Pe.jsx(Y,{ref:W,style:{...h,...S},className:x,...M,children:c})})}const Ae=ye({direction:"row",defaultArrangement:s.START,defaultAlignment:s.TOP});Ae.displayName="Row";const Re=ye({direction:"column",defaultArrangement:s.TOP,defaultAlignment:s.START});Re.displayName="Column";exports.Column=Re;exports.Row=Ae;
31
+ Check the top-level render call using <`+e+">."),r}var Re=F,W=Symbol.for("react.transitional.element"),he=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),ee=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),je=Symbol.for("react.offscreen"),re=Symbol.iterator,ke=Symbol.for("react.client.reference"),g=Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,p=Object.assign,Oe=Symbol.for("react.client.reference"),J=Array.isArray,A=0,ne,oe,ae,ue,le,se,ce;x.__reactDisabledLog=!0;var G,fe,X=!1,L=new(typeof WeakMap=="function"?WeakMap:Map),Ne=Symbol.for("react.client.reference"),ie,de={},Ee={},me={};h.Fragment=V,h.jsx=function(e,r,t,o,u){return k(e,r,t,!1,o,u)},h.jsxs=function(e,r,t,o,u){return k(e,r,t,!0,o,u)}}()),h}var pe;function Me(){return pe||(pe=1,process.env.NODE_ENV==="production"?N.exports=Pe():N.exports=Ye()),N.exports}var $e=Me();function Se(s){const{direction:w,defaultArrangement:b,defaultAlignment:x}=s;return F.forwardRef(({children:i=null,arrangement:f=b,alignment:d=x,style:S={},className:_="",gap:j=0,as:P="div",...Y},M)=>{const k=F.useMemo(()=>({display:"flex",flexDirection:w,gap:`${j}px`,justifyContent:ve[f]??f,alignItems:ve[d]??d}),[j,f,d]);return $e.jsx(P,{ref:M,style:{...k,...S},className:_,...Y,children:i})})}const _e=Se({direction:"row",defaultArrangement:ye.Start,defaultAlignment:Te.Stretch});_e.displayName="Row";const Ae=Se({direction:"column",defaultArrangement:we.Top,defaultAlignment:xe.Stretch});Ae.displayName="Column";exports.Column=Ae;exports.HorizontalAlignment=xe;exports.HorizontalArrangement=ye;exports.Row=_e;exports.VerticalAlignment=Te;exports.VerticalArrangement=we;
package/dist/index.d.ts CHANGED
@@ -4,85 +4,112 @@ import { ElementType } from 'react';
4
4
  import { ForwardRefExoticComponent } from 'react';
5
5
  import { ReactNode } from 'react';
6
6
 
7
- /** Configuration options for element alignment in both horizontal and vertical directions */
8
- declare type Alignment = Readonly<{
9
- /** Alignment configuration for horizontal positioning */
10
- Horizontal: HorizontalAlignment;
11
- /** Alignment configuration for vertical positioning */
12
- Vertical: VerticalAlignment;
13
- }>;
7
+ export declare const Column: ForwardRefExoticComponent<ColumnProps>;
14
8
 
15
- /** Configuration options for element arrangement in both horizontal and vertical directions */
16
- declare type Arrangement = Readonly<{
17
- /** Arrangement configuration for horizontal layouts */
18
- Horizontal: HorizontalArrangement;
19
- /** Arrangement configuration for vertical layouts */
20
- Vertical: VerticalArrangement;
21
- }>;
9
+ /**
10
+ * Props for the Column component.
11
+ * @example
12
+ * ```tsx
13
+ * <Column arrangement={VerticalArrangement.SpaceBetween} alignment={HorizontalAlignment.Center}>
14
+ * <div>Item 1</div>
15
+ * <div>Item 2</div>
16
+ * </Column>
17
+ * ```
18
+ */
19
+ export declare interface ColumnProps extends LayoutPrimitivesProps {
20
+ /** Controls vertical distribution of children (main axis) */
21
+ readonly arrangement?: VerticalArrangement;
22
+ /** Controls horizontal alignment of children (cross axis) */
23
+ readonly alignment?: HorizontalAlignment;
24
+ }
22
25
 
23
26
  /**
24
- * Common arrangement values used across the layout primitives.
25
- * These values are used to define the alignment and distribution of child elements.
27
+ * Namespace for horizontal alignment options.
28
+ * Used for Column's cross axis alignment.
26
29
  */
27
- declare const ArrangementValues: {
28
- readonly EQUAL_WEIGHT: "Equal Weight";
29
- readonly SPACE_BETWEEN: "Space Between";
30
- readonly SPACE_AROUND: "Space Around";
31
- readonly SPACE_EVENLY: "Space Evenly";
32
- readonly CENTER: "Center";
33
- readonly START: "Start";
34
- readonly END: "End";
35
- readonly TOP: "Top";
36
- readonly BOTTOM: "Bottom";
30
+ export declare const HorizontalAlignment: {
31
+ readonly Start: "start";
32
+ readonly Center: "center";
33
+ readonly End: "end";
34
+ readonly Stretch: "stretch";
37
35
  };
38
36
 
39
- export declare const Column: ForwardRefExoticComponent<ColumnProps>;
37
+ export declare type HorizontalAlignment = typeof HorizontalAlignment[keyof typeof HorizontalAlignment];
40
38
 
41
39
  /**
42
- * Props interface for the Column component
43
- * Extends LayoutPrimitivesProps with column-specific arrangement options
40
+ * Namespace for horizontal arrangement options.
41
+ * Used for Row's main axis distribution.
44
42
  */
45
- export declare interface ColumnProps extends LayoutPrimitivesProps {
46
- readonly arrangement?: Arrangement['Vertical'];
47
- readonly alignment?: Alignment['Horizontal'];
48
- }
49
-
50
- /** Common arrangement options that can be applied to both horizontal and vertical layouts */
51
- declare type CommonArrangement = typeof ArrangementValues.EQUAL_WEIGHT | typeof ArrangementValues.SPACE_BETWEEN | typeof ArrangementValues.SPACE_AROUND | typeof ArrangementValues.SPACE_EVENLY | typeof ArrangementValues.CENTER;
52
-
53
- /** Alignment options for horizontal positioning */
54
- declare type HorizontalAlignment = typeof ArrangementValues.START | typeof ArrangementValues.CENTER | typeof ArrangementValues.END;
43
+ export declare const HorizontalArrangement: {
44
+ readonly Start: "start";
45
+ readonly End: "end";
46
+ readonly Center: "center";
47
+ readonly SpaceBetween: "space-between";
48
+ readonly SpaceAround: "space-around";
49
+ readonly SpaceEvenly: "space-evenly";
50
+ };
55
51
 
56
- /** Arrangement options specific to horizontal layouts */
57
- declare type HorizontalArrangement = typeof ArrangementValues.START | typeof ArrangementValues.END | CommonArrangement;
52
+ export declare type HorizontalArrangement = typeof HorizontalArrangement[keyof typeof HorizontalArrangement];
58
53
 
59
54
  /**
60
- * Base interface for all layout primitive components
61
- * Extends React's div props while adding custom layout properties
55
+ * Base props for all layout primitive components.
56
+ * Extends React's div props while adding custom layout properties.
62
57
  */
63
- declare interface LayoutPrimitivesProps extends Omit<ComponentPropsWithRef<'div'>, 'as'> {
58
+ export declare interface LayoutPrimitivesProps extends Omit<ComponentPropsWithRef<'div'>, 'as'> {
64
59
  readonly children?: ReactNode;
65
60
  readonly style?: CSSProperties;
66
61
  readonly className?: string;
62
+ /** Gap between child elements in pixels */
67
63
  readonly gap?: number;
64
+ /** The element type to render as */
68
65
  readonly as?: ElementType;
69
66
  }
70
67
 
71
68
  export declare const Row: ForwardRefExoticComponent<RowProps>;
72
69
 
73
70
  /**
74
- * Props interface for the Row component
75
- * Extends LayoutPrimitivesProps with row-specific arrangement options
71
+ * Props for the Row component.
72
+ * @example
73
+ * ```tsx
74
+ * <Row arrangement={HorizontalArrangement.SpaceBetween} alignment={VerticalAlignment.Center}>
75
+ * <div>Item 1</div>
76
+ * <div>Item 2</div>
77
+ * </Row>
78
+ * ```
76
79
  */
77
80
  export declare interface RowProps extends LayoutPrimitivesProps {
78
- readonly arrangement?: Arrangement['Horizontal'];
79
- readonly alignment?: Alignment['Vertical'];
81
+ /** Controls horizontal distribution of children (main axis) */
82
+ readonly arrangement?: HorizontalArrangement;
83
+ /** Controls vertical alignment of children (cross axis) */
84
+ readonly alignment?: VerticalAlignment;
80
85
  }
81
86
 
82
- /** Alignment options for vertical positioning */
83
- declare type VerticalAlignment = typeof ArrangementValues.TOP | typeof ArrangementValues.CENTER | typeof ArrangementValues.BOTTOM;
87
+ /**
88
+ * Namespace for vertical alignment options.
89
+ * Used for Row's cross axis alignment.
90
+ */
91
+ export declare const VerticalAlignment: {
92
+ readonly Top: "top";
93
+ readonly Center: "center";
94
+ readonly Bottom: "bottom";
95
+ readonly Stretch: "stretch";
96
+ };
97
+
98
+ export declare type VerticalAlignment = typeof VerticalAlignment[keyof typeof VerticalAlignment];
99
+
100
+ /**
101
+ * Namespace for vertical arrangement options.
102
+ * Used for Column's main axis distribution.
103
+ */
104
+ export declare const VerticalArrangement: {
105
+ readonly Top: "top";
106
+ readonly Bottom: "bottom";
107
+ readonly Center: "center";
108
+ readonly SpaceBetween: "space-between";
109
+ readonly SpaceAround: "space-around";
110
+ readonly SpaceEvenly: "space-evenly";
111
+ };
84
112
 
85
- /** Arrangement options specific to vertical layouts */
86
- declare type VerticalArrangement = typeof ArrangementValues.TOP | typeof ArrangementValues.BOTTOM | CommonArrangement;
113
+ export declare type VerticalArrangement = typeof VerticalArrangement[keyof typeof VerticalArrangement];
87
114
 
88
115
  export { }
package/dist/index.js CHANGED
@@ -1,26 +1,40 @@
1
- import we, { forwardRef as Oe, useMemo as Ne } from "react";
2
- const f = {
3
- EQUAL_WEIGHT: "Equal Weight",
4
- SPACE_BETWEEN: "Space Between",
5
- SPACE_AROUND: "Space Around",
6
- SPACE_EVENLY: "Space Evenly",
7
- CENTER: "Center",
8
- START: "Start",
9
- END: "End",
10
- TOP: "Top",
11
- BOTTOM: "Bottom"
12
- }, ve = {
13
- [f.EQUAL_WEIGHT]: "stretch",
14
- [f.SPACE_BETWEEN]: "space-between",
15
- [f.SPACE_AROUND]: "space-around",
16
- [f.SPACE_EVENLY]: "space-evenly",
17
- [f.CENTER]: "center",
18
- [f.START]: "flex-start",
19
- [f.END]: "flex-end",
20
- [f.TOP]: "flex-start",
21
- [f.BOTTOM]: "flex-end"
1
+ import Re, { forwardRef as Ae, useMemo as he } from "react";
2
+ const je = {
3
+ Start: "start",
4
+ End: "end",
5
+ Center: "center",
6
+ SpaceBetween: "space-between",
7
+ SpaceAround: "space-around",
8
+ SpaceEvenly: "space-evenly"
9
+ }, ke = {
10
+ Top: "top",
11
+ Bottom: "bottom",
12
+ Center: "center",
13
+ SpaceBetween: "space-between",
14
+ SpaceAround: "space-around",
15
+ SpaceEvenly: "space-evenly"
16
+ }, Oe = {
17
+ Start: "start",
18
+ Center: "center",
19
+ End: "end",
20
+ Stretch: "stretch"
21
+ }, Ne = {
22
+ Top: "top",
23
+ Center: "center",
24
+ Bottom: "bottom",
25
+ Stretch: "stretch"
26
+ }, me = {
27
+ start: "flex-start",
28
+ end: "flex-end",
29
+ top: "flex-start",
30
+ bottom: "flex-end",
31
+ center: "center",
32
+ stretch: "stretch",
33
+ "space-between": "space-between",
34
+ "space-around": "space-around",
35
+ "space-evenly": "space-evenly"
22
36
  };
23
- var P = { exports: {} }, O = {};
37
+ var N = { exports: {} }, A = {};
24
38
  /**
25
39
  * @license React
26
40
  * react-jsx-runtime.production.js
@@ -30,29 +44,29 @@ var P = { exports: {} }, O = {};
30
44
  * This source code is licensed under the MIT license found in the
31
45
  * LICENSE file in the root directory of this source tree.
32
46
  */
33
- var be;
34
- function je() {
35
- if (be) return O;
36
- be = 1;
37
- var s = Symbol.for("react.transitional.element"), R = Symbol.for("react.fragment");
38
- function g(y, i, c) {
39
- var E = null;
40
- if (c !== void 0 && (E = "" + c), i.key !== void 0 && (E = "" + i.key), "key" in i) {
41
- c = {};
42
- for (var d in i)
43
- d !== "key" && (c[d] = i[d]);
44
- } else c = i;
45
- return i = c.ref, {
47
+ var ve;
48
+ function Pe() {
49
+ if (ve) return A;
50
+ ve = 1;
51
+ var s = Symbol.for("react.transitional.element"), x = Symbol.for("react.fragment");
52
+ function b(w, c, i) {
53
+ var f = null;
54
+ if (i !== void 0 && (f = "" + i), c.key !== void 0 && (f = "" + c.key), "key" in c) {
55
+ i = {};
56
+ for (var d in c)
57
+ d !== "key" && (i[d] = c[d]);
58
+ } else i = c;
59
+ return c = i.ref, {
46
60
  $$typeof: s,
47
- type: y,
48
- key: E,
49
- ref: i !== void 0 ? i : null,
50
- props: c
61
+ type: w,
62
+ key: f,
63
+ ref: c !== void 0 ? c : null,
64
+ props: i
51
65
  };
52
66
  }
53
- return O.Fragment = R, O.jsx = g, O.jsxs = g, O;
67
+ return A.Fragment = x, A.jsx = b, A.jsxs = b, A;
54
68
  }
55
- var N = {};
69
+ var h = {};
56
70
  /**
57
71
  * @license React
58
72
  * react-jsx-runtime.development.js
@@ -62,42 +76,42 @@ var N = {};
62
76
  * This source code is licensed under the MIT license found in the
63
77
  * LICENSE file in the root directory of this source tree.
64
78
  */
65
- var ge;
66
- function he() {
67
- return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() {
79
+ var be;
80
+ function Ye() {
81
+ return be || (be = 1, process.env.NODE_ENV !== "production" && function() {
68
82
  function s(e) {
69
83
  if (e == null) return null;
70
84
  if (typeof e == "function")
71
- return e.$$typeof === pe ? null : e.displayName || e.name || null;
85
+ return e.$$typeof === _e ? null : e.displayName || e.name || null;
72
86
  if (typeof e == "string") return e;
73
87
  switch (e) {
74
- case B:
88
+ case U:
75
89
  return "Fragment";
76
- case ye:
90
+ case we:
77
91
  return "Portal";
78
- case K:
92
+ case Q:
79
93
  return "Profiler";
80
94
  case Z:
81
95
  return "StrictMode";
82
- case q:
96
+ case z:
83
97
  return "Suspense";
84
- case G:
98
+ case q:
85
99
  return "SuspenseList";
86
100
  }
87
101
  if (typeof e == "object")
88
102
  switch (typeof e.tag == "number" && console.error(
89
103
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
90
104
  ), e.$$typeof) {
91
- case ee:
92
- return (e.displayName || "Context") + ".Provider";
93
105
  case D:
106
+ return (e.displayName || "Context") + ".Provider";
107
+ case K:
94
108
  return (e._context.displayName || "Context") + ".Consumer";
95
109
  case V:
96
110
  var r = e.render;
97
111
  return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
98
- case J:
112
+ case B:
99
113
  return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
100
- case L:
114
+ case J:
101
115
  r = e._payload, e = e._init;
102
116
  try {
103
117
  return s(e(r));
@@ -106,12 +120,12 @@ function he() {
106
120
  }
107
121
  return null;
108
122
  }
109
- function R(e) {
123
+ function x(e) {
110
124
  return "" + e;
111
125
  }
112
- function g(e) {
126
+ function b(e) {
113
127
  try {
114
- R(e);
128
+ x(e);
115
129
  var r = !1;
116
130
  } catch {
117
131
  r = !0;
@@ -123,18 +137,18 @@ function he() {
123
137
  r,
124
138
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
125
139
  o
126
- ), R(e);
140
+ ), x(e);
127
141
  }
128
142
  }
129
- function y() {
143
+ function w() {
130
144
  }
131
- function i() {
132
- if (S === 0) {
133
- ne = console.log, oe = console.info, ae = console.warn, ue = console.error, le = console.group, fe = console.groupCollapsed, se = console.groupEnd;
145
+ function c() {
146
+ if (C === 0) {
147
+ te = console.log, ne = console.info, oe = console.warn, ae = console.error, ue = console.group, le = console.groupCollapsed, se = console.groupEnd;
134
148
  var e = {
135
149
  configurable: !0,
136
150
  enumerable: !0,
137
- value: y,
151
+ value: w,
138
152
  writable: !0
139
153
  };
140
154
  Object.defineProperties(console, {
@@ -147,83 +161,83 @@ function he() {
147
161
  groupEnd: e
148
162
  });
149
163
  }
150
- S++;
164
+ C++;
151
165
  }
152
- function c() {
153
- if (S--, S === 0) {
166
+ function i() {
167
+ if (C--, C === 0) {
154
168
  var e = { configurable: !0, enumerable: !0, writable: !0 };
155
169
  Object.defineProperties(console, {
156
- log: _({}, e, { value: ne }),
157
- info: _({}, e, { value: oe }),
158
- warn: _({}, e, { value: ae }),
159
- error: _({}, e, { value: ue }),
160
- group: _({}, e, { value: le }),
161
- groupCollapsed: _({}, e, { value: fe }),
162
- groupEnd: _({}, e, { value: se })
170
+ log: p({}, e, { value: te }),
171
+ info: p({}, e, { value: ne }),
172
+ warn: p({}, e, { value: oe }),
173
+ error: p({}, e, { value: ae }),
174
+ group: p({}, e, { value: ue }),
175
+ groupCollapsed: p({}, e, { value: le }),
176
+ groupEnd: p({}, e, { value: se })
163
177
  });
164
178
  }
165
- 0 > S && console.error(
179
+ 0 > C && console.error(
166
180
  "disabledDepth fell below zero. This is a bug in React. Please file an issue."
167
181
  );
168
182
  }
169
- function E(e) {
170
- if (H === void 0)
183
+ function f(e) {
184
+ if (G === void 0)
171
185
  try {
172
186
  throw Error();
173
187
  } catch (t) {
174
188
  var r = t.stack.trim().match(/\n( *(at )?)/);
175
- H = r && r[1] || "", ie = -1 < t.stack.indexOf(`
189
+ G = r && r[1] || "", ce = -1 < t.stack.indexOf(`
176
190
  at`) ? " (<anonymous>)" : -1 < t.stack.indexOf("@") ? "@unknown:0:0" : "";
177
191
  }
178
192
  return `
179
- ` + H + e + ie;
193
+ ` + G + e + ce;
180
194
  }
181
195
  function d(e, r) {
182
196
  if (!e || X) return "";
183
- var t = F.get(e);
197
+ var t = L.get(e);
184
198
  if (t !== void 0) return t;
185
199
  X = !0, t = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
186
200
  var o = null;
187
- o = T.H, T.H = null, i();
201
+ o = g.H, g.H = null, c();
188
202
  try {
189
203
  var u = {
190
204
  DetermineComponentFrameRoot: function() {
191
205
  try {
192
206
  if (r) {
193
- var b = function() {
207
+ var v = function() {
194
208
  throw Error();
195
209
  };
196
- if (Object.defineProperty(b.prototype, "props", {
210
+ if (Object.defineProperty(v.prototype, "props", {
197
211
  set: function() {
198
212
  throw Error();
199
213
  }
200
214
  }), typeof Reflect == "object" && Reflect.construct) {
201
215
  try {
202
- Reflect.construct(b, []);
203
- } catch (v) {
204
- var k = v;
216
+ Reflect.construct(v, []);
217
+ } catch (m) {
218
+ var O = m;
205
219
  }
206
- Reflect.construct(e, [], b);
220
+ Reflect.construct(e, [], v);
207
221
  } else {
208
222
  try {
209
- b.call();
210
- } catch (v) {
211
- k = v;
223
+ v.call();
224
+ } catch (m) {
225
+ O = m;
212
226
  }
213
- e.call(b.prototype);
227
+ e.call(v.prototype);
214
228
  }
215
229
  } else {
216
230
  try {
217
231
  throw Error();
218
- } catch (v) {
219
- k = v;
232
+ } catch (m) {
233
+ O = m;
220
234
  }
221
- (b = e()) && typeof b.catch == "function" && b.catch(function() {
235
+ (v = e()) && typeof v.catch == "function" && v.catch(function() {
222
236
  });
223
237
  }
224
- } catch (v) {
225
- if (v && k && typeof v.stack == "string")
226
- return [v.stack, k.stack];
238
+ } catch (m) {
239
+ if (m && O && typeof m.stack == "string")
240
+ return [m.stack, O.stack];
227
241
  }
228
242
  return [null, null];
229
243
  }
@@ -238,44 +252,44 @@ function he() {
238
252
  "name",
239
253
  { value: "DetermineComponentFrameRoot" }
240
254
  );
241
- var n = u.DetermineComponentFrameRoot(), m = n[0], x = n[1];
242
- if (m && x) {
243
- var l = m.split(`
244
- `), A = x.split(`
255
+ var n = u.DetermineComponentFrameRoot(), E = n[0], T = n[1];
256
+ if (E && T) {
257
+ var l = E.split(`
258
+ `), y = T.split(`
245
259
  `);
246
260
  for (n = a = 0; a < l.length && !l[a].includes(
247
261
  "DetermineComponentFrameRoot"
248
262
  ); )
249
263
  a++;
250
- for (; n < A.length && !A[n].includes(
264
+ for (; n < y.length && !y[n].includes(
251
265
  "DetermineComponentFrameRoot"
252
266
  ); )
253
267
  n++;
254
- if (a === l.length || n === A.length)
255
- for (a = l.length - 1, n = A.length - 1; 1 <= a && 0 <= n && l[a] !== A[n]; )
268
+ if (a === l.length || n === y.length)
269
+ for (a = l.length - 1, n = y.length - 1; 1 <= a && 0 <= n && l[a] !== y[n]; )
256
270
  n--;
257
271
  for (; 1 <= a && 0 <= n; a--, n--)
258
- if (l[a] !== A[n]) {
272
+ if (l[a] !== y[n]) {
259
273
  if (a !== 1 || n !== 1)
260
274
  do
261
- if (a--, n--, 0 > n || l[a] !== A[n]) {
262
- var w = `
275
+ if (a--, n--, 0 > n || l[a] !== y[n]) {
276
+ var R = `
263
277
  ` + l[a].replace(
264
278
  " at new ",
265
279
  " at "
266
280
  );
267
- return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && F.set(e, w), w;
281
+ return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, R), R;
268
282
  }
269
283
  while (1 <= a && 0 <= n);
270
284
  break;
271
285
  }
272
286
  }
273
287
  } finally {
274
- X = !1, T.H = o, c(), Error.prepareStackTrace = t;
288
+ X = !1, g.H = o, i(), Error.prepareStackTrace = t;
275
289
  }
276
- return l = (l = e ? e.displayName || e.name : "") ? E(l) : "", typeof e == "function" && F.set(e, l), l;
290
+ return l = (l = e ? e.displayName || e.name : "") ? f(l) : "", typeof e == "function" && L.set(e, l), l;
277
291
  }
278
- function p(e) {
292
+ function _(e) {
279
293
  if (e == null) return "";
280
294
  if (typeof e == "function") {
281
295
  var r = e.prototype;
@@ -284,42 +298,42 @@ function he() {
284
298
  !(!r || !r.isReactComponent)
285
299
  );
286
300
  }
287
- if (typeof e == "string") return E(e);
301
+ if (typeof e == "string") return f(e);
288
302
  switch (e) {
303
+ case z:
304
+ return f("Suspense");
289
305
  case q:
290
- return E("Suspense");
291
- case G:
292
- return E("SuspenseList");
306
+ return f("SuspenseList");
293
307
  }
294
308
  if (typeof e == "object")
295
309
  switch (e.$$typeof) {
296
310
  case V:
297
311
  return e = d(e.render, !1), e;
312
+ case B:
313
+ return _(e.type);
298
314
  case J:
299
- return p(e.type);
300
- case L:
301
315
  r = e._payload, e = e._init;
302
316
  try {
303
- return p(e(r));
317
+ return _(e(r));
304
318
  } catch {
305
319
  }
306
320
  }
307
321
  return "";
308
322
  }
309
- function C() {
310
- var e = T.A;
323
+ function S() {
324
+ var e = g.A;
311
325
  return e === null ? null : e.getOwner();
312
326
  }
313
327
  function j(e) {
314
- if (te.call(e, "key")) {
328
+ if (re.call(e, "key")) {
315
329
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
316
330
  if (r && r.isReactWarning) return !1;
317
331
  }
318
332
  return e.key !== void 0;
319
333
  }
320
- function Y(e, r) {
334
+ function P(e, r) {
321
335
  function t() {
322
- ce || (ce = !0, console.error(
336
+ fe || (fe = !0, console.error(
323
337
  "%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)",
324
338
  r
325
339
  ));
@@ -329,22 +343,22 @@ function he() {
329
343
  configurable: !0
330
344
  });
331
345
  }
332
- function M() {
346
+ function Y() {
333
347
  var e = s(this.type);
334
- return Ee[e] || (Ee[e] = !0, console.error(
348
+ return ie[e] || (ie[e] = !0, console.error(
335
349
  "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."
336
350
  )), e = this.props.ref, e !== void 0 ? e : null;
337
351
  }
338
- function W(e, r, t, o, u, a) {
352
+ function M(e, r, t, o, u, a) {
339
353
  return t = a.ref, e = {
340
- $$typeof: U,
354
+ $$typeof: W,
341
355
  type: e,
342
356
  key: r,
343
357
  props: a,
344
358
  _owner: u
345
359
  }, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
346
360
  enumerable: !1,
347
- get: M
361
+ get: Y
348
362
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
349
363
  configurable: !1,
350
364
  enumerable: !1,
@@ -357,32 +371,32 @@ function he() {
357
371
  value: null
358
372
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
359
373
  }
360
- function h(e, r, t, o, u, a) {
361
- if (typeof e == "string" || typeof e == "function" || e === B || e === K || e === Z || e === q || e === G || e === xe || typeof e == "object" && e !== null && (e.$$typeof === L || e.$$typeof === J || e.$$typeof === ee || e.$$typeof === D || e.$$typeof === V || e.$$typeof === Ce || e.getModuleId !== void 0)) {
374
+ function k(e, r, t, o, u, a) {
375
+ if (typeof e == "string" || typeof e == "function" || e === U || e === Q || e === Z || e === z || e === q || e === Te || typeof e == "object" && e !== null && (e.$$typeof === J || e.$$typeof === B || e.$$typeof === D || e.$$typeof === K || e.$$typeof === V || e.$$typeof === Se || e.getModuleId !== void 0)) {
362
376
  var n = r.children;
363
377
  if (n !== void 0)
364
378
  if (o)
365
- if (z(n)) {
379
+ if (H(n)) {
366
380
  for (o = 0; o < n.length; o++)
367
- I(n[o], e);
381
+ F(n[o], e);
368
382
  Object.freeze && Object.freeze(n);
369
383
  } else
370
384
  console.error(
371
385
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
372
386
  );
373
- else I(n, e);
387
+ else F(n, e);
374
388
  } else
375
- n = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (n += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? o = "null" : z(e) ? o = "array" : e !== void 0 && e.$$typeof === U ? (o = "<" + (s(e.type) || "Unknown") + " />", n = " Did you accidentally export a JSX literal instead of a component?") : o = typeof e, console.error(
389
+ n = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (n += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? o = "null" : H(e) ? o = "array" : e !== void 0 && e.$$typeof === W ? (o = "<" + (s(e.type) || "Unknown") + " />", n = " Did you accidentally export a JSX literal instead of a component?") : o = typeof e, console.error(
376
390
  "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
377
391
  o,
378
392
  n
379
393
  );
380
- if (te.call(r, "key")) {
394
+ if (re.call(r, "key")) {
381
395
  n = s(e);
382
- var m = Object.keys(r).filter(function(l) {
396
+ var E = Object.keys(r).filter(function(l) {
383
397
  return l !== "key";
384
398
  });
385
- o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", de[n + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error(
399
+ o = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", de[n + o] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
386
400
  `A props object containing a "key" prop is being spread into JSX:
387
401
  let props = %s;
388
402
  <%s {...props} />
@@ -391,120 +405,124 @@ React keys must be passed directly to JSX without using spread:
391
405
  <%s key={someKey} {...props} />`,
392
406
  o,
393
407
  n,
394
- m,
408
+ E,
395
409
  n
396
410
  ), de[n + o] = !0);
397
411
  }
398
- if (n = null, t !== void 0 && (g(t), n = "" + t), j(r) && (g(r.key), n = "" + r.key), "key" in r) {
412
+ if (n = null, t !== void 0 && (b(t), n = "" + t), j(r) && (b(r.key), n = "" + r.key), "key" in r) {
399
413
  t = {};
400
- for (var x in r)
401
- x !== "key" && (t[x] = r[x]);
414
+ for (var T in r)
415
+ T !== "key" && (t[T] = r[T]);
402
416
  } else t = r;
403
- return n && Y(
417
+ return n && P(
404
418
  t,
405
419
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
406
- ), W(e, n, a, u, C(), t);
420
+ ), M(e, n, a, u, S(), t);
407
421
  }
408
- function I(e, r) {
409
- if (typeof e == "object" && e && e.$$typeof !== Se) {
410
- if (z(e))
422
+ function F(e, r) {
423
+ if (typeof e == "object" && e && e.$$typeof !== Ce) {
424
+ if (H(e))
411
425
  for (var t = 0; t < e.length; t++) {
412
426
  var o = e[t];
413
- $(o) && Q(o, r);
427
+ $(o) && I(o, r);
414
428
  }
415
429
  else if ($(e))
416
430
  e._store && (e._store.validated = 1);
417
- else if (e === null || typeof e != "object" ? t = null : (t = re && e[re] || e["@@iterator"], t = typeof t == "function" ? t : null), typeof t == "function" && t !== e.entries && (t = t.call(e), t !== e))
431
+ else if (e === null || typeof e != "object" ? t = null : (t = ee && e[ee] || e["@@iterator"], t = typeof t == "function" ? t : null), typeof t == "function" && t !== e.entries && (t = t.call(e), t !== e))
418
432
  for (; !(e = t.next()).done; )
419
- $(e.value) && Q(e.value, r);
433
+ $(e.value) && I(e.value, r);
420
434
  }
421
435
  }
422
436
  function $(e) {
423
- return typeof e == "object" && e !== null && e.$$typeof === U;
437
+ return typeof e == "object" && e !== null && e.$$typeof === W;
424
438
  }
425
- function Q(e, r) {
426
- if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, r = Ae(r), !me[r])) {
427
- me[r] = !0;
439
+ function I(e, r) {
440
+ if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, r = ye(r), !Ee[r])) {
441
+ Ee[r] = !0;
428
442
  var t = "";
429
- e && e._owner != null && e._owner !== C() && (t = null, typeof e._owner.tag == "number" ? t = s(e._owner.type) : typeof e._owner.name == "string" && (t = e._owner.name), t = " It was passed a child from " + t + ".");
430
- var o = T.getCurrentStack;
431
- T.getCurrentStack = function() {
432
- var u = p(e.type);
443
+ e && e._owner != null && e._owner !== S() && (t = null, typeof e._owner.tag == "number" ? t = s(e._owner.type) : typeof e._owner.name == "string" && (t = e._owner.name), t = " It was passed a child from " + t + ".");
444
+ var o = g.getCurrentStack;
445
+ g.getCurrentStack = function() {
446
+ var u = _(e.type);
433
447
  return o && (u += o() || ""), u;
434
448
  }, console.error(
435
449
  'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
436
450
  r,
437
451
  t
438
- ), T.getCurrentStack = o;
452
+ ), g.getCurrentStack = o;
439
453
  }
440
454
  }
441
- function Ae(e) {
442
- var r = "", t = C();
455
+ function ye(e) {
456
+ var r = "", t = S();
443
457
  return t && (t = s(t.type)) && (r = `
444
458
 
445
459
  Check the render method of \`` + t + "`."), r || (e = s(e)) && (r = `
446
460
 
447
461
  Check the top-level render call using <` + e + ">."), r;
448
462
  }
449
- var Re = we, U = Symbol.for("react.transitional.element"), ye = Symbol.for("react.portal"), B = Symbol.for("react.fragment"), Z = Symbol.for("react.strict_mode"), K = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), ee = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), q = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), J = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), xe = Symbol.for("react.offscreen"), re = Symbol.iterator, pe = Symbol.for("react.client.reference"), T = Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, _ = Object.assign, Ce = Symbol.for("react.client.reference"), z = Array.isArray, S = 0, ne, oe, ae, ue, le, fe, se;
450
- y.__reactDisabledLog = !0;
451
- var H, ie, X = !1, F = new (typeof WeakMap == "function" ? WeakMap : Map)(), Se = Symbol.for("react.client.reference"), ce, Ee = {}, de = {}, me = {};
452
- N.Fragment = B, N.jsx = function(e, r, t, o, u) {
453
- return h(e, r, t, !1, o, u);
454
- }, N.jsxs = function(e, r, t, o, u) {
455
- return h(e, r, t, !0, o, u);
463
+ var xe = Re, W = Symbol.for("react.transitional.element"), we = Symbol.for("react.portal"), U = Symbol.for("react.fragment"), Z = Symbol.for("react.strict_mode"), Q = Symbol.for("react.profiler"), K = Symbol.for("react.consumer"), D = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), q = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), Te = Symbol.for("react.offscreen"), ee = Symbol.iterator, _e = Symbol.for("react.client.reference"), g = xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, p = Object.assign, Se = Symbol.for("react.client.reference"), H = Array.isArray, C = 0, te, ne, oe, ae, ue, le, se;
464
+ w.__reactDisabledLog = !0;
465
+ var G, ce, X = !1, L = new (typeof WeakMap == "function" ? WeakMap : Map)(), Ce = Symbol.for("react.client.reference"), fe, ie = {}, de = {}, Ee = {};
466
+ h.Fragment = U, h.jsx = function(e, r, t, o, u) {
467
+ return k(e, r, t, !1, o, u);
468
+ }, h.jsxs = function(e, r, t, o, u) {
469
+ return k(e, r, t, !0, o, u);
456
470
  };
457
- }()), N;
471
+ }()), h;
458
472
  }
459
- var Te;
460
- function ke() {
461
- return Te || (Te = 1, process.env.NODE_ENV === "production" ? P.exports = je() : P.exports = he()), P.exports;
473
+ var ge;
474
+ function Me() {
475
+ return ge || (ge = 1, process.env.NODE_ENV === "production" ? N.exports = Pe() : N.exports = Ye()), N.exports;
462
476
  }
463
- var Pe = ke();
464
- function _e(s) {
465
- const { direction: R, defaultArrangement: g, defaultAlignment: y } = s;
466
- return Oe(({
467
- children: c = null,
468
- arrangement: E = g,
469
- alignment: d = y,
470
- style: p = {},
471
- className: C = "",
477
+ var $e = Me();
478
+ function pe(s) {
479
+ const { direction: x, defaultArrangement: b, defaultAlignment: w } = s;
480
+ return Ae(({
481
+ children: i = null,
482
+ arrangement: f = b,
483
+ alignment: d = w,
484
+ style: _ = {},
485
+ className: S = "",
472
486
  gap: j = 0,
473
- as: Y = "div",
474
- ...M
475
- }, W) => {
476
- const h = Ne(() => ({
487
+ as: P = "div",
488
+ ...Y
489
+ }, M) => {
490
+ const k = he(() => ({
477
491
  display: "flex",
478
- flexDirection: R,
492
+ flexDirection: x,
479
493
  gap: `${j}px`,
480
- justifyContent: ve[E],
481
- alignItems: ve[d]
482
- }), [j, E, d]);
483
- return /* @__PURE__ */ Pe.jsx(
484
- Y,
494
+ justifyContent: me[f] ?? f,
495
+ alignItems: me[d] ?? d
496
+ }), [j, f, d]);
497
+ return /* @__PURE__ */ $e.jsx(
498
+ P,
485
499
  {
486
- ref: W,
487
- style: { ...h, ...p },
488
- className: C,
489
- ...M,
490
- children: c
500
+ ref: M,
501
+ style: { ...k, ..._ },
502
+ className: S,
503
+ ...Y,
504
+ children: i
491
505
  }
492
506
  );
493
507
  });
494
508
  }
495
- const Ye = _e({
509
+ const We = pe({
496
510
  direction: "row",
497
- defaultArrangement: f.START,
498
- defaultAlignment: f.TOP
511
+ defaultArrangement: je.Start,
512
+ defaultAlignment: Ne.Stretch
499
513
  });
500
- Ye.displayName = "Row";
501
- const Me = _e({
514
+ We.displayName = "Row";
515
+ const Ue = pe({
502
516
  direction: "column",
503
- defaultArrangement: f.TOP,
504
- defaultAlignment: f.START
517
+ defaultArrangement: ke.Top,
518
+ defaultAlignment: Oe.Stretch
505
519
  });
506
- Me.displayName = "Column";
520
+ Ue.displayName = "Column";
507
521
  export {
508
- Me as Column,
509
- Ye as Row
522
+ Ue as Column,
523
+ Oe as HorizontalAlignment,
524
+ je as HorizontalArrangement,
525
+ We as Row,
526
+ Ne as VerticalAlignment,
527
+ ke as VerticalArrangement
510
528
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4banana/react-layout-primitives",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "files": ["dist"],
6
6
  "main": "./dist/index.cjs",
@@ -22,10 +22,8 @@
22
22
  "devDependencies": {
23
23
  "@types/node": "^20.11.24",
24
24
  "@types/react": "^19.0.0",
25
- "@types/react-dom": "^19.0.0",
26
25
  "@vitejs/plugin-react-swc": "^3.6.0",
27
26
  "react": "^19.0.0",
28
- "react-dom": "^19.0.0",
29
27
  "typescript": "^5.7.0",
30
28
  "vite": "^6.0.7",
31
29
  "vite-plugin-dts": "^3.7.3"