@descope/web-components-ui 1.0.233 → 1.0.235

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. package/dist/cjs/index.cjs.js +133 -15
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +212 -84
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/{4513.js → 1721.js} +1 -1
  6. package/dist/umd/2481.js +1 -1
  7. package/dist/umd/3003.js +1 -1
  8. package/dist/umd/3092.js +23 -18
  9. package/dist/umd/322.js +90 -0
  10. package/dist/umd/4201.js +1 -1
  11. package/dist/umd/4226.js +1 -1
  12. package/dist/umd/4447.js +1 -2
  13. package/dist/umd/4803.js +1 -1
  14. package/dist/umd/5345.js +1 -1
  15. package/dist/umd/5517.js +2 -0
  16. package/dist/umd/5806.js +3 -3
  17. package/dist/umd/5977.js +18 -13
  18. package/dist/umd/6091.js +1 -1
  19. package/dist/umd/6542.js +22 -22
  20. package/dist/umd/6770.js +2 -2
  21. package/dist/umd/7531.js +77 -6
  22. package/dist/umd/849.js +744 -0
  23. package/dist/umd/849.js.LICENSE.txt +11 -0
  24. package/dist/umd/8623.js +2 -0
  25. package/dist/umd/8725.js +2 -2
  26. package/dist/umd/{1990.js → 9092.js} +21 -17
  27. package/dist/umd/9211.js +33 -19
  28. package/dist/umd/{7514.js → 9558.js} +128 -110
  29. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  30. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  31. package/dist/umd/descope-button-index-js.js +1 -1
  32. package/dist/umd/descope-button-selection-group-descope-button-selection-group-item-index-js.js +1 -1
  33. package/dist/umd/descope-button-selection-group-index-js.js +1 -1
  34. package/dist/umd/descope-combo-box-index-js.js +1 -1
  35. package/dist/umd/descope-date-picker-index-js.js +1 -1
  36. package/dist/umd/descope-divider-index-js.js +1 -1
  37. package/dist/umd/descope-email-field-index-js.js +1 -1
  38. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  39. package/dist/umd/descope-grid-descope-grid-status-column-index-js.js +1 -1
  40. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +1 -1
  41. package/dist/umd/descope-grid-index-js.js +1 -1
  42. package/dist/umd/descope-link-index-js.js +1 -1
  43. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  44. package/dist/umd/descope-number-field-index-js.js +1 -1
  45. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  46. package/dist/umd/descope-passcode-index-js.js +1 -1
  47. package/dist/umd/descope-text-area-index-js.js +1 -1
  48. package/dist/umd/descope-text-field-index-js.js +1 -1
  49. package/dist/umd/descope-text-index-js.js +1 -1
  50. package/dist/umd/descope-upload-file-index-js.js +1 -1
  51. package/dist/umd/index.js +1 -1
  52. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  53. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  54. package/package.json +14 -13
  55. package/src/components/boolean-fields/commonStyles.js +1 -1
  56. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +7 -2
  57. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +6 -1
  58. package/src/components/descope-button/ButtonClass.js +5 -1
  59. package/src/components/descope-button-selection-group/ButtonSelectionGroupClass.js +3 -0
  60. package/src/components/descope-button-selection-group/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +4 -0
  61. package/src/components/descope-combo-box/ComboBoxClass.js +14 -0
  62. package/src/components/descope-divider/DividerClass.js +4 -0
  63. package/src/components/descope-email-field/EmailFieldClass.js +3 -1
  64. package/src/components/descope-link/LinkClass.js +1 -0
  65. package/src/components/descope-new-password/NewPasswordClass.js +10 -2
  66. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +6 -1
  67. package/src/components/descope-number-field/NumberFieldClass.js +2 -0
  68. package/src/components/descope-passcode/PasscodeClass.js +3 -0
  69. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +5 -0
  70. package/src/components/descope-password/PasswordClass.js +8 -2
  71. package/src/components/descope-text/TextClass.js +1 -0
  72. package/src/components/descope-text-area/TextAreaClass.js +4 -1
  73. package/src/components/descope-text-field/TextFieldClass.js +3 -1
  74. package/src/components/descope-text-field/textFieldMappings.js +1 -0
  75. package/src/components/descope-upload-file/UploadFileClass.js +6 -0
  76. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +4 -2
  77. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +4 -2
  78. package/src/helpers/themeHelpers/resetHelpers.js +28 -0
  79. package/src/theme/components/button.js +1 -0
  80. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroup.js +1 -0
  81. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +1 -0
  82. package/src/theme/components/checkbox.js +1 -0
  83. package/src/theme/components/comboBox.js +3 -0
  84. package/src/theme/components/divider.js +2 -0
  85. package/src/theme/components/emailField.js +1 -0
  86. package/src/theme/components/inputWrapper.js +2 -0
  87. package/src/theme/components/link.js +1 -0
  88. package/src/theme/components/newPassword.js +1 -0
  89. package/src/theme/components/numberField.js +1 -0
  90. package/src/theme/components/passcode.js +1 -0
  91. package/src/theme/components/password.js +1 -0
  92. package/src/theme/components/phoneField.js +1 -0
  93. package/src/theme/components/phoneInputBoxField.js +1 -0
  94. package/src/theme/components/switchToggle.js +1 -0
  95. package/src/theme/components/text.js +1 -0
  96. package/src/theme/components/textArea.js +1 -0
  97. package/src/theme/components/textField.js +1 -0
  98. package/src/theme/components/uploadFile.js +1 -0
  99. package/src/theme/globals.js +3 -0
  100. package/dist/umd/2873.js +0 -738
  101. package/dist/umd/2873.js.LICENSE.txt +0 -21
  102. package/dist/umd/446.js +0 -92
  103. package/dist/umd/729.js +0 -1
  104. package/dist/umd/9629.js +0 -2
  105. package/dist/umd/9671.js +0 -1
  106. /package/dist/umd/{4447.js.LICENSE.txt → 322.js.LICENSE.txt} +0 -0
  107. /package/dist/umd/{446.js.LICENSE.txt → 5517.js.LICENSE.txt} +0 -0
  108. /package/dist/umd/{9629.js.LICENSE.txt → 8623.js.LICENSE.txt} +0 -0
  109. /package/dist/umd/{1990.js.LICENSE.txt → 9092.js.LICENSE.txt} +0 -0
  110. /package/dist/umd/{7514.js.LICENSE.txt → 9558.js.LICENSE.txt} +0 -0
