@descope/web-components-ui 1.3.0 → 1.5.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/cjs/index.cjs.js +16 -20
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-alert-index-js.js +1 -1
- package/package.json +2 -2
- package/src/components/descope-alert/AlertClass.js +12 -0
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
|
438
|
-
light: color.light || generateLightColor$1(mainColor
|
439
|
-
highlight: color.highlight || generateHighlightColor$1(mainColor
|
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(
|
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(
|
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(
|
615
|
+
set({}, path, `var(${getVarName(path)})`)
|
631
616
|
);
|
632
617
|
|
633
618
|
const getThemeVars = (theme, prefix) =>
|
634
|
-
transformTheme(theme, [], (path) => set({}, path, getVarName(
|
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(
|
@@ -17638,6 +17623,9 @@ class RawAlert extends createBaseClass$1({ componentName: componentName$2, baseS
|
|
17638
17623
|
display: flex;
|
17639
17624
|
width: 100%;
|
17640
17625
|
}
|
17626
|
+
:host([empty="true"]) {
|
17627
|
+
display: none;
|
17628
|
+
}
|
17641
17629
|
.icon {
|
17642
17630
|
flex-shrink: 0;
|
17643
17631
|
}
|
@@ -17667,11 +17655,19 @@ class RawAlert extends createBaseClass$1({ componentName: componentName$2, baseS
|
|
17667
17655
|
|
17668
17656
|
this.slotEle.addEventListener('slotchange', this.handleSlotChange.bind(this));
|
17669
17657
|
|
17658
|
+
syncAttrs(this.textComp, this, { includeAttrs: ['empty'] });
|
17659
|
+
|
17660
|
+
observeChildren(this, this.handleChildrenChange.bind(this));
|
17661
|
+
|
17670
17662
|
forwardAttrs$1(this, this.textComp, {
|
17671
17663
|
includeAttrs: ['variant', 'full-width', 'link-target-blank'],
|
17672
17664
|
});
|
17673
17665
|
}
|
17674
17666
|
|
17667
|
+
handleChildrenChange() {
|
17668
|
+
this.textComp.textContent = this.textContent;
|
17669
|
+
}
|
17670
|
+
|
17675
17671
|
handleSlotChange() {
|
17676
17672
|
const assignedNodes = this.slotEle.assignedNodes({ flatten: true });
|
17677
17673
|
if (!assignedNodes.length) return;
|