@descope/web-components-ui 1.0.50 → 1.0.51

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ import Text, { componentName } from './Text';
2
+
3
+ customElements.define(componentName, Text);
4
+
5
+ export { Text };
package/src/index.js CHANGED
@@ -7,6 +7,7 @@ import './components/descope-password-field';
7
7
  import './components/descope-text-area';
8
8
  import './components/descope-date-picker';
9
9
  import './components/descope-container';
10
+ import './components/descope-text';
10
11
 
11
12
  export {
12
13
  globalsThemeToStyle,
@@ -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;
@@ -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: ['Courier New', 'Arial', 'sans-serif'],
18
- weight: '700',
24
+ font: fontsRef.font1,
25
+ weight: '900',
19
26
  size: '48px'
20
27
  },
21
28
  h2: {
22
- font: ['Courier New', 'sans-serif'],
23
- weight: '500',
29
+ font: fontsRef.font1,
30
+ weight: '800',
24
31
  size: '38px'
25
32
  },
26
33
  h3: {
27
- font: ['Courier New', 'sans-serif'],
28
- weight: '300',
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
- wide: {
55
- sm: '0 2px 3px -0.5px',
56
- md: '0 4px 6px -1px',
57
- lg: '0 10px 15px -3px',
58
- xl: '0 20px 25px -5px',
59
- '2xl': '0 25px 50px -12px',
60
- },
61
- narrow: {
62
- sm: '0 1px 2px -1px',
63
- md: '0 2px 4px -2px',
64
- lg: '0 4px 6px -4px',
65
- xl: '0 8px 10px -6px',
66
- '2xl': '0 16px 16px -8px',
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
  };