@sproutsocial/seeds-react-theme 3.6.1 → 4.1.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.
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 +63 -15
  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 -12
  14. package/dist/themes/extendedThemes/sproutTheme/dark/_themed.scss +7 -0
  15. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +47 -9
  16. package/dist/themes/extendedThemes/sproutTheme/light/_themed.scss +7 -0
  17. package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +47 -9
  18. package/dist/themes/light/_themed.scss +7 -0
  19. package/dist/themes/light/theme.scss +94 -18
  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 +92 -10
  30. package/dist/types/dark/theme.d.ts.map +1 -1
  31. package/dist/types/light/theme.d.ts +96 -20
  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 +62 -14
  41. package/package.json +24 -2
  42. package/tailwind-preset.js +199 -0
@@ -18,17 +18,13 @@ import BORDER from "@sproutsocial/seeds-border";
18
18
  import literalColors from "./literal-colors";
19
19
  import { datavizPalette } from "./dataviz-palette";
20
20
  import { green, blue, purple, yellow, orange, red, neutral, magenta, pink, aqua, teal } from "./decorative-palettes";
21
- export var breakpoints = ["900px", "1200px", "1500px", "1800px"];
22
- export var newBreakpoints = {
23
- sm: 640,
24
- md: 768,
25
- lg: 1024,
26
- xl: 1280
21
+ var breakpointAliases = {
22
+ sm: "640px",
23
+ md: "768px",
24
+ lg: "1024px",
25
+ xl: "1280px"
27
26
  };
28
- breakpoints.sm = newBreakpoints.sm;
29
- breakpoints.md = newBreakpoints.md;
30
- breakpoints.lg = newBreakpoints.lg;
31
- breakpoints.xl = newBreakpoints.xl;
27
+ export var breakpoints = Object.assign(["900px", "1200px", "1500px", "1800px"], breakpointAliases);
32
28
  var MODE = "light";
33
29
 
34
30
  // If you are making changes to the colors in the theme file tag the Design Systems team on your PR! Thank you!!
@@ -65,7 +61,8 @@ export var colors = _objectSpread(_objectSpread({
65
61
  selected: COLORS.COLOR_NEUTRAL_800,
66
62
  positive_sentiment: COLORS.COLOR_BLUE_500,
67
63
  negative_sentiment: COLORS.COLOR_RED_500,
68
- 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, ")")
69
66
  },
70
67
  border: {
71
68
  base: COLORS.COLOR_NEUTRAL_200,
@@ -89,9 +86,19 @@ export var colors = _objectSpread(_objectSpread({
89
86
  aqua: aqua.highlight,
90
87
  teal: teal.highlight
91
88
  },
92
- selected: COLORS.COLOR_NEUTRAL_800
89
+ selected: COLORS.COLOR_NEUTRAL_800,
90
+ ai_generated: COLORS.COLOR_PURPLE_700
93
91
  }
94
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
+ },
95
102
  button: {
96
103
  primary: {
97
104
  background: {
@@ -184,6 +191,46 @@ export var colors = _objectSpread(_objectSpread({
184
191
  base: COLORS.COLOR_NEUTRAL_700,
185
192
  hover: COLORS.COLOR_NEUTRAL_900
186
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
+ "ai-primary": {
198
+ background: {
199
+ base: "var(--color-gradient-ai)"
200
+ },
201
+ border: {
202
+ base: "transparent"
203
+ },
204
+ text: {
205
+ base: COLORS.COLOR_NEUTRAL_0,
206
+ hover: COLORS.COLOR_NEUTRAL_0
207
+ }
208
+ },
209
+ "ai-secondary": {
210
+ background: {
211
+ // White base is applied in button.css; this is the 20% gradient tint on top.
212
+ base: "var(--color-gradient-ai-subtle)"
213
+ },
214
+ border: {
215
+ base: "transparent"
216
+ },
217
+ text: {
218
+ base: COLORS.COLOR_NEUTRAL_800,
219
+ hover: COLORS.COLOR_NEUTRAL_800
220
+ }
221
+ },
222
+ "ai-outline": {
223
+ background: {
224
+ base: "transparent"
225
+ },
226
+ border: {
227
+ // Drawn as a rounded gradient border via a ::before pseudo-element in button.css.
228
+ base: "var(--color-gradient-ai)"
229
+ },
230
+ text: {
231
+ base: COLORS.COLOR_NEUTRAL_800,
232
+ hover: COLORS.COLOR_NEUTRAL_800
233
+ }
187
234
  }
188
235
  },
189
236
  link: {
@@ -212,7 +259,8 @@ export var colors = _objectSpread(_objectSpread({
212
259
  pink: pink.foreground,
213
260
  aqua: aqua.foreground,
214
261
  teal: teal.foreground
215
- }
262
+ },
263
+ ai_generated: COLORS.COLOR_NEUTRAL_900
216
264
  },
217
265
  icon: {
218
266
  base: COLORS.COLOR_NEUTRAL_800,
@@ -319,6 +367,7 @@ export var colors = _objectSpread(_objectSpread({
319
367
  instagram: NETWORKCOLORS.NETWORK_COLOR_INSTAGRAM,
320
368
  feedly: NETWORKCOLORS.NETWORK_COLOR_FEEDLY,
321
369
  analytics: NETWORKCOLORS.NETWORK_COLOR_ANALYTICS,
370
+ google_analytics_property: NETWORKCOLORS.NETWORK_COLOR_ANALYTICS,
322
371
  youtube: NETWORKCOLORS.NETWORK_COLOR_YOUTUBE,
323
372
  messenger: NETWORKCOLORS.NETWORK_COLOR_MESSENGER,
324
373
  snapchat: NETWORKCOLORS.NETWORK_COLOR_SNAPCHAT,
@@ -455,7 +504,6 @@ export var duration = {
455
504
  };
456
505
  var theme = {
457
506
  breakpoints: breakpoints,
458
- newBreakpoints: newBreakpoints,
459
507
  colors: colors,
460
508
  typography: _objectSpread(_objectSpread({}, typography), {}, {
461
509
  typography: typography
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-theme",
3
- "version": "3.6.1",
3
+ "version": "4.1.0",
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
+ };