@descope/web-components-ui 1.0.39 → 1.0.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/dist/cjs/index.cjs.js +35 -18
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +1128 -481
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/101.js +148 -0
  6. package/dist/umd/208.js +2 -0
  7. package/dist/umd/208.js.LICENSE.txt +5 -0
  8. package/dist/umd/211.js +312 -0
  9. package/dist/umd/211.js.LICENSE.txt +5 -0
  10. package/dist/umd/233.js +573 -0
  11. package/dist/umd/{511.js.LICENSE.txt → 233.js.LICENSE.txt} +0 -6
  12. package/dist/umd/422.js +2 -0
  13. package/dist/umd/422.js.LICENSE.txt +5 -0
  14. package/dist/umd/437.js +19 -0
  15. package/dist/umd/437.js.LICENSE.txt +5 -0
  16. package/dist/umd/513.js +1 -0
  17. package/dist/umd/515.js +202 -0
  18. package/dist/umd/515.js.LICENSE.txt +11 -0
  19. package/dist/umd/54.js +4 -4
  20. package/dist/umd/56.js +48 -0
  21. package/dist/umd/56.js.LICENSE.txt +5 -0
  22. package/dist/umd/599.js +1 -1
  23. package/dist/umd/63.js +1 -0
  24. package/dist/umd/725.js +37 -0
  25. package/dist/umd/725.js.LICENSE.txt +11 -0
  26. package/dist/umd/729.js +1 -1
  27. package/dist/umd/767.js +2 -0
  28. package/dist/umd/{9.js.LICENSE.txt → 767.js.LICENSE.txt} +0 -6
  29. package/dist/umd/786.js +2 -0
  30. package/dist/umd/786.js.LICENSE.txt +17 -0
  31. package/dist/umd/789.js +1 -0
  32. package/dist/umd/806.js +109 -0
  33. package/dist/umd/806.js.LICENSE.txt +5 -0
  34. package/dist/umd/938.js +1 -0
  35. package/dist/umd/97.js +1 -1
  36. package/dist/umd/descope-button-index-js.js +1 -1
  37. package/dist/umd/descope-checkbox-index-js.js +1 -0
  38. package/dist/umd/descope-combo-index-js.js +1 -1
  39. package/dist/umd/descope-container-index-js.js +1 -1
  40. package/dist/umd/descope-email-field-index-js.js +1 -0
  41. package/dist/umd/descope-number-field-index-js.js +1 -0
  42. package/dist/umd/descope-password-field-index-js.js +1 -0
  43. package/dist/umd/descope-switch-toggle-index-js.js +1 -0
  44. package/dist/umd/descope-text-area-index-js.js +1 -0
  45. package/dist/umd/descope-text-field-index-js.js +1 -1
  46. package/dist/umd/index.js +1 -1
  47. package/package.json +9 -2
  48. package/src/components/descope-button/Button.js +90 -30
  49. package/src/components/descope-button/index.js +3 -3
  50. package/src/components/descope-checkbox/Checkbox.js +33 -0
  51. package/src/components/descope-checkbox/index.js +6 -0
  52. package/src/components/descope-combo/index.js +12 -12
  53. package/src/components/descope-container/Container.js +57 -51
  54. package/src/components/descope-container/index.js +1 -1
  55. package/src/components/descope-date-picker/index.js +13 -7
  56. package/src/components/descope-email-field/EmailField.js +72 -0
  57. package/src/components/descope-email-field/index.js +6 -0
  58. package/src/components/descope-number-field/NumberField.js +72 -0
  59. package/src/components/descope-number-field/index.js +6 -0
  60. package/src/components/descope-password-field/PasswordField.js +79 -0
  61. package/src/components/descope-password-field/index.js +6 -0
  62. package/src/components/descope-switch-toggle/SwitchToggle.js +81 -0
  63. package/src/components/descope-switch-toggle/index.js +6 -0
  64. package/src/components/descope-text-area/TextArea.js +66 -0
  65. package/src/components/descope-text-area/index.js +6 -0
  66. package/src/components/descope-text-field/TextField.js +98 -28
  67. package/src/components/descope-text-field/index.js +3 -3
  68. package/src/componentsHelpers/componentNameValidationMixin.js +21 -17
  69. package/src/componentsHelpers/createProxy/helpers.js +31 -27
  70. package/src/componentsHelpers/createProxy/index.js +27 -17
  71. package/src/componentsHelpers/createStyleMixin/helpers.js +65 -47
  72. package/src/componentsHelpers/createStyleMixin/index.js +64 -55
  73. package/src/componentsHelpers/draggableMixin.js +25 -26
  74. package/src/componentsHelpers/index.js +12 -9
  75. package/src/componentsHelpers/inputMixin.js +38 -37
  76. package/src/constants.js +1 -1
  77. package/src/dev/index.js +4 -3
  78. package/src/helpers.js +8 -6
  79. package/src/index.cjs.js +1 -1
  80. package/src/index.js +16 -8
  81. package/src/index.umd.js +11 -5
  82. package/src/theme/components/button.js +32 -21
  83. package/src/theme/components/checkbox.js +9 -0
  84. package/src/theme/components/container.js +32 -27
  85. package/src/theme/components/emailField.js +8 -0
  86. package/src/theme/components/index.js +19 -7
  87. package/src/theme/components/input.js +106 -0
  88. package/src/theme/components/numberField.js +8 -0
  89. package/src/theme/components/passwordField.js +11 -0
  90. package/src/theme/components/switchToggle.js +10 -0
  91. package/src/theme/components/textArea.js +44 -0
  92. package/src/theme/components/textField.js +69 -45
  93. package/src/theme/globals.js +27 -26
  94. package/src/theme/index.js +2 -2
  95. package/src/themeHelpers/index.js +45 -30
  96. package/src/themeHelpers/processColors.js +10 -7
  97. package/dist/umd/221.js +0 -37
  98. package/dist/umd/511.js +0 -573
  99. package/dist/umd/9.js +0 -312
  100. /package/dist/umd/{221.js.LICENSE.txt → 101.js.LICENSE.txt} +0 -0
