@purpurds/theme 7.13.1 → 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/{10faf61143baee1a2e22f79fd791f0db853e0f61.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
package/dist/theme.es.js CHANGED
@@ -1,165 +1,378 @@
1
- import { jsx as v } from "react/jsx-runtime";
2
- import { createContext as h, useState as m, useEffect as s, useContext as C } from "react";
3
- const x = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), T = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), y = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), k = /[^\p{L}\d]+/giu, f = "$1\0$2", B = "";
4
- function P(e) {
5
- let r = e.trim();
6
- r = r.replace(x, f).replace(T, f), r = r.replace(k, "\0");
7
- let o = 0, c = r.length;
8
- for (; r.charAt(o) === "\0"; )
9
- o++;
10
- if (o === c)
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import { useEffect as v, createContext as m, useState as d, useContext as C } from "react";
3
+ const N = {
4
+ colorBrandDeepPurple: "var(--purpur-color-purple-100)",
5
+ colorBrandCorePurple: "var(--purpur-color-purple-400)",
6
+ colorBrandLightPurple: "var(--purpur-color-purple-900)",
7
+ colorBrandDeepBeige: "var(--purpur-color-beige-100)",
8
+ colorBrandBeige: "var(--purpur-color-beige-700)",
9
+ colorBrandLightBeige: "var(--purpur-color-beige-800)",
10
+ colorBrandOffBlack: "var(--purpur-color-functional-white)",
11
+ colorBrandWhite: "var(--purpur-color-gray-900)",
12
+ colorTextDefault: "var(--purpur-color-transparent-white-950)",
13
+ colorTextMedium: "var(--purpur-color-transparent-white-700)",
14
+ colorTextWeak: "var(--purpur-color-transparent-white-400)",
15
+ colorTextDefaultNegative: "var(--purpur-color-transparent-black-800)",
16
+ colorTextMediumNegative: "var(--purpur-color-transparent-black-500)",
17
+ colorTextWeakNegative: "var(--purpur-color-transparent-black-400)",
18
+ colorTextInteractivePrimary: "var(--purpur-color-purple-100)",
19
+ colorTextInteractivePrimaryHover: "var(--purpur-color-purple-200)",
20
+ colorTextInteractivePrimaryActive: "var(--purpur-color-purple-300)",
21
+ colorTextInteractiveOnPrimary: "var(--purpur-color-purple-800)",
22
+ colorTextInteractiveOnExpressive: "var(--purpur-color-functional-white)",
23
+ colorTextInteractiveOnExpressiveHover: "var(--purpur-color-purple-900)",
24
+ colorTextInteractiveOnExpressiveActive: "var(--purpur-color-purple-900)",
25
+ colorTextInteractiveOnDestructive: "var(--purpur-color-functional-white)",
26
+ colorTextInteractiveSelected: "var(--purpur-color-purple-300)",
27
+ colorTextInteractivePrimaryNegative: "var(--purpur-color-purple-700)",
28
+ colorTextInteractivePrimaryHoverNegative: "var(--purpur-color-purple-800)",
29
+ colorTextInteractivePrimaryActiveNegative: "var(--purpur-color-purple-900)",
30
+ colorTextInteractiveOnPrimaryNegative: "var(--purpur-color-functional-white)",
31
+ colorTextInteractiveOnExpressiveNegative: "var(--purpur-color-functional-white)",
32
+ colorTextInteractiveOnExpressiveHoverNegative: "var(--purpur-color-functional-white)",
33
+ colorTextInteractiveOnExpressiveActiveNegative: "var(--purpur-color-functional-white)",
34
+ colorTextStatusInfoMedium: "var(--purpur-color-blue-400)",
35
+ colorTextStatusInfoStrong: "var(--purpur-color-blue-200)",
36
+ colorTextStatusSuccessMedium: "var(--purpur-color-green-400)",
37
+ colorTextStatusSuccessStrong: "var(--purpur-color-green-200)",
38
+ colorTextStatusWarningMedium: "var(--purpur-color-orange-300)",
39
+ colorTextStatusWarningStrong: "var(--purpur-color-orange-200)",
40
+ colorTextStatusErrorMedium: "var(--purpur-color-red-400)",
41
+ colorTextStatusErrorStrong: "var(--purpur-color-red-200)",
42
+ colorTextStatusNeutral: "var(--purpur-color-functional-white)",
43
+ colorTextStatusSpecial: "var(--purpur-color-functional-white)",
44
+ colorTextStatusAttention: "var(--purpur-color-purple-800)",
45
+ colorTextStatusDiscount: "var(--purpur-color-purple-300)",
46
+ colorTextStatusBlackFriday: "var(--purpur-color-gray-900)",
47
+ colorTextStatusSuccessStrongNegative: "var(--purpur-color-green-700)",
48
+ colorTextStatusErrorMediumNegative: "var(--purpur-color-red-500)",
49
+ colorTextStatusErrorStrongNegative: "var(--purpur-color-red-700)",
50
+ colorTextStatusWarningMediumNegative: "var(--purpur-color-orange-500)",
51
+ colorTextToneOnTonePrimary: "var(--purpur-color-purple-900)",
52
+ colorTextToneOnToneSecondary: "var(--purpur-color-purple-100)",
53
+ colorTextToneOnToneTertiary: "var(--purpur-color-functional-white)",
54
+ colorBackgroundPrimary: "var(--purpur-color-gray-950)",
55
+ colorBackgroundSecondary: "var(--purpur-color-gray-900)",
56
+ colorBackgroundOnImage: "var(--purpur-color-transparent-black-700)",
57
+ colorBackgroundPrimaryNegative: "var(--purpur-color-functional-white)",
58
+ colorBackgroundSecondaryNegative: "var(--purpur-color-gray-50)",
59
+ colorBackgroundOnImageNegative: "var(--purpur-color-transparent-white-850)",
60
+ colorBackgroundInteractivePrimary: "var(--purpur-color-purple-100)",
61
+ colorBackgroundInteractivePrimaryHover: "var(--purpur-color-purple-200)",
62
+ colorBackgroundInteractivePrimaryActive: "var(--purpur-color-purple-300)",
63
+ colorBackgroundInteractiveExpressive: "var(--purpur-color-purple-550)",
64
+ colorBackgroundInteractiveExpressiveHover: "var(--purpur-color-purple-400)",
65
+ colorBackgroundInteractiveExpressiveActive: "var(--purpur-color-purple-300)",
66
+ colorBackgroundInteractiveTransparentHover: "var(--purpur-color-purple-800)",
67
+ colorBackgroundInteractiveTransparentActive: "var(--purpur-color-purple-700)",
68
+ colorBackgroundInteractiveDisabled: "var(--purpur-color-transparent-white-100)",
69
+ colorBackgroundInteractiveReadOnly: "var(--purpur-color-transparent-white-50)",
70
+ colorBackgroundInteractiveInactive: "var(--purpur-color-transparent-white-150)",
71
+ colorBackgroundInteractiveDestructive: "var(--purpur-color-red-500)",
72
+ colorBackgroundInteractiveDestructiveHover: "var(--purpur-color-red-600)",
73
+ colorBackgroundInteractiveDestructiveActive: "var(--purpur-color-red-700)",
74
+ colorBackgroundInteractiveAutoFill: "var(--purpur-color-blue-800)",
75
+ colorBackgroundInteractivePrimaryNegative: "var(--purpur-color-purple-800)",
76
+ colorBackgroundInteractivePrimaryHoverNegative: "var(--purpur-color-purple-700)",
77
+ colorBackgroundInteractivePrimaryActiveNegative: "var(--purpur-color-purple-600)",
78
+ colorBackgroundInteractiveExpressiveNegative: "var(--purpur-color-purple-550)",
79
+ colorBackgroundInteractiveExpressiveHoverNegative: "var(--purpur-color-purple-700)",
80
+ colorBackgroundInteractiveExpressiveActiveNegative: "var(--purpur-color-purple-800)",
81
+ colorBackgroundInteractiveTransparentHoverNegative: "var(--purpur-color-purple-200)",
82
+ colorBackgroundInteractiveTransparentActiveNegative: "var(--purpur-color-purple-300)",
83
+ colorBackgroundInteractiveDisabledNegative: "var(--purpur-color-transparent-black-100)",
84
+ colorBackgroundInteractiveInactiveNegative: "var(--purpur-color-transparent-black-50)",
85
+ colorBackgroundInteractiveReadOnlyNegative: "var(--purpur-color-transparent-black-50)",
86
+ colorBackgroundStatusInfoMedium: "var(--purpur-color-blue-800)",
87
+ colorBackgroundStatusInfoStrong: "var(--purpur-color-blue-300)",
88
+ colorBackgroundStatusSuccessMedium: "var(--purpur-color-green-800)",
89
+ colorBackgroundStatusSuccessStrong: "var(--purpur-color-green-300)",
90
+ colorBackgroundStatusWarningMedium: "var(--purpur-color-orange-800)",
91
+ colorBackgroundStatusWarningStrong: "var(--purpur-color-orange-300)",
92
+ colorBackgroundStatusErrorMedium: "var(--purpur-color-red-800)",
93
+ colorBackgroundStatusErrorStrong: "var(--purpur-color-red-300)",
94
+ colorBackgroundStatusNeutral: "var(--purpur-color-gray-800)",
95
+ colorBackgroundStatusSpecial: "var(--purpur-color-purple-700)",
96
+ colorBackgroundStatusAttention: "var(--purpur-color-purple-100)",
97
+ colorBackgroundStatusBlackFriday: "var(--purpur-color-functional-white)",
98
+ colorBackgroundStatusSuccessStrongNegative: "var(--purpur-color-green-400)",
99
+ colorBackgroundStatusWarningStrongNegative: "var(--purpur-color-orange-300)",
100
+ colorBackgroundStatusErrorStrongNegative: "var(--purpur-color-red-400)",
101
+ colorBackgroundToneOnTonePrimary: "var(--purpur-color-purple-100)",
102
+ colorBackgroundToneOnToneSecondary: "var(--purpur-color-purple-900)",
103
+ colorBackgroundToneOnToneTertiary: "var(--purpur-color-beige-700)",
104
+ colorBackgroundToneOnToneQuaternary: "var(--purpur-color-beige-800)",
105
+ colorBorderWeak: "var(--purpur-color-transparent-white-150)",
106
+ colorBorderMedium: "var(--purpur-color-transparent-white-300)",
107
+ colorBorderStrong: "var(--purpur-color-transparent-white-500)",
108
+ colorBorderWeakNegative: "var(--purpur-color-transparent-black-150)",
109
+ colorBorderMediumNegative: "var(--purpur-color-transparent-black-300)",
110
+ colorBorderStrongNegative: "var(--purpur-color-transparent-black-500)",
111
+ colorBorderInteractivePrimary: "var(--purpur-color-purple-100)",
112
+ colorBorderInteractivePrimaryHover: "var(--purpur-color-purple-200)",
113
+ colorBorderInteractivePrimaryActive: "var(--purpur-color-purple-200)",
114
+ colorBorderInteractiveFocus: "var(--purpur-color-purple-400)",
115
+ colorBorderInteractiveExpressive: "var(--purpur-color-purple-550)",
116
+ colorBorderInteractiveSubtle: "var(--purpur-color-transparent-white-400)",
117
+ colorBorderInteractiveSubtleHover: "var(--purpur-color-purple-200)",
118
+ colorBorderInteractiveSelected: "var(--purpur-color-purple-300)",
119
+ colorBorderInteractivePrimaryNegative: "var(--purpur-color-purple-700)",
120
+ colorBorderInteractivePrimaryHoverNegative: "var(--purpur-color-purple-800)",
121
+ colorBorderInteractivePrimaryActiveNegative: "var(--purpur-color-purple-900)",
122
+ colorBorderInteractiveSubtleNegative: "var(--purpur-color-transparent-black-400)",
123
+ colorBorderInteractiveSubtleHoverNegative: "var(--purpur-color-purple-700)",
124
+ colorBorderStatusError: "var(--purpur-color-red-400)",
125
+ colorBorderStatusWarning: "var(--purpur-color-orange-300)",
126
+ colorBorderStatusInfo: "var(--purpur-color-blue-400)",
127
+ colorBorderStatusSuccess: "var(--purpur-color-green-400)",
128
+ colorBorderStatusErrorNegative: "var(--purpur-color-red-500)",
129
+ colorBorderStatusSuccessNegative: "var(--purpur-color-green-500)"
130
+ }, y = "#29003e", P = "#990ae3", b = "#f4e0ff", E = "#4f4741", h = "#ede1d8", O = "#f9f1ec", A = "#1e1e20", H = "#ffffff", M = "rgba(0, 0, 0, 0.84)", w = "rgba(0, 0, 0, 0.62)", W = "rgba(0, 0, 0, 0.44)", D = "rgba(255, 255, 255, 0.95)", L = "rgba(255, 255, 255, 0.66)", R = "rgba(255, 255, 255, 0.37)", F = "#6d02a3", _ = "#4e0174", U = "#29003e", Q = "#ffffff", j = "#4e0174", X = "#f4e0ff", $ = "#e4b6fb", q = "#e4b6fb", G = "#ffffff", z = "#ffffff", J = "#ffffff", K = "#29003e", Y = "#ffffff", Z = "#29003e", V = "#ffffff", rr = "#990ae3", or = "#990ae3", er = "#980233", tr = "#ff80ab", ar = "#e4175c", cr = "#fb4885", ur = "#02562b", nr = "#3dbf7c", lr = "#018842", pr = "#6a4102", ir = "#a86602", vr = "#f39200", sr = "#014d80", gr = "#0078cb", dr = "rgba(0, 0, 0, 0.71)", Br = "#4e0174", Sr = "#ffffff", Ir = "#ffffff", fr = "#f4e0ff", Tr = "#29003e", kr = "#4f4741", xr = "#ffffff", mr = "#1f002e", Cr = "#f5f5fa", Nr = "#29003e", yr = "rgba(255, 255, 255, 0.84)", Pr = "rgba(0, 0, 0, 0.71)", br = "#e8f6ff", Er = "#4e0174", hr = "#6d02a3", Or = "#8c07d0", Ar = "#f4e0ff", Hr = "#e4b6fb", Mr = "#d58df9", wr = "#990ae3", Wr = "#6d02a3", Dr = "#4e0174", Lr = "#990ae3", Rr = "#c461f7", Fr = "#d58df9", _r = "rgba(0, 0, 0, 0.1)", Ur = "rgba(255, 255, 255, 0.11)", Qr = "#f4e0ff", jr = "#4e0174", Xr = "#e4b6fb", $r = "#6d02a3", qr = "rgba(0, 0, 0, 0.05)", Gr = "rgba(255, 255, 255, 0.16)", zr = "rgba(0, 0, 0, 0.05)", Jr = "rgba(255, 255, 255, 0.11)", Kr = "#e4175c", Yr = "#c00543", Zr = "#980233", Vr = "#caeaff", ro = "#3694d3", oo = "#c5efd9", eo = "#1fa15e", to = "#3dbf7c", ao = "#ffdde8", co = "#fb4885", uo = "#ff80ab", no = "#ffe1b3", lo = "#cc7a00", po = "#f39200", io = "#d6d6dd", vo = "#f4e0ff", so = "#6d02a3", go = "#1e1e20", Bo = "#29003e", So = "#f4e0ff", Io = "#ede1d8", fo = "#f9f1ec", To = "rgba(0, 0, 0, 0.33)", ko = "rgba(255, 255, 255, 0.29)", xo = "rgba(0, 0, 0, 0.54)", mo = "rgba(255, 255, 255, 0.46)", Co = "rgba(0, 0, 0, 0.16)", No = "rgba(255, 255, 255, 0.16)", yo = "#b12df4", Po = "#6d02a3", bo = "#f4e0ff", Eo = "#4e0174", ho = "#29003e", Oo = "#e4b6fb", Ao = "#e4b6fb", Ho = "#990ae3", Mo = "#990ae3", wo = "rgba(0, 0, 0, 0.44)", Wo = "rgba(255, 255, 255, 0.46)", Do = "#6d02a3", Lo = "#c461f7", Ro = "#e4175c", Fo = "#fb4885", _o = "#cc7a00", Uo = "#0078cb", Qo = "#018842", jo = "#1fa15e", Xo = {
131
+ colorBrandDeepPurple: y,
132
+ colorBrandCorePurple: P,
133
+ colorBrandLightPurple: b,
134
+ colorBrandDeepBeige: E,
135
+ colorBrandBeige: h,
136
+ colorBrandLightBeige: O,
137
+ colorBrandOffBlack: A,
138
+ colorBrandWhite: H,
139
+ colorTextDefault: M,
140
+ colorTextMedium: w,
141
+ colorTextWeak: W,
142
+ colorTextDefaultNegative: D,
143
+ colorTextMediumNegative: L,
144
+ colorTextWeakNegative: R,
145
+ colorTextInteractivePrimary: F,
146
+ colorTextInteractivePrimaryHover: _,
147
+ colorTextInteractivePrimaryActive: U,
148
+ colorTextInteractiveOnPrimary: Q,
149
+ colorTextInteractiveOnExpressive: G,
150
+ colorTextInteractiveOnExpressiveHover: J,
151
+ colorTextInteractiveOnExpressiveActive: Y,
152
+ colorTextInteractiveOnDestructive: V,
153
+ colorTextInteractiveSelected: rr,
154
+ colorTextInteractivePrimaryNegative: X,
155
+ colorTextInteractivePrimaryHoverNegative: $,
156
+ colorTextInteractivePrimaryActiveNegative: q,
157
+ colorTextInteractiveOnPrimaryNegative: j,
158
+ colorTextInteractiveOnExpressiveNegative: z,
159
+ colorTextInteractiveOnExpressiveHoverNegative: K,
160
+ colorTextInteractiveOnExpressiveActiveNegative: Z,
161
+ colorTextStatusInfoMedium: gr,
162
+ colorTextStatusInfoStrong: sr,
163
+ colorTextStatusSuccessMedium: lr,
164
+ colorTextStatusSuccessStrong: ur,
165
+ colorTextStatusWarningMedium: ir,
166
+ colorTextStatusWarningStrong: pr,
167
+ colorTextStatusErrorMedium: ar,
168
+ colorTextStatusErrorStrong: er,
169
+ colorTextStatusNeutral: dr,
170
+ colorTextStatusSpecial: Br,
171
+ colorTextStatusAttention: Sr,
172
+ colorTextStatusDiscount: or,
173
+ colorTextStatusBlackFriday: Ir,
174
+ colorTextStatusSuccessStrongNegative: nr,
175
+ colorTextStatusErrorMediumNegative: cr,
176
+ colorTextStatusErrorStrongNegative: tr,
177
+ colorTextStatusWarningMediumNegative: vr,
178
+ colorTextToneOnTonePrimary: fr,
179
+ colorTextToneOnToneSecondary: Tr,
180
+ colorTextToneOnToneTertiary: kr,
181
+ colorBackgroundPrimary: xr,
182
+ colorBackgroundSecondary: Cr,
183
+ colorBackgroundOnImage: yr,
184
+ colorBackgroundPrimaryNegative: mr,
185
+ colorBackgroundSecondaryNegative: Nr,
186
+ colorBackgroundOnImageNegative: Pr,
187
+ colorBackgroundInteractivePrimary: Er,
188
+ colorBackgroundInteractivePrimaryHover: hr,
189
+ colorBackgroundInteractivePrimaryActive: Or,
190
+ colorBackgroundInteractiveExpressive: wr,
191
+ colorBackgroundInteractiveExpressiveHover: Wr,
192
+ colorBackgroundInteractiveExpressiveActive: Dr,
193
+ colorBackgroundInteractiveTransparentHover: Qr,
194
+ colorBackgroundInteractiveTransparentActive: Xr,
195
+ colorBackgroundInteractiveDisabled: _r,
196
+ colorBackgroundInteractiveReadOnly: zr,
197
+ colorBackgroundInteractiveInactive: qr,
198
+ colorBackgroundInteractiveDestructive: Kr,
199
+ colorBackgroundInteractiveDestructiveHover: Yr,
200
+ colorBackgroundInteractiveDestructiveActive: Zr,
201
+ colorBackgroundInteractiveAutoFill: br,
202
+ colorBackgroundInteractivePrimaryNegative: Ar,
203
+ colorBackgroundInteractivePrimaryHoverNegative: Hr,
204
+ colorBackgroundInteractivePrimaryActiveNegative: Mr,
205
+ colorBackgroundInteractiveExpressiveNegative: Lr,
206
+ colorBackgroundInteractiveExpressiveHoverNegative: Rr,
207
+ colorBackgroundInteractiveExpressiveActiveNegative: Fr,
208
+ colorBackgroundInteractiveTransparentHoverNegative: jr,
209
+ colorBackgroundInteractiveTransparentActiveNegative: $r,
210
+ colorBackgroundInteractiveDisabledNegative: Ur,
211
+ colorBackgroundInteractiveInactiveNegative: Gr,
212
+ colorBackgroundInteractiveReadOnlyNegative: Jr,
213
+ colorBackgroundStatusInfoMedium: Vr,
214
+ colorBackgroundStatusInfoStrong: ro,
215
+ colorBackgroundStatusSuccessMedium: oo,
216
+ colorBackgroundStatusSuccessStrong: eo,
217
+ colorBackgroundStatusWarningMedium: no,
218
+ colorBackgroundStatusWarningStrong: lo,
219
+ colorBackgroundStatusErrorMedium: ao,
220
+ colorBackgroundStatusErrorStrong: co,
221
+ colorBackgroundStatusNeutral: io,
222
+ colorBackgroundStatusSpecial: vo,
223
+ colorBackgroundStatusAttention: so,
224
+ colorBackgroundStatusBlackFriday: go,
225
+ colorBackgroundStatusSuccessStrongNegative: to,
226
+ colorBackgroundStatusWarningStrongNegative: po,
227
+ colorBackgroundStatusErrorStrongNegative: uo,
228
+ colorBackgroundToneOnTonePrimary: Bo,
229
+ colorBackgroundToneOnToneSecondary: So,
230
+ colorBackgroundToneOnToneTertiary: Io,
231
+ colorBackgroundToneOnToneQuaternary: fo,
232
+ colorBorderWeak: Co,
233
+ colorBorderMedium: To,
234
+ colorBorderStrong: xo,
235
+ colorBorderWeakNegative: No,
236
+ colorBorderMediumNegative: ko,
237
+ colorBorderStrongNegative: mo,
238
+ colorBorderInteractivePrimary: Po,
239
+ colorBorderInteractivePrimaryHover: Eo,
240
+ colorBorderInteractivePrimaryActive: ho,
241
+ colorBorderInteractiveFocus: yo,
242
+ colorBorderInteractiveExpressive: Ho,
243
+ colorBorderInteractiveSubtle: wo,
244
+ colorBorderInteractiveSubtleHover: Do,
245
+ colorBorderInteractiveSelected: Mo,
246
+ colorBorderInteractivePrimaryNegative: bo,
247
+ colorBorderInteractivePrimaryHoverNegative: Oo,
248
+ colorBorderInteractivePrimaryActiveNegative: Ao,
249
+ colorBorderInteractiveSubtleNegative: Wo,
250
+ colorBorderInteractiveSubtleHoverNegative: Lo,
251
+ colorBorderStatusError: Ro,
252
+ colorBorderStatusWarning: _o,
253
+ colorBorderStatusInfo: Uo,
254
+ colorBorderStatusSuccess: Qo,
255
+ colorBorderStatusErrorNegative: Fo,
256
+ colorBorderStatusSuccessNegative: jo
257
+ }, B = {
258
+ light: Xo,
259
+ dark: N
260
+ }, $o = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), qo = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Go = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), zo = /[^\p{L}\d]+/giu, S = "$1\0$2", I = "";
261
+ function f(o) {
262
+ let r = o.trim();
263
+ r = r.replace($o, S).replace(qo, S), r = r.replace(zo, "\0");
264
+ let e = 0, t = r.length;
265
+ for (; r.charAt(e) === "\0"; )
266
+ e++;
267
+ if (e === t)
11
268
  return [];
12
- for (; r.charAt(c - 1) === "\0"; )
13
- c--;
14
- return r.slice(o, c).split(/\0/g);
269
+ for (; r.charAt(t - 1) === "\0"; )
270
+ t--;
271
+ return r.slice(e, t).split(/\0/g);
15
272
  }
