@plumeria/core 0.11.0 → 0.11.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/README.md CHANGED
@@ -47,7 +47,7 @@ const styles = css.create({
47
47
  },
48
48
  });
49
49
 
50
- const classNameString = css.props(styles.text, styles.box);
50
+ const className = css.props(styles.text, styles.box);
51
51
  ```
52
52
 
53
53
  Use `css.props()` to convert a style object into a string with a hashed key.
@@ -220,6 +220,7 @@ Use [@plumeria/eslint-plugin](https://www.npmjs.com/package/@plumeria/eslint-plu
220
220
  ### Rules: recommended
221
221
 
222
222
  ```
223
+ - no-destructure: error
223
224
  - no-inner-call: error
224
225
  - no-unused-keys: warn
225
226
  - sort-properties: warn
package/dist/index.d.ts CHANGED
@@ -1,14 +1,17 @@
1
- import { CSSHTML, CSSProperties, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues, Join, ReturnRx, ReturnType, ReturnVariableType, RxVariableSet } from "zss-engine";
1
+ import { CSSHTML, CSSProperties, CSSProperties as CSSProperties$1, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues, Join, ReturnRx, ReturnType, ReturnVariableType, RxVariableSet } from "zss-engine";
2
2
  import { ps } from "zss-utils";
3
3
 
4
- //#region src/css.d.ts
5
- declare const rx: (cssProperties: Readonly<CSSProperties>, varSet: RxVariableSet) => {
4
+ //#region src/main/utilities.d.ts
5
+ declare const px: <T extends readonly string[]>(...pseudos: T) => Join<T>;
6
+ declare const rx: (cssProperties: Readonly<CSSProperties$1>, varSet: RxVariableSet) => {
6
7
  className: string;
7
8
  style: {
8
9
  [k: string]: string;
9
10
  };
10
11
  };
11
- declare const px: <T extends readonly string[]>(...pseudos: T) => Join<T>;
12
+
13
+ //#endregion
14
+ //#region src/css.d.ts
12
15
  declare class css {
13
16
  private constructor();
14
17
  static create<const T extends Record<string, CSSProperties>>(object: CreateStyleType<T>): ReturnType<T>;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ const require_css = require('./css.js');
3
3
  const zss_engine = require_css.__toESM(require("zss-engine"));
4
4
  const zss_utils = require_css.__toESM(require("zss-utils"));
5
5
 
6
- //#region src/css.ts
6
+ //#region src/main/create.ts
7
7
  const objectToKeyHashMap = new WeakMap();
8
8
  function create(object) {
9
9
  const base36Hash = (0, zss_engine.genBase36Hash)(object, 6);
@@ -22,6 +22,21 @@ function create(object) {
22
22
  });
23
23
  return Object.freeze(object);
24
24
  }
25
+ var create_default = create;
26
+
27
+ //#endregion
28
+ //#region src/main/global.ts
29
+ function global(object) {
30
+ const base36Hash = (0, zss_engine.genBase36Hash)(object, 8);
31
+ const { styleSheet } = (0, zss_engine.transpiler)(object, void 0, "--global");
32
+ if (typeof require_css.globalPromise_2 === "undefined") require_css.initPromise_2();
33
+ require_css.resolvePromise_2(styleSheet);
34
+ if (zss_engine.isTestingDevelopment) zss_engine.isServer ? (0, zss_engine.injectServerCSS)(base36Hash, styleSheet) : (0, zss_engine.injectClientGlobalCSS)(styleSheet);
35
+ }
36
+ var global_default = global;
37
+
38
+ //#endregion
39
+ //#region src/main/props.ts
25
40
  const props = (...objects) => {
26
41
  const classNames = objects.filter(Boolean).map((obj) => {
27
42
  if (obj && typeof obj === "object") {
@@ -32,28 +47,29 @@ const props = (...objects) => {
32
47
  });
33
48
  return [...new Set(classNames)].join(" ");
34
49
  };
35
- const rx = (cssProperties, varSet) => ({
36
- className: props(cssProperties),
37
- style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
38
- });
50
+ var props_default = props;
51
+
52
+ //#endregion
53
+ //#region src/main/utilities.ts
39
54
  const px = (...pseudos) => {
40
55
  return pseudos.filter(Boolean).join("");
41
56
  };
42
- function global(object) {
43
- const base36Hash = (0, zss_engine.genBase36Hash)(object, 8);
44
- const { styleSheet } = (0, zss_engine.transpiler)(object, void 0, "--global");
45
- if (typeof require_css.globalPromise_2 === "undefined") require_css.initPromise_2();
46
- require_css.resolvePromise_2(styleSheet);
47
- if (zss_engine.isTestingDevelopment) zss_engine.isServer ? (0, zss_engine.injectServerCSS)(base36Hash, styleSheet) : (0, zss_engine.injectClientGlobalCSS)(styleSheet);
48
- }
57
+ const rx = (cssProperties, varSet) => ({
58
+ className: props_default(cssProperties),
59
+ style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
60
+ });
61
+
62
+ //#endregion
63
+ //#region src/define/keyframes.ts
49
64
  const keyframes = (object) => {
50
65
  const prefix = (0, zss_engine.genBase36Hash)(object, 8);
51
- global({ [`@keyframes ${prefix}`]: object });
66
+ global_default({ [`@keyframes ${prefix}`]: object });
52
67
  return prefix;
53
68
  };
54
- const defineConsts = (constants) => {
55
- return constants;
56
- };
69
+ var keyframes_default = keyframes;
70
+
71
+ //#endregion
72
+ //#region src/define/vars.ts
57
73
  const defineVars = (object) => {
58
74
  const styles = { ":root": {} };
59
75
  const result = {};
@@ -62,9 +78,13 @@ const defineVars = (object) => {
62
78
  result[key] = `var(--${kebabKey})`;
63
79
  styles[":root"][`--${key}`] = value;
64
80
  });
65
- global(styles);
81
+ global_default(styles);
66
82
  return result;
67
83
  };
84
+ var vars_default = defineVars;
85
+
86
+ //#endregion
87
+ //#region src/define/theme.ts
68
88
  const defineTheme = (object) => {
69
89
  const styles = {};
70
90
  const result = {};
@@ -83,31 +103,42 @@ const defineTheme = (object) => {
83
103
  }
84
104
  });
85
105
  });
