@cronocode/react-box 1.3.9 → 1.4.1
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/baseSvg.module.css.cjs.js +1 -0
- package/baseSvg.module.css.es.js +4 -0
- package/box.cjs.js +1 -0
- package/{box.mjs → box.es.js} +3 -3
- package/box.module.css.cjs.js +1 -0
- package/box.module.css.es.js +4 -0
- package/components/baseSvg.cjs.js +1 -0
- package/components/baseSvg.d.ts +6 -9
- package/components/{baseSvg.mjs → baseSvg.es.js} +2 -2
- package/components/button.cjs.js +1 -0
- package/components/{button.mjs → button.es.js} +4 -4
- package/components/checkbox.cjs.js +1 -0
- package/components/{checkbox.mjs → checkbox.es.js} +5 -5
- package/components/dataGrid.cjs.js +1 -0
- package/components/{dataGrid.mjs → dataGrid.es.js} +4 -4
- package/components/flex.cjs.js +1 -0
- package/components/{flex.mjs → flex.es.js} +4 -4
- package/components/form.cjs.js +1 -0
- package/components/{form.mjs → form.es.js} +4 -4
- package/components/radioButton.cjs.js +1 -0
- package/components/{radioButton.mjs → radioButton.es.js} +4 -4
- package/components/textarea.cjs.js +1 -0
- package/components/{textarea.mjs → textarea.es.js} +4 -4
- package/components/textbox.cjs.js +1 -0
- package/components/{textbox.mjs → textbox.es.js} +4 -4
- package/components/tooltip.cjs.js +1 -0
- package/components/{tooltip.mjs → tooltip.es.js} +4 -4
- package/package.json +15 -10
- package/plugins.cjs.js +220 -0
- package/plugins.d.ts +11 -0
- package/plugins.es.js +231 -0
- package/style.css +1 -1
- package/theme.cjs.js +1 -0
- package/types.d.ts +6 -2
- package/utils/utils.cjs.js +1 -0
- package/baseSvg.module.css.mjs +0 -4
- package/box.module.css.mjs +0 -4
- package/plugins/box-theme.ts +0 -250
- /package/{theme.mjs → theme.es.js} +0 -0
- /package/utils/{utils.mjs → utils.es.js} +0 -0
|
@@ -0,0 +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;
|
package/components/baseSvg.d.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SvgStyles } from '../types';
|
|
3
3
|
import ClassNameUtils from '../utils/className/classNameUtils';
|
|
4
|
-
interface SvgNormalStyles {
|
|
5
|
-
fill?: ColorType | string;
|
|
6
|
-
stroke?: ColorType | string;
|
|
7
|
-
rotate?: 0 | 90 | 180 | 270;
|
|
8
|
-
flip?: 'xAxis' | 'yAxis';
|
|
9
|
-
}
|
|
10
|
-
export type SvgStyles = SvgNormalStyles & Hovered<SvgNormalStyles> & Focused<SvgNormalStyles> & Activated<SvgNormalStyles>;
|
|
11
4
|
type AllSvgProps = React.SVGProps<SVGElement>;
|
|
12
5
|
type SvgPropsType = Omit<AllSvgProps, 'className' | 'style' | 'width' | 'height'>;
|
|
13
6
|
type SvgStyleType = Omit<React.CSSProperties, 'width' | 'height'>;
|
|
14
|
-
|
|
7
|
+
export declare namespace Augmented {
|
|
8
|
+
interface Props {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
interface Props extends SvgStyles, Augmented.Props {
|
|
15
12
|
children?: React.ReactNode | ((props: {
|
|
16
13
|
isHover: boolean;
|
|
17
14
|
}) => React.ReactNode);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import d, { useState as N } from "react";
|
|
2
|
-
import { C as x, t as m } from "../utils/utils.
|
|
3
|
-
import { c as a } from "../baseSvg.module.css.
|
|
2
|
+
import { C as x, t as m } from "../utils/utils.es.js";
|
|
3
|
+
import { c as a } from "../baseSvg.module.css.es.js";
|
|
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]) => {
|
|
@@ -0,0 +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,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.
|
|
4
|
-
import { O as m } from "../utils/utils.
|
|
5
|
-
import "../box.module.css.
|
|
6
|
-
import "../theme.
|
|
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";
|
|
7
7
|
const s = ["type", "onClick", "disabled"];
|
|
8
8
|
function e(o, t) {
|
|
9
9
|
const r = m.buildProps(o, s);
|
|
@@ -0,0 +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,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.
|
|
4
|
-
import { O as a } from "../utils/utils.
|
|
5
|
-
import l from "./flex.
|
|
6
|
-
import { c as d } from "../box.module.css.
|
|
7
|
-
import "../theme.
|
|
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";
|
|
8
8
|
const p = [
|
|
9
9
|
"name",
|
|
10
10
|
"onInput",
|
|
@@ -0,0 +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,9 +1,9 @@
|
|
|
1
1
|
import { jsx as s, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import t from "../box.
|
|
2
|
+
import t from "../box.es.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import "../box.module.css.
|
|
5
|
-
import "../utils/utils.
|
|
6
|
-
import "../theme.
|
|
4
|
+
import "../box.module.css.es.js";
|
|
5
|
+
import "../utils/utils.es.js";
|
|
6
|
+
import "../theme.es.js";
|
|
7
7
|
function p(i) {
|
|
8
8
|
if (!(i != null && i.length))
|
|
9
9
|
return {
|
|
@@ -0,0 +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,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.
|
|
4
|
-
import "../box.module.css.
|
|
5
|
-
import "../utils/utils.
|
|
6
|
-
import "../theme.
|
|
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";
|
|
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 });
|
|
@@ -0,0 +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,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.
|
|
4
|
-
import { F as c } from "../utils/utils.
|
|
5
|
-
import "../box.module.css.
|
|
6
|
-
import "../theme.
|
|
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";
|
|
7
7
|
function d(o) {
|
|
8
8
|
const { onSubmit: m, props: n } = o, r = p(null), e = u((t) => {
|
|
9
9
|
t.preventDefault();
|
|
@@ -0,0 +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,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.
|
|
4
|
-
import { O as i } from "../utils/utils.
|
|
5
|
-
import "../box.module.css.
|
|
6
|
-
import "../theme.
|
|
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";
|
|
7
7
|
const d = [
|
|
8
8
|
"name",
|
|
9
9
|
"onInput",
|
|
@@ -0,0 +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,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.
|
|
4
|
-
import { O as m } from "../utils/utils.
|
|
5
|
-
import "../box.module.css.
|
|
6
|
-
import "../theme.
|
|
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";
|
|
7
7
|
const s = [
|
|
8
8
|
"name",
|
|
9
9
|
"onInput",
|
|
@@ -0,0 +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,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.
|
|
4
|
-
import { O as p } from "../utils/utils.
|
|
5
|
-
import "../box.module.css.
|
|
6
|
-
import "../theme.
|
|
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";
|
|
7
7
|
const i = [
|
|
8
8
|
"name",
|
|
9
9
|
"onInput",
|
|
@@ -0,0 +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,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.
|
|
3
|
+
import f from "../box.es.js";
|
|
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.
|
|
6
|
-
import "../box.module.css.
|
|
7
|
-
import "../theme.
|
|
5
|
+
import { u as C } from "../utils/utils.es.js";
|
|
6
|
+
import "../box.module.css.es.js";
|
|
7
|
+
import "../theme.es.js";
|
|
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,25 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronocode/react-box",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"main": "./box.
|
|
5
|
-
"module": "./box.mjs",
|
|
3
|
+
"version": "1.4.1",
|
|
4
|
+
"main": "./box.cjs.js",
|
|
5
|
+
"module": "./box.mjs.js",
|
|
6
6
|
"types": "./box.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./box.mjs",
|
|
10
|
-
"require": "./box.
|
|
9
|
+
"import": "./box.mjs.js",
|
|
10
|
+
"require": "./box.cjs.js",
|
|
11
11
|
"types": "./box.d.ts"
|
|
12
12
|
},
|
|
13
13
|
"./style.css": "./style.css",
|
|
14
14
|
"./theme": {
|
|
15
|
-
"import": "./theme.mjs",
|
|
16
|
-
"require": "./theme.
|
|
15
|
+
"import": "./theme.mjs.js",
|
|
16
|
+
"require": "./theme.cjs.js",
|
|
17
17
|
"types": "./theme.d.ts"
|
|
18
18
|
},
|
|
19
19
|
"./components/*": {
|
|
20
|
-
"import": "./components/*.mjs",
|
|
21
|
-
"require": "./components/*.
|
|
20
|
+
"import": "./components/*.mjs.js",
|
|
21
|
+
"require": "./components/*.cjs.js",
|
|
22
22
|
"types": "./components/*.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./plugins": {
|
|
25
|
+
"import": "./plugins.mjs.js",
|
|
26
|
+
"require": "./plugins.cjs.js",
|
|
27
|
+
"types": "./plugins.d.ts"
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
30
|
"scripts": {
|
|
@@ -28,7 +33,7 @@
|
|
|
28
33
|
"preview": "vite preview",
|
|
29
34
|
"build": "vite build",
|
|
30
35
|
"build:dev": "vite build --mode dev",
|
|
31
|
-
"postbuild": "cp package.json dist & cp LICENSE dist &
|
|
36
|
+
"postbuild": "cp package.json dist & cp LICENSE dist & rm ./dist/index.d.ts & rm ./dist/index.js",
|
|
32
37
|
"compile": "tsc --noEmit --skipLibCheck",
|
|
33
38
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
34
39
|
},
|
package/plugins.cjs.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(r){return{name:"boxTheme",configResolved(y){const n=Object.entries(r.colors).map(([o,e])=>`--color${o}: ${e};`).join(`
|
|
2
|
+
`),_=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
|
+
`),$=`:root {
|
|
5
|
+
${n}
|
|
6
|
+
${_}
|
|
7
|
+
${i}
|
|
8
|
+
}`,h=Object.keys(r.colors).map(o=>`
|
|
9
|
+
.color_${o},
|
|
10
|
+
.color_h_${o}:hover,
|
|
11
|
+
._h:hover>.color_h_${o} {
|
|
12
|
+
color: var(--color${o});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.color_f_${o}:focus-within,
|
|
16
|
+
._f:focus-within>.color_f_${o} {
|
|
17
|
+
color: var(--color${o});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.color_a_${o}:active {
|
|
21
|
+
color: var(--color${o});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.bgColor_${o},
|
|
25
|
+
.bgColor_h_${o}:hover,
|
|
26
|
+
._h:hover>.bgColor_h_${o} {
|
|
27
|
+
background-color: var(--color${o});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bgColor_f_${o}:focus-within,
|
|
31
|
+
._f:focus-within>.bgColor_f_${o} {
|
|
32
|
+
background-color: var(--color${o});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.bgColor_a_${o}:active {
|
|
36
|
+
background-color: var(--color${o});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.borderColor_${o},
|
|
40
|
+
.borderColor_h_${o}:hover,
|
|
41
|
+
._h:hover>.borderColor_h_${o} {
|
|
42
|
+
border-color: var(--color${o});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.borderColor_f_${o}:focus-within,
|
|
46
|
+
._f:focus-within>.borderColor_f_${o} {
|
|
47
|
+
border-color: var(--color${o});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.borderColor_a_${o}:active {
|
|
51
|
+
border-color: var(--color${o});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.outlineColor_${o},
|
|
55
|
+
.outlineColor_h_${o}:hover,
|
|
56
|
+
._h:hover>.outlineColor_h_${o} {
|
|
57
|
+
outline-color: var(--color${o});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.outlineColor_f_${o}:focus-within,
|
|
61
|
+
._f:focus-within>.outlineColor_f_${o} {
|
|
62
|
+
outline-color: var(--color${o});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.outlineColor_a_${o}:active {
|
|
66
|
+
outline-color: var(--color${o});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.fill_${o},
|
|
70
|
+
.fill_h_${o}:hover,
|
|
71
|
+
._h:hover>.fill_h_${o} {
|
|
72
|
+
path,
|
|
73
|
+
circle,
|
|
74
|
+
rect,
|
|
75
|
+
line {
|
|
76
|
+
fill: var(--color${o});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.fill_f_${o}:focus-within,
|
|
81
|
+
._f:focus-within>.fill_f_${o} {
|
|
82
|
+
path,
|
|
83
|
+
circle,
|
|
84
|
+
rect,
|
|
85
|
+
line {
|
|
86
|
+
fill: var(--color${o});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.fill_a_${o}:active {
|
|
91
|
+
path,
|
|
92
|
+
circle,
|
|
93
|
+
rect,
|
|
94
|
+
line {
|
|
95
|
+
fill: var(--color${o});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.stroke_${o},
|
|
100
|
+
.stroke_h_${o}:hover,
|
|
101
|
+
._h:hover>.stroke_h_${o} {
|
|
102
|
+
path,
|
|
103
|
+
circle,
|
|
104
|
+
rect,
|
|
105
|
+
line {
|
|
106
|
+
stroke: var(--color${o});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.stroke_f_${o}:focus-within,
|
|
111
|
+
._f:focus-within>.stroke_f_${o} {
|
|
112
|
+
path,
|
|
113
|
+
circle,
|
|
114
|
+
rect,
|
|
115
|
+
line {
|
|
116
|
+
stroke: var(--color${o});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.stroke_a_${o}:active {
|
|
121
|
+
path,
|
|
122
|
+
circle,
|
|
123
|
+
rect,
|
|
124
|
+
line {
|
|
125
|
+
stroke: var(--color${o});
|
|
126
|
+
}
|
|
127
|
+
}`),s=Object.keys(r.shadows).map(o=>`
|
|
128
|
+
.shadow_${o},
|
|
129
|
+
.shadow_h_${o}:hover,
|
|
130
|
+
._h:hover>.shadow_h_${o} {
|
|
131
|
+
box-shadow: var(--shadow${o});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.shadow_f_${o}:focus-within,
|
|
135
|
+
._f:focus-within>.shadow_f_${o} {
|
|
136
|
+
box-shadow: var(--shadow${o});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.shadow_a_${o}:active {
|
|
140
|
+
box-shadow: var(--shadow${o});
|
|
141
|
+
}`),b=Object.keys(r.backgrounds).map(o=>`
|
|
142
|
+
.bg_${o},
|
|
143
|
+
.bg_h_${o}:hover,
|
|
144
|
+
._h:hover>.bg_h_${o} {
|
|
145
|
+
background: var(--background${o});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.bg_f_${o}:focus-within,
|
|
149
|
+
._f:focus-within>.bg_f_${o} {
|
|
150
|
+
background: var(--background${o});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.bg_a_${o}:active {
|
|
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(" | "),d=`import '@cronocode/react-box';
|
|
156
|
+
|
|
157
|
+
declare module '@cronocode/react-box' {
|
|
158
|
+
type ColorType = ${l};
|
|
159
|
+
type BackgroundType = ${t};
|
|
160
|
+
type ShadowType = ${c};
|
|
161
|
+
|
|
162
|
+
namespace Augmented {
|
|
163
|
+
interface Props {
|
|
164
|
+
color?: ColorType;
|
|
165
|
+
colorH?: ColorType;
|
|
166
|
+
colorF?: ColorType;
|
|
167
|
+
colorA?: ColorType;
|
|
168
|
+
bgColor?: ColorType;
|
|
169
|
+
bgColorH?: ColorType;
|
|
170
|
+
bgColorF?: ColorType;
|
|
171
|
+
bgColorA?: ColorType;
|
|
172
|
+
backgroundColor?: ColorType;
|
|
173
|
+
backgroundColorH?: ColorType;
|
|
174
|
+
backgroundColorF?: ColorType;
|
|
175
|
+
backgroundColorA?: ColorType;
|
|
176
|
+
borderColor?: ColorType;
|
|
177
|
+
borderColorH?: ColorType;
|
|
178
|
+
borderColorF?: ColorType;
|
|
179
|
+
borderColorA?: ColorType;
|
|
180
|
+
outlineColor?: ColorType;
|
|
181
|
+
outlineColorH?: ColorType;
|
|
182
|
+
outlineColorF?: ColorType;
|
|
183
|
+
outlineColorA?: ColorType;
|
|
184
|
+
bg?: BackgroundType;
|
|
185
|
+
bgH?: BackgroundType;
|
|
186
|
+
bgF?: BackgroundType;
|
|
187
|
+
bgA?: BackgroundType;
|
|
188
|
+
background?: BackgroundType;
|
|
189
|
+
backgroundH?: BackgroundType;
|
|
190
|
+
backgroundF?: BackgroundType;
|
|
191
|
+
backgroundA?: BackgroundType;
|
|
192
|
+
shadow?: ShadowType;
|
|
193
|
+
shadowH?: ShadowType;
|
|
194
|
+
shadowF?: ShadowType;
|
|
195
|
+
shadowA?: ShadowType;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
`,p=`import '@cronocode/react-box/components/baseSvg';
|
|
200
|
+
|
|
201
|
+
declare module '@cronocode/react-box/components/baseSvg' {
|
|
202
|
+
type ColorType = ${l};
|
|
203
|
+
type BackgroundType = ${t};
|
|
204
|
+
type ShadowType = ${c};
|
|
205
|
+
|
|
206
|
+
namespace Augmented {
|
|
207
|
+
interface Props {
|
|
208
|
+
fill?: ColorType;
|
|
209
|
+
fillH?: ColorType;
|
|
210
|
+
fillF?: ColorType;
|
|
211
|
+
fillA?: ColorType;
|
|
212
|
+
stroke?: ColorType;
|
|
213
|
+
strokeH?: ColorType;
|
|
214
|
+
strokeF?: ColorType;
|
|
215
|
+
strokeA?: ColorType;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
`;(void 0)(r.cssPath,[$,...h,...s,...b].join(`
|
|
220
|
+
`)),(void 0)(r.boxDtsPath,d),(void 0)(r.baseSvgDtsPath,p)}}}exports.boxTheme=u;
|
package/plugins.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PluginOption } from 'vite';
|
|
2
|
+
interface BoxThemeOptions {
|
|
3
|
+
cssPath: string;
|
|
4
|
+
boxDtsPath: string;
|
|
5
|
+
baseSvgDtsPath: string;
|
|
6
|
+
colors: Record<string, string>;
|
|
7
|
+
shadows: Record<string, string>;
|
|
8
|
+
backgrounds: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare function boxTheme(options: BoxThemeOptions): PluginOption;
|
|
11
|
+
export {};
|