@cronocode/react-box 1.7.4 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/box.cjs +1 -0
- package/{box.js → box.mjs} +1 -1
- package/components/baseSvg.cjs +1 -0
- package/components/{baseSvg.js → baseSvg.mjs} +2 -2
- package/components/button.cjs +1 -0
- package/components/{button.js → button.mjs} +3 -3
- package/components/checkbox.cjs +1 -0
- package/components/{checkbox.js → checkbox.mjs} +4 -4
- package/components/dataGrid.cjs +1 -0
- package/components/{dataGrid.js → dataGrid.mjs} +2 -2
- package/components/flex.cjs +1 -0
- package/components/{flex.js → flex.mjs} +2 -2
- package/components/form.cjs +1 -0
- package/components/{form.js → form.mjs} +3 -3
- package/components/grid.cjs +1 -0
- package/components/{grid.js → grid.mjs} +2 -2
- package/components/radioButton.cjs +1 -0
- package/components/{radioButton.js → radioButton.mjs} +3 -3
- package/components/textarea.cjs +1 -0
- package/components/{textarea.js → textarea.mjs} +3 -3
- package/components/textbox.cjs +1 -0
- package/components/{textbox.js → textbox.mjs} +3 -3
- package/components/tooltip.cjs +1 -0
- package/components/{tooltip.js → tooltip.mjs} +2 -2
- package/core.cjs +58 -0
- package/package.json +11 -11
- package/ssg.cjs +1 -0
- package/{ssg.js → ssg.mjs} +1 -1
- package/theme.cjs +1 -0
- package/{theme.js → theme.mjs} +1 -1
- package/utils.cjs +1 -0
- /package/{core.js → core.mjs} +0 -0
- /package/{utils.js → utils.mjs} +0 -0
package/box.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react"),u=require("./core.cjs");function d(t,n){const{tag:a="div",children:o,props:i,className:f,style:r}=t,m=u.useStyles(t,a==="svg"),v=s.useMemo(()=>u.classNames(m,f).join(" "),[t]),e={...i,className:v};r&&(e.style=r),n&&(e.ref=n);const[y,c]=s.useState(!1),l=typeof o=="function";return l&&(e.onMouseEnter=()=>c(!0),e.onMouseLeave=()=>c(!1)),s.createElement(a,e,l?o({isHover:y}):o)}const g=s.forwardRef(d);module.exports=g;
|
package/{box.js → box.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import v, { forwardRef as d, useMemo as y, useState as g } from "react";
|
|
2
|
-
import { u as p, c as N } from "./core.
|
|
2
|
+
import { u as p, c as N } from "./core.mjs";
|
|
3
3
|
function x(s, o) {
|
|
4
4
|
const { tag: a = "div", children: t, props: l, className: f, style: n } = s, u = p(s, a === "svg"), i = y(() => N(u, f).join(" "), [s]), e = { ...l, className: i };
|
|
5
5
|
n && (e.style = n), o && (e.ref = o);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),g=require("react"),p=require("../box.cjs");require("../core.cjs");function u(e,r){const{viewBox:s="0 0 24 24",width:t="1.5rem",height:o,props:n,...i}=e;return c.jsx(p,{tag:"svg",ref:r,props:{...n,viewBox:s,width:t,height:o,xmlns:"http://www.w3.org/2000/svg",fill:"none"},...i})}const w=g.forwardRef(u);module.exports=w;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import g from "../box.
|
|
4
|
-
import "../core.
|
|
3
|
+
import g from "../box.mjs";
|
|
4
|
+
import "../core.mjs";
|
|
5
5
|
function n(o, r) {
|
|
6
6
|
const { viewBox: t = "0 0 24 24", width: s = "1.5rem", height: p, props: e, ...i } = o;
|
|
7
7
|
return /* @__PURE__ */ m(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),r=require("react"),s=require("../box.cjs"),u=require("../utils.cjs");require("../core.cjs");const c=["type","onClick","disabled"];function i(t,e){const o=u.ObjectUtils.buildProps(t,c);return n.jsx(s,{ref:e,tag:"button",component:"button",...o})}const b=r.forwardRef(i);module.exports=b;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
|
-
import s from "../box.
|
|
4
|
-
import { O as i } from "../utils.
|
|
5
|
-
import "../core.
|
|
3
|
+
import s from "../box.mjs";
|
|
4
|
+
import { O as i } from "../utils.mjs";
|
|
5
|
+
import "../core.mjs";
|
|
6
6
|
const m = ["type", "onClick", "disabled"];
|
|
7
7
|
function e(o, t) {
|
|
8
8
|
const r = i.buildProps(o, m);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("react"),t=require("../box.cjs"),c=require("../utils.cjs"),u=require("./flex.cjs");require("../core.cjs");const l=["name","onInput","onChange","disabled","autoFocus","readOnly","required","value","checked","defaultChecked"];function d(n,r){const{native:o}=n,s=c.ObjectUtils.buildProps(n,l,{type:"checkbox"});return e.jsxs(u,{inline:!0,position:"relative",children:[e.jsx(t,{ref:r,tag:"input",component:"checkbox",...s,appearance:o?void 0:"none"}),!o&&e.jsx(t,{position:"absolute",pointerEvents:"none",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:"0 0 20 20",children:e.jsx("g",{fill:"none",fillRule:"evenodd",children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.15L8.5 13 14 7"})})})})]})}const a=i.forwardRef(d);module.exports=a;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as s } from "react";
|
|
3
|
-
import t from "../box.
|
|
4
|
-
import { O as a } from "../utils.
|
|
5
|
-
import d from "./flex.
|
|
6
|
-
import "../core.
|
|
3
|
+
import t from "../box.mjs";
|
|
4
|
+
import { O as a } from "../utils.mjs";
|
|
5
|
+
import d from "./flex.mjs";
|
|
6
|
+
import "../core.mjs";
|
|
7
7
|
const l = [
|
|
8
8
|
"name",
|
|
9
9
|
"onInput",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),u=require("../box.cjs");require("react");require("../core.cjs");function c(e){if(!(e!=null&&e.length))return{rows:[],columns:[]};const i=Object.keys(e[0]);return{rows:e.map(r=>({dataRow:r,cells:i.map(n=>({key:n,value:r[n]}))})),columns:i.map(r=>({key:r}))}}function l(e){const{data:i}=e,r=c(i);return s.jsx(u,{display:"grid",b:1,borderRadius:1,children:r.columns.length===0?s.jsx(s.Fragment,{children:"empty grid"}):s.jsxs(s.Fragment,{children:[r.columns.map((n,t)=>s.jsx(u,{style:{gridColumn:t+1},children:n.key.toString()},n.key.toString())),r.rows.map((n,t)=>n.cells.map(o=>s.jsx(u,{children:o.value},o.key.toString()+t)))]})})}module.exports=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),i=require("react"),o=require("../box.cjs");require("../core.cjs");function c(e,r){const{inline:n,...s}=e;return t.jsx(o,{ref:r,display:n?"inline-flex":"flex",...s})}const u=i.forwardRef(c);module.exports=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import n from "../box.
|
|
4
|
-
import "../core.
|
|
3
|
+
import n from "../box.mjs";
|
|
4
|
+
import "../core.mjs";
|
|
5
5
|
function l(o, r) {
|
|
6
6
|
const { inline: e, ...t } = o;
|
|
7
7
|
return /* @__PURE__ */ i(n, { ref: r, display: e ? "inline-flex" : "flex", ...t });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const m=require("react/jsx-runtime"),o=require("react"),a=require("../box.cjs"),f=require("../utils.cjs");require("../core.cjs");function l(r){const{onSubmit:s,props:n}=r,t=o.useRef(null),u=o.useCallback(e=>{e.preventDefault();const i=f.FormUtils.getFormEntries(t.current);s(i,e)},[]),c={...n,onSubmit:u,ref:t};return m.jsx(a,{tag:"form",...r,props:c})}module.exports=l;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as p, useCallback as u } from "react";
|
|
3
|
-
import a from "../box.
|
|
4
|
-
import { F as c } from "../utils.
|
|
5
|
-
import "../core.
|
|
3
|
+
import a from "../box.mjs";
|
|
4
|
+
import { F as c } from "../utils.mjs";
|
|
5
|
+
import "../core.mjs";
|
|
6
6
|
function S(o) {
|
|
7
7
|
const { onSubmit: m, props: n } = o, r = p(null), e = u((t) => {
|
|
8
8
|
t.preventDefault();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),t=require("react"),o=require("../box.cjs");require("../core.cjs");function c(r,e){const{inline:i,...n}=r;return s.jsx(o,{ref:e,display:i?"inline-grid":"grid",...n})}const u=t.forwardRef(c);module.exports=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as d } from "react";
|
|
3
|
-
import e from "../box.
|
|
4
|
-
import "../core.
|
|
3
|
+
import e from "../box.mjs";
|
|
4
|
+
import "../core.mjs";
|
|
5
5
|
function f(r, i) {
|
|
6
6
|
const { inline: o, ...t } = r;
|
|
7
7
|
return /* @__PURE__ */ n(e, { ref: i, display: o ? "inline-grid" : "grid", ...t });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs"),s=require("../utils.cjs");require("../core.cjs");const i=["name","onInput","onChange","disabled","value","autoFocus","readOnly","required","checked","defaultChecked"];function c(e,t){const o=s.ObjectUtils.buildProps(e,i,{type:"radio"});return r.jsx(u,{ref:t,tag:"input",component:"radioButton",...o})}const a=n.forwardRef(c);module.exports=a;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import a from "../box.
|
|
4
|
-
import { O as i } from "../utils.
|
|
5
|
-
import "../core.
|
|
3
|
+
import a from "../box.mjs";
|
|
4
|
+
import { O as i } from "../utils.mjs";
|
|
5
|
+
import "../core.mjs";
|
|
6
6
|
const d = [
|
|
7
7
|
"name",
|
|
8
8
|
"onInput",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),o=require("react"),a=require("../box.cjs"),s=require("../utils.cjs");require("../core.cjs");const u=["name","onInput","onChange","placeholder","disabled","value","defaultValue","rows","cols","autoFocus","maxLength","minLength","readOnly","required"];function c(e,t){const r=s.ObjectUtils.buildProps(e,u);return n.jsx(a,{ref:t,tag:"textarea",component:"textarea",...r})}const i=o.forwardRef(c);module.exports=i;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as a } from "react";
|
|
3
|
-
import n from "../box.
|
|
4
|
-
import { O as s } from "../utils.
|
|
5
|
-
import "../core.
|
|
3
|
+
import n from "../box.mjs";
|
|
4
|
+
import { O as s } from "../utils.mjs";
|
|
5
|
+
import "../core.mjs";
|
|
6
6
|
const m = [
|
|
7
7
|
"name",
|
|
8
8
|
"onInput",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),n=require("react"),s=require("../box.cjs"),u=require("../utils.cjs");require("../core.cjs");const a=["name","onInput","onChange","type","placeholder","disabled","defaultValue","autoFocus","readOnly","required","value","pattern"];function c(e,t){const o=u.ObjectUtils.buildProps(e,a);return r.jsx(s,{ref:t,tag:"input",component:"textbox",...o})}const i=n.forwardRef(c);module.exports=i;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import a from "../box.
|
|
4
|
-
import { O as p } from "../utils.
|
|
5
|
-
import "../core.
|
|
3
|
+
import a from "../box.mjs";
|
|
4
|
+
import { O as p } from "../utils.mjs";
|
|
5
|
+
import "../core.mjs";
|
|
6
6
|
const s = [
|
|
7
7
|
"name",
|
|
8
8
|
"onInput",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),h=require("react-dom"),f=require("../box.cjs"),s=require("react");require("../core.cjs");function v(){return s.useMemo(()=>{const i="crono-box";let r=document.getElementById(i);return r||(r=document.createElement("div"),r.id=i,document.body.appendChild(r)),r},[])}const a=2;function x(i){const{onPositionChange:r}=i,u=s.useRef(null),[e,p]=s.useState(),m=v(),w=s.useCallback((o,t)=>{const n=c=>{c.target.contains(o)&&t(o)};return document.addEventListener("scroll",n,{capture:!0}),()=>{document.removeEventListener("scroll",n,{capture:!0})}},[e]),b=s.useCallback((o,t)=>{const n=c=>{t(o)};return window.addEventListener("resize",n,{capture:!0}),()=>{window.removeEventListener("resize",n,{capture:!0})}},[e]),d=s.useCallback(o=>{const t=o.getBoundingClientRect(),n=Math.round((t.top+window.scrollY)*a)/a,c=Math.round((t.left+window.scrollX)*a)/a;((e==null?void 0:e.top)!==n||(e==null?void 0:e.left)!==c)&&(r==null||r({top:n,left:c}),p({top:n,left:c,width:t.width>0?t.width:void 0}))},[e]);return s.useLayoutEffect(()=>{if(u.current){d(u.current);const o=w(u.current,d),t=b(u.current,d);return()=>{o(),t()}}},[e]),l.jsxs(l.Fragment,{children:[l.jsx(f,{ref:u}),e&&h.createPortal(l.jsx(f,{position:"absolute",top:0,left:0,transition:"none",style:{transform:`translate(${e.left}px,${e.top}px)`,width:e.width},children:l.jsx(f,{position:"absolute",width:"fit",...i})}),m)]})}module.exports=x;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as v, Fragment as b, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal as x } from "react-dom";
|
|
3
|
-
import d from "../box.
|
|
3
|
+
import d from "../box.mjs";
|
|
4
4
|
import { useMemo as E, useRef as C, useState as g, useCallback as f, useLayoutEffect as L } from "react";
|
|
5
|
-
import "../core.
|
|
5
|
+
import "../core.mjs";
|
|
6
6
|
function y() {
|
|
7
7
|
return E(() => {
|
|
8
8
|
const i = "crono-box";
|
package/core.cjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";const j=require("react");var e;(u=>{(l=>{function m(s,n){return`${s}${n.replace("/","-")}`}l.fraction=m;function c(s){return[`${s} path`,`${s} circle`,`${s} rect`,`${s} line`]}l.svg=c})(u.ClassName||(u.ClassName={})),(l=>{function m(o,a){return`${a/4}rem`}l.rem=m;function c(o,a){return`${a}px`}l.px=c;function s(o,a){const[v,g]=a.split("/");return`${+v/+g*100}%`}l.fraction=s;function n(o,a){switch(a){case"fit":return"100%";case"fit-screen":return o.toLocaleLowerCase().includes("height")?"100vh":"100vw";default:return a}}l.widthHeight=n;function f(o){return(a,v)=>`var(--${o}${v});`}l.variables=f;function b(o){return(a,v)=>`var(--${o}${v});`}l.svgVariables=b;function h(o,a){return`repeat(${a},minmax(0,1fr))`}l.gridColumns=h;function p(o,a){return a==="full-row"?"1/-1":`span ${a}/span ${a}`}l.gridColumn=p;function V(o,a){return`${a}ms`}l.ms=V;function C(o,a){return`${a}deg`}l.rotate=C;function r(o,a){return a==="xAxis"?"-1 1":"1 -1"}l.flip=r})(u.Value||(u.Value={}))})(e||(e={}));const i=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,64,68,72,76,80,84,88,92,96,100],U=[-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-22,-24,-26,-28,-30,-32,-34,-36,-38,-40,-44,-48,-52,-56,-60,-64,-68,-72,-76,-80,-84,-88,-92,-96,-100],d=[...i,...U],L=["solid","dashed","dotted","double","groove","ridge","inset","outset","none","hidden"],A=["auto","hidden","scroll","visible"],w=["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"],x=["fit","fit-screen","auto","fit-content","max-content","min-content"],I=["auto","flex-start","flex-end","center","baseline","stretch"],t={display:{cssNames:["display"],values1:{values:["none","block","inline-block","flex","inline-flex","grid","inline-grid","contents"]},values2:{values:[]},values3:{values:[]}},inline:{cssNames:["display"],values1:{values:[!0]},values2:{values:[]},values3:{values:[]}},boxSizing:{cssNames:["box-sizing"],values1:{values:["border-box","content-box"]},values2:{values:[]},values3:{values:[]}},width:{cssNames:["width"],values1:{values:x,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:w,formatValue:e.Value.fraction}},minWidth:{cssNames:["min-width"],values1:{values:x,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:w,formatValue:e.Value.fraction}},maxWidth:{cssNames:["max-width"],values1:{values:x,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:w,formatValue:e.Value.fraction}},height:{cssNames:["height"],values1:{values:x,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:w,formatValue:e.Value.fraction}},minHeight:{cssNames:["min-height"],values1:{values:x,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:w,formatValue:e.Value.fraction}},maxHeight:{cssNames:["max-height"],values1:{values:x,formatValue:e.Value.widthHeight},values2:{values:i,formatValue:e.Value.rem},values3:{values:w,formatValue:e.Value.fraction}},position:{cssNames:["position"],values1:{values:["static","relative","absolute","fixed","sticky"]},values2:{values:[]},values3:{values:[]}},top:{cssNames:["top"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},right:{cssNames:["right"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},bottom:{cssNames:["bottom"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},left:{cssNames:["left"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},inset:{cssNames:["inset"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},margin:{cssNames:["margin"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginHorizontal:{cssNames:["margin-inline"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginVertical:{cssNames:["margin-block"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginTop:{cssNames:["margin-top"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginRight:{cssNames:["margin-right"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginBottom:{cssNames:["margin-bottom"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},marginLeft:{cssNames:["margin-left"],values1:{values:d,formatValue:e.Value.rem},values2:{values:["auto"]},values3:{values:[]}},padding:{cssNames:["padding"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingHorizontal:{cssNames:["padding-inline"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingVertical:{cssNames:["padding-block"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingTop:{cssNames:["padding-top"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingRight:{cssNames:["padding-right"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingBottom:{cssNames:["padding-bottom"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},paddingLeft:{cssNames:["padding-left"],values1:{values:d,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},border:{cssNames:["border-width"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderHorizontal:{cssNames:["border-inline-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderVertical:{cssNames:["border-block-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderTop:{cssNames:["border-top-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderRight:{cssNames:["border-right-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderBottom:{cssNames:["border-bottom-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderLeft:{cssNames:["border-left-width"],values1:{values:d,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},borderStyle:{cssNames:["border-style"],values1:{values:L},values2:{values:[]},values3:{values:[]}},borderRadius:{cssNames:["border-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTop:{cssNames:["border-top-left-radius","border-top-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusRight:{cssNames:["border-top-right-radius","border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottom:{cssNames:["border-bottom-left-radius","border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusLeft:{cssNames:["border-top-left-radius","border-bottom-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopLeft:{cssNames:["border-top-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusTopRight:{cssNames:["border-top-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomLeft:{cssNames:["border-bottom-left-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},borderRadiusBottomRight:{cssNames:["border-bottom-right-radius"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},cursor:{cssNames:["cursor"],values1:{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]},values2:{values:[]},values3:{values:[]}},zIndex:{cssNames:["z-index"],values1:{values:[1,2,3,4,5,10,11,12,13,14,15,100,101,102,103,104,105,1e3,1001,1002,1003,1004,1005]},values2:{values:[]},values3:{values:[]}},overflow:{cssNames:["overflow"],values1:{values:A},values2:{values:[]},values3:{values:[]}},overflowX:{cssNames:["overflow-x"],values1:{values:A},values2:{values:[]},values3:{values:[]}},overflowY:{cssNames:["overflow-y"],values1:{values:A},values2:{values:[]},values3:{values:[]}},opacity:{cssNames:["opacity"],values1:{values:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]},values2:{values:[]},values3:{values:[]}},fontSize:{cssNames:["font-size"],values1:{values:i,formatValue:e.Value.px},values2:{values:["inherit"]},values3:{values:[]}},fontStyle:{cssNames:["font-style"],values1:{values:["italic","normal","oblique"]},values2:{values:[]},values3:{values:[]}},fontWeight:{cssNames:["font-weight"],values1:{values:[100,200,300,400,500,600,700,800,900]},values2:{values:[]},values3:{values:[]}},letterSpacing:{cssNames:["letter-spacing"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},lineHeight:{cssNames:["line-height"],values1:{values:i,formatValue:e.Value.px},values2:{values:["font-size"],formatValue:()=>"1"},values3:{values:[]}},textDecoration:{cssNames:["text-decoration"],values1:{values:["none","underline","overline","line-through"]},values2:{values:[]},values3:{values:[]}},textTransform:{cssNames:["text-transform"],values1:{values:["none","capitalize","lowercase","uppercase"]},values2:{values:[]},values3:{values:[]}},textAlign:{cssNames:["text-align"],values1:{values:["left","right","center","justify"]},values2:{values:[]},values3:{values:[]}},flexWrap:{cssNames:["flex-wrap"],values1:{values:["nowrap","wrap","wrap-reverse"]},values2:{values:[]},values3:{values:[]}},justifyContent:{cssNames:["justify-content"],values1:{values:["start","end","flex-start","flex-end","center","left","right","space-between","space-around","space-evenly","stretch"]},values2:{values:[]},values3:{values:[]}},alignItems:{cssNames:["align-items"],values1:{values:["stretch","flex-start","flex-end","center","baseline","start","end","self-start","self-end"]},values2:{values:[]},values3:{values:[]}},alignContent:{cssNames:["align-content"],values1:{values:["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch","start","end","baseline"]},values2:{values:[]},values3:{values:[]}},flex1:{cssNames:["flex"],values1:{values:[!0],formatValue:()=>"1"},values2:{values:[]},values3:{values:[]}},flexDirection:{cssNames:["flex-direction"],values1:{values:["row","row-reverse","column","column-reverse"]},values2:{values:[]},values3:{values:[]}},gap:{cssNames:["gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},rowGap:{cssNames:["row-gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},columnGap:{cssNames:["column-gap"],values1:{values:i,formatValue:e.Value.rem},values2:{values:[]},values3:{values:[]}},order:{cssNames:["order"],values1:{values:i},values2:{values:[]},values3:{values:[]}},flexGrow:{cssNames:["flex-grow"],values1:{values:i},values2:{values:[]},values3:{values:[]}},flexShrink:{cssNames:["flex-shrink"],values1:{values:i},values2:{values:[]},values3:{values:[]}},alignSelf:{cssNames:["align-self"],values1:{values:I},values2:{values:[]},values3:{values:[]}},justifySelf:{cssNames:["justify-self"],values1:{values:I},values2:{values:[]},values3:{values:[]}},gridColumns:{cssNames:["grid-template-columns"],values1:{values:i,formatValue:e.Value.gridColumns},values2:{values:[]},values3:{values:[]}},colSpan:{cssNames:["grid-column"],values1:{values:i,formatValue:e.Value.gridColumn},values2:{values:["full-row"],formatValue:e.Value.gridColumn},values3:{values:[]}},colStart:{cssNames:["grid-column-start"],values1:{values:i},values2:{values:[]},values3:{values:[]}},colEnd:{cssNames:["grid-column-end"],values1:{values:i},values2:{values:[]},values3:{values:[]}},outline:{cssNames:["outline-width"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},outlineStyle:{cssNames:["outline-style"],values1:{values:L},values2:{values:[]},values3:{values:[]}},outlineOffset:{cssNames:["outline-offset"],values1:{values:i,formatValue:e.Value.px},values2:{values:[]},values3:{values:[]}},transition:{cssNames:["transition-property"],values1:{values:["none","all"]},values2:{values:[]},values3:{values:[]}},transitionDuration:{cssNames:["transition-duration"],values1:{values:[50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1e3],formatValue:e.Value.ms},values2:{values:[]},values3:{values:[]}},userSelect:{cssNames:["user-select"],values1:{values:["none","auto","text","all"]},values2:{values:[]},values3:{values:[]}},appearance:{cssNames:["appearance"],values1:{values:["none"]},values2:{values:[]},values3:{values:[]}},pointerEvents:{cssNames:["pointer-events"],values1:{values:["none","auto","all"]},values2:{values:[]},values3:{values:[]}},whiteSpace:{cssNames:["white-space"],values1:{values:["break-spaces","normal","nowrap","pre","pre-line","pre-wrap"]},values2:{values:[]},values3:{values:[]}},textOverflow:{cssNames:["text-overflow"],values1:{values:["clip","ellipsis"]},values2:{values:[]},values3:{values:[]}},rotate:{cssNames:["rotate"],values1:{values:[0,90,180,270,-90,-180,-270],formatValue:e.Value.rotate},values2:{values:[]},values3:{values:[]}},flip:{cssNames:["scale"],values1:{values:["xAxis","yAxis"],formatValue:e.Value.flip},values2:{values:[]},values3:{values:[]}}},_={shadow:{cssNames:["box-shadow"],formatValue:e.Value.variables("shadow")},background:{cssNames:["background"],formatValue:e.Value.variables("background")},color:{cssNames:["color"],formatValue:e.Value.variables("color")},bgColor:{cssNames:["background-color"],formatValue:e.Value.variables("color")},borderColor:{cssNames:["border-color"],formatValue:e.Value.variables("color")},outlineColor:{cssNames:["outline-color"],formatValue:e.Value.variables("color")}},D={fill:{cssNames:["fill"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg},stroke:{cssNames:["stroke"],formatValue:e.Value.svgVariables("color"),formatSelector:e.ClassName.svg}},X=["H","F","A"],z={hover:{className:"_h"},focus:{className:"_f"}};Object.keys(_).forEach(u=>{t[u]=_[u],t[u].isThemeStyle=!0});Object.keys(D).forEach(u=>{t[u]=D[u],t[u].isThemeStyle=!0});const k={w:{...t.width,key:"width"},h:{...t.height,key:"height"},m:{...t.margin,key:"margin"},mx:{...t.marginHorizontal,key:"marginHorizontal"},my:{...t.marginVertical,key:"marginVertical"},mt:{...t.marginTop,key:"marginTop"},mr:{...t.marginRight,key:"marginRight"},mb:{...t.marginBottom,key:"marginBottom"},ml:{...t.marginLeft,key:"marginLeft"},p:{...t.padding,key:"padding"},px:{...t.paddingHorizontal,key:"paddingHorizontal"},py:{...t.paddingVertical,key:"paddingVertical"},pt:{...t.paddingTop,key:"paddingTop"},pr:{...t.paddingRight,key:"paddingRight"},pb:{...t.paddingBottom,key:"paddingBottom"},pl:{...t.paddingLeft,key:"paddingLeft"},b:{...t.border,key:"border"},bx:{...t.borderHorizontal,key:"borderHorizontal"},by:{...t.borderVertical,key:"borderVertical"},bt:{...t.borderTop,key:"borderTop"},br:{...t.borderRight,key:"borderRight"},bb:{...t.borderBottom,key:"borderBottom"},bl:{...t.borderLeft,key:"borderLeft"},jc:{...t.justifyContent,key:"justifyContent"},ai:{...t.alignItems,key:"alignItems"},ac:{...t.alignContent,key:"alignContent"},d:{...t.flexDirection,key:"flexDirection"}},Y=Object.keys(t),J=Object.keys(k);X.forEach(u=>{Y.forEach(l=>{t[`${l}${u}`]={...t[l]},t[`${l}${u}`].pseudoSuffix=u}),J.forEach(l=>{k[`${l}${u}`]={...k[l],key:`${k[l].key}${u}`},k[`${l}${u}`].pseudoSuffix=u})});class Q{constructor(){this._index=0,this._cache={}}getIdentity(l){return this._cache[l]||(this._cache[l]=this.getByIndex(this._index++)),this._cache[l]}getByIndex(l){const{first:m,next:c}=Z,s=l-m.length;if(s<0)return m[l];const n=Math.floor(s/c.length),f=s-n*c.length;return this.getByIndex(n)+c[f]}}const Z={first:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",next:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};var F;(u=>{u.boxClassName="_box",u.svgClassName="_svg";const l=`:root{--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;#crono-box {position: absolute;top: 0;left: 0;height: 0;}}
|
|
2
|
+
html{font-size: 16px;font-family: Arial, sans-serif;}
|
|
3
|
+
body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
|
|
4
|
+
a,ul{all: unset;}
|
|
5
|
+
.${u.boxClassName}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
|
|
6
|
+
.${u.svgClassName}{transition: all var(--svgTransitionTime);}.${u.svgClassName} path,.${u.svgClassName} circle,.${u.svgClassName} rect,.${u.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
7
|
+
`,m=new Q,c=Object.keys(t);let s=!1;const n=c.reduce((r,o)=>(r[o]=new Set,r),{});function f(r,o){if(r in t)return h(r,o);if(r in z)return z[r].className}u.get=f;function b(){if(s){console.info("%c💬Flush Dox Styles","color: #00ffff");let r=p([l]);r=p(r,"H"),r=p(r,"F"),r=p(r,"A");const o=C();o.innerHTML=r.join(""),s=!1}}u.flush=b;function h(r,o){var g;n[r].has(o)||(s=!0,n[r].add(o));const a=V(r,o),v=((g=a.formatClassName)==null?void 0:g.call(a,r,o))??`${r}${o}`;return`-${m.getIdentity(v)}`}function p(r,o){return Object.entries(n).filter(([v])=>{var g;return((g=t[v])==null?void 0:g.pseudoSuffix)===o}).reduce((v,[g,M])=>(M.forEach(H=>{var O;const y=V(g,H),N=`.${h(g,H)}`;let T=[];o?o==="H"?T=[...a(`${N}:hover`,y),...a(`.${z.hover.className}:hover>${N}`,y)]:o==="F"?T=[...a(`${N}:focus-within`,y),...a(`.${z.focus.className}:focus-within>${N}`,y)]:o==="A"&&(T=a(`${N}:active`,y)):T=a(N,y);const W=((O=y.formatValue)==null?void 0:O.call(y,g,H))??H,q=t[g].cssNames.map(G=>`${G}:${W};`).join("");v.push(`${T.join(",")}{${q}}`)}),v),r);function a(v,g){return g.formatSelector?g.formatSelector(v):[v]}}function V(r,o){const a=t[r];return a.isThemeStyle?a:a.values1.values.includes(o)?a.values1:a.values2.values.includes(o)?a.values2:a.values3}function C(){const r="crono-styles",a=typeof window<"u"&&typeof window.document<"u"?window.document:global.document;let v=a.getElementById(r);return v||(v=a.createElement("style"),v.setAttribute("id",r),v.setAttribute("type","text/css"),a.head.insertBefore(v,a.head.firstChild)),v}})(F||(F={}));const $=F,S={button:{styles:{display:"inline-block",p:3,cursor:"pointer",b:1,borderRadius:1},disabled:{cursor:"default"}},checkbox:{styles:{display:"inline-block",b:1,p:2}},radioButton:{styles:{display:"inline-block",b:1,p:2}},textbox:{styles:{display:"inline-block",b:1,borderRadius:1,p:3}},textarea:{styles:{display:"inline-block",b:1,borderRadius:1}}};var R;(u=>{u.Styles=S;function l(s){u.Styles=s,c()}u.setup=l;function m(s,n){const f=Object.entries(s.colors).map(([a,v])=>`--color${a}: ${v};`).join(`
|
|
8
|
+
`),b=Object.entries(s.shadows).map(([a,v])=>`--shadow${a}: ${v};`).join(`
|
|
9
|
+
`),h=Object.entries(s.backgrounds).map(([a,v])=>`--background${a}: ${v};`).join(`
|
|
10
|
+
`),p=[":root {"];f&&p.push(` ${f}`),b&&p.push(` ${b}`),h&&p.push(` ${h}`),p.push("}");const V=Object.keys(s.colors).map(a=>`'${a}'`).join(" | "),C=Object.keys(s.backgrounds).map(a=>`'${a}'`).join(" | "),r=Object.keys(s.shadows).map(a=>`'${a}'`).join(" | "),o=`import '@cronocode/react-box';
|
|
11
|
+
|
|
12
|
+
declare module '${(n==null?void 0:n.namespacePath)??"@cronocode/react-box/core/types"}' {
|
|
13
|
+
type ColorType = ${V};
|
|
14
|
+
type BackgroundType = ${C};
|
|
15
|
+
type ShadowType = ${r};
|
|
16
|
+
|
|
17
|
+
namespace Augmented {
|
|
18
|
+
interface BoxProps {
|
|
19
|
+
color?: ColorType;
|
|
20
|
+
colorH?: ColorType;
|
|
21
|
+
colorF?: ColorType;
|
|
22
|
+
colorA?: ColorType;
|
|
23
|
+
bgColor?: ColorType;
|
|
24
|
+
bgColorH?: ColorType;
|
|
25
|
+
bgColorF?: ColorType;
|
|
26
|
+
bgColorA?: ColorType;
|
|
27
|
+
borderColor?: ColorType;
|
|
28
|
+
borderColorH?: ColorType;
|
|
29
|
+
borderColorF?: ColorType;
|
|
30
|
+
borderColorA?: ColorType;
|
|
31
|
+
outlineColor?: ColorType;
|
|
32
|
+
outlineColorH?: ColorType;
|
|
33
|
+
outlineColorF?: ColorType;
|
|
34
|
+
outlineColorA?: ColorType;
|
|
35
|
+
background?: BackgroundType;
|
|
36
|
+
backgroundH?: BackgroundType;
|
|
37
|
+
backgroundF?: BackgroundType;
|
|
38
|
+
backgroundA?: BackgroundType;
|
|
39
|
+
shadow?: ShadowType;
|
|
40
|
+
shadowH?: ShadowType;
|
|
41
|
+
shadowF?: ShadowType;
|
|
42
|
+
shadowA?: ShadowType;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface SvgProps {
|
|
46
|
+
fill?: ColorType;
|
|
47
|
+
fillH?: ColorType;
|
|
48
|
+
fillF?: ColorType;
|
|
49
|
+
fillA?: ColorType;
|
|
50
|
+
stroke?: ColorType;
|
|
51
|
+
strokeH?: ColorType;
|
|
52
|
+
strokeF?: ColorType;
|
|
53
|
+
strokeA?: ColorType;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;return{variables:p.join(`
|
|
58
|
+
`),boxDts:o}}u.setupAugmentedProps=m;function c(){Object.keys(S).forEach(n=>{const f=u.Styles[n],b=S[n];f?(f.styles={...b.styles,...f.styles},f.disabled&&b.disabled&&(f.disabled={...b.disabled,...f.disabled})):u.Styles[n]=S[n]})}})(R||(R={}));const E=R;function K(u){const{clean:l,disabled:m,theme:c,component:s}=u;return j.useMemo(()=>{var b,h,p;if(l)return;let n=E.Styles[s]??((b=E.Styles.components)==null?void 0:b[s]);if(!n)return;let f=c?{...n.styles,...(h=n.themes)==null?void 0:h[c].styles}:n.styles;return m?c?{...f,...n.disabled,...(p=n.themes)==null?void 0:p[c].disabled}:{...f,...n.disabled}:f},[s,l,m,c])}const ee=typeof window<"u"&&typeof window.document<"u",se=ee?j.useLayoutEffect:j.useEffect;function ae(u,l){const m=K(u);return se($.flush,[u]),j.useMemo(()=>{const c=[l?$.svgClassName:$.boxClassName],s=m?{...B(m),...B(u)}:B(u);return"inline"in s&&(s.display==="block"?s.display="inline-block":s.display==="flex"?s.display="inline-flex":s.display==="grid"&&(s.display="inline-grid"),delete s.inline),"inlineH"in s&&(s.displayH==="block"?s.displayH="inline-block":s.displayH==="flex"?s.displayH="inline-flex":s.displayH==="grid"&&(s.displayH="inline-grid"),delete s.inlineH),"inlineF"in s&&(s.displayF==="block"?s.displayF="inline-block":s.displayF==="flex"?s.displayF="inline-flex":s.displayF==="grid"&&(s.displayF="inline-grid"),delete s.inlineF),"inlineA"in s&&(s.displayA==="block"?s.displayA="inline-block":s.displayA==="flex"?s.displayA="inline-flex":s.displayA==="grid"&&(s.displayA="inline-grid"),delete s.inlineA),Object.entries(s).forEach(([n,f])=>{c.push($.get(n,f))}),c},[u,m])}function B(u){const l={...u};return Object.keys(l).forEach(c=>{const s=k[c];s&&(s.key in l||(l[s.key]=l[c]),delete l[c])}),l}function P(...u){return u.reduce((l,m)=>m?typeof m=="string"?(l.push(m),l):Array.isArray(m)?(l.push(...P(...m)),l):(Object.entries(m).forEach(([c,s])=>{s&&l.push(c)}),l):l,[])}exports.StylesContext=$;exports.Theme=E;exports.classNames=P;exports.useStyles=ae;
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronocode/react-box",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "./box.
|
|
6
|
-
"module": "./box.
|
|
5
|
+
"main": "./box.cjs",
|
|
6
|
+
"module": "./box.mjs",
|
|
7
7
|
"types": "./box.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"import": "./box.
|
|
11
|
-
"require": "./box.
|
|
10
|
+
"import": "./box.mjs",
|
|
11
|
+
"require": "./box.cjs",
|
|
12
12
|
"types": "./box.d.ts"
|
|
13
13
|
},
|
|
14
14
|
"./theme": {
|
|
15
|
-
"import": "./theme.
|
|
16
|
-
"require": "./theme.
|
|
15
|
+
"import": "./theme.mjs",
|
|
16
|
+
"require": "./theme.cjs",
|
|
17
17
|
"types": "./theme.d.ts"
|
|
18
18
|
},
|
|
19
19
|
"./core/types": {
|
|
20
20
|
"types": "./core/types.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"./ssg": {
|
|
23
|
-
"import": "./ssg.
|
|
24
|
-
"require": "./ssg.
|
|
23
|
+
"import": "./ssg.mjs",
|
|
24
|
+
"require": "./ssg.cjs",
|
|
25
25
|
"types": "./ssg.d.ts"
|
|
26
26
|
},
|
|
27
27
|
"./components/*": {
|
|
28
|
-
"import": "./components/*.
|
|
29
|
-
"require": "./components/*.
|
|
28
|
+
"import": "./components/*.mjs",
|
|
29
|
+
"require": "./components/*.cjs",
|
|
30
30
|
"types": "./components/*.d.ts"
|
|
31
31
|
}
|
|
32
32
|
},
|
package/ssg.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core.cjs");require("react");const{flush:t}=e.StylesContext;exports.flushStyles=t;
|
package/{ssg.js → ssg.mjs}
RENAMED
package/theme.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./core.cjs");require("react");module.exports=e.Theme;
|
package/{theme.js → theme.mjs}
RENAMED
package/utils.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a;(f=>{function l(c,...s){const e={...c},o={};return s.forEach(r=>{r in e&&(o[r]=e[r],delete e[r])}),[o,e]}f.moveToTagProps=l;function p(c,s,e){const o={...c},r=o.props||{};return s.forEach(t=>{if(t in o){if(r[t]=o[t],t==="disabled")return;delete o[t]}}),e&&Object.entries(e).forEach(([t,n])=>{r[t]=n}),o.props=r,o}f.buildProps=p})(a||(a={}));const m=a;var h;(f=>{function l(c){const s=Array.from(c.elements).reduce((e,o)=>{const r=o.name;return r&&(e[r]||(e[r]=[]),e[r].push(o)),e},{});return Object.entries(s).reduce((e,[o,r])=>{if(r.length===1){const t=r[0];p(e,o,t.type==="checkbox"||t.type==="radio"?t.checked:t.value)}else{const t=r.reduce((n,i)=>(i.type==="checkbox"||i.type==="radio"?i.checked&&n.push(i.value):n.push(i.value),n),[]);p(e,o,t)}return e},{})}f.getFormEntries=l;function p(c,s,e){if(s.includes(".")){const o=s.split(".");let r=c;o.forEach((t,n)=>{if(o.length>n+1){const i=t.match(/^(.+)\[(\d)\]$/);if(i){const[,u,d]=i;r[u]=r[u]||[],r[u][d]=r[u][d]||{},r=r[u][d]}else r[t]=r[t]||{},r=r[t]}else r[t]=e})}else c[s]=e}})(h||(h={}));const P=h;exports.FormUtils=P;exports.ObjectUtils=m;
|
/package/{core.js → core.mjs}
RENAMED
|
File without changes
|
/package/{utils.js → utils.mjs}
RENAMED
|
File without changes
|