@purpurds/theme 8.1.1 → 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/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, useContext as C } from "react";
3
- const N = {
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
- }, 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,
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: V,
153
- colorTextInteractiveSelected: rr,
154
- colorTextInteractivePrimaryNegative: X,
155
- colorTextInteractivePrimaryHoverNegative: $,
156
- colorTextInteractivePrimaryActiveNegative: q,
157
- colorTextInteractiveOnPrimaryNegative: j,
158
- colorTextInteractiveOnExpressiveNegative: z,
159
- colorTextInteractiveOnExpressiveHoverNegative: K,
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: 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,
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: 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,
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: 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,
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: 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
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: 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) {
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($o, S).replace(qo, S), r = r.replace(zo, "\0");
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 Jo(o) {
274
- const r = f(o);
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 = Go.exec(t);
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 Ko(o, r) {
285
- const [e, t, a] = Vo(o, r);
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 Ko(o, { delimiter: "-", ...r });
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 Vo(o, r = {}) {
295
- const e = r.split ?? (r.separateNumbers ? Jo : f), t = r.prefixCharacters ?? I, a = r.suffixCharacters ?? I;
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 re = ({
315
+ const oe = ({
316
316
  theme: o = B,
317
317
  cssVariablesSelector: r,
318
318
  currentColorScheme: e
@@ -327,12 +327,13 @@ const re = ({
327
327
  }
328
328
  );
329
329
  }, [o, r, e]);
330
- }, T = m({
330
+ }, f = m({
331
331
  colorScheme: "light",
332
+ currentColorScheme: "light",
332
333
  setColorScheme: () => {
333
334
  },
334
335
  options: {}
335
- }), ae = ({
336
+ }), ce = ({
336
337
  cssVariablesSelector: o,
337
338
  forceColorScheme: r,
338
339
  theme: e,
@@ -359,25 +360,32 @@ const re = ({
359
360
  return n.addEventListener("change", s), () => {
360
361
  n.removeEventListener("change", s);
361
362
  };
362
- }, [u, r]), re({ theme: e, cssVariablesSelector: o, currentColorScheme: p });
363
- const k = (n) => {
364
- r || (l(n), localStorage.setItem("colorScheme", n));
365
- };
366
- return /* @__PURE__ */ g(T.Provider, { value: { colorScheme: u, setColorScheme: k, options: a }, children: /* @__PURE__ */ g("div", { className: u, ...c, children: t }) });
367
- }, oe = () => {
368
- const o = C(T);
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);
369
377
  if (!o)
370
378
  throw new Error("useTheme must be used within a ThemeProvider");
371
379
  return o;
372
- }, ce = () => {
373
- const { colorScheme: o, setColorScheme: r } = oe();
380
+ }, ue = () => {
381
+ const { currentColorScheme: o, setColorScheme: r } = ee();
374
382
  return [o, r];
375
383
  };
376
384
  export {
377
- ae as ThemeProvider,
385
+ ce as ThemeProvider,
378
386
  B as teliaTheme,
379
- re as useApplyTheme,
380
- ce as useColorScheme,
381
- oe as useTheme
387
+ oe as useApplyTheme,
388
+ ue as useColorScheme,
389
+ ee as useTheme
382
390
  };
383
391
  //# sourceMappingURL=theme.es.js.map