@cronocode/react-box 1.8.7 → 1.8.9
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/README.md +6 -17
- package/box.cjs +1 -1
- package/box.d.ts +4 -3
- package/box.mjs +7 -8
- package/components/baseSvg.cjs +1 -1
- package/components/baseSvg.d.ts +4 -4
- package/components/baseSvg.mjs +10 -12
- package/components/button.cjs +1 -1
- package/components/button.d.ts +3 -3
- package/components/button.mjs +8 -9
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.d.ts +3 -2
- package/components/checkbox.mjs +8 -9
- package/components/dataGrid/useGrid.d.ts +1 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.mjs +11 -14
- package/components/flex.cjs +1 -1
- package/components/flex.d.ts +3 -2
- package/components/flex.mjs +6 -8
- package/components/form.cjs +1 -1
- package/components/form.d.ts +2 -2
- package/components/form.mjs +7 -8
- package/components/grid.cjs +1 -1
- package/components/grid.d.ts +3 -2
- package/components/grid.mjs +6 -8
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.d.ts +4 -3
- package/components/radioButton.mjs +6 -7
- package/components/textarea.cjs +1 -1
- package/components/textarea.d.ts +4 -3
- package/components/textarea.mjs +7 -8
- package/components/textbox.cjs +1 -1
- package/components/textbox.d.ts +4 -3
- package/components/textbox.mjs +3 -4
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +3 -2
- package/components/tooltip.mjs +7 -9
- package/core/boxStyles.d.ts +10 -13
- package/core/stylesContext.d.ts +4 -1
- package/core/theme.d.ts +1 -0
- package/core/types.d.ts +15 -5
- package/core/useStyles.cssClass.test.d.ts +1 -0
- package/core/useStyles.d.ts +1 -0
- package/core/useStyles.styles.test.d.ts +1 -0
- package/core/useTheme.d.ts +2 -1
- package/core.cjs +13 -13
- package/core.mjs +362 -339
- package/package.json +16 -17
- package/ssg.cjs +65 -65
- package/ssg.d.ts +2 -1
- package/ssg.mjs +8375 -8393
- package/ssg.test.d.ts +1 -0
- package/theme.cjs +1 -1
- package/theme.d.ts +2 -1
- package/theme.mjs +2 -4
package/components/tooltip.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsxs as v, Fragment as b, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal as x } from "react-dom";
|
|
3
3
|
import d from "../box.mjs";
|
|
4
|
-
import { useMemo as E, useRef as C, useState as g, useCallback as
|
|
5
|
-
import "../core.mjs";
|
|
6
|
-
import "../utils.mjs";
|
|
4
|
+
import { useMemo as E, useRef as C, useState as g, useCallback as f, useLayoutEffect as L } from "react";
|
|
7
5
|
function y() {
|
|
8
6
|
return E(() => {
|
|
9
7
|
const i = "crono-box";
|
|
@@ -12,8 +10,8 @@ function y() {
|
|
|
12
10
|
}, []);
|
|
13
11
|
}
|
|
14
12
|
const l = 2;
|
|
15
|
-
function
|
|
16
|
-
const { onPositionChange: r } = i, c = C(null), [t,
|
|
13
|
+
function M(i) {
|
|
14
|
+
const { onPositionChange: r } = i, c = C(null), [t, p] = g(), m = y(), w = f(
|
|
17
15
|
(n, e) => {
|
|
18
16
|
const o = (s) => {
|
|
19
17
|
s.target.contains(n) && e(n);
|
|
@@ -23,7 +21,7 @@ function j(i) {
|
|
|
23
21
|
};
|
|
24
22
|
},
|
|
25
23
|
[t]
|
|
26
|
-
), h =
|
|
24
|
+
), h = f(
|
|
27
25
|
(n, e) => {
|
|
28
26
|
const o = (s) => {
|
|
29
27
|
e(n);
|
|
@@ -33,10 +31,10 @@ function j(i) {
|
|
|
33
31
|
};
|
|
34
32
|
},
|
|
35
33
|
[t]
|
|
36
|
-
), u =
|
|
34
|
+
), u = f(
|
|
37
35
|
(n) => {
|
|
38
36
|
const e = n.getBoundingClientRect(), o = Math.round((e.top + window.scrollY) * l) / l, s = Math.round((e.left + window.scrollX) * l) / l;
|
|
39
|
-
((t == null ? void 0 : t.top) !== o || (t == null ? void 0 : t.left) !== s) && (r == null || r({ top: o, left: s }),
|
|
37
|
+
((t == null ? void 0 : t.top) !== o || (t == null ? void 0 : t.left) !== s) && (r == null || r({ top: o, left: s }), p({ top: o, left: s, width: e.width > 0 ? e.width : void 0 }));
|
|
40
38
|
},
|
|
41
39
|
[t]
|
|
42
40
|
);
|
|
@@ -67,5 +65,5 @@ function j(i) {
|
|
|
67
65
|
] });
|
|
68
66
|
}
|
|
69
67
|
export {
|
|
70
|
-
|
|
68
|
+
M as default
|
|
71
69
|
};
|
package/core/boxStyles.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BoxStylesFormatters } from './boxStylesFormatters';
|
|
2
|
+
|
|
2
3
|
export interface StyleValues {
|
|
3
4
|
values: Readonly<Array<unknown>>;
|
|
4
5
|
formatSelector?: (selector: string) => string[];
|
|
@@ -15,10 +16,11 @@ export interface StyleItem {
|
|
|
15
16
|
values2: StyleValues;
|
|
16
17
|
values3: StyleValues;
|
|
17
18
|
pseudoSuffix?: PseudoClassSuffix;
|
|
19
|
+
customPseudoSuffix?: string;
|
|
18
20
|
breakpoint?: BoxBreakpointsType;
|
|
19
21
|
isThemeStyle?: boolean;
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
declare const simpleBoxStyles: {
|
|
22
24
|
/** The `display` CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. */
|
|
23
25
|
display: {
|
|
24
26
|
cssNames: string[];
|
|
@@ -1173,6 +1175,7 @@ export declare const boxStyles: {
|
|
|
1173
1175
|
};
|
|
1174
1176
|
};
|
|
1175
1177
|
};
|
|
1178
|
+
export type StyleKey = keyof typeof simpleBoxStyles;
|
|
1176
1179
|
export declare const boxThemeStyles: {
|
|
1177
1180
|
shadow: {
|
|
1178
1181
|
cssNames: string[];
|
|
@@ -1215,18 +1218,12 @@ export declare const svgThemeStyles: {
|
|
|
1215
1218
|
formatSelector: typeof BoxStylesFormatters.ClassName.svg;
|
|
1216
1219
|
};
|
|
1217
1220
|
};
|
|
1218
|
-
export declare const
|
|
1219
|
-
export type PseudoClassSuffix = (typeof
|
|
1221
|
+
export declare const pseudoClassSuffixes: readonly ["Hover", "Focus", "Active", "Checked", "Indeterminate", "Valid", "Invalid", "Required", "Optional", "Disabled"];
|
|
1222
|
+
export type PseudoClassSuffix = (typeof pseudoClassSuffixes)[number];
|
|
1220
1223
|
export declare const boxBreakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
|
1221
1224
|
export type BoxBreakpointsType = (typeof boxBreakpoints)[number];
|
|
1222
1225
|
export declare const boxBreakpointsMinWidth: Record<BoxBreakpointsType, number>;
|
|
1223
|
-
export declare
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
focus: {
|
|
1228
|
-
className: string;
|
|
1229
|
-
};
|
|
1230
|
-
};
|
|
1231
|
-
export type PseudoClassClassNameKey = keyof typeof pseudoClassClassName;
|
|
1232
|
-
export type StyleKey = keyof typeof boxStyles;
|
|
1226
|
+
export declare let boxStyles: Record<string, StyleItem>;
|
|
1227
|
+
export declare function rebuildBoxStyles(): void;
|
|
1228
|
+
export declare function addCustomPseudoClassProps(suffix: PseudoClassSuffix, customName: string, parentKey: string): string[];
|
|
1229
|
+
export {};
|
package/core/stylesContext.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BoxBreakpointsType } from './boxStyles';
|
|
1
|
+
import { BoxBreakpointsType, PseudoClassSuffix } from './boxStyles';
|
|
2
|
+
|
|
2
3
|
declare namespace StylesContext {
|
|
3
4
|
const boxClassName = "_box";
|
|
4
5
|
const svgClassName = "_svg";
|
|
@@ -6,5 +7,7 @@ declare namespace StylesContext {
|
|
|
6
7
|
function get(key: string, value: unknown, breakpoint?: BoxBreakpointsType): string | undefined;
|
|
7
8
|
function flush(): void;
|
|
8
9
|
function clear(): void;
|
|
10
|
+
function addCustomPseudoClass(suffix: PseudoClassSuffix, customName: string, parentKey: string): void;
|
|
11
|
+
function getElement(): HTMLElement;
|
|
9
12
|
}
|
|
10
13
|
export default StylesContext;
|
package/core/theme.d.ts
CHANGED
package/core/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { StyleItem, boxStyles } from './boxStyles';
|
|
3
1
|
import { ThemeComponentProps } from './useTheme';
|
|
2
|
+
import { StyleItem, boxStyles } from './boxStyles';
|
|
3
|
+
|
|
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]>;
|
|
6
6
|
export declare namespace Augmented {
|
|
@@ -15,9 +15,13 @@ type BoxStyles<T extends Record<string, StyleItem>> = {
|
|
|
15
15
|
type BoxNormalStyles = BoxStyles<typeof boxStyles> & Augmented.BoxProps;
|
|
16
16
|
interface BoxPseudoClasses {
|
|
17
17
|
disabled?: boolean | [boolean, BoxNormalStyles];
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
disabledGroup?: string | Record<string, BoxNormalStyles>;
|
|
19
|
+
hover?: BoxNormalStyles;
|
|
20
|
+
hoverGroup?: string | Record<string, BoxNormalStyles>;
|
|
21
|
+
focus?: BoxNormalStyles;
|
|
22
|
+
focusGroup?: string | Record<string, BoxNormalStyles>;
|
|
20
23
|
active?: BoxNormalStyles;
|
|
24
|
+
activeGroup?: string | Record<string, BoxNormalStyles>;
|
|
21
25
|
}
|
|
22
26
|
interface BoxThemePseudoClassProps {
|
|
23
27
|
hover?: BoxNormalStyles;
|
|
@@ -40,7 +44,13 @@ interface SvgNormalStyles {
|
|
|
40
44
|
rotate?: BoxNormalStyles['rotate'];
|
|
41
45
|
flip?: BoxNormalStyles['flip'];
|
|
42
46
|
transitionDuration?: BoxNormalStyles['transitionDuration'];
|
|
43
|
-
|
|
47
|
+
disabledGroup?: Record<string, SvgNormalStyles>;
|
|
48
|
+
hover?: SvgNormalStyles;
|
|
49
|
+
hoverGroup?: string | Record<string, SvgNormalStyles>;
|
|
50
|
+
focus?: SvgNormalStyles;
|
|
51
|
+
focusGroup?: string | Record<string, SvgNormalStyles>;
|
|
52
|
+
active?: SvgNormalStyles;
|
|
53
|
+
activeGroup?: string | Record<string, SvgNormalStyles>;
|
|
44
54
|
}
|
|
45
55
|
export type BoxSvgStyles = SvgNormalStyles & ThemeComponentProps & Augmented.SvgProps;
|
|
46
56
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/core/useStyles.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/core/useTheme.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ThemeSetup } from './theme';
|
|
2
1
|
import { BoxStyleProps } from './types';
|
|
2
|
+
import { ThemeSetup } from './theme';
|
|
3
|
+
|
|
3
4
|
type ReservedComponentName = Exclude<string, keyof Omit<ThemeSetup, 'components'>>;
|
|
4
5
|
export interface ThemeComponentProps {
|
|
5
6
|
clean?: boolean;
|
package/core.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";const B=require("react"),Q=require("./utils.cjs");var s;(l=>{(u=>{function i(o,h){return`${o}${h.replace("/","-")}`}u.fraction=i;function m(o){return[`${o} path`,`${o} circle`,`${o} rect`,`${o} line`]}u.svg=m})(l.ClassName||(l.ClassName={})),(u=>{function i(e,a){return`${a/4}rem`}u.rem=i;function m(e,a){return`${a}px`}u.px=m;function o(e,a){const[t,v]=a.split("/");return`${+t/+v*100}%`}u.fraction=o;function h(e,a){switch(a){case"fit":return"100%";case"fit-screen":return e.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return a}}u.widthHeight=h;function V(e){return(a,t)=>`var(--${e}${t});`}u.variables=V;function T(e){return(a,t)=>`var(--${e}${t});`}u.svgVariables=T;function C(e,a){return`repeat(${a},minmax(0,1fr))`}u.gridColumns=C;function c(e,a){return a==="full-row"?"1/-1":`span ${a}/span ${a}`}u.gridColumn=c;function r(e,a){return`${a}ms`}u.ms=r;function b(e,a){return`${a}deg`}u.rotate=b;function f(e,a){return a==="xAxis"?"-1 1":"1 -1"}u.flip=f})(l.Value||(l.Value={}))})(s||(s={}));const n=[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],Z=[-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-22,-24,-26,-28,-30,-32,-34,-36,-38,-40,-44,-48,-52,-56,-60,-64,-68,-72,-76,-80,-84,-88,-92,-96,-100],d=[...n,...Z],M=["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"],_=["auto","hidden","scroll","visible"],S=["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"],z=["fit","fit-screen","auto","fit-content","max-content","min-content"],G=["auto","flex-start","flex-end","center","baseline","stretch"],N={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:z,formatValue:s.Value.widthHeight},values2:{values:n,formatValue:s.Value.rem},values3:{values:S,formatValue:s.Value.fraction}},minWidth:{cssNames:["min-width"],values1:{values:z,formatValue:s.Value.widthHeight},values2:{values:n,formatValue:s.Value.rem},values3:{values:S,formatValue:s.Value.fraction}},maxWidth:{cssNames:["max-width"],values1:{values:z,formatValue:s.Value.widthHeight},values2:{values:n,formatValue:s.Value.rem},values3:{values:S,formatValue:s.Value.fraction}},height:{cssNames:["height"],values1:{values:z,formatValue:s.Value.widthHeight},values2:{values:n,formatValue:s.Value.rem},values3:{values:S,formatValue:s.Value.fraction}},minHeight:{cssNames:["min-height"],values1:{values:z,formatValue:s.Value.widthHeight},values2:{values:n,formatValue:s.Value.rem},values3:{values:S,formatValue:s.Value.fraction}},maxHeight:{cssNames:["max-height"],values1:{values:z,formatValue:s.Value.widthHeight},values2:{values:n,formatValue:s.Value.rem},values3:{values:S,formatValue:s.Value.fraction}},position:{cssNames:["position"],values1:{values:["static","relative","absolute","fixed","sticky"]},values2:{values:[]},values3:{values:[]}},top:{cssNames:["top"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},right:{cssNames:["right"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},bottom:{cssNames:["bottom"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},left:{cssNames:["left"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},inset:{cssNames:["inset"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},m:{cssNames:["margin"],values1:{values:d,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mx:{cssNames:["margin-inline"],values1:{values:d,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},my:{cssNames:["margin-block"],values1:{values:d,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mt:{cssNames:["margin-top"],values1:{values:d,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mr:{cssNames:["margin-right"],values1:{values:d,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mb:{cssNames:["margin-bottom"],values1:{values:d,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},ml:{cssNames:["margin-left"],values1:{values:d,formatValue:s.Value.rem},values2:{values:["auto"]},values3:{values:[]}},p:{cssNames:["padding"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},px:{cssNames:["padding-inline"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},py:{cssNames:["padding-block"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pt:{cssNames:["padding-top"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pr:{cssNames:["padding-right"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pb:{cssNames:["padding-bottom"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},pl:{cssNames:["padding-left"],values1:{values:d,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},b:{cssNames:["border-width"],values1:{values:n,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bx:{cssNames:["border-inline-width"],values1:{values:d,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},by:{cssNames:["border-block-width"],values1:{values:d,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bt:{cssNames:["border-top-width"],values1:{values:d,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},br:{cssNames:["border-right-width"],values1:{values:d,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bb:{cssNames:["border-bottom-width"],values1:{values:d,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},bl:{cssNames:["border-left-width"],values1:{values:d,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},borderStyle:{cssNames:["border-style"],values1:{values:M},values2:{values:[]},values3:{values:[]}},borderRadius:{cssNames:["border-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTop:{cssNames:["border-top-left-radius","border-top-right-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusRight:{cssNames:["border-top-right-radius","border-bottom-right-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottom:{cssNames:["border-bottom-left-radius","border-bottom-right-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusLeft:{cssNames:["border-top-left-radius","border-bottom-left-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopLeft:{cssNames:["border-top-left-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopRight:{cssNames:["border-top-right-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomLeft:{cssNames:["border-bottom-left-radius"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomRight:{cssNames:["border-bottom-right-radius"],values1:{values:n,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:n,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:n,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},lineHeight:{cssNames:["line-height"],values1:{values:n,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:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},rowGap:{cssNames:["row-gap"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},columnGap:{cssNames:["column-gap"],values1:{values:n,formatValue:s.Value.rem},values2:{values:[]},values3:{values:[]}},order:{cssNames:["order"],values1:{values:n},values2:{values:[]},values3:{values:[]}},flexGrow:{cssNames:["flex-grow"],values1:{values:n},values2:{values:[]},values3:{values:[]}},flexShrink:{cssNames:["flex-shrink"],values1:{values:n},values2:{values:[]},values3:{values:[]}},alignSelf:{cssNames:["align-self"],values1:{values:G},values2:{values:[]},values3:{values:[]}},justifySelf:{cssNames:["justify-self"],values1:{values:G},values2:{values:[]},values3:{values:[]}},gridColumns:{cssNames:["grid-template-columns"],values1:{values:n,formatValue:s.Value.gridColumns},values2:{values:[]},values3:{values:[]}},colSpan:{cssNames:["grid-column"],values1:{values:n,formatValue:s.Value.gridColumn},values2:{values:["full-row"],formatValue:s.Value.gridColumn},values3:{values:[]}},colStart:{cssNames:["grid-column-start"],values1:{values:n},values2:{values:[]},values3:{values:[]}},colEnd:{cssNames:["grid-column-end"],values1:{values:n},values2:{values:[]},values3:{values:[]}},outline:{cssNames:["outline-width"],values1:{values:n,formatValue:s.Value.px},values2:{values:[]},values3:{values:[]}},outlineStyle:{cssNames:["outline-style"],values1:{values:M},values2:{values:[]},values3:{values:[]}},outlineOffset:{cssNames:["outline-offset"],values1:{values:n,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"]},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:[]}}},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")}},U={fill:{cssNames:["fill"],formatValue:s.Value.svgVariables("color"),formatSelector:s.ClassName.svg},stroke:{cssNames:["stroke"],formatValue:s.Value.svgVariables("color"),formatSelector:s.ClassName.svg}},ee=["H","F","A","Checked","Indeterminate","Valid","Invalid","Required","Optional","Disabled"],E=["sm","md","lg","xl","xxl"],se={sm:640,md:768,lg:1024,xl:1280,xxl:1536},H={hover:{className:"_h"},focus:{className:"_f"}};Object.keys(K).forEach(l=>{N[l]=K[l],N[l].isThemeStyle=!0});Object.keys(U).forEach(l=>{N[l]=U[l],N[l].isThemeStyle=!0});let P=Object.keys(N);ee.forEach(l=>{P.forEach(u=>{N[`${u}${l}`]={...N[u],pseudoSuffix:l}})});P=Object.keys(N);E.forEach(l=>{P.forEach(u=>{N[`${l}${u}`]={...N[u],breakpoint:l}})});class ae{constructor(){this._index=0,this._cache={}}getIdentity(u){return this._cache[u]||(this._cache[u]=this.getByIndex(this._index++)),this._cache[u]}getByIndex(u){const{first:i,next:m}=le,o=u-i.length;if(o<0)return i[u];const h=Math.floor(o/m.length),V=o-h*m.length;return this.getByIndex(h)+m[V]}}const le={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var D;(l=>{l.boxClassName="_box",l.svgClassName="_svg",l.cronoStylesElementId="crono-styles";const u=`: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 G=require("react"),Y=require("./utils.cjs");var e;(a=>{(u=>{function t(o,m){return`${o}${m.replace("/","-")}`}u.fraction=t;function n(o){return[`${o} path`,`${o} circle`,`${o} rect`,`${o} line`]}u.svg=n})(a.ClassName||(a.ClassName={})),(u=>{function t(l,s){return`${s/4}rem`}u.rem=t;function n(l,s){return`${s}px`}u.px=n;function o(l,s){const[r,i]=s.split("/");return`${+r/+i*100}%`}u.fraction=o;function m(l,s){switch(s){case"fit":return"100%";case"fit-screen":return l.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return s}}u.widthHeight=m;function N(l){return(s,r)=>`var(--${l}${r});`}u.variables=N;function T(l){return(s,r)=>`var(--${l}${r});`}u.svgVariables=T;function S(l,s){return`repeat(${s},minmax(0,1fr))`}u.gridColumns=S;function c(l,s){return s==="full-row"?"1/-1":`span ${s}/span ${s}`}u.gridColumn=c;function f(l,s){return`${s}ms`}u.ms=f;function b(l,s){return`${s}deg`}u.rotate=b;function d(l,s){return s==="xAxis"?"-1 1":"1 -1"}u.flip=d})(a.Value||(a.Value={}))})(e||(e={}));const v=[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],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=[...v,...ae],W=["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"],P=["auto","hidden","scroll","visible"],z=["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"],K=["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:e.Value.widthHeight},values2:{values:v,formatValue:e.Value.rem},values3:{values:z,formatValue:e.Value.fraction}},minWidth:{cssNames:["min-width"],values1:{values:I,formatValue:e.Value.widthHeight},values2:{values:v,formatValue:e.Value.rem},values3:{values:z,formatValue:e.Value.fraction}},maxWidth:{cssNames:["max-width"],values1:{values:I,formatValue:e.Value.widthHeight},values2:{values:v,formatValue:e.Value.rem},values3:{values:z,formatValue:e.Value.fraction}},height:{cssNames:["height"],values1:{values:I,formatValue:e.Value.widthHeight},values2:{values:v,formatValue:e.Value.rem},values3:{values:z,formatValue:e.Value.fraction}},minHeight:{cssNames:["min-height"],values1:{values:I,formatValue:e.Value.widthHeight},values2:{values:v,formatValue:e.Value.rem},values3:{values:z,formatValue:e.Value.fraction}},maxHeight:{cssNames:["max-height"],values1:{values:I,formatValue:e.Value.widthHeight},values2:{values:v,formatValue:e.Value.rem},values3:{values:z,formatValue:e.Value.fraction}},position:{cssNames:["position"],values1:{values:["static","relative","absolute","fixed","sticky"]},values2:{values:[]},values3:{values:[]}},top:{cssNames:["top"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},right:{cssNames:["right"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},bottom:{cssNames:["bottom"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},left:{cssNames:["left"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},inset:{cssNames:["inset"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},m:{cssNames:["margin"],values1:{values:h,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mx:{cssNames:["margin-inline"],values1:{values:h,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},my:{cssNames:["margin-block"],values1:{values:h,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mt:{cssNames:["margin-top"],values1:{values:h,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mr:{cssNames:["margin-right"],values1:{values:h,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},mb:{cssNames:["margin-bottom"],values1:{values:h,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},ml:{cssNames:["margin-left"],values1:{values:h,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},p:{cssNames:["padding"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},px:{cssNames:["padding-inline"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},py:{cssNames:["padding-block"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pt:{cssNames:["padding-top"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pr:{cssNames:["padding-right"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pb:{cssNames:["padding-bottom"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},pl:{cssNames:["padding-left"],values1:{values:h,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},b:{cssNames:["border-width"],values1:{values:v,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bx:{cssNames:["border-inline-width"],values1:{values:h,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},by:{cssNames:["border-block-width"],values1:{values:h,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bt:{cssNames:["border-top-width"],values1:{values:h,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},br:{cssNames:["border-right-width"],values1:{values:h,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bb:{cssNames:["border-bottom-width"],values1:{values:h,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},bl:{cssNames:["border-left-width"],values1:{values:h,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderStyle:{cssNames:["border-style"],values1:{values:W},values2:{values:[]},values3:{values:[]}},borderRadius:{cssNames:["border-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTop:{cssNames:["border-top-left-radius","border-top-right-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusRight:{cssNames:["border-top-right-radius","border-bottom-right-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottom:{cssNames:["border-bottom-left-radius","border-bottom-right-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusLeft:{cssNames:["border-top-left-radius","border-bottom-left-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopLeft:{cssNames:["border-top-left-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopRight:{cssNames:["border-top-right-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomLeft:{cssNames:["border-bottom-left-radius"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomRight:{cssNames:["border-bottom-right-radius"],values1:{values:v,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:P},values2:{values:[]},values3:{values:[]}},overflowX:{cssNames:["overflow-x"],values1:{values:P},values2:{values:[]},values3:{values:[]}},overflowY:{cssNames:["overflow-y"],values1:{values:P},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:v,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:v,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},lineHeight:{cssNames:["line-height"],values1:{values:v,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:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},rowGap:{cssNames:["row-gap"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},columnGap:{cssNames:["column-gap"],values1:{values:v,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},order:{cssNames:["order"],values1:{values:v},values2:{values:[]},values3:{values:[]}},flexGrow:{cssNames:["flex-grow"],values1:{values:v},values2:{values:[]},values3:{values:[]}},flexShrink:{cssNames:["flex-shrink"],values1:{values:v},values2:{values:[]},values3:{values:[]}},alignSelf:{cssNames:["align-self"],values1:{values:K},values2:{values:[]},values3:{values:[]}},justifySelf:{cssNames:["justify-self"],values1:{values:K},values2:{values:[]},values3:{values:[]}},gridColumns:{cssNames:["grid-template-columns"],values1:{values:v,formatValue:e.Value.gridColumns},values2:{values:[]},values3:{values:[]}},colSpan:{cssNames:["grid-column"],values1:{values:v,formatValue:e.Value.gridColumn},values2:{values:["full-row"],formatValue:e.Value.gridColumn},values3:{values:[]}},colStart:{cssNames:["grid-column-start"],values1:{values:v},values2:{values:[]},values3:{values:[]}},colEnd:{cssNames:["grid-column-end"],values1:{values:v},values2:{values:[]},values3:{values:[]}},outline:{cssNames:["outline-width"],values1:{values:v,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},outlineStyle:{cssNames:["outline-style"],values1:{values:W},values2:{values:[]},values3:{values:[]}},outlineOffset:{cssNames:["outline-offset"],values1:{values:v,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:[]}}},M={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")}},U={fill:{cssNames:["fill"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg},stroke:{cssNames:["stroke"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg}},q=["Hover","Focus","Active","Checked","Indeterminate","Valid","Invalid","Required","Optional","Disabled"],A=["sm","md","lg","xl","xxl"],ue={sm:640,md:768,lg:1024,xl:1280,xxl:1536};function J(){const a={...le};Object.keys(M).forEach(t=>{a[t]=M[t],a[t].isThemeStyle=!0}),Object.keys(U).forEach(t=>{a[t]=U[t],a[t].isThemeStyle=!0});let u=Object.keys(a);return q.forEach(t=>{u.forEach(n=>{a[`${n}${t}`]={...a[n],pseudoSuffix:t}})}),u=Object.keys(a),A.forEach(t=>{u.forEach(n=>{a[`${t}${n}`]={...a[n],breakpoint:t}})}),a}let C=J();function te(){C=J()}function oe(a,u,t){const n=Object.entries(C).filter(([o,m])=>m.pseudoSuffix===a&&!m.customPseudoSuffix&&!(`${o}${u}`in C)).map(([o])=>o);return n.forEach(o=>{C[`${o}${u}`]={...C[o],customPseudoSuffix:t+u}}),n.map(o=>`${o}${u}`)}class re{constructor(){this._index=0,this._cache={}}getIdentity(u){return this._cache[u]||(this._cache[u]=this.getByIndex(this._index++)),this._cache[u]}getByIndex(u){const{first:t,next:n}=ne,o=u-t.length;if(o<0)return t[u];const m=Math.floor(o/n.length),N=o-m*n.length;return this.getByIndex(m)+n[N]}}const ne={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var D;(a=>{a.boxClassName="_box",a.svgClassName="_svg",a.cronoStylesElementId="crono-styles";const u=`: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
|
-
`),
|
|
9
|
-
`),
|
|
10
|
-
`)
|
|
11
|
-
`),
|
|
5
|
+
.${a.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
|
+
.${a.svgClassName}{transition: all var(--svgTransitionTime);}.${a.svgClassName} path,.${a.svgClassName} circle,.${a.svgClassName} rect,.${a.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
7
|
+
`,t=new re;let n=!0,o={};T();function m(l,s,r){if(l in C)return c(l,s,r);if(["disabledGroup","hoverGroup","focusGroup","activeGroup"].includes(l))return l+s}a.get=m;function N(){if(n){let l=f([u]);q.forEach(r=>{l=f(l,r)}),A.forEach(r=>{l.push(`@media(min-width: ${ue[r]}px){`),l=f(l,void 0,r),q.forEach(i=>{l=f(l,i,r)}),l.push("}")});const s=d();s.innerHTML=l.join(""),n=!1}}a.flush=N;function T(){te(),o=Object.keys(C).reduce((s,r)=>(s[r]=new Set,s),{})}a.clear=T;function S(l,s,r){oe(l,s,r).forEach(p=>{o[p]=new Set})}a.addCustomPseudoClass=S;function c(l,s,r){const i=(r??"")+l;o[i].has(s)||(n=!0,o[i].add(s));const p=`${i}${s}`;return process.env.NODE_ENV==="test"?p:t.getIdentity(p)}function f(l,s,r){return Object.entries(o).filter(([p,k])=>{var w,$;return((w=C[p])==null?void 0:w.pseudoSuffix)===s&&(($=C[p])==null?void 0:$.breakpoint)===r&&k.size>0}).reduce((p,[k,w])=>(w.forEach($=>{var L;const g=C[k],y=b(g,$),j=`.${c(k,$)}`;let x=[];s?s==="Hover"?x=i(j,g,y,"hover"):s==="Focus"?x=i(j,g,y,"focus-within"):s==="Active"?x=i(j,g,y,"active"):s==="Checked"?x=i(j,g,y,"checked"):s==="Indeterminate"?x=i(j,g,y,"indeterminate"):s==="Valid"?x=i(j,g,y,"valid"):s==="Invalid"?x=i(j,g,y,"invalid"):s==="Required"?x=i(j,g,y,"required"):s==="Optional"?x=i(j,g,y,"optional"):s==="Disabled"&&(x=i(j,g,y,"disabled")):x=i(j,g,y);const V=((L=y.formatValue)==null?void 0:L.call(y,k,$))??$,ee=C[k].cssNames.map(se=>`${se}:${V};`).join("");p.push(`${x.join(",")}{${ee}}`)}),p),l);function i(p,k,w,$){let g=p;return $&&(g=k.customPseudoSuffix?`.${k.customPseudoSuffix}:${$} ${p}`:`${p}:${$}`),w.formatSelector?w.formatSelector(g):[g]}}function b(l,s){return l.isThemeStyle?l:l.values1.values.includes(s)?l.values1:l.values2.values.includes(s)?l.values2:l.values3}function d(){const s=typeof window<"u"&&typeof window.document<"u"?window.document:global.document;let r=s.getElementById(a.cronoStylesElementId);return r||(r=s.createElement("style"),r.setAttribute("id",a.cronoStylesElementId),r.setAttribute("type","text/css"),s.head.insertBefore(r,s.head.firstChild)),r}a.getElement=d})(D||(D={}));const E=D,H={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}}},ve={Hover:"hover",Focus:"focus",Active:"active",Checked:"checked",Indeterminate:"indeterminate",Valid:"valid",Invalid:"invalid",Required:"required",Optional:"optional",Disabled:"disabled"};var _;(a=>{a.Styles={};function u(c){a.Styles=o(H),a.Styles=n(c)}a.setup=u;function t(c,f){const{colors:b={},shadows:d={},backgrounds:l={},backgroundImages:s={}}=c;b.none="none",d.none="none",l.none="none",s.none="none";const r=Object.entries(b).map(([V,O])=>`--color${V}: ${O};`).join(`
|
|
8
|
+
`),i=Object.entries(d).map(([V,O])=>`--shadow${V}: ${O};`).join(`
|
|
9
|
+
`),p=Object.entries(l).map(([V,O])=>`--background${V}: ${O};`).join(`
|
|
10
|
+
`),k=Object.entries(s).map(([V,O])=>`--backgroundImage${V}: ${O};`).join(`
|
|
11
|
+
`),w=[":root {"];r&&w.push(` ${r}`),i&&w.push(` ${i}`),p&&w.push(` ${p}`),k&&w.push(` ${k}`),w.push("}");const $=Object.keys(b).map(V=>`'${V}'`).join(" | "),g=Object.keys(l).map(V=>`'${V}'`).join(" | "),y=Object.keys(s).map(V=>`'${V}'`).join(" | "),j=Object.keys(d).map(V=>`'${V}'`).join(" | "),x=`import '@cronocode/react-box';
|
|
12
12
|
|
|
13
|
-
declare module '${(
|
|
14
|
-
type ColorType = ${
|
|
13
|
+
declare module '${(f==null?void 0:f.namespacePath)??"@cronocode/react-box/core/types"}' {
|
|
14
|
+
type ColorType = ${$};
|
|
15
15
|
type BackgroundType = ${g};
|
|
16
16
|
type BackgroundImageType = ${y};
|
|
17
|
-
type ShadowType = ${
|
|
17
|
+
type ShadowType = ${j};
|
|
18
18
|
|
|
19
19
|
namespace Augmented {
|
|
20
20
|
interface BoxProps {
|
|
@@ -33,5 +33,5 @@ a,ul{all: unset;}
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
`;return{variables:
|
|
37
|
-
`),boxDts:
|
|
36
|
+
`;return{variables:w.join(`
|
|
37
|
+
`),boxDts:x}}a.setupAugmentedProps=t;function n(c){const f=o(c);return Object.keys(H).forEach(d=>{const l=f[d],s=H[d];l?l.styles={...s.styles,...l.styles}:f[d]=H[d]}),f}function o(c){return m(c),T(c),c}function m(c){if(!c.components)return;const f=Object.keys(c.components);for(const b of f){const d=c.components[b],l=N(b,d);delete d.children;for(const s of l){const[r,i]=s;c.components[r]=i}}}function N(c,f){if(!f.children)return[];const b=Object.keys(f.children),d=[];for(const l of b){const s=`${c}.${l}`,r=f.children[l],i=N(s,r);d.push(...i),delete r.children,d.push([s,r])}return d}function T(c){const{components:f,...b}=c,d=Object.values(b);f&&d.push(...Object.values(f));for(const l of d)S(l.styles),A.forEach(s=>{if(s in l.styles){const r=l.styles[s];S(r)}}),l.themes&&Object.values(l.themes).forEach(s=>{S(s),A.forEach(r=>{if(r in s){const i=s[r];S(i)}})})}function S(c){Object.entries(ve).forEach(([f,b])=>{if(b in c){const d=c[b];Object.entries(d).map(([l,s])=>{c[`${l}${f}`]=s}),delete c[b]}})}})(_||(_={}));const F=_;function ie(a){const{clean:u,theme:t,component:n}=a;return G.useMemo(()=>{var m,N;if(u)return;let o=F.Styles[n]??((m=F.Styles.components)==null?void 0:m[n]);if(o)return t?{...o.styles,...(N=o.themes)==null?void 0:N[t]}:o.styles},[n,u,t])}const ce=typeof window<"u"&&typeof window.document<"u",me=ce?G.useLayoutEffect:G.useEffect;function fe(a,u){const t=ie(a);return me(E.flush,[a]),G.useMemo(()=>{const n=[u?E.svgClassName:E.boxClassName],o=t?{...t,...a}:{...a};return X(o),Object.entries(o).forEach(([m,N])=>{n.push(E.get(m,N))}),A.forEach(m=>{if(m in o){const N=o[m];X(N),Object.entries(N).forEach(([T,S])=>{n.push(E.get(T,S,m))}),delete o[m]}}),n},[a,t])}function X(a){B(a,"hover","Hover"),B(a,"focus","Focus"),B(a,"active","Active"),B(a,"disabled","Disabled"),R(a,"hoverGroup","Hover"),R(a,"focusGroup","Focus"),R(a,"activeGroup","Active"),R(a,"disabledGroup","Disabled")}function B(a,u,t){u in a&&Q(a,u,t,a[u])}function R(a,u,t){u in a&&Y.ObjectUtils.isObject(a[u])&&Object.entries(a[u]).forEach(([n,o])=>{E.addCustomPseudoClass(t,n,u),Q(a,u,t+n,o)})}function Q(a,u,t,n){Array.isArray(n)?(Object.entries(n[1]).forEach(([o,m])=>{a[`${o}${t}`]=m}),a[u]=n[0]):Y.ObjectUtils.isObject(n)&&(Object.entries(n).forEach(([o,m])=>{a[`${o}${t}`]=m}),delete a[u])}function Z(...a){return a.reduce((u,t)=>t?typeof t=="string"?(u.push(t),u):Array.isArray(t)?(u.push(...Z(...t)),u):(Object.entries(t).forEach(([n,o])=>{o&&u.push(n)}),u):u,[])}exports.StylesContext=E;exports.Theme=F;exports.classNames=Z;exports.useStyles=fe;
|