@datalayer/primer-addons 1.0.11 → 1.0.13

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 (49) hide show
  1. package/lib/App.d.ts +1 -0
  2. package/lib/App.js +1 -0
  3. package/lib/components/appearance/AppearanceControls.d.ts +10 -0
  4. package/lib/components/appearance/AppearanceControls.js +42 -0
  5. package/lib/components/appearance/AppearanceControlsWithStore.d.ts +8 -0
  6. package/lib/{theme/ThemeSwitcher.js → components/appearance/AppearanceControlsWithStore.js} +5 -3
  7. package/lib/components/appearance/index.d.ts +2 -0
  8. package/lib/components/appearance/index.js +6 -0
  9. package/lib/components/index.d.ts +4 -0
  10. package/lib/components/index.js +4 -0
  11. package/lib/components/logo/DatalayerLogo.d.ts +39 -0
  12. package/lib/components/logo/DatalayerLogo.js +116 -0
  13. package/lib/components/logo/DatalayerLogoText.d.ts +30 -0
  14. package/lib/components/logo/DatalayerLogoText.js +30 -0
  15. package/lib/components/logo/DatalayerText.d.ts +22 -0
  16. package/lib/components/logo/DatalayerText.js +21 -0
  17. package/lib/components/logo/index.d.ts +3 -0
  18. package/lib/components/logo/index.js +3 -0
  19. package/lib/index.js +0 -1
  20. package/lib/theme/colors/datalayerColors.js +1 -1
  21. package/lib/theme/colors/earthColors.d.ts +39 -0
  22. package/lib/theme/colors/earthColors.js +51 -0
  23. package/lib/theme/colors/index.d.ts +14 -0
  24. package/lib/theme/colors/index.js +24 -0
  25. package/lib/theme/colors/indicatorColors.d.ts +50 -0
  26. package/lib/theme/colors/indicatorColors.js +68 -0
  27. package/lib/theme/index.d.ts +1 -2
  28. package/lib/theme/index.js +1 -2
  29. package/lib/theme/themeRegistry.d.ts +1 -1
  30. package/lib/theme/themeRegistry.js +51 -1
  31. package/lib/theme/themes/datalayerTheme.d.ts +0 -2
  32. package/lib/theme/themes/datalayerTheme.js +0 -2
  33. package/lib/theme/themes/earthTheme.d.ts +1091 -0
  34. package/lib/theme/themes/earthTheme.js +193 -0
  35. package/lib/theme/themes/lovelyTheme.d.ts +0 -2
  36. package/lib/theme/themes/lovelyTheme.js +0 -2
  37. package/lib/theme/themes/matrixTheme.d.ts +0 -2
  38. package/lib/theme/themes/matrixTheme.js +0 -2
  39. package/lib/theme/themes/spatialTheme.d.ts +0 -2
  40. package/lib/theme/themes/spatialTheme.js +0 -2
  41. package/lib/theme/useThemeStore.d.ts +0 -1
  42. package/lib/utils/Portals.d.ts +4 -0
  43. package/lib/utils/Portals.js +61 -9
  44. package/package.json +1 -1
  45. package/lib/_utils/story-helpers.d.ts +0 -31
  46. package/lib/_utils/story-helpers.js +0 -105
  47. package/lib/theme/Palette.d.ts +0 -4
  48. package/lib/theme/Palette.js +0 -10
  49. package/lib/theme/ThemeSwitcher.d.ts +0 -17
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /* ── Per-theme palettes ────────────────────────────────── */
6
+ const datalayer = {
7
+ neutral: '#656D76',
8
+ muted: '#8b949e',
9
+ pending: '#d29922',
10
+ warning: '#d29922',
11
+ danger: '#d1242f',
12
+ success: '#16A085',
13
+ info: '#0969da',
14
+ reservation: '#656D76',
15
+ credits: '#16A085',
16
+ inviteJoined: '#0969da',
17
+ invitePending: '#cfd3d7',
18
+ };
19
+ const spatial = {
20
+ neutral: '#8892B0',
21
+ muted: '#6B7394',
22
+ pending: '#E2B340',
23
+ warning: '#E2B340',
24
+ danger: '#FF5252',
25
+ success: '#4F46E5',
26
+ info: '#448AFF',
27
+ reservation: '#8892B0',
28
+ credits: '#4F46E5',
29
+ inviteJoined: '#448AFF',
30
+ invitePending: '#6B7394',
31
+ };
32
+ const lovely = {
33
+ neutral: '#9D7A8F',
34
+ muted: '#C9A2B8',
35
+ pending: '#FFD740',
36
+ warning: '#FFD740',
37
+ danger: '#FF1744',
38
+ success: '#DB2777',
39
+ info: '#536DFE',
40
+ reservation: '#9D7A8F',
41
+ credits: '#DB2777',
42
+ inviteJoined: '#536DFE',
43
+ invitePending: '#C9A2B8',
44
+ };
45
+ const matrix = {
46
+ neutral: '#5A6E3A',
47
+ muted: '#7A9A50',
48
+ pending: '#FFD600',
49
+ warning: '#FFD600',
50
+ danger: '#FF3D00',
51
+ success: '#00C853',
52
+ info: '#00E676',
53
+ reservation: '#5A6E3A',
54
+ credits: '#00C853',
55
+ inviteJoined: '#00E676',
56
+ invitePending: '#7A9A50',
57
+ };
58
+ /* ── Public map ────────────────────────────────────────── */
59
+ export const indicatorColors = {
60
+ datalayer,
61
+ spatial,
62
+ lovely,
63
+ matrix,
64
+ };
65
+ /**
66
+ * Convenience: default indicator palette (Datalayer theme).
67
+ */
68
+ export const defaultIndicatorColors = datalayer;
@@ -6,10 +6,9 @@ export * from './DatalayerBrandThemeProvider';
6
6
  export * from './themes/spatialTheme';