@@ -1,57 +1,63 @@
1
- import { getComponentName, createStyleMixin, draggableMixin, compose, componentNameValidationMixin } from "../../componentsHelpers";
1
+ import {
2
+ getComponentName,
3
+ createStyleMixin,
4
+ draggableMixin,
5
+ compose,
6
+ componentNameValidationMixin
7
+ } from '../../componentsHelpers';
2
8
 
3
- export const componentName = getComponentName("container");
9
+ export const componentName = getComponentName('container');
4
10
 
5
11
  class RawContainer extends HTMLElement {
6
- static get componentName() {
7
- return componentName
8
- }
9
- constructor() {
10
- super();
11
- const template = document.createElement('template');
12
- template.innerHTML = `<slot></slot>`;
13
-
14
- this.attachShadow({ mode: 'open' });
15
- this.shadowRoot.appendChild(template.content.cloneNode(true));
16
-
17
- this.baseSelector = ':host > slot'
18
- }
12
+ static get componentName() {
13
+ return componentName;
14
+ }
15
+ constructor() {
16
+ super();
17
+ const template = document.createElement('template');
18
+ template.innerHTML = `<slot></slot>`;
19
+
20
+ this.attachShadow({ mode: 'open' });
21
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
22
+
23
+ this.baseSelector = ':host > slot';
24
+ }
19
25
  }
20
26
 
