@salty-css/core 0.0.1-alpha.13 → 0.0.1-alpha.131
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/.saltyrc.schema.json +40 -0
- package/README.md +143 -26
- package/bin/bin-util.d.ts +2 -0
- package/bin/index.cjs +2 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +3 -0
- package/bin/logger.d.ts +2 -0
- package/bin/main.cjs +11 -0
- package/bin/main.d.ts +1 -0
- package/bin/main.js +260 -0
- package/bin/prettier.d.ts +1 -0
- package/compiler/get-files.d.ts +3 -0
- package/compiler/index.cjs +1 -11
- package/compiler/index.d.ts +4 -6
- package/compiler/index.js +16 -180
- package/config/config-types.d.ts +15 -5
- package/dash-case-BJEkFEGQ.cjs +1 -0
- package/dash-case-DBThphLm.js +19 -0
- package/generator/index.cjs +1 -1
- package/generator/index.js +40 -17
- package/generator/parse-templates.d.ts +2 -0
- package/generator/style-generator.d.ts +14 -4
- package/index-84Wroia-.cjs +1 -0
- package/index-AXVHdDqw.js +305 -0
- package/index-D2QOtfTb.cjs +21 -0
- package/index-D_732b92.js +4 -0
- package/package.json +20 -2
- package/parse-templates-DdYSw-iq.cjs +8 -0
- package/parse-templates-DnLWJ7Hc.js +100 -0
- package/pascal-case-BQpR5PdN.js +6 -0
- package/pascal-case-iWoaJWwT.cjs +1 -0
- package/react-styled-file-CGVf5n1B.js +11 -0
- package/react-styled-file-Dkubsz-U.cjs +8 -0
- package/react-vanilla-file-CCXbsjIb.js +18 -0
- package/react-vanilla-file-CG_WJLam.cjs +15 -0
- package/salty.config-BhBY_oOk.js +10 -0
- package/salty.config-Dk6ZcCxI.cjs +7 -0
- package/templates/salty-reset.d.ts +2 -0
- package/types/index.d.ts +48 -21
- package/util/camel-case.d.ts +1 -0
- package/util/dot-case.d.ts +1 -0
- package/util/index.cjs +1 -1
- package/util/index.d.ts +2 -0
- package/util/index.js +7 -15
- package/util/module-type.d.ts +1 -0
- package/util/pascal-case.d.ts +1 -0
- package/parse-templates-BOSK0Tb6.js +0 -90
- package/parse-templates-BY1Xai-_.cjs +0 -8
package/compiler/index.js
CHANGED
@@ -1,182 +1,18 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import { p as
|
9
|
-
const rt = N.createLogger({
|
10
|
-
level: "info",
|
11
|
-
format: N.format.combine(N.format.colorize(), N.format.cli()),
|
12
|
-
transports: [new N.transports.Console({})]
|
13
|
-
}), k = (s) => o(s, "./saltygen"), W = ["salty", "css", "styles", "styled"], X = (s = []) => new RegExp(`\\.(${[...W, ...s].join("|")})\\.`), O = (s, e = []) => X(e).test(s), Y = async (s) => {
|
14
|
-
const e = k(s), n = o(s, "salty-config.ts"), t = o(e, "salty-config.js");
|
15
|
-
await M.build({
|
16
|
-
entryPoints: [n],
|
17
|
-
minify: !0,
|
18
|
-
treeShaking: !0,
|
19
|
-
bundle: !0,
|
20
|
-
outfile: t,
|
21
|
-
format: "esm",
|
22
|
-
external: ["react"]
|
23
|
-
});
|
24
|
-
const c = Date.now(), { config: j } = await import(`${t}?t=${c}`);
|
25
|
-
return j;
|
26
|
-
}, Z = async (s) => {
|
27
|
-
const e = await Y(s), n = /* @__PURE__ */ new Set(), t = (m, l = []) => m ? Object.entries(m).flatMap(([p, i]) => {
|
28
|
-
if (!i) return;
|
29
|
-
if (typeof i == "object") return t(i, [...l, p]);
|
30
|
-
const x = [...l, p].join(".");
|
31
|
-
n.add(`"${x}"`);
|
32
|
-
const D = [...l.map(I), I(p)].join("-"), { result: P } = U(i);
|
33
|
-
return `--${D}: ${P};`;
|
34
|
-
}) : [], c = (m) => m ? Object.entries(m).flatMap(([l, p]) => {
|
35
|
-
const i = t(p);
|
36
|
-
return l === "base" ? i.join("") : `${l} { ${i.join("")} }`;
|
37
|
-
}) : [], j = (m) => m ? Object.entries(m).flatMap(([l, p]) => Object.entries(p).flatMap(([i, x]) => {
|
38
|
-
const D = t(x, [l]), P = `.${l}-${i}, [data-${l}="${i}"]`, V = D.join("");
|
39
|
-
return `${P} { ${V} }`;
|
40
|
-
})) : [], d = t(e.variables), w = c(e.responsiveVariables), a = j(e.conditionalVariables), b = k(s), y = o(b, "css/variables.css"), r = `:root { ${d.join("")} ${w.join("")} } ${a.join("")}`;
|
41
|
-
$(y, r);
|
42
|
-
const f = o(b, "types/css-tokens.d.ts"), u = `type VariableTokens = ${[...n].join("|")}; type PropertyValueToken = \`{\${VariableTokens}}\``;
|
43
|
-
$(f, u);
|
44
|
-
const g = o(b, "css/global.css"), F = q(e.global, "");
|
45
|
-
$(g, F);
|
46
|
-
const S = o(b, "css/templates.css"), C = A(e.templates);
|
47
|
-
$(S, C);
|
48
|
-
}, E = async (s, e) => {
|
49
|
-
const n = T(s), t = o(e, "js", n + ".js");
|
50
|
-
await M.build({
|
51
|
-
entryPoints: [s],
|
52
|
-
minify: !0,
|
53
|
-
treeShaking: !0,
|
54
|
-
bundle: !0,
|
55
|
-
outfile: t,
|
56
|
-
format: "esm",
|
57
|
-
target: ["es2022"],
|
58
|
-
keepNames: !0,
|
59
|
-
external: ["react"]
|
60
|
-
});
|
61
|
-
const c = Date.now();
|
62
|
-
return await import(`${t}?t=${c}`);
|
63
|
-
}, R = async (s) => {
|
64
|
-
const e = k(s), n = o(e, "salty-config.js"), { config: t } = await import(n);
|
65
|
-
return t;
|
66
|
-
}, it = async (s) => {
|
67
|
-
try {
|
68
|
-
const e = [], n = [], t = k(s), c = o(t, "index.css");
|
69
|
-
(() => {
|
70
|
-
H(t) && z("rm -rf " + t), v(t), v(o(t, "css")), v(o(t, "types"));
|
71
|
-
})(), await Z(s);
|
72
|
-
const d = await R(s);
|
73
|
-
async function w(r, f) {
|
74
|
-
const h = J(r);
|
75
|
-
if (h.isDirectory()) {
|
76
|
-
const u = G(r);
|
77
|
-
await Promise.all(u.map((g) => w(o(r, g), o(f, g))));
|
78
|
-
} else if (h.isFile() && O(r)) {
|
79
|
-
const g = await E(r, t), F = [];
|
80
|
-
Object.entries(g).forEach(([l, p]) => {
|
81
|
-
if (p.isKeyframes && p.css) {
|
82
|
-
const V = `${p.animationName}.css`, B = `css/${V}`, K = o(t, B);
|
83
|
-
e.push(V), $(K, p.css);
|
84
|
-
return;
|
85
|
-
}
|
86
|
-
if (!p.generator) return;
|
87
|
-
const i = p.generator._withBuildContext({
|
88
|
-
name: l,
|
89
|
-
config: d
|
90
|
-
}), x = `${i.hash}-${i.priority}.css`;
|
91
|
-
n[i.priority] || (n[i.priority] = []), n[i.priority].push(x), F.push(x);
|
92
|
-
const D = `css/${x}`, P = o(t, D);
|
93
|
-
$(P, i.css);
|
94
|
-
});
|
95
|
-
const S = F.map((l) => `@import url('./${l}');`).join(`
|
96
|
-
`), C = T(r, 6), m = o(t, `css/${C}.css`);
|
97
|
-
$(m, S);
|
98
|
-
}
|
99
|
-
}
|
100
|
-
await w(s, t);
|
101
|
-
const a = e.map((r) => `@import url('./css/${r}');`).join(`
|
102
|
-
`);
|
103
|
-
let y = `@layer l0, l1, l2, l3, l4, l5, l6, l7, l8;
|
104
|
-
|
105
|
-
${["@import url('./css/variables.css');", "@import url('./css/global.css');", "@import url('./css/templates.css');"].join(`
|
106
|
-
`)}
|
107
|
-
${a}`;
|
108
|
-
if (d.importStrategy !== "component") {
|
109
|
-
const r = n.flat().map((f) => `@import url('./css/${f}');`).join(`
|
110
|
-
`);
|
111
|
-
y += r;
|
112
|
-
}
|
113
|
-
$(c, y);
|
114
|
-
} catch (e) {
|
115
|
-
console.error(e);
|
116
|
-
}
|
117
|
-
}, ct = async (s, e) => {
|
118
|
-
try {
|
119
|
-
const n = [], t = o(s, "./saltygen"), c = o(t, "index.css");
|
120
|
-
if (O(e)) {
|
121
|
-
const d = await R(s), w = await E(e, t);
|
122
|
-
Object.entries(w).forEach(([f, h]) => {
|
123
|
-
if (!h.generator) return;
|
124
|
-
const u = h.generator._withBuildContext({
|
125
|
-
name: f,
|
126
|
-
config: d
|
127
|
-
}), g = `${u.hash}-${u.priority}.css`, F = `css/${g}`, S = o(t, F);
|
128
|
-
n.push(g), $(S, u.css);
|
129
|
-
});
|
130
|
-
const a = _(c, "utf8").split(`
|
131
|
-
`), b = n.map((f) => `@import url('../saltygen/css/${f}');`), r = [.../* @__PURE__ */ new Set([...a, ...b])].join(`
|
132
|
-
`);
|
133
|
-
$(c, r);
|
134
|
-
}
|
135
|
-
} catch (n) {
|
136
|
-
console.error(n);
|
137
|
-
}
|
138
|
-
}, at = async (s, e) => {
|
139
|
-
try {
|
140
|
-
const n = o(s, "./saltygen");
|
141
|
-
if (O(e)) {
|
142
|
-
let c = _(e, "utf8");
|
143
|
-
c.replace(/^(?!export\s)const\s.*/gm, (y) => `export ${y}`) !== c && await L(e, c);
|
144
|
-
const d = await R(s), w = await E(e, n);
|
145
|
-
let a = c;
|
146
|
-
Object.entries(w).forEach(([y, r]) => {
|
147
|
-
var m;
|
148
|
-
if (r.isKeyframes) {
|
149
|
-
console.log("value", r);
|
150
|
-
return;
|
151
|
-
}
|
152
|
-
if (!r.generator) return;
|
153
|
-
const f = r.generator._withBuildContext({
|
154
|
-
name: y,
|
155
|
-
config: d
|
156
|
-
}), h = new RegExp(`${y}[=\\s]+[^()]+styled\\(([^,]+),`, "g").exec(c);
|
157
|
-
if (!h)
|
158
|
-
return console.error("Could not find the original declaration");
|
159
|
-
const u = (m = h.at(1)) == null ? void 0 : m.trim(), { element: g, variantKeys: F } = f.props, S = `${y} = styled(${u}, "${f.classNames}", "${f._callerName}", ${JSON.stringify(g)}, ${JSON.stringify(
|
160
|
-
F
|
161
|
-
)});`, C = new RegExp(`${y}[=\\s]+[^()]+styled\\(([^,]+),[^;]+;`, "g");
|
162
|
-
a = a.replace(C, S);
|
163
|
-
});
|
164
|
-
const b = T(e, 6);
|
165
|
-
return d.importStrategy === "component" && (a = `import '../../saltygen/css/${b}.css';
|
166
|
-
${a}`), a = a.replace("{ styled }", "{ styledClient as styled }"), a = a.replace("@salty-css/react/styled", "@salty-css/react/styled-client"), a;
|
167
|
-
}
|
168
|
-
} catch (n) {
|
169
|
-
console.error(n);
|
170
|
-
}
|
171
|
-
};
|
1
|
+
import "esbuild";
|
2
|
+
import "child_process";
|
3
|
+
import "../dash-case-DBThphLm.js";
|
4
|
+
import "path";
|
5
|
+
import "fs";
|
6
|
+
import "fs/promises";
|
7
|
+
import "../parse-templates-DnLWJ7Hc.js";
|
8
|
+
import { d as p, c as n, g, e as F, i as y, m as x, s as S, b as c } from "../index-AXVHdDqw.js";
|
172
9
|
export {
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
X as saltyFileRegExp
|
10
|
+
p as compileSaltyFile,
|
11
|
+
n as generateConfigStyles,
|
12
|
+
g as generateCss,
|
13
|
+
F as generateFile,
|
14
|
+
y as isSaltyFile,
|
15
|
+
x as minimizeFile,
|
16
|
+
S as saltyFileExtensions,
|
17
|
+
c as saltyFileRegExp
|
182
18
|
};
|
package/config/config-types.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
import { CssStyles } from '../types';
|
2
|
-
|
3
|
-
|
4
|
-
};
|
1
|
+
import { CssProperties, CssStyles } from '../types';
|
2
|
+
import { OrString } from '../types/util-types';
|
3
|
+
export type GlobalStyles = Record<string, CssProperties>;
|
5
4
|
export type CssVariables = Record<string, unknown>;
|
6
5
|
export interface CssResponsiveVariables {
|
7
6
|
[key: string]: CssVariables;
|
@@ -11,6 +10,9 @@ export interface CssConditionalVariables {
|
|
11
10
|
[key: PropertyKey]: CssVariables;
|
12
11
|
};
|
13
12
|
}
|
13
|
+
type CssTemplate = CssStyles | {
|
14
|
+
[key: PropertyKey]: CssTemplate;
|
15
|
+
};
|
14
16
|
export interface CssTemplates {
|
15
17
|
[key: PropertyKey]: {
|
16
18
|
[key: PropertyKey]: CssTemplate;
|
@@ -46,7 +48,11 @@ export interface SaltyConfig {
|
|
46
48
|
/**
|
47
49
|
* The global styles that are imported in the root of the project.
|
48
50
|
*/
|
49
|
-
|
51
|
+
reset?: 'default' | 'none' | GlobalStyles;
|
52
|
+
/**
|
53
|
+
* The global styles that are imported in the root of the project.
|
54
|
+
*/
|
55
|
+
global?: GlobalStyles;
|
50
56
|
/**
|
51
57
|
* The templates that can be used in styles to create reusable css.
|
52
58
|
*/
|
@@ -55,5 +61,9 @@ export interface SaltyConfig {
|
|
55
61
|
* The modifiers that can transform css values.
|
56
62
|
*/
|
57
63
|
modifiers?: CssModifiers;
|
64
|
+
/**
|
65
|
+
* Define modules that should not be bundled when generating the css file. This improves the performance of the css generation and can help with issues relared to external packages being imported in an environment that does not support them.
|
66
|
+
*/
|
67
|
+
externalModules?: ('react' | 'react-dom' | OrString)[];
|
58
68
|
}
|
59
69
|
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const n=e=>String.fromCharCode(e+(e>25?39:97)),i=(e,r)=>{let t="",a;for(a=Math.abs(e);a>52;a=a/52|0)t=n(a%52)+t;return t=n(a%52)+t,t.length<r?t=t.padStart(r,"a"):t.length>r&&(t=t.slice(-r)),t},o=(e,r)=>{let t=r.length;for(;t;)e=e*33^r.charCodeAt(--t);return e},c=(e,r=5)=>{const t=o(5381,JSON.stringify(e))>>>0;return i(t,r)};function s(e){return e?typeof e!="string"?s(String(e)):e.replace(/[\s.]/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(r,t)=>(t>0?"-":"")+r.toLowerCase()):""}exports.dashCase=s;exports.toHash=c;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
const n = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), o = (e, r) => {
|
2
|
+
let t = "", a;
|
3
|
+
for (a = Math.abs(e); a > 52; a = a / 52 | 0) t = n(a % 52) + t;
|
4
|
+
return t = n(a % 52) + t, t.length < r ? t = t.padStart(r, "a") : t.length > r && (t = t.slice(-r)), t;
|
5
|
+
}, i = (e, r) => {
|
6
|
+
let t = r.length;
|
7
|
+
for (; t; ) e = e * 33 ^ r.charCodeAt(--t);
|
8
|
+
return e;
|
9
|
+
}, c = (e, r = 5) => {
|
10
|
+
const t = i(5381, JSON.stringify(e)) >>> 0;
|
11
|
+
return o(t, r);
|
12
|
+
};
|
13
|
+
function s(e) {
|
14
|
+
return e ? typeof e != "string" ? s(String(e)) : e.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (r, t) => (t > 0 ? "-" : "") + r.toLowerCase()) : "";
|
15
|
+
}
|
16
|
+
export {
|
17
|
+
s as d,
|
18
|
+
c as t
|
19
|
+
};
|
package/generator/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";var y=Object.defineProperty;var f=(a,t,s)=>t in a?y(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s;var c=(a,t,s)=>f(a,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../dash-case-BJEkFEGQ.cjs"),u=require("../parse-templates-DdYSw-iq.cjs");class N{constructor(t,s){c(this,"_isProd");c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return d.toHash(this.params.base||this.params)}get priority(){var t;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get classNames(){const t=[this.hash],{className:s}=this.params;return s&&t.push(s),t.join(" ")}get cssClassName(){return this.hash}get cssDisplayNameVar(){return`--${this.hash}-display-name: ${this._callerName};`}get cssFileName(){return this._callerName?`c_${d.dashCase(this._callerName)}-${this.hash}-${this.priority}.css`:`${this.hash}-${this.priority}.css`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?u.getTemplateKeys(this._context.config.templates):[]}get css(){var n;const{base:t={},variants:s={},compoundVariants:i=[]}=this.params,r={...t,variants:s,compoundVariants:i};return u.parseStyles(r,`.${this.cssClassName}`,this.priority,(n=this._context)==null?void 0:n.config)}get props(){const{element:t,variants:s={},compoundVariants:i=[],defaultVariants:r={},defaultProps:n={},passProps:g}=this.params,h=new Set([]),p=e=>{const o=r[e];o!==void 0?h.add(`${e}=${String(o)}`):h.add(e)};Object.keys(s).forEach(p),i.map(e=>Object.keys(e).forEach(p));const l=new Set([]);if(this.params.base){const e=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);e&&e.forEach(o=>{const m=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");m&&l.add(m)})}return{element:t,variantKeys:[...h],propValueKeys:[...l],passProps:g,defaultProps:n,attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:s,config:i,prod:r}=t;return this._isProd=r,this._callerName=s,this}}exports.StyleComponentGenerator=N;
|
package/generator/index.js
CHANGED
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
var u = Object.defineProperty;
|
2
|
+
var f = (a, t, s) => t in a ? u(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
|
3
|
+
var c = (a, t, s) => f(a, typeof t != "symbol" ? t + "" : t, s);
|
4
|
+
import { t as g, d as y } from "../dash-case-DBThphLm.js";
|
5
|
+
import { g as N, p as _ } from "../parse-templates-DnLWJ7Hc.js";
|
6
|
+
class v {
|
4
7
|
constructor(t, s) {
|
8
|
+
c(this, "_isProd");
|
9
|
+
c(this, "_callerName");
|
10
|
+
c(this, "_context");
|
5
11
|
this.tagName = t, this.params = s;
|
6
12
|
}
|
7
13
|
get hash() {
|
8
|
-
return
|
14
|
+
return g(this.params.base || this.params);
|
9
15
|
}
|
10
16
|
get priority() {
|
11
17
|
var t;
|
@@ -21,32 +27,49 @@ class p {
|
|
21
27
|
get cssDisplayNameVar() {
|
22
28
|
return `--${this.hash}-display-name: ${this._callerName};`;
|
23
29
|
}
|
30
|
+
get cssFileName() {
|
31
|
+
return this._callerName ? `c_${y(this._callerName)}-${this.hash}-${this.priority}.css` : `${this.hash}-${this.priority}.css`;
|
32
|
+
}
|
24
33
|
get templateKeys() {
|
25
34
|
var t;
|
26
|
-
return (t = this._context) != null && t.config.templates ?
|
35
|
+
return (t = this._context) != null && t.config.templates ? N(this._context.config.templates) : [];
|
27
36
|
}
|
28
37
|
get css() {
|
29
|
-
var
|
30
|
-
const { base: t = {}, variants: s = {}, compoundVariants:
|
31
|
-
return
|
38
|
+
var n;
|
39
|
+
const { base: t = {}, variants: s = {}, compoundVariants: i = [] } = this.params, r = { ...t, variants: s, compoundVariants: i };
|
40
|
+
return _(r, `.${this.cssClassName}`, this.priority, (n = this._context) == null ? void 0 : n.config);
|
32
41
|
}
|
33
42
|
get props() {
|
34
|
-
const { element: t } =
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
43
|
+
const { element: t, variants: s = {}, compoundVariants: i = [], defaultVariants: r = {}, defaultProps: n = {}, passProps: d } = this.params, h = /* @__PURE__ */ new Set([]), p = (e) => {
|
44
|
+
const o = r[e];
|
45
|
+
o !== void 0 ? h.add(`${e}=${String(o)}`) : h.add(e);
|
46
|
+
};
|
47
|
+
Object.keys(s).forEach(p), i.map((e) => Object.keys(e).forEach(p));
|
48
|
+
const m = /* @__PURE__ */ new Set([]);
|
49
|
+
if (this.params.base) {
|
50
|
+
const e = JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);
|
51
|
+
e && e.forEach((o) => {
|
52
|
+
const l = o.replace(/\{props\.([\w\d]+)\}/gi, "$1");
|
53
|
+
l && m.add(l);
|
54
|
+
});
|
55
|
+
}
|
39
56
|
return {
|
40
57
|
element: t,
|
41
|
-
variantKeys:
|
58
|
+
variantKeys: [...h],
|
59
|
+
propValueKeys: [...m],
|
60
|
+
passProps: d,
|
61
|
+
defaultProps: n,
|
62
|
+
attr: {
|
63
|
+
"data-component-name": this._isProd ? void 0 : this._callerName
|
64
|
+
}
|
42
65
|
};
|
43
66
|
}
|
44
67
|
_withBuildContext(t) {
|
45
68
|
this._context = t;
|
46
|
-
const { name: s, config:
|
47
|
-
return this._callerName = s, this;
|
69
|
+
const { name: s, config: i, prod: r } = t;
|
70
|
+
return this._isProd = r, this._callerName = s, this;
|
48
71
|
}
|
49
72
|
}
|
50
73
|
export {
|
51
|
-
|
74
|
+
v as StyleComponentGenerator
|
52
75
|
};
|
@@ -1,2 +1,4 @@
|
|
1
1
|
export declare const parseTemplates: <T extends object>(obj: T, path?: PropertyKey[]) => string;
|
2
2
|
export declare const getTemplateKeys: <T extends object>(templates: T) => string[];
|
3
|
+
export declare const getTemplateTypes: <T extends object>(templates: T) => Record<string, string>;
|
4
|
+
export declare const getTemplateTokens: <T extends object>(templates: T, parent?: string, templateTokens?: Set<string>) => string[];
|
@@ -1,7 +1,18 @@
|
|
1
1
|
import { StyledParams, Tag } from '../types';
|
2
|
+
export interface GeneratorProps {
|
3
|
+
element?: string;
|
4
|
+
variantKeys?: string[];
|
5
|
+
propValueKeys?: string[];
|
6
|
+
passProps?: boolean | string | string[];
|
7
|
+
defaultProps?: Record<PropertyKey, unknown>;
|
8
|
+
attr: {
|
9
|
+
[key: string]: any;
|
10
|
+
};
|
11
|
+
}
|
2
12
|
export declare class StyleComponentGenerator {
|
3
13
|
tagName: Tag<any>;
|
4
14
|
params: StyledParams;
|
15
|
+
_isProd: boolean | undefined;
|
5
16
|
_callerName: string | undefined;
|
6
17
|
_context: {
|
7
18
|
name: string;
|
@@ -13,14 +24,13 @@ export declare class StyleComponentGenerator {
|
|
13
24
|
get classNames(): string;
|
14
25
|
get cssClassName(): string;
|
15
26
|
get cssDisplayNameVar(): string;
|
27
|
+
get cssFileName(): string;
|
16
28
|
get templateKeys(): string[];
|
17
29
|
get css(): string;
|
18
|
-
get props():
|
19
|
-
element: string | undefined;
|
20
|
-
variantKeys: string[] | undefined;
|
21
|
-
};
|
30
|
+
get props(): GeneratorProps;
|
22
31
|
_withBuildContext(context: {
|
23
32
|
name: string;
|
24
33
|
config: any;
|
34
|
+
prod: boolean;
|
25
35
|
}): this;
|
26
36
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="/* Empty */";exports.default=e;
|