tuix-webcomponents 0.0.21 → 0.0.24

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 (116) hide show
  1. package/README.md +110 -4
  2. package/dist/assets/tuix-styles.css +72 -0
  3. package/dist/src/index.d.ts +34 -1
  4. package/dist/src/index.js +26 -16
  5. package/dist/src/react/index.d.ts +42 -0
  6. package/dist/src/react/index.js +114 -0
  7. package/dist/src/tuix-button/TuixBaseButton.d.ts +17 -0
  8. package/dist/src/tuix-button/TuixBaseButton.js +60 -0
  9. package/dist/src/tuix-button/TuixButton.d.ts +11 -0
  10. package/dist/src/tuix-button/TuixButton.js +84 -0
  11. package/dist/src/tuix-button/TuixButton.styles.d.ts +3 -0
  12. package/dist/src/tuix-button/TuixButton.styles.js +107 -0
  13. package/dist/src/tuix-button/enums/tuix-button.enums.d.ts +2 -0
  14. package/dist/src/tuix-button/enums/tuix-button.enums.js +6 -0
  15. package/dist/src/tuix-button/interfaces/tuix-button.interface.d.ts +1 -0
  16. package/dist/src/tuix-button/interfaces/tuix-button.interface.js +1 -0
  17. package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +17 -0
  18. package/dist/src/tuix-checkbox/TuixCheckbox.js +108 -0
  19. package/dist/src/tuix-checkbox/TuixCheckbox.styles.d.ts +4 -0
  20. package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +132 -0
  21. package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.d.ts +21 -0
  22. package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +23 -0
  23. package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.d.ts +5 -0
  24. package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js +1 -0
  25. package/dist/src/tuix-dropdown/TuixDropdown.d.ts +56 -0
  26. package/dist/src/tuix-dropdown/TuixDropdown.js +361 -0
  27. package/dist/src/tuix-dropdown/TuixDropdown.styles.d.ts +3 -0
  28. package/dist/src/tuix-dropdown/TuixDropdown.styles.js +125 -0
  29. package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +4 -0
  30. package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +5 -0
  31. package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +15 -0
  32. package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +1 -0
  33. package/dist/src/tuix-icon/TuixIcon.d.ts +15 -0
  34. package/dist/src/tuix-icon/TuixIcon.icons.d.ts +6 -0
  35. package/dist/src/tuix-icon/TuixIcon.icons.js +395 -0
  36. package/dist/src/tuix-icon/TuixIcon.js +79 -0
  37. package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +89 -0
  38. package/dist/src/tuix-icon/enums/tuix-icon.enums.js +96 -0
  39. package/dist/src/tuix-icon-button/TuixIconButton.d.ts +9 -0
  40. package/dist/src/tuix-icon-button/TuixIconButton.js +51 -0
  41. package/dist/src/tuix-input/TuixInput.d.ts +52 -0
  42. package/dist/src/tuix-input/TuixInput.js +374 -0
  43. package/dist/src/tuix-input/TuixInput.styles.d.ts +8 -0
  44. package/dist/src/tuix-input/TuixInput.styles.js +296 -0
  45. package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +38 -0
  46. package/dist/src/tuix-input/enums/tuix-input.enums.js +41 -0
  47. package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +18 -0
  48. package/dist/src/tuix-input/interfaces/tuix-input.interface.js +5 -0
  49. package/dist/src/tuix-link/TuixLink.d.ts +15 -0
  50. package/dist/src/tuix-link/TuixLink.js +71 -0
  51. package/dist/src/tuix-link/TuixLink.styles.d.ts +2 -0
  52. package/dist/src/tuix-link/TuixLink.styles.js +55 -0
  53. package/dist/src/tuix-link/enums/linkTarget.enum.d.ts +6 -0
  54. package/dist/src/tuix-link/enums/linkTarget.enum.js +7 -0
  55. package/dist/src/tuix-modal/TuixModal.d.ts +11 -0
  56. package/dist/src/tuix-modal/TuixModal.js +65 -0
  57. package/dist/src/tuix-modal/TuixModal.styles.d.ts +2 -0
  58. package/dist/src/tuix-modal/TuixModal.styles.js +55 -0
  59. package/dist/src/tuix-paper/TuixPaper.d.ts +10 -0
  60. package/dist/src/tuix-paper/TuixPaper.js +46 -0
  61. package/dist/src/tuix-paper/TuixPaper.styles.d.ts +1 -0
  62. package/dist/src/tuix-paper/TuixPaper.styles.js +30 -0
  63. package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +13 -0
  64. package/dist/src/tuix-paper/enums/tuix-paper.enum.js +15 -0
  65. package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +17 -0
  66. package/dist/src/tuix-radio-button/TuixRadioButton.js +96 -0
  67. package/dist/src/tuix-radio-button/TuixRadioButton.styles.d.ts +5 -0
  68. package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +135 -0
  69. package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +3 -0
  70. package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +1 -0
  71. package/dist/src/tuix-table/TuixTable.d.ts +48 -0
  72. package/dist/src/tuix-table/TuixTable.js +369 -0
  73. package/dist/src/tuix-table/TuixTable.styles.d.ts +2 -0
  74. package/dist/src/tuix-table/TuixTable.styles.js +197 -0
  75. package/dist/src/tuix-table/interfaces/tuix-table.interface.d.ts +45 -0
  76. package/dist/src/tuix-table/interfaces/tuix-table.interface.js +1 -0
  77. package/dist/src/tuix-text/TuixText.d.ts +7 -5
  78. package/dist/src/tuix-text/TuixText.js +45 -137
  79. package/dist/src/tuix-text/TuixText.styles.d.ts +2 -0
  80. package/dist/src/tuix-text/TuixText.styles.js +195 -0
  81. package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +36 -0
  82. package/dist/src/tuix-text/enums/tuix-text.enums.js +72 -0
  83. package/dist/src/tuix-toast/TuixToast.d.ts +18 -0
  84. package/dist/src/tuix-toast/TuixToast.js +103 -0
  85. package/dist/src/tuix-toast/TuixToast.styles.d.ts +3 -0
  86. package/dist/src/tuix-toast/TuixToast.styles.js +43 -0
  87. package/dist/src/tuix-toast/enums/tuix-toast.enums.d.ts +20 -0
  88. package/dist/src/tuix-toast/enums/tuix-toast.enums.js +59 -0
  89. package/dist/src/tuix-toggle-button/TuixToggleButton.d.ts +14 -0
  90. package/dist/src/tuix-toggle-button/TuixToggleButton.js +86 -0
  91. package/dist/src/tuix-toggle-button/TuixToggleButton.styles.d.ts +5 -0
  92. package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +134 -0
  93. package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.d.ts +2 -0
  94. package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js +1 -0
  95. package/dist/src/utils/colors.d.ts +30 -10
  96. package/dist/src/utils/colors.js +31 -11
  97. package/dist/src/utils/darkColors.d.ts +32 -0
  98. package/dist/src/utils/darkColors.js +33 -0
  99. package/dist/src/utils/hex-rgb.d.ts +5 -0
  100. package/dist/src/utils/hex-rgb.js +15 -0
  101. package/dist/src/utils/interfaces/detail-value.interface.d.ts +3 -0
  102. package/dist/src/utils/interfaces/detail-value.interface.js +1 -0
  103. package/dist/src/utils/mainVariant.enum.d.ts +4 -0
  104. package/dist/src/utils/mainVariant.enum.js +5 -0
  105. package/dist/src/utils/screenSizes.enum.d.ts +4 -0
  106. package/dist/src/utils/screenSizes.enum.js +5 -0
  107. package/dist/src/utils/slottedClassName.d.ts +2 -0
  108. package/dist/src/utils/slottedClassName.js +1 -0
  109. package/package.json +118 -66
  110. package/dist/src/enums/tuix-text.enums.d.ts +0 -24
  111. package/dist/src/enums/tuix-text.enums.js +0 -29
  112. package/dist/src/enums/tuix-text.enums.js.map +0 -1
  113. package/dist/src/index.js.map +0 -1
  114. package/dist/src/tuix-text/TuixText.js.map +0 -1
  115. package/dist/src/utils/colors.js.map +0 -1
  116. package/dist/tsconfig.publish.tsbuildinfo +0 -1
