@plumeria/core 0.6.9 → 0.7.0

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/dist/css.js CHANGED
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cx = exports.css = void 0;
3
+ exports.rx = exports.cx = exports.css = void 0;
4
4
  const create_1 = require("./method/create");
5
5
  const global_1 = require("./method/global");
6
- const cx_1 = require("./cx");
7
- Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return cx_1.cx; } });
8
6
  const define_theme_vars_1 = require("./method/define-theme-vars");
9
7
  const keyframes_1 = require("./method/keyframes");
10
8
  const collection_1 = require("@plumeria/collection");
9
+ const cx_1 = require("./cx");
10
+ Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return cx_1.cx; } });
11
+ const rx_1 = require("./rx");
12
+ Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return rx_1.rx; } });
11
13
  class css {
12
14
  static create(object) {
13
15
  return (0, create_1.create)(object);
package/dist/css.mjs CHANGED
@@ -1,9 +1,10 @@
1
1
  import { create } from './method/create';
2
2
  import { global } from './method/global';
3
- import { cx } from './cx';
4
3
  import { defineThemeVars } from './method/define-theme-vars';
5
4
  import { keyframes } from './method/keyframes';
6
5
  import { media, pseudo, colors, container } from '@plumeria/collection';
6
+ import { cx } from './cx';
7
+ import { rx } from './rx';
7
8
  class css {
8
9
  static create(object) {
9
10
  return create(object);
@@ -22,4 +23,4 @@ class css {
22
23
  static colors = colors;
23
24
  static container = container;
24
25
  }
25
- export { css, cx };
26
+ export { css, cx, rx };
package/dist/cx.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cx = cx;
4
- function cx(...strings) {
3
+ exports.cx = void 0;
4
+ const cx = (...strings) => {
5
5
  let result = '';
6
6
  let isFirst = true;
7
7
  strings.filter(Boolean).forEach((str) => {
@@ -19,4 +19,5 @@ function cx(...strings) {
19
19
  }
20
20
  });
21
21
  return result;
22
- }
22
+ };
23
+ exports.cx = cx;
package/dist/cx.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export function cx(...strings) {
1
+ export const cx = (...strings) => {
2
2
  let result = '';
3
3
  let isFirst = true;
4
4
  strings.filter(Boolean).forEach((str) => {
@@ -16,4 +16,4 @@ export function cx(...strings) {
16
16
  }
17
17
  });
18
18
  return result;
19
- }
19
+ };
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cx = exports.css = void 0;
3
+ exports.rx = exports.cx = exports.css = void 0;
4
4
  var css_1 = require("./css");
5
5
  Object.defineProperty(exports, "css", { enumerable: true, get: function () { return css_1.css; } });
6
6
  Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return css_1.cx; } });
7
+ Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return css_1.rx; } });
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { css, cx } from './css';
1
+ export { css, cx, rx } from './css';
package/dist/rx.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rx = void 0;
4
+ const rx = (className, varSet) => ({
5
+ className,
6
+ style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value])),
7
+ });
8
+ exports.rx = rx;
package/dist/rx.mjs ADDED
@@ -0,0 +1,4 @@
1
+ export const rx = (className, varSet) => ({
2
+ className,
3
+ style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value])),
4
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "0.6.9",
3
+ "version": "0.7.0",
4
4
  "description": "Near Zero-runtime CSS-in-JS for efficient design systems.",
5
5
  "keywords": [
6
6
  "react",
package/types/css.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { CreateStyle, CustomHTMLType, CustomProperties, KeyframesDefinition, ReturnType, VarsDefinition } from 'zss-engine';
2
2
  import { cx } from './cx';
3
+ import { rx } from './rx';
3
4
  declare class css {
4
5
  static create<T extends Record<string, CustomProperties>>(object: CreateStyle<T>): ReturnType<T>;
5
6
  static global(object: CustomHTMLType): void;
@@ -80,4 +81,4 @@ declare class css {
80
81
  min: (str: string) => "@container (min-)";
81
82
  };
82
83
  }
83
- export { css, cx };
84
+ export { css, cx, rx };
package/types/cx.d.ts CHANGED
@@ -1 +1 @@
1
- export declare function cx(...strings: Array<string | undefined | false>): string & ':';
1
+ export declare const cx: (...strings: Array<string | null | undefined | false>) => string & ":";
package/types/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { css, cx } from './css';
1
+ export { css, cx, rx } from './css';
package/types/rx.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export declare const rx: (className: string, varSet: {
2
+ [key: `--${string}`]: string;
3
+ }) => {
4
+ className: string;
5
+ style: {
6
+ [k: string]: string;
7
+ };
8
+ };