@descope/web-components-ui 1.0.113 → 1.0.115

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 (84) hide show
  1. package/dist/cjs/index.cjs.js +5558 -1
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +21 -20
  4. package/dist/index.esm.js +1586 -1456
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/201.js +1 -0
  7. package/dist/umd/241.js +1 -1
  8. package/dist/umd/447.js +1 -1
  9. package/dist/umd/65.js +1 -1
  10. package/dist/umd/803.js +1 -1
  11. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  12. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  13. package/dist/umd/descope-button-index-js.js +1 -1
  14. package/dist/umd/descope-combo-box-index-js.js +1 -1
  15. package/dist/umd/descope-container-index-js.js +1 -1
  16. package/dist/umd/descope-divider-index-js.js +1 -1
  17. package/dist/umd/descope-email-field-index-js.js +1 -1
  18. package/dist/umd/descope-link-index-js.js +1 -1
  19. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  20. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  21. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  22. package/dist/umd/descope-number-field-index-js.js +1 -1
  23. package/dist/umd/descope-passcode-index-js.js +1 -1
  24. package/dist/umd/descope-phone-field-index-js.js +1 -1
  25. package/dist/umd/descope-text-area-index-js.js +1 -1
  26. package/dist/umd/descope-text-field-index-js.js +1 -1
  27. package/dist/umd/descope-text-index-js.js +1 -1
  28. package/dist/umd/index.js +1 -1
  29. package/package.json +2 -2
  30. package/src/components/boolean-fields/commonStyles.js +13 -5
  31. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +40 -37
  32. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +43 -37
  33. package/src/components/descope-button/ButtonClass.js +22 -6
  34. package/src/components/descope-combo-box/ComboBoxClass.js +49 -36
  35. package/src/components/descope-container/ContainerClass.js +4 -4
  36. package/src/components/descope-divider/DividerClass.js +74 -55
  37. package/src/components/descope-email-field/EmailFieldClass.js +11 -47
  38. package/src/components/descope-link/LinkClass.js +8 -5
  39. package/src/components/descope-loader-linear/LoaderLinearClass.js +16 -12
  40. package/src/components/descope-loader-radial/LoaderRadialClass.js +12 -11
  41. package/src/components/descope-new-password/NewPasswordClass.js +65 -51
  42. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +1 -1
  43. package/src/components/descope-number-field/NumberFieldClass.js +11 -43
  44. package/src/components/descope-passcode/PasscodeClass.js +36 -29
  45. package/src/components/descope-password-field/PasswordFieldClass.js +52 -41
  46. package/src/components/descope-phone-field/PhoneFieldClass.js +61 -41
  47. package/src/components/descope-text/TextClass.js +8 -8
  48. package/src/components/descope-text-area/TextAreaClass.js +50 -48
  49. package/src/components/descope-text-field/TextFieldClass.js +11 -53
  50. package/src/components/descope-text-field/textFieldMappings.js +66 -38
  51. package/src/dev/index.js +1 -1
  52. package/src/helpers/themeHelpers/index.js +6 -1
  53. package/src/helpers/themeHelpers/resetHelpers.js +76 -0
  54. package/src/index.cjs.js +23 -2
  55. package/src/index.d.ts +50 -0
  56. package/src/index.js +1 -1
  57. package/src/mixins/createStyleMixin/index.js +38 -27
  58. package/src/mixins/inputValidationMixin.js +4 -1
  59. package/src/mixins/proxyInputMixin.js +11 -3
  60. package/src/theme/components/button.js +45 -29
  61. package/src/theme/components/checkbox.js +18 -46
  62. package/src/theme/components/comboBox.js +24 -35
  63. package/src/theme/components/container.js +49 -61
  64. package/src/theme/components/divider.js +35 -23
  65. package/src/theme/components/emailField.js +21 -2
  66. package/src/theme/components/image.js +1 -0
  67. package/src/theme/components/index.js +27 -19
  68. package/src/theme/components/inputWrapper.js +72 -0
  69. package/src/theme/components/link.js +16 -22
  70. package/src/theme/components/loader/index.js +4 -2
  71. package/src/theme/components/loader/loaderLinear.js +19 -23
  72. package/src/theme/components/loader/loaderRadial.js +32 -46
  73. package/src/theme/components/logo.js +1 -0
  74. package/src/theme/components/newPassword.js +11 -25
  75. package/src/theme/components/numberField.js +21 -2
  76. package/src/theme/components/passcode.js +17 -27
  77. package/src/theme/components/passwordField.js +19 -64
  78. package/src/theme/components/phoneField.js +19 -58
  79. package/src/theme/components/switchToggle.js +21 -34
  80. package/src/theme/components/text.js +14 -8
  81. package/src/theme/components/textArea.js +20 -36
  82. package/src/theme/components/textField.js +21 -67
  83. package/src/theme/globals.js +6 -2
  84. package/src/theme/index.js +4 -3
