@descope/web-components-ui 1.0.45 → 1.0.47

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 (36) hide show
  1. package/dist/index.esm.js +235 -137
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/umd/599.js +1 -1
  4. package/dist/umd/63.js +1 -1
  5. package/dist/umd/938.js +1 -1
  6. package/dist/umd/descope-button-index-js.js +1 -1
  7. package/dist/umd/descope-checkbox-index-js.js +1 -1
  8. package/dist/umd/descope-email-field-index-js.js +1 -1
  9. package/dist/umd/descope-logo-index-js.js +1 -0
  10. package/dist/umd/descope-number-field-index-js.js +1 -1
  11. package/dist/umd/descope-passcode-index-js.js +1 -0
  12. package/dist/umd/descope-password-field-index-js.js +1 -1
  13. package/dist/umd/descope-switch-toggle-index-js.js +1 -1
  14. package/dist/umd/descope-text-area-index-js.js +1 -1
  15. package/dist/umd/index.js +1 -1
  16. package/package.json +1 -1
  17. package/src/components/descope-button/Button.js +5 -2
  18. package/src/components/descope-checkbox/Checkbox.js +8 -3
  19. package/src/components/descope-container/Container.js +1 -1
  20. package/src/components/descope-email-field/EmailField.js +3 -0
  21. package/src/components/descope-logo/Logo.js +57 -0
  22. package/src/components/descope-logo/index.js +5 -0
  23. package/src/components/descope-number-field/NumberField.js +3 -0
  24. package/src/components/descope-passcode/Passcode.js +252 -0
  25. package/src/components/descope-passcode/index.js +79 -0
  26. package/src/components/descope-password-field/PasswordField.js +3 -0
  27. package/src/components/descope-switch-toggle/SwitchToggle.js +7 -2
  28. package/src/components/descope-text-area/TextArea.js +7 -2
  29. package/src/components/descope-text-field/TextField.js +5 -1
  30. package/src/componentsHelpers/createStyleMixin/helpers.js +1 -1
  31. package/src/componentsHelpers/createStyleMixin/index.js +3 -3
  32. package/src/componentsHelpers/inputMixin.js +19 -4
  33. package/src/dev/index.js +2 -7
  34. package/src/theme/components/index.js +3 -1
  35. package/src/theme/components/logo.js +9 -0
  36. package/src/theme/components/input.js +0 -106
@@ -1,3 +1,15 @@
1
+ const propertyObserver = (src, target, property) => {
2
+ Object.defineProperty(src, property, {
3
+ set: function (v) {
4
+ return target[property] = v
5
+ },
6
+ get: function () {
7
+ return target[property]
8
+ },
9
+ configurable: true
10
+ });
11
+ }
12
+
1
13
  export const inputMixin = (superclass) =>
