@plumeria/core 0.9.9 → 0.10.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/index.d.ts +11 -257
- package/dist/index.js +21 -14
- package/dist/index.mjs +10 -16
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CSSHTML, CSSProperties, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues, ReturnType } from "zss-engine";
|
|
1
|
+
import { CSSHTML, CSSProperties, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues, Join, ReturnType } from "zss-engine";
|
|
2
|
+
import { color, ps } from "zss-utils";
|
|
2
3
|
|
|
3
4
|
//#region src/css.d.ts
|
|
4
5
|
declare class css {
|
|
@@ -25,262 +26,15 @@ declare class css {
|
|
|
25
26
|
minWidth: <V extends string | number>(value: V) => V extends number ? `@container (min-width: ${V}px)` : `@container (min-width: ${V})`;
|
|
26
27
|
minHeight: <V extends string | number>(value: V) => V extends number ? `@container (min-height: ${V}px)` : `@container (min-height: ${V})`;
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
dir: <S extends string>(str: S) => `:dir(${S})`;
|
|
32
|
-
has: <S extends string>(str: S) => `:has(${S})`;
|
|
33
|
-
host: <S extends string>(str: S) => `:host(${S})`;
|
|
34
|
-
hostContext: <S extends string>(str: S) => `:host-context(${S})`;
|
|
35
|
-
is: <S extends string>(str: S) => `:is(${S})`;
|
|
36
|
-
lang: <S extends string>(str: S) => `:lang(${S})`;
|
|
37
|
-
nthChild: <S extends string>(str: S) => `:nth-child(${S})`;
|
|
38
|
-
nthLastChild: <S extends string>(str: S) => `:nth-last-child(${S})`;
|
|
39
|
-
nthLastOfType: <S extends string>(str: S) => `:nth-last-of-type(${S})`;
|
|
40
|
-
nthOfType: <S extends string>(str: S) => `:nth-of-type(${S})`;
|
|
41
|
-
not: <S extends string>(str: S) => `:not(${S})`;
|
|
42
|
-
state: <S extends string>(str: S) => `:state(${S})`;
|
|
43
|
-
where: <S extends string>(str: S) => `:where(${S})`;
|
|
44
|
-
highlight: <S extends string>(str: S) => `::highlight(${S})`;
|
|
45
|
-
part: <S extends string>(str: S) => `::part(${S})`;
|
|
46
|
-
slotted: <S extends string>(str: S) => `::slotted(${S})`;
|
|
47
|
-
viewTransitionImagePair: <S extends string>(str: S) => `::view-transition-image-pair(${S})`;
|
|
48
|
-
viewTransitionGroup: <S extends string>(str: S) => `::view-transition-group(${S})`;
|
|
49
|
-
viewTransitionOld: <S extends string>(str: S) => `::view-transition-old(${S})`;
|
|
50
|
-
viewTransitionNew: <S extends string>(str: S) => `::view-transition-new(${S})`;
|
|
51
|
-
};
|
|
52
|
-
active: ":active";
|
|
53
|
-
anyLink: ":any-link";
|
|
54
|
-
autoFill: ":autofill";
|
|
55
|
-
buffering: ":buffering";
|
|
56
|
-
checked: ":checked";
|
|
57
|
-
default: ":default";
|
|
58
|
-
defined: ":defined";
|
|
59
|
-
disabled: ":disabled";
|
|
60
|
-
empty: ":empty";
|
|
61
|
-
enabled: ":enabled";
|
|
62
|
-
first: ":first";
|
|
63
|
-
firstChild: ":first-child";
|
|
64
|
-
firstOfType: ":first-of-type";
|
|
65
|
-
focus: ":focus";
|
|
66
|
-
focusVisible: ":focus-visible";
|
|
67
|
-
focusWithin: ":focus-within";
|
|
68
|
-
fullscreen: ":fullscreen";
|
|
69
|
-
future: ":future";
|
|
70
|
-
hasSlotted: ":has-slotted";
|
|
71
|
-
host: ":host";
|
|
72
|
-
hover: ":hover";
|
|
73
|
-
inRange: ":in-range";
|
|
74
|
-
indeterminate: ":indeterminate";
|
|
75
|
-
invalid: ":invalid";
|
|
76
|
-
lastChild: ":last-child";
|
|
77
|
-
lastOfType: ":last-of-type";
|
|
78
|
-
left: ":left";
|
|
79
|
-
link: ":link";
|
|
80
|
-
modal: ":modal";
|
|
81
|
-
muted: ":muted";
|
|
82
|
-
onlyChild: ":only-child";
|
|
83
|
-
onlyOfType: ":only-of-type";
|
|
84
|
-
open: ":open";
|
|
85
|
-
optional: ":optional";
|
|
86
|
-
outOfRange: ":out-of-range";
|
|
87
|
-
past: ":past";
|
|
88
|
-
paused: ":paused";
|
|
89
|
-
pictureInPicture: ":picture-in-picture";
|
|
90
|
-
placeholderShown: ":placeholder-shown";
|
|
91
|
-
playing: ":playing";
|
|
92
|
-
popoverOpen: ":popover-open";
|
|
93
|
-
readOnly: ":read-only";
|
|
94
|
-
readWrite: ":read-write";
|
|
95
|
-
required: ":required";
|
|
96
|
-
right: ":right";
|
|
97
|
-
root: ":root";
|
|
98
|
-
scope: ":scope";
|
|
99
|
-
seeking: ":seeking";
|
|
100
|
-
stalled: ":stalled";
|
|
101
|
-
target: ":target";
|
|
102
|
-
userInvalid: ":user-invalid";
|
|
103
|
-
userValid: ":user-valid";
|
|
104
|
-
valid: ":valid";
|
|
105
|
-
visited: ":visited";
|
|
106
|
-
volumeLocked: ":volume-locked";
|
|
107
|
-
after: "::after";
|
|
108
|
-
backdrop: "::backdrop";
|
|
109
|
-
before: "::before";
|
|
110
|
-
cue: "::cue";
|
|
111
|
-
detailsContent: "::details-content";
|
|
112
|
-
firstSelectorButton: "::first-selector-button";
|
|
113
|
-
firstLetter: "::first-letter";
|
|
114
|
-
firstLine: "::first-line";
|
|
115
|
-
grammarError: "::grammar-error";
|
|
116
|
-
marker: "::marker";
|
|
117
|
-
placeholder: "::placeholder";
|
|
118
|
-
selection: "::selection";
|
|
119
|
-
spellingError: "::spellingError";
|
|
120
|
-
targetText: "::target-text";
|
|
121
|
-
viewTransition: "::view-transition";
|
|
122
|
-
};
|
|
123
|
-
static color: {
|
|
124
|
-
lighten: (color: string, amount: string | number) => `color-mix(in srgb, ${string}, white ${number}%)`;
|
|
125
|
-
darken: (color: string, amount: string | number) => `color-mix(in srgb, ${string}, black ${number}%)`;
|
|
126
|
-
primary: "#0070f3";
|
|
127
|
-
secondary: "#ff4081";
|
|
128
|
-
success: "#2e7d32";
|
|
129
|
-
warning: "#ed6c02";
|
|
130
|
-
error: "#d32f2f";
|
|
131
|
-
aliceblue: "aliceblue";
|
|
132
|
-
antiquewhite: "antiquewhite";
|
|
133
|
-
aqua: "aqua";
|
|
134
|
-
aquamarine: "aquamarine";
|
|
135
|
-
azure: "azure";
|
|
136
|
-
beige: "beige";
|
|
137
|
-
bisque: "bisque";
|
|
138
|
-
black: "black";
|
|
139
|
-
blanchedalmond: "blanchedalmond";
|
|
140
|
-
blue: "blue";
|
|
141
|
-
blueviolet: "blueviolet";
|
|
142
|
-
brown: "brown";
|
|
143
|
-
burlywood: "burlywood";
|
|
144
|
-
cadetblue: "cadetblue";
|
|
145
|
-
chartreuse: "chartreuse";
|
|
146
|
-
chocolate: "chocolate";
|
|
147
|
-
coral: "coral";
|
|
148
|
-
cornflowerblue: "cornflowerblue";
|
|
149
|
-
cornsilk: "cornsilk";
|
|
150
|
-
crimson: "crimson";
|
|
151
|
-
cyan: "cyan";
|
|
152
|
-
darkblue: "darkblue";
|
|
153
|
-
darkcyan: "darkcyan";
|
|
154
|
-
darkgoldenrod: "darkgoldenrod";
|
|
155
|
-
darkgray: "darkgray";
|
|
156
|
-
darkgreen: "darkgreen";
|
|
157
|
-
darkgrey: "darkgrey";
|
|
158
|
-
darkkhaki: "darkkhaki";
|
|
159
|
-
darkmagenta: "darkmagenta";
|
|
160
|
-
darkolivegreen: "darkolivegreen";
|
|
161
|
-
darkorange: "darkorange";
|
|
162
|
-
darkorchid: "darkorchid";
|
|
163
|
-
darkred: "darkred";
|
|
164
|
-
darksalmon: "darksalmon";
|
|
165
|
-
darkseagreen: "darkseagreen";
|
|
166
|
-
darkslateblue: "darkslateblue";
|
|
167
|
-
darkslategray: "darkslategray";
|
|
168
|
-
darkslategrey: "darkslategrey";
|
|
169
|
-
darkturquoise: "darkturquoise";
|
|
170
|
-
darkviolet: "darkviolet";
|
|
171
|
-
deeppink: "deeppink";
|
|
172
|
-
deepskyblue: "deepskyblue";
|
|
173
|
-
dimgray: "dimgray";
|
|
174
|
-
dimgrey: "dimgrey";
|
|
175
|
-
dodgerblue: "dodgerblue";
|
|
176
|
-
firebrick: "firebrick";
|
|
177
|
-
floralwhite: "floralwhite";
|
|
178
|
-
forestgreen: "forestgreen";
|
|
179
|
-
fuchsia: "fuchsia";
|
|
180
|
-
gainsboro: "gainsboro";
|
|
181
|
-
ghostwhite: "ghostwhite";
|
|
182
|
-
gold: "gold";
|
|
183
|
-
goldenrod: "goldenrod";
|
|
184
|
-
gray: "gray";
|
|
185
|
-
green: "green";
|
|
186
|
-
greenyellow: "greenyellow";
|
|
187
|
-
grey: "grey";
|
|
188
|
-
honeydew: "honeydew";
|
|
189
|
-
hotpink: "hotpink";
|
|
190
|
-
indianred: "indianred";
|
|
191
|
-
indigo: "indigo";
|
|
192
|
-
ivory: "ivory";
|
|
193
|
-
khaki: "khaki";
|
|
194
|
-
lavender: "lavender";
|
|
195
|
-
lavenderblush: "lavenderblush";
|
|
196
|
-
lawngreen: "lawngreen";
|
|
197
|
-
lemonchiffon: "lemonchiffon";
|
|
198
|
-
lightblue: "lightblue";
|
|
199
|
-
lightcoral: "lightcoral";
|
|
200
|
-
lightcyan: "lightcyan";
|
|
201
|
-
lightgoldenrodyellow: "lightgoldenrodyellow";
|
|
202
|
-
lightgray: "lightgray";
|
|
203
|
-
lightgreen: "lightgreen";
|
|
204
|
-
lightgrey: "lightgrey";
|
|
205
|
-
lightpink: "lightpink";
|
|
206
|
-
lightsalmon: "lightsalmon";
|
|
207
|
-
lightseagreen: "lightseagreen";
|
|
208
|
-
lightskyblue: "lightskyblue";
|
|
209
|
-
lightslategray: "lightslategray";
|
|
210
|
-
lightslategrey: "lightslategrey";
|
|
211
|
-
lightsteelblue: "lightsteelblue";
|
|
212
|
-
lightyellow: "lightyellow";
|
|
213
|
-
lime: "lime";
|
|
214
|
-
limegreen: "limegreen";
|
|
215
|
-
linen: "linen";
|
|
216
|
-
magenta: "magenta";
|
|
217
|
-
maroon: "maroon";
|
|
218
|
-
mediumaquamarine: "mediumaquamarine";
|
|
219
|
-
mediumblue: "mediumblue";
|
|
220
|
-
mediumorchid: "mediumorchid";
|
|
221
|
-
mediumpurple: "mediumpurple";
|
|
222
|
-
mediumseagreen: "mediumseagreen";
|
|
223
|
-
mediumslateblue: "mediumslateblue";
|
|
224
|
-
mediumspringgreen: "mediumspringgreen";
|
|
225
|
-
mediumturquoise: "mediumturquoise";
|
|
226
|
-
mediumvioletred: "mediumvioletred";
|
|
227
|
-
midnightblue: "midnightblue";
|
|
228
|
-
mintcream: "mintcream";
|
|
229
|
-
mistyrose: "mistyrose";
|
|
230
|
-
moccasin: "moccasin";
|
|
231
|
-
navajowhite: "navajowhite";
|
|
232
|
-
navy: "navy";
|
|
233
|
-
oldlace: "oldlace";
|
|
234
|
-
olive: "olive";
|
|
235
|
-
olivedrab: "olivedrab";
|
|
236
|
-
orange: "orange";
|
|
237
|
-
orangered: "orangered";
|
|
238
|
-
orchid: "orchid";
|
|
239
|
-
palegoldenrod: "palegoldenrod";
|
|
240
|
-
palegreen: "palegreen";
|
|
241
|
-
paleturquoise: "paleturquoise";
|
|
242
|
-
palevioletred: "palevioletred";
|
|
243
|
-
papayawhip: "papayawhip";
|
|
244
|
-
peachpuff: "peachpuff";
|
|
245
|
-
peru: "peru";
|
|
246
|
-
pink: "pink";
|
|
247
|
-
plum: "plum";
|
|
248
|
-
powderblue: "powderblue";
|
|
249
|
-
purple: "purple";
|
|
250
|
-
rebeccapurple: "rebeccapurple";
|
|
251
|
-
red: "red";
|
|
252
|
-
rosybrown: "rosybrown";
|
|
253
|
-
royalblue: "royalblue";
|
|
254
|
-
saddlebrown: "saddlebrown";
|
|
255
|
-
salmon: "salmon";
|
|
256
|
-
sandybrown: "sandybrown";
|
|
257
|
-
seagreen: "seagreen";
|
|
258
|
-
seashell: "seashell";
|
|
259
|
-
sienna: "sienna";
|
|
260
|
-
silver: "silver";
|
|
261
|
-
skyblue: "skyblue";
|
|
262
|
-
slateblue: "slateblue";
|
|
263
|
-
slategray: "slategray";
|
|
264
|
-
slategrey: "slategrey";
|
|
265
|
-
snow: "snow";
|
|
266
|
-
springgreen: "springgreen";
|
|
267
|
-
steelblue: "steelblue";
|
|
268
|
-
tan: "tan";
|
|
269
|
-
teal: "teal";
|
|
270
|
-
thistle: "thistle";
|
|
271
|
-
tomato: "tomato";
|
|
272
|
-
transparent: "transparent";
|
|
273
|
-
turquoise: "turquoise";
|
|
274
|
-
violet: "violet";
|
|
275
|
-
wheat: "wheat";
|
|
276
|
-
white: "white";
|
|
277
|
-
whitesmoke: "whitesmoke";
|
|
278
|
-
yellow: "yellow";
|
|
279
|
-
yellowgreen: "yellowgreen";
|
|
280
|
-
};
|
|
281
|
-
} //#endregion
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
282
32
|
//#region src/cx.d.ts
|
|
283
|
-
declare const cx: (...
|
|
33
|
+
declare const cx: (...classes: Array<string | null | undefined | false>) => string;
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/px.d.ts
|
|
37
|
+
declare const px: <T extends readonly string[]>(...pseudos: T) => Join<T>;
|
|
284
38
|
|
|
285
39
|
//#endregion
|
|
286
40
|
//#region src/rx.d.ts
|
|
@@ -294,4 +48,4 @@ declare const rx: (className: string, varSet: {
|
|
|
294
48
|
};
|
|
295
49
|
|
|
296
50
|
//#endregion
|
|
297
|
-
export { CSSHTML, CSSProperties, CreateStyle, css, cx, rx };
|
|
51
|
+
export { CSSHTML, CSSProperties, CreateStyle, color, css, cx, ps, px, rx };
|
package/dist/index.js
CHANGED
|
@@ -96,27 +96,21 @@ var css = class {
|
|
|
96
96
|
}
|
|
97
97
|
static media = zss_utils.media;
|
|
98
98
|
static container = zss_utils.container;
|
|
99
|
-
static pseudo = zss_utils.pseudo;
|
|
100
|
-
static color = zss_utils.color;
|
|
101
99
|
};
|
|
102
100
|
var css_default = css;
|
|
103
101
|
|
|
104
102
|
//#endregion
|
|
105
103
|
//#region src/cx.ts
|
|
106
|
-
const cx = (...
|
|
107
|
-
let result = "";
|
|
108
|
-
let isFirst = true;
|
|
109
|
-
strings.filter(Boolean).forEach((str) => {
|
|
110
|
-
if (str?.toString().startsWith(":")) result += str.toString();
|
|
111
|
-
else if (typeof str === "string") if (isFirst) {
|
|
112
|
-
result += str;
|
|
113
|
-
isFirst = false;
|
|
114
|
-
} else result += ` ${str}`;
|
|
115
|
-
});
|
|
116
|
-
return result;
|
|
117
|
-
};
|
|
104
|
+
const cx = (...classes) => classes.filter(Boolean).join(" ");
|
|
118
105
|
var cx_default = cx;
|
|
119
106
|
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/px.ts
|
|
109
|
+
const px = (...pseudos) => {
|
|
110
|
+
return pseudos.filter(Boolean).join("");
|
|
111
|
+
};
|
|
112
|
+
var px_default = px;
|
|
113
|
+
|
|
120
114
|
//#endregion
|
|
121
115
|
//#region src/rx.ts
|
|
122
116
|
const rx = (className, varSet) => ({
|
|
@@ -126,6 +120,19 @@ const rx = (className, varSet) => ({
|
|
|
126
120
|
var rx_default = rx;
|
|
127
121
|
|
|
128
122
|
//#endregion
|
|
123
|
+
Object.defineProperty(exports, 'color', {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function () {
|
|
126
|
+
return zss_utils.color;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
129
|
exports.css = css_default;
|
|
130
130
|
exports.cx = cx_default;
|
|
131
|
+
Object.defineProperty(exports, 'ps', {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return zss_utils.ps;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
exports.px = px_default;
|
|
131
138
|
exports.rx = rx_default;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 } from "./css.mjs";
|
|
2
2
|
import { camelToKebabCase, genBase36Hash, injectClientCSS, injectClientGlobalCSS, injectServerCSS, isDevAndTest, isServer, transpiler } from "zss-engine";
|
|
3
|
-
import { color, container, media,
|
|
3
|
+
import { color, container, media, ps } from "zss-utils";
|
|
4
4
|
|
|
5
5
|
//#region src/css.ts
|
|
6
6
|
function create(object) {
|
|
@@ -95,27 +95,21 @@ var css = class {
|
|
|
95
95
|
}
|
|
96
96
|
static media = media;
|
|
97
97
|
static container = container;
|
|
98
|
-
static pseudo = pseudo;
|
|
99
|
-
static color = color;
|
|
100
98
|
};
|
|
101
99
|
var css_default = css;
|
|
102
100
|
|
|
103
101
|
//#endregion
|
|
104
102
|
//#region src/cx.ts
|
|
105
|
-
const cx = (...
|
|
106
|
-
let result = "";
|
|
107
|
-
let isFirst = true;
|
|
108
|
-
strings.filter(Boolean).forEach((str) => {
|
|
109
|
-
if (str?.toString().startsWith(":")) result += str.toString();
|
|
110
|
-
else if (typeof str === "string") if (isFirst) {
|
|
111
|
-
result += str;
|
|
112
|
-
isFirst = false;
|
|
113
|
-
} else result += ` ${str}`;
|
|
114
|
-
});
|
|
115
|
-
return result;
|
|
116
|
-
};
|
|
103
|
+
const cx = (...classes) => classes.filter(Boolean).join(" ");
|
|
117
104
|
var cx_default = cx;
|
|
118
105
|
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/px.ts
|
|
108
|
+
const px = (...pseudos) => {
|
|
109
|
+
return pseudos.filter(Boolean).join("");
|
|
110
|
+
};
|
|
111
|
+
var px_default = px;
|
|
112
|
+
|
|
119
113
|
//#endregion
|
|
120
114
|
//#region src/rx.ts
|
|
121
115
|
const rx = (className, varSet) => ({
|
|
@@ -125,4 +119,4 @@ const rx = (className, varSet) => ({
|
|
|
125
119
|
var rx_default = rx;
|
|
126
120
|
|
|
127
121
|
//#endregion
|
|
128
|
-
export { css_default as css, cx_default as cx, rx_default as rx };
|
|
122
|
+
export { color, css_default as css, cx_default as cx, ps, px_default as px, rx_default as rx };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Zero-runtime, expressive CSS-in-JS library for TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"./processors": {
|
|
29
29
|
"types": "./dist/processors/css.d.ts",
|
|
30
|
-
"import": "./dist/
|
|
30
|
+
"import": "./dist/processors/css.mjs",
|
|
31
31
|
"default": "./dist/processors/css.js"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"stylesheet.css"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"zss-engine": "0.2.
|
|
43
|
-
"zss-utils": "0.2.
|
|
42
|
+
"zss-engine": "0.2.41",
|
|
43
|
+
"zss-utils": "0.2.4"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|