package/src/index.d.ts ADDED
@@ -0,0 +1,50 @@
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
+ inputWrapper: Record<string, any>;
49
+ };
50
+ };
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';
@@ -6,14 +6,15 @@ import { createStyle, createCssVarsList, createClassSelectorSpecifier } from './
6
6
 
7
7
  const STYLE_OVERRIDE_ATTR_PREFIX = 'st'
8
8
 
9
-
10
9
  export const createStyleMixin =
11
- ({ mappings = {} }) => (superclass) =>
12
- class CustomStyleMixinClass extends superclass {
10
+ ({ mappings = {}, componentNameOverride = '' }) => (superclass) => {
11
+ const componentName = componentNameOverride || superclass.componentName;
12
+
13
+ return class CustomStyleMixinClass extends superclass {
13
14
  static get cssVarList() {
14
15
  return {
15
16
  ...superclass.cssVarList,
16
- ...createCssVarsList(superclass.componentName, {
17
+ ...createCssVarsList(componentName, {
17
18
  ...mappings,
18
19
  })
19
20
  };
@@ -52,30 +53,32 @@ export const createStyleMixin =
52
53
  this.#createOverridesStyle();
53
54
  }
54
55
 
55
- get componentTheme() {
56
- return componentsThemeManager.currentTheme?.[superclass.componentName] || ''
56
+ get #componentTheme() {
57
+ return componentsThemeManager.currentTheme?.[componentName] || ''
57
58
  }
58
59
 
59
60
  #onComponentThemeChange() {
60
- this.#themeStyleEle.innerHTML = this.componentTheme[this.#themeSection]
61
+ this.#themeStyleEle.innerHTML = this.#componentTheme[this.#themeSection]
61
62
  }
62
63
 
63
64
  #createComponentTheme() {
64
65
  this.#themeStyleEle = document.createElement('style');
65
- this.#themeStyleEle.id = 'style-mixin-theme';
66
+ this.#themeStyleEle.id = `style-mixin-theme__${componentName}`;
66
67
  this.#rootElement.prepend(this.#themeStyleEle);
67
68
  this.#disconnectThemeManager = componentsThemeManager.onCurrentThemeChange(this.#onComponentThemeChange.bind(this))
68
69
  this.#onComponentThemeChange()
69
70
  }
70
71
 
71
72
  #createOverridesStyle() {
72
- this.#overrideStyleEle = document.createElement('style');
73
- this.#overrideStyleEle.id = 'style-mixin-overrides';
73
+ if (this.#styleAttributes.length) {
74
+ this.#overrideStyleEle = document.createElement('style');
75
+ this.#overrideStyleEle.id = `style-mixin-overrides__${componentName}`;
74
76
 
75
- const classSpecifier = createClassSelectorSpecifier(superclass.componentName, CSS_SELECTOR_SPECIFIER_MULTIPLY);
77
+ const classSpecifier = createClassSelectorSpecifier(componentName, CSS_SELECTOR_SPECIFIER_MULTIPLY);
76
78
 
77
- this.#overrideStyleEle.innerText = `:host(${classSpecifier}) {}`;
78
- this.#rootElement.append(this.#overrideStyleEle);
79
+ this.#overrideStyleEle.innerText = `:host(${classSpecifier}) {}`;
80
+ this.#rootElement.append(this.#overrideStyleEle);
81
+ }
79
82
  }
80
83
 
81
84
  #setAttrOverride(attrName, value) {
@@ -83,37 +86,44 @@ export const createStyleMixin =
83
86
  if (!style) return;
84
87
 
85
88
  const varName = getCssVarName(
86
- superclass.componentName,
89
+ componentName,
87
90
  attrName.replace(new RegExp(`^${STYLE_OVERRIDE_ATTR_PREFIX}-`), '')
88
91
  );
89
92
 
90
93
  if (value) style?.setProperty(varName, value);
91
- else {
94
+ else {
92
95
  style?.removeProperty(varName);
93
96
  this.removeAttribute(attrName)
94
97
  }
95
98
  }
96
99
 
97
100
  #updateOverridesStyle(attrs = []) {
101
+ let shouldUpdate = false;
102
+
98
103
  for (const attr of attrs) {
99
104
  if (this.#styleAttributes.includes(attr)) {
100
105
  this.#setAttrOverride(attr, this.getAttribute(attr));
106
+ shouldUpdate = true;
101
107
  }
102
108
  }
103
109
 
104
- // we are rewriting the style back to the style tag
105
- this.#overrideStyleEle.innerHTML = this.#overrideStyleEle?.sheet?.cssRules[0].cssText
110
+ if (shouldUpdate) {
111
+ // we are rewriting the style back to the style tag
112
+ this.#overrideStyleEle.innerHTML = this.#overrideStyleEle?.sheet?.cssRules[0].cssText
113
+ }
106
114
  }
107
115
 
108
116
  #createMappingStyle() {
109
- const themeStyle = document.createElement('style');
110
- themeStyle.id = 'style-mixin-mappings'
111
- themeStyle.innerHTML = createStyle(
112
- kebabCaseJoin(superclass.componentName, this.#componentNameSuffix),
113
- this.#baseSelector,
114
- mappings
115
- );
116
- this.#rootElement.prepend(themeStyle);
117
+ if (Object.keys(mappings).length) {
118
+ const themeStyle = document.createElement('style');
119
+ themeStyle.id = `style-mixin-mappings__${componentName}`
120
+ themeStyle.innerHTML = createStyle(
121
+ kebabCaseJoin(componentName, this.#componentNameSuffix),
122
+ this.#baseSelector,
123
+ mappings
124
+ );
125
+ this.#rootElement.prepend(themeStyle);
126
+ }
117
127
  }
118
128
 
119
129
  #addClassName(className) {
@@ -123,7 +133,7 @@ export const createStyleMixin =
123
133
  init() {
124
134
  super.init?.();
125
135
  if (this.shadowRoot.isConnected) {
126
- this.#addClassName(superclass.componentName)
136
+ this.#addClassName(componentName)
127
137
 
128
138
  // this is instead attributeChangedCallback because we cannot use static methods in this case
129
139
  observeAttributes(this, this.#updateOverridesStyle.bind(this), {})
@@ -135,4 +145,5 @@ export const createStyleMixin =
135
145
 
136
146
  this.#disconnectThemeManager?.();
137
147
  }
138
- };
148
+ }
149
+ };
@@ -53,13 +53,16 @@ export const inputValidationMixin = (superclass) => class InputValidationMixinCl
53
53
  stepMismatch,
54
54
  tooShort,
55
55
  tooLong,
56
+ rangeOverflow,
57
+ rangeUnderflow,
58
+ badInput,
56
59
  customError
57
60
  } = flags;
