@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
package/theme.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),o={button:{styles:{inline:!0,p:3,cursor:"pointer",b:1,borderRadius:1},disabled:{cursor:"default"}},checkbox:{styles:{inline:!0,b:1,p:2}},radioButton:{styles:{inline:!0,b:1,p:2}},textbox:{styles:{inline:!0,b:1,borderRadius:1,p:3}},textarea:{styles:{inline:!0,b:1,borderRadius:1}}};let n=o;var d;(u=>{function i(t){n=t,r()}u.setup=i;function r(){Object.keys(o).forEach(s=>{const e=n[s],l=o[s];e?(e.styles={...l.styles,...e.styles},e.disabled&&l.disabled&&(e.disabled={...l.disabled,...e.disabled})):n[s]=o[s]})}})(d||(d={}));const f=d;function m(u){const{clean:i,disabled:r,theme:t,component:s}=u;return y.useMemo(()=>{var a,b,c;if(i)return{};let e=n[s]??((a=n.components)==null?void 0:a[s]);if(!e)return{};let l=t?{...e.styles,...(b=e.themes)==null?void 0:b[t].styles}:e.styles;return r?t?{...l,...e.disabled,...(c=e.themes)==null?void 0:c[t].disabled}:{...l,...e.disabled}:l},[s,i,r,t])}exports.default=f;exports.useTheme=m;
|
package/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SvgStyles } from './components/baseSvg/baseSvg';
|
|
2
1
|
export type Hovered<T> = {
|
|
3
2
|
[K in keyof T as K extends string ? `${K}H` : never]: T[K];
|
|
4
3
|
};
|
|
@@ -217,5 +216,10 @@ interface BoxPointerEvents {
|
|
|
217
216
|
type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline & BoxTransition & BoxUserSelect & BoxAppearance & BoxPointerEvents;
|
|
218
217
|
export type BoxStyles = BoxNormalStyles & Hovered<BoxNormalStyles> & Focused<BoxNormalStyles> & Activated<BoxNormalStyles>;
|
|
219
218
|
export declare const themeClasses: Partial<Record<string, string>>;
|
|
220
|
-
|
|
219
|
+
interface SvgNormalStyles {
|
|
220
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
221
|
+
flip?: 'xAxis' | 'yAxis';
|
|
222
|
+
}
|
|
223
|
+
export type SvgStyles = SvgNormalStyles & Hovered<SvgNormalStyles> & Focused<SvgNormalStyles> & Activated<SvgNormalStyles>;
|
|
224
|
+
export declare const themeSvgClasses: Partial<Record<string, string>>;
|
|
221
225
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("react"),C={hover:"_h",focus:"_f",shadow:"shadow_",shadowH:"shadow_h_",shadowF:"shadow_f_",shadowA:"shadow_a_",background:"bg_",backgroundH:"bg_h_",backgroundF:"bg_f_",backgroundA:"bg_a_",bg:"bg_",bgH:"bg_h_",bgF:"bg_f_",bgA:"bg_a_",color:"color_",colorH:"color_h_",colorF:"color_f_",colorA:"color_a_",backgroundColor:"bgColor_",backgroundColorH:"bgColor_h_",backgroundColorF:"bgColor_f_",backgroundColorA:"bgColor_a_",bgColor:"bgColor_",bgColorH:"bgColor_h_",bgColorF:"bgColor_f_",bgColorA:"bgColor_a_",borderColor:"borderColor_",borderColorH:"borderColor_h_",borderColorF:"borderColor_f_",borderColorA:"borderColor_a_",outlineColor:"outlineColor_",outlineColorH:"outlineColor_h_",outlineColorF:"outlineColor_f_",outlineColorA:"outlineColor_a_"},p={fill:"fill_",fillH:"fill_h_",fillF:"fill_f_",fillA:"fill_a_",stroke:"stroke_",strokeH:"stroke_h_",strokeF:"stroke_f_",strokeA:"stroke_a_"};var b;(i=>{function n(...u){return u.reduce((l,s)=>s?typeof s=="string"?(l.push(s),l):Array.isArray(s)?(l.push(...n(...s)),l):(Object.entries(s).forEach(([r,e])=>{e&&l.push(r)}),l):l,[])}i.classNames=n})(b||(b={}));const F=b;var f;(i=>{function n(l,...s){const r={...l},e={};return s.forEach(o=>{o in r&&(e[o]=r[o],delete r[o])}),[e,r]}i.moveToTagProps=n;function u(l,s,r){const e={...l},o=e.props||{};return s.forEach(t=>{if(t in e){if(o[t]=e[t],t==="disabled")return;delete e[t]}}),r&&Object.entries(r).forEach(([t,c])=>{o[t]=c}),e.props=o,e}i.buildProps=u})(f||(f={}));const m=f;var g;(i=>{function n(l){const s=Array.from(l.elements).reduce((r,e)=>{const o=e.name;return o&&(r[o]||(r[o]=[]),r[o].push(e)),r},{});return Object.entries(s).reduce((r,[e,o])=>{if(o.length===1){const t=o[0];u(r,e,t.type==="checkbox"||t.type==="radio"?t.checked:t.value)}else{const t=o.reduce((c,_)=>(_.type==="checkbox"||_.type==="radio"?_.checked&&c.push(_.value):c.push(_.value),c),[]);u(r,e,t)}return r},{})}i.getFormEntries=n;function u(l,s,r){if(s.includes(".")){const e=s.split(".");let o=l;e.forEach((t,c)=>{if(e.length>c+1){const _=t.match(/^(.+)\[(\d)\]$/);if(_){const[,a,d]=_;o[a]=o[a]||[],o[a][d]=o[a][d]||{},o=o[a][d]}else o[t]=o[t]||{},o=o[t]}else o[t]=r})}else l[s]=r}})(g||(g={}));const k=g;function A(){return h.useMemo(()=>{const i="crono-box";let n=document.getElementById(i);return n||(n=document.createElement("div"),n.id=i,document.body.appendChild(n)),n},[])}exports.ClassNameUtils=F;exports.FormUtils=k;exports.ObjectUtils=m;exports.themeClasses=C;exports.themeSvgClasses=p;exports.usePortalContainer=A;
|
package/baseSvg.module.css.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const t = { base: "a", rotate0: "b", rotateH0: "c", hovertrue: "_h", rotate90: "d", rotateH90: "e", rotate180: "f", rotateH180: "g", rotate270: "h", rotateH270: "i", flipxAxis: "j", flipHxAxis: "k", flipyAxis: "l", flipHyAxis: "m", rotateF0: "n", focustrue: "_f", rotateF90: "o", rotateF180: "p", rotateF270: "q", flipFxAxis: "r", flipFyAxis: "s", rotateA0: "t", rotateA90: "u", rotateA180: "v", rotateA270: "w", flipAxAxis: "x", flipAyAxis: "y" };
|
|
2
|
-
export {
|
|
3
|
-
t as c
|
|
4
|
-
};
|