@descope/web-components-ui 1.0.112 → 1.0.114

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.
Files changed (35) hide show
  1. package/dist/cjs/index.cjs.js +2614 -1324
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +21 -21
  4. package/dist/index.esm.js +562 -424
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +2 -2
  7. package/src/dev/index.js +1 -1
  8. package/src/helpers/themeHelpers/index.js +6 -1
  9. package/src/index.cjs.js +4 -2
  10. package/src/index.d.ts +49 -0
  11. package/src/index.js +1 -1
  12. package/src/theme/components/button.js +30 -29
  13. package/src/theme/components/checkbox.js +1 -0
  14. package/src/theme/components/comboBox.js +1 -0
  15. package/src/theme/components/container.js +33 -32
  16. package/src/theme/components/divider.js +20 -19
  17. package/src/theme/components/emailField.js +1 -0
  18. package/src/theme/components/image.js +1 -0
  19. package/src/theme/components/index.js +27 -20
  20. package/src/theme/components/link.js +1 -0
  21. package/src/theme/components/loader/index.js +4 -2
  22. package/src/theme/components/loader/loaderLinear.js +1 -0
  23. package/src/theme/components/loader/loaderRadial.js +1 -0
  24. package/src/theme/components/logo.js +1 -0
  25. package/src/theme/components/newPassword.js +1 -0
  26. package/src/theme/components/numberField.js +1 -0
  27. package/src/theme/components/passcode.js +1 -0
  28. package/src/theme/components/passwordField.js +1 -0
  29. package/src/theme/components/phoneField.js +1 -1
  30. package/src/theme/components/switchToggle.js +1 -0
  31. package/src/theme/components/text.js +1 -0
  32. package/src/theme/components/textArea.js +1 -0
  33. package/src/theme/components/textField.js +1 -0
  34. package/src/theme/globals.js +6 -2
  35. package/src/theme/index.js +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.112",
3
+ "version": "1.0.114",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -19,7 +19,7 @@
19
19
  "lint": "echo \"Error: no lint specified\" && exit 0",
20
20
  "build:umd": "webpack -c webpack.prod.js",
21
21
  "build:lib": "rollup -c",
22
- "build": "npm run build:umd && npm run build:lib && cp index.d.ts dist",
22
+ "build": "npm run build:umd && npm run build:lib && cp src/index.d.ts dist",
23
23
  "start": "webpack serve -c webpack.dev.js --port=8888",
24
24
  "format": "prettier . -w --ignore-path .gitignore"
25
25
  },
package/src/dev/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as defaultTheme } from '../theme';
1
+ export { defaultTheme } from '../theme';
2
2
  export { themeToStyle } from '../helpers/themeHelpers';
@@ -40,6 +40,11 @@ export const getThemeRefs = (theme, prefix) =>
40
40
  set({}, path, `var(${getVarName(prefix ? [prefix, ...path] : path)})`)
41
41
  );
42
42
 