58
61
  switch (true) {
59
62
  case valueMissing:
60
63
  return this.getAttribute(errorAttributes.valueMissing) ||
61
64
  this.defaultErrorMsgValueMissing
62
- case patternMismatch || typeMismatch || stepMismatch:
65
+ case patternMismatch || typeMismatch || stepMismatch || rangeOverflow || rangeUnderflow || badInput:
63
66
  return this.getAttribute(errorAttributes.patternMismatch) ||
64
67
  this.defaultErrorMsgPatternMismatch
65
68
  case tooShort:
@@ -1,5 +1,7 @@
1
- import { forwardAttrs } from "../helpers/componentHelpers";
1
+ import { compose } from "../helpers";
2
+ import { forwardAttrs, getComponentName } from "../helpers/componentHelpers";
2
3
  import { createDispatchEvent } from "../helpers/mixinsHelpers";
4
+ import { createStyleMixin } from "./createStyleMixin";
3
5
  import { inputValidationMixin } from "./inputValidationMixin";
4
6
 
5
7
  const errorAttrs = ['invalid', 'required'];
@@ -30,7 +32,7 @@ const getNestedInput = (ele) => {
30
32
  }
31
33
  }
32
34
 
33
- export const proxyInputMixin = (superclass) =>
35
+ const proxyInputMixin = (superclass) =>
34
36
  class ProxyInputMixinClass extends inputValidationMixin(superclass) {
35
37
  static get observedAttributes() {
36
38
  return [...superclass.observedAttributes || [], ...errorAttrs];
@@ -131,6 +133,12 @@ export const proxyInputMixin = (superclass) =>
131
133
  propertyObserver(this, this.inputElement, 'selectionStart');
132
134
  this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);
133
135
 
134
- forwardAttrs(this, this.inputElement, {includeAttrs: ['inputmode']})
136
+ forwardAttrs(this, this.inputElement, { includeAttrs: ['inputmode'] })
135
137
  }