86
- global(styles);
106
+ global_default(styles);
87
107
  return result;
88
108
  };
109
+ var theme_default = defineTheme;
110
+
111
+ //#endregion
112
+ //#region src/define/consts.ts
113
+ const defineConsts = (constants) => {
114
+ return constants;
115
+ };
116
+ var consts_default = defineConsts;
117
+
118
+ //#endregion
119
+ //#region src/css.ts
89
120
  var css = class {
90
121
  constructor() {}
91
122
  static create(object) {
92
- return create(object);
123
+ return create_default(object);
93
124
  }
94
125
  static global(object) {
95
- return global(object);
126
+ return global_default(object);
96
127
  }
97
128
  static keyframes(object) {
98
- return keyframes(object);
129
+ return keyframes_default(object);
99
130
  }
100
131
  static defineConsts(object) {
101
- return defineConsts(object);
132
+ return consts_default(object);
102
133
  }
103
134
  static defineVars(object) {
104
- return defineVars(object);
135
+ return vars_default(object);
105
136
  }
106
137
  static defineTheme(object) {
107
- return defineTheme(object);
138
+ return theme_default(object);
108
139
  }
109
140
  static props(...objects) {
110
- return props(...objects);
141
+ return props_default(...objects);
111
142
  }
112
143
  static rx(cssProperties, varSet) {
113
144
  return rx(cssProperties, varSet);
@@ -119,9 +150,10 @@ var css = class {
119
150
  static container = zss_utils.container;
120
151
  static color = zss_utils.color;
121
152
  };
153
+ var css_default = css;
122
154
 
123
155
  //#endregion
124
- exports.css = css;
156
+ exports.css = css_default;
125
157
  exports.ps = zss_utils.ps;
126
158
  exports.px = px;
127
159
  exports.rx = rx;
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolve
2
2
  import { camelToKebabCase, genBase36Hash, injectClientCSS, injectClientGlobalCSS, injectServerCSS, isServer, isTestingDevelopment, transpiler } from "zss-engine";
3
3
  import { color, container, media, ps } from "zss-utils";
4
4
 
5
- //#region src/css.ts
5
+ //#region src/main/create.ts
6
6
  const objectToKeyHashMap = new WeakMap();
7
7
  function create(object) {
8
8
  const base36Hash = genBase36Hash(object, 6);
@@ -21,6 +21,21 @@ function create(object) {
21
21
  });
22
22
  return Object.freeze(object);
23
23
  }
24
+ var create_default = create;
25
+
26
+ //#endregion
27
+ //#region src/main/global.ts
28
+ function global(object) {
29
+ const base36Hash = genBase36Hash(object, 8);
30
+ const { styleSheet } = transpiler(object, void 0, "--global");
31
+ if (typeof globalPromise_2 === "undefined") initPromise_2();
32
+ resolvePromise_2(styleSheet);
33
+ if (isTestingDevelopment) isServer ? injectServerCSS(base36Hash, styleSheet) : injectClientGlobalCSS(styleSheet);
34
+ }
35
+ var global_default = global;
36
+
37
+ //#endregion
38
+ //#region src/main/props.ts
24
39
  const props = (...objects) => {
25
40
  const classNames = objects.filter(Boolean).map((obj) => {
26
41
  if (obj && typeof obj === "object") {
@@ -31,28 +46,29 @@ const props = (...objects) => {
31
46
  });
32
47
  return [...new Set(classNames)].join(" ");
33
48
  };
34
- const rx = (cssProperties, varSet) => ({
35
- className: props(cssProperties),
36
- style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
37
- });
49
+ var props_default = props;
50
+
51
+ //#endregion
52
+ //#region src/main/utilities.ts
38
53
  const px = (...pseudos) => {
39
54
  return pseudos.filter(Boolean).join("");
40
55
  };
41
- function global(object) {
42
- const base36Hash = genBase36Hash(object, 8);
43
- const { styleSheet } = transpiler(object, void 0, "--global");
44
- if (typeof globalPromise_2 === "undefined") initPromise_2();
45
- resolvePromise_2(styleSheet);
46
- if (isTestingDevelopment) isServer ? injectServerCSS(base36Hash, styleSheet) : injectClientGlobalCSS(styleSheet);
47
- }
56
+ const rx = (cssProperties, varSet) => ({
57
+ className: props_default(cssProperties),
58
+ style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
59
+ });
60
+
61
+ //#endregion
62
+ //#region src/define/keyframes.ts
48
63
  const keyframes = (object) => {
49
64
  const prefix = genBase36Hash(object, 8);
50
- global({ [`@keyframes ${prefix}`]: object });
65
+ global_default({ [`@keyframes ${prefix}`]: object });
51
66
  return prefix;
52
67
  };
53
- const defineConsts = (constants) => {
54
- return constants;
55
- };
68
+ var keyframes_default = keyframes;
69
+
70
+ //#endregion
71
+ //#region src/define/vars.ts
56
72
  const defineVars = (object) => {
57
73
  const styles = { ":root": {} };
58
74
  const result = {};
@@ -61,9 +77,13 @@ const defineVars = (object) => {
61
77
  result[key] = `var(--${kebabKey})`;
62
78
  styles[":root"][`--${key}`] = value;
63
79
  });
64
- global(styles);
80
+ global_default(styles);
65
81
  return result;
66
82
  };
83
+ var vars_default = defineVars;
84
+
85
+ //#endregion
86
+ //#region src/define/theme.ts
67
87
  const defineTheme = (object) => {
68
88
  const styles = {};
69
89
  const result = {};
@@ -82,31 +102,42 @@ const defineTheme = (object) => {
82
102
  }
83
103
  });
84
104
  });
