@cronocode/react-box 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/box.d.ts +21 -2
- package/box.js +12 -5
- package/components/baseSvg.d.ts +19 -2
- package/components/baseSvg.js +19 -6
- package/components/button.js +10 -8
- package/components/checkbox.js +6 -4
- package/components/dataGrid.js +32 -5
- package/components/dox.js +135 -141
- package/components/flex.js +8 -10
- package/components/form.js +15 -5
- package/components/grid.js +10 -9
- package/components/radioButton.js +6 -4
- package/components/textarea.js +11 -9
- package/components/textbox.js +10 -8
- package/components/tooltip.js +63 -6
- package/package.json +1 -1
- package/theme.js +14 -12
- package/utils.js +63 -53
- package/components/dox.d.ts +0 -21
- package/components/doxSvg.d.ts +0 -19
- package/components/doxSvg.js +0 -18
package/box.d.ts
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React, { RefAttributes } from 'react';
|
|
2
|
+
import ClassNameUtils from './utils/className/classNameUtils';
|
|
3
|
+
import { DoxStyleProps } from './components/dox/doxStyles';
|
|
4
|
+
import { StylesContext } from './components/dox/stylesContext';
|
|
5
|
+
type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
6
|
+
type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
7
|
+
type AllProps<TTag extends keyof React.JSX.IntrinsicElements> = React.ComponentProps<TTag>;
|
|
8
|
+
type TagPropsType<TTag extends keyof React.JSX.IntrinsicElements> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref'>;
|
|
9
|
+
interface Props<TTag extends keyof React.JSX.IntrinsicElements> extends DoxStyleProps {
|
|
10
|
+
children?: React.ReactNode | ((props: {
|
|
11
|
+
isHover: boolean;
|
|
12
|
+
}) => React.ReactNode);
|
|
13
|
+
tag?: TTag;
|
|
14
|
+
props?: TagPropsType<TTag>;
|
|
15
|
+
className?: ClassNameUtils.ClassNameType;
|
|
16
|
+
style?: React.ComponentProps<TTag>['style'];
|
|
17
|
+
}
|
|
18
|
+
declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: Props<TTag> & React.RefAttributes<ExtractElementType<React.JSX.IntrinsicElements[TTag]>>) => React.ReactNode;
|
|
19
|
+
export default _default;
|
|
20
|
+
declare const flushStyles: typeof StylesContext.flush;
|
|
21
|
+
export { flushStyles };
|
package/box.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "
|
|
3
|
-
import "./
|
|
4
|
-
|
|
1
|
+
import y, { forwardRef as N, useMemo as v, useState as S } from "react";
|
|
2
|
+
import { C as p } from "./utils.js";
|
|
3
|
+
import { u as C, S as d } from "./components/dox.js";
|
|
4
|
+
function g(e, o) {
|
|
5
|
+
const { tag: a = "div", children: t, props: c, className: f, style: n } = e, m = C(e, a === "svg"), u = v(() => p.classNames(f, m).join(" "), [e]), s = { ...c, className: u };
|
|
6
|
+
n && (s.style = n), o && (s.ref = o);
|
|
7
|
+
const [i, l] = S(!1), r = typeof t == "function";
|
|
8
|
+
return r && (s.onMouseEnter = () => l(!0), s.onMouseLeave = () => l(!1)), y.createElement(a, s, r ? t({ isHover: i }) : t);
|
|
9
|
+
}
|
|
10
|
+
const M = N(g), { flush: E } = d;
|
|
5
11
|
export {
|
|
6
|
-
|
|
12
|
+
M as B,
|
|
13
|
+
E as f
|
|
7
14
|
};
|
package/components/baseSvg.d.ts
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Box from '../box';
|
|
3
|
+
import ClassNameUtils from '../utils/className/classNameUtils';
|
|
4
|
+
import { DoxSvgStyles } from './dox/doxStyles';
|
|
5
|
+
type SvgTagProps = Required<React.ComponentProps<typeof Box<'svg'>>>['props'];
|
|
6
|
+
type DoxSvgTagProps = Omit<SvgTagProps, 'viewBox' | 'width' | 'height'>;
|
|
7
|
+
interface Props extends DoxSvgStyles {
|
|
8
|
+
children?: React.ReactNode | ((props: {
|
|
9
|
+
isHover: boolean;
|
|
10
|
+
}) => React.ReactNode);
|
|
11
|
+
props?: DoxSvgTagProps;
|
|
12
|
+
style?: React.ComponentProps<'svg'>['style'];
|
|
13
|
+
className?: ClassNameUtils.ClassNameType;
|
|
14
|
+
viewBox?: string;
|
|
15
|
+
width?: string;
|
|
16
|
+
height?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<SVGSVGElement>>;
|
|
19
|
+
export default _default;
|
package/components/baseSvg.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "react
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { B as n } from "../box.js";
|
|
4
|
+
function a(o, r) {
|
|
5
|
+
const { viewBox: s = "0 0 24 24", width: t = "1.5rem", height: p, props: e, ...g } = o;
|
|
6
|
+
return /* @__PURE__ */ i(
|
|
7
|
+
n,
|
|
8
|
+
{
|
|
9
|
+
tag: "svg",
|
|
10
|
+
ref: r,
|
|
11
|
+
props: { ...e, viewBox: s, width: t, height: p, xmlns: "http://www.w3.org/2000/svg", fill: "none" },
|
|
12
|
+
...g
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
const x = m(a);
|
|
17
|
+
export {
|
|
18
|
+
x as b
|
|
19
|
+
};
|
package/components/button.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { O as
|
|
5
|
-
|
|
6
|
-
const s = ["type", "onClick", "disabled"];
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
import { B as p } from "../box.js";
|
|
4
|
+
import { O as i } from "../utils.js";
|
|
5
|
+
const m = ["type", "onClick", "disabled"];
|
|
7
6
|
function e(o, t) {
|
|
8
|
-
const r =
|
|
9
|
-
return /* @__PURE__ */ n(
|
|
7
|
+
const r = i.buildProps(o, m);
|
|
8
|
+
return /* @__PURE__ */ n(p, { ref: t, tag: "button", component: "button", ...r });
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
const u = s(e);
|
|
11
|
+
export {
|
|
12
|
+
u as b
|
|
13
|
+
};
|
package/components/checkbox.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c } from "react";
|
|
3
|
-
import t from "
|
|
3
|
+
import { B as t } from "../box.js";
|
|
4
4
|
import { O as a } from "../utils.js";
|
|
5
|
-
import l from "./flex.js";
|
|
5
|
+
import { F as l } from "./flex.js";
|
|
6
6
|
import { c as d } from "../box.module.css.js";
|
|
7
|
-
import "../theme.js";
|
|
8
7
|
const p = [
|
|
9
8
|
"name",
|
|
10
9
|
"onInput",
|
|
@@ -24,4 +23,7 @@ function m(o, r) {
|
|
|
24
23
|
!n && /* @__PURE__ */ e(t, { position: "absolute", pointerEvents: "none", className: d._checkedIcon, children: /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", viewBox: "0 0 20 20", children: /* @__PURE__ */ e("g", { fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ e("path", { stroke: "#000", strokeLinecap: "round", strokeLinejoin: "round", d: "M6 10.15L8.5 13 14 7" }) }) }) })
|
|
25
24
|
] });
|
|
26
25
|
}
|
|
27
|
-
c(m);
|
|
26
|
+
const b = c(m);
|
|
27
|
+
export {
|
|
28
|
+
b as c
|
|
29
|
+
};
|
package/components/dataGrid.js
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as i, Fragment as m, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { B as t } from "../box.js";
|
|
3
|
+
function u(n) {
|
|
4
|
+
if (!(n != null && n.length))
|
|
5
|
+
return {
|
|
6
|
+
rows: [],
|
|
7
|
+
columns: []
|
|
8
|
+
};
|
|
9
|
+
const s = Object.keys(n[0]);
|
|
10
|
+
return {
|
|
11
|
+
rows: n.map((r) => ({
|
|
12
|
+
dataRow: r,
|
|
13
|
+
cells: s.map((e) => ({
|
|
14
|
+
key: e,
|
|
15
|
+
value: r[e]
|
|
16
|
+
}))
|
|
17
|
+
})),
|
|
18
|
+
columns: s.map((r) => ({
|
|
19
|
+
key: r
|
|
20
|
+
}))
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function d(n) {
|
|
24
|
+
const { data: s } = n, r = u(s);
|
|
25
|
+
return /* @__PURE__ */ i(t, { display: "grid", b: 1, borderRadius: 1, children: r.columns.length === 0 ? /* @__PURE__ */ i(m, { children: "empty grid" }) : /* @__PURE__ */ c(m, { children: [
|
|
26
|
+
r.columns.map((e, o) => /* @__PURE__ */ i(t, { style: { gridColumn: o + 1 }, children: e.key.toString() }, e.key.toString())),
|
|
27
|
+
r.rows.map((e, o) => e.cells.map((l) => /* @__PURE__ */ i(t, { children: l.value }, l.key.toString() + o)))
|
|
28
|
+
] }) });
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
d as D
|
|
32
|
+
};
|
package/components/dox.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { I as
|
|
3
|
-
import {
|
|
1
|
+
import { useMemo as L, useLayoutEffect as O, useEffect as I } from "react";
|
|
2
|
+
import { I as _ } from "../utils.js";
|
|
3
|
+
import { u as D } from "../theme.js";
|
|
4
4
|
var e;
|
|
5
5
|
((a) => {
|
|
6
6
|
((r) => {
|
|
7
|
-
function
|
|
7
|
+
function c(l, d) {
|
|
8
8
|
return `${l}${d.replace("/", "-")}`;
|
|
9
9
|
}
|
|
10
|
-
r.fraction =
|
|
11
|
-
function
|
|
10
|
+
r.fraction = c;
|
|
11
|
+
function m(l) {
|
|
12
12
|
return [`${l} path`, `${l} circle`, `${l} rect`, `${l} line`];
|
|
13
13
|
}
|
|
14
|
-
r.svg =
|
|
14
|
+
r.svg = m;
|
|
15
15
|
})(a.ClassName || (a.ClassName = {})), ((r) => {
|
|
16
|
-
function
|
|
17
|
-
return `${
|
|
16
|
+
function c(u, i) {
|
|
17
|
+
return `${i / 4}rem`;
|
|
18
18
|
}
|
|
19
|
-
r.rem =
|
|
20
|
-
function
|
|
21
|
-
return `${
|
|
19
|
+
r.rem = c;
|
|
20
|
+
function m(u, i) {
|
|
21
|
+
return `${i}px`;
|
|
22
22
|
}
|
|
23
|
-
r.px =
|
|
24
|
-
function l(u,
|
|
25
|
-
const [o, v] =
|
|
23
|
+
r.px = m;
|
|
24
|
+
function l(u, i) {
|
|
25
|
+
const [o, v] = i.split("/");
|
|
26
26
|
return `${+o / +v * 100}%`;
|
|
27
27
|
}
|
|
28
28
|
r.fraction = l;
|
|
29
|
-
function d(u,
|
|
30
|
-
switch (
|
|
29
|
+
function d(u, i) {
|
|
30
|
+
switch (i) {
|
|
31
31
|
case "fit":
|
|
32
32
|
return "100%";
|
|
33
33
|
case "fit-screen":
|
|
34
34
|
return u.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
|
|
35
35
|
default:
|
|
36
|
-
return
|
|
36
|
+
return i;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
r.widthHeight = d;
|
|
40
40
|
function g(u) {
|
|
41
|
-
return (
|
|
41
|
+
return (i, o) => `var(--${u}${o});`;
|
|
42
42
|
}
|
|
43
43
|
r.variables = g;
|
|
44
|
-
function
|
|
45
|
-
return (
|
|
44
|
+
function S(u) {
|
|
45
|
+
return (i, o) => `var(--${u}${o});`;
|
|
46
46
|
}
|
|
47
|
-
r.svgVariables =
|
|
48
|
-
function
|
|
49
|
-
return `repeat(${
|
|
47
|
+
r.svgVariables = S;
|
|
48
|
+
function k(u, i) {
|
|
49
|
+
return `repeat(${i},minmax(0,1fr))`;
|
|
50
50
|
}
|
|
51
|
-
r.gridColumns =
|
|
52
|
-
function
|
|
53
|
-
return
|
|
51
|
+
r.gridColumns = k;
|
|
52
|
+
function N(u, i) {
|
|
53
|
+
return i === "full-row" ? "1/-1" : `span ${i}/span ${i}`;
|
|
54
54
|
}
|
|
55
|
-
r.gridColumn =
|
|
56
|
-
function
|
|
57
|
-
return `${
|
|
55
|
+
r.gridColumn = N;
|
|
56
|
+
function p(u, i) {
|
|
57
|
+
return `${i}ms`;
|
|
58
58
|
}
|
|
59
|
-
r.ms =
|
|
60
|
-
function
|
|
61
|
-
return `${
|
|
59
|
+
r.ms = p;
|
|
60
|
+
function y(u, i) {
|
|
61
|
+
return `${i}deg`;
|
|
62
62
|
}
|
|
63
|
-
r.rotate =
|
|
64
|
-
function
|
|
65
|
-
return
|
|
63
|
+
r.rotate = y;
|
|
64
|
+
function $(u, i) {
|
|
65
|
+
return i === "xAxis" ? "-1 1" : "1 -1";
|
|
66
66
|
}
|
|
67
|
-
r.flip =
|
|
67
|
+
r.flip = $;
|
|
68
68
|
})(a.Value || (a.Value = {}));
|
|
69
69
|
})(e || (e = {}));
|
|
70
|
-
const
|
|
70
|
+
const W = ["H", "F", "A"];
|
|
71
71
|
var s;
|
|
72
72
|
((a) => {
|
|
73
73
|
a.positiveSizes = [
|
|
@@ -208,14 +208,14 @@ var s;
|
|
|
208
208
|
"11/12"
|
|
209
209
|
], a.widthHeightValues = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], a.alignSelf = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
|
|
210
210
|
})(s || (s = {}));
|
|
211
|
-
const
|
|
211
|
+
const A = {
|
|
212
212
|
shadow: { cssNames: ["box-shadow"], formatValue: e.Value.variables("shadow") },
|
|
213
213
|
background: { cssNames: ["background"], formatValue: e.Value.variables("background") },
|
|
214
214
|
color: { cssNames: ["color"], formatValue: e.Value.variables("color") },
|
|
215
215
|
bgColor: { cssNames: ["background-color"], formatValue: e.Value.variables("color") },
|
|
216
216
|
borderColor: { cssNames: ["border-color"], formatValue: e.Value.variables("color") },
|
|
217
217
|
outlineColor: { cssNames: ["outline-color"], formatValue: e.Value.variables("color") }
|
|
218
|
-
},
|
|
218
|
+
}, R = {
|
|
219
219
|
fill: {
|
|
220
220
|
cssNames: ["fill"],
|
|
221
221
|
formatValue: e.Value.svgVariables("color"),
|
|
@@ -226,10 +226,10 @@ const R = {
|
|
|
226
226
|
formatValue: e.Value.svgVariables("color"),
|
|
227
227
|
formatSelector: e.ClassName.svg
|
|
228
228
|
}
|
|
229
|
-
},
|
|
229
|
+
}, x = {
|
|
230
230
|
hover: { className: "_h" },
|
|
231
231
|
focus: { className: "_f" }
|
|
232
|
-
},
|
|
232
|
+
}, t = {
|
|
233
233
|
display: {
|
|
234
234
|
cssNames: ["display"],
|
|
235
235
|
values1: { values: ["none", "block", "inline-block", "flex", "inline-flex", "grid", "inline-grid", "contents"] },
|
|
@@ -870,51 +870,51 @@ const R = {
|
|
|
870
870
|
}
|
|
871
871
|
};
|
|
872
872
|
Object.keys(C).forEach((a) => {
|
|
873
|
-
|
|
874
|
-
});
|
|
875
|
-
Object.keys(R).forEach((a) => {
|
|
876
|
-
i[a] = R[a], i[a].isThemeStyle = !0;
|
|
873
|
+
t[a] = C[a];
|
|
877
874
|
});
|
|
878
875
|
Object.keys(A).forEach((a) => {
|
|
879
|
-
|
|
876
|
+
t[a] = A[a], t[a].isThemeStyle = !0;
|
|
880
877
|
});
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
878
|
+
Object.keys(R).forEach((a) => {
|
|
879
|
+
t[a] = R[a], t[a].isThemeStyle = !0;
|
|
880
|
+
});
|
|
881
|
+
const V = {
|
|
882
|
+
w: { ...t.width, key: "width" },
|
|
883
|
+
h: { ...t.height, key: "height" },
|
|
884
|
+
m: { ...t.margin, key: "margin" },
|
|
885
|
+
mx: { ...t.marginHorizontal, key: "marginHorizontal" },
|
|
886
|
+
my: { ...t.marginVertical, key: "marginVertical" },
|
|
887
|
+
mt: { ...t.marginTop, key: "marginTop" },
|
|
888
|
+
mr: { ...t.marginRight, key: "marginRight" },
|
|
889
|
+
mb: { ...t.marginBottom, key: "marginBottom" },
|
|
890
|
+
ml: { ...t.marginLeft, key: "marginLeft" },
|
|
891
|
+
p: { ...t.padding, key: "padding" },
|
|
892
|
+
px: { ...t.paddingHorizontal, key: "paddingHorizontal" },
|
|
893
|
+
py: { ...t.paddingVertical, key: "paddingVertical" },
|
|
894
|
+
pt: { ...t.paddingTop, key: "paddingTop" },
|
|
895
|
+
pr: { ...t.paddingRight, key: "paddingRight" },
|
|
896
|
+
pb: { ...t.paddingBottom, key: "paddingBottom" },
|
|
897
|
+
pl: { ...t.paddingLeft, key: "paddingLeft" },
|
|
898
|
+
b: { ...t.border, key: "border" },
|
|
899
|
+
bx: { ...t.borderHorizontal, key: "borderHorizontal" },
|
|
900
|
+
by: { ...t.borderVertical, key: "borderVertical" },
|
|
901
|
+
bt: { ...t.borderTop, key: "borderTop" },
|
|
902
|
+
br: { ...t.borderRight, key: "borderRight" },
|
|
903
|
+
bb: { ...t.borderBottom, key: "borderBottom" },
|
|
904
|
+
bl: { ...t.borderLeft, key: "borderLeft" },
|
|
905
|
+
jc: { ...t.justifyContent, key: "justifyContent" },
|
|
906
|
+
ai: { ...t.alignItems, key: "alignItems" },
|
|
907
|
+
ac: { ...t.alignContent, key: "alignContent" },
|
|
908
|
+
d: { ...t.flexDirection, key: "flexDirection" }
|
|
909
|
+
}, G = Object.keys(t), P = Object.keys(V);
|
|
910
|
+
W.forEach((a) => {
|
|
911
|
+
G.forEach((r) => {
|
|
912
|
+
t[`${r}${a}`] = { ...t[r] }, t[`${r}${a}`].pseudoSuffix = a;
|
|
913
|
+
}), P.forEach((r) => {
|
|
914
|
+
V[`${r}${a}`] = { ...V[r], key: `${V[r].key}${a}` }, V[`${r}${a}`].pseudoSuffix = a;
|
|
915
915
|
});
|
|
916
916
|
});
|
|
917
|
-
var
|
|
917
|
+
var b;
|
|
918
918
|
((a) => {
|
|
919
919
|
a.doxClassName = "_dox", a.svgClassName = "_svg";
|
|
920
920
|
const r = `:root{--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;#crono-box {position: absolute;top: 0;left: 0;height: 0;}}
|
|
@@ -923,88 +923,82 @@ body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
|
|
|
923
923
|
a,ul{all: unset;}
|
|
924
924
|
.${a.doxClassName}{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;}
|
|
925
925
|
.${a.svgClassName}{transition: all var(--svgTransitionTime);}.${a.svgClassName} path,.${a.svgClassName} circle,.${a.svgClassName} rect,.${a.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
926
|
-
`,
|
|
926
|
+
`, c = new _(), m = Object.keys(t), l = $();
|
|
927
927
|
let d = !1;
|
|
928
|
-
const g =
|
|
929
|
-
function
|
|
930
|
-
if (u in
|
|
931
|
-
return
|
|
932
|
-
if (u in
|
|
933
|
-
return
|
|
928
|
+
const g = m.reduce((u, i) => (u[i] = /* @__PURE__ */ new Set(), u), {});
|
|
929
|
+
function S(u, i) {
|
|
930
|
+
if (u in t)
|
|
931
|
+
return N(u, i);
|
|
932
|
+
if (u in x)
|
|
933
|
+
return x[u].className;
|
|
934
934
|
if (u in C)
|
|
935
|
-
return
|
|
935
|
+
return N(u, i);
|
|
936
936
|
}
|
|
937
|
-
a.get =
|
|
938
|
-
function
|
|
937
|
+
a.get = S;
|
|
938
|
+
function k() {
|
|
939
939
|
if (d) {
|
|
940
940
|
console.info("%c💬Flush Dox Styles", "color: #00ffff");
|
|
941
|
-
let u =
|
|
942
|
-
u =
|
|
941
|
+
let u = p([r]);
|
|
942
|
+
u = p(u, "H"), u = p(u, "F"), u = p(u, "A"), l.innerHTML = u.join(""), d = !1;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
a.flush =
|
|
946
|
-
function
|
|
947
|
-
var
|
|
948
|
-
g[u].has(
|
|
949
|
-
const o =
|
|
950
|
-
return `-${
|
|
945
|
+
a.flush = k;
|
|
946
|
+
function N(u, i) {
|
|
947
|
+
var n;
|
|
948
|
+
g[u].has(i) || (d = !0, g[u].add(i));
|
|
949
|
+
const o = y(u, i), v = ((n = o.formatClassName) == null ? void 0 : n.call(o, u, i)) ?? `${u}${i}`;
|
|
950
|
+
return `-${c.getIdentity(v)}`;
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function p(u, i) {
|
|
953
953
|
return Object.entries(g).filter(([v]) => {
|
|
954
|
-
var
|
|
955
|
-
return ((
|
|
956
|
-
}).reduce((v, [
|
|
954
|
+
var n;
|
|
955
|
+
return ((n = t[v]) == null ? void 0 : n.pseudoSuffix) === i;
|
|
956
|
+
}).reduce((v, [n, j]) => (j.forEach((z) => {
|
|
957
957
|
var T;
|
|
958
|
-
const
|
|
959
|
-
let
|
|
960
|
-
|
|
961
|
-
...o(`${
|
|
962
|
-
...o(`.${
|
|
963
|
-
] :
|
|
964
|
-
...o(`${
|
|
965
|
-
...o(`.${
|
|
966
|
-
] :
|
|
967
|
-
const F = ((T =
|
|
968
|
-
v.push(`${
|
|
958
|
+
const f = y(n, z), h = `.${N(n, z)}`;
|
|
959
|
+
let w = [];
|
|
960
|
+
i ? i === "H" ? w = [
|
|
961
|
+
...o(`${h}:hover`, f),
|
|
962
|
+
...o(`.${x.hover.className}:hover>${h}`, f)
|
|
963
|
+
] : i === "F" ? w = [
|
|
964
|
+
...o(`${h}:focus-within`, f),
|
|
965
|
+
...o(`.${x.focus.className}:focus-within>${h}`, f)
|
|
966
|
+
] : i === "A" && (w = o(`${h}:active`, f)) : w = o(h, f);
|
|
967
|
+
const F = ((T = f.formatValue) == null ? void 0 : T.call(f, n, z)) ?? z, B = t[n].cssNames.map((E) => `${E}:${F};`).join("");
|
|
968
|
+
v.push(`${w.join(",")}{${B}}`);
|
|
969
969
|
}), v), u);
|
|
970
|
-
function o(v,
|
|
971
|
-
return
|
|
970
|
+
function o(v, n) {
|
|
971
|
+
return n.formatSelector ? n.formatSelector(v) : [v];
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
const o =
|
|
976
|
-
return o.isThemeStyle ? o : o.values1.values.includes(
|
|
974
|
+
function y(u, i) {
|
|
975
|
+
const o = t[u];
|
|
976
|
+
return o.isThemeStyle ? o : o.values1.values.includes(i) ? o.values1 : o.values2.values.includes(i) ? o.values2 : o.values3;
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function $() {
|
|
979
979
|
const u = "crono-styles", o = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
|
|
980
980
|
let v = o.getElementById(u);
|
|
981
981
|
return v || (v = o.createElement("style"), v.setAttribute("id", u), v.setAttribute("type", "text/css"), o.head.insertBefore(v, o.head.firstChild)), v;
|
|
982
982
|
}
|
|
983
|
-
})(
|
|
984
|
-
const
|
|
983
|
+
})(b || (b = {}));
|
|
984
|
+
const q = typeof window < "u" && typeof window.document < "u", M = q ? O : I;
|
|
985
985
|
function Q(a, r) {
|
|
986
|
-
const
|
|
987
|
-
return
|
|
988
|
-
const
|
|
986
|
+
const c = D(a);
|
|
987
|
+
return M(b.flush, [a]), L(() => {
|
|
988
|
+
const m = [r ? b.svgClassName : b.doxClassName], l = c ? { ...H(c), ...H(a) } : H(a);
|
|
989
989
|
return "inline" in l && (l.display === "block" ? l.display = "inline-block" : l.display === "flex" ? l.display = "inline-flex" : l.display === "grid" && (l.display = "inline-grid"), delete l.inline), "inlineH" in l && (l.displayH === "block" ? l.displayH = "inline-block" : l.displayH === "flex" ? l.displayH = "inline-flex" : l.displayH === "grid" && (l.displayH = "inline-grid"), delete l.inlineH), "inlineF" in l && (l.displayF === "block" ? l.displayF = "inline-block" : l.displayF === "flex" ? l.displayF = "inline-flex" : l.displayF === "grid" && (l.displayF = "inline-grid"), delete l.inlineF), "inlineA" in l && (l.displayA === "block" ? l.displayA = "inline-block" : l.displayA === "flex" ? l.displayA = "inline-flex" : l.displayA === "grid" && (l.displayA = "inline-grid"), delete l.inlineA), Object.entries(l).forEach(([d, g]) => {
|
|
990
|
-
|
|
991
|
-
}),
|
|
992
|
-
}, [a,
|
|
990
|
+
m.push(b.get(d, g));
|
|
991
|
+
}), m;
|
|
992
|
+
}, [a, c]);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function H(a) {
|
|
995
995
|
const r = { ...a };
|
|
996
|
-
return Object.keys(r).forEach((
|
|
997
|
-
const l =
|
|
998
|
-
l && (l.key in r || (r[l.key] = r[
|
|
996
|
+
return Object.keys(r).forEach((m) => {
|
|
997
|
+
const l = V[m];
|
|
998
|
+
l && (l.key in r || (r[l.key] = r[m]), delete r[m]);
|
|
999
999
|
}), r;
|
|
1000
1000
|
}
|
|
1001
|
-
function Z(a, r) {
|
|
1002
|
-
const { tag: m = "div", children: n, props: l, className: d, style: g } = a, z = Q(a, m === "svg"), x = j(() => W.classNames(d, z).join(" "), [a]), f = { ...l, className: x };
|
|
1003
|
-
g && (f.style = g), r && (f.ref = r);
|
|
1004
|
-
const [h, V] = P(!1), b = typeof n == "function";
|
|
1005
|
-
return b && (f.onMouseEnter = () => V(!0), f.onMouseLeave = () => V(!1)), O.createElement(m, f, b ? n({ isHover: h }) : n);
|
|
1006
|
-
}
|
|
1007
|
-
const le = D(Z);
|
|
1008
1001
|
export {
|
|
1009
|
-
|
|
1002
|
+
b as S,
|
|
1003
|
+
Q as u
|
|
1010
1004
|
};
|
package/components/flex.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { inline: t, ...e } = o;
|
|
8
|
-
return /* @__PURE__ */ i(n, { ref: r, display: t ? "inline-flex" : "flex", ...e });
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { B as f } from "../box.js";
|
|
4
|
+
function s(o, r) {
|
|
5
|
+
const { inline: e, ...i } = o;
|
|
6
|
+
return /* @__PURE__ */ n(f, { ref: r, display: e ? "inline-flex" : "flex", ...i });
|
|
9
7
|
}
|
|
10
|
-
const
|
|
8
|
+
const p = t(s);
|
|
11
9
|
export {
|
|
12
|
-
|
|
10
|
+
p as F
|
|
13
11
|
};
|
package/components/form.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
4
|
-
import "../utils.js";
|
|
5
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as i, useCallback as p } from "react";
|
|
3
|
+
import { B as u } from "../box.js";
|
|
4
|
+
import { F as c } from "../utils.js";
|
|
5
|
+
function x(o) {
|
|
6
|
+
const { onSubmit: m, props: n } = o, r = i(null), s = p((t) => {
|
|
7
|
+
t.preventDefault();
|
|
8
|
+
const f = c.getFormEntries(r.current);
|
|
9
|
+
m(f, t);
|
|
10
|
+
}, []), e = { ...n, onSubmit: s, ref: r };
|
|
11
|
+
return /* @__PURE__ */ a(u, { tag: "form", ...o, props: e });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
x as F
|
|
15
|
+
};
|
package/components/grid.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { inline: o, ...t } = r;
|
|
8
|
-
return /* @__PURE__ */ m(p, { ref: i, display: o ? "inline-grid" : "grid", ...t });
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
import { B as d } from "../box.js";
|
|
4
|
+
function e(r, i) {
|
|
5
|
+
const { inline: o, ...n } = r;
|
|
6
|
+
return /* @__PURE__ */ t(d, { ref: i, display: o ? "inline-grid" : "grid", ...n });
|
|
9
7
|
}
|
|
10
|
-
|
|
8
|
+
const a = s(e);
|
|
9
|
+
export {
|
|
10
|
+
a as g
|
|
11
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import a from "
|
|
3
|
+
import { B as a } from "../box.js";
|
|
4
4
|
import { O as i } from "../utils.js";
|
|
5
|
-
import "../theme.js";
|
|
6
5
|
const d = [
|
|
7
6
|
"name",
|
|
8
7
|
"onInput",
|
|
@@ -15,8 +14,11 @@ const d = [
|
|
|
15
14
|
"checked",
|
|
16
15
|
"defaultChecked"
|
|
17
16
|
];
|
|
18
|
-
function
|
|
17
|
+
function s(o, t) {
|
|
19
18
|
const r = i.buildProps(o, d, { type: "radio" });
|
|
20
19
|
return /* @__PURE__ */ e(a, { ref: t, tag: "input", component: "radioButton", ...r });
|
|
21
20
|
}
|
|
22
|
-
n(
|
|
21
|
+
const f = n(s);
|
|
22
|
+
export {
|
|
23
|
+
f as r
|
|
24
|
+
};
|
package/components/textarea.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as a } from "react";
|
|
3
|
-
import n from "
|
|
4
|
-
import { O as
|
|
5
|
-
|
|
6
|
-
const s = [
|
|
3
|
+
import { B as n } from "../box.js";
|
|
4
|
+
import { O as s } from "../utils.js";
|
|
5
|
+
const m = [
|
|
7
6
|
"name",
|
|
8
7
|
"onInput",
|
|
9
8
|
"onChange",
|
|
@@ -19,8 +18,11 @@ const s = [
|
|
|
19
18
|
"readOnly",
|
|
20
19
|
"required"
|
|
21
20
|
];
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
21
|
+
function p(t, e) {
|
|
22
|
+
const o = s.buildProps(t, m);
|
|
23
|
+
return /* @__PURE__ */ r(n, { ref: e, tag: "textarea", component: "textarea", ...o });
|
|
25
24
|
}
|
|
26
|
-
a(
|
|
25
|
+
const d = a(p);
|
|
26
|
+
export {
|
|
27
|
+
d as t
|
|
28
|
+
};
|
package/components/textbox.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import a from "
|
|
3
|
+
import { B as a } from "../box.js";
|
|
4
4
|
import { O as p } from "../utils.js";
|
|
5
|
-
|
|
6
|
-
const i = [
|
|
5
|
+
const s = [
|
|
7
6
|
"name",
|
|
8
7
|
"onInput",
|
|
9
8
|
"onChange",
|
|
@@ -17,8 +16,11 @@ const i = [
|
|
|
17
16
|
"value",
|
|
18
17
|
"pattern"
|
|
19
18
|
];
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
19
|
+
function u(o, t) {
|
|
20
|
+
const e = p.buildProps(o, s);
|
|
21
|
+
return /* @__PURE__ */ r(a, { ref: t, tag: "input", component: "textbox", ...e });
|
|
23
22
|
}
|
|
24
|
-
n(
|
|
23
|
+
const c = n(u);
|
|
24
|
+
export {
|
|
25
|
+
c as t
|
|
26
|
+
};
|
package/components/tooltip.js
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react-dom";
|
|
3
|
-
import "
|
|
4
|
-
import "react";
|
|
5
|
-
import "../utils.js";
|
|
6
|
-
|
|
1
|
+
import { jsxs as v, Fragment as x, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal as b } from "react-dom";
|
|
3
|
+
import { B as u } from "../box.js";
|
|
4
|
+
import { useRef as E, useState as L, useCallback as d, useLayoutEffect as g } from "react";
|
|
5
|
+
import { u as z } from "../utils.js";
|
|
6
|
+
const i = 2;
|
|
7
|
+
function j(f) {
|
|
8
|
+
const { onPositionChange: c } = f, s = E(null), [t, p] = L(), m = z(), w = d(
|
|
9
|
+
(o, e) => {
|
|
10
|
+
const r = (n) => {
|
|
11
|
+
n.target.contains(o) && e(o);
|
|
12
|
+
};
|
|
13
|
+
return document.addEventListener("scroll", r, { capture: !0 }), () => {
|
|
14
|
+
document.removeEventListener("scroll", r, { capture: !0 });
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
[t]
|
|
18
|
+
), h = d(
|
|
19
|
+
(o, e) => {
|
|
20
|
+
const r = (n) => {
|
|
21
|
+
e(o);
|
|
22
|
+
};
|
|
23
|
+
return window.addEventListener("resize", r, { capture: !0 }), () => {
|
|
24
|
+
window.removeEventListener("resize", r, { capture: !0 });
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
[t]
|
|
28
|
+
), l = d(
|
|
29
|
+
(o) => {
|
|
30
|
+
const e = o.getBoundingClientRect(), r = Math.round((e.top + window.scrollY) * i) / i, n = Math.round((e.left + window.scrollX) * i) / i;
|
|
31
|
+
((t == null ? void 0 : t.top) !== r || (t == null ? void 0 : t.left) !== n) && (c == null || c({ top: r, left: n }), p({ top: r, left: n, width: e.width > 0 ? e.width : void 0 }));
|
|
32
|
+
},
|
|
33
|
+
[t]
|
|
34
|
+
);
|
|
35
|
+
return g(() => {
|
|
36
|
+
if (s.current) {
|
|
37
|
+
l(s.current);
|
|
38
|
+
const o = w(s.current, l), e = h(s.current, l);
|
|
39
|
+
return () => {
|
|
40
|
+
o(), e();
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}, [t]), /* @__PURE__ */ v(x, { children: [
|
|
44
|
+
/* @__PURE__ */ a(u, { ref: s }),
|
|
45
|
+
t && b(
|
|
46
|
+
/* @__PURE__ */ a(
|
|
47
|
+
u,
|
|
48
|
+
{
|
|
49
|
+
position: "absolute",
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
transition: "none",
|
|
53
|
+
style: { transform: `translate(${t.left}px,${t.top}px)`, width: t.width },
|
|
54
|
+
children: /* @__PURE__ */ a(u, { position: "absolute", width: "fit", ...f })
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
m
|
|
58
|
+
)
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
j as T
|
|
63
|
+
};
|
package/package.json
CHANGED
package/theme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo as g } from "react";
|
|
2
|
-
const
|
|
2
|
+
const b = {
|
|
3
3
|
button: {
|
|
4
4
|
styles: {
|
|
5
5
|
display: "inline-block",
|
|
@@ -42,14 +42,14 @@ const $ = {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
let _ =
|
|
45
|
+
let _ = b;
|
|
46
46
|
var u;
|
|
47
47
|
((h) => {
|
|
48
48
|
function d(r) {
|
|
49
49
|
_ = r, i();
|
|
50
50
|
}
|
|
51
51
|
h.setup = d;
|
|
52
|
-
function
|
|
52
|
+
function $(r, e) {
|
|
53
53
|
const t = Object.entries(r.colors).map(([o, c]) => `--color${o}: ${c};`).join(`
|
|
54
54
|
`), l = Object.entries(r.shadows).map(([o, c]) => `--shadow${o}: ${c};`).join(`
|
|
55
55
|
`), n = Object.entries(r.backgrounds).map(([o, c]) => `--background${o}: ${c};`).join(`
|
|
@@ -259,16 +259,17 @@ var u;
|
|
|
259
259
|
boxDts: T
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
h.setupAugmentedProps =
|
|
262
|
+
h.setupAugmentedProps = $;
|
|
263
263
|
function i() {
|
|
264
|
-
Object.keys(
|
|
265
|
-
const t = _[e], l =
|
|
266
|
-
t ? (t.styles = { ...l.styles, ...t.styles }, t.disabled && l.disabled && (t.disabled = { ...l.disabled, ...t.disabled })) : _[e] =
|
|
264
|
+
Object.keys(b).forEach((e) => {
|
|
265
|
+
const t = _[e], l = b[e];
|
|
266
|
+
t ? (t.styles = { ...l.styles, ...t.styles }, t.disabled && l.disabled && (t.disabled = { ...l.disabled, ...t.disabled })) : _[e] = b[e];
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
269
|
})(u || (u = {}));
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
const j = u;
|
|
271
|
+
function x(h) {
|
|
272
|
+
const { clean: d, disabled: $, theme: i, component: r } = h;
|
|
272
273
|
return g(() => {
|
|
273
274
|
var l, n, s;
|
|
274
275
|
if (d)
|
|
@@ -277,9 +278,10 @@ function j(h) {
|
|
|
277
278
|
if (!e)
|
|
278
279
|
return;
|
|
279
280
|
let t = i ? { ...e.styles, ...(n = e.themes) == null ? void 0 : n[i].styles } : e.styles;
|
|
280
|
-
return
|
|
281
|
-
}, [r, d,
|
|
281
|
+
return $ ? i ? { ...t, ...e.disabled, ...(s = e.themes) == null ? void 0 : s[i].disabled } : { ...t, ...e.disabled } : t;
|
|
282
|
+
}, [r, d, $, i]);
|
|
282
283
|
}
|
|
283
284
|
export {
|
|
284
|
-
j as
|
|
285
|
+
j as T,
|
|
286
|
+
x as u
|
|
285
287
|
};
|
package/utils.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
var
|
|
3
|
-
((
|
|
4
|
-
function i(...
|
|
5
|
-
return
|
|
6
|
-
e &&
|
|
7
|
-
}),
|
|
1
|
+
import { useMemo as x } from "react";
|
|
2
|
+
var p;
|
|
3
|
+
((c) => {
|
|
4
|
+
function i(...u) {
|
|
5
|
+
return u.reduce((n, o) => o ? typeof o == "string" ? (n.push(o), n) : Array.isArray(o) ? (n.push(...i(...o)), n) : (Object.entries(o).forEach(([r, e]) => {
|
|
6
|
+
e && n.push(r);
|
|
7
|
+
}), n) : n, []);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
})(
|
|
11
|
-
const y =
|
|
9
|
+
c.classNames = i;
|
|
10
|
+
})(p || (p = {}));
|
|
11
|
+
const y = p;
|
|
12
12
|
class I {
|
|
13
13
|
constructor() {
|
|
14
14
|
this._index = 0, this._cache = {};
|
|
@@ -17,81 +17,91 @@ class I {
|
|
|
17
17
|
return this._cache[i] || (this._cache[i] = this.getByIndex(this._index++)), this._cache[i];
|
|
18
18
|
}
|
|
19
19
|
getByIndex(i) {
|
|
20
|
-
const { first:
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
23
|
-
const r = Math.floor(
|
|
24
|
-
return this.getByIndex(r) +
|
|
20
|
+
const { first: u, next: n } = m, o = i - u.length;
|
|
21
|
+
if (o < 0)
|
|
22
|
+
return u[i];
|
|
23
|
+
const r = Math.floor(o / n.length), e = o - r * n.length;
|
|
24
|
+
return this.getByIndex(r) + n[e];
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const m = {
|
|
28
28
|
first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
29
29
|
next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
30
30
|
};
|
|
31
31
|
var l;
|
|
32
|
-
((
|
|
33
|
-
function i(
|
|
34
|
-
const r = { ...
|
|
35
|
-
return
|
|
32
|
+
((c) => {
|
|
33
|
+
function i(n, ...o) {
|
|
34
|
+
const r = { ...n }, e = {};
|
|
35
|
+
return o.forEach((t) => {
|
|
36
36
|
t in r && (e[t] = r[t], delete r[t]);
|
|
37
37
|
}), [e, r];
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
const e = { ...
|
|
42
|
-
return
|
|
43
|
-
if (
|
|
44
|
-
if (t[
|
|
39
|
+
c.moveToTagProps = i;
|
|
40
|
+
function u(n, o, r) {
|
|
41
|
+
const e = { ...n }, t = e.props || {};
|
|
42
|
+
return o.forEach((s) => {
|
|
43
|
+
if (s in e) {
|
|
44
|
+
if (t[s] = e[s], s === "disabled")
|
|
45
45
|
return;
|
|
46
|
-
delete e[
|
|
46
|
+
delete e[s];
|
|
47
47
|
}
|
|
48
|
-
}), r && Object.entries(r).forEach(([
|
|
49
|
-
t[
|
|
48
|
+
}), r && Object.entries(r).forEach(([s, f]) => {
|
|
49
|
+
t[s] = f;
|
|
50
50
|
}), e.props = t, e;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
c.buildProps = u;
|
|
53
53
|
})(l || (l = {}));
|
|
54
|
-
const
|
|
54
|
+
const E = l;
|
|
55
55
|
var g;
|
|
56
|
-
((
|
|
57
|
-
function i(
|
|
58
|
-
const
|
|
56
|
+
((c) => {
|
|
57
|
+
function i(n) {
|
|
58
|
+
const o = Array.from(n.elements).reduce((r, e) => {
|
|
59
59
|
const t = e.name;
|
|
60
60
|
return t && (r[t] || (r[t] = []), r[t].push(e)), r;
|
|
61
61
|
}, {});
|
|
62
|
-
return Object.entries(
|
|
62
|
+
return Object.entries(o).reduce((r, [e, t]) => {
|
|
63
63
|
if (t.length === 1) {
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const s = t[0];
|
|
65
|
+
u(r, e, s.type === "checkbox" || s.type === "radio" ? s.checked : s.value);
|
|
66
66
|
} else {
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
const s = t.reduce((f, d) => (d.type === "checkbox" || d.type === "radio" ? d.checked && f.push(d.value) : f.push(d.value), f), []);
|
|
68
|
+
u(r, e, s);
|
|
69
69
|
}
|
|
70
70
|
return r;
|
|
71
71
|
}, {});
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
function
|
|
75
|
-
if (
|
|
76
|
-
const e =
|
|
77
|
-
let t =
|
|
78
|
-
e.forEach((
|
|
73
|
+
c.getFormEntries = i;
|
|
74
|
+
function u(n, o, r) {
|
|
75
|
+
if (o.includes(".")) {
|
|
76
|
+
const e = o.split(".");
|
|
77
|
+
let t = n;
|
|
78
|
+
e.forEach((s, f) => {
|
|
79
79
|
if (e.length > f + 1) {
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const [,
|
|
83
|
-
t[
|
|
80
|
+
const d = s.match(/^(.+)\[(\d)\]$/);
|
|
81
|
+
if (d) {
|
|
82
|
+
const [, h, a] = d;
|
|
83
|
+
t[h] = t[h] || [], t[h][a] = t[h][a] || {}, t = t[h][a];
|
|
84
84
|
} else
|
|
85
|
-
t[
|
|
85
|
+
t[s] = t[s] || {}, t = t[s];
|
|
86
86
|
} else
|
|
87
|
-
t[
|
|
87
|
+
t[s] = r;
|
|
88
88
|
});
|
|
89
89
|
} else
|
|
90
|
-
|
|
90
|
+
n[o] = r;
|
|
91
91
|
}
|
|
92
92
|
})(g || (g = {}));
|
|
93
|
+
const P = g;
|
|
94
|
+
function v() {
|
|
95
|
+
return x(() => {
|
|
96
|
+
const c = "crono-box";
|
|
97
|
+
let i = document.getElementById(c);
|
|
98
|
+
return i || (i = document.createElement("div"), i.id = c, document.body.appendChild(i)), i;
|
|
99
|
+
}, []);
|
|
100
|
+
}
|
|
93
101
|
export {
|
|
94
102
|
y as C,
|
|
103
|
+
P as F,
|
|
95
104
|
I,
|
|
96
|
-
|
|
105
|
+
E as O,
|
|
106
|
+
v as u
|
|
97
107
|
};
|
package/components/dox.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, { RefAttributes } from 'react';
|
|
2
|
-
import ClassNameUtils from '../utils/className/classNameUtils';
|
|
3
|
-
import { DoxStyleProps } from './dox/doxStyles';
|
|
4
|
-
import { StylesContext } from './dox/stylesContext';
|
|
5
|
-
type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
6
|
-
type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
7
|
-
type AllProps<TTag extends keyof React.JSX.IntrinsicElements> = React.ComponentProps<TTag>;
|
|
8
|
-
type TagPropsType<TTag extends keyof React.JSX.IntrinsicElements> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref'>;
|
|
9
|
-
interface Props<TTag extends keyof React.JSX.IntrinsicElements> extends DoxStyleProps {
|
|
10
|
-
children?: React.ReactNode | ((props: {
|
|
11
|
-
isHover: boolean;
|
|
12
|
-
}) => React.ReactNode);
|
|
13
|
-
tag?: TTag;
|
|
14
|
-
props?: TagPropsType<TTag>;
|
|
15
|
-
className?: ClassNameUtils.ClassNameType;
|
|
16
|
-
style?: React.ComponentProps<TTag>['style'];
|
|
17
|
-
}
|
|
18
|
-
declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: Props<TTag> & React.RefAttributes<ExtractElementType<React.JSX.IntrinsicElements[TTag]>>) => React.ReactNode;
|
|
19
|
-
export default _default;
|
|
20
|
-
declare const flushStyles: typeof StylesContext.flush;
|
|
21
|
-
export { flushStyles };
|
package/components/doxSvg.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import Dox from './dox';
|
|
3
|
-
import ClassNameUtils from '../utils/className/classNameUtils';
|
|
4
|
-
import { DoxSvgStyles } from './dox/doxStyles';
|
|
5
|
-
type SvgTagProps = Required<React.ComponentProps<typeof Dox<'svg'>>>['props'];
|
|
6
|
-
type DoxSvgTagProps = Omit<SvgTagProps, 'viewBox' | 'width' | 'height'>;
|
|
7
|
-
interface Props extends DoxSvgStyles {
|
|
8
|
-
children?: React.ReactNode | ((props: {
|
|
9
|
-
isHover: boolean;
|
|
10
|
-
}) => React.ReactNode);
|
|
11
|
-
props?: DoxSvgTagProps;
|
|
12
|
-
style?: React.ComponentProps<'svg'>['style'];
|
|
13
|
-
className?: ClassNameUtils.ClassNameType;
|
|
14
|
-
viewBox?: string;
|
|
15
|
-
width?: string;
|
|
16
|
-
height?: string;
|
|
17
|
-
}
|
|
18
|
-
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<SVGSVGElement>>;
|
|
19
|
-
export default _default;
|
package/components/doxSvg.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as f } from "react";
|
|
3
|
-
import g from "./dox.js";
|
|
4
|
-
import "../utils.js";
|
|
5
|
-
import "../theme.js";
|
|
6
|
-
function n(o, r) {
|
|
7
|
-
const { viewBox: t = "0 0 24 24", width: p = "1.5rem", height: i, props: m, ...s } = o;
|
|
8
|
-
return /* @__PURE__ */ e(
|
|
9
|
-
g,
|
|
10
|
-
{
|
|
11
|
-
tag: "svg",
|
|
12
|
-
ref: r,
|
|
13
|
-
props: { ...m, viewBox: t, width: p, height: i, xmlns: "http://www.w3.org/2000/svg", fill: "none" },
|
|
14
|
-
...s
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
f(n);
|