@purpurds/theme 7.14.0 → 8.0.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 (39) hide show
  1. package/.rush/temp/ci_build/@purpurds/theme/{c57802c8cf92c28803a6efc14a068565981032a8.untar.log → 0646f8ac54319d2ce21f09e9f3209badb3907451.untar.log} +2 -2
  2. package/.rush/temp/operation/ci_build/all.log +12 -6
  3. package/.rush/temp/operation/ci_build/log-chunks.jsonl +12 -6
  4. package/.rush/temp/operation/ci_build/state.json +1 -1
  5. package/.rush/temp/operation/test_unit/state.json +1 -1
  6. package/.rush/temp/shrinkwrap-deps.json +1 -1
  7. package/dist/LICENSE.txt +8 -8
  8. package/dist/ThemeProvider.d.ts +7 -5
  9. package/dist/ThemeProvider.d.ts.map +1 -1
  10. package/dist/telia-dark.d.ts +129 -0
  11. package/dist/telia-dark.d.ts.map +1 -0
  12. package/dist/telia-light.d.ts +129 -0
  13. package/dist/telia-light.d.ts.map +1 -0
  14. package/dist/telia-theme.d.ts +223 -20
  15. package/dist/telia-theme.d.ts.map +1 -1
  16. package/dist/theme-props.d.ts +32 -17
  17. package/dist/theme-props.d.ts.map +1 -1
  18. package/dist/theme.cjs.js +1 -1
  19. package/dist/theme.cjs.js.map +1 -1
  20. package/dist/theme.d.ts +4 -2
  21. package/dist/theme.d.ts.map +1 -1
  22. package/dist/theme.es.js +346 -133
  23. package/dist/theme.es.js.map +1 -1
  24. package/dist/types.d.ts +4 -0
  25. package/dist/types.d.ts.map +1 -1
  26. package/dist/useApplyTheme.d.ts +10 -0
  27. package/dist/useApplyTheme.d.ts.map +1 -0
  28. package/dist/useColorScheme.d.ts.map +1 -1
  29. package/package.json +4 -3
  30. package/src/ThemeProvider.tsx +18 -27
  31. package/src/telia-dark.ts +141 -0
  32. package/src/telia-light.ts +278 -0
  33. package/src/telia-theme.ts +6 -88
  34. package/src/theme-props.ts +32 -17
  35. package/src/theme.ts +4 -2
  36. package/src/types.ts +1 -0
  37. package/src/useApplyTheme.ts +34 -0
  38. package/types.d.ts +0 -365
  39. /package/src/{useColorScheme.tsx → useColorScheme.ts} +0 -0
