@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.
- package/.rush/temp/ci_build/@purpurds/theme/{10faf61143baee1a2e22f79fd791f0db853e0f61.untar.log → 0646f8ac54319d2ce21f09e9f3209badb3907451.untar.log} +2 -2
- package/.rush/temp/operation/ci_build/all.log +12 -6
- package/.rush/temp/operation/ci_build/log-chunks.jsonl +12 -6
- package/.rush/temp/operation/ci_build/state.json +1 -1
- package/.rush/temp/operation/test_unit/state.json +1 -1
- package/.rush/temp/shrinkwrap-deps.json +1 -1
- package/dist/LICENSE.txt +8 -8
- package/dist/ThemeProvider.d.ts +7 -5
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/telia-dark.d.ts +129 -0
- package/dist/telia-dark.d.ts.map +1 -0
- package/dist/telia-light.d.ts +129 -0
- package/dist/telia-light.d.ts.map +1 -0
- package/dist/telia-theme.d.ts +223 -20
- package/dist/telia-theme.d.ts.map +1 -1
- package/dist/theme-props.d.ts +32 -17
- package/dist/theme-props.d.ts.map +1 -1
- package/dist/theme.cjs.js +1 -1
- package/dist/theme.cjs.js.map +1 -1
- package/dist/theme.d.ts +4 -2
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.es.js +346 -133
- package/dist/theme.es.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/useApplyTheme.d.ts +10 -0
- package/dist/useApplyTheme.d.ts.map +1 -0
- package/dist/useColorScheme.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/ThemeProvider.tsx +18 -27
- package/src/telia-dark.ts +141 -0
- package/src/telia-light.ts +278 -0
- package/src/telia-theme.ts +6 -88
- package/src/theme-props.ts +32 -17
- package/src/theme.ts +4 -2
- package/src/types.ts +1 -0
- package/src/useApplyTheme.ts +34 -0
- package/types.d.ts +0 -365
- /package/src/{useColorScheme.tsx → useColorScheme.ts} +0 -0
package/dist/theme.es.js
CHANGED
|
@@ -1,165 +1,378 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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(
|
|
13
|
-
|
|
14
|
-
return r.slice(
|
|
269
|
+
for (; r.charAt(t - 1) === "\0"; )
|
|
270
|
+
t--;
|
|
271
|
+
return r.slice(e, t).split(/\0/g);
|
|
15
272
|
}
|
|
16
|
-
function
|
|
17
|
-
const r =
|
|
18
|
-
for (let
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
r.splice(
|
|
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
|
|
28
|
-
const [
|
|
29
|
-
return
|
|
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
|
|
32
|
-
return
|
|
288
|
+
function Yo(o, r) {
|
|
289
|
+
return Ko(o, { delimiter: "-", ...r });
|
|
33
290
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
291
|
+
function Zo(o) {
|
|
292
|
+
return o === !1 ? (r) => r.toLowerCase() : (r) => r.toLocaleLowerCase(o);
|
|
36
293
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
for (;
|
|
41
|
-
const l =
|
|
42
|
-
if (!
|
|
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
|
-
|
|
301
|
+
c++;
|
|
45
302
|
}
|
|
46
|
-
for (; u >
|
|
47
|
-
const l = u - 1, p =
|
|
48
|
-
if (!
|
|
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
|
-
|
|
54
|
-
o
|
|
55
|
-
|
|
310
|
+
o.slice(0, c),
|
|
311
|
+
e(o.slice(c, u)),
|
|
312
|
+
o.slice(u)
|
|
56
313
|
];
|
|
57
314
|
}
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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:
|
|
116
|
-
children:
|
|
117
|
-
|
|
333
|
+
theme: e,
|
|
334
|
+
children: t,
|
|
335
|
+
options: a = {},
|
|
336
|
+
...c
|
|
118
337
|
}) => {
|
|
119
|
-
const [
|
|
338
|
+
const [u, l] = d(r ?? "auto"), [p, i] = d(
|
|
120
339
|
r ?? "light"
|
|
121
340
|
);
|
|
122
|
-
|
|
341
|
+
v(() => {
|
|
123
342
|
if (r)
|
|
124
|
-
|
|
343
|
+
l(r);
|
|
125
344
|
else {
|
|
126
|
-
const
|
|
127
|
-
|
|
345
|
+
const n = localStorage.getItem("colorScheme");
|
|
346
|
+
n && l(n);
|
|
128
347
|
}
|
|
129
|
-
}, [r]),
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
!r &&
|
|
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
|
|
136
|
-
|
|
354
|
+
return n.addEventListener("change", s), () => {
|
|
355
|
+
n.removeEventListener("change", s);
|
|
137
356
|
};
|
|
138
|
-
}, [
|
|
139
|
-
|
|
140
|
-
|
|
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__ */
|
|
152
|
-
},
|
|
153
|
-
const
|
|
154
|
-
if (!
|
|
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
|
|
157
|
-
},
|
|
158
|
-
const { colorScheme:
|
|
159
|
-
return [
|
|
366
|
+
return o;
|
|
367
|
+
}, ce = () => {
|
|
368
|
+
const { colorScheme: o, setColorScheme: r } = oe();
|
|
369
|
+
return [o, r];
|
|
160
370
|
};
|
|
161
371
|
export {
|
|
162
|
-
|
|
163
|
-
|
|
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
|