@@ -14,6 +14,7 @@ import {
14
14
  observeChildren,
15
15
  } from '../../helpers/componentHelpers';
16
16
  import {
17
+ resetInputLabelPosition,
17
18
  resetInputCursor,
18
19
  resetInputFieldDefaultWidth,
19
20
  } from '../../helpers/themeHelpers/resetHelpers';
@@ -135,6 +136,7 @@ export const ButtonSelectionGroupClass = compose(
135
136
  createStyleMixin({
136
137
  mappings: {
137
138
  hostWidth: { ...host, property: 'width' },
139
+ hostDirection: { ...host, property: 'direction' },
138
140
  fontFamily: host,
139
141
  labelTextColor: [
140
142
  { ...label, property: 'color' },
@@ -204,6 +206,7 @@ export const ButtonSelectionGroupClass = compose(
204
206
  box-shadow: none;
205
207
  }
206
208
 
209
+ ${resetInputLabelPosition('vaadin-text-field')}
207
210
  ${resetInputCursor('vaadin-text-field')}
208
211
  `,
209
212
  excludeAttrsSync: ['tabindex'],
@@ -75,6 +75,10 @@ class RawSelectItem extends createBaseClass({
75
75
  export const ButtonSelectionGroupItemClass = compose(
76
76
  createStyleMixin({
77
77
  mappings: {
78
+ hostDirection: {
79
+ selector: () => ButtonClass.componentName,
80
+ property: ButtonClass.cssVarList.hostDirection,
81
+ },
78
82
  backgroundColor: {
79
83
  selector: () => ButtonClass.componentName,
80
84
  property: ButtonClass.cssVarList.backgroundColor,
@@ -5,6 +5,7 @@ import {
5
5
  observeChildren,
6
6
  } from '../../helpers/componentHelpers';
7
7
  import {
8
+ resetInputLabelPosition,
8
9
  resetInputCursor,
9
10
  resetInputPlaceholder,
10
11
  resetInputReadonlyStyle,
@@ -266,6 +267,7 @@ export const ComboBoxClass = compose(
266
267
  createStyleMixin({
267
268
  mappings: {
268
269
  hostWidth: { ...host, property: 'width' },
270
+ hostDirection: { ...host, property: 'direction' },
269
271
  // we apply font-size also on the host so we can set its width with em
270
272
  fontSize: [{}, host],
271
273
  fontFamily: [label, placeholder, inputField, helperText, errorMessage],
@@ -309,6 +311,12 @@ export const ComboBoxClass = compose(
309
311
  overlayFontFamily: { property: () => ComboBoxClass.cssVarList.overlay.fontFamily },
310
312
  overlayCursor: { property: () => ComboBoxClass.cssVarList.overlay.cursor },
311
313
  overlayItemBoxShadow: { property: () => ComboBoxClass.cssVarList.overlay.itemBoxShadow },
314
+ overlayItemPaddingInlineStart: {
315
+ property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,
316
+ },
317
+ overlayItemPaddingInlineEnd: {
318
+ property: () => ComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,
319
+ },
312
320
  },
313
321
  }),
314
322
  draggableMixin,
@@ -323,6 +331,11 @@ export const ComboBoxClass = compose(
323
331
  fontFamily: { selector: 'vaadin-combo-box-item' },
324
332
  fontSize: { selector: 'vaadin-combo-box-item' },
325
333
  itemBoxShadow: { selector: 'vaadin-combo-box-item', property: 'box-shadow' },
334
+ itemPaddingInlineStart: {
335
+ selector: 'vaadin-combo-box-item',
336
+ property: 'padding-inline-start',
337
+ },
338
+ itemPaddingInlineEnd: { selector: 'vaadin-combo-box-item', property: 'padding-inline-end' },
326
339
  },
327
340
  forward: {
328
341
  include: false,
@@ -364,6 +377,7 @@ export const ComboBoxClass = compose(
364
377
  padding: 0;
365
378
  box-shadow: none;
366
379
  }
380
+ ${resetInputLabelPosition('vaadin-combo-box')}
367
381
  `,
368
382
  // Note: we exclude `size` to avoid overriding Vaadin's ComboBox property
369
383
  // with the same name. Including it will cause Vaadin to calculate NaN size,
@@ -2,6 +2,7 @@ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '
2
2
  import { createBaseClass } from '../../baseClasses/createBaseClass';
3
3
  import { compose } from '../../helpers';
4
4
  import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
5
+ import { TextClass } from '../descope-text/TextClass';
5
6
 
6
7
  export const componentName = getComponentName('divider');
7
8
  class RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {
@@ -49,6 +50,7 @@ class RawDivider extends createBaseClass({ componentName, baseSelector: ':host >
49
50
  }
50
51
  }
51
52
 
53
+ const textVars = TextClass.cssVarList;
52
54
  const { host, before, after, text } = {
53
55
  host: { selector: () => ':host' },
54
56
  before: { selector: '::before' },
@@ -61,11 +63,13 @@ export const DividerClass = compose(
61
63
  mappings: {
62
64
  hostWidth: { ...host, property: 'width' },
63
65
  hostPadding: { ...host, property: 'padding' },
66
+ hostDirection: { ...text, property: 'direction' },
64
67
 
65
68
  minHeight: {},
66
69
  alignItems: {},
67
70
  alignSelf: {},
68
71
  flexDirection: {},
72
+ textAlign: { ...text, property: textVars.textAlign },
69
73
 
70
74
  labelTextWidth: { ...text, property: 'width' },
71
75
  labelTextMaxWidth: { ...text, property: 'max-width' },
@@ -9,6 +9,7 @@ import textFieldMappings from '../descope-text-field/textFieldMappings';
9
9
  import { compose } from '../../helpers';
10
10
  import { getComponentName } from '../../helpers/componentHelpers';
11
11
  import {
12
+ resetInputLabelPosition,
12
13
  resetInputOverrides,
13
14
  useHostExternalPadding,
14
15
  } from '../../helpers/themeHelpers/resetHelpers';
@@ -41,8 +42,9 @@ export const EmailFieldClass = compose(
41
42
  padding: calc(var(${EmailFieldClass.cssVarList.inputOutlineWidth}) + var(${
42
43
  EmailFieldClass.cssVarList.inputOutlineOffset
43
44
  }));
44
- box-sizing: border-box;
45
+ box-sizing: border-box;
45
46
  }
47
+ ${resetInputLabelPosition('vaadin-email-field')}
46
48
  ${useHostExternalPadding(EmailFieldClass.cssVarList)}
47
49
  ${resetInputOverrides('vaadin-email-field', EmailFieldClass.cssVarList)}
48
50
  `,
@@ -58,6 +58,7 @@ export const LinkClass = compose(
58
58
  createStyleMixin({
59
59
  mappings: {
60
60
  hostWidth: { ...host, property: 'width' },
61
+ hostDirection: { ...text, property: 'direction' },
61
62
  textAlign: wrapper,
62
63
  textColor: [
63
64
  { ...anchor, property: 'color' },
@@ -45,12 +45,13 @@ const customMixin = (superclass) =>
45
45
  }
46
46
  };
47
47
 
48
- const { host, label, internalInputsWrapper, errorMessage, helperText } = {
48
+ const { host, label, internalInputsWrapper, errorMessage, helperText, passwordInput } = {
49
49
  host: { selector: () => ':host' },
50
50
  label: { selector: '::part(label)' },
51
51
  internalInputsWrapper: { selector: 'descope-new-password-internal .wrapper' },
52
52
  helperText: { selector: '::part(helper-text)' },
53
53
  errorMessage: { selector: '::part(error-message)' },
54
+ passwordInput: { selector: 'descope-password' },
54
55
  };
55
56
 
56
57
  export const NewPasswordClass = compose(
@@ -68,6 +69,10 @@ export const NewPasswordClass = compose(
68
69
  errorMessageTextColor: { ...errorMessage, property: 'color' },
69
70
  hostWidth: { ...host, property: 'width' },
70
71
  hostMinWidth: { ...host, property: 'min-width' },
72
+ hostDirection: [
73
+ { ...host, property: 'direction' },
74
+ { ...passwordInput, property: PasswordClass.cssVarList.hostDirection },
75
+ ],
71
76
  inputsRequiredIndicator: { ...host, property: 'content' },
72
77
  spaceBetweenInputs: { ...internalInputsWrapper, property: 'gap' },
73
78
  },
@@ -85,6 +90,9 @@ export const NewPasswordClass = compose(
85
90
  max-width: 100%;
86
91
  box-sizing: border-box;
87
92
  }
93
+ :host ::part(error-message) {
94
+ direction: ltr;
95
+ }
88
96
  ${useHostExternalPadding(PasswordClass.cssVarList)}
89
97
  vaadin-text-field {
90
98
  padding: 0;
@@ -120,7 +128,7 @@ export const NewPasswordClass = compose(
120
128
  }
121
129
  descope-new-password-internal vaadin-password-field::before {
122
130
  height: initial;
123
- },
131
+ }
124
132
  `,
125
133
  excludeAttrsSync: ['tabindex'],
126
134
  componentName,
@@ -113,9 +113,14 @@ class NewPasswordInternal extends BaseInputClass {
113
113
  this.inputs.forEach((input) => {
114
114
  const styleTag = document.createElement('style');
115
115
  styleTag.innerHTML = `
116
- :host::part(required-indicator)::after {
116
+ :host ::part(required-indicator)::after {
117
117
  content: var(${NewPasswordClass.cssVarList.inputsRequiredIndicator});
118
+ width: 1em;
119
+ text-align: center;
118
120
  }
121
+ :host ::part(required-indicator) {
122
+ display: inline-flex;
123
+ }
119
124
  `;
120
125
  input?.shadowRoot.appendChild(styleTag);
121
126
  });
@@ -9,6 +9,7 @@ import textFieldMappings from '../descope-text-field/textFieldMappings';
9
9
  import { compose } from '../../helpers';
10
10
  import { getComponentName } from '../../helpers/componentHelpers';
11
11
  import {
12
+ resetInputLabelPosition,
12
13
  resetInputOverrides,
13
14
  useHostExternalPadding,
14
15
  } from '../../helpers/themeHelpers/resetHelpers';
@@ -34,6 +35,7 @@ export const NumberFieldClass = compose(
34
35
  NumberFieldClass.cssVarList.inputOutlineOffset
35
36
  }));
36
37
  }
38
+ ${resetInputLabelPosition('vaadin-number-field')}
37
39
  ${useHostExternalPadding(NumberFieldClass.cssVarList)}
38
40
  ${resetInputOverrides('vaadin-number-field', NumberFieldClass.cssVarList)}
39
41
  `,
@@ -11,6 +11,7 @@ import { compose } from '../../helpers';
11
11
  import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
12
12
  import {
13
13
  resetInputCursor,
14
+ resetInputLabelPosition,
14
15
  resetInputFieldDefaultWidth,
15
16
  } from '../../helpers/themeHelpers/resetHelpers';
16
17
 
@@ -82,6 +83,7 @@ export const PasscodeClass = compose(
82
83
  mappings: {
83
84
  fontSize: [{ ...digitField, property: textVars.fontSize }, host],
84
85
  hostWidth: { property: 'width' },
86
+ hostDirection: { ...host, property: 'direction' },
85
87
  fontFamily: [host, { ...label }],
86
88
  labelTextColor: [
87
89
  { ...label, property: 'color' },
@@ -178,6 +180,7 @@ export const PasscodeClass = compose(
178
180
  box-shadow: none;
179
181
  }
180
182
 
183
+ ${resetInputLabelPosition('vaadin-text-field')}
181
184
  ${resetInputCursor('vaadin-text-field')}
182
185
  `,
183
186
  excludeAttrsSync: ['tabindex'],
@@ -26,7 +26,12 @@ class PasscodeInternal extends BaseInputClass {
26
26
  display: flex;
27
27
  width: 100%;
28
28
  justify-content: space-between;
29
+ direction: ltr;
29
30
  }
31
+
32
+ descope-text-field {
33
+ direction: ltr;
34
+ }
30
35
  </style>
31
36
  `;
32
37
 
@@ -8,7 +8,11 @@ import {
8
8
  import { compose } from '../../helpers';
9
9
  import { getComponentName } from '../../helpers/componentHelpers';
10
10
  import passwordDraggableMixin from './passwordDraggableMixin';
11
- import { resetInputCursor, useHostExternalPadding } from '../../helpers/themeHelpers/resetHelpers';
11
+ import {
12
+ resetInputLabelPosition,
13
+ resetInputCursor,
14
+ useHostExternalPadding,
15
+ } from '../../helpers/themeHelpers/resetHelpers';
12
16
 
13
17
  export const componentName = getComponentName('password');
14
18
 
@@ -41,6 +45,7 @@ export const PasswordClass = compose(
41
45
  mappings: {
42
46
  hostWidth: { ...host, property: 'width' },
43
47
  hostMinWidth: { ...host, property: 'min-width' },
48
+ hostDirection: { ...host, property: 'direction' },
44
49
  fontSize: [{}, host],
45
50
  fontFamily: [label, inputField, errorMessage, helperText],
46
51
  inputHeight: { ...inputField, property: 'height' },
@@ -93,10 +98,11 @@ export const PasswordClass = compose(
93
98
  display: inline-block;
94
99
  max-width: 100%;
95
100
  min-width: 10em;
96
- box-sizing: border-box;
101
+ box-sizing: border-box;
97
102
  }
98
103
  ${useHostExternalPadding(PasswordClass.cssVarList)}
99
104
  ${resetInputCursor('vaadin-password-field')}
105
+ ${resetInputLabelPosition('vaadin-password-field')}
100
106
 
101
107
  vaadin-password-field {
102
108
  width: 100%;
@@ -45,6 +45,7 @@ export const TextClass = compose(
45
45
  createStyleMixin({
46
46
  mappings: {
47
47
  hostWidth: { selector: () => ':host', property: 'width' },
48
+ hostDirection: { selector: () => ':host', property: 'direction' },
48
49
  fontSize: {},
49
50
  textColor: { property: 'color' },
50
51
  textLineHeight: { property: 'line-height' },
@@ -10,6 +10,7 @@ import { getComponentName } from '../../helpers/componentHelpers';
10
10
  import {
11
11
  resetInputContainer,
12
12
  resetInputCursor,
13
+ resetInputLabelPosition,
13
14
  resetInputField,
14
15
  resetInputPlaceholder,
15
16
  useHostExternalPadding,
@@ -42,6 +43,7 @@ export const TextAreaClass = compose(
42
43
  mappings: {
43
44
  hostWidth: { ...host, property: 'width' },
44
45
  hostMinWidth: { ...host, property: 'min-width' },
46
+ hostDirection: { ...host, property: 'direction' },
45
47
  fontSize: [host, textArea],
46
48
  fontFamily: [label, inputField, helperText, errorMessage],
47
49
  labelTextColor: [
@@ -76,11 +78,12 @@ export const TextAreaClass = compose(
76
78
  :host {
77
79
  display: inline-block;
78
80
  max-width: 100%;
79
- box-sizing: border-box;
81
+ box-sizing: border-box;
80
82
  }
81
83
  textarea {
82
84
  height: 100%;
83
85
  }
86
+ ${resetInputLabelPosition('vaadin-text-area')}
84
87
  ${useHostExternalPadding(TextAreaClass.cssVarList)}
85
88
  ${resetInputContainer('vaadin-text-area')}
86
89
  ${resetInputField('vaadin-text-area')}
@@ -9,6 +9,7 @@ import textFieldMappings from './textFieldMappings';
9
9
  import { compose } from '../../helpers';
10
10
  import { getComponentName } from '../../helpers/componentHelpers';
11
11
  import {
12
+ resetInputLabelPosition,
12
13
  resetInputOverrides,
13
14
  useHostExternalPadding,
14
15
  } from '../../helpers/themeHelpers/resetHelpers';
@@ -56,8 +57,9 @@ export const TextFieldClass = compose(
56
57
  padding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${
57
58
  TextFieldClass.cssVarList.inputOutlineOffset
58
59
  }));
59
- box-sizing: border-box;
60
+ box-sizing: border-box;
60
61
  }
62
+ ${resetInputLabelPosition('vaadin-text-field')}
61
63
  ${useHostExternalPadding(TextFieldClass.cssVarList)}
62
64
  ${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}
63
65
  `,
@@ -17,6 +17,7 @@ export default {
17
17
 
18
18
  hostWidth: { ...host, property: 'width' },
19
19
  hostMinWidth: { ...host, property: 'min-width' },
20
+ hostDirection: { ...host, property: 'direction' },
20
21
 
21
22
  inputBackgroundColor: { ...inputField, property: 'background-color' },
22
23
 
@@ -2,6 +2,7 @@ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '
2
2
  import { compose } from '../../helpers';
3
3
  import { getComponentName } from '../../helpers/componentHelpers';
4
4
  import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';
5
+ import { ButtonClass } from '../descope-button/ButtonClass';
5
6
  import { getFileBase64, getFilename } from './helpers';
6
7
 
7
8
  export const componentName = getComponentName('upload-file');
@@ -190,6 +191,7 @@ class RawUploadFile extends BaseInputClass {
190
191
  }
191
192
  }
192
193
 
194
+ const buttonVars = ButtonClass.cssVarList;
193
195
  const { host, wrapper, icon, title, description, requiredIndicator } = {
194
196
  host: { selector: () => ':host' },
195
197
  wrapper: { selector: () => ':host > div' },
@@ -212,6 +214,10 @@ export const UploadFileClass = compose(
212
214
  hostHeight: { ...host, property: 'height' },
213
215
  hostWidth: { ...host, property: 'width' },
214
216
  hostPadding: { property: 'padding' },
217
+ hostDirection: [
218
+ { ...host, property: 'direction' },
219
+ { selector: () => ButtonClass.componentName, property: buttonVars.hostDirection },
220
+ ],
215
221
  gap: { ...wrapper },
216
222
  lineHeight: { ...wrapper, property: 'line-height' },
217
223
  titleFontSize: { ...title, property: 'font-size' },
@@ -7,6 +7,7 @@ import { ComboBoxClass } from '../../descope-combo-box/ComboBoxClass';
7
7
  import CountryCodes from '../CountryCodes';
8
8
  import {
9
9
  resetInputCursor,
10
+ resetInputLabelPosition,
10
11
  resetInputFieldDefaultWidth,
11
12
  resetInputFieldInvalidBackgroundColor,
12
13
  useHostExternalPadding,
@@ -107,6 +108,7 @@ export const PhoneFieldClass = compose(
107
108
  { ...phoneInput, property: 'width' },
108
109
  { ...countryCodeInput, property: '--vaadin-combo-box-overlay-width' },
109
110
  ],
111
+ hostDirection: { ...host, property: 'direction' },
110
112
 
111
113
  inputBorderStyle: [
112
114
  { ...inputField, property: 'border-style' },
@@ -190,16 +192,15 @@ export const PhoneFieldClass = compose(
190
192
  }
191
193
  vaadin-text-field::part(input-field) {
192
194
  padding: 0;
193
- min-height: 0;
194
195
  background: transparent;
195
196
  overflow: hidden;
196
197
  }
197
198
  descope-phone-field-internal {
198
199
  -webkit-mask-image: none;
199
200
  padding: 0;
200
- min-height: 0;
201
201
  width: 100%;
202
202
  height: 100%;
203
+ direction: ltr;
203
204
  }
204
205
  descope-phone-field-internal > div {
205
206
  width: 100%;
@@ -230,6 +231,7 @@ export const PhoneFieldClass = compose(
230
231
  vaadin-text-field::part(input-field)::after {
231
232
  border: none;
232
233
  }
234
+ ${resetInputLabelPosition('vaadin-text-field')}
233
235
  `,
234
236
  excludeAttrsSync: ['tabindex'],
235
237
  componentName,
@@ -5,6 +5,7 @@ import { createProxy, createStyleMixin, draggableMixin, proxyInputMixin } from '
5
5
  import { TextFieldClass } from '../../descope-text-field/TextFieldClass';
6
6
  import CountryCodes from '../CountryCodes';
7
7
  import {
8
+ resetInputLabelPosition,
8
9
  resetInputCursor,
9
10
  resetInputFieldDefaultWidth,
10
11
  resetInputFieldInvalidBackgroundColor,
@@ -76,6 +77,7 @@ export const PhoneFieldInputBoxClass = compose(
76
77
  fontFamily: [label, errorMessage, helperText],
77
78
  hostWidth: { ...host, property: 'width' },
78
79
  hostMinWidth: { ...host, property: 'min-width' },
80
+ hostDirection: { ...host, property: 'direction' },
79
81
 
80
82
  inputBorderStyle: { ...inputField, property: 'border-style' },
81
83
  inputBorderWidth: { ...inputField, property: 'border-width' },
@@ -131,7 +133,6 @@ export const PhoneFieldInputBoxClass = compose(
131
133
  }
132
134
  vaadin-text-field::part(input-field) {
133
135
  padding: 0;
134
- min-height: 0;
135
136
  background: transparent;
136
137
  overflow: hidden;
137
138
  -webkit-mask-image: none;
@@ -139,7 +140,6 @@ export const PhoneFieldInputBoxClass = compose(
139
140
  descope-phone-field-internal-input-box {
140
141
  -webkit-mask-image: none;
141
142
  padding: 0;
142
- min-height: 0;
143
143
  width: 100%;
144
144
  height: 100%;
145
145
  }
@@ -158,6 +158,7 @@ export const PhoneFieldInputBoxClass = compose(
158
158
  ${textVars.inputOutlineOffset}: 0;
159
159
  ${textVars.inputBorderWidth}: 0;
160
160
  ${textVars.inputBorderRadius}: 0;
161
+ direction: ltr;
161
162
  }
162
163
  vaadin-text-field[readonly] > input:placeholder-shown {
163
164
  opacity: 1;
@@ -165,6 +166,7 @@ export const PhoneFieldInputBoxClass = compose(
165
166
  vaadin-text-field::part(input-field)::after {
166
167
  border: none;
167
168
  }
169
+ ${resetInputLabelPosition('vaadin-text-field')}
168
170
  `,
169
171
  excludeAttrsSync: ['tabindex'],
170
172
  componentName,
@@ -98,3 +98,31 @@ export const resetInputOverrides = (name, cssVarList) => `
98
98
  ${resetInputElement(name)}
99
99
  ${resetInputFieldUnderlayingBorder(name)}
100
100
  `;
101
+
102
+ // This function is used to support RTL correctly for input components.
103
+ // It also fixes the error message to be displayed LTR since we currently
104
+ // don't support RTL for error messages.
105
+ export const resetInputLabelPosition = (name) => `
106
+ :host ::part(error-message) {
107
+ direction: ltr;
108
+ }
109
+ :host([required]) ::part(required-indicator) {
110
+ width: 1em;
111
+ display: inline-flex;
112
+ }
113
+ :host([required]) ::part(required-indicator)::after {
114
+ position: static;
115
+ }
116
+ :host([has-label]) ::part(label) {
117
+ padding-right: 0;
118
+ padding-bottom: 0;
119
+ display: flex;
120
+ width: 100%;
121
+ }
122
+ ${name} [slot="label"] {
123
+ max-width: calc(100% - 1em);
124
+ overflow: hidden;
125
+ text-overflow: ellipsis;
126
+ padding-bottom: 0.5em;
127
+ }
128
+ `;
@@ -23,6 +23,7 @@ const button = {
23
23
  [compVars.cursor]: 'pointer',
24
24
  [compVars.hostHeight]: '3em',
25
25
  [compVars.hostWidth]: 'auto',
26
+ [compVars.hostDirection]: globalRefs.direction,
26
27
 
27
28
  [compVars.borderRadius]: globalRefs.radius.sm,
28
29
  [compVars.borderWidth]: globalRefs.border.xs,
@@ -7,6 +7,7 @@ const globalRefs = getThemeRefs(globals);
7
7
  const vars = ButtonSelectionGroupClass.cssVarList;
8
8
 
9
9
  const buttonSelectionGroup = {
10
+ [vars.hostDirection]: refs.direction,
10
11
  [vars.fontFamily]: refs.fontFamily,
11
12
  [vars.labelTextColor]: refs.labelTextColor,
12
13
  [vars.labelRequiredIndicator]: refs.requiredIndicator,
@@ -7,6 +7,7 @@ const globalRefs = getThemeRefs(globals);
7
7
  export const vars = ButtonSelectionGroupItemClass.cssVarList;
8
8
 
9
9
  const buttonSelectionGroupItem = {
10
+ [vars.hostDirection]: 'inherit',
10
11
  [vars.backgroundColor]: globalRefs.colors.surface.light,
11
12
  [vars.labelTextColor]: globalRefs.colors.surface.contrast,
12
13
  [vars.borderColor]: globalRefs.colors.surface.main,
@@ -6,6 +6,7 @@ const checkboxSize = '1.35em';
6
6
 
7
7
  const checkbox = {
8
8
  [vars.hostWidth]: refs.width,
9
+ [vars.hostDirection]: refs.direction,
9
10
  [vars.fontSize]: refs.fontSize,
10
11
  [vars.fontFamily]: refs.fontFamily,
11
12
  [vars.labelTextColor]: refs.labelTextColor,
@@ -8,6 +8,7 @@ const vars = ComboBoxClass.cssVarList;
8
8
 
9
9
  export const comboBox = {
10
10
  [vars.hostWidth]: refs.width,
11
+ [vars.hostDirection]: refs.direction,
11
12
  [vars.fontSize]: refs.fontSize,
12
13
  [vars.fontFamily]: refs.fontFamily,
13
14
  [vars.labelTextColor]: refs.labelTextColor,
@@ -30,6 +31,8 @@ export const comboBox = {
30
31
  [vars.inputDropdownButtonCursor]: 'pointer',
31
32
  [vars.inputDropdownButtonSize]: refs.toggleButtonSize,
32
33
  [vars.inputDropdownButtonOffset]: globalRefs.spacing.xs,
34
+ [vars.overlayItemPaddingInlineStart]: globalRefs.spacing.xs,
35
+ [vars.overlayItemPaddingInlineEnd]: globalRefs.spacing.lg,
33
36
 
34
37
  _readonly: {
35
38
  [vars.inputDropdownButtonCursor]: 'default',
@@ -16,6 +16,7 @@ const [helperTheme, helperRefs, helperVars] = createHelperVars(
16
16
  const divider = {
17
17
  ...helperTheme,
18
18
 
19
+ [compVars.hostDirection]: globalRefs.direction,
19
20
  [compVars.alignItems]: 'center',
20
21
  [compVars.flexDirection]: 'row',
21
22
  [compVars.alignSelf]: 'stretch',
@@ -26,6 +27,7 @@ const divider = {
26
27
  [compVars.labelTextWidth]: 'fit-content',
27
28
  [compVars.labelTextMaxWidth]: 'calc(100% - 100px)',
28
29
  [compVars.labelTextHorizontalSpacing]: helperRefs.spacing,
30
+ [compVars.textAlign]: 'center',
29
31
 
30
32
  _vertical: {
31
33
  [compVars.minHeight]: '200px',
@@ -6,6 +6,7 @@ const vars = EmailFieldClass.cssVarList;
6
6
  const emailField = {
7
7
  [vars.hostWidth]: refs.width,
8
8
  [vars.hostMinWidth]: refs.minWidth,
9
+ [vars.hostDirection]: refs.direction,
9
10
  [vars.fontSize]: refs.fontSize,
10
11
  [vars.fontFamily]: refs.fontFamily,
11
12
  [vars.labelTextColor]: refs.labelTextColor,
@@ -32,6 +32,8 @@ const [theme, refs, vars] = createHelperVars(
32
32
 
33
33
  fontFamily: globalRefs.fonts.font1.family,
34
34
 
35
+ direction: globalRefs.direction,
36
+
35
37
  size: {
36
38
  xs: { fontSize: '12px' },
37
39
  sm: { fontSize: '14px' },
@@ -6,6 +6,7 @@ const globalRefs = getThemeRefs(globals);
6
6
  const vars = LinkClass.cssVarList;
7
7
 
8
8
  const link = {
9
+ [vars.hostDirection]: globalRefs.direction,
9
10
  [vars.cursor]: 'pointer',
10
11
 
11
12
  [vars.textColor]: globalRefs.colors.primary.main,
@@ -6,6 +6,7 @@ const vars = NewPasswordClass.cssVarList;
6
6
  const newPassword = {
7
7
  [vars.hostWidth]: refs.width,
8
8
  [vars.hostMinWidth]: refs.minWidth,
9
+ [vars.hostDirection]: refs.direction,
9
10
  [vars.fontSize]: refs.fontSize,
10
11
  [vars.fontFamily]: refs.fontFamily,
11
12
  [vars.spaceBetweenInputs]: '1em',
@@ -6,6 +6,7 @@ const vars = NumberFieldClass.cssVarList;
6
6
  const numberField = {
7
7
  [vars.hostWidth]: refs.width,
8
8
  [vars.hostMinWidth]: refs.minWidth,
9
+ [vars.hostDirection]: refs.direction,
9
10
  [vars.fontSize]: refs.fontSize,
10
11
  [vars.fontFamily]: refs.fontFamily,
11
12
  [vars.labelTextColor]: refs.labelTextColor,
@@ -4,6 +4,7 @@ import { refs } from './inputWrapper';
4
4
  const vars = PasscodeClass.cssVarList;
5
5
 
6
6
  const passcode = {
7
+ [vars.hostDirection]: refs.direction,
7
8
  [vars.fontFamily]: refs.fontFamily,
8
9
  [vars.fontSize]: refs.fontSize,
9
10
  [vars.labelTextColor]: refs.labelTextColor,
@@ -8,6 +8,7 @@ const vars = PasswordClass.cssVarList;
8
8
 
9
9
  const password = {
10
10
  [vars.hostWidth]: refs.width,
11
+ [vars.hostDirection]: refs.direction,
11
12
  [vars.fontSize]: refs.fontSize,
12
13
  [vars.fontFamily]: refs.fontFamily,
13
14
  [vars.labelTextColor]: refs.labelTextColor,
@@ -5,6 +5,7 @@ const vars = PhoneFieldClass.cssVarList;
5
5
 
6
6
  const phoneField = {
7
7
  [vars.hostWidth]: refs.width,
8
+ [vars.hostDirection]: refs.direction,
8
9
  [vars.fontSize]: refs.fontSize,
9
10
  [vars.fontFamily]: refs.fontFamily,
10
11
  [vars.labelTextColor]: refs.labelTextColor,