7
7
  export * from './themes/lovelyTheme';
8
8
  export * from './themes/matrixTheme';
9
+ export * from './themes/earthTheme';
9
10
  export * from './themes-brand/spatialBrandTheme';
10
11
  export * from './themeRegistry';
11
- export * from './Palette';
12
12
  export * from './useSystemColorMode';
13
13
  export * from './useThemeStore';
14
- export * from './ThemeSwitcher';
15
14
  export * from './ThemedProvider';
@@ -10,10 +10,9 @@ export * from './DatalayerBrandThemeProvider';
10
10
  export * from './themes/spatialTheme';
11
11
  export * from './themes/lovelyTheme';
12
12
  export * from './themes/matrixTheme';
13
+ export * from './themes/earthTheme';
13
14
  export * from './themes-brand/spatialBrandTheme';
14
15
  export * from './themeRegistry';
15
- export * from './Palette';
16
16
  export * from './useSystemColorMode';
17
17
  export * from './useThemeStore';
18
- export * from './ThemeSwitcher';
19
18
  export * from './ThemedProvider';
@@ -1,7 +1,7 @@
1
1
  import { type CSSProperties } from 'react';
2
2
  import { type ColorMode } from './DatalayerBrandThemeProvider';
3
3
  /** Available theme variants. */
4
- export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix';
4
+ export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth';
5
5
  /** A pair of colours for a two-stop gradient. */