2
14
  class InputMixinClass extends superclass {
3
15
  static get formAssociated() {
@@ -17,6 +29,7 @@ export const inputMixin = (superclass) =>
17
29
  }
18
30
 
19
31
  connectedCallback() {
32
+ this.baseEle = this.shadowRoot.querySelector(this.baseSelector)
20
33
  super.connectedCallback?.();
21
34
 
22
35
  // this is needed in order to make sure the form input validation is working
@@ -24,13 +37,15 @@ export const inputMixin = (superclass) =>
24
37
  this.setAttribute('tabindex', 0);
25
38
  }
26
39
 
27
- // vaadin does not expose all those validation attributes so we need to take it from the input
28
- // https://github.com/vaadin/web-components/issues/1177
29
40
  const input =
30
- this.proxyElement.querySelector('input') ||
31
- this.proxyElement.querySelector('textarea');
41
+ this.baseEle.querySelector('input') ||
42
+ this.baseEle.querySelector('textarea');
32
43
  if (!input) throw Error('no input was found');
33
44
 
45
+ // sync properties
46
+ propertyObserver(this, input, 'value')
47
+ this.setSelectionRange = input.setSelectionRange.bind(input)
48
+
34
49
  this.checkValidity = () => input.checkValidity();
35
50
  this.reportValidity = () => input.reportValidity();
36
51
  this.validity = input.validity;
package/src/dev/index.js CHANGED
@@ -1,7 +1,2 @@
1
- import theme from '../theme';
2
- import { themeToStyle } from '../themeHelpers';
3
-
4
- // this file is used for exposing stuff to the dev env only
5
-
6
- export const getDefaultThemeStyles = (themeName) =>
7
- themeToStyle(theme, themeName);
1
+ export {default as defaultTheme} from '../theme';
2
+ export { themeToStyle } from '../themeHelpers';
@@ -7,6 +7,7 @@ import textArea from './textArea';
7
7
  import checkbox from './checkbox';
8
8
  import switchToggle from './switchToggle';
9
9
  import container from './container';
10
+ import logo from './logo';
10
11
 
11
12
  export default {
12
13
  button,
@@ -17,5 +18,6 @@ export default {
17
18
  textArea,
18
19
  checkbox,
19
20
  switchToggle,
20
- container
21
+ container,
22
+ logo
21
23
  };
@@ -0,0 +1,9 @@
1
+ import Logo from "../../components/descope-logo/Logo";
2
+
3
+ const vars = Logo.cssVarList
4
+
5
+ const logo = {
6
+ [vars.fallbackUrl]: 'url(https://content.app.descope.com/assets/flows/noLogoPlaceholder.svg)'
7
+ };
8
+
9
+ export default logo;
@@ -1,106 +0,0 @@
1
- import {
2
- getComponentName,
3
- createStyleMixin,
4
- draggableMixin,
5
- createProxy,
6
- inputMixin,
7
- compose,
8
- componentNameValidationMixin
9
- } from '../../componentsHelpers';
10
- import { matchHostStyle } from '../../componentsHelpers/createStyleMixin/helpers';
11
-
12
- export const componentName = getComponentName('text-field');
13
-
14
- const selectors = {
15
- label: '::part(label)',
16
- input: '::part(input-field)',
17
- readOnlyInput: '[readonly]::part(input-field)::after',
18
- placeholder: '> input:placeholder-shown'
19
- };
20
-
21
- let overrides = ``;
22
-
23
- export const textFieldMappings = {
24
- color: { selector: selectors.input },
25
- backgroundColor: { selector: selectors.input },
26
- width: [matchHostStyle()],
27
- color: { selector: selectors.input },
28
- borderColor: [
29
- { selector: selectors.input },
30
- { selector: selectors.readOnlyInput }
31
- ],
32
- borderWidth: [
33
- { selector: selectors.input },
34
- { selector: selectors.readOnlyInput }
35
- ],
36
- borderStyle: [
37
- { selector: selectors.input },
38
- { selector: selectors.readOnlyInput }
39
- ],
40
- borderRadius: { selector: selectors.input },
41
- boxShadow: { selector: selectors.input },
42
- fontSize: {},
43
- height: { selector: selectors.input },
44
- padding: { selector: selectors.input },
45
- outline: { selector: selectors.input },
46
- outlineOffset: { selector: selectors.input },
47
-
48
- placeholderColor: { selector: selectors.placeholder, property: 'color' }
49
- // borderWidthReadOnly: [borderWidth('[readonly]::part(input-field)::after')]
50
- };
51
-
52
- const TextField = compose(
53
- createStyleMixin({
54
- mappings: textFieldMappings
55
- }),
56
- draggableMixin,
57
- inputMixin,
58
- componentNameValidationMixin
59
- )(
60
- createProxy({
61
- slots: ['prefix', 'suffix'],
62
- wrappedEleName: 'vaadin-text-field',
63
- style: () => overrides,
64
- excludeAttrsSync: ['tabindex'],
65
- componentName
66
- })
67
- );
68
-
69
- overrides = `
70
- vaadin-text-field {
71
- margin: 0;
72
- padding: 0;
73
- }
74
- vaadin-text-field::part(input-field) {
75
- overflow: hidden;
76
- }
77
- vaadin-text-field[readonly] > input:placeholder-shown {
78
- opacity: 1;
79
- }
80
- vaadin-text-field input:-webkit-autofill,
81
- vaadin-text-field input:-webkit-autofill::first-line,
82
- vaadin-text-field input:-webkit-autofill:hover,
83
- vaadin-text-field input:-webkit-autofill:active,
84
- vaadin-text-field input:-webkit-autofill:focus {
85
- -webkit-text-fill-color: var(${TextField.cssVarList.color});
86
- box-shadow: 0 0 0 var(${TextField.cssVarList.height}) var(${TextField.cssVarList.backgroundColor}) inset;
87
- }
88
- vaadin-text-field > label,
89
- vaadin-text-field::part(input-field) {
90
- cursor: pointer;
91
- color: var(${TextField.cssVarList.color});
92
- }
93
- vaadin-text-field::part(input-field):focus {
94
- cursor: text;
95
- }
96
- vaadin-text-field[required]::part(required-indicator)::after {
97
- font-size: "12px";
98
- content: "*";
99
- color: var(${TextField.cssVarList.color});
100
- }
101
- vaadin-text-field[readonly]::part(input-field)::after {
102
- border: 0 solid;
103
- }
104
- `;
105
-
106
- export default TextField;