@@ -0,0 +1,278 @@
1
+ import {
2
+ purpurColorBackgroundInteractiveAutoFill,
3
+ purpurColorBackgroundInteractiveDestructive,
4
+ purpurColorBackgroundInteractiveDestructiveActive,
5
+ purpurColorBackgroundInteractiveDestructiveHover,
6
+ purpurColorBackgroundInteractiveDisabled,
7
+ purpurColorBackgroundInteractiveDisabledNegative,
8
+ purpurColorBackgroundInteractiveExpressive,
9
+ purpurColorBackgroundInteractiveExpressiveActive,
10
+ purpurColorBackgroundInteractiveExpressiveActiveNegative,
11
+ purpurColorBackgroundInteractiveExpressiveHover,
12
+ purpurColorBackgroundInteractiveExpressiveHoverNegative,
13
+ purpurColorBackgroundInteractiveExpressiveNegative,
14
+ purpurColorBackgroundInteractiveInactive,
15
+ purpurColorBackgroundInteractiveInactiveNegative,
16
+ purpurColorBackgroundInteractivePrimary,
17
+ purpurColorBackgroundInteractivePrimaryActive,
18
+ purpurColorBackgroundInteractivePrimaryActiveNegative,
19
+ purpurColorBackgroundInteractivePrimaryHover,
20
+ purpurColorBackgroundInteractivePrimaryHoverNegative,
21
+ purpurColorBackgroundInteractivePrimaryNegative,
22
+ purpurColorBackgroundInteractiveReadOnly,
23
+ purpurColorBackgroundInteractiveReadOnlyNegative,
24
+ purpurColorBackgroundInteractiveTransparentActive,
25
+ purpurColorBackgroundInteractiveTransparentActiveNegative,
26
+ purpurColorBackgroundInteractiveTransparentHover,
27
+ purpurColorBackgroundInteractiveTransparentHoverNegative,
28
+ purpurColorBackgroundOnImage,
29
+ purpurColorBackgroundOnImageNegative,
30
+ purpurColorBackgroundPrimary,
31
+ purpurColorBackgroundPrimaryNegative,
32
+ purpurColorBackgroundSecondary,
33
+ purpurColorBackgroundSecondaryNegative,
34
+ purpurColorBackgroundStatusAttention,
35
+ purpurColorBackgroundStatusBlackFriday,
36
+ purpurColorBackgroundStatusErrorMedium,
37
+ purpurColorBackgroundStatusErrorStrong,
38
+ purpurColorBackgroundStatusErrorStrongNegative,
39
+ purpurColorBackgroundStatusInfoMedium,
40
+ purpurColorBackgroundStatusInfoStrong,
41
+ purpurColorBackgroundStatusNeutral,
42
+ purpurColorBackgroundStatusSpecial,
43
+ purpurColorBackgroundStatusSuccessMedium,
44
+ purpurColorBackgroundStatusSuccessStrong,
45
+ purpurColorBackgroundStatusSuccessStrongNegative,
46
+ purpurColorBackgroundStatusWarningMedium,
47
+ purpurColorBackgroundStatusWarningStrong,
48
+ purpurColorBackgroundStatusWarningStrongNegative,
49
+ purpurColorBackgroundToneOnTonePrimary,
50
+ purpurColorBackgroundToneOnToneQuaternary,
51
+ purpurColorBackgroundToneOnToneSecondary,
52
+ purpurColorBackgroundToneOnToneTertiary,
53
+ purpurColorBorderInteractiveExpressive,
54
+ purpurColorBorderInteractiveFocus,
55
+ purpurColorBorderInteractivePrimary,
56
+ purpurColorBorderInteractivePrimaryActive,
57
+ purpurColorBorderInteractivePrimaryActiveNegative,
58
+ purpurColorBorderInteractivePrimaryHover,
59
+ purpurColorBorderInteractivePrimaryHoverNegative,
60
+ purpurColorBorderInteractivePrimaryNegative,
61
+ purpurColorBorderInteractiveSelected,
62
+ purpurColorBorderInteractiveSubtle,
63
+ purpurColorBorderInteractiveSubtleHover,
64
+ purpurColorBorderInteractiveSubtleHoverNegative,
65
+ purpurColorBorderInteractiveSubtleNegative,
66
+ purpurColorBorderMedium,
67
+ purpurColorBorderMediumNegative,
68
+ purpurColorBorderStatusError,
69
+ purpurColorBorderStatusErrorNegative,
70
+ purpurColorBorderStatusInfo,
71
+ purpurColorBorderStatusSuccess,
72
+ purpurColorBorderStatusSuccessNegative,
73
+ purpurColorBorderStatusWarning,
74
+ purpurColorBorderStrong,
75
+ purpurColorBorderStrongNegative,
76
+ purpurColorBorderWeak,
77
+ purpurColorBorderWeakNegative,
78
+ purpurColorBrandBeige,
79
+ purpurColorBrandCorePurple,
80
+ purpurColorBrandDeepBeige,
81
+ purpurColorBrandDeepPurple,
82
+ purpurColorBrandLightBeige,
83
+ purpurColorBrandLightPurple,
84
+ purpurColorBrandOffBlack,
85
+ purpurColorBrandWhite,
86
+ purpurColorTextDefault,
87
+ purpurColorTextDefaultNegative,
88
+ purpurColorTextInteractiveOnDestructive,
89
+ purpurColorTextInteractiveOnExpressive,
90
+ purpurColorTextInteractiveOnExpressiveActive,
91
+ purpurColorTextInteractiveOnExpressiveActiveNegative,
92
+ purpurColorTextInteractiveOnExpressiveHover,
93
+ purpurColorTextInteractiveOnExpressiveHoverNegative,
94
+ purpurColorTextInteractiveOnExpressiveNegative,
95
+ purpurColorTextInteractiveOnPrimary,
96
+ purpurColorTextInteractiveOnPrimaryNegative,
97
+ purpurColorTextInteractivePrimary,
98
+ purpurColorTextInteractivePrimaryActive,
99
+ purpurColorTextInteractivePrimaryActiveNegative,
100
+ purpurColorTextInteractivePrimaryHover,
101
+ purpurColorTextInteractivePrimaryHoverNegative,
102
+ purpurColorTextInteractivePrimaryNegative,
103
+ purpurColorTextInteractiveSelected,
104
+ purpurColorTextMedium,
105
+ purpurColorTextMediumNegative,
106
+ purpurColorTextStatusAttention,
107
+ purpurColorTextStatusBlackFriday,
108
+ purpurColorTextStatusDiscount,
109
+ purpurColorTextStatusErrorMedium,
110
+ purpurColorTextStatusErrorMediumNegative,
111
+ purpurColorTextStatusErrorStrong,
112
+ purpurColorTextStatusErrorStrongNegative,
113
+ purpurColorTextStatusInfoMedium,
114
+ purpurColorTextStatusInfoStrong,
115
+ purpurColorTextStatusNeutral,
116
+ purpurColorTextStatusSpecial,
117
+ purpurColorTextStatusSuccessMedium,
118
+ purpurColorTextStatusSuccessStrong,
119
+ purpurColorTextStatusSuccessStrongNegative,
120
+ purpurColorTextStatusWarningMedium,
121
+ purpurColorTextStatusWarningMediumNegative,
122
+ purpurColorTextStatusWarningStrong,
123
+ purpurColorTextToneOnTonePrimary,
124
+ purpurColorTextToneOnToneSecondary,
125
+ purpurColorTextToneOnToneTertiary,
126
+ purpurColorTextWeak,
127
+ purpurColorTextWeakNegative,
128
+ } from "@purpurds/tokens";
129
+
130
+ import type { ThemeProps } from "./theme-props";
131
+
132
+ export const light = {
133
+ colorBrandDeepPurple: purpurColorBrandDeepPurple,
134
+ colorBrandCorePurple: purpurColorBrandCorePurple,
135
+ colorBrandLightPurple: purpurColorBrandLightPurple,
136
+ colorBrandDeepBeige: purpurColorBrandDeepBeige,
137
+ colorBrandBeige: purpurColorBrandBeige,
138
+ colorBrandLightBeige: purpurColorBrandLightBeige,
139
+ colorBrandOffBlack: purpurColorBrandOffBlack,
140
+ colorBrandWhite: purpurColorBrandWhite,
141
+
142
+ colorTextDefault: purpurColorTextDefault,
143
+ colorTextMedium: purpurColorTextMedium,
144
+ colorTextWeak: purpurColorTextWeak,
145
+ colorTextDefaultNegative: purpurColorTextDefaultNegative,
146
+ colorTextMediumNegative: purpurColorTextMediumNegative,
147
+ colorTextWeakNegative: purpurColorTextWeakNegative,
148
+
149
+ colorTextInteractivePrimary: purpurColorTextInteractivePrimary,
150
+ colorTextInteractivePrimaryHover: purpurColorTextInteractivePrimaryHover,
151
+ colorTextInteractivePrimaryActive: purpurColorTextInteractivePrimaryActive,
152
+ colorTextInteractiveOnPrimary: purpurColorTextInteractiveOnPrimary,
153
+ colorTextInteractiveOnExpressive: purpurColorTextInteractiveOnExpressive,
154
+ colorTextInteractiveOnExpressiveHover: purpurColorTextInteractiveOnExpressiveHover,
155
+ colorTextInteractiveOnExpressiveActive: purpurColorTextInteractiveOnExpressiveActive,
156
+ colorTextInteractiveOnDestructive: purpurColorTextInteractiveOnDestructive,
157
+ colorTextInteractiveSelected: purpurColorTextInteractiveSelected,
158
+ colorTextInteractivePrimaryNegative: purpurColorTextInteractivePrimaryNegative,
159
+ colorTextInteractivePrimaryHoverNegative: purpurColorTextInteractivePrimaryHoverNegative,
160
+ colorTextInteractivePrimaryActiveNegative: purpurColorTextInteractivePrimaryActiveNegative,
161
+ colorTextInteractiveOnPrimaryNegative: purpurColorTextInteractiveOnPrimaryNegative,
162
+ colorTextInteractiveOnExpressiveNegative: purpurColorTextInteractiveOnExpressiveNegative,
163
+ colorTextInteractiveOnExpressiveHoverNegative:
164
+ purpurColorTextInteractiveOnExpressiveHoverNegative,
165
+ colorTextInteractiveOnExpressiveActiveNegative:
166
+ purpurColorTextInteractiveOnExpressiveActiveNegative,
167
+
168
+ colorTextStatusInfoMedium: purpurColorTextStatusInfoMedium,
169
+ colorTextStatusInfoStrong: purpurColorTextStatusInfoStrong,
170
+ colorTextStatusSuccessMedium: purpurColorTextStatusSuccessMedium,
171
+ colorTextStatusSuccessStrong: purpurColorTextStatusSuccessStrong,
172
+ colorTextStatusWarningMedium: purpurColorTextStatusWarningMedium,
173
+ colorTextStatusWarningStrong: purpurColorTextStatusWarningStrong,
174
+ colorTextStatusErrorMedium: purpurColorTextStatusErrorMedium,
175
+ colorTextStatusErrorStrong: purpurColorTextStatusErrorStrong,
176
+ colorTextStatusNeutral: purpurColorTextStatusNeutral,
177
+ colorTextStatusSpecial: purpurColorTextStatusSpecial,
178
+ colorTextStatusAttention: purpurColorTextStatusAttention,
179
+ colorTextStatusDiscount: purpurColorTextStatusDiscount,
180
+ colorTextStatusBlackFriday: purpurColorTextStatusBlackFriday,
181
+ colorTextStatusSuccessStrongNegative: purpurColorTextStatusSuccessStrongNegative,
182
+ colorTextStatusErrorMediumNegative: purpurColorTextStatusErrorMediumNegative,
183
+ colorTextStatusErrorStrongNegative: purpurColorTextStatusErrorStrongNegative,
184
+ colorTextStatusWarningMediumNegative: purpurColorTextStatusWarningMediumNegative,
185
+
186
+ colorTextToneOnTonePrimary: purpurColorTextToneOnTonePrimary,
187
+ colorTextToneOnToneSecondary: purpurColorTextToneOnToneSecondary,
188
+ colorTextToneOnToneTertiary: purpurColorTextToneOnToneTertiary,
189
+
190
+ colorBackgroundPrimary: purpurColorBackgroundPrimary,
191
+ colorBackgroundSecondary: purpurColorBackgroundSecondary,
192
+ colorBackgroundOnImage: purpurColorBackgroundOnImage,
193
+ colorBackgroundPrimaryNegative: purpurColorBackgroundPrimaryNegative,
194
+ colorBackgroundSecondaryNegative: purpurColorBackgroundSecondaryNegative,
195
+ colorBackgroundOnImageNegative: purpurColorBackgroundOnImageNegative,
196
+
197
+ colorBackgroundInteractivePrimary: purpurColorBackgroundInteractivePrimary,
198
+ colorBackgroundInteractivePrimaryHover: purpurColorBackgroundInteractivePrimaryHover,
199
+ colorBackgroundInteractivePrimaryActive: purpurColorBackgroundInteractivePrimaryActive,
200
+ colorBackgroundInteractiveExpressive: purpurColorBackgroundInteractiveExpressive,
201
+ colorBackgroundInteractiveExpressiveHover: purpurColorBackgroundInteractiveExpressiveHover,
202
+ colorBackgroundInteractiveExpressiveActive: purpurColorBackgroundInteractiveExpressiveActive,
203
+ colorBackgroundInteractiveTransparentHover: purpurColorBackgroundInteractiveTransparentHover,
204
+ colorBackgroundInteractiveTransparentActive: purpurColorBackgroundInteractiveTransparentActive,
205
+ colorBackgroundInteractiveDisabled: purpurColorBackgroundInteractiveDisabled,
206
+ colorBackgroundInteractiveReadOnly: purpurColorBackgroundInteractiveReadOnly,
207
+ colorBackgroundInteractiveInactive: purpurColorBackgroundInteractiveInactive,
208
+ colorBackgroundInteractiveDestructive: purpurColorBackgroundInteractiveDestructive,
209
+ colorBackgroundInteractiveDestructiveHover: purpurColorBackgroundInteractiveDestructiveHover,
210
+ colorBackgroundInteractiveDestructiveActive: purpurColorBackgroundInteractiveDestructiveActive,
211
+ colorBackgroundInteractiveAutoFill: purpurColorBackgroundInteractiveAutoFill,
212
+ colorBackgroundInteractivePrimaryNegative: purpurColorBackgroundInteractivePrimaryNegative,
213
+ colorBackgroundInteractivePrimaryHoverNegative:
214
+ purpurColorBackgroundInteractivePrimaryHoverNegative,
215
+ colorBackgroundInteractivePrimaryActiveNegative:
216
+ purpurColorBackgroundInteractivePrimaryActiveNegative,
217
+ colorBackgroundInteractiveExpressiveNegative: purpurColorBackgroundInteractiveExpressiveNegative,
218
+ colorBackgroundInteractiveExpressiveHoverNegative:
219
+ purpurColorBackgroundInteractiveExpressiveHoverNegative,
220
+ colorBackgroundInteractiveExpressiveActiveNegative:
221
+ purpurColorBackgroundInteractiveExpressiveActiveNegative,
222
+ colorBackgroundInteractiveTransparentHoverNegative:
223
+ purpurColorBackgroundInteractiveTransparentHoverNegative,
224
+ colorBackgroundInteractiveTransparentActiveNegative:
225
+ purpurColorBackgroundInteractiveTransparentActiveNegative,
226
+ colorBackgroundInteractiveDisabledNegative: purpurColorBackgroundInteractiveDisabledNegative,
227
+ colorBackgroundInteractiveInactiveNegative: purpurColorBackgroundInteractiveInactiveNegative,
228
+ colorBackgroundInteractiveReadOnlyNegative: purpurColorBackgroundInteractiveReadOnlyNegative,
229
+
230
+ colorBackgroundStatusInfoMedium: purpurColorBackgroundStatusInfoMedium,
231
+ colorBackgroundStatusInfoStrong: purpurColorBackgroundStatusInfoStrong,
232
+ colorBackgroundStatusSuccessMedium: purpurColorBackgroundStatusSuccessMedium,
233
+ colorBackgroundStatusSuccessStrong: purpurColorBackgroundStatusSuccessStrong,
234
+ colorBackgroundStatusWarningMedium: purpurColorBackgroundStatusWarningMedium,
235
+ colorBackgroundStatusWarningStrong: purpurColorBackgroundStatusWarningStrong,
236
+ colorBackgroundStatusErrorMedium: purpurColorBackgroundStatusErrorMedium,
237
+ colorBackgroundStatusErrorStrong: purpurColorBackgroundStatusErrorStrong,
238
+ colorBackgroundStatusNeutral: purpurColorBackgroundStatusNeutral,
239
+ colorBackgroundStatusSpecial: purpurColorBackgroundStatusSpecial,
240
+ colorBackgroundStatusAttention: purpurColorBackgroundStatusAttention,
241
+ colorBackgroundStatusBlackFriday: purpurColorBackgroundStatusBlackFriday,
242
+ colorBackgroundStatusSuccessStrongNegative: purpurColorBackgroundStatusSuccessStrongNegative,
243
+ colorBackgroundStatusWarningStrongNegative: purpurColorBackgroundStatusWarningStrongNegative,
244
+ colorBackgroundStatusErrorStrongNegative: purpurColorBackgroundStatusErrorStrongNegative,
245
+
246
+ colorBackgroundToneOnTonePrimary: purpurColorBackgroundToneOnTonePrimary,
247
+ colorBackgroundToneOnToneSecondary: purpurColorBackgroundToneOnToneSecondary,
248
+ colorBackgroundToneOnToneTertiary: purpurColorBackgroundToneOnToneTertiary,
249
+ colorBackgroundToneOnToneQuaternary: purpurColorBackgroundToneOnToneQuaternary,
250
+
251
+ colorBorderWeak: purpurColorBorderWeak,
252
+ colorBorderMedium: purpurColorBorderMedium,
253
+ colorBorderStrong: purpurColorBorderStrong,
254
+ colorBorderWeakNegative: purpurColorBorderWeakNegative,
255
+ colorBorderMediumNegative: purpurColorBorderMediumNegative,
256
+ colorBorderStrongNegative: purpurColorBorderStrongNegative,
257
+
258
+ colorBorderInteractivePrimary: purpurColorBorderInteractivePrimary,
259
+ colorBorderInteractivePrimaryHover: purpurColorBorderInteractivePrimaryHover,
260
+ colorBorderInteractivePrimaryActive: purpurColorBorderInteractivePrimaryActive,
261
+ colorBorderInteractiveFocus: purpurColorBorderInteractiveFocus,
262
+ colorBorderInteractiveExpressive: purpurColorBorderInteractiveExpressive,
263
+ colorBorderInteractiveSubtle: purpurColorBorderInteractiveSubtle,
264
+ colorBorderInteractiveSubtleHover: purpurColorBorderInteractiveSubtleHover,
265
+ colorBorderInteractiveSelected: purpurColorBorderInteractiveSelected,
266
+ colorBorderInteractivePrimaryNegative: purpurColorBorderInteractivePrimaryNegative,
267
+ colorBorderInteractivePrimaryHoverNegative: purpurColorBorderInteractivePrimaryHoverNegative,
268
+ colorBorderInteractivePrimaryActiveNegative: purpurColorBorderInteractivePrimaryActiveNegative,
269
+ colorBorderInteractiveSubtleNegative: purpurColorBorderInteractiveSubtleNegative,
270
+ colorBorderInteractiveSubtleHoverNegative: purpurColorBorderInteractiveSubtleHoverNegative,
271
+
272
+ colorBorderStatusError: purpurColorBorderStatusError,
273
+ colorBorderStatusWarning: purpurColorBorderStatusWarning,
274
+ colorBorderStatusInfo: purpurColorBorderStatusInfo,
275
+ colorBorderStatusSuccess: purpurColorBorderStatusSuccess,
276
+ colorBorderStatusErrorNegative: purpurColorBorderStatusErrorNegative,
277
+ colorBorderStatusSuccessNegative: purpurColorBorderStatusSuccessNegative,
278
+ } satisfies ThemeProps;
@@ -1,90 +1,8 @@
1
- import {
2
- purpurColorBackgroundInteractiveDisabled,
3
- purpurColorBackgroundInteractivePrimary,
4
- purpurColorBackgroundInteractivePrimaryActive,
5
- purpurColorBackgroundInteractivePrimaryHover,
6
- purpurColorBackgroundInteractiveTransparentActive,
7
- purpurColorBackgroundInteractiveTransparentHover,
8
- purpurColorBackgroundPrimary,
9
- purpurColorBackgroundSecondary,
10
- purpurColorBorderInteractiveFocus,
11
- purpurColorBorderInteractivePrimary,
12
- purpurColorBorderInteractivePrimaryHover,
13
- purpurColorBorderInteractiveSubtle,
14
- purpurColorBorderMedium,
15
- purpurColorBorderWeak,
16
- purpurColorBrandCorePurple,
17
- purpurColorBrandDeepPurple,
18
- purpurColorBrandOffBlack,
19
- purpurColorTextDefault,
20
- purpurColorTextInteractiveOnPrimary,
21
- purpurColorTextInteractivePrimary,
22
- purpurColorTextInteractivePrimaryActive,
23
- purpurColorTextInteractivePrimaryHover,
24
- purpurColorTextMedium,
25
- purpurColorTextWeak,
26
- } from "@purpurds/tokens";
27
-
28
- import type { Theme } from "./types";
1
+ import { dark } from "./telia-dark";
2
+ import { light } from "./telia-light";
3
+ import type { ThemeProps } from "./theme-props";
29
4
 
