@cronocode/react-box 1.8.0 → 1.8.2
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/box.cjs +1 -1
- package/box.d.ts +5 -2
- package/box.mjs +8 -8
- package/components/baseSvg.d.ts +2 -3
- package/components/button.cjs +1 -1
- package/components/button.d.ts +1 -1
- package/components/button.mjs +7 -7
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.d.ts +6 -6
- package/components/checkbox.mjs +11 -20
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.d.ts +1 -1
- package/components/radioButton.mjs +4 -15
- package/components/textarea.cjs +1 -1
- package/components/textarea.d.ts +1 -1
- package/components/textarea.mjs +7 -8
- package/components/textbox.cjs +1 -1
- package/components/textbox.d.ts +1 -1
- package/components/textbox.mjs +5 -6
- package/core/boxStyles.d.ts +97 -476
- package/core/boxStylesFormatters.d.ts +12 -12
- package/core/stylesContext.d.ts +1 -1
- package/core/theme.d.ts +15 -17
- package/core/types.d.ts +12 -4
- package/core/useTheme.d.ts +0 -1
- package/core.cjs +25 -61
- package/core.mjs +304 -348
- package/package.json +1 -1
- package/utils/object/objectUtils.d.ts +0 -1
- package/utils.cjs +1 -1
- package/utils.mjs +43 -54
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare namespace BoxStylesFormatters {
|
|
2
2
|
namespace ClassName {
|
|
3
|
-
function fraction(key: string, value: string
|
|
3
|
+
function fraction(key: string, value: string): string;
|
|
4
4
|
function svg(selector: string): string[];
|
|
5
5
|
}
|
|
6
6
|
namespace Value {
|
|
7
|
-
function rem(_key: string, value:
|
|
8
|
-
function px(_key: string, value:
|
|
9
|
-
function fraction(_key: string, value: string
|
|
10
|
-
function widthHeight(key: string, value: string
|
|
11
|
-
function variables(prefix: string): (key: string, value: string
|
|
12
|
-
function svgVariables(prefix: string): (key: string, value: string
|
|
13
|
-
function gridColumns(key: string, value:
|
|
14
|
-
function gridColumn(key: string, value: string | number
|
|
15
|
-
function ms(key: string, value:
|
|
16
|
-
function rotate(key: string, value:
|
|
17
|
-
function flip(key: string, value: string
|
|
7
|
+
function rem(_key: string, value: number): string;
|
|
8
|
+
function px(_key: string, value: number): string;
|
|
9
|
+
function fraction(_key: string, value: string): string;
|
|
10
|
+
function widthHeight(key: string, value: string): string;
|
|
11
|
+
function variables(prefix: string): (key: string, value: string) => string;
|
|
12
|
+
function svgVariables(prefix: string): (key: string, value: string) => string;
|
|
13
|
+
function gridColumns(key: string, value: number): string;
|
|
14
|
+
function gridColumn(key: string, value: string | number): string;
|
|
15
|
+
function ms(key: string, value: number): string;
|
|
16
|
+
function rotate(key: string, value: number): string;
|
|
17
|
+
function flip(key: string, value: string): "-1 1" | "1 -1";
|
|
18
18
|
}
|
|
19
19
|
}
|
package/core/stylesContext.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ declare namespace StylesContext {
|
|
|
2
2
|
const boxClassName = "_box";
|
|
3
3
|
const svgClassName = "_svg";
|
|
4
4
|
const cronoStylesElementId = "crono-styles";
|
|
5
|
-
function get(key: string, value:
|
|
5
|
+
function get(key: string, value: unknown): string | undefined;
|
|
6
6
|
function flush(): void;
|
|
7
7
|
function clear(): void;
|
|
8
8
|
}
|
package/core/theme.d.ts
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { BoxStyleProps } from './types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { BoxThemeProps } from './types';
|
|
3
|
+
export interface ThemeStyles<T> {
|
|
4
|
+
styles: T;
|
|
5
5
|
}
|
|
6
|
-
export interface ThemeComponentStyles {
|
|
7
|
-
styles: BoxStyleProps;
|
|
8
|
-
disabled?: BoxStyleProps;
|
|
6
|
+
export interface ThemeComponentStyles<T = BoxStyleProps> extends ThemeStyles<T> {
|
|
9
7
|
themes?: {
|
|
10
|
-
[name: string]: ThemeStyles
|
|
8
|
+
[name: string]: ThemeStyles<T>;
|
|
11
9
|
};
|
|
12
10
|
children?: {
|
|
13
|
-
[name: string]: ThemeComponentStyles
|
|
11
|
+
[name: string]: ThemeComponentStyles<T>;
|
|
14
12
|
};
|
|
15
13
|
}
|
|
16
|
-
export interface ThemeSetup {
|
|
14
|
+
export interface ThemeSetup<T = BoxStyleProps> {
|
|
17
15
|
components?: {
|
|
18
|
-
[name: string]: ThemeComponentStyles
|
|
16
|
+
[name: string]: ThemeComponentStyles<T>;
|
|
19
17
|
};
|
|
20
|
-
button?: ThemeComponentStyles
|
|
21
|
-
textbox?: ThemeComponentStyles
|
|
22
|
-
textarea?: ThemeComponentStyles
|
|
23
|
-
checkbox?: ThemeComponentStyles
|
|
24
|
-
radioButton?: ThemeComponentStyles
|
|
18
|
+
button?: ThemeComponentStyles<T>;
|
|
19
|
+
textbox?: ThemeComponentStyles<T>;
|
|
20
|
+
textarea?: ThemeComponentStyles<T>;
|
|
21
|
+
checkbox?: ThemeComponentStyles<T>;
|
|
22
|
+
radioButton?: ThemeComponentStyles<T>;
|
|
25
23
|
}
|
|
26
24
|
interface BoxAugmentedProps {
|
|
27
25
|
colors: Record<string, string>;
|
|
@@ -30,8 +28,8 @@ interface BoxAugmentedProps {
|
|
|
30
28
|
backgroundImages: Record<string, string>;
|
|
31
29
|
}
|
|
32
30
|
declare namespace Theme {
|
|
33
|
-
let Styles: ThemeSetup
|
|
34
|
-
function setup(styles: ThemeSetup): void;
|
|
31
|
+
let Styles: ThemeSetup<BoxStyleProps>;
|
|
32
|
+
function setup(styles: ThemeSetup<BoxThemeProps>): void;
|
|
35
33
|
function setupAugmentedProps(props: BoxAugmentedProps, options?: {
|
|
36
34
|
namespacePath?: string;
|
|
37
35
|
}): {
|
package/core/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PseudoClassSuffix, StyleItem,
|
|
2
|
+
import { PseudoClassSuffix, StyleItem, boxStyles } from './boxStyles';
|
|
3
3
|
import { ThemeComponentProps } from './useTheme';
|
|
4
4
|
export type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
5
5
|
export type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
@@ -15,16 +15,24 @@ export declare namespace Augmented {
|
|
|
15
15
|
type BoxStyles<T extends Record<string, StyleItem>> = {
|
|
16
16
|
[K in keyof T]?: T[K]['values1']['values'][number] | T[K]['values2']['values'][number] | T[K]['values3']['values'][number];
|
|
17
17
|
};
|
|
18
|
-
type BoxNormalStyles = BoxStyles<typeof boxStyles> &
|
|
18
|
+
type BoxNormalStyles = BoxStyles<typeof boxStyles> & Augmented.BoxProps;
|
|
19
19
|
interface BoxPseudoClasses {
|
|
20
20
|
hover?: boolean;
|
|
21
21
|
focus?: boolean;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
interface BoxPseudoClasses2 {
|
|
24
|
+
disabled?: boolean | [boolean, BoxNormalStyles];
|
|
25
|
+
}
|
|
26
|
+
type BoxPseudoClassStyles = PseudoClass<BoxNormalStyles, 'H'> & PseudoClass<BoxNormalStyles, 'F'> & PseudoClass<BoxNormalStyles, 'A'> & PseudoClass<BoxNormalStyles, 'Checked'> & PseudoClass<BoxNormalStyles, 'Indeterminate'> & PseudoClass<BoxNormalStyles, 'Valid'> & PseudoClass<BoxNormalStyles, 'Invalid'> & PseudoClass<BoxNormalStyles, 'Required'> & PseudoClass<BoxNormalStyles, 'Optional'>;
|
|
27
|
+
interface BoxThemePseudoClassProps {
|
|
28
|
+
disabled?: BoxNormalStyles;
|
|
29
|
+
}
|
|
30
|
+
export type BoxThemeProps = BoxNormalStyles & BoxThemePseudoClassProps & BoxPseudoClassStyles;
|
|
31
|
+
export type BoxStyleProps = BoxNormalStyles & BoxPseudoClasses & BoxPseudoClasses2 & BoxPseudoClassStyles & ThemeComponentProps;
|
|
24
32
|
interface SvgNormalStyles {
|
|
25
33
|
rotate?: BoxNormalStyles['rotate'];
|
|
26
34
|
flip?: BoxNormalStyles['flip'];
|
|
27
35
|
transitionDuration?: BoxNormalStyles['transitionDuration'];
|
|
28
36
|
}
|
|
29
|
-
export type BoxSvgStyles = SvgNormalStyles & PseudoClass<SvgNormalStyles, 'H'> & PseudoClass<SvgNormalStyles, 'F'> & PseudoClass<SvgNormalStyles, 'A'> & PseudoClass<SvgNormalStyles, '
|
|
37
|
+
export type BoxSvgStyles = SvgNormalStyles & PseudoClass<SvgNormalStyles, 'H'> & PseudoClass<SvgNormalStyles, 'F'> & PseudoClass<SvgNormalStyles, 'A'> & PseudoClass<SvgNormalStyles, 'Checked'> & PseudoClass<SvgNormalStyles, 'Indeterminate'> & PseudoClass<SvgNormalStyles, 'Valid'> & PseudoClass<SvgNormalStyles, 'Invalid'> & PseudoClass<SvgNormalStyles, 'Required'> & PseudoClass<SvgNormalStyles, 'Optional'> & ThemeComponentProps & Augmented.SvgProps;
|
|
30
38
|
export {};
|
package/core/useTheme.d.ts
CHANGED
package/core.cjs
CHANGED
|
@@ -1,74 +1,38 @@
|
|
|
1
|
-
"use strict";const I=require("react");var e;(a=>{(l=>{function c(s,d){return`${s}${d.replace("/","-")}`}l.fraction=c;function v(s){return[`${s} path`,`${s} circle`,`${s} rect`,`${s} line`]}l.svg=v})(a.ClassName||(a.ClassName={})),(l=>{function c(o,u){return`${u/4}rem`}l.rem=c;function v(o,u){return`${u}px`}l.px=v;function s(o,u){const[t,N]=u.split("/");return`${+t/+N*100}%`}l.fraction=s;function d(o,u){switch(u){case"fit":return"100%";case"fit-screen":return o.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return u}}l.widthHeight=d;function n(o){return(u,t)=>`var(--${o}${t});`}l.variables=n;function f(o){return(u,t)=>`var(--${o}${t});`}l.svgVariables=f;function g(o,u){return`repeat(${u},minmax(0,1fr))`}l.gridColumns=g;function p(o,u){return u==="full-row"?"1/-1":`span ${u}/span ${u}`}l.gridColumn=p;function y(o,u){return`${u}ms`}l.ms=y;function k(o,u){return`${u}deg`}l.rotate=k;function h(o,u){return u==="xAxis"?"-1 1":"1 -1"}l.flip=h})(a.Value||(a.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],X=[-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],m=[...i,...X],_=["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"],B=["auto","hidden","scroll","visible"],$=["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"],H=["fit","fit-screen","auto","fit-content","max-content","min-content"],D=["auto","flex-start","flex-end","center","baseline","stretch"],r={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:H,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:$,formatValue:e.Value.fraction}},minWidth:{cssNames:["min-width"],values1:{values:H,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:$,formatValue:e.Value.fraction}},maxWidth:{cssNames:["max-width"],values1:{values:H,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:$,formatValue:e.Value.fraction}},height:{cssNames:["height"],values1:{values:H,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:$,formatValue:e.Value.fraction}},minHeight:{cssNames:["min-height"],values1:{values:H,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:$,formatValue:e.Value.fraction}},maxHeight:{cssNames:["max-height"],values1:{values:H,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:$,formatValue:e.Value.fraction}},position:{cssNames:["position"],values1:{values:["static","relative","absolute","fixed","sticky"]},values2:{values:[]},values3:{values:[]}},top:{cssNames:["top"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},right:{cssNames:["right"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},bottom:{cssNames:["bottom"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},left:{cssNames:["left"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},inset:{cssNames:["inset"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},margin:{cssNames:["margin"],values1:{values:m,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginHorizontal:{cssNames:["margin-inline"],values1:{values:m,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginVertical:{cssNames:["margin-block"],values1:{values:m,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginTop:{cssNames:["margin-top"],values1:{values:m,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginRight:{cssNames:["margin-right"],values1:{values:m,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginBottom:{cssNames:["margin-bottom"],values1:{values:m,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginLeft:{cssNames:["margin-left"],values1:{values:m,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},padding:{cssNames:["padding"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingHorizontal:{cssNames:["padding-inline"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingVertical:{cssNames:["padding-block"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingTop:{cssNames:["padding-top"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingRight:{cssNames:["padding-right"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingBottom:{cssNames:["padding-bottom"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingLeft:{cssNames:["padding-left"],values1:{values:m,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},border:{cssNames:["border-width"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderHorizontal:{cssNames:["border-inline-width"],values1:{values:m,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderVertical:{cssNames:["border-block-width"],values1:{values:m,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderTop:{cssNames:["border-top-width"],values1:{values:m,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderRight:{cssNames:["border-right-width"],values1:{values:m,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderBottom:{cssNames:["border-bottom-width"],values1:{values:m,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderLeft:{cssNames:["border-left-width"],values1:{values:m,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderStyle:{cssNames:["border-style"],values1:{values:_},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:B},values2:{values:[]},values3:{values:[]}},overflowX:{cssNames:["overflow-x"],values1:{values:B},values2:{values:[]},values3:{values:[]}},overflowY:{cssNames:["overflow-y"],values1:{values:B},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:[]}},justifyContent:{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:[]}},alignItems:{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:[]}},flexDirection:{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:D},values2:{values:[]},values3:{values:[]}},justifySelf:{cssNames:["justify-self"],values1:{values:D},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:_},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:[]}}},P={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}},Y=["H","F","A","C"],A={hover:{className:"_h"},focus:{className:"_f"}};Object.keys(P).forEach(a=>{r[a]=P[a],r[a].isThemeStyle=!0});Object.keys(q).forEach(a=>{r[a]=q[a],r[a].isThemeStyle=!0});const z={w:{...r.width,key:"width"},h:{...r.height,key:"height"},m:{...r.margin,key:"margin"},mx:{...r.marginHorizontal,key:"marginHorizontal"},my:{...r.marginVertical,key:"marginVertical"},mt:{...r.marginTop,key:"marginTop"},mr:{...r.marginRight,key:"marginRight"},mb:{...r.marginBottom,key:"marginBottom"},ml:{...r.marginLeft,key:"marginLeft"},p:{...r.padding,key:"padding"},px:{...r.paddingHorizontal,key:"paddingHorizontal"},py:{...r.paddingVertical,key:"paddingVertical"},pt:{...r.paddingTop,key:"paddingTop"},pr:{...r.paddingRight,key:"paddingRight"},pb:{...r.paddingBottom,key:"paddingBottom"},pl:{...r.paddingLeft,key:"paddingLeft"},b:{...r.border,key:"border"},bx:{...r.borderHorizontal,key:"borderHorizontal"},by:{...r.borderVertical,key:"borderVertical"},bt:{...r.borderTop,key:"borderTop"},br:{...r.borderRight,key:"borderRight"},bb:{...r.borderBottom,key:"borderBottom"},bl:{...r.borderLeft,key:"borderLeft"},jc:{...r.justifyContent,key:"justifyContent"},ai:{...r.alignItems,key:"alignItems"},ac:{...r.alignContent,key:"alignContent"},d:{...r.flexDirection,key:"flexDirection"}},J=Object.keys(r),Q=Object.keys(z);Y.forEach(a=>{J.forEach(l=>{r[`${l}${a}`]={...r[l]},r[`${l}${a}`].pseudoSuffix=a}),Q.forEach(l=>{z[`${l}${a}`]={...z[l],key:`${z[l].key}${a}`},z[`${l}${a}`].pseudoSuffix=a})});class Z{constructor(){this._index=0,this._cache={}}getIdentity(l){return this._cache[l]||(this._cache[l]=this.getByIndex(this._index++)),this._cache[l]}getByIndex(l){const{first:c,next:v}=K,s=l-c.length;if(s<0)return c[l];const d=Math.floor(s/v.length),n=s-d*v.length;return this.getByIndex(d)+v[n]}}const K={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var O;(a=>{a.boxClassName="_box",a.svgClassName="_svg",a.cronoStylesElementId="crono-styles";const l=`: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;(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;}}
|
|
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
|
-
`,
|
|
8
|
-
`),p=Object.entries(
|
|
9
|
-
`),
|
|
10
|
-
`),
|
|
11
|
-
`),
|
|
5
|
+
.${u.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
|
+
.${u.svgClassName}{transition: all var(--svgTransitionTime);}.${u.svgClassName} path,.${u.svgClassName} circle,.${u.svgClassName} rect,.${u.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
7
|
+
`,m=new J,n=Object.keys(w);let a=!0,b=n.reduce((l,s)=>(l[s]=new Set,l),{});function V(l,s){if(l in w)return d(l,s);if(l in S)return S[l].className}u.get=V;function $(){if(a){let l=c([r]);l=c(l,"H"),l=c(l,"F"),l=c(l,"A"),l=c(l,"Checked"),l=c(l,"Indeterminate"),l=c(l,"Valid"),l=c(l,"Invalid"),l=c(l,"Required"),l=c(l,"Disabled");const s=h();s.innerHTML=l.join(""),a=!1}}u.flush=$;function v(){b=n.reduce((l,s)=>(l[s]=new Set,l),{})}u.clear=v;function d(l,s){var y;b[l].has(s)||(a=!0,b[l].add(s));const t=p(l,s),N=((y=t.formatClassName)==null?void 0:y.call(t,l,s))??`${l}${s}`;return m.getIdentity(N)}function c(l,s){return Object.entries(b).filter(([N])=>{var y;return((y=w[N])==null?void 0:y.pseudoSuffix)===s}).reduce((N,[y,H])=>(H.forEach(k=>{var F;const o=p(y,k),g=`.${d(y,k)}`;let x=[];s?s==="H"?x=[...t(`${g}:hover`,o),...t(`.${S.hover.className}:hover>${g}`,o)]:s==="F"?x=[...t(`${g}:focus-within`,o),...t(`.${S.focus.className}:focus-within>${g}`,o)]:s==="A"?x=t(`${g}:active`,o):s==="Checked"?x=t(`${g}:checked`,o):s==="Indeterminate"?x=t(`${g}:indeterminate`,o):s==="Valid"?x=t(`${g}:valid`,o):s==="Invalid"?x=t(`${g}:invalid`,o):s==="Required"?x=t(`${g}:required`,o):s==="Optional"?x=t(`${g}:optional`,o):s==="Disabled"&&(x=t(`${g}:disabled`,o)):x=t(g,o);const L=((F=o.formatValue)==null?void 0:F.call(o,y,k))??k,M=w[y].cssNames.map(W=>`${W}:${L};`).join("");N.push(`${x.join(",")}{${M}}`)}),N),l);function t(N,y){return y.formatSelector?y.formatSelector(N):[N]}}function p(l,s){const t=w[l];return t.isThemeStyle?t:t.values1.values.includes(s)?t.values1:t.values2.values.includes(s)?t.values2:t.values3}function h(){const s=typeof window<"u"&&typeof window.document<"u"?window.document:global.document;let t=s.getElementById(u.cronoStylesElementId);return t||(t=s.createElement("style"),t.setAttribute("id",u.cronoStylesElementId),t.setAttribute("type","text/css"),s.head.insertBefore(t,s.head.firstChild)),t}})(O||(O={}));const z=O,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}}};var E;(u=>{function r(v){b(v),$(v),u.Styles=v,a()}u.setup=r;function m(v,d){const c=Object.entries(v.colors).map(([o,g])=>`--color${o}: ${g};`).join(`
|
|
8
|
+
`),p=Object.entries(v.shadows).map(([o,g])=>`--shadow${o}: ${g};`).join(`
|
|
9
|
+
`),h=Object.entries(v.backgrounds).map(([o,g])=>`--background${o}: ${g};`).join(`
|
|
10
|
+
`),l=Object.entries(v.backgroundImages).map(([o,g])=>`--backgroundImage${o}: ${g};`).join(`
|
|
11
|
+
`),s=[":root {"];c&&s.push(` ${c}`),p&&s.push(` ${p}`),h&&s.push(` ${h}`),l&&s.push(` ${l}`),s.push("}");const t=Object.keys(v.colors).map(o=>`'${o}'`).join(" | "),N=Object.keys(v.backgrounds).map(o=>`'${o}'`).join(" | "),y=Object.keys(v.backgroundImages).map(o=>`'${o}'`).join(" | "),H=Object.keys(v.shadows).map(o=>`'${o}'`).join(" | "),k=`import '@cronocode/react-box';
|
|
12
12
|
|
|
13
|
-
declare module '${(
|
|
14
|
-
type ColorType = ${
|
|
15
|
-
type BackgroundType = ${
|
|
16
|
-
type BackgroundImageType = ${
|
|
17
|
-
type ShadowType = ${
|
|
13
|
+
declare module '${(d==null?void 0:d.namespacePath)??"@cronocode/react-box/core/types"}' {
|
|
14
|
+
type ColorType = ${t};
|
|
15
|
+
type BackgroundType = ${N};
|
|
16
|
+
type BackgroundImageType = ${y};
|
|
17
|
+
type ShadowType = ${H};
|
|
18
18
|
|
|
19
19
|
namespace Augmented {
|
|
20
20
|
interface BoxProps {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
bgColorF?: ColorType;
|
|
29
|
-
bgColorA?: ColorType;
|
|
30
|
-
bgColorC?: ColorType;
|
|
31
|
-
borderColor?: ColorType;
|
|
32
|
-
borderColorH?: ColorType;
|
|
33
|
-
borderColorF?: ColorType;
|
|
34
|
-
borderColorA?: ColorType;
|
|
35
|
-
borderColorC?: ColorType;
|
|
36
|
-
outlineColor?: ColorType;
|
|
37
|
-
outlineColorH?: ColorType;
|
|
38
|
-
outlineColorF?: ColorType;
|
|
39
|
-
outlineColorA?: ColorType;
|
|
40
|
-
outlineColorC?: ColorType;
|
|
41
|
-
background?: BackgroundType;
|
|
42
|
-
backgroundH?: BackgroundType;
|
|
43
|
-
backgroundF?: BackgroundType;
|
|
44
|
-
backgroundA?: BackgroundType;
|
|
45
|
-
backgroundC?: BackgroundType;
|
|
46
|
-
backgroundImage?: BackgroundImageType;
|
|
47
|
-
backgroundImageH?: BackgroundImageType;
|
|
48
|
-
backgroundImageF?: BackgroundImageType;
|
|
49
|
-
backgroundImageA?: BackgroundImageType;
|
|
50
|
-
backgroundImageC?: BackgroundImageType;
|
|
51
|
-
shadow?: ShadowType;
|
|
52
|
-
shadowH?: ShadowType;
|
|
53
|
-
shadowF?: ShadowType;
|
|
54
|
-
shadowF?: ShadowType;
|
|
55
|
-
shadowA?: ShadowType;
|
|
56
|
-
shadowC?: ShadowType;
|
|
21
|
+
${n("color","ColorType")}
|
|
22
|
+
${n("bgColor","ColorType")}
|
|
23
|
+
${n("borderColor","ColorType")}
|
|
24
|
+
${n("outlineColor","ColorType")}
|
|
25
|
+
${n("background","BackgroundType")}
|
|
26
|
+
${n("backgroundImage","BackgroundImageType")}
|
|
27
|
+
${n("shadow","ShadowType")}
|
|
57
28
|
}
|
|
58
29
|
|
|
59
30
|
interface SvgProps {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
fillF?: ColorType;
|
|
63
|
-
fillA?: ColorType;
|
|
64
|
-
fillC?: ColorType;
|
|
65
|
-
stroke?: ColorType;
|
|
66
|
-
strokeH?: ColorType;
|
|
67
|
-
strokeF?: ColorType;
|
|
68
|
-
strokeA?: ColorType;
|
|
69
|
-
strokeC?: ColorType;
|
|
31
|
+
${n("fill","ColorType")}
|
|
32
|
+
${n("stroke","ColorType")}
|
|
70
33
|
}
|
|
71
34
|
}
|
|
72
35
|
}
|
|
73
|
-
`;return{variables:
|
|
74
|
-
`),boxDts:
|
|
36
|
+
`;return{variables:s.join(`
|
|
37
|
+
`),boxDts:k}}u.setupAugmentedProps=m;function n(v,d){const c=U.map(p=>` ${v}${p}?: ${d};`);return c.unshift(` ${v}?: ${d};`),c.join(`
|
|
38
|
+
`)}function a(){b(T),$(T),Object.keys(T).forEach(d=>{const c=u.Styles[d],p=T[d];c?c.styles={...p.styles,...c.styles}:u.Styles[d]=T[d]})}function b(v){if(!v.components)return;const d=Object.keys(v.components);for(const c of d){const p=v.components[c],h=V(c,p);delete p.children;for(const l of h){const[s,t]=l;v.components[s]=t}}}function V(v,d){if(!d.children)return[];const c=Object.keys(d.children),p=[];for(const h of c){const l=`${v}.${h}`,s=d.children[h],t=V(l,s);p.push(...t),delete s.children,p.push([l,s])}return p}function $(v){const{components:d,...c}=v,p=Object.values(c);d&&p.push(...Object.values(d));for(const h of p)"disabled"in h.styles&&(Object.entries(h.styles.disabled).map(([l,s])=>{h.styles[`${l}Disabled`]=s}),delete h.styles.disabled)}})(E||(E={}));const B=E;function Z(u){const{clean:r,theme:m,component:n}=u;return I.useMemo(()=>{var b,V;if(r)return;let a=B.Styles[n]??((b=B.Styles.components)==null?void 0:b[n]);if(a)return m?{...a.styles,...(V=a.themes)==null?void 0:V[m].styles}:a.styles},[n,r,m])}const K=typeof window<"u"&&typeof window.document<"u",ee=K?I.useLayoutEffect:I.useEffect;function se(u,r){const m=Z(u);return ee(z.flush,[u]),I.useMemo(()=>{const n=[r?z.svgClassName:z.boxClassName],a=m?{...m,...u}:{...u};return Array.isArray(a.disabled)&&(Object.entries(a.disabled[1]).forEach(([b,V])=>{a[`${b}Disabled`]=V}),delete a.disabled),"inline"in a&&(a.display==="block"||!a.display?a.display="inline-block":a.display==="flex"?a.display="inline-flex":a.display==="grid"&&(a.display="inline-grid"),delete a.inline),"inlineH"in a&&(a.displayH==="block"||!a.displayH?a.displayH="inline-block":a.displayH==="flex"?a.displayH="inline-flex":a.displayH==="grid"&&(a.displayH="inline-grid"),delete a.inlineH),"inlineF"in a&&(a.displayF==="block"||!a.displayF?a.displayF="inline-block":a.displayF==="flex"?a.displayF="inline-flex":a.displayF==="grid"&&(a.displayF="inline-grid"),delete a.inlineF),"inlineA"in a&&(a.displayA==="block"||!a.displayA?a.displayA="inline-block":a.displayA==="flex"?a.displayA="inline-flex":a.displayA==="grid"&&(a.displayA="inline-grid"),delete a.inlineA),Object.entries(a).forEach(([b,V])=>{n.push(z.get(b,V))}),n},[u,m])}function P(...u){return u.reduce((r,m)=>m?typeof m=="string"?(r.push(m),r):Array.isArray(m)?(r.push(...P(...m)),r):(Object.entries(m).forEach(([n,a])=>{a&&r.push(n)}),r):r,[])}exports.StylesContext=z;exports.Theme=B;exports.classNames=P;exports.useStyles=se;
|