6
6
  export interface GradientPair {
7
7
  /** Start colour (brighter / brand). */
@@ -6,10 +6,12 @@ import { datalayerTheme, datalayerThemeStyles } from './themes/datalayerTheme';
6
6
  import { spatialTheme, spatialThemeStyles } from './themes/spatialTheme';
7
7
  import { lovelyTheme, lovelyThemeStyles } from './themes/lovelyTheme';
8
8
  import { matrixTheme, matrixThemeStyles } from './themes/matrixTheme';
9
+ import { earthTheme, earthThemeStyles } from './themes/earthTheme';
9
10
  import { datalayerColors } from './colors/datalayerColors';
10
11
  import { spatialColors } from './colors/spatialColors';
11
12
  import { lovelyColors } from './colors/lovelyColors';
12
13
  import { matrixColors } from './colors/matrixColors';
14
+ import { earthColors } from './colors/earthColors';
13
15
  /* ─── Registry ────────────────────────────────────────────────────────── */
14
16
  export const themeConfigs = {
15
17
  datalayer: {
@@ -140,9 +142,41 @@ export const themeConfigs = {
140
142
  gold: matrixColors.brightLightGold, // #FFAB00 — vivid amber
141
143
  },
142
144
  },
145
+ earth: {
146
+ label: 'Earth',
147
+ description: 'Ocean blues, forest greens & golden sun — the Blue Planet.',
148
+ brandColor: earthColors.oceanBrand,
149
+ defaultColorMode: 'auto',
150
+ primerTheme: earthTheme,
151
+ themeStyles: earthThemeStyles,
152
+ cardGradient: {
153
+ light: { from: earthColors.oceanBrand, to: earthColors.oceanText }, // #0369A1 → #075985
154
+ dark: { from: earthColors.oceanAccent, to: earthColors.oceanBrand }, // #0EA5E9 → #0369A1
155
+ },
156
+ brightPalette: {
157
+ glow: earthColors.brightGlow, // #0EA5E9 — vivid ocean blue
158
+ onGlow: '#ffffff', // white text on ocean blue
159
+ pop: earthColors.brightPop, // #22C55E — vivid green
160
+ spark: earthColors.brightSpark, // #EAB308 — vivid gold
161
+ blaze: earthColors.brightBlaze, // #EF4444 — vivid red
162
+ surge: earthColors.brightSurge, // #3B82F6 — deep blue
163
+ flame: earthColors.brightFlame, // #F59E0B — amber gold
164
+ gold: earthColors.brightGold, // #FACC15 — sunflower
165
+ },
166
+ brightPaletteLight: {
167
+ glow: earthColors.brightLightGlow, // #0284C7 — deep ocean blue
168
+ onGlow: '#ffffff', // white text on deep ocean
169
+ pop: earthColors.brightLightPop, // #16A34A — vivid forest green
170
+ spark: earthColors.brightLightSpark, // #CA8A04 — deep golden sun
171
+ blaze: earthColors.brightLightBlaze, // #DC2626 — deep red
172
+ surge: earthColors.brightLightSurge, // #2563EB — deep ocean blue
173
+ flame: earthColors.brightLightFlame, // #D97706 — deep amber
174
+ gold: earthColors.brightLightGold, // #A16207 — deep gold
175
+ },
176
+ },
143
177
  };
144
178
  /** All available theme variants in display order. */
145
- export const themeVariants = ['datalayer', 'spatial', 'lovely', 'matrix'];
179
+ export const themeVariants = ['datalayer', 'spatial', 'lovely', 'matrix', 'earth'];
146
180
  /** Look up a theme config by variant name. */
147
181
  export function getThemeConfig(variant) {
148
182
  return themeConfigs[variant];
@@ -263,6 +297,22 @@ const avatarColorPalettes = {
263
297
  matrixColors.brightSurge, // #00E5FF — electric blue
264
298
  ],
265
299
  },
300
+ earth: {
301
+ light: [
302
+ earthColors.oceanText, // #075985 — deep ocean blue
303
+ earthColors.oceanBrand, // #0369A1 — brand ocean
304
+ earthColors.brightLightPop, // #16A34A — vivid forest green
305
+ earthColors.brightLightSpark, // #CA8A04 — deep golden sun
306
+ earthColors.gray, // #5B6B7A — slate
307
+ ],
308
+ dark: [
309
+ earthColors.oceanAccent, // #0EA5E9 — bright sky blue
310
+ earthColors.oceanBright, // #38BDF8 — vivid sky blue
311
+ earthColors.brightPop, // #22C55E — vivid green
312
+ earthColors.brightSpark, // #EAB308 — vivid gold
313
+ earthColors.brightFlame, // #F59E0B — amber gold
314
+ ],
315
+ },
266
316
  };
267
317
  /**
268
318
  * Get a 5-colour avatar palette for the given theme variant and colour mode.
@@ -1,5 +1,3 @@
1
- import { datalayerColors } from '../colors';
2
- export { datalayerColors };
3
1
  /**
4
2
  * The Primer theme object.
5
3
  *
@@ -12,8 +12,6 @@
12
12
  import { theme as primerTheme } from '@primer/react';
13
13
  import { datalayerColors } from '../colors';
14
14
  import { buildThemeStyles } from './createThemeCSSVars';
15
- // Re-export so existing consumers keep working.
16
- export { datalayerColors };
17
15
  /* ── Light-mode colour definitions ───────────────────────────────────── */
18
16
  const datalayerLight = {
19
17
  canvas: {