@salty-css/core 0.2.0 → 0.2.2-refactor-vite-8.4
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/astro-component-Ov1RH0CO.js +4 -0
- package/dist/astro-component-r0qEcF1p.cjs +14 -0
- package/{bin → dist/bin}/bin-util.d.ts +1 -0
- package/dist/bin/bin-util.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/build.d.ts +1 -0
- package/dist/bin/commands/build.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/generate.d.ts +1 -0
- package/dist/bin/commands/generate.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/init.d.ts +1 -0
- package/dist/bin/commands/init.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/update.d.ts +1 -0
- package/dist/bin/commands/update.d.ts.map +1 -0
- package/{bin → dist/bin}/commands/version.d.ts +1 -0
- package/dist/bin/commands/version.d.ts.map +1 -0
- package/{bin → dist/bin}/confirm-install.d.ts +1 -0
- package/dist/bin/confirm-install.d.ts.map +1 -0
- package/{bin → dist/bin}/context.d.ts +1 -0
- package/dist/bin/context.d.ts.map +1 -0
- package/{bin → dist/bin}/detection/css-file.d.ts +1 -0
- package/dist/bin/detection/css-file.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/astro.d.ts +1 -0
- package/dist/bin/frameworks/astro.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/index.d.ts +1 -0
- package/dist/bin/frameworks/index.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/react.d.ts +1 -0
- package/dist/bin/frameworks/react.d.ts.map +1 -0
- package/{bin → dist/bin}/frameworks/types.d.ts +1 -0
- package/dist/bin/frameworks/types.d.ts.map +1 -0
- package/dist/bin/index.cjs +2 -0
- package/dist/bin/index.d.ts +3 -0
- package/dist/bin/index.d.ts.map +1 -0
- package/dist/bin/index.js +5 -0
- package/{bin → dist/bin}/integrations/astro.d.ts +1 -0
- package/dist/bin/integrations/astro.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/eslint.d.ts +1 -0
- package/dist/bin/integrations/eslint.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/index.d.ts +1 -0
- package/dist/bin/integrations/index.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/next.d.ts +1 -0
- package/dist/bin/integrations/next.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/types.d.ts +1 -0
- package/dist/bin/integrations/types.d.ts.map +1 -0
- package/{bin → dist/bin}/integrations/vite.d.ts +1 -0
- package/dist/bin/integrations/vite.d.ts.map +1 -0
- package/{bin → dist/bin}/logger.d.ts +1 -0
- package/dist/bin/logger.d.ts.map +1 -0
- package/dist/bin/main.cjs +1 -0
- package/{bin → dist/bin}/main.d.ts +1 -0
- package/dist/bin/main.d.ts.map +1 -0
- package/dist/bin/main.js +2 -0
- package/{bin → dist/bin}/package-json.d.ts +1 -0
- package/dist/bin/package-json.d.ts.map +1 -0
- package/{bin → dist/bin}/path-defaults.d.ts +1 -0
- package/dist/bin/path-defaults.d.ts.map +1 -0
- package/{bin → dist/bin}/prettier.d.ts +1 -0
- package/dist/bin/prettier.d.ts.map +1 -0
- package/{bin → dist/bin}/saltyrc.d.ts +1 -0
- package/dist/bin/saltyrc.d.ts.map +1 -0
- package/dist/bin/templates.d.ts +15 -0
- package/dist/bin/templates.d.ts.map +1 -0
- package/dist/chunk-CMqjfN_6.cjs +1 -0
- package/dist/compiler/get-files.cjs +1 -0
- package/{compiler → dist/compiler}/get-files.d.ts +1 -0
- package/dist/compiler/get-files.d.ts.map +1 -0
- package/dist/compiler/get-files.js +15 -0
- package/dist/compiler/get-function-range.cjs +1 -0
- package/{compiler → dist/compiler}/get-function-range.d.ts +1 -0
- package/dist/compiler/get-function-range.d.ts.map +1 -0
- package/dist/compiler/get-function-range.js +17 -0
- package/dist/compiler/helpers.cjs +1 -0
- package/{compiler → dist/compiler}/helpers.d.ts +1 -0
- package/dist/compiler/helpers.d.ts.map +1 -0
- package/dist/compiler/helpers.js +24 -0
- package/{compiler → dist/compiler}/resolve-import.d.ts +1 -0
- package/dist/compiler/resolve-import.d.ts.map +1 -0
- package/dist/compiler/salty-compiler.cjs +1 -0
- package/{compiler → dist/compiler}/salty-compiler.d.ts +1 -0
- package/dist/compiler/salty-compiler.d.ts.map +1 -0
- package/dist/compiler/salty-compiler.js +2 -0
- package/{config → dist/config}/define-config.d.ts +1 -0
- package/dist/config/define-config.d.ts.map +1 -0
- package/dist/config/index.cjs +1 -0
- package/{config → dist/config}/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +5 -0
- package/dist/css/index.cjs +1 -0
- package/{css → dist/css}/index.d.ts +1 -0
- package/dist/css/index.d.ts.map +1 -0
- package/dist/css/index.js +5 -0
- package/dist/css/keyframes.cjs +1 -0
- package/{css → dist/css}/keyframes.d.ts +1 -0
- package/dist/css/keyframes.d.ts.map +1 -0
- package/dist/css/keyframes.js +30 -0
- package/dist/css/media.cjs +1 -0
- package/{css → dist/css}/media.d.ts +1 -0
- package/dist/css/media.d.ts.map +1 -0
- package/dist/css/media.js +84 -0
- package/dist/css/merge.cjs +1 -0
- package/{css → dist/css}/merge.d.ts +1 -0
- package/dist/css/merge.d.ts.map +1 -0
- package/dist/css/merge.js +20 -0
- package/dist/css/token.cjs +1 -0
- package/{css → dist/css}/token.d.ts +1 -0
- package/dist/css/token.d.ts.map +1 -0
- package/dist/css/token.js +4 -0
- package/{factories → dist/factories}/define-font.d.ts +1 -0
- package/dist/factories/define-font.d.ts.map +1 -0
- package/{factories → dist/factories}/define-global-styles.d.ts +1 -0
- package/dist/factories/define-global-styles.d.ts.map +1 -0
- package/{factories → dist/factories}/define-import.d.ts +1 -0
- package/dist/factories/define-import.d.ts.map +1 -0
- package/{factories → dist/factories}/define-media-query.d.ts +1 -0
- package/dist/factories/define-media-query.d.ts.map +1 -0
- package/{factories → dist/factories}/define-templates.d.ts +1 -0
- package/dist/factories/define-templates.d.ts.map +1 -0
- package/{factories → dist/factories}/define-variables.d.ts +1 -0
- package/dist/factories/define-variables.d.ts.map +1 -0
- package/dist/factories/index.cjs +1 -0
- package/{factories → dist/factories}/index.d.ts +1 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +149 -0
- package/{generators → dist/generators}/class-name-generator.d.ts +1 -0
- package/dist/generators/class-name-generator.d.ts.map +1 -0
- package/dist/generators/index.cjs +1 -0
- package/{generators → dist/generators}/index.d.ts +1 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +2 -0
- package/{generators → dist/generators}/styled-generator.d.ts +1 -0
- package/dist/generators/styled-generator.d.ts.map +1 -0
- package/{generators → dist/generators}/styles-generator.d.ts +1 -0
- package/dist/generators/styles-generator.d.ts.map +1 -0
- package/dist/generators-CrK45F8i.js +112 -0
- package/dist/generators-eEKEtyAm.cjs +1 -0
- package/{helpers → dist/helpers}/color.d.ts +1 -0
- package/dist/helpers/color.d.ts.map +1 -0
- package/dist/helpers/index.cjs +1 -0
- package/{helpers → dist/helpers}/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +33 -0
- package/{helpers → dist/helpers}/viewport-clamp.d.ts +1 -0
- package/dist/helpers/viewport-clamp.d.ts.map +1 -0
- package/dist/instances/classname-instance.cjs +1 -0
- package/{instances → dist/instances}/classname-instance.d.ts +1 -0
- package/dist/instances/classname-instance.d.ts.map +1 -0
- package/dist/instances/classname-instance.js +18 -0
- package/dist/main-DGpSu6zK.js +545 -0
- package/dist/main-LnoqOq21.cjs +11 -0
- package/dist/maybe.d.ts +2 -0
- package/dist/maybe.d.ts.map +1 -0
- package/dist/parse-styles-2rwbF9j_.cjs +3 -0
- package/dist/parse-styles-Bz0otiZ-.js +336 -0
- package/dist/parsers/index.cjs +3 -0
- package/{parsers → dist/parsers}/index.d.ts +1 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +79 -0
- package/{parsers → dist/parsers}/parse-modifiers.d.ts +1 -0
- package/dist/parsers/parse-modifiers.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parse-styles.d.ts +1 -0
- package/dist/parsers/parse-styles.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parse-templates.d.ts +1 -0
- package/dist/parsers/parse-templates.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parse-tokens.d.ts +1 -0
- package/dist/parsers/parse-tokens.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parser-regexes.d.ts +1 -0
- package/dist/parsers/parser-regexes.d.ts.map +1 -0
- package/{parsers → dist/parsers}/parser-types.d.ts +1 -0
- package/dist/parsers/parser-types.d.ts.map +1 -0
- package/{parsers → dist/parsers}/property-name-check.d.ts +1 -0
- package/dist/parsers/property-name-check.d.ts.map +1 -0
- package/{parsers → dist/parsers}/resolve-template-variants.d.ts +1 -0
- package/dist/parsers/resolve-template-variants.d.ts.map +1 -0
- package/{parsers → dist/parsers}/strict.d.ts +1 -0
- package/dist/parsers/strict.d.ts.map +1 -0
- package/{parsers → dist/parsers}/unit-check.d.ts +1 -0
- package/dist/parsers/unit-check.d.ts.map +1 -0
- package/dist/runtime/index.cjs +2 -0
- package/{runtime → dist/runtime}/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +20 -0
- package/dist/salty-compiler-Bvd0OKHz.cjs +33 -0
- package/dist/salty-compiler-CvQ-rsex.js +484 -0
- package/dist/salty.config-B0ZiRpHR.cjs +7 -0
- package/dist/salty.config-DWF4i7K0.js +4 -0
- package/dist/server/index.cjs +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +12 -0
- package/{server → dist/server}/should-restart.d.ts +1 -0
- package/dist/server/should-restart.d.ts.map +1 -0
- package/{styled-file-Cda3EeR6.js → dist/styled-file-BCbAEzBB.cjs} +2 -5
- package/dist/styled-file-C_4eLAdV.js +4 -0
- package/dist/styled-file-DQHLzmuL.js +4 -0
- package/{styled-file-DLcgYmGN.js → dist/styled-file-DorArlCk.cjs} +2 -5
- package/{templates → dist/templates}/salty-reset.d.ts +1 -0
- package/dist/templates/salty-reset.d.ts.map +1 -0
- package/dist/templates-BGHLaAOm.cjs +1 -0
- package/dist/templates-DWWLjEiU.js +4 -0
- package/{types → dist/types}/cli-types.d.ts +1 -0
- package/dist/types/cli-types.d.ts.map +1 -0
- package/{types → dist/types}/config-types.d.ts +1 -0
- package/dist/types/config-types.d.ts.map +1 -0
- package/{types → dist/types}/font-types.d.ts +1 -0
- package/dist/types/font-types.d.ts.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/{types → dist/types}/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +0 -0
- package/{types → dist/types}/util-types.d.ts +1 -0
- package/dist/types/util-types.d.ts.map +1 -0
- package/{util → dist/util}/camel-case.d.ts +1 -0
- package/dist/util/camel-case.d.ts.map +1 -0
- package/{util → dist/util}/dash-case.d.ts +1 -0
- package/dist/util/dash-case.d.ts.map +1 -0
- package/{util → dist/util}/dot-case.d.ts +1 -0
- package/dist/util/dot-case.d.ts.map +1 -0
- package/{util → dist/util}/glob-match.d.ts +1 -0
- package/dist/util/glob-match.d.ts.map +1 -0
- package/dist/util/index.cjs +1 -0
- package/{util → dist/util}/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +72 -0
- package/{util → dist/util}/module-type.d.ts +1 -0
- package/dist/util/module-type.d.ts.map +1 -0
- package/{util → dist/util}/pascal-case.d.ts +1 -0
- package/dist/util/pascal-case.d.ts.map +1 -0
- package/{util → dist/util}/to-hash.d.ts +1 -0
- package/dist/util/to-hash.d.ts.map +1 -0
- package/dist/vanilla-file-BEqMIe-6.js +4 -0
- package/{vanilla-file-1kOqbCIM.js → dist/vanilla-file-Z3VsOa_U.cjs} +2 -5
- package/dist/viewport-clamp-CHOyzt37.cjs +1 -0
- package/dist/viewport-clamp-CRtzRvJ3.js +7 -0
- package/package.json +67 -64
- package/README.md +0 -535
- package/astro-component-5hrNTCJ5.js +0 -4
- package/astro-component-Dj3enX6K.cjs +0 -4
- package/bin/index.cjs +0 -4
- package/bin/index.d.ts +0 -2
- package/bin/index.js +0 -3
- package/bin/main.cjs +0 -783
- package/bin/main.js +0 -782
- package/bin/templates.d.ts +0 -14
- package/class-name-generator-BcbeZdcV.cjs +0 -88
- package/class-name-generator-DJ27JHW_.js +0 -89
- package/compiler/get-files.cjs +0 -25
- package/compiler/get-files.js +0 -25
- package/compiler/get-function-range.cjs +0 -22
- package/compiler/get-function-range.js +0 -22
- package/compiler/helpers.cjs +0 -34
- package/compiler/helpers.js +0 -33
- package/compiler/salty-compiler.cjs +0 -846
- package/compiler/salty-compiler.js +0 -828
- package/config/index.cjs +0 -20
- package/config/index.js +0 -20
- package/css/index.cjs +0 -12
- package/css/index.js +0 -12
- package/css/keyframes.cjs +0 -49
- package/css/keyframes.js +0 -49
- package/css/media.cjs +0 -93
- package/css/media.js +0 -93
- package/css/merge.cjs +0 -20
- package/css/merge.js +0 -20
- package/css/token.cjs +0 -4
- package/css/token.js +0 -4
- package/define-templates-CVhhgPnd.js +0 -60
- package/define-templates-Deq1aCbN.cjs +0 -59
- package/factories/index.cjs +0 -177
- package/factories/index.js +0 -177
- package/generators/index.cjs +0 -58
- package/generators/index.js +0 -59
- package/glob-match-C28iYp1A.js +0 -74
- package/glob-match-CT1uFlp-.cjs +0 -73
- package/helpers/index.cjs +0 -53
- package/helpers/index.js +0 -53
- package/index-ByR0nfaf.cjs +0 -4
- package/index-DKz1QXqs.js +0 -4
- package/instances/classname-instance.cjs +0 -31
- package/instances/classname-instance.js +0 -31
- package/parse-styles-BlUpavVg.js +0 -521
- package/parse-styles-DWT4tDyS.cjs +0 -520
- package/parsers/index.cjs +0 -147
- package/parsers/index.js +0 -148
- package/pascal-case-By_l58S-.cjs +0 -7
- package/pascal-case-F3Usi5Wf.js +0 -8
- package/runtime/index.cjs +0 -24
- package/runtime/index.js +0 -24
- package/salty.config-DogY_sSQ.cjs +0 -4
- package/salty.config-GV37Q-D2.js +0 -4
- package/server/index.cjs +0 -4
- package/server/index.d.ts +0 -1
- package/server/index.js +0 -4
- package/should-restart-CQsyHls3.cjs +0 -17
- package/should-restart-CXIO0jxY.js +0 -18
- package/styled-file-BzmB9_Ez.cjs +0 -12
- package/styled-file-CPd_rTW2.cjs +0 -11
- package/to-hash-DSoCPs8D.js +0 -33
- package/to-hash-DT2ImSPA.cjs +0 -32
- package/types/index.cjs +0 -1
- package/types/index.js +0 -1
- package/util/index.cjs +0 -18
- package/util/index.js +0 -18
- package/vanilla-file-r0fp2q_m.cjs +0 -18
- package/viewport-clamp-CEmzmcSj.cjs +0 -10
- package/viewport-clamp-K553uXu3.js +0 -11
- /package/{.saltyrc.schema.json → dist/.saltyrc.schema.json} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region src/css/media.ts
|
|
2
|
+
var e = class e {
|
|
3
|
+
base;
|
|
4
|
+
constructor(e = "@media") {
|
|
5
|
+
this.base = e;
|
|
6
|
+
}
|
|
7
|
+
next = (t) => {
|
|
8
|
+
let n = new String(t);
|
|
9
|
+
return Object.assign(n, {
|
|
10
|
+
get isMedia() {
|
|
11
|
+
return !0;
|
|
12
|
+
},
|
|
13
|
+
get and() {
|
|
14
|
+
return new e(`${t} and`);
|
|
15
|
+
},
|
|
16
|
+
get or() {
|
|
17
|
+
return new e(`${t},`);
|
|
18
|
+
}
|
|
19
|
+
}), n;
|
|
20
|
+
};
|
|
21
|
+
custom(e) {
|
|
22
|
+
return this.next(`${this.base} ${e}`);
|
|
23
|
+
}
|
|
24
|
+
minWidth(e) {
|
|
25
|
+
let t = typeof e == "number" ? `${e}px` : e, n = `${this.base} (min-width: ${t})`;
|
|
26
|
+
return this.next(n);
|
|
27
|
+
}
|
|
28
|
+
maxWidth(e) {
|
|
29
|
+
let t = typeof e == "number" ? `${e}px` : e, n = `${this.base} (max-width: ${t})`;
|
|
30
|
+
return this.next(n);
|
|
31
|
+
}
|
|
32
|
+
minHeight(e) {
|
|
33
|
+
let t = typeof e == "number" ? `${e}px` : e, n = `${this.base} (min-height: ${t})`;
|
|
34
|
+
return this.next(n);
|
|
35
|
+
}
|
|
36
|
+
maxHeight(e) {
|
|
37
|
+
let t = typeof e == "number" ? `${e}px` : e, n = `${this.base} (max-height: ${t})`;
|
|
38
|
+
return this.next(n);
|
|
39
|
+
}
|
|
40
|
+
get portrait() {
|
|
41
|
+
let e = `${this.base} (orientation: portrait)`;
|
|
42
|
+
return this.next(e);
|
|
43
|
+
}
|
|
44
|
+
get landscape() {
|
|
45
|
+
let e = `${this.base} (orientation: landscape)`;
|
|
46
|
+
return this.next(e);
|
|
47
|
+
}
|
|
48
|
+
prefersColorScheme(e) {
|
|
49
|
+
let t = `${this.base} (prefers-color-scheme: ${e})`;
|
|
50
|
+
return this.next(t);
|
|
51
|
+
}
|
|
52
|
+
get dark() {
|
|
53
|
+
return this.prefersColorScheme("dark");
|
|
54
|
+
}
|
|
55
|
+
get light() {
|
|
56
|
+
return this.prefersColorScheme("light");
|
|
57
|
+
}
|
|
58
|
+
get print() {
|
|
59
|
+
let e = `${this.base} print`;
|
|
60
|
+
return this.next(e);
|
|
61
|
+
}
|
|
62
|
+
get screen() {
|
|
63
|
+
let e = `${this.base} screen`;
|
|
64
|
+
return this.next(e);
|
|
65
|
+
}
|
|
66
|
+
get speech() {
|
|
67
|
+
let e = `${this.base} speech`;
|
|
68
|
+
return this.next(e);
|
|
69
|
+
}
|
|
70
|
+
get all() {
|
|
71
|
+
let e = `${this.base} all`;
|
|
72
|
+
return this.next(e);
|
|
73
|
+
}
|
|
74
|
+
get not() {
|
|
75
|
+
let e = `${this.base} not`;
|
|
76
|
+
return this.next(e);
|
|
77
|
+
}
|
|
78
|
+
get reducedMotion() {
|
|
79
|
+
let e = `${this.base} (prefers-reduced-motion: reduce)`;
|
|
80
|
+
return this.next(e);
|
|
81
|
+
}
|
|
82
|
+
}, t = new e();
|
|
83
|
+
//#endregion
|
|
84
|
+
export { e as MediaQueryFactory, t as media };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(...e)=>e.flat().reduce((e,t)=>{if(!t||typeof t!=`object`)return e;if(`_current`in t){let n=t._current||{};return typeof n!=`object`&&(n={}),{...e,...n}}return{...e,...t}},{}),t=(...e)=>e.flat().reduce((e,t)=>({...e,...t._children}),{});exports.mergeFactories=t,exports.mergeObjects=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/css/merge.ts"],"names":[],"mappings":"AACA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,GAAG,GAAG,EAAE,GAAG,QAAQ,GAAG,EAAE,KAAG,CAUxD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,YAAY,EAAE,GAAG,WAAW,CAAC,EAAE,EAAE,KAAG,CAI5E,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/css/merge.ts
|
|
2
|
+
var e = (...e) => e.flat().reduce((e, t) => {
|
|
3
|
+
if (!t || typeof t != "object") return e;
|
|
4
|
+
if ("_current" in t) {
|
|
5
|
+
let n = t._current || {};
|
|
6
|
+
return typeof n != "object" && (n = {}), {
|
|
7
|
+
...e,
|
|
8
|
+
...n
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
...e,
|
|
13
|
+
...t
|
|
14
|
+
};
|
|
15
|
+
}, {}), t = (...e) => e.flat().reduce((e, t) => ({
|
|
16
|
+
...e,
|
|
17
|
+
...t._children
|
|
18
|
+
}), {});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { t as mergeFactories, e as mergeObjects };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=e=>`{${e}}`;exports.token=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/css/token.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,cAAc,EAAE,OAAO,CAAC,WAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-font.d.ts","sourceRoot":"","sources":["../../src/factories/define-font.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiD,MAAM,qBAAqB,CAAC;AAiFvG,MAAM,WAAW,OAAO;IACtB,gGAAgG;IAChG,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,WAAW;aAKM,QAAQ,EAAE,iBAAiB;IAJvD,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEN,QAAQ,EAAE,iBAAiB;IAgBvD,IAAI,YAAY,IAAI,IAAI,CAEvB;IAED,gEAAgE;IACzD,QAAQ,IAAI,MAAM;IAIzB,6DAA6D;IAC7D,IAAW,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKzC;IAED,oDAAoD;IAC7C,MAAM,IAAI,OAAO;CAiBzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,iBAAiB,KAAG,WAEvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-global-styles.d.ts","sourceRoot":"","sources":["../../src/factories/define-global-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAa,mBAAmB;IACX,QAAQ,EAAE,YAAY;gBAAtB,QAAQ,EAAE,YAAY;IAEzC,IAAI,cAAc,YAEjB;CACF;AAED,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY,wBAEtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-import.d.ts","sourceRoot":"","sources":["../../src/factories/define-import.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAEpD,qBAAa,aAAa;IAGL,QAAQ,EAAE,UAAU,EAAE;IAFlC,KAAK,CAAC,EAAE,MAAM,CAAC;gBAEH,QAAQ,EAAE,UAAU,EAAE;IAEzC,IAAI,cAAc,YAEjB;IAEM,QAAQ,CAAC,IAAI,EAAE,MAAM;CAI7B;AAED,eAAO,MAAM,YAAY,GAAI,GAAG,OAAO,UAAU,EAAE,kBAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-media-query.d.ts","sourceRoot":"","sources":["../../src/factories/define-media-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAExD,KAAK,uBAAuB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnG,eAAO,MAAM,gBAAgB,GAAI,cAAc,uBAAuB;;;;CAErE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-templates.d.ts","sourceRoot":"","sources":["../../src/factories/define-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE7F,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,iBAAiB,GAAG,mBAAmB,CAAC;CACnD;AAED,qBAAa,eAAe;IAEP,MAAM,EAAE,qBAAqB;IADzC,KAAK,CAAC,EAAE,MAAM,CAAC;gBACH,MAAM,EAAE,qBAAqB;IAEhD,IAAI,QAAQ,IAAI,iBAAiB,GAAG,mBAAmB,CAEtD;IAED,IAAI,gBAAgB,YAEnB;IAEM,QAAQ,CAAC,IAAI,EAAE,MAAM;CAI7B;AAED,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAElD,qBAAa,gBAAgB;IAIR,MAAM,EAAE,sBAAsB;IAH1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,SAAS,CAAyB;gBAEvB,MAAM,EAAE,sBAAsB;IAWjD,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,IAAI,SAAS;;MAMZ;IAED,IAAI,iBAAiB,YAEpB;IAEM,QAAQ,CAAC,IAAI,EAAE,MAAM;CAK7B;AAED,eAAO,MAAM,eAAe,GAAI,WAAW,sBAAsB,qBAEhE,CAAC"}
|
|
@@ -10,3 +10,4 @@ export declare class VariablesFactory {
|
|
|
10
10
|
@param conditional Variables that are defined for different parent selectors (classes or data attributes).
|
|
11
11
|
*/
|
|
12
12
|
export declare const defineVariables: (variables: SaltyVariables) => VariablesFactory;
|
|
13
|
+
//# sourceMappingURL=define-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-variables.d.ts","sourceRoot":"","sources":["../../src/factories/define-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,qBAAa,gBAAgB;IACR,QAAQ,EAAE,cAAc;gBAAxB,QAAQ,EAAE,cAAc;IAE3C,IAAI,iBAAiB,YAEpB;CACF;AAED;;;;KAIK;AACL,eAAO,MAAM,eAAe,GAAI,WAAW,cAAc,qBAExD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../util/index.cjs"),t=require("../css/media.cjs");var n={woff2:`woff2`,woff:`woff`,ttf:`truetype`,otf:`opentype`,eot:`embedded-opentype`,svg:`svg`,ttc:`collection`},r=e=>{let t=e.split(`?`)[0].split(`#`)[0],r=t.lastIndexOf(`.`);if(r!==-1)return n[t.slice(r+1).toLowerCase()]},i=e=>typeof e==`string`?{url:e,format:r(e)}:e,a=e=>Array.isArray(e)?e.map(i):[i(e)],o=t=>{let n=t.trim().replace(/^--/,``);if(!n)throw Error(`defineFont: invalid \`variable\` value "${t}".`);return`--${e.dashCase(n)}`},s=t=>{let n=[t.name,t.fallback,`variants`in t?t.variants:void 0,`import`in t?t.import:void 0];return`--font-${e.dashCase(t.name)}-${e.toHash(n,6)}`},c=e=>/^["'].*["']$/.test(e)?e:/\s/.test(e)?`"${e}"`:e,l=(e,t)=>{let n=c(e);return!t||t.length===0?n:[n,t].join(`, `)},u=e=>{let t=[`url("${e.url}")`];return e.format&&t.push(`format("${e.format}")`),e.tech&&t.push(`tech(${e.tech})`),t.join(` `)},d=(e,t,n)=>{let r=a(t.src);if(r.length===0)throw Error(`defineFont(${e}): variant must declare at least one \`src\`.`);let i=[`font-family: ${c(e)};`,`src: ${r.map(u).join(`, `)};`,`font-display: ${t.display??n};`];return t.weight!==void 0&&i.push(`font-weight: ${t.weight};`),t.style!==void 0&&i.push(`font-style: ${t.style};`),t.stretch!==void 0&&i.push(`font-stretch: ${t.stretch};`),t.unicodeRange!==void 0&&i.push(`unicode-range: ${t.unicodeRange};`),t.ascentOverride!==void 0&&i.push(`ascent-override: ${t.ascentOverride};`),t.descentOverride!==void 0&&i.push(`descent-override: ${t.descentOverride};`),t.lineGapOverride!==void 0&&i.push(`line-gap-override: ${t.lineGapOverride};`),t.sizeAdjust!==void 0&&i.push(`size-adjust: ${t.sizeAdjust};`),`@font-face { ${i.join(` `)} }`},f=class{_options;variable;fontFamily;className;constructor(t){if(this._options=t,!t||!t.name)throw Error("defineFont: `name` is required.");if(`variants`in t&&`import`in t&&t.import!==void 0&&t.variants!==void 0)throw Error("defineFont: provide either `variants` or `import`, not both.");if(!(`variants`in t&&t.variants)&&!(`import`in t&&t.import))throw Error("defineFont: must provide either `variants` or `import`.");this.variable=t.variable?o(t.variable):s(t),this.fontFamily=l(t.name,t.fallback),this.className=`font-${e.dashCase(t.name)}`}get isDefineFont(){return!0}toString(){return this.fontFamily}get style(){return{fontFamily:this.fontFamily,[this.variable]:this.fontFamily}}_toCss(){let e=[],t=[];if(`import`in this._options&&this._options.import)e.push(`@import url("${this._options.import}");`);else if(`variants`in this._options&&this._options.variants){let e=this._options.display??`swap`;for(let n of this._options.variants)t.push(d(this._options.name,n,e))}return t.push(`:root { ${this.variable}: ${this.fontFamily}; }`,`.${this.className} { font-family: var(${this.variable}); }`),{imports:e,body:t.join(` `)}}},p=e=>new f(e),m=class{_current;constructor(e){this._current=e}get isGlobalDefine(){return!0}},h=e=>new m(e),g=class{_current;_path;constructor(e){this._current=e}get isDefineImport(){return!0}_setPath(e){return this._path=e,this}},_=(...e)=>new g(e),v=e=>e(t.media),y=class{_current;constructor(e){this._current=e}get isDefineVariables(){return!0}},b=e=>new y(e),x=class{params;_path;constructor(e){this.params=e}get _current(){return this.params.template}get isDefineTemplate(){return!0}_setPath(e){return this._path=e,this}},S=class{params;_path;templates=[];constructor(e){this.params=e,Object.entries(e).forEach(([e,t])=>{this.templates.push(new x({name:e,template:t}))})}get _current(){return this.params}get _children(){return Object.fromEntries(this.templates.map(e=>[e.params.name,e]))}get isDefineTemplates(){return!0}_setPath(e){return this._path=e,this.templates.forEach(t=>t._setPath(e)),this}},C=e=>new S(e);exports.FontFactory=f,exports.GlobalStylesFactory=m,exports.ImportFactory=g,exports.TemplateFactory=x,exports.TemplatesFactory=S,exports.VariablesFactory=y,exports.defineFont=p,exports.defineGlobalStyles=h,exports.defineImport=_,exports.defineMediaQuery=v,exports.defineTemplates=C,exports.defineVariables=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { dashCase as e, toHash as t } from "../util/index.js";
|
|
2
|
+
import { media as n } from "../css/media.js";
|
|
3
|
+
//#region src/factories/define-font.ts
|
|
4
|
+
var r = {
|
|
5
|
+
woff2: "woff2",
|
|
6
|
+
woff: "woff",
|
|
7
|
+
ttf: "truetype",
|
|
8
|
+
otf: "opentype",
|
|
9
|
+
eot: "embedded-opentype",
|
|
10
|
+
svg: "svg",
|
|
11
|
+
ttc: "collection"
|
|
12
|
+
}, i = (e) => {
|
|
13
|
+
let t = e.split("?")[0].split("#")[0], n = t.lastIndexOf(".");
|
|
14
|
+
if (n !== -1) return r[t.slice(n + 1).toLowerCase()];
|
|
15
|
+
}, a = (e) => typeof e == "string" ? {
|
|
16
|
+
url: e,
|
|
17
|
+
format: i(e)
|
|
18
|
+
} : e, o = (e) => Array.isArray(e) ? e.map(a) : [a(e)], s = (t) => {
|
|
19
|
+
let n = t.trim().replace(/^--/, "");
|
|
20
|
+
if (!n) throw Error(`defineFont: invalid \`variable\` value "${t}".`);
|
|
21
|
+
return `--${e(n)}`;
|
|
22
|
+
}, c = (n) => {
|
|
23
|
+
let r = [
|
|
24
|
+
n.name,
|
|
25
|
+
n.fallback,
|
|
26
|
+
"variants" in n ? n.variants : void 0,
|
|
27
|
+
"import" in n ? n.import : void 0
|
|
28
|
+
];
|
|
29
|
+
return `--font-${e(n.name)}-${t(r, 6)}`;
|
|
30
|
+
}, l = (e) => /^["'].*["']$/.test(e) ? e : /\s/.test(e) ? `"${e}"` : e, u = (e, t) => {
|
|
31
|
+
let n = l(e);
|
|
32
|
+
return !t || t.length === 0 ? n : [n, t].join(", ");
|
|
33
|
+
}, d = (e) => {
|
|
34
|
+
let t = [`url("${e.url}")`];
|
|
35
|
+
return e.format && t.push(`format("${e.format}")`), e.tech && t.push(`tech(${e.tech})`), t.join(" ");
|
|
36
|
+
}, f = (e, t, n) => {
|
|
37
|
+
let r = o(t.src);
|
|
38
|
+
if (r.length === 0) throw Error(`defineFont(${e}): variant must declare at least one \`src\`.`);
|
|
39
|
+
let i = [
|
|
40
|
+
`font-family: ${l(e)};`,
|
|
41
|
+
`src: ${r.map(d).join(", ")};`,
|
|
42
|
+
`font-display: ${t.display ?? n};`
|
|
43
|
+
];
|
|
44
|
+
return t.weight !== void 0 && i.push(`font-weight: ${t.weight};`), t.style !== void 0 && i.push(`font-style: ${t.style};`), t.stretch !== void 0 && i.push(`font-stretch: ${t.stretch};`), t.unicodeRange !== void 0 && i.push(`unicode-range: ${t.unicodeRange};`), t.ascentOverride !== void 0 && i.push(`ascent-override: ${t.ascentOverride};`), t.descentOverride !== void 0 && i.push(`descent-override: ${t.descentOverride};`), t.lineGapOverride !== void 0 && i.push(`line-gap-override: ${t.lineGapOverride};`), t.sizeAdjust !== void 0 && i.push(`size-adjust: ${t.sizeAdjust};`), `@font-face { ${i.join(" ")} }`;
|
|
45
|
+
}, p = class {
|
|
46
|
+
_options;
|
|
47
|
+
variable;
|
|
48
|
+
fontFamily;
|
|
49
|
+
className;
|
|
50
|
+
constructor(t) {
|
|
51
|
+
if (this._options = t, !t || !t.name) throw Error("defineFont: `name` is required.");
|
|
52
|
+
if ("variants" in t && "import" in t && t.import !== void 0 && t.variants !== void 0) throw Error("defineFont: provide either `variants` or `import`, not both.");
|
|
53
|
+
if (!("variants" in t && t.variants) && !("import" in t && t.import)) throw Error("defineFont: must provide either `variants` or `import`.");
|
|
54
|
+
this.variable = t.variable ? s(t.variable) : c(t), this.fontFamily = u(t.name, t.fallback), this.className = `font-${e(t.name)}`;
|
|
55
|
+
}
|
|
56
|
+
get isDefineFont() {
|
|
57
|
+
return !0;
|
|
58
|
+
}
|
|
59
|
+
toString() {
|
|
60
|
+
return this.fontFamily;
|
|
61
|
+
}
|
|
62
|
+
get style() {
|
|
63
|
+
return {
|
|
64
|
+
fontFamily: this.fontFamily,
|
|
65
|
+
[this.variable]: this.fontFamily
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
_toCss() {
|
|
69
|
+
let e = [], t = [];
|
|
70
|
+
if ("import" in this._options && this._options.import) e.push(`@import url("${this._options.import}");`);
|
|
71
|
+
else if ("variants" in this._options && this._options.variants) {
|
|
72
|
+
let e = this._options.display ?? "swap";
|
|
73
|
+
for (let n of this._options.variants) t.push(f(this._options.name, n, e));
|
|
74
|
+
}
|
|
75
|
+
return t.push(`:root { ${this.variable}: ${this.fontFamily}; }`, `.${this.className} { font-family: var(${this.variable}); }`), {
|
|
76
|
+
imports: e,
|
|
77
|
+
body: t.join(" ")
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}, m = (e) => new p(e), h = class {
|
|
81
|
+
_current;
|
|
82
|
+
constructor(e) {
|
|
83
|
+
this._current = e;
|
|
84
|
+
}
|
|
85
|
+
get isGlobalDefine() {
|
|
86
|
+
return !0;
|
|
87
|
+
}
|
|
88
|
+
}, g = (e) => new h(e), _ = class {
|
|
89
|
+
_current;
|
|
90
|
+
_path;
|
|
91
|
+
constructor(e) {
|
|
92
|
+
this._current = e;
|
|
93
|
+
}
|
|
94
|
+
get isDefineImport() {
|
|
95
|
+
return !0;
|
|
96
|
+
}
|
|
97
|
+
_setPath(e) {
|
|
98
|
+
return this._path = e, this;
|
|
99
|
+
}
|
|
100
|
+
}, v = (...e) => new _(e), y = (e) => e(n), b = class {
|
|
101
|
+
_current;
|
|
102
|
+
constructor(e) {
|
|
103
|
+
this._current = e;
|
|
104
|
+
}
|
|
105
|
+
get isDefineVariables() {
|
|
106
|
+
return !0;
|
|
107
|
+
}
|
|
108
|
+
}, x = (e) => new b(e), S = class {
|
|
109
|
+
params;
|
|
110
|
+
_path;
|
|
111
|
+
constructor(e) {
|
|
112
|
+
this.params = e;
|
|
113
|
+
}
|
|
114
|
+
get _current() {
|
|
115
|
+
return this.params.template;
|
|
116
|
+
}
|
|
117
|
+
get isDefineTemplate() {
|
|
118
|
+
return !0;
|
|
119
|
+
}
|
|
120
|
+
_setPath(e) {
|
|
121
|
+
return this._path = e, this;
|
|
122
|
+
}
|
|
123
|
+
}, C = class {
|
|
124
|
+
params;
|
|
125
|
+
_path;
|
|
126
|
+
templates = [];
|
|
127
|
+
constructor(e) {
|
|
128
|
+
this.params = e, Object.entries(e).forEach(([e, t]) => {
|
|
129
|
+
this.templates.push(new S({
|
|
130
|
+
name: e,
|
|
131
|
+
template: t
|
|
132
|
+
}));
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
get _current() {
|
|
136
|
+
return this.params;
|
|
137
|
+
}
|
|
138
|
+
get _children() {
|
|
139
|
+
return Object.fromEntries(this.templates.map((e) => [e.params.name, e]));
|
|
140
|
+
}
|
|
141
|
+
get isDefineTemplates() {
|
|
142
|
+
return !0;
|
|
143
|
+
}
|
|
144
|
+
_setPath(e) {
|
|
145
|
+
return this._path = e, this.templates.forEach((t) => t._setPath(e)), this;
|
|
146
|
+
}
|
|
147
|
+
}, w = (e) => new C(e);
|
|
148
|
+
//#endregion
|
|
149
|
+
export { p as FontFactory, h as GlobalStylesFactory, _ as ImportFactory, S as TemplateFactory, C as TemplatesFactory, b as VariablesFactory, m as defineFont, g as defineGlobalStyles, v as defineImport, y as defineMediaQuery, w as defineTemplates, x as defineVariables };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-name-generator.d.ts","sourceRoot":"","sources":["../../src/generators/class-name-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,qBAAa,kBAAkB,CAAC,KAAK,CAAC,YAAY,SAAS,YAAY,GAAG,YAAY,CAAE,SAAQ,eAAe,CAAC,YAAY,CAAC;IACxG,OAAO,EAAE,YAAY;gBAArB,OAAO,EAAE,YAAY;IAIxC,IAAa,QAAQ,IAAI,MAAM,CAG9B;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../generators-eEKEtyAm.cjs");exports.ClassNameGenerator=e.n,exports.StyledGenerator=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generators/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled-generator.d.ts","sourceRoot":"","sources":["../../src/generators/styled-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,qBAAa,eAAe,CAAC,KAAK,CAAC,YAAY,SAAS,YAAY,GAAG,YAAY,CAAE,SAAQ,eAAe,CAAC,YAAY,CAAC;IAE/G,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC;IACjB,OAAO,EAAE,YAAY;gBADrB,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,EACjB,OAAO,EAAE,YAAY;IAK9B,IAAa,QAAQ,IAAI,MAAM,CAO9B;IAED,IAAI,WAAW,IAAI,0BAA0B,CAyC5C;CACF"}
|
|
@@ -20,3 +20,4 @@ export declare class StylesGenerator<const STYLE_PARAMS extends StyledParams = S
|
|
|
20
20
|
getTemplateClasses(config?: (SaltyConfig & CachedConfig) | undefined): string[];
|
|
21
21
|
_withBuildContext(context: StylesGeneratorBuildTimeProps): this;
|
|
22
22
|
}
|
|
23
|
+
//# sourceMappingURL=styles-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles-generator.d.ts","sourceRoot":"","sources":["../../src/generators/styles-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAU,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGlE,MAAM,WAAW,6BAA6B;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,qBAAa,eAAe,CAAC,KAAK,CAAC,YAAY,SAAS,YAAY,GAAG,YAAY;IAG9D,MAAM,EAAE,YAAY;IAFhC,YAAY,EAAE,6BAA6B,CAAM;gBAErC,MAAM,EAAE,YAAY;IAEvC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,IAAI,WAGP;IAED,IAAI,YAAY,WAEf;IAED,IAAI,UAAU,WAQb;IAED,IAAI,WAAW,WAOd;IAED,IAAI,GAAG,oBAON;IAEM,kBAAkB,CAAC,MAAM,2CAA2B;IA0BpD,iBAAiB,CAAC,OAAO,EAAE,6BAA6B;CAIhE"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { dashCase as e, toHash as t } from "./util/index.js";
|
|
2
|
+
import { i as n, t as r } from "./parse-styles-Bz0otiZ-.js";
|
|
3
|
+
//#region src/generators/styles-generator.ts
|
|
4
|
+
var i = class {
|
|
5
|
+
params;
|
|
6
|
+
buildContext = {};
|
|
7
|
+
constructor(e) {
|
|
8
|
+
this.params = e;
|
|
9
|
+
}
|
|
10
|
+
get priority() {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
get isRoot() {
|
|
14
|
+
return this.priority === 0;
|
|
15
|
+
}
|
|
16
|
+
get hash() {
|
|
17
|
+
let { base: e, variants: n, compoundVariants: r, anyOfVariants: i } = this.params;
|
|
18
|
+
return t({
|
|
19
|
+
base: e,
|
|
20
|
+
variants: n,
|
|
21
|
+
compoundVariants: r,
|
|
22
|
+
anyOfVariants: i
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
get cssClassName() {
|
|
26
|
+
return this.hash;
|
|
27
|
+
}
|
|
28
|
+
get classNames() {
|
|
29
|
+
let e = new Set([this.cssClassName]), { className: t } = this.params;
|
|
30
|
+
return typeof t == "string" && e.add(t), typeof t == "object" && t.forEach((t) => e.add(t)), this.getTemplateClasses().forEach((t) => e.add(t)), this.buildContext.classNames && this.buildContext.classNames.forEach((t) => e.add(t)), [...e].join(" ");
|
|
31
|
+
}
|
|
32
|
+
get cssFileName() {
|
|
33
|
+
let { callerName: t } = this.buildContext;
|
|
34
|
+
return t ? `cl_${e(t)}-${this.hash}.css` : `${this.hash}.css`;
|
|
35
|
+
}
|
|
36
|
+
get css() {
|
|
37
|
+
let { base: e = {}, variants: t = {}, compoundVariants: n = [], anyOfVariants: i = [] } = this.params, { config: a } = this.buildContext;
|
|
38
|
+
return r({
|
|
39
|
+
...e,
|
|
40
|
+
variants: t,
|
|
41
|
+
compoundVariants: n,
|
|
42
|
+
anyOfVariants: i
|
|
43
|
+
}, `.${this.cssClassName}`, a, this.isRoot);
|
|
44
|
+
}
|
|
45
|
+
getTemplateClasses(r = this.buildContext.config) {
|
|
46
|
+
if (!r?.templates || !this.params.base || this.priority > 0) return [];
|
|
47
|
+
let i = Object.keys(r.templates);
|
|
48
|
+
return Object.entries(this.params.base).reduce((r, [a, o]) => {
|
|
49
|
+
if (!i.includes(a)) return r;
|
|
50
|
+
let s = n(o);
|
|
51
|
+
if (!s || s.path.length === 0) return r;
|
|
52
|
+
let { path: c, variants: l } = s, u = [];
|
|
53
|
+
for (let n of c) {
|
|
54
|
+
u.push(n);
|
|
55
|
+
let i = e(`${a}-${u.join(".")}`);
|
|
56
|
+
r.push("t_" + t(i, 4));
|
|
57
|
+
for (let [n, a] of Object.entries(l)) {
|
|
58
|
+
if (a === !1 || a === void 0) continue;
|
|
59
|
+
let o = a === !0 ? "" : `-${e(String(a))}`, s = `${i}-${e(n)}${o}`;
|
|
60
|
+
r.push("tv_" + t(s, 4));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return r;
|
|
64
|
+
}, []);
|
|
65
|
+
}
|
|
66
|
+
_withBuildContext(e) {
|
|
67
|
+
return this.buildContext = e, this;
|
|
68
|
+
}
|
|
69
|
+
}, a = class extends i {
|
|
70
|
+
_params;
|
|
71
|
+
constructor(e) {
|
|
72
|
+
super(e), this._params = e;
|
|
73
|
+
}
|
|
74
|
+
get priority() {
|
|
75
|
+
return this.params.priority ? this.params.priority : 0;
|
|
76
|
+
}
|
|
77
|
+
}, o = class extends i {
|
|
78
|
+
tagName;
|
|
79
|
+
_params;
|
|
80
|
+
constructor(e, t) {
|
|
81
|
+
super(t), this.tagName = e, this._params = t;
|
|
82
|
+
}
|
|
83
|
+
get priority() {
|
|
84
|
+
return this.params.priority ? this.params.priority : this.tagName && (typeof this.tagName == "function" || typeof this.tagName == "object") ? (this.tagName.generator?.priority || 0) + 1 : 0;
|
|
85
|
+
}
|
|
86
|
+
get clientProps() {
|
|
87
|
+
let { element: t, as: n, variants: r = {}, compoundVariants: i = [], anyOfVariants: a = [], defaultVariants: o = {}, defaultProps: s = {}, passProps: c } = this.params, l = n ?? t, { callerName: u, isProduction: d } = this.buildContext, f = /* @__PURE__ */ new Set([]), p = (e) => {
|
|
88
|
+
let t = o[e];
|
|
89
|
+
t === void 0 ? f.add(e) : f.add(`${e}=${String(t)}`);
|
|
90
|
+
};
|
|
91
|
+
Object.keys(r).forEach(p), i.map((e) => Object.keys(e).forEach(p)), a.map((e) => Object.keys(e).forEach(p));
|
|
92
|
+
let m = /* @__PURE__ */ new Set([]);
|
|
93
|
+
if (this.params.base) {
|
|
94
|
+
let t = JSON.stringify(this.params.base).match(/\{-?props\.([^}]+)\}/gi);
|
|
95
|
+
t && t.forEach((t) => {
|
|
96
|
+
let n = t.replace(/\{(?:-)?props\.([^}]+)\}/gi, "$1"), r = e(n);
|
|
97
|
+
n && m.add(r);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
element: l,
|
|
102
|
+
hash: this.hash,
|
|
103
|
+
variantKeys: [...f],
|
|
104
|
+
propValueKeys: [...m],
|
|
105
|
+
passProps: c,
|
|
106
|
+
defaultProps: s,
|
|
107
|
+
attr: { "data-component-name": d ? void 0 : u }
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
export { a as n, o as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./util/index.cjs"),t=require("./parse-styles-2rwbF9j_.cjs");var n=class{params;buildContext={};constructor(e){this.params=e}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){let{base:t,variants:n,compoundVariants:r,anyOfVariants:i}=this.params;return e.toHash({base:t,variants:n,compoundVariants:r,anyOfVariants:i})}get cssClassName(){return this.hash}get classNames(){let e=new Set([this.cssClassName]),{className:t}=this.params;return typeof t==`string`&&e.add(t),typeof t==`object`&&t.forEach(t=>e.add(t)),this.getTemplateClasses().forEach(t=>e.add(t)),this.buildContext.classNames&&this.buildContext.classNames.forEach(t=>e.add(t)),[...e].join(` `)}get cssFileName(){let{callerName:t}=this.buildContext;return t?`cl_${e.dashCase(t)}-${this.hash}.css`:`${this.hash}.css`}get css(){let{base:e={},variants:n={},compoundVariants:r=[],anyOfVariants:i=[]}=this.params,{config:a}=this.buildContext;return t.t({...e,variants:n,compoundVariants:r,anyOfVariants:i},`.${this.cssClassName}`,a,this.isRoot)}getTemplateClasses(n=this.buildContext.config){if(!n?.templates||!this.params.base||this.priority>0)return[];let r=Object.keys(n.templates);return Object.entries(this.params.base).reduce((n,[i,a])=>{if(!r.includes(i))return n;let o=t.i(a);if(!o||o.path.length===0)return n;let{path:s,variants:c}=o,l=[];for(let t of s){l.push(t);let r=e.dashCase(`${i}-${l.join(`.`)}`);n.push(`t_`+e.toHash(r,4));for(let[t,i]of Object.entries(c)){if(i===!1||i===void 0)continue;let a=i===!0?``:`-${e.dashCase(String(i))}`,o=`${r}-${e.dashCase(t)}${a}`;n.push(`tv_`+e.toHash(o,4))}}return n},[])}_withBuildContext(e){return this.buildContext=e,this}},r=class extends n{_params;constructor(e){super(e),this._params=e}get priority(){return this.params.priority?this.params.priority:0}},i=class extends n{tagName;_params;constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){return this.params.priority?this.params.priority:this.tagName&&(typeof this.tagName==`function`||typeof this.tagName==`object`)?(this.tagName.generator?.priority||0)+1:0}get clientProps(){let{element:t,as:n,variants:r={},compoundVariants:i=[],anyOfVariants:a=[],defaultVariants:o={},defaultProps:s={},passProps:c}=this.params,l=n??t,{callerName:u,isProduction:d}=this.buildContext,f=new Set([]),p=e=>{let t=o[e];t===void 0?f.add(e):f.add(`${e}=${String(t)}`)};Object.keys(r).forEach(p),i.map(e=>Object.keys(e).forEach(p)),a.map(e=>Object.keys(e).forEach(p));let m=new Set([]);if(this.params.base){let t=JSON.stringify(this.params.base).match(/\{-?props\.([^}]+)\}/gi);t&&t.forEach(t=>{let n=t.replace(/\{(?:-)?props\.([^}]+)\}/gi,`$1`),r=e.dashCase(n);n&&m.add(r)})}return{element:l,hash:this.hash,variantKeys:[...f],propValueKeys:[...m],passProps:c,defaultProps:s,attr:{"data-component-name":d?void 0:u}}}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/helpers/color.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAsB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,WAAW,EAAE,YAAY,CAAC;CACjC;AAED,KAAK,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,kBAAkB,CAAC;AAE9D,cAAM,KAAK;IAIU,IAAI,EAAE,SAAS;IAH3B,OAAO,UAAQ;IACf,YAAY,EAAE,aAAa,CAAC;gBAEhB,IAAI,EAAE,SAAS;IAMlC,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,iBAAiB;IAelB,kBAAkB,CAAC,MAAM,EAAE,MAAM,aAAa;IAS9C,QAAQ;CAGhB;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KACT,KAAK,GAAG,aACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../chunk-CMqjfN_6.cjs"),t=require("../viewport-clamp-CHOyzt37.cjs");let n=require("color");n=e.t(n,1);var r=class{base;isColor=!0;currentColor;constructor(e){this.base=e;let t=this._resolveBaseColor(e);return this.currentColor=(0,n.default)(t),this._createProxy()}_createProxy(){return new Proxy(this,{get(e,t){return t in e?e[t]:t in e.currentColor?e._handleColorMethod(t):e[t]}})}_resolveBaseColor(e){if(typeof e!=`string`||!/\{[^{}]+\}/g.test(e))return e;if(typeof saltyConfig>`u`)return`transparent`;let{staticVariables:t}=saltyConfig;return t?e.replace(/^\{|\}$/g,``).split(`.`).reduce((e,t)=>e[t],t):`transparent`}_handleColorMethod(e){let t=this.currentColor;return typeof t[e]==`function`?(...n)=>(this.currentColor=t[e](...n),this._createProxy()):t[e]}toString(){return this.currentColor.toString()}},i=e=>new r(e);exports.color=i,exports.defineViewportClamp=t.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as e } from "../viewport-clamp-CRtzRvJ3.js";
|
|
2
|
+
import t from "color";
|
|
3
|
+
//#region src/helpers/color.ts
|
|
4
|
+
var n = class {
|
|
5
|
+
base;
|
|
6
|
+
isColor = !0;
|
|
7
|
+
currentColor;
|
|
8
|
+
constructor(e) {
|
|
9
|
+
this.base = e;
|
|
10
|
+
let n = this._resolveBaseColor(e);
|
|
11
|
+
return this.currentColor = t(n), this._createProxy();
|
|
12
|
+
}
|
|
13
|
+
_createProxy() {
|
|
14
|
+
return new Proxy(this, { get(e, t) {
|
|
15
|
+
return t in e ? e[t] : t in e.currentColor ? e._handleColorMethod(t) : e[t];
|
|
16
|
+
} });
|
|
17
|
+
}
|
|
18
|
+
_resolveBaseColor(e) {
|
|
19
|
+
if (typeof e != "string" || !/\{[^{}]+\}/g.test(e)) return e;
|
|
20
|
+
if (typeof saltyConfig > "u") return "transparent";
|
|
21
|
+
let { staticVariables: t } = saltyConfig;
|
|
22
|
+
return t ? e.replace(/^\{|\}$/g, "").split(".").reduce((e, t) => e[t], t) : "transparent";
|
|
23
|
+
}
|
|
24
|
+
_handleColorMethod(e) {
|
|
25
|
+
let t = this.currentColor;
|
|
26
|
+
return typeof t[e] == "function" ? (...n) => (this.currentColor = t[e](...n), this._createProxy()) : t[e];
|
|
27
|
+
}
|
|
28
|
+
toString() {
|
|
29
|
+
return this.currentColor.toString();
|
|
30
|
+
}
|
|
31
|
+
}, r = (e) => new n(e);
|
|
32
|
+
//#endregion
|
|
33
|
+
export { r as color, e as defineViewportClamp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-clamp.d.ts","sourceRoot":"","sources":["../../src/helpers/viewport-clamp.ts"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,mBAAmB,GAAI,QAAQ,mBAAmB,MAAM,OAAO,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS,EAAE,MAAM,MAAM,GAAG,SAAS,WAUrI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../generators-eEKEtyAm.cjs");var t=t=>{let n=new e.n(t),r=e=>{let t=new String(e);return Object.assign(t,{get isClassName(){return!0},variant:(e,n)=>r(`${t} ${`${e}-${n}`}`),variants:e=>r(`${t}${Object.entries(e).reduce((e,[t,n])=>(e+=` ${t}-${n}`,e),``)}`.trim()),generator:n}),t};return r(n.cssClassName)};exports.classNameInstance=t;
|
|
@@ -8,3 +8,4 @@ interface ClassNameMethods<STYLE_PARAMS extends StyledParams> {
|
|
|
8
8
|
type ClassNameFunction<STYLE_PARAMS extends StyledParams> = string & ClassNameMethods<STYLE_PARAMS>;
|
|
9
9
|
export declare const classNameInstance: <const STYLE_PARAMS extends StyledParams>(params: STYLE_PARAMS) => ClassNameFunction<STYLE_PARAMS>;
|
|
10
10
|
export {};
|
|
11
|
+
//# sourceMappingURL=classname-instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classname-instance.d.ts","sourceRoot":"","sources":["../../src/instances/classname-instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,gBAAgB,CAAC,YAAY,SAAS,YAAY;IAC1D,SAAS,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;CACpF;AAED,KAAK,iBAAiB,CAAC,YAAY,SAAS,YAAY,IAAI,MAAM,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAEpG,eAAO,MAAM,iBAAiB,GAAI,KAAK,CAAC,YAAY,SAAS,YAAY,EAAE,QAAQ,YAAY,oCA4B9F,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { n as e } from "../generators-CrK45F8i.js";
|
|
2
|
+
//#region src/instances/classname-instance.ts
|
|
3
|
+
var t = (t) => {
|
|
4
|
+
let n = new e(t), r = (e) => {
|
|
5
|
+
let t = new String(e);
|
|
6
|
+
return Object.assign(t, {
|
|
7
|
+
get isClassName() {
|
|
8
|
+
return !0;
|
|
9
|
+
},
|
|
10
|
+
variant: (e, n) => r(`${t} ${`${e}-${n}`}`),
|
|
11
|
+
variants: (e) => r(`${t}${Object.entries(e).reduce((e, [t, n]) => (e += ` ${t}-${n}`, e), "")}`.trim()),
|
|
12
|
+
generator: n
|
|
13
|
+
}), t;
|
|
14
|
+
};
|
|
15
|
+
return r(n.cssClassName);
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { t as classNameInstance };
|