@cronocode/react-box 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "main": "./box.cjs.js",
5
- "module": "./box.mjs.js",
5
+ "module": "./box.es.js",
6
6
  "types": "./box.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
- "import": "./box.mjs.js",
9
+ "import": "./box.es.js",
10
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.js",
15
+ "import": "./theme.es.js",
16
16
  "require": "./theme.cjs.js",
17
17
  "types": "./theme.d.ts"
18
18
  },
19
19
  "./components/*": {
20
- "import": "./components/*.mjs.js",
20
+ "import": "./components/*.es.js",
21
21
  "require": "./components/*.cjs.js",
22
22
  "types": "./components/*.d.ts"
23
23
  },
24
24
  "./plugins": {
25
- "import": "./plugins.mjs.js",
25
+ "import": "./plugins.es.js",
26
26
  "require": "./plugins.cjs.js",
27
27
  "types": "./plugins.d.ts"
28
28
  }
package/plugins.cjs.js CHANGED
@@ -1,11 +1,11 @@
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(`
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
3
  `),i=Object.entries(r.backgrounds).map(([o,e])=>`--background${o}: ${e};`).join(`
4
- `),$=`:root {
5
- ${n}
4
+ `),s=`:root {
6
5
  ${_}
6
+ ${n}
7
7
  ${i}
8
- }`,h=Object.keys(r.colors).map(o=>`
8
+ }`,$=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
- }`),s=Object.keys(r.shadows).map(o=>`
127
+ }`),h=Object.keys(r.shadows).map(o=>`
128
128
  .shadow_${o},
129
129
  .shadow_h_${o}:hover,
130
130
  ._h:hover>.shadow_h_${o} {
@@ -152,7 +152,7 @@
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(" | "),d=`import '@cronocode/react-box';
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';
156
156
 
157
157
  declare module '@cronocode/react-box' {
158
158
  type ColorType = ${l};
@@ -196,7 +196,7 @@ declare module '@cronocode/react-box' {
196
196
  }
197
197
  }
198
198
  }
199
- `,p=`import '@cronocode/react-box/components/baseSvg';
199
+ `,d=`import '@cronocode/react-box/components/baseSvg';
200
200
 
201
201
  declare module '@cronocode/react-box/components/baseSvg' {
202
202
  type ColorType = ${l};
@@ -216,5 +216,5 @@ declare module '@cronocode/react-box/components/baseSvg' {
216
216
  }
217
217
  }
218
218
  }
219
- `;(void 0)(r.cssPath,[$,...h,...s,...b].join(`
220
- `)),(void 0)(r.boxDtsPath,d),(void 0)(r.baseSvgDtsPath,p)}}}exports.boxTheme=u;
219
+ `;return{themeCss:[s,...$,...h,...b].join(`
220
+ `),boxDts:p,baseSvgDts:d}}exports.boxTheme=u;
package/plugins.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { PluginOption } from 'vite';
2
1
  interface BoxThemeOptions {
3
- cssPath: string;
4
- boxDtsPath: string;
5
- baseSvgDtsPath: string;
6
2
  colors: Record<string, string>;
7
3
  shadows: Record<string, string>;
8
4
  backgrounds: Record<string, string>;
9
5
  }
10
- export declare function boxTheme(options: BoxThemeOptions): PluginOption;
6
+ interface BoxThemeResources {
7
+ themeCss: string;
8
+ boxDts: string;
9
+ baseSvgDts: string;
10
+ }
11
+ export declare function boxTheme(options: BoxThemeOptions): BoxThemeResources;
11
12
  export {};
package/plugins.es.js CHANGED
@@ -1,15 +1,12 @@
1
1
  function C(r) {
2
- return {
3
- name: "boxTheme",
4
- configResolved(u) {
5
- const t = Object.entries(r.colors).map(([o, e]) => `--color${o}: ${e};`).join(`
6
- `), _ = Object.entries(r.shadows).map(([o, e]) => `--shadow${o}: ${e};`).join(`
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(`
7
4
  `), i = Object.entries(r.backgrounds).map(([o, e]) => `--background${o}: ${e};`).join(`
8
5
  `), $ = `:root {
9
- ${t}
10
- ${_}
6
+ ${c}
7
+ ${n}
11
8
  ${i}
12
- }`, h = Object.keys(r.colors).map((o) => `
9
+ }`, s = Object.keys(r.colors).map((o) => `
13
10
  .color_${o},
14
11
  .color_h_${o}:hover,
15
12
  ._h:hover>.color_h_${o} {
@@ -128,7 +125,7 @@ function C(r) {
128
125
  line {
129
126
  stroke: var(--color${o});
130
127
  }
131
- }`), s = Object.keys(r.shadows).map((o) => `
128
+ }`), h = Object.keys(r.shadows).map((o) => `
132
129
  .shadow_${o},
133
130
  .shadow_h_${o}:hover,
134
131
  ._h:hover>.shadow_h_${o} {
@@ -156,12 +153,12 @@ function C(r) {
156
153
 
157
154
  .bg_a_${o}:active {
158
155
  background: var(--background${o});
159
- }`), l = Object.keys(r.colors).map((o) => `'${o}'`).join(" | "), c = Object.keys(r.backgrounds).map((o) => `'${o}'`).join(" | "), n = Object.keys(r.shadows).map((o) => `'${o}'`).join(" | "), d = `import '@cronocode/react-box';
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';
160
157
 
161
158
  declare module '@cronocode/react-box' {
162
159
  type ColorType = ${l};
163
- type BackgroundType = ${c};
164
- type ShadowType = ${n};
160
+ type BackgroundType = ${t};
161
+ type ShadowType = ${_};
165
162
 
166
163
  namespace Augmented {
167
164
  interface Props {
@@ -200,12 +197,12 @@ declare module '@cronocode/react-box' {
200
197
  }
201
198
  }
202
199
  }
203
- `, p = `import '@cronocode/react-box/components/baseSvg';
200
+ `, d = `import '@cronocode/react-box/components/baseSvg';
204
201
 
205
202
  declare module '@cronocode/react-box/components/baseSvg' {
206
203
  type ColorType = ${l};
207
- type BackgroundType = ${c};
208
- type ShadowType = ${n};
204
+ type BackgroundType = ${t};
205
+ type ShadowType = ${_};
209
206
 
210
207
  namespace Augmented {
211
208
  interface Props {
@@ -221,9 +218,11 @@ declare module '@cronocode/react-box/components/baseSvg' {
221
218
  }
222
219
  }
223
220
  `;
224
- (void 0)(r.cssPath, [$, ...h, ...s, ...b].join(`
225
- `)), (void 0)(r.boxDtsPath, d), (void 0)(r.baseSvgDtsPath, p);
226
- }
221
+ return {
222
+ themeCss: [$, ...s, ...h, ...b].join(`
223
+ `),
224
+ boxDts: p,
225
+ baseSvgDts: d
227
226
  };
228
227
  }
229
228
  export {