85
- global(styles);
105
+ global_default(styles);
86
106
  return result;
87
107
  };
108
+ var theme_default = defineTheme;
109
+
110
+ //#endregion
111
+ //#region src/define/consts.ts
112
+ const defineConsts = (constants) => {
113
+ return constants;
114
+ };
115
+ var consts_default = defineConsts;
116
+
117
+ //#endregion
118
+ //#region src/css.ts
88
119
  var css = class {
89
120
  constructor() {}
90
121
  static create(object) {
91
- return create(object);
122
+ return create_default(object);
92
123
  }
93
124
  static global(object) {
94
- return global(object);
125
+ return global_default(object);
95
126
  }
96
127
  static keyframes(object) {
97
- return keyframes(object);
128
+ return keyframes_default(object);
98
129
  }
99
130
  static defineConsts(object) {
100
- return defineConsts(object);
131
+ return consts_default(object);
101
132
  }
102
133
  static defineVars(object) {
103
- return defineVars(object);
134
+ return vars_default(object);
104
135
  }
105
136
  static defineTheme(object) {
106
- return defineTheme(object);
137
+ return theme_default(object);
107
138
  }
108
139
  static props(...objects) {
109
- return props(...objects);
140
+ return props_default(...objects);
110
141
  }
111
142
  static rx(cssProperties, varSet) {
112
143
  return rx(cssProperties, varSet);
@@ -118,6 +149,7 @@ var css = class {
118
149
  static container = container;
119
150
  static color = color;
120
151
  };
152
+ var css_default = css;
121
153
 
122
154
  //#endregion
123
- export { css, ps, px, rx };
155
+ export { css_default as css, ps, px, rx };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Zero-runtime, expressive CSS-in-JS library for TypeScript.",
5
5
  "keywords": [
6
6
  "css",