@descope/web-components-ui 1.0.296 → 1.0.297
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +583 -357
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +566 -339
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1612.js +1 -1
- package/dist/umd/1621.js +2 -2
- package/dist/umd/3951.js +1 -1
- package/dist/umd/4024.js +1 -1
- package/dist/umd/4052.js +1 -1
- package/dist/umd/4569.js +1 -0
- package/dist/umd/4746.js +1 -1
- package/dist/umd/5806.js +1 -1
- package/dist/umd/6770.js +1 -1
- package/dist/umd/7056.js +1 -1
- package/dist/umd/7531.js +1 -1
- package/dist/umd/7911.js +1 -1
- package/dist/umd/9092.js +2 -2
- package/dist/umd/9314.js +1 -1
- package/dist/umd/9423.js +2 -2
- package/dist/umd/9562.js +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-link-index-js.js +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
- package/dist/umd/text-components-descope-markdown-content-index-js.js +1 -0
- package/dist/umd/text-components-descope-text-index-js.js +1 -0
- package/package.json +4 -2
- package/src/components/descope-divider/DividerClass.js +1 -1
- package/src/components/descope-divider/index.js +1 -1
- package/src/components/descope-link/LinkClass.js +1 -1
- package/src/components/descope-link/index.js +1 -1
- package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
- package/src/components/descope-user-attribute/index.js +1 -1
- package/src/components/descope-user-auth-method/UserAuthMethodClass.js +1 -1
- package/src/components/descope-user-auth-method/index.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
- package/src/components/text-components/createBaseTextClass.js +26 -0
- package/src/components/text-components/descope-markdown-content/MarkdownContentClass.js +98 -0
- package/src/components/text-components/descope-markdown-content/helpers.js +41 -0
- package/src/components/text-components/descope-markdown-content/index.js +5 -0
- package/src/components/text-components/descope-text/TextClass.js +34 -0
- package/src/components/text-components/hideWhenEmptyMixin.js +17 -0
- package/src/index.cjs.js +2 -1
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -1
- package/src/theme/components/index.js +2 -0
- package/src/theme/components/markdownContent.js +84 -0
- package/src/theme/components/text.js +1 -1
- package/dist/umd/descope-text-index-js.js +0 -1
- package/src/components/descope-text/TextClass.js +0 -67
- /package/src/components/{descope-text → text-components/descope-text}/index.js +0 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
import globals from '../globals';
|
2
|
+
import { getThemeRefs } from '../../helpers/themeHelpers';
|
3
|
+
import { MarkdownContentClass } from '../../components/text-components/descope-markdown-content/MarkdownContentClass';
|
4
|
+
|
5
|
+
const globalRefs = getThemeRefs(globals);
|
6
|
+
const vars = MarkdownContentClass.cssVarList;
|
7
|
+
|
8
|
+
const markdownContent = {
|
9
|
+
[vars.hostDirection]: globalRefs.direction,
|
10
|
+
|
11
|
+
[vars.fontSize]: globalRefs.typography.body1.size,
|
12
|
+
[vars.fontWeight]: globalRefs.typography.body1.weight,
|
13
|
+
[vars.fontFamily]: globalRefs.typography.body1.font,
|
14
|
+
|
15
|
+
[vars.textLineHeight]: '1.35em',
|
16
|
+
[vars.textAlign]: 'left',
|
17
|
+
[vars.textColor]: globalRefs.colors.surface.dark,
|
18
|
+
|
19
|
+
mode: {
|
20
|
+
primary: {
|
21
|
+
[vars.textColor]: globalRefs.colors.surface.contrast,
|
22
|
+
},
|
23
|
+
secondary: {
|
24
|
+
[vars.textColor]: globalRefs.colors.surface.dark,
|
25
|
+
},
|
26
|
+
error: {
|
27
|
+
[vars.textColor]: globalRefs.colors.error.main,
|
28
|
+
},
|
29
|
+
success: {
|
30
|
+
[vars.textColor]: globalRefs.colors.success.main,
|
31
|
+
},
|
32
|
+
},
|
33
|
+
|
34
|
+
variant: {
|
35
|
+
h1: {
|
36
|
+
[vars.fontSize]: globalRefs.typography.h1.size,
|
37
|
+
[vars.fontWeight]: globalRefs.typography.h1.weight,
|
38
|
+
[vars.fontFamily]: globalRefs.typography.h1.font,
|
39
|
+
},
|
40
|
+
h2: {
|
41
|
+
[vars.fontSize]: globalRefs.typography.h2.size,
|
42
|
+
[vars.fontWeight]: globalRefs.typography.h2.weight,
|
43
|
+
[vars.fontFamily]: globalRefs.typography.h2.font,
|
44
|
+
},
|
45
|
+
h3: {
|
46
|
+
[vars.fontSize]: globalRefs.typography.h3.size,
|
47
|
+
[vars.fontWeight]: globalRefs.typography.h3.weight,
|
48
|
+
[vars.fontFamily]: globalRefs.typography.h3.font,
|
49
|
+
},
|
50
|
+
subtitle1: {
|
51
|
+
[vars.fontSize]: globalRefs.typography.subtitle1.size,
|
52
|
+
[vars.fontWeight]: globalRefs.typography.subtitle1.weight,
|
53
|
+
[vars.fontFamily]: globalRefs.typography.subtitle1.font,
|
54
|
+
},
|
55
|
+
subtitle2: {
|
56
|
+
[vars.fontSize]: globalRefs.typography.subtitle2.size,
|
57
|
+
[vars.fontWeight]: globalRefs.typography.subtitle2.weight,
|
58
|
+
[vars.fontFamily]: globalRefs.typography.subtitle2.font,
|
59
|
+
},
|
60
|
+
body1: {
|
61
|
+
[vars.fontSize]: globalRefs.typography.body1.size,
|
62
|
+
[vars.fontWeight]: globalRefs.typography.body1.weight,
|
63
|
+
[vars.fontFamily]: globalRefs.typography.body1.font,
|
64
|
+
},
|
65
|
+
body2: {
|
66
|
+
[vars.fontSize]: globalRefs.typography.body2.size,
|
67
|
+
[vars.fontWeight]: globalRefs.typography.body2.weight,
|
68
|
+
[vars.fontFamily]: globalRefs.typography.body2.font,
|
69
|
+
},
|
70
|
+
},
|
71
|
+
|
72
|
+
textAlign: {
|
73
|
+
right: { [vars.textAlign]: 'right' },
|
74
|
+
left: { [vars.textAlign]: 'left' },
|
75
|
+
center: { [vars.textAlign]: 'center' },
|
76
|
+
},
|
77
|
+
|
78
|
+
_fullWidth: {
|
79
|
+
[vars.hostWidth]: '100%',
|
80
|
+
},
|
81
|
+
};
|
82
|
+
|
83
|
+
export default markdownContent;
|
84
|
+
export { vars };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import globals from '../globals';
|
2
2
|
import { getThemeRefs } from '../../helpers/themeHelpers';
|
3
|
-
import { TextClass } from '../../components/descope-text/TextClass';
|
3
|
+
import { TextClass } from '../../components/text-components/descope-text/TextClass';
|
4
4
|
|
5
5
|
const globalRefs = getThemeRefs(globals);
|
6
6
|
const vars = TextClass.cssVarList;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2528],{2138:(t,e,o)=>{o.d(e,{f:()=>h,k:()=>p});var n=o(4978),s=o(3346),i=o(2061),r=o(4567);const h=(0,r.iY)("text");class l extends((0,s.s)({componentName:h,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<style>\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t:host > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot part="text-wrapper"></slot>\n\t\t'}}const p=(0,i.qC)((0,n.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.e4,n.Ae,(t=>class extends t{get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,r.P$)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}))(l)},1876:(t,e,o)=>{o.r(e),o.d(e,{TextClass:()=>n.k});var n=o(2138);customElements.define(n.f,n.k)}}]);
|
@@ -1,67 +0,0 @@
|
|
1
|
-
// eslint-disable-next-line max-classes-per-file
|
2
|
-
import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
|
3
|
-
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
4
|
-
import { compose } from '../../helpers';
|
5
|
-
import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
|
6
|
-
|
7
|
-
export const componentName = getComponentName('text');
|
8
|
-
|
9
|
-
class RawText extends createBaseClass({ componentName, baseSelector: ':host > slot' }) {
|
10
|
-
constructor() {
|
11
|
-
super();
|
12
|
-
|
13
|
-
this.attachShadow({ mode: 'open' }).innerHTML = `
|
14
|
-
<style>
|
15
|
-
:host {
|
16
|
-
display: inline-block;
|
17
|
-
}
|
18
|
-
:host > slot {
|
19
|
-
width: 100%;
|
20
|
-
display: inline-block;
|
21
|
-
}
|
22
|
-
</style>
|
23
|
-
<slot part="text-wrapper"></slot>
|
24
|
-
`;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
const customTextMixin = (superclass) =>
|
29
|
-
class CustomTextMixin extends superclass {
|
30
|
-
get hideWhenEmpty() {
|
31
|
-
return this.getAttribute('hide-when-empty') === 'true';
|
32
|
-
}
|
33
|
-
|
34
|
-
init() {
|
35
|
-
super.init();
|
36
|
-
|
37
|
-
observeChildren(this, () => {
|
38
|
-
const hasChildren = !!this.childNodes.length;
|
39
|
-
this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';
|
40
|
-
});
|
41
|
-
}
|
42
|
-
};
|
43
|
-
|
44
|
-
export const TextClass = compose(
|
45
|
-
createStyleMixin({
|
46
|
-
mappings: {
|
47
|
-
hostWidth: { selector: () => ':host', property: 'width' },
|
48
|
-
hostDirection: { selector: () => ':host', property: 'direction' },
|
49
|
-
fontSize: {},
|
50
|
-
textColor: { property: 'color' },
|
51
|
-
textLineHeight: { property: 'line-height' },
|
52
|
-
textLetterSpacing: { property: 'letter-spacing' },
|
53
|
-
textShadow: {},
|
54
|
-
textAlign: {},
|
55
|
-
textTransform: {},
|
56
|
-
fontFamily: {},
|
57
|
-
fontStyle: {},
|
58
|
-
fontWeight: {},
|
59
|
-
borderWidth: {},
|
60
|
-
borderStyle: {},
|
61
|
-
borderColor: {},
|
62
|
-
},
|
63
|
-
}),
|
64
|
-
draggableMixin,
|
65
|
-
componentNameValidationMixin,
|
66
|
-
customTextMixin
|
67
|
-
)(RawText);
|
File without changes
|