@datalayer/primer-addons 1.0.12 → 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.
@@ -0,0 +1,193 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * Earth Theme for Primer React.
7
+ *
8
+ * Ocean blues (sea), forest greens (plants), golden yellows (sun) —
9
+ * the Blue Planet, inspired by satellite observations of Earth.
10
+ * Theming is applied via **CSS custom-property overrides**.
11
+ */
12
+ import { theme as primerTheme } from '@primer/react';
13
+ import { earthColors } from '../colors/earthColors';
14
+ import { buildThemeStyles } from './createThemeCSSVars';
15
+ /* ── Light-mode colour definitions ───────────────────────────────────── */
16
+ const earthLight = {
17
+ canvas: {
18
+ default: earthColors.white,
19
+ },
20
+ fg: {
21
+ default: '#1A2332',
22
+ muted: earthColors.gray,
23
+ onEmphasis: earthColors.white,
24
+ },
25
+ accent: {
26
+ fg: earthColors.oceanText,
27
+ emphasis: earthColors.oceanBrand,
28
+ muted: earthColors.oceanAccent,
29
+ },
30
+ success: {
31
+ fg: earthColors.forestBrand,
32
+ emphasis: earthColors.forestBrand,
33
+ muted: earthColors.forestAccent,
34
+ },
35
+ border: {
36
+ default: '#C1D0DD',
37
+ muted: '#DAE4ED',
38
+ },
39
+ btn: {
40
+ text: '#1A2332',
41
+ bg: earthColors.white,
42
+ border: '#A8BDD0',
43
+ hoverBg: earthColors.oceanTint,
44
+ hoverBorder: earthColors.gray,
45
+ activeBg: earthColors.oceanTint,
46
+ activeBorder: earthColors.gray,
47
+ selectedBg: earthColors.white,
48
+ counterBg: earthColors.gray,
49
+ primary: {
50
+ text: earthColors.white,
51
+ bg: earthColors.oceanText,
52
+ border: earthColors.oceanText,
53
+ hoverBg: earthColors.oceanHover,
54
+ hoverBorder: earthColors.oceanHover,
55
+ selectedBg: earthColors.oceanHover,
56
+ disabledText: 'rgba(255, 255, 255, 0.8)',
57
+ disabledBg: '#7DB8D8',
58
+ disabledBorder: '#7DB8D8',
59
+ icon: earthColors.white,
60
+ counterBg: 'rgba(0, 0, 0, 0.2)',
61
+ },
62
+ outline: {
63
+ text: earthColors.oceanText,
64
+ hoverText: earthColors.white,
65
+ hoverBg: earthColors.oceanText,
66
+ hoverBorder: earthColors.oceanText,
67
+ hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
68
+ selectedText: earthColors.white,
69
+ selectedBg: earthColors.oceanHover,
70
+ selectedBorder: earthColors.oceanHover,
71
+ disabledText: earthColors.gray,
72
+ disabledBg: earthColors.oceanTint,
73
+ disabledCounterBg: 'rgba(0, 0, 0, 0.05)',
74
+ counterBg: 'rgba(0, 0, 0, 0.05)',
75
+ counterFg: earthColors.oceanText,
76
+ hoverCounterFg: earthColors.white,
77
+ disabledCounterFg: earthColors.gray,
78
+ },
79
+ danger: {
80
+ text: '#d32f2f',
81
+ hoverText: earthColors.white,
82
+ hoverBg: '#d32f2f',
83
+ hoverBorder: '#d32f2f',
84
+ hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
85
+ selectedText: earthColors.white,
86
+ selectedBg: '#b71c1c',
87
+ selectedBorder: '#b71c1c',
88
+ disabledText: 'rgba(211, 47, 47, 0.5)',
89
+ disabledBg: earthColors.oceanTint,
90
+ disabledCounterBg: 'rgba(211, 47, 47, 0.05)',
91
+ counterBg: 'rgba(211, 47, 47, 0.1)',
92
+ counterFg: '#d32f2f',
93
+ hoverCounterFg: earthColors.white,
94
+ disabledCounterFg: 'rgba(211, 47, 47, 0.5)',
95
+ icon: '#d32f2f',
96
+ },
97
+ },
98
+ };
99
+ /* ── Dark-mode colour definitions ────────────────────────────────────── */
100
+ const earthDark = {
101
+ canvas: {
102
+ default: earthColors.black,
103
+ subtle: '#0E1D30',
104
+ },
105
+ fg: {
106
+ default: '#D4E4DC',
107
+ muted: '#8A9BA8',
108
+ onEmphasis: earthColors.white,
109
+ },
110
+ accent: {
111
+ fg: earthColors.oceanAccent,
112
+ emphasis: earthColors.oceanBright,
113
+ muted: earthColors.oceanBrand,
114
+ subtle: '#0C2440',
115
+ },
116
+ success: {
117
+ fg: earthColors.forestAccent,
118
+ emphasis: earthColors.forestAccent,
119
+ muted: earthColors.forestBrand,
120
+ subtle: '#0C2D18',
121
+ },
122
+ btn: {
123
+ text: '#D4E4DC',
124
+ bg: '#162236',
125
+ border: 'rgba(212, 228, 220, 0.12)',
126
+ hoverBg: '#1E3048',
127
+ hoverBorder: '#8A9BA8',
128
+ activeBg: '#162236',
129
+ activeBorder: '#6B7C88',
130
+ selectedBg: '#0E1D30',
131
+ counterBg: '#1E3048',
132
+ primary: {
133
+ text: earthColors.white,
134
+ bg: earthColors.oceanAccent,
135
+ border: 'rgba(212, 228, 220, 0.12)',
136
+ hoverBg: earthColors.oceanBright,
137
+ hoverBorder: 'rgba(212, 228, 220, 0.12)',
138
+ selectedBg: earthColors.oceanBright,
139
+ disabledText: 'rgba(255, 255, 255, 0.5)',
140
+ disabledBg: 'rgba(3, 105, 161, 0.35)',
141
+ disabledBorder: 'rgba(3, 105, 161, 0.2)',
142
+ icon: earthColors.white,
143
+ counterBg: 'rgba(0, 0, 0, 0.2)',
144
+ },
145
+ outline: {
146
+ text: earthColors.oceanAccent,
147
+ hoverText: earthColors.white,
148
+ hoverBg: earthColors.oceanAccent,
149
+ hoverBorder: earthColors.oceanAccent,
150
+ hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
151
+ selectedText: earthColors.white,
152
+ selectedBg: earthColors.oceanBright,
153
+ selectedBorder: earthColors.oceanBright,
154
+ disabledText: 'rgba(14, 165, 233, 0.5)',
155
+ disabledBg: 'rgba(14, 165, 233, 0.1)',
156
+ disabledCounterBg: 'rgba(14, 165, 233, 0.05)',
157
+ counterBg: 'rgba(14, 165, 233, 0.1)',
158
+ counterFg: earthColors.oceanAccent,
159
+ hoverCounterFg: earthColors.white,
160
+ disabledCounterFg: 'rgba(14, 165, 233, 0.5)',
161
+ },
162
+ danger: {
163
+ text: '#f85149',
164
+ hoverText: earthColors.white,
165
+ hoverBg: '#da3633',
166
+ hoverBorder: '#f85149',
167
+ hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
168
+ selectedText: earthColors.white,
169
+ selectedBg: '#b62324',
170
+ selectedBorder: '#ff7b72',
171
+ disabledText: 'rgba(248, 81, 73, 0.5)',
172
+ disabledBg: 'rgba(248, 81, 73, 0.1)',
173
+ disabledCounterBg: 'rgba(248, 81, 73, 0.05)',
174
+ counterBg: 'rgba(248, 81, 73, 0.1)',
175
+ counterFg: '#f85149',
176
+ hoverCounterFg: earthColors.white,
177
+ disabledCounterFg: 'rgba(248, 81, 73, 0.5)',
178
+ icon: '#f85149',
179
+ },
180
+ },
181
+ };
182
+ /* ── Exports ─────────────────────────────────────────────────────────── */
183
+ /**
184
+ * The Primer theme object.
185
+ *
186
+ * Since theming is now done entirely via CSS custom properties
187
+ * (see `earthThemeStyles`), this is just the unmodified
188
+ * default Primer theme kept for backward compatibility.
189
+ */
190
+ export const earthTheme = primerTheme;
191
+ /** Comprehensive Primer CSS-variable overrides for light & dark mode. */
192
+ export const earthThemeStyles = buildThemeStyles(earthLight, earthDark);
193
+ export default earthTheme;
@@ -1,5 +1,3 @@
1
- import { lovelyColors } from '../colors';
2
- export { lovelyColors };
3
1
  /**
4
2
  * The Primer theme object.
5
3
  *
@@ -11,8 +11,6 @@
11
11
  import { theme as primerTheme } from '@primer/react';
12
12
  import { lovelyColors } from '../colors';
13
13
  import { buildThemeStyles } from './createThemeCSSVars';
14
- // Re-export so existing consumers keep working.
15
- export { lovelyColors };
16
14
  /* ── Light-mode colour definitions ───────────────────────────────────── */
