@cronocode/react-box 2.0.6 → 3.0.0-alpha.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 +13 -7
- package/box.mjs +15 -9
- package/components/baseSvg.d.ts +3 -4
- package/components/button.cjs +1 -1
- package/components/button.d.ts +0 -1
- package/components/button.mjs +1 -1
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.d.ts +2 -5
- package/components/checkbox.mjs +10 -10
- package/components/dataGrid/dataGridContract.d.ts +19 -11
- package/components/dataGrid/useGridData.d.ts +7 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.d.ts +5 -3
- package/components/dataGrid.mjs +17 -28
- package/components/flex.d.ts +3 -5
- package/components/form.cjs +1 -1
- package/components/form.d.ts +0 -1
- package/components/form.mjs +1 -1
- package/components/grid.d.ts +3 -5
- package/components/label.d.ts +0 -1
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.d.ts +1 -3
- package/components/radioButton.mjs +9 -9
- package/components/textarea.cjs +1 -1
- package/components/textarea.d.ts +1 -2
- package/components/textarea.mjs +8 -9
- package/components/textbox.cjs +1 -1
- package/components/textbox.d.ts +0 -2
- package/components/textbox.mjs +1 -1
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +1 -2
- package/components/tooltip.mjs +34 -40
- package/core/boxExtends.d.ts +6 -0
- package/core/boxStyles.d.ts +701 -1217
- package/core/boxStylesFormatters.d.ts +2 -2
- package/core/coreTypes.d.ts +31 -0
- package/core/theme.d.ts +13 -32
- package/core/useStyles.d.ts +12 -3
- package/core/useTheme.d.ts +7 -10
- package/core.cjs +4 -34
- package/core.mjs +1397 -1158
- package/package.json +20 -25
- package/ssg.d.ts +0 -1
- package/types.d.ts +26 -0
- package/utils/object/objectUtils.d.ts +2 -0
- package/components/dataGrid/useGrid.d.ts +0 -3
- package/core/stylesContext.d.ts +0 -13
- package/core/theme.cjs +0 -1
- package/core/theme.mjs +0 -4
- package/core/types.d.ts +0 -60
- package/utils.cjs +0 -1
- package/utils.mjs +0 -63
|
@@ -4,8 +4,8 @@ export declare namespace BoxStylesFormatters {
|
|
|
4
4
|
function svg(selector: string): string[];
|
|
5
5
|
}
|
|
6
6
|
namespace Value {
|
|
7
|
-
function rem(
|
|
8
|
-
function px(
|
|
7
|
+
function rem(value: number): string;
|
|
8
|
+
function px(value: number): string;
|
|
9
9
|
function fraction(_key: string, value: string): string;
|
|
10
10
|
function widthHeight(key: string, value: string): string;
|
|
11
11
|
function variables(prefix: string): (key: string, value: string) => string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type ArrayType<T> = T extends (infer U)[] ? U : T;
|
|
2
|
+
export type BoxStylesType<T> = T extends ReadonlyArray<infer U> ? T[number] : T;
|
|
3
|
+
export type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
4
|
+
export type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
5
|
+
interface BoxStyleArrayString {
|
|
6
|
+
values: ReadonlyArray<string>;
|
|
7
|
+
valueFormat?: (value: string) => string;
|
|
8
|
+
}
|
|
9
|
+
interface BoxStyleArrayBoolean {
|
|
10
|
+
values: ReadonlyArray<boolean>;
|
|
11
|
+
valueFormat?: (value: boolean) => string;
|
|
12
|
+
}
|
|
13
|
+
interface BoxStyleArrayNumber {
|
|
14
|
+
values: ReadonlyArray<number>;
|
|
15
|
+
valueFormat?: (value: number) => string;
|
|
16
|
+
}
|
|
17
|
+
interface BoxStyleNumber {
|
|
18
|
+
values: number;
|
|
19
|
+
valueFormat?: (value: number) => string;
|
|
20
|
+
}
|
|
21
|
+
interface BoxStyleString {
|
|
22
|
+
values: string;
|
|
23
|
+
valueFormat?: (value: string) => string;
|
|
24
|
+
}
|
|
25
|
+
export type BoxStyle = (BoxStyleArrayString | BoxStyleArrayBoolean | BoxStyleArrayNumber | BoxStyleNumber | BoxStyleString) & {
|
|
26
|
+
styleName?: string;
|
|
27
|
+
};
|
|
28
|
+
export type ExtractKeys<T extends Record<string, unknown>, TT> = {
|
|
29
|
+
[K in keyof T]?: TT;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
package/core/theme.d.ts
CHANGED
|
@@ -1,41 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
styles: T;
|
|
5
|
-
}
|
|
6
|
-
export interface ThemeComponentStyles<T = BoxStyleProps> extends ThemeStyles<T> {
|
|
1
|
+
import { BoxThemeStyles } from '../types';
|
|
2
|
+
export interface ThemeComponentStyles {
|
|
3
|
+
styles: BoxThemeStyles;
|
|
7
4
|
themes?: {
|
|
8
|
-
[name: string]:
|
|
9
|
-
};
|
|
10
|
-
children?: {
|
|
11
|
-
[name: string]: ThemeComponentStyles<T>;
|
|
5
|
+
[name: string]: BoxThemeStyles;
|
|
12
6
|
};
|
|
13
7
|
}
|
|
14
|
-
export interface ThemeSetup
|
|
8
|
+
export interface ThemeSetup {
|
|
15
9
|
components?: {
|
|
16
|
-
[name: string]: ThemeComponentStyles
|
|
10
|
+
[name: string]: ThemeComponentStyles;
|
|
17
11
|
};
|
|
18
|
-
button?: ThemeComponentStyles
|
|
19
|
-
textbox?: ThemeComponentStyles
|
|
20
|
-
textarea?: ThemeComponentStyles
|
|
21
|
-
checkbox?: ThemeComponentStyles
|
|
22
|
-
radioButton?: ThemeComponentStyles
|
|
23
|
-
label?: ThemeComponentStyles
|
|
24
|
-
}
|
|
25
|
-
interface BoxAugmentedProps {
|
|
26
|
-
colors?: Record<string, string>;
|
|
27
|
-
shadows?: Record<string, string>;
|
|
28
|
-
backgrounds?: Record<string, string>;
|
|
29
|
-
backgroundImages?: Record<string, string>;
|
|
12
|
+
button?: ThemeComponentStyles;
|
|
13
|
+
textbox?: ThemeComponentStyles;
|
|
14
|
+
textarea?: ThemeComponentStyles;
|
|
15
|
+
checkbox?: ThemeComponentStyles;
|
|
16
|
+
radioButton?: ThemeComponentStyles;
|
|
17
|
+
label?: ThemeComponentStyles;
|
|
30
18
|
}
|
|
31
19
|
declare namespace Theme {
|
|
32
|
-
|
|
33
|
-
function setup(styles: ThemeSetup<BoxThemeProps>): void;
|
|
34
|
-
function setupAugmentedProps(props: BoxAugmentedProps, options?: {
|
|
35
|
-
namespacePath?: string;
|
|
36
|
-
}): {
|
|
37
|
-
variables: string;
|
|
38
|
-
boxDts: string;
|
|
39
|
-
};
|
|
20
|
+
function setup(styles: ThemeSetup): void;
|
|
40
21
|
}
|
|
41
22
|
export default Theme;
|
package/core/useStyles.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import { BoxStyleProps } from '
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { BoxStyleProps, PseudoClassesType } from '../types';
|
|
2
|
+
export default function useStyles(props: BoxStyleProps, isSvg: boolean): string[];
|
|
3
|
+
declare namespace StylesContextImpl {
|
|
4
|
+
function addClassNames(props: BoxStyleProps, classNames: string[], currentPseudoClasses: PseudoClassesType[], breakpoint?: string, pseudoClassParentName?: string): void;
|
|
5
|
+
function flush(): void;
|
|
6
|
+
function clear(): void;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace StylesContext {
|
|
9
|
+
const flush: typeof StylesContextImpl.flush;
|
|
10
|
+
const clear: typeof StylesContextImpl.clear;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
package/core/useTheme.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
component?: ReservedComponentName;
|
|
8
|
-
theme?: string;
|
|
1
|
+
import { ThemeProps, BoxThemeStyles } from '../types';
|
|
2
|
+
import { ThemeComponentStyles } from './theme';
|
|
3
|
+
export declare namespace ThemeInternal {
|
|
4
|
+
let components: {
|
|
5
|
+
[name: string]: ThemeComponentStyles;
|
|
6
|
+
};
|
|
9
7
|
}
|
|
10
|
-
export declare function useTheme(props:
|
|
11
|
-
export {};
|
|
8
|
+
export declare function useTheme(props: ThemeProps): BoxThemeStyles | undefined;
|
package/core.cjs
CHANGED
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
"use strict";const H=require("react"),X=require("./utils.cjs");var s;(e=>{(l=>{function u(t,d){return`${t}${d.replace("/","-")}`}l.fraction=u;function n(t){return[`${t} path`,`${t} circle`,`${t} rect`,`${t} line`]}l.svg=n})(e.ClassName||(e.ClassName={})),(l=>{function u(r,a){return`${a/4}rem`}l.rem=u;function n(r,a){return`${a}px`}l.px=n;function t(r,a){const[o,v]=a.split("/");return`${+o/+v*100}%`}l.fraction=t;function d(r,a){switch(a){case"fit":return"100%";case"fit-screen":return r.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return a}}l.widthHeight=d;function p(r){return(a,o)=>`var(--${r}${o});`}l.variables=p;function k(r){return(a,o)=>`var(--${r}${o});`}l.svgVariables=k;function E(r,a){return`repeat(${a},minmax(0,1fr))`}l.gridColumns=E;function C(r,a){return a==="full-row"?"1/-1":`span ${a}/span ${a}`}l.gridColumn=C;function i(r,a){return`${a}ms`}l.ms=i;function m(r,a){return`${a}deg`}l.rotate=m;function f(r,a){return a==="xAxis"?"-1 1":"1 -1"}l.flip=f})(e.Value||(e.Value={}))})(s||(s={}));const c=[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,110,120,128,130,140,150,160,170,180,190,192,200,225,250,256,275,300,320,350,384,400],ae=[-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],h=[...c,...ae],W=["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"],_=["auto","hidden","scroll","visible"],O=["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"],I=["fit","fit-screen","auto","fit-content","max-content","min-content"],F=["auto","flex-start","flex-end","center","baseline","stretch"],le={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],formatValue:()=>"inline-block"},values2:{values:[]},values3:{values:[]}},boxSizing:{cssNames:["box-sizing"],values1:{values:["border-box","content-box"]},values2:{values:[]},values3:{values:[]}},width:{cssNames:["width"],values1:{values:I,formatValue:s.Value.widthHeight},values2:{values:c,formatValue:s.Value.rem},values3:{values:O,formatValue:s.Value.fraction}},minWidth:{cssNames:["min-width"],values1:{values:I,formatValue:s.Value.widthHeight},values2:{values:c,formatValue:s.Value.rem},values3:{values:O,formatValue:s.Value.fraction}},maxWidth:{cssNames:["max-width"],values1:{values:I,formatValue:s.Value.widthHeight},values2:{values:c,formatValue:s.Value.rem},values3:{values:O,formatValue:s.Value.fraction}},height:{cssNames:["height"],values1:{values:I,formatValue:s.Value.widthHeight},values2:{values:c,formatValue:s.Value.rem},values3:{values:O,formatValue:s.Value.fraction}},minHeight:{cssNames:["min-height"],values1:{values:I,formatValue:s.Value.widthHeight},values2:{values:c,formatValue:s.Value.rem},values3:{values:O,formatValue:s.Value.fraction}},maxHeight:{cssNames:["max-height"],values1:{values:I,formatValue:s.Value.widthHeight},values2:{values:c,formatValue:s.Value.rem},values3:{values:O,formatValue:s.Value.fraction}},position:{cssNames:["position"],values1:{values:["static","relative","absolute","fixed","sticky"]},values2:{values:[]},values3:{values:[]}},top:{cssNames:["top"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},right:{cssNames:["right"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},bottom:{cssNames:["bottom"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},left:{cssNames:["left"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},inset:{cssNames:["inset"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},m:{cssNames:["margin"],values1:{values:h,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mx:{cssNames:["margin-inline"],values1:{values:h,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},my:{cssNames:["margin-block"],values1:{values:h,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mt:{cssNames:["margin-top"],values1:{values:h,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mr:{cssNames:["margin-right"],values1:{values:h,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mb:{cssNames:["margin-bottom"],values1:{values:h,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},ml:{cssNames:["margin-left"],values1:{values:h,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},p:{cssNames:["padding"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},px:{cssNames:["padding-inline"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},py:{cssNames:["padding-block"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pt:{cssNames:["padding-top"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pr:{cssNames:["padding-right"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pb:{cssNames:["padding-bottom"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pl:{cssNames:["padding-left"],values1:{values:h,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},b:{cssNames:["border-width"],values1:{values:c,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bx:{cssNames:["border-inline-width"],values1:{values:h,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},by:{cssNames:["border-block-width"],values1:{values:h,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bt:{cssNames:["border-top-width"],values1:{values:h,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},br:{cssNames:["border-right-width"],values1:{values:h,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bb:{cssNames:["border-bottom-width"],values1:{values:h,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bl:{cssNames:["border-left-width"],values1:{values:h,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},borderStyle:{cssNames:["border-style"],values1:{values:W},values2:{values:[]},values3:{values:[]}},borderRadius:{cssNames:["border-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTop:{cssNames:["border-top-left-radius","border-top-right-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusRight:{cssNames:["border-top-right-radius","border-bottom-right-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottom:{cssNames:["border-bottom-left-radius","border-bottom-right-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusLeft:{cssNames:["border-top-left-radius","border-bottom-left-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopLeft:{cssNames:["border-top-left-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopRight:{cssNames:["border-top-right-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomLeft:{cssNames:["border-bottom-left-radius"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomRight:{cssNames:["border-bottom-right-radius"],values1:{values:c,formatValue:s.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:_},values2:{values:[]},values3:{values:[]}},overflowX:{cssNames:["overflow-x"],values1:{values:_},values2:{values:[]},values3:{values:[]}},overflowY:{cssNames:["overflow-y"],values1:{values:_},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:c,formatValue:s.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:c,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},lineHeight:{cssNames:["line-height"],values1:{values:c,formatValue:s.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:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},rowGap:{cssNames:["row-gap"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},columnGap:{cssNames:["column-gap"],values1:{values:c,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},order:{cssNames:["order"],values1:{values:c},values2:{values:[]},values3:{values:[]}},flexGrow:{cssNames:["flex-grow"],values1:{values:c},values2:{values:[]},values3:{values:[]}},flexShrink:{cssNames:["flex-shrink"],values1:{values:c},values2:{values:[]},values3:{values:[]}},alignSelf:{cssNames:["align-self"],values1:{values:F},values2:{values:[]},values3:{values:[]}},justifySelf:{cssNames:["justify-self"],values1:{values:F},values2:{values:[]},values3:{values:[]}},gridColumns:{cssNames:["grid-template-columns"],values1:{values:c,formatValue:s.Value.gridColumns},values2:{values:[]},values3:{values:[]}},colSpan:{cssNames:["grid-column"],values1:{values:c,formatValue:s.Value.gridColumn},values2:{values:["full-row"],formatValue:s.Value.gridColumn},values3:{values:[]}},colStart:{cssNames:["grid-column-start"],values1:{values:c},values2:{values:[]},values3:{values:[]}},colEnd:{cssNames:["grid-column-end"],values1:{values:c},values2:{values:[]},values3:{values:[]}},outline:{cssNames:["outline-width"],values1:{values:c,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},outlineStyle:{cssNames:["outline-style"],values1:{values:W},values2:{values:[]},values3:{values:[]}},outlineOffset:{cssNames:["outline-offset"],values1:{values:c,formatValue:s.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:s.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","auto","menulist-button","textfield","button","checkbox"]},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:s.Value.rotate},values2:{values:[]},values3:{values:[]}},flip:{cssNames:["scale"],values1:{values:["xAxis","yAxis"],formatValue:s.Value.flip},values2:{values:[]},values3:{values:[]}},visibility:{cssNames:["visibility"],values1:{values:["visible","hidden","collapse"]},values2:{values:[]},values3:{values:[]}},resize:{cssNames:["resize"],values1:{values:["none","both","horizontal","vertical","block","inline"]},values2:{values:[]},values3:{values:[]}}},K={shadow:{cssNames:["box-shadow"],formatValue:s.Value.variables("shadow")},background:{cssNames:["background"],formatValue:s.Value.variables("background")},backgroundImage:{cssNames:["background-image"],formatValue:s.Value.variables("backgroundImage")},color:{cssNames:["color"],formatValue:s.Value.variables("color")},bgColor:{cssNames:["background-color"],formatValue:s.Value.variables("color")},borderColor:{cssNames:["border-color"],formatValue:s.Value.variables("color")},outlineColor:{cssNames:["outline-color"],formatValue:s.Value.variables("color")}},M={fill:{cssNames:["fill"],formatValue:s.Value.svgVariables("color"),formatSelector:s.ClassName.svg},stroke:{cssNames:["stroke"],formatValue:s.Value.svgVariables("color"),formatSelector:s.ClassName.svg}},ue=["disabledGroup","hoverGroup","focusGroup","activeGroup"],P=["hover","focus","hasFocus","active","checked","hasChecked","indeterminate","valid","hasValid","invalid","hasInvalid","required","optional","disabled","hasDisabled"],B=["sm","md","lg","xl","xxl"],te={sm:640,md:768,lg:1024,xl:1280,xxl:1536};function Y(){const e={...le};Object.keys(K).forEach(u=>{e[u]=K[u],e[u].isThemeStyle=!0}),Object.keys(M).forEach(u=>{e[u]=M[u],e[u].isThemeStyle=!0});let l=Object.keys(e);return P.forEach(u=>{l.forEach(n=>{e[`${n}${u}`]={...e[n],pseudoSuffix:u}})}),l=Object.keys(e),B.forEach(u=>{l.forEach(n=>{e[`${u}${n}`]={...e[n],breakpoint:u}})}),e}let $=Y();function oe(){$=Y()}function re(e,l,u){const n=Object.entries($).filter(([t,d])=>d.pseudoSuffix===e&&!d.customPseudoSuffix&&!(`${t}${l}`in $)).map(([t])=>t);return n.forEach(t=>{$[`${t}${l}`]={...$[t],customPseudoSuffix:u+l}}),n.map(t=>`${t}${l}`)}class ne{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:u,next:n}=ve,t=l-u.length;if(t<0)return u[l];const d=Math.floor(t/n.length),p=t-d*n.length;return this.getByIndex(d)+n[p]}}const ve={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var D;(e=>{e.boxClassName="_box",e.svgClassName="_svg",e.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 T=require("react");function k(...e){return e.reduce((t,s)=>s?typeof s=="string"?(t.push(s),t):Array.isArray(s)?(t.push(...k(...s)),t):(Object.entries(s).forEach(([u,m])=>{m&&t.push(u)}),t):t,[])}var c;(e=>{(t=>{function s(m,n){return`${m}${n.replace("/","-")}`}t.fraction=s;function u(m){return[`${m} path`,`${m} circle`,`${m} rect`,`${m} line`]}t.svg=u})(e.ClassName||(e.ClassName={})),(t=>{function s(h){return`${h/4}rem`}t.rem=s;function u(h){return`${h}px`}t.px=u;function m(h,r){const[i,l]=r.split("/");return`${+i/+l*100}%`}t.fraction=m;function n(h,r){switch(r){case"fit":return"100%";case"fit-screen":return h.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return r}}t.widthHeight=n;function d(h){return(r,i)=>`var(--${h}${i});`}t.variables=d;function o(h){return(r,i)=>`var(--${h}${i});`}t.svgVariables=o;function v(h,r){return`repeat(${r},minmax(0,1fr))`}t.gridColumns=v;function y(h,r){return r==="full-row"?"1/-1":`span ${r}/span ${r}`}t.gridColumn=y;function a(h,r){return`${r}ms`}t.ms=a;function f(h,r){return`${r}deg`}t.rotate=f;function p(h,r){return r==="xAxis"?"-1 1":"1 -1"}t.flip=p})(e.Value||(e.Value={}))})(c||(c={}));const _={appearance:[{values:["none","auto","menulist-button","textfield","button","checkbox"]}],b:[{values:0,styleName:"border-width",valueFormat:c.Value.px}],bx:[{values:0,styleName:"border-inline-width",valueFormat:c.Value.px}],by:[{values:0,styleName:"border-block-width",valueFormat:c.Value.px}],bt:[{values:0,styleName:"border-top-width",valueFormat:c.Value.px}],br:[{values:0,styleName:"border-right-width",valueFormat:c.Value.px}],bb:[{values:0,styleName:"border-bottom-width",valueFormat:c.Value.px}],bl:[{values:0,styleName:"border-left-width",valueFormat:c.Value.px}],borderStyle:[{styleName:"border-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],borderRadius:[{styleName:"border-radius",values:0,valueFormat:c.Value.rem}],borderRadiusTop:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem ${e/4}rem 0 0`}],borderRadiusRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 ${e/4}rem ${e/4}rem 0`}],borderRadiusBottom:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 ${e/4}rem ${e/4}rem`}],borderRadiusLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem 0 0 ${e/4}rem`}],borderRadiusTopLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`${e/4}rem 0 0 0`}],borderRadiusTopRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 ${e/4}rem 0 0`}],borderRadiusBottomRight:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 ${e/4}rem 0`}],borderRadiusBottomLeft:[{values:0,styleName:"border-radius",valueFormat:e=>`0 0 0 ${e/4}rem`}],position:[{values:["static","relative","absolute","fixed","sticky"]}],top:[{values:0,valueFormat:c.Value.rem}],right:[{values:0,valueFormat:c.Value.rem}],bottom:[{values:0,valueFormat:c.Value.rem}],left:[{values:0,valueFormat:c.Value.rem}],inset:[{values:0,valueFormat:c.Value.rem}],boxSizing:[{values:["border-box","content-box"],styleName:"box-sizing"}],contentVisibility:[{values:["visible","hidden"],styleName:"content-visibility"}],cursor:[{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]}],display:[{values:["none","block","inline-block","flex","inline-flex","grid","inline-grid","contents"]}],inline:[{values:[!0],styleName:"display",valueFormat:()=>"inline-block"}],jc:[{styleName:"justify-content",values:["start","end","flex-start","flex-end","center","left","right","space-between","space-around","space-evenly","stretch"]}],ai:[{styleName:"align-items",values:["stretch","flex-start","flex-end","center","baseline","start","end","self-start","self-end"]}],alignContent:[{styleName:"align-content",values:["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch","start","end","baseline"]}],flex1:[{styleName:"flex",values:[!0],valueFormat:()=>"1"}],d:[{styleName:"flex-direction",values:["row","row-reverse","column","column-reverse"]}],flexWrap:[{styleName:"flex-wrap",values:["nowrap","wrap","wrap-reverse"]}],flexGrow:[{styleName:"flex-grow",values:0}],flexShrink:[{styleName:"flex-shrink",values:0}],alignSelf:[{styleName:"align-self",values:["auto","flex-start","flex-end","center","baseline","stretch"]}],justifySelf:[{styleName:"justify-self",values:["auto","flex-start","flex-end","center","baseline","stretch"]}],fontSize:[{styleName:"font-size",values:0,valueFormat:c.Value.px},{styleName:"font-size",values:["inherit"]}],fontStyle:[{styleName:"font-style",values:["italic","normal","oblique"]}],fontWeight:[{styleName:"font-weight",values:[100,200,300,400,500,600,700,800,900]}],gap:[{values:0,valueFormat:c.Value.rem}],rowGap:[{styleName:"row-gap",values:0,valueFormat:c.Value.rem}],columnGap:[{styleName:"column-gap",values:0,valueFormat:c.Value.rem}],order:[{styleName:"order",values:0}],height:[{values:0,valueFormat:e=>`${e/4}rem`},{values:["fit"],valueFormat:()=>"100%"},{values:["fit-screen"],valueFormat:()=>"100vh"},{values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{values:["auto","fit-content","max-content","min-content"]}],minHeight:[{styleName:"min-height",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"min-height",values:["fit"],valueFormat:()=>"100%"},{styleName:"min-height",values:["fit-screen"],valueFormat:()=>"100vh"},{styleName:"min-height",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"min-height",values:["auto","fit-content","max-content","min-content"]}],maxHeight:[{styleName:"max-height",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"max-height",values:["fit"],valueFormat:()=>"100%"},{styleName:"max-height",values:["fit-screen"],valueFormat:()=>"100vh"},{styleName:"max-height",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"max-height",values:["auto","fit-content","max-content","min-content"]}],width:[{values:0,valueFormat:e=>`${e/4}rem`},{values:["fit"],valueFormat:()=>"100%"},{values:["fit-screen"],valueFormat:()=>"100vw"},{values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{values:["auto","fit-content","max-content","min-content"]}],minWidth:[{styleName:"min-width",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"min-width",values:["fit"],valueFormat:()=>"100%"},{styleName:"min-width",values:["fit-screen"],valueFormat:()=>"100vw"},{styleName:"min-width",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"min-width",values:["auto","fit-content","max-content","min-content"]}],maxWidth:[{styleName:"max-width",values:0,valueFormat:e=>`${e/4}rem`},{styleName:"max-width",values:["fit"],valueFormat:()=>"100%"},{styleName:"max-width",values:["fit-screen"],valueFormat:()=>"100vw"},{styleName:"max-width",values:["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12"],valueFormat:e=>{const[t,s]=e.split("/");return`${+t/+s*100}%`}},{styleName:"max-width",values:["auto","fit-content","max-content","min-content"]}],letterSpacing:[{styleName:"letter-spacing",values:0,valueFormat:c.Value.px}],lineHeight:[{styleName:"line-height",values:0,valueFormat:c.Value.px},{styleName:"line-height",values:["font-size"],valueFormat:e=>"1"}],listStyle:[{styleName:"list-style",values:["square","inside","outside","none"]}],m:[{values:0,styleName:"margin",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin"}],mx:[{values:0,styleName:"margin-inline",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-inline"}],my:[{values:0,styleName:"margin-block",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-block"}],mt:[{values:0,styleName:"margin-top",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-top"}],mr:[{values:0,styleName:"margin-right",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-right"}],mb:[{values:0,styleName:"margin-bottom",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-bottom"}],ml:[{values:0,styleName:"margin-left",valueFormat:c.Value.rem},{values:["auto"],styleName:"margin-left"}],p:[{values:0,styleName:"padding",valueFormat:c.Value.rem}],px:[{values:0,styleName:"padding-inline",valueFormat:c.Value.rem}],py:[{values:0,styleName:"padding-block",valueFormat:c.Value.rem}],pt:[{values:0,styleName:"padding-top",valueFormat:c.Value.rem}],pr:[{values:0,styleName:"padding-right",valueFormat:c.Value.rem}],pb:[{values:0,styleName:"padding-bottom",valueFormat:c.Value.rem}],pl:[{values:0,styleName:"padding-left",valueFormat:c.Value.rem}],objectFit:[{styleName:"object-fit",values:["fill","contain","cover","scale-down","none"]}],opacity:[{values:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]}],outline:[{styleName:"outline-width",values:0,valueFormat:c.Value.px}],outlineStyle:[{styleName:"outline-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],outlineOffset:[{styleName:"outline-offset",values:0,valueFormat:c.Value.px}],overflow:[{values:["auto","hidden","scroll","visible"]}],overflowX:[{styleName:"overflow-x",values:["auto","hidden","scroll","visible"]}],overflowY:[{styleName:"overflow-y",values:["auto","hidden","scroll","visible"]}],pointerEvents:[{styleName:"pointer-events",values:["none","auto","all"]}],resize:[{values:["none","both","horizontal","vertical","block","inline"]}],rotate:[{values:[0,90,180,270,-90,-180,-270],valueFormat:e=>`${e}deg`}],flip:[{styleName:"scale",values:["xAxis","yAxis"],valueFormat:e=>e==="xAxis"?"-1 1":"1 -1"}],textAlign:[{styleName:"text-align",values:["left","right","center","justify"]}],textDecoration:[{styleName:"text-decoration",values:["none","underline","overline","line-through"]}],textOverflow:[{styleName:"text-overflow",values:["clip","ellipsis"]}],textTransform:[{styleName:"text-transform",values:["none","capitalize","lowercase","uppercase"]}],textWrap:[{styleName:"text-wrap",values:["wrap","nowrap","balance","pretty"]}],transition:[{styleName:"transition-property",values:["none","all"]}],transitionDuration:[{styleName:"transition-duration",values:[50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1e3],valueFormat:e=>`${e}ms`}],userSelect:[{styleName:"user-select",values:["none","auto","text","all"]}],visibility:[{styleName:"visibility",values:["visible","hidden","collapse"]}],whiteSpace:[{styleName:"white-space",values:["break-spaces","normal","nowrap","pre","pre-line","pre-wrap"]}],zIndex:[{styleName:"z-index",values:[1,2,3,4,5,10,11,12,13,14,15,100,101,102,103,104,105,1e3,1001,1002,1003,1004,1005]}],gridTemplateColumns:[{styleName:"grid-template-columns",values:0,valueFormat:e=>`repeat(${e},minmax(0,1fr))`},{styleName:"grid-template-columns",values:["subgrid"]}],gridTemplateRows:[{styleName:"grid-template-rows",values:0,valueFormat:e=>`repeat(${e},minmax(0,1fr))`},{styleName:"grid-template-rows",values:["subgrid"]}],gridColumn:[{styleName:"grid-column",values:0,valueFormat:e=>`span ${e}/span ${e}`},{styleName:"grid-column",values:["full-row"],valueFormat:()=>"1/-1"}],gridColumnStart:[{styleName:"grid-column-start",values:0}],gridColumnEnd:[{styleName:"grid-column-end",values:0}],gridRow:[{styleName:"grid-row",values:0,valueFormat:e=>`span ${e}/span ${e}`},{styleName:"grid-row",values:["full-column"],valueFormat:()=>"1/-1"}],gridRowStart:[{styleName:"grid-row-start",values:0}],gridRowEnd:[{styleName:"grid-row-end",values:0}]},ee={hover:":hover",focus:":focus-within",hasFocus:":has(:focus)",active:":active",valid:":user-valid",hasValid:":has(:valid)",invalid:":user-invalid",hasInvalid:":has(:user-invalid)",optional:":optional",hasChecked:":has(:checked)",hasRequired:":has(:required)",hasDisabled:":has([disabled])"},I={indeterminate:":indeterminate",checked:":checked",required:":required",disabled:"[disabled]"},M={...ee,...I},te=Object.entries(M).reduce((e,[t],s)=>(e[t]=Math.pow(2,s),e),{}),q=Object.entries(M).reduce((e,[t])=>{const s=te[t];return Object.entries(e).forEach(([u,m])=>{e[+u+s]=[...m,t]}),e},{0:[]}),H={hoverGroup:"hover",focusGroup:"focus",activeGroup:"active"},C={sm:640,md:768,lg:1024,xl:1280,xxl:1536};var K;(e=>{function t(n,d,o){const v={...n},y=v.props||{};return d.forEach(a=>{a in v&&(y[a]=v[a],delete v[a])}),o&&Object.entries(o).forEach(([a,f])=>{y[a]=f}),v.props=y,v}e.buildProps=t;function s(n){return!!n&&typeof n=="object"}e.isObject=s;function u(...n){return n.reduce((d,o)=>(Object.keys(o).forEach(v=>{const y=d[v],a=o[v];v in I&&typeof a=="boolean"||(v in I&&Array.isArray(a)?d[v]=u(y,a[1]??{}):Array.isArray(y)&&Array.isArray(a)?d[v]=y.concat(...a):s(y)&&s(a)?d[v]=u(y,a):d[v]=a)}),d),{})}e.mergeDeep=u;function m(n,d){return n in d}e.isKeyOf=m})(K||(K={}));const x=K;class ne{constructor(){this._index=0,this._cache={}}getIdentity(t){return this._cache[t]||(this._cache[t]=this.getByIndex(this._index++)),this._cache[t]}getByIndex(t){const{first:s,next:u}=ie,m=t-s.length;if(m<0)return s[t];const n=Math.floor(m/u.length),d=m-n*u.length;return this.getByIndex(n)+u[d]}}const ie={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var L;(e=>{let t="";function s(m,n){return t=Object.entries(m).map(([d,o])=>`--${d}: ${o};`).join(""),Object.entries(n).forEach(([d,o])=>{_[d]=o}),n}e.extend=s;function u(){return t}e.getVariables=u})(L||(L={}));const se=L;var R;(e=>{e.components={}})(R||(R={}));function oe(e){const{clean:t,theme:s,component:u}=e;return T.useMemo(()=>{var n,d;if(t)return;let m=(n=R.components)==null?void 0:n[u];if(m)return s?x.mergeDeep(m.styles,((d=m.themes)==null?void 0:d[s])??{}):m.styles},[u,t,s])}const ue=new ne,me=typeof window<"u"&&typeof window.document<"u";var P;const ae=typeof process=="object"&&((P=process.env)==null?void 0:P.NODE_ENV)==="test",ce=me&&!ae?T.useLayoutEffect:T.useEffect,re="_b",j="_s";function de(e,t){ce(O.flush,[e]);const s=oe(e);return T.useMemo(()=>{var n;const u=[t?j:re];(n=e.props)==null||n.name;const m=s?x.mergeDeep(s,e):e;return O.addClassNames(m,u,[]),u},[e,t,s])}var O;(e=>{let t=!0,s={};function u(a,f,p,h,r){Object.entries(a).forEach(([i,l])=>{if(x.isKeyOf(i,_))d(i,l,f,p,h,r);else if(x.isKeyOf(i,ee))u(l,f,[...p,i],h,r);else if(x.isKeyOf(i,I)){if(Array.isArray(l)){const[g,b]=l;u(b,f,[...p,i],h,r)}x.isObject(l)&&u(l,f,[...p,i],h,r)}else x.isKeyOf(i,C)?u(l,f,p,i,r):x.isKeyOf(i,H)&&(typeof l=="string"?f.push(`${H[i]}-${l}`):Object.entries(l).forEach(([g,b])=>{u(b,f,[...p,H[i]],h,g)}))})}e.addClassNames=u;function m(){if(!t)return;console.debug("\x1B[36m%s\x1B[0m","[react-box]: flush");const a=Object.entries(_).reduce((i,[l],g)=>(i[l]=g,i),{}),f=`:root{${se.getVariables()}--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;}#crono-box {position: absolute;top: 0;left: 0;height: 0;}
|
|
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
|
-
`),V=Object.entries(r).map(([g,j])=>`--shadow${g}: ${j};`).join(`
|
|
9
|
-
`),b=Object.entries(a).map(([g,j])=>`--background${g}: ${j};`).join(`
|
|
10
|
-
`),x=Object.entries(o).map(([g,j])=>`--backgroundImage${g}: ${j};`).join(`
|
|
11
|
-
`),N=[":root {"];v&&N.push(` ${v}`),V&&N.push(` ${V}`),b&&N.push(` ${b}`),x&&N.push(` ${x}`),N.push("}");const y=Object.keys(f).map(g=>`'${g}'`).join(" | "),S=Object.keys(a).map(g=>`'${g}'`).join(" | "),z=Object.keys(o).map(g=>`'${g}'`).join(" | "),G=Object.keys(r).map(g=>`'${g}'`).join(" | "),R=`import '@cronocode/react-box';
|
|
12
|
-
|
|
13
|
-
declare module '${(m==null?void 0:m.namespacePath)??"@cronocode/react-box/core/types"}' {
|
|
14
|
-
type ColorType = ${y};
|
|
15
|
-
type BackgroundType = ${S};
|
|
16
|
-
type BackgroundImageType = ${z};
|
|
17
|
-
type ShadowType = ${G};
|
|
18
|
-
|
|
19
|
-
namespace Augmented {
|
|
20
|
-
interface BoxProps {
|
|
21
|
-
color?: ColorType;
|
|
22
|
-
bgColor?: ColorType;
|
|
23
|
-
borderColor?: ColorType;
|
|
24
|
-
outlineColor?: ColorType;
|
|
25
|
-
background?: BackgroundType;
|
|
26
|
-
backgroundImage?: BackgroundImageType;
|
|
27
|
-
shadow?: ShadowType;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface SvgProps {
|
|
31
|
-
fill?: ColorType;
|
|
32
|
-
stroke?: ColorType;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`;return{variables:N.join(`
|
|
37
|
-
`),boxDts:R}}e.setupAugmentedProps=u;function n(i){const m=t(i);if(m.components)return Object.entries(m.components).forEach(([f,r])=>{var o;const a=(o=e.Styles.components)==null?void 0:o[f];a?e.Styles.components[f].styles={...a.styles,...r.styles}:e.Styles.components[f]=r}),m}function t(i){return d(i),p(i),E(i),i}function d(i){const{components:m,...f}=i,r=Object.entries(f);r.length&&!i.components&&(i.components={});for(const a of r){const[o,v]=a;i.components[o]=v,delete i[o]}}function p(i){if(!i.components)return;const m=Object.keys(i.components);for(const f of m){const r=i.components[f],a=k(f,r);delete r.children;for(const o of a){const[v,V]=o;i.components[v]=V}}}function k(i,m){if(!m.children)return[];const f=Object.keys(m.children),r=[];for(const a of f){const o=`${i}.${a}`,v=m.children[a],V=k(o,v);r.push(...V),delete v.children,r.push([o,v])}return r}function E(i){if(!i.components)return;const m=Object.values(i.components);for(const f of m)C(f.styles),B.forEach(r=>{if(r in f.styles){const a=f.styles[r];C(a)}}),f.themes&&Object.values(f.themes).forEach(r=>{C(r),B.forEach(a=>{if(a in r){const o=r[a];C(o)}})})}function C(i){P.forEach(m=>{if(m in i){const f=i[m];Object.entries(f).map(([r,a])=>{i[`${r}${m}`]=a}),delete i[m]}})}})(q||(q={}));const J=q;function ce(e){const{clean:l,theme:u,component:n}=e;return H.useMemo(()=>{var d,p;if(l)return;let t=(d=J.Styles.components)==null?void 0:d[n];if(t)return u?{...t.styles,...(p=t.themes)==null?void 0:p[u]}:t.styles},[n,l,u])}const me=typeof window<"u"&&typeof window.document<"u",de=me?H.useLayoutEffect:H.useEffect;function fe(e,l){const u=ce(e);return de(T.flush,[e]),H.useMemo(()=>{const n=[l?T.svgClassName:T.boxClassName],t=u?{...u,...e}:{...e};return U(t),Object.entries(t).forEach(([d,p])=>{n.push(T.get(d,p))}),B.forEach(d=>{if(d in t){const p=t[d];U(p),Object.entries(p).forEach(([k,E])=>{n.push(T.get(k,E,d))}),delete t[d]}}),n},[e,u])}function U(e){w(e,"hover","hover"),w(e,"focus","focus"),w(e,"hasFocus","hasFocus"),w(e,"active","active"),w(e,"disabled","disabled"),w(e,"hasDisabled","hasDisabled"),w(e,"checked","checked"),w(e,"hasChecked","hasChecked"),w(e,"valid","valid"),w(e,"hasValid","hasValid"),w(e,"invalid","invalid"),w(e,"hasInvalid","hasInvalid"),A(e,"hoverGroup","hover"),A(e,"focusGroup","focus"),A(e,"activeGroup","active"),A(e,"disabledGroup","disabled")}function w(e,l,u){l in e&&Q(e,l,u,e[l])}function A(e,l,u){l in e&&X.ObjectUtils.isObject(e[l])&&Object.entries(e[l]).forEach(([n,t])=>{T.addCustomPseudoClass(u,n,l),Q(e,l,u+n,t)})}function Q(e,l,u,n){Array.isArray(n)?(Object.entries(n[1]).forEach(([t,d])=>{e[`${t}${u}`]=d}),e[l]=n[0]):X.ObjectUtils.isObject(n)&&(Object.entries(n).forEach(([t,d])=>{e[`${t}${u}`]=d}),delete e[l])}function Z(...e){return e.reduce((l,u)=>u?typeof u=="string"?(l.push(u),l):Array.isArray(u)?(l.push(...Z(...u)),l):(Object.entries(u).forEach(([n,t])=>{t&&l.push(n)}),l):l,[])}exports.StylesContext=T;exports.Theme=J;exports.classNames=Z;exports.useStyles=fe;
|
|
5
|
+
.${re}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
|
|
6
|
+
.${j}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${j} path,.${j} circle,.${j} rect,.${j} line {transition: all var(--svgTransitionTime);}
|
|
7
|
+
`,p=Object.entries(s);p.sort(([i],[l])=>(C[i]??0)-(C[l]??0));const h=p.reduce((i,[l,g])=>(l!=="normal"&&i.push(`@media(min-width: ${C[l]}px){`),Object.entries(g).forEach(([b,B])=>{const{__parents:X,...le}=B,Y=Object.entries(le);Y.sort(([w],[S])=>a[w]-a[S]),Y.forEach(([w,S])=>{S.forEach(F=>{var A;const N=_[w].find(E=>Array.isArray(E.values)?E.values.includes(F):typeof F==typeof E.values);if(!N)return;const $=o(w,F,+b,l),J=N.styleName??w,V=((A=N.valueFormat)==null?void 0:A.call(N,F))??F,G=q[+b];i.push(`.${$}${G.map(E=>M[E]).join("")}{${J}:${V}}`)})}),X&&Object.entries(X).forEach(([w,S])=>{const F=Object.entries(S);F.sort(([z],[N])=>a[z]-a[N]),F.forEach(([z,N])=>{N.forEach($=>{var Z;const V=_[z].find(D=>Array.isArray(D.values)?D.values.includes($):typeof $==typeof D.values);if(!V)return;const G=o(z,$,+b,l,w),A=V.styleName??z,E=((Z=V.valueFormat)==null?void 0:Z.call(V,$))??$,[Q]=q[+b];i.push(`.${Q}-${w}:${Q} .${G}{${A}:${E}}`)})})})}),l!=="normal"&&i.push("}"),i),[f]),r=y();r.innerHTML=h.join(""),t=!1}e.flush=m;function n(){s={}}e.clear=n;function d(a,f,p,h,r="normal",i){if(f==null)return;const l=h.reduce((b,B)=>b+te[B],0);s[r]?s[r][l]?s[r][l][a]||(s[r][l][a]=new Set):s[r][l]={[a]:new Set}:s[r]={[l]:{[a]:new Set}},i?(s[r][l].__parents?s[r][l].__parents[i]?s[r][l].__parents[i][a]||(s[r][l].__parents[i][a]=new Set):s[r][l].__parents[i]={[a]:new Set}:s[r][l].__parents={[i]:{[a]:new Set}},s[r][l].__parents[i][a].has(f)||(s[r][l].__parents[i][a].add(f),t=!0)):s[r][l][a].has(f)||(s[r][l][a].add(f),t=!0);const g=o(a,f,l,r,i);p.push(g)}function o(a,f,p,h,r){const i=q[p],l=`${h==="normal"?"":`${h}-`}${i.map(g=>`${g}-`).join("")}${r?`${r}-`:""}${a}-${f}`;return ae?l:ue.getIdentity(l)}const v="crono-styles";function y(){let a=document.getElementById(v);return a||(a=document.createElement("style"),a.setAttribute("id",v),a.setAttribute("type","text/css"),document.head.insertBefore(a,document.head.firstChild)),a}})(O||(O={}));exports.StylesContext=void 0;(e=>{e.flush=O.flush,e.clear=O.clear})(exports.StylesContext||(exports.StylesContext={}));var U;(e=>{const t={button:{styles:{display:"inline-block",p:3,cursor:"pointer",b:1,borderRadius:1,userSelect:"none",disabled:{cursor:"default"}}},checkbox:{styles:{display:"inline-block"}},radioButton:{styles:{display:"inline-block",b:1,p:2}},textbox:{styles:{display:"inline-block",b:1,borderRadius:1,p:3}},textarea:{styles:{display:"inline-block",b:1,borderRadius:1}}};function s(u){const{components:m,...n}=u,d=m??{};Object.entries(n).forEach(([o,v])=>{d[o]=v}),R.components=x.mergeDeep(t,d)}e.setup=s})(U||(U={}));const ve=U;var W;(e=>{function t(u){const m=Array.from(u.elements).reduce((n,d)=>{const o=d.name;return o&&(n[o]||(n[o]=[]),n[o].push(d)),n},{});return Object.entries(m).reduce((n,[d,o])=>{if(o.length===1){const v=o[0];s(n,d,v.type==="checkbox"||v.type==="radio"?v.checked:v.value)}else{const v=o.reduce((y,a)=>(a.type==="checkbox"||a.type==="radio"?a.checked&&y.push(a.value):y.push(a.value),y),[]);s(n,d,v)}return n},{})}e.getFormEntries=t;function s(u,m,n){if(m.includes(".")){const d=m.split(".");let o=u;d.forEach((v,y)=>{if(d.length>y+1){const a=v.match(/^(.+)\[(\d)\]$/);if(a){const[,f,p]=a;o[f]=o[f]||[],o[f][p]=o[f][p]||{},o=o[f][p]}else o[v]=o[v]||{},o=o[v]}else o[v]=n})}else u[m]=n}})(W||(W={}));const fe=W;function he(){return T.useMemo(()=>{const e="crono-box";let t=document.getElementById(e);return t||(t=document.createElement("div"),t.id=e,document.body.appendChild(t)),t},[])}exports.BoxExtends=se;exports.FormUtils=fe;exports.ObjectUtils=x;exports.Theme=ve;exports.classNames=k;exports.usePortalContainer=he;exports.useStyles=de;
|