43
+ export const getThemeVars = (theme, prefix) =>
44
+ transformTheme(theme, [], (path) =>
45
+ set({}, path, getVarName(prefix ? [prefix, ...path] : path))
46
+ );
47
+
43
48
  export const globalsThemeToStyle = (theme, themeName = '') => `
44
49
  *[data-theme="${themeName}"] {
45
50
  ${Object.entries(themeToCSSVarsObj(theme)).reduce(
@@ -55,7 +60,7 @@ const componentsThemeToStyleObj = (componentsTheme) =>
55
60
  const property = restPath.pop();
56
61
  const componentName = getComponentName(component);
57
62
 
58
- if(property === 'undefined'){
63
+ if (property === 'undefined') {
59
64
  console.warn(componentName, `theme value: "${val}" is mapped to an invalid property`)
60
65
  }
61
66
 
package/src/index.cjs.js CHANGED
@@ -1,7 +1,9 @@
1
- // CJS is used by screen-renderer-service, we cannot load vaadin there,
2
- // so we are exporting only the css generation stuff
1
+ // CJS is used by screen-renderer-service, we cannot export client stuff here (except HTMLElement class),
2
+
3
3
  export * from './helpers/themeHelpers';
4
4
  export * from './helpers/themeHelpers/colorsHelpers';
5
+ export { defaultTheme, themeVars } from './theme';
6
+
5
7
  export { CheckboxClass } from './components/boolean-fields/descope-checkbox/CheckboxClass'
6
8
  export { SwitchToggleClass } from './components/boolean-fields/descope-switch-toggle/SwitchToggleClass'
7
9
  export { ButtonClass } from './components/descope-button/ButtonClass';
package/src/index.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ declare module '@descope/web-components-ui';
2
+
3
+ export {
4
+ globalsThemeToStyle,
5
+ createComponentsTheme,
6
+ themeToStyle,
7
+ componentsThemeManager,
8
+ } from './helpers/themeHelpers';
9
+ export { genColor } from './helpers/themeHelpers/colorsHelpers';
10
+ export { defaultTheme, themeVars } from './theme';
11
+
12
+ export { ButtonClass } from './components/descope-button';
13
+ export { CheckboxClass } from './components/boolean-fields/descope-checkbox';
14
+ export { SwitchToggleClass } from './components/boolean-fields/descope-switch-toggle';
15
+ export { LoaderLinearClass } from './components/descope-loader-linear';
16
+ export { LoaderRadialClass } from './components/descope-loader-radial';
17
+ export { ContainerClass } from './components/descope-container';
18
+ export { DividerClass } from './components/descope-divider';
19
+ export { EmailFieldClass } from './components/descope-email-field';
20
+ export { LinkClass } from './components/descope-link';
21
+ export { LogoClass } from './components/descope-logo';
22
+ export { NumberFieldClass } from './components/descope-number-field';
23
+ export { PasscodeClass } from './components/descope-passcode';
24
+ export { PasswordFieldClass } from './components/descope-password-field';
25
+ export { TextClass } from './components/descope-text';
26
+ export { TextAreaClass } from './components/descope-text-area';
27
+ export { TextFieldClass } from './components/descope-text-field';
28
+ export { ImageClass } from './components/descope-image';
29
+ export { PhoneFieldClass } from './components/descope-phone-field';
30
+ export { NewPasswordClass } from './components/descope-new-password';
31
+
32
+ export type Theme = {
33
+ globals: {
34
+ colors: Record<string, string>;
35
+ fonts: Record<string, any>;
36
+ typography: Record<string, any>;
37
+ shadow: Record<string, string>;
38
+ spacing: Record<string, string>;
39
+ };
40
+ components: {
41
+ button: Record<string, any>;
42
+ textField: Record<string, any>;
43
+ logo: Record<string, any>;
44
+ container: Record<string, any>;
45
+ link: Record<string, any>;
46
+ button: Record<string, any>;
47
+ text: Record<string, any>;
48
+ };
49
+ };
package/src/index.js CHANGED
@@ -26,4 +26,4 @@ export {
26
26
  componentsThemeManager
27
27
  } from './helpers/themeHelpers';
28
28
  export { genColor } from './helpers/themeHelpers/colorsHelpers';
29
- export { default as defaultTheme } from './theme';
29
+ export { defaultTheme, themeVars } from './theme';
@@ -3,7 +3,7 @@ import { getThemeRefs, createHelperVars } from '../../helpers/themeHelpers';
3
3
  import { componentName, ButtonClass } from '../../components/descope-button/ButtonClass';
4
4
 
5
5
  const globalRefs = getThemeRefs(globals);
6
- const vars = ButtonClass.cssVarList;
6
+ const compVars = ButtonClass.cssVarList;
7
7
 
8
8
  const mode = {
9
9
  primary: globalRefs.colors.primary,
@@ -13,7 +13,7 @@ const mode = {
13
13
  surface: globalRefs.colors.surface
14
14
  };
15
15
 
16
- const [helperTheme, helperRefs] = createHelperVars({ mode }, componentName);
16
+ const [helperTheme, helperRefs, helperVars] = createHelperVars({ mode }, componentName);
17
17
 
18
18
  const verticalPaddingRatio = 3;
19
19
  const horizontalPaddingRatio = 2;
@@ -21,68 +21,69 @@ const horizontalPaddingRatio = 2;
21
21
  const button = {
22
22
  ...helperTheme,
23
23
 
24
- [vars.cursor]: 'pointer',
24
+ [compVars.cursor]: 'pointer',
25
25
 
26
- [vars.borderRadius]: globalRefs.radius.sm,
27
- [vars.borderWidth]: '2px',
28
- [vars.borderStyle]: 'solid',
29
- [vars.borderColor]: 'transparent',
26
+ [compVars.borderRadius]: globalRefs.radius.sm,
27
+ [compVars.borderWidth]: '2px',
28
+ [compVars.borderStyle]: 'solid',
29
+ [compVars.borderColor]: 'transparent',
30
30
 
31
- [vars.gap]: '0.25em',
31
+ [compVars.gap]: '0.25em',
32
32
 
33
- [vars.verticalPadding]: `calc(var(${vars.fontSize}) / ${verticalPaddingRatio})`,
34
- [vars.horizontalPadding]: `calc(var(${vars.fontSize}) / ${horizontalPaddingRatio})`,
33
+ [compVars.verticalPadding]: `calc(var(${compVars.fontSize}) / ${verticalPaddingRatio})`,
34
+ [compVars.horizontalPadding]: `calc(var(${compVars.fontSize}) / ${horizontalPaddingRatio})`,
35
35
 
36
36
  size: {
37
- xs: { [vars.fontSize]: '12px' },
38
- sm: { [vars.fontSize]: '14px' },
39
- md: { [vars.fontSize]: '18px' },
40
- lg: { [vars.fontSize]: '22px' },
41
- xl: { [vars.fontSize]: '26px' }
37
+ xs: { [compVars.fontSize]: '12px' },
38
+ sm: { [compVars.fontSize]: '14px' },
39
+ md: { [compVars.fontSize]: '18px' },
40
+ lg: { [compVars.fontSize]: '22px' },
41
+ xl: { [compVars.fontSize]: '26px' }
42
42
  },
43
43
 
44
44
  _fullWidth: {
45
- [vars.width]: '100%'
45
+ [compVars.width]: '100%'
46
46
  },
47
47
 
48
48
  _loading: {
49
- [vars.cursor]: 'wait'
49
+ [compVars.cursor]: 'wait'
50
50
  },
51
51
 
52
52
  variant: {
53
53
  contained: {
54
- [vars.color]: helperRefs.contrast,
55
- [vars.backgroundColor]: helperRefs.main,
54
+ [compVars.color]: helperRefs.contrast,
55
+ [compVars.backgroundColor]: helperRefs.main,
56
56
  _hover: {
57
- [vars.backgroundColor]: helperRefs.dark
57
+ [compVars.backgroundColor]: helperRefs.dark
58
58
  },
59
59
  _active: {
60
- [vars.backgroundColor]: helperRefs.dark
60
+ [compVars.backgroundColor]: helperRefs.dark
61
61
  }
62
62
  },
63
63
 
64
64
  outline: {
65
- [vars.color]: helperRefs.main,
66
- [vars.borderColor]: 'currentColor',
65
+ [compVars.color]: helperRefs.main,
66
+ [compVars.borderColor]: 'currentColor',
67
67
  _hover: {
68
- [vars.color]: helperRefs.dark,
68
+ [compVars.color]: helperRefs.dark,
69
69
  },
70
70
  _active: {
71
- [vars.color]: helperRefs.light,
71
+ [compVars.color]: helperRefs.light,
72
72
  }
73
73
  },
74
74
 
75
75
  link: {
76
- [vars.color]: helperRefs.main,
76
+ [compVars.color]: helperRefs.main,
77
77
  _hover: {
78
- [vars.color]: helperRefs.main,
79
- [vars.textDecoration]: 'underline'
78
+ [compVars.color]: helperRefs.main,
79
+ [compVars.textDecoration]: 'underline'
80
80
  },
81
81
  _active: {
82
- [vars.color]: helperRefs.dark
82
+ [compVars.color]: helperRefs.dark
83
83
  }
84
84
  }
85
85
  }
86
86
  };
87
87
 
88
88
  export default button;
89
+ export const vars = { ...compVars, ...helperVars }
@@ -62,3 +62,4 @@ const checkbox = {
62
62
  };
63
63
 
64
64
  export default checkbox;
65
+ export { vars }
@@ -53,3 +53,4 @@ export const comboBox = {
53
53
  };
54
54
 
55
55
  export default comboBox;
56
+ export { vars }
@@ -4,7 +4,7 @@ import { ContainerClass, componentName } from "../../components/descope-containe
4
4
 
5
5
  const globalRefs = getThemeRefs(globals);
6
6
 
7
- const vars = ContainerClass.cssVarList
7
+ const compVars = ContainerClass.cssVarList
8
8
 
9
9
  const verticalAlignment = {
10
10
  start: { verticalAlignment: 'start' },
@@ -27,35 +27,35 @@ const [helperTheme, helperRefs, helperVars] =
27
27
 
28
28
  const container = {
29
29
  ...helperTheme,
30
- [vars.width]: '100%',
31
- [vars.boxShadow]: 'none',
32
- [vars.backgroundColor]: globalRefs.colors.surface.light,
33
- [vars.color]: globalRefs.colors.surface.contrast,
30
+ [compVars.width]: '100%',
31
+ [compVars.boxShadow]: 'none',
32
+ [compVars.backgroundColor]: globalRefs.colors.surface.light,
33
+ [compVars.color]: globalRefs.colors.surface.contrast,
34
34
  verticalPadding: {
35
- sm: { [vars.verticalPadding]: '5px' },
36
- md: { [vars.verticalPadding]: '10px' },
37
- lg: { [vars.verticalPadding]: '20px' },
35
+ sm: { [compVars.verticalPadding]: '5px' },
36
+ md: { [compVars.verticalPadding]: '10px' },
37
+ lg: { [compVars.verticalPadding]: '20px' },
38
38
  },
39
39
  horizontalPadding: {
40
- sm: { [vars.horizontalPadding]: '5px' },
41
- md: { [vars.horizontalPadding]: '10px' },
42
- lg: { [vars.horizontalPadding]: '20px' },
40
+ sm: { [compVars.horizontalPadding]: '5px' },
41
+ md: { [compVars.horizontalPadding]: '10px' },
42
+ lg: { [compVars.horizontalPadding]: '20px' },
43
43
  },
44
44
  direction: {
45
45
  row: {
46
- [vars.flexDirection]: 'row',
47
- [vars.alignItems]: helperRefs.verticalAlignment,
48
- [vars.justifyContent]: helperRefs.horizontalAlignment,
49
- [vars.flexWrap]: 'wrap',
46
+ [compVars.flexDirection]: 'row',
47
+ [compVars.alignItems]: helperRefs.verticalAlignment,
48
+ [compVars.justifyContent]: helperRefs.horizontalAlignment,
49
+ [compVars.flexWrap]: 'wrap',
50
50
  horizontalAlignment: {
51
51
  spaceBetween: { [helperVars.horizontalAlignment]: 'space-between' },
52
52
  }
53
53
  },
54
54
 
55
55
  column: {
56
- [vars.flexDirection]: 'column',
57
- [vars.alignItems]: helperRefs.horizontalAlignment,
58
- [vars.justifyContent]: helperRefs.verticalAlignment,
56
+ [compVars.flexDirection]: 'column',
57
+ [compVars.alignItems]: helperRefs.horizontalAlignment,
58
+ [compVars.justifyContent]: helperRefs.verticalAlignment,
59
59
  verticalAlignment: {
60
60
  spaceBetween: { [helperVars.verticalAlignment]: 'space-between' }
61
61
  }
@@ -64,55 +64,56 @@ const container = {
64
64
 
65
65
  spaceBetween: {
66
66
  sm: {
67
- [vars.gap]: '10px'
67
+ [compVars.gap]: '10px'
68
68
  },
69
69
  md: {
70
- [vars.gap]: '20px'
70
+ [compVars.gap]: '20px'
71
71
  },
72
72
  lg: {
73
- [vars.gap]: '30px'
73
+ [compVars.gap]: '30px'
74
74
  }
75
75
  },
76
76
 
77
77
  shadow: {
78
78
  sm: {
79
- [vars.boxShadow]: `${globalRefs.shadow.wide.sm} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.sm} ${helperRefs.shadowColor}`
79
+ [compVars.boxShadow]: `${globalRefs.shadow.wide.sm} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.sm} ${helperRefs.shadowColor}`
80
80
  },
81
81
  md: {
82
- [vars.boxShadow]: `${globalRefs.shadow.wide.md} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.md} ${helperRefs.shadowColor}`
82
+ [compVars.boxShadow]: `${globalRefs.shadow.wide.md} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.md} ${helperRefs.shadowColor}`
83
83
  },
84
84
  lg: {
85
- [vars.boxShadow]: `${globalRefs.shadow.wide.lg} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.lg} ${helperRefs.shadowColor}`
85
+ [compVars.boxShadow]: `${globalRefs.shadow.wide.lg} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.lg} ${helperRefs.shadowColor}`
86
86
  },
87
87
  xl: {
88
- [vars.boxShadow]: `${globalRefs.shadow.wide.xl} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.xl} ${helperRefs.shadowColor}`
88
+ [compVars.boxShadow]: `${globalRefs.shadow.wide.xl} ${helperRefs.shadowColor}, ${globalRefs.shadow.narrow.xl} ${helperRefs.shadowColor}`
89
89
  },
90
90
  '2xl': {
91
91
  [helperVars.shadowColor]: '#00000050', // mimic daisyUI shadow settings
92
- [vars.boxShadow]: `${globalRefs.shadow.wide['2xl']} ${helperRefs.shadowColor}`
92
+ [compVars.boxShadow]: `${globalRefs.shadow.wide['2xl']} ${helperRefs.shadowColor}`
93
93
  },
94
94
  },
95
95
 
96
96
  borderRadius: {
97
97
  sm: {
98
- [vars.borderRadius]: globalRefs.radius.sm
98
+ [compVars.borderRadius]: globalRefs.radius.sm
99
99
  },
100
100
  md: {
101
- [vars.borderRadius]: globalRefs.radius.md
101
+ [compVars.borderRadius]: globalRefs.radius.md
102
102
  },
103
103
  lg: {
104
- [vars.borderRadius]: globalRefs.radius.lg
104
+ [compVars.borderRadius]: globalRefs.radius.lg
105
105
  },
106
106
  xl: {
107
- [vars.borderRadius]: globalRefs.radius.xl
107
+ [compVars.borderRadius]: globalRefs.radius.xl
108
108
  },
109
109
  '2xl': {
110
- [vars.borderRadius]: globalRefs.radius['2xl']
110
+ [compVars.borderRadius]: globalRefs.radius['2xl']
111
111
  },
112
112
  '3xl': {
113
- [vars.borderRadius]: globalRefs.radius['3xl']
113
+ [compVars.borderRadius]: globalRefs.radius['3xl']
114
114
  },
115
115
  }
116
116
  };
117
117
 
118
118
  export default container;
119
+ export const vars = { ...compVars, ...helperVars }
@@ -4,33 +4,34 @@ import globals from '../globals';
4
4
 
5
5
  const globalRefs = getThemeRefs(globals);
6
6
 
7
- const vars = DividerClass.cssVarList;
7
+ const compVars = DividerClass.cssVarList;
8
8
 
9
9
  const thickness = '2px'
10
10
  const textPaddingSize = '10px'
11
- const [helperTheme, helperRefs] = createHelperVars({ thickness, textPaddingSize }, componentName);
11
+ const [helperTheme, helperRefs, helperVars] = createHelperVars({ thickness, textPaddingSize }, componentName);
12
12
 
13
13
  const divider = {
14
14
  ...helperTheme,
15
- [vars.alignItems]: 'center',
16
- [vars.dividerHeight]: helperRefs.thickness,
17
- [vars.backgroundColor]: globalRefs.colors.surface.main,
18
- [vars.textPadding]: `0 ${helperRefs.textPaddingSize}`,
19
- [vars.width]: '100%',
20
- [vars.flexDirection]: 'row',
21
- [vars.alignSelf]: 'strech',
22
- [vars.textWidth]: 'fit-content',
23
- [vars.maxTextWidth]: 'calc(100% - 100px)',
15
+ [compVars.alignItems]: 'center',
16
+ [compVars.dividerHeight]: helperRefs.thickness,
17
+ [compVars.backgroundColor]: globalRefs.colors.surface.main,
18
+ [compVars.textPadding]: `0 ${helperRefs.textPaddingSize}`,
19
+ [compVars.width]: '100%',
20
+ [compVars.flexDirection]: 'row',
21
+ [compVars.alignSelf]: 'strech',
22
+ [compVars.textWidth]: 'fit-content',
23
+ [compVars.maxTextWidth]: 'calc(100% - 100px)',
24
24
  _vertical: {
25
- [vars.padding]: `0 calc(${thickness} * 3)`,
26
- [vars.width]: 'fit-content',
27
- [vars.textPadding]: `${helperRefs.textPaddingSize} 0`,
28
- [vars.flexDirection]: 'column',
29
- [vars.minHeight]: '200px',
30
- [vars.textWidth]: 'fit-content',
31
- [vars.dividerWidth]: helperRefs.thickness,
32
- [vars.maxTextWidth]: '100%',
25
+ [compVars.padding]: `0 calc(${thickness} * 3)`,
26
+ [compVars.width]: 'fit-content',
27
+ [compVars.textPadding]: `${helperRefs.textPaddingSize} 0`,
28
+ [compVars.flexDirection]: 'column',
29
+ [compVars.minHeight]: '200px',
30
+ [compVars.textWidth]: 'fit-content',
31
+ [compVars.dividerWidth]: helperRefs.thickness,
32
+ [compVars.maxTextWidth]: '100%',
33
33
  }
34
34
  };
35
35
 
36
36
  export default divider;
37
+ export const vars = { ...compVars, ...helperVars }
@@ -6,3 +6,4 @@ const emailField = {
6
6
  };
7
7
 
8
8
  export default emailField;
9
+ export const vars = EmailFieldClass.cssVarList
@@ -5,3 +5,4 @@ const vars = ImageClass.cssVarList
5
5
  const image = {};
6
6
 
7
7
  export default image;
8
+ export { vars }
@@ -1,24 +1,24 @@
1
- import button from './button';
2
- import textField from './textField';
3
- import passwordField from './passwordField';
4
- import numberField from './numberField';
5
- import emailField from './emailField';
6
- import textArea from './textArea';
7
- import checkbox from './checkbox';
8
- import switchToggle from './switchToggle';
9
- import container from './container';
10
- import logo from './logo';
11
- import text from './text';
12
- import link from './link';
13
- import divider from './divider';
14
- import passcode from './passcode';
1
+ import * as button from './button';
2
+ import * as textField from './textField';
3
+ import * as passwordField from './passwordField';
4
+ import * as numberField from './numberField';
5
+ import * as emailField from './emailField';
6
+ import * as textArea from './textArea';
7
+ import * as checkbox from './checkbox';
8
+ import * as switchToggle from './switchToggle';
9
+ import * as container from './container';
10
+ import * as logo from './logo';
11
+ import * as text from './text';
12
+ import * as link from './link';
13
+ import * as divider from './divider';
14
+ import * as passcode from './passcode';
15
15
  import { loaderRadial, loaderLinear } from './loader';
16
- import comboBox from './comboBox';
17
- import image from './image';
18
- import phoneField from './phoneField';
19
- import newPassword from './newPassword';
16
+ import * as comboBox from './comboBox';
17
+ import * as image from './image';
18
+ import * as phoneField from './phoneField';
19
+ import * as newPassword from './newPassword';
20
20
 
21
- export default {
21
+ const components = {
22
22
  button,
23
23
  textField,
24
24
  passwordField,
@@ -39,4 +39,11 @@ export default {
39
39
  image,
40
40
  phoneField,
41
41
  newPassword,
42
- };
42
+ }
43
+
44
+
45
+ const theme = Object.keys(components).reduce((acc, comp) => ({ ...acc, [comp]: components[comp].default }), {});
46
+ const vars = Object.keys(components).reduce((acc, comp) => ({ ...acc, [comp]: components[comp].vars }), {});
47
+
48
+ export default theme;
49
+ export { vars }
@@ -55,3 +55,4 @@ const link = {
55
55
  };
56
56
 
57
57
  export default link;
58
+ export { vars }
@@ -1,2 +1,4 @@
1
- export { default as loaderLinear } from './loaderLinear';
2
- export { default as loaderRadial } from './loaderRadial';
1
+ import * as loaderLinear from './loaderLinear'
2
+ import * as loaderRadial from './loaderRadial'
3
+
4
+ export { loaderLinear, loaderRadial };
@@ -47,3 +47,4 @@ const loaderLinear = {
47
47
  };
48
48
 
49
49
  export default loaderLinear;
50
+ export { vars }
@@ -60,3 +60,4 @@ const loaderRadial = {
60
60
  };
61
61
 
62
62
  export default loaderRadial;
63
+ export { vars }
@@ -7,3 +7,4 @@ const logo = {
7
7
  };
8
8
 
9
9
  export default logo;
10
+ export { vars }
@@ -33,3 +33,4 @@ const newPassword = {
33
33
  };
34
34
 
35
35
  export default newPassword;
36
+ export { vars }
@@ -6,3 +6,4 @@ const numberField = {
6
6
  };
7
7
 
8
8
  export default numberField;
9
+ export const vars = NumberFieldClass.cssVarList
@@ -40,3 +40,4 @@ const passcode = {
40
40
  }
41
41
 
42
42
  export default passcode;
43
+ export { vars }
@@ -70,3 +70,4 @@ const passwordField = {
70
70
  };
71
71
 
72
72
  export default passwordField;
73
+ export { vars }
@@ -68,5 +68,5 @@ const phoneField = {
68
68
  };
69
69
 
70
70
  export default phoneField;
71
-
71
+ export { vars }
72
72
 
@@ -75,3 +75,4 @@ const switchToggle = {
75
75
  };
76
76
 
77
77
  export default switchToggle;
78
+ export { vars }
@@ -81,3 +81,4 @@ const text = {
81
81
  };
82
82
 
83
83
  export default text;
84
+ export { vars }
@@ -52,3 +52,4 @@ const textArea = {
52
52
  };
53
53
 
54
54
  export default textArea;
55
+ export { vars }
@@ -71,3 +71,4 @@ export const textField = (vars) => ({
71
71
  });
72
72
 
73
73
  export default textField(vars);
74
+ export { vars }
@@ -1,6 +1,7 @@
1
- import { getThemeRefs } from '../helpers/themeHelpers';
1
+ import { getThemeRefs, getThemeVars } from '../helpers/themeHelpers';
2
2
  import { genColors } from '../helpers/themeHelpers/colorsHelpers';
3
3
 
4
+
4
5
  export const colors = genColors({
5
6
  surface: {
6
7
  main: 'lightgray',
@@ -138,7 +139,7 @@ const shadow = {
138
139
  }
139
140
  };
140
141
 
141
- export default {
142
+ const globals = {
142
143
  colors,
143
144
  typography,
144
145
  spacing,
@@ -147,3 +148,6 @@ export default {
147
148
  shadow,
148
149
  fonts
149
150
  };
151
+
152
+ export default globals
153
+ export const vars = getThemeVars(globals)
@@ -1,4 +1,5 @@
1
- import globals from './globals';
2
- import components from './components';
1
+ import globals, { vars as globalsVars } from './globals';
2
+ import components, { vars as componentsVars } from './components';
3
3
 
4
- export default { globals, components };
4
+ export const defaultTheme = { globals, components };
5
+ export const themeVars = { globals: globalsVars, components: componentsVars }