@salty-css/core 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (71) hide show
  1. package/README.md +83 -0
  2. package/astro-component-5hrNTCJ5.js +4 -0
  3. package/astro-component-Dj3enX6K.cjs +4 -0
  4. package/bin/commands/build.d.ts +2 -0
  5. package/bin/commands/generate.d.ts +2 -0
  6. package/bin/commands/init.d.ts +2 -0
  7. package/bin/commands/update.d.ts +2 -0
  8. package/bin/commands/version.d.ts +2 -0
  9. package/bin/confirm-install.d.ts +34 -0
  10. package/bin/context.d.ts +22 -0
  11. package/bin/detection/css-file.d.ts +5 -0
  12. package/bin/frameworks/astro.d.ts +4 -0
  13. package/bin/frameworks/index.d.ts +13 -0
  14. package/bin/frameworks/react.d.ts +2 -0
  15. package/bin/frameworks/types.d.ts +27 -0
  16. package/bin/integrations/astro.d.ts +11 -0
  17. package/bin/integrations/eslint.d.ts +6 -0
  18. package/bin/integrations/index.d.ts +21 -0
  19. package/bin/integrations/next.d.ts +9 -0
  20. package/bin/integrations/types.d.ts +29 -0
  21. package/bin/integrations/vite.d.ts +8 -0
  22. package/bin/main.cjs +653 -336
  23. package/bin/main.d.ts +8 -0
  24. package/bin/main.js +653 -336
  25. package/bin/package-json.d.ts +21 -0
  26. package/bin/saltyrc.d.ts +31 -0
  27. package/bin/templates.d.ts +14 -0
  28. package/{class-name-generator-B2Pb2obX.cjs → class-name-generator-DVuPkyrS.cjs} +1 -1
  29. package/{class-name-generator-YeSQe_Ik.js → class-name-generator-DkByUzHU.js} +1 -1
  30. package/compiler/salty-compiler.cjs +29 -8
  31. package/compiler/salty-compiler.d.ts +7 -1
  32. package/compiler/salty-compiler.js +29 -8
  33. package/config/index.cjs +2 -0
  34. package/config/index.js +3 -1
  35. package/css/dynamic-styles.cjs +15 -0
  36. package/css/dynamic-styles.d.ts +10 -0
  37. package/css/dynamic-styles.js +15 -0
  38. package/css/index.cjs +3 -0
  39. package/css/index.d.ts +1 -0
  40. package/css/index.js +3 -0
  41. package/css/keyframes.cjs +1 -1
  42. package/css/keyframes.js +1 -1
  43. package/factories/define-font.d.ts +28 -0
  44. package/factories/index.cjs +128 -0
  45. package/factories/index.d.ts +1 -0
  46. package/factories/index.js +128 -0
  47. package/generators/index.cjs +1 -1
  48. package/generators/index.js +2 -2
  49. package/instances/classname-instance.cjs +1 -1
  50. package/instances/classname-instance.js +1 -1
  51. package/package.json +5 -1
  52. package/{parse-styles-CA3TP5n1.cjs → parse-styles-CX1WjafO.cjs} +106 -7
  53. package/{parse-styles-BTIoYnBr.js → parse-styles-DIqJjXF3.js} +107 -8
  54. package/parsers/index.cjs +2 -1
  55. package/parsers/index.d.ts +1 -0
  56. package/parsers/index.js +4 -3
  57. package/parsers/parser-regexes.d.ts +3 -0
  58. package/parsers/strict.d.ts +2 -0
  59. package/runtime/index.cjs +1 -1
  60. package/runtime/index.js +1 -1
  61. package/{salty.config-cqavVm2t.cjs → salty.config-DogY_sSQ.cjs} +1 -1
  62. package/salty.config-GV37Q-D2.js +4 -0
  63. package/styled-file-BzmB9_Ez.cjs +12 -0
  64. package/{react-styled-file-U02jek-B.cjs → styled-file-CPd_rTW2.cjs} +2 -2
  65. package/{react-styled-file-B99mwk0w.js → styled-file-Cda3EeR6.js} +2 -2
  66. package/styled-file-DLcgYmGN.js +12 -0
  67. package/types/config-types.d.ts +10 -1
  68. package/types/font-types.d.ts +53 -0
  69. package/{react-vanilla-file-D9px70iK.js → vanilla-file-1kOqbCIM.js} +2 -2
  70. package/{react-vanilla-file-Bj6XC8GS.cjs → vanilla-file-r0fp2q_m.cjs} +2 -2
  71. package/salty.config-DjosWdPw.js +0 -4
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const styledFile = `import { styled } from "@salty-css/astro/styled";
4
+
5
+ export const <%- name %> = styled('<%- tag %>', {
6
+ <% if(className) { %>className: '<%- className %>',<% } %>
7
+ base: {
8
+ // Add your styles here
9
+ }
10
+ })
11
+ `;
12
+ exports.default = styledFile;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const reactStyledFile = `import { styled } from "@salty-css/react/styled";
3
+ const styledFile = `import { styled } from "@salty-css/react/styled";
4
4
 
