@cronocode/react-box 1.8.2 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/textarea.d.ts +0 -1
- package/core/boxStyles.d.ts +1 -1
- package/core/types.d.ts +4 -2
- package/core.cjs +25 -25
- package/core.mjs +239 -228
- package/package.json +1 -1
package/components/textarea.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ interface Props extends Omit<BoxProps, 'props'> {
|
|
|
11
11
|
onInput?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
12
12
|
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
13
13
|
placeholder?: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
14
|
value?: string;
|
|
16
15
|
defaultValue?: string;
|
|
17
16
|
rows?: number;
|
package/core/boxStyles.d.ts
CHANGED
|
@@ -1215,7 +1215,7 @@ export declare const svgThemeStyles: {
|
|
|
1215
1215
|
formatSelector: typeof BoxStylesFormatters.ClassName.svg;
|
|
1216
1216
|
};
|
|
1217
1217
|
};
|
|
1218
|
-
export declare const pseudoClassSuffixes: readonly ["H", "F", "A"
|
|
1218
|
+
export declare const pseudoClassSuffixes: readonly ["H", "F", "A"];
|
|
1219
1219
|
export declare const pseudoClassSuffixesExtended: readonly ["H", "F", "A", "Checked", "Indeterminate", "Valid", "Invalid", "Required", "Optional", "Disabled"];
|
|
1220
1220
|
export type PseudoClassSuffix = (typeof pseudoClassSuffixes)[number];
|
|
1221
1221
|
export type PseudoClassSuffixExtended = (typeof pseudoClassSuffixesExtended)[number];
|
package/core/types.d.ts
CHANGED
|
@@ -23,9 +23,11 @@ interface BoxPseudoClasses {
|
|
|
23
23
|
interface BoxPseudoClasses2 {
|
|
24
24
|
disabled?: boolean | [boolean, BoxNormalStyles];
|
|
25
25
|
}
|
|
26
|
-
type BoxPseudoClassStyles = PseudoClass<BoxNormalStyles, 'H'> & PseudoClass<BoxNormalStyles, 'F'> & PseudoClass<BoxNormalStyles, 'A'
|
|
26
|
+
type BoxPseudoClassStyles = PseudoClass<BoxNormalStyles, 'H'> & PseudoClass<BoxNormalStyles, 'F'> & PseudoClass<BoxNormalStyles, 'A'>;
|
|
27
27
|
interface BoxThemePseudoClassProps {
|
|
28
28
|
disabled?: BoxNormalStyles;
|
|
29
|
+
indeterminate?: BoxNormalStyles;
|
|
30
|
+
checked?: BoxNormalStyles;
|
|
29
31
|
}
|
|
30
32
|
export type BoxThemeProps = BoxNormalStyles & BoxThemePseudoClassProps & BoxPseudoClassStyles;
|
|
31
33
|
export type BoxStyleProps = BoxNormalStyles & BoxPseudoClasses & BoxPseudoClasses2 & BoxPseudoClassStyles & ThemeComponentProps;
|
|
@@ -34,5 +36,5 @@ interface SvgNormalStyles {
|
|
|
34
36
|
flip?: BoxNormalStyles['flip'];
|
|
35
37
|
transitionDuration?: BoxNormalStyles['transitionDuration'];
|
|
36
38
|
}
|
|
37
|
-
export type BoxSvgStyles = SvgNormalStyles & PseudoClass<SvgNormalStyles, 'H'> & PseudoClass<SvgNormalStyles, 'F'> & PseudoClass<SvgNormalStyles, 'A'> &
|
|
39
|
+
export type BoxSvgStyles = SvgNormalStyles & PseudoClass<SvgNormalStyles, 'H'> & PseudoClass<SvgNormalStyles, 'F'> & PseudoClass<SvgNormalStyles, 'A'> & ThemeComponentProps & Augmented.SvgProps;
|
|
38
40
|
export {};
|
package/core.cjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";const I=require("react");var e;(u=>{(r=>{function m(a,b){return`${a}${b.replace("/","-")}`}r.fraction=m;function n(a){return[`${a} path`,`${a} circle`,`${a} rect`,`${a} line`]}r.svg=n})(u.ClassName||(u.ClassName={})),(r=>{function m(l,s){return`${s/4}rem`}r.rem=m;function n(l,s){return`${s}px`}r.px=n;function a(l,s){const[t,N]=s.split("/");return`${+t/+N*100}%`}r.fraction=a;function b(l,s){switch(s){case"fit":return"100%";case"fit-screen":return l.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return s}}r.widthHeight=b;function V(l){return(s,t)=>`var(--${l}${t});`}r.variables=V;function $(l){return(s,t)=>`var(--${l}${t});`}r.svgVariables=$;function v(l,s){return`repeat(${s},minmax(0,1fr))`}r.gridColumns=v;function d(l,s){return s==="full-row"?"1/-1":`span ${s}/span ${s}`}r.gridColumn=d;function c(l,s){return`${s}ms`}r.ms=c;function p(l,s){return`${s}deg`}r.rotate=p;function h(l,s){return s==="xAxis"?"-1 1":"1 -1"}r.flip=h})(u.Value||(u.Value={}))})(e||(e={}));const i=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,64,68,72,76,80,84,88,92,96,100,120,140,160,180,200,250,300],G=[-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-22,-24,-26,-28,-30,-32,-34,-36,-38,-40,-44,-48,-52,-56,-60,-64,-68,-72,-76,-80,-84,-88,-92,-96,-100],f=[...i,...G],R=["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"],A=["auto","hidden","scroll","visible"],C=["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"],j=["fit","fit-screen","auto","fit-content","max-content","min-content"],_=["auto","flex-start","flex-end","center","baseline","stretch"],w={display:{cssNames:["display"],values1:{values:["none","block","inline-block","flex","inline-flex","grid","inline-grid","contents"]},values2:{values:[]},values3:{values:[]}},inline:{cssNames:["display"],values1:{values:[!0]},values2:{values:[]},values3:{values:[]}},boxSizing:{cssNames:["box-sizing"],values1:{values:["border-box","content-box"]},values2:{values:[]},values3:{values:[]}},width:{cssNames:["width"],values1:{values:j,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:C,formatValue:e.Value.fraction}},minWidth:{cssNames:["min-width"],values1:{values:j,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:C,formatValue:e.Value.fraction}},maxWidth:{cssNames:["max-width"],values1:{values:j,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:C,formatValue:e.Value.fraction}},height:{cssNames:["height"],values1:{values:j,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:C,formatValue:e.Value.fraction}},minHeight:{cssNames:["min-height"],values1:{values:j,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:C,formatValue:e.Value.fraction}},maxHeight:{cssNames:["max-height"],values1:{values:j,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:C,formatValue:e.Value.fraction}},position:{cssNames:["position"],values1:{values:["static","relative","absolute","fixed","sticky"]},values2:{values:[]},values3:{values:[]}},top:{cssNames:["top"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},right:{cssNames:["right"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},bottom:{cssNames:["bottom"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},left:{cssNames:["left"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},inset:{cssNames:["inset"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},m:{cssNames:["margin"],values1:{values:f,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mx:{cssNames:["margin-inline"],values1:{values:f,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},my:{cssNames:["margin-block"],values1:{values:f,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mt:{cssNames:["margin-top"],values1:{values:f,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mr:{cssNames:["margin-right"],values1:{values:f,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mb:{cssNames:["margin-bottom"],values1:{values:f,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},ml:{cssNames:["margin-left"],values1:{values:f,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},p:{cssNames:["padding"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},px:{cssNames:["padding-inline"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},py:{cssNames:["padding-block"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pt:{cssNames:["padding-top"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pr:{cssNames:["padding-right"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pb:{cssNames:["padding-bottom"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pl:{cssNames:["padding-left"],values1:{values:f,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},b:{cssNames:["border-width"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bx:{cssNames:["border-inline-width"],values1:{values:f,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},by:{cssNames:["border-block-width"],values1:{values:f,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bt:{cssNames:["border-top-width"],values1:{values:f,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},br:{cssNames:["border-right-width"],values1:{values:f,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bb:{cssNames:["border-bottom-width"],values1:{values:f,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bl:{cssNames:["border-left-width"],values1:{values:f,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderStyle:{cssNames:["border-style"],values1:{values:R},values2:{values:[]},values3:{values:[]}},borderRadius:{cssNames:["border-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTop:{cssNames:["border-top-left-radius","border-top-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusRight:{cssNames:["border-top-right-radius","border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottom:{cssNames:["border-bottom-left-radius","border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusLeft:{cssNames:["border-top-left-radius","border-bottom-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopLeft:{cssNames:["border-top-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopRight:{cssNames:["border-top-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomLeft:{cssNames:["border-bottom-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomRight:{cssNames:["border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},cursor:{cssNames:["cursor"],values1:{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"]},values2:{values:[]},values3:{values:[]}},zIndex:{cssNames:["z-index"],values1:{values:[1,2,3,4,5,10,11,12,13,14,15,100,101,102,103,104,105,1e3,1001,1002,1003,1004,1005]},values2:{values:[]},values3:{values:[]}},overflow:{cssNames:["overflow"],values1:{values:A},values2:{values:[]},values3:{values:[]}},overflowX:{cssNames:["overflow-x"],values1:{values:A},values2:{values:[]},values3:{values:[]}},overflowY:{cssNames:["overflow-y"],values1:{values:A},values2:{values:[]},values3:{values:[]}},opacity:{cssNames:["opacity"],values1:{values:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]},values2:{values:[]},values3:{values:[]}},fontSize:{cssNames:["font-size"],values1:{values:i,formatValue:e.Value.px},values2:{values:["inherit"]},values3:{values:[]}},fontStyle:{cssNames:["font-style"],values1:{values:["italic","normal","oblique"]},values2:{values:[]},values3:{values:[]}},fontWeight:{cssNames:["font-weight"],values1:{values:[100,200,300,400,500,600,700,800,900]},values2:{values:[]},values3:{values:[]}},letterSpacing:{cssNames:["letter-spacing"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},lineHeight:{cssNames:["line-height"],values1:{values:i,formatValue:e.Value.px},values2:{values:["font-size"],formatValue:()=>"1"},values3:{values:[]}},textDecoration:{cssNames:["text-decoration"],values1:{values:["none","underline","overline","line-through"]},values2:{values:[]},values3:{values:[]}},textTransform:{cssNames:["text-transform"],values1:{values:["none","capitalize","lowercase","uppercase"]},values2:{values:[]},values3:{values:[]}},textAlign:{cssNames:["text-align"],values1:{values:["left","right","center","justify"]},values2:{values:[]},values3:{values:[]}},flexWrap:{cssNames:["flex-wrap"],values1:{values:["nowrap","wrap","wrap-reverse"]},values2:{values:[]},values3:{values:[]}},jc:{cssNames:["justify-content"],values1:{values:["start","end","flex-start","flex-end","center","left","right","space-between","space-around","space-evenly","stretch"]},values2:{values:[]},values3:{values:[]}},ai:{cssNames:["align-items"],values1:{values:["stretch","flex-start","flex-end","center","baseline","start","end","self-start","self-end"]},values2:{values:[]},values3:{values:[]}},alignContent:{cssNames:["align-content"],values1:{values:["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch","start","end","baseline"]},values2:{values:[]},values3:{values:[]}},flex1:{cssNames:["flex"],values1:{values:[!0],formatValue:()=>"1"},values2:{values:[]},values3:{values:[]}},d:{cssNames:["flex-direction"],values1:{values:["row","row-reverse","column","column-reverse"]},values2:{values:[]},values3:{values:[]}},gap:{cssNames:["gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},rowGap:{cssNames:["row-gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},columnGap:{cssNames:["column-gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},order:{cssNames:["order"],values1:{values:i},values2:{values:[]},values3:{values:[]}},flexGrow:{cssNames:["flex-grow"],values1:{values:i},values2:{values:[]},values3:{values:[]}},flexShrink:{cssNames:["flex-shrink"],values1:{values:i},values2:{values:[]},values3:{values:[]}},alignSelf:{cssNames:["align-self"],values1:{values:_},values2:{values:[]},values3:{values:[]}},justifySelf:{cssNames:["justify-self"],values1:{values:_},values2:{values:[]},values3:{values:[]}},gridColumns:{cssNames:["grid-template-columns"],values1:{values:i,formatValue:e.Value.gridColumns},values2:{values:[]},values3:{values:[]}},colSpan:{cssNames:["grid-column"],values1:{values:i,formatValue:e.Value.gridColumn},values2:{values:["full-row"],formatValue:e.Value.gridColumn},values3:{values:[]}},colStart:{cssNames:["grid-column-start"],values1:{values:i},values2:{values:[]},values3:{values:[]}},colEnd:{cssNames:["grid-column-end"],values1:{values:i},values2:{values:[]},values3:{values:[]}},outline:{cssNames:["outline-width"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},outlineStyle:{cssNames:["outline-style"],values1:{values:R},values2:{values:[]},values3:{values:[]}},outlineOffset:{cssNames:["outline-offset"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},transition:{cssNames:["transition-property"],values1:{values:["none","all"]},values2:{values:[]},values3:{values:[]}},transitionDuration:{cssNames:["transition-duration"],values1:{values:[50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1e3],formatValue:e.Value.ms},values2:{values:[]},values3:{values:[]}},userSelect:{cssNames:["user-select"],values1:{values:["none","auto","text","all"]},values2:{values:[]},values3:{values:[]}},appearance:{cssNames:["appearance"],values1:{values:["none"]},values2:{values:[]},values3:{values:[]}},pointerEvents:{cssNames:["pointer-events"],values1:{values:["none","auto","all"]},values2:{values:[]},values3:{values:[]}},whiteSpace:{cssNames:["white-space"],values1:{values:["break-spaces","normal","nowrap","pre","pre-line","pre-wrap"]},values2:{values:[]},values3:{values:[]}},textOverflow:{cssNames:["text-overflow"],values1:{values:["clip","ellipsis"]},values2:{values:[]},values3:{values:[]}},rotate:{cssNames:["rotate"],values1:{values:[0,90,180,270,-90,-180,-270],formatValue:e.Value.rotate},values2:{values:[]},values3:{values:[]}},flip:{cssNames:["scale"],values1:{values:["xAxis","yAxis"],formatValue:e.Value.flip},values2:{values:[]},values3:{values:[]}}},D={shadow:{cssNames:["box-shadow"],formatValue:e.Value.variables("shadow")},background:{cssNames:["background"],formatValue:e.Value.variables("background")},backgroundImage:{cssNames:["background-image"],formatValue:e.Value.variables("backgroundImage")},color:{cssNames:["color"],formatValue:e.Value.variables("color")},bgColor:{cssNames:["background-color"],formatValue:e.Value.variables("color")},borderColor:{cssNames:["border-color"],formatValue:e.Value.variables("color")},outlineColor:{cssNames:["outline-color"],formatValue:e.Value.variables("color")}},q={fill:{cssNames:["fill"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg},stroke:{cssNames:["stroke"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg}},U=["H","F","A","Checked","Indeterminate","Valid","Invalid","Required","Optional"],X=["H","F","A","Checked","Indeterminate","Valid","Invalid","Required","Optional","Disabled"],S={hover:{className:"_h"},focus:{className:"_f"}};Object.keys(D).forEach(u=>{w[u]=D[u],w[u].isThemeStyle=!0});Object.keys(q).forEach(u=>{w[u]=q[u],w[u].isThemeStyle=!0});const Y=Object.keys(w);X.forEach(u=>{Y.forEach(r=>{w[`${r}${u}`]={...w[r]},w[`${r}${u}`].pseudoSuffix=u})});class J{constructor(){this._index=0,this._cache={}}getIdentity(r){return this._cache[r]||(this._cache[r]=this.getByIndex(this._index++)),this._cache[r]}getByIndex(r){const{first:m,next:n}=Q,a=r-m.length;if(a<0)return m[r];const b=Math.floor(a/n.length),V=a-b*n.length;return this.getByIndex(b)+n[V]}}const Q={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var O;(u=>{u.boxClassName="_box",u.svgClassName="_svg",u.cronoStylesElementId="crono-styles";const r=`:root{--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 I=require("react");var e;(t=>{(r=>{function m(l,b){return`${l}${b.replace("/","-")}`}r.fraction=m;function v(l){return[`${l} path`,`${l} circle`,`${l} rect`,`${l} line`]}r.svg=v})(t.ClassName||(t.ClassName={})),(r=>{function m(s,a){return`${a/4}rem`}r.rem=m;function v(s,a){return`${a}px`}r.px=v;function l(s,a){const[u,p]=a.split("/");return`${+u/+p*100}%`}r.fraction=l;function b(s,a){switch(a){case"fit":return"100%";case"fit-screen":return s.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return a}}r.widthHeight=b;function N(s){return(a,u)=>`var(--${s}${u});`}r.variables=N;function x(s){return(a,u)=>`var(--${s}${u});`}r.svgVariables=x;function j(s,a){return`repeat(${a},minmax(0,1fr))`}r.gridColumns=j;function o(s,a){return a==="full-row"?"1/-1":`span ${a}/span ${a}`}r.gridColumn=o;function n(s,a){return`${a}ms`}r.ms=n;function g(s,a){return`${a}deg`}r.rotate=g;function f(s,a){return a==="xAxis"?"-1 1":"1 -1"}r.flip=f})(t.Value||(t.Value={}))})(e||(e={}));const i=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,64,68,72,76,80,84,88,92,96,100,120,140,160,180,200,250,300],G=[-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-22,-24,-26,-28,-30,-32,-34,-36,-38,-40,-44,-48,-52,-56,-60,-64,-68,-72,-76,-80,-84,-88,-92,-96,-100],d=[...i,...G],R=["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"],A=["auto","hidden","scroll","visible"],k=["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"],C=["fit","fit-screen","auto","fit-content","max-content","min-content"],_=["auto","flex-start","flex-end","center","baseline","stretch"],w={display:{cssNames:["display"],values1:{values:["none","block","inline-block","flex","inline-flex","grid","inline-grid","contents"]},values2:{values:[]},values3:{values:[]}},inline:{cssNames:["display"],values1:{values:[!0]},values2:{values:[]},values3:{values:[]}},boxSizing:{cssNames:["box-sizing"],values1:{values:["border-box","content-box"]},values2:{values:[]},values3:{values:[]}},width:{cssNames:["width"],values1:{values:C,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:k,formatValue:e.Value.fraction}},minWidth:{cssNames:["min-width"],values1:{values:C,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:k,formatValue:e.Value.fraction}},maxWidth:{cssNames:["max-width"],values1:{values:C,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:k,formatValue:e.Value.fraction}},height:{cssNames:["height"],values1:{values:C,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:k,formatValue:e.Value.fraction}},minHeight:{cssNames:["min-height"],values1:{values:C,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:k,formatValue:e.Value.fraction}},maxHeight:{cssNames:["max-height"],values1:{values:C,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:k,formatValue:e.Value.fraction}},position:{cssNames:["position"],values1:{values:["static","relative","absolute","fixed","sticky"]},values2:{values:[]},values3:{values:[]}},top:{cssNames:["top"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},right:{cssNames:["right"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},bottom:{cssNames:["bottom"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},left:{cssNames:["left"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},inset:{cssNames:["inset"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},m:{cssNames:["margin"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mx:{cssNames:["margin-inline"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},my:{cssNames:["margin-block"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mt:{cssNames:["margin-top"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mr:{cssNames:["margin-right"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mb:{cssNames:["margin-bottom"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},ml:{cssNames:["margin-left"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},p:{cssNames:["padding"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},px:{cssNames:["padding-inline"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},py:{cssNames:["padding-block"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pt:{cssNames:["padding-top"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pr:{cssNames:["padding-right"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pb:{cssNames:["padding-bottom"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pl:{cssNames:["padding-left"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},b:{cssNames:["border-width"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bx:{cssNames:["border-inline-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},by:{cssNames:["border-block-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bt:{cssNames:["border-top-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},br:{cssNames:["border-right-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bb:{cssNames:["border-bottom-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bl:{cssNames:["border-left-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderStyle:{cssNames:["border-style"],values1:{values:R},values2:{values:[]},values3:{values:[]}},borderRadius:{cssNames:["border-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTop:{cssNames:["border-top-left-radius","border-top-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusRight:{cssNames:["border-top-right-radius","border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottom:{cssNames:["border-bottom-left-radius","border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusLeft:{cssNames:["border-top-left-radius","border-bottom-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopLeft:{cssNames:["border-top-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopRight:{cssNames:["border-top-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomLeft:{cssNames:["border-bottom-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomRight:{cssNames:["border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},cursor:{cssNames:["cursor"],values1:{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"]},values2:{values:[]},values3:{values:[]}},zIndex:{cssNames:["z-index"],values1:{values:[1,2,3,4,5,10,11,12,13,14,15,100,101,102,103,104,105,1e3,1001,1002,1003,1004,1005]},values2:{values:[]},values3:{values:[]}},overflow:{cssNames:["overflow"],values1:{values:A},values2:{values:[]},values3:{values:[]}},overflowX:{cssNames:["overflow-x"],values1:{values:A},values2:{values:[]},values3:{values:[]}},overflowY:{cssNames:["overflow-y"],values1:{values:A},values2:{values:[]},values3:{values:[]}},opacity:{cssNames:["opacity"],values1:{values:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]},values2:{values:[]},values3:{values:[]}},fontSize:{cssNames:["font-size"],values1:{values:i,formatValue:e.Value.px},values2:{values:["inherit"]},values3:{values:[]}},fontStyle:{cssNames:["font-style"],values1:{values:["italic","normal","oblique"]},values2:{values:[]},values3:{values:[]}},fontWeight:{cssNames:["font-weight"],values1:{values:[100,200,300,400,500,600,700,800,900]},values2:{values:[]},values3:{values:[]}},letterSpacing:{cssNames:["letter-spacing"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},lineHeight:{cssNames:["line-height"],values1:{values:i,formatValue:e.Value.px},values2:{values:["font-size"],formatValue:()=>"1"},values3:{values:[]}},textDecoration:{cssNames:["text-decoration"],values1:{values:["none","underline","overline","line-through"]},values2:{values:[]},values3:{values:[]}},textTransform:{cssNames:["text-transform"],values1:{values:["none","capitalize","lowercase","uppercase"]},values2:{values:[]},values3:{values:[]}},textAlign:{cssNames:["text-align"],values1:{values:["left","right","center","justify"]},values2:{values:[]},values3:{values:[]}},flexWrap:{cssNames:["flex-wrap"],values1:{values:["nowrap","wrap","wrap-reverse"]},values2:{values:[]},values3:{values:[]}},jc:{cssNames:["justify-content"],values1:{values:["start","end","flex-start","flex-end","center","left","right","space-between","space-around","space-evenly","stretch"]},values2:{values:[]},values3:{values:[]}},ai:{cssNames:["align-items"],values1:{values:["stretch","flex-start","flex-end","center","baseline","start","end","self-start","self-end"]},values2:{values:[]},values3:{values:[]}},alignContent:{cssNames:["align-content"],values1:{values:["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch","start","end","baseline"]},values2:{values:[]},values3:{values:[]}},flex1:{cssNames:["flex"],values1:{values:[!0],formatValue:()=>"1"},values2:{values:[]},values3:{values:[]}},d:{cssNames:["flex-direction"],values1:{values:["row","row-reverse","column","column-reverse"]},values2:{values:[]},values3:{values:[]}},gap:{cssNames:["gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},rowGap:{cssNames:["row-gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},columnGap:{cssNames:["column-gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},order:{cssNames:["order"],values1:{values:i},values2:{values:[]},values3:{values:[]}},flexGrow:{cssNames:["flex-grow"],values1:{values:i},values2:{values:[]},values3:{values:[]}},flexShrink:{cssNames:["flex-shrink"],values1:{values:i},values2:{values:[]},values3:{values:[]}},alignSelf:{cssNames:["align-self"],values1:{values:_},values2:{values:[]},values3:{values:[]}},justifySelf:{cssNames:["justify-self"],values1:{values:_},values2:{values:[]},values3:{values:[]}},gridColumns:{cssNames:["grid-template-columns"],values1:{values:i,formatValue:e.Value.gridColumns},values2:{values:[]},values3:{values:[]}},colSpan:{cssNames:["grid-column"],values1:{values:i,formatValue:e.Value.gridColumn},values2:{values:["full-row"],formatValue:e.Value.gridColumn},values3:{values:[]}},colStart:{cssNames:["grid-column-start"],values1:{values:i},values2:{values:[]},values3:{values:[]}},colEnd:{cssNames:["grid-column-end"],values1:{values:i},values2:{values:[]},values3:{values:[]}},outline:{cssNames:["outline-width"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},outlineStyle:{cssNames:["outline-style"],values1:{values:R},values2:{values:[]},values3:{values:[]}},outlineOffset:{cssNames:["outline-offset"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},transition:{cssNames:["transition-property"],values1:{values:["none","all"]},values2:{values:[]},values3:{values:[]}},transitionDuration:{cssNames:["transition-duration"],values1:{values:[50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1e3],formatValue:e.Value.ms},values2:{values:[]},values3:{values:[]}},userSelect:{cssNames:["user-select"],values1:{values:["none","auto","text","all"]},values2:{values:[]},values3:{values:[]}},appearance:{cssNames:["appearance"],values1:{values:["none"]},values2:{values:[]},values3:{values:[]}},pointerEvents:{cssNames:["pointer-events"],values1:{values:["none","auto","all"]},values2:{values:[]},values3:{values:[]}},whiteSpace:{cssNames:["white-space"],values1:{values:["break-spaces","normal","nowrap","pre","pre-line","pre-wrap"]},values2:{values:[]},values3:{values:[]}},textOverflow:{cssNames:["text-overflow"],values1:{values:["clip","ellipsis"]},values2:{values:[]},values3:{values:[]}},rotate:{cssNames:["rotate"],values1:{values:[0,90,180,270,-90,-180,-270],formatValue:e.Value.rotate},values2:{values:[]},values3:{values:[]}},flip:{cssNames:["scale"],values1:{values:["xAxis","yAxis"],formatValue:e.Value.flip},values2:{values:[]},values3:{values:[]}}},D={shadow:{cssNames:["box-shadow"],formatValue:e.Value.variables("shadow")},background:{cssNames:["background"],formatValue:e.Value.variables("background")},backgroundImage:{cssNames:["background-image"],formatValue:e.Value.variables("backgroundImage")},color:{cssNames:["color"],formatValue:e.Value.variables("color")},bgColor:{cssNames:["background-color"],formatValue:e.Value.variables("color")},borderColor:{cssNames:["border-color"],formatValue:e.Value.variables("color")},outlineColor:{cssNames:["outline-color"],formatValue:e.Value.variables("color")}},P={fill:{cssNames:["fill"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg},stroke:{cssNames:["stroke"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg}},U=["H","F","A"],X=["H","F","A","Checked","Indeterminate","Valid","Invalid","Required","Optional","Disabled"],S={hover:{className:"_h"},focus:{className:"_f"}};Object.keys(D).forEach(t=>{w[t]=D[t],w[t].isThemeStyle=!0});Object.keys(P).forEach(t=>{w[t]=P[t],w[t].isThemeStyle=!0});const Y=Object.keys(w);X.forEach(t=>{Y.forEach(r=>{w[`${r}${t}`]={...w[r],pseudoSuffix:t}})});class J{constructor(){this._index=0,this._cache={}}getIdentity(r){return this._cache[r]||(this._cache[r]=this.getByIndex(this._index++)),this._cache[r]}getByIndex(r){const{first:m,next:v}=Q,l=r-m.length;if(l<0)return m[r];const b=Math.floor(l/v.length),N=l-b*v.length;return this.getByIndex(b)+v[N]}}const Q={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var O;(t=>{t.boxClassName="_box",t.svgClassName="_svg",t.cronoStylesElementId="crono-styles";const r=`:root{--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
|
-
.${
|
|
6
|
-
.${
|
|
7
|
-
`,m=new J,
|
|
8
|
-
`),
|
|
9
|
-
`),
|
|
10
|
-
`),
|
|
11
|
-
`),
|
|
5
|
+
.${t.boxClassName}{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
|
+
.${t.svgClassName}{transition: all var(--svgTransitionTime);}.${t.svgClassName} path,.${t.svgClassName} circle,.${t.svgClassName} rect,.${t.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
7
|
+
`,m=new J,v=Object.keys(w);let l=!0,b=v.reduce((s,a)=>(s[a]=new Set,s),{});function N(s,a){if(s in w)return o(s,a);if(s in S)return S[s].className}t.get=N;function x(){if(l){let s=n([r]);s=n(s,"H"),s=n(s,"F"),s=n(s,"A"),s=n(s,"Checked"),s=n(s,"Indeterminate"),s=n(s,"Valid"),s=n(s,"Invalid"),s=n(s,"Required"),s=n(s,"Disabled");const a=f();a.innerHTML=s.join(""),l=!1}}t.flush=x;function j(){b=v.reduce((s,a)=>(s[a]=new Set,s),{})}t.clear=j;function o(s,a){var y;b[s].has(a)||(l=!0,b[s].add(a));const u=g(s,a),p=((y=u.formatClassName)==null?void 0:y.call(u,s,a))??`${s}${a}`;return m.getIdentity(p)}function n(s,a){return Object.entries(b).filter(([p])=>{var y;return((y=w[p])==null?void 0:y.pseudoSuffix)===a}).reduce((p,[y,H])=>(H.forEach($=>{var F;const V=g(y,$),c=`.${o(y,$)}`;let h=[];a?a==="H"?h=[...u(`${c}:hover`,V),...u(`.${S.hover.className}:hover>${c}`,V)]:a==="F"?h=[...u(`${c}:focus-within`,V),...u(`.${S.focus.className}:focus-within>${c}`,V)]:a==="A"?h=u(`${c}:active`,V):a==="Checked"?h=u(`${c}:checked`,V):a==="Indeterminate"?h=u(`${c}:indeterminate`,V):a==="Valid"?h=u(`${c}:valid`,V):a==="Invalid"?h=u(`${c}:invalid`,V):a==="Required"?h=u(`${c}:required`,V):a==="Optional"?h=u(`${c}:optional`,V):a==="Disabled"&&(h=u(`${c}:disabled`,V)):h=u(c,V);const L=((F=V.formatValue)==null?void 0:F.call(V,y,$))??$,M=w[y].cssNames.map(W=>`${W}:${L};`).join("");p.push(`${h.join(",")}{${M}}`)}),p),s);function u(p,y){return y.formatSelector?y.formatSelector(p):[p]}}function g(s,a){const u=w[s];return u.isThemeStyle?u:u.values1.values.includes(a)?u.values1:u.values2.values.includes(a)?u.values2:u.values3}function f(){const a=typeof window<"u"&&typeof window.document<"u"?window.document:global.document;let u=a.getElementById(t.cronoStylesElementId);return u||(u=a.createElement("style"),u.setAttribute("id",t.cronoStylesElementId),u.setAttribute("type","text/css"),a.head.insertBefore(u,a.head.firstChild)),u}})(O||(O={}));const T=O,z={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}}};var E;(t=>{t.Styles=b(z);function r(o){t.Styles=l(o)}t.setup=r;function m(o,n){const g=Object.entries(o.colors).map(([c,h])=>`--color${c}: ${h};`).join(`
|
|
8
|
+
`),f=Object.entries(o.shadows).map(([c,h])=>`--shadow${c}: ${h};`).join(`
|
|
9
|
+
`),s=Object.entries(o.backgrounds).map(([c,h])=>`--background${c}: ${h};`).join(`
|
|
10
|
+
`),a=Object.entries(o.backgroundImages).map(([c,h])=>`--backgroundImage${c}: ${h};`).join(`
|
|
11
|
+
`),u=[":root {"];g&&u.push(` ${g}`),f&&u.push(` ${f}`),s&&u.push(` ${s}`),a&&u.push(` ${a}`),u.push("}");const p=Object.keys(o.colors).map(c=>`'${c}'`).join(" | "),y=Object.keys(o.backgrounds).map(c=>`'${c}'`).join(" | "),H=Object.keys(o.backgroundImages).map(c=>`'${c}'`).join(" | "),$=Object.keys(o.shadows).map(c=>`'${c}'`).join(" | "),V=`import '@cronocode/react-box';
|
|
12
12
|
|
|
13
|
-
declare module '${(
|
|
14
|
-
type ColorType = ${
|
|
15
|
-
type BackgroundType = ${
|
|
16
|
-
type BackgroundImageType = ${
|
|
17
|
-
type ShadowType = ${
|
|
13
|
+
declare module '${(n==null?void 0:n.namespacePath)??"@cronocode/react-box/core/types"}' {
|
|
14
|
+
type ColorType = ${p};
|
|
15
|
+
type BackgroundType = ${y};
|
|
16
|
+
type BackgroundImageType = ${H};
|
|
17
|
+
type ShadowType = ${$};
|
|
18
18
|
|
|
19
19
|
namespace Augmented {
|
|
20
20
|
interface BoxProps {
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
21
|
+
${v("color","ColorType")}
|
|
22
|
+
${v("bgColor","ColorType")}
|
|
23
|
+
${v("borderColor","ColorType")}
|
|
24
|
+
${v("outlineColor","ColorType")}
|
|
25
|
+
${v("background","BackgroundType")}
|
|
26
|
+
${v("backgroundImage","BackgroundImageType")}
|
|
27
|
+
${v("shadow","ShadowType")}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
interface SvgProps {
|
|
31
|
-
${
|
|
32
|
-
${
|
|
31
|
+
${v("fill","ColorType")}
|
|
32
|
+
${v("stroke","ColorType")}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
`;return{variables:
|
|
37
|
-
`),boxDts:
|
|
38
|
-
`)}function
|
|
36
|
+
`;return{variables:u.join(`
|
|
37
|
+
`),boxDts:V}}t.setupAugmentedProps=m;function v(o,n){const g=U.map(f=>` ${o}${f}?: ${n};`);return g.unshift(` ${o}?: ${n};`),g.join(`
|
|
38
|
+
`)}function l(o){const n=b(o);return Object.keys(z).forEach(f=>{const s=n[f],a=z[f];s?s.styles={...a.styles,...s.styles}:n[f]=z[f]}),n}function b(o){return N(o),j(o),o}function N(o){if(!o.components)return;const n=Object.keys(o.components);for(const g of n){const f=o.components[g],s=x(g,f);delete f.children;for(const a of s){const[u,p]=a;o.components[u]=p}}}function x(o,n){if(!n.children)return[];const g=Object.keys(n.children),f=[];for(const s of g){const a=`${o}.${s}`,u=n.children[s],p=x(a,u);f.push(...p),delete u.children,f.push([a,u])}return f}function j(o){const{components:n,...g}=o,f=Object.values(g);n&&f.push(...Object.values(n));for(const s of f)[["disabled","Disabled"],["indeterminate","Indeterminate"],["checked","Checked"]].forEach(([a,u])=>{a in s.styles&&(Object.entries(s.styles[a]).map(([p,y])=>{s.styles[`${p}${u}`]=y}),delete s.styles[a])})}})(E||(E={}));const B=E;function Z(t){const{clean:r,theme:m,component:v}=t;return I.useMemo(()=>{var b,N;if(r)return;let l=B.Styles[v]??((b=B.Styles.components)==null?void 0:b[v]);if(l)return m?{...l.styles,...(N=l.themes)==null?void 0:N[m].styles}:l.styles},[v,r,m])}const K=typeof window<"u"&&typeof window.document<"u",ee=K?I.useLayoutEffect:I.useEffect;function se(t,r){const m=Z(t);return ee(T.flush,[t]),I.useMemo(()=>{const v=[r?T.svgClassName:T.boxClassName],l=m?{...m,...t}:{...t};return Array.isArray(l.disabled)&&(Object.entries(l.disabled[1]).forEach(([b,N])=>{l[`${b}Disabled`]=N}),delete l.disabled),"inline"in l&&(l.display==="block"||!l.display?l.display="inline-block":l.display==="flex"?l.display="inline-flex":l.display==="grid"&&(l.display="inline-grid"),delete l.inline),"inlineH"in l&&(l.displayH==="block"||!l.displayH?l.displayH="inline-block":l.displayH==="flex"?l.displayH="inline-flex":l.displayH==="grid"&&(l.displayH="inline-grid"),delete l.inlineH),"inlineF"in l&&(l.displayF==="block"||!l.displayF?l.displayF="inline-block":l.displayF==="flex"?l.displayF="inline-flex":l.displayF==="grid"&&(l.displayF="inline-grid"),delete l.inlineF),"inlineA"in l&&(l.displayA==="block"||!l.displayA?l.displayA="inline-block":l.displayA==="flex"?l.displayA="inline-flex":l.displayA==="grid"&&(l.displayA="inline-grid"),delete l.inlineA),Object.entries(l).forEach(([b,N])=>{v.push(T.get(b,N))}),v},[t,m])}function q(...t){return t.reduce((r,m)=>m?typeof m=="string"?(r.push(m),r):Array.isArray(m)?(r.push(...q(...m)),r):(Object.entries(m).forEach(([v,l])=>{l&&r.push(v)}),r):r,[])}exports.StylesContext=T;exports.Theme=B;exports.classNames=q;exports.useStyles=se;
|
package/core.mjs
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import { useMemo as P, useLayoutEffect as G, useEffect as M } from "react";
|
|
2
2
|
var e;
|
|
3
|
-
((
|
|
3
|
+
((t) => {
|
|
4
4
|
((r) => {
|
|
5
|
-
function m(
|
|
6
|
-
return `${
|
|
5
|
+
function m(l, b) {
|
|
6
|
+
return `${l}${b.replace("/", "-")}`;
|
|
7
7
|
}
|
|
8
8
|
r.fraction = m;
|
|
9
|
-
function
|
|
10
|
-
return [`${
|
|
9
|
+
function v(l) {
|
|
10
|
+
return [`${l} path`, `${l} circle`, `${l} rect`, `${l} line`];
|
|
11
11
|
}
|
|
12
|
-
r.svg =
|
|
13
|
-
})(
|
|
14
|
-
function m(
|
|
15
|
-
return `${
|
|
12
|
+
r.svg = v;
|
|
13
|
+
})(t.ClassName || (t.ClassName = {})), ((r) => {
|
|
14
|
+
function m(s, a) {
|
|
15
|
+
return `${a / 4}rem`;
|
|
16
16
|
}
|
|
17
17
|
r.rem = m;
|
|
18
|
-
function
|
|
19
|
-
return `${
|
|
18
|
+
function v(s, a) {
|
|
19
|
+
return `${a}px`;
|
|
20
20
|
}
|
|
21
|
-
r.px =
|
|
22
|
-
function
|
|
23
|
-
const [
|
|
24
|
-
return `${+
|
|
21
|
+
r.px = v;
|
|
22
|
+
function l(s, a) {
|
|
23
|
+
const [u, p] = a.split("/");
|
|
24
|
+
return `${+u / +p * 100}%`;
|
|
25
25
|
}
|
|
26
|
-
r.fraction =
|
|
27
|
-
function b(
|
|
28
|
-
switch (
|
|
26
|
+
r.fraction = l;
|
|
27
|
+
function b(s, a) {
|
|
28
|
+
switch (a) {
|
|
29
29
|
case "fit":
|
|
30
30
|
return "100%";
|
|
31
31
|
case "fit-screen":
|
|
32
|
-
return
|
|
32
|
+
return s.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
|
|
33
33
|
default:
|
|
34
|
-
return
|
|
34
|
+
return a;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
r.widthHeight = b;
|
|
38
|
-
function
|
|
39
|
-
return (
|
|
38
|
+
function N(s) {
|
|
39
|
+
return (a, u) => `var(--${s}${u});`;
|
|
40
40
|
}
|
|
41
|
-
r.variables =
|
|
42
|
-
function
|
|
43
|
-
return (
|
|
41
|
+
r.variables = N;
|
|
42
|
+
function x(s) {
|
|
43
|
+
return (a, u) => `var(--${s}${u});`;
|
|
44
44
|
}
|
|
45
|
-
r.svgVariables =
|
|
46
|
-
function
|
|
47
|
-
return `repeat(${
|
|
45
|
+
r.svgVariables = x;
|
|
46
|
+
function j(s, a) {
|
|
47
|
+
return `repeat(${a},minmax(0,1fr))`;
|
|
48
48
|
}
|
|
49
|
-
r.gridColumns =
|
|
50
|
-
function
|
|
51
|
-
return
|
|
49
|
+
r.gridColumns = j;
|
|
50
|
+
function o(s, a) {
|
|
51
|
+
return a === "full-row" ? "1/-1" : `span ${a}/span ${a}`;
|
|
52
52
|
}
|
|
53
|
-
r.gridColumn =
|
|
54
|
-
function
|
|
55
|
-
return `${
|
|
53
|
+
r.gridColumn = o;
|
|
54
|
+
function n(s, a) {
|
|
55
|
+
return `${a}ms`;
|
|
56
56
|
}
|
|
57
|
-
r.ms =
|
|
58
|
-
function
|
|
59
|
-
return `${
|
|
57
|
+
r.ms = n;
|
|
58
|
+
function g(s, a) {
|
|
59
|
+
return `${a}deg`;
|
|
60
60
|
}
|
|
61
|
-
r.rotate =
|
|
62
|
-
function
|
|
63
|
-
return
|
|
61
|
+
r.rotate = g;
|
|
62
|
+
function f(s, a) {
|
|
63
|
+
return a === "xAxis" ? "-1 1" : "1 -1";
|
|
64
64
|
}
|
|
65
|
-
r.flip =
|
|
66
|
-
})(
|
|
65
|
+
r.flip = f;
|
|
66
|
+
})(t.Value || (t.Value = {}));
|
|
67
67
|
})(e || (e = {}));
|
|
68
68
|
const i = [
|
|
69
69
|
0,
|
|
@@ -170,7 +170,7 @@ const i = [
|
|
|
170
170
|
-92,
|
|
171
171
|
-96,
|
|
172
172
|
-100
|
|
173
|
-
],
|
|
173
|
+
], d = [...i, ...U], B = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], H = ["auto", "hidden", "scroll", "visible"], k = [
|
|
174
174
|
"1/2",
|
|
175
175
|
"1/3",
|
|
176
176
|
"2/3",
|
|
@@ -197,7 +197,7 @@ const i = [
|
|
|
197
197
|
"9/12",
|
|
198
198
|
"10/12",
|
|
199
199
|
"11/12"
|
|
200
|
-
],
|
|
200
|
+
], C = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], F = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], w = {
|
|
201
201
|
/** The `display` CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. */
|
|
202
202
|
display: {
|
|
203
203
|
cssNames: ["display"],
|
|
@@ -221,60 +221,60 @@ const i = [
|
|
|
221
221
|
},
|
|
222
222
|
width: {
|
|
223
223
|
cssNames: ["width"],
|
|
224
|
-
values1: { values:
|
|
224
|
+
values1: { values: C, formatValue: e.Value.widthHeight },
|
|
225
225
|
values2: { values: i, formatValue: e.Value.rem },
|
|
226
226
|
values3: {
|
|
227
|
-
values:
|
|
227
|
+
values: k,
|
|
228
228
|
formatValue: e.Value.fraction
|
|
229
229
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
230
230
|
}
|
|
231
231
|
},
|
|
232
232
|
minWidth: {
|
|
233
233
|
cssNames: ["min-width"],
|
|
234
|
-
values1: { values:
|
|
234
|
+
values1: { values: C, formatValue: e.Value.widthHeight },
|
|
235
235
|
values2: { values: i, formatValue: e.Value.rem },
|
|
236
236
|
values3: {
|
|
237
|
-
values:
|
|
237
|
+
values: k,
|
|
238
238
|
formatValue: e.Value.fraction
|
|
239
239
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
242
|
maxWidth: {
|
|
243
243
|
cssNames: ["max-width"],
|
|
244
|
-
values1: { values:
|
|
244
|
+
values1: { values: C, formatValue: e.Value.widthHeight },
|
|
245
245
|
values2: { values: i, formatValue: e.Value.rem },
|
|
246
246
|
values3: {
|
|
247
|
-
values:
|
|
247
|
+
values: k,
|
|
248
248
|
formatValue: e.Value.fraction
|
|
249
249
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
250
250
|
}
|
|
251
251
|
},
|
|
252
252
|
height: {
|
|
253
253
|
cssNames: ["height"],
|
|
254
|
-
values1: { values:
|
|
254
|
+
values1: { values: C, formatValue: e.Value.widthHeight },
|
|
255
255
|
values2: { values: i, formatValue: e.Value.rem },
|
|
256
256
|
values3: {
|
|
257
|
-
values:
|
|
257
|
+
values: k,
|
|
258
258
|
formatValue: e.Value.fraction
|
|
259
259
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
260
260
|
}
|
|
261
261
|
},
|
|
262
262
|
minHeight: {
|
|
263
263
|
cssNames: ["min-height"],
|
|
264
|
-
values1: { values:
|
|
264
|
+
values1: { values: C, formatValue: e.Value.widthHeight },
|
|
265
265
|
values2: { values: i, formatValue: e.Value.rem },
|
|
266
266
|
values3: {
|
|
267
|
-
values:
|
|
267
|
+
values: k,
|
|
268
268
|
formatValue: e.Value.fraction
|
|
269
269
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
270
270
|
}
|
|
271
271
|
},
|
|
272
272
|
maxHeight: {
|
|
273
273
|
cssNames: ["max-height"],
|
|
274
|
-
values1: { values:
|
|
274
|
+
values1: { values: C, formatValue: e.Value.widthHeight },
|
|
275
275
|
values2: { values: i, formatValue: e.Value.rem },
|
|
276
276
|
values3: {
|
|
277
|
-
values:
|
|
277
|
+
values: k,
|
|
278
278
|
formatValue: e.Value.fraction
|
|
279
279
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
280
280
|
}
|
|
@@ -287,115 +287,115 @@ const i = [
|
|
|
287
287
|
},
|
|
288
288
|
top: {
|
|
289
289
|
cssNames: ["top"],
|
|
290
|
-
values1: { values:
|
|
290
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
291
291
|
values2: { values: [] },
|
|
292
292
|
values3: { values: [] }
|
|
293
293
|
},
|
|
294
294
|
right: {
|
|
295
295
|
cssNames: ["right"],
|
|
296
|
-
values1: { values:
|
|
296
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
297
297
|
values2: { values: [] },
|
|
298
298
|
values3: { values: [] }
|
|
299
299
|
},
|
|
300
300
|
bottom: {
|
|
301
301
|
cssNames: ["bottom"],
|
|
302
|
-
values1: { values:
|
|
302
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
303
303
|
values2: { values: [] },
|
|
304
304
|
values3: { values: [] }
|
|
305
305
|
},
|
|
306
306
|
left: {
|
|
307
307
|
cssNames: ["left"],
|
|
308
|
-
values1: { values:
|
|
308
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
309
309
|
values2: { values: [] },
|
|
310
310
|
values3: { values: [] }
|
|
311
311
|
},
|
|
312
312
|
inset: {
|
|
313
313
|
cssNames: ["inset"],
|
|
314
|
-
values1: { values:
|
|
314
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
315
315
|
values2: { values: [] },
|
|
316
316
|
values3: { values: [] }
|
|
317
317
|
},
|
|
318
318
|
m: {
|
|
319
319
|
cssNames: ["margin"],
|
|
320
|
-
values1: { values:
|
|
320
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
321
321
|
values2: { values: ["auto"] },
|
|
322
322
|
values3: { values: [] }
|
|
323
323
|
},
|
|
324
324
|
mx: {
|
|
325
325
|
cssNames: ["margin-inline"],
|
|
326
|
-
values1: { values:
|
|
326
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
327
327
|
values2: { values: ["auto"] },
|
|
328
328
|
values3: { values: [] }
|
|
329
329
|
},
|
|
330
330
|
my: {
|
|
331
331
|
cssNames: ["margin-block"],
|
|
332
|
-
values1: { values:
|
|
332
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
333
333
|
values2: { values: ["auto"] },
|
|
334
334
|
values3: { values: [] }
|
|
335
335
|
},
|
|
336
336
|
mt: {
|
|
337
337
|
cssNames: ["margin-top"],
|
|
338
|
-
values1: { values:
|
|
338
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
339
339
|
values2: { values: ["auto"] },
|
|
340
340
|
values3: { values: [] }
|
|
341
341
|
},
|
|
342
342
|
mr: {
|
|
343
343
|
cssNames: ["margin-right"],
|
|
344
|
-
values1: { values:
|
|
344
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
345
345
|
values2: { values: ["auto"] },
|
|
346
346
|
values3: { values: [] }
|
|
347
347
|
},
|
|
348
348
|
mb: {
|
|
349
349
|
cssNames: ["margin-bottom"],
|
|
350
|
-
values1: { values:
|
|
350
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
351
351
|
values2: { values: ["auto"] },
|
|
352
352
|
values3: { values: [] }
|
|
353
353
|
},
|
|
354
354
|
ml: {
|
|
355
355
|
cssNames: ["margin-left"],
|
|
356
|
-
values1: { values:
|
|
356
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
357
357
|
values2: { values: ["auto"] },
|
|
358
358
|
values3: { values: [] }
|
|
359
359
|
},
|
|
360
360
|
p: {
|
|
361
361
|
cssNames: ["padding"],
|
|
362
|
-
values1: { values:
|
|
362
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
363
363
|
values2: { values: [] },
|
|
364
364
|
values3: { values: [] }
|
|
365
365
|
},
|
|
366
366
|
px: {
|
|
367
367
|
cssNames: ["padding-inline"],
|
|
368
|
-
values1: { values:
|
|
368
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
369
369
|
values2: { values: [] },
|
|
370
370
|
values3: { values: [] }
|
|
371
371
|
},
|
|
372
372
|
py: {
|
|
373
373
|
cssNames: ["padding-block"],
|
|
374
|
-
values1: { values:
|
|
374
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
375
375
|
values2: { values: [] },
|
|
376
376
|
values3: { values: [] }
|
|
377
377
|
},
|
|
378
378
|
pt: {
|
|
379
379
|
cssNames: ["padding-top"],
|
|
380
|
-
values1: { values:
|
|
380
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
381
381
|
values2: { values: [] },
|
|
382
382
|
values3: { values: [] }
|
|
383
383
|
},
|
|
384
384
|
pr: {
|
|
385
385
|
cssNames: ["padding-right"],
|
|
386
|
-
values1: { values:
|
|
386
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
387
387
|
values2: { values: [] },
|
|
388
388
|
values3: { values: [] }
|
|
389
389
|
},
|
|
390
390
|
pb: {
|
|
391
391
|
cssNames: ["padding-bottom"],
|
|
392
|
-
values1: { values:
|
|
392
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
393
393
|
values2: { values: [] },
|
|
394
394
|
values3: { values: [] }
|
|
395
395
|
},
|
|
396
396
|
pl: {
|
|
397
397
|
cssNames: ["padding-left"],
|
|
398
|
-
values1: { values:
|
|
398
|
+
values1: { values: d, formatValue: e.Value.rem },
|
|
399
399
|
values2: { values: [] },
|
|
400
400
|
values3: { values: [] }
|
|
401
401
|
},
|
|
@@ -407,37 +407,37 @@ const i = [
|
|
|
407
407
|
},
|
|
408
408
|
bx: {
|
|
409
409
|
cssNames: ["border-inline-width"],
|
|
410
|
-
values1: { values:
|
|
410
|
+
values1: { values: d, formatValue: e.Value.px },
|
|
411
411
|
values2: { values: [] },
|
|
412
412
|
values3: { values: [] }
|
|
413
413
|
},
|
|
414
414
|
by: {
|
|
415
415
|
cssNames: ["border-block-width"],
|
|
416
|
-
values1: { values:
|
|
416
|
+
values1: { values: d, formatValue: e.Value.px },
|
|
417
417
|
values2: { values: [] },
|
|
418
418
|
values3: { values: [] }
|
|
419
419
|
},
|
|
420
420
|
bt: {
|
|
421
421
|
cssNames: ["border-top-width"],
|
|
422
|
-
values1: { values:
|
|
422
|
+
values1: { values: d, formatValue: e.Value.px },
|
|
423
423
|
values2: { values: [] },
|
|
424
424
|
values3: { values: [] }
|
|
425
425
|
},
|
|
426
426
|
br: {
|
|
427
427
|
cssNames: ["border-right-width"],
|
|
428
|
-
values1: { values:
|
|
428
|
+
values1: { values: d, formatValue: e.Value.px },
|
|
429
429
|
values2: { values: [] },
|
|
430
430
|
values3: { values: [] }
|
|
431
431
|
},
|
|
432
432
|
bb: {
|
|
433
433
|
cssNames: ["border-bottom-width"],
|
|
434
|
-
values1: { values:
|
|
434
|
+
values1: { values: d, formatValue: e.Value.px },
|
|
435
435
|
values2: { values: [] },
|
|
436
436
|
values3: { values: [] }
|
|
437
437
|
},
|
|
438
438
|
bl: {
|
|
439
439
|
cssNames: ["border-left-width"],
|
|
440
|
-
values1: { values:
|
|
440
|
+
values1: { values: d, formatValue: e.Value.px },
|
|
441
441
|
values2: { values: [] },
|
|
442
442
|
values3: { values: [] }
|
|
443
443
|
},
|
|
@@ -857,7 +857,7 @@ const i = [
|
|
|
857
857
|
formatValue: e.Value.svgVariables("color"),
|
|
858
858
|
formatSelector: e.ClassName.svg
|
|
859
859
|
}
|
|
860
|
-
}, X = ["H", "F", "A"
|
|
860
|
+
}, X = ["H", "F", "A"], Y = [
|
|
861
861
|
"H",
|
|
862
862
|
"F",
|
|
863
863
|
"A",
|
|
@@ -868,20 +868,20 @@ const i = [
|
|
|
868
868
|
"Required",
|
|
869
869
|
"Optional",
|
|
870
870
|
"Disabled"
|
|
871
|
-
],
|
|
871
|
+
], T = {
|
|
872
872
|
hover: { className: "_h" },
|
|
873
873
|
focus: { className: "_f" }
|
|
874
874
|
};
|
|
875
|
-
Object.keys(R).forEach((
|
|
876
|
-
w[
|
|
875
|
+
Object.keys(R).forEach((t) => {
|
|
876
|
+
w[t] = R[t], w[t].isThemeStyle = !0;
|
|
877
877
|
});
|
|
878
|
-
Object.keys(_).forEach((
|
|
879
|
-
w[
|
|
878
|
+
Object.keys(_).forEach((t) => {
|
|
879
|
+
w[t] = _[t], w[t].isThemeStyle = !0;
|
|
880
880
|
});
|
|
881
881
|
const J = Object.keys(w);
|
|
882
|
-
Y.forEach((
|
|
882
|
+
Y.forEach((t) => {
|
|
883
883
|
J.forEach((r) => {
|
|
884
|
-
w[`${r}${
|
|
884
|
+
w[`${r}${t}`] = { ...w[r], pseudoSuffix: t };
|
|
885
885
|
});
|
|
886
886
|
});
|
|
887
887
|
class Q {
|
|
@@ -892,11 +892,11 @@ class Q {
|
|
|
892
892
|
return this._cache[r] || (this._cache[r] = this.getByIndex(this._index++)), this._cache[r];
|
|
893
893
|
}
|
|
894
894
|
getByIndex(r) {
|
|
895
|
-
const { first: m, next:
|
|
896
|
-
if (
|
|
895
|
+
const { first: m, next: v } = Z, l = r - m.length;
|
|
896
|
+
if (l < 0)
|
|
897
897
|
return m[r];
|
|
898
|
-
const b = Math.floor(
|
|
899
|
-
return this.getByIndex(b) +
|
|
898
|
+
const b = Math.floor(l / v.length), N = l - b * v.length;
|
|
899
|
+
return this.getByIndex(b) + v[N];
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
902
|
const Z = {
|
|
@@ -904,81 +904,81 @@ const Z = {
|
|
|
904
904
|
next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
905
905
|
};
|
|
906
906
|
var A;
|
|
907
|
-
((
|
|
908
|
-
|
|
907
|
+
((t) => {
|
|
908
|
+
t.boxClassName = "_box", t.svgClassName = "_svg", t.cronoStylesElementId = "crono-styles";
|
|
909
909
|
const r = `:root{--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;}}
|
|
910
910
|
html{font-size: 16px;font-family: Arial, sans-serif;}
|
|
911
911
|
body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
|
|
912
912
|
a,ul{all: unset;}
|
|
913
|
-
.${
|
|
914
|
-
.${
|
|
915
|
-
`, m = new Q(),
|
|
916
|
-
let
|
|
917
|
-
(
|
|
913
|
+
.${t.boxClassName}{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;}
|
|
914
|
+
.${t.svgClassName}{transition: all var(--svgTransitionTime);}.${t.svgClassName} path,.${t.svgClassName} circle,.${t.svgClassName} rect,.${t.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
915
|
+
`, m = new Q(), v = Object.keys(w);
|
|
916
|
+
let l = !0, b = v.reduce(
|
|
917
|
+
(s, a) => (s[a] = /* @__PURE__ */ new Set(), s),
|
|
918
918
|
{}
|
|
919
919
|
);
|
|
920
|
-
function
|
|
921
|
-
if (
|
|
922
|
-
return
|
|
923
|
-
if (
|
|
924
|
-
return
|
|
920
|
+
function N(s, a) {
|
|
921
|
+
if (s in w)
|
|
922
|
+
return o(s, a);
|
|
923
|
+
if (s in T)
|
|
924
|
+
return T[s].className;
|
|
925
925
|
}
|
|
926
|
-
|
|
927
|
-
function
|
|
928
|
-
if (
|
|
929
|
-
let
|
|
930
|
-
|
|
931
|
-
const
|
|
932
|
-
|
|
926
|
+
t.get = N;
|
|
927
|
+
function x() {
|
|
928
|
+
if (l) {
|
|
929
|
+
let s = n([r]);
|
|
930
|
+
s = n(s, "H"), s = n(s, "F"), s = n(s, "A"), s = n(s, "Checked"), s = n(s, "Indeterminate"), s = n(s, "Valid"), s = n(s, "Invalid"), s = n(s, "Required"), s = n(s, "Disabled");
|
|
931
|
+
const a = f();
|
|
932
|
+
a.innerHTML = s.join(""), l = !1;
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
|
-
|
|
936
|
-
function
|
|
937
|
-
b =
|
|
938
|
-
(
|
|
935
|
+
t.flush = x;
|
|
936
|
+
function j() {
|
|
937
|
+
b = v.reduce(
|
|
938
|
+
(s, a) => (s[a] = /* @__PURE__ */ new Set(), s),
|
|
939
939
|
{}
|
|
940
940
|
);
|
|
941
941
|
}
|
|
942
|
-
|
|
943
|
-
function
|
|
942
|
+
t.clear = j;
|
|
943
|
+
function o(s, a) {
|
|
944
944
|
var y;
|
|
945
|
-
b[
|
|
946
|
-
const
|
|
947
|
-
return m.getIdentity(
|
|
945
|
+
b[s].has(a) || (l = !0, b[s].add(a));
|
|
946
|
+
const u = g(s, a), p = ((y = u.formatClassName) == null ? void 0 : y.call(u, s, a)) ?? `${s}${a}`;
|
|
947
|
+
return m.getIdentity(p);
|
|
948
948
|
}
|
|
949
|
-
function
|
|
950
|
-
return Object.entries(b).filter(([
|
|
949
|
+
function n(s, a) {
|
|
950
|
+
return Object.entries(b).filter(([p]) => {
|
|
951
951
|
var y;
|
|
952
|
-
return ((y = w[
|
|
953
|
-
}).reduce((
|
|
952
|
+
return ((y = w[p]) == null ? void 0 : y.pseudoSuffix) === a;
|
|
953
|
+
}).reduce((p, [y, I]) => (I.forEach(($) => {
|
|
954
954
|
var E;
|
|
955
|
-
const
|
|
956
|
-
let
|
|
957
|
-
|
|
958
|
-
...
|
|
959
|
-
...
|
|
960
|
-
] :
|
|
961
|
-
...
|
|
962
|
-
...
|
|
963
|
-
] :
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
}),
|
|
967
|
-
function
|
|
968
|
-
return y.formatSelector ? y.formatSelector(
|
|
955
|
+
const V = g(y, $), c = `.${o(y, $)}`;
|
|
956
|
+
let h = [];
|
|
957
|
+
a ? a === "H" ? h = [
|
|
958
|
+
...u(`${c}:hover`, V),
|
|
959
|
+
...u(`.${T.hover.className}:hover>${c}`, V)
|
|
960
|
+
] : a === "F" ? h = [
|
|
961
|
+
...u(`${c}:focus-within`, V),
|
|
962
|
+
...u(`.${T.focus.className}:focus-within>${c}`, V)
|
|
963
|
+
] : a === "A" ? h = u(`${c}:active`, V) : a === "Checked" ? h = u(`${c}:checked`, V) : a === "Indeterminate" ? h = u(`${c}:indeterminate`, V) : a === "Valid" ? h = u(`${c}:valid`, V) : a === "Invalid" ? h = u(`${c}:invalid`, V) : a === "Required" ? h = u(`${c}:required`, V) : a === "Optional" ? h = u(`${c}:optional`, V) : a === "Disabled" && (h = u(`${c}:disabled`, V)) : h = u(c, V);
|
|
964
|
+
const L = ((E = V.formatValue) == null ? void 0 : E.call(V, y, $)) ?? $, q = w[y].cssNames.map((W) => `${W}:${L};`).join("");
|
|
965
|
+
p.push(`${h.join(",")}{${q}}`);
|
|
966
|
+
}), p), s);
|
|
967
|
+
function u(p, y) {
|
|
968
|
+
return y.formatSelector ? y.formatSelector(p) : [p];
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
return
|
|
971
|
+
function g(s, a) {
|
|
972
|
+
const u = w[s];
|
|
973
|
+
return u.isThemeStyle ? u : u.values1.values.includes(a) ? u.values1 : u.values2.values.includes(a) ? u.values2 : u.values3;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
const
|
|
977
|
-
let
|
|
978
|
-
return
|
|
975
|
+
function f() {
|
|
976
|
+
const a = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
|
|
977
|
+
let u = a.getElementById(t.cronoStylesElementId);
|
|
978
|
+
return u || (u = a.createElement("style"), u.setAttribute("id", t.cronoStylesElementId), u.setAttribute("type", "text/css"), a.head.insertBefore(u, a.head.firstChild)), u;
|
|
979
979
|
}
|
|
980
980
|
})(A || (A = {}));
|
|
981
|
-
const
|
|
981
|
+
const z = A, S = {
|
|
982
982
|
button: {
|
|
983
983
|
styles: {
|
|
984
984
|
display: "inline-block",
|
|
@@ -1021,125 +1021,136 @@ const S = A, T = {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
};
|
|
1023
1023
|
var O;
|
|
1024
|
-
((
|
|
1025
|
-
|
|
1026
|
-
|
|
1024
|
+
((t) => {
|
|
1025
|
+
t.Styles = b(S);
|
|
1026
|
+
function r(o) {
|
|
1027
|
+
t.Styles = l(o);
|
|
1027
1028
|
}
|
|
1028
|
-
|
|
1029
|
-
function m(
|
|
1030
|
-
const
|
|
1031
|
-
`),
|
|
1032
|
-
`),
|
|
1033
|
-
`),
|
|
1034
|
-
`),
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1029
|
+
t.setup = r;
|
|
1030
|
+
function m(o, n) {
|
|
1031
|
+
const g = Object.entries(o.colors).map(([c, h]) => `--color${c}: ${h};`).join(`
|
|
1032
|
+
`), f = Object.entries(o.shadows).map(([c, h]) => `--shadow${c}: ${h};`).join(`
|
|
1033
|
+
`), s = Object.entries(o.backgrounds).map(([c, h]) => `--background${c}: ${h};`).join(`
|
|
1034
|
+
`), a = Object.entries(o.backgroundImages).map(([c, h]) => `--backgroundImage${c}: ${h};`).join(`
|
|
1035
|
+
`), u = [":root {"];
|
|
1036
|
+
g && u.push(` ${g}`), f && u.push(` ${f}`), s && u.push(` ${s}`), a && u.push(` ${a}`), u.push("}");
|
|
1037
|
+
const p = Object.keys(o.colors).map((c) => `'${c}'`).join(" | "), y = Object.keys(o.backgrounds).map((c) => `'${c}'`).join(" | "), I = Object.keys(o.backgroundImages).map((c) => `'${c}'`).join(" | "), $ = Object.keys(o.shadows).map((c) => `'${c}'`).join(" | "), V = `import '@cronocode/react-box';
|
|
1037
1038
|
|
|
1038
|
-
declare module '${(
|
|
1039
|
-
type ColorType = ${
|
|
1040
|
-
type BackgroundType = ${
|
|
1041
|
-
type BackgroundImageType = ${
|
|
1042
|
-
type ShadowType = ${
|
|
1039
|
+
declare module '${(n == null ? void 0 : n.namespacePath) ?? "@cronocode/react-box/core/types"}' {
|
|
1040
|
+
type ColorType = ${p};
|
|
1041
|
+
type BackgroundType = ${y};
|
|
1042
|
+
type BackgroundImageType = ${I};
|
|
1043
|
+
type ShadowType = ${$};
|
|
1043
1044
|
|
|
1044
1045
|
namespace Augmented {
|
|
1045
1046
|
interface BoxProps {
|
|
1046
|
-
${
|
|
1047
|
-
${
|
|
1048
|
-
${
|
|
1049
|
-
${
|
|
1050
|
-
${
|
|
1051
|
-
${
|
|
1052
|
-
${
|
|
1047
|
+
${v("color", "ColorType")}
|
|
1048
|
+
${v("bgColor", "ColorType")}
|
|
1049
|
+
${v("borderColor", "ColorType")}
|
|
1050
|
+
${v("outlineColor", "ColorType")}
|
|
1051
|
+
${v("background", "BackgroundType")}
|
|
1052
|
+
${v("backgroundImage", "BackgroundImageType")}
|
|
1053
|
+
${v("shadow", "ShadowType")}
|
|
1053
1054
|
}
|
|
1054
1055
|
|
|
1055
1056
|
interface SvgProps {
|
|
1056
|
-
${
|
|
1057
|
-
${
|
|
1057
|
+
${v("fill", "ColorType")}
|
|
1058
|
+
${v("stroke", "ColorType")}
|
|
1058
1059
|
}
|
|
1059
1060
|
}
|
|
1060
1061
|
}
|
|
1061
1062
|
`;
|
|
1062
1063
|
return {
|
|
1063
|
-
variables:
|
|
1064
|
+
variables: u.join(`
|
|
1064
1065
|
`),
|
|
1065
|
-
boxDts:
|
|
1066
|
+
boxDts: V
|
|
1066
1067
|
};
|
|
1067
1068
|
}
|
|
1068
|
-
|
|
1069
|
-
function
|
|
1070
|
-
const
|
|
1071
|
-
return
|
|
1069
|
+
t.setupAugmentedProps = m;
|
|
1070
|
+
function v(o, n) {
|
|
1071
|
+
const g = X.map((f) => ` ${o}${f}?: ${n};`);
|
|
1072
|
+
return g.unshift(` ${o}?: ${n};`), g.join(`
|
|
1072
1073
|
`);
|
|
1073
1074
|
}
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1075
|
+
function l(o) {
|
|
1076
|
+
const n = b(o);
|
|
1077
|
+
return Object.keys(S).forEach((f) => {
|
|
1078
|
+
const s = n[f], a = S[f];
|
|
1079
|
+
s ? s.styles = { ...a.styles, ...s.styles } : n[f] = S[f];
|
|
1080
|
+
}), n;
|
|
1081
|
+
}
|
|
1082
|
+
function b(o) {
|
|
1083
|
+
return N(o), j(o), o;
|
|
1079
1084
|
}
|
|
1080
|
-
function
|
|
1081
|
-
if (!
|
|
1085
|
+
function N(o) {
|
|
1086
|
+
if (!o.components)
|
|
1082
1087
|
return;
|
|
1083
|
-
const
|
|
1084
|
-
for (const
|
|
1085
|
-
const
|
|
1086
|
-
delete
|
|
1087
|
-
for (const
|
|
1088
|
-
const [
|
|
1089
|
-
|
|
1088
|
+
const n = Object.keys(o.components);
|
|
1089
|
+
for (const g of n) {
|
|
1090
|
+
const f = o.components[g], s = x(g, f);
|
|
1091
|
+
delete f.children;
|
|
1092
|
+
for (const a of s) {
|
|
1093
|
+
const [u, p] = a;
|
|
1094
|
+
o.components[u] = p;
|
|
1090
1095
|
}
|
|
1091
1096
|
}
|
|
1092
1097
|
}
|
|
1093
|
-
function
|
|
1094
|
-
if (!
|
|
1098
|
+
function x(o, n) {
|
|
1099
|
+
if (!n.children)
|
|
1095
1100
|
return [];
|
|
1096
|
-
const
|
|
1097
|
-
for (const
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1101
|
+
const g = Object.keys(n.children), f = [];
|
|
1102
|
+
for (const s of g) {
|
|
1103
|
+
const a = `${o}.${s}`, u = n.children[s], p = x(a, u);
|
|
1104
|
+
f.push(...p), delete u.children, f.push([a, u]);
|
|
1100
1105
|
}
|
|
1101
|
-
return
|
|
1106
|
+
return f;
|
|
1102
1107
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const { components:
|
|
1105
|
-
|
|
1106
|
-
for (const
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1108
|
+
function j(o) {
|
|
1109
|
+
const { components: n, ...g } = o, f = Object.values(g);
|
|
1110
|
+
n && f.push(...Object.values(n));
|
|
1111
|
+
for (const s of f)
|
|
1112
|
+
[
|
|
1113
|
+
["disabled", "Disabled"],
|
|
1114
|
+
["indeterminate", "Indeterminate"],
|
|
1115
|
+
["checked", "Checked"]
|
|
1116
|
+
].forEach(([a, u]) => {
|
|
1117
|
+
a in s.styles && (Object.entries(s.styles[a]).map(([p, y]) => {
|
|
1118
|
+
s.styles[`${p}${u}`] = y;
|
|
1119
|
+
}), delete s.styles[a]);
|
|
1120
|
+
});
|
|
1110
1121
|
}
|
|
1111
1122
|
})(O || (O = {}));
|
|
1112
1123
|
const D = O;
|
|
1113
|
-
function K(
|
|
1114
|
-
const { clean: r, theme: m, component:
|
|
1124
|
+
function K(t) {
|
|
1125
|
+
const { clean: r, theme: m, component: v } = t;
|
|
1115
1126
|
return P(() => {
|
|
1116
|
-
var b,
|
|
1127
|
+
var b, N;
|
|
1117
1128
|
if (r)
|
|
1118
1129
|
return;
|
|
1119
|
-
let
|
|
1120
|
-
if (
|
|
1121
|
-
return m ? { ...
|
|
1122
|
-
}, [
|
|
1130
|
+
let l = D.Styles[v] ?? ((b = D.Styles.components) == null ? void 0 : b[v]);
|
|
1131
|
+
if (l)
|
|
1132
|
+
return m ? { ...l.styles, ...(N = l.themes) == null ? void 0 : N[m].styles } : l.styles;
|
|
1133
|
+
}, [v, r, m]);
|
|
1123
1134
|
}
|
|
1124
1135
|
const ee = typeof window < "u" && typeof window.document < "u", se = ee ? G : M;
|
|
1125
|
-
function te(
|
|
1126
|
-
const m = K(
|
|
1127
|
-
return se(
|
|
1128
|
-
const
|
|
1129
|
-
return Array.isArray(
|
|
1130
|
-
|
|
1131
|
-
}), delete
|
|
1132
|
-
|
|
1133
|
-
}),
|
|
1134
|
-
}, [
|
|
1136
|
+
function te(t, r) {
|
|
1137
|
+
const m = K(t);
|
|
1138
|
+
return se(z.flush, [t]), P(() => {
|
|
1139
|
+
const v = [r ? z.svgClassName : z.boxClassName], l = m ? { ...m, ...t } : { ...t };
|
|
1140
|
+
return Array.isArray(l.disabled) && (Object.entries(l.disabled[1]).forEach(([b, N]) => {
|
|
1141
|
+
l[`${b}Disabled`] = N;
|
|
1142
|
+
}), delete l.disabled), "inline" in l && (l.display === "block" || !l.display ? l.display = "inline-block" : l.display === "flex" ? l.display = "inline-flex" : l.display === "grid" && (l.display = "inline-grid"), delete l.inline), "inlineH" in l && (l.displayH === "block" || !l.displayH ? l.displayH = "inline-block" : l.displayH === "flex" ? l.displayH = "inline-flex" : l.displayH === "grid" && (l.displayH = "inline-grid"), delete l.inlineH), "inlineF" in l && (l.displayF === "block" || !l.displayF ? l.displayF = "inline-block" : l.displayF === "flex" ? l.displayF = "inline-flex" : l.displayF === "grid" && (l.displayF = "inline-grid"), delete l.inlineF), "inlineA" in l && (l.displayA === "block" || !l.displayA ? l.displayA = "inline-block" : l.displayA === "flex" ? l.displayA = "inline-flex" : l.displayA === "grid" && (l.displayA = "inline-grid"), delete l.inlineA), Object.entries(l).forEach(([b, N]) => {
|
|
1143
|
+
v.push(z.get(b, N));
|
|
1144
|
+
}), v;
|
|
1145
|
+
}, [t, m]);
|
|
1135
1146
|
}
|
|
1136
|
-
function ae(...
|
|
1137
|
-
return
|
|
1138
|
-
|
|
1147
|
+
function ae(...t) {
|
|
1148
|
+
return t.reduce((r, m) => m ? typeof m == "string" ? (r.push(m), r) : Array.isArray(m) ? (r.push(...ae(...m)), r) : (Object.entries(m).forEach(([v, l]) => {
|
|
1149
|
+
l && r.push(v);
|
|
1139
1150
|
}), r) : r, []);
|
|
1140
1151
|
}
|
|
1141
1152
|
export {
|
|
1142
|
-
S,
|
|
1153
|
+
z as S,
|
|
1143
1154
|
D as T,
|
|
1144
1155
|
ae as c,
|
|
1145
1156
|
te as u
|