tuix-webcomponents 0.64.0 → 0.66.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/{assets/TuixIconButton-eQtxZNXh.js → src/tuix-icon/TuixIcon.icons.js} +125 -203
- 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-build/src/index.js +42 -0
- package/package.json +5 -5
- package/dist/addon-visual-tests-assets/visual-test-illustration.mp4 +0 -0
- package/dist/assets/Color-AVL7NMMY-IH_JbDEF.js +0 -1
- package/dist/assets/DocsRenderer-PQXLIZUC-C0ZKNA9m.js +0 -1286
- package/dist/assets/TuixModal-BZFIHTi_.js +0 -78
- package/dist/assets/TuixToast-BhxwZIGo.js +0 -62
- package/dist/assets/_commonjsHelpers-CqkleIqs.js +0 -1
- package/dist/assets/axe-C59a3kt3.js +0 -30
- package/dist/assets/iframe-ClsPaEIM.js +0 -1057
- package/dist/assets/index-DBzYXxxs.js +0 -1554
- package/dist/assets/index-TjhCmV-u.js +0 -1
- package/dist/assets/matchers-7Z3WT2CE-CcSi9QFY.js +0 -14
- package/dist/assets/screenSizes.enum-C1IhC_dy.js +0 -13
- package/dist/assets/state-CLjydI9z.js +0 -13
- package/dist/assets/tuix-button.stories-Dm_yifox.js +0 -30
- package/dist/assets/tuix-checkbox.stories-DmzoygjC.js +0 -44
- package/dist/assets/tuix-dropdown-object-list.stories-Neeajtj-.js +0 -56
- package/dist/assets/tuix-dropdown.stories-B7ea8QAz.js +0 -28
- package/dist/assets/tuix-icon-button.stories-CgbOSRO4.js +0 -21
- package/dist/assets/tuix-icon.enums-DYTtwLZl.js +0 -1
- package/dist/assets/tuix-icon.stories-CjN2XsKx.js +0 -19
- package/dist/assets/tuix-input.stories-CD7onvw2.js +0 -33
- package/dist/assets/tuix-link.stories-CT7pzGlx.js +0 -35
- package/dist/assets/tuix-modal.stories-B6v3cOPq.js +0 -39
- package/dist/assets/tuix-paper.enum-DhmlUJB7.js +0 -1
- package/dist/assets/tuix-paper.stories-CLnRPHNK.js +0 -31
- package/dist/assets/tuix-radio-button.stories-BwkKC3a9.js +0 -35
- package/dist/assets/tuix-table.stories-Bn-aZa0J.js +0 -65
- package/dist/assets/tuix-text.enums-Ck8cVqZZ.js +0 -1
- package/dist/assets/tuix-text.stories-BNIqPsGD.js +0 -29
- package/dist/assets/tuix-toast.stories-CRYiLiHK.js +0 -21
- package/dist/assets/tuix-toggle-button.stories-CY6wlDnA.js +0 -40
- package/dist/favicon-wrapper.svg +0 -46
- package/dist/favicon.svg +0 -1
- package/dist/iframe.html +0 -685
- package/dist/index.html +0 -160
- package/dist/index.json +0 -1
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +0 -1
- package/dist/sb-addons/a11y-3/manager-bundle.js +0 -5
- package/dist/sb-addons/a11y-3/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/chromatic-com-storybook-1/manager-bundle.js +0 -356
- package/dist/sb-addons/chromatic-com-storybook-1/manager-bundle.js.LEGAL.txt +0 -40
- package/dist/sb-addons/docs-2/manager-bundle.js +0 -151
- package/dist/sb-addons/docs-2/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -971
- package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/vitest-4/manager-bundle.js +0 -3
- package/dist/sb-addons/vitest-4/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/favicon-wrapper.svg +0 -46
- package/dist/sb-common-assets/favicon.svg +0 -1
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +0 -797
- package/dist/sb-manager/globals-runtime.js +0 -69679
- package/dist/sb-manager/globals.js +0 -34
- package/dist/sb-manager/runtime.js +0 -13195
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
3
|
+
import { TextSize } from './enums/tuix-text.enums';
|
|
4
|
+
import slottedClassName from '../utils/slottedClassName';
|
|
5
|
+
export const linkFontStyles = css `
|
|
6
|
+
${unsafeCSS(`
|
|
7
|
+
${slottedClassName(TextSize.Link)} {
|
|
8
|
+
font-family: 'Rubik', sans-serif;
|
|
9
|
+
font-size: 1rem;
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
line-height: 1.25rem;
|
|
12
|
+
}
|
|
13
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
14
|
+
${slottedClassName(TextSize.Link)} {
|
|
15
|
+
font-size: 0.938rem;
|
|
16
|
+
line-height: 1.125rem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
20
|
+
${slottedClassName(TextSize.Link)} {
|
|
21
|
+
font-size: 0.875rem;
|
|
22
|
+
line-height: 1rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`)}
|
|
26
|
+
`;
|
|
27
|
+
export const textStyles = css `
|
|
28
|
+
${unsafeCSS(`
|
|
29
|
+
${slottedClassName(TextSize.XL)} {
|
|
30
|
+
font-size: 3.375rem;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
line-height: 3.688rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
${slottedClassName(TextSize.L)} {
|
|
36
|
+
font-size: 2.813rem;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
line-height: 3.375rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
${slottedClassName(TextSize.M)} {
|
|
42
|
+
font-size: 2.313rem;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
line-height: 2.75rem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
${slottedClassName(TextSize.S)} {
|
|
48
|
+
font-size: 1.938rem;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
line-height: 2.313rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
${slottedClassName(TextSize.XS)} {
|
|
54
|
+
font-size: 1.313rem;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
line-height: 1.563rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
${slottedClassName(TextSize.Body1)} {
|
|
60
|
+
font-size: 1.125rem;
|
|
61
|
+
font-weight: 300;
|
|
62
|
+
line-height: 1.688rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
${slottedClassName(TextSize.Body2)} {
|
|
66
|
+
font-size: 0.938rem;
|
|
67
|
+
font-weight: 300;
|
|
68
|
+
line-height: 1.313rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
${slottedClassName(TextSize.Field1)} {
|
|
72
|
+
font-size: 1rem;
|
|
73
|
+
font-weight: 300;
|
|
74
|
+
line-height: 1.25rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
${slottedClassName(TextSize.Field2)} {
|
|
78
|
+
font-size: 0.75rem;
|
|
79
|
+
font-weight: 300;
|
|
80
|
+
line-height: 0.875rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
84
|
+
${slottedClassName(TextSize.XL)} {
|
|
85
|
+
font-size: 3rem;
|
|
86
|
+
line-height: 3.313rem;
|
|
87
|
+
}
|
|
88
|
+
${slottedClassName(TextSize.L)} {
|
|
89
|
+
font-size: 2.5rem;
|
|
90
|
+
line-height: 3rem;
|
|
91
|
+
}
|
|
92
|
+
${slottedClassName(TextSize.M)} {
|
|
93
|
+
font-size: 2.063rem;
|
|
94
|
+
line-height: 2.5rem;
|
|
95
|
+
}
|
|
96
|
+
${slottedClassName(TextSize.S)} {
|
|
97
|
+
font-size: 1.75rem;
|
|
98
|
+
line-height: 2.125rem;
|
|
99
|
+
}
|
|
100
|
+
${slottedClassName(TextSize.XS)} {
|
|
101
|
+
font-size: 1.188rem;
|
|
102
|
+
line-height: 1.438rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
${slottedClassName(TextSize.Body1)} {
|
|
106
|
+
font-size: 1rem;
|
|
107
|
+
line-height: 1.5rem;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
${slottedClassName(TextSize.Body2)} {
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
line-height: 1.125rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
${slottedClassName(TextSize.Field1)} {
|
|
116
|
+
font-size: 0.938rem;
|
|
117
|
+
line-height: 1.125rem;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
122
|
+
${slottedClassName(TextSize.Body1)} {
|
|
123
|
+
font-size: 0.875rem;
|
|
124
|
+
font-weight: 300;
|
|
125
|
+
line-height: 1.313rem;
|
|
126
|
+
}
|
|
127
|
+
${slottedClassName(TextSize.Body2)} {
|
|
128
|
+
font-size: 0.75rem;
|
|
129
|
+
line-height: 1rem;
|
|
130
|
+
}
|
|
131
|
+
${slottedClassName(TextSize.Field1)} {
|
|
132
|
+
font-size: 0.875rem;
|
|
133
|
+
font-weight: 300;
|
|
134
|
+
line-height: 1rem;
|
|
135
|
+
}
|
|
136
|
+
${slottedClassName(TextSize.XL)} {
|
|
137
|
+
font-size: 2.625rem;
|
|
138
|
+
line-height: 2.875rem;
|
|
139
|
+
}
|
|
140
|
+
${slottedClassName(TextSize.L)} {
|
|
141
|
+
font-size: 2.188rem;
|
|
142
|
+
line-height: 2.438rem;
|
|
143
|
+
}
|
|
144
|
+
${slottedClassName(TextSize.M)} {
|
|
145
|
+
font-size: 1.813rem;
|
|
146
|
+
line-height: 2rem;
|
|
147
|
+
}
|
|
148
|
+
${slottedClassName(TextSize.S)} {
|
|
149
|
+
font-size: 1.5rem;
|
|
150
|
+
line-height: 1.625rem;
|
|
151
|
+
}
|
|
152
|
+
${slottedClassName(TextSize.XS)} {
|
|
153
|
+
font-size: 1.063rem;
|
|
154
|
+
line-height: 1.188rem;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
`)}
|
|
158
|
+
`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare enum TextSize {
|
|
2
|
+
XL = "xl",
|
|
3
|
+
L = "l",
|
|
4
|
+
M = "m",
|
|
5
|
+
S = "s",
|
|
6
|
+
XS = "xs",
|
|
7
|
+
Body1 = "body1",
|
|
8
|
+
Body2 = "body2",
|
|
9
|
+
Link = "link",
|
|
10
|
+
Button = "button",
|
|
11
|
+
Field1 = "field1",
|
|
12
|
+
Field2 = "field2"
|
|
13
|
+
}
|
|
14
|
+
export declare enum TextVariant {
|
|
15
|
+
PRIMARY = "primary",
|
|
16
|
+
SECONDARY = "secondary",
|
|
17
|
+
MAIN = "main",
|
|
18
|
+
DARK_MAIN = "dark_main",
|
|
19
|
+
GREY = "grey",
|
|
20
|
+
LIGHT_GREY = "light_grey",
|
|
21
|
+
DISABLED = "disabled",
|
|
22
|
+
VALIDATION = "validation",
|
|
23
|
+
ERROR = "error",
|
|
24
|
+
SUCCESS = "success",
|
|
25
|
+
LIGHT = "light",
|
|
26
|
+
DARK = "dark",
|
|
27
|
+
DARK_BLUE = "dark_blue",
|
|
28
|
+
TITLE_BLUE = "title_blue"
|
|
29
|
+
}
|
|
30
|
+
export declare const colorText: Record<TextVariant, string>;
|
|
31
|
+
export declare const colorTextDark: Record<TextVariant, string>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Palette } from '../../utils/colors';
|
|
2
|
+
import { DarkPalette } from '../../utils/darkColors';
|
|
3
|
+
export var TextSize;
|
|
4
|
+
(function (TextSize) {
|
|
5
|
+
TextSize["XL"] = "xl";
|
|
6
|
+
TextSize["L"] = "l";
|
|
7
|
+
TextSize["M"] = "m";
|
|
8
|
+
TextSize["S"] = "s";
|
|
9
|
+
TextSize["XS"] = "xs";
|
|
10
|
+
TextSize["Body1"] = "body1";
|
|
11
|
+
TextSize["Body2"] = "body2";
|
|
12
|
+
TextSize["Link"] = "link";
|
|
13
|
+
TextSize["Button"] = "button";
|
|
14
|
+
TextSize["Field1"] = "field1";
|
|
15
|
+
TextSize["Field2"] = "field2";
|
|
16
|
+
})(TextSize || (TextSize = {}));
|
|
17
|
+
export var TextVariant;
|
|
18
|
+
(function (TextVariant) {
|
|
19
|
+
TextVariant["PRIMARY"] = "primary";
|
|
20
|
+
TextVariant["SECONDARY"] = "secondary";
|
|
21
|
+
TextVariant["MAIN"] = "main";
|
|
22
|
+
TextVariant["DARK_MAIN"] = "dark_main";
|
|
23
|
+
TextVariant["GREY"] = "grey";
|
|
24
|
+
TextVariant["LIGHT_GREY"] = "light_grey";
|
|
25
|
+
TextVariant["DISABLED"] = "disabled";
|
|
26
|
+
TextVariant["VALIDATION"] = "validation";
|
|
27
|
+
TextVariant["ERROR"] = "error";
|
|
28
|
+
TextVariant["SUCCESS"] = "success";
|
|
29
|
+
TextVariant["LIGHT"] = "light";
|
|
30
|
+
TextVariant["DARK"] = "dark";
|
|
31
|
+
TextVariant["DARK_BLUE"] = "dark_blue";
|
|
32
|
+
TextVariant["TITLE_BLUE"] = "title_blue";
|
|
33
|
+
})(TextVariant || (TextVariant = {}));
|
|
34
|
+
export const colorText = {
|
|
35
|
+
[TextVariant.MAIN]: Palette.MAIN,
|
|
36
|
+
[TextVariant.DARK_MAIN]: Palette.DARK_MAIN,
|
|
37
|
+
[TextVariant.PRIMARY]: Palette.BLACK,
|
|
38
|
+
[TextVariant.SECONDARY]: Palette.WHITE,
|
|
39
|
+
[TextVariant.GREY]: Palette.NEUTRAL_600,
|
|
40
|
+
[TextVariant.LIGHT_GREY]: Palette.NEUTRAL_200,
|
|
41
|
+
[TextVariant.DISABLED]: Palette.PRIMARY_200,
|
|
42
|
+
[TextVariant.VALIDATION]: Palette.VALIDATION,
|
|
43
|
+
[TextVariant.ERROR]: Palette.ERROR,
|
|
44
|
+
[TextVariant.SUCCESS]: Palette.SUCCESS,
|
|
45
|
+
[TextVariant.LIGHT]: Palette.WHITE,
|
|
46
|
+
[TextVariant.DARK]: Palette.BLACK,
|
|
47
|
+
[TextVariant.DARK_BLUE]: Palette.DARK_MAIN,
|
|
48
|
+
[TextVariant.TITLE_BLUE]: Palette.DARK_MAIN,
|
|
49
|
+
};
|
|
50
|
+
export const colorTextDark = {
|
|
51
|
+
...colorText,
|
|
52
|
+
[TextVariant.MAIN]: DarkPalette.MAIN,
|
|
53
|
+
[TextVariant.DARK_MAIN]: DarkPalette.NEUTRAL_600,
|
|
54
|
+
[TextVariant.PRIMARY]: DarkPalette.WHITE,
|
|
55
|
+
[TextVariant.SECONDARY]: Palette.BLACK,
|
|
56
|
+
[TextVariant.GREY]: DarkPalette.NEUTRAL_600,
|
|
57
|
+
[TextVariant.VALIDATION]: DarkPalette.VALIDATION,
|
|
58
|
+
[TextVariant.ERROR]: DarkPalette.ERROR,
|
|
59
|
+
[TextVariant.SUCCESS]: DarkPalette.SUCCESS,
|
|
60
|
+
[TextVariant.LIGHT]: DarkPalette.WHITE,
|
|
61
|
+
[TextVariant.DARK_BLUE]: DarkPalette.PRIMARY_800,
|
|
62
|
+
[TextVariant.TITLE_BLUE]: DarkPalette.PRIMARY_300,
|
|
63
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement, type PropertyValueMap } from 'lit';
|
|
2
|
+
import { ToastType, type ToastTypeExcludingNone } from './enums/tuix-toast.enums.js';
|
|
3
|
+
export declare class TuixToast extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
type: ToastType;
|
|
6
|
+
visibilityDuration: number;
|
|
7
|
+
dark: boolean;
|
|
8
|
+
lastType: ToastTypeExcludingNone;
|
|
9
|
+
updated(changedProperties: PropertyValueMap<unknown>): void;
|
|
10
|
+
private _handleOnClose;
|
|
11
|
+
private _saveType;
|
|
12
|
+
private _getStyleMap;
|
|
13
|
+
private _getIcon;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
5
|
+
import { IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums.js';
|
|
6
|
+
import { BorderRadiusPaper, PaperElevation, } from '../tuix-paper/enums/tuix-paper.enum.js';
|
|
7
|
+
import { Palette } from '../utils/colors.js';
|
|
8
|
+
import { iconDarkPropertiesMap, iconPropertiesMap, toastBgColorMap, toastBgDarkColorMap, ToastType, } from './enums/tuix-toast.enums.js';
|
|
9
|
+
import { commonToastStyles, mobileToastStyles, tabletToastStyles, } from './TuixToast.styles.js';
|
|
10
|
+
let TuixToast = class TuixToast extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.type = ToastType.NONE;
|
|
14
|
+
this.visibilityDuration = 4000;
|
|
15
|
+
this.dark = false;
|
|
16
|
+
this.lastType = ToastType.SUCCESS;
|
|
17
|
+
this._saveType = () => {
|
|
18
|
+
if (this.type !== ToastType.NONE) {
|
|
19
|
+
this.lastType = this.type;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this._getStyleMap = () => {
|
|
23
|
+
this._saveType();
|
|
24
|
+
const bgColorMap = this.dark ? toastBgDarkColorMap : toastBgColorMap;
|
|
25
|
+
const backgroundColor = bgColorMap[this.lastType];
|
|
26
|
+
return { backgroundColor };
|
|
27
|
+
};
|
|
28
|
+
this._getIcon = () => {
|
|
29
|
+
this._saveType();
|
|
30
|
+
if (this.lastType === ToastType.TEXT)
|
|
31
|
+
return;
|
|
32
|
+
const { name: iconName, color: iconColor } = this.dark
|
|
33
|
+
? iconDarkPropertiesMap[this.lastType]
|
|
34
|
+
: iconPropertiesMap[this.lastType];
|
|
35
|
+
return html `
|
|
36
|
+
<tuix-icon
|
|
37
|
+
size="${IconSizeVariant.MEDIUM}"
|
|
38
|
+
name="${iconName}"
|
|
39
|
+
color="${iconColor}"
|
|
40
|
+
></tuix-icon>
|
|
41
|
+
`;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static { this.styles = [commonToastStyles, tabletToastStyles, mobileToastStyles]; }
|
|
45
|
+
updated(changedProperties) {
|
|
46
|
+
super.updated(changedProperties);
|
|
47
|
+
if (this.type === ToastType.NONE || this.visibilityDuration === 0)
|
|
48
|
+
return;
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
this.type = ToastType.NONE;
|
|
51
|
+
this._handleOnClose();
|
|
52
|
+
}, this.visibilityDuration);
|
|
53
|
+
}
|
|
54
|
+
_handleOnClose() {
|
|
55
|
+
if (this.visibilityDuration === 0)
|
|
56
|
+
return;
|
|
57
|
+
this.dispatchEvent(new CustomEvent('on-close', {
|
|
58
|
+
bubbles: true,
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
return html `
|
|
63
|
+
<tuix-paper
|
|
64
|
+
elevation=${PaperElevation.VARIANT_4}
|
|
65
|
+
border-radius=${BorderRadiusPaper.SOFT}
|
|
66
|
+
?dark=${this.dark}
|
|
67
|
+
>
|
|
68
|
+
<div
|
|
69
|
+
style="${styleMap({
|
|
70
|
+
backgroundColor: this.dark ? Palette.BLACK : Palette.WHITE,
|
|
71
|
+
borderRadius: BorderRadiusPaper.SOFT,
|
|
72
|
+
})}"
|
|
73
|
+
>
|
|
74
|
+
<div class="toast-container" style="${styleMap(this._getStyleMap())}">
|
|
75
|
+
${this._getIcon()}
|
|
76
|
+
<tuix-text ?dark=${this.dark}>
|
|
77
|
+
<slot></slot>
|
|
78
|
+
</tuix-text>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</tuix-paper>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ type: ToastType, reflect: true })
|
|
87
|
+
], TuixToast.prototype, "type", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ type: Number, attribute: 'visibility-duration' })
|
|
90
|
+
], TuixToast.prototype, "visibilityDuration", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
property({ type: Boolean, reflect: true })
|
|
93
|
+
], TuixToast.prototype, "dark", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
state()
|
|
96
|
+
], TuixToast.prototype, "lastType", void 0);
|
|
97
|
+
TuixToast = __decorate([
|
|
98
|
+
customElement('tuix-toast')
|
|
99
|
+
], TuixToast);
|
|
100
|
+
export { TuixToast };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
3
|
+
export const commonToastStyles = css `
|
|
4
|
+
:host {
|
|
5
|
+
position: fixed;
|
|
6
|
+
bottom: -100%;
|
|
7
|
+
left: 50%;
|
|
8
|
+
transform: translateX(-50%);
|
|
9
|
+
transition: bottom 600ms linear;
|
|
10
|
+
width: 640px;
|
|
11
|
+
z-index: 99;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([type='text']),
|
|
15
|
+
:host([type='warning']),
|
|
16
|
+
:host([type='error']),
|
|
17
|
+
:host([type='success']) {
|
|
18
|
+
bottom: 1.5rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.toast-container {
|
|
22
|
+
padding: 12px 16px;
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 16px;
|
|
25
|
+
align-items: center;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
export const tabletToastStyles = css `
|
|
30
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
31
|
+
:host {
|
|
32
|
+
width: 520px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
export const mobileToastStyles = css `
|
|
37
|
+
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
38
|
+
:host {
|
|
39
|
+
max-width: 343px;
|
|
40
|
+
width: 90%;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 ToastType {
|
|
5
|
+
NONE = "none",
|
|
6
|
+
TEXT = "text",
|
|
7
|
+
WARNING = "warning",
|
|
8
|
+
ERROR = "error",
|
|
9
|
+
SUCCESS = "success"
|
|
10
|
+
}
|
|
11
|
+
export type ToastTypeExcludingNone = Exclude<ToastType, ToastType.NONE>;
|
|
12
|
+
interface IconProperties {
|
|
13
|
+
name: IconName;
|
|
14
|
+
color: Palette | DarkPalette;
|
|
15
|
+
}
|
|
16
|
+
export declare const toastBgColorMap: Record<ToastTypeExcludingNone, string>;
|
|
17
|
+
export declare const toastBgDarkColorMap: Record<ToastTypeExcludingNone, string>;
|
|
18
|
+
export declare const iconPropertiesMap: Record<ToastTypeExcludingNone, IconProperties>;
|
|
19
|
+
export declare const iconDarkPropertiesMap: Record<ToastTypeExcludingNone, IconProperties>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
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 ToastType;
|
|
5
|
+
(function (ToastType) {
|
|
6
|
+
ToastType["NONE"] = "none";
|
|
7
|
+
ToastType["TEXT"] = "text";
|
|
8
|
+
ToastType["WARNING"] = "warning";
|
|
9
|
+
ToastType["ERROR"] = "error";
|
|
10
|
+
ToastType["SUCCESS"] = "success";
|
|
11
|
+
})(ToastType || (ToastType = {}));
|
|
12
|
+
export const toastBgColorMap = {
|
|
13
|
+
[ToastType.TEXT]: Palette.WHITE,
|
|
14
|
+
[ToastType.WARNING]: Palette.VALIDATION_50,
|
|
15
|
+
[ToastType.ERROR]: Palette.ERROR_50,
|
|
16
|
+
[ToastType.SUCCESS]: Palette.SUCCESS_50,
|
|
17
|
+
};
|
|
18
|
+
export const toastBgDarkColorMap = {
|
|
19
|
+
[ToastType.TEXT]: Palette.PRIMARY_950,
|
|
20
|
+
[ToastType.WARNING]: DarkPalette.VALIDATION_50,
|
|
21
|
+
[ToastType.ERROR]: DarkPalette.ERROR_50,
|
|
22
|
+
[ToastType.SUCCESS]: DarkPalette.SUCCESS_50,
|
|
23
|
+
};
|
|
24
|
+
export const iconPropertiesMap = {
|
|
25
|
+
[ToastType.TEXT]: {
|
|
26
|
+
name: IconName.ARROW_DOWN,
|
|
27
|
+
color: Palette.BLACK,
|
|
28
|
+
},
|
|
29
|
+
[ToastType.WARNING]: {
|
|
30
|
+
name: IconName.TRIANGLE_EXCLAMATION,
|
|
31
|
+
color: Palette.VALIDATION,
|
|
32
|
+
},
|
|
33
|
+
[ToastType.ERROR]: {
|
|
34
|
+
name: IconName.CIRCLE_EXCLAMATION,
|
|
35
|
+
color: Palette.ERROR,
|
|
36
|
+
},
|
|
37
|
+
[ToastType.SUCCESS]: {
|
|
38
|
+
name: IconName.CIRCLE_CHECK,
|
|
39
|
+
color: Palette.SUCCESS,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export const iconDarkPropertiesMap = {
|
|
43
|
+
[ToastType.TEXT]: {
|
|
44
|
+
name: IconName.ARROW_DOWN,
|
|
45
|
+
color: Palette.WHITE,
|
|
46
|
+
},
|
|
47
|
+
[ToastType.WARNING]: {
|
|
48
|
+
name: IconName.TRIANGLE_EXCLAMATION,
|
|
49
|
+
color: DarkPalette.VALIDATION,
|
|
50
|
+
},
|
|
51
|
+
[ToastType.ERROR]: {
|
|
52
|
+
name: IconName.CIRCLE_EXCLAMATION,
|
|
53
|
+
color: DarkPalette.ERROR,
|
|
54
|
+
},
|
|
55
|
+
[ToastType.SUCCESS]: {
|
|
56
|
+
name: IconName.CIRCLE_CHECK,
|
|
57
|
+
color: DarkPalette.SUCCESS,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { CheckboxLabelSide } from '../tuix-checkbox/enums/tuix-checkbox.enums';
|
|
3
|
+
export declare class TuixToggleButton extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
checked: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
dark: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
labelSide: CheckboxLabelSide;
|
|
10
|
+
private _onToggleButtonChange;
|
|
11
|
+
private _getFullContainerClasses;
|
|
12
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { CheckboxLabelSide } from '../tuix-checkbox/enums/tuix-checkbox.enums';
|
|
6
|
+
import { TextSize, TextVariant } from '../tuix-text/enums/tuix-text.enums';
|
|
7
|
+
import { toggleButtonCheckmarkStyles, toggleButtonContainerStyles, toggleButtonHostStyles, toggleButtonInnerStyles, toggleButtonLabelStyles, } from './TuixToggleButton.styles';
|
|
8
|
+
let TuixToggleButton = class TuixToggleButton extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.checked = false;
|
|
12
|
+
this.disabled = false;
|
|
13
|
+
this.dark = false;
|
|
14
|
+
this.label = '';
|
|
15
|
+
this.labelSide = CheckboxLabelSide.RIGHT;
|
|
16
|
+
}
|
|
17
|
+
static { this.styles = [
|
|
18
|
+
toggleButtonHostStyles,
|
|
19
|
+
toggleButtonContainerStyles,
|
|
20
|
+
toggleButtonCheckmarkStyles,
|
|
21
|
+
toggleButtonInnerStyles,
|
|
22
|
+
toggleButtonLabelStyles,
|
|
23
|
+
]; }
|
|
24
|
+
_onToggleButtonChange(event) {
|
|
25
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
26
|
+
detail: {
|
|
27
|
+
value: event.target.checked,
|
|
28
|
+
label: this.label,
|
|
29
|
+
},
|
|
30
|
+
bubbles: true,
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
_getFullContainerClasses() {
|
|
34
|
+
return {
|
|
35
|
+
't-toggle-button-full-container': true,
|
|
36
|
+
't-with-label-left': this.labelSide === CheckboxLabelSide.LEFT,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return html `<label class="${classMap(this._getFullContainerClasses())}">
|
|
41
|
+
<div class="t-toggle-button-container">
|
|
42
|
+
<input
|
|
43
|
+
type="checkbox"
|
|
44
|
+
class="t-toggle-button"
|
|
45
|
+
.checked="${this.checked}"
|
|
46
|
+
?disabled="${this.disabled}"
|
|
47
|
+
@change="${this._onToggleButtonChange}"
|
|
48
|
+
/>
|
|
49
|
+
<div class="t-toggle-button-checkmark">
|
|
50
|
+
<div class="t-toggle-button-inner"></div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="t-toggle-button-label">
|
|
54
|
+
<slot>
|
|
55
|
+
<tuix-text
|
|
56
|
+
size="${TextSize.Field1}"
|
|
57
|
+
color="${TextVariant.PRIMARY}"
|
|
58
|
+
?dark="${this.dark}"
|
|
59
|
+
>
|
|
60
|
+
${this.label}
|
|
61
|
+
</tuix-text>
|
|
62
|
+
</slot>
|
|
63
|
+
</div>
|
|
64
|
+
</label>`;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
__decorate([
|
|
68
|
+
property({ type: Boolean })
|
|
69
|
+
], TuixToggleButton.prototype, "checked", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
property({ type: Boolean, reflect: true })
|
|
72
|
+
], TuixToggleButton.prototype, "disabled", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ type: Boolean, reflect: true })
|
|
75
|
+
], TuixToggleButton.prototype, "dark", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: String })
|
|
78
|
+
], TuixToggleButton.prototype, "label", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: String })
|
|
81
|
+
], TuixToggleButton.prototype, "labelSide", void 0);
|
|
82
|
+
TuixToggleButton = __decorate([
|
|
83
|
+
customElement('tuix-toggle-button')
|
|
84
|
+
], TuixToggleButton);
|
|
85
|
+
export { TuixToggleButton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const toggleButtonHostStyles: import("lit").CSSResult;
|
|
2
|
+
export declare const toggleButtonContainerStyles: import("lit").CSSResult;
|
|
3
|
+
export declare const toggleButtonCheckmarkStyles: import("lit").CSSResult;
|
|
4
|
+
export declare const toggleButtonInnerStyles: import("lit").CSSResult;
|
|
5
|
+
export declare const toggleButtonLabelStyles: import("lit").CSSResult;
|