@descope/web-components-ui 1.2.0 → 1.4.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/dist/index.esm.js CHANGED
@@ -394,11 +394,6 @@ const isNearBlack$1 = (color) => color.luminosity() < 0.01;
394
394
  const isNearWhite$1 = (color) => color.luminosity() > 0.99;
395
395
 
396
396
  const generateDarkColor$1 = (color, theme) => {
397
- if (theme === 'dark') {
398
- return isNearWhite$1(color)
399
- ? darken$1(color, colorGaps$1.edgeColor.darkLight)
400
- : lighten$1(color, colorGaps$1.darkLight);
401
- }
402
397
 
403
398
  return isNearBlack$1(color)
404
399
  ? lighten$1(color, colorGaps$1.edgeColor.darkLight)
@@ -406,11 +401,6 @@ const generateDarkColor$1 = (color, theme) => {
406
401
  };
407
402
 
408
403
  const generateLightColor$1 = (color, theme) => {
409
- if (theme === 'dark') {
410
- return isNearBlack$1(color)
411
- ? lighten$1(color, colorGaps$1.edgeColor.darkLight)
412
- : darken$1(color, colorGaps$1.darkLight);
413
- }
414
404
 
415
405
  return isNearWhite$1(color)
416
406
  ? darken$1(color, colorGaps$1.edgeColor.darkLight)
@@ -418,11 +408,6 @@ const generateLightColor$1 = (color, theme) => {
418
408
  };
419
409
 
420
410
  const generateHighlightColor$1 = (color, theme) => {
421
- if (theme === 'dark') {
422
- return isNearBlack$1(color)
423
- ? lighten$1(color, colorGaps$1.edgeColor.highlight)
424
- : darken$1(color, colorGaps$1.highlight);
425
- }
426
411
 
427
412
  return isNearWhite$1(color)
428
413
  ? darken$1(color, colorGaps$1.edgeColor.highlight)
@@ -434,9 +419,9 @@ const genColor$1 = (color, theme) => {
434
419
 
435
420
  const res = {
436
421
  main: mainColor.hex(),
437
- dark: color.dark || generateDarkColor$1(mainColor, theme),
438
- light: color.light || generateLightColor$1(mainColor, theme),
439
- highlight: color.highlight || generateHighlightColor$1(mainColor, theme),
422
+ dark: color.dark || generateDarkColor$1(mainColor),
423
+ light: color.light || generateLightColor$1(mainColor),
424
+ highlight: color.highlight || generateHighlightColor$1(mainColor),
440
425
  contrast: color.contrast || contrast$1(mainColor),
441
426
  };
442
427
 
@@ -550,12 +535,12 @@ const transformTheme$1 = (theme, path, getTransformation) => {
550
535
 
551
536
  const getThemeRefs$1 = (theme, prefix) =>
552
537
  transformTheme$1(theme, [], (path) =>
553
- set$1({}, path, `var(${getVarName$1(prefix ? [prefix, ...path] : path)})`),
538
+ set$1({}, path, `var(${getVarName$1(path)})`),
554
539
  );
555
540
 
556
541
  const getThemeVars$1 = (theme, prefix) =>
557
542
  transformTheme$1(theme, [], (path) =>
558
- set$1({}, path, getVarName$1(prefix ? [prefix, ...path] : path)),
543
+ set$1({}, path, getVarName$1(path)),
559
544
  );
560
545
 
561
546
  // allows to generate css variables with nested fallbacks
@@ -627,11 +612,11 @@ const themeToCSSVarsObj = (theme) =>
627
612
 
628
613
  const getThemeRefs = (theme, prefix) =>
629
614
  transformTheme(theme, [], (path) =>
630
- set({}, path, `var(${getVarName(prefix ? [prefix, ...path] : path)})`)
615
+ set({}, path, `var(${getVarName(path)})`)
631
616
  );
632
617
 
633
618
  const getThemeVars = (theme, prefix) =>
634
- transformTheme(theme, [], (path) => set({}, path, getVarName(prefix ? [prefix, ...path] : path)));
619
+ transformTheme(theme, [], (path) => set({}, path, getVarName(path)));
635
620
 
636
621
  const globalsThemeToStyle = (theme, themeName = '') => {
637
622
  const style = Object.entries(themeToCSSVarsObj(theme)).reduce(