@descope/web-components-ui 1.0.50 → 1.0.51
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 +305 -165
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/descope-text-index-js.js +1 -0
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-text/Text.js +46 -0
- package/src/components/descope-text/index.js +5 -0
- package/src/index.js +1 -0
- package/src/theme/components/index.js +3 -1
- package/src/theme/components/text.js +79 -0
- package/src/theme/globals.js +49 -21
package/src/index.js
CHANGED
@@ -8,6 +8,7 @@ import checkbox from './checkbox';
|
|
8
8
|
import switchToggle from './switchToggle';
|
9
9
|
import container from './container';
|
10
10
|
import logo from './logo';
|
11
|
+
import text from './text';
|
11
12
|
|
12
13
|
export default {
|
13
14
|
button,
|
@@ -19,5 +20,6 @@ export default {
|
|
19
20
|
checkbox,
|
20
21
|
switchToggle,
|
21
22
|
container,
|
22
|
-
logo
|
23
|
+
logo,
|
24
|
+
text
|
23
25
|
};
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import globals from '../globals';
|
2
|
+
import { getThemeRefs } from '../../themeHelpers';
|
3
|
+
import Text from '../../components/descope-text/Text';
|
4
|
+
|
5
|
+
const globalRefs = getThemeRefs(globals);
|
6
|
+
|
7
|
+
const vars = Text.cssVarList;
|
8
|
+
|
9
|
+
const text = {
|
10
|
+
[vars.lineHeight]: '1em',
|
11
|
+
[vars.display]: 'inline-block',
|
12
|
+
[vars.textAlign]: 'left',
|
13
|
+
[vars.color]: globalRefs.colors.surface.dark,
|
14
|
+
variant: {
|
15
|
+
h1: {
|
16
|
+
[vars.fontSize]: globalRefs.typography.h1.size,
|
17
|
+
[vars.fontWeight]: globalRefs.typography.h1.weight,
|
18
|
+
[vars.fontFamily]: globalRefs.typography.h1.font
|
19
|
+
},
|
20
|
+
h2: {
|
21
|
+
[vars.fontSize]: globalRefs.typography.h2.size,
|
22
|
+
[vars.fontWeight]: globalRefs.typography.h2.weight,
|
23
|
+
[vars.fontFamily]: globalRefs.typography.h2.font
|
24
|
+
},
|
25
|
+
h3: {
|
26
|
+
[vars.fontSize]: globalRefs.typography.h3.size,
|
27
|
+
[vars.fontWeight]: globalRefs.typography.h3.weight,
|
28
|
+
[vars.fontFamily]: globalRefs.typography.h3.font
|
29
|
+
},
|
30
|
+
subtitle1: {
|
31
|
+
[vars.fontSize]: globalRefs.typography.subtitle1.size,
|
32
|
+
[vars.fontWeight]: globalRefs.typography.subtitle1.weight,
|
33
|
+
[vars.fontFamily]: globalRefs.typography.subtitle1.font
|
34
|
+
},
|
35
|
+
subtitle2: {
|
36
|
+
[vars.fontSize]: globalRefs.typography.subtitle2.size,
|
37
|
+
[vars.fontWeight]: globalRefs.typography.subtitle2.weight,
|
38
|
+
[vars.fontFamily]: globalRefs.typography.subtitle2.font
|
39
|
+
},
|
40
|
+
body1: {
|
41
|
+
[vars.fontSize]: globalRefs.typography.body1.size,
|
42
|
+
[vars.fontWeight]: globalRefs.typography.body1.weight,
|
43
|
+
[vars.fontFamily]: globalRefs.typography.body1.font
|
44
|
+
},
|
45
|
+
body2: {
|
46
|
+
[vars.fontSize]: globalRefs.typography.body2.size,
|
47
|
+
[vars.fontWeight]: globalRefs.typography.body2.weight,
|
48
|
+
[vars.fontFamily]: globalRefs.typography.body2.font
|
49
|
+
}
|
50
|
+
},
|
51
|
+
mode: {
|
52
|
+
primary: {
|
53
|
+
[vars.color]: globalRefs.colors.primary.main
|
54
|
+
},
|
55
|
+
secondary: {
|
56
|
+
[vars.color]: globalRefs.colors.secondary.main
|
57
|
+
},
|
58
|
+
error: {
|
59
|
+
[vars.color]: globalRefs.colors.error.main
|
60
|
+
},
|
61
|
+
success: {
|
62
|
+
[vars.color]: globalRefs.colors.success.main
|
63
|
+
}
|
64
|
+
},
|
65
|
+
textAlign: {
|
66
|
+
right: { [vars.textAlign]: 'right' },
|
67
|
+
left: { [vars.textAlign]: 'left' },
|
68
|
+
center: { [vars.textAlign]: 'center' }
|
69
|
+
},
|
70
|
+
_fullWidth: {
|
71
|
+
[vars.width]: '100%',
|
72
|
+
[vars.display]: 'block'
|
73
|
+
},
|
74
|
+
_italic: {
|
75
|
+
[vars.fontStyle]: 'italic'
|
76
|
+
}
|
77
|
+
};
|
78
|
+
|
79
|
+
export default text;
|
package/src/theme/globals.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { getThemeRefs } from '../themeHelpers';
|
1
2
|
import { genColors } from '../themeHelpers/processColors';
|
2
3
|
|
3
4
|
export const colors = genColors({
|
@@ -12,21 +13,47 @@ export const colors = genColors({
|
|
12
13
|
error: 'red'
|
13
14
|
});
|
14
15
|
|
16
|
+
const fonts = {
|
17
|
+
font1: ['Roboto', 'sans-serif'],
|
18
|
+
font2: ['Oswald', 'serif']
|
19
|
+
};
|
20
|
+
const fontsRef = getThemeRefs({ fonts }).fonts;
|
21
|
+
|
15
22
|
const typography = {
|
16
23
|
h1: {
|
17
|
-
font:
|
18
|
-
weight: '
|
24
|
+
font: fontsRef.font1,
|
25
|
+
weight: '900',
|
19
26
|
size: '48px'
|
20
27
|
},
|
21
28
|
h2: {
|
22
|
-
font:
|
23
|
-
weight: '
|
29
|
+
font: fontsRef.font1,
|
30
|
+
weight: '800',
|
24
31
|
size: '38px'
|
25
32
|
},
|
26
33
|
h3: {
|
27
|
-
font:
|
28
|
-
weight: '
|
34
|
+
font: fontsRef.font1,
|
35
|
+
weight: '600',
|
29
36
|
size: '28px'
|
37
|
+
},
|
38
|
+
subtitle1: {
|
39
|
+
font: fontsRef.font2,
|
40
|
+
weight: '500',
|
41
|
+
size: '22px'
|
42
|
+
},
|
43
|
+
subtitle2: {
|
44
|
+
font: fontsRef.font2,
|
45
|
+
weight: '400',
|
46
|
+
size: '20px'
|
47
|
+
},
|
48
|
+
body1: {
|
49
|
+
font: fontsRef.font1,
|
50
|
+
weight: '300',
|
51
|
+
size: '16px'
|
52
|
+
},
|
53
|
+
body2: {
|
54
|
+
font: fontsRef.font1,
|
55
|
+
weight: '200',
|
56
|
+
size: '14px'
|
30
57
|
}
|
31
58
|
};
|
32
59
|
|
@@ -51,20 +78,20 @@ const radius = {
|
|
51
78
|
};
|
52
79
|
|
53
80
|
const shadow = {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
81
|
+
wide: {
|
82
|
+
sm: '0 2px 3px -0.5px',
|
83
|
+
md: '0 4px 6px -1px',
|
84
|
+
lg: '0 10px 15px -3px',
|
85
|
+
xl: '0 20px 25px -5px',
|
86
|
+
'2xl': '0 25px 50px -12px'
|
87
|
+
},
|
88
|
+
narrow: {
|
89
|
+
sm: '0 1px 2px -1px',
|
90
|
+
md: '0 2px 4px -2px',
|
91
|
+
lg: '0 4px 6px -4px',
|
92
|
+
xl: '0 8px 10px -6px',
|
93
|
+
'2xl': '0 16px 16px -8px'
|
94
|
+
}
|
68
95
|
};
|
69
96
|
|
70
97
|
export default {
|
@@ -73,5 +100,6 @@ export default {
|
|
73
100
|
spacing,
|
74
101
|
border,
|
75
102
|
radius,
|
76
|
-
shadow
|
103
|
+
shadow,
|
104
|
+
fonts
|
77
105
|
};
|