136
138
  };
139
+
140
+ const composedProxyInputMixin = compose(
141
+ proxyInputMixin,
142
+ createStyleMixin({ componentNameOverride: getComponentName('input-wrapper') }))
143
+
144
+ export { composedProxyInputMixin as proxyInputMixin }
@@ -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,84 @@ const horizontalPaddingRatio = 2;
21
21
  const button = {
22
22
  ...helperTheme,
23
23
 
24
- [vars.cursor]: 'pointer',
24
+ [compVars.fontFamily]: globalRefs.fonts.font1.family,
25
25
 
26
- [vars.borderRadius]: globalRefs.radius.sm,
27
- [vars.borderWidth]: '2px',
28
- [vars.borderStyle]: 'solid',
29
- [vars.borderColor]: 'transparent',
26
+ [compVars.cursor]: 'pointer',
30
27
 
31
- [vars.gap]: '0.25em',
28
+ [compVars.borderRadius]: globalRefs.radius.sm,
29
+ [compVars.borderWidth]: '2px',
30
+ [compVars.borderStyle]: 'solid',
31
+ [compVars.borderColor]: 'transparent',
32
32
 
33
- [vars.verticalPadding]: `calc(var(${vars.fontSize}) / ${verticalPaddingRatio})`,
34
- [vars.horizontalPadding]: `calc(var(${vars.fontSize}) / ${horizontalPaddingRatio})`,
33
+ [compVars.labelSpacing]: '0.25em',
34
+
35
+ [compVars.verticalPadding]: `calc(var(${compVars.fontSize}) / ${verticalPaddingRatio})`,
36
+ [compVars.horizontalPadding]: `calc(var(${compVars.fontSize}) / ${horizontalPaddingRatio})`,
37
+
38
+ [compVars.outlineWidth]: globals.border.sm,
39
+ [compVars.outlineOffset]: '1px',
40
+ [compVars.outlineStyle]: 'solid',
41
+ [compVars.outlineColor]: 'transparent',
35
42
 
36
43
  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' }
44
+ xs: { [compVars.fontSize]: '8px' },
45
+ sm: { [compVars.fontSize]: '10px' },
46
+ md: { [compVars.fontSize]: '14px' },
47
+ lg: { [compVars.fontSize]: '20px' },
48
+ xl: { [compVars.fontSize]: '25px' }
42
49
  },
43
50
 
44
51
  _fullWidth: {
45
- [vars.width]: '100%'
52
+ [compVars.hostWidth]: '100%'
46
53
  },
47
54
 
48
55
  _loading: {
49
- [vars.cursor]: 'wait'
56
+ [compVars.cursor]: 'wait'
50
57
  },
51
58
 
