tuix-webcomponents 0.62.0 → 0.64.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/addon-visual-tests-assets/visual-test-illustration.mp4 +0 -0
- package/dist/assets/Color-AVL7NMMY-IH_JbDEF.js +1 -0
- package/dist/assets/DocsRenderer-PQXLIZUC-C0ZKNA9m.js +1286 -0
- package/dist/{src/tuix-icon/TuixIcon.icons.js → assets/TuixIconButton-eQtxZNXh.js} +203 -126
- package/dist/assets/TuixModal-BZFIHTi_.js +78 -0
- package/dist/assets/TuixToast-BhxwZIGo.js +62 -0
- package/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/assets/axe-C59a3kt3.js +30 -0
- package/dist/assets/iframe-ClsPaEIM.js +1057 -0
- package/dist/assets/index-DBzYXxxs.js +1554 -0
- package/dist/assets/index-TjhCmV-u.js +1 -0
- package/dist/assets/matchers-7Z3WT2CE-CcSi9QFY.js +14 -0
- package/dist/assets/screenSizes.enum-C1IhC_dy.js +13 -0
- package/dist/assets/state-CLjydI9z.js +13 -0
- package/dist/assets/tuix-button.stories-Dm_yifox.js +30 -0
- package/dist/assets/tuix-checkbox.stories-DmzoygjC.js +44 -0
- package/dist/assets/tuix-dropdown-object-list.stories-Neeajtj-.js +56 -0
- package/dist/assets/tuix-dropdown.stories-B7ea8QAz.js +28 -0
- package/dist/assets/tuix-icon-button.stories-CgbOSRO4.js +21 -0
- package/dist/assets/tuix-icon.enums-DYTtwLZl.js +1 -0
- package/dist/assets/tuix-icon.stories-CjN2XsKx.js +19 -0
- package/dist/assets/tuix-input.stories-CD7onvw2.js +33 -0
- package/dist/assets/tuix-link.stories-CT7pzGlx.js +35 -0
- package/dist/assets/tuix-modal.stories-B6v3cOPq.js +39 -0
- package/dist/assets/tuix-paper.enum-DhmlUJB7.js +1 -0
- package/dist/assets/tuix-paper.stories-CLnRPHNK.js +31 -0
- package/dist/assets/tuix-radio-button.stories-BwkKC3a9.js +35 -0
- package/dist/assets/tuix-table.stories-Bn-aZa0J.js +65 -0
- package/dist/assets/tuix-text.enums-Ck8cVqZZ.js +1 -0
- package/dist/assets/tuix-text.stories-BNIqPsGD.js +29 -0
- package/dist/assets/tuix-toast.stories-CRYiLiHK.js +21 -0
- package/dist/assets/tuix-toggle-button.stories-CY6wlDnA.js +40 -0
- package/dist/favicon-wrapper.svg +46 -0
- package/dist/favicon.svg +1 -0
- package/dist/iframe.html +685 -0
- package/dist/index.html +160 -0
- package/dist/index.json +1 -0
- 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 +1 -0
- package/dist/sb-addons/a11y-3/manager-bundle.js +5 -0
- package/dist/sb-addons/a11y-3/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/chromatic-com-storybook-1/manager-bundle.js +356 -0
- package/dist/sb-addons/chromatic-com-storybook-1/manager-bundle.js.LEGAL.txt +40 -0
- package/dist/sb-addons/docs-2/manager-bundle.js +151 -0
- 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 +971 -0
- 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 +3 -0
- package/dist/sb-addons/vitest-4/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/favicon-wrapper.svg +46 -0
- package/dist/sb-common-assets/favicon.svg +1 -0
- 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 +797 -0
- package/dist/sb-manager/globals-runtime.js +69679 -0
- package/dist/sb-manager/globals.js +34 -0
- package/dist/sb-manager/runtime.js +13195 -0
- package/package.json +77 -53
- package/dist/assets/tuix-styles.css +0 -58
- package/dist/src/index.d.ts +0 -36
- package/dist/src/index.js +0 -43
- package/dist/src/index.js.map +0 -1
- package/dist/src/tuix-button/TuixBaseButton.d.ts +0 -17
- package/dist/src/tuix-button/TuixBaseButton.js +0 -62
- package/dist/src/tuix-button/TuixBaseButton.js.map +0 -1
- package/dist/src/tuix-button/TuixButton.d.ts +0 -11
- package/dist/src/tuix-button/TuixButton.js +0 -85
- package/dist/src/tuix-button/TuixButton.js.map +0 -1
- package/dist/src/tuix-button/TuixButton.styles.d.ts +0 -3
- package/dist/src/tuix-button/TuixButton.styles.js +0 -108
- package/dist/src/tuix-button/TuixButton.styles.js.map +0 -1
- package/dist/src/tuix-button/enums/tuix-button.enums.d.ts +0 -2
- package/dist/src/tuix-button/enums/tuix-button.enums.js +0 -7
- package/dist/src/tuix-button/enums/tuix-button.enums.js.map +0 -1
- package/dist/src/tuix-button/interfaces/tuix-button.interface.d.ts +0 -1
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js +0 -2
- package/dist/src/tuix-button/interfaces/tuix-button.interface.js.map +0 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +0 -15
- package/dist/src/tuix-checkbox/TuixCheckbox.js +0 -107
- package/dist/src/tuix-checkbox/TuixCheckbox.js.map +0 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.d.ts +0 -4
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +0 -133
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js.map +0 -1
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.d.ts +0 -21
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +0 -24
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js.map +0 -1
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.d.ts +0 -5
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js +0 -2
- package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js.map +0 -1
- package/dist/src/tuix-dropdown/TuixDropdown.d.ts +0 -55
- package/dist/src/tuix-dropdown/TuixDropdown.js +0 -368
- package/dist/src/tuix-dropdown/TuixDropdown.js.map +0 -1
- package/dist/src/tuix-dropdown/TuixDropdown.styles.d.ts +0 -3
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +0 -126
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +0 -1
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +0 -4
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +0 -6
- package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js.map +0 -1
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +0 -15
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +0 -2
- package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js.map +0 -1
- package/dist/src/tuix-icon/TuixIcon.d.ts +0 -15
- package/dist/src/tuix-icon/TuixIcon.icons.d.ts +0 -6
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +0 -1
- package/dist/src/tuix-icon/TuixIcon.js +0 -81
- package/dist/src/tuix-icon/TuixIcon.js.map +0 -1
- package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +0 -62
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js +0 -70
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +0 -1
- package/dist/src/tuix-icon-button/TuixIconButton.d.ts +0 -9
- package/dist/src/tuix-icon-button/TuixIconButton.js +0 -52
- package/dist/src/tuix-icon-button/TuixIconButton.js.map +0 -1
- package/dist/src/tuix-input/TuixInput.d.ts +0 -52
- package/dist/src/tuix-input/TuixInput.js +0 -374
- package/dist/src/tuix-input/TuixInput.js.map +0 -1
- package/dist/src/tuix-input/TuixInput.styles.d.ts +0 -8
- package/dist/src/tuix-input/TuixInput.styles.js +0 -296
- package/dist/src/tuix-input/TuixInput.styles.js.map +0 -1
- package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +0 -38
- package/dist/src/tuix-input/enums/tuix-input.enums.js +0 -42
- package/dist/src/tuix-input/enums/tuix-input.enums.js.map +0 -1
- package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +0 -17
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js +0 -7
- package/dist/src/tuix-input/interfaces/tuix-input.interface.js.map +0 -1
- package/dist/src/tuix-link/TuixLink.d.ts +0 -15
- package/dist/src/tuix-link/TuixLink.js +0 -72
- package/dist/src/tuix-link/TuixLink.js.map +0 -1
- package/dist/src/tuix-link/TuixLink.styles.d.ts +0 -2
- package/dist/src/tuix-link/TuixLink.styles.js +0 -56
- package/dist/src/tuix-link/TuixLink.styles.js.map +0 -1
- package/dist/src/tuix-link/enums/linkTarget.enum.d.ts +0 -6
- package/dist/src/tuix-link/enums/linkTarget.enum.js +0 -8
- package/dist/src/tuix-link/enums/linkTarget.enum.js.map +0 -1
- package/dist/src/tuix-modal/TuixModal.d.ts +0 -9
- package/dist/src/tuix-modal/TuixModal.js +0 -64
- package/dist/src/tuix-modal/TuixModal.js.map +0 -1
- package/dist/src/tuix-modal/TuixModal.styles.d.ts +0 -2
- package/dist/src/tuix-modal/TuixModal.styles.js +0 -56
- package/dist/src/tuix-modal/TuixModal.styles.js.map +0 -1
- package/dist/src/tuix-paper/TuixPaper.d.ts +0 -10
- package/dist/src/tuix-paper/TuixPaper.js +0 -47
- package/dist/src/tuix-paper/TuixPaper.js.map +0 -1
- package/dist/src/tuix-paper/TuixPaper.styles.d.ts +0 -1
- package/dist/src/tuix-paper/TuixPaper.styles.js +0 -31
- package/dist/src/tuix-paper/TuixPaper.styles.js.map +0 -1
- package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +0 -13
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js +0 -16
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +0 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +0 -16
- package/dist/src/tuix-radio-button/TuixRadioButton.js +0 -96
- package/dist/src/tuix-radio-button/TuixRadioButton.js.map +0 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.d.ts +0 -5
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +0 -136
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js.map +0 -1
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +0 -3
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +0 -2
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js.map +0 -1
- package/dist/src/tuix-table/TuixTable.d.ts +0 -46
- package/dist/src/tuix-table/TuixTable.js +0 -373
- package/dist/src/tuix-table/TuixTable.js.map +0 -1
- package/dist/src/tuix-table/TuixTable.styles.d.ts +0 -2
- package/dist/src/tuix-table/TuixTable.styles.js +0 -198
- package/dist/src/tuix-table/TuixTable.styles.js.map +0 -1
- package/dist/src/tuix-table/interfaces/tuix-table.interface.d.ts +0 -45
- package/dist/src/tuix-table/interfaces/tuix-table.interface.js +0 -2
- package/dist/src/tuix-table/interfaces/tuix-table.interface.js.map +0 -1
- package/dist/src/tuix-text/TuixText.d.ts +0 -12
- package/dist/src/tuix-text/TuixText.js +0 -67
- package/dist/src/tuix-text/TuixText.js.map +0 -1
- package/dist/src/tuix-text/TuixText.styles.d.ts +0 -2
- package/dist/src/tuix-text/TuixText.styles.js +0 -159
- package/dist/src/tuix-text/TuixText.styles.js.map +0 -1
- package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +0 -31
- package/dist/src/tuix-text/enums/tuix-text.enums.js +0 -64
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +0 -1
- package/dist/src/tuix-toast/TuixToast.d.ts +0 -15
- package/dist/src/tuix-toast/TuixToast.js +0 -101
- package/dist/src/tuix-toast/TuixToast.js.map +0 -1
- package/dist/src/tuix-toast/TuixToast.styles.d.ts +0 -3
- package/dist/src/tuix-toast/TuixToast.styles.js +0 -44
- package/dist/src/tuix-toast/TuixToast.styles.js.map +0 -1
- package/dist/src/tuix-toast/enums/tuix-toast.enums.d.ts +0 -20
- package/dist/src/tuix-toast/enums/tuix-toast.enums.js +0 -60
- package/dist/src/tuix-toast/enums/tuix-toast.enums.js.map +0 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.d.ts +0 -13
- package/dist/src/tuix-toggle-button/TuixToggleButton.js +0 -86
- package/dist/src/tuix-toggle-button/TuixToggleButton.js.map +0 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.d.ts +0 -5
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +0 -135
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js.map +0 -1
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.d.ts +0 -2
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js +0 -2
- package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js.map +0 -1
- package/dist/src/utils/colors.d.ts +0 -29
- package/dist/src/utils/colors.js +0 -31
- package/dist/src/utils/colors.js.map +0 -1
- package/dist/src/utils/darkColors.d.ts +0 -31
- package/dist/src/utils/darkColors.js +0 -33
- package/dist/src/utils/darkColors.js.map +0 -1
- package/dist/src/utils/hex-rgb.d.ts +0 -5
- package/dist/src/utils/hex-rgb.js +0 -16
- package/dist/src/utils/hex-rgb.js.map +0 -1
- package/dist/src/utils/interfaces/detail-value.interface.d.ts +0 -3
- package/dist/src/utils/interfaces/detail-value.interface.js +0 -2
- package/dist/src/utils/interfaces/detail-value.interface.js.map +0 -1
- package/dist/src/utils/mainVariant.enum.d.ts +0 -4
- package/dist/src/utils/mainVariant.enum.js +0 -6
- package/dist/src/utils/mainVariant.enum.js.map +0 -1
- package/dist/src/utils/screenSizes.enum.d.ts +0 -4
- package/dist/src/utils/screenSizes.enum.js +0 -6
- package/dist/src/utils/screenSizes.enum.js.map +0 -1
- package/dist/src/utils/slottedClassName.d.ts +0 -2
- package/dist/src/utils/slottedClassName.js +0 -2
- package/dist/src/utils/slottedClassName.js.map +0 -1
- package/dist/tsconfig.publish.tsbuildinfo +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tuix-table.interface.js","sourceRoot":"","sources":["../../../../src/tuix-table/interfaces/tuix-table.interface.ts"],"names":[],"mappings":"","sourcesContent":["export interface IDataTableHeader<TRowData = Record<string, unknown>> {\n cellColor?: (rowData: TRowData) => string | undefined;\n isSlot?: boolean;\n slotName?: string;\n name?: string;\n dataKey: Extract<keyof TRowData, string>;\n width: number;\n}\n\nexport interface TablePaginationProps {\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n\n startItem: number;\n endItem: number;\n\n onNextPage: () => void;\n onPreviousPage: () => void;\n onItemsPerPageChange: (newPageSize: number) => void;\n\n isLoading?: boolean;\n stickyInTablet?: boolean;\n}\n\nexport interface ThreeDotsLoaderConfig {\n size?: string;\n color?: string;\n visible?: boolean;\n ariaLabel?: string;\n wrapperStyle?: Record<string, string | number>;\n}\n\nexport interface TuixTableElement<TRowData = any> extends HTMLElement {\n data: TRowData[];\n headers: IDataTableHeader<TRowData>[];\n totalItems?: number;\n currentPage?: number;\n currentSize?: number;\n isLoadingData?: boolean;\n paginated?: boolean;\n showMobileTableInTablet?: boolean;\n disableMobileTable?: boolean;\n pageSizeOptions?: number[];\n loader?: ThreeDotsLoaderConfig;\n}\n\nexport interface PaginationEventDetail {\n page: number;\n pageSize: number;\n}\n\nexport type TuixPaginationEvent = CustomEvent<PaginationEventDetail>;\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { TextSize, TextVariant } from './enums/tuix-text.enums.js';
|
|
3
|
-
export declare class TuixText extends LitElement {
|
|
4
|
-
size: TextSize;
|
|
5
|
-
color?: TextVariant | undefined;
|
|
6
|
-
dark: boolean;
|
|
7
|
-
static styles: import("lit").CSSResult[];
|
|
8
|
-
private _getTextColor;
|
|
9
|
-
private _getStyleMap;
|
|
10
|
-
private _getClassMap;
|
|
11
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
12
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement, unsafeCSS } from 'lit';
|
|
3
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
5
|
-
import { TextSize, TextVariant, colorText, colorTextDark, } from './enums/tuix-text.enums.js';
|
|
6
|
-
import { linkFontStyles, textStyles } from './TuixText.styles.js';
|
|
7
|
-
import { buttonSizeStyles } from '../tuix-button/TuixButton.styles.js';
|
|
8
|
-
import slottedClassName from '../utils/slottedClassName.js';
|
|
9
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
-
import { LINK_TEXT_COLOR_VAR_NAME } from '../tuix-link/TuixLink.styles.js';
|
|
11
|
-
let TuixText = class TuixText extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.size = TextSize.Body1;
|
|
15
|
-
this.color = TextVariant.PRIMARY;
|
|
16
|
-
this.dark = false;
|
|
17
|
-
this._getStyleMap = () => {
|
|
18
|
-
return {
|
|
19
|
-
color: `var(${LINK_TEXT_COLOR_VAR_NAME}, ${this._getTextColor()})`,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
this._getClassMap = () => {
|
|
23
|
-
return {
|
|
24
|
-
text: true,
|
|
25
|
-
[this.size]: true,
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
_getTextColor() {
|
|
30
|
-
const colorMap = this.dark ? colorTextDark : colorText;
|
|
31
|
-
return colorMap[this.color || TextVariant.PRIMARY];
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
return html ` <div
|
|
35
|
-
class="${classMap(this._getClassMap())}"
|
|
36
|
-
style="${styleMap(this._getStyleMap())}"
|
|
37
|
-
>
|
|
38
|
-
<slot></slot>
|
|
39
|
-
</div>`;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
TuixText.styles = [
|
|
43
|
-
css `
|
|
44
|
-
${unsafeCSS(slottedClassName('text'))} {
|
|
45
|
-
font-family: 'Rubik', sans-serif;
|
|
46
|
-
display: inline;
|
|
47
|
-
margin: 0;
|
|
48
|
-
}
|
|
49
|
-
`,
|
|
50
|
-
textStyles,
|
|
51
|
-
linkFontStyles,
|
|
52
|
-
buttonSizeStyles,
|
|
53
|
-
];
|
|
54
|
-
__decorate([
|
|
55
|
-
property({ type: TextSize })
|
|
56
|
-
], TuixText.prototype, "size", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
property({ type: TextVariant })
|
|
59
|
-
], TuixText.prototype, "color", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
property({ type: Boolean, reflect: true })
|
|
62
|
-
], TuixText.prototype, "dark", void 0);
|
|
63
|
-
TuixText = __decorate([
|
|
64
|
-
customElement('tuix-text')
|
|
65
|
-
], TuixText);
|
|
66
|
-
export { TuixText };
|
|
67
|
-
//# sourceMappingURL=TuixText.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TuixText.js","sourceRoot":"","sources":["../../../src/tuix-text/TuixText.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,E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,AAXY,CAWX;AAnBF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sCACP;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;uCACH;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAC9B;AARF,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAiDpB;SAjDY,QAAQ","sourcesContent":["import { html, css, LitElement, unsafeCSS } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport {\n TextSize,\n TextVariant,\n colorText,\n colorTextDark,\n} from './enums/tuix-text.enums.js';\nimport { linkFontStyles, textStyles } from './TuixText.styles.js';\nimport { buttonSizeStyles } from '../tuix-button/TuixButton.styles.js';\nimport slottedClassName from '../utils/slottedClassName.js';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\nimport { LINK_TEXT_COLOR_VAR_NAME } from '../tuix-link/TuixLink.styles.js';\n\n@customElement('tuix-text')\nexport class TuixText extends LitElement {\n @property({ type: TextSize })\n size = TextSize.Body1;\n\n @property({ type: TextVariant })\n color? = TextVariant.PRIMARY;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n static styles = [\n css`\n ${unsafeCSS(slottedClassName('text'))} {\n font-family: 'Rubik', sans-serif;\n display: inline;\n margin: 0;\n }\n `,\n textStyles,\n linkFontStyles,\n buttonSizeStyles,\n ];\n\n private _getTextColor() {\n const colorMap = this.dark ? colorTextDark : colorText;\n return colorMap[this.color || TextVariant.PRIMARY];\n }\n\n private _getStyleMap = () => {\n return {\n color: `var(${LINK_TEXT_COLOR_VAR_NAME}, ${this._getTextColor()})`,\n };\n };\n\n private _getClassMap = (): ClassInfo => {\n return {\n text: true,\n [this.size]: true,\n };\n };\n\n render() {\n return html` <div\n class=\"${classMap(this._getClassMap())}\"\n style=\"${styleMap(this._getStyleMap())}\"\n >\n <slot></slot>\n </div>`;\n }\n}\n"]}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { css, unsafeCSS } from 'lit';
|
|
2
|
-
import { ScreenSizes } from '../utils/screenSizes.enum.js';
|
|
3
|
-
import { TextSize } from './enums/tuix-text.enums.js';
|
|
4
|
-
import slottedClassName from '../utils/slottedClassName.js';
|
|
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
|
-
`;
|
|
159
|
-
//# sourceMappingURL=TuixText.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TuixText.styles.js","sourceRoot":"","sources":["../../../src/tuix-text/TuixText.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,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AAEzD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;IAC7B,SAAS,CAAC;IACV,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;;;;;;uCAMI,WAAW,CAAC,MAAM;MACnD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;;;;;uCAKE,WAAW,CAAC,MAAM;MACnD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;;;;;CAKpC,CAAC;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;IACzB,SAAS,CAAC;IACV,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;;;;;;IAM7B,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;;;;;;IAM5B,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;;;;;;IAM5B,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;;;;;;IAM5B,gBAAgB,CAAC,Q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edClassName from '../utils/slottedClassName';\n\nexport const linkFontStyles = css`\n ${unsafeCSS(`\n ${slottedClassName(TextSize.Link)} {\n font-family: 'Rubik', sans-serif;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.25rem; \n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n ${slottedClassName(TextSize.Link)} { \n font-size: 0.938rem;\n line-height: 1.125rem; \n } \n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n ${slottedClassName(TextSize.Link)} { \n font-size: 0.875rem;\n line-height: 1rem; \n } \n }\n`)}\n`;\n\nexport const textStyles = css`\n ${unsafeCSS(`\n ${slottedClassName(TextSize.XL)} {\n font-size: 3.375rem;\n font-weight: 600;\n line-height: 3.688rem;\n }\n\n ${slottedClassName(TextSize.L)} {\n font-size: 2.813rem;\n font-weight: 600;\n line-height: 3.375rem;\n }\n\n ${slottedClassName(TextSize.M)} {\n font-size: 2.313rem;\n font-weight: 600;\n line-height: 2.75rem;\n }\n\n ${slottedClassName(TextSize.S)} {\n font-size: 1.938rem;\n font-weight: 600;\n line-height: 2.313rem;\n }\n\n ${slottedClassName(TextSize.XS)} {\n font-size: 1.313rem;\n font-weight: 600;\n line-height: 1.563rem;\n }\n\n ${slottedClassName(TextSize.Body1)} {\n font-size: 1.125rem;\n font-weight: 300;\n line-height: 1.688rem;\n }\n\n ${slottedClassName(TextSize.Body2)} {\n font-size: 0.938rem;\n font-weight: 300;\n line-height: 1.313rem;\n }\n\n ${slottedClassName(TextSize.Field1)} {\n font-size: 1rem;\n font-weight: 300;\n line-height: 1.25rem;\n }\n\n ${slottedClassName(TextSize.Field2)} {\n font-size: 0.75rem;\n font-weight: 300;\n line-height: 0.875rem;\n }\n\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n ${slottedClassName(TextSize.XL)} {\n font-size: 3rem;\n line-height: 3.313rem;\n }\n ${slottedClassName(TextSize.L)} {\n font-size: 2.5rem;\n line-height: 3rem;\n }\n ${slottedClassName(TextSize.M)} {\n font-size: 2.063rem;\n line-height: 2.5rem;\n }\n ${slottedClassName(TextSize.S)} {\n font-size: 1.75rem;\n line-height: 2.125rem;\n }\n ${slottedClassName(TextSize.XS)} {\n font-size: 1.188rem;\n line-height: 1.438rem;\n }\n\n ${slottedClassName(TextSize.Body1)} {\n font-size: 1rem;\n line-height: 1.5rem;\n }\n\n ${slottedClassName(TextSize.Body2)} {\n font-size: 0.875rem;\n line-height: 1.125rem;\n }\n\n ${slottedClassName(TextSize.Field1)} {\n font-size: 0.938rem;\n line-height: 1.125rem;\n }\n }\n\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n ${slottedClassName(TextSize.Body1)} {\n font-size: 0.875rem;\n font-weight: 300;\n line-height: 1.313rem;\n }\n ${slottedClassName(TextSize.Body2)} {\n font-size: 0.75rem;\n line-height: 1rem;\n }\n ${slottedClassName(TextSize.Field1)} {\n font-size: 0.875rem;\n font-weight: 300;\n line-height: 1rem;\n }\n ${slottedClassName(TextSize.XL)} {\n font-size: 2.625rem;\n line-height: 2.875rem;\n }\n ${slottedClassName(TextSize.L)} {\n font-size: 2.188rem;\n line-height: 2.438rem;\n }\n ${slottedClassName(TextSize.M)} {\n font-size: 1.813rem;\n line-height: 2rem;\n }\n ${slottedClassName(TextSize.S)} {\n font-size: 1.5rem;\n line-height: 1.625rem;\n }\n ${slottedClassName(TextSize.XS)} {\n font-size: 1.063rem;\n line-height: 1.188rem;\n }\n }\n`)}\n`;\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
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>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Palette } from '../../utils/colors.js';
|
|
2
|
-
import { DarkPalette } from '../../utils/darkColors.js';
|
|
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
|
-
};
|
|
64
|
-
//# sourceMappingURL=tuix-text.enums.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tuix-text.enums.js","sourceRoot":"","sources":["../../../../src/tuix-text/enums/tuix-text.enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,MAAM,CAAN,IAAY,QAYX;AAZD,WAAY,QAAQ;IAClB,qBAAS,CAAA;IACT,mBAAO,CAAA;IACP,mBAAO,CAAA;IACP,mBAAO,CAAA;IACP,qBAAS,CAAA;IACT,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;AACnB,CAAC,EAZW,QAAQ,KAAR,QAAQ,QAYnB;AAED,MAAM,CAAN,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,kCAA6B,CAAA;IAC7B,sCAAiC,CAAA;IACjC,4BAAa,CAAA;IACb,sCAAuB,CAAA;IACvB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,sCAAuB,CAAA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AC,EAAE,OAAO,CAAC,KAAK;IACtC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,WAAW;IAC3C,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,UAAU;IAChD,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK;IACtC,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO;IAC1C,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK;IACtC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW;IAChD,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,WAAW;CAClD,CAAC","sourcesContent":["import { Palette } from '../../utils/colors';\nimport { DarkPalette } from '../../utils/darkColors';\nimport { MainVariant } from '../../utils/mainVariant.enum';\n\nexport enum TextSize {\n XL = 'xl',\n L = 'l',\n M = 'm',\n S = 's',\n XS = 'xs',\n Body1 = 'body1',\n Body2 = 'body2',\n Link = 'link',\n Button = 'button',\n Field1 = 'field1',\n Field2 = 'field2',\n}\n\nexport enum TextVariant {\n PRIMARY = MainVariant.PRIMARY,\n SECONDARY = MainVariant.SECONDARY,\n MAIN = 'main',\n DARK_MAIN = 'dark_main',\n GREY = 'grey',\n LIGHT_GREY = 'light_grey',\n DISABLED = 'disabled',\n VALIDATION = 'validation',\n ERROR = 'error',\n SUCCESS = 'success',\n LIGHT = 'light',\n DARK = 'dark',\n DARK_BLUE = 'dark_blue',\n TITLE_BLUE = 'title_blue',\n}\n\nexport const colorText: Record<TextVariant, string> = {\n [TextVariant.MAIN]: Palette.MAIN,\n [TextVariant.DARK_MAIN]: Palette.DARK_MAIN,\n [TextVariant.PRIMARY]: Palette.BLACK,\n [TextVariant.SECONDARY]: Palette.WHITE,\n [TextVariant.GREY]: Palette.NEUTRAL_600,\n [TextVariant.LIGHT_GREY]: Palette.NEUTRAL_200,\n [TextVariant.DISABLED]: Palette.PRIMARY_200,\n [TextVariant.VALIDATION]: Palette.VALIDATION,\n [TextVariant.ERROR]: Palette.ERROR,\n [TextVariant.SUCCESS]: Palette.SUCCESS,\n [TextVariant.LIGHT]: Palette.WHITE,\n [TextVariant.DARK]: Palette.BLACK,\n [TextVariant.DARK_BLUE]: Palette.DARK_MAIN,\n [TextVariant.TITLE_BLUE]: Palette.DARK_MAIN,\n};\n\nexport const colorTextDark: Record<TextVariant, string> = {\n ...colorText,\n [TextVariant.MAIN]: DarkPalette.MAIN,\n [TextVariant.DARK_MAIN]: DarkPalette.NEUTRAL_600,\n [TextVariant.PRIMARY]: DarkPalette.WHITE,\n [TextVariant.SECONDARY]: Palette.BLACK,\n [TextVariant.GREY]: DarkPalette.NEUTRAL_600,\n [TextVariant.VALIDATION]: DarkPalette.VALIDATION,\n [TextVariant.ERROR]: DarkPalette.ERROR,\n [TextVariant.SUCCESS]: DarkPalette.SUCCESS,\n [TextVariant.LIGHT]: DarkPalette.WHITE,\n [TextVariant.DARK_BLUE]: DarkPalette.PRIMARY_800,\n [TextVariant.TITLE_BLUE]: DarkPalette.PRIMARY_300,\n};\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValueMap } from 'lit';
|
|
2
|
-
import { ToastType, 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
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
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
|
-
updated(changedProperties) {
|
|
45
|
-
super.updated(changedProperties);
|
|
46
|
-
if (this.type === ToastType.NONE || this.visibilityDuration === 0)
|
|
47
|
-
return;
|
|
48
|
-
setTimeout(() => {
|
|
49
|
-
this.type = ToastType.NONE;
|
|
50
|
-
this._handleOnClose();
|
|
51
|
-
}, this.visibilityDuration);
|
|
52
|
-
}
|
|
53
|
-
_handleOnClose() {
|
|
54
|
-
if (this.visibilityDuration === 0)
|
|
55
|
-
return;
|
|
56
|
-
this.dispatchEvent(new CustomEvent('on-close', {
|
|
57
|
-
bubbles: true,
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
render() {
|
|
61
|
-
return html `
|
|
62
|
-
<tuix-paper
|
|
63
|
-
elevation=${PaperElevation.VARIANT_4}
|
|
64
|
-
border-radius=${BorderRadiusPaper.SOFT}
|
|
65
|
-
?dark=${this.dark}
|
|
66
|
-
>
|
|
67
|
-
<div
|
|
68
|
-
style="${styleMap({
|
|
69
|
-
backgroundColor: this.dark ? Palette.BLACK : Palette.WHITE,
|
|
70
|
-
borderRadius: BorderRadiusPaper.SOFT,
|
|
71
|
-
})}"
|
|
72
|
-
>
|
|
73
|
-
<div class="toast-container" style="${styleMap(this._getStyleMap())}">
|
|
74
|
-
${this._getIcon()}
|
|
75
|
-
<tuix-text ?dark=${this.dark}>
|
|
76
|
-
<slot></slot>
|
|
77
|
-
</tuix-text>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</tuix-paper>
|
|
81
|
-
`;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
TuixToast.styles = [commonToastStyles, tabletToastStyles, mobileToastStyles];
|
|
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 };
|
|
101
|
-
//# sourceMappingURL=TuixToast.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TuixToast.js","sourceRoot":"","sources":["../../../src/tuix-toast/TuixToast.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAoB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,SAAS,GAEV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAAzC;;QAIE,SAAI,GAAG,SAAS,CAAC,IAAI,CAAC;QAGtB,uBAAkB,GAAG,IAAI,CAAC;QAG1B,SAAI,GAAG,KAAK,CAAC;QAGb,aAAQ,GAAG,SAAS,CAAC,OAA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customElement, property, state } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums.js';\nimport {\n BorderRadiusPaper,\n PaperElevation,\n} from '../tuix-paper/enums/tuix-paper.enum.js';\nimport { Palette } from '../utils/colors.js';\nimport {\n iconDarkPropertiesMap,\n iconPropertiesMap,\n toastBgColorMap,\n toastBgDarkColorMap,\n ToastType,\n ToastTypeExcludingNone,\n} from './enums/tuix-toast.enums.js';\nimport {\n commonToastStyles,\n mobileToastStyles,\n tabletToastStyles,\n} from './TuixToast.styles.js';\n\n@customElement('tuix-toast')\nexport class TuixToast extends LitElement {\n static styles = [commonToastStyles, tabletToastStyles, mobileToastStyles];\n\n @property({ type: ToastType, reflect: true })\n type = ToastType.NONE;\n\n @property({ type: Number, attribute: 'visibility-duration' })\n visibilityDuration = 4000;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n @state()\n lastType = ToastType.SUCCESS as ToastTypeExcludingNone;\n\n updated(changedProperties: PropertyValueMap<unknown>) {\n super.updated(changedProperties);\n if (this.type === ToastType.NONE || this.visibilityDuration === 0) return;\n setTimeout(() => {\n this.type = ToastType.NONE;\n this._handleOnClose();\n }, this.visibilityDuration);\n }\n\n private _handleOnClose() {\n if (this.visibilityDuration === 0) return;\n this.dispatchEvent(\n new CustomEvent('on-close', {\n bubbles: true,\n })\n );\n }\n\n private _saveType = () => {\n if (this.type !== ToastType.NONE) {\n this.lastType = this.type as ToastTypeExcludingNone;\n }\n };\n\n private _getStyleMap = () => {\n this._saveType();\n const bgColorMap = this.dark ? toastBgDarkColorMap : toastBgColorMap;\n const backgroundColor = bgColorMap[this.lastType];\n\n return { backgroundColor };\n };\n\n private _getIcon = () => {\n this._saveType();\n if (this.lastType === ToastType.TEXT) return;\n const { name: iconName, color: iconColor } = this.dark\n ? iconDarkPropertiesMap[this.lastType]\n : iconPropertiesMap[this.lastType];\n return html`\n <tuix-icon\n size=\"${IconSizeVariant.MEDIUM}\"\n name=\"${iconName}\"\n color=\"${iconColor}\"\n ></tuix-icon>\n `;\n };\n\n render() {\n return html`\n <tuix-paper\n elevation=${PaperElevation.VARIANT_4}\n border-radius=${BorderRadiusPaper.SOFT}\n ?dark=${this.dark}\n >\n <div\n style=\"${styleMap({\n backgroundColor: this.dark ? Palette.BLACK : Palette.WHITE,\n borderRadius: BorderRadiusPaper.SOFT,\n })}\"\n >\n <div class=\"toast-container\" style=\"${styleMap(this._getStyleMap())}\">\n ${this._getIcon()}\n <tuix-text ?dark=${this.dark}>\n <slot></slot>\n </tuix-text>\n </div>\n </div>\n </tuix-paper>\n `;\n }\n}\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
2
|
-
import { ScreenSizes } from '../utils/screenSizes.enum.js';
|
|
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
|
-
`;
|
|
44
|
-
//# sourceMappingURL=TuixToast.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TuixToast.styles.js","sourceRoot":"","sources":["../../../src/tuix-toast/TuixToast.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBnC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;uCACG,WAAW,CAAC,MAAM;;;;;CAKxD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;uCACG,WAAW,CAAC,MAAM;;;;;;CAMxD,CAAC","sourcesContent":["import { css } from 'lit';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\n\nexport const commonToastStyles = css`\n :host {\n position: fixed;\n bottom: -100%;\n left: 50%;\n transform: translateX(-50%);\n transition: bottom 600ms linear;\n width: 640px;\n z-index: 99;\n }\n\n :host([type='text']),\n :host([type='warning']),\n :host([type='error']),\n :host([type='success']) {\n bottom: 1.5rem;\n }\n\n .toast-container {\n padding: 12px 16px;\n display: flex;\n gap: 16px;\n align-items: center;\n border-radius: 4px;\n }\n`;\n\nexport const tabletToastStyles = css`\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n :host {\n width: 520px;\n }\n }\n`;\n\nexport const mobileToastStyles = css`\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n :host {\n max-width: 343px;\n width: 90%;\n }\n }\n`;\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums.js';
|
|
2
|
-
import { Palette } from '../../utils/colors.js';
|
|
3
|
-
import { DarkPalette } from '../../utils/darkColors.js';
|
|
4
|
-
export declare enum 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 {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { IconName } from '../../tuix-icon/enums/tuix-icon.enums.js';
|
|
2
|
-
import { Palette } from '../../utils/colors.js';
|
|
3
|
-
import { DarkPalette } from '../../utils/darkColors.js';
|
|
4
|
-
export var 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
|
-
};
|
|
60
|
-
//# sourceMappingURL=tuix-toast.enums.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tuix-toast.enums.js","sourceRoot":"","sources":["../../../../src/tuix-toast/enums/tuix-toast.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,SAMX;AAND,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,0BAAa,CAAA;IACb,gCAAmB,CAAA;IACnB,4BAAe,CAAA;IACf,gCAAmB,CAAA;AACrB,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AASD,MAAM,CAAC,MAAM,eAAe,GAA2C;IACrE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK;IAC/B,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa;IAC1C,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ;IACnC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAA2C;IACzE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW;IACrC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,aAAa;IAC9C,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,QAAQ;IACvC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,UAAU;CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAC5B;IACE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;QAChB,IAAI,EAAE,QAAQ,CAAC,UAAU;QACzB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB;IACD,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QACnB,IAAI,EAAE,QAAQ,CAAC,oBAAoB;QACnC,KAAK,EAAE,OAAO,CAAC,UAAU;KAC1B;IACD,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QACjB,IAAI,EAAE,QAAQ,CAAC,kBAAkB;QACjC,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB;IACD,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QACnB,IAAI,EAAE,QAAQ,CAAC,YAAY;QAC3B,KAAK,EAAE,OAAO,CAAC,OAAO;KACvB;CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,qBAAqB,GAG9B;IACF,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;QAChB,IAAI,EAAE,QAAQ,CAAC,UAAU;QACzB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB;IACD,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QACnB,IAAI,EAAE,QAAQ,CAAC,oBAAoB;QACnC,KAAK,EAAE,WAAW,CAAC,UAAU;KAC9B;IACD,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QACjB,IAAI,EAAE,QAAQ,CAAC,kBAAkB;QACjC,KAAK,EAAE,WAAW,CAAC,KAAK;KACzB;IACD,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;QACnB,IAAI,EAAE,QAAQ,CAAC,YAAY;QAC3B,KAAK,EAAE,WAAW,CAAC,OAAO;KAC3B;CACF,CAAC","sourcesContent":["import { IconName } from '../../tuix-icon/enums/tuix-icon.enums';\nimport { Palette } from '../../utils/colors';\nimport { DarkPalette } from '../../utils/darkColors';\n\nexport enum ToastType {\n NONE = 'none',\n TEXT = 'text',\n WARNING = 'warning',\n ERROR = 'error',\n SUCCESS = 'success',\n}\n\nexport type ToastTypeExcludingNone = Exclude<ToastType, ToastType.NONE>;\n\ninterface IconProperties {\n name: IconName;\n color: Palette | DarkPalette;\n}\n\nexport const toastBgColorMap: Record<ToastTypeExcludingNone, string> = {\n [ToastType.TEXT]: Palette.WHITE,\n [ToastType.WARNING]: Palette.VALIDATION_50,\n [ToastType.ERROR]: Palette.ERROR_50,\n [ToastType.SUCCESS]: Palette.SUCCESS_50,\n};\n\nexport const toastBgDarkColorMap: Record<ToastTypeExcludingNone, string> = {\n [ToastType.TEXT]: Palette.PRIMARY_950,\n [ToastType.WARNING]: DarkPalette.VALIDATION_50,\n [ToastType.ERROR]: DarkPalette.ERROR_50,\n [ToastType.SUCCESS]: DarkPalette.SUCCESS_50,\n};\n\nexport const iconPropertiesMap: Record<ToastTypeExcludingNone, IconProperties> =\n {\n [ToastType.TEXT]: {\n name: IconName.ARROW_DOWN,\n color: Palette.BLACK,\n },\n [ToastType.WARNING]: {\n name: IconName.TRIANGLE_EXCLAMATION,\n color: Palette.VALIDATION,\n },\n [ToastType.ERROR]: {\n name: IconName.CIRCLE_EXCLAMATION,\n color: Palette.ERROR,\n },\n [ToastType.SUCCESS]: {\n name: IconName.CIRCLE_CHECK,\n color: Palette.SUCCESS,\n },\n };\n\nexport const iconDarkPropertiesMap: Record<\n ToastTypeExcludingNone,\n IconProperties\n> = {\n [ToastType.TEXT]: {\n name: IconName.ARROW_DOWN,\n color: Palette.WHITE,\n },\n [ToastType.WARNING]: {\n name: IconName.TRIANGLE_EXCLAMATION,\n color: DarkPalette.VALIDATION,\n },\n [ToastType.ERROR]: {\n name: IconName.CIRCLE_EXCLAMATION,\n color: DarkPalette.ERROR,\n },\n [ToastType.SUCCESS]: {\n name: IconName.CIRCLE_CHECK,\n color: DarkPalette.SUCCESS,\n },\n};\n"]}
|