@cronocode/react-box 3.0.0-alpha.3 → 3.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,7 @@ interface BoxStyleString {
24
24
  }
25
25
  export type BoxStyle = (BoxStyleArrayString | BoxStyleArrayBoolean | BoxStyleArrayNumber | BoxStyleNumber | BoxStyleString) & {
26
26
  styleName?: string;
27
+ selector?: (className: string, pseudoClass: string) => string;
27
28
  };
28
29
  export type ExtractKeys<T extends Record<string, unknown>, TT> = {
29
30
  [K in keyof T]?: TT;
package/core.cjs CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";const T=require("react");function k(...e){return e.reduce((t,s)=>s?typeof s=="string"?(t.push(s),t):Array.isArray(s)?(t.push(...k(...s)),t):(Object.entries(s).forEach(([u,m])=>{m&&t.push(u)}),t):t,[])}var c;(e=>{(t=>{function s(m,n){return`${m}${n.replace("/","-")}`}t.fraction=s;function u(m){return[`${m} path`,`${m} circle`,`${m} rect`,`${m} line`]}t.svg=u})(e.ClassName||(e.ClassName={})),(t=>{function s(h){return`${h/4}rem`}t.rem=s;function u(h){return`${h}px`}t.px=u;function m(h,r){const[i,l]=r.split("/");return`${+i/+l*100}%`}t.fraction=m;function n(h,r){switch(r){case"fit":return"100%";case"fit-screen":return h.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return r}}t.widthHeight=n;function d(h){return(r,i)=>`var(--${h}${i});`}t.variables=d;function o(h){return(r,i)=>`var(--${h}${i});`}t.svgVariables=o;function v(h,r){return`repeat(${r},minmax(0,1fr))`}t.gridColumns=v;function y(h,r){return r==="full-row"?"1/-1":`span ${r}/span ${r}`}t.gridColumn=y;function a(h,r){return`${r}ms`}t.ms=a;function f(h,r){return`${r}deg`}t.rotate=f;function p(h,r){return r==="xAxis"?"-1 1":"1 -1"}t.flip=p})(e.Value||(e.Value={}))})(c||(c={}));const _={appearance:[{values:["none","auto","menulist-button","textfield","button","checkbox"]}],b:[{values:0,styleName:"border-width",valueFormat:c.Value.px}],bx:[{values:0,styleName:"border-inline-width",valueFormat:c.Value.px}],by:[{values:0,styleName:"border-block-width",valueFormat:c.Value.px}],bt:[{values:0,styleName:"border-top-width",valueFormat:c.Value.px}],br:[{values:0,styleName:"border-right-width",valueFormat:c.Value.px}],bb:[{values:0,styleName:"border-bottom-width",valueFormat:c.Value.px}],bl:[{values:0,styleName:"border-left-width",valueFormat:c.Value.px}],borderStyle:[{styleName:"border-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],borderRadius:[{styleName:"border-radius",values:0,valueFormat:c.Value.rem}],borderRadiusTop:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem ${e/4}rem 0 0`}],borderRadiusRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 ${e/4}rem ${e/4}rem 0`}],borderRadiusBottom:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 ${e/4}rem ${e/4}rem`}],borderRadiusLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem 0 0 ${e/4}rem`}],borderRadiusTopLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem 0 0 0`}],borderRadiusTopRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 ${e/4}rem 0 0`}],borderRadiusBottomRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 ${e/4}rem 0`}],borderRadiusBottomLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 0 ${e/4}rem`}],position:[{values:["static","relative","absolute","fixed","sticky"]}],top:[{values:0,valueFormat:c.Value.rem}],right:[{values:0,valueFormat:c.Value.rem}],bottom:[{values:0,valueFormat:c.Value.rem}],left:[{values:0,valueFormat:c.Value.rem}],inset:[{values:0,valueFormat:c.Value.rem}],boxSizing:[{values:["border-box","content-box"],styleName:"box-sizing"}],contentVisibility:[{values:["visible","hidden"],styleName:"content-visibility"}],cursor:[{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]}],display:[{values:["none","block","inline-block","flex","inline-flex","grid","inline-grid","contents"]}],inline:[{values:[!0],styleName:"display",valueFormat:()=>"inline-block"}],jc:[{styleName:"justify-content",values:["start","end","flex-start","flex-end","center","left","right","space-between","space-around","space-evenly","stretch"]}],ai:[{styleName:"align-items",values:["stretch","flex-start","flex-end","center","baseline","start","end","self-start","self-end"]}],alignContent:[{styleName:"align-content",values:["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch","start","end","baseline"]}],flex1:[{styleName:"flex",values:[!0],valueFormat:()=>"1"}],d:[{styleName:"flex-direction",values:["row","row-reverse","column","column-reverse"]}],flexWrap:[{styleName:"flex-wrap",values:["nowrap","wrap","wrap-reverse"]}],flexGrow:[{styleName:"flex-grow",values:0}],flexShrink:[{styleName:"flex-shrink",values:0}],alignSelf:[{styleName:"align-self",values:["auto","flex-start","flex-end","center","baseline","stretch"]}],justifySelf:[{styleName:"justify-self",values:["auto","flex-start","flex-end","center","baseline","stretch"]}],fontSize:[{styleName:"font-size",values:0,valueFormat:c.Value.px},{styleName:"font-size",values:["inherit"]}],fontStyle:[{styleName:"font-style",values:["italic","normal","oblique"]}],fontWeight:[{styleName:"font-weight",values:[100,200,300,400,500,600,700,800,900]}],gap:[{values:0,valueFormat:c.Value.rem}],rowGap:[{styleName:"row-gap",values:0,valueFormat:c.Value.rem}],columnGap:[{styleName:"column-gap",values:0,valueFormat:c.Value.rem}],order:[{styleName:"order",values:0}],height:[{values:0,valueFormat:e=>`${e/4}rem`},{values:["fit"],valueFormat:()=>"100%"},{values:["fit-screen"],valueFormat:()=>"100vh"},{values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{values:["auto","fit-content","max-content","min-content"]}],minHeight:[{styleName:"min-height",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"min-height",values:["fit"],valueFormat:()=>"100%"},{styleName:"min-height",values:["fit-screen"],valueFormat:()=>"100vh"},{styleName:"min-height",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"min-height",values:["auto","fit-content","max-content","min-content"]}],maxHeight:[{styleName:"max-height",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"max-height",values:["fit"],valueFormat:()=>"100%"},{styleName:"max-height",values:["fit-screen"],valueFormat:()=>"100vh"},{styleName:"max-height",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"max-height",values:["auto","fit-content","max-content","min-content"]}],width:[{values:0,valueFormat:e=>`${e/4}rem`},{values:["fit"],valueFormat:()=>"100%"},{values:["fit-screen"],valueFormat:()=>"100vw"},{values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{values:["auto","fit-content","max-content","min-content"]}],minWidth:[{styleName:"min-width",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"min-width",values:["fit"],valueFormat:()=>"100%"},{styleName:"min-width",values:["fit-screen"],valueFormat:()=>"100vw"},{styleName:"min-width",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"min-width",values:["auto","fit-content","max-content","min-content"]}],maxWidth:[{styleName:"max-width",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"max-width",values:["fit"],valueFormat:()=>"100%"},{styleName:"max-width",values:["fit-screen"],valueFormat:()=>"100vw"},{styleName:"max-width",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"max-width",values:["auto","fit-content","max-content","min-content"]}],letterSpacing:[{styleName:"letter-spacing",values:0,valueFormat:c.Value.px}],lineHeight:[{styleName:"line-height",values:0,valueFormat:c.Value.px},{styleName:"line-height",values:["font-size"],valueFormat:e=>"1"}],listStyle:[{styleName:"list-style",values:["square","inside","outside","none"]}],m:[{values:0,styleName:"margin",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin"}],mx:[{values:0,styleName:"margin-inline",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-inline"}],my:[{values:0,styleName:"margin-block",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-block"}],mt:[{values:0,styleName:"margin-top",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-top"}],mr:[{values:0,styleName:"margin-right",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-right"}],mb:[{values:0,styleName:"margin-bottom",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-bottom"}],ml:[{values:0,styleName:"margin-left",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-left"}],p:[{values:0,styleName:"padding",valueFormat:c.Value.rem}],px:[{values:0,styleName:"padding-inline",valueFormat:c.Value.rem}],py:[{values:0,styleName:"padding-block",valueFormat:c.Value.rem}],pt:[{values:0,styleName:"padding-top",valueFormat:c.Value.rem}],pr:[{values:0,styleName:"padding-right",valueFormat:c.Value.rem}],pb:[{values:0,styleName:"padding-bottom",valueFormat:c.Value.rem}],pl:[{values:0,styleName:"padding-left",valueFormat:c.Value.rem}],objectFit:[{styleName:"object-fit",values:["fill","contain","cover","scale-down","none"]}],opacity:[{values:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]}],outline:[{styleName:"outline-width",values:0,valueFormat:c.Value.px}],outlineStyle:[{styleName:"outline-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],outlineOffset:[{styleName:"outline-offset",values:0,valueFormat:c.Value.px}],overflow:[{values:["auto","hidden","scroll","visible"]}],overflowX:[{styleName:"overflow-x",values:["auto","hidden","scroll","visible"]}],overflowY:[{styleName:"overflow-y",values:["auto","hidden","scroll","visible"]}],pointerEvents:[{styleName:"pointer-events",values:["none","auto","all"]}],resize:[{values:["none","both","horizontal","vertical","block","inline"]}],rotate:[{values:[0,90,180,270,-90,-180,-270],valueFormat:e=>`${e}deg`}],flip:[{styleName:"scale",values:["xAxis","yAxis"],valueFormat:e=>e==="xAxis"?"-1 1":"1 -1"}],textAlign:[{styleName:"text-align",values:["left","right","center","justify"]}],textDecoration:[{styleName:"text-decoration",values:["none","underline","overline","line-through"]}],textOverflow:[{styleName:"text-overflow",values:["clip","ellipsis"]}],textTransform:[{styleName:"text-transform",values:["none","capitalize","lowercase","uppercase"]}],textWrap:[{styleName:"text-wrap",values:["wrap","nowrap","balance","pretty"]}],transition:[{styleName:"transition-property",values:["none","all"]}],transitionDuration:[{styleName:"transition-duration",values:[50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1e3],valueFormat:e=>`${e}ms`}],userSelect:[{styleName:"user-select",values:["none","auto","text","all"]}],visibility:[{styleName:"visibility",values:["visible","hidden","collapse"]}],whiteSpace:[{styleName:"white-space",values:["break-spaces","normal","nowrap","pre","pre-line","pre-wrap"]}],zIndex:[{styleName:"z-index",values:[1,2,3,4,5,10,11,12,13,14,15,100,101,102,103,104,105,1e3,1001,1002,1003,1004,1005]}],gridTemplateColumns:[{styleName:"grid-template-columns",values:0,valueFormat:e=>`repeat(${e},minmax(0,1fr))`},{styleName:"grid-template-columns",values:["subgrid"]}],gridTemplateRows:[{styleName:"grid-template-rows",values:0,valueFormat:e=>`repeat(${e},minmax(0,1fr))`},{styleName:"grid-template-rows",values:["subgrid"]}],gridColumn:[{styleName:"grid-column",values:0,valueFormat:e=>`span ${e}/span ${e}`},{styleName:"grid-column",values:["full-row"],valueFormat:()=>"1/-1"}],gridColumnStart:[{styleName:"grid-column-start",values:0}],gridColumnEnd:[{styleName:"grid-column-end",values:0}],gridRow:[{styleName:"grid-row",values:0,valueFormat:e=>`span ${e}/span ${e}`},{styleName:"grid-row",values:["full-column"],valueFormat:()=>"1/-1"}],gridRowStart:[{styleName:"grid-row-start",values:0}],gridRowEnd:[{styleName:"grid-row-end",values:0}]},ee={hover:":hover",focus:":focus-within",hasFocus:":has(:focus)",active:":active",valid:":user-valid",hasValid:":has(:valid)",invalid:":user-invalid",hasInvalid:":has(:user-invalid)",optional:":optional",hasChecked:":has(:checked)",hasRequired:":has(:required)",hasDisabled:":has([disabled])"},I={indeterminate:":indeterminate",checked:":checked",required:":required",disabled:"[disabled]"},M={...ee,...I},te=Object.entries(M).reduce((e,[t],s)=>(e[t]=Math.pow(2,s),e),{}),q=Object.entries(M).reduce((e,[t])=>{const s=te[t];return Object.entries(e).forEach(([u,m])=>{e[+u+s]=[...m,t]}),e},{0:[]}),H={hoverGroup:"hover",focusGroup:"focus",activeGroup:"active"},C={sm:640,md:768,lg:1024,xl:1280,xxl:1536};var K;(e=>{function t(n,d,o){const v={...n},y=v.props||{};return d.forEach(a=>{a in v&&(y[a]=v[a],delete v[a])}),o&&Object.entries(o).forEach(([a,f])=>{y[a]=f}),v.props=y,v}e.buildProps=t;function s(n){return!!n&&typeof n=="object"}e.isObject=s;function u(...n){return n.reduce((d,o)=>(Object.keys(o).forEach(v=>{const y=d[v],a=o[v];v in I&&typeof a=="boolean"||(v in I&&Array.isArray(a)?d[v]=u(y,a[1]??{}):Array.isArray(y)&&Array.isArray(a)?d[v]=y.concat(...a):s(y)&&s(a)?d[v]=u(y,a):d[v]=a)}),d),{})}e.mergeDeep=u;function m(n,d){return n in d}e.isKeyOf=m})(K||(K={}));const x=K;class ne{constructor(){this._index=0,this._cache={}}getIdentity(t){return this._cache[t]||(this._cache[t]=this.getByIndex(this._index++)),this._cache[t]}getByIndex(t){const{first:s,next:u}=ie,m=t-s.length;if(m<0)return s[t];const n=Math.floor(m/u.length),d=m-n*u.length;return this.getByIndex(n)+u[d]}}const ie={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var L;(e=>{let t="";function s(m,n){return t=Object.entries(m).map(([d,o])=>`--${d}: ${o};`).join(""),Object.entries(n).forEach(([d,o])=>{_[d]=o}),n}e.extend=s;function u(){return t}e.getVariables=u})(L||(L={}));const se=L;var R;(e=>{e.components={}})(R||(R={}));function oe(e){const{clean:t,theme:s,component:u}=e;return T.useMemo(()=>{var n,d;if(t)return;let m=(n=R.components)==null?void 0:n[u];if(m)return s?x.mergeDeep(m.styles,((d=m.themes)==null?void 0:d[s])??{}):m.styles},[u,t,s])}const ue=new ne,me=typeof window<"u"&&typeof window.document<"u";var P;const ae=typeof process=="object"&&((P=process.env)==null?void 0:P.NODE_ENV)==="test",ce=me&&!ae?T.useLayoutEffect:T.useEffect,re="_b",j="_s";function de(e,t){ce(O.flush,[e]);const s=oe(e);return T.useMemo(()=>{var n;const u=[t?j:re];(n=e.props)==null||n.name;const m=s?x.mergeDeep(s,e):e;return O.addClassNames(m,u,[]),u},[e,t,s])}var O;(e=>{let t=!0,s={};function u(a,f,p,h,r){Object.entries(a).forEach(([i,l])=>{if(x.isKeyOf(i,_))d(i,l,f,p,h,r);else if(x.isKeyOf(i,ee))u(l,f,[...p,i],h,r);else if(x.isKeyOf(i,I)){if(Array.isArray(l)){const[g,b]=l;u(b,f,[...p,i],h,r)}x.isObject(l)&&u(l,f,[...p,i],h,r)}else x.isKeyOf(i,C)?u(l,f,p,i,r):x.isKeyOf(i,H)&&(typeof l=="string"?f.push(`${H[i]}-${l}`):Object.entries(l).forEach(([g,b])=>{u(b,f,[...p,H[i]],h,g)}))})}e.addClassNames=u;function m(){if(!t)return;console.debug("\x1B[36m%s\x1B[0m","[react-box]: flush");const a=Object.entries(_).reduce((i,[l],g)=>(i[l]=g,i),{}),f=`:root{${se.getVariables()}--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;}#crono-box {position: absolute;top: 0;left: 0;height: 0;}
1
+ "use strict";const C=require("react");function te(...e){return e.reduce((t,s)=>s?typeof s=="string"?(t.push(s),t):Array.isArray(s)?(t.push(...te(...s)),t):(Object.entries(s).forEach(([u,m])=>{m&&t.push(u)}),t):t,[])}var c;(e=>{(t=>{function s(m,n){return`${m}${n.replace("/","-")}`}t.fraction=s;function u(m){return[`${m} path`,`${m} circle`,`${m} rect`,`${m} line`]}t.svg=u})(e.ClassName||(e.ClassName={})),(t=>{function s(h){return`${h/4}rem`}t.rem=s;function u(h){return`${h}px`}t.px=u;function m(h,r){const[o,l]=r.split("/");return`${+o/+l*100}%`}t.fraction=m;function n(h,r){switch(r){case"fit":return"100%";case"fit-screen":return h.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return r}}t.widthHeight=n;function d(h){return(r,o)=>`var(--${h}${o});`}t.variables=d;function i(h){return(r,o)=>`var(--${h}${o});`}t.svgVariables=i;function v(h,r){return`repeat(${r},minmax(0,1fr))`}t.gridColumns=v;function y(h,r){return r==="full-row"?"1/-1":`span ${r}/span ${r}`}t.gridColumn=y;function a(h,r){return`${r}ms`}t.ms=a;function f(h,r){return`${r}deg`}t.rotate=f;function p(h,r){return r==="xAxis"?"-1 1":"1 -1"}t.flip=p})(e.Value||(e.Value={}))})(c||(c={}));const A={appearance:[{values:["none","auto","menulist-button","textfield","button","checkbox"]}],b:[{values:0,styleName:"border-width",valueFormat:c.Value.px}],bx:[{values:0,styleName:"border-inline-width",valueFormat:c.Value.px}],by:[{values:0,styleName:"border-block-width",valueFormat:c.Value.px}],bt:[{values:0,styleName:"border-top-width",valueFormat:c.Value.px}],br:[{values:0,styleName:"border-right-width",valueFormat:c.Value.px}],bb:[{values:0,styleName:"border-bottom-width",valueFormat:c.Value.px}],bl:[{values:0,styleName:"border-left-width",valueFormat:c.Value.px}],borderStyle:[{styleName:"border-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],borderRadius:[{styleName:"border-radius",values:0,valueFormat:c.Value.rem}],borderRadiusTop:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem ${e/4}rem 0 0`}],borderRadiusRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 ${e/4}rem ${e/4}rem 0`}],borderRadiusBottom:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 ${e/4}rem ${e/4}rem`}],borderRadiusLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem 0 0 ${e/4}rem`}],borderRadiusTopLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem 0 0 0`}],borderRadiusTopRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 ${e/4}rem 0 0`}],borderRadiusBottomRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 ${e/4}rem 0`}],borderRadiusBottomLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 0 ${e/4}rem`}],position:[{values:["static","relative","absolute","fixed","sticky"]}],top:[{values:0,valueFormat:c.Value.rem}],right:[{values:0,valueFormat:c.Value.rem}],bottom:[{values:0,valueFormat:c.Value.rem}],left:[{values:0,valueFormat:c.Value.rem}],inset:[{values:0,valueFormat:c.Value.rem}],boxSizing:[{values:["border-box","content-box"],styleName:"box-sizing"}],contentVisibility:[{values:["visible","hidden"],styleName:"content-visibility"}],cursor:[{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]}],display:[{values:["none","block","inline-block","flex","inline-flex","grid","inline-grid","contents"]}],inline:[{values:[!0],styleName:"display",valueFormat:()=>"inline-block"}],jc:[{styleName:"justify-content",values:["start","end","flex-start","flex-end","center","left","right","space-between","space-around","space-evenly","stretch"]}],ai:[{styleName:"align-items",values:["stretch","flex-start","flex-end","center","baseline","start","end","self-start","self-end"]}],alignContent:[{styleName:"align-content",values:["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch","start","end","baseline"]}],flex1:[{styleName:"flex",values:[!0],valueFormat:()=>"1"}],d:[{styleName:"flex-direction",values:["row","row-reverse","column","column-reverse"]}],flexWrap:[{styleName:"flex-wrap",values:["nowrap","wrap","wrap-reverse"]}],flexGrow:[{styleName:"flex-grow",values:0}],flexShrink:[{styleName:"flex-shrink",values:0}],alignSelf:[{styleName:"align-self",values:["auto","flex-start","flex-end","center","baseline","stretch"]}],justifySelf:[{styleName:"justify-self",values:["auto","flex-start","flex-end","center","baseline","stretch"]}],fontSize:[{styleName:"font-size",values:0,valueFormat:c.Value.px},{styleName:"font-size",values:["inherit"]}],fontStyle:[{styleName:"font-style",values:["italic","normal","oblique"]}],fontWeight:[{styleName:"font-weight",values:[100,200,300,400,500,600,700,800,900]}],gap:[{values:0,valueFormat:c.Value.rem}],rowGap:[{styleName:"row-gap",values:0,valueFormat:c.Value.rem}],columnGap:[{styleName:"column-gap",values:0,valueFormat:c.Value.rem}],order:[{styleName:"order",values:0}],height:[{values:0,valueFormat:e=>`${e/4}rem`},{values:["fit"],valueFormat:()=>"100%"},{values:["fit-screen"],valueFormat:()=>"100vh"},{values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{values:["auto","fit-content","max-content","min-content"]}],minHeight:[{styleName:"min-height",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"min-height",values:["fit"],valueFormat:()=>"100%"},{styleName:"min-height",values:["fit-screen"],valueFormat:()=>"100vh"},{styleName:"min-height",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"min-height",values:["auto","fit-content","max-content","min-content"]}],maxHeight:[{styleName:"max-height",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"max-height",values:["fit"],valueFormat:()=>"100%"},{styleName:"max-height",values:["fit-screen"],valueFormat:()=>"100vh"},{styleName:"max-height",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"max-height",values:["auto","fit-content","max-content","min-content"]}],width:[{values:0,valueFormat:e=>`${e/4}rem`},{values:["fit"],valueFormat:()=>"100%"},{values:["fit-screen"],valueFormat:()=>"100vw"},{values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{values:["auto","fit-content","max-content","min-content"]}],minWidth:[{styleName:"min-width",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"min-width",values:["fit"],valueFormat:()=>"100%"},{styleName:"min-width",values:["fit-screen"],valueFormat:()=>"100vw"},{styleName:"min-width",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"min-width",values:["auto","fit-content","max-content","min-content"]}],maxWidth:[{styleName:"max-width",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"max-width",values:["fit"],valueFormat:()=>"100%"},{styleName:"max-width",values:["fit-screen"],valueFormat:()=>"100vw"},{styleName:"max-width",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"max-width",values:["auto","fit-content","max-content","min-content"]}],letterSpacing:[{styleName:"letter-spacing",values:0,valueFormat:c.Value.px}],lineHeight:[{styleName:"line-height",values:0,valueFormat:c.Value.px},{styleName:"line-height",values:["font-size"],valueFormat:e=>"1"}],listStyle:[{styleName:"list-style",values:["square","inside","outside","none"]}],m:[{values:0,styleName:"margin",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin"}],mx:[{values:0,styleName:"margin-inline",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-inline"}],my:[{values:0,styleName:"margin-block",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-block"}],mt:[{values:0,styleName:"margin-top",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-top"}],mr:[{values:0,styleName:"margin-right",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-right"}],mb:[{values:0,styleName:"margin-bottom",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-bottom"}],ml:[{values:0,styleName:"margin-left",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-left"}],p:[{values:0,styleName:"padding",valueFormat:c.Value.rem}],px:[{values:0,styleName:"padding-inline",valueFormat:c.Value.rem}],py:[{values:0,styleName:"padding-block",valueFormat:c.Value.rem}],pt:[{values:0,styleName:"padding-top",valueFormat:c.Value.rem}],pr:[{values:0,styleName:"padding-right",valueFormat:c.Value.rem}],pb:[{values:0,styleName:"padding-bottom",valueFormat:c.Value.rem}],pl:[{values:0,styleName:"padding-left",valueFormat:c.Value.rem}],objectFit:[{styleName:"object-fit",values:["fill","contain","cover","scale-down","none"]}],opacity:[{values:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]}],outline:[{styleName:"outline-width",values:0,valueFormat:c.Value.px}],outlineStyle:[{styleName:"outline-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],outlineOffset:[{styleName:"outline-offset",values:0,valueFormat:c.Value.px}],overflow:[{values:["auto","hidden","scroll","visible"]}],overflowX:[{styleName:"overflow-x",values:["auto","hidden","scroll","visible"]}],overflowY:[{styleName:"overflow-y",values:["auto","hidden","scroll","visible"]}],pointerEvents:[{styleName:"pointer-events",values:["none","auto","all"]}],resize:[{values:["none","both","horizontal","vertical","block","inline"]}],rotate:[{values:[0,90,180,270,-90,-180,-270],valueFormat:e=>`${e}deg`}],flip:[{styleName:"scale",values:["xAxis","yAxis"],valueFormat:e=>e==="xAxis"?"-1 1":"1 -1"}],textAlign:[{styleName:"text-align",values:["left","right","center","justify"]}],textDecoration:[{styleName:"text-decoration",values:["none","underline","overline","line-through"]}],textOverflow:[{styleName:"text-overflow",values:["clip","ellipsis"]}],textTransform:[{styleName:"text-transform",values:["none","capitalize","lowercase","uppercase"]}],textWrap:[{styleName:"text-wrap",values:["wrap","nowrap","balance","pretty"]}],transition:[{styleName:"transition-property",values:["none","all"]}],transitionDuration:[{styleName:"transition-duration",values:[50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1e3],valueFormat:e=>`${e}ms`}],userSelect:[{styleName:"user-select",values:["none","auto","text","all"]}],visibility:[{styleName:"visibility",values:["visible","hidden","collapse"]}],whiteSpace:[{styleName:"white-space",values:["break-spaces","normal","nowrap","pre","pre-line","pre-wrap"]}],zIndex:[{styleName:"z-index",values:[1,2,3,4,5,10,11,12,13,14,15,100,101,102,103,104,105,1e3,1001,1002,1003,1004,1005]}],gridTemplateColumns:[{styleName:"grid-template-columns",values:0,valueFormat:e=>`repeat(${e},minmax(0,1fr))`},{styleName:"grid-template-columns",values:["subgrid"]}],gridTemplateRows:[{styleName:"grid-template-rows",values:0,valueFormat:e=>`repeat(${e},minmax(0,1fr))`},{styleName:"grid-template-rows",values:["subgrid"]}],gridColumn:[{styleName:"grid-column",values:0,valueFormat:e=>`span ${e}/span ${e}`},{styleName:"grid-column",values:["full-row"],valueFormat:()=>"1/-1"}],gridColumnStart:[{styleName:"grid-column-start",values:0}],gridColumnEnd:[{styleName:"grid-column-end",values:0}],gridRow:[{styleName:"grid-row",values:0,valueFormat:e=>`span ${e}/span ${e}`},{styleName:"grid-row",values:["full-column"],valueFormat:()=>"1/-1"}],gridRowStart:[{styleName:"grid-row-start",values:0}],gridRowEnd:[{styleName:"grid-row-end",values:0}]},se={hover:":hover",focus:":focus-within",hasFocus:":has(:focus)",active:":active",valid:":user-valid",hasValid:":has(:valid)",invalid:":user-invalid",hasInvalid:":has(:user-invalid)",optional:":optional",hasChecked:":has(:checked)",hasRequired:":has(:required)",hasDisabled:":has([disabled])"},B={indeterminate:":indeterminate",checked:":checked",required:":required",disabled:"[disabled]"},Y={...se,...B},ae=Object.entries(Y).reduce((e,[t],s)=>(e[t]=Math.pow(2,s),e),{}),K=Object.entries(Y).reduce((e,[t])=>{const s=ae[t];return Object.entries(e).forEach(([u,m])=>{e[+u+s]=[...m,t]}),e},{0:[]}),L={hoverGroup:"hover",focusGroup:"focus",activeGroup:"active"},R={sm:640,md:768,lg:1024,xl:1280,xxl:1536};var U;(e=>{function t(n,d,i){const v={...n},y=v.props||{};return d.forEach(a=>{a in v&&(y[a]=v[a],delete v[a])}),i&&Object.entries(i).forEach(([a,f])=>{y[a]=f}),v.props=y,v}e.buildProps=t;function s(n){return!!n&&typeof n=="object"}e.isObject=s;function u(...n){return n.reduce((d,i)=>(Object.keys(i).forEach(v=>{const y=d[v],a=i[v];v in B&&typeof a=="boolean"||(v in B&&Array.isArray(a)?d[v]=u(y,a[1]??{}):Array.isArray(y)&&Array.isArray(a)?d[v]=y.concat(...a):s(y)&&s(a)?d[v]=u(y,a):d[v]=a)}),d),{})}e.mergeDeep=u;function m(n,d){return n in d}e.isKeyOf=m})(U||(U={}));const w=U;class ie{constructor(){this._index=0,this._cache={}}getIdentity(t){return this._cache[t]||(this._cache[t]=this.getByIndex(this._index++)),this._cache[t]}getByIndex(t){const{first:s,next:u}=ue,m=t-s.length;if(m<0)return s[t];const n=Math.floor(m/u.length),d=m-n*u.length;return this.getByIndex(n)+u[d]}}const ue={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var W;(e=>{let t="";function s(m,n){return t=Object.entries(m).map(([d,i])=>`--${d}: ${i};`).join(""),Object.entries(n).forEach(([d,i])=>{A[d]=i}),n}e.extend=s;function u(){return t}e.getVariables=u})(W||(W={}));const re=W;var G;(e=>{e.components={}})(G||(G={}));function me(e){const{clean:t,theme:s,component:u}=e;return C.useMemo(()=>{var n,d;if(t)return;let m=(n=G.components)==null?void 0:n[u];if(m)return s?w.mergeDeep(m.styles,((d=m.themes)==null?void 0:d[s])??{}):m.styles},[u,t,s])}const ce=new ie,de=typeof window<"u"&&typeof window.document<"u";var ee;const le=typeof process=="object"&&((ee=process.env)==null?void 0:ee.NODE_ENV)==="test",ve=de&&!le?C.useLayoutEffect:C.useEffect,ne="_b",O="_s";function fe(e,t){ve(S.flush,[e]);const s=me(e);return C.useMemo(()=>{var n;const u=[t?O:ne];(n=e.props)==null||n.name;const m=s?w.mergeDeep(s,e):e;return S.addClassNames(m,u,[]),u},[e,t,s])}var S;(e=>{let t=!0,s={};function u(a,f,p,h,r){Object.entries(a).forEach(([o,l])=>{if(w.isKeyOf(o,A))d(o,l,f,p,h,r);else if(w.isKeyOf(o,se))u(l,f,[...p,o],h,r);else if(w.isKeyOf(o,B)){if(Array.isArray(l)){const[b,x]=l;u(x,f,[...p,o],h,r)}w.isObject(l)&&u(l,f,[...p,o],h,r)}else w.isKeyOf(o,R)?u(l,f,p,o,r):w.isKeyOf(o,L)&&(typeof l=="string"?f.push(`${L[o]}-${l}`):Object.entries(l).forEach(([b,x])=>{u(x,f,[...p,L[o]],h,b)}))})}e.addClassNames=u;function m(){if(!t)return;console.debug("\x1B[36m%s\x1B[0m","[react-box]: flush");const a=Object.entries(A).reduce((o,[l],b)=>(o[l]=b,o),{}),f=`:root{${re.getVariables()}--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;}#crono-box {position: absolute;top: 0;left: 0;height: 0;}
2
2
  html{font-size: 16px;font-family: Arial, sans-serif;}