52
59
  variant: {
53
60
  contained: {
54
- [vars.color]: helperRefs.contrast,
55
- [vars.backgroundColor]: helperRefs.main,
61
+ [compVars.labelTextColor]: helperRefs.contrast,
62
+ [compVars.backgroundColor]: helperRefs.main,
56
63
  _hover: {
57
- [vars.backgroundColor]: helperRefs.dark
64
+ [compVars.backgroundColor]: helperRefs.dark
58
65
  },
59
66
  _active: {
60
- [vars.backgroundColor]: helperRefs.dark
67
+ [compVars.backgroundColor]: helperRefs.dark
61
68
  }
62
69
  },
63
70
 
64
71
  outline: {
65
- [vars.color]: helperRefs.main,
66
- [vars.borderColor]: 'currentColor',
72
+ [compVars.labelTextColor]: helperRefs.main,
73
+ [compVars.borderColor]: 'currentColor',
67
74
  _hover: {
68
- [vars.color]: helperRefs.dark,
75
+ [compVars.labelTextColor]: helperRefs.dark,
69
76
  },
70
77
  _active: {
71
- [vars.color]: helperRefs.light,
78
+ [compVars.labelTextColor]: helperRefs.light,
72
79
  }
73
80
  },
74
81
 
75
82
  link: {
76
- [vars.color]: helperRefs.main,
83
+ [compVars.labelTextColor]: helperRefs.main,
77
84
  _hover: {
78
- [vars.color]: helperRefs.main,
79
- [vars.textDecoration]: 'underline'
85
+ [compVars.labelTextColor]: helperRefs.main,
86
+ [compVars.labelTextDecoration]: 'underline'
80
87
  },
81
88
  _active: {
82
- [vars.color]: helperRefs.dark
89
+ [compVars.labelTextColor]: helperRefs.dark
83
90
  }
84
91
  }
92
+ },
93
+
94
+ _focused: {
95
+ [compVars.outlineColor]: globals.colors.surface.main,
85
96
  }
86
97
  };
87
98
 
88
99
  export default button;
100
+
101
+ export const vars = {
102
+ ...compVars,
103
+ ...helperVars
104
+ };
@@ -1,64 +1,36 @@
1
1
  import globals from '../globals';
2
2
  import { getThemeRefs } from '../../helpers/themeHelpers';
3
3
  import { CheckboxClass } from '../../components/boolean-fields/descope-checkbox/CheckboxClass';
4
+ import { refs } from './inputWrapper';
4
5
 
5
6
  const globalRefs = getThemeRefs(globals);
6
7
  const vars = CheckboxClass.cssVarList;
7
8
 
8
9
  const checkbox = {
9
- [vars.checkboxBackgroundColor]: globalRefs.colors.surface.main,
10
- [vars.cursor]: 'pointer',
11
-
12
- [vars.checkboxRadius]: globalRefs.radius.xs,
13
- [vars.checkboxSize]: '2em',
14
-
15
- [vars.labelTextColor]: globalRefs.colors.surface.contrast,
16
- [vars.labelMargin]: '0.5em',
10
+ [vars.hostWidth]: refs.width,
11
+ [vars.fontSize]: refs.fontSize,
12
+ [vars.fontFamily]: refs.fontFamily,
13
+ [vars.labelTextColor]: refs.labelTextColor,
14
+ [vars.labelRequiredIndicator]: refs.requiredIndicator,
17
15
  [vars.labelFontWeight]: '400',
18
-
19
- size: {
20
- xs: {
21
- [vars.labelFontSize]: '8px',
22
- },
23
- sm: {
24
- [vars.labelFontSize]: '10px',
25
- },
26
- md: {
27
- [vars.labelFontSize]: '14px',
28
- },
29
- lg: {
30
- [vars.labelFontSize]: '20px',
31
- },
32
- xl: {
33
- [vars.labelFontSize]: '25px',
34
- }
35
- },
36
-
37
- _fullWidth: {
38
- [vars.width]: '100%',
39
- },
16
+ [vars.labelSpacing]: '0.5em',
17
+ [vars.inputOutlineWidth]: refs.outlineWidth,
18
+ [vars.inputOutlineOffset]: refs.outlineOffset,
19
+ [vars.inputOutlineColor]: refs.outlineColor,
20
+ [vars.inputOutlineStyle]: refs.outlineStyle,
21
+ [vars.inputBorderRadius]: refs.borderRadius,
22
+ [vars.inputBackgroundColor]: globalRefs.colors.surface.main,
23
+ [vars.inputSize]: '2em',
40
24
 
41
25
  _checked: {
42
- [vars.checkboxBackgroundColor]: globalRefs.colors.primary.main,
43
- [vars.checkmarkTextColor]: globalRefs.colors.primary.contrast,
26
+ [vars.inputBackgroundColor]: globalRefs.colors.primary.main,
27
+ [vars.inputValueTextColor]: globalRefs.colors.primary.contrast,
44
28
  },
45
29
 
46
30
  _disabled: {
47
- [vars.checkboxBackgroundColor]: globalRefs.colors.surface.main,
31
+ [vars.inputBackgroundColor]: globalRefs.colors.surface.main,
48
32
  },
49
-
50
- _focused: {
51
- [vars.checkboxOutlineWidth]: '2px',
52
- [vars.checkboxOutlineOffset]: '1px',
53
- [vars.checkboxOutlineColor]: globalRefs.colors.primary.main,
54
- [vars.checkboxOutlineStyle]: 'solid'
55
- },
56
-
57
- _invalid: {
58
- [vars.checkboxOutlineColor]: globalRefs.colors.error.main,
59
- [vars.labelTextColor]: globalRefs.colors.error.main
60
- },
61
-
62
33
  };
