@sproutsocial/seeds-react-theme 3.6.2 → 4.1.1

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 (42) hide show
  1. package/README.md +199 -0
  2. package/commonjs/builders/buildCSS.js +202 -0
  3. package/commonjs/builders/buildTailwindV4.js +238 -0
  4. package/commonjs/builders/index.js +65 -0
  5. package/commonjs/builders/utils.js +225 -0
  6. package/commonjs/dark/theme.js +48 -3
  7. package/commonjs/light/theme.js +57 -3
  8. package/dist/tailwind-preset.css +118 -0
  9. package/dist/theme-all.css +961 -0
  10. package/dist/theme-dark.css +480 -0
  11. package/dist/theme.css +480 -0
  12. package/dist/themes/dark/_themed.scss +7 -0
  13. package/dist/themes/dark/theme.scss +94 -6
  14. package/dist/themes/extendedThemes/sproutTheme/dark/_themed.scss +7 -0
  15. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +47 -3
  16. package/dist/themes/extendedThemes/sproutTheme/light/_themed.scss +7 -0
  17. package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +47 -3
  18. package/dist/themes/light/_themed.scss +7 -0
  19. package/dist/themes/light/theme.scss +94 -6
  20. package/dist/themes/types/_themed.scss +7 -0
  21. package/dist/types/builders/buildCSS.d.ts +8 -0
  22. package/dist/types/builders/buildCSS.d.ts.map +1 -0
  23. package/dist/types/builders/buildTailwindV4.d.ts +18 -0
  24. package/dist/types/builders/buildTailwindV4.d.ts.map +1 -0
  25. package/dist/types/builders/index.d.ts +10 -0
  26. package/dist/types/builders/index.d.ts.map +1 -0
  27. package/dist/types/builders/utils.d.ts +53 -0
  28. package/dist/types/builders/utils.d.ts.map +1 -0
  29. package/dist/types/dark/theme.d.ts +88 -0
  30. package/dist/types/dark/theme.d.ts.map +1 -1
  31. package/dist/types/light/theme.d.ts +88 -0
  32. package/dist/types/light/theme.d.ts.map +1 -1
  33. package/dist/types/types/theme.colors.d.ts +1 -0
  34. package/dist/types/types/theme.colors.d.ts.map +1 -1
  35. package/lib/builders/buildCSS.js +200 -0
  36. package/lib/builders/buildTailwindV4.js +233 -0
  37. package/lib/builders/index.js +37 -0
  38. package/lib/builders/utils.js +209 -0
  39. package/lib/dark/theme.js +48 -3
  40. package/lib/light/theme.js +57 -3
  41. package/package.json +24 -2
  42. package/tailwind-preset.js +199 -0