30
5
  export const teliaTheme = {
31
- light: {
32
- colorBackgroundPrimary: purpurColorBackgroundPrimary,
33
- colorBackgroundSecondary: purpurColorBackgroundSecondary,
34
- colorBackgroundInteractivePrimary: purpurColorBackgroundInteractivePrimary,
35
- colorBackgroundInteractivePrimaryHover: purpurColorBackgroundInteractivePrimaryHover,
36
- colorBackgroundInteractivePrimaryActive: purpurColorBackgroundInteractivePrimaryActive,
37
- colorBackgroundInteractiveTransparentHover: purpurColorBackgroundInteractiveTransparentHover,
38
- colorBackgroundInteractiveTransparentActive: purpurColorBackgroundInteractiveTransparentActive,
39
- colorBackgroundInteractiveDisabled: purpurColorBackgroundInteractiveDisabled,
40
-
41
- colorTextDefault: purpurColorTextDefault,
42
- colorTextMedium: purpurColorTextMedium,
43
- colorTextWeak: purpurColorTextWeak,
44
- colorTextInteractivePrimary: purpurColorTextInteractivePrimary,
45
- colorTextInteractivePrimaryActive: purpurColorTextInteractivePrimaryActive,
46
- colorTextInteractivePrimaryHover: purpurColorTextInteractivePrimaryHover,
47
- colorTextInteractiveOnPrimary: purpurColorTextInteractiveOnPrimary,
48
-
49
- colorBrandDeepPurple: purpurColorBrandDeepPurple,
50
- colorBrandCorePurple: purpurColorBrandCorePurple,
51
- colorBrandOffBlack: purpurColorBrandOffBlack,
52
-
53
- colorBorderWeak: purpurColorBorderWeak,
54
- colorBorderMedium: purpurColorBorderMedium,
55
- colorBorderInteractivePrimary: purpurColorBorderInteractivePrimary,
56
- colorBorderInteractivePrimaryHover: purpurColorBorderInteractivePrimaryHover,
57
- colorBorderInteractiveFocus: purpurColorBorderInteractiveFocus,
58
- colorBorderInteractiveSubtle: purpurColorBorderInteractiveSubtle,
59
- },
60
- dark: {
61
- colorBackgroundPrimary: "var(--purpur-color-gray-900)",
62
- colorBackgroundSecondary: "var(--purpur-color-gray-850)",
63
- colorBackgroundInteractivePrimary: "var(--purpur-color-purple-100)",
64
- colorBackgroundInteractivePrimaryHover: "var(--purpur-color-purple-200)",
65
- colorBackgroundInteractivePrimaryActive: "var(--purpur-color-purple-300)",
66
- colorBackgroundInteractiveTransparentHover: "var(color-purple-800)",
67
- colorBackgroundInteractiveTransparentActive: "var(--purpur-color-purple-700)",
68
- colorBackgroundInteractiveDisabled: "var(--purpur-color-gray-700)",
69
-
70
- colorTextDefault: "var(--purpur-color-transparent-white-950)",
71
- colorTextMedium: "var(--purpur-color-transparent-white-850)",
72
- colorTextWeak: "var(--purpur-color-transparent-white-700)",
73
- colorTextInteractivePrimary: "var(--purpur-color-purple-100)",
74
- colorTextInteractivePrimaryActive: "var(--purpur-color-purple-200)",
75
- colorTextInteractivePrimaryHover: "var(--purpur-color-purple-200)",
76
- colorTextInteractiveOnPrimary: "var(--purpur-color-purple-800)",
77
-
78
- colorBrandDeepPurple: "var(--purpur-color-purple-200)",
79
- colorBrandCorePurple: "var(--purpur-color-purple-400)",
80
- colorBrandOffBlack: "var(--purpur-color-transparent-white-950)",
81
-
82
- colorBorderWeak: "var(--purpur-color-transparent-white-150)",
83
- colorBorderMedium: "var(--purpur-color-transparent-white-300)",
84
- colorBorderStrong: "var(--purpur-color-transparent-white-500)",
85
- colorBorderInteractivePrimary: "var(--purpur-color-purple-100)",
86
- colorBorderInteractivePrimaryHover: "var(--purpur-color-purple-200)",
87
- colorBorderInteractiveFocus: "var(--purpur-color-purple-300)",
88
- colorBorderInteractiveSubtle: "var(--purpur-color-transparent-white-800)",
89
- },
90
- } satisfies Theme;
6
+ light,
7
+ dark,
8
+ } satisfies { light: ThemeProps; dark: ThemeProps };
@@ -23,21 +23,27 @@ export type ThemeProps = {
23
23
  colorTextInteractiveOnPrimary?: string;
24
24
  colorTextInteractiveOnPrimaryNegative?: string;
25
25
  colorTextInteractivePrimaryNegative?: string;
26
- colorTextInteractivePrimaryNegativeHover?: string;
27
- colorTextInteractivePrimaryNegativeActive?: string;
26
+ colorTextInteractivePrimaryHoverNegative?: string;
27
+ colorTextInteractivePrimaryActiveNegative?: string;
28
28
  colorTextInteractiveOnExpressive?: string;
29
29
  colorTextInteractiveOnExpressiveNegative?: string;
30
- colorTextInteractiveOnExpressiveNegativeHover?: string;
31
- colorTextInteractiveOnExpressiveNegativeActive?: string;
30
+ colorTextInteractiveOnExpressiveHover?: string;
31
+ colorTextInteractiveOnExpressiveHoverNegative?: string;
32
+ colorTextInteractiveOnExpressiveActive?: string;
33
+ colorTextInteractiveOnExpressiveActiveNegative?: string;
32
34
  colorTextInteractiveOnDestructive?: string;
33
35
  colorTextInteractiveSelected?: string;
34
36
  colorTextStatusDiscount?: string;
35
37
  colorTextStatusErrorStrong?: string;
38
+ colorTextStatusErrorStrongNegative?: string;
36
39
  colorTextStatusErrorMedium?: string;
40
+ colorTextStatusErrorMediumNegative?: string;
37
41
  colorTextStatusSuccessStrong?: string;
42
+ colorTextStatusSuccessStrongNegative?: string;
38
43
  colorTextStatusSuccessMedium?: string;
39
44
  colorTextStatusWarningStrong?: string;
40
45
  colorTextStatusWarningMedium?: string;
46
+ colorTextStatusWarningMediumNegative?: string;
41
47
  colorTextStatusInfoStrong?: string;
42
48
  colorTextStatusInfoMedium?: string;
43
49
  colorTextStatusNeutral?: string;
@@ -58,35 +64,38 @@ export type ThemeProps = {
58
64
  colorBackgroundInteractivePrimaryHover?: string;
59
65
  colorBackgroundInteractivePrimaryActive?: string;
60
66
  colorBackgroundInteractivePrimaryNegative?: string;
61
- colorBackgroundInteractivePrimaryNegativeHover?: string;
62
- colorBackgroundInteractivePrimaryNegativeActive?: string;
67
+ colorBackgroundInteractivePrimaryHoverNegative?: string;
68
+ colorBackgroundInteractivePrimaryActiveNegative?: string;
63
69
  colorBackgroundInteractiveExpressive?: string;
64
70
  colorBackgroundInteractiveExpressiveHover?: string;
65
71
  colorBackgroundInteractiveExpressiveActive?: string;
66
72
  colorBackgroundInteractiveExpressiveNegative?: string;
67
- colorBackgroundInteractiveExpressiveNegativeHover?: string;
68
- colorBackgroundInteractiveExpressiveNegativeActive?: string;
73
+ colorBackgroundInteractiveExpressiveHoverNegative?: string;
74
+ colorBackgroundInteractiveExpressiveActiveNegative?: string;
69
75
  colorBackgroundInteractiveDisabled?: string;
70
76
  colorBackgroundInteractiveDisabledNegative?: string;
71
- colorBackgroundInteractiveTransparent?: string;
72
77
  colorBackgroundInteractiveTransparentHover?: string;
73
- colorBackgroundInteractiveTransparentNegativeHover?: string;
78
+ colorBackgroundInteractiveTransparentHoverNegative?: string;
74
79
  colorBackgroundInteractiveTransparentActive?: string;
75
- colorBackgroundInteractiveTransparentNegativeActive?: string;
80
+ colorBackgroundInteractiveTransparentActiveNegative?: string;
76
81
  colorBackgroundInteractiveInactive?: string;
77
82
  colorBackgroundInteractiveInactiveNegative?: string;
78
83
  colorBackgroundInteractiveReadOnly?: string;
84
+ colorBackgroundInteractiveReadOnlyNegative?: string;
79
85
  colorBackgroundInteractiveDestructive?: string;
80
86
  colorBackgroundInteractiveDestructiveHover?: string;
81
87
  colorBackgroundInteractiveDestructiveActive?: string;
82
- colorBackgroundStatusInfo?: string;
88
+ colorBackgroundStatusInfoMedium?: string;
83
89
  colorBackgroundStatusInfoStrong?: string;
84
- colorBackgroundStatusSuccess?: string;
90
+ colorBackgroundStatusSuccessMedium?: string;
85
91
  colorBackgroundStatusSuccessStrong?: string;
86
- colorBackgroundStatusError?: string;
92
+ colorBackgroundStatusSuccessStrongNegative?: string;
93
+ colorBackgroundStatusErrorMedium?: string;
87
94
  colorBackgroundStatusErrorStrong?: string;
88
- colorBackgroundStatusWarning?: string;
95
+ colorBackgroundStatusErrorStrongNegative?: string;
96
+ colorBackgroundStatusWarningMedium?: string;
89
97
  colorBackgroundStatusWarningStrong?: string;
98
+ colorBackgroundStatusWarningStrongNegative?: string;
90
99
  colorBackgroundStatusNeutral?: string;
91
100
  colorBackgroundStatusSpecial?: string;
92
101
  colorBackgroundStatusAttention?: string;
@@ -106,15 +115,20 @@ export type ThemeProps = {
106
115
  colorBorderInteractivePrimaryNegative?: string;
107
116
  colorBorderInteractivePrimaryHover?: string;
108
117
  colorBorderInteractivePrimaryActive?: string;
109
- colorBorderInteractivePrimaryNegativeHover?: string;
110
- colorBorderInteractivePrimaryNegativeActive?: string;
118
+ colorBorderInteractivePrimaryHoverNegative?: string;
119
+ colorBorderInteractivePrimaryActiveNegative?: string;
120
+ colorBorderInteractiveExpressive?: string;
111
121
  colorBorderInteractiveSelected?: string;
112
122
  colorBorderInteractiveSubtle?: string;
123
+ colorBorderInteractiveSubtleNegative?: string;
113
124
  colorBorderInteractiveSubtleHover?: string;
125
+ colorBorderInteractiveSubtleHoverNegative?: string;
114
126
  colorBorderStatusError?: string;
127
+ colorBorderStatusErrorNegative?: string;
115
128
  colorBorderStatusWarning?: string;
116
129
  colorBorderStatusInfo?: string;
117
130
  colorBorderStatusSuccess?: string;
131
+ colorBorderStatusSuccessNegative?: string;
118
132
  colorOverlayDefault?: string;
119
133
  spacingGutterSm?: string;
120
134
  spacingGutterMd?: string;
@@ -130,6 +144,7 @@ export type ThemeProps = {
130
144
  typographyWeightMedium?: string;
131
145
  typographyWeightBold?: string;
132
146
  typographyLineHeightTight?: string;
147
+ typographyLineHeightSnug?: string;
133
148
  typographyLineHeightDefault?: string;
134
149
  typographyLineHeightLoose?: string;
135
150
  typographyLineHeightLooser?: string;
package/src/theme.ts CHANGED
@@ -1,4 +1,6 @@
1
+ export { teliaTheme } from "./telia-theme";
1
2
  export { type ThemeProps } from "./theme-props";
2
- export { ThemeProvider } from "./ThemeProvider";
3
- export { type ColorScheme, type Theme } from "./types";
3
+ export { ThemeProvider, useTheme } from "./ThemeProvider";
4
+ export { type ColorOptions, type ColorScheme, type Theme } from "./types";
5
+ export { useApplyTheme } from "./useApplyTheme";
4
6
  export { useColorScheme } from "./useColorScheme";
package/src/types.ts CHANGED
@@ -12,4 +12,5 @@ export type ColorOptions = ColorScheme | "auto";
12
12
  export type ThemeContextType = {
13
13
  colorScheme: ColorOptions;
14
14
  setColorScheme: (colorScheme: ColorOptions) => void;
15
+ options?: { heroBannerColorScheme?: ColorScheme; footerColorScheme?: ColorScheme };
15
16
  };
@@ -0,0 +1,34 @@
1
+ import { useEffect } from "react";
2
+ import { kebabCase } from "change-case";
3
+
4
+ import { teliaTheme } from "./telia-theme";
5
+ import type { ColorScheme, Theme } from "./types";
6
+
7
+ type Props = {
8
+ theme?: Theme;
9
+ cssVariablesSelector?: string;
10
+ currentColorScheme?: ColorScheme;
11
+ };
12
+
13
+ export const useApplyTheme = ({
14
+ theme = teliaTheme,
15
+ cssVariablesSelector,
16
+ currentColorScheme,
17
+ }: Props) => {
18
+ useEffect(() => {
19
+ if (currentColorScheme) {
20
+ Object.entries(theme?.[currentColorScheme] ?? teliaTheme[currentColorScheme]).forEach(
21
+ ([key, value]) => {
22
+ const element = cssVariablesSelector
23
+ ? (document.querySelector(cssVariablesSelector) as HTMLElement)
24
+ : null;
25
+
26
+ (element ?? document.documentElement).style.setProperty(
27
+ `--purpur-${kebabCase(key)}`,
28
+ value
29
+ );
30
+ }
31
+ );
32
+ }
33
+ }, [theme, cssVariablesSelector, currentColorScheme]);
34
+ };