63
34
 
64
35
  export default checkbox;
36
+ export { vars }
@@ -1,55 +1,44 @@
1
1
  import globals from '../globals';
2
2
  import { ComboBoxClass } from '../../components/descope-combo-box/ComboBoxClass';
3
3
  import { getThemeRefs } from '../../helpers/themeHelpers';
4
+ import { refs } from './inputWrapper';
4
5
 
5
6
  const globalRefs = getThemeRefs(globals);
6
-
7
7
  const vars = ComboBoxClass.cssVarList;
8
8
 
9
9
  export const comboBox = {
10
- [vars.borderColor]: globalRefs.colors.surface.main,
11
- [vars.borderWidth]: '1px',
12
- [vars.borderStyle]: 'solid',
13
- [vars.cursor]: 'pointer',
14
- [vars.padding]: '0',
15
- [vars.placeholderColor]: globalRefs.colors.surface.main,
16
- [vars.toggleColor]: globalRefs.colors.surface.contrast,
17
- [vars.toggleCursor]: 'pointer',
18
- [vars.inputBackgroundColor]: globalRefs.colors.surface.light,
19
- [vars.padding]: `0 ${globalRefs.spacing.xs}`,
20
-
21
- [vars.height]: '2em',
22
-
23
- size: {
24
- xs: {
25
- [vars.fontSize]: '8px',
26
- },
27
- sm: {
28
- [vars.fontSize]: '10px',
29
- },
30
- md: {
31
- [vars.fontSize]: '14px',
32
- },
33
- lg: {
34
- [vars.fontSize]: '20px',
35
- },
36
- xl: {
37
- [vars.fontSize]: '25px',
38
- }
39
- },
10
+ [vars.hostWidth]: refs.width,
11
+ [vars.fontSize]: refs.fontSize,
12
+ [vars.fontFamily]: refs.fontFamily,
13
+ [vars.labelTextColor]: refs.labelTextColor,
14
+ [vars.inputBorderColor]: refs.borderColor,
15
+ [vars.inputBorderWidth]: refs.borderWidth,
16
+ [vars.inputBorderStyle]: refs.borderStyle,
17
+ [vars.inputBorderRadius]: refs.borderRadius,
18
+ [vars.inputOutlineColor]: refs.outlineColor,
19
+ [vars.inputOutlineOffset]: refs.outlineOffset,
20
+ [vars.inputOutlineWidth]: refs.outlineWidth,
21
+ [vars.inputOutlineStyle]: refs.outlineStyle,
22
+ [vars.labelRequiredIndicator]: refs.requiredIndicator,
23
+ [vars.inputValueTextColor]: refs.valueTextColor,
24
+ [vars.inputPlaceholderTextColor]: refs.placeholderTextColor,
25
+ [vars.inputBackgroundColor]: refs.backgroundColor,
26
+ [vars.inputHeight]: refs.inputHeight,
27
+ [vars.inputDropdownButtonColor]: globalRefs.colors.surface.contrast,
28
+ [vars.inputDropdownButtonCursor]: 'pointer',
40
29
 
41
30
  _readonly: {
42
- [vars.toggleCursor]: 'default',
31
+ [vars.inputDropdownButtonCursor]: 'default'
43
32
  },
44
33
 
45
34
  _invalid: {
46
- [vars.borderColor]: globalRefs.colors.error.main,
47
- [vars.placeholderColor]: globalRefs.colors.error.light,
48
- [vars.toggleColor]: globalRefs.colors.error.main,
35
+ [vars.inputDropdownButtonColor]: globalRefs.colors.error.main
49
36
  },
37
+
50
38
  // [vars.overlayCursor]: 'pointer',
51
39
  // [vars.overlayBackground]: globalRefs.colors.surface.light,
52
40
  // [vars.overlayBorder]: `2px solid red`,
53
41
  };
54
42
 
55
43
  export default comboBox;
44
+ export { vars }