@cronocode/react-box 1.4.3 → 1.4.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),o=require("../utils/utils.cjs.js"),n=require("../baseSvg.module.css.cjs.js");function w(l){const{children:s,props:v,className:c,style:m,viewBox:h,width:d,height:S}=l,e=c?o.ClassNameUtils.classNames(c,n.classes.base):[n.classes.base];Object.entries(l).forEach(([a,u])=>{const f=n.classes[a+u];f?e.push(f):a in o.themeSvgClasses&&e.push(`${o.themeSvgClasses[a]}${u}`)});const t={...v,style:{...m,width:d,height:S},className:e.join(" "),viewBox:h||"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none"},[p,i]=g.useState(!1),r=typeof s=="function";return r&&(t.onMouseEnter=()=>i(!0),t.onMouseLeave=()=>i(!1)),g.createElement("svg",t,r?s({isHover:p}):s)}exports.default=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),o=require("../utils/utils.cjs"),n=require("../baseSvg.module.css.cjs");function w(l){const{children:s,props:v,className:c,style:m,viewBox:h,width:d,height:S}=l,e=c?o.ClassNameUtils.classNames(c,n.classes.base):[n.classes.base];Object.entries(l).forEach(([a,u])=>{const f=n.classes[a+u];f?e.push(f):a in o.themeSvgClasses&&e.push(`${o.themeSvgClasses[a]}${u}`)});const t={...v,style:{...m,width:d,height:S},className:e.join(" "),viewBox:h||"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none"},[p,i]=g.useState(!1),r=typeof s=="function";return r&&(t.onMouseEnter=()=>i(!0),t.onMouseLeave=()=>i(!1)),g.createElement("svg",t,r?s({isHover:p}):s)}exports.default=w;
@@ -1,6 +1,6 @@
1
1
  import d, { useState as N } from "react";
2
- import { C as x, t as m } from "../utils/utils.es.js";
3
- import { c as a } from "../baseSvg.module.css.es.js";
2
+ import { C as x, t as m } from "../utils/utils.mjs";
3
+ import { c as a } from "../baseSvg.module.css.mjs";
4
4
  function C(n) {
5
5
  const { children: s, props: p, className: r, style: h, viewBox: u, width: v, height: g } = n, e = r ? x.classNames(r, a.base) : [a.base];
6
6
  Object.entries(n).forEach(([o, l]) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs.js"),s=require("../utils/utils.cjs.js");require("../box.module.css.cjs.js");require("../theme.cjs.js");const i=["type","onClick","disabled"];function c(t,e){const o=s.ObjectUtils.buildProps(t,i);return r.jsx(u.default,{ref:e,tag:"button",component:"button",...o})}const l=n.forwardRef(c);exports.default=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs"),s=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const i=["type","onClick","disabled"];function c(t,e){const o=s.ObjectUtils.buildProps(t,i);return r.jsx(u.default,{ref:e,tag:"button",component:"button",...o})}const l=n.forwardRef(c);exports.default=l;
@@ -1,9 +1,9 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as p } from "react";
3
- import i from "../box.es.js";
4
- import { O as m } from "../utils/utils.es.js";
5
- import "../box.module.css.es.js";
6
- import "../theme.es.js";
3
+ import i from "../box.mjs";
4
+ import { O as m } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ import "../theme.mjs";
7
7
  const s = ["type", "onClick", "disabled"];
