@cronocode/react-box 3.0.8 → 3.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.d.ts +2 -1
- package/components/dropdown.mjs +106 -86
- package/components/semantics.cjs +1 -0
- package/components/semantics.d.ts +29 -0
- package/components/semantics.mjs +33 -0
- package/core/boxStyles.d.ts +1 -1
- package/core/boxStylesFormatters.d.ts +1 -1
- package/core.cjs +2 -2
- package/core.mjs +146 -125
- package/package.json +1 -1
package/components/dropdown.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),n=require("react"),h=require("../box.cjs"),E=require("./textbox.cjs"),z=require("./flex.cjs"),C=require("../core.cjs"),F=require("./baseSvg.cjs"),G=require("./tooltip.cjs"),Q=require("./button.cjs");function X(u,d){const{name:i,defaultValue:g,multiple:l,isSearchable:w,searchPlaceholder:H,children:j,onChange:r,...L}=u,[c,v]=n.useState(Array.isArray(g)?g:g?[g]:[]),[M,P]=n.useState(""),[m,R,S]=C.useVisibility(),b=n.useRef(null),U=n.useRef(null),[V,B]=n.useState(0),I=n.useMemo(()=>V>window.innerHeight/2,[V]),Y=n.useMemo(()=>{var e;return I?((e=S.current)==null?void 0:e.getBoundingClientRect().height)??0:0},[I,S]),p=n.useMemo(()=>Array.isArray(j)?j:[j],[j]),_=n.useMemo(()=>p.filter(e=>{var o;return((o=e.type)==null?void 0:o.displayName)==="DropdownItem"}),[p]),f=n.useMemo(()=>_.filter(e=>w&&M?N(e).toLowerCase().includes(M.toLowerCase()):!0),[w,M,p]),y=n.useMemo(()=>p.find(e=>{var o;return((o=e.type)==null?void 0:o.displayName)==="DropdownUnselect"}),[p]),O=n.useMemo(()=>p.find(e=>{var o;return((o=e.type)==null?void 0:o.displayName)==="DropdownSelectAll"}),[p]),A=n.useMemo(()=>p.find(e=>{var o;return((o=e.type)==null?void 0:o.displayName)==="DropdownEmptyItem"}),[p]),T=n.useMemo(()=>p.find(e=>{var o;return((o=e.type)==null?void 0:o.displayName)==="DropdownDisplay"}),[p]),J=n.useMemo(()=>{if(T)return T.props.children(c);const e=f.filter(t=>c.includes(t.props.value));if(l&&e.length>1)return e.map(t=>N(t)).join(", ");const o=e.at(0);return(o==null?void 0:o.props.children)??(o==null?void 0:o.props.value)??(l?null:y==null?void 0:y.props.children)},[l,f,c,y]),q=n.useCallback((e,...o)=>{if(o.length===0)v([]),r==null||r(void 0,[]);else if(l&&o.length>1){const t=o.map(a=>a.props.value);v(t),r==null||r(void 0,t)}else if(o.length===1){const t=o[0];if(l){const a=c.filter($=>$!==t.props.value);a.length===c.length&&a.push(t.props.value),v(a),r==null||r(t.props.value,a)}else v([t.props.value]),r==null||r(t.props.value,[t.props.value])}l?(e.stopPropagation(),setTimeout(()=>{var t;return(t=b.current)==null?void 0:t.focus()},0)):(R(!1),setTimeout(()=>{var t;return(t=S.current)==null?void 0:t.focus()},0))},[l,c,v]);n.useEffect(()=>{m?setTimeout(()=>{var e,o,t;(e=b.current)==null||e.focus(),(t=(o=U.current)==null?void 0:o.querySelector('[aria-selected="true"]'))==null||t.scrollIntoView({block:"nearest"})},0):P("")},[m]);const k=O&&l&&f.length>c.length,W=y&&f.length>0&&!k;return s.jsxs(h,{width:"fit-content",children:[c.map(e=>s.jsx(E,{ref:d,name:i,type:"hidden",value:JSON.stringify(e)??""},JSON.stringify(e))),s.jsxs(Q,{ref:S,component:"dropdown",...L,props:{onMouseDown:()=>R(e=>!e),tabIndex:0},children:[w&&s.jsx(E,{display:m&&w?"block":"none",clean:!0,flex1:!0,width:1,minHeight:5,placeholder:H,value:M,onChange:e=>P(e.target.value),ref:b,props:{onMouseDown:e=>{m&&w&&e.stopPropagation()}}}),s.jsx(z,{component:"dropdown.display",display:m&&w?"none":"flex",flex1:!0,minHeight:5,children:J}),s.jsx(h,{children:s.jsx(F,{viewBox:"0 0 10 6",width:"0.6rem",rotate:m?180:0,children:s.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 4 4 4-4"})})})]}),m&&s.jsx(G,{ref:U,top:I?void 0:0,bottom:I?2:void 0,style:{transform:`translateY(-${Y}px)`},onPositionChange:e=>B(e.top-window.scrollY),children:(f.length>0||A)&&s.jsxs(h,{component:"dropdown.items",children:[W&&s.jsx(h,{component:"dropdown.unselect",selected:c.length===0,...y.props,props:{onMouseDown:e=>q(e)}}),k&&s.jsx(h,{component:"dropdown.selectAll",...O.props,props:{onMouseDown:e=>q(e,..._)}}),f.map(e=>{const{value:o,...t}=e.props;return s.jsx(h,{component:"dropdown.item",theme:l?"multiple":"single",selected:c.includes(o),...t,props:{onMouseDown:a=>q(a,e)}},o)}),f.length===0&&A&&s.jsx(h,{component:"dropdown.emptyItem",...A.props})]})})]})}function D(u){const d=i=>null;return d.displayName=u,d}const x=n.forwardRef(X);x.Item=D("DropdownItem");x.Unselect=D("DropdownUnselect");x.SelectAll=D("DropdownSelectAll");x.EmptyItem=D("DropdownEmptyItem");x.Display=D("DropdownDisplay");function N(u){var d;if(u==null)return"";if(typeof u=="object"){const i=(d=u.props)==null?void 0:d.children;return i==null?"":typeof i=="object"?(Array.isArray(i)?i:[i]).map(l=>N(l)).join(""):i.toString()}return u.toString()}module.exports=x;
|
package/components/dropdown.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ interface DropdownDisplayProps<TVal> extends Omit<BoxProps, 'children'> {
|
|
|
17
17
|
interface DropdownType {
|
|
18
18
|
<TVal>(props: Props<TVal>, ref: Ref<HTMLInputElement>): React.ReactNode;
|
|
19
19
|
Item: <TVal>(props: DropdownItemProps<TVal>) => React.ReactNode;
|
|
20
|
-
|
|
20
|
+
Unselect: (props: BoxProps) => React.ReactNode;
|
|
21
|
+
SelectAll: (props: BoxProps) => React.ReactNode;
|
|
21
22
|
EmptyItem: (props: BoxProps) => React.ReactNode;
|
|
22
23
|
Display: <TVal>(props: DropdownDisplayProps<TVal>) => React.ReactNode;
|
|
23
24
|
}
|
package/components/dropdown.mjs
CHANGED
|
@@ -1,140 +1,160 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { b as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
function
|
|
11
|
-
const { name:
|
|
1
|
+
import { jsxs as M, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as G, useState as T, useRef as Y, useMemo as c, useCallback as Q, useEffect as X } from "react";
|
|
3
|
+
import h from "../box.mjs";
|
|
4
|
+
import J from "./textbox.mjs";
|
|
5
|
+
import Z from "./flex.mjs";
|
|
6
|
+
import { b as K } from "../core.mjs";
|
|
7
|
+
import ee from "./baseSvg.mjs";
|
|
8
|
+
import oe from "./tooltip.mjs";
|
|
9
|
+
import te from "./button.mjs";
|
|
10
|
+
function re(a, d) {
|
|
11
|
+
const { name: p, defaultValue: g, multiple: n, isSearchable: w, searchPlaceholder: q, children: I, onChange: r, ...F } = a, [i, v] = T(Array.isArray(g) ? g : g ? [g] : []), [S, U] = T(""), [m, V, A] = K(), N = Y(null), O = Y(null), [R, W] = T(0), b = c(() => R > window.innerHeight / 2, [R]), _ = c(() => {
|
|
12
12
|
var e;
|
|
13
|
-
return
|
|
14
|
-
}, [
|
|
13
|
+
return b ? ((e = A.current) == null ? void 0 : e.getBoundingClientRect().height) ?? 0 : 0;
|
|
14
|
+
}, [b, A]), s = c(() => Array.isArray(I) ? I : [I], [I]), k = c(() => s.filter((e) => {
|
|
15
15
|
var o;
|
|
16
|
-
return ((o = e.type) == null ? void 0 : o.
|
|
17
|
-
}), [
|
|
16
|
+
return ((o = e.type) == null ? void 0 : o.displayName) === "DropdownItem";
|
|
17
|
+
}), [s]), f = c(() => k.filter((e) => w && S ? B(e).toLowerCase().includes(S.toLowerCase()) : !0), [w, S, s]), y = c(() => s.find((e) => {
|
|
18
18
|
var o;
|
|
19
|
-
return ((o = e.type) == null ? void 0 : o.
|
|
20
|
-
}), [
|
|
19
|
+
return ((o = e.type) == null ? void 0 : o.displayName) === "DropdownUnselect";
|
|
20
|
+
}), [s]), E = c(() => s.find((e) => {
|
|
21
21
|
var o;
|
|
22
|
-
return ((o = e.type) == null ? void 0 : o.
|
|
23
|
-
}), [
|
|
22
|
+
return ((o = e.type) == null ? void 0 : o.displayName) === "DropdownSelectAll";
|
|
23
|
+
}), [s]), P = c(() => s.find((e) => {
|
|
24
24
|
var o;
|
|
25
|
-
return ((o = e.type) == null ? void 0 : o.
|
|
26
|
-
}), [
|
|
27
|
-
|
|
25
|
+
return ((o = e.type) == null ? void 0 : o.displayName) === "DropdownEmptyItem";
|
|
26
|
+
}), [s]), H = c(() => s.find((e) => {
|
|
27
|
+
var o;
|
|
28
|
+
return ((o = e.type) == null ? void 0 : o.displayName) === "DropdownDisplay";
|
|
29
|
+
}), [s]), $ = c(() => {
|
|
30
|
+
if (H) return H.props.children(i);
|
|
28
31
|
const e = f.filter((t) => i.includes(t.props.value));
|
|
29
|
-
if (
|
|
32
|
+
if (n && e.length > 1)
|
|
30
33
|
return e.map((t) => B(t)).join(", ");
|
|
31
34
|
const o = e.at(0);
|
|
32
|
-
return (o == null ? void 0 : o.props.children) ?? (o == null ? void 0 : o.props.value) ?? (
|
|
33
|
-
}, [
|
|
34
|
-
(e, o) => {
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
else if (
|
|
38
|
-
const t =
|
|
39
|
-
|
|
40
|
-
} else
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
return (o == null ? void 0 : o.props.children) ?? (o == null ? void 0 : o.props.value) ?? (n ? null : y == null ? void 0 : y.props.children);
|
|
36
|
+
}, [n, f, i, y]), j = Q(
|
|
37
|
+
(e, ...o) => {
|
|
38
|
+
if (o.length === 0)
|
|
39
|
+
v([]), r == null || r(void 0, []);
|
|
40
|
+
else if (n && o.length > 1) {
|
|
41
|
+
const t = o.map((u) => u.props.value);
|
|
42
|
+
v(t), r == null || r(void 0, t);
|
|
43
|
+
} else if (o.length === 1) {
|
|
44
|
+
const t = o[0];
|
|
45
|
+
if (n) {
|
|
46
|
+
const u = i.filter((C) => C !== t.props.value);
|
|
47
|
+
u.length === i.length && u.push(t.props.value), v(u), r == null || r(t.props.value, u);
|
|
48
|
+
} else
|
|
49
|
+
v([t.props.value]), r == null || r(t.props.value, [t.props.value]);
|
|
50
|
+
}
|
|
51
|
+
n ? (e.stopPropagation(), setTimeout(() => {
|
|
43
52
|
var t;
|
|
44
53
|
return (t = N.current) == null ? void 0 : t.focus();
|
|
45
|
-
}, 0)) : (
|
|
54
|
+
}, 0)) : (V(!1), setTimeout(() => {
|
|
46
55
|
var t;
|
|
47
|
-
return (t =
|
|
56
|
+
return (t = A.current) == null ? void 0 : t.focus();
|
|
48
57
|
}, 0));
|
|
49
58
|
},
|
|
50
|
-
[
|
|
59
|
+
[n, i, v]
|
|
51
60
|
);
|
|
52
|
-
|
|
61
|
+
X(() => {
|
|
53
62
|
m ? setTimeout(() => {
|
|
54
63
|
var e, o, t;
|
|
55
|
-
(e = N.current) == null || e.focus(), (t = (o =
|
|
56
|
-
}, 0) :
|
|
57
|
-
}, [m])
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
(e = N.current) == null || e.focus(), (t = (o = O.current) == null ? void 0 : o.querySelector('[aria-selected="true"]')) == null || t.scrollIntoView({ block: "nearest" });
|
|
65
|
+
}, 0) : U("");
|
|
66
|
+
}, [m]);
|
|
67
|
+
const L = E && n && f.length > i.length, z = y && f.length > 0 && !L;
|
|
68
|
+
return /* @__PURE__ */ M(h, { width: "fit-content", children: [
|
|
69
|
+
i.map((e) => /* @__PURE__ */ l(J, { ref: d, name: p, type: "hidden", value: JSON.stringify(e) ?? "" }, JSON.stringify(e))),
|
|
70
|
+
/* @__PURE__ */ M(te, { ref: A, component: "dropdown", ...F, props: { onMouseDown: () => V((e) => !e), tabIndex: 0 }, children: [
|
|
71
|
+
w && /* @__PURE__ */ l(
|
|
72
|
+
J,
|
|
62
73
|
{
|
|
63
|
-
display: m &&
|
|
74
|
+
display: m && w ? "block" : "none",
|
|
64
75
|
clean: !0,
|
|
65
76
|
flex1: !0,
|
|
66
77
|
width: 1,
|
|
67
78
|
minHeight: 5,
|
|
68
|
-
placeholder:
|
|
69
|
-
value:
|
|
70
|
-
onChange: (e) =>
|
|
79
|
+
placeholder: q,
|
|
80
|
+
value: S,
|
|
81
|
+
onChange: (e) => U(e.target.value),
|
|
71
82
|
ref: N,
|
|
72
83
|
props: {
|
|
73
84
|
onMouseDown: (e) => {
|
|
74
|
-
m &&
|
|
85
|
+
m && w && e.stopPropagation();
|
|
75
86
|
}
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
89
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ l(Z, { component: "dropdown.display", display: m && w ? "none" : "flex", flex1: !0, minHeight: 5, children: $ }),
|
|
91
|
+
/* @__PURE__ */ l(h, { children: /* @__PURE__ */ l(ee, { viewBox: "0 0 10 6", width: "0.6rem", rotate: m ? 180 : 0, children: /* @__PURE__ */ l("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m1 1 4 4 4-4" }) }) })
|
|
81
92
|
] }),
|
|
82
|
-
m && /* @__PURE__ */
|
|
83
|
-
|
|
93
|
+
m && /* @__PURE__ */ l(
|
|
94
|
+
oe,
|
|
84
95
|
{
|
|
85
|
-
ref:
|
|
86
|
-
top:
|
|
87
|
-
bottom:
|
|
88
|
-
style: { transform: `translateY(-${
|
|
89
|
-
onPositionChange: (e) =>
|
|
90
|
-
children: (f.length > 0 || P) && /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
ref: O,
|
|
97
|
+
top: b ? void 0 : 0,
|
|
98
|
+
bottom: b ? 2 : void 0,
|
|
99
|
+
style: { transform: `translateY(-${_}px)` },
|
|
100
|
+
onPositionChange: (e) => W(e.top - window.scrollY),
|
|
101
|
+
children: (f.length > 0 || P) && /* @__PURE__ */ M(h, { component: "dropdown.items", children: [
|
|
102
|
+
z && /* @__PURE__ */ l(
|
|
103
|
+
h,
|
|
93
104
|
{
|
|
94
|
-
component: "dropdown.
|
|
105
|
+
component: "dropdown.unselect",
|
|
95
106
|
selected: i.length === 0,
|
|
96
|
-
...
|
|
97
|
-
props: { onMouseDown: (e) =>
|
|
107
|
+
...y.props,
|
|
108
|
+
props: { onMouseDown: (e) => j(e) }
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
L && /* @__PURE__ */ l(
|
|
112
|
+
h,
|
|
113
|
+
{
|
|
114
|
+
component: "dropdown.selectAll",
|
|
115
|
+
...E.props,
|
|
116
|
+
props: { onMouseDown: (e) => j(e, ...k) }
|
|
98
117
|
}
|
|
99
118
|
),
|
|
100
119
|
f.map((e) => {
|
|
101
120
|
const { value: o, ...t } = e.props;
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
|
|
121
|
+
return /* @__PURE__ */ l(
|
|
122
|
+
h,
|
|
104
123
|
{
|
|
105
124
|
component: "dropdown.item",
|
|
106
|
-
theme:
|
|
125
|
+
theme: n ? "multiple" : "single",
|
|
107
126
|
selected: i.includes(o),
|
|
108
127
|
...t,
|
|
109
|
-
props: { onMouseDown: (
|
|
128
|
+
props: { onMouseDown: (u) => j(u, e) }
|
|
110
129
|
},
|
|
111
130
|
o
|
|
112
131
|
);
|
|
113
132
|
}),
|
|
114
|
-
f.length === 0 && P && /* @__PURE__ */
|
|
133
|
+
f.length === 0 && P && /* @__PURE__ */ l(h, { component: "dropdown.emptyItem", ...P.props })
|
|
115
134
|
] })
|
|
116
135
|
}
|
|
117
136
|
)
|
|
118
137
|
] });
|
|
119
138
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
return
|
|
139
|
+
function D(a) {
|
|
140
|
+
const d = (p) => null;
|
|
141
|
+
return d.displayName = a, d;
|
|
123
142
|
}
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
143
|
+
const x = G(re);
|
|
144
|
+
x.Item = D("DropdownItem");
|
|
145
|
+
x.Unselect = D("DropdownUnselect");
|
|
146
|
+
x.SelectAll = D("DropdownSelectAll");
|
|
147
|
+
x.EmptyItem = D("DropdownEmptyItem");
|
|
148
|
+
x.Display = D("DropdownDisplay");
|
|
149
|
+
function B(a) {
|
|
150
|
+
var d;
|
|
151
|
+
if (a == null) return "";
|
|
152
|
+
if (typeof a == "object") {
|
|
153
|
+
const p = (d = a.props) == null ? void 0 : d.children;
|
|
154
|
+
return p == null ? "" : typeof p == "object" ? (Array.isArray(p) ? p : [p]).map((n) => B(n)).join("") : p.toString();
|
|
135
155
|
}
|
|
136
|
-
return
|
|
156
|
+
return a.toString();
|
|
137
157
|
}
|
|
138
158
|
export {
|
|
139
|
-
|
|
159
|
+
x as default
|
|
140
160
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),s=require("react"),r=require("../box.cjs");function t(e,n){return s.forwardRef((o,i)=>c.jsx(r,{tag:e,ref:i,component:e,...n,...o}))}const a=t("label"),m=t("article"),u=t("aside"),H=t("details"),f=t("figcaption"),l=t("figure"),S=t("footer"),g=t("header"),d=t("main"),h=t("mark"),M=t("nav"),b=t("menu"),p=t("section"),z=t("summary"),F=t("time"),k=t("p"),y=t("h1",{fontSize:14*2.5}),v=t("h2",{fontSize:14*2}),A=t("h3",{fontSize:14*1.75}),L=t("h4",{fontSize:14*1.5}),j=t("h5",{fontSize:14*1.25}),q=t("h6",{fontSize:14*1}),x=t("a"),P=t("img");exports.Article=m;exports.Aside=u;exports.Details=H;exports.Figcaption=f;exports.Figure=l;exports.Footer=S;exports.H1=y;exports.H2=v;exports.H3=A;exports.H4=L;exports.H5=j;exports.H6=q;exports.Header=g;exports.Img=P;exports.Label=a;exports.Link=x;exports.Main=d;exports.Mark=h;exports.Menu=b;exports.Nav=M;exports.P=k;exports.Section=p;exports.Summary=z;exports.Time=F;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
2
|
+
import { BoxProps } from '../box';
|
|
3
|
+
import { ExtractElementFromTag } from '../core/coreTypes';
|
|
4
|
+
type SemanticComponentType<TTag extends keyof React.JSX.IntrinsicElements> = (props: Omit<BoxProps<TTag>, 'ref' | 'tag'> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
|
|
5
|
+
export declare const Label: SemanticComponentType<"label">;
|
|
6
|
+
export declare const Article: SemanticComponentType<"article">;
|
|
7
|
+
export declare const Aside: SemanticComponentType<"aside">;
|
|
8
|
+
export declare const Details: SemanticComponentType<"details">;
|
|
9
|
+
export declare const Figcaption: SemanticComponentType<"figcaption">;
|
|
10
|
+
export declare const Figure: SemanticComponentType<"figure">;
|
|
11
|
+
export declare const Footer: SemanticComponentType<"footer">;
|
|
12
|
+
export declare const Header: SemanticComponentType<"header">;
|
|
13
|
+
export declare const Main: SemanticComponentType<"main">;
|
|
14
|
+
export declare const Mark: SemanticComponentType<"mark">;
|
|
15
|
+
export declare const Nav: SemanticComponentType<"nav">;
|
|
16
|
+
export declare const Menu: SemanticComponentType<"menu">;
|
|
17
|
+
export declare const Section: SemanticComponentType<"section">;
|
|
18
|
+
export declare const Summary: SemanticComponentType<"summary">;
|
|
19
|
+
export declare const Time: SemanticComponentType<"time">;
|
|
20
|
+
export declare const P: SemanticComponentType<"p">;
|
|
21
|
+
export declare const H1: SemanticComponentType<"h1">;
|
|
22
|
+
export declare const H2: SemanticComponentType<"h2">;
|
|
23
|
+
export declare const H3: SemanticComponentType<"h3">;
|
|
24
|
+
export declare const H4: SemanticComponentType<"h4">;
|
|
25
|
+
export declare const H5: SemanticComponentType<"h5">;
|
|
26
|
+
export declare const H6: SemanticComponentType<"h6">;
|
|
27
|
+
export declare const Link: SemanticComponentType<"a">;
|
|
28
|
+
export declare const Img: SemanticComponentType<"img">;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
import r from "../box.mjs";
|
|
4
|
+
function o(t, n) {
|
|
5
|
+
return i((c, e) => /* @__PURE__ */ s(r, { tag: t, ref: e, component: t, ...n, ...c }));
|
|
6
|
+
}
|
|
7
|
+
const p = o("label"), u = o("article"), S = o("aside"), h = o("details"), l = o("figcaption"), H = o("figure"), d = o("footer"), g = o("header"), z = o("main"), k = o("mark"), x = o("nav"), F = o("menu"), M = o("section"), b = o("summary"), v = o("time"), y = o("p"), A = o("h1", { fontSize: 14 * 2.5 }), L = o("h2", { fontSize: 14 * 2 }), j = o("h3", { fontSize: 14 * 1.75 }), w = o("h4", { fontSize: 14 * 1.5 }), B = o("h5", { fontSize: 14 * 1.25 }), D = o("h6", { fontSize: 14 * 1 }), I = o("a"), P = o("img");
|
|
8
|
+
export {
|
|
9
|
+
u as Article,
|
|
10
|
+
S as Aside,
|
|
11
|
+
h as Details,
|
|
12
|
+
l as Figcaption,
|
|
13
|
+
H as Figure,
|
|
14
|
+
d as Footer,
|
|
15
|
+
A as H1,
|
|
16
|
+
L as H2,
|
|
17
|
+
j as H3,
|
|
18
|
+
w as H4,
|
|
19
|
+
B as H5,
|
|
20
|
+
D as H6,
|
|
21
|
+
g as Header,
|
|
22
|
+
P as Img,
|
|
23
|
+
p as Label,
|
|
24
|
+
I as Link,
|
|
25
|
+
z as Main,
|
|
26
|
+
k as Mark,
|
|
27
|
+
F as Menu,
|
|
28
|
+
x as Nav,
|
|
29
|
+
y as P,
|
|
30
|
+
M as Section,
|
|
31
|
+
b as Summary,
|
|
32
|
+
v as Time
|
|
33
|
+
};
|
package/core/boxStyles.d.ts
CHANGED
|
@@ -214,7 +214,7 @@ export declare const cssStyles: {
|
|
|
214
214
|
fontSize: ({
|
|
215
215
|
styleName: string;
|
|
216
216
|
values: number;
|
|
217
|
-
valueFormat:
|
|
217
|
+
valueFormat: (value: number) => string;
|
|
218
218
|
} | {
|
|
219
219
|
styleName: string;
|
|
220
220
|
values: readonly ["inherit"];
|
|
@@ -4,7 +4,7 @@ export declare namespace BoxStylesFormatters {
|
|
|
4
4
|
function svg(selector: string): string[];
|
|
5
5
|
}
|
|
6
6
|
namespace Value {
|
|
7
|
-
function rem(value: number): string;
|
|
7
|
+
function rem(value: number, _fn?: Function, divider?: number): string;
|
|
8
8
|
function px(value: number): string;
|
|
9
9
|
function fraction(_key: string, value: string): string;
|
|
10
10
|
function widthHeight(key: string, value: string): string;
|
package/core.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";const p=require("react"),ce=require("react/jsx-runtime");function le(...e){return e.reduce((t,r)=>r?typeof r=="string"?(t.push(r),t):Array.isArray(r)?(t.push(...le(...r)),t):(Object.entries(r).forEach(([l,s])=>{s&&t.push(l)}),t):t,[])}var u;(e=>{(t=>{function r(s,n){return`${s}${n.replace("/","-")}`}t.fraction=r;function l(s){return[`${s} path`,`${s} circle`,`${s} rect`,`${s} line`]}t.svg=l})(e.ClassName||(e.ClassName={})),(t=>{function r(b){return`${b/4}rem`}t.rem=r;function l(b){return`${b}px`}t.px=l;function s(b,i){const[m,f]=i.split("/");return`${+m/+f*100}%`}t.fraction=s;function n(b,i){switch(i){case"fit":return"100%";case"fit-screen":return b.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return i}}t.widthHeight=n;function d(b){return(i,m)=>`var(--${b}${m});`}t.variables=d;function o(b){return(i,m)=>`var(--${b}${m});`}t.svgVariables=o;function c(b,i){return`repeat(${i},minmax(0,1fr))`}t.gridColumns=c;function y(b,i){return i==="full-row"?"1/-1":`span ${i}/span ${i}`}t.gridColumn=y;function a(b,i){return`${i}ms`}t.ms=a;function v(b,i){return`${i}deg`}t.rotate=v;function g(b,i){return i==="xAxis"?"-1 1":"1 -1"}t.flip=g})(e.Value||(e.Value={}))})(u||(u={}));var W;(e=>{e.colors={currentColor:"currentColor",transparent:"transparent",green:"green",red:"red",blue:"blue",gray:"gray",black:"#000",white:"#fff","slate-50":"#f8fafc","slate-100":"#f1f5f9","slate-200":"#e2e8f0","slate-300":"#cbd5e1","slate-400":"#94a3b8","slate-500":"#64748b","slate-600":"#475569","slate-700":"#334155","slate-800":"#1e293b","slate-900":"#0f172a","slate-950":"#020617","gray-50":"#f9fafb","gray-100":"#f3f4f6","gray-200":"#e5e7eb","gray-300":"#d1d5db","gray-400":"#9ca3af","gray-500":"#6b7280","gray-600":"#4b5563","gray-700":"#374151","gray-800":"#1f2937","gray-900":"#111827","gray-950":"#030712","zinc-50":"#fafafa","zinc-100":"#f4f4f5","zinc-200":"#e4e4e7","zinc-300":"#d4d4d8","zinc-400":"#a1a1aa","zinc-500":"#71717a","zinc-600":"#52525b","zinc-700":"#3f3f46","zinc-800":"#27272a","zinc-900":"#18181b","zinc-950":"#09090b","neutral-50":"#fafafa","neutral-100":"#f5f5f5","neutral-200":"#e5e5e5","neutral-300":"#d4d4d4","neutral-400":"#a3a3a3","neutral-500":"#737373","neutral-600":"#525252","neutral-700":"#404040","neutral-800":"#262626","neutral-900":"#171717","neutral-950":"#0a0a0a","stone-50":"#fafaf9","stone-100":"#f5f5f4","stone-200":"#e7e5e4","stone-300":"#d6d3d1","stone-400":"#a8a29e","stone-500":"#78716c","stone-600":"#57534e","stone-700":"#44403c","stone-800":"#292524","stone-900":"#1c1917","stone-950":"#0c0a09","red-50":"#fef2f2","red-100":"#fee2e2","red-200":"#fecaca","red-300":"#fca5a5","red-400":"#f87171","red-500":"#ef4444","red-600":"#dc2626","red-700":"#b91c1c","red-800":"#991b1b","red-900":"#7f1d1d","red-950":"#450a0a","orange-50":"#fff7ed","orange-100":"#ffedd5","orange-200":"#fed7aa","orange-300":"#fdba74","orange-400":"#fb923c","orange-500":"#f97316","orange-600":"#ea580c","orange-700":"#c2410c","orange-800":"#9a3412","orange-900":"#7c2d12","orange-950":"#431407","amber-50":"#fffbeb","amber-100":"#fef3c7","amber-200":"#fde68a","amber-300":"#fcd34d","amber-400":"#fbbf24","amber-500":"#f59e0b","amber-600":"#d97706","amber-700":"#b45309","amber-800":"#92400e","amber-900":"#78350f","amber-950":"#451a03","yellow-50":"#fefce8","yellow-100":"#fef9c3","yellow-200":"#fef08a","yellow-300":"#fde047","yellow-400":"#facc15","yellow-500":"#eab308","yellow-600":"#ca8a04","yellow-700":"#a16207","yellow-800":"#854d0e","yellow-900":"#713f12","yellow-950":"#422006","lime-50":"#f7fee7","lime-100":"#ecfccb","lime-200":"#d9f99d","lime-300":"#bef264","lime-400":"#a3e635","lime-500":"#84cc16","lime-600":"#65a30d","lime-700":"#4d7c0f","lime-800":"#3f6212","lime-900":"#365314","lime-950":"#1a2e05","green-50":"#f0fdf4","green-100":"#dcfce7","green-200":"#bbf7d0","green-300":"#86efac","green-400":"#4ade80","green-500":"#22c55e","green-600":"#16a34a","green-700":"#15803d","green-800":"#166534","green-900":"#14532d","green-950":"#052e16","emerald-50":"#ecfdf5","emerald-100":"#d1fae5","emerald-200":"#a7f3d0","emerald-300":"#6ee7b7","emerald-400":"#34d399","emerald-500":"#10b981","emerald-600":"#059669","emerald-700":"#047857","emerald-800":"#065f46","emerald-900":"#064e3b","emerald-950":"#022c22","teal-50":"#f0fdfa","teal-100":"#ccfbf1","teal-200":"#99f6e4","teal-300":"#5eead4","teal-400":"#2dd4bf","teal-500":"#14b8a6","teal-600":"#0d9488","teal-700":"#0f766e","teal-800":"#115e59","teal-900":"#134e4a","teal-950":"#042f2e","cyan-50":"#ecfeff","cyan-100":"#cffafe","cyan-200":"#a5f3fc","cyan-300":"#67e8f9","cyan-400":"#22d3ee","cyan-500":"#06b6d4","cyan-600":"#0891b2","cyan-700":"#0e7490","cyan-800":"#155e75","cyan-900":"#164e63","cyan-950":"#083344","sky-50":"#f0f9ff","sky-100":"#e0f2fe","sky-200":"#bae6fd","sky-300":"#7dd3fc","sky-400":"#38bdf8","sky-500":"#0ea5e9","sky-600":"#0284c7","sky-700":"#0369a1","sky-800":"#075985","sky-900":"#0c4a6e","sky-950":"#082f49","blue-50":"#eff6ff","blue-100":"#dbeafe","blue-200":"#bfdbfe","blue-300":"#93c5fd","blue-400":"#60a5fa","blue-500":"#3b82f6","blue-600":"#2563eb","blue-700":"#1d4ed8","blue-800":"#1e40af","blue-900":"#1e3a8a","blue-950":"#172554","indigo-50":"#eef2ff","indigo-100":"#e0e7ff","indigo-200":"#c7d2fe","indigo-300":"#a5b4fc","indigo-400":"#818cf8","indigo-500":"#6366f1","indigo-600":"#4f46e5","indigo-700":"#4338ca","indigo-800":"#3730a3","indigo-900":"#312e81","indigo-950":"#1e1b4b","violet-50":"#f5f3ff","violet-100":"#ede9fe","violet-200":"#ddd6fe","violet-300":"#c4b5fd","violet-400":"#a78bfa","violet-500":"#8b5cf6","violet-600":"#7c3aed","violet-700":"#6d28d9","violet-800":"#5b21b6","violet-900":"#4c1d95","violet-950":"#2e1065",vi:"#7949FF","purple-50":"#faf5ff","purple-100":"#f3e8ff","purple-200":"#e9d5ff","purple-300":"#d8b4fe","purple-400":"#c084fc","purple-500":"#a855f7","purple-600":"#9333ea","purple-700":"#7e22ce","purple-800":"#6b21a8","purple-900":"#581c87","purple-950":"#3b0764","fuchsia-50":"#fdf4ff","fuchsia-100":"#fae8ff","fuchsia-200":"#f5d0fe","fuchsia-300":"#f0abfc","fuchsia-400":"#e879f9","fuchsia-500":"#d946ef","fuchsia-600":"#c026d3","fuchsia-700":"#a21caf","fuchsia-800":"#86198f","fuchsia-900":"#701a75","fuchsia-950":"#4a044e","pink-50":"#fdf2f8","pink-100":"#fce7f3","pink-200":"#fbcfe8","pink-300":"#f9a8d4","pink-400":"#f472b6","pink-500":"#ec4899","pink-600":"#db2777","pink-700":"#be185d","pink-800":"#9d174d","pink-900":"#831843","pink-950":"#500724","rose-50":"#fff1f2","rose-100":"#ffe4e6","rose-200":"#fecdd3","rose-300":"#fda4af","rose-400":"#fb7185","rose-500":"#f43f5e","rose-600":"#e11d48","rose-700":"#be123c","rose-800":"#9f1239","rose-900":"#881337","rose-950":"#4c0519"};const t={inherit:"inherit",none:"none","bg-img-checked":`url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><path fill='none' stroke='#FFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 10l3 3l6-6'/></svg>")}")`,"bg-img-indeterminate":`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><line stroke='${e.colors["violet-400"]}' x1='4' y1='10' x2='16' y2='10' stroke-width='1' /></svg>`)}")`,"bg-img-radio":`url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><circle fill='#FFF' cx='10' cy='10' r='5'/></svg>")}")`,"small-shadow":"rgba(0, 0, 0, 0.16) 0px 1px 4px","medium-shadow":"rgba(0, 0, 0, 0.24) 0px 3px 8px","large-shadow":"rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px"},r={};let l={};function s(o){return o in l?r[o]=l[o]:o in t?r[o]=t[o]:o in e.colors?r[o]=e.colors[o]:r[o]=o,`var(--${o})`}e.getVariableValue=s;function n(){return Object.entries(r).map(([o,c])=>`--${o}: ${c};`).join("")}e.generateVariables=n;function d(o){l=o}e.setUserVariables=d})(W||(W={}));const w=W,z={appearance:[{values:["none","auto","menulist-button","textfield","button","checkbox"]}],b:[{values:0,styleName:"border-width",valueFormat:u.Value.px}],bx:[{values:0,styleName:"border-inline-width",valueFormat:u.Value.px}],by:[{values:0,styleName:"border-block-width",valueFormat:u.Value.px}],bt:[{values:0,styleName:"border-top-width",valueFormat:u.Value.px}],br:[{values:0,styleName:"border-right-width",valueFormat:u.Value.px}],bb:[{values:0,styleName:"border-bottom-width",valueFormat:u.Value.px}],bl:[{values:0,styleName:"border-left-width",valueFormat:u.Value.px}],borderStyle:[{styleName:"border-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],borderRadius:[{styleName:"border-radius",values:0,valueFormat:u.Value.rem}],borderRadiusTop:[{values:0,styleName:["border-top-left-radius","border-top-right-radius"],valueFormat:u.Value.rem}],borderRadiusRight:[{values:0,styleName:["border-top-right-radius","border-bottom-right-radius"],valueFormat:u.Value.rem}],borderRadiusBottom:[{values:0,styleName:["border-bottom-left-radius","border-bottom-right-radius"],valueFormat:u.Value.rem}],borderRadiusLeft:[{values:0,styleName:["border-top-left-radius","border-bottom-left-radius"],valueFormat:u.Value.rem}],borderRadiusTopLeft:[{values:0,styleName:"border-top-left-radius",valueFormat:u.Value.rem}],borderRadiusTopRight:[{values:0,styleName:"border-top-right-radius",valueFormat:u.Value.rem}],borderRadiusBottomRight:[{values:0,styleName:"border-bottom-right-radius",valueFormat:u.Value.rem}],borderRadiusBottomLeft:[{values:0,styleName:"border-bottom-left-radius",valueFormat:u.Value.rem}],position:[{values:["static","relative","absolute","fixed","sticky"]}],top:[{values:0,valueFormat:u.Value.rem}],right:[{values:0,valueFormat:u.Value.rem}],bottom:[{values:0,valueFormat:u.Value.rem}],left:[{values:0,valueFormat:u.Value.rem}],inset:[{values:0,valueFormat:u.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:u.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:u.Value.rem}],rowGap:[{styleName:"row-gap",values:0,valueFormat:u.Value.rem}],columnGap:[{styleName:"column-gap",values:0,valueFormat:u.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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*100}%`}},{styleName:"max-width",values:["auto","fit-content","max-content","min-content"]}],letterSpacing:[{styleName:"letter-spacing",values:0,valueFormat:u.Value.px}],lineHeight:[{styleName:"line-height",values:0,valueFormat:u.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:u.Value.rem},{values:["auto"],styleName:"margin"}],mx:[{values:0,styleName:"margin-inline",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-inline"}],my:[{values:0,styleName:"margin-block",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-block"}],mt:[{values:0,styleName:"margin-top",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-top"}],mr:[{values:0,styleName:"margin-right",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-right"}],mb:[{values:0,styleName:"margin-bottom",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-bottom"}],ml:[{values:0,styleName:"margin-left",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-left"}],p:[{values:0,styleName:"padding",valueFormat:u.Value.rem}],px:[{values:0,styleName:"padding-inline",valueFormat:u.Value.rem}],py:[{values:0,styleName:"padding-block",valueFormat:u.Value.rem}],pt:[{values:0,styleName:"padding-top",valueFormat:u.Value.rem}],pr:[{values:0,styleName:"padding-right",valueFormat:u.Value.rem}],pb:[{values:0,styleName:"padding-bottom",valueFormat:u.Value.rem}],pl:[{values:0,styleName:"padding-left",valueFormat:u.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:u.Value.px}],outlineStyle:[{styleName:"outline-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],outlineOffset:[{styleName:"outline-offset",values:0,valueFormat:u.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"]}],colSpan:[{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}],color:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e)}],bgColor:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e),styleName:"background-color"}],borderColor:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e),styleName:"border-color"}],outlineColor:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e),styleName:"outline-color"}],fill:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e)}],stroke:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e)}],bgImage:[{values:["none","bg-img-checked","bg-img-indeterminate","bg-img-radio"],valueFormat:(e,t)=>t(e),styleName:"background-image"}],shadow:[{values:["small-shadow","medium-shadow","large-shadow"],valueFormat:(e,t)=>t(e),styleName:"box-shadow"}],translateX:[{values:0,valueFormat:e=>`translateX(${e/4}rem)`,styleName:"transform"}]},se={hover:":hover",focus:":focus-within",hasFocus:":has(:focus)",active:":active",valid:":user-valid",hasValid:":has(:valid)",invalid:":user-invalid",hasInvalid:":has(:user-invalid)",optional:":optional",hasChecked:":has(:checked)",hasRequired:":has(:required)",hasDisabled:":has([disabled])"},G={indeterminate:":indeterminate",checked:":checked",required:":required",disabled:"[disabled]",selected:'[aria-selected="true"]'},Z={...se,...G},ie=Object.entries(Z).reduce((e,[t],r)=>(e[t]=Math.pow(2,r),e),{}),K=Object.entries(Z).reduce((e,[t])=>{const r=ie[t];return Object.entries(e).forEach(([l,s])=>{e[+l+r]=[...s,t]}),e},{0:[]}),M={hoverGroup:"hover",focusGroup:"focus",activeGroup:"active",disabledGroup:"disabled"},U={sm:640,md:768,lg:1024,xl:1280,xxl:1536};var X;(e=>{function t(n,d,o){const c={...n},y=c.props||{};return d.forEach(a=>{a in c&&(y[a]=c[a],delete c[a])}),o&&Object.entries(o).forEach(([a,v])=>{y[a]=v}),c.props=y,c}e.buildProps=t;function r(n){return!!n&&typeof n=="object"}e.isObject=r;function l(...n){return n.reduce((d,o)=>(Object.keys(o??{}).forEach(c=>{const y=d[c],a=o[c];c in G&&typeof a=="boolean"||(c in G&&Array.isArray(a)?d[c]=l(y,a[1]??{}):Array.isArray(y)&&Array.isArray(a)?d[c]=y.concat(...a):r(y)&&r(a)?d[c]=l(y,a):d[c]=a)}),d),{})}e.mergeDeep=l;function s(n,d){return n in d}e.isKeyOf=s})(X||(X={}));const $=X;class fe{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:r,next:l}=me,s=t-r.length;if(s<0)return r[t];const n=Math.floor(s/l.length),d=s-n*l.length;return this.getByIndex(n)+l[d]}}const me={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"},B={button:{styles:{display:"inline-flex",color:"white",bgColor:"violet-500",borderColor:"violet-500",p:3,cursor:"pointer",b:1,borderRadius:1,userSelect:"none",lineHeight:20,hover:{bgColor:"violet-600",borderColor:"violet-600"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300"}}},textbox:{styles:{display:"inline-block",b:1,borderColor:"violet-200",bgColor:"violet-50",color:"violet-950",borderRadius:1,p:3,transition:"none",lineHeight:20,hover:{borderColor:"violet-300"},focus:{outline:1,borderColor:"violet-500",outlineColor:"violet-500"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300"}}},textarea:{styles:{display:"inline-block",b:1,borderColor:"violet-200",bgColor:"violet-50",color:"violet-950",borderRadius:1,p:3,transition:"none",hover:{borderColor:"violet-300"},focus:{outline:1,borderColor:"violet-500",outlineColor:"violet-500"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300",resize:"none"}}},checkbox:{styles:{display:"inline-block",appearance:"none",b:1,borderColor:"violet-300",borderRadius:1,p:2,cursor:"pointer",transition:"none",hover:{borderColor:"violet-500"},focus:{outline:2,outlineOffset:2,outlineColor:"violet-500"},checked:{bgColor:"violet-500",borderColor:"violet-500",bgImage:"bg-img-checked"},indeterminate:{color:"violet-500",bgImage:"bg-img-indeterminate"},disabled:{cursor:"not-allowed",bgColor:"violet-100",color:"gray-400",borderColor:"gray-300"}}},radioButton:{styles:{appearance:"none",b:1,borderColor:"violet-300",borderRadius:3,p:2,cursor:"pointer",transition:"none",hover:{borderColor:"violet-500"},focus:{outline:2,outlineOffset:2,outlineColor:"violet-500"},checked:{bgColor:"violet-500",borderColor:"violet-500",bgImage:"bg-img-radio"},disabled:{cursor:"not-allowed",bgColor:"violet-100",color:"gray-400",borderColor:"violet-200"}}},dropdown:{styles:{display:"inline-flex",ai:"center",gap:2,jc:"space-between",p:3,cursor:"pointer",bgColor:"violet-50",color:"violet-950",b:1,borderColor:"violet-200",borderRadius:1,userSelect:"none",lineHeight:20,minWidth:40,transition:"none",hover:{borderColor:"violet-300"},focus:{outline:1,borderColor:"violet-500",outlineColor:"violet-500"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300"}},children:{display:{styles:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},items:{styles:{display:"flex",d:"column",gap:1,p:1,b:1,borderRadius:1,position:"relative",top:1,bgColor:"white",overflow:"auto",maxHeight:62,borderColor:"violet-300",color:"violet-950",shadow:"medium-shadow"}},item:{styles:{display:"flex",width:"fit",p:3,cursor:"pointer",borderRadius:1,hover:{bgColor:"gray-100"},focus:{bgColor:"violet-50"},selected:{bgColor:"violet-50",cursor:"default",hover:{bgColor:"violet-100"}}},themes:{multiple:{selected:{cursor:"pointer"}}}},unselectItem:{styles:{display:"flex",width:"fit",p:3,cursor:"pointer",lineHeight:20,borderRadius:1,color:"violet-400",hover:{bgColor:"violet-50"},focus:{bgColor:"violet-50"},selected:{bgColor:"violet-50",cursor:"default"}}},emptyItem:{styles:{display:"flex",width:"fit",p:3,cursor:"default",lineHeight:20,borderRadius:1,color:"violet-400"}}}}},P=p.createContext({themeStyles:B,theme:"",setTheme:()=>{}});function ve(e){const{clean:t,theme:r,component:l}=e,{themeStyles:s}=p.useContext(P);return p.useMemo(()=>{var o;if(t)return;const n=l==null?void 0:l.split(".");if(!n)return;const d=n.reduce((c,y,a)=>{var v;return a===0?s==null?void 0:s[y]:(v=c==null?void 0:c.children)==null?void 0:v[y]},void 0);if(d)return r?$.mergeDeep(d.styles,((o=d.themes)==null?void 0:o[r])??{}):d.styles},[l,t,r,s])}const be=new fe,ye=typeof window<"u"&&typeof window.document<"u";var ae;const ne=typeof process=="object"&&((ae=process.env)==null?void 0:ae.NODE_ENV)==="test",ge=ye&&!ne?p.useLayoutEffect:p.useEffect,ue="_b",A="_s";function he(e,t){ge(T.flush,[e]);const r=ve(e);return p.useMemo(()=>{const l=[t?A:ue],s=r?$.mergeDeep(r,e):e;return T.addClassNames(s,l,[]),l},[e,t,r])}var T;(e=>{let t=!0,r={};function l(a,v,g,b,i){Object.entries(a).forEach(([m,f])=>{if($.isKeyOf(m,z))d(m,f,v,g,b,i);else if($.isKeyOf(m,se))l(f,v,[...g,m],b,i);else if($.isKeyOf(m,G)){if(Array.isArray(f)){const[N,F]=f;l(F,v,[...g,m],b,i)}$.isObject(f)&&l(f,v,[...g,m],b,i)}else $.isKeyOf(m,U)?l(f,v,g,m,i):$.isKeyOf(m,M)&&(typeof f=="string"?v.push(`${M[m]}-${f}`):Object.entries(f).forEach(([N,F])=>{l(F,v,[...g,M[m]],b,N)}))})}e.addClassNames=l;function s(){if(!t)return;console.debug("\x1B[36m%s\x1B[0m","[react-box]: flush");const a=Object.entries(z).reduce((m,[f],N)=>(m[f]=N,m),{}),v=`: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 p=require("react"),ce=require("react/jsx-runtime");function ae(...e){return e.reduce((t,r)=>r?typeof r=="string"?(t.push(r),t):Array.isArray(r)?(t.push(...ae(...r)),t):(Object.entries(r).forEach(([a,i])=>{i&&t.push(a)}),t):t,[])}var u;(e=>{(t=>{function r(i,n){return`${i}${n.replace("/","-")}`}t.fraction=r;function a(i){return[`${i} path`,`${i} circle`,`${i} rect`,`${i} line`]}t.svg=a})(e.ClassName||(e.ClassName={})),(t=>{function r(b,s,c=4){return`${b/c}rem`}t.rem=r;function a(b){return`${b}px`}t.px=a;function i(b,s){const[c,m]=s.split("/");return`${+c/+m*100}%`}t.fraction=i;function n(b,s){switch(s){case"fit":return"100%";case"fit-screen":return b.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return s}}t.widthHeight=n;function d(b){return(s,c)=>`var(--${b}${c});`}t.variables=d;function o(b){return(s,c)=>`var(--${b}${c});`}t.svgVariables=o;function f(b,s){return`repeat(${s},minmax(0,1fr))`}t.gridColumns=f;function y(b,s){return s==="full-row"?"1/-1":`span ${s}/span ${s}`}t.gridColumn=y;function l(b,s){return`${s}ms`}t.ms=l;function v(b,s){return`${s}deg`}t.rotate=v;function g(b,s){return s==="xAxis"?"-1 1":"1 -1"}t.flip=g})(e.Value||(e.Value={}))})(u||(u={}));var W;(e=>{e.colors={currentColor:"currentColor",transparent:"transparent",green:"green",red:"red",blue:"blue",gray:"gray",black:"#000",white:"#fff","slate-50":"#f8fafc","slate-100":"#f1f5f9","slate-200":"#e2e8f0","slate-300":"#cbd5e1","slate-400":"#94a3b8","slate-500":"#64748b","slate-600":"#475569","slate-700":"#334155","slate-800":"#1e293b","slate-900":"#0f172a","slate-950":"#020617","gray-50":"#f9fafb","gray-100":"#f3f4f6","gray-200":"#e5e7eb","gray-300":"#d1d5db","gray-400":"#9ca3af","gray-500":"#6b7280","gray-600":"#4b5563","gray-700":"#374151","gray-800":"#1f2937","gray-900":"#111827","gray-950":"#030712","zinc-50":"#fafafa","zinc-100":"#f4f4f5","zinc-200":"#e4e4e7","zinc-300":"#d4d4d8","zinc-400":"#a1a1aa","zinc-500":"#71717a","zinc-600":"#52525b","zinc-700":"#3f3f46","zinc-800":"#27272a","zinc-900":"#18181b","zinc-950":"#09090b","neutral-50":"#fafafa","neutral-100":"#f5f5f5","neutral-200":"#e5e5e5","neutral-300":"#d4d4d4","neutral-400":"#a3a3a3","neutral-500":"#737373","neutral-600":"#525252","neutral-700":"#404040","neutral-800":"#262626","neutral-900":"#171717","neutral-950":"#0a0a0a","stone-50":"#fafaf9","stone-100":"#f5f5f4","stone-200":"#e7e5e4","stone-300":"#d6d3d1","stone-400":"#a8a29e","stone-500":"#78716c","stone-600":"#57534e","stone-700":"#44403c","stone-800":"#292524","stone-900":"#1c1917","stone-950":"#0c0a09","red-50":"#fef2f2","red-100":"#fee2e2","red-200":"#fecaca","red-300":"#fca5a5","red-400":"#f87171","red-500":"#ef4444","red-600":"#dc2626","red-700":"#b91c1c","red-800":"#991b1b","red-900":"#7f1d1d","red-950":"#450a0a","orange-50":"#fff7ed","orange-100":"#ffedd5","orange-200":"#fed7aa","orange-300":"#fdba74","orange-400":"#fb923c","orange-500":"#f97316","orange-600":"#ea580c","orange-700":"#c2410c","orange-800":"#9a3412","orange-900":"#7c2d12","orange-950":"#431407","amber-50":"#fffbeb","amber-100":"#fef3c7","amber-200":"#fde68a","amber-300":"#fcd34d","amber-400":"#fbbf24","amber-500":"#f59e0b","amber-600":"#d97706","amber-700":"#b45309","amber-800":"#92400e","amber-900":"#78350f","amber-950":"#451a03","yellow-50":"#fefce8","yellow-100":"#fef9c3","yellow-200":"#fef08a","yellow-300":"#fde047","yellow-400":"#facc15","yellow-500":"#eab308","yellow-600":"#ca8a04","yellow-700":"#a16207","yellow-800":"#854d0e","yellow-900":"#713f12","yellow-950":"#422006","lime-50":"#f7fee7","lime-100":"#ecfccb","lime-200":"#d9f99d","lime-300":"#bef264","lime-400":"#a3e635","lime-500":"#84cc16","lime-600":"#65a30d","lime-700":"#4d7c0f","lime-800":"#3f6212","lime-900":"#365314","lime-950":"#1a2e05","green-50":"#f0fdf4","green-100":"#dcfce7","green-200":"#bbf7d0","green-300":"#86efac","green-400":"#4ade80","green-500":"#22c55e","green-600":"#16a34a","green-700":"#15803d","green-800":"#166534","green-900":"#14532d","green-950":"#052e16","emerald-50":"#ecfdf5","emerald-100":"#d1fae5","emerald-200":"#a7f3d0","emerald-300":"#6ee7b7","emerald-400":"#34d399","emerald-500":"#10b981","emerald-600":"#059669","emerald-700":"#047857","emerald-800":"#065f46","emerald-900":"#064e3b","emerald-950":"#022c22","teal-50":"#f0fdfa","teal-100":"#ccfbf1","teal-200":"#99f6e4","teal-300":"#5eead4","teal-400":"#2dd4bf","teal-500":"#14b8a6","teal-600":"#0d9488","teal-700":"#0f766e","teal-800":"#115e59","teal-900":"#134e4a","teal-950":"#042f2e","cyan-50":"#ecfeff","cyan-100":"#cffafe","cyan-200":"#a5f3fc","cyan-300":"#67e8f9","cyan-400":"#22d3ee","cyan-500":"#06b6d4","cyan-600":"#0891b2","cyan-700":"#0e7490","cyan-800":"#155e75","cyan-900":"#164e63","cyan-950":"#083344","sky-50":"#f0f9ff","sky-100":"#e0f2fe","sky-200":"#bae6fd","sky-300":"#7dd3fc","sky-400":"#38bdf8","sky-500":"#0ea5e9","sky-600":"#0284c7","sky-700":"#0369a1","sky-800":"#075985","sky-900":"#0c4a6e","sky-950":"#082f49","blue-50":"#eff6ff","blue-100":"#dbeafe","blue-200":"#bfdbfe","blue-300":"#93c5fd","blue-400":"#60a5fa","blue-500":"#3b82f6","blue-600":"#2563eb","blue-700":"#1d4ed8","blue-800":"#1e40af","blue-900":"#1e3a8a","blue-950":"#172554","indigo-50":"#eef2ff","indigo-100":"#e0e7ff","indigo-200":"#c7d2fe","indigo-300":"#a5b4fc","indigo-400":"#818cf8","indigo-500":"#6366f1","indigo-600":"#4f46e5","indigo-700":"#4338ca","indigo-800":"#3730a3","indigo-900":"#312e81","indigo-950":"#1e1b4b","violet-50":"#f5f3ff","violet-100":"#ede9fe","violet-200":"#ddd6fe","violet-300":"#c4b5fd","violet-400":"#a78bfa","violet-500":"#8b5cf6","violet-600":"#7c3aed","violet-700":"#6d28d9","violet-800":"#5b21b6","violet-900":"#4c1d95","violet-950":"#2e1065",vi:"#7949FF","purple-50":"#faf5ff","purple-100":"#f3e8ff","purple-200":"#e9d5ff","purple-300":"#d8b4fe","purple-400":"#c084fc","purple-500":"#a855f7","purple-600":"#9333ea","purple-700":"#7e22ce","purple-800":"#6b21a8","purple-900":"#581c87","purple-950":"#3b0764","fuchsia-50":"#fdf4ff","fuchsia-100":"#fae8ff","fuchsia-200":"#f5d0fe","fuchsia-300":"#f0abfc","fuchsia-400":"#e879f9","fuchsia-500":"#d946ef","fuchsia-600":"#c026d3","fuchsia-700":"#a21caf","fuchsia-800":"#86198f","fuchsia-900":"#701a75","fuchsia-950":"#4a044e","pink-50":"#fdf2f8","pink-100":"#fce7f3","pink-200":"#fbcfe8","pink-300":"#f9a8d4","pink-400":"#f472b6","pink-500":"#ec4899","pink-600":"#db2777","pink-700":"#be185d","pink-800":"#9d174d","pink-900":"#831843","pink-950":"#500724","rose-50":"#fff1f2","rose-100":"#ffe4e6","rose-200":"#fecdd3","rose-300":"#fda4af","rose-400":"#fb7185","rose-500":"#f43f5e","rose-600":"#e11d48","rose-700":"#be123c","rose-800":"#9f1239","rose-900":"#881337","rose-950":"#4c0519"};const t={inherit:"inherit",none:"none","bg-img-checked":`url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><path fill='none' stroke='#FFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 10l3 3l6-6'/></svg>")}")`,"bg-img-indeterminate":`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><line stroke='${e.colors["violet-400"]}' x1='4' y1='10' x2='16' y2='10' stroke-width='1' /></svg>`)}")`,"bg-img-radio":`url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><circle fill='#FFF' cx='10' cy='10' r='5'/></svg>")}")`,"small-shadow":"rgba(0, 0, 0, 0.16) 0px 1px 4px","medium-shadow":"rgba(0, 0, 0, 0.24) 0px 3px 8px","large-shadow":"rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px"},r={};let a={};function i(o){return o in a?r[o]=a[o]:o in t?r[o]=t[o]:o in e.colors?r[o]=e.colors[o]:r[o]=o,`var(--${o})`}e.getVariableValue=i;function n(){return Object.entries(r).map(([o,f])=>`--${o}: ${f};`).join("")}e.generateVariables=n;function d(o){a=o}e.setUserVariables=d})(W||(W={}));const w=W,z={appearance:[{values:["none","auto","menulist-button","textfield","button","checkbox"]}],b:[{values:0,styleName:"border-width",valueFormat:u.Value.px}],bx:[{values:0,styleName:"border-inline-width",valueFormat:u.Value.px}],by:[{values:0,styleName:"border-block-width",valueFormat:u.Value.px}],bt:[{values:0,styleName:"border-top-width",valueFormat:u.Value.px}],br:[{values:0,styleName:"border-right-width",valueFormat:u.Value.px}],bb:[{values:0,styleName:"border-bottom-width",valueFormat:u.Value.px}],bl:[{values:0,styleName:"border-left-width",valueFormat:u.Value.px}],borderStyle:[{styleName:"border-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],borderRadius:[{styleName:"border-radius",values:0,valueFormat:u.Value.rem}],borderRadiusTop:[{values:0,styleName:["border-top-left-radius","border-top-right-radius"],valueFormat:u.Value.rem}],borderRadiusRight:[{values:0,styleName:["border-top-right-radius","border-bottom-right-radius"],valueFormat:u.Value.rem}],borderRadiusBottom:[{values:0,styleName:["border-bottom-left-radius","border-bottom-right-radius"],valueFormat:u.Value.rem}],borderRadiusLeft:[{values:0,styleName:["border-top-left-radius","border-bottom-left-radius"],valueFormat:u.Value.rem}],borderRadiusTopLeft:[{values:0,styleName:"border-top-left-radius",valueFormat:u.Value.rem}],borderRadiusTopRight:[{values:0,styleName:"border-top-right-radius",valueFormat:u.Value.rem}],borderRadiusBottomRight:[{values:0,styleName:"border-bottom-right-radius",valueFormat:u.Value.rem}],borderRadiusBottomLeft:[{values:0,styleName:"border-bottom-left-radius",valueFormat:u.Value.rem}],position:[{values:["static","relative","absolute","fixed","sticky"]}],top:[{values:0,valueFormat:u.Value.rem}],right:[{values:0,valueFormat:u.Value.rem}],bottom:[{values:0,valueFormat:u.Value.rem}],left:[{values:0,valueFormat:u.Value.rem}],inset:[{values:0,valueFormat:u.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:e=>u.Value.rem(e,void 0,16)},{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:u.Value.rem}],rowGap:[{styleName:"row-gap",values:0,valueFormat:u.Value.rem}],columnGap:[{styleName:"column-gap",values:0,valueFormat:u.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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*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,r]=e.split("/");return`${+t/+r*100}%`}},{styleName:"max-width",values:["auto","fit-content","max-content","min-content"]}],letterSpacing:[{styleName:"letter-spacing",values:0,valueFormat:u.Value.px}],lineHeight:[{styleName:"line-height",values:0,valueFormat:u.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:u.Value.rem},{values:["auto"],styleName:"margin"}],mx:[{values:0,styleName:"margin-inline",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-inline"}],my:[{values:0,styleName:"margin-block",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-block"}],mt:[{values:0,styleName:"margin-top",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-top"}],mr:[{values:0,styleName:"margin-right",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-right"}],mb:[{values:0,styleName:"margin-bottom",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-bottom"}],ml:[{values:0,styleName:"margin-left",valueFormat:u.Value.rem},{values:["auto"],styleName:"margin-left"}],p:[{values:0,styleName:"padding",valueFormat:u.Value.rem}],px:[{values:0,styleName:"padding-inline",valueFormat:u.Value.rem}],py:[{values:0,styleName:"padding-block",valueFormat:u.Value.rem}],pt:[{values:0,styleName:"padding-top",valueFormat:u.Value.rem}],pr:[{values:0,styleName:"padding-right",valueFormat:u.Value.rem}],pb:[{values:0,styleName:"padding-bottom",valueFormat:u.Value.rem}],pl:[{values:0,styleName:"padding-left",valueFormat:u.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:u.Value.px}],outlineStyle:[{styleName:"outline-style",values:["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"]}],outlineOffset:[{styleName:"outline-offset",values:0,valueFormat:u.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"]}],colSpan:[{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}],color:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e)}],bgColor:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e),styleName:"background-color"}],borderColor:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e),styleName:"border-color"}],outlineColor:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e),styleName:"outline-color"}],fill:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e)}],stroke:[{values:Object.keys(w.colors),valueFormat:(e,t)=>t(e)}],bgImage:[{values:["none","bg-img-checked","bg-img-indeterminate","bg-img-radio"],valueFormat:(e,t)=>t(e),styleName:"background-image"}],shadow:[{values:["small-shadow","medium-shadow","large-shadow"],valueFormat:(e,t)=>t(e),styleName:"box-shadow"}],translateX:[{values:0,valueFormat:e=>`translateX(${e/4}rem)`,styleName:"transform"}]},se={hover:":hover",focus:":focus-within",hasFocus:":has(:focus)",active:":active",valid:":user-valid",hasValid:":has(:valid)",invalid:":user-invalid",hasInvalid:":has(:user-invalid)",optional:":optional",hasChecked:":has(:checked)",hasRequired:":has(:required)",hasDisabled:":has([disabled])"},G={indeterminate:":indeterminate",checked:":checked",required:":required",disabled:"[disabled]",selected:'[aria-selected="true"]'},Z={...se,...G},ie=Object.entries(Z).reduce((e,[t],r)=>(e[t]=Math.pow(2,r),e),{}),K=Object.entries(Z).reduce((e,[t])=>{const r=ie[t];return Object.entries(e).forEach(([a,i])=>{e[+a+r]=[...i,t]}),e},{0:[]}),M={hoverGroup:"hover",focusGroup:"focus",activeGroup:"active",disabledGroup:"disabled"},U={sm:640,md:768,lg:1024,xl:1280,xxl:1536};var X;(e=>{function t(n,d,o){const f={...n},y=f.props||{};return d.forEach(l=>{l in f&&(y[l]=f[l],delete f[l])}),o&&Object.entries(o).forEach(([l,v])=>{y[l]=v}),f.props=y,f}e.buildProps=t;function r(n){return!!n&&typeof n=="object"}e.isObject=r;function a(...n){return n.reduce((d,o)=>(Object.keys(o??{}).forEach(f=>{const y=d[f],l=o[f];f in G&&typeof l=="boolean"||(f in G&&Array.isArray(l)?d[f]=a(y,l[1]??{}):Array.isArray(y)&&Array.isArray(l)?d[f]=y.concat(...l):r(y)&&r(l)?d[f]=a(y,l):d[f]=l)}),d),{})}e.mergeDeep=a;function i(n,d){return n in d}e.isKeyOf=i})(X||(X={}));const $=X;class fe{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:r,next:a}=me,i=t-r.length;if(i<0)return r[t];const n=Math.floor(i/a.length),d=i-n*a.length;return this.getByIndex(n)+a[d]}}const me={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"},B={button:{styles:{display:"inline-flex",color:"white",bgColor:"violet-500",borderColor:"violet-500",p:3,cursor:"pointer",b:1,borderRadius:1,userSelect:"none",lineHeight:20,hover:{bgColor:"violet-600",borderColor:"violet-600"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300"}}},textbox:{styles:{display:"inline-block",b:1,borderColor:"violet-200",bgColor:"violet-50",color:"violet-950",borderRadius:1,p:3,transition:"none",lineHeight:20,hover:{borderColor:"violet-300"},focus:{outline:1,borderColor:"violet-500",outlineColor:"violet-500"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300"}}},textarea:{styles:{display:"inline-block",b:1,borderColor:"violet-200",bgColor:"violet-50",color:"violet-950",borderRadius:1,p:3,transition:"none",hover:{borderColor:"violet-300"},focus:{outline:1,borderColor:"violet-500",outlineColor:"violet-500"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300",resize:"none"}}},checkbox:{styles:{display:"inline-block",appearance:"none",b:1,borderColor:"violet-300",borderRadius:1,p:2,cursor:"pointer",transition:"none",hover:{borderColor:"violet-500"},focus:{outline:2,outlineOffset:2,outlineColor:"violet-500"},checked:{bgColor:"violet-500",borderColor:"violet-500",bgImage:"bg-img-checked"},indeterminate:{color:"violet-500",bgImage:"bg-img-indeterminate"},disabled:{cursor:"not-allowed",bgColor:"violet-100",color:"gray-400",borderColor:"gray-300"}}},radioButton:{styles:{appearance:"none",b:1,borderColor:"violet-300",borderRadius:3,p:2,cursor:"pointer",transition:"none",hover:{borderColor:"violet-500"},focus:{outline:2,outlineOffset:2,outlineColor:"violet-500"},checked:{bgColor:"violet-500",borderColor:"violet-500",bgImage:"bg-img-radio"},disabled:{cursor:"not-allowed",bgColor:"violet-100",color:"gray-400",borderColor:"violet-200"}}},dropdown:{styles:{display:"inline-flex",ai:"center",gap:2,jc:"space-between",p:3,cursor:"pointer",bgColor:"violet-50",color:"violet-950",b:1,borderColor:"violet-200",borderRadius:1,userSelect:"none",lineHeight:20,minWidth:40,transition:"none",hover:{borderColor:"violet-300"},focus:{outline:1,borderColor:"violet-500",outlineColor:"violet-500"},disabled:{cursor:"not-allowed",bgColor:"violet-50",color:"gray-400",borderColor:"gray-300"}},children:{display:{styles:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},items:{styles:{display:"flex",d:"column",gap:1,p:1,b:1,borderRadius:1,position:"relative",top:1,bgColor:"white",overflow:"auto",maxHeight:62,borderColor:"violet-300",color:"violet-950",shadow:"medium-shadow"}},item:{styles:{display:"flex",width:"fit",p:3,cursor:"pointer",borderRadius:1,hover:{bgColor:"gray-100"},focus:{bgColor:"violet-50"},selected:{bgColor:"violet-50",cursor:"default",hover:{bgColor:"violet-100"}}},themes:{multiple:{selected:{cursor:"pointer"}}}},unselect:{styles:{display:"flex",width:"fit",p:3,cursor:"pointer",lineHeight:20,borderRadius:1,color:"violet-400",hover:{bgColor:"violet-50"},focus:{bgColor:"violet-50"},selected:{bgColor:"violet-50",cursor:"default"}}},selectAll:{styles:{display:"flex",width:"fit",p:3,cursor:"pointer",lineHeight:20,borderRadius:1,color:"violet-400",hover:{bgColor:"violet-50"},focus:{bgColor:"violet-50"},selected:{bgColor:"violet-50",cursor:"default"}}},emptyItem:{styles:{display:"flex",width:"fit",p:3,cursor:"default",lineHeight:20,borderRadius:1,color:"violet-400"}}}}},P=p.createContext({themeStyles:B,theme:"",setTheme:()=>{}});function ve(e){const{clean:t,theme:r,component:a}=e,{themeStyles:i}=p.useContext(P);return p.useMemo(()=>{var o;if(t)return;const n=a==null?void 0:a.split(".");if(!n)return;const d=n.reduce((f,y,l)=>{var v;return l===0?i==null?void 0:i[y]:(v=f==null?void 0:f.children)==null?void 0:v[y]},void 0);if(d)return r?$.mergeDeep(d.styles,((o=d.themes)==null?void 0:o[r])??{}):d.styles},[a,t,r,i])}const be=new fe,ye=typeof window<"u"&&typeof window.document<"u";var le;const ne=typeof process=="object"&&((le=process.env)==null?void 0:le.NODE_ENV)==="test",ge=ye&&!ne?p.useLayoutEffect:p.useEffect,ue="_b",A="_s";function he(e,t){ge(T.flush,[e]);const r=ve(e);return p.useMemo(()=>{const a=[t?A:ue],i=r?$.mergeDeep(r,e):e;return T.addClassNames(i,a,[]),a},[e,t,r])}var T;(e=>{let t=!0,r={};function a(l,v,g,b,s){Object.entries(l).forEach(([c,m])=>{if($.isKeyOf(c,z))d(c,m,v,g,b,s);else if($.isKeyOf(c,se))a(m,v,[...g,c],b,s);else if($.isKeyOf(c,G)){if(Array.isArray(m)){const[N,F]=m;a(F,v,[...g,c],b,s)}$.isObject(m)&&a(m,v,[...g,c],b,s)}else $.isKeyOf(c,U)?a(m,v,g,c,s):$.isKeyOf(c,M)&&(typeof m=="string"?v.push(`${M[c]}-${m}`):Object.entries(m).forEach(([N,F])=>{a(F,v,[...g,M[c]],b,N)}))})}e.addClassNames=a;function i(){if(!t)return;console.debug("\x1B[36m%s\x1B[0m","[react-box]: flush");const l=Object.entries(z).reduce((c,[m],N)=>(c[m]=N,c),{}),v=`: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
5
|
.${ue}{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
6
|
.${A}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${A} path,.${A} circle,.${A} rect,.${A} line {transition: all var(--svgTransitionTime);}
|
|
7
|
-
`,g=Object.entries(r);g.sort(([
|
|
7
|
+
`,g=Object.entries(r);g.sort(([c],[m])=>(U[c]??0)-(U[m]??0));const b=g.reduce((c,[m,N])=>(m!=="normal"&&c.push(`@media(min-width: ${U[m]}px){`),Object.entries(N).forEach(([F,q])=>{const{__parents:ee,...de}=q,te=Object.entries(de);te.sort(([C],[R])=>l[C]-l[R]),te.forEach(([C,R])=>{R.forEach(E=>{var k,H;const h=z[C].find(V=>Array.isArray(V.values)?V.values.includes(E):typeof E==typeof V.values);if(!h)return;const j=o(C,E,+F,m),D=K[+F].map(V=>Z[V]).join(""),x=((k=h.selector)==null?void 0:k.call(h,`.${j}`,D))??`.${j}${D}`,I=Array.isArray(h.styleName)?h.styleName:[h.styleName??C],S=((H=h.valueFormat)==null?void 0:H.call(h,E,w.getVariableValue))??E;c.push(`${x}{${I.map(V=>`${V}:${S}`).join(";")}}`)})}),ee&&Object.entries(ee).forEach(([C,R])=>{const E=Object.entries(R);E.sort(([O],[h])=>l[O]-l[h]),E.forEach(([O,h])=>{h.forEach(j=>{var re,oe;const x=z[O].find(_=>Array.isArray(_.values)?_.values.includes(j):typeof j==typeof _.values);if(!x)return;const I=o(O,j,+F,m,C),[S]=K[+F],k=((re=x.selector)==null?void 0:re.call(x,`.${S}-${C}:${S} .${I}`,""))??`.${S}-${C}:${S} .${I}`,H=Array.isArray(x.styleName)?x.styleName:[x.styleName??O],V=((oe=x.valueFormat)==null?void 0:oe.call(x,j,w.getVariableValue))??j;c.push(`${k}{${H.map(_=>`${_}:${V}`).join(";")}}`)})})})}),m!=="normal"&&c.push("}"),c),[v]);b.unshift(`:root{${w.generateVariables()}}`);const s=y();s.innerHTML=b.join(""),t=!1}e.flush=i;function n(){r={}}e.clear=n;function d(l,v,g,b,s="normal",c){if(v==null)return;const m=b.reduce((F,q)=>F+ie[q],0);r[s]?r[s][m]?r[s][m][l]||(r[s][m][l]=new Set):r[s][m]={[l]:new Set}:r[s]={[m]:{[l]:new Set}},c?(r[s][m].__parents?r[s][m].__parents[c]?r[s][m].__parents[c][l]||(r[s][m].__parents[c][l]=new Set):r[s][m].__parents[c]={[l]:new Set}:r[s][m].__parents={[c]:{[l]:new Set}},r[s][m].__parents[c][l].has(v)||(r[s][m].__parents[c][l].add(v),t=!0)):r[s][m][l].has(v)||(r[s][m][l].add(v),t=!0);const N=o(l,v,m,s,c);g.push(N)}function o(l,v,g,b,s){const c=K[g],m=`${b==="normal"?"":`${b}-`}${c.map(N=>`${N}-`).join("")}${s?`${s}-`:""}${l}-${v}`;return ne?m:be.getIdentity(m)}const f="crono-styles";function y(){let l=document.getElementById(f);return l||(l=document.createElement("style"),l.setAttribute("id",f),l.setAttribute("type","text/css"),document.head.insertBefore(l,document.head.firstChild)),l}})(T||(T={}));exports.StylesContext=void 0;(e=>{e.flush=T.flush,e.clear=T.clear})(exports.StylesContext||(exports.StylesContext={}));var Y;(e=>{function t(r,a,i){return w.setUserVariables(r),Object.entries(a).forEach(([n,d])=>{z[n]=d}),Object.entries(i).forEach(([n,d])=>{const o=z[n];z[n]=o?[...d,...o]:d}),{extendedProps:a,extendedPropTypes:i}}e.extend=t})(Y||(Y={}));const pe=Y;function L(e){const{children:t,theme:r}=e,[a,i]=p.useState(r),n=p.useMemo(()=>{var l;const d=(l=L.userThemes)==null?void 0:l[a];if(!d)return B;const{components:o,...f}=d,y=o??{};return Object.entries(f).forEach(([v,g])=>{y[v]=g}),Object.keys(y).forEach(v=>{y[v].clean&&v in B&&delete B[v]}),$.mergeDeep(B,y)},[a]);return ce.jsx(P.Provider,{value:{themeStyles:n,theme:a,setTheme:i},children:t})}(e=>{e.userThemes=void 0;function t(a){e.userThemes=a}e.setup=t;function r(){const{theme:a,setTheme:i}=p.useContext(P);return[a,i]}e.useTheme=r})(L||(L={}));const xe=L,we={selected:"aria-selected"};var J;(e=>{function t(r,a,i){r!==void 0&&r!=null&&(i[we[a]??a]=Array.isArray(r)?r[0]:r)}e.assignBooleanProp=t})(J||(J={}));const Ne=J;Array.prototype.removeBy||(Array.prototype.removeBy=function(e){return this.filter(e)});function Fe(e=null){const[t,r]=p.useState(!1),a=p.useRef(null);return p.useEffect(()=>{function i(d){const o=e??a.current;(o==null?void 0:o.contains(d.target))===!1&&r(!1)}function n(d){d.key==="Escape"&&r(!1)}return t&&(window.addEventListener("mousedown",i),window.addEventListener("keydown",n)),()=>{window.removeEventListener("mousedown",i),window.removeEventListener("keydown",n)}},[e,t]),[t,r,a]}function $e(){return p.useMemo(()=>{const e="crono-box";let t=document.getElementById(e);return t||(t=document.createElement("div"),t.id=e,document.body.appendChild(t)),t},[])}var Q;(e=>{function t(a){const i=Array.from(a.elements).reduce((n,d)=>{const o=d.name;return o&&(n[o]||(n[o]=[]),n[o].push(d)),n},{});return Object.entries(i).reduce((n,[d,o])=>{if(o.length===1){const f=o[0];r(n,d,f.type==="checkbox"||f.type==="radio"?f.checked:f.value)}else{const f=o.reduce((y,l)=>(l.type==="checkbox"||l.type==="radio"?l.checked&&y.push(l.value):y.push(l.value),y),[]);r(n,d,f)}return n},{})}e.getFormEntries=t;function r(a,i,n){if(i.includes(".")){const d=i.split(".");let o=a;d.forEach((f,y)=>{if(d.length>y+1){const l=f.match(/^(.+)\[(\d)\]$/);if(l){const[,v,g]=l;o[v]=o[v]||[],o[v][g]=o[v][g]||{},o=o[v][g]}else o[f]=o[f]||{},o=o[f]}else o[f]=n})}else a[i]=n}})(Q||(Q={}));const Ce=Q;exports.BoxExtends=pe;exports.BoxUtils=Ne;exports.FormUtils=Ce;exports.ObjectUtils=$;exports.Theme=xe;exports.Variables=w;exports.classNames=ae;exports.usePortalContainer=$e;exports.useStyles=he;exports.useVisibility=Fe;
|
package/core.mjs
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
import ve, { useContext as se, useMemo as L, useLayoutEffect as be, useEffect as ie, useState as ne, useRef as ye } from "react";
|
|
2
2
|
import { jsx as ge } from "react/jsx-runtime";
|
|
3
3
|
function he(...e) {
|
|
4
|
-
return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...he(...r)), t) : (Object.entries(r).forEach(([l,
|
|
5
|
-
|
|
4
|
+
return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...he(...r)), t) : (Object.entries(r).forEach(([l, i]) => {
|
|
5
|
+
i && t.push(l);
|
|
6
6
|
}), t) : t, []);
|
|
7
7
|
}
|
|
8
8
|
var u;
|
|
9
9
|
((e) => {
|
|
10
10
|
((t) => {
|
|
11
|
-
function r(
|
|
12
|
-
return `${
|
|
11
|
+
function r(i, n) {
|
|
12
|
+
return `${i}${n.replace("/", "-")}`;
|
|
13
13
|
}
|
|
14
14
|
t.fraction = r;
|
|
15
|
-
function l(
|
|
16
|
-
return [`${
|
|
15
|
+
function l(i) {
|
|
16
|
+
return [`${i} path`, `${i} circle`, `${i} rect`, `${i} line`];
|
|
17
17
|
}
|
|
18
18
|
t.svg = l;
|
|
19
19
|
})(e.ClassName || (e.ClassName = {})), ((t) => {
|
|
20
|
-
function r(b) {
|
|
21
|
-
return `${b /
|
|
20
|
+
function r(b, s, c = 4) {
|
|
21
|
+
return `${b / c}rem`;
|
|
22
22
|
}
|
|
23
23
|
t.rem = r;
|
|
24
24
|
function l(b) {
|
|
25
25
|
return `${b}px`;
|
|
26
26
|
}
|
|
27
27
|
t.px = l;
|
|
28
|
-
function
|
|
29
|
-
const [
|
|
30
|
-
return `${+
|
|
28
|
+
function i(b, s) {
|
|
29
|
+
const [c, m] = s.split("/");
|
|
30
|
+
return `${+c / +m * 100}%`;
|
|
31
31
|
}
|
|
32
|
-
t.fraction =
|
|
33
|
-
function n(b,
|
|
34
|
-
switch (
|
|
32
|
+
t.fraction = i;
|
|
33
|
+
function n(b, s) {
|
|
34
|
+
switch (s) {
|
|
35
35
|
case "fit":
|
|
36
36
|
return "100%";
|
|
37
37
|
case "fit-screen":
|
|
38
38
|
return b.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
|
|
39
39
|
default:
|
|
40
|
-
return
|
|
40
|
+
return s;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
t.widthHeight = n;
|
|
44
44
|
function d(b) {
|
|
45
|
-
return (
|
|
45
|
+
return (s, c) => `var(--${b}${c});`;
|
|
46
46
|
}
|
|
47
47
|
t.variables = d;
|
|
48
48
|
function o(b) {
|
|
49
|
-
return (
|
|
49
|
+
return (s, c) => `var(--${b}${c});`;
|
|
50
50
|
}
|
|
51
51
|
t.svgVariables = o;
|
|
52
|
-
function
|
|
53
|
-
return `repeat(${
|
|
52
|
+
function f(b, s) {
|
|
53
|
+
return `repeat(${s},minmax(0,1fr))`;
|
|
54
54
|
}
|
|
55
|
-
t.gridColumns =
|
|
56
|
-
function y(b,
|
|
57
|
-
return
|
|
55
|
+
t.gridColumns = f;
|
|
56
|
+
function y(b, s) {
|
|
57
|
+
return s === "full-row" ? "1/-1" : `span ${s}/span ${s}`;
|
|
58
58
|
}
|
|
59
59
|
t.gridColumn = y;
|
|
60
|
-
function a(b,
|
|
61
|
-
return `${
|
|
60
|
+
function a(b, s) {
|
|
61
|
+
return `${s}ms`;
|
|
62
62
|
}
|
|
63
63
|
t.ms = a;
|
|
64
|
-
function v(b,
|
|
65
|
-
return `${
|
|
64
|
+
function v(b, s) {
|
|
65
|
+
return `${s}deg`;
|
|
66
66
|
}
|
|
67
67
|
t.rotate = v;
|
|
68
|
-
function g(b,
|
|
69
|
-
return
|
|
68
|
+
function g(b, s) {
|
|
69
|
+
return s === "xAxis" ? "-1 1" : "1 -1";
|
|
70
70
|
}
|
|
71
71
|
t.flip = g;
|
|
72
72
|
})(e.Value || (e.Value = {}));
|
|
@@ -337,12 +337,12 @@ var M;
|
|
|
337
337
|
"large-shadow": "rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px"
|
|
338
338
|
}, r = {};
|
|
339
339
|
let l = {};
|
|
340
|
-
function
|
|
340
|
+
function i(o) {
|
|
341
341
|
return o in l ? r[o] = l[o] : o in t ? r[o] = t[o] : o in e.colors ? r[o] = e.colors[o] : r[o] = o, `var(--${o})`;
|
|
342
342
|
}
|
|
343
|
-
e.getVariableValue =
|
|
343
|
+
e.getVariableValue = i;
|
|
344
344
|
function n() {
|
|
345
|
-
return Object.entries(r).map(([o,
|
|
345
|
+
return Object.entries(r).map(([o, f]) => `--${o}: ${f};`).join("");
|
|
346
346
|
}
|
|
347
347
|
e.generateVariables = n;
|
|
348
348
|
function d(o) {
|
|
@@ -703,7 +703,7 @@ const N = M, E = {
|
|
|
703
703
|
{
|
|
704
704
|
styleName: "font-size",
|
|
705
705
|
values: 0,
|
|
706
|
-
valueFormat: u.Value.
|
|
706
|
+
valueFormat: (e) => u.Value.rem(e, void 0, 16)
|
|
707
707
|
},
|
|
708
708
|
{
|
|
709
709
|
styleName: "font-size",
|
|
@@ -1556,8 +1556,8 @@ const N = M, E = {
|
|
|
1556
1556
|
), W = Object.entries(Z).reduce(
|
|
1557
1557
|
(e, [t]) => {
|
|
1558
1558
|
const r = de[t];
|
|
1559
|
-
return Object.entries(e).forEach(([l,
|
|
1560
|
-
e[+l + r] = [...
|
|
1559
|
+
return Object.entries(e).forEach(([l, i]) => {
|
|
1560
|
+
e[+l + r] = [...i, t];
|
|
1561
1561
|
}), e;
|
|
1562
1562
|
},
|
|
1563
1563
|
{ 0: [] }
|
|
@@ -1581,12 +1581,12 @@ const N = M, E = {
|
|
|
1581
1581
|
var X;
|
|
1582
1582
|
((e) => {
|
|
1583
1583
|
function t(n, d, o) {
|
|
1584
|
-
const
|
|
1584
|
+
const f = { ...n }, y = f.props || {};
|
|
1585
1585
|
return d.forEach((a) => {
|
|
1586
|
-
a in
|
|
1586
|
+
a in f && (y[a] = f[a], delete f[a]);
|
|
1587
1587
|
}), o && Object.entries(o).forEach(([a, v]) => {
|
|
1588
1588
|
y[a] = v;
|
|
1589
|
-
}),
|
|
1589
|
+
}), f.props = y, f;
|
|
1590
1590
|
}
|
|
1591
1591
|
e.buildProps = t;
|
|
1592
1592
|
function r(n) {
|
|
@@ -1594,16 +1594,16 @@ var X;
|
|
|
1594
1594
|
}
|
|
1595
1595
|
e.isObject = r;
|
|
1596
1596
|
function l(...n) {
|
|
1597
|
-
return n.reduce((d, o) => (Object.keys(o ?? {}).forEach((
|
|
1598
|
-
const y = d[
|
|
1599
|
-
|
|
1597
|
+
return n.reduce((d, o) => (Object.keys(o ?? {}).forEach((f) => {
|
|
1598
|
+
const y = d[f], a = o[f];
|
|
1599
|
+
f in U && typeof a == "boolean" || (f in U && Array.isArray(a) ? d[f] = l(y, a[1] ?? {}) : Array.isArray(y) && Array.isArray(a) ? d[f] = y.concat(...a) : r(y) && r(a) ? d[f] = l(y, a) : d[f] = a);
|
|
1600
1600
|
}), d), {});
|
|
1601
1601
|
}
|
|
1602
1602
|
e.mergeDeep = l;
|
|
1603
|
-
function
|
|
1603
|
+
function i(n, d) {
|
|
1604
1604
|
return n in d;
|
|
1605
1605
|
}
|
|
1606
|
-
e.isKeyOf =
|
|
1606
|
+
e.isKeyOf = i;
|
|
1607
1607
|
})(X || (X = {}));
|
|
1608
1608
|
const C = X;
|
|
1609
1609
|
class pe {
|
|
@@ -1614,10 +1614,10 @@ class pe {
|
|
|
1614
1614
|
return this._cache[t] || (this._cache[t] = this.getByIndex(this._index++)), this._cache[t];
|
|
1615
1615
|
}
|
|
1616
1616
|
getByIndex(t) {
|
|
1617
|
-
const { first: r, next: l } = we,
|
|
1618
|
-
if (
|
|
1617
|
+
const { first: r, next: l } = we, i = t - r.length;
|
|
1618
|
+
if (i < 0)
|
|
1619
1619
|
return r[t];
|
|
1620
|
-
const n = Math.floor(
|
|
1620
|
+
const n = Math.floor(i / l.length), d = i - n * l.length;
|
|
1621
1621
|
return this.getByIndex(n) + l[d];
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
@@ -1855,7 +1855,28 @@ const we = {
|
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
1857
|
},
|
|
1858
|
-
|
|
1858
|
+
unselect: {
|
|
1859
|
+
styles: {
|
|
1860
|
+
display: "flex",
|
|
1861
|
+
width: "fit",
|
|
1862
|
+
p: 3,
|
|
1863
|
+
cursor: "pointer",
|
|
1864
|
+
lineHeight: 20,
|
|
1865
|
+
borderRadius: 1,
|
|
1866
|
+
color: "violet-400",
|
|
1867
|
+
hover: {
|
|
1868
|
+
bgColor: "violet-50"
|
|
1869
|
+
},
|
|
1870
|
+
focus: {
|
|
1871
|
+
bgColor: "violet-50"
|
|
1872
|
+
},
|
|
1873
|
+
selected: {
|
|
1874
|
+
bgColor: "violet-50",
|
|
1875
|
+
cursor: "default"
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
},
|
|
1879
|
+
selectAll: {
|
|
1859
1880
|
styles: {
|
|
1860
1881
|
display: "flex",
|
|
1861
1882
|
width: "fit",
|
|
@@ -1892,75 +1913,75 @@ const we = {
|
|
|
1892
1913
|
}, P = ve.createContext({ themeStyles: R, theme: "", setTheme: () => {
|
|
1893
1914
|
} });
|
|
1894
1915
|
function xe(e) {
|
|
1895
|
-
const { clean: t, theme: r, component: l } = e, { themeStyles:
|
|
1916
|
+
const { clean: t, theme: r, component: l } = e, { themeStyles: i } = se(P);
|
|
1896
1917
|
return L(() => {
|
|
1897
1918
|
var o;
|
|
1898
1919
|
if (t) return;
|
|
1899
1920
|
const n = l == null ? void 0 : l.split(".");
|
|
1900
1921
|
if (!n) return;
|
|
1901
|
-
const d = n.reduce((
|
|
1922
|
+
const d = n.reduce((f, y, a) => {
|
|
1902
1923
|
var v;
|
|
1903
|
-
return a === 0 ?
|
|
1924
|
+
return a === 0 ? i == null ? void 0 : i[y] : (v = f == null ? void 0 : f.children) == null ? void 0 : v[y];
|
|
1904
1925
|
}, void 0);
|
|
1905
1926
|
if (d)
|
|
1906
1927
|
return r ? C.mergeDeep(d.styles, ((o = d.themes) == null ? void 0 : o[r]) ?? {}) : d.styles;
|
|
1907
|
-
}, [l, t, r,
|
|
1928
|
+
}, [l, t, r, i]);
|
|
1908
1929
|
}
|
|
1909
1930
|
const Ne = new pe(), Fe = typeof window < "u" && typeof window.document < "u";
|
|
1910
1931
|
var le;
|
|
1911
|
-
const ce = typeof process == "object" && ((le = process.env) == null ? void 0 : le.NODE_ENV) === "test", $e = Fe && !ce ? be : ie, fe = "_b",
|
|
1932
|
+
const ce = typeof process == "object" && ((le = process.env) == null ? void 0 : le.NODE_ENV) === "test", $e = Fe && !ce ? be : ie, fe = "_b", A = "_s";
|
|
1912
1933
|
function Ee(e, t) {
|
|
1913
|
-
$e(
|
|
1934
|
+
$e(S.flush, [e]);
|
|
1914
1935
|
const r = xe(e);
|
|
1915
1936
|
return L(() => {
|
|
1916
|
-
const l = [t ?
|
|
1917
|
-
return
|
|
1937
|
+
const l = [t ? A : fe], i = r ? C.mergeDeep(r, e) : e;
|
|
1938
|
+
return S.addClassNames(i, l, []), l;
|
|
1918
1939
|
}, [e, t, r]);
|
|
1919
1940
|
}
|
|
1920
|
-
var
|
|
1941
|
+
var S;
|
|
1921
1942
|
((e) => {
|
|
1922
1943
|
let t = !0, r = {};
|
|
1923
|
-
function l(a, v, g, b,
|
|
1924
|
-
Object.entries(a).forEach(([
|
|
1925
|
-
if (C.isKeyOf(
|
|
1926
|
-
d(
|
|
1927
|
-
else if (C.isKeyOf(
|
|
1928
|
-
l(
|
|
1929
|
-
else if (C.isKeyOf(
|
|
1930
|
-
if (Array.isArray(
|
|
1931
|
-
const [w, x] =
|
|
1932
|
-
l(x, v, [...g,
|
|
1944
|
+
function l(a, v, g, b, s) {
|
|
1945
|
+
Object.entries(a).forEach(([c, m]) => {
|
|
1946
|
+
if (C.isKeyOf(c, E))
|
|
1947
|
+
d(c, m, v, g, b, s);
|
|
1948
|
+
else if (C.isKeyOf(c, ue))
|
|
1949
|
+
l(m, v, [...g, c], b, s);
|
|
1950
|
+
else if (C.isKeyOf(c, U)) {
|
|
1951
|
+
if (Array.isArray(m)) {
|
|
1952
|
+
const [w, x] = m;
|
|
1953
|
+
l(x, v, [...g, c], b, s);
|
|
1933
1954
|
}
|
|
1934
|
-
C.isObject(
|
|
1935
|
-
} else C.isKeyOf(
|
|
1936
|
-
l(x, v, [...g, q[
|
|
1955
|
+
C.isObject(m) && l(m, v, [...g, c], b, s);
|
|
1956
|
+
} else C.isKeyOf(c, H) ? l(m, v, g, c, s) : C.isKeyOf(c, q) && (typeof m == "string" ? v.push(`${q[c]}-${m}`) : Object.entries(m).forEach(([w, x]) => {
|
|
1957
|
+
l(x, v, [...g, q[c]], b, w);
|
|
1937
1958
|
}));
|
|
1938
1959
|
});
|
|
1939
1960
|
}
|
|
1940
1961
|
e.addClassNames = l;
|
|
1941
|
-
function
|
|
1962
|
+
function i() {
|
|
1942
1963
|
if (!t) return;
|
|
1943
1964
|
console.debug("\x1B[36m%s\x1B[0m", "[react-box]: flush");
|
|
1944
|
-
const a = Object.entries(E).reduce((
|
|
1965
|
+
const a = Object.entries(E).reduce((c, [m], w) => (c[m] = w, c), {}), v = `: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;}
|
|
1945
1966
|
html{font-size: 16px;font-family: Arial, sans-serif;}
|
|
1946
1967
|
body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
|
|
1947
1968
|
a,ul{all: unset;}
|
|
1948
1969
|
.${fe}{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;}
|
|
1949
|
-
.${
|
|
1970
|
+
.${A}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${A} path,.${A} circle,.${A} rect,.${A} line {transition: all var(--svgTransitionTime);}
|
|
1950
1971
|
`, g = Object.entries(r);
|
|
1951
1972
|
g.sort(
|
|
1952
|
-
([
|
|
1973
|
+
([c], [m]) => (H[c] ?? 0) - (H[m] ?? 0)
|
|
1953
1974
|
);
|
|
1954
1975
|
const b = g.reduce(
|
|
1955
|
-
(
|
|
1976
|
+
(c, [m, w]) => (m !== "normal" && c.push(`@media(min-width: ${H[m]}px){`), Object.entries(w).forEach(([x, D]) => {
|
|
1956
1977
|
const { __parents: ee, ...me } = D, te = Object.entries(me);
|
|
1957
1978
|
te.sort(([F], [T]) => a[F] - a[T]), te.forEach(([F, T]) => {
|
|
1958
1979
|
T.forEach((V) => {
|
|
1959
1980
|
var I, k;
|
|
1960
1981
|
const h = E[F].find(($) => Array.isArray($.values) ? $.values.includes(V) : typeof V == typeof $.values);
|
|
1961
1982
|
if (!h) return;
|
|
1962
|
-
const z = o(F, V, +x,
|
|
1963
|
-
|
|
1983
|
+
const z = o(F, V, +x, m), K = W[+x].map(($) => Z[$]).join(""), p = ((I = h.selector) == null ? void 0 : I.call(h, `.${z}`, K)) ?? `.${z}${K}`, B = Array.isArray(h.styleName) ? h.styleName : [h.styleName ?? F], O = ((k = h.valueFormat) == null ? void 0 : k.call(h, V, N.getVariableValue)) ?? V;
|
|
1984
|
+
c.push(`${p}{${B.map(($) => `${$}:${O}`).join(";")}}`);
|
|
1964
1985
|
});
|
|
1965
1986
|
}), ee && Object.entries(ee).forEach(([F, T]) => {
|
|
1966
1987
|
const V = Object.entries(T);
|
|
@@ -1969,70 +1990,70 @@ a,ul{all: unset;}
|
|
|
1969
1990
|
var re, oe;
|
|
1970
1991
|
const p = E[j].find((_) => Array.isArray(_.values) ? _.values.includes(z) : typeof z == typeof _.values);
|
|
1971
1992
|
if (!p) return;
|
|
1972
|
-
const B = o(j, z, +x,
|
|
1973
|
-
|
|
1993
|
+
const B = o(j, z, +x, m, F), [O] = W[+x], I = ((re = p.selector) == null ? void 0 : re.call(p, `.${O}-${F}:${O} .${B}`, "")) ?? `.${O}-${F}:${O} .${B}`, k = Array.isArray(p.styleName) ? p.styleName : [p.styleName ?? j], $ = ((oe = p.valueFormat) == null ? void 0 : oe.call(p, z, N.getVariableValue)) ?? z;
|
|
1994
|
+
c.push(`${I}{${k.map((_) => `${_}:${$}`).join(";")}}`);
|
|
1974
1995
|
});
|
|
1975
1996
|
});
|
|
1976
1997
|
});
|
|
1977
|
-
}),
|
|
1998
|
+
}), m !== "normal" && c.push("}"), c),
|
|
1978
1999
|
[v]
|
|
1979
2000
|
);
|
|
1980
2001
|
b.unshift(`:root{${N.generateVariables()}}`);
|
|
1981
|
-
const
|
|
1982
|
-
|
|
2002
|
+
const s = y();
|
|
2003
|
+
s.innerHTML = b.join(""), t = !1;
|
|
1983
2004
|
}
|
|
1984
|
-
e.flush =
|
|
2005
|
+
e.flush = i;
|
|
1985
2006
|
function n() {
|
|
1986
2007
|
r = {};
|
|
1987
2008
|
}
|
|
1988
2009
|
e.clear = n;
|
|
1989
|
-
function d(a, v, g, b,
|
|
2010
|
+
function d(a, v, g, b, s = "normal", c) {
|
|
1990
2011
|
if (v == null) return;
|
|
1991
|
-
const
|
|
1992
|
-
r[
|
|
1993
|
-
const w = o(a, v,
|
|
2012
|
+
const m = b.reduce((x, D) => x + de[D], 0);
|
|
2013
|
+
r[s] ? r[s][m] ? r[s][m][a] || (r[s][m][a] = /* @__PURE__ */ new Set()) : r[s][m] = { [a]: /* @__PURE__ */ new Set() } : r[s] = { [m]: { [a]: /* @__PURE__ */ new Set() } }, c ? (r[s][m].__parents ? r[s][m].__parents[c] ? r[s][m].__parents[c][a] || (r[s][m].__parents[c][a] = /* @__PURE__ */ new Set()) : r[s][m].__parents[c] = { [a]: /* @__PURE__ */ new Set() } : r[s][m].__parents = { [c]: { [a]: /* @__PURE__ */ new Set() } }, r[s][m].__parents[c][a].has(v) || (r[s][m].__parents[c][a].add(v), t = !0)) : r[s][m][a].has(v) || (r[s][m][a].add(v), t = !0);
|
|
2014
|
+
const w = o(a, v, m, s, c);
|
|
1994
2015
|
g.push(w);
|
|
1995
2016
|
}
|
|
1996
|
-
function o(a, v, g, b,
|
|
1997
|
-
const
|
|
1998
|
-
return ce ?
|
|
2017
|
+
function o(a, v, g, b, s) {
|
|
2018
|
+
const c = W[g], m = `${b === "normal" ? "" : `${b}-`}${c.map((w) => `${w}-`).join("")}${s ? `${s}-` : ""}${a}-${v}`;
|
|
2019
|
+
return ce ? m : Ne.getIdentity(m);
|
|
1999
2020
|
}
|
|
2000
|
-
const
|
|
2021
|
+
const f = "crono-styles";
|
|
2001
2022
|
function y() {
|
|
2002
|
-
let a = document.getElementById(
|
|
2003
|
-
return a || (a = document.createElement("style"), a.setAttribute("id",
|
|
2023
|
+
let a = document.getElementById(f);
|
|
2024
|
+
return a || (a = document.createElement("style"), a.setAttribute("id", f), a.setAttribute("type", "text/css"), document.head.insertBefore(a, document.head.firstChild)), a;
|
|
2004
2025
|
}
|
|
2005
|
-
})(
|
|
2026
|
+
})(S || (S = {}));
|
|
2006
2027
|
var ae;
|
|
2007
2028
|
((e) => {
|
|
2008
|
-
e.flush =
|
|
2029
|
+
e.flush = S.flush, e.clear = S.clear;
|
|
2009
2030
|
})(ae || (ae = {}));
|
|
2010
2031
|
var Y;
|
|
2011
2032
|
((e) => {
|
|
2012
|
-
function t(r, l,
|
|
2033
|
+
function t(r, l, i) {
|
|
2013
2034
|
return N.setUserVariables(r), Object.entries(l).forEach(([n, d]) => {
|
|
2014
2035
|
E[n] = d;
|
|
2015
|
-
}), Object.entries(
|
|
2036
|
+
}), Object.entries(i).forEach(([n, d]) => {
|
|
2016
2037
|
const o = E[n];
|
|
2017
2038
|
E[n] = o ? [...d, ...o] : d;
|
|
2018
|
-
}), { extendedProps: l, extendedPropTypes:
|
|
2039
|
+
}), { extendedProps: l, extendedPropTypes: i };
|
|
2019
2040
|
}
|
|
2020
2041
|
e.extend = t;
|
|
2021
2042
|
})(Y || (Y = {}));
|
|
2022
2043
|
const je = Y;
|
|
2023
2044
|
function G(e) {
|
|
2024
|
-
const { children: t, theme: r } = e, [l,
|
|
2045
|
+
const { children: t, theme: r } = e, [l, i] = ne(r), n = L(() => {
|
|
2025
2046
|
var a;
|
|
2026
2047
|
const d = (a = G.userThemes) == null ? void 0 : a[l];
|
|
2027
2048
|
if (!d) return R;
|
|
2028
|
-
const { components: o, ...
|
|
2029
|
-
return Object.entries(
|
|
2049
|
+
const { components: o, ...f } = d, y = o ?? {};
|
|
2050
|
+
return Object.entries(f).forEach(([v, g]) => {
|
|
2030
2051
|
y[v] = g;
|
|
2031
2052
|
}), Object.keys(y).forEach((v) => {
|
|
2032
2053
|
y[v].clean && v in R && delete R[v];
|
|
2033
2054
|
}), C.mergeDeep(R, y);
|
|
2034
2055
|
}, [l]);
|
|
2035
|
-
return /* @__PURE__ */ ge(P.Provider, { value: { themeStyles: n, theme: l, setTheme:
|
|
2056
|
+
return /* @__PURE__ */ ge(P.Provider, { value: { themeStyles: n, theme: l, setTheme: i }, children: t });
|
|
2036
2057
|
}
|
|
2037
2058
|
((e) => {
|
|
2038
2059
|
e.userThemes = void 0;
|
|
@@ -2041,8 +2062,8 @@ function G(e) {
|
|
|
2041
2062
|
}
|
|
2042
2063
|
e.setup = t;
|
|
2043
2064
|
function r() {
|
|
2044
|
-
const { theme: l, setTheme:
|
|
2045
|
-
return [l,
|
|
2065
|
+
const { theme: l, setTheme: i } = se(P);
|
|
2066
|
+
return [l, i];
|
|
2046
2067
|
}
|
|
2047
2068
|
e.useTheme = r;
|
|
2048
2069
|
})(G || (G = {}));
|
|
@@ -2051,27 +2072,27 @@ const Oe = G, Ce = {
|
|
|
2051
2072
|
};
|
|
2052
2073
|
var J;
|
|
2053
2074
|
((e) => {
|
|
2054
|
-
function t(r, l,
|
|
2055
|
-
r !== void 0 && r != null && (
|
|
2075
|
+
function t(r, l, i) {
|
|
2076
|
+
r !== void 0 && r != null && (i[Ce[l] ?? l] = Array.isArray(r) ? r[0] : r);
|
|
2056
2077
|
}
|
|
2057
2078
|
e.assignBooleanProp = t;
|
|
2058
2079
|
})(J || (J = {}));
|
|
2059
|
-
const
|
|
2080
|
+
const Ae = J;
|
|
2060
2081
|
Array.prototype.removeBy || (Array.prototype.removeBy = function(e) {
|
|
2061
2082
|
return this.filter(e);
|
|
2062
2083
|
});
|
|
2063
|
-
function
|
|
2084
|
+
function Se(e = null) {
|
|
2064
2085
|
const [t, r] = ne(!1), l = ye(null);
|
|
2065
2086
|
return ie(() => {
|
|
2066
|
-
function
|
|
2087
|
+
function i(d) {
|
|
2067
2088
|
const o = e ?? l.current;
|
|
2068
2089
|
(o == null ? void 0 : o.contains(d.target)) === !1 && r(!1);
|
|
2069
2090
|
}
|
|
2070
2091
|
function n(d) {
|
|
2071
2092
|
d.key === "Escape" && r(!1);
|
|
2072
2093
|
}
|
|
2073
|
-
return t && (window.addEventListener("mousedown",
|
|
2074
|
-
window.removeEventListener("mousedown",
|
|
2094
|
+
return t && (window.addEventListener("mousedown", i), window.addEventListener("keydown", n)), () => {
|
|
2095
|
+
window.removeEventListener("mousedown", i), window.removeEventListener("keydown", n);
|
|
2075
2096
|
};
|
|
2076
2097
|
}, [e, t]), [t, r, l];
|
|
2077
2098
|
}
|
|
@@ -2085,42 +2106,42 @@ function Te() {
|
|
|
2085
2106
|
var Q;
|
|
2086
2107
|
((e) => {
|
|
2087
2108
|
function t(l) {
|
|
2088
|
-
const
|
|
2109
|
+
const i = Array.from(l.elements).reduce(
|
|
2089
2110
|
(n, d) => {
|
|
2090
2111
|
const o = d.name;
|
|
2091
2112
|
return o && (n[o] || (n[o] = []), n[o].push(d)), n;
|
|
2092
2113
|
},
|
|
2093
2114
|
{}
|
|
2094
2115
|
);
|
|
2095
|
-
return Object.entries(
|
|
2116
|
+
return Object.entries(i).reduce((n, [d, o]) => {
|
|
2096
2117
|
if (o.length === 1) {
|
|
2097
|
-
const
|
|
2098
|
-
r(n, d,
|
|
2118
|
+
const f = o[0];
|
|
2119
|
+
r(n, d, f.type === "checkbox" || f.type === "radio" ? f.checked : f.value);
|
|
2099
2120
|
} else {
|
|
2100
|
-
const
|
|
2101
|
-
r(n, d,
|
|
2121
|
+
const f = o.reduce((y, a) => (a.type === "checkbox" || a.type === "radio" ? a.checked && y.push(a.value) : y.push(a.value), y), []);
|
|
2122
|
+
r(n, d, f);
|
|
2102
2123
|
}
|
|
2103
2124
|
return n;
|
|
2104
2125
|
}, {});
|
|
2105
2126
|
}
|
|
2106
2127
|
e.getFormEntries = t;
|
|
2107
|
-
function r(l,
|
|
2108
|
-
if (
|
|
2109
|
-
const d =
|
|
2128
|
+
function r(l, i, n) {
|
|
2129
|
+
if (i.includes(".")) {
|
|
2130
|
+
const d = i.split(".");
|
|
2110
2131
|
let o = l;
|
|
2111
|
-
d.forEach((
|
|
2132
|
+
d.forEach((f, y) => {
|
|
2112
2133
|
if (d.length > y + 1) {
|
|
2113
|
-
const a =
|
|
2134
|
+
const a = f.match(/^(.+)\[(\d)\]$/);
|
|
2114
2135
|
if (a) {
|
|
2115
2136
|
const [, v, g] = a;
|
|
2116
2137
|
o[v] = o[v] || [], o[v][g] = o[v][g] || {}, o = o[v][g];
|
|
2117
2138
|
} else
|
|
2118
|
-
o[
|
|
2139
|
+
o[f] = o[f] || {}, o = o[f];
|
|
2119
2140
|
} else
|
|
2120
|
-
o[
|
|
2141
|
+
o[f] = n;
|
|
2121
2142
|
});
|
|
2122
2143
|
} else
|
|
2123
|
-
l[
|
|
2144
|
+
l[i] = n;
|
|
2124
2145
|
}
|
|
2125
2146
|
})(Q || (Q = {}));
|
|
2126
2147
|
const _e = Q;
|
|
@@ -2131,8 +2152,8 @@ export {
|
|
|
2131
2152
|
ae as S,
|
|
2132
2153
|
Oe as T,
|
|
2133
2154
|
N as V,
|
|
2134
|
-
|
|
2135
|
-
|
|
2155
|
+
Ae as a,
|
|
2156
|
+
Se as b,
|
|
2136
2157
|
he as c,
|
|
2137
2158
|
Te as d,
|
|
2138
2159
|
Ee as u
|