@sproutsocial/seeds-react-theme 4.3.0 → 4.4.0
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 +21 -14
- package/commonjs/builders/buildCSS.js +5 -0
- package/commonjs/builders/buildTailwindV4.js +32 -14
- package/commonjs/builders/buildThemeSCSS.js +56 -0
- package/commonjs/builders/utils.js +35 -18
- package/commonjs/dark/theme.js +9 -2
- package/commonjs/light/theme.js +13 -5
- package/dist/tailwind-preset.css +5 -0
- package/dist/theme-all.css +14 -2
- package/dist/theme-dark.css +7 -1
- package/dist/theme.css +7 -1
- package/dist/themes/dark/_themed.scss +7 -3
- package/dist/themes/dark/theme.scss +10 -4
- package/dist/themes/extendedThemes/sproutTheme/dark/_themed.scss +7 -3
- package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +5 -2
- package/dist/themes/extendedThemes/sproutTheme/light/_themed.scss +7 -3
- package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +5 -2
- package/dist/themes/light/_themed.scss +7 -3
- package/dist/themes/light/theme.scss +10 -4
- package/dist/types/builders/buildCSS.d.ts.map +1 -1
- package/dist/types/builders/buildTailwindV4.d.ts.map +1 -1
- package/dist/types/builders/buildThemeSCSS.d.ts +2 -0
- package/dist/types/builders/buildThemeSCSS.d.ts.map +1 -0
- package/dist/types/builders/utils.d.ts +4 -0
- package/dist/types/builders/utils.d.ts.map +1 -1
- package/dist/types/dark/theme.d.ts +6 -0
- package/dist/types/dark/theme.d.ts.map +1 -1
- package/dist/types/light/theme.d.ts +6 -0
- package/dist/types/light/theme.d.ts.map +1 -1
- package/lib/builders/buildCSS.js +6 -1
- package/lib/builders/buildTailwindV4.js +32 -14
- package/lib/builders/buildThemeSCSS.js +50 -0
- package/lib/builders/utils.js +34 -18
- package/lib/dark/theme.js +9 -2
- package/lib/light/theme.js +13 -5
- package/package.json +10 -5
- package/dist/themes/types/_themed.scss +0 -126
|
@@ -85,7 +85,7 @@ $theme: (
|
|
|
85
85
|
"positive_sentiment": #3876e3,
|
|
86
86
|
"negative_sentiment": #f76054,
|
|
87
87
|
"neutral_sentiment": #c8cccc,
|
|
88
|
-
"ai_generated": var(--color-
|
|
88
|
+
"ai_generated": var(--color-container-bg-ai-generated)
|
|
89
89
|
),
|
|
90
90
|
"border": (
|
|
91
91
|
"base": #040404,
|
|
@@ -114,7 +114,10 @@ $theme: (
|
|
|
114
114
|
),
|
|
115
115
|
"gradient": (
|
|
116
116
|
"ai": radial-gradient(circle at bottom left, #679eff 0%, #b984ff 61%, #f282f5 100%),
|
|
117
|
-
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #679eff, transparent 80%) 0%, color-mix(in srgb, #b984ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)
|
|
117
|
+
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #679eff, transparent 80%) 0%, color-mix(in srgb, #b984ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%),
|
|
118
|
+
"ai-stop-1": #679eff,
|
|
119
|
+
"ai-stop-2": #b984ff,
|
|
120
|
+
"ai-stop-3": #f282f5
|
|
118
121
|
),
|
|
119
122
|
"button": (
|
|
120
123
|
"primary": (
|
|
@@ -7,10 +7,14 @@
|
|
|
7
7
|
@import "./theme.scss";
|
|
8
8
|
|
|
9
9
|
// CSS custom properties for values that can't be represented in SCSS maps.
|
|
10
|
-
//
|
|
11
|
-
//
|
|
10
|
+
// A comma-separated CSS value (e.g. a multi-layer background) breaks SCSS map
|
|
11
|
+
// parsing, since Sass reads the top-level comma as a second map value with no
|
|
12
|
+
// key. So the theme object holds a single var() reference, and the composed,
|
|
13
|
+
// comma-separated value is defined here instead, built from the other
|
|
14
|
+
// theme-driven vars so it stays correct for light and dark automatically.
|
|
12
15
|
:root {
|
|
13
|
-
--color-container-bg-ai-generated:
|
|
16
|
+
--color-container-bg-ai-generated: var(--color-gradient-ai-subtle),
|
|
17
|
+
var(--color-container-bg-base);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
// In the JS theme file, the theme object is exported as "default" (i.e., using "export default"),
|
|
@@ -85,7 +85,7 @@ $theme: (
|
|
|
85
85
|
"positive_sentiment": #3876e3,
|
|
86
86
|
"negative_sentiment": #f76054,
|
|
87
87
|
"neutral_sentiment": #c8cccc,
|
|
88
|
-
"ai_generated": var(--color-
|
|
88
|
+
"ai_generated": var(--color-container-bg-ai-generated)
|
|
89
89
|
),
|
|
90
90
|
"border": (
|
|
91
91
|
"base": #dee1e1,
|
|
@@ -114,7 +114,10 @@ $theme: (
|
|
|
114
114
|
),
|
|
115
115
|
"gradient": (
|
|
116
116
|
"ai": radial-gradient(circle at bottom left, #205bc3 0%, #9747ff 61%, #f282f5 100%),
|
|
117
|
-
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)
|
|
117
|
+
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%),
|
|
118
|
+
"ai-stop-1": #205bc3,
|
|
119
|
+
"ai-stop-2": #9747ff,
|
|
120
|
+
"ai-stop-3": #f282f5
|
|
118
121
|
),
|
|
119
122
|
"button": (
|
|
120
123
|
"primary": (
|
|
@@ -7,10 +7,14 @@
|
|
|
7
7
|
@import "./theme.scss";
|
|
8
8
|
|
|
9
9
|
// CSS custom properties for values that can't be represented in SCSS maps.
|
|
10
|
-
//
|
|
11
|
-
//
|
|
10
|
+
// A comma-separated CSS value (e.g. a multi-layer background) breaks SCSS map
|
|
11
|
+
// parsing, since Sass reads the top-level comma as a second map value with no
|
|
12
|
+
// key. So the theme object holds a single var() reference, and the composed,
|
|
13
|
+
// comma-separated value is defined here instead, built from the other
|
|
14
|
+
// theme-driven vars so it stays correct for light and dark automatically.
|
|
12
15
|
:root {
|
|
13
|
-
--color-container-bg-ai-generated:
|
|
16
|
+
--color-container-bg-ai-generated: var(--color-gradient-ai-subtle),
|
|
17
|
+
var(--color-container-bg-base);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
// In the JS theme file, the theme object is exported as "default" (i.e., using "export default"),
|
|
@@ -42,7 +42,7 @@ $theme: (
|
|
|
42
42
|
"positive_sentiment": #3876e3,
|
|
43
43
|
"negative_sentiment": #f76054,
|
|
44
44
|
"neutral_sentiment": #c8cccc,
|
|
45
|
-
"ai_generated": var(--color-
|
|
45
|
+
"ai_generated": var(--color-container-bg-ai-generated)
|
|
46
46
|
),
|
|
47
47
|
"border": (
|
|
48
48
|
"base": #dee1e1,
|
|
@@ -71,7 +71,10 @@ $theme: (
|
|
|
71
71
|
),
|
|
72
72
|
"gradient": (
|
|
73
73
|
"ai": radial-gradient(circle at bottom left, #205bc3 0%, #9747ff 61%, #f282f5 100%),
|
|
74
|
-
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)
|
|
74
|
+
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%),
|
|
75
|
+
"ai-stop-1": #205bc3,
|
|
76
|
+
"ai-stop-2": #9747ff,
|
|
77
|
+
"ai-stop-3": #f282f5
|
|
75
78
|
),
|
|
76
79
|
"button": (
|
|
77
80
|
"primary": (
|
|
@@ -611,7 +614,7 @@ $theme: (
|
|
|
611
614
|
"positive_sentiment": #3876e3,
|
|
612
615
|
"negative_sentiment": #f76054,
|
|
613
616
|
"neutral_sentiment": #c8cccc,
|
|
614
|
-
"ai_generated": var(--color-
|
|
617
|
+
"ai_generated": var(--color-container-bg-ai-generated)
|
|
615
618
|
),
|
|
616
619
|
"border": (
|
|
617
620
|
"base": #dee1e1,
|
|
@@ -640,7 +643,10 @@ $theme: (
|
|
|
640
643
|
),
|
|
641
644
|
"gradient": (
|
|
642
645
|
"ai": radial-gradient(circle at bottom left, #205bc3 0%, #9747ff 61%, #f282f5 100%),
|
|
643
|
-
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)
|
|
646
|
+
"ai-subtle": radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%),
|
|
647
|
+
"ai-stop-1": #205bc3,
|
|
648
|
+
"ai-stop-2": #9747ff,
|
|
649
|
+
"ai-stop-3": #f282f5
|
|
644
650
|
),
|
|
645
651
|
"button": (
|
|
646
652
|
"primary": (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCSS.d.ts","sourceRoot":"","sources":["../../../src/builders/buildCSS.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"buildCSS.d.ts","sourceRoot":"","sources":["../../../src/builders/buildCSS.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoKH;;GAEG;AACH,wBAAsB,iBAAiB,kBAkCtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTailwindV4.d.ts","sourceRoot":"","sources":["../../../src/builders/buildTailwindV4.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH;;GAEG;AACH,wBAAsB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"buildTailwindV4.d.ts","sourceRoot":"","sources":["../../../src/builders/buildTailwindV4.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH;;GAEG;AACH,wBAAsB,qBAAqB,kBAgP1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildThemeSCSS.d.ts","sourceRoot":"","sources":["../../../src/builders/buildThemeSCSS.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,mBAAmB,qBA2B/B,CAAC"}
|
|
@@ -25,6 +25,10 @@ export declare function flattenTypography(typography: any): Record<string, [stri
|
|
|
25
25
|
* Flatten radii (border radius)
|
|
26
26
|
*/
|
|
27
27
|
export declare function flattenRadii(radii: any): Record<string, string>;
|
|
28
|
+
/**
|
|
29
|
+
* Flatten border widths
|
|
30
|
+
*/
|
|
31
|
+
export declare function flattenBorderWidths(borderWidths: any): Record<string, string>;
|
|
28
32
|
/**
|
|
29
33
|
* Flatten shadows
|
|
30
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/builders/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,GAAG,EACR,MAAM,GAAE,MAAW,EACnB,SAAS,GAAE,MAAY,GACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYjE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,GAAG,GACd,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAkBlD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUnE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,GAAG,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAUjC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxB"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/builders/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,GAAG,EACR,MAAM,GAAE,MAAW,EACnB,SAAS,GAAE,MAAY,GACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYjE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,GAAG,GACd,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAkBlD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU/D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU7E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUnE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,GAAG,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAUjC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxB"}
|
|
@@ -91,6 +91,9 @@ export declare const colors: {
|
|
|
91
91
|
gradient: {
|
|
92
92
|
ai: string;
|
|
93
93
|
"ai-subtle": string;
|
|
94
|
+
"ai-stop-1": string;
|
|
95
|
+
"ai-stop-2": string;
|
|
96
|
+
"ai-stop-3": string;
|
|
94
97
|
};
|
|
95
98
|
button: {
|
|
96
99
|
primary: {
|
|
@@ -662,6 +665,9 @@ declare const darkTheme: {
|
|
|
662
665
|
gradient: {
|
|
663
666
|
ai: string;
|
|
664
667
|
"ai-subtle": string;
|
|
668
|
+
"ai-stop-1": string;
|
|
669
|
+
"ai-stop-2": string;
|
|
670
|
+
"ai-stop-3": string;
|
|
665
671
|
};
|
|
666
672
|
button: {
|
|
667
673
|
primary: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/dark/theme.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAIF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAeb,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/dark/theme.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAIF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAeb,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;YA8BnD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2MrD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGtD,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAjVT,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8BnD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2MrD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GtD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -249,6 +249,9 @@ export declare const colors: {
|
|
|
249
249
|
gradient: {
|
|
250
250
|
ai: string;
|
|
251
251
|
"ai-subtle": string;
|
|
252
|
+
"ai-stop-1": string;
|
|
253
|
+
"ai-stop-2": string;
|
|
254
|
+
"ai-stop-3": string;
|
|
252
255
|
};
|
|
253
256
|
button: {
|
|
254
257
|
primary: {
|
|
@@ -923,6 +926,9 @@ declare const theme: {
|
|
|
923
926
|
gradient: {
|
|
924
927
|
ai: string;
|
|
925
928
|
"ai-subtle": string;
|
|
929
|
+
"ai-stop-1": string;
|
|
930
|
+
"ai-stop-2": string;
|
|
931
|
+
"ai-stop-3": string;
|
|
926
932
|
};
|
|
927
933
|
button: {
|
|
928
934
|
primary: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/light/theme.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,WAAW;;;;;CAGvB,CAAC;AAMF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAcb,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/light/theme.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,WAAW;;;;;CAGvB,CAAC;AAMF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAcb,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;YA6BnD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkNrD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8ItD,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAatB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAavB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,eAAO,MAAM,UAAU,QAA+B,CAAC;AAEvD,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;CAUjB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;CAUjB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA7eL,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;gBA6BnD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkNrD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6RtD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/lib/builders/buildCSS.js
CHANGED
|
@@ -21,7 +21,7 @@ import fs from "fs";
|
|
|
21
21
|
import path from "path";
|
|
22
22
|
import lightTheme from "../light/theme";
|
|
23
23
|
import darkTheme from "../dark/theme";
|
|
24
|
-
import { flattenColors, flattenSpacing, flattenRadii, flattenShadows, flattenFontWeights, flattenEasing, flattenDuration } from "./utils";
|
|
24
|
+
import { flattenColors, flattenSpacing, flattenRadii, flattenBorderWidths, flattenShadows, flattenFontWeights, flattenEasing, flattenDuration } from "./utils";
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Convert a flat object into CSS custom properties
|
|
@@ -119,6 +119,11 @@ function generateCSSVariables(themeObj, mode) {
|
|
|
119
119
|
variables.push.apply(variables, _toConsumableArray(objectToCSSVariables(radii, "radius")));
|
|
120
120
|
console.log(" - Mapped ".concat(Object.keys(radii).length, " border radius values"));
|
|
121
121
|
|
|
122
|
+
// Border width
|
|
123
|
+
var borderWidths = flattenBorderWidths(themeObj.borderWidths);
|
|
124
|
+
variables.push.apply(variables, _toConsumableArray(objectToCSSVariables(borderWidths, "border-width")));
|
|
125
|
+
console.log(" - Mapped ".concat(Object.keys(borderWidths).length, " border width values"));
|
|
126
|
+
|
|
122
127
|
// Shadows
|
|
123
128
|
var shadows = flattenShadows(themeObj.shadows);
|
|
124
129
|
variables.push.apply(variables, _toConsumableArray(objectToCSSVariables(shadows, "shadow")));
|
|
@@ -37,7 +37,7 @@ export function buildTailwindV4Preset() {
|
|
|
37
37
|
}
|
|
38
38
|
function _buildTailwindV4Preset() {
|
|
39
39
|
_buildTailwindV4Preset = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
40
|
-
var distDir, lines, spacingMap, _i, _Object$entries, _Object$entries$_i, key, value, radiusMap, _i2, _Object$entries2, _Object$entries2$_i, _key, _value,
|
|
40
|
+
var distDir, lines, spacingMap, _i, _Object$entries, _Object$entries$_i, key, value, radiusMap, _i2, _Object$entries2, _Object$entries2$_i, _key, _value, borderWidthMap, _i3, _Object$entries3, _Object$entries3$_i, _key2, _value2, typographyScales, _i4, _typographyScales, scale, _key3, val, buttonColors, _i5, _Object$entries4, _Object$entries4$_i, _key4, _value3, semanticColors, _i6, _Object$entries5, _Object$entries5$_i, _key5, _value4, darkButtonColors, _i7, _Object$entries6, _Object$entries6$_i, _key6, _value5, css, outPath;
|
|
41
41
|
return _regenerator().w(function (_context) {
|
|
42
42
|
while (1) switch (_context.n) {
|
|
43
43
|
case 0:
|
|
@@ -94,16 +94,34 @@ function _buildTailwindV4Preset() {
|
|
|
94
94
|
console.log(" - Mapped ".concat(Object.keys(radiusMap).length, " border radius tokens"));
|
|
95
95
|
lines.push("");
|
|
96
96
|
|
|
97
|
+
// -------------------------------------------------------------------------
|
|
98
|
+
// Border width — from @sproutsocial/seeds-border
|
|
99
|
+
// Seeds' own `border-w-{key}` utility (not Tailwind's numeric border-<n>
|
|
100
|
+
// scale) — see seeds-react-system-props/src/scales.ts SCALE_PROPS.borderWidth
|
|
101
|
+
// -------------------------------------------------------------------------
|
|
102
|
+
lines.push(" /* Border width — from @sproutsocial/seeds-border */");
|
|
103
|
+
borderWidthMap = {
|
|
104
|
+
500: BORDER.BORDER_WIDTH_500,
|
|
105
|
+
600: BORDER.BORDER_WIDTH_600,
|
|
106
|
+
700: BORDER.BORDER_WIDTH_700
|
|
107
|
+
};
|
|
108
|
+
for (_i3 = 0, _Object$entries3 = Object.entries(borderWidthMap); _i3 < _Object$entries3.length; _i3++) {
|
|
109
|
+
_Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2), _key2 = _Object$entries3$_i[0], _value2 = _Object$entries3$_i[1];
|
|
110
|
+
lines.push(" --border-width-".concat(_key2, ": ").concat(_value2, ";"));
|
|
111
|
+
}
|
|
112
|
+
console.log(" - Mapped ".concat(Object.keys(borderWidthMap).length, " border width tokens"));
|
|
113
|
+
lines.push("");
|
|
114
|
+
|
|
97
115
|
// -------------------------------------------------------------------------
|
|
98
116
|
// Font size — from @sproutsocial/seeds-typography
|
|
99
117
|
// Tailwind v4: --text-{key}--font-size + --text-{key}--line-height → text-{key}
|
|
100
118
|
// -------------------------------------------------------------------------
|
|
101
119
|
lines.push(" /* Font size — from @sproutsocial/seeds-typography */");
|
|
102
120
|
typographyScales = [100, 200, 300, 400, 500, 600, 700];
|
|
103
|
-
for (
|
|
104
|
-
scale = _typographyScales[
|
|
105
|
-
|
|
106
|
-
val = TYPOGRAPHY[
|
|
121
|
+
for (_i4 = 0, _typographyScales = typographyScales; _i4 < _typographyScales.length; _i4++) {
|
|
122
|
+
scale = _typographyScales[_i4];
|
|
123
|
+
_key3 = "TYPOGRAPHY_SIZE_".concat(scale);
|
|
124
|
+
val = TYPOGRAPHY[_key3];
|
|
107
125
|
if (val && val.fontSize && val.lineHeight) {
|
|
108
126
|
// Tailwind v4 uses --text-*--font-size and --text-*--line-height for
|
|
109
127
|
// the two-value tuple equivalent
|
|
@@ -149,9 +167,9 @@ function _buildTailwindV4Preset() {
|
|
|
149
167
|
"color-button-placeholder-text-hover": COLORS.COLOR_BLUE_800,
|
|
150
168
|
"color-button-placeholder-border-base": COLORS.COLOR_NEUTRAL_500
|
|
151
169
|
};
|
|
152
|
-
for (
|
|
153
|
-
_Object$
|
|
154
|
-
lines.push(" --".concat(
|
|
170
|
+
for (_i5 = 0, _Object$entries4 = Object.entries(buttonColors); _i5 < _Object$entries4.length; _i5++) {
|
|
171
|
+
_Object$entries4$_i = _slicedToArray(_Object$entries4[_i5], 2), _key4 = _Object$entries4$_i[0], _value3 = _Object$entries4$_i[1];
|
|
172
|
+
lines.push(" --".concat(_key4, ": ").concat(_value3, ";"));
|
|
155
173
|
}
|
|
156
174
|
console.log(" - Mapped ".concat(Object.keys(buttonColors).length, " button color tokens"));
|
|
157
175
|
lines.push("");
|
|
@@ -181,9 +199,9 @@ function _buildTailwindV4Preset() {
|
|
|
181
199
|
"color-form-border-selected": "var(--color-form-border-selected)",
|
|
182
200
|
"color-form-placeholder-base": "var(--color-form-placeholder-base)"
|
|
183
201
|
};
|
|
184
|
-
for (
|
|
185
|
-
_Object$
|
|
186
|
-
lines.push(" --".concat(
|
|
202
|
+
for (_i6 = 0, _Object$entries5 = Object.entries(semanticColors); _i6 < _Object$entries5.length; _i6++) {
|
|
203
|
+
_Object$entries5$_i = _slicedToArray(_Object$entries5[_i6], 2), _key5 = _Object$entries5$_i[0], _value4 = _Object$entries5$_i[1];
|
|
204
|
+
lines.push(" --".concat(_key5, ": ").concat(_value4, ";"));
|
|
187
205
|
}
|
|
188
206
|
console.log(" - Mapped ".concat(Object.keys(semanticColors).length, " semantic color tokens"));
|
|
189
207
|
|
|
@@ -212,9 +230,9 @@ function _buildTailwindV4Preset() {
|
|
|
212
230
|
"color-button-placeholder-text-base-dark": COLORS.COLOR_BLUE_400,
|
|
213
231
|
"color-button-placeholder-text-hover-dark": COLORS.COLOR_BLUE_300
|
|
214
232
|
};
|
|
215
|
-
for (
|
|
216
|
-
_Object$
|
|
217
|
-
lines.push(" --".concat(
|
|
233
|
+
for (_i7 = 0, _Object$entries6 = Object.entries(darkButtonColors); _i7 < _Object$entries6.length; _i7++) {
|
|
234
|
+
_Object$entries6$_i = _slicedToArray(_Object$entries6[_i7], 2), _key6 = _Object$entries6$_i[0], _value5 = _Object$entries6$_i[1];
|
|
235
|
+
lines.push(" --".concat(_key6, ": ").concat(_value5, ";"));
|
|
218
236
|
}
|
|
219
237
|
console.log(" - Mapped ".concat(Object.keys(darkButtonColors).length, " dark mode button color tokens"));
|
|
220
238
|
lines.push("}");
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
2
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
3
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
4
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import { sync as globSync } from "glob";
|
|
7
|
+
import { execSync } from "child_process";
|
|
8
|
+
|
|
9
|
+
//@ts-ignore
|
|
10
|
+
var execSyncHelper = function execSyncHelper(command, extraEnv) {
|
|
11
|
+
return execSync(command, {
|
|
12
|
+
stdio: "inherit",
|
|
13
|
+
env: Object.assign({}, process.env, extraEnv)
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Generate theme.scss and add a copy of _themed.scss to /dist for each theme
|
|
18
|
+
export var buildThemeSCSSFiles = /*#__PURE__*/function () {
|
|
19
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
20
|
+
var themeFiles;
|
|
21
|
+
return _regenerator().w(function (_context) {
|
|
22
|
+
while (1) switch (_context.n) {
|
|
23
|
+
case 0:
|
|
24
|
+
console.log("Building theme stylesheets");
|
|
25
|
+
|
|
26
|
+
// "types" excluded: src/types/theme.ts is a type-only file that happens to
|
|
27
|
+
// share the "theme" basename with the real theme data modules, and its
|
|
28
|
+
// compiled output has no runtime keys for json-to-scss to convert.
|
|
29
|
+
themeFiles = globSync("./commonjs/**/theme.js", {
|
|
30
|
+
ignore: "commonjs/types/**"
|
|
31
|
+
});
|
|
32
|
+
themeFiles.forEach(function (fileName) {
|
|
33
|
+
var themeDistDirectory = fileName.replace("commonjs", "dist/themes").replace("/theme.js", "");
|
|
34
|
+
if (!fs.existsSync(themeDistDirectory)) {
|
|
35
|
+
fs.mkdirSync(themeDistDirectory, {
|
|
36
|
+
recursive: true
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
execSyncHelper("json-to-scss '".concat(fileName, "' '").concat(themeDistDirectory, "/theme.scss' --k=\"dq\""));
|
|
40
|
+
execSyncHelper("cp './src/utils/_themed.scss' '".concat(themeDistDirectory, "/_themed.scss'"));
|
|
41
|
+
});
|
|
42
|
+
case 1:
|
|
43
|
+
return _context.a(2);
|
|
44
|
+
}
|
|
45
|
+
}, _callee);
|
|
46
|
+
}));
|
|
47
|
+
return function buildThemeSCSSFiles() {
|
|
48
|
+
return _ref.apply(this, arguments);
|
|
49
|
+
};
|
|
50
|
+
}();
|
package/lib/builders/utils.js
CHANGED
|
@@ -118,11 +118,11 @@ export function flattenRadii(radii) {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
* Flatten
|
|
121
|
+
* Flatten border widths
|
|
122
122
|
*/
|
|
123
|
-
export function
|
|
123
|
+
export function flattenBorderWidths(borderWidths) {
|
|
124
124
|
var flattened = {};
|
|
125
|
-
for (var _i5 = 0, _Object$entries5 = Object.entries(
|
|
125
|
+
for (var _i5 = 0, _Object$entries5 = Object.entries(borderWidths); _i5 < _Object$entries5.length; _i5++) {
|
|
126
126
|
var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
|
|
127
127
|
key = _Object$entries5$_i[0],
|
|
128
128
|
value = _Object$entries5$_i[1];
|
|
@@ -134,15 +134,15 @@ export function flattenShadows(shadows) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* Flatten
|
|
137
|
+
* Flatten shadows
|
|
138
138
|
*/
|
|
139
|
-
export function
|
|
139
|
+
export function flattenShadows(shadows) {
|
|
140
140
|
var flattened = {};
|
|
141
|
-
for (var _i6 = 0, _Object$entries6 = Object.entries(
|
|
141
|
+
for (var _i6 = 0, _Object$entries6 = Object.entries(shadows); _i6 < _Object$entries6.length; _i6++) {
|
|
142
142
|
var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2),
|
|
143
143
|
key = _Object$entries6$_i[0],
|
|
144
144
|
value = _Object$entries6$_i[1];
|
|
145
|
-
if (typeof value === "string"
|
|
145
|
+
if (typeof value === "string") {
|
|
146
146
|
flattened[key] = value;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -150,15 +150,15 @@ export function flattenFontWeights(fontWeights) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
* Flatten
|
|
153
|
+
* Flatten font weights
|
|
154
154
|
*/
|
|
155
|
-
export function
|
|
155
|
+
export function flattenFontWeights(fontWeights) {
|
|
156
156
|
var flattened = {};
|
|
157
|
-
for (var _i7 = 0, _Object$entries7 = Object.entries(
|
|
157
|
+
for (var _i7 = 0, _Object$entries7 = Object.entries(fontWeights); _i7 < _Object$entries7.length; _i7++) {
|
|
158
158
|
var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i7], 2),
|
|
159
159
|
key = _Object$entries7$_i[0],
|
|
160
160
|
value = _Object$entries7$_i[1];
|
|
161
|
-
if (typeof value === "string") {
|
|
161
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
162
162
|
flattened[key] = value;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -166,11 +166,11 @@ export function flattenEasing(easing) {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
* Flatten
|
|
169
|
+
* Flatten easing (transition timing functions)
|
|
170
170
|
*/
|
|
171
|
-
export function
|
|
171
|
+
export function flattenEasing(easing) {
|
|
172
172
|
var flattened = {};
|
|
173
|
-
for (var _i8 = 0, _Object$entries8 = Object.entries(
|
|
173
|
+
for (var _i8 = 0, _Object$entries8 = Object.entries(easing); _i8 < _Object$entries8.length; _i8++) {
|
|
174
174
|
var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i8], 2),
|
|
175
175
|
key = _Object$entries8$_i[0],
|
|
176
176
|
value = _Object$entries8$_i[1];
|
|
@@ -181,6 +181,22 @@ export function flattenDuration(duration) {
|
|
|
181
181
|
return flattened;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
/**
|
|
185
|
+
* Flatten duration (transition durations)
|
|
186
|
+
*/
|
|
187
|
+
export function flattenDuration(duration) {
|
|
188
|
+
var flattened = {};
|
|
189
|
+
for (var _i9 = 0, _Object$entries9 = Object.entries(duration); _i9 < _Object$entries9.length; _i9++) {
|
|
190
|
+
var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i9], 2),
|
|
191
|
+
key = _Object$entries9$_i[0],
|
|
192
|
+
value = _Object$entries9$_i[1];
|
|
193
|
+
if (typeof value === "string") {
|
|
194
|
+
flattened[key] = value;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return flattened;
|
|
198
|
+
}
|
|
199
|
+
|
|
184
200
|
/**
|
|
185
201
|
* Check if a value is a valid CSS color
|
|
186
202
|
* Filters out complex values like color-mix() which may not work everywhere
|
|
@@ -194,10 +210,10 @@ export function isSimpleColor(value) {
|
|
|
194
210
|
*/
|
|
195
211
|
export function filterComplexColors(colors) {
|
|
196
212
|
var filtered = {};
|
|
197
|
-
for (var
|
|
198
|
-
var _Object$
|
|
199
|
-
key = _Object$
|
|
200
|
-
value = _Object$
|
|
213
|
+
for (var _i0 = 0, _Object$entries0 = Object.entries(colors); _i0 < _Object$entries0.length; _i0++) {
|
|
214
|
+
var _Object$entries0$_i = _slicedToArray(_Object$entries0[_i0], 2),
|
|
215
|
+
key = _Object$entries0$_i[0],
|
|
216
|
+
value = _Object$entries0$_i[1];
|
|
201
217
|
if (isSimpleColor(value)) {
|
|
202
218
|
filtered[key] = value;
|
|
203
219
|
} else {
|
package/lib/dark/theme.js
CHANGED
|
@@ -57,7 +57,9 @@ export var colors = _objectSpread(_objectSpread({}, lightTheme.colors), {}, {
|
|
|
57
57
|
neutral_sentiment: COLORS.COLOR_NEUTRAL_300,
|
|
58
58
|
// 20% AI gradient tint over the dark container surface. Same token-driven
|
|
59
59
|
// value as light mode; the referenced tokens flip per theme.
|
|
60
|
-
|
|
60
|
+
// The comma-separated composed value lives in _themed.scss (see comment
|
|
61
|
+
// there) since a literal comma here breaks SCSS map parsing.
|
|
62
|
+
ai_generated: "var(--color-container-bg-ai-generated)"
|
|
61
63
|
},
|
|
62
64
|
border: {
|
|
63
65
|
base: COLORS.COLOR_NEUTRAL_1100,
|
|
@@ -89,7 +91,12 @@ export var colors = _objectSpread(_objectSpread({}, lightTheme.colors), {}, {
|
|
|
89
91
|
// contrast against the dark surface (Figma Sprout Variables, "Trellis" dark).
|
|
90
92
|
gradient: {
|
|
91
93
|
ai: "radial-gradient(circle at bottom left, #679eff 0%, #b984ff 61%, #f282f5 100%)",
|
|
92
|
-
"ai-subtle": "radial-gradient(circle at bottom left, color-mix(in srgb, #679eff, transparent 80%) 0%, color-mix(in srgb, #b984ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)"
|
|
94
|
+
"ai-subtle": "radial-gradient(circle at bottom left, color-mix(in srgb, #679eff, transparent 80%) 0%, color-mix(in srgb, #b984ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)",
|
|
95
|
+
// Discrete stops for SVG paint servers — see the light theme for why these
|
|
96
|
+
// exist alongside the composed gradient strings.
|
|
97
|
+
"ai-stop-1": "#679eff",
|
|
98
|
+
"ai-stop-2": "#b984ff",
|
|
99
|
+
"ai-stop-3": "#f282f5"
|
|
93
100
|
},
|
|
94
101
|
button: {
|
|
95
102
|
primary: {
|
package/lib/light/theme.js
CHANGED
|
@@ -63,10 +63,9 @@ export var colors = _objectSpread(_objectSpread({
|
|
|
63
63
|
negative_sentiment: COLORS.COLOR_RED_500,
|
|
64
64
|
neutral_sentiment: COLORS.COLOR_NEUTRAL_300,
|
|
65
65
|
// 20% AI gradient tint composited over the themed container surface.
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
ai_generated: "var(--color-gradient-ai-subtle), var(--color-container-bg-base)"
|
|
66
|
+
// The comma-separated composed value lives in _themed.scss (see comment
|
|
67
|
+
// there) since a literal comma here breaks SCSS map parsing.
|
|
68
|
+
ai_generated: "var(--color-container-bg-ai-generated)"
|
|
70
69
|
},
|
|
71
70
|
border: {
|
|
72
71
|
base: COLORS.COLOR_NEUTRAL_200,
|
|
@@ -101,7 +100,16 @@ export var colors = _objectSpread(_objectSpread({
|
|
|
101
100
|
ai: "radial-gradient(circle at bottom left, #205bc3 0%, #9747ff 61%, #f282f5 100%)",
|
|
102
101
|
// 20% tint — AI secondary (composited over a white base in CSS).
|
|
103
102
|
// Kebab key so it flattens to --color-gradient-ai-subtle.
|
|
104
|
-
"ai-subtle": "radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)"
|
|
103
|
+
"ai-subtle": "radial-gradient(circle at bottom left, color-mix(in srgb, #205bc3, transparent 80%) 0%, color-mix(in srgb, #9747ff, transparent 80%) 61%, color-mix(in srgb, #f282f5, transparent 80%) 100%)",
|
|
104
|
+
// The same three stops as discrete colors, flattening to
|
|
105
|
+
// --color-gradient-ai-stop-{1,2,3}. SVG needs a real <radialGradient> with
|
|
106
|
+
// separate <stop> elements to use as a paint server, and a CSS
|
|
107
|
+
// radial-gradient() string can't be decomposed back into stops. Consumed by
|
|
108
|
+
// seeds-react-icon's gradient defs (see icon.css) so gradient-filled icons
|
|
109
|
+
// pick up dark mode through the usual .dark variable swap.
|
|
110
|
+
"ai-stop-1": "#205bc3",
|
|
111
|
+
"ai-stop-2": "#9747ff",
|
|
112
|
+
"ai-stop-3": "#f282f5"
|
|
105
113
|
},
|
|
106
114
|
button: {
|
|
107
115
|
primary: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/seeds-react-theme",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Seeds Theme",
|
|
5
5
|
"main": "commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"build:css": "tsx src/builders/buildCSS.ts",
|
|
33
33
|
"clean": "rm -rf .turbo dist lib commonjs __flow__",
|
|
34
34
|
"clean:modules": "rm -rf node_modules",
|
|
35
|
-
"typecheck": "tsc --noEmit"
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"test": "jest",
|
|
37
|
+
"test:watch": "jest --watch --coverage=false"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"@sproutsocial/seeds-border": "^1.7.1",
|
|
@@ -45,12 +47,15 @@
|
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
49
|
"@sproutsocial/seeds-build": "*",
|
|
50
|
+
"@sproutsocial/seeds-tsconfig": "*",
|
|
48
51
|
"glob": "^10.3.10",
|
|
52
|
+
"jest": "^29.7.0",
|
|
49
53
|
"json-to-scss": "^1.6.2",
|
|
54
|
+
"sass": "^1.50.0",
|
|
55
|
+
"tsc-alias": "^1.8.11",
|
|
56
|
+
"ts-jest": "^29.2.5",
|
|
50
57
|
"tsx": "^4.0.0",
|
|
51
|
-
"typescript": "^5.6.2"
|
|
52
|
-
"@sproutsocial/seeds-tsconfig": "*",
|
|
53
|
-
"tsc-alias": "^1.8.11"
|
|
58
|
+
"typescript": "^5.6.2"
|
|
54
59
|
},
|
|
55
60
|
"peerDependencies": {
|
|
56
61
|
"tailwindcss": ">=3.0.0 || >=4.0.0"
|