@plumeria/core 0.8.10 → 0.8.12

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) zss-in-js contributer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,10 +1,10 @@
1
1
  # @plumeria/core
2
2
 
3
- Plumeria is a CSS-in-JS built with [**zss-utils**](https://www.npmjs.com/package/zss-utils) that provides a speedy development cycle.
3
+ Plumeria is a Near zero-runtime CSS-in-JS for efficient design systems.
4
4
 
5
5
  ## Installation
6
6
 
7
- To start using Plumeria, Install the following two packages and the bundler package:
7
+ To start using Plumeria, Install the following two packages:
8
8
 
9
9
  ```sh
10
10
  npm install @plumeria/core
@@ -12,32 +12,22 @@ npm install @plumeria/core
12
12
 
13
13
  ### Compiler
14
14
 
15
- Plumeria is designed to extract styles into static CSS stylesheets using the CLI.
16
- Install the following libraries to enable CLI commands: [`@plumeria/compiler`](https://www.npmjs.com/package/@plumeria/compiler)
15
+ To compile `@plumeria/core`, for example, to use `npx css`, install
16
+ [`@plumeria/compiler`](https://www.npmjs.com/package/@plumeria/compiler) for static extraction through the build process.
17
17
 
18
18
  ```sh
19
19
  npm install --save-dev @plumeria/compiler
20
20
  ```
21
21
 
22
- For more information on compiler commnads, please see the documentation
23
- [API reference](https://plumeria.dev/docs/reference/css).
24
-
25
- ### Static StyleSheet
22
+ ### StyleSheet
26
23
 
27
24
  Import stylesheet in your application's entry point.
28
25
  Applies the static stylesheet for production environments.
29
26
 
30
27
  ```ts
31
- // eg: main.ts or layout.tsx
32
28
  import '@plumeria/core/stylesheet';
33
29
  ```
34
30
 
35
- ### Integrate
36
-
37
- To integrate with Next.js or Vite, you'll need one of the following packages:
38
- [@plumeria/next](https://www.npmjs.com/package/@plumeria/next) or [@plumeria/vite](https://www.npmjs.com/package/@plumeria/vite).
39
- See [Installation](https://plumeria.dev/docs/getting-started/installation) in the documentation for more details.
40
-
41
31
  ## API
42
32
 
43
33
  ### css.create()
@@ -70,7 +60,7 @@ const styles = css.create({
70
60
  },
71
61
  },
72
62
  text: {
73
- color: '#333' // standard properties of that className
63
+ color: '#333',
74
64
  [css.pseudo.hover]: {
75
65
  color: 'skyblue',
76
66
  opacity: 0.9,
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rx = exports.cx = exports.css = void 0;
4
- var css_js_1 = require("./css.js");
5
- Object.defineProperty(exports, "css", { enumerable: true, get: function () { return css_js_1.css; } });
6
- Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return css_js_1.cx; } });
7
- Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return css_js_1.rx; } });
4
+ const zss_utils_1 = require("zss-utils");
5
+ Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return zss_utils_1.cx; } });
6
+ Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return zss_utils_1.rx; } });
7
+ class css {
8
+ static create(object) {
9
+ return (0, zss_utils_1.create)(object);
10
+ }
11
+ static global(object) {
12
+ return (0, zss_utils_1.global)(object);
13
+ }
14
+ static defineThemeVars(object) {
15
+ return (0, zss_utils_1.defineThemeVars)(object);
16
+ }
17
+ static keyframes(object) {
18
+ return (0, zss_utils_1.keyframes)(object);
19
+ }
20
+ static media = zss_utils_1.media;
21
+ static pseudo = zss_utils_1.pseudo;
22
+ static colors = zss_utils_1.colors;
23
+ static container = zss_utils_1.container;
24
+ }
25
+ exports.css = css;
package/dist/esm/index.js CHANGED
@@ -1 +1,20 @@
1
- export { css, cx, rx } from './css.js';
1
+ import { create, global, keyframes, defineThemeVars, media, pseudo, colors, container, cx, rx, } from 'zss-utils';
2
+ class css {
3
+ static create(object) {
4
+ return create(object);
5
+ }
6
+ static global(object) {
7
+ return global(object);
8
+ }
9
+ static defineThemeVars(object) {
10
+ return defineThemeVars(object);
11
+ }
12
+ static keyframes(object) {
13
+ return keyframes(object);
14
+ }
15
+ static media = media;
16
+ static pseudo = pseudo;
17
+ static colors = colors;
18
+ static container = container;
19
+ }
20
+ export { css, cx, rx };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "0.8.10",
4
- "description": "Zero-runtime StyleSheet for speedy development cycle",
3
+ "version": "0.8.12",
4
+ "description": "Near Zero-runtime CSS-in-JS for efficient design systems.",
5
5
  "keywords": [
6
6
  "css",
7
7
  "css-in-js",
@@ -39,18 +39,15 @@
39
39
  "types/",
40
40
  "stylesheet/"
41
41
  ],
42
- "scripts": {
43
- "build": "rimraf dist types && pnpm esm && pnpm cjs",
44
- "cjs": "tsc --project tsconfig.cjs.json",
45
- "esm": "tsc --project tsconfig.esm.json"
46
- },
47
42
  "dependencies": {
48
- "zss-utils": "0.1.0"
49
- },
50
- "peerDependencies": {
51
- "@plumeria/compiler": ">=0.8.10"
43
+ "zss-utils": "0.1.1"
52
44
  },
53
45
  "publishConfig": {
54
46
  "access": "public"
47
+ },
48
+ "scripts": {
49
+ "build": "rimraf dist types && pnpm esm && pnpm cjs",
50
+ "cjs": "tsc --project tsconfig.cjs.json",
51
+ "esm": "tsc --project tsconfig.esm.json"
55
52
  }
56
- }
53
+ }
package/types/index.d.ts CHANGED
@@ -1 +1,132 @@
1
- export { css, cx, rx } from './css.js';
1
+ import type { CreateStyle, CustomHTMLType, CustomProperties, KeyframesDefinition, ReturnType, VarsDefinition } from 'zss-utils';
2
+ import { cx, rx } from 'zss-utils';
3
+ declare class css {
4
+ static create<T extends Record<string, CustomProperties>>(object: CreateStyle<T>): ReturnType<T>;
5
+ static global(object: CustomHTMLType): void;
6
+ static defineThemeVars<const T extends VarsDefinition>(object: T): { [K in keyof T]: `var(--${string & K})`; };
7
+ static keyframes(object: KeyframesDefinition): string;
8
+ static media: {
9
+ readonly min_sm: "@media (min-width: 640px)";
10
+ readonly min_md: "@media (min-width: 768px)";
11
+ readonly min_lg: "@media (min-width: 1024px)";
12
+ readonly min_xl: "@media (min-width: 1280px)";
13
+ readonly min_2xl: "@media (min-width: 1536px)";
14
+ readonly max_sm: "@media (max-width: 640px)";
15
+ readonly max_md: "@media (max-width: 768px)";
16
+ readonly max_lg: "@media (max-width: 1024px)";
17
+ readonly max_xl: "@media (max-width: 1280px)";
18
+ readonly max_2xl: "@media (max-width: 1536px)";
19
+ readonly range: (range: string) => "@media ()";
20
+ readonly max: (str: string) => "@media (max-)";
21
+ readonly min: (str: string) => "@media (min-)";
22
+ readonly scheme: {
23
+ readonly dark: "@media (prefers-color-scheme: dark)";
24
+ readonly light: "@media (prefers-color-scheme: light)";
25
+ };
26
+ };
27
+ static pseudo: {
28
+ readonly active: ":active";
29
+ readonly anyLink: ":any-link";
30
+ readonly autoFill: ":autofill";
31
+ readonly buffering: ":buffering";
32
+ readonly checked: ":checked";
33
+ readonly default: ":default";
34
+ readonly defined: ":defined";
35
+ readonly disabled: ":disabled";
36
+ readonly empty: ":empty";
37
+ readonly enabled: ":enabled";
38
+ readonly first: ":first";
39
+ readonly firstChild: ":first-child";
40
+ readonly firstOfType: ":first-of-type";
41
+ readonly focus: ":focus";
42
+ readonly focusVisible: ":focus-visible";
43
+ readonly focusWithin: ":focus-within";
44
+ readonly fullscreen: ":fullscreen";
45
+ readonly future: ":future";
46
+ readonly hasSlotted: ":has-slotted";
47
+ readonly host: ":host";
48
+ readonly hover: ":hover";
49
+ readonly inRange: ":in-range";
50
+ readonly indeterminate: ":indeterminate";
51
+ readonly invalid: ":invalid";
52
+ readonly lastChild: ":last-child";
53
+ readonly lastOfType: ":last-of-type";
54
+ readonly left: ":left";
55
+ readonly link: ":link";
56
+ readonly modal: ":modal";
57
+ readonly muted: ":muted";
58
+ readonly onlyChild: ":only-child";
59
+ readonly onlyOfType: ":only-of-type";
60
+ readonly open: ":open";
61
+ readonly optional: ":optional";
62
+ readonly outOfRange: ":out-of-range";
63
+ readonly past: ":past";
64
+ readonly paused: ":paused";
65
+ readonly pictureInPicture: ":picture-in-picture";
66
+ readonly placeholderShown: ":placeholder-shown";
67
+ readonly playing: ":playing";
68
+ readonly popoverOpen: ":popover-open";
69
+ readonly readOnly: ":read-only";
70
+ readonly readWrite: ":read-write";
71
+ readonly required: ":required";
72
+ readonly right: ":right";
73
+ readonly root: "root";
74
+ readonly scope: ":scope";
75
+ readonly seeking: ":seeking";
76
+ readonly stalled: ":stalled";
77
+ readonly target: ":target";
78
+ readonly userInvalid: ":user-invalid";
79
+ readonly userValid: ":user-valid";
80
+ readonly valid: ":valid";
81
+ readonly visited: ":visited";
82
+ readonly volumeLocked: ":volume-locked";
83
+ readonly after: "::after";
84
+ readonly backdrop: "::backdrop";
85
+ readonly before: "::before";
86
+ readonly cue: "::cue";
87
+ readonly detailsContent: "::details-content";
88
+ readonly firstSelectorButton: "::first-selector-button";
89
+ readonly firstLetter: "::first-letter";
90
+ readonly firstLine: "::first-line";
91
+ readonly grammarError: "::grammar-error";
92
+ readonly marker: "::marker";
93
+ readonly placeholder: "::placeholder";
94
+ readonly selection: "::selection";
95
+ readonly spellingError: "::spellingError";
96
+ readonly targetText: "::target-text";
97
+ readonly viewTransition: "::view-transition";
98
+ readonly fn: {
99
+ readonly cue: (str: string) => "::cue()";
100
+ readonly dir: (str: string) => ":dir()";
101
+ readonly has: (str: string) => ":has()";
102
+ readonly host: (str: string) => ":host()";
103
+ readonly hostContext: (str: string) => ":host-context()";
104
+ readonly is: (str: string) => ":is()";
105
+ readonly lang: (str: string) => ":lang()";
106
+ readonly nthChild: (str: string) => ":nth-child()";
107
+ readonly nthLastChild: (str: string) => ":nth-last-child()";
108
+ readonly nthLastOfType: (str: string) => ":nth-last-of-type()";
109
+ readonly nthOfType: (str: string) => ":nth-of-type()";
110
+ readonly not: (str: string) => ":not()";
111
+ readonly state: (str: string) => ":state()";
112
+ readonly where: (str: string) => ":where()";
113
+ readonly highlight: (str: string) => "::highlight()";
114
+ readonly part: (str: string) => "::part()";
115
+ readonly slotted: (str: string) => "::slotted()";
116
+ readonly viewTransitionImagePair: (str: string) => "::view-transition-image-pair()";
117
+ readonly viewTransitionGroup: (str: string) => "::view-transition-group()";
118
+ readonly viewTransitionOld: (str: string) => "::view-transition-old()";
119
+ readonly viewTransitionNew: (str: string) => "::view-transition-new()";
120
+ };
121
+ };
122
+ static colors: {
123
+ lighten: (color: string, amount: string | number) => string;
124
+ darken: (color: string, amount: string | number) => string;
125
+ };
126
+ static container: {
127
+ range: (range: string) => "@container ()";
128
+ max: (str: string) => "@container (max-)";
129
+ min: (str: string) => "@container (min-)";
130
+ };
131
+ }
132
+ export { css, cx, rx };
package/dist/cjs/css.js DELETED
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rx = exports.cx = exports.css = void 0;
4
- const zss_utils_1 = require("zss-utils");
5
- Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return zss_utils_1.cx; } });
6
- Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return zss_utils_1.rx; } });
7
- class css {
8
- static create(object) {
9
- return (0, zss_utils_1.create)(object);
10
- }
11
- static global(object) {
12
- return (0, zss_utils_1.global)(object);
13
- }
14
- static defineThemeVars(object) {
15
- return (0, zss_utils_1.defineThemeVars)(object);
16
- }
17
- static keyframes(object) {
18
- return (0, zss_utils_1.keyframes)(object);
19
- }
20
- static media = zss_utils_1.media;
21
- static pseudo = zss_utils_1.pseudo;
22
- static colors = zss_utils_1.colors;
23
- static container = zss_utils_1.container;
24
- }
25
- exports.css = css;
package/dist/esm/css.js DELETED
@@ -1,20 +0,0 @@
1
- import { create, global, keyframes, defineThemeVars, media, pseudo, colors, container, cx, rx, } from 'zss-utils';
2
- class css {
3
- static create(object) {
4
- return create(object);
5
- }
6
- static global(object) {
7
- return global(object);
8
- }
9
- static defineThemeVars(object) {
10
- return defineThemeVars(object);
11
- }
12
- static keyframes(object) {
13
- return keyframes(object);
14
- }
15
- static media = media;
16
- static pseudo = pseudo;
17
- static colors = colors;
18
- static container = container;
19
- }
20
- export { css, cx, rx };
package/types/css.d.ts DELETED
@@ -1,132 +0,0 @@
1
- import type { CreateStyle, CustomHTMLType, CustomProperties, KeyframesDefinition, ReturnType, VarsDefinition } from 'zss-utils';
2
- import { cx, rx } from 'zss-utils';
3
- declare class css {
4
- static create<T extends Record<string, CustomProperties>>(object: CreateStyle<T>): ReturnType<T>;
5
- static global(object: CustomHTMLType): void;
6
- static defineThemeVars<const T extends VarsDefinition>(object: T): { [K in keyof T]: `var(--${string & K})`; };
7
- static keyframes(object: KeyframesDefinition): string;
8
- static media: {
9
- readonly min_sm: "@media (min-width: 640px)";
10
- readonly min_md: "@media (min-width: 768px)";
11
- readonly min_lg: "@media (min-width: 1024px)";
12
- readonly min_xl: "@media (min-width: 1280px)";
13
- readonly min_2xl: "@media (min-width: 1536px)";
14
- readonly max_sm: "@media (max-width: 640px)";
15
- readonly max_md: "@media (max-width: 768px)";
16
- readonly max_lg: "@media (max-width: 1024px)";
17
- readonly max_xl: "@media (max-width: 1280px)";
18
- readonly max_2xl: "@media (max-width: 1536px)";
19
- readonly range: (range: string) => "@media ()";
20
- readonly max: (str: string) => "@media (max-)";
21
- readonly min: (str: string) => "@media (min-)";
22
- readonly scheme: {
23
- readonly dark: "@media (prefers-color-scheme: dark)";
24
- readonly light: "@media (prefers-color-scheme: light)";
25
- };
26
- };
27
- static pseudo: {
28
- readonly active: ":active";
29
- readonly anyLink: ":any-link";
30
- readonly autoFill: ":autofill";
31
- readonly buffering: ":buffering";
32
- readonly checked: ":checked";
33
- readonly default: ":default";
34
- readonly defined: ":defined";
35
- readonly disabled: ":disabled";
36
- readonly empty: ":empty";
37
- readonly enabled: ":enabled";
38
- readonly first: ":first";
39
- readonly firstChild: ":first-child";
40
- readonly firstOfType: ":first-of-type";
41
- readonly focus: ":focus";
42
- readonly focusVisible: ":focus-visible";
43
- readonly focusWithin: ":focus-within";
44
- readonly fullscreen: ":fullscreen";
45
- readonly future: ":future";
46
- readonly hasSlotted: ":has-slotted";
47
- readonly host: ":host";
48
- readonly hover: ":hover";
49
- readonly inRange: ":in-range";
50
- readonly indeterminate: ":indeterminate";
51
- readonly invalid: ":invalid";
52
- readonly lastChild: ":last-child";
53
- readonly lastOfType: ":last-of-type";
54
- readonly left: ":left";
55
- readonly link: ":link";
56
- readonly modal: ":modal";
57
- readonly muted: ":muted";
58
- readonly onlyChild: ":only-child";
59
- readonly onlyOfType: ":only-of-type";
60
- readonly open: ":open";
61
- readonly optional: ":optional";
62
- readonly outOfRange: ":out-of-range";
63
- readonly past: ":past";
64
- readonly paused: ":paused";
65
- readonly pictureInPicture: ":picture-in-picture";
66
- readonly placeholderShown: ":placeholder-shown";
67
- readonly playing: ":playing";
68
- readonly popoverOpen: ":popover-open";
69
- readonly readOnly: ":read-only";
70
- readonly readWrite: ":read-write";
71
- readonly required: ":required";
72
- readonly right: ":right";
73
- readonly root: "root";
74
- readonly scope: ":scope";
75
- readonly seeking: ":seeking";
76
- readonly stalled: ":stalled";
77
- readonly target: ":target";
78
- readonly userInvalid: ":user-invalid";
79
- readonly userValid: ":user-valid";
80
- readonly valid: ":valid";
81
- readonly visited: ":visited";
82
- readonly volumeLocked: ":volume-locked";
83
- readonly after: "::after";
84
- readonly backdrop: "::backdrop";
85
- readonly before: "::before";
86
- readonly cue: "::cue";
87
- readonly detailsContent: "::details-content";
88
- readonly firstSelectorButton: "::first-selector-button";
89
- readonly firstLetter: "::first-letter";
90
- readonly firstLine: "::first-line";
91
- readonly grammarError: "::grammar-error";
92
- readonly marker: "::marker";
93
- readonly placeholder: "::placeholder";
94
- readonly selection: "::selection";
95
- readonly spellingError: "::spellingError";
96
- readonly targetText: "::target-text";
97
- readonly viewTransition: "::view-transition";
98
- readonly fn: {
99
- readonly cue: (str: string) => "::cue()";
100
- readonly dir: (str: string) => ":dir()";
101
- readonly has: (str: string) => ":has()";
102
- readonly host: (str: string) => ":host()";
103
- readonly hostContext: (str: string) => ":host-context()";
104
- readonly is: (str: string) => ":is()";
105
- readonly lang: (str: string) => ":lang()";
106
- readonly nthChild: (str: string) => ":nth-child()";
107
- readonly nthLastChild: (str: string) => ":nth-last-child()";
108
- readonly nthLastOfType: (str: string) => ":nth-last-of-type()";
109
- readonly nthOfType: (str: string) => ":nth-of-type()";
110
- readonly not: (str: string) => ":not()";
111
- readonly state: (str: string) => ":state()";
112
- readonly where: (str: string) => ":where()";
113
- readonly highlight: (str: string) => "::highlight()";
114
- readonly part: (str: string) => "::part()";
115
- readonly slotted: (str: string) => "::slotted()";
116
- readonly viewTransitionImagePair: (str: string) => "::view-transition-image-pair()";
117
- readonly viewTransitionGroup: (str: string) => "::view-transition-group()";
118
- readonly viewTransitionOld: (str: string) => "::view-transition-old()";
119
- readonly viewTransitionNew: (str: string) => "::view-transition-new()";
120
- };
121
- };
122
- static colors: {
123
- lighten: (color: string, amount: string | number) => string;
124
- darken: (color: string, amount: string | number) => string;
125
- };
126
- static container: {
127
- range: (range: string) => "@container ()";
128
- max: (str: string) => "@container (max-)";
129
- min: (str: string) => "@container (min-)";
130
- };
131
- }
132
- export { css, cx, rx };