@salty-css/core 0.0.1-alpha.20 → 0.0.1-alpha.201

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.
Files changed (88) hide show
  1. package/.saltyrc.schema.json +48 -0
  2. package/README.md +143 -26
  3. package/bin/index.cjs +1 -8
  4. package/bin/index.js +2 -128
  5. package/bin/logger.d.ts +1 -0
  6. package/bin/main.cjs +11 -0
  7. package/bin/main.d.ts +1 -0
  8. package/bin/main.js +260 -0
  9. package/compiler/get-files.d.ts +3 -0
  10. package/compiler/index.cjs +1 -11
  11. package/compiler/index.d.ts +11 -6
  12. package/compiler/index.js +17 -172
  13. package/config/define-config.d.ts +1 -1
  14. package/config/index.cjs +1 -1
  15. package/config/index.d.ts +2 -1
  16. package/config/index.js +10 -2
  17. package/css/index.cjs +1 -1
  18. package/css/index.d.ts +4 -1
  19. package/css/index.js +9 -2
  20. package/css/keyframes.cjs +1 -0
  21. package/css/keyframes.d.ts +22 -0
  22. package/css/keyframes.js +34 -0
  23. package/css/media.cjs +1 -0
  24. package/css/media.d.ts +87 -0
  25. package/css/media.js +88 -0
  26. package/css/merge.cjs +1 -0
  27. package/css/merge.d.ts +6 -0
  28. package/css/merge.js +4 -0
  29. package/css/token.cjs +1 -0
  30. package/css/token.d.ts +1 -0
  31. package/css/token.js +4 -0
  32. package/{dash-case-DKzpenwY.cjs → dash-case-BJEkFEGQ.cjs} +1 -1
  33. package/{dash-case-DMQMcCO6.js → dash-case-DBThphLm.js} +2 -2
  34. package/factories/define-global-styles.d.ts +7 -0
  35. package/factories/define-media-query.d.ts +8 -0
  36. package/factories/define-templates.d.ts +10 -0
  37. package/factories/define-variables.d.ts +12 -0
  38. package/factories/index.d.ts +4 -0
  39. package/generators/class-name-generator.d.ts +6 -0
  40. package/generators/index.cjs +1 -0
  41. package/generators/index.d.ts +2 -0
  42. package/generators/index.js +75 -0
  43. package/generators/styled-generator.d.ts +19 -0
  44. package/generators/styles-generator.d.ts +18 -0
  45. package/helpers/color.d.ts +18 -0
  46. package/helpers/index.cjs +1 -0
  47. package/helpers/index.d.ts +1 -0
  48. package/helpers/index.js +1152 -0
  49. package/index-BtsgjRXm.cjs +38 -0
  50. package/index-DVzNO1Qt.js +486 -0
  51. package/package.json +34 -2
  52. package/parse-styles-Bjxh8lZv.js +107 -0
  53. package/parse-styles-D_gL6efj.cjs +7 -0
  54. package/parsers/index.cjs +1 -0
  55. package/parsers/index.d.ts +5 -0
  56. package/parsers/index.js +37 -0
  57. package/{generator → parsers}/parse-modifiers.d.ts +1 -1
  58. package/parsers/parse-styles.d.ts +2 -0
  59. package/parsers/parse-templates.d.ts +4 -0
  60. package/{generator → parsers}/parser-types.d.ts +1 -1
  61. package/parsers/property-name-check.d.ts +1 -0
  62. package/parsers/unit-check.d.ts +7 -0
  63. package/react-vanilla-file-CCXbsjIb.js +18 -0
  64. package/react-vanilla-file-CG_WJLam.cjs +15 -0
  65. package/{salty.config-D9ANEDiH.js → salty.config-BhBY_oOk.js} +1 -0
  66. package/{salty.config-BupieCfE.cjs → salty.config-Dk6ZcCxI.cjs} +3 -2
  67. package/server/index.cjs +1 -0
  68. package/server/index.d.ts +1 -0
  69. package/server/index.js +12 -0
  70. package/server/should-restart.d.ts +1 -0
  71. package/templates/salty-reset.d.ts +2 -0
  72. package/types/cli-types.d.ts +10 -0
  73. package/types/config-types.d.ts +77 -0
  74. package/types/index.d.ts +52 -22
  75. package/util/dot-case.d.ts +1 -0
  76. package/util/index.cjs +1 -1
  77. package/util/index.js +1 -1
  78. package/util/module-type.d.ts +1 -0
  79. package/config/config-types.d.ts +0 -59
  80. package/generator/index.cjs +0 -1
  81. package/generator/index.d.ts +0 -1
  82. package/generator/index.js +0 -61
  83. package/generator/parse-styles.d.ts +0 -2
  84. package/generator/parse-templates.d.ts +0 -2
  85. package/generator/style-generator.d.ts +0 -28
  86. package/parse-templates-D4p3pgQR.js +0 -92
  87. package/parse-templates-W0YfTmOT.cjs +0 -8
  88. /package/{generator → parsers}/parse-tokens.d.ts +0 -0
