tuix-webcomponents 0.0.21 → 0.1.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 +29 -5
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tuix-button/TuixButton.d.ts +17 -0
- package/dist/src/tuix-button/TuixButton.js +108 -0
- package/dist/src/tuix-button/TuixButton.js.map +1 -0
- package/dist/src/tuix-button/TuixButton.styles.d.ts +2 -0
- package/dist/src/tuix-button/TuixButton.styles.js +74 -0
- package/dist/src/tuix-button/TuixButton.styles.js.map +1 -0
- package/dist/src/tuix-button/enums/tuix-button.enums.d.ts +2 -0
- package/dist/src/tuix-button/enums/tuix-button.enums.js +7 -0
- package/dist/src/tuix-button/enums/tuix-button.enums.js.map +1 -0
- package/dist/src/tuix-dropdown/TuixDropdown.d.ts +46 -0
- package/dist/src/tuix-dropdown/TuixDropdown.js +275 -0
- package/dist/src/tuix-dropdown/TuixDropdown.js.map +1 -0
- package/dist/src/tuix-dropdown/TuixDropdown.styles.d.ts +3 -0
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +85 -0
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +1 -0
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +10 -0
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +13 -0
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js.map +1 -0
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +1 -0
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +2 -0
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js.map +1 -0
- package/dist/src/tuix-icon/TuixIcon.d.ts +11 -0
- package/dist/src/tuix-icon/TuixIcon.icons.d.ts +6 -0
- package/dist/src/tuix-icon/TuixIcon.icons.js +103 -0
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +1 -0
- package/dist/src/tuix-icon/TuixIcon.js +65 -0
- package/dist/src/tuix-icon/TuixIcon.js.map +1 -0
- package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +43 -0
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js +52 -0
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +1 -0
- package/dist/src/tuix-icon-button/TuixIconButton.d.ts +14 -0
- package/dist/src/tuix-icon-button/TuixIconButton.js +80 -0
- package/dist/src/tuix-icon-button/TuixIconButton.js.map +1 -0
- package/dist/src/tuix-input/TuixInput.d.ts +46 -0
- package/dist/src/tuix-input/TuixInput.js +327 -0
- package/dist/src/tuix-input/TuixInput.js.map +1 -0
- package/dist/src/tuix-input/TuixInput.styles.d.ts +8 -0
- package/dist/src/tuix-input/TuixInput.styles.js +307 -0
- package/dist/src/tuix-input/TuixInput.styles.js.map +1 -0
- package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +36 -0
- package/dist/src/tuix-input/enums/tuix-input.enums.js +42 -0
- package/dist/src/tuix-input/enums/tuix-input.enums.js.map +1 -0
- package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +13 -0
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js +2 -0
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js.map +1 -0
- package/dist/src/tuix-link/TuixLink.d.ts +11 -0
- package/dist/src/tuix-link/TuixLink.js +72 -0
- package/dist/src/tuix-link/TuixLink.js.map +1 -0
- package/dist/src/tuix-link/enums/linkTarget.enum.d.ts +6 -0
- package/dist/src/tuix-link/enums/linkTarget.enum.js +8 -0
- package/dist/src/tuix-link/enums/linkTarget.enum.js.map +1 -0
- package/dist/src/tuix-paper/TuixPaper.d.ts +7 -0
- package/dist/src/tuix-paper/TuixPaper.js +40 -0
- package/dist/src/tuix-paper/TuixPaper.js.map +1 -0
- package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +7 -0
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js +9 -0
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +1 -0
- package/dist/src/tuix-text/TuixText.d.ts +3 -4
- package/dist/src/tuix-text/TuixText.js +10 -128
- package/dist/src/tuix-text/TuixText.js.map +1 -1
- package/dist/src/tuix-text/TuixText.styles.d.ts +1 -0
- package/dist/src/tuix-text/TuixText.styles.js +114 -0
- package/dist/src/tuix-text/TuixText.styles.js.map +1 -0
- package/dist/src/{enums → tuix-text/enums}/tuix-text.enums.d.ts +6 -8
- package/dist/src/{enums → tuix-text/enums}/tuix-text.enums.js +5 -9
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +1 -0
- package/dist/src/utils/colors.d.ts +12 -10
- package/dist/src/utils/colors.js +42 -7
- package/dist/src/utils/colors.js.map +1 -1
- package/dist/src/utils/darkColors.d.ts +1 -0
- package/dist/src/utils/darkColors.js +11 -0
- package/dist/src/utils/darkColors.js.map +1 -0
- package/dist/src/utils/hex-rgb.d.ts +5 -0
- package/dist/src/utils/hex-rgb.js +16 -0
- package/dist/src/utils/hex-rgb.js.map +1 -0
- package/dist/src/utils/mainVariant.enum.d.ts +4 -0
- package/dist/src/utils/mainVariant.enum.js +6 -0
- package/dist/src/utils/mainVariant.enum.js.map +1 -0
- package/dist/src/utils/screenSizes.enum.d.ts +4 -0
- package/dist/src/utils/screenSizes.enum.js +7 -0
- package/dist/src/utils/screenSizes.enum.js.map +1 -0
- package/dist/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +18 -7
- package/dist/src/enums/tuix-text.enums.js.map +0 -1
|
@@ -0,0 +1,307 @@
|
|
|
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
|
+
iconTabletSize: '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_300)};
|
|
18
|
+
--t-field-color-text: ${unsafeCSS(palette.dark)};
|
|
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
|
+
}
|
|
30
|
+
:host([dark]) {
|
|
31
|
+
--t-field-color-form: ${unsafeCSS(darkPalette.primary_950)};
|
|
32
|
+
--t-field-color-text: ${unsafeCSS(darkPalette.primary_100)};
|
|
33
|
+
--t-field-color-description: ${unsafeCSS(darkPalette.neutral_200)};
|
|
34
|
+
--t-field-color-stroke-focus: ${unsafeCSS(darkPalette.secondary)};
|
|
35
|
+
--t-field-color-text-disabled: ${unsafeCSS(darkPalette.primary_800)};
|
|
36
|
+
--t-field-color-stroke-validation: ${unsafeCSS(darkPalette.validation_200)};
|
|
37
|
+
--t-field-color-bg-validation: rgba(
|
|
38
|
+
${rgbDarkValidation.r},
|
|
39
|
+
${rgbDarkValidation.g},
|
|
40
|
+
${rgbDarkValidation.b},
|
|
41
|
+
0.2
|
|
42
|
+
);
|
|
43
|
+
--t-field-color-bg-error: rgba(
|
|
44
|
+
${rgbDarkError.r},
|
|
45
|
+
${rgbDarkError.g},
|
|
46
|
+
${rgbDarkError.b},
|
|
47
|
+
0.2
|
|
48
|
+
);
|
|
49
|
+
--t-field-color-stroke-error: ${unsafeCSS(darkPalette.error_200)};
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
export const inputComponentStyles = css `
|
|
53
|
+
.t-input-container {
|
|
54
|
+
position: relative;
|
|
55
|
+
--t-padding-x-desktop-with-icon: calc(
|
|
56
|
+
${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconDesktopSize)} +
|
|
57
|
+
${unsafeCSS(inputVars.gapX)}
|
|
58
|
+
);
|
|
59
|
+
--t-padding-x-tablet-with-icon: calc(
|
|
60
|
+
${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconTabletSize)} +
|
|
61
|
+
${unsafeCSS(inputVars.gapX)}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
.t-input {
|
|
65
|
+
padding: 1rem ${unsafeCSS(inputVars.paddingX)};
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
font-family: 'rubik', sans-serif;
|
|
68
|
+
cursor: var(--t-field-input-cursor);
|
|
69
|
+
}
|
|
70
|
+
.t-input.with-title {
|
|
71
|
+
padding-top: 1.5rem;
|
|
72
|
+
padding-bottom: 0.5rem;
|
|
73
|
+
}
|
|
74
|
+
.t-input.with-icon-right {
|
|
75
|
+
padding-right: var(--t-padding-x-desktop-with-icon);
|
|
76
|
+
}
|
|
77
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
78
|
+
.t-input {
|
|
79
|
+
padding-top: 0.875rem;
|
|
80
|
+
padding-bottom: 0.875rem;
|
|
81
|
+
}
|
|
82
|
+
.t-input.with-title {
|
|
83
|
+
padding-top: 1.375rem;
|
|
84
|
+
padding-bottom: 0.375rem;
|
|
85
|
+
}
|
|
86
|
+
.t-input.with-icon-right {
|
|
87
|
+
padding-right: var(--t-padding-x-tablet-with-icon);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
91
|
+
.t-input {
|
|
92
|
+
padding-top: 0.75rem;
|
|
93
|
+
padding-bottom: 0.75rem;
|
|
94
|
+
}
|
|
95
|
+
.t-input.with-title {
|
|
96
|
+
padding-top: 1.25rem;
|
|
97
|
+
padding-bottom: 0.25rem;
|
|
98
|
+
}
|
|
99
|
+
.t-input.with-icon-right {
|
|
100
|
+
padding-right: var(--t-padding-x-tablet-with-icon);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
104
|
+
export const inputFontStyles = css `
|
|
105
|
+
.t-input::placeholder,
|
|
106
|
+
.t-input,
|
|
107
|
+
.t-title {
|
|
108
|
+
font-size: 1rem;
|
|
109
|
+
font-weight: 400;
|
|
110
|
+
line-height: 1.5rem;
|
|
111
|
+
}
|
|
112
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
113
|
+
.t-input::placeholder {
|
|
114
|
+
font-size: 0.875rem;
|
|
115
|
+
line-height: 1.25rem;
|
|
116
|
+
}
|
|
117
|
+
.t-input {
|
|
118
|
+
font-size: 1rem;
|
|
119
|
+
line-height: 1.25rem;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
123
|
+
.t-input {
|
|
124
|
+
font-size: 0.875rem;
|
|
125
|
+
line-height: 1rem;
|
|
126
|
+
}
|
|
127
|
+
.t-input::placeholder {
|
|
128
|
+
line-height: 1rem;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
export const inputColorStyles = css `
|
|
133
|
+
.t-input {
|
|
134
|
+
background-color: var(--t-field-color-form);
|
|
135
|
+
border: 1px solid var(--t-field-color-form);
|
|
136
|
+
color: var(--t-field-color-text);
|
|
137
|
+
}
|
|
138
|
+
.t-input-container:hover .t-input,
|
|
139
|
+
.t-input:hover {
|
|
140
|
+
border: 1px solid var(--t-field-color-stroke-hover);
|
|
141
|
+
}
|
|
142
|
+
.t-input:focus {
|
|
143
|
+
border: 1px solid var(--t-field-color-stroke-focus);
|
|
144
|
+
outline: 1px solid var(--t-field-color-stroke-focus);
|
|
145
|
+
}
|
|
146
|
+
.t-input[disabled] {
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
color: var(--t-field-color-text-disabled);
|
|
149
|
+
}
|
|
150
|
+
.t-input.with-title::placeholder {
|
|
151
|
+
color: transparent;
|
|
152
|
+
}
|
|
153
|
+
.t-input::placeholder,
|
|
154
|
+
.t-input.with-title:focus::placeholder {
|
|
155
|
+
color: var(--t-field-color-title);
|
|
156
|
+
}
|
|
157
|
+
.t-input.with-warning {
|
|
158
|
+
border: 1px solid var(--t-field-color-stroke-validation);
|
|
159
|
+
background-color: var(--t-field-color-bg-validation);
|
|
160
|
+
}
|
|
161
|
+
.t-input.with-error {
|
|
162
|
+
border: 1px solid var(--t-field-color-stroke-error);
|
|
163
|
+
background-color: var(--t-field-color-bg-error);
|
|
164
|
+
}
|
|
165
|
+
.t-input.with-loading {
|
|
166
|
+
border: 1px solid var(--t-field-color-stroke-loading);
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
export const inputTitleStyles = css `
|
|
170
|
+
.t-title {
|
|
171
|
+
position: absolute;
|
|
172
|
+
top: 50%;
|
|
173
|
+
left: 1.25rem;
|
|
174
|
+
font-family: 'rubik', sans-serif;
|
|
175
|
+
color: var(--t-field-color-title);
|
|
176
|
+
transform: translateY(-50%);
|
|
177
|
+
transition-duration: 0.3s;
|
|
178
|
+
pointer-events: none;
|
|
179
|
+
}
|
|
180
|
+
.t-textarea-container .t-title {
|
|
181
|
+
top: 1rem;
|
|
182
|
+
transform: none;
|
|
183
|
+
}
|
|
184
|
+
.t-input.with-title:focus + .t-title,
|
|
185
|
+
.t-input.with-title:not(:placeholder-shown) + .t-title {
|
|
186
|
+
font-size: 0.75rem;
|
|
187
|
+
font-weight: 400;
|
|
188
|
+
line-height: 1rem;
|
|
189
|
+
transform: translateY(0);
|
|
190
|
+
top: 0.5rem;
|
|
191
|
+
}
|
|
192
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
193
|
+
.t-title {
|
|
194
|
+
font-size: 0.875rem;
|
|
195
|
+
line-height: 1.25rem;
|
|
196
|
+
}
|
|
197
|
+
.t-input.with-title:focus + .t-title,
|
|
198
|
+
.t-input.with-title:not(:placeholder-shown) + .t-title {
|
|
199
|
+
top: 0.375rem;
|
|
200
|
+
}
|
|
201
|
+
.t-textarea-container .t-title {
|
|
202
|
+
top: 0.875rem;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
206
|
+
.t-input.with-title:focus + .t-title,
|
|
207
|
+
.t-input.with-title:not(:placeholder-shown) + .t-title {
|
|
208
|
+
top: 0.25rem;
|
|
209
|
+
}
|
|
210
|
+
.t-textarea-container .t-title {
|
|
211
|
+
top: 0.75rem;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
`;
|
|
215
|
+
export const inputIconStyles = css `
|
|
216
|
+
.t-icon-set-container.t-icon-click {
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
}
|
|
219
|
+
.t-input-container .t-icon-set-container {
|
|
220
|
+
height: ${unsafeCSS(inputVars.iconDesktopSize)};
|
|
221
|
+
width: ${unsafeCSS(inputVars.iconDesktopSize)};
|
|
222
|
+
}
|
|
223
|
+
.t-input-container .t-icon-set-container.t-icon-right {
|
|
224
|
+
position: absolute;
|
|
225
|
+
top: 50%;
|
|
226
|
+
right: ${unsafeCSS(inputVars.paddingX)};
|
|
227
|
+
transform: translateY(-50%);
|
|
228
|
+
}
|
|
229
|
+
.t-input-container .t-icon-set-container.t-icon-left {
|
|
230
|
+
position: absolute;
|
|
231
|
+
top: 50%;
|
|
232
|
+
left: ${unsafeCSS(inputVars.paddingX)};
|
|
233
|
+
transform: translateY(-50%);
|
|
234
|
+
}
|
|
235
|
+
.t-icon-inactive {
|
|
236
|
+
display: inline;
|
|
237
|
+
}
|
|
238
|
+
.t-icon-active {
|
|
239
|
+
display: none;
|
|
240
|
+
}
|
|
241
|
+
.t-icon-disabled {
|
|
242
|
+
display: none;
|
|
243
|
+
}
|
|
244
|
+
.t-input-container:hover .t-icon-set-container .t-icon-inactive,
|
|
245
|
+
.t-input:hover ~ .t-icon-set-container .t-icon-inactive,
|
|
246
|
+
.t-input:focus ~ .t-icon-set-container .t-icon-inactive {
|
|
247
|
+
display: none;
|
|
248
|
+
}
|
|
249
|
+
.t-input-container:hover .t-icon-set-container .t-icon-active,
|
|
250
|
+
.t-input:hover ~ .t-icon-set-container .t-icon-active,
|
|
251
|
+
.t-input:focus ~ .t-icon-set-container .t-icon-active {
|
|
252
|
+
display: inline;
|
|
253
|
+
}
|
|
254
|
+
.t-input[disabled] ~ .t-icon-set-container .t-icon-inactive {
|
|
255
|
+
display: none;
|
|
256
|
+
}
|
|
257
|
+
.t-input[disabled] ~ .t-icon-set-container .t-icon-disabled {
|
|
258
|
+
display: inline;
|
|
259
|
+
}
|
|
260
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
261
|
+
.t-input-container .t-icon-set-container {
|
|
262
|
+
height: ${unsafeCSS(inputVars.iconTabletSize)};
|
|
263
|
+
width: ${unsafeCSS(inputVars.iconTabletSize)};
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
`;
|
|
267
|
+
export const inputSearchStyles = css `
|
|
268
|
+
.t-input[type='search'] {
|
|
269
|
+
padding-left: var(--t-padding-x-desktop-with-icon);
|
|
270
|
+
}
|
|
271
|
+
.t-input[type='search'] + .t-title {
|
|
272
|
+
left: var(--t-padding-x-desktop-with-icon);
|
|
273
|
+
}
|
|
274
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
275
|
+
.t-input[type='search'] {
|
|
276
|
+
padding-left: var(--t-padding-x-tablet-with-icon);
|
|
277
|
+
}
|
|
278
|
+
.t-input[type='search'] + .t-title {
|
|
279
|
+
left: var(--t-padding-x-tablet-with-icon);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
input[type='search']::-webkit-search-decoration,
|
|
283
|
+
input[type='search']::-webkit-search-cancel-button,
|
|
284
|
+
input[type='search']::-webkit-search-results-button,
|
|
285
|
+
input[type='search']::-webkit-search-results-decoration {
|
|
286
|
+
display: none;
|
|
287
|
+
}
|
|
288
|
+
`;
|
|
289
|
+
export const inputDescriptionStyles = css `
|
|
290
|
+
.t-input-description-container {
|
|
291
|
+
margin-top: 0.5rem;
|
|
292
|
+
font-family: 'rubik', sans-serif;
|
|
293
|
+
font-size: 0.75rem;
|
|
294
|
+
line-height: 1rem;
|
|
295
|
+
color: var(--t-field-color-description);
|
|
296
|
+
display: flex;
|
|
297
|
+
justify-content: space-between;
|
|
298
|
+
}
|
|
299
|
+
.t-input-description-container .t-letter-counter {
|
|
300
|
+
align-self: flex-end;
|
|
301
|
+
}
|
|
302
|
+
.t-input-description-container .t-input-description {
|
|
303
|
+
display: flex;
|
|
304
|
+
gap: 0.5rem;
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
//# sourceMappingURL=TuixInput.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixInput.styles.js","sourceRoot":"","sources":["../../../src/tuix-input/TuixInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,i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CAAC;;;;;aAKpC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;YAM9B,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA4BF,WAAW,CAAC,MAAM;;gBAEzC,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC;eACpC,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC;;;CAGjD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;uCAOG,WAAW,CAAC,MAAM;;;;;;;;;;;;;;CAcxD,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBxC,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { palette } from '../utils/colors';\nimport { darkPalette } from '../utils/darkColors';\nimport { hexToRgb } from '../utils/hex-rgb';\n\nconst inputVars = {\n gapX: '10px',\n iconDesktopSize: '1.5rem',\n iconTabletSize: '1rem',\n paddingX: '1.25rem',\n};\n\nconst rgbDarkValidation = hexToRgb(darkPalette.validation);\nconst rgbDarkError = hexToRgb(darkPalette.error);\n\nexport const hostStyles = css`\n :host {\n --t-field-color-form: ${unsafeCSS(palette.primary_50)};\n --t-field-color-title: ${unsafeCSS(palette.primary_300)};\n --t-field-color-text: ${unsafeCSS(palette.dark)};\n --t-field-color-description: ${unsafeCSS(palette.neutral_600)};\n --t-field-color-stroke-hover: ${unsafeCSS(palette.primary_300)};\n --t-field-color-stroke-focus: ${unsafeCSS(palette.main)};\n --t-field-color-text-disabled: ${unsafeCSS(palette.primary_300)};\n --t-field-color-stroke-validation: ${unsafeCSS(palette.validation_200)};\n --t-field-color-bg-validation: ${unsafeCSS(palette.validation_50)};\n --t-field-color-stroke-loading: ${unsafeCSS(palette.primary_300)};\n --t-field-color-bg-error: ${unsafeCSS(palette.error_50)};\n --t-field-color-stroke-error: ${unsafeCSS(palette.error_200)};\n --t-field-input-cursor: auto;\n }\n :host([dark]) {\n --t-field-color-form: ${unsafeCSS(darkPalette.primary_950)};\n --t-field-color-text: ${unsafeCSS(darkPalette.primary_100)};\n --t-field-color-description: ${unsafeCSS(darkPalette.neutral_200)};\n --t-field-color-stroke-focus: ${unsafeCSS(darkPalette.secondary)};\n --t-field-color-text-disabled: ${unsafeCSS(darkPalette.primary_800)};\n --t-field-color-stroke-validation: ${unsafeCSS(darkPalette.validation_200)};\n --t-field-color-bg-validation: rgba(\n ${rgbDarkValidation.r},\n ${rgbDarkValidation.g},\n ${rgbDarkValidation.b},\n 0.2\n );\n --t-field-color-bg-error: rgba(\n ${rgbDarkError.r},\n ${rgbDarkError.g},\n ${rgbDarkError.b},\n 0.2\n );\n --t-field-color-stroke-error: ${unsafeCSS(darkPalette.error_200)};\n }\n`;\n\nexport const inputComponentStyles = css`\n .t-input-container {\n position: relative;\n --t-padding-x-desktop-with-icon: calc(\n ${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconDesktopSize)} +\n ${unsafeCSS(inputVars.gapX)}\n );\n --t-padding-x-tablet-with-icon: calc(\n ${unsafeCSS(inputVars.paddingX)} + ${unsafeCSS(inputVars.iconTabletSize)} +\n ${unsafeCSS(inputVars.gapX)}\n );\n }\n .t-input {\n padding: 1rem ${unsafeCSS(inputVars.paddingX)};\n border-radius: 4px;\n font-family: 'rubik', sans-serif;\n cursor: var(--t-field-input-cursor);\n }\n .t-input.with-title {\n padding-top: 1.5rem;\n padding-bottom: 0.5rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-desktop-with-icon);\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input {\n padding-top: 0.875rem;\n padding-bottom: 0.875rem;\n }\n .t-input.with-title {\n padding-top: 1.375rem;\n padding-bottom: 0.375rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-tablet-with-icon);\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n }\n .t-input.with-title {\n padding-top: 1.25rem;\n padding-bottom: 0.25rem;\n }\n .t-input.with-icon-right {\n padding-right: var(--t-padding-x-tablet-with-icon);\n }\n }\n`;\n\nexport const inputFontStyles = css`\n .t-input::placeholder,\n .t-input,\n .t-title {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input::placeholder {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n .t-input {\n font-size: 1rem;\n line-height: 1.25rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input {\n font-size: 0.875rem;\n line-height: 1rem;\n }\n .t-input::placeholder {\n line-height: 1rem;\n }\n }\n`;\n\nexport const inputColorStyles = css`\n .t-input {\n background-color: var(--t-field-color-form);\n border: 1px solid var(--t-field-color-form);\n color: var(--t-field-color-text);\n }\n .t-input-container:hover .t-input,\n .t-input:hover {\n border: 1px solid var(--t-field-color-stroke-hover);\n }\n .t-input:focus {\n border: 1px solid var(--t-field-color-stroke-focus);\n outline: 1px solid var(--t-field-color-stroke-focus);\n }\n .t-input[disabled] {\n pointer-events: none;\n color: var(--t-field-color-text-disabled);\n }\n .t-input.with-title::placeholder {\n color: transparent;\n }\n .t-input::placeholder,\n .t-input.with-title:focus::placeholder {\n color: var(--t-field-color-title);\n }\n .t-input.with-warning {\n border: 1px solid var(--t-field-color-stroke-validation);\n background-color: var(--t-field-color-bg-validation);\n }\n .t-input.with-error {\n border: 1px solid var(--t-field-color-stroke-error);\n background-color: var(--t-field-color-bg-error);\n }\n .t-input.with-loading {\n border: 1px solid var(--t-field-color-stroke-loading);\n }\n`;\n\nexport const inputTitleStyles = css`\n .t-title {\n position: absolute;\n top: 50%;\n left: 1.25rem;\n font-family: 'rubik', sans-serif;\n color: var(--t-field-color-title);\n transform: translateY(-50%);\n transition-duration: 0.3s;\n pointer-events: none;\n }\n .t-textarea-container .t-title {\n top: 1rem;\n transform: none;\n }\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1rem;\n transform: translateY(0);\n top: 0.5rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-title {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n top: 0.375rem;\n }\n .t-textarea-container .t-title {\n top: 0.875rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .t-input.with-title:focus + .t-title,\n .t-input.with-title:not(:placeholder-shown) + .t-title {\n top: 0.25rem;\n }\n .t-textarea-container .t-title {\n top: 0.75rem;\n }\n }\n`;\n\nexport const inputIconStyles = css`\n .t-icon-set-container.t-icon-click {\n cursor: pointer;\n }\n .t-input-container .t-icon-set-container {\n height: ${unsafeCSS(inputVars.iconDesktopSize)};\n width: ${unsafeCSS(inputVars.iconDesktopSize)};\n }\n .t-input-container .t-icon-set-container.t-icon-right {\n position: absolute;\n top: 50%;\n right: ${unsafeCSS(inputVars.paddingX)};\n transform: translateY(-50%);\n }\n .t-input-container .t-icon-set-container.t-icon-left {\n position: absolute;\n top: 50%;\n left: ${unsafeCSS(inputVars.paddingX)};\n transform: translateY(-50%);\n }\n .t-icon-inactive {\n display: inline;\n }\n .t-icon-active {\n display: none;\n }\n .t-icon-disabled {\n display: none;\n }\n .t-input-container:hover .t-icon-set-container .t-icon-inactive,\n .t-input:hover ~ .t-icon-set-container .t-icon-inactive,\n .t-input:focus ~ .t-icon-set-container .t-icon-inactive {\n display: none;\n }\n .t-input-container:hover .t-icon-set-container .t-icon-active,\n .t-input:hover ~ .t-icon-set-container .t-icon-active,\n .t-input:focus ~ .t-icon-set-container .t-icon-active {\n display: inline;\n }\n .t-input[disabled] ~ .t-icon-set-container .t-icon-inactive {\n display: none;\n }\n .t-input[disabled] ~ .t-icon-set-container .t-icon-disabled {\n display: inline;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input-container .t-icon-set-container {\n height: ${unsafeCSS(inputVars.iconTabletSize)};\n width: ${unsafeCSS(inputVars.iconTabletSize)};\n }\n }\n`;\n\nexport const inputSearchStyles = css`\n .t-input[type='search'] {\n padding-left: var(--t-padding-x-desktop-with-icon);\n }\n .t-input[type='search'] + .t-title {\n left: var(--t-padding-x-desktop-with-icon);\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .t-input[type='search'] {\n padding-left: var(--t-padding-x-tablet-with-icon);\n }\n .t-input[type='search'] + .t-title {\n left: var(--t-padding-x-tablet-with-icon);\n }\n }\n input[type='search']::-webkit-search-decoration,\n input[type='search']::-webkit-search-cancel-button,\n input[type='search']::-webkit-search-results-button,\n input[type='search']::-webkit-search-results-decoration {\n display: none;\n }\n`;\n\nexport const inputDescriptionStyles = css`\n .t-input-description-container {\n margin-top: 0.5rem;\n font-family: 'rubik', sans-serif;\n font-size: 0.75rem;\n line-height: 1rem;\n color: var(--t-field-color-description);\n display: flex;\n justify-content: space-between;\n }\n .t-input-description-container .t-letter-counter {\n align-self: flex-end;\n }\n .t-input-description-container .t-input-description {\n display: flex;\n gap: 0.5rem;\n }\n`;\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
2
|
+
export declare enum InputType {
|
|
3
|
+
TEXT = "text",
|
|
4
|
+
SEARCH = "search",
|
|
5
|
+
PASSWORD = "password",
|
|
6
|
+
TEXT_AREA = "textarea"
|
|
7
|
+
}
|
|
8
|
+
export declare enum InputIconLocation {
|
|
9
|
+
LEFT = "left",
|
|
10
|
+
RIGHT = "right"
|
|
11
|
+
}
|
|
12
|
+
export declare enum DescriptionType {
|
|
13
|
+
TEXT = "text",
|
|
14
|
+
WARNING = "warning",
|
|
15
|
+
ERROR = "error",
|
|
16
|
+
SUCCESS = "success",
|
|
17
|
+
LOADING = "loading"
|
|
18
|
+
}
|
|
19
|
+
export declare const IconByDescriptionType: {
|
|
20
|
+
warning: IconName;
|
|
21
|
+
error: IconName;
|
|
22
|
+
success: IconName;
|
|
23
|
+
loading: IconName;
|
|
24
|
+
};
|
|
25
|
+
export declare const IconDescriptionColorLight: {
|
|
26
|
+
warning: string;
|
|
27
|
+
error: string;
|
|
28
|
+
success: string;
|
|
29
|
+
loading: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const IconDescriptionColorDark: {
|
|
32
|
+
warning: string;
|
|
33
|
+
error: string;
|
|
34
|
+
success: string;
|
|
35
|
+
loading: string;
|
|
36
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
};
|
|
42
|
+
//# sourceMappingURL=tuix-input.enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuix-input.enums.js","sourceRoot":"","sources":["../../../../src/tuix-input/enums/tuix-input.enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,mCAAsB,CAAA;AACxB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,oCAAe,CAAA;AACjB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,oBAAoB;IACxD,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,QAAQ;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,YAAY;IAChD,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM;CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU;IAC7C,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK;IACtC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,UAAU;IACjD,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK;IAC1C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO;IAC9C,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,WAAW;CACnD,CAAC","sourcesContent":["import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';\nimport { palette } from '../../utils/colors';\nimport { darkPalette } from '../../utils/darkColors';\n\nexport enum InputType {\n TEXT = 'text',\n SEARCH = 'search',\n PASSWORD = 'password',\n TEXT_AREA = 'textarea',\n}\n\nexport enum InputIconLocation {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport enum DescriptionType {\n TEXT = 'text',\n WARNING = 'warning',\n ERROR = 'error',\n SUCCESS = 'success',\n LOADING = 'loading',\n}\n\nexport const IconByDescriptionType = {\n [DescriptionType.WARNING]: IconName.TRIANGLE_EXCLAMATION,\n [DescriptionType.ERROR]: IconName.CIRCLE_X,\n [DescriptionType.SUCCESS]: IconName.CIRCLE_CHECK,\n [DescriptionType.LOADING]: IconName.LOADER,\n};\n\nexport const IconDescriptionColorLight = {\n [DescriptionType.WARNING]: palette.validation,\n [DescriptionType.ERROR]: palette.error,\n [DescriptionType.SUCCESS]: palette.success,\n [DescriptionType.LOADING]: palette.primary_300,\n};\n\nexport const IconDescriptionColorDark = {\n [DescriptionType.WARNING]: darkPalette.validation,\n [DescriptionType.ERROR]: darkPalette.error,\n [DescriptionType.SUCCESS]: darkPalette.success,\n [DescriptionType.LOADING]: darkPalette.primary_300,\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
2
|
+
import { InputIconLocation } from '../enums/tuix-input.enums';
|
|
3
|
+
export interface InputIconColors {
|
|
4
|
+
inactive: string;
|
|
5
|
+
active: string;
|
|
6
|
+
disabled: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FormatIconSetParams {
|
|
9
|
+
iconName: IconName;
|
|
10
|
+
colorByState: InputIconColors;
|
|
11
|
+
location?: InputIconLocation;
|
|
12
|
+
clickHandler?: (e: MouseEvent) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuix-input.interface.js","sourceRoot":"","sources":["../../../../src/tuix-input/interfaces/tuix-input.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';\nimport { InputIconLocation } from '../enums/tuix-input.enums';\n\nexport interface InputIconColors {\n inactive: string;\n active: string;\n disabled: string;\n}\n\nexport interface FormatIconSetParams {\n iconName: IconName;\n colorByState: InputIconColors;\n location?: InputIconLocation;\n clickHandler?: (e: MouseEvent) => void;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } 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
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css, LitElement, unsafeCSS } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { palette } from '../utils/colors';
|
|
5
|
+
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
6
|
+
import { MainVariant } from '../utils/mainVariant.enum';
|
|
7
|
+
import { LinkTarget } from './enums/linkTarget.enum';
|
|
8
|
+
let TuixLink = class TuixLink extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.href = '';
|
|
12
|
+
this.target = LinkTarget.Blank;
|
|
13
|
+
this.variant = MainVariant.PRIMARY;
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<a
|
|
19
|
+
target="${this.disabled ? LinkTarget.Self : this.target}"
|
|
20
|
+
class="link ${this.variant} ${this.disabled ? 'disabled' : ''}"
|
|
21
|
+
href="${this.disabled ? 'javascript:void(0)' : this.href}"
|
|
22
|
+
>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</a>
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
TuixLink.styles = css `
|
|
29
|
+
a.link {
|
|
30
|
+
font-family: 'rubik', sans-serif;
|
|
31
|
+
font-size: 1rem;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
line-height: 1.25rem;
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
color: ${unsafeCSS(palette.main)};
|
|
36
|
+
}
|
|
37
|
+
a.link:hover {
|
|
38
|
+
text-decoration: underline;
|
|
39
|
+
}
|
|
40
|
+
a.link.secondary {
|
|
41
|
+
color: ${unsafeCSS(palette.white)};
|
|
42
|
+
}
|
|
43
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
44
|
+
a.link {
|
|
45
|
+
font-size: 0.875rem;
|
|
46
|
+
font-weight: 400;
|
|
47
|
+
line-height: 1rem;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
a.link.disabled {
|
|
51
|
+
text-decoration: underline;
|
|
52
|
+
color: ${unsafeCSS(palette.primary_300)};
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
__decorate([
|
|
57
|
+
property({ type: String })
|
|
58
|
+
], TuixLink.prototype, "href", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
property({ type: LinkTarget })
|
|
61
|
+
], TuixLink.prototype, "target", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
property({ type: MainVariant })
|
|
64
|
+
], TuixLink.prototype, "variant", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
property({ type: Boolean })
|
|
67
|
+
], TuixLink.prototype, "disabled", void 0);
|
|
68
|
+
TuixLink = __decorate([
|
|
69
|
+
customElement('tuix-link')
|
|
70
|
+
], TuixLink);
|
|
71
|
+
export { TuixLink };
|
|
72
|
+
//# sourceMappingURL=TuixLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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ADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCACjB;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;wCACL;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;yCACF;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACX;AAxCN,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAqDpB;SArDY,QAAQ","sourcesContent":["import { html, css, LitElement, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { palette } from '../utils/colors';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { MainVariant } from '../utils/mainVariant.enum';\nimport { LinkTarget } from './enums/linkTarget.enum';\n\n@customElement('tuix-link')\nexport class TuixLink extends LitElement {\n static styles = css`\n a.link {\n font-family: 'rubik', sans-serif;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.25rem;\n text-decoration: none;\n color: ${unsafeCSS(palette.main)};\n }\n a.link:hover {\n text-decoration: underline;\n }\n a.link.secondary {\n color: ${unsafeCSS(palette.white)};\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n a.link {\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 1rem;\n }\n }\n a.link.disabled {\n text-decoration: underline;\n color: ${unsafeCSS(palette.primary_300)};\n cursor: not-allowed;\n }\n `;\n\n @property({ type: String })\n href = '';\n\n @property({ type: LinkTarget })\n target = LinkTarget.Blank;\n\n @property({ type: MainVariant })\n variant = MainVariant.PRIMARY;\n\n @property({ type: Boolean })\n disabled = false;\n\n render() {\n return html`\n <a\n target=\"${this.disabled ? LinkTarget.Self : this.target}\"\n class=\"link ${this.variant} ${this.disabled ? 'disabled' : ''}\"\n href=\"${this.disabled ? 'javascript:void(0)' : this.href}\"\n >\n <slot></slot>\n </a>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
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 = {}));
|
|
8
|
+
//# sourceMappingURL=linkTarget.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkTarget.enum.js","sourceRoot":"","sources":["../../../../src/tuix-link/enums/linkTarget.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,8BAAgB,CAAA;IAChB,4BAAc,CAAA;IACd,gCAAkB,CAAA;IAClB,0BAAY,CAAA;AACd,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","sourcesContent":["export enum LinkTarget {\n Blank = '_blank',\n Self = '_self',\n Parent = '_parent',\n Top = '_top',\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, css, html, unsafeCSS } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { ShadowVariants } from './enums/tuix-paper.enum';
|
|
5
|
+
let TuixPaper = class TuixPaper extends LitElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.elevation = ShadowVariants.Variant_1;
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return html ` <div class="elevation variant_${this.elevation}">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</div>`;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
// prettier-ignore
|
|
17
|
+
TuixPaper.styles = css `
|
|
18
|
+
.elevation {
|
|
19
|
+
border-radius: 20px;
|
|
20
|
+
padding: 16px 32px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
${unsafeCSS(Object.values(ShadowVariants).slice(1)
|
|
24
|
+
.map((variant, index) => {
|
|
25
|
+
return `
|
|
26
|
+
.elevation.variant_${variant} {
|
|
27
|
+
box-shadow: 0px ${Math.pow(2, index)}px ${Math.pow(2, (index + 2))}px rgba(66, 79, 101, 0.16);
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
})
|
|
31
|
+
.join('\n'))}
|
|
32
|
+
`;
|
|
33
|
+
__decorate([
|
|
34
|
+
property({ type: ShadowVariants })
|
|
35
|
+
], TuixPaper.prototype, "elevation", void 0);
|
|
36
|
+
TuixPaper = __decorate([
|
|
37
|
+
customElement('tuix-paper')
|
|
38
|
+
], TuixPaper);
|
|
39
|
+
export { TuixPaper };
|
|
40
|
+
//# sourceMappingURL=TuixPaper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixPaper.js","sourceRoot":"","sources":["../../../src/tuix-paper/TuixPaper.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAAzC;;QAEE,cAAS,GAAmB,cAAc,CAAC,SAAS,CAAC;IA2BvD,CAAC;IALC,MAAM;QACJ,OAAO,IAAI,CAAA,kCAAkC,IAAI,CAAC,SAAS;;WAEpD,CAAC;IACV,CAAC;;AAxBD,kBAAkB;AACX,gBAAM,GAAG,GAAG,CAAA;;;;;;MAMf,SAAS,CACT,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;KACnC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;IACtB,OAAO;iCACgB,OAAO;gCACR,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;;WAErE,CAAC;AACJ,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC,CACd;GACF,AAjBY,CAiBX;AApBF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;4CACkB;AAF1C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA6BrB;SA7BY,SAAS","sourcesContent":["import { LitElement, TemplateResult, css, html, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ShadowVariants } from './enums/tuix-paper.enum';\n\n@customElement('tuix-paper')\nexport class TuixPaper extends LitElement {\n @property({ type: ShadowVariants })\n elevation: ShadowVariants = ShadowVariants.Variant_1;\n\n // prettier-ignore\n static styles = css`\n .elevation {\n border-radius: 20px;\n padding: 16px 32px;\n }\n\n ${unsafeCSS(\n Object.values(ShadowVariants).slice(1)\n .map((variant, index) => {\n return `\n .elevation.variant_${variant} {\n box-shadow: 0px ${Math.pow(2, index)}px ${Math.pow(2, (index + 2))}px rgba(66, 79, 101, 0.16);\n }\n `;\n })\n .join('\\n')\n )}\n `;\n\n render(): TemplateResult {\n return html` <div class=\"elevation variant_${this.elevation}\">\n <slot></slot>\n </div>`;\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var ShadowVariants;
|
|
2
|
+
(function (ShadowVariants) {
|
|
3
|
+
ShadowVariants["Variant_0"] = "0";
|
|
4
|
+
ShadowVariants["Variant_1"] = "1";
|
|
5
|
+
ShadowVariants["Variant_2"] = "2";
|
|
6
|
+
ShadowVariants["Variant_3"] = "3";
|
|
7
|
+
ShadowVariants["Variant_4"] = "4";
|
|
8
|
+
})(ShadowVariants || (ShadowVariants = {}));
|
|
9
|
+
//# sourceMappingURL=tuix-paper.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuix-paper.enum.js","sourceRoot":"","sources":["../../../../src/tuix-paper/enums/tuix-paper.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB","sourcesContent":["export enum ShadowVariants {\n Variant_0 = '0',\n Variant_1 = '1',\n Variant_2 = '2',\n Variant_3 = '3',\n Variant_4 = '4',\n}\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { TextSize } from './enums/tuix-text.enums.js';
|
|
3
|
+
import { TextVariant } from '../utils/colors.js';
|
|
3
4
|
export declare class TuixText extends LitElement {
|
|
4
5
|
size?: TextSize;
|
|
5
|
-
color?:
|
|
6
|
-
type?: TextType;
|
|
6
|
+
color?: TextVariant.PRIMARY;
|
|
7
7
|
static styles: import("lit").CSSResult[];
|
|
8
|
-
getTextClass(): string;
|
|
9
8
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
9
|
}
|