8
8
  function e(o, t) {
9
9
  const r = m.buildProps(o, s);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),t=require("../box.cjs.js"),i=require("../utils/utils.cjs.js"),u=require("./flex.cjs.js"),l=require("../box.module.css.cjs.js");require("../theme.cjs.js");const a=["name","onInput","onChange","disabled","autoFocus","readOnly","required","value","checked","defaultChecked"];function d(n,s){const{native:o}=n,r=i.ObjectUtils.buildProps(n,a,{type:"checkbox"});return e.jsxs(u.default,{inline:!0,position:"relative",children:[e.jsx(t.default,{ref:s,tag:"input",component:"checkbox",...r,appearance:o?void 0:"none"}),!o&&e.jsx(t.default,{position:"absolute",pointerEvents:"none",className:l.classes._checkedIcon,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 x=c.forwardRef(d);exports.default=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),t=require("../box.cjs"),i=require("../utils/utils.cjs"),u=require("./flex.cjs"),l=require("../box.module.css.cjs");require("../theme.cjs");const a=["name","onInput","onChange","disabled","autoFocus","readOnly","required","value","checked","defaultChecked"];function d(n,s){const{native:o}=n,r=i.ObjectUtils.buildProps(n,a,{type:"checkbox"});return e.jsxs(u.default,{inline:!0,position:"relative",children:[e.jsx(t.default,{ref:s,tag:"input",component:"checkbox",...r,appearance:o?void 0:"none"}),!o&&e.jsx(t.default,{position:"absolute",pointerEvents:"none",className:l.classes._checkedIcon,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 x=c.forwardRef(d);exports.default=x;
@@ -1,10 +1,10 @@
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.es.js";
4
- import { O as a } from "../utils/utils.es.js";
5
- import l from "./flex.es.js";
6
- import { c as d } from "../box.module.css.es.js";
7
- import "../theme.es.js";
3
+ import t from "../box.mjs";
4
+ import { O as a } from "../utils/utils.mjs";
5
+ import l from "./flex.mjs";
6
+ import { c as d } from "../box.module.css.mjs";
7
+ import "../theme.mjs";
8
8
  const p = [
9
9
  "name",
10
10
  "onInput",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("../box.cjs.js");require("react");require("../box.module.css.cjs.js");require("../utils/utils.cjs.js");require("../theme.cjs.js");function o(r){if(!(r!=null&&r.length))return{rows:[],columns:[]};const t=Object.keys(r[0]);return{rows:r.map(e=>({dataRow:e,cells:t.map(n=>({key:n,value:e[n]}))})),columns:t.map(e=>({key:e}))}}function c(r){const{data:t}=r,e=o(t);return e.columns.length===0?i.jsx(u.default,{display:"grid",children:"empty grid"}):i.jsxs(u.default,{display:"grid",children:[e.columns.map((n,s)=>i.jsx(u.default,{style:{gridColumn:s+1},children:n.key.toString()},n.key.toString())),e.rows.map((n,s)=>n.cells.map(l=>i.jsx(u.default,{children:l.value},l.key.toString()+s)))]})}exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("../box.cjs");require("react");require("../box.module.css.cjs");require("../utils/utils.cjs");require("../theme.cjs");function o(r){if(!(r!=null&&r.length))return{rows:[],columns:[]};const t=Object.keys(r[0]);return{rows:r.map(e=>({dataRow:e,cells:t.map(n=>({key:n,value:e[n]}))})),columns:t.map(e=>({key:e}))}}function c(r){const{data:t}=r,e=o(t);return e.columns.length===0?i.jsx(u.default,{display:"grid",children:"empty grid"}):i.jsxs(u.default,{display:"grid",children:[e.columns.map((n,s)=>i.jsx(u.default,{style:{gridColumn:s+1},children:n.key.toString()},n.key.toString())),e.rows.map((n,s)=>n.cells.map(l=>i.jsx(u.default,{children:l.value},l.key.toString()+s)))]})}exports.default=c;
@@ -1,9 +1,9 @@
1
1
  import { jsx as s, jsxs as l } from "react/jsx-runtime";
2
- import t from "../box.es.js";
2
+ import t from "../box.mjs";
3
3
  import "react";
4
- import "../box.module.css.es.js";
5
- import "../utils/utils.es.js";
6
- import "../theme.es.js";
4
+ import "../box.module.css.mjs";
5
+ import "../utils/utils.mjs";
6
+ import "../theme.mjs";
7
7
  function p(i) {
8
8
  if (!(i != null && i.length))
9
9
  return {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs.js");require("../box.module.css.cjs.js");require("../utils/utils.cjs.js");require("../theme.cjs.js");function l(e,r){const{inline:t}=e;return i.jsx(u.default,{ref:r,display:t?"inline-flex":"flex",...e})}const o=n.forwardRef(l);exports.default=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs");require("../box.module.css.cjs");require("../utils/utils.cjs");require("../theme.cjs");function l(e,r){const{inline:t}=e;return i.jsx(u.default,{ref:r,display:t?"inline-flex":"flex",...e})}const o=n.forwardRef(l);exports.default=o;
@@ -1,9 +1,9 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as e } from "react";
3
- import f from "../box.es.js";
4
- import "../box.module.css.es.js";
5
- import "../utils/utils.es.js";
6
- import "../theme.es.js";
3
+ import f from "../box.mjs";
4
+ import "../box.module.css.mjs";
5
+ import "../utils/utils.mjs";
6
+ import "../theme.mjs";
7
7
  function m(o, r) {
8
8
  const { inline: i } = o;
9
9
  return /* @__PURE__ */ t(f, { ref: r, display: i ? "inline-flex" : "flex", ...o });
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),a=require("../box.cjs.js"),f=require("../utils/utils.cjs.js");require("../box.module.css.cjs.js");require("../theme.cjs.js");function m(e){const{onSubmit:n,props:u}=e,r=o.useRef(null),s=o.useCallback(t=>{t.preventDefault();const c=f.FormUtils.getFormEntries(r.current);n(c,t)},[]),i={...u,onSubmit:s,ref:r};return l.jsx(a.default,{tag:"form",...e,props:i})}exports.default=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),a=require("../box.cjs"),f=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");function m(e){const{onSubmit:n,props:u}=e,r=o.useRef(null),s=o.useCallback(t=>{t.preventDefault();const c=f.FormUtils.getFormEntries(r.current);n(c,t)},[]),i={...u,onSubmit:s,ref:r};return l.jsx(a.default,{tag:"form",...e,props:i})}exports.default=m;
@@ -1,9 +1,9 @@
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.es.js";
4
- import { F as c } from "../utils/utils.es.js";
5
- import "../box.module.css.es.js";
6
- import "../theme.es.js";
3
+ import a from "../box.mjs";
4
+ import { F as c } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ import "../theme.mjs";
7
7
  function d(o) {
8
8
  const { onSubmit: m, props: n } = o, r = p(null), e = u((t) => {
9
9
  t.preventDefault();
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs.js"),i=require("../utils/utils.cjs.js");require("../box.module.css.cjs.js");require("../theme.cjs.js");const a=["name","onInput","onChange","disabled","value","autoFocus","readOnly","required","checked","defaultChecked"];function s(e,t){const o=i.ObjectUtils.buildProps(e,a,{type:"radio"});return r.jsx(u.default,{ref:t,tag:"input",component:"radioButton",...o})}const c=n.forwardRef(s);exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs"),i=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const a=["name","onInput","onChange","disabled","value","autoFocus","readOnly","required","checked","defaultChecked"];function s(e,t){const o=i.ObjectUtils.buildProps(e,a,{type:"radio"});return r.jsx(u.default,{ref:t,tag:"input",component:"radioButton",...o})}const c=n.forwardRef(s);exports.default=c;
@@ -1,9 +1,9 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as n } from "react";
3
- import a from "../box.es.js";
4
- import { O as i } from "../utils/utils.es.js";
5
- import "../box.module.css.es.js";
6
- import "../theme.es.js";
3
+ import a from "../box.mjs";
4
+ import { O as i } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ import "../theme.mjs";
7
7
  const d = [
8
8
  "name",
9
9
  "onInput",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),n=require("../box.cjs.js"),u=require("../utils/utils.cjs.js");require("../box.module.css.cjs.js");require("../theme.cjs.js");const s=["name","onInput","onChange","placeholder","disabled","value","defaultValue","rows","cols","autoFocus","maxLength","minLength","readOnly","required"];function i(e,t){const r=u.ObjectUtils.buildProps(e,s);return a.jsx(n.default,{ref:t,tag:"textarea",component:"textarea",...r})}const c=o.forwardRef(i);exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),n=require("../box.cjs"),u=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const s=["name","onInput","onChange","placeholder","disabled","value","defaultValue","rows","cols","autoFocus","maxLength","minLength","readOnly","required"];function i(e,t){const r=u.ObjectUtils.buildProps(e,s);return a.jsx(n.default,{ref:t,tag:"textarea",component:"textarea",...r})}const c=o.forwardRef(i);exports.default=c;
@@ -1,9 +1,9 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { forwardRef as a } from "react";
3
- import n from "../box.es.js";
4
- import { O as m } from "../utils/utils.es.js";
5
- import "../box.module.css.es.js";
6
- import "../theme.es.js";
3
+ import n from "../box.mjs";
4
+ import { O as m } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ import "../theme.mjs";
7
7
  const s = [
8
8
  "name",
9
9
  "onInput",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs.js"),a=require("../utils/utils.cjs.js");require("../box.module.css.cjs.js");require("../theme.cjs.js");const s=["name","onInput","onChange","type","placeholder","disabled","defaultValue","autoFocus","readOnly","required","value","pattern"];function i(e,t){const r=a.ObjectUtils.buildProps(e,s);return o.jsx(u.default,{ref:t,tag:"input",component:"textbox",...r})}const c=n.forwardRef(i);exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs"),a=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const s=["name","onInput","onChange","type","placeholder","disabled","defaultValue","autoFocus","readOnly","required","value","pattern"];function i(e,t){const r=a.ObjectUtils.buildProps(e,s);return o.jsx(u.default,{ref:t,tag:"input",component:"textbox",...r})}const c=n.forwardRef(i);exports.default=c;
@@ -1,9 +1,9 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { forwardRef as n } from "react";
3
- import a from "../box.es.js";
4
- import { O as p } from "../utils/utils.es.js";
5
- import "../box.module.css.es.js";
6
- import "../theme.es.js";
3
+ import a from "../box.mjs";
4
+ import { O as p } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ import "../theme.mjs";
7
7
  const i = [
8
8
  "name",
9
9
  "onInput",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),v=require("react-dom"),d=require("../box.cjs.js"),s=require("react"),q=require("../utils/utils.cjs.js");require("../box.module.css.cjs.js");require("../theme.cjs.js");function x(u){const{children:f,onPositionChange:c}=u,o=s.useRef(null),[e,p]=s.useState(),w=q.usePortalContainer(),b=s.useCallback((t,r)=>{const n=a=>{a.target.contains(t)&&r()};return document.addEventListener("scroll",n,{capture:!0}),()=>{document.removeEventListener("scroll",n,{capture:!0})}},[e]),m=s.useCallback((t,r)=>{const n=a=>{r()};return window.addEventListener("resize",n,{capture:!0}),()=>{window.removeEventListener("resize",n,{capture:!0})}},[e]),i=s.useCallback(()=>{if(o.current){const t=o.current.getBoundingClientRect(),r=t.top+window.scrollY,n=t.left+window.scrollX;((e==null?void 0:e.top)!==r||(e==null?void 0:e.left)!==n)&&(c==null||c({top:r,left:n}),p({top:t.top+window.scrollY,left:t.left+window.scrollX}))}},[e]);return s.useLayoutEffect(()=>{if(o.current){i();const t=b(o.current,i),r=m(o.current,i);return()=>{t(),r()}}},[e]),l.jsxs(l.Fragment,{children:[l.jsx(d.default,{ref:o,position:"absolute",top:0,left:0,...u,children:void 0}),e&&v.createPortal(l.jsx(d.default,{position:"absolute",top:0,left:0,transition:"none",style:{transform:`translate(${e.left}px,${e.top}px)`},children:f}),w)]})}exports.default=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),v=require("react-dom"),d=require("../box.cjs"),s=require("react"),q=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");function x(u){const{children:f,onPositionChange:c}=u,o=s.useRef(null),[e,p]=s.useState(),w=q.usePortalContainer(),b=s.useCallback((t,r)=>{const n=a=>{a.target.contains(t)&&r()};return document.addEventListener("scroll",n,{capture:!0}),()=>{document.removeEventListener("scroll",n,{capture:!0})}},[e]),m=s.useCallback((t,r)=>{const n=a=>{r()};return window.addEventListener("resize",n,{capture:!0}),()=>{window.removeEventListener("resize",n,{capture:!0})}},[e]),i=s.useCallback(()=>{if(o.current){const t=o.current.getBoundingClientRect(),r=t.top+window.scrollY,n=t.left+window.scrollX;((e==null?void 0:e.top)!==r||(e==null?void 0:e.left)!==n)&&(c==null||c({top:r,left:n}),p({top:t.top+window.scrollY,left:t.left+window.scrollX}))}},[e]);return s.useLayoutEffect(()=>{if(o.current){i();const t=b(o.current,i),r=m(o.current,i);return()=>{t(),r()}}},[e]),l.jsxs(l.Fragment,{children:[l.jsx(d.default,{ref:o,position:"absolute",top:0,left:0,...u,children:void 0}),e&&v.createPortal(l.jsx(d.default,{position:"absolute",top:0,left:0,transition:"none",style:{transform:`translate(${e.left}px,${e.top}px)`},children:f}),w)]})}exports.default=x;
@@ -1,10 +1,10 @@
1
1
  import { jsxs as x, Fragment as b, jsx as a } from "react/jsx-runtime";
2
2
  import { createPortal as E } from "react-dom";
3
- import f from "../box.es.js";
3
+ import f from "../box.mjs";
4
4
  import { useRef as L, useState as z, useCallback as c, useLayoutEffect as g } from "react";
5
- import { u as C } from "../utils/utils.es.js";
6
- import "../box.module.css.es.js";
7
- import "../theme.es.js";
5
+ import { u as C } from "../utils/utils.mjs";
6
+ import "../box.module.css.mjs";
7
+ import "../theme.mjs";
8
8
  function P(i) {
9
9
  const { children: p, onPositionChange: s } = i, n = L(null), [t, d] = z(), m = C(), w = c(
10
10
  (e, r) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "main": "./box.cjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",
package/plugins.cjs CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(r){const _=Object.entries(r.colors).map(([o,e])=>`--color${o}: ${e};`).join(`
2
- `),n=Object.entries(r.shadows).map(([o,e])=>`--shadow${o}: ${e};`).join(`
3
- `),i=Object.entries(r.backgrounds).map(([o,e])=>`--background${o}: ${e};`).join(`
4
- `),s=`:root {
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(r){const l=Object.entries(r.colors).map(([o,e])=>`--color${o}: ${e};`).join(`
2
+ `),_=Object.entries(r.shadows).map(([o,e])=>`--shadow${o}: ${e};`).join(`
3
+ `),t=Object.entries(r.backgrounds).map(([o,e])=>`--background${o}: ${e};`).join(`
4
+ `),c=`:root {
5
+ ${l}
5
6
  ${_}
6
- ${n}
7
- ${i}
8
- }`,$=Object.keys(r.colors).map(o=>`
7
+ ${t}
8
+ }`,n=Object.keys(r.colors).map(o=>`
9
9
  .color_${o},
10
10
  .color_h_${o}:hover,
11
11
  ._h:hover>.color_h_${o} {
@@ -124,7 +124,7 @@
124
124
  line {
125
125
  stroke: var(--color${o});
126
126
  }
127
- }`),h=Object.keys(r.shadows).map(o=>`
127
+ }`),i=Object.keys(r.shadows).map(o=>`
128
128
  .shadow_${o},
129
129
  .shadow_h_${o}:hover,
130
130
  ._h:hover>.shadow_h_${o} {
@@ -138,7 +138,7 @@
138
138
 
139
139
  .shadow_a_${o}:active {
140
140
  box-shadow: var(--shadow${o});
141
- }`),b=Object.keys(r.backgrounds).map(o=>`
141
+ }`),$=Object.keys(r.backgrounds).map(o=>`
142
142
  .bg_${o},
143
143
  .bg_h_${o}:hover,
144
144
  ._h:hover>.bg_h_${o} {
@@ -152,12 +152,12 @@
152
152
 
153
153
  .bg_a_${o}:active {
154
154
  background: var(--background${o});
155
- }`),l=Object.keys(r.colors).map(o=>`'${o}'`).join(" | "),t=Object.keys(r.backgrounds).map(o=>`'${o}'`).join(" | "),c=Object.keys(r.shadows).map(o=>`'${o}'`).join(" | "),p=`import '@cronocode/react-box';
155
+ }`),h=Object.keys(r.colors).map(o=>`'${o}'`).join(" | "),s=Object.keys(r.backgrounds).map(o=>`'${o}'`).join(" | "),b=Object.keys(r.shadows).map(o=>`'${o}'`).join(" | "),d=`import {ColorType} from '@cronocode/react-box';
156
156
 
157
157
  declare module '@cronocode/react-box' {
158
- type ColorType = ${l};
159
- type BackgroundType = ${t};
160
- type ShadowType = ${c};
158
+ type ColorType = ${h};
159
+ type BackgroundType = ${s};
160
+ type ShadowType = ${b};
161
161
 
162
162
  namespace Augmented {
163
163
  interface Props {
@@ -196,13 +196,8 @@ declare module '@cronocode/react-box' {
196
196
  }
197
197
  }
198
198
  }
199
- `,d=`import '@cronocode/react-box/components/baseSvg';
200
199
 
201
200
  declare module '@cronocode/react-box/components/baseSvg' {
202
- type ColorType = ${l};
203
- type BackgroundType = ${t};
204
- type ShadowType = ${c};
205
-
206
201
  namespace Augmented {
207
202
  interface Props {
208
203
  fill?: ColorType;
@@ -216,5 +211,5 @@ declare module '@cronocode/react-box/components/baseSvg' {
216
211
  }
217
212
  }
218
213
  }
219
- `;return{themeCss:[s,...$,...h,...b].join(`
220
- `),boxDts:p,baseSvgDts:d}}exports.boxTheme=u;
214
+ `;return{themeCss:[c,...n,...i,...$].join(`
215
+ `),boxDts:d}}exports.boxTheme=p;
package/plugins.d.ts CHANGED
@@ -6,7 +6,6 @@ interface BoxThemeOptions {
6
6
  interface BoxThemeResources {
7
7
  themeCss: string;
8
8
  boxDts: string;
9
- baseSvgDts: string;
10
9
  }
11
10
  export declare function boxTheme(options: BoxThemeOptions): BoxThemeResources;
12
11
  export {};
package/plugins.mjs CHANGED
@@ -1,12 +1,12 @@
1
- function C(r) {
2
- const c = Object.entries(r.colors).map(([o, e]) => `--color${o}: ${e};`).join(`
3
- `), n = Object.entries(r.shadows).map(([o, e]) => `--shadow${o}: ${e};`).join(`
4
- `), i = Object.entries(r.backgrounds).map(([o, e]) => `--background${o}: ${e};`).join(`
5
- `), $ = `:root {
6
- ${c}
7
- ${n}
8
- ${i}
9
- }`, s = Object.keys(r.colors).map((o) => `
1
+ function p(r) {
2
+ const l = Object.entries(r.colors).map(([o, e]) => `--color${o}: ${e};`).join(`
3
+ `), _ = Object.entries(r.shadows).map(([o, e]) => `--shadow${o}: ${e};`).join(`
4
+ `), t = Object.entries(r.backgrounds).map(([o, e]) => `--background${o}: ${e};`).join(`
5
+ `), c = `:root {
6
+ ${l}
7
+ ${_}
8
+ ${t}
9
+ }`, n = Object.keys(r.colors).map((o) => `
10
10
  .color_${o},
11
11
  .color_h_${o}:hover,
12
12
  ._h:hover>.color_h_${o} {
@@ -125,7 +125,7 @@ function C(r) {
125
125
  line {
126
126
  stroke: var(--color${o});
127
127
  }
128
- }`), h = Object.keys(r.shadows).map((o) => `
128
+ }`), i = Object.keys(r.shadows).map((o) => `
129
129
  .shadow_${o},
130
130
  .shadow_h_${o}:hover,
131
131
  ._h:hover>.shadow_h_${o} {
@@ -139,7 +139,7 @@ function C(r) {
139
139
 
140
140
  .shadow_a_${o}:active {
141
141
  box-shadow: var(--shadow${o});
142
- }`), b = Object.keys(r.backgrounds).map((o) => `
142
+ }`), $ = Object.keys(r.backgrounds).map((o) => `
143
143
  .bg_${o},
144
144
  .bg_h_${o}:hover,
145
145
  ._h:hover>.bg_h_${o} {
@@ -153,12 +153,12 @@ function C(r) {
153
153
 
154
154
  .bg_a_${o}:active {
155
155
  background: var(--background${o});
156
- }`), l = Object.keys(r.colors).map((o) => `'${o}'`).join(" | "), t = Object.keys(r.backgrounds).map((o) => `'${o}'`).join(" | "), _ = Object.keys(r.shadows).map((o) => `'${o}'`).join(" | "), p = `import '@cronocode/react-box';
156
+ }`), h = Object.keys(r.colors).map((o) => `'${o}'`).join(" | "), s = Object.keys(r.backgrounds).map((o) => `'${o}'`).join(" | "), b = Object.keys(r.shadows).map((o) => `'${o}'`).join(" | "), d = `import {ColorType} from '@cronocode/react-box';
157
157
 
158
158
  declare module '@cronocode/react-box' {
159
- type ColorType = ${l};
160
- type BackgroundType = ${t};
161
- type ShadowType = ${_};
159
+ type ColorType = ${h};
160
+ type BackgroundType = ${s};
161
+ type ShadowType = ${b};
162
162
 
163
163
  namespace Augmented {
164
164
  interface Props {
@@ -197,13 +197,8 @@ declare module '@cronocode/react-box' {
197
197
  }
198
198
  }
199
199
  }
200
- `, d = `import '@cronocode/react-box/components/baseSvg';
201
200
 
202
201
  declare module '@cronocode/react-box/components/baseSvg' {
203
- type ColorType = ${l};
204
- type BackgroundType = ${t};
205
- type ShadowType = ${_};
206
-
207
202
  namespace Augmented {
208
203
  interface Props {
209
204
  fill?: ColorType;
@@ -219,12 +214,11 @@ declare module '@cronocode/react-box/components/baseSvg' {
219
214
  }
220
215
  `;
221
216
  return {
222
- themeCss: [$, ...s, ...h, ...b].join(`
217
+ themeCss: [c, ...n, ...i, ...$].join(`
223
218
  `),
224
- boxDts: p,
225
- baseSvgDts: d
219
+ boxDts: d
226
220
  };
227
221
  }
228
222
  export {
229
- C as boxTheme
223
+ p as boxTheme
230
224
  };