16
- function E(e) {
17
- const r = P(e);
18
- for (let o = 0; o < r.length; o++) {
19
- const c = r[o], n = y.exec(c);
20
- if (n) {
21
- const t = n.index + (n[1] ?? n[2]).length;
22
- r.splice(o, 1, c.slice(0, t), c.slice(t));
273
+ function Jo(o) {
274
+ const r = f(o);
275
+ for (let e = 0; e < r.length; e++) {
276
+ const t = r[e], a = Go.exec(t);
277
+ if (a) {
278
+ const c = a.index + (a[1] ?? a[2]).length;
279
+ r.splice(e, 1, t.slice(0, c), t.slice(c));
23
280
  }
24
281
  }
25
282
  return r;
26
283
  }
27
- function w(e, r) {
28
- const [o, c, n] = L(e, r);
29
- return o + c.map(b(r == null ? void 0 : r.locale)).join((r == null ? void 0 : r.delimiter) ?? " ") + n;
284
+ function Ko(o, r) {
285
+ const [e, t, a] = Vo(o, r);
286
+ return e + t.map(Zo(r == null ? void 0 : r.locale)).join((r == null ? void 0 : r.delimiter) ?? " ") + a;
30
287
  }
31
- function S(e, r) {
32
- return w(e, { delimiter: "-", ...r });
288
+ function Yo(o, r) {
289
+ return Ko(o, { delimiter: "-", ...r });
33
290
  }
34
- function b(e) {
35
- return e === !1 ? (r) => r.toLowerCase() : (r) => r.toLocaleLowerCase(e);
291
+ function Zo(o) {
292
+ return o === !1 ? (r) => r.toLowerCase() : (r) => r.toLocaleLowerCase(o);
36
293
  }
37
- function L(e, r = {}) {
38
- const o = r.split ?? (r.separateNumbers ? E : P), c = r.prefixCharacters ?? B, n = r.suffixCharacters ?? B;
39
- let t = 0, u = e.length;
40
- for (; t < e.length; ) {
41
- const l = e.charAt(t);
42
- if (!c.includes(l))
294
+ function Vo(o, r = {}) {
295
+ const e = r.split ?? (r.separateNumbers ? Jo : f), t = r.prefixCharacters ?? I, a = r.suffixCharacters ?? I;
296
+ let c = 0, u = o.length;
297
+ for (; c < o.length; ) {
298
+ const l = o.charAt(c);
299
+ if (!t.includes(l))
43
300
  break;
44
- t++;
301
+ c++;
45
302
  }
46
- for (; u > t; ) {
47
- const l = u - 1, p = e.charAt(l);
48
- if (!n.includes(p))
303
+ for (; u > c; ) {
304
+ const l = u - 1, p = o.charAt(l);
305
+ if (!a.includes(p))
49
306
  break;
50
307
  u = l;
51
308
  }
52
309
  return [
53
- e.slice(0, t),
54
- o(e.slice(t, u)),
55
- e.slice(u)
310
+ o.slice(0, c),
311
+ e(o.slice(c, u)),
312
+ o.slice(u)
56
313
  ];
57
314
  }
58
- const A = "#29003e", _ = "#990ae3", R = "#1e1e20", H = "rgba(0, 0, 0, 0.84)", D = "rgba(0, 0, 0, 0.62)", F = "rgba(0, 0, 0, 0.44)", M = "#6d02a3", O = "#4e0174", U = "#29003e", W = "#ffffff", N = "#ffffff", j = "#f5f5fa", X = "#4e0174", $ = "#6d02a3", q = "#8c07d0", G = "rgba(0, 0, 0, 0.1)", Q = "#e4b6fb", z = "#d58df9", J = "rgba(0, 0, 0, 0.33)", K = "rgba(0, 0, 0, 0.16)", Y = "#b12df4", Z = "#6d02a3", V = "#4e0174", rr = "rgba(0, 0, 0, 0.44)", er = {
59
- light: {
60
- colorBackgroundPrimary: N,
61
- colorBackgroundSecondary: j,
62
- colorBackgroundInteractivePrimary: X,
63
- colorBackgroundInteractivePrimaryHover: $,
64
- colorBackgroundInteractivePrimaryActive: q,
65
- colorBackgroundInteractiveTransparentHover: Q,
66
- colorBackgroundInteractiveTransparentActive: z,
67
- colorBackgroundInteractiveDisabled: G,
68
- colorTextDefault: H,
69
- colorTextMedium: D,
70
- colorTextWeak: F,
71
- colorTextInteractivePrimary: M,
72
- colorTextInteractivePrimaryActive: U,
73
- colorTextInteractivePrimaryHover: O,
74
- colorTextInteractiveOnPrimary: W,
75
- colorBrandDeepPurple: A,
76
- colorBrandCorePurple: _,
77
- colorBrandOffBlack: R,
78
- colorBorderWeak: K,
79
- colorBorderMedium: J,
80
- colorBorderInteractivePrimary: Z,
81
- colorBorderInteractivePrimaryHover: V,
82
- colorBorderInteractiveFocus: Y,
83
- colorBorderInteractiveSubtle: rr
84
- },
85
- dark: {
86
- colorBackgroundPrimary: "var(--purpur-color-gray-900)",
87
- colorBackgroundSecondary: "var(--purpur-color-gray-850)",
88
- colorBackgroundInteractivePrimary: "var(--purpur-color-purple-100)",
89
- colorBackgroundInteractivePrimaryHover: "var(--purpur-color-purple-200)",
90
- colorBackgroundInteractivePrimaryActive: "var(--purpur-color-purple-300)",
91
- colorBackgroundInteractiveTransparentHover: "var(color-purple-800)",
92
- colorBackgroundInteractiveTransparentActive: "var(--purpur-color-purple-700)",
93
- colorBackgroundInteractiveDisabled: "var(--purpur-color-gray-700)",
94
- colorTextDefault: "var(--purpur-color-transparent-white-950)",
95
- colorTextMedium: "var(--purpur-color-transparent-white-850)",
96
- colorTextWeak: "var(--purpur-color-transparent-white-700)",
97
- colorTextInteractivePrimary: "var(--purpur-color-purple-100)",
98
- colorTextInteractivePrimaryActive: "var(--purpur-color-purple-200)",
99
- colorTextInteractivePrimaryHover: "var(--purpur-color-purple-200)",
100
- colorTextInteractiveOnPrimary: "var(--purpur-color-purple-800)",
101
- colorBrandDeepPurple: "var(--purpur-color-purple-200)",
102
- colorBrandCorePurple: "var(--purpur-color-purple-400)",
103
- colorBrandOffBlack: "var(--purpur-color-transparent-white-950)",
104
- colorBorderWeak: "var(--purpur-color-transparent-white-150)",
105
- colorBorderMedium: "var(--purpur-color-transparent-white-300)",
106
- colorBorderStrong: "var(--purpur-color-transparent-white-500)",
107
- colorBorderInteractivePrimary: "var(--purpur-color-purple-100)",
108
- colorBorderInteractivePrimaryHover: "var(--purpur-color-purple-200)",
109
- colorBorderInteractiveFocus: "var(--purpur-color-purple-300)",
110
- colorBorderInteractiveSubtle: "var(--purpur-color-transparent-white-800)"
111
- }
112
- }, g = h(void 0), ar = ({
113
- cssVariablesSelector: e,
315
+ const re = ({
316
+ theme: o = B,
317
+ cssVariablesSelector: r,
318
+ currentColorScheme: e
319
+ }) => {
320
+ v(() => {
321
+ e && Object.entries((o == null ? void 0 : o[e]) ?? B[e]).forEach(
322
+ ([t, a]) => {
323
+ ((r ? document.querySelector(r) : null) ?? document.documentElement).style.setProperty(
324
+ `--purpur-${Yo(t)}`,
325
+ a
326
+ );
327
+ }
328
+ );
329
+ }, [o, r, e]);
330
+ }, T = m(void 0), ae = ({
331
+ cssVariablesSelector: o,
114
332
  forceColorScheme: r,
115
- theme: o,
116
- children: c,
117
- ...n
333
+ theme: e,
334
+ children: t,
335
+ options: a = {},
336
+ ...c
118
337
  }) => {
119
- const [t, u] = m(r ?? "auto"), [l, p] = m(
338
+ const [u, l] = d(r ?? "auto"), [p, i] = d(
120
339
  r ?? "light"
121
340
  );
122
- s(() => {
341
+ v(() => {
123
342
  if (r)
124
- u(r);
343
+ l(r);
125
344
  else {
126
- const a = localStorage.getItem("colorScheme");
127
- a && u(a);
345
+ const n = localStorage.getItem("colorScheme");
346
+ n && l(n);
128
347
  }
129
- }, [r]), s(() => {
130
- const a = window.matchMedia("(prefers-color-scheme: dark)");
131
- p(t === "auto" ? a.matches ? "dark" : "light" : t);
132
- const i = (d) => {
133
- !r && t === "auto" && p(d.matches ? "dark" : "light");
348
+ }, [r]), v(() => {
349
+ const n = window.matchMedia("(prefers-color-scheme: dark)");
350
+ i(u === "auto" ? n.matches ? "dark" : "light" : u);
351
+ const s = (x) => {
352
+ !r && u === "auto" && i(x.matches ? "dark" : "light");
134
353
  };
135
- return a.addEventListener("change", i), () => {
136
- a.removeEventListener("change", i);
354
+ return n.addEventListener("change", s), () => {
355
+ n.removeEventListener("change", s);
137
356
  };
138
- }, [t, r]), s(() => {
139
- Object.entries((o == null ? void 0 : o[l]) ?? er[l]).forEach(
140
- ([a, i]) => {
141
- ((e ? document.querySelector(e) : null) ?? document.documentElement).style.setProperty(
142
- `--purpur-${S(a)}`,
143
- i
144
- );
145
- }
146
- );
147
- }, [o, e, r, l]);
148
- const I = (a) => {
149
- r || (u(a), localStorage.setItem("colorScheme", a));
357
+ }, [u, r]), re({ theme: e, cssVariablesSelector: o, currentColorScheme: p });
358
+ const k = (n) => {
359
+ r || (l(n), localStorage.setItem("colorScheme", n));
150
360
  };
151
- return /* @__PURE__ */ v(g.Provider, { value: { colorScheme: t, setColorScheme: I }, children: /* @__PURE__ */ v("div", { className: t, ...n, children: c }) });
152
- }, or = () => {
153
- const e = C(g);
154
- if (!e)
361
+ return /* @__PURE__ */ g(T.Provider, { value: { colorScheme: u, setColorScheme: k, options: a }, children: /* @__PURE__ */ g("div", { className: u, ...c, children: t }) });
362
+ }, oe = () => {
363
+ const o = C(T);
364
+ if (!o)
155
365
  throw new Error("useTheme must be used within a ThemeProvider");
156
- return e;
157
- }, nr = () => {
158
- const { colorScheme: e, setColorScheme: r } = or();
159
- return [e, r];
366
+ return o;
367
+ }, ce = () => {
368
+ const { colorScheme: o, setColorScheme: r } = oe();
369
+ return [o, r];
160
370
  };
161
371
  export {
162
- ar as ThemeProvider,
163
- nr as useColorScheme
372
+ ae as ThemeProvider,
373
+ B as teliaTheme,
374
+ re as useApplyTheme,
375
+ ce as useColorScheme,
376
+ oe as useTheme
164
377
  };
165
378
  //# sourceMappingURL=theme.es.js.map