3
3
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
4
4
  a,ul{all: unset;}
5
- .${re}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
6
- .${j}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${j} path,.${j} circle,.${j} rect,.${j} line {transition: all var(--svgTransitionTime);}
7
- `,p=Object.entries(s);p.sort(([i],[l])=>(C[i]??0)-(C[l]??0));const h=p.reduce((i,[l,g])=>(l!=="normal"&&i.push(`@media(min-width: ${C[l]}px){`),Object.entries(g).forEach(([b,B])=>{const{__parents:X,...le}=B,Y=Object.entries(le);Y.sort(([w],[S])=>a[w]-a[S]),Y.forEach(([w,S])=>{S.forEach(F=>{var A;const N=_[w].find(E=>Array.isArray(E.values)?E.values.includes(F):typeof F==typeof E.values);if(!N)return;const $=o(w,F,+b,l),J=N.styleName??w,V=((A=N.valueFormat)==null?void 0:A.call(N,F))??F,G=q[+b];i.push(`.${$}${G.map(E=>M[E]).join("")}{${J}:${V}}`)})}),X&&Object.entries(X).forEach(([w,S])=>{const F=Object.entries(S);F.sort(([z],[N])=>a[z]-a[N]),F.forEach(([z,N])=>{N.forEach($=>{var Z;const V=_[z].find(D=>Array.isArray(D.values)?D.values.includes($):typeof $==typeof D.values);if(!V)return;const G=o(z,$,+b,l,w),A=V.styleName??z,E=((Z=V.valueFormat)==null?void 0:Z.call(V,$))??$,[Q]=q[+b];i.push(`.${Q}-${w}:${Q} .${G}{${A}:${E}}`)})})})}),l!=="normal"&&i.push("}"),i),[f]),r=y();r.innerHTML=h.join(""),t=!1}e.flush=m;function n(){s={}}e.clear=n;function d(a,f,p,h,r="normal",i){if(f==null)return;const l=h.reduce((b,B)=>b+te[B],0);s[r]?s[r][l]?s[r][l][a]||(s[r][l][a]=new Set):s[r][l]={[a]:new Set}:s[r]={[l]:{[a]:new Set}},i?(s[r][l].__parents?s[r][l].__parents[i]?s[r][l].__parents[i][a]||(s[r][l].__parents[i][a]=new Set):s[r][l].__parents[i]={[a]:new Set}:s[r][l].__parents={[i]:{[a]:new Set}},s[r][l].__parents[i][a].has(f)||(s[r][l].__parents[i][a].add(f),t=!0)):s[r][l][a].has(f)||(s[r][l][a].add(f),t=!0);const g=o(a,f,l,r,i);p.push(g)}function o(a,f,p,h,r){const i=q[p],l=`${h==="normal"?"":`${h}-`}${i.map(g=>`${g}-`).join("")}${r?`${r}-`:""}${a}-${f}`;return ae?l:ue.getIdentity(l)}const v="crono-styles";function y(){let a=document.getElementById(v);return a||(a=document.createElement("style"),a.setAttribute("id",v),a.setAttribute("type","text/css"),document.head.insertBefore(a,document.head.firstChild)),a}})(O||(O={}));exports.StylesContext=void 0;(e=>{e.flush=O.flush,e.clear=O.clear})(exports.StylesContext||(exports.StylesContext={}));var U;(e=>{const t={button:{styles:{display:"inline-block",p:3,cursor:"pointer",b:1,borderRadius:1,userSelect:"none",disabled:{cursor:"default"}}},checkbox:{styles:{display:"inline-block"}},radioButton:{styles:{display:"inline-block",b:1,p:2}},textbox:{styles:{display:"inline-block",b:1,borderRadius:1,p:3}},textarea:{styles:{display:"inline-block",b:1,borderRadius:1}}};function s(u){const{components:m,...n}=u,d=m??{};Object.entries(n).forEach(([o,v])=>{d[o]=v}),R.components=x.mergeDeep(t,d)}e.setup=s})(U||(U={}));const ve=U;var W;(e=>{function t(u){const m=Array.from(u.elements).reduce((n,d)=>{const o=d.name;return o&&(n[o]||(n[o]=[]),n[o].push(d)),n},{});return Object.entries(m).reduce((n,[d,o])=>{if(o.length===1){const v=o[0];s(n,d,v.type==="checkbox"||v.type==="radio"?v.checked:v.value)}else{const v=o.reduce((y,a)=>(a.type==="checkbox"||a.type==="radio"?a.checked&&y.push(a.value):y.push(a.value),y),[]);s(n,d,v)}return n},{})}e.getFormEntries=t;function s(u,m,n){if(m.includes(".")){const d=m.split(".");let o=u;d.forEach((v,y)=>{if(d.length>y+1){const a=v.match(/^(.+)\[(\d)\]$/);if(a){const[,f,p]=a;o[f]=o[f]||[],o[f][p]=o[f][p]||{},o=o[f][p]}else o[v]=o[v]||{},o=o[v]}else o[v]=n})}else u[m]=n}})(W||(W={}));const fe=W;function he(){return T.useMemo(()=>{const e="crono-box";let t=document.getElementById(e);return t||(t=document.createElement("div"),t.id=e,document.body.appendChild(t)),t},[])}exports.BoxExtends=se;exports.FormUtils=fe;exports.ObjectUtils=x;exports.Theme=ve;exports.classNames=k;exports.usePortalContainer=he;exports.useStyles=de;
5
+ .${ne}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
6
+ .${O}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${O} path,.${O} circle,.${O} rect,.${O} line {transition: all var(--svgTransitionTime);}
7
+ `,p=Object.entries(s);p.sort(([o],[l])=>(R[o]??0)-(R[l]??0));const h=p.reduce((o,[l,b])=>(l!=="normal"&&o.push(`@media(min-width: ${R[l]}px){`),Object.entries(b).forEach(([x,D])=>{const{__parents:J,...oe}=D,Q=Object.entries(oe);Q.sort(([$],[_])=>a[$]-a[_]),Q.forEach(([$,_])=>{_.forEach(F=>{var I,V;const g=A[$].find(z=>Array.isArray(z.values)?z.values.includes(F):typeof F==typeof z.values);if(!g)return;const E=i($,F,+x,l),Z=g.styleName??$,N=((I=g.valueFormat)==null?void 0:I.call(g,F))??F,T=K[+x].map(z=>Y[z]).join(""),q=((V=g.selector)==null?void 0:V.call(g,`.${E}`,T))??`.${E}${T}`;o.push(`${q}{${Z}:${N}}`)})}),J&&Object.entries(J).forEach(([$,_])=>{const F=Object.entries(_);F.sort(([j],[g])=>a[j]-a[g]),F.forEach(([j,g])=>{g.forEach(E=>{var P,k;const N=A[j].find(H=>Array.isArray(H.values)?H.values.includes(E):typeof E==typeof H.values);if(!N)return;const T=i(j,E,+x,l,$),q=N.styleName??j,I=((P=N.valueFormat)==null?void 0:P.call(N,E))??E,[V]=K[+x],z=((k=N.selector)==null?void 0:k.call(N,`.${V}-${$}:${V} .${T}`,""))??`.${V}-${$}:${V} .${T}`;o.push(`${z}{${q}:${I}}`)})})})}),l!=="normal"&&o.push("}"),o),[f]),r=y();r.innerHTML=h.join(""),t=!1}e.flush=m;function n(){s={}}e.clear=n;function d(a,f,p,h,r="normal",o){if(f==null)return;const l=h.reduce((x,D)=>x+ae[D],0);s[r]?s[r][l]?s[r][l][a]||(s[r][l][a]=new Set):s[r][l]={[a]:new Set}:s[r]={[l]:{[a]:new Set}},o?(s[r][l].__parents?s[r][l].__parents[o]?s[r][l].__parents[o][a]||(s[r][l].__parents[o][a]=new Set):s[r][l].__parents[o]={[a]:new Set}:s[r][l].__parents={[o]:{[a]:new Set}},s[r][l].__parents[o][a].has(f)||(s[r][l].__parents[o][a].add(f),t=!0)):s[r][l][a].has(f)||(s[r][l][a].add(f),t=!0);const b=i(a,f,l,r,o);p.push(b)}function i(a,f,p,h,r){const o=K[p],l=`${h==="normal"?"":`${h}-`}${o.map(b=>`${b}-`).join("")}${r?`${r}-`:""}${a}-${f}`;return le?l:ce.getIdentity(l)}const v="crono-styles";function y(){let a=document.getElementById(v);return a||(a=document.createElement("style"),a.setAttribute("id",v),a.setAttribute("type","text/css"),document.head.insertBefore(a,document.head.firstChild)),a}})(S||(S={}));exports.StylesContext=void 0;(e=>{e.flush=S.flush,e.clear=S.clear})(exports.StylesContext||(exports.StylesContext={}));var M;(e=>{const t={button:{styles:{display:"inline-block",p:3,cursor:"pointer",b:1,borderRadius:1,userSelect:"none",disabled:{cursor:"default"}}},checkbox:{styles:{display:"inline-block"}},radioButton:{styles:{display:"inline-block",b:1,p:2}},textbox:{styles:{display:"inline-block",b:1,borderRadius:1,p:3}},textarea:{styles:{display:"inline-block",b:1,borderRadius:1}}};function s(u){const{components:m,...n}=u,d=m??{};Object.entries(n).forEach(([i,v])=>{d[i]=v}),G.components=w.mergeDeep(t,d)}e.setup=s})(M||(M={}));const he=M;var X;(e=>{function t(u){const m=Array.from(u.elements).reduce((n,d)=>{const i=d.name;return i&&(n[i]||(n[i]=[]),n[i].push(d)),n},{});return Object.entries(m).reduce((n,[d,i])=>{if(i.length===1){const v=i[0];s(n,d,v.type==="checkbox"||v.type==="radio"?v.checked:v.value)}else{const v=i.reduce((y,a)=>(a.type==="checkbox"||a.type==="radio"?a.checked&&y.push(a.value):y.push(a.value),y),[]);s(n,d,v)}return n},{})}e.getFormEntries=t;function s(u,m,n){if(m.includes(".")){const d=m.split(".");let i=u;d.forEach((v,y)=>{if(d.length>y+1){const a=v.match(/^(.+)\[(\d)\]$/);if(a){const[,f,p]=a;i[f]=i[f]||[],i[f][p]=i[f][p]||{},i=i[f][p]}else i[v]=i[v]||{},i=i[v]}else i[v]=n})}else u[m]=n}})(X||(X={}));const ye=X;function pe(){return C.useMemo(()=>{const e="crono-box";let t=document.getElementById(e);return t||(t=document.createElement("div"),t.id=e,document.body.appendChild(t)),t},[])}exports.BoxExtends=re;exports.FormUtils=ye;exports.ObjectUtils=w;exports.Theme=he;exports.classNames=te;exports.usePortalContainer=pe;exports.useStyles=fe;
package/core.mjs CHANGED
@@ -1,32 +1,32 @@
1
- import { useMemo as U, useLayoutEffect as le, useEffect as ne } from "react";
2
- function ie(...e) {
3
- return e.reduce((t, a) => a ? typeof a == "string" ? (t.push(a), t) : Array.isArray(a) ? (t.push(...ie(...a)), t) : (Object.entries(a).forEach(([u, m]) => {
1
+ import { useMemo as X, useLayoutEffect as oe, useEffect as ie } from "react";
2
+ function ue(...e) {
3
+ return e.reduce((t, s) => s ? typeof s == "string" ? (t.push(s), t) : Array.isArray(s) ? (t.push(...ue(...s)), t) : (Object.entries(s).forEach(([u, m]) => {
4
4
  m && t.push(u);
5
5
  }), t) : t, []);
6
6
  }
7
7
  var c;
8
8
  ((e) => {
9
9
  ((t) => {
10
- function a(m, n) {
10
+ function s(m, n) {
11
11
  return `${m}${n.replace("/", "-")}`;
12
12
  }
13
- t.fraction = a;
13
+ t.fraction = s;
14
14
  function u(m) {
15
15
  return [`${m} path`, `${m} circle`, `${m} rect`, `${m} line`];
16
16
  }
17
17
  t.svg = u;
18
18
  })(e.ClassName || (e.ClassName = {})), ((t) => {
19
- function a(h) {
19
+ function s(h) {
20
20
  return `${h / 4}rem`;
21
21
  }
22
- t.rem = a;
22
+ t.rem = s;
23
23
  function u(h) {
24
24
  return `${h}px`;
25
25
  }
26
26
  t.px = u;
27
27
  function m(h, r) {
28
- const [i, l] = r.split("/");
29
- return `${+i / +l * 100}%`;
28
+ const [o, l] = r.split("/");
29
+ return `${+o / +l * 100}%`;
30
30
  }
31
31
  t.fraction = m;
32
32
  function n(h, r) {
@@ -41,13 +41,13 @@ var c;
41
41
  }
42
42
  t.widthHeight = n;
43
43
  function d(h) {
44
- return (r, i) => `var(--${h}${i});`;
44
+ return (r, o) => `var(--${h}${o});`;
45
45
  }
46
46
  t.variables = d;
47
- function o(h) {
48
- return (r, i) => `var(--${h}${i});`;
47
+ function i(h) {
48
+ return (r, o) => `var(--${h}${o});`;
49
49
  }
50
- t.svgVariables = o;
50
+ t.svgVariables = i;
51
51
  function v(h, r) {
52
52
  return `repeat(${r},minmax(0,1fr))`;
53
53
  }
@@ -56,10 +56,10 @@ var c;
56
56
  return r === "full-row" ? "1/-1" : `span ${r}/span ${r}`;
57
57
  }
58
58
  t.gridColumn = y;
59
- function s(h, r) {
59
+ function a(h, r) {
60
60
  return `${r}ms`;
61
61
  }
62
- t.ms = s;
62
+ t.ms = a;
63
63
  function f(h, r) {
64
64
  return `${r}deg`;
65
65
  }
@@ -70,7 +70,7 @@ var c;
70
70
  t.flip = p;
71
71
  })(e.Value || (e.Value = {}));
72
72
  })(c || (c = {}));
73
- const S = {
73
+ const A = {
74
74
  /** The appearance CSS property is used to display UI elements with platform-specific styling, based on the operating system's theme. */
75
75
  appearance: [
76
76
  {
@@ -515,8 +515,8 @@ const S = {
515
515
  "11/12"
516
516
  ],
517
517
  valueFormat: (e) => {
518
- const [t, a] = e.split("/");
519
- return `${+t / +a * 100}%`;
518
+ const [t, s] = e.split("/");
519
+ return `${+t / +s * 100}%`;
520
520
  }
521
521
  },
522
522
  {
@@ -567,8 +567,8 @@ const S = {
567
567
  "11/12"
568
568
  ],
569
569
  valueFormat: (e) => {
570
- const [t, a] = e.split("/");
571
- return `${+t / +a * 100}%`;
570
+ const [t, s] = e.split("/");
571
+ return `${+t / +s * 100}%`;
572
572
  }
573
573
  },
574
574
  {
@@ -620,8 +620,8 @@ const S = {
620
620
  "11/12"
621
621
  ],
622
622
  valueFormat: (e) => {
623
- const [t, a] = e.split("/");
624
- return `${+t / +a * 100}%`;
623
+ const [t, s] = e.split("/");
624
+ return `${+t / +s * 100}%`;
625
625
  }
626
626
  },
627
627
  {
@@ -670,8 +670,8 @@ const S = {
670
670
  "11/12"
671
671
  ],
672
672
  valueFormat: (e) => {
673
- const [t, a] = e.split("/");
674
- return `${+t / +a * 100}%`;
673
+ const [t, s] = e.split("/");
674
+ return `${+t / +s * 100}%`;
675
675
  }
676
676
  },
677
677
  {
@@ -722,8 +722,8 @@ const S = {
722
722
  "11/12"
723
723
  ],
724
724
  valueFormat: (e) => {
725
- const [t, a] = e.split("/");
726
- return `${+t / +a * 100}%`;
725
+ const [t, s] = e.split("/");
726
+ return `${+t / +s * 100}%`;
727
727
  }
728
728
  },
729
729
  {
@@ -775,8 +775,8 @@ const S = {
775
775
  "11/12"
776
776
  ],
777
777
  valueFormat: (e) => {
778
- const [t, a] = e.split("/");
779
- return `${+t / +a * 100}%`;
778
+ const [t, s] = e.split("/");
779
+ return `${+t / +s * 100}%`;
780
780
  }
781
781
  },
782
782
  {
@@ -1191,7 +1191,7 @@ const S = {
1191
1191
  values: 0
1192
1192
  }
1193
1193
  ]
1194
- }, ee = {
1194
+ }, se = {
1195
1195
  hover: ":hover",
1196
1196
  focus: ":focus-within",
1197
1197
  hasFocus: ":has(:focus)",
@@ -1204,52 +1204,52 @@ const S = {
1204
1204
  hasChecked: ":has(:checked)",
1205
1205
  hasRequired: ":has(:required)",
1206
1206
  hasDisabled: ":has([disabled])"
1207
- }, C = {
1207
+ }, B = {
1208
1208
  indeterminate: ":indeterminate",
1209
1209
  checked: ":checked",
1210
1210
  required: ":required",
1211
1211
  disabled: "[disabled]"
1212
- }, M = { ...ee, ...C }, te = Object.entries(M).reduce(
1213
- (e, [t], a) => (e[t] = Math.pow(2, a), e),
1212
+ }, Y = { ...se, ...B }, ae = Object.entries(Y).reduce(
1213
+ (e, [t], s) => (e[t] = Math.pow(2, s), e),
1214
1214
  {}
1215
- ), D = Object.entries(M).reduce(
1215
+ ), q = Object.entries(Y).reduce(
1216
1216
  (e, [t]) => {
1217
- const a = te[t];
1217
+ const s = ae[t];
1218
1218
  return Object.entries(e).forEach(([u, m]) => {
1219
- e[+u + a] = [...m, t];
1219
+ e[+u + s] = [...m, t];
1220
1220
  }), e;
1221
1221
  },
1222
1222
  { 0: [] }
1223
- ), H = {
1223
+ ), K = {
1224
1224
  hoverGroup: "hover",
1225
1225
  focusGroup: "focus",
1226
1226
  activeGroup: "active"
1227
- }, A = {
1227
+ }, I = {
1228
1228
  sm: 640,
1229
1229
  md: 768,
1230
1230
  lg: 1024,
1231
1231
  xl: 1280,
1232
1232
  xxl: 1536
1233
1233
  };
1234
- var q;
1234
+ var L;
1235
1235
  ((e) => {
1236
- function t(n, d, o) {
1236
+ function t(n, d, i) {
1237
1237
  const v = { ...n }, y = v.props || {};
1238
- return d.forEach((s) => {
1239
- s in v && (y[s] = v[s], delete v[s]);
1240
- }), o && Object.entries(o).forEach(([s, f]) => {
1241
- y[s] = f;
1238
+ return d.forEach((a) => {
1239
+ a in v && (y[a] = v[a], delete v[a]);
1240
+ }), i && Object.entries(i).forEach(([a, f]) => {
1241
+ y[a] = f;
1242
1242
  }), v.props = y, v;
1243
1243
  }
1244
1244
  e.buildProps = t;
1245
- function a(n) {
1245
+ function s(n) {
1246
1246
  return !!n && typeof n == "object";
1247
1247
  }
1248
- e.isObject = a;
1248
+ e.isObject = s;
1249
1249
  function u(...n) {
1250
- return n.reduce((d, o) => (Object.keys(o).forEach((v) => {
1251
- const y = d[v], s = o[v];
1252
- v in C && typeof s == "boolean" || (v in C && Array.isArray(s) ? d[v] = u(y, s[1] ?? {}) : Array.isArray(y) && Array.isArray(s) ? d[v] = y.concat(...s) : a(y) && a(s) ? d[v] = u(y, s) : d[v] = s);
1250
+ return n.reduce((d, i) => (Object.keys(i).forEach((v) => {
1251
+ const y = d[v], a = i[v];
1252
+ v in B && typeof a == "boolean" || (v in B && Array.isArray(a) ? d[v] = u(y, a[1] ?? {}) : Array.isArray(y) && Array.isArray(a) ? d[v] = y.concat(...a) : s(y) && s(a) ? d[v] = u(y, a) : d[v] = a);
1253
1253
  }), d), {});
1254
1254
  }
1255
1255
  e.mergeDeep = u;
@@ -1257,9 +1257,9 @@ var q;
1257
1257
  return n in d;
1258
1258
  }
1259
1259
  e.isKeyOf = m;
1260
- })(q || (q = {}));
1261
- const N = q;
1262
- class oe {
1260
+ })(L || (L = {}));
1261
+ const $ = L;
1262
+ class me {
1263
1263
  constructor() {
1264
1264
  this._index = 0, this._cache = {};
1265
1265
  }
@@ -1267,77 +1267,77 @@ class oe {
1267
1267
  return this._cache[t] || (this._cache[t] = this.getByIndex(this._index++)), this._cache[t];
1268
1268
  }
1269
1269
  getByIndex(t) {
1270
- const { first: a, next: u } = ue, m = t - a.length;
1270
+ const { first: s, next: u } = ce, m = t - s.length;
1271
1271
  if (m < 0)
1272
- return a[t];
1272
+ return s[t];
1273
1273
  const n = Math.floor(m / u.length), d = m - n * u.length;
1274
1274
  return this.getByIndex(n) + u[d];
1275
1275
  }
1276
1276
  }
1277
- const ue = {
1277
+ const ce = {
1278
1278
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
1279
1279
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
1280
1280
  };
1281
- var K;
1281
+ var W;
1282
1282
  ((e) => {
1283
1283
  let t = "";
1284
- function a(m, n) {
1285
- return t = Object.entries(m).map(([d, o]) => `--${d}: ${o};`).join(""), Object.entries(n).forEach(([d, o]) => {
1286
- S[d] = o;
1284
+ function s(m, n) {
1285
+ return t = Object.entries(m).map(([d, i]) => `--${d}: ${i};`).join(""), Object.entries(n).forEach(([d, i]) => {
1286
+ A[d] = i;
1287
1287
  }), n;
1288
1288
  }
1289
- e.extend = a;
1289
+ e.extend = s;
1290
1290
  function u() {
1291
1291
  return t;
1292
1292
  }
1293
1293
  e.getVariables = u;
1294
- })(K || (K = {}));
1295
- const me = K;
1296
- var I;
1294
+ })(W || (W = {}));
1295
+ const de = W;
1296
+ var R;
1297
1297
  ((e) => {
1298
1298
  e.components = {};
1299
- })(I || (I = {}));
1300
- function ce(e) {
1301
- const { clean: t, theme: a, component: u } = e;
1302
- return U(() => {
1299
+ })(R || (R = {}));
1300
+ function ve(e) {
1301
+ const { clean: t, theme: s, component: u } = e;
1302
+ return X(() => {
1303
1303
  var n, d;
1304
1304
  if (t) return;
1305
- let m = (n = I.components) == null ? void 0 : n[u];
1305
+ let m = (n = R.components) == null ? void 0 : n[u];
1306
1306
  if (m)
1307
- return a ? N.mergeDeep(m.styles, ((d = m.themes) == null ? void 0 : d[a]) ?? {}) : m.styles;
1308
- }, [u, t, a]);
1307
+ return s ? $.mergeDeep(m.styles, ((d = m.themes) == null ? void 0 : d[s]) ?? {}) : m.styles;
1308
+ }, [u, t, s]);
1309
1309
  }
1310
- const de = new oe(), ve = typeof window < "u" && typeof window.document < "u";
1311
- var k;
1312
- const ae = typeof process == "object" && ((k = process.env) == null ? void 0 : k.NODE_ENV) === "test", fe = ve && !ae ? le : ne, se = "_b", O = "_s";
1313
- function ye(e, t) {
1314
- fe(j.flush, [e]);
1315
- const a = ce(e);
1316
- return U(() => {
1310
+ const fe = new me(), he = typeof window < "u" && typeof window.document < "u";
1311
+ var te;
1312
+ const re = typeof process == "object" && ((te = process.env) == null ? void 0 : te.NODE_ENV) === "test", ye = he && !re ? oe : ie, le = "_b", j = "_s";
1313
+ function ge(e, t) {
1314
+ ye(_.flush, [e]);
1315
+ const s = ve(e);
1316
+ return X(() => {
1317
1317
  var n;
1318
- const u = [t ? O : se];
1318
+ const u = [t ? j : le];
1319
1319
  (n = e.props) == null || n.name;
1320
- const m = a ? N.mergeDeep(a, e) : e;
1321
- return j.addClassNames(m, u, []), u;
1322
- }, [e, t, a]);
1320
+ const m = s ? $.mergeDeep(s, e) : e;
1321
+ return _.addClassNames(m, u, []), u;
1322
+ }, [e, t, s]);
1323
1323
  }
1324
- var j;
1324
+ var _;
1325
1325
  ((e) => {
1326
- let t = !0, a = {};
1327
- function u(s, f, p, h, r) {
1328
- Object.entries(s).forEach(([i, l]) => {
1329
- if (N.isKeyOf(i, S))
1330
- d(i, l, f, p, h, r);
1331
- else if (N.isKeyOf(i, ee))
1332
- u(l, f, [...p, i], h, r);
1333
- else if (N.isKeyOf(i, C)) {
1326
+ let t = !0, s = {};
1327
+ function u(a, f, p, h, r) {
1328
+ Object.entries(a).forEach(([o, l]) => {
1329
+ if ($.isKeyOf(o, A))
1330
+ d(o, l, f, p, h, r);
1331
+ else if ($.isKeyOf(o, se))
1332
+ u(l, f, [...p, o], h, r);
1333
+ else if ($.isKeyOf(o, B)) {
1334
1334
  if (Array.isArray(l)) {
1335
- const [g, b] = l;
1336
- u(b, f, [...p, i], h, r);
1335
+ const [b, x] = l;
1336
+ u(x, f, [...p, o], h, r);
1337
1337
  }
1338
- N.isObject(l) && u(l, f, [...p, i], h, r);
1339
- } else N.isKeyOf(i, A) ? u(l, f, p, i, r) : N.isKeyOf(i, H) && (typeof l == "string" ? f.push(`${H[i]}-${l}`) : Object.entries(l).forEach(([g, b]) => {
1340
- u(b, f, [...p, H[i]], h, g);
1338
+ $.isObject(l) && u(l, f, [...p, o], h, r);
1339
+ } else $.isKeyOf(o, I) ? u(l, f, p, o, r) : $.isKeyOf(o, K) && (typeof l == "string" ? f.push(`${K[o]}-${l}`) : Object.entries(l).forEach(([b, x]) => {
1340
+ u(x, f, [...p, K[o]], h, b);
1341
1341
  }));
1342
1342
  });
1343
1343
  }
@@ -1345,71 +1345,71 @@ var j;
1345
1345
  function m() {
1346
1346
  if (!t) return;
1347
1347
  console.debug("\x1B[36m%s\x1B[0m", "[react-box]: flush");
1348
- const s = Object.entries(S).reduce((i, [l], g) => (i[l] = g, i), {}), f = `:root{${me.getVariables()}--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;}#crono-box {position: absolute;top: 0;left: 0;height: 0;}
1348
+ const a = Object.entries(A).reduce((o, [l], b) => (o[l] = b, o), {}), f = `:root{${de.getVariables()}--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;}#crono-box {position: absolute;top: 0;left: 0;height: 0;}
1349
1349
  html{font-size: 16px;font-family: Arial, sans-serif;}
1350
1350
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
1351
1351
  a,ul{all: unset;}
1352
- .${se}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
1353
- .${O}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${O} path,.${O} circle,.${O} rect,.${O} line {transition: all var(--svgTransitionTime);}
1354
- `, p = Object.entries(a);
1352
+ .${le}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
1353
+ .${j}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${j} path,.${j} circle,.${j} rect,.${j} line {transition: all var(--svgTransitionTime);}
1354
+ `, p = Object.entries(s);
1355
1355
  p.sort(
1356
- ([i], [l]) => (A[i] ?? 0) - (A[l] ?? 0)
1356
+ ([o], [l]) => (I[o] ?? 0) - (I[l] ?? 0)
1357
1357
  );
1358
1358
  const h = p.reduce(
1359
- (i, [l, g]) => (l !== "normal" && i.push(`@media(min-width: ${A[l]}px){`), Object.entries(g).forEach(([b, B]) => {
1360
- const { __parents: X, ...re } = B, Y = Object.entries(re);
1361
- Y.sort(([w], [_]) => s[w] - s[_]), Y.forEach(([w, _]) => {
1362
- _.forEach((F) => {
1363
- var T;
1364
- const x = S[w].find((E) => Array.isArray(E.values) ? E.values.includes(F) : typeof F == typeof E.values);
1365
- if (!x) return;
1366
- const $ = o(w, F, +b, l), J = x.styleName ?? w, V = ((T = x.valueFormat) == null ? void 0 : T.call(x, F)) ?? F, R = D[+b];
1367
- i.push(`.${$}${R.map((E) => M[E]).join("")}{${J}:${V}}`);
1359
+ (o, [l, b]) => (l !== "normal" && o.push(`@media(min-width: ${I[l]}px){`), Object.entries(b).forEach(([x, G]) => {
1360
+ const { __parents: J, ...ne } = G, Q = Object.entries(ne);
1361
+ Q.sort(([w], [S]) => a[w] - a[S]), Q.forEach(([w, S]) => {
1362
+ S.forEach((F) => {
1363
+ var C, V;
1364
+ const g = A[w].find((z) => Array.isArray(z.values) ? z.values.includes(F) : typeof F == typeof z.values);
1365
+ if (!g) return;
1366
+ const E = i(w, F, +x, l), Z = g.styleName ?? w, N = ((C = g.valueFormat) == null ? void 0 : C.call(g, F)) ?? F, T = q[+x].map((z) => Y[z]).join(""), D = ((V = g.selector) == null ? void 0 : V.call(g, `.${E}`, T)) ?? `.${E}${T}`;
1367
+ o.push(`${D}{${Z}:${N}}`);
1368
1368
  });
1369
- }), X && Object.entries(X).forEach(([w, _]) => {
1370
- const F = Object.entries(_);
1371
- F.sort(([z], [x]) => s[z] - s[x]), F.forEach(([z, x]) => {
1372
- x.forEach(($) => {
1373
- var Z;
1374
- const V = S[z].find((G) => Array.isArray(G.values) ? G.values.includes($) : typeof $ == typeof G.values);
1375
- if (!V) return;
1376
- const R = o(z, $, +b, l, w), T = V.styleName ?? z, E = ((Z = V.valueFormat) == null ? void 0 : Z.call(V, $)) ?? $, [Q] = D[+b];
1377
- i.push(`.${Q}-${w}:${Q} .${R}{${T}:${E}}`);
1369
+ }), J && Object.entries(J).forEach(([w, S]) => {
1370
+ const F = Object.entries(S);
1371
+ F.sort(([O], [g]) => a[O] - a[g]), F.forEach(([O, g]) => {
1372
+ g.forEach((E) => {
1373
+ var P, k;
1374
+ const N = A[O].find((H) => Array.isArray(H.values) ? H.values.includes(E) : typeof E == typeof H.values);
1375
+ if (!N) return;
1376
+ const T = i(O, E, +x, l, w), D = N.styleName ?? O, C = ((P = N.valueFormat) == null ? void 0 : P.call(N, E)) ?? E, [V] = q[+x], z = ((k = N.selector) == null ? void 0 : k.call(N, `.${V}-${w}:${V} .${T}`, "")) ?? `.${V}-${w}:${V} .${T}`;
1377
+ o.push(`${z}{${D}:${C}}`);
1378
1378
  });
1379
1379
  });
1380
1380
  });
1381
- }), l !== "normal" && i.push("}"), i),
1381
+ }), l !== "normal" && o.push("}"), o),
1382
1382
  [f]
1383
1383
  ), r = y();
1384
1384
  r.innerHTML = h.join(""), t = !1;
1385
1385
  }
1386
1386
  e.flush = m;
1387
1387
  function n() {
1388
- a = {};
1388
+ s = {};
1389
1389
  }
1390
1390
  e.clear = n;
1391
- function d(s, f, p, h, r = "normal", i) {
1391
+ function d(a, f, p, h, r = "normal", o) {
1392
1392
  if (f == null) return;
1393
- const l = h.reduce((b, B) => b + te[B], 0);
1394
- a[r] ? a[r][l] ? a[r][l][s] || (a[r][l][s] = /* @__PURE__ */ new Set()) : a[r][l] = { [s]: /* @__PURE__ */ new Set() } : a[r] = { [l]: { [s]: /* @__PURE__ */ new Set() } }, i ? (a[r][l].__parents ? a[r][l].__parents[i] ? a[r][l].__parents[i][s] || (a[r][l].__parents[i][s] = /* @__PURE__ */ new Set()) : a[r][l].__parents[i] = { [s]: /* @__PURE__ */ new Set() } : a[r][l].__parents = { [i]: { [s]: /* @__PURE__ */ new Set() } }, a[r][l].__parents[i][s].has(f) || (a[r][l].__parents[i][s].add(f), t = !0)) : a[r][l][s].has(f) || (a[r][l][s].add(f), t = !0);
1395
- const g = o(s, f, l, r, i);
1396
- p.push(g);
1393
+ const l = h.reduce((x, G) => x + ae[G], 0);
1394
+ s[r] ? s[r][l] ? s[r][l][a] || (s[r][l][a] = /* @__PURE__ */ new Set()) : s[r][l] = { [a]: /* @__PURE__ */ new Set() } : s[r] = { [l]: { [a]: /* @__PURE__ */ new Set() } }, o ? (s[r][l].__parents ? s[r][l].__parents[o] ? s[r][l].__parents[o][a] || (s[r][l].__parents[o][a] = /* @__PURE__ */ new Set()) : s[r][l].__parents[o] = { [a]: /* @__PURE__ */ new Set() } : s[r][l].__parents = { [o]: { [a]: /* @__PURE__ */ new Set() } }, s[r][l].__parents[o][a].has(f) || (s[r][l].__parents[o][a].add(f), t = !0)) : s[r][l][a].has(f) || (s[r][l][a].add(f), t = !0);
1395
+ const b = i(a, f, l, r, o);
1396
+ p.push(b);
1397
1397
  }
1398
- function o(s, f, p, h, r) {
1399
- const i = D[p], l = `${h === "normal" ? "" : `${h}-`}${i.map((g) => `${g}-`).join("")}${r ? `${r}-` : ""}${s}-${f}`;
1400
- return ae ? l : de.getIdentity(l);
1398
+ function i(a, f, p, h, r) {
1399
+ const o = q[p], l = `${h === "normal" ? "" : `${h}-`}${o.map((b) => `${b}-`).join("")}${r ? `${r}-` : ""}${a}-${f}`;
1400
+ return re ? l : fe.getIdentity(l);
1401
1401
  }
1402
1402
  const v = "crono-styles";
1403
1403
  function y() {
1404
- let s = document.getElementById(v);
1405
- return s || (s = document.createElement("style"), s.setAttribute("id", v), s.setAttribute("type", "text/css"), document.head.insertBefore(s, document.head.firstChild)), s;
1404
+ let a = document.getElementById(v);
1405
+ return a || (a = document.createElement("style"), a.setAttribute("id", v), a.setAttribute("type", "text/css"), document.head.insertBefore(a, document.head.firstChild)), a;
1406
1406
  }
1407
- })(j || (j = {}));
1408
- var P;
1407
+ })(_ || (_ = {}));
1408
+ var ee;
1409
1409
  ((e) => {
1410
- e.flush = j.flush, e.clear = j.clear;
1411
- })(P || (P = {}));
1412
- var L;
1410
+ e.flush = _.flush, e.clear = _.clear;
1411
+ })(ee || (ee = {}));
1412
+ var U;
1413
1413
  ((e) => {
1414
1414
  const t = {
1415
1415
  button: {
@@ -1453,71 +1453,71 @@ var L;
1453
1453
  }
1454
1454
  }
1455
1455
  };
1456
- function a(u) {
1456
+ function s(u) {
1457
1457
  const { components: m, ...n } = u, d = m ?? {};
1458
- Object.entries(n).forEach(([o, v]) => {
1459
- d[o] = v;
1460
- }), I.components = N.mergeDeep(t, d);
1458
+ Object.entries(n).forEach(([i, v]) => {
1459
+ d[i] = v;
1460
+ }), R.components = $.mergeDeep(t, d);
1461
1461
  }
1462
- e.setup = a;
1463
- })(L || (L = {}));
1464
- const pe = L;
1465
- var W;
1462
+ e.setup = s;
1463
+ })(U || (U = {}));
1464
+ const be = U;
1465
+ var M;
1466
1466
  ((e) => {
1467
1467
  function t(u) {
1468
1468
  const m = Array.from(u.elements).reduce(
1469
1469
  (n, d) => {
1470
- const o = d.name;
1471
- return o && (n[o] || (n[o] = []), n[o].push(d)), n;
1470
+ const i = d.name;
1471
+ return i && (n[i] || (n[i] = []), n[i].push(d)), n;
1472
1472
  },
1473
1473
  {}
1474
1474
  );
1475
- return Object.entries(m).reduce((n, [d, o]) => {
1476
- if (o.length === 1) {
1477
- const v = o[0];
1478
- a(n, d, v.type === "checkbox" || v.type === "radio" ? v.checked : v.value);
1475
+ return Object.entries(m).reduce((n, [d, i]) => {
1476
+ if (i.length === 1) {
1477
+ const v = i[0];
1478
+ s(n, d, v.type === "checkbox" || v.type === "radio" ? v.checked : v.value);
1479
1479
  } else {
1480
- const v = o.reduce((y, s) => (s.type === "checkbox" || s.type === "radio" ? s.checked && y.push(s.value) : y.push(s.value), y), []);
1481
- a(n, d, v);
1480
+ const v = i.reduce((y, a) => (a.type === "checkbox" || a.type === "radio" ? a.checked && y.push(a.value) : y.push(a.value), y), []);
1481
+ s(n, d, v);
1482
1482
  }
1483
1483
  return n;
1484
1484
  }, {});
1485
1485
  }
1486
1486
  e.getFormEntries = t;
1487
- function a(u, m, n) {
1487
+ function s(u, m, n) {
1488
1488
  if (m.includes(".")) {
1489
1489
  const d = m.split(".");
1490
- let o = u;
1490
+ let i = u;
1491
1491
  d.forEach((v, y) => {
1492
1492
  if (d.length > y + 1) {
1493
- const s = v.match(/^(.+)\[(\d)\]$/);
1494
- if (s) {
1495
- const [, f, p] = s;
1496
- o[f] = o[f] || [], o[f][p] = o[f][p] || {}, o = o[f][p];
1493
+ const a = v.match(/^(.+)\[(\d)\]$/);
1494
+ if (a) {
1495
+ const [, f, p] = a;
1496
+ i[f] = i[f] || [], i[f][p] = i[f][p] || {}, i = i[f][p];
1497
1497
  } else
1498
- o[v] = o[v] || {}, o = o[v];
1498
+ i[v] = i[v] || {}, i = i[v];
1499
1499
  } else
1500
- o[v] = n;
1500
+ i[v] = n;
1501
1501
  });
1502
1502
  } else
1503
1503
  u[m] = n;
1504
1504
  }
1505
- })(W || (W = {}));
1506
- const ge = W;
1507
- function be() {
1508
- return U(() => {
1505
+ })(M || (M = {}));
1506
+ const xe = M;
1507
+ function Ne() {
1508
+ return X(() => {
1509
1509
  const e = "crono-box";
1510
1510
  let t = document.getElementById(e);
1511
1511
  return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
1512
1512
  }, []);
1513
1513
  }
1514
1514
  export {
1515
- me as B,
1516
- ge as F,
1517
- N as O,
1518
- P as S,
1519
- pe as T,
1520
- be as a,
1521
- ie as c,
1522
- ye as u
1515
+ de as B,
1516
+ xe as F,
1517
+ $ as O,
1518
+ ee as S,
1519
+ be as T,
1520
+ Ne as a,
1521
+ ue as c,
1522
+ ge as u
1523
1523
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.4",
4
4
  "type": "module",
5
5
  "main": "./box.cjs",
6
6
  "module": "./box.mjs",