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,296 @@
1
+ import { css, unsafeCSS } from 'lit';
2
+ import { ScreenSizes } from '../utils/screenSizes.enum.js';
3
+ import { Palette } from '../utils/colors.js';
4
+ import { DarkPalette } from '../utils/darkColors.js';
5
+ import { hexToRgb } from '../utils/hex-rgb.js';
6
+ const inputVars = {
7
+ gapX: '10px',
8
+ iconDesktopSize: '1.5rem',
9
+ iconMobileSize: '1rem',
10
+ paddingX: '1.25rem',
11
+ };
12
+ const rgbDarkValidation = hexToRgb(DarkPalette.VALIDATION);
13
+ const rgbDarkError = hexToRgb(DarkPalette.ERROR);
14
+ export const hostStyles = css `
15
+ :host {
16
+ --t-field-color-form: ${unsafeCSS(Palette.PRIMARY_50)};
17
+ --t-field-color-title: ${unsafeCSS(Palette.PRIMARY_600)};
18
+ --t-field-color-text: ${unsafeCSS(Palette.BLACK)};
19
+ --t-field-color-description: ${unsafeCSS(Palette.NEUTRAL_600)};
20
+ --t-field-color-stroke-hover: ${unsafeCSS(Palette.PRIMARY_300)};
21
+ --t-field-color-stroke-focus: ${unsafeCSS(Palette.MAIN)};
22
+ --t-field-color-text-disabled: ${unsafeCSS(Palette.PRIMARY_300)};
23
+ --t-field-color-stroke-validation: ${unsafeCSS(Palette.VALIDATION_200)};
24
+ --t-field-color-bg-validation: ${unsafeCSS(Palette.VALIDATION_50)};
25
+ --t-field-color-stroke-loading: ${unsafeCSS(Palette.PRIMARY_300)};
26
+ --t-field-color-bg-error: ${unsafeCSS(Palette.ERROR_50)};
27
+ --t-field-color-stroke-error: ${unsafeCSS(Palette.ERROR_200)};
28
+ --t-field-input-cursor: auto;
29
+ --t-field-font-size: 1rem;
30
+ --t-field-font-weight: 300;
31
+ --t-field-line-height: 1.25rem;
32
+ --t-field-padding-x: 1.25rem;
33
+ --t-field-padding-y: 1.125rem;
34
+ --t-field-padding-top: 1.625rem;
35
+ --t-field-padding-bottom: 0.625rem;
36
+ --t-field-title-left-position: 1.25rem;
37
+ }
38
+ :host([dark]) {
39
+ --t-field-color-form: ${unsafeCSS(DarkPalette.PRIMARY_950)};
40
+ --t-field-color-title: ${unsafeCSS(DarkPalette.PRIMARY_400)};
41
+ --t-field-color-text: ${unsafeCSS(DarkPalette.PRIMARY_100)};
42
+ --t-field-color-description: ${unsafeCSS(DarkPalette.NEUTRAL_200)};
43
+ --t-field-color-stroke-focus: ${unsafeCSS(DarkPalette.SECONDARY)};
44
+ --t-field-color-text-disabled: ${unsafeCSS(DarkPalette.PRIMARY_800)};
45
+ --t-field-color-stroke-validation: ${unsafeCSS(DarkPalette.VALIDATION_200)};
46
+ --t-field-color-bg-validation: rgba(
47
+ ${rgbDarkValidation.r},
48
+ ${rgbDarkValidation.g},
49
+ ${rgbDarkValidation.b},
50
+ 0.2
51
+ );
52
+ --t-field-color-bg-error: rgba(
53
+ ${rgbDarkError.r},
54
+ ${rgbDarkError.g},
55
+ ${rgbDarkError.b},
56
+ 0.2
57
+ );
58
+ --t-field-color-stroke-error: ${unsafeCSS(DarkPalette.ERROR_200)};
59
+ }
60
+ `;
61
+ export const inputComponentStyles = css `
62
+ .t-textarea-main-container {
63
+ display: flex;
64
+ flex-direction: column;
65
+ width: 100%;
66
+ height: 100%;
67
+ }
68
+ .t-input-container {
69
+ position: relative;
70
+ --t-padding-x-desktop-with-icon: calc(
71
+ var(--t-field-padding-x) + ${unsafeCSS(inputVars.iconDesktopSize)} +
72
+ ${unsafeCSS(inputVars.gapX)}
73
+ );
74
+ --t-padding-x-mobile-with-icon: calc(
75
+ var(--t-field-padding-x) + ${unsafeCSS(inputVars.iconMobileSize)} +
76
+ ${unsafeCSS(inputVars.gapX)}
77
+ );
78
+ --t-border-size: 1px;
79
+ }
80
+ .t-input-container.t-textarea-container {
81
+ height: 100%;
82
+ }
83
+ .t-input {
84
+ padding: calc(var(--t-field-padding-y) - var(--t-border-size))
85
+ var(--t-field-padding-x);
86
+ border-radius: 4px;
87
+ font-family: 'Rubik', sans-serif;
88
+ cursor: var(--t-field-input-cursor);
89
+ width: 100%;
90
+ box-sizing: border-box;
91
+ }
92
+ .t-input.t-textarea {
93
+ height: 100%;
94
+ display: block;
95
+ }
96
+ .t-input.with-title {
97
+ padding-top: calc(var(--t-field-padding-top) - var(--t-border-size));
98
+ padding-bottom: calc(var(--t-field-padding-bottom) - var(--t-border-size));
99
+ }
100
+ .t-input.with-icon-right {
101
+ padding-right: var(--t-padding-x-desktop-with-icon);
102
+ }
103
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
104
+ .t-input.with-icon-right {
105
+ padding-right: var(--t-padding-x-mobile-with-icon);
106
+ }
107
+ }
108
+ `;
109
+ export const inputFontStyles = css `
110
+ .t-input::placeholder,
111
+ .t-input,
112
+ .t-title {
113
+ font-size: var(--t-field-font-size);
114
+ font-weight: var(--t-field-font-weight);
115
+ line-height: var(--t-field-line-height);
116
+ }
117
+ @media only screen and (max-width: ${ScreenSizes.TABLET}px) {
118
+ :host {
119
+ --t-field-font-size: 0.813rem;
120
+ --t-field-line-height: 1.125rem;
121
+ --t-field-padding-y: 1.063rem;
122
+ --t-field-padding-top: 1.5rem;
123
+ }
124
+ }
125
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
126
+ :host {
127
+ --t-field-font-size: 0.813rem;
128
+ --t-field-line-height: 1rem;
129
+ --t-field-padding-y: 1rem;
130
+ --t-field-padding-top: 1.375rem;
131
+ }
132
+ }
133
+ `;
134
+ export const inputColorStyles = css `
135
+ .t-input {
136
+ background-color: var(--t-field-color-form);
137
+ border: 1px solid var(--t-field-color-form);
138
+ color: var(--t-field-color-text);
139
+ }
140
+ .t-input-container:hover .t-input,
141
+ .t-input:hover {
142
+ border: 1px solid var(--t-field-color-stroke-hover);
143
+ }
144
+ .t-input:focus {
145
+ border: 1px solid var(--t-field-color-stroke-focus);
146
+ outline: 1px solid var(--t-field-color-stroke-focus);
147
+ }
148
+ .t-input[disabled]:disabled {
149
+ cursor: not-allowed;
150
+ border: 1px solid var(--t-field-color-form);
151
+ color: var(--t-field-color-text-disabled);
152
+ }
153
+ .t-input.with-title::placeholder {
154
+ color: transparent;
155
+ }
156
+ .t-input::placeholder,
157
+ .t-input.with-title:focus::placeholder {
158
+ color: var(--t-field-color-title);
159
+ }
160
+ .t-input.with-warning {
161
+ border: 1px solid var(--t-field-color-stroke-validation);
162
+ background-color: var(--t-field-color-bg-validation);
163
+ }
164
+ .t-input.with-error {
165
+ border: 1px solid var(--t-field-color-stroke-error);
166
+ background-color: var(--t-field-color-bg-error);
167
+ }
168
+ .t-input.with-loading {
169
+ border: 1px solid var(--t-field-color-stroke-loading);
170
+ }
171
+ `;
172
+ export const inputTitleStyles = css `
173
+ .t-title {
174
+ position: absolute;
175
+ top: 50%;
176
+ left: var(--t-field-title-left-position);
177
+ font-family: 'Rubik', sans-serif;
178
+ color: var(--t-field-color-title);
179
+ transform: translateY(-50%);
180
+ transition-duration: 0.3s;
181
+ pointer-events: none;
182
+ -webkit-user-select: none;
183
+ -moz-user-select: none;
184
+ -ms-user-select: none;
185
+ user-select: none;
186
+ }
187
+ .t-textarea-container .t-title {
188
+ top: 1rem;
189
+ transform: none;
190
+ }
191
+ .t-input.with-title:focus + .t-title,
192
+ .t-input.with-title:not(:placeholder-shown) + .t-title {
193
+ font-size: 0.75rem;
194
+ font-weight: 300;
195
+ line-height: 0.875rem;
196
+ transform: translateY(0);
197
+ top: 0.5rem;
198
+ }
199
+ `;
200
+ export const inputIconStyles = css `
201
+ .t-input-container .t-icon-set-container {
202
+ height: ${unsafeCSS(inputVars.iconDesktopSize)};
203
+ width: ${unsafeCSS(inputVars.iconDesktopSize)};
204
+ cursor: var(--t-field-input-cursor);
205
+ }
206
+ .t-icon-set-container.t-icon-click {
207
+ cursor: pointer;
208
+ }
209
+ .t-input-container .t-icon-set-container.t-icon-right {
210
+ position: absolute;
211
+ top: 50%;
212
+ right: var(--t-field-padding-x);
213
+ transform: translateY(-50%);
214
+ }
215
+ .t-input-container .t-icon-set-container.t-icon-left {
216
+ position: absolute;
217
+ top: 50%;
218
+ left: var(--t-field-padding-x);
219
+ transform: translateY(-50%);
220
+ }
221
+ .t-icon-inactive {
222
+ display: inline;
223
+ }
224
+ .t-icon-active {
225
+ display: none;
226
+ }
227
+ .t-icon-disabled {
228
+ display: none;
229
+ }
230
+ .t-input-container:hover .t-icon-set-container .t-icon-inactive,
231
+ .t-input:hover ~ .t-icon-set-container .t-icon-inactive,
232
+ .t-input:focus ~ .t-icon-set-container .t-icon-inactive {
233
+ display: none;
234
+ }
235
+ .t-input-container:hover .t-icon-set-container .t-icon-active,
236
+ .t-input:hover ~ .t-icon-set-container .t-icon-active,
237
+ .t-input:focus ~ .t-icon-set-container .t-icon-active {
238
+ display: inline;
239
+ }
240
+ .t-input[disabled] ~ .t-icon-set-container .t-icon-active {
241
+ display: none;
242
+ }
243
+ .t-input[disabled] ~ .t-icon-set-container .t-icon-inactive {
244
+ display: none;
245
+ }
246
+ .t-input[disabled] ~ .t-icon-set-container .t-icon-disabled {
247
+ display: inline;
248
+ cursor: not-allowed;
249
+ }
250
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
251
+ .t-input-container .t-icon-set-container {
252
+ height: ${unsafeCSS(inputVars.iconMobileSize)};
253
+ width: ${unsafeCSS(inputVars.iconMobileSize)};
254
+ }
255
+ }
256
+ `;
257
+ export const inputSearchStyles = css `
258
+ .t-input[type='search'] {
259
+ padding-left: var(--t-padding-x-desktop-with-icon);
260
+ }
261
+ .t-input[type='search'] + .t-title {
262
+ left: var(--t-padding-x-desktop-with-icon);
263
+ }
264
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
265
+ .t-input[type='search'] {
266
+ padding-left: var(--t-padding-x-mobile-with-icon);
267
+ }
268
+ .t-input[type='search'] + .t-title {
269
+ left: var(--t-padding-x-mobile-with-icon);
270
+ }
271
+ }
272
+ input[type='search']::-webkit-search-decoration,
273
+ input[type='search']::-webkit-search-cancel-button,
274
+ input[type='search']::-webkit-search-results-button,
275
+ input[type='search']::-webkit-search-results-decoration {
276
+ display: none;
277
+ }
278
+ `;
279
+ export const inputDescriptionStyles = css `
280
+ .t-input-description-container {
281
+ margin-top: 0.5rem;
282
+ font-family: 'Rubik', sans-serif;
283
+ font-size: 0.75rem;
284
+ line-height: 1rem;
285
+ color: var(--t-field-color-description);
286
+ display: flex;
287
+ justify-content: space-between;
288
+ }
289
+ .t-input-description-container .t-letter-counter {
290
+ align-self: flex-end;
291
+ }
292
+ .t-input-description-container .t-input-description {
293
+ display: flex;
294
+ gap: 0.5rem;
295
+ }
296
+ `;
@@ -0,0 +1,38 @@
1
+ import { IconName } from '../../tuix-icon/enums/tuix-icon.enums.js';
2
+ import { Palette } from '../../utils/colors.js';
3
+ import { DarkPalette } from '../../utils/darkColors.js';
4
+ export declare enum InputType {
5
+ TEXT = "text",
6
+ SEARCH = "search",
7
+ PASSWORD = "password",
8
+ TEXT_AREA = "textarea"
9
+ }
10
+ export declare enum InputIconLocation {
11
+ LEFT = "left",
12
+ RIGHT = "right"
13
+ }
14
+ export declare enum DescriptionType {
15
+ TEXT = "text",
16
+ WARNING = "warning",
17
+ ERROR = "error",
18
+ SUCCESS = "success",
19
+ LOADING = "loading"
20
+ }
21
+ export declare const IconByDescriptionType: {
22
+ warning: IconName;
23
+ error: IconName;
24
+ success: IconName;
25
+ loading: IconName;
26
+ };
27
+ export declare const IconDescriptionColorLight: {
28
+ warning: Palette;
29
+ error: Palette;
30
+ success: Palette;
31
+ loading: Palette;
32
+ };
33
+ export declare const IconDescriptionColorDark: {
34
+ warning: DarkPalette;
35
+ error: DarkPalette;
36
+ success: DarkPalette;
37
+ loading: DarkPalette;
38
+ };
@@ -0,0 +1,41 @@
1
+ import { IconName } from '../../tuix-icon/enums/tuix-icon.enums.js';
2
+ import { Palette } from '../../utils/colors.js';
3
+ import { DarkPalette } from '../../utils/darkColors.js';
4
+ export var InputType;
5
+ (function (InputType) {
6
+ InputType["TEXT"] = "text";
7
+ InputType["SEARCH"] = "search";
8
+ InputType["PASSWORD"] = "password";
9
+ InputType["TEXT_AREA"] = "textarea";
10
+ })(InputType || (InputType = {}));
11
+ export var InputIconLocation;
12
+ (function (InputIconLocation) {
13
+ InputIconLocation["LEFT"] = "left";
14
+ InputIconLocation["RIGHT"] = "right";
15
+ })(InputIconLocation || (InputIconLocation = {}));
16
+ export var DescriptionType;
17
+ (function (DescriptionType) {
18
+ DescriptionType["TEXT"] = "text";
19
+ DescriptionType["WARNING"] = "warning";
20
+ DescriptionType["ERROR"] = "error";
21
+ DescriptionType["SUCCESS"] = "success";
22
+ DescriptionType["LOADING"] = "loading";
23
+ })(DescriptionType || (DescriptionType = {}));
24
+ export const IconByDescriptionType = {
25
+ [DescriptionType.WARNING]: IconName.TRIANGLE_EXCLAMATION,
26
+ [DescriptionType.ERROR]: IconName.CIRCLE_X,
27
+ [DescriptionType.SUCCESS]: IconName.CIRCLE_CHECK,
28
+ [DescriptionType.LOADING]: IconName.LOADER,
29
+ };
30
+ export const IconDescriptionColorLight = {
31
+ [DescriptionType.WARNING]: Palette.VALIDATION,
32
+ [DescriptionType.ERROR]: Palette.ERROR,
33
+ [DescriptionType.SUCCESS]: Palette.SUCCESS,
34
+ [DescriptionType.LOADING]: Palette.PRIMARY_300,
35
+ };
36
+ export const IconDescriptionColorDark = {
37
+ [DescriptionType.WARNING]: DarkPalette.VALIDATION,
38
+ [DescriptionType.ERROR]: DarkPalette.ERROR,
39
+ [DescriptionType.SUCCESS]: DarkPalette.SUCCESS,
40
+ [DescriptionType.LOADING]: DarkPalette.PRIMARY_300,
41
+ };
@@ -0,0 +1,18 @@
1
+ import { IconName } from '../../tuix-icon/enums/tuix-icon.enums.js';
2
+ import { type DetailValue } from '../../utils/interfaces/detail-value.interface.js';
3
+ import { InputIconLocation } from '../enums/tuix-input.enums.js';
4
+ import { DarkPalette } from '../../utils/darkColors.js';
5
+ import { Palette } from '../../utils/colors.js';
6
+ export declare const InputState: {
7
+ INACTIVE: string;
8
+ ACTIVE: string;
9
+ DISABLED: string;
10
+ };
11
+ export type InputState = (typeof InputState)[keyof typeof InputState];
12
+ export interface FormatIconSetParams {
13
+ iconName: IconName;
14
+ colorByState: Record<InputState, DarkPalette | Palette>;
15
+ location?: InputIconLocation;
16
+ clickHandler?: (e: MouseEvent) => void;
17
+ }
18
+ export type CustomEventTuixInput = CustomEvent<DetailValue<string>>;
@@ -0,0 +1,5 @@
1
+ export const InputState = {
2
+ INACTIVE: 'inactive',
3
+ ACTIVE: 'active',
4
+ DISABLED: 'disabled',
5
+ };
@@ -0,0 +1,15 @@
1
+ import { LitElement, type TemplateResult } from 'lit';
2
+ import { MainVariant } from '../utils/mainVariant.enum.js';
3
+ import { LinkTarget } from './enums/linkTarget.enum.js';
4
+ export declare class TuixLink extends LitElement {
5
+ static styles: import("lit").CSSResult[];
6
+ href?: string;
7
+ target: LinkTarget;
8
+ variant: MainVariant;
9
+ disabled: boolean;
10
+ dark: boolean;
11
+ private _getClassMap;
12
+ private _anchorTemplate;
13
+ private _divTemplate;
14
+ render(): TemplateResult;
15
+ }
@@ -0,0 +1,71 @@
1
+ import { __decorate } from "tslib";
2
+ import { html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import { MainVariant } from '../utils/mainVariant.enum.js';
5
+ import { LinkTarget } from './enums/linkTarget.enum.js';
6
+ import { classMap } from 'lit/directives/class-map.js';
7
+ import { linkStyles } from './TuixLink.styles.js';
8
+ import { linkFontStyles } from '../tuix-text/TuixText.styles.js';
9
+ let TuixLink = class TuixLink extends LitElement {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.target = LinkTarget.BLANK;
13
+ this.variant = MainVariant.PRIMARY;
14
+ this.disabled = false;
15
+ this.dark = false;
16
+ }
17
+ static { this.styles = [linkStyles, linkFontStyles]; }
18
+ _getClassMap() {
19
+ return {
20
+ link: true,
21
+ disabled: this.disabled,
22
+ [MainVariant.SECONDARY]: this.variant === MainVariant.SECONDARY,
23
+ };
24
+ }
25
+ _anchorTemplate() {
26
+ return html `
27
+ <a
28
+ target="${this.disabled ? LinkTarget.SELF : this.target}"
29
+ class="${classMap(this._getClassMap())}"
30
+ href="${this.disabled ? 'javascript:void(0)' : this.href}"
31
+ >
32
+ <slot></slot>
33
+ </a>
34
+ `;
35
+ }
36
+ _divTemplate() {
37
+ return html `
38
+ <div class="${classMap(this._getClassMap())}">
39
+ <slot></slot>
40
+ </div>
41
+ `;
42
+ }
43
+ render() {
44
+ const isValidAnchor = this.href && !this.disabled;
45
+ if (isValidAnchor) {
46
+ return this._anchorTemplate();
47
+ }
48
+ else {
49
+ return this._divTemplate();
50
+ }
51
+ }
52
+ };
53
+ __decorate([
54
+ property({ type: String })
55
+ ], TuixLink.prototype, "href", void 0);
56
+ __decorate([
57
+ property({ type: LinkTarget })
58
+ ], TuixLink.prototype, "target", void 0);
59
+ __decorate([
60
+ property({ type: MainVariant, reflect: true })
61
+ ], TuixLink.prototype, "variant", void 0);
62
+ __decorate([
63
+ property({ type: Boolean, reflect: true })
64
+ ], TuixLink.prototype, "disabled", void 0);
65
+ __decorate([
66
+ property({ type: Boolean, reflect: true })
67
+ ], TuixLink.prototype, "dark", void 0);
68
+ TuixLink = __decorate([
69
+ customElement('tuix-link')
70
+ ], TuixLink);
71
+ export { TuixLink };
@@ -0,0 +1,2 @@
1
+ export declare const LINK_TEXT_COLOR_VAR_NAME = "--t-link-text-color";
2
+ export declare const linkStyles: import("lit").CSSResult;
@@ -0,0 +1,55 @@
1
+ import { css, unsafeCSS } from 'lit';
2
+ import { MainVariant } from '../utils/mainVariant.enum.js';
3
+ import { Palette } from '../utils/colors.js';
4
+ import { DarkPalette } from '../utils/darkColors.js';
5
+ export const LINK_TEXT_COLOR_VAR_NAME = '--t-link-text-color';
6
+ export const linkStyles = css `
7
+ ${unsafeCSS(`
8
+ :host {
9
+ --t-link-border-color: ${Palette.MAIN};
10
+ ${LINK_TEXT_COLOR_VAR_NAME}: ${Palette.MAIN}
11
+ }
12
+
13
+ :host([dark]) {
14
+ --t-link-border-color: ${DarkPalette.MAIN};
15
+ ${LINK_TEXT_COLOR_VAR_NAME}: ${DarkPalette.MAIN}
16
+ }
17
+
18
+ :host([variant=${MainVariant.SECONDARY}]) {
19
+ --t-link-border-color: ${Palette.WHITE};
20
+ ${LINK_TEXT_COLOR_VAR_NAME}: ${Palette.WHITE}
21
+ }
22
+
23
+ :host([variant=${MainVariant.SECONDARY}][dark]) {
24
+ --t-link-border-color: ${DarkPalette.PRIMARY_50};
25
+ ${LINK_TEXT_COLOR_VAR_NAME}: ${DarkPalette.PRIMARY_50}
26
+ }
27
+
28
+ :host([disabled]) .link.disabled {
29
+ --t-link-border-color: ${Palette.PRIMARY_300};
30
+ ${LINK_TEXT_COLOR_VAR_NAME}: ${Palette.PRIMARY_300}
31
+ }
32
+
33
+ .link {
34
+ text-decoration: none;
35
+ display: inline;
36
+ color: var(${LINK_TEXT_COLOR_VAR_NAME});
37
+ border-bottom: solid 1px var(--t-link-border-active-color, transparent);
38
+ }
39
+ .link:hover {
40
+ border-bottom: solid 1px var(--t-link-border-color);
41
+ cursor: pointer;
42
+ }
43
+ .link.secondary {
44
+ color: var(${LINK_TEXT_COLOR_VAR_NAME});
45
+ }
46
+ .link.secondary:hover {
47
+ border-bottom: solid 1px var(--t-link-border-color);
48
+ }
49
+ .link.disabled {
50
+ border-bottom: solid 1px var(--t-link-border-color);
51
+ color: var(${LINK_TEXT_COLOR_VAR_NAME});
52
+ cursor: not-allowed;
53
+ }
54
+ `)}
55
+ `;
@@ -0,0 +1,6 @@
1
+ export declare enum LinkTarget {
2
+ BLANK = "_blank",
3
+ SELF = "_self",
4
+ PARENT = "_parent",
5
+ TOP = "_top"
6
+ }
@@ -0,0 +1,7 @@
1
+ export var LinkTarget;
2
+ (function (LinkTarget) {
3
+ LinkTarget["BLANK"] = "_blank";
4
+ LinkTarget["SELF"] = "_self";
5
+ LinkTarget["PARENT"] = "_parent";
6
+ LinkTarget["TOP"] = "_top";
7
+ })(LinkTarget || (LinkTarget = {}));
@@ -0,0 +1,11 @@
1
+ import { LitElement } from 'lit';
2
+ import '../tuix-icon/TuixIcon.js';
3
+ import '../tuix-paper/TuixPaper.js';
4
+ export declare class TuixModal extends LitElement {
5
+ static styles: import("lit").CSSResult[];
6
+ visible: boolean;
7
+ dark: boolean;
8
+ scrollable: boolean;
9
+ protected _onClose(): void;
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ }
@@ -0,0 +1,65 @@
1
+ import { __decorate } from "tslib";
2
+ import { html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import '../tuix-icon/TuixIcon.js';
5
+ import '../tuix-paper/TuixPaper.js';
6
+ import { BorderRadiusPaper, PaperElevation, } from '../tuix-paper/enums/tuix-paper.enum.js';
7
+ import { commonModalStyles, mobileModalStyles } from './TuixModal.styles.js';
8
+ import { TextVariant } from '../tuix-text/enums/tuix-text.enums.js';
9
+ import { IconName, IconSizeVariant, } from '../tuix-icon/enums/tuix-icon.enums.js';
10
+ let TuixModal = class TuixModal extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.visible = false;
14
+ this.dark = false;
15
+ this.scrollable = false;
16
+ }
17
+ static { this.styles = [commonModalStyles, mobileModalStyles]; }
18
+ _onClose() {
19
+ this.visible = false;
20
+ this.dispatchEvent(new CustomEvent('on-close', { bubbles: true }));
21
+ }
22
+ render() {
23
+ return html `
24
+ <tuix-paper
25
+ class="modal-container"
26
+ elevation=${PaperElevation.VARIANT_4}
27
+ border-radius=${BorderRadiusPaper.SOFT}
28
+ ?dark=${this.dark}
29
+ >
30
+ <div class="content">
31
+ <header>
32
+ <slot name="title"></slot>
33
+ <tuix-icon
34
+ @click=${this._onClose}
35
+ class="close-icon"
36
+ size="${IconSizeVariant.MEDIUM}"
37
+ name="${IconName.X}"
38
+ color="${TextVariant.MAIN}"
39
+ ?dark=${this.dark}
40
+ ></tuix-icon>
41
+ </header>
42
+ <div class="body" ?scrollable=${this.scrollable}>
43
+ <slot name="body"></slot>
44
+ </div>
45
+ <div class="action-buttons">
46
+ <slot name="actions"></slot>
47
+ </div>
48
+ </div>
49
+ </tuix-paper>
50
+ `;
51
+ }
52
+ };
53
+ __decorate([
54
+ property({ type: Boolean, reflect: true })
55
+ ], TuixModal.prototype, "visible", void 0);
56
+ __decorate([
57
+ property({ type: Boolean, reflect: true })
58
+ ], TuixModal.prototype, "dark", void 0);
59
+ __decorate([
60
+ property({ type: Boolean, reflect: true })
61
+ ], TuixModal.prototype, "scrollable", void 0);
62
+ TuixModal = __decorate([
63
+ customElement('tuix-modal')
64
+ ], TuixModal);
65
+ export { TuixModal };
@@ -0,0 +1,2 @@
1
+ export declare const commonModalStyles: import("lit").CSSResult;
2
+ export declare const mobileModalStyles: import("lit").CSSResult;