@@ -61,7 +61,8 @@ export var colors = _objectSpread(_objectSpread({
61
61
  selected: COLORS.COLOR_NEUTRAL_800,
62
62
  positive_sentiment: COLORS.COLOR_BLUE_500,
63
63
  negative_sentiment: COLORS.COLOR_RED_500,
64
- neutral_sentiment: COLORS.COLOR_NEUTRAL_300
64
+ neutral_sentiment: COLORS.COLOR_NEUTRAL_300,
65
+ ai_generated: "var(--color-container-bg-ai-generated, ".concat(COLORS.COLOR_NEUTRAL_100, ")")
65
66
  },
66
67
  border: {
67
68
  base: COLORS.COLOR_NEUTRAL_200,
@@ -85,9 +86,19 @@ export var colors = _objectSpread(_objectSpread({
85
86
  aqua: aqua.highlight,
86
87
  teal: teal.highlight
87
88
  },
88
- selected: COLORS.COLOR_NEUTRAL_800
89
+ selected: COLORS.COLOR_NEUTRAL_800,
90
+ ai_generated: COLORS.COLOR_PURPLE_700
89
91
  }
90
92
  },
93
+ // AI brand gradient (AI/Gradient: Start #205bc3 -> Mid #9747ff -> Stop #f282f5).
94
+ // Raw hex matches the `ai_generated` precedent; #9747ff has no exact seeds-color token.
95
+ gradient: {
96
+ // 100% — AI primary fill & outline border
97
+ ai: "radial-gradient(circle at bottom left, #205bc3 0%, #9747ff 61%, #f282f5 100%)",
98
+ // 20% tint — AI secondary (composited over a white base in CSS).
99
+ // Kebab key so it flattens to --color-gradient-ai-subtle.
100
+ "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%)"
101
+ },
91
102
  button: {
92
103
  primary: {
93
104
  background: {
@@ -180,6 +191,47 @@ export var colors = _objectSpread(_objectSpread({
180
191
  base: COLORS.COLOR_NEUTRAL_700,
181
192
  hover: COLORS.COLOR_NEUTRAL_900
182
193
  }
194
+ },
195
+ // AI brand appearances — consume the shared `gradient.ai*` tokens.
196
+ // Rendered only via the Tailwind/button.css path (see seeds-react-button).
197
+ // Bill forgot to cut a new version of theme.
198
+ "ai-primary": {
199
+ background: {
200
+ base: "var(--color-gradient-ai)"
201
+ },
202
+ border: {
203
+ base: "transparent"
204
+ },
205
+ text: {
206
+ base: COLORS.COLOR_NEUTRAL_0,
207
+ hover: COLORS.COLOR_NEUTRAL_0
208
+ }
209
+ },
210
+ "ai-secondary": {
211
+ background: {
212
+ // White base is applied in button.css; this is the 20% gradient tint on top.
213
+ base: "var(--color-gradient-ai-subtle)"
214
+ },
215
+ border: {
216
+ base: "transparent"
217
+ },
218
+ text: {
219
+ base: COLORS.COLOR_NEUTRAL_800,
220
+ hover: COLORS.COLOR_NEUTRAL_800
221
+ }
222
+ },
223
+ "ai-outline": {
224
+ background: {
225
+ base: "transparent"
226
+ },
227
+ border: {
228
+ // Drawn as a rounded gradient border via a ::before pseudo-element in button.css.
229
+ base: "var(--color-gradient-ai)"
230
+ },
231
+ text: {
232
+ base: COLORS.COLOR_NEUTRAL_800,
233
+ hover: COLORS.COLOR_NEUTRAL_800
234
+ }
183
235
  }
184
236
  },
185
237
  link: {
@@ -208,7 +260,8 @@ export var colors = _objectSpread(_objectSpread({
208
260
  pink: pink.foreground,
209
261
  aqua: aqua.foreground,
210
262
  teal: teal.foreground
211
- }
263
+ },
264
+ ai_generated: COLORS.COLOR_NEUTRAL_900
212
265
  },
213
266
  icon: {
214
267
  base: COLORS.COLOR_NEUTRAL_800,
@@ -315,6 +368,7 @@ export var colors = _objectSpread(_objectSpread({
315
368
  instagram: NETWORKCOLORS.NETWORK_COLOR_INSTAGRAM,
316
369
  feedly: NETWORKCOLORS.NETWORK_COLOR_FEEDLY,
317
370
  analytics: NETWORKCOLORS.NETWORK_COLOR_ANALYTICS,
371
+ google_analytics_property: NETWORKCOLORS.NETWORK_COLOR_ANALYTICS,
318
372
  youtube: NETWORKCOLORS.NETWORK_COLOR_YOUTUBE,
319
373
  messenger: NETWORKCOLORS.NETWORK_COLOR_MESSENGER,
320
374
  snapchat: NETWORKCOLORS.NETWORK_COLOR_SNAPCHAT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-theme",
3
- "version": "3.6.2",
3
+ "version": "4.1.1",
4
4
  "description": "Seeds Theme",
5
5
  "main": "commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -10,11 +10,25 @@
10
10
  "files": [
11
11
  "commonjs",
12
12
  "dist",
13
- "lib"
13
+ "lib",
14
+ "tailwind-preset.js"
14
15
  ],
16
+ "exports": {
17
+ ".": {
18
+ "import": "./lib/index.js",
19
+ "require": "./commonjs/index.js",
20
+ "types": "./dist/types/index.d.ts"
21
+ },
22
+ "./tailwind-preset": "./tailwind-preset.js",
23
+ "./css/theme": "./dist/theme.css",
24
+ "./css/theme-dark": "./dist/theme-dark.css",
25
+ "./css/theme-all": "./dist/theme-all.css",
26
+ "./css/tailwind-preset": "./dist/tailwind-preset.css"
27
+ },
15
28
  "scripts": {
16
29
  "build": "yarn build:ts-declarations && tsx buildScript.ts",
17
30
  "build:ts-declarations": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json",
31
+ "build:css": "tsx src/builders/buildCSS.ts",
18
32
  "clean": "rm -rf .turbo dist lib commonjs __flow__",
19
33
  "clean:modules": "rm -rf node_modules",
20
34
  "typecheck": "tsc --noEmit"
@@ -37,6 +51,14 @@
37
51
  "@sproutsocial/seeds-tsconfig": "*",
38
52
  "tsc-alias": "^1.8.11"
39
53
  },
54
+ "peerDependencies": {
55
+ "tailwindcss": ">=3.0.0 || >=4.0.0"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "tailwindcss": {
59
+ "optional": true
60
+ }
61
+ },
40
62
  "engines": {
41
63
  "node": ">=18"
42
64
  }
@@ -0,0 +1,199 @@
1
+ /**
2
+ * Seeds Design System — Tailwind CSS Preset
3
+ *
4
+ * Usage:
5
+ * // tailwind.config.js
6
+ * module.exports = {
7
+ * presets: [require('@sproutsocial/seeds-react-theme/tailwind-preset')],
8
+ * content: ['./src/**\/*.{html,ts,tsx,jsx}'],
9
+ * };
10
+ *
11
+ * All values are sourced from Seeds token packages — no hardcoded values.
12
+ * Colors use static token values so dark mode is handled via Tailwind's
13
+ * built-in `dark:` variant (darkMode: 'class'). No runtime CSS variable
14
+ * dependency required for button/color tokens.
15
+ *
16
+ * Non-button tokens (app, container, text, form) still reference CSS custom
17
+ * properties and require loading theme-all.css for dark mode to work.
18
+ * These can be migrated to static token values + `dark:` classes over time.
19
+ */
20
+
21
+ const COLORS = require("@sproutsocial/seeds-color");
22
+ const SPACE = require("@sproutsocial/seeds-space");
23
+ const BORDER = require("@sproutsocial/seeds-border");
24
+ const TYPOGRAPHY = require("@sproutsocial/seeds-typography");
25
+
26
+ /** @type {import('tailwindcss').Config} */
27
+ module.exports = {
28
+ theme: {
29
+ extend: {
30
+ // -----------------------------------------------------------------------
31
+ // Spacing — from @sproutsocial/seeds-space
32
+ // Usage: p-300, m-400, gap-500, w-600, etc.
33
+ // -----------------------------------------------------------------------
34
+ spacing: {
35
+ 0: SPACE.SPACE_SIZE_0, // 0px
36
+ 100: SPACE.SPACE_SIZE_100, // 2px
37
+ 200: SPACE.SPACE_SIZE_200, // 4px
38
+ 300: SPACE.SPACE_SIZE_300, // 8px
39
+ 350: SPACE.SPACE_SIZE_350, // 12px
40
+ 400: SPACE.SPACE_SIZE_400, // 16px
41
+ 450: SPACE.SPACE_SIZE_450, // 24px
42
+ 500: SPACE.SPACE_SIZE_500, // 32px
43
+ 600: SPACE.SPACE_SIZE_600, // 40px
44
+ },
45
+
46
+ // -----------------------------------------------------------------------
47
+ // Border radius — from @sproutsocial/seeds-border
48
+ // Usage: rounded-400, rounded-500, rounded-pill, etc.
49
+ // -----------------------------------------------------------------------
50
+ // -----------------------------------------------------------------------
51
+ // Font size — from @sproutsocial/seeds-typography
52
+ // Usage: text-200, text-300, text-400, etc.
53
+ // -----------------------------------------------------------------------
54
+ fontSize: {
55
+ 100: [
56
+ TYPOGRAPHY.TYPOGRAPHY_SIZE_100.fontSize,
57
+ { lineHeight: TYPOGRAPHY.TYPOGRAPHY_SIZE_100.lineHeight },
58
+ ],
59
+ 200: [
60
+ TYPOGRAPHY.TYPOGRAPHY_SIZE_200.fontSize,
61
+ { lineHeight: TYPOGRAPHY.TYPOGRAPHY_SIZE_200.lineHeight },
62
+ ],
63
+ 300: [
64
+ TYPOGRAPHY.TYPOGRAPHY_SIZE_300.fontSize,
65
+ { lineHeight: TYPOGRAPHY.TYPOGRAPHY_SIZE_300.lineHeight },
66
+ ],
67
+ 400: [
68
+ TYPOGRAPHY.TYPOGRAPHY_SIZE_400.fontSize,
69
+ { lineHeight: TYPOGRAPHY.TYPOGRAPHY_SIZE_400.lineHeight },
70
+ ],
71
+ 500: [
72
+ TYPOGRAPHY.TYPOGRAPHY_SIZE_500.fontSize,
73
+ { lineHeight: TYPOGRAPHY.TYPOGRAPHY_SIZE_500.lineHeight },
74
+ ],
75
+ 600: [
76
+ TYPOGRAPHY.TYPOGRAPHY_SIZE_600.fontSize,
77
+ { lineHeight: TYPOGRAPHY.TYPOGRAPHY_SIZE_600.lineHeight },
78
+ ],
79
+ 700: [
80
+ TYPOGRAPHY.TYPOGRAPHY_SIZE_700.fontSize,
81
+ { lineHeight: TYPOGRAPHY.TYPOGRAPHY_SIZE_700.lineHeight },
82
+ ],
83
+ },
84
+
85
+ borderRadius: {
86
+ 400: BORDER.BORDER_RADIUS_400, // 4px
87
+ 500: BORDER.BORDER_RADIUS_500, // 6px
88
+ 600: BORDER.BORDER_RADIUS_600, // 8px
89
+ 800: BORDER.BORDER_RADIUS_800, // 12px
90
+ 900: BORDER.BORDER_RADIUS_900, // 24px
91
+ 1000: BORDER.BORDER_RADIUS_1000, // 999999px
92
+ pill: "999999px",
93
+ inner: "4px",
94
+ outer: "8px",
95
+ },
96
+
97
+ colors: {
98
+ // ---------------------------------------------------------------------
99
+ // Button tokens — from @sproutsocial/seeds-color
100
+ //
101
+ // Light mode values used by default; dark mode via `dark:` variant:
102
+ // <button class="bg-button-primary-bg-base dark:bg-button-primary-bg-base-dark">
103
+ // ---------------------------------------------------------------------
104
+
105
+ // Primary
106
+ "button-primary-bg-base": COLORS.COLOR_BLUE_700,
107
+ "button-primary-bg-hover": COLORS.COLOR_BLUE_800,
108
+ "button-primary-bg-active": COLORS.COLOR_BLUE_900,
109
+ "button-primary-text-base": COLORS.COLOR_NEUTRAL_0,
110
+ "button-primary-text-hover": COLORS.COLOR_NEUTRAL_0,
111
+ "button-primary-border-base": "transparent",
112
+ // dark
113
+ "button-primary-bg-base-dark": COLORS.COLOR_BLUE_400,
114
+ "button-primary-bg-hover-dark": COLORS.COLOR_BLUE_300,
115
+ "button-primary-bg-active-dark": COLORS.COLOR_BLUE_200,
116
+ "button-primary-text-base-dark": COLORS.COLOR_NEUTRAL_900,
117
+ "button-primary-text-hover-dark": COLORS.COLOR_NEUTRAL_1000,
118
+
119
+ // Secondary
120
+ "button-secondary-bg-base": "transparent",
121
+ "button-secondary-bg-hover": COLORS.COLOR_NEUTRAL_800,
122
+ "button-secondary-bg-active": COLORS.COLOR_NEUTRAL_900,
123
+ "button-secondary-text-base": COLORS.COLOR_NEUTRAL_800,
124
+ "button-secondary-text-hover": COLORS.COLOR_NEUTRAL_0,
125
+ "button-secondary-border-base": COLORS.COLOR_NEUTRAL_800,
126
+ // dark
127
+ "button-secondary-bg-hover-dark": COLORS.COLOR_NEUTRAL_100,
128
+ "button-secondary-bg-active-dark": COLORS.COLOR_NEUTRAL_0,
129
+ "button-secondary-text-base-dark": COLORS.COLOR_NEUTRAL_0,
130
+ "button-secondary-text-hover-dark": COLORS.COLOR_NEUTRAL_800,
131
+ "button-secondary-border-base-dark": COLORS.COLOR_NEUTRAL_0,
132
+
133
+ // Destructive
134
+ "button-destructive-bg-base": COLORS.COLOR_RED_800,
135
+ "button-destructive-bg-hover": COLORS.COLOR_RED_900,
136
+ "button-destructive-bg-active": COLORS.COLOR_RED_1000,
137
+ "button-destructive-text-base": COLORS.COLOR_NEUTRAL_0,
138
+ "button-destructive-text-hover": COLORS.COLOR_NEUTRAL_0,
139
+ "button-destructive-border-base": "transparent",
140
+ // dark
141
+ "button-destructive-bg-base-dark": COLORS.COLOR_RED_400,
142
+ "button-destructive-bg-hover-dark": COLORS.COLOR_RED_300,
143
+ "button-destructive-bg-active-dark": COLORS.COLOR_RED_200,
144
+ "button-destructive-text-base-dark": COLORS.COLOR_NEUTRAL_900,
145
+ "button-destructive-text-hover-dark": COLORS.COLOR_NEUTRAL_1000,
146
+
147
+ // Placeholder
148
+ "button-placeholder-bg-base": "transparent",
149
+ "button-placeholder-bg-hover": COLORS.COLOR_NEUTRAL_0,
150
+ "button-placeholder-bg-active": COLORS.COLOR_NEUTRAL_0,
151
+ "button-placeholder-text-base": COLORS.COLOR_BLUE_700,
152
+ "button-placeholder-text-hover": COLORS.COLOR_BLUE_800,
153
+ "button-placeholder-border-base": COLORS.COLOR_NEUTRAL_500,
154
+ // dark
155
+ "button-placeholder-bg-hover-dark": COLORS.COLOR_NEUTRAL_1100,
156
+ "button-placeholder-bg-active-dark": COLORS.COLOR_NEUTRAL_1100,
157
+ "button-placeholder-text-base-dark": COLORS.COLOR_BLUE_400,
158
+ "button-placeholder-text-hover-dark": COLORS.COLOR_BLUE_300,
159
+
160
+ // ---------------------------------------------------------------------
161
+ // Remaining tokens — CSS variable approach
162
+ //
163
+ // These reference CSS custom properties and require loading theme-all.css.
164
+ // Migrate to static token values + `dark:` classes over time.
165
+ // These are intentionally kept for now to compare the pros and cons
166
+ // ---------------------------------------------------------------------
167
+
168
+ // App
169
+ "app-bg-base": "var(--color-app-bg-base)",
170
+
171
+ // Container
172
+ "container-bg-base": "var(--color-container-bg-base)",
173
+ "container-bg-success": "var(--color-container-bg-success)",
174
+ "container-bg-warning": "var(--color-container-bg-warning)",
175
+ "container-bg-error": "var(--color-container-bg-error)",
176
+ "container-bg-info": "var(--color-container-bg-info)",
177
+ "container-bg-opportunity": "var(--color-container-bg-opportunity)",
178
+ "container-border-base": "var(--color-container-border-base)",
179
+ "container-border-success": "var(--color-container-border-success)",
180
+ "container-border-warning": "var(--color-container-border-warning)",
181
+ "container-border-error": "var(--color-container-border-error)",
182
+ "container-border-info": "var(--color-container-border-info)",
183
+ "container-border-opportunity":
184
+ "var(--color-container-border-opportunity)",
185
+
186
+ // Text
187
+ "text-body": "var(--color-text-body)",
188
+ "text-headline": "var(--color-text-headline)",
189
+ "text-subtext": "var(--color-text-subtext)",
190
+
191
+ // Form
192
+ "form-bg-base": "var(--color-form-bg-base)",
193
+ "form-border-base": "var(--color-form-border-base)",
194
+ "form-border-selected": "var(--color-form-border-selected)",
195
+ "form-placeholder-base": "var(--color-form-placeholder-base)",
196
+ },
197
+ },
198
+ },
199
+ };