21
27
  const Container = compose(
22
- createStyleMixin({
23
- // todo: do we want to change the mapping structure to this? ['aa', 'aaa', {'color': [{ selector: '::part(label)' }]}],
24
- mappings: {
25
- 'height': {},
26
- 'width': {},
27
-
28
- 'verticalPadding': [
29
- { property: 'padding-top' },
30
- { property: 'padding-bottom' }
31
- ],
32
- 'horizontalPadding': [
33
- { property: 'padding-left' },
34
- { property: 'padding-right' }
35
- ],
36
-
37
- 'display': {},
38
- 'flexDirection': {},
39
- 'justifyContent': {},
40
- 'alignItems': {},
41
- 'gap': {},
42
-
43
- 'backgroundColor': {},
44
- 'borderRadius': {},
45
-
46
- 'borderColor': {},
47
- 'borderStyle': {},
48
- 'borderWidth': {},
49
-
50
- 'boxShadow': {},
51
- },
52
- }),
53
- draggableMixin,
54
- componentNameValidationMixin,
55
- )(RawContainer)
56
-
57
- export default Container
28
+ createStyleMixin({
29
+ // todo: do we want to change the mapping structure to this? ['aa', 'aaa', {'color': [{ selector: '::part(label)' }]}],
30
+ mappings: {
31
+ height: {},
32
+ width: {},
33
+
34
+ verticalPadding: [
35
+ { property: 'padding-top' },
36
+ { property: 'padding-bottom' }
37
+ ],
38
+ horizontalPadding: [
39
+ { property: 'padding-left' },
40
+ { property: 'padding-right' }
41
+ ],
42
+
43
+ display: {},
44
+ flexDirection: {},
45
+ justifyContent: {},
46
+ alignItems: {},
47
+ gap: {},
48
+
49
+ backgroundColor: {},
50
+ borderRadius: {},
51
+
52
+ borderColor: {},
53
+ borderStyle: {},
54
+ borderWidth: {},
55
+
56
+ boxShadow: {}
57
+ }
58
+ }),
59
+ draggableMixin,
60
+ componentNameValidationMixin
61
+ )(RawContainer);
62
+
63
+ export default Container;
@@ -2,4 +2,4 @@ import Container, { componentName } from './Container';
2
2
 
3
3
  customElements.define(componentName, Container);
4
4
 
5
- export { Container }
5
+ export { Container };
@@ -1,7 +1,13 @@
1
- import "@vaadin/date-picker";
2
- import { getComponentName, draggableMixin, createProxy, compose, componentNameValidationMixin } from "../../componentsHelpers";
1
+ import '@vaadin/date-picker';
2
+ import {
3
+ getComponentName,
4
+ draggableMixin,
5
+ createProxy,
6
+ compose,
7
+ componentNameValidationMixin
8
+ } from '../../componentsHelpers';
3
9
 
4
- const componentName = getComponentName("date-picker");
10
+ const componentName = getComponentName('date-picker');
5
11
 