@@ -0,0 +1,361 @@
1
+ import { __decorate } from "tslib";
2
+ import { LitElement, html, } from 'lit';
3
+ import { customElement, property, query, state } from 'lit/decorators.js';
4
+ import { classMap } from 'lit/directives/class-map.js';
5
+ import '../tuix-input/TuixInput.js';
6
+ import { IconName } from '../tuix-icon/enums/tuix-icon.enums.js';
7
+ import { dropdownHostStyles, dropdownMainContainerStyles, dropdownOptionStyles, } from './TuixDropdown.styles.js';
8
+ import { DescriptionType } from '../tuix-input/enums/tuix-input.enums.js';
9
+ import { DropdownType } from './enums/tuix-dropdown.enums.js';
10
+ let TuixDropdown = class TuixDropdown extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.value = undefined;
14
+ this.options = [];
15
+ this.placeholder = '';
16
+ this.title = '';
17
+ this.disabled = false;
18
+ this.dark = false;
19
+ this.descriptionType = DescriptionType.TEXT;
20
+ this.type = DropdownType.SINGLE;
21
+ this._value = '';
22
+ this._isOptionsVisible = false;
23
+ this._searchingOption = false;
24
+ this._extendedOptions = [];
25
+ this._previousSelectedOption = null;
26
+ this._previousFocusedOption = null;
27
+ this._handleClickOutside = (event) => {
28
+ if (!event.composedPath().includes(this)) {
29
+ this._isOptionsVisible = false;
30
+ }
31
+ };
32
+ }
33
+ static { this.styles = [
34
+ dropdownHostStyles,
35
+ dropdownMainContainerStyles,
36
+ dropdownOptionStyles,
37
+ ]; }
38
+ connectedCallback() {
39
+ super.connectedCallback();
40
+ window.addEventListener('click', this._handleClickOutside);
41
+ this.addEventListener('blur', this._handleBlur.bind(this));
42
+ }
43
+ disconnectedCallback() {
44
+ window.removeEventListener('click', this._handleClickOutside);
45
+ super.disconnectedCallback();
46
+ }
47
+ _onEnterPress(event) {
48
+ if (event.key === 'Enter') {
49
+ this._toggleOptions();
50
+ }
51
+ }
52
+ _onKeyDownOption(event) {
53
+ switch (event.key) {
54
+ case 'ArrowDown':
55
+ return this._handleArrowDown();
56
+ case 'ArrowUp':
57
+ return this._handleArrowUp();
58
+ case 'Escape':
59
+ this._isOptionsVisible = false;
60
+ break;
61
+ }
62
+ }
63
+ _onKeyPressOption(event) {
64
+ if (event.key === 'Enter') {
65
+ this._onClickOption(event);
66
+ }
67
+ }
68
+ _onMouseOverOption(event) {
69
+ const optionTarget = event.target;
70
+ this._focusTargetOption(optionTarget);
71
+ }
72
+ _onClickOption(event) {
73
+ const optionTarget = event.target;
74
+ this._value = optionTarget.innerText;
75
+ this._isOptionsVisible = false;
76
+ this._unselectPreviousOption();
77
+ optionTarget.classList.add('t-option-selected');
78
+ this._previousSelectedOption = optionTarget;
79
+ this._handleSelectEvent(event);
80
+ }
81
+ _onInputSingle(e) {
82
+ this._handleInputBase(e, 'input-single');
83
+ }
84
+ _handleSelectEvent(event) {
85
+ const optionIndex = event.target.getAttribute('data-value');
86
+ const selectedValue = this.options[Number(optionIndex)];
87
+ this.dispatchEvent(new CustomEvent('select', {
88
+ detail: {
89
+ value: this._getOptionValue(selectedValue),
90
+ },
91
+ bubbles: true,
92
+ }));
93
+ if (this.type === DropdownType.SEARCH) {
94
+ this._extendOptionsList(this._getOptionName(selectedValue));
95
+ this._searchingOption = false;
96
+ }
97
+ }
98
+ _handleBlur() {
99
+ if (this.type === DropdownType.SEARCH && this._searchingOption) {
100
+ const optionIndex = this._previousSelectedOption?.getAttribute('data-value');
101
+ const selectedValue = typeof optionIndex === 'string'
102
+ ? this.options[Number(optionIndex)]
103
+ : '';
104
+ this._value = this._getOptionName(selectedValue);
105
+ this._extendOptionsList();
106
+ }
107
+ }
108
+ _getOptionName(option) {
109
+ return String(typeof option === 'object' ? option?.name : option);
110
+ }
111
+ _getOptionValue(option) {
112
+ return typeof option === 'object' ? option.value : option;
113
+ }
114
+ _findIndex(option) {
115
+ return this._extendedOptions.findIndex(opt => opt.value === this._getOptionValue(option));
116
+ }
117
+ _handleInputBase(e, eventName) {
118
+ if (!this._searchingOption) {
119
+ this._searchingOption = true;
120
+ }
121
+ this._extendOptionsList(e.detail.value);
122
+ this._isOptionsVisible = true;
123
+ this.dispatchEvent(new CustomEvent(eventName, {
124
+ detail: {
125
+ value: e.detail.value,
126
+ },
127
+ bubbles: true,
128
+ }));
129
+ this._value = e.detail.value;
130
+ }
131
+ _extendOptionsList(value = '') {
132
+ value = value.trim();
133
+ this._extendedOptions = this.options.map(option => {
134
+ const optionName = this._getOptionName(option);
135
+ return {
136
+ name: optionName,
137
+ value: this._getOptionValue(option),
138
+ filtered: this.type === DropdownType.SEARCH &&
139
+ value !== '' &&
140
+ !optionName.toLowerCase().includes(value.toLowerCase()),
141
+ };
142
+ });
143
+ }
144
+ _handleArrowDown() {
145
+ const nextOption = this._previousFocusedOption
146
+ ?.nextElementSibling;
147
+ if (nextOption) {
148
+ this._focusTargetOption(nextOption);
149
+ }
150
+ }
151
+ _handleArrowUp() {
152
+ const previousOption = this._previousFocusedOption
153
+ ?.previousElementSibling;
154
+ if (previousOption) {
155
+ this._focusTargetOption(previousOption);
156
+ }
157
+ }
158
+ _focusTargetOption(targetOption, extrict = true) {
159
+ this._previousFocusedOption?.classList?.remove('t-option-hover');
160
+ targetOption?.classList.add('t-option-hover');
161
+ if (extrict) {
162
+ targetOption?.focus();
163
+ }
164
+ this._previousFocusedOption = targetOption;
165
+ }
166
+ _toggleOptions() {
167
+ if (this.disabled) {
168
+ return;
169
+ }
170
+ this._isOptionsVisible = !this._isOptionsVisible;
171
+ if (this._isOptionsVisible &&
172
+ this.type === DropdownType.SEARCH &&
173
+ this._previousSelectedOption) {
174
+ this._optionsContainer?.scrollTo({
175
+ top: this._previousSelectedOption.offsetTop,
176
+ behavior: 'auto',
177
+ });
178
+ this._inputDropdown?.shadowRoot?.querySelector('input')?.select();
179
+ }
180
+ }
181
+ _focusOptionsContainer() {
182
+ if (this.type === DropdownType.SEARCH) {
183
+ if (this._previousSelectedOption) {
184
+ this._focusTargetOption(this._previousSelectedOption, false);
185
+ }
186
+ return;
187
+ }
188
+ if (!this._isOptionsVisible || !this._optionsContainer) {
189
+ this._inputDropdown?.shadowRoot?.querySelector('input')?.focus();
190
+ return;
191
+ }
192
+ if (this._previousSelectedOption) {
193
+ this._focusTargetOption(this._previousSelectedOption);
194
+ }
195
+ else {
196
+ const firstOption = this._optionsContainer
197
+ .firstElementChild;
198
+ if (firstOption) {
199
+ this._focusTargetOption(firstOption);
200
+ }
201
+ }
202
+ }
203
+ _unselectPreviousOption() {
204
+ if (this._previousSelectedOption) {
205
+ this._previousSelectedOption.classList?.remove('t-option-selected');
206
+ this._previousSelectedOption = null;
207
+ }
208
+ }
209
+ _hasCompleteDescription() {
210
+ const isValidDescriptionType = Object.values(DescriptionType).includes(this.descriptionType);
211
+ return (isValidDescriptionType &&
212
+ (this.descriptionType === DescriptionType.TEXT
213
+ ? !!this.description
214
+ : true));
215
+ }
216
+ _getOptionsContainerClasses() {
217
+ return {
218
+ 't-options-container': true,
219
+ show: this._isOptionsVisible,
220
+ 't-with-description': this._hasCompleteDescription(),
221
+ };
222
+ }
223
+ _triggerUpdateByExternalValueChange() {
224
+ this._unselectPreviousOption();
225
+ if (!this.value) {
226
+ this._value = '';
227
+ this._extendOptionsList();
228
+ return;
229
+ }
230
+ const index = this._findIndex(this.value);
231
+ if (this.type === DropdownType.SEARCH) {
232
+ this._extendOptionsList('');
233
+ }
234
+ if (index < 0) {
235
+ this._value = '';
236
+ return;
237
+ }
238
+ const optionTarget = this._optionsContainer?.children[index];
239
+ optionTarget?.classList.add('t-option-selected');
240
+ this._previousSelectedOption = optionTarget || null;
241
+ this._value = optionTarget ? this._getOptionName(this.options[index]) : '';
242
+ }
243
+ _resetPreviousSelection() {
244
+ this._value = '';
245
+ this._unselectPreviousOption();
246
+ }
247
+ _getOptionsTemplate() {
248
+ if (this.type === DropdownType.SINGLE || this._searchingOption === false) {
249
+ this._extendOptionsList();
250
+ }
251
+ return this._extendedOptions?.map((option, index) => {
252
+ return html `<div
253
+ class="${classMap({
254
+ 't-dropdown-option': true,
255
+ 't-option-filtered': option.filtered,
256
+ })}"
257
+ @click="${this._onClickOption}"
258
+ data-value="${index}"
259
+ tabindex="0"
260
+ @keydown="${this._onKeyDownOption}"
261
+ @keypress="${this._onKeyPressOption}"
262
+ @mouseover="${this._onMouseOverOption}"
263
+ >
264
+ ${option.name}
265
+ </div>`;
266
+ });
267
+ }
268
+ updated(changedProperties) {
269
+ if (changedProperties.has('_isOptionsVisible')) {
270
+ this._focusOptionsContainer();
271
+ }
272
+ else if (changedProperties.has('value')) {
273
+ this._triggerUpdateByExternalValueChange();
274
+ }
275
+ }
276
+ willUpdate(changedProperties) {
277
+ if (changedProperties.has('options')) {
278
+ this._resetPreviousSelection();
279
+ }
280
+ }
281
+ firstUpdated(changedProperties) {
282
+ super.firstUpdated(changedProperties);
283
+ this._triggerUpdateByExternalValueChange();
284
+ }
285
+ render() {
286
+ return html `<div class="t-dropdown-full-container">
287
+ <div class="t-dropdown-container">
288
+ <tuix-input
289
+ .value="${this._value}"
290
+ class="t-input-dropdown"
291
+ iconRight="${this._isOptionsVisible
292
+ ? IconName.CHEVRON_UP
293
+ : IconName.CHEVRON_DOWN}"
294
+ placeholder="${this.placeholder}"
295
+ title="${this.title}"
296
+ .description="${this.description}"
297
+ descriptionType="${this.descriptionType}"
298
+ ?disabled="${this.disabled}"
299
+ ?dark="${this.dark}"
300
+ ?readonly="${this.type !== DropdownType.SEARCH}"
301
+ @on-click="${this._toggleOptions}"
302
+ @keypress="${this._onEnterPress}"
303
+ @on-change="${this._onInputSingle}"
304
+ >
305
+ </tuix-input>
306
+ </div>
307
+ <div class="${classMap(this._getOptionsContainerClasses())}">
308
+ ${this._getOptionsTemplate()}
309
+ </div>
310
+ </div>`;
311
+ }
312
+ };
313
+ __decorate([
314
+ property({ type: Object })
315
+ ], TuixDropdown.prototype, "value", void 0);
316
+ __decorate([
317
+ property({ type: Array })
318
+ ], TuixDropdown.prototype, "options", void 0);
319
+ __decorate([
320
+ property({ type: String })
321
+ ], TuixDropdown.prototype, "placeholder", void 0);
322
+ __decorate([
323
+ property({ type: String })
324
+ ], TuixDropdown.prototype, "title", void 0);
325
+ __decorate([
326
+ property({ type: Boolean, reflect: true })
327
+ ], TuixDropdown.prototype, "disabled", void 0);
328
+ __decorate([
329
+ property({ type: Boolean, reflect: true })
330
+ ], TuixDropdown.prototype, "dark", void 0);
331
+ __decorate([
332
+ property({ type: String })
333
+ ], TuixDropdown.prototype, "description", void 0);
334
+ __decorate([
335
+ property({ type: DescriptionType })
336
+ ], TuixDropdown.prototype, "descriptionType", void 0);
337
+ __decorate([
338
+ property({ type: String })
339
+ ], TuixDropdown.prototype, "type", void 0);
340
+ __decorate([
341
+ state()
342
+ ], TuixDropdown.prototype, "_value", void 0);
343
+ __decorate([
344
+ state()
345
+ ], TuixDropdown.prototype, "_isOptionsVisible", void 0);
346
+ __decorate([
347
+ state()
348
+ ], TuixDropdown.prototype, "_searchingOption", void 0);
349
+ __decorate([
350
+ state()
351
+ ], TuixDropdown.prototype, "_extendedOptions", void 0);
352
+ __decorate([
353
+ query('.t-options-container')
354
+ ], TuixDropdown.prototype, "_optionsContainer", void 0);
355
+ __decorate([
356
+ query('.t-dropdown-container .t-input-dropdown')
357
+ ], TuixDropdown.prototype, "_inputDropdown", void 0);
358
+ TuixDropdown = __decorate([
359
+ customElement('tuix-dropdown')
360
+ ], TuixDropdown);
361
+ export { TuixDropdown };
@@ -0,0 +1,3 @@
1
+ export declare const dropdownHostStyles: import("lit").CSSResult;
2
+ export declare const dropdownMainContainerStyles: import("lit").CSSResult;
3
+ export declare const dropdownOptionStyles: import("lit").CSSResult;
@@ -0,0 +1,125 @@
1
+ import { css, unsafeCSS } from 'lit';
2
+ import { hostStyles } from '../tuix-input/TuixInput.styles.js';
3
+ import { Palette } from '../utils/colors.js';
4
+ import { ScreenSizes } from '../utils/screenSizes.enum.js';
5
+ import { DarkPalette } from '../utils/darkColors.js';
6
+ export const dropdownHostStyles = css `
7
+ ${hostStyles}
8
+ :host {
9
+ --t-field-color-option: ${unsafeCSS(Palette.WHITE)};
10
+ --t-field-color-main: ${unsafeCSS(Palette.MAIN)};
11
+ }
12
+
13
+ :host .t-input-dropdown {
14
+ --t-field-font-weight: 300;
15
+ --t-field-font-size: 1rem;
16
+ --t-field-padding-x: 1rem;
17
+ --t-field-title-left-position: 1rem;
18
+ }
19
+
20
+ @media only screen and (max-width: ${ScreenSizes.TABLET}px) {
21
+ :host .t-input-dropdown {
22
+ --t-field-font-size: 0.938rem;
23
+ --t-field-line-height: 1.125rem;
24
+ }
25
+ }
26
+
27
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
28
+ :host .t-input-dropdown {
29
+ --t-field-font-size: 0.813rem;
30
+ --t-field-line-height: 1rem;
31
+ }
32
+ }
33
+
34
+ :host([dark]) {
35
+ --t-field-color-option: ${unsafeCSS(DarkPalette.ELEVATION_2)};
36
+ }
37
+ `;
38
+ export const dropdownMainContainerStyles = css `
39
+ .t-dropdown-full-container {
40
+ position: relative;
41
+ font-family: 'Rubik', sans-serif;
42
+ }
43
+ .t-dropdown-container .t-input-dropdown {
44
+ --t-field-input-cursor: pointer;
45
+ }
46
+ `;
47
+ export const dropdownOptionStyles = css `
48
+ .t-options-container {
49
+ width: 100%;
50
+ position: absolute;
51
+ top: calc(100% + 2px);
52
+ left: 0;
53
+ border: none;
54
+ border-radius: 0 0 5px 5px;
55
+ background-color: var(--t-field-color-option);
56
+ visibility: collapse;
57
+ overflow-y: auto;
58
+ max-height: 250px;
59
+ color: var(--t-field-color-text);
60
+ box-shadow: 0px 2px 8px 0px ${unsafeCSS(Palette.SHADOW)};
61
+ z-index: 9999;
62
+ }
63
+ .t-options-container::-webkit-scrollbar {
64
+ width: 0.75rem;
65
+ }
66
+ .t-options-container::-webkit-scrollbar-track {
67
+ background-color: transparent;
68
+ }
69
+ .t-options-container::-webkit-scrollbar-thumb {
70
+ background-color: ${unsafeCSS(Palette.PRIMARY_100)};
71
+ border-radius: 0.25rem;
72
+ border: 0.188rem solid transparent;
73
+ background-clip: content-box;
74
+ }
75
+ .t-options-container.show {
76
+ visibility: visible;
77
+ }
78
+ .t-options-container.show.t-with-description {
79
+ top: calc(100% + 2px - 1.5rem);
80
+ }
81
+ @media only screen and (max-height: 500px) {
82
+ .t-options-container {
83
+ max-height: 50vh;
84
+ }
85
+ }
86
+ .t-dropdown-option {
87
+ padding: var(--t-field-padding-y) 1rem;
88
+ cursor: pointer;
89
+ font-size: 1rem;
90
+ line-height: 1.25rem;
91
+ font-weight: 300;
92
+ -webkit-user-select: none;
93
+ -moz-user-select: none;
94
+ -ms-user-select: none;
95
+ user-select: none;
96
+ }
97
+ .t-dropdown-option.t-option-hover {
98
+ background-color: var(--t-field-color-form);
99
+ }
100
+ .t-dropdown-option.t-option-selected {
101
+ color: var(--t-field-color-main);
102
+ }
103
+ .t-dropdown-option.t-option-filtered {
104
+ display: none;
105
+ }
106
+ .t-dropdown-option:focus {
107
+ outline: none;
108
+ }
109
+ @media only screen and (max-width: ${ScreenSizes.TABLET}px) {
110
+ .t-dropdown-option {
111
+ font-size: 0.938rem;
112
+ line-height: 1.125rem;
113
+ --t-field-padding-y: 1.063rem;
114
+ --t-field-padding-top: 1.5rem;
115
+ }
116
+ }
117
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
118
+ .t-dropdown-option {
119
+ font-size: 0.813rem;
120
+ line-height: 1rem;
121
+ --t-field-padding-y: 1rem;
122
+ --t-field-padding-top: 1.375rem;
123
+ }
124
+ }
125
+ `;
@@ -0,0 +1,4 @@
1
+ export declare enum DropdownType {
2
+ SINGLE = "single",
3
+ SEARCH = "search"
4
+ }
@@ -0,0 +1,5 @@
1
+ export var DropdownType;
2
+ (function (DropdownType) {
3
+ DropdownType["SINGLE"] = "single";
4
+ DropdownType["SEARCH"] = "search";
5
+ })(DropdownType || (DropdownType = {}));
@@ -0,0 +1,15 @@
1
+ import { type CustomEventTuixInput } from '../../tuix-input/interfaces/tuix-input.interface.js';
2
+ import { type DetailValue } from '../../utils/interfaces/detail-value.interface.js';
3
+ export type TuixDropdownPlainOption = string | number | boolean;
4
+ export interface TuixDropdownObjectOption {
5
+ name: string;
6
+ value: TuixDropdownPlainOption;
7
+ }
8
+ export type TuixDropdownOption = TuixDropdownPlainOption | TuixDropdownObjectOption;
9
+ export interface TuixDropdownExtendedOption {
10
+ name: string;
11
+ value: TuixDropdownPlainOption;
12
+ filtered: boolean;
13
+ }
14
+ export type CustomEventTuixDropdownSelect<T extends TuixDropdownOption = TuixDropdownOption> = CustomEvent<DetailValue<T>>;
15
+ export type CustomEventTuixDropdownInput = CustomEventTuixInput;
@@ -0,0 +1,15 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+ import { IconName, IconSizeVariant } from './enums/tuix-icon.enums.js';
3
+ import { TextVariant } from '../tuix-text/enums/tuix-text.enums.js';
4
+ export declare class TuixIcon extends LitElement {
5
+ static styles: import("lit").CSSResult;
6
+ name: IconName;
7
+ color?: string | TextVariant;
8
+ size: IconSizeVariant;
9
+ dark: boolean;
10
+ fill?: string | TextVariant;
11
+ private _getSelectedColor;
12
+ private _getSelectedFill;
13
+ private _getIconTemplate;
14
+ render(): TemplateResult<1>;
15
+ }
@@ -0,0 +1,6 @@
1
+ import { html } from 'lit';
2
+ import { IconName } from './enums/tuix-icon.enums.js';
3
+ export declare const iconTemplate: (name?: IconName, color?: string, fill?: string) => ReturnType<typeof html>;
4
+ type IconContentMapType = Record<IconName, string>;
5
+ export declare const iconContentMap: IconContentMapType;
6
+ export {};