@purpurds/theme 8.1.0 → 8.1.2
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/{323ebc20ba62f99389019a66772bec6197c7107d.untar.log → dce4f88919e762397190140780fdc165d2ec0686.untar.log} +2 -2
- package/.rush/temp/operation/ci_build/all.log +4 -4
- package/.rush/temp/operation/ci_build/log-chunks.jsonl +4 -4
- package/.rush/temp/operation/ci_build/state.json +1 -1
- package/.rush/temp/operation/test_unit/state.json +1 -1
- package/dist/LICENSE.txt +1 -1
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/theme.cjs.js +1 -1
- package/dist/theme.cjs.js.map +1 -1
- package/dist/theme.es.js +164 -151
- package/dist/theme.es.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/ThemeProvider.tsx +29 -10
- package/src/types.ts +1 -0
- package/src/useColorScheme.ts +2 -2
package/dist/theme.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as v, createContext as m, useState as d,
|
|
3
|
-
const
|
|
2
|
+
import { useEffect as v, createContext as m, useState as d, useMemo as C, useContext as N } from "react";
|
|
3
|
+
const y = {
|
|
4
4
|
colorBrandDeepPurple: "var(--purpur-color-purple-100)",
|
|
5
5
|
colorBrandCorePurple: "var(--purpur-color-purple-400)",
|
|
6
6
|
colorBrandLightPurple: "var(--purpur-color-purple-900)",
|
|
@@ -127,140 +127,140 @@ const N = {
|
|
|
127
127
|
colorBorderStatusSuccess: "var(--purpur-color-green-400)",
|
|
128
128
|
colorBorderStatusErrorNegative: "var(--purpur-color-red-500)",
|
|
129
129
|
colorBorderStatusSuccessNegative: "var(--purpur-color-green-500)"
|
|
130
|
-
},
|
|
131
|
-
colorBrandDeepPurple:
|
|
132
|
-
colorBrandCorePurple:
|
|
133
|
-
colorBrandLightPurple:
|
|
134
|
-
colorBrandDeepBeige:
|
|
135
|
-
colorBrandBeige:
|
|
136
|
-
colorBrandLightBeige:
|
|
137
|
-
colorBrandOffBlack:
|
|
138
|
-
colorBrandWhite:
|
|
139
|
-
colorTextDefault:
|
|
140
|
-
colorTextMedium:
|
|
141
|
-
colorTextWeak:
|
|
142
|
-
colorTextDefaultNegative:
|
|
143
|
-
colorTextMediumNegative:
|
|
144
|
-
colorTextWeakNegative:
|
|
145
|
-
colorTextInteractivePrimary:
|
|
146
|
-
colorTextInteractivePrimaryHover:
|
|
147
|
-
colorTextInteractivePrimaryActive:
|
|
148
|
-
colorTextInteractiveOnPrimary:
|
|
149
|
-
colorTextInteractiveOnExpressive:
|
|
150
|
-
colorTextInteractiveOnExpressiveHover:
|
|
130
|
+
}, P = "#29003e", b = "#990ae3", E = "#f4e0ff", h = "#4f4741", O = "#ede1d8", A = "#f9f1ec", H = "#1e1e20", M = "#ffffff", w = "rgba(0, 0, 0, 0.84)", W = "rgba(0, 0, 0, 0.62)", D = "rgba(0, 0, 0, 0.44)", L = "rgba(255, 255, 255, 0.95)", R = "rgba(255, 255, 255, 0.66)", F = "rgba(255, 255, 255, 0.37)", _ = "#6d02a3", U = "#4e0174", Q = "#29003e", j = "#ffffff", X = "#4e0174", $ = "#f4e0ff", q = "#e4b6fb", G = "#e4b6fb", z = "#ffffff", J = "#ffffff", K = "#ffffff", V = "#29003e", Y = "#ffffff", Z = "#29003e", rr = "#ffffff", or = "#990ae3", er = "#990ae3", tr = "#980233", ar = "#ff80ab", cr = "#e4175c", ur = "#fb4885", nr = "#02562b", lr = "#3dbf7c", pr = "#018842", ir = "#6a4102", vr = "#a86602", sr = "#f39200", gr = "#014d80", dr = "#0078cb", Br = "rgba(0, 0, 0, 0.71)", Sr = "#4e0174", Ir = "#ffffff", Tr = "#ffffff", fr = "#f4e0ff", kr = "#29003e", xr = "#4f4741", mr = "#ffffff", Cr = "#1f002e", Nr = "#f5f5fa", yr = "#29003e", Pr = "rgba(255, 255, 255, 0.84)", br = "rgba(0, 0, 0, 0.71)", Er = "#e8f6ff", hr = "#4e0174", Or = "#6d02a3", Ar = "#8c07d0", Hr = "#f4e0ff", Mr = "#e4b6fb", wr = "#d58df9", Wr = "#990ae3", Dr = "#6d02a3", Lr = "#4e0174", Rr = "#990ae3", Fr = "#c461f7", _r = "#d58df9", Ur = "rgba(0, 0, 0, 0.1)", Qr = "rgba(255, 255, 255, 0.11)", jr = "#f4e0ff", Xr = "#4e0174", $r = "#e4b6fb", qr = "#6d02a3", Gr = "rgba(0, 0, 0, 0.05)", zr = "rgba(255, 255, 255, 0.16)", Jr = "rgba(0, 0, 0, 0.05)", Kr = "rgba(255, 255, 255, 0.11)", Vr = "#e4175c", Yr = "#c00543", Zr = "#980233", ro = "#caeaff", oo = "#3694d3", eo = "#c5efd9", to = "#1fa15e", ao = "#3dbf7c", co = "#ffdde8", uo = "#fb4885", no = "#ff80ab", lo = "#ffe1b3", po = "#cc7a00", io = "#f39200", vo = "#d6d6dd", so = "#f4e0ff", go = "#6d02a3", Bo = "#1e1e20", So = "#29003e", Io = "#f4e0ff", To = "#ede1d8", fo = "#f9f1ec", ko = "rgba(0, 0, 0, 0.33)", xo = "rgba(255, 255, 255, 0.29)", mo = "rgba(0, 0, 0, 0.54)", Co = "rgba(255, 255, 255, 0.46)", No = "rgba(0, 0, 0, 0.16)", yo = "rgba(255, 255, 255, 0.16)", Po = "#b12df4", bo = "#6d02a3", Eo = "#f4e0ff", ho = "#4e0174", Oo = "#29003e", Ao = "#e4b6fb", Ho = "#e4b6fb", Mo = "#990ae3", wo = "#990ae3", Wo = "rgba(0, 0, 0, 0.44)", Do = "rgba(255, 255, 255, 0.46)", Lo = "#6d02a3", Ro = "#c461f7", Fo = "#e4175c", _o = "#fb4885", Uo = "#cc7a00", Qo = "#0078cb", jo = "#018842", Xo = "#1fa15e", $o = {
|
|
131
|
+
colorBrandDeepPurple: P,
|
|
132
|
+
colorBrandCorePurple: b,
|
|
133
|
+
colorBrandLightPurple: E,
|
|
134
|
+
colorBrandDeepBeige: h,
|
|
135
|
+
colorBrandBeige: O,
|
|
136
|
+
colorBrandLightBeige: A,
|
|
137
|
+
colorBrandOffBlack: H,
|
|
138
|
+
colorBrandWhite: M,
|
|
139
|
+
colorTextDefault: w,
|
|
140
|
+
colorTextMedium: W,
|
|
141
|
+
colorTextWeak: D,
|
|
142
|
+
colorTextDefaultNegative: L,
|
|
143
|
+
colorTextMediumNegative: R,
|
|
144
|
+
colorTextWeakNegative: F,
|
|
145
|
+
colorTextInteractivePrimary: _,
|
|
146
|
+
colorTextInteractivePrimaryHover: U,
|
|
147
|
+
colorTextInteractivePrimaryActive: Q,
|
|
148
|
+
colorTextInteractiveOnPrimary: j,
|
|
149
|
+
colorTextInteractiveOnExpressive: z,
|
|
150
|
+
colorTextInteractiveOnExpressiveHover: K,
|
|
151
151
|
colorTextInteractiveOnExpressiveActive: Y,
|
|
152
|
-
colorTextInteractiveOnDestructive:
|
|
153
|
-
colorTextInteractiveSelected:
|
|
154
|
-
colorTextInteractivePrimaryNegative:
|
|
155
|
-
colorTextInteractivePrimaryHoverNegative:
|
|
156
|
-
colorTextInteractivePrimaryActiveNegative:
|
|
157
|
-
colorTextInteractiveOnPrimaryNegative:
|
|
158
|
-
colorTextInteractiveOnExpressiveNegative:
|
|
159
|
-
colorTextInteractiveOnExpressiveHoverNegative:
|
|
152
|
+
colorTextInteractiveOnDestructive: rr,
|
|
153
|
+
colorTextInteractiveSelected: or,
|
|
154
|
+
colorTextInteractivePrimaryNegative: $,
|
|
155
|
+
colorTextInteractivePrimaryHoverNegative: q,
|
|
156
|
+
colorTextInteractivePrimaryActiveNegative: G,
|
|
157
|
+
colorTextInteractiveOnPrimaryNegative: X,
|
|
158
|
+
colorTextInteractiveOnExpressiveNegative: J,
|
|
159
|
+
colorTextInteractiveOnExpressiveHoverNegative: V,
|
|
160
160
|
colorTextInteractiveOnExpressiveActiveNegative: Z,
|
|
161
|
-
colorTextStatusInfoMedium:
|
|
162
|
-
colorTextStatusInfoStrong:
|
|
163
|
-
colorTextStatusSuccessMedium:
|
|
164
|
-
colorTextStatusSuccessStrong:
|
|
165
|
-
colorTextStatusWarningMedium:
|
|
166
|
-
colorTextStatusWarningStrong:
|
|
167
|
-
colorTextStatusErrorMedium:
|
|
168
|
-
colorTextStatusErrorStrong:
|
|
169
|
-
colorTextStatusNeutral:
|
|
170
|
-
colorTextStatusSpecial:
|
|
171
|
-
colorTextStatusAttention:
|
|
172
|
-
colorTextStatusDiscount:
|
|
173
|
-
colorTextStatusBlackFriday:
|
|
174
|
-
colorTextStatusSuccessStrongNegative:
|
|
175
|
-
colorTextStatusErrorMediumNegative:
|
|
176
|
-
colorTextStatusErrorStrongNegative:
|
|
177
|
-
colorTextStatusWarningMediumNegative:
|
|
161
|
+
colorTextStatusInfoMedium: dr,
|
|
162
|
+
colorTextStatusInfoStrong: gr,
|
|
163
|
+
colorTextStatusSuccessMedium: pr,
|
|
164
|
+
colorTextStatusSuccessStrong: nr,
|
|
165
|
+
colorTextStatusWarningMedium: vr,
|
|
166
|
+
colorTextStatusWarningStrong: ir,
|
|
167
|
+
colorTextStatusErrorMedium: cr,
|
|
168
|
+
colorTextStatusErrorStrong: tr,
|
|
169
|
+
colorTextStatusNeutral: Br,
|
|
170
|
+
colorTextStatusSpecial: Sr,
|
|
171
|
+
colorTextStatusAttention: Ir,
|
|
172
|
+
colorTextStatusDiscount: er,
|
|
173
|
+
colorTextStatusBlackFriday: Tr,
|
|
174
|
+
colorTextStatusSuccessStrongNegative: lr,
|
|
175
|
+
colorTextStatusErrorMediumNegative: ur,
|
|
176
|
+
colorTextStatusErrorStrongNegative: ar,
|
|
177
|
+
colorTextStatusWarningMediumNegative: sr,
|
|
178
178
|
colorTextToneOnTonePrimary: fr,
|
|
179
|
-
colorTextToneOnToneSecondary:
|
|
180
|
-
colorTextToneOnToneTertiary:
|
|
181
|
-
colorBackgroundPrimary:
|
|
182
|
-
colorBackgroundSecondary:
|
|
183
|
-
colorBackgroundOnImage:
|
|
184
|
-
colorBackgroundPrimaryNegative:
|
|
185
|
-
colorBackgroundSecondaryNegative:
|
|
186
|
-
colorBackgroundOnImageNegative:
|
|
187
|
-
colorBackgroundInteractivePrimary:
|
|
188
|
-
colorBackgroundInteractivePrimaryHover:
|
|
189
|
-
colorBackgroundInteractivePrimaryActive:
|
|
190
|
-
colorBackgroundInteractiveExpressive:
|
|
191
|
-
colorBackgroundInteractiveExpressiveHover:
|
|
192
|
-
colorBackgroundInteractiveExpressiveActive:
|
|
193
|
-
colorBackgroundInteractiveTransparentHover:
|
|
194
|
-
colorBackgroundInteractiveTransparentActive:
|
|
195
|
-
colorBackgroundInteractiveDisabled:
|
|
196
|
-
colorBackgroundInteractiveReadOnly:
|
|
197
|
-
colorBackgroundInteractiveInactive:
|
|
198
|
-
colorBackgroundInteractiveDestructive:
|
|
179
|
+
colorTextToneOnToneSecondary: kr,
|
|
180
|
+
colorTextToneOnToneTertiary: xr,
|
|
181
|
+
colorBackgroundPrimary: mr,
|
|
182
|
+
colorBackgroundSecondary: Nr,
|
|
183
|
+
colorBackgroundOnImage: Pr,
|
|
184
|
+
colorBackgroundPrimaryNegative: Cr,
|
|
185
|
+
colorBackgroundSecondaryNegative: yr,
|
|
186
|
+
colorBackgroundOnImageNegative: br,
|
|
187
|
+
colorBackgroundInteractivePrimary: hr,
|
|
188
|
+
colorBackgroundInteractivePrimaryHover: Or,
|
|
189
|
+
colorBackgroundInteractivePrimaryActive: Ar,
|
|
190
|
+
colorBackgroundInteractiveExpressive: Wr,
|
|
191
|
+
colorBackgroundInteractiveExpressiveHover: Dr,
|
|
192
|
+
colorBackgroundInteractiveExpressiveActive: Lr,
|
|
193
|
+
colorBackgroundInteractiveTransparentHover: jr,
|
|
194
|
+
colorBackgroundInteractiveTransparentActive: $r,
|
|
195
|
+
colorBackgroundInteractiveDisabled: Ur,
|
|
196
|
+
colorBackgroundInteractiveReadOnly: Jr,
|
|
197
|
+
colorBackgroundInteractiveInactive: Gr,
|
|
198
|
+
colorBackgroundInteractiveDestructive: Vr,
|
|
199
199
|
colorBackgroundInteractiveDestructiveHover: Yr,
|
|
200
200
|
colorBackgroundInteractiveDestructiveActive: Zr,
|
|
201
|
-
colorBackgroundInteractiveAutoFill:
|
|
202
|
-
colorBackgroundInteractivePrimaryNegative:
|
|
203
|
-
colorBackgroundInteractivePrimaryHoverNegative:
|
|
204
|
-
colorBackgroundInteractivePrimaryActiveNegative:
|
|
205
|
-
colorBackgroundInteractiveExpressiveNegative:
|
|
206
|
-
colorBackgroundInteractiveExpressiveHoverNegative:
|
|
207
|
-
colorBackgroundInteractiveExpressiveActiveNegative:
|
|
208
|
-
colorBackgroundInteractiveTransparentHoverNegative:
|
|
209
|
-
colorBackgroundInteractiveTransparentActiveNegative:
|
|
210
|
-
colorBackgroundInteractiveDisabledNegative:
|
|
211
|
-
colorBackgroundInteractiveInactiveNegative:
|
|
212
|
-
colorBackgroundInteractiveReadOnlyNegative:
|
|
213
|
-
colorBackgroundStatusInfoMedium:
|
|
214
|
-
colorBackgroundStatusInfoStrong:
|
|
215
|
-
colorBackgroundStatusSuccessMedium:
|
|
216
|
-
colorBackgroundStatusSuccessStrong:
|
|
217
|
-
colorBackgroundStatusWarningMedium:
|
|
218
|
-
colorBackgroundStatusWarningStrong:
|
|
219
|
-
colorBackgroundStatusErrorMedium:
|
|
220
|
-
colorBackgroundStatusErrorStrong:
|
|
221
|
-
colorBackgroundStatusNeutral:
|
|
222
|
-
colorBackgroundStatusSpecial:
|
|
223
|
-
colorBackgroundStatusAttention:
|
|
224
|
-
colorBackgroundStatusBlackFriday:
|
|
225
|
-
colorBackgroundStatusSuccessStrongNegative:
|
|
226
|
-
colorBackgroundStatusWarningStrongNegative:
|
|
227
|
-
colorBackgroundStatusErrorStrongNegative:
|
|
228
|
-
colorBackgroundToneOnTonePrimary:
|
|
229
|
-
colorBackgroundToneOnToneSecondary:
|
|
230
|
-
colorBackgroundToneOnToneTertiary:
|
|
201
|
+
colorBackgroundInteractiveAutoFill: Er,
|
|
202
|
+
colorBackgroundInteractivePrimaryNegative: Hr,
|
|
203
|
+
colorBackgroundInteractivePrimaryHoverNegative: Mr,
|
|
204
|
+
colorBackgroundInteractivePrimaryActiveNegative: wr,
|
|
205
|
+
colorBackgroundInteractiveExpressiveNegative: Rr,
|
|
206
|
+
colorBackgroundInteractiveExpressiveHoverNegative: Fr,
|
|
207
|
+
colorBackgroundInteractiveExpressiveActiveNegative: _r,
|
|
208
|
+
colorBackgroundInteractiveTransparentHoverNegative: Xr,
|
|
209
|
+
colorBackgroundInteractiveTransparentActiveNegative: qr,
|
|
210
|
+
colorBackgroundInteractiveDisabledNegative: Qr,
|
|
211
|
+
colorBackgroundInteractiveInactiveNegative: zr,
|
|
212
|
+
colorBackgroundInteractiveReadOnlyNegative: Kr,
|
|
213
|
+
colorBackgroundStatusInfoMedium: ro,
|
|
214
|
+
colorBackgroundStatusInfoStrong: oo,
|
|
215
|
+
colorBackgroundStatusSuccessMedium: eo,
|
|
216
|
+
colorBackgroundStatusSuccessStrong: to,
|
|
217
|
+
colorBackgroundStatusWarningMedium: lo,
|
|
218
|
+
colorBackgroundStatusWarningStrong: po,
|
|
219
|
+
colorBackgroundStatusErrorMedium: co,
|
|
220
|
+
colorBackgroundStatusErrorStrong: uo,
|
|
221
|
+
colorBackgroundStatusNeutral: vo,
|
|
222
|
+
colorBackgroundStatusSpecial: so,
|
|
223
|
+
colorBackgroundStatusAttention: go,
|
|
224
|
+
colorBackgroundStatusBlackFriday: Bo,
|
|
225
|
+
colorBackgroundStatusSuccessStrongNegative: ao,
|
|
226
|
+
colorBackgroundStatusWarningStrongNegative: io,
|
|
227
|
+
colorBackgroundStatusErrorStrongNegative: no,
|
|
228
|
+
colorBackgroundToneOnTonePrimary: So,
|
|
229
|
+
colorBackgroundToneOnToneSecondary: Io,
|
|
230
|
+
colorBackgroundToneOnToneTertiary: To,
|
|
231
231
|
colorBackgroundToneOnToneQuaternary: fo,
|
|
232
|
-
colorBorderWeak:
|
|
233
|
-
colorBorderMedium:
|
|
234
|
-
colorBorderStrong:
|
|
235
|
-
colorBorderWeakNegative:
|
|
236
|
-
colorBorderMediumNegative:
|
|
237
|
-
colorBorderStrongNegative:
|
|
238
|
-
colorBorderInteractivePrimary:
|
|
239
|
-
colorBorderInteractivePrimaryHover:
|
|
240
|
-
colorBorderInteractivePrimaryActive:
|
|
241
|
-
colorBorderInteractiveFocus:
|
|
242
|
-
colorBorderInteractiveExpressive:
|
|
243
|
-
colorBorderInteractiveSubtle:
|
|
244
|
-
colorBorderInteractiveSubtleHover:
|
|
245
|
-
colorBorderInteractiveSelected:
|
|
246
|
-
colorBorderInteractivePrimaryNegative:
|
|
247
|
-
colorBorderInteractivePrimaryHoverNegative:
|
|
248
|
-
colorBorderInteractivePrimaryActiveNegative:
|
|
249
|
-
colorBorderInteractiveSubtleNegative:
|
|
250
|
-
colorBorderInteractiveSubtleHoverNegative:
|
|
251
|
-
colorBorderStatusError:
|
|
252
|
-
colorBorderStatusWarning:
|
|
253
|
-
colorBorderStatusInfo:
|
|
254
|
-
colorBorderStatusSuccess:
|
|
255
|
-
colorBorderStatusErrorNegative:
|
|
256
|
-
colorBorderStatusSuccessNegative:
|
|
232
|
+
colorBorderWeak: No,
|
|
233
|
+
colorBorderMedium: ko,
|
|
234
|
+
colorBorderStrong: mo,
|
|
235
|
+
colorBorderWeakNegative: yo,
|
|
236
|
+
colorBorderMediumNegative: xo,
|
|
237
|
+
colorBorderStrongNegative: Co,
|
|
238
|
+
colorBorderInteractivePrimary: bo,
|
|
239
|
+
colorBorderInteractivePrimaryHover: ho,
|
|
240
|
+
colorBorderInteractivePrimaryActive: Oo,
|
|
241
|
+
colorBorderInteractiveFocus: Po,
|
|
242
|
+
colorBorderInteractiveExpressive: Mo,
|
|
243
|
+
colorBorderInteractiveSubtle: Wo,
|
|
244
|
+
colorBorderInteractiveSubtleHover: Lo,
|
|
245
|
+
colorBorderInteractiveSelected: wo,
|
|
246
|
+
colorBorderInteractivePrimaryNegative: Eo,
|
|
247
|
+
colorBorderInteractivePrimaryHoverNegative: Ao,
|
|
248
|
+
colorBorderInteractivePrimaryActiveNegative: Ho,
|
|
249
|
+
colorBorderInteractiveSubtleNegative: Do,
|
|
250
|
+
colorBorderInteractiveSubtleHoverNegative: Ro,
|
|
251
|
+
colorBorderStatusError: Fo,
|
|
252
|
+
colorBorderStatusWarning: Uo,
|
|
253
|
+
colorBorderStatusInfo: Qo,
|
|
254
|
+
colorBorderStatusSuccess: jo,
|
|
255
|
+
colorBorderStatusErrorNegative: _o,
|
|
256
|
+
colorBorderStatusSuccessNegative: Xo
|
|
257
257
|
}, B = {
|
|
258
|
-
light:
|
|
259
|
-
dark:
|
|
260
|
-
},
|
|
261
|
-
function
|
|
258
|
+
light: $o,
|
|
259
|
+
dark: y
|
|
260
|
+
}, qo = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Go = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), zo = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), Jo = /[^\p{L}\d]+/giu, S = "$1\0$2", I = "";
|
|
261
|
+
function T(o) {
|
|
262
262
|
let r = o.trim();
|
|
263
|
-
r = r.replace(
|
|
263
|
+
r = r.replace(qo, S).replace(Go, S), r = r.replace(Jo, "\0");
|
|
264
264
|
let e = 0, t = r.length;
|
|
265
265
|
for (; r.charAt(e) === "\0"; )
|
|
266
266
|
e++;
|
|
@@ -270,10 +270,10 @@ function f(o) {
|
|
|
270
270
|
t--;
|
|
271
271
|
return r.slice(e, t).split(/\0/g);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
const r =
|
|
273
|
+
function Ko(o) {
|
|
274
|
+
const r = T(o);
|
|
275
275
|
for (let e = 0; e < r.length; e++) {
|
|
276
|
-
const t = r[e], a =
|
|
276
|
+
const t = r[e], a = zo.exec(t);
|
|
277
277
|
if (a) {
|
|
278
278
|
const c = a.index + (a[1] ?? a[2]).length;
|
|
279
279
|
r.splice(e, 1, t.slice(0, c), t.slice(c));
|
|
@@ -281,18 +281,18 @@ function Jo(o) {
|
|
|
281
281
|
}
|
|
282
282
|
return r;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
const [e, t, a] =
|
|
284
|
+
function Vo(o, r) {
|
|
285
|
+
const [e, t, a] = re(o, r);
|
|
286
286
|
return e + t.map(Zo(r == null ? void 0 : r.locale)).join((r == null ? void 0 : r.delimiter) ?? " ") + a;
|
|
287
287
|
}
|
|
288
288
|
function Yo(o, r) {
|
|
289
|
-
return
|
|
289
|
+
return Vo(o, { delimiter: "-", ...r });
|
|
290
290
|
}
|
|
291
291
|
function Zo(o) {
|
|
292
292
|
return o === !1 ? (r) => r.toLowerCase() : (r) => r.toLocaleLowerCase(o);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
const e = r.split ?? (r.separateNumbers ?
|
|
294
|
+
function re(o, r = {}) {
|
|
295
|
+
const e = r.split ?? (r.separateNumbers ? Ko : T), t = r.prefixCharacters ?? I, a = r.suffixCharacters ?? I;
|
|
296
296
|
let c = 0, u = o.length;
|
|
297
297
|
for (; c < o.length; ) {
|
|
298
298
|
const l = o.charAt(c);
|
|
@@ -312,7 +312,7 @@ function Vo(o, r = {}) {
|
|
|
312
312
|
o.slice(u)
|
|
313
313
|
];
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const oe = ({
|
|
316
316
|
theme: o = B,
|
|
317
317
|
cssVariablesSelector: r,
|
|
318
318
|
currentColorScheme: e
|
|
@@ -327,7 +327,13 @@ const re = ({
|
|
|
327
327
|
}
|
|
328
328
|
);
|
|
329
329
|
}, [o, r, e]);
|
|
330
|
-
},
|
|
330
|
+
}, f = m({
|
|
331
|
+
colorScheme: "light",
|
|
332
|
+
currentColorScheme: "light",
|
|
333
|
+
setColorScheme: () => {
|
|
334
|
+
},
|
|
335
|
+
options: {}
|
|
336
|
+
}), ce = ({
|
|
331
337
|
cssVariablesSelector: o,
|
|
332
338
|
forceColorScheme: r,
|
|
333
339
|
theme: e,
|
|
@@ -354,25 +360,32 @@ const re = ({
|
|
|
354
360
|
return n.addEventListener("change", s), () => {
|
|
355
361
|
n.removeEventListener("change", s);
|
|
356
362
|
};
|
|
357
|
-
}, [u, r]),
|
|
358
|
-
const k = (
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
}, [u, r]), oe({ theme: e, cssVariablesSelector: o, currentColorScheme: p });
|
|
364
|
+
const k = C(
|
|
365
|
+
() => ({
|
|
366
|
+
colorScheme: u,
|
|
367
|
+
currentColorScheme: p,
|
|
368
|
+
setColorScheme: (n) => {
|
|
369
|
+
r || (l(n), localStorage.setItem("colorScheme", n));
|
|
370
|
+
}
|
|
371
|
+
}),
|
|
372
|
+
[u, p, r]
|
|
373
|
+
);
|
|
374
|
+
return /* @__PURE__ */ g(f.Provider, { value: { ...k, options: a }, children: /* @__PURE__ */ g("div", { className: p, ...c, children: t }) });
|
|
375
|
+
}, ee = () => {
|
|
376
|
+
const o = N(f);
|
|
364
377
|
if (!o)
|
|
365
378
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
366
379
|
return o;
|
|
367
|
-
},
|
|
368
|
-
const {
|
|
380
|
+
}, ue = () => {
|
|
381
|
+
const { currentColorScheme: o, setColorScheme: r } = ee();
|
|
369
382
|
return [o, r];
|
|
370
383
|
};
|
|
371
384
|
export {
|
|
372
|
-
|
|
385
|
+
ce as ThemeProvider,
|
|
373
386
|
B as teliaTheme,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
387
|
+
oe as useApplyTheme,
|
|
388
|
+
ue as useColorScheme,
|
|
389
|
+
ee as useTheme
|
|
377
390
|
};
|
|
378
391
|
//# sourceMappingURL=theme.es.js.map
|