6
12
  const DatePicker = compose(
7
13
  draggableMixin,
@@ -9,12 +15,12 @@ const DatePicker = compose(
9
15
  )(
10
16
  createProxy({
11
17
  componentName,
12
- slots: ["prefix", "suffix"],
13
- wrappedEleName: "vaadin-date-picker",
14
- style: ``,
18
+ slots: ['prefix', 'suffix'],
19
+ wrappedEleName: 'vaadin-date-picker',
20
+ style: ``
15
21
  })
16
22
  );
17
23
 
18
24
  customElements.define(componentName, DatePicker);
19
25
 
20
- export { DatePicker }
26
+ export { DatePicker };
@@ -0,0 +1,72 @@
1
+ import {
2
+ getComponentName,
3
+ createStyleMixin,
4
+ draggableMixin,
5
+ createProxy,
6
+ inputMixin,
7
+ compose,
8
+ componentNameValidationMixin
9
+ } from '../../componentsHelpers';
10
+ import { textFieldMappings } from '../descope-text-field/TextField';
11
+
12
+ export const componentName = getComponentName('email-field');
13
+
14
+ let overrides = ``;
15
+
16
+ const EmailField = compose(
17
+ createStyleMixin({
18
+ mappings: {
19
+ ...textFieldMappings
20
+ }
21
+ }),
22
+ draggableMixin,
23
+ inputMixin,
24
+ componentNameValidationMixin
25
+ )(
26
+ createProxy({
27
+ slots: ['suffix'],
28
+ wrappedEleName: 'vaadin-email-field',
29
+ style: () => overrides,
30
+ excludeAttrsSync: ['tabindex'],
31
+ componentName
32
+ })
33
+ );
34
+
35
+ overrides = `
36
+ vaadin-email-field {
37
+ margin: 0;
38
+ padding: 0;
39
+ }
40
+ vaadin-email-field::part(input-field) {
41
+ overflow: hidden;
42
+ }
43
+ vaadin-email-field[readonly] > input:placeholder-shown {
44
+ opacity: 1;
45
+ }
46
+ vaadin-email-field input:-webkit-autofill,
47
+ vaadin-email-field input:-webkit-autofill::first-line,
48
+ vaadin-email-field input:-webkit-autofill:hover,
49
+ vaadin-email-field input:-webkit-autofill:active,
50
+ vaadin-email-field input:-webkit-autofill:focus {
51
+ -webkit-text-fill-color: var(${EmailField.cssVarList.color});
52
+ box-shadow: 0 0 0 var(${EmailField.cssVarList.height}) var(${EmailField.cssVarList.backgroundColor}) inset;
53
+ }
54
+ vaadin-email-field > label,
55
+ vaadin-email-field::part(input-field) {
56
+ cursor: pointer;
57
+ color: var(${EmailField.cssVarList.color});
58
+ }
59
+ vaadin-email-field::part(input-field):focus {
60
+ cursor: text;
61
+ }
62
+ vaadin-email-field[required]::part(required-indicator)::after {
63
+ font-size: "12px";
64
+ content: "*";
65
+ color: var(${EmailField.cssVarList.color});
66
+ }
67
+ vaadin-email-field[readonly]::part(input-field)::after {
68
+ border: 0 solid;
69
+ }
70
+ `;
71
+
72
+ export default EmailField;
@@ -0,0 +1,6 @@
1
+ import '@vaadin/email-field';
2
+ import EmailField, { componentName } from './EmailField';
3
+
4
+ customElements.define(componentName, EmailField);
5
+
6
+ export { EmailField };
@@ -0,0 +1,72 @@
1
+ import {
2
+ getComponentName,
3
+ createStyleMixin,
4
+ draggableMixin,
5
+ createProxy,
6
+ inputMixin,
7
+ compose,
8
+ componentNameValidationMixin
9
+ } from '../../componentsHelpers';
10
+ import { textFieldMappings } from '../descope-text-field/TextField';
11
+
12
+ export const componentName = getComponentName('number-field');
13
+
14
+ let overrides = ``;
15
+
16
+ const NumberField = compose(
17
+ createStyleMixin({
18
+ mappings: {
19
+ ...textFieldMappings
20
+ }
21
+ }),
22
+ draggableMixin,
23
+ inputMixin,
24
+ componentNameValidationMixin
25
+ )(
26
+ createProxy({
27
+ slots: ['prefix', 'suffix'],
28
+ wrappedEleName: 'vaadin-number-field',
29
+ style: () => overrides,
30
+ excludeAttrsSync: ['tabindex'],
31
+ componentName
32
+ })
33
+ );
34
+
35
+ overrides = `
36
+ vaadin-number-field {
37
+ margin: 0;
38
+ padding: 0;
39
+ }
40
+ vaadin-number-field::part(input-field) {
41
+ overflow: hidden;
42
+ }
43
+ vaadin-number-field[readonly] > input:placeholder-shown {
44
+ opacity: 1;
45
+ }
46
+ vaadin-number-field input:-webkit-autofill,
47
+ vaadin-number-field input:-webkit-autofill::first-line,
48
+ vaadin-number-field input:-webkit-autofill:hover,
49
+ vaadin-number-field input:-webkit-autofill:active,
50
+ vaadin-number-field input:-webkit-autofill:focus {
51
+ -webkit-text-fill-color: var(${NumberField.cssVarList.color});
52
+ box-shadow: 0 0 0 var(${NumberField.cssVarList.height}) var(${NumberField.cssVarList.backgroundColor}) inset;
53
+ }
54
+ vaadin-number-field > label,
55
+ vaadin-number-field::part(input-field) {
56
+ cursor: pointer;
57
+ color: var(${NumberField.cssVarList.color});
58
+ }
59
+ vaadin-number-field::part(input-field):focus {
60
+ cursor: text;
61
+ }
62
+ vaadin-number-field[required]::part(required-indicator)::after {
63
+ font-size: "12px";
64
+ content: "*";
65
+ color: var(${NumberField.cssVarList.color});
66
+ }
67
+ vaadin-number-field[readonly]::part(input-field)::after {
68
+ border: 0 solid;
69
+ }
70
+ `;
71
+
72
+ export default NumberField;
@@ -0,0 +1,6 @@
1
+ import '@vaadin/number-field';
2
+ import NumberField, { componentName } from './NumberField';
3
+
4
+ customElements.define(componentName, NumberField);
5
+
6
+ export { NumberField };
@@ -0,0 +1,79 @@
1
+ import {
2
+ getComponentName,
3
+ createStyleMixin,
4
+ draggableMixin,
5
+ createProxy,
6
+ inputMixin,
7
+ compose,
8
+ componentNameValidationMixin
9
+ } from '../../componentsHelpers';
10
+ import { textFieldMappings } from '../descope-text-field/TextField';
11
+
12
+ export const componentName = getComponentName('password-field');
13
+
14
+ let overrides = ``;
15
+
16
+ const PasswordField = compose(
17
+ createStyleMixin({
18
+ mappings: {
19
+ ...textFieldMappings,
20
+ // todo: override cursor from lumo
21
+ revealCursor: [
22
+ {
23
+ selector: '::part(reveal-button)::before',
24
+ property: 'cursor'
25
+ }
26
+ ]
27
+ }
28
+ }),
29
+ draggableMixin,
30
+ inputMixin,
31
+ componentNameValidationMixin
32
+ )(
33
+ createProxy({
34
+ slots: ['suffix'],
35
+ wrappedEleName: 'vaadin-password-field',
36
+ style: () => overrides,
37
+ excludeAttrsSync: ['tabindex'],
38
+ componentName
39
+ })
40
+ );
41
+
42
+ overrides = `
43
+ vaadin-password-field {
44
+ margin: 0;
45
+ padding: 0;
46
+ }
47
+ vaadin-password-field::part(input-field) {
48
+ overflow: hidden;
49
+ }
50
+ vaadin-password-field[readonly] > input:placeholder-shown {
51
+ opacity: 1;
52
+ }
53
+ vaadin-password-field input:-webkit-autofill,
54
+ vaadin-password-field input:-webkit-autofill::first-line,
55
+ vaadin-password-field input:-webkit-autofill:hover,
56
+ vaadin-password-field input:-webkit-autofill:active,
57
+ vaadin-password-field input:-webkit-autofill:focus {
58
+ -webkit-text-fill-color: var(${PasswordField.cssVarList.color});
59
+ box-shadow: 0 0 0 var(${PasswordField.cssVarList.height}) var(${PasswordField.cssVarList.backgroundColor}) inset;
60
+ }
61
+ vaadin-password-field > label,
62
+ vaadin-password-field::part(input-field) {
63
+ cursor: pointer;
64
+ color: var(${PasswordField.cssVarList.color});
65
+ }
66
+ vaadin-password-field::part(input-field):focus {
67
+ cursor: text;
68
+ }
69
+ vaadin-password-field[required]::part(required-indicator)::after {
70
+ font-size: "12px";
71
+ content: "*";
72
+ color: var(${PasswordField.cssVarList.color});
73
+ }
74
+ vaadin-password-field[readonly]::part(input-field)::after {
75
+ border: 0 solid;
76
+ }
77
+ `;
78
+
79
+ export default PasswordField;
@@ -0,0 +1,6 @@
1
+ import '@vaadin/password-field';
2
+ import PasswordField, { componentName } from './PasswordField';
3
+
4
+ customElements.define(componentName, PasswordField);
5
+
6
+ export { PasswordField };
@@ -0,0 +1,81 @@
1
+ import {
2
+ getComponentName,
3
+ createStyleMixin,
4
+ draggableMixin,
5
+ createProxy,
6
+ inputMixin,
7
+ compose,
8
+ componentNameValidationMixin
9
+ } from '../../componentsHelpers';
10
+
11
+ export const componentName = getComponentName('switch-toggle');
12
+
13
+ let overrides = ``;
14
+
15
+ const SwitchToggle = compose(
16
+ createStyleMixin({
17
+ mappings: {
18
+ width: {},
19
+ cursor: [{}, { selector: '> label' }]
20
+ }
21
+ }),
22
+ draggableMixin,
23
+ inputMixin,
24
+ componentNameValidationMixin
25
+ )(
26
+ createProxy({
27
+ slots: [],
28
+ wrappedEleName: 'vaadin-checkbox',
29
+ style: () => overrides,
30
+ excludeAttrsSync: ['tabindex'],
31
+ componentName
32
+ })
33
+ );
34
+
35
+ overrides = `
36
+ :host {
37
+ --margin: 7px;
38
+ --width: var(${SwitchToggle.cssVarList.width});
39
+ --height: calc(var(--width) / 2);
40
+ --radius: var(--height);
41
+ --knobSize: calc(var(--height) - 5px);
42
+ --bgColor: #fff;
43
+ --knobBgColor: #000;
44
+ }
45
+ vaadin-checkbox>label {
46
+ cursor: pointer;
47
+ border: 1px solid;
48
+ text-indent: -99999px;
49
+ display: block;
50
+ position: relative;
51
+ width: var(--width);
52
+ height: var(--height);
53
+ background: var(--bgColor);
54
+ border-radius: var(--radius);
55
+ }
56
+ vaadin-checkbox>label::after {
57
+ content: '';
58
+ position: absolute;
59
+ transition: 0.3s;
60
+ top: var(--margin);
61
+ left: var(--margin);
62
+ width: var(--knobSize);
63
+ height: var(--knobSize);
64
+ background: var(--knobBgColor);
65
+ border-radius: var(--knobSize);
66
+ }
67
+ vaadin-checkbox::part(checkbox) {
68
+ height: 0;
69
+ width: 0;
70
+ visibility: hidden;
71
+ }
72
+ vaadin-checkbox[checked]>label::after {
73
+ transform: translateX(-100%);
74
+ left: calc(100% - var(--margin));
75
+ }
76
+ vaadin-checkbox[active]>label::after {
77
+ width: calc(var(--knobSize) + 15px);
78
+ }
79
+ `;
80
+
81
+ export default SwitchToggle;
@@ -0,0 +1,6 @@
1
+ import '@vaadin/checkbox';
2
+ import SwitchToggle, { componentName } from './SwitchToggle';
3
+
4
+ customElements.define(componentName, SwitchToggle);
5
+
6
+ export { SwitchToggle };
@@ -0,0 +1,66 @@
1
+ import {
2
+ getComponentName,
3
+ createStyleMixin,
4
+ draggableMixin,
5
+ createProxy,
6
+ inputMixin,
7
+ compose,
8
+ componentNameValidationMixin
9
+ } from '../../componentsHelpers';
10
+
11
+ export const componentName = getComponentName('text-area');
12
+
13
+ const selectors = {
14
+ label: '::part(label)',
15
+ input: ':not([disabled])::part(input-field)',
16
+ required: '::part(required-indicator)::after'
17
+ };
18
+
19
+ let overrides = ``;
20
+
21
+ const TextArea = compose(
22
+ createStyleMixin({
23
+ mappings: {
24
+ resize: { selector: '> textarea' },
25
+ color: { selector: selectors.label },
26
+ cursor: {},
27
+ width: {},
28
+ backgroundColor: { selector: selectors.input },
29
+ borderWidth: { selector: selectors.input },
30
+ borderStyle: { selector: selectors.input },
31
+ borderColor: { selector: selectors.input },
32
+ borderRadius: { selector: selectors.input },
33
+ outline: { selector: selectors.input },
34
+ outlineOffset: { selector: selectors.input }
35
+ }
36
+ }),
37
+ draggableMixin,
38
+ inputMixin,
39
+ componentNameValidationMixin
40
+ )(
41
+ createProxy({
42
+ slots: [],
43
+ wrappedEleName: 'vaadin-text-area',
44
+ style: () => overrides,
45
+ excludeAttrsSync: ['tabindex'],
46
+ componentName
47
+ })
48
+ );
49
+
50
+ overrides = `
51
+ vaadin-text-area {
52
+ margin: 0;
53
+ }
54
+ vaadin-text-area > label,
55
+ vaadin-text-area::part(input-field) {
56
+ cursor: pointer;
57
+ }
58
+ vaadin-text-area[focused] input:focus {
59
+ cursor: text;
60
+ }
61
+ vaadin-text-area::part(required-indicator)::after {
62
+ font-size: "12px";
63
+ content: "*";
64
+ }
65
+ `;
66
+ export default TextArea;
@@ -0,0 +1,6 @@
1
+ import '@vaadin/text-area';
2
+ import TextArea, { componentName } from './TextArea';
3
+
4
+ customElements.define(componentName, TextArea);
5
+
6
+ export { TextArea };