17
15
  const lovelyLight = {
18
16
  canvas: {
@@ -1,5 +1,3 @@
1
- import { matrixColors } from '../colors';
2
- export { matrixColors };
3
1
  /**
4
2
  * The Primer theme object.
5
3
  *
@@ -11,8 +11,6 @@
11
11
  import { theme as primerTheme } from '@primer/react';
12
12
  import { matrixColors } from '../colors';
13
13
  import { buildThemeStyles } from './createThemeCSSVars';
14
- // Re-export so existing consumers keep working.
15
- export { matrixColors };
16
14
  /* ── Light-mode colour definitions ───────────────────────────────────── */
17
15
  const matrixLight = {
18
16
  canvas: {
@@ -1,5 +1,3 @@
1
- import { spatialColors } from '../colors';
2
- export { spatialColors };
3
1
  /**
4
2
  * The Primer theme object.
5
3
  *
@@ -11,8 +11,6 @@
11
11
  import { theme as primerTheme } from '@primer/react';
12
12
  import { spatialColors } from '../colors';
13
13
  import { buildThemeStyles } from './createThemeCSSVars';
14
- // Re-export so existing consumers keep working.
15
- export { spatialColors };
16
14
  /* ── Light-mode colour definitions ───────────────────────────────────── */
17
15
  const spatialLight = {
18
16
  canvas: {
@@ -9,7 +9,6 @@
9
9
  import { type StoreApi, type UseBoundStore } from 'zustand';
10
10
  import type { ThemeVariant } from './themeRegistry';
11
11
  import type { ColorMode } from './DatalayerBrandThemeProvider';
12
- export type { ThemeVariant, ColorMode };
13
12
  export interface ThemeState {
14
13
  /** Current color mode (light, dark, or auto = follow OS). */
15
14
  colorMode: ColorMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/primer-addons",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "license": "BSD-3-Clause",
5
5
  "scripts": {
6
6
  "build": "tsc && vite build",
@@ -1,8 +0,0 @@
1
- /** @deprecated Use `defaultIndicatorColors.reservation` */
2
- export declare const RESERVATION_CIRCLE_COLOR: string;
3
- /** @deprecated Use `defaultIndicatorColors.credits` */
4
- export declare const CREDITS_CIRCLE_COLOR: string;
5
- /** @deprecated Use `defaultIndicatorColors.inviteJoined` */
6
- export declare const JOINED_INVITE_COLOR: string;
7
- /** @deprecated Use `defaultIndicatorColors.invitePending` */
8
- export declare const PENDING_INVITE_COLOR: string;
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2025 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- /**
6
- * @deprecated Use `indicatorColors` / `defaultIndicatorColors` from
7
- * `@datalayer/primer-addons/lib/theme` instead.
8
- */
9
- import { defaultIndicatorColors } from './colors/indicatorColors';
10
- /** @deprecated Use `defaultIndicatorColors.reservation` */
11
- export const RESERVATION_CIRCLE_COLOR = defaultIndicatorColors.reservation;
12
- /** @deprecated Use `defaultIndicatorColors.credits` */
13
- export const CREDITS_CIRCLE_COLOR = defaultIndicatorColors.credits;
14
- /** @deprecated Use `defaultIndicatorColors.inviteJoined` */
15
- export const JOINED_INVITE_COLOR = defaultIndicatorColors.inviteJoined;
16
- /** @deprecated Use `defaultIndicatorColors.invitePending` */
17
- export const PENDING_INVITE_COLOR = defaultIndicatorColors.invitePending;