@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.
- package/README.md +83 -0
- package/astro-component-5hrNTCJ5.js +4 -0
- package/astro-component-Dj3enX6K.cjs +4 -0
- package/bin/commands/build.d.ts +2 -0
- package/bin/commands/generate.d.ts +2 -0
- package/bin/commands/init.d.ts +2 -0
- package/bin/commands/update.d.ts +2 -0
- package/bin/commands/version.d.ts +2 -0
- package/bin/confirm-install.d.ts +34 -0
- package/bin/context.d.ts +22 -0
- package/bin/detection/css-file.d.ts +5 -0
- package/bin/frameworks/astro.d.ts +4 -0
- package/bin/frameworks/index.d.ts +13 -0
- package/bin/frameworks/react.d.ts +2 -0
- package/bin/frameworks/types.d.ts +27 -0
- package/bin/integrations/astro.d.ts +11 -0
- package/bin/integrations/eslint.d.ts +6 -0
- package/bin/integrations/index.d.ts +21 -0
- package/bin/integrations/next.d.ts +9 -0
- package/bin/integrations/types.d.ts +29 -0
- package/bin/integrations/vite.d.ts +8 -0
- package/bin/main.cjs +653 -336
- package/bin/main.d.ts +8 -0
- package/bin/main.js +653 -336
- package/bin/package-json.d.ts +21 -0
- package/bin/saltyrc.d.ts +31 -0
- package/bin/templates.d.ts +14 -0
- package/{class-name-generator-B2Pb2obX.cjs → class-name-generator-DVuPkyrS.cjs} +1 -1
- package/{class-name-generator-YeSQe_Ik.js → class-name-generator-DkByUzHU.js} +1 -1
- package/compiler/salty-compiler.cjs +29 -8
- package/compiler/salty-compiler.d.ts +7 -1
- package/compiler/salty-compiler.js +29 -8
- package/config/index.cjs +2 -0
- package/config/index.js +3 -1
- package/css/dynamic-styles.cjs +15 -0
- package/css/dynamic-styles.d.ts +10 -0
- package/css/dynamic-styles.js +15 -0
- package/css/index.cjs +3 -0
- package/css/index.d.ts +1 -0
- package/css/index.js +3 -0
- package/css/keyframes.cjs +1 -1
- package/css/keyframes.js +1 -1
- package/factories/define-font.d.ts +28 -0
- package/factories/index.cjs +128 -0
- package/factories/index.d.ts +1 -0
- package/factories/index.js +128 -0
- package/generators/index.cjs +1 -1
- package/generators/index.js +2 -2
- package/instances/classname-instance.cjs +1 -1
- package/instances/classname-instance.js +1 -1
- package/package.json +5 -1
- package/{parse-styles-CA3TP5n1.cjs → parse-styles-CX1WjafO.cjs} +106 -7
- package/{parse-styles-BTIoYnBr.js → parse-styles-DIqJjXF3.js} +107 -8
- package/parsers/index.cjs +2 -1
- package/parsers/index.d.ts +1 -0
- package/parsers/index.js +4 -3
- package/parsers/parser-regexes.d.ts +3 -0
- package/parsers/strict.d.ts +2 -0
- package/runtime/index.cjs +1 -1
- package/runtime/index.js +1 -1
- package/{salty.config-cqavVm2t.cjs → salty.config-DogY_sSQ.cjs} +1 -1
- package/salty.config-GV37Q-D2.js +4 -0
- package/styled-file-BzmB9_Ez.cjs +12 -0
- package/{react-styled-file-U02jek-B.cjs → styled-file-CPd_rTW2.cjs} +2 -2
- package/{react-styled-file-B99mwk0w.js → styled-file-Cda3EeR6.js} +2 -2
- package/styled-file-DLcgYmGN.js +12 -0
- package/types/config-types.d.ts +10 -1
- package/types/font-types.d.ts +53 -0
- package/{react-vanilla-file-D9px70iK.js → vanilla-file-1kOqbCIM.js} +2 -2
- package/{react-vanilla-file-Bj6XC8GS.cjs → vanilla-file-r0fp2q_m.cjs} +2 -2
- 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
|
|
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 =
|
|
11
|
+
exports.default = styledFile;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
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
|
-
|
|
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
|
+
};
|
package/types/config-types.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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 =
|
|
18
|
+
exports.default = vanillaFile;
|
package/salty.config-DjosWdPw.js
DELETED