@@ -1,28 +0,0 @@
1
- import { StyledParams, Tag } from '../types';
2
- export interface GeneratorProps {
3
- element?: string;
4
- variantKeys?: string[];
5
- propValueKeys?: string[];
6
- }
7
- export declare class StyleComponentGenerator {
8
- tagName: Tag<any>;
9
- params: StyledParams;
10
- _callerName: string | undefined;
11
- _context: {
12
- name: string;
13
- config: any;
14
- } | undefined;
15
- constructor(tagName: Tag<any>, params: StyledParams);
16
- get hash(): string;
17
- get priority(): number;
18
- get classNames(): string;
19
- get cssClassName(): string;
20
- get cssDisplayNameVar(): string;
21
- get templateKeys(): string[];
22
- get css(): string;
23
- get props(): GeneratorProps;
24
- _withBuildContext(context: {
25
- name: string;
26
- config: any;
27
- }): this;
28
- }
@@ -1,92 +0,0 @@
1
- import { d as O } from "./dash-case-DMQMcCO6.js";
2
- const N = (t, r) => {
3
- if (typeof t != "string") return { result: t };
4
- if (!r) return { result: t };
5
- const e = [];
6
- return Object.values(r).forEach((n) => {
7
- const { pattern: o, transform: c } = n;
8
- t = t.replace(o, (h) => {
9
- const { value: i, css: m } = c(h);
10
- return m && e.push(m), i;
11
- });
12
- }), { result: t, additionalCss: e };
13
- }, P = (t) => typeof t != "string" ? { result: t } : /\{[^{}]+\}/g.test(t) ? { result: t.replace(/\{([^{}]+)\}/g, (...n) => `var(--${O(n[1].replaceAll(".", "-"))})`) } : { result: t }, d = (t, r, e, n) => {
14
- if (!t) return "";
15
- const o = [], c = Object.entries(t).reduce((i, [m, s]) => {
16
- const p = m.trim();
17
- if (typeof s == "function" && (s = s()), typeof s == "object") {
18
- if (!s) return i;
19
- if (p === "variants")
20
- return Object.entries(s).forEach(([u, f]) => {
21
- f && Object.entries(f).forEach(([b, j]) => {
22
- if (!j) return;
23
- const l = `${r}.${u}-${b}`, y = d(j, l, e);
24
- o.push(y);
25
- });
26
- }), i;
27
- if (p === "defaultVariants")
28
- return i;
29
- if (p === "compoundVariants")
30
- return s.forEach((u) => {
31
- const { css: f, ...b } = u, j = Object.entries(b).reduce((y, [V, W]) => `${y}.${V}-${W}`, r), l = d(f, j, e);
32
- o.push(l);
33
- }), i;
34
- if (p.startsWith("@")) {
35
- const u = d(s, r, e), f = `${p} {
36
- ${u.replace(`
37
- `, `
38
- `)}
39
- }`;
40
- return o.push(f), i;
41
- }
42
- const $ = m.includes("&") ? p.replace("&", r) : p.startsWith(":") ? `${r}${p}` : `${r} ${p}`, a = d(s, $, e);
43
- return o.push(a), i;
44
- }
45
- if (n != null && n.templates && n.templates[p]) {
46
- const a = s.split(".").reduce((f, b) => f[b], n.templates[p]), u = d(a, "");
47
- return `${i}${u}`;
48
- }
49
- const g = p.startsWith("-") ? p : O(p), E = ($, a = ";") => i = `${i}${$}${a}`, S = ($) => E(`${g}:${$}`);
50
- if (typeof s == "number") return S(s);
51
- if (typeof s != "string")
52
- if ("toString" in s) s = s.toString();
53
- else return i;
54
- const { modifiers: k } = n || {}, T = function* () {
55
- yield P(s), yield N(s, k);
56
- }();
57
- for (const { result: $, additionalCss: a = [] } of T)
58
- s = $, a.forEach((u) => {
59
- const f = d(u, "");
60
- E(f, "");
61
- });
62
- return S(s);
63
- }, "");
64
- if (!c) return o.join(`
65
- `);
66
- if (!r) return c;
67
- let h = "";
68
- return e !== void 0 ? h = `@layer l${e} { ${r} { ${c} } }` : h = `${r} { ${c} }`, [h, ...o].join(`
69
- `);
70
- }, _ = (t, r = []) => {
71
- if (!t) return "";
72
- const e = [], n = {};
73
- if (Object.entries(t).forEach(([o, c]) => {
74
- if (typeof c == "object") {
75
- if (!c) return;
76
- const h = o.trim(), i = _(c, [...r, h]);
77
- e.push(i);
78
- } else
79
- n[o] = c;
80
- }), Object.keys(n).length) {
81
- const o = r.map(O).join("-"), c = d(n, `.${o}`);
82
- e.push(c);
83
- }
84
- return e.join(`
85
- `);
86
- }, A = (t) => Object.keys(t);
87
- export {
88
- _ as a,
89
- P as b,
90
- A as g,
91
- d as p
92
- };
@@ -1,8 +0,0 @@
1
- "use strict";const O=require("./dash-case-DKzpenwY.cjs"),N=(t,e)=>{if(typeof t!="string")return{result:t};if(!e)return{result:t};const r=[];return Object.values(e).forEach(n=>{const{pattern:o,transform:c}=n;t=t.replace(o,a=>{const{value:i,css:l}=c(a);return l&&r.push(l),i})}),{result:t,additionalCss:r}},k=t=>typeof t!="string"?{result:t}:/\{[^{}]+\}/g.test(t)?{result:t.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${O.dashCase(n[1].replaceAll(".","-"))})`)}:{result:t},h=(t,e,r,n)=>{if(!t)return"";const o=[],c=Object.entries(t).reduce((i,[l,s])=>{const p=l.trim();if(typeof s=="function"&&(s=s()),typeof s=="object"){if(!s)return i;if(p==="variants")return Object.entries(s).forEach(([u,f])=>{f&&Object.entries(f).forEach(([m,j])=>{if(!j)return;const y=`${e}.${u}-${m}`,b=h(j,y,r);o.push(b)})}),i;if(p==="defaultVariants")return i;if(p==="compoundVariants")return s.forEach(u=>{const{css:f,...m}=u,j=Object.entries(m).reduce((b,[q,K])=>`${b}.${q}-${K}`,e),y=h(f,j,r);o.push(y)}),i;if(p.startsWith("@")){const u=h(s,e,r),f=`${p} {
2
- ${u.replace(`
3
- `,`
4
- `)}
5
- }`;return o.push(f),i}const $=l.includes("&")?p.replace("&",e):p.startsWith(":")?`${e}${p}`:`${e} ${p}`,d=h(s,$,r);return o.push(d),i}if(n!=null&&n.templates&&n.templates[p]){const d=s.split(".").reduce((f,m)=>f[m],n.templates[p]),u=h(d,"");return`${i}${u}`}const V=p.startsWith("-")?p:O.dashCase(p),T=($,d=";")=>i=`${i}${$}${d}`,S=$=>T(`${V}:${$}`);if(typeof s=="number")return S(s);if(typeof s!="string")if("toString"in s)s=s.toString();else return i;const{modifiers:g}=n||{},W=function*(){yield k(s),yield N(s,g)}();for(const{result:$,additionalCss:d=[]}of W)s=$,d.forEach(u=>{const f=h(u,"");T(f,"")});return S(s)},"");if(!c)return o.join(`
6
- `);if(!e)return c;let a="";return r!==void 0?a=`@layer l${r} { ${e} { ${c} } }`:a=`${e} { ${c} }`,[a,...o].join(`
7
- `)},E=(t,e=[])=>{if(!t)return"";const r=[],n={};if(Object.entries(t).forEach(([o,c])=>{if(typeof c=="object"){if(!c)return;const a=o.trim(),i=E(c,[...e,a]);r.push(i)}else n[o]=c}),Object.keys(n).length){const o=e.map(O.dashCase).join("-"),c=h(n,`.${o}`);r.push(c)}return r.join(`
8
- `)},P=t=>Object.keys(t);exports.getTemplateKeys=P;exports.parseStyles=h;exports.parseTemplates=E;exports.parseValueTokens=k;
File without changes