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