5
5
  export const <%- name %> = styled('<%- tag %>', {
6
6
  <% if(className) { %>className: '<%- className %>',<% } %>
@@ -8,4 +8,4 @@ export const <%- name %> = styled('<%- tag %>', {
8
8
  // Add your styles here
9
9
  }
10
10
  })`;
11
- exports.default = reactStyledFile;
11
+ exports.default = styledFile;
@@ -1,4 +1,4 @@
1
- const reactStyledFile = `import { styled } from "@salty-css/react/styled";
1
+ const styledFile = `import { styled } from "@salty-css/react/styled";
2
2
 
3
3
  export const <%- name %> = styled('<%- tag %>', {
4
4
  <% if(className) { %>className: '<%- className %>',<% } %>
@@ -7,5 +7,5 @@ export const <%- name %> = styled('<%- tag %>', {
7
7
  }
8
8
  })`;
9
9
  export {
10
- reactStyledFile as default
10
+ styledFile as default
11
11
  };
@@ -0,0 +1,12 @@
1
+ const styledFile = `import { styled } from "@salty-css/astro/styled";
2
+
3
+ export const <%- name %> = styled('<%- tag %>', {
4
+ <% if(className) { %>className: '<%- className %>',<% } %>
5
+ base: {
6
+ // Add your styles here
7
+ }
8
+ })
9
+ `;
10
+ export {
11
+ styledFile as default
12
+ };
@@ -1,5 +1,6 @@
1
1
  import { BaseStyles, CssStyles, MediaQueryStyles } from '../types';
2
2
  import { OrString } from '../types/util-types';
3
+ export * from './font-types';
3
4
  export type GlobalStyles = Record<string, BaseStyles>;
4
5
  export type CssVariableTokensObject = Record<string, unknown>;
5
6
  export interface CssResponsiveVariables {
@@ -68,6 +69,14 @@ export interface SaltyConfig {
68
69
  * 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.
69
70
  */
70
71
  externalModules?: ('react' | 'react-dom' | OrString)[];
72
+ /**
73
+ * Controls how the parser reacts to suspicious or malformed input
74
+ * (typos, invalid value types, malformed selectors, etc.).
75
+ * - `true` — throw on issues (recommended for new projects)
76
+ * - `'warn'` — log a warning and continue
77
+ * - `false` / undefined — silent, behave like prior versions
78
+ */
79
+ strict?: boolean | 'warn';
71
80
  /**
72
81
  * default unit for px based properties when providing a number value. Default is 'px'.
73
82
  */
@@ -78,8 +87,8 @@ export interface CachedConfig {
78
87
  staticVariables: Record<string, any>;
79
88
  mediaQueries: Record<string, string>;
80
89
  modifiers?: CssModifiers;
90
+ strict?: boolean | 'warn';
81
91
  templatePaths: {
82
92
  [key: string]: string;
83
93
  };
84
94
  }
85
- export {};
@@ -0,0 +1,53 @@
1
+ export type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
2
+ export type FontFormat = 'woff2' | 'woff' | 'truetype' | 'opentype' | 'embedded-opentype' | 'svg' | 'collection';
3
+ export type FontStyle = 'normal' | 'italic' | 'oblique' | (string & {});
4
+ export type FontWeight = number | 'normal' | 'bold' | 'lighter' | 'bolder' | (string & {});
5
+ export interface FontSrc {
6
+ url: string;
7
+ format?: FontFormat;
8
+ /** Optional `tech(...)` descriptor passed straight through to @font-face. */
9
+ tech?: string;
10
+ }
11
+ export interface FontVariant {
12
+ weight?: FontWeight;
13
+ style?: FontStyle;
14
+ stretch?: string;
15
+ display?: FontDisplay;
16
+ unicodeRange?: string;
17
+ ascentOverride?: string;
18
+ descentOverride?: string;
19
+ lineGapOverride?: string;
20
+ sizeAdjust?: string;
21
+ /**
22
+ * One or more font sources. Strings are treated as URLs and the `format()`
23
+ * descriptor is auto-detected from the file extension when possible. Use
24
+ * the `{ url, format }` object form for CDN/extensionless URLs where the
25
+ * format must be set explicitly.
26
+ */
27
+ src: string | FontSrc | (string | FontSrc)[];
28
+ }
29
+ interface DefineFontBase {
30
+ /** CSS `font-family` value users will see in styles. */
31
+ name: string;
32
+ /**
33
+ * CSS variable name. Accepts `--font-inter` or `font-inter`; we normalize.
34
+ * Optional — when omitted, a deterministic name is derived from the other
35
+ * inputs as `--font-<name>-<hash>`.
36
+ */
37
+ variable?: string;
38
+ /** Default `font-display` applied to variants that don't set their own. */
39
+ display?: FontDisplay;
40
+ /** Family fallbacks appended after `name` in the generated `font-family` string. */
41
+ fallback?: string[];
42
+ }
43
+ export interface DefineFontVariantsOptions extends DefineFontBase {
44
+ variants: FontVariant[];
45
+ import?: never;
46
+ }
47
+ export interface DefineFontImportOptions extends DefineFontBase {
48
+ /** Remote stylesheet URL (e.g. Google Fonts). Emitted as `@import url(...)`. */
49
+ import: string;
50
+ variants?: never;
51
+ }
52
+ export type DefineFontOptions = DefineFontVariantsOptions | DefineFontImportOptions;
53
+ export {};
@@ -1,4 +1,4 @@
1
- const reactVanillaFile = `import { <%- styledComponentName %> } from "./<%- fileName %>.css";
1
+ const vanillaFile = `import { <%- styledComponentName %> } from "./<%- fileName %>.css";
2
2
 
3
3
  interface <%- componentName %>Props {
4
4
  text?: string;
@@ -14,5 +14,5 @@ export const <%- componentName %> = ({ text = 'Lorem ipsum' }: <%- componentName
14
14
 
15
15
  export default <%- componentName %>;`;
16
16
  export {
17
- reactVanillaFile as default
17
+ vanillaFile as default
18
18
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const reactVanillaFile = `import { <%- styledComponentName %> } from "./<%- fileName %>.css";
3
+ const vanillaFile = `import { <%- styledComponentName %> } from "./<%- fileName %>.css";
4
4
 
5
5
  interface <%- componentName %>Props {
6
6
  text?: string;
@@ -15,4 +15,4 @@ export const <%- componentName %> = ({ text = 'Lorem ipsum' }: <%- componentName
15
15
  };
16
16
 
17
17
  export default <%- componentName %>;`;
18
- exports.default = reactVanillaFile;
18
+ exports.default = vanillaFile;
@@ -1,4 +0,0 @@
1
- const salty_config = "import { defineConfig } from '@salty-css/core/config';\n\nexport const config = defineConfig({\n // Add your custom config here\n externalModules: ['react', 'react-dom']\n});\n";
2
- export {
3
- salty_config as default
4
- };