tuix-webcomponents 0.0.22 → 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.
- package/README.md +103 -21
- package/dist/assets/tuix-styles.css +72 -0
- package/dist/src/index.d.ts +27 -1
- package/dist/src/index.js +19 -16
- package/dist/src/react/index.d.ts +42 -0
- package/dist/src/react/index.js +114 -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 +7 -13
- package/dist/src/tuix-button/TuixButton.js +37 -61
- package/dist/src/tuix-button/TuixButton.styles.d.ts +1 -0
- package/dist/src/tuix-button/TuixButton.styles.js +78 -45
- package/dist/src/tuix-button/enums/tuix-button.enums.d.ts +1 -1
- package/dist/src/tuix-button/enums/tuix-button.enums.js +4 -5
- 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 +17 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.js +108 -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 +15 -5
- package/dist/src/tuix-dropdown/TuixDropdown.js +129 -43
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +61 -21
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +0 -6
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +0 -8
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +15 -1
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +0 -1
- package/dist/src/tuix-icon/TuixIcon.d.ts +6 -2
- package/dist/src/tuix-icon/TuixIcon.icons.d.ts +3 -3
- package/dist/src/tuix-icon/TuixIcon.icons.js +299 -7
- package/dist/src/tuix-icon/TuixIcon.js +39 -25
- package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +67 -21
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js +66 -22
- package/dist/src/tuix-icon-button/TuixIconButton.d.ts +7 -12
- package/dist/src/tuix-icon-button/TuixIconButton.js +22 -51
- package/dist/src/tuix-input/TuixInput.d.ts +13 -7
- package/dist/src/tuix-input/TuixInput.js +98 -51
- package/dist/src/tuix-input/TuixInput.styles.js +101 -112
- package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +11 -9
- package/dist/src/tuix-input/enums/tuix-input.enums.js +11 -12
- package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +13 -8
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js +5 -2
- package/dist/src/tuix-link/TuixLink.d.ts +10 -6
- package/dist/src/tuix-link/TuixLink.js +39 -40
- 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 +4 -4
- package/dist/src/tuix-link/enums/linkTarget.enum.js +4 -5
- package/dist/src/tuix-modal/TuixModal.d.ts +11 -0
- package/dist/src/tuix-modal/TuixModal.js +65 -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 +7 -4
- package/dist/src/tuix-paper/TuixPaper.js +29 -23
- 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 +12 -6
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js +15 -9
- package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +17 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.js +96 -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 +48 -0
- package/dist/src/tuix-table/TuixTable.js +369 -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 +7 -4
- package/dist/src/tuix-text/TuixText.js +44 -18
- package/dist/src/tuix-text/TuixText.styles.d.ts +1 -0
- package/dist/src/tuix-text/TuixText.styles.js +146 -65
- package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +25 -11
- package/dist/src/tuix-text/enums/tuix-text.enums.js +61 -14
- package/dist/src/tuix-toast/TuixToast.d.ts +18 -0
- package/dist/src/tuix-toast/TuixToast.js +103 -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 +14 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.js +86 -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 -11
- package/dist/src/utils/colors.js +31 -46
- package/dist/src/utils/darkColors.d.ts +32 -1
- package/dist/src/utils/darkColors.js +33 -11
- package/dist/src/utils/hex-rgb.js +0 -1
- 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.js +0 -1
- package/dist/src/utils/screenSizes.enum.d.ts +2 -2
- package/dist/src/utils/screenSizes.enum.js +2 -4
- package/dist/src/utils/slottedClassName.d.ts +2 -0
- package/dist/src/utils/slottedClassName.js +1 -0
- package/package.json +107 -66
- package/dist/src/index.js.map +0 -1
- package/dist/src/tuix-button/TuixButton.js.map +0 -1
- package/dist/src/tuix-button/TuixButton.styles.js.map +0 -1
- package/dist/src/tuix-button/enums/tuix-button.enums.js.map +0 -1
- package/dist/src/tuix-dropdown/TuixDropdown.js.map +0 -1
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +0 -1
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js.map +0 -1
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js.map +0 -1
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +0 -1
- package/dist/src/tuix-icon/TuixIcon.js.map +0 -1
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +0 -1
- package/dist/src/tuix-icon-button/TuixIconButton.js.map +0 -1
- package/dist/src/tuix-input/TuixInput.js.map +0 -1
- package/dist/src/tuix-input/TuixInput.styles.js.map +0 -1
- package/dist/src/tuix-input/enums/tuix-input.enums.js.map +0 -1
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js.map +0 -1
- package/dist/src/tuix-link/TuixLink.js.map +0 -1
- package/dist/src/tuix-link/enums/linkTarget.enum.js.map +0 -1
- package/dist/src/tuix-paper/TuixPaper.js.map +0 -1
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +0 -1
- package/dist/src/tuix-text/TuixText.js.map +0 -1
- package/dist/src/tuix-text/TuixText.styles.js.map +0 -1
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +0 -1
- package/dist/src/utils/colors.js.map +0 -1
- package/dist/src/utils/darkColors.js.map +0 -1
- package/dist/src/utils/hex-rgb.js.map +0 -1
- package/dist/src/utils/mainVariant.enum.js.map +0 -1
- package/dist/src/utils/screenSizes.enum.js.map +0 -1
- package/dist/tsconfig.publish.tsbuildinfo +0 -1
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
|
-
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { hexToRgb } from '../utils/hex-rgb';
|
|
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
6
|
const inputVars = {
|
|
7
7
|
gapX: '10px',
|
|
8
8
|
iconDesktopSize: '1.5rem',
|
|
9
|
-
|
|
9
|
+
iconMobileSize: '1rem',
|
|
10
10
|
paddingX: '1.25rem',
|
|
11
11
|
};
|
|
12
|
-
const rgbDarkValidation = hexToRgb(
|
|
13
|
-
const rgbDarkError = hexToRgb(
|
|
12
|
+
const rgbDarkValidation = hexToRgb(DarkPalette.VALIDATION);
|
|
13
|
+
const rgbDarkError = hexToRgb(DarkPalette.ERROR);
|
|
14
14
|
export const hostStyles = css `
|
|
15
15
|
:host {
|
|
16
|
-
--t-field-color-form: ${unsafeCSS(
|
|
17
|
-
--t-field-color-title: ${unsafeCSS(
|
|
18
|
-
--t-field-color-text: ${unsafeCSS(
|
|
19
|
-
--t-field-color-description: ${unsafeCSS(
|
|
20
|
-
--t-field-color-stroke-hover: ${unsafeCSS(
|
|
21
|
-
--t-field-color-stroke-focus: ${unsafeCSS(
|
|
22
|
-
--t-field-color-text-disabled: ${unsafeCSS(
|
|
23
|
-
--t-field-color-stroke-validation: ${unsafeCSS(
|
|
24
|
-
--t-field-color-bg-validation: ${unsafeCSS(
|
|
25
|
-
--t-field-color-stroke-loading: ${unsafeCSS(
|
|
26
|
-
--t-field-color-bg-error: ${unsafeCSS(
|
|
27
|
-
--t-field-color-stroke-error: ${unsafeCSS(
|
|
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
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;
|
|
29
37
|
}
|
|
30
38
|
:host([dark]) {
|
|
31
|
-
--t-field-color-form: ${unsafeCSS(
|
|
32
|
-
--t-field-color-
|
|
33
|
-
--t-field-color-
|
|
34
|
-
--t-field-color-
|
|
35
|
-
--t-field-color-
|
|
36
|
-
--t-field-color-
|
|
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)};
|
|
37
46
|
--t-field-color-bg-validation: rgba(
|
|
38
47
|
${rgbDarkValidation.r},
|
|
39
48
|
${rgbDarkValidation.g},
|
|
@@ -46,58 +55,54 @@ export const hostStyles = css `
|
|
|
46
55
|
${rgbDarkError.b},
|
|
47
56
|
0.2
|
|
48
57
|
);
|
|
49
|
-
--t-field-color-stroke-error: ${unsafeCSS(
|
|
58
|
+
--t-field-color-stroke-error: ${unsafeCSS(DarkPalette.ERROR_200)};
|
|
50
59
|
}
|
|
51
60
|
`;
|
|
52
61
|
export const inputComponentStyles = css `
|
|
62
|
+
.t-textarea-main-container {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
}
|
|
53
68
|
.t-input-container {
|
|
54
69
|
position: relative;
|
|
55
70
|
--t-padding-x-desktop-with-icon: calc(
|
|
56
|
-
|
|
71
|
+
var(--t-field-padding-x) + ${unsafeCSS(inputVars.iconDesktopSize)} +
|
|
57
72
|
${unsafeCSS(inputVars.gapX)}
|
|
58
73
|
);
|
|
59
|
-
--t-padding-x-
|
|
60
|
-
|
|
74
|
+
--t-padding-x-mobile-with-icon: calc(
|
|
75
|
+
var(--t-field-padding-x) + ${unsafeCSS(inputVars.iconMobileSize)} +
|
|
61
76
|
${unsafeCSS(inputVars.gapX)}
|
|
62
77
|
);
|
|
78
|
+
--t-border-size: 1px;
|
|
79
|
+
}
|
|
80
|
+
.t-input-container.t-textarea-container {
|
|
81
|
+
height: 100%;
|
|
63
82
|
}
|
|
64
83
|
.t-input {
|
|
65
|
-
padding:
|
|
84
|
+
padding: calc(var(--t-field-padding-y) - var(--t-border-size))
|
|
85
|
+
var(--t-field-padding-x);
|
|
66
86
|
border-radius: 4px;
|
|
67
|
-
font-family: '
|
|
87
|
+
font-family: 'Rubik', sans-serif;
|
|
68
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;
|
|
69
95
|
}
|
|
70
96
|
.t-input.with-title {
|
|
71
|
-
padding-top:
|
|
72
|
-
padding-bottom:
|
|
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));
|
|
73
99
|
}
|
|
74
100
|
.t-input.with-icon-right {
|
|
75
101
|
padding-right: var(--t-padding-x-desktop-with-icon);
|
|
76
102
|
}
|
|
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
103
|
@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
104
|
.t-input.with-icon-right {
|
|
100
|
-
padding-right: var(--t-padding-x-
|
|
105
|
+
padding-right: var(--t-padding-x-mobile-with-icon);
|
|
101
106
|
}
|
|
102
107
|
}
|
|
103
108
|
`;
|
|
@@ -105,27 +110,24 @@ export const inputFontStyles = css `
|
|
|
105
110
|
.t-input::placeholder,
|
|
106
111
|
.t-input,
|
|
107
112
|
.t-title {
|
|
108
|
-
font-size:
|
|
109
|
-
font-weight:
|
|
110
|
-
line-height:
|
|
113
|
+
font-size: var(--t-field-font-size);
|
|
114
|
+
font-weight: var(--t-field-font-weight);
|
|
115
|
+
line-height: var(--t-field-line-height);
|
|
111
116
|
}
|
|
112
117
|
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
113
|
-
|
|
114
|
-
font-size: 0.
|
|
115
|
-
line-height: 1.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
font-size: 1rem;
|
|
119
|
-
line-height: 1.25rem;
|
|
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;
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
125
|
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
123
|
-
|
|
124
|
-
font-size: 0.
|
|
125
|
-
line-height: 1rem;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
line-height: 1rem;
|
|
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;
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
`;
|
|
@@ -143,8 +145,9 @@ export const inputColorStyles = css `
|
|
|
143
145
|
border: 1px solid var(--t-field-color-stroke-focus);
|
|
144
146
|
outline: 1px solid var(--t-field-color-stroke-focus);
|
|
145
147
|
}
|
|
146
|
-
.t-input[disabled] {
|
|
147
|
-
|
|
148
|
+
.t-input[disabled]:disabled {
|
|
149
|
+
cursor: not-allowed;
|
|
150
|
+
border: 1px solid var(--t-field-color-form);
|
|
148
151
|
color: var(--t-field-color-text-disabled);
|
|
149
152
|
}
|
|
150
153
|
.t-input.with-title::placeholder {
|
|
@@ -170,12 +173,16 @@ export const inputTitleStyles = css `
|
|
|
170
173
|
.t-title {
|
|
171
174
|
position: absolute;
|
|
172
175
|
top: 50%;
|
|
173
|
-
left:
|
|
174
|
-
font-family: '
|
|
176
|
+
left: var(--t-field-title-left-position);
|
|
177
|
+
font-family: 'Rubik', sans-serif;
|
|
175
178
|
color: var(--t-field-color-title);
|
|
176
179
|
transform: translateY(-50%);
|
|
177
180
|
transition-duration: 0.3s;
|
|
178
181
|
pointer-events: none;
|
|
182
|
+
-webkit-user-select: none;
|
|
183
|
+
-moz-user-select: none;
|
|
184
|
+
-ms-user-select: none;
|
|
185
|
+
user-select: none;
|
|
179
186
|
}
|
|
180
187
|
.t-textarea-container .t-title {
|
|
181
188
|
top: 1rem;
|
|
@@ -184,52 +191,31 @@ export const inputTitleStyles = css `
|
|
|
184
191
|
.t-input.with-title:focus + .t-title,
|
|
185
192
|
.t-input.with-title:not(:placeholder-shown) + .t-title {
|
|
186
193
|
font-size: 0.75rem;
|
|
187
|
-
font-weight:
|
|
188
|
-
line-height:
|
|
194
|
+
font-weight: 300;
|
|
195
|
+
line-height: 0.875rem;
|
|
189
196
|
transform: translateY(0);
|
|
190
197
|
top: 0.5rem;
|
|
191
198
|
}
|
|
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
199
|
`;
|
|
215
200
|
export const inputIconStyles = css `
|
|
216
|
-
.t-icon-set-container.t-icon-click {
|
|
217
|
-
cursor: pointer;
|
|
218
|
-
}
|
|
219
201
|
.t-input-container .t-icon-set-container {
|
|
220
202
|
height: ${unsafeCSS(inputVars.iconDesktopSize)};
|
|
221
203
|
width: ${unsafeCSS(inputVars.iconDesktopSize)};
|
|
204
|
+
cursor: var(--t-field-input-cursor);
|
|
205
|
+
}
|
|
206
|
+
.t-icon-set-container.t-icon-click {
|
|
207
|
+
cursor: pointer;
|
|
222
208
|
}
|
|
223
209
|
.t-input-container .t-icon-set-container.t-icon-right {
|
|
224
210
|
position: absolute;
|
|
225
211
|
top: 50%;
|
|
226
|
-
right:
|
|
212
|
+
right: var(--t-field-padding-x);
|
|
227
213
|
transform: translateY(-50%);
|
|
228
214
|
}
|
|
229
215
|
.t-input-container .t-icon-set-container.t-icon-left {
|
|
230
216
|
position: absolute;
|
|
231
217
|
top: 50%;
|
|
232
|
-
left:
|
|
218
|
+
left: var(--t-field-padding-x);
|
|
233
219
|
transform: translateY(-50%);
|
|
234
220
|
}
|
|
235
221
|
.t-icon-inactive {
|
|
@@ -251,16 +237,20 @@ export const inputIconStyles = css `
|
|
|
251
237
|
.t-input:focus ~ .t-icon-set-container .t-icon-active {
|
|
252
238
|
display: inline;
|
|
253
239
|
}
|
|
240
|
+
.t-input[disabled] ~ .t-icon-set-container .t-icon-active {
|
|
241
|
+
display: none;
|
|
242
|
+
}
|
|
254
243
|
.t-input[disabled] ~ .t-icon-set-container .t-icon-inactive {
|
|
255
244
|
display: none;
|
|
256
245
|
}
|
|
257
246
|
.t-input[disabled] ~ .t-icon-set-container .t-icon-disabled {
|
|
258
247
|
display: inline;
|
|
248
|
+
cursor: not-allowed;
|
|
259
249
|
}
|
|
260
|
-
@media only screen and (max-width: ${ScreenSizes.
|
|
250
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
261
251
|
.t-input-container .t-icon-set-container {
|
|
262
|
-
height: ${unsafeCSS(inputVars.
|
|
263
|
-
width: ${unsafeCSS(inputVars.
|
|
252
|
+
height: ${unsafeCSS(inputVars.iconMobileSize)};
|
|
253
|
+
width: ${unsafeCSS(inputVars.iconMobileSize)};
|
|
264
254
|
}
|
|
265
255
|
}
|
|
266
256
|
`;
|
|
@@ -271,12 +261,12 @@ export const inputSearchStyles = css `
|
|
|
271
261
|
.t-input[type='search'] + .t-title {
|
|
272
262
|
left: var(--t-padding-x-desktop-with-icon);
|
|
273
263
|
}
|
|
274
|
-
@media only screen and (max-width: ${ScreenSizes.
|
|
264
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
275
265
|
.t-input[type='search'] {
|
|
276
|
-
padding-left: var(--t-padding-x-
|
|
266
|
+
padding-left: var(--t-padding-x-mobile-with-icon);
|
|
277
267
|
}
|
|
278
268
|
.t-input[type='search'] + .t-title {
|
|
279
|
-
left: var(--t-padding-x-
|
|
269
|
+
left: var(--t-padding-x-mobile-with-icon);
|
|
280
270
|
}
|
|
281
271
|
}
|
|
282
272
|
input[type='search']::-webkit-search-decoration,
|
|
@@ -289,7 +279,7 @@ export const inputSearchStyles = css `
|
|
|
289
279
|
export const inputDescriptionStyles = css `
|
|
290
280
|
.t-input-description-container {
|
|
291
281
|
margin-top: 0.5rem;
|
|
292
|
-
font-family: '
|
|
282
|
+
font-family: 'Rubik', sans-serif;
|
|
293
283
|
font-size: 0.75rem;
|
|
294
284
|
line-height: 1rem;
|
|
295
285
|
color: var(--t-field-color-description);
|
|
@@ -304,4 +294,3 @@ export const inputDescriptionStyles = css `
|
|
|
304
294
|
gap: 0.5rem;
|
|
305
295
|
}
|
|
306
296
|
`;
|
|
307
|
-
//# sourceMappingURL=TuixInput.styles.js.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
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';
|
|
2
4
|
export declare enum InputType {
|
|
3
5
|
TEXT = "text",
|
|
4
6
|
SEARCH = "search",
|
|
@@ -23,14 +25,14 @@ export declare const IconByDescriptionType: {
|
|
|
23
25
|
loading: IconName;
|
|
24
26
|
};
|
|
25
27
|
export declare const IconDescriptionColorLight: {
|
|
26
|
-
warning:
|
|
27
|
-
error:
|
|
28
|
-
success:
|
|
29
|
-
loading:
|
|
28
|
+
warning: Palette;
|
|
29
|
+
error: Palette;
|
|
30
|
+
success: Palette;
|
|
31
|
+
loading: Palette;
|
|
30
32
|
};
|
|
31
33
|
export declare const IconDescriptionColorDark: {
|
|
32
|
-
warning:
|
|
33
|
-
error:
|
|
34
|
-
success:
|
|
35
|
-
loading:
|
|
34
|
+
warning: DarkPalette;
|
|
35
|
+
error: DarkPalette;
|
|
36
|
+
success: DarkPalette;
|
|
37
|
+
loading: DarkPalette;
|
|
36
38
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
4
|
export var InputType;
|
|
5
5
|
(function (InputType) {
|
|
6
6
|
InputType["TEXT"] = "text";
|
|
@@ -28,15 +28,14 @@ export const IconByDescriptionType = {
|
|
|
28
28
|
[DescriptionType.LOADING]: IconName.LOADER,
|
|
29
29
|
};
|
|
30
30
|
export const IconDescriptionColorLight = {
|
|
31
|
-
[DescriptionType.WARNING]:
|
|
32
|
-
[DescriptionType.ERROR]:
|
|
33
|
-
[DescriptionType.SUCCESS]:
|
|
34
|
-
[DescriptionType.LOADING]:
|
|
31
|
+
[DescriptionType.WARNING]: Palette.VALIDATION,
|
|
32
|
+
[DescriptionType.ERROR]: Palette.ERROR,
|
|
33
|
+
[DescriptionType.SUCCESS]: Palette.SUCCESS,
|
|
34
|
+
[DescriptionType.LOADING]: Palette.PRIMARY_300,
|
|
35
35
|
};
|
|
36
36
|
export const IconDescriptionColorDark = {
|
|
37
|
-
[DescriptionType.WARNING]:
|
|
38
|
-
[DescriptionType.ERROR]:
|
|
39
|
-
[DescriptionType.SUCCESS]:
|
|
40
|
-
[DescriptionType.LOADING]:
|
|
37
|
+
[DescriptionType.WARNING]: DarkPalette.VALIDATION,
|
|
38
|
+
[DescriptionType.ERROR]: DarkPalette.ERROR,
|
|
39
|
+
[DescriptionType.SUCCESS]: DarkPalette.SUCCESS,
|
|
40
|
+
[DescriptionType.LOADING]: DarkPalette.PRIMARY_300,
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=tuix-input.enums.js.map
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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];
|
|
8
12
|
export interface FormatIconSetParams {
|
|
9
13
|
iconName: IconName;
|
|
10
|
-
colorByState:
|
|
14
|
+
colorByState: Record<InputState, DarkPalette | Palette>;
|
|
11
15
|
location?: InputIconLocation;
|
|
12
16
|
clickHandler?: (e: MouseEvent) => void;
|
|
13
17
|
}
|
|
18
|
+
export type CustomEventTuixInput = CustomEvent<DetailValue<string>>;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { MainVariant } from '../utils/mainVariant.enum';
|
|
3
|
-
import { LinkTarget } from './enums/linkTarget.enum';
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import { MainVariant } from '../utils/mainVariant.enum.js';
|
|
3
|
+
import { LinkTarget } from './enums/linkTarget.enum.js';
|
|
4
4
|
export declare class TuixLink extends LitElement {
|
|
5
|
-
static styles: import("lit").CSSResult;
|
|
6
|
-
href
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
href?: string;
|
|
7
7
|
target: LinkTarget;
|
|
8
8
|
variant: MainVariant;
|
|
9
9
|
disabled: boolean;
|
|
10
|
-
|
|
10
|
+
dark: boolean;
|
|
11
|
+
private _getClassMap;
|
|
12
|
+
private _anchorTemplate;
|
|
13
|
+
private _divTemplate;
|
|
14
|
+
render(): TemplateResult;
|
|
11
15
|
}
|
|
@@ -1,58 +1,55 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html,
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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';
|
|
8
9
|
let TuixLink = class TuixLink extends LitElement {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
|
-
this.
|
|
12
|
-
this.target = LinkTarget.Blank;
|
|
12
|
+
this.target = LinkTarget.BLANK;
|
|
13
13
|
this.variant = MainVariant.PRIMARY;
|
|
14
14
|
this.disabled = false;
|
|
15
|
+
this.dark = false;
|
|
15
16
|
}
|
|
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() {
|
|
17
26
|
return html `
|
|
18
27
|
<a
|
|
19
|
-
target="${this.disabled ? LinkTarget.
|
|
20
|
-
class="
|
|
28
|
+
target="${this.disabled ? LinkTarget.SELF : this.target}"
|
|
29
|
+
class="${classMap(this._getClassMap())}"
|
|
21
30
|
href="${this.disabled ? 'javascript:void(0)' : this.href}"
|
|
22
31
|
>
|
|
23
32
|
<slot></slot>
|
|
24
33
|
</a>
|
|
25
34
|
`;
|
|
26
35
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
}
|
|
36
|
+
_divTemplate() {
|
|
37
|
+
return html `
|
|
38
|
+
<div class="${classMap(this._getClassMap())}">
|
|
39
|
+
<slot></slot>
|
|
40
|
+
</div>
|
|
41
|
+
`;
|
|
49
42
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
render() {
|
|
44
|
+
const isValidAnchor = this.href && !this.disabled;
|
|
45
|
+
if (isValidAnchor) {
|
|
46
|
+
return this._anchorTemplate();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return this._divTemplate();
|
|
50
|
+
}
|
|
54
51
|
}
|
|
55
|
-
|
|
52
|
+
};
|
|
56
53
|
__decorate([
|
|
57
54
|
property({ type: String })
|
|
58
55
|
], TuixLink.prototype, "href", void 0);
|
|
@@ -60,13 +57,15 @@ __decorate([
|
|
|
60
57
|
property({ type: LinkTarget })
|
|
61
58
|
], TuixLink.prototype, "target", void 0);
|
|
62
59
|
__decorate([
|
|
63
|
-
property({ type: MainVariant })
|
|
60
|
+
property({ type: MainVariant, reflect: true })
|
|
64
61
|
], TuixLink.prototype, "variant", void 0);
|
|
65
62
|
__decorate([
|
|
66
|
-
property({ type: Boolean })
|
|
63
|
+
property({ type: Boolean, reflect: true })
|
|
67
64
|
], TuixLink.prototype, "disabled", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
property({ type: Boolean, reflect: true })
|
|
67
|
+
], TuixLink.prototype, "dark", void 0);
|
|
68
68
|
TuixLink = __decorate([
|
|
69
69
|
customElement('tuix-link')
|
|
70
70
|
], TuixLink);
|
|
71
71
|
export { TuixLink };
|
|
72
|
-
//# sourceMappingURL=TuixLink.js.map
|
|
@@ -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
|
+
`;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export var LinkTarget;
|
|
2
2
|
(function (LinkTarget) {
|
|
3
|
-
LinkTarget["
|
|
4
|
-
LinkTarget["
|
|
5
|
-
LinkTarget["
|
|
6
|
-
LinkTarget["
|
|
3
|
+
LinkTarget["BLANK"] = "_blank";
|
|
4
|
+
LinkTarget["SELF"] = "_self";
|
|
5
|
+
LinkTarget["PARENT"] = "_parent";
|
|
6
|
+
LinkTarget["TOP"] = "_top";
|
|
7
7
|
})(LinkTarget || (LinkTarget = {}));
|
|
8
|
-
//# sourceMappingURL=linkTarget.enum.js.map
|