tuix-webcomponents 0.3.0 → 0.5.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/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/tuix-button/TuixButton.js +1 -1
- package/dist/src/tuix-button/TuixButton.js.map +1 -1
- package/dist/src/tuix-button/TuixButton.styles.js +7 -3
- package/dist/src/tuix-button/TuixButton.styles.js.map +1 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +1 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js.map +1 -1
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +3 -5
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +1 -1
- package/dist/src/tuix-icon/TuixIcon.d.ts +2 -1
- package/dist/src/tuix-icon/TuixIcon.icons.js +7 -0
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +1 -1
- package/dist/src/tuix-icon/TuixIcon.js +7 -2
- package/dist/src/tuix-icon/TuixIcon.js.map +1 -1
- package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +2 -1
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js +1 -0
- package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +1 -1
- package/dist/src/tuix-input/TuixInput.styles.js +3 -3
- package/dist/src/tuix-input/TuixInput.styles.js.map +1 -1
- package/dist/src/tuix-link/TuixLink.d.ts +6 -4
- package/dist/src/tuix-link/TuixLink.js +21 -34
- package/dist/src/tuix-link/TuixLink.js.map +1 -1
- package/dist/src/tuix-link/TuixLink.styles.d.ts +1 -0
- package/dist/src/tuix-link/TuixLink.styles.js +67 -0
- package/dist/src/tuix-link/TuixLink.styles.js.map +1 -0
- package/dist/src/tuix-paper/TuixPaper.d.ts +4 -3
- package/dist/src/tuix-paper/TuixPaper.js +16 -26
- package/dist/src/tuix-paper/TuixPaper.js.map +1 -1
- package/dist/src/tuix-paper/TuixPaper.styles.d.ts +1 -0
- package/dist/src/tuix-paper/TuixPaper.styles.js +31 -0
- package/dist/src/tuix-paper/TuixPaper.styles.js.map +1 -0
- package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +7 -1
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js +15 -8
- package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +1 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +1 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js.map +1 -1
- package/dist/src/tuix-text/TuixText.d.ts +1 -1
- package/dist/src/tuix-text/TuixText.js +7 -6
- package/dist/src/tuix-text/TuixText.js.map +1 -1
- package/dist/src/tuix-text/TuixText.styles.js +26 -22
- package/dist/src/tuix-text/TuixText.styles.js.map +1 -1
- package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +6 -1
- package/dist/src/tuix-text/enums/tuix-text.enums.js +17 -0
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +1 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +1 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js.map +1 -1
- package/dist/src/utils/colors.d.ts +4 -1
- package/dist/src/utils/colors.js +3 -0
- package/dist/src/utils/colors.js.map +1 -1
- package/dist/src/utils/darkColors.d.ts +10 -4
- package/dist/src/utils/darkColors.js +9 -3
- package/dist/src/utils/darkColors.js.map +1 -1
- package/dist/src/utils/screenSizes.enum.d.ts +2 -2
- package/dist/src/utils/screenSizes.enum.js +2 -3
- package/dist/src/utils/screenSizes.enum.js.map +1 -1
- package/dist/src/utils/slottedClassName.d.ts +2 -0
- package/dist/src/utils/slottedClassName.js +2 -0
- package/dist/src/utils/slottedClassName.js.map +1 -0
- package/dist/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,13 @@
|
|
|
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 { Palette } from '../utils/colors';
|
|
5
|
-
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
6
4
|
import { MainVariant } from '../utils/mainVariant.enum';
|
|
7
5
|
import { LinkTarget } from './enums/linkTarget.enum';
|
|
8
6
|
import { classMap } from 'lit/directives/class-map.js';
|
|
7
|
+
import { linkStyles } from './TuixLink.styles';
|
|
9
8
|
let TuixLink = class TuixLink extends LitElement {
|
|
10
9
|
constructor() {
|
|
11
10
|
super(...arguments);
|
|
12
|
-
this.href = '';
|
|
13
11
|
this.target = LinkTarget.BLANK;
|
|
14
12
|
this.variant = MainVariant.PRIMARY;
|
|
15
13
|
this.disabled = false;
|
|
@@ -19,10 +17,10 @@ let TuixLink = class TuixLink extends LitElement {
|
|
|
19
17
|
return {
|
|
20
18
|
link: true,
|
|
21
19
|
disabled: this.disabled,
|
|
22
|
-
[MainVariant.SECONDARY]: this.
|
|
20
|
+
[MainVariant.SECONDARY]: this.variant === MainVariant.SECONDARY,
|
|
23
21
|
};
|
|
24
22
|
}
|
|
25
|
-
|
|
23
|
+
_anchorTemplate() {
|
|
26
24
|
return html `
|
|
27
25
|
<a
|
|
28
26
|
target="${this.disabled ? LinkTarget.SELF : this.target}"
|
|
@@ -33,35 +31,24 @@ let TuixLink = class TuixLink extends LitElement {
|
|
|
33
31
|
</a>
|
|
34
32
|
`;
|
|
35
33
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
line-height: 1.25rem;
|
|
43
|
-
text-decoration: none;
|
|
44
|
-
color: ${unsafeCSS(Palette.MAIN)};
|
|
45
|
-
}
|
|
46
|
-
a.link:hover {
|
|
47
|
-
text-decoration: underline;
|
|
48
|
-
}
|
|
49
|
-
a.link.secondary {
|
|
50
|
-
color: ${unsafeCSS(Palette.WHITE)};
|
|
51
|
-
}
|
|
52
|
-
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
53
|
-
a.link {
|
|
54
|
-
font-size: 0.875rem;
|
|
55
|
-
font-weight: 400;
|
|
56
|
-
line-height: 1rem;
|
|
57
|
-
}
|
|
34
|
+
_divTemplate() {
|
|
35
|
+
return html `
|
|
36
|
+
<div class="${classMap(this._getOptionalClasses())}">
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
58
40
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
41
|
+
render() {
|
|
42
|
+
const isValidAnchor = this.href && !this.disabled;
|
|
43
|
+
if (isValidAnchor) {
|
|
44
|
+
return this._anchorTemplate();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return this._divTemplate();
|
|
48
|
+
}
|
|
63
49
|
}
|
|
64
|
-
|
|
50
|
+
};
|
|
51
|
+
TuixLink.styles = [linkStyles];
|
|
65
52
|
__decorate([
|
|
66
53
|
property({ type: String })
|
|
67
54
|
], TuixLink.prototype, "href", void 0);
|
|
@@ -69,7 +56,7 @@ __decorate([
|
|
|
69
56
|
property({ type: LinkTarget })
|
|
70
57
|
], TuixLink.prototype, "target", void 0);
|
|
71
58
|
__decorate([
|
|
72
|
-
property({ type: MainVariant })
|
|
59
|
+
property({ type: MainVariant, reflect: true })
|
|
73
60
|
], TuixLink.prototype, "variant", void 0);
|
|
74
61
|
__decorate([
|
|
75
62
|
property({ type: Boolean, reflect: true })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixLink.js","sourceRoot":"","sources":["../../../src/tuix-link/TuixLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"TuixLink.js","sourceRoot":"","sources":["../../../src/tuix-link/TuixLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,UAAU;IAAxC;;QAOE,WAAM,GAAG,UAAU,CAAC,KAAK,CAAC;QAG1B,YAAO,GAAG,WAAW,CAAC,OAAO,CAAC;QAG9B,aAAQ,GAAG,KAAK,CAAC;QAGjB,SAAI,GAAG,KAAK,CAAC;IAsCf,CAAC;IApCS,mBAAmB;QACzB,OAAO;YACL,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,SAAS;SAChE,CAAC;IACJ,CAAC;IAEO,eAAe;QACrB,OAAO,IAAI,CAAA;;kBAEG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;iBAC9C,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBACrC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI;;;;KAI3D,CAAC;IACJ,CAAC;IAEO,YAAY;QAClB,OAAO,IAAI,CAAA;oBACK,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;;;KAGnD,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QAClD,IAAI,aAAa,EAAE;YACjB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;SAC/B;aAAM;YACL,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;SAC5B;IACH,CAAC;;AApDM,eAAM,GAAG,CAAC,UAAU,CAAC,AAAf,CAAgB;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;wCACL;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACjB;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAC9B;AAhBF,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAsDpB;SAtDY,QAAQ","sourcesContent":["import { html, LitElement, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { MainVariant } from '../utils/mainVariant.enum';\nimport { LinkTarget } from './enums/linkTarget.enum';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\nimport { linkStyles } from './TuixLink.styles';\n\n@customElement('tuix-link')\nexport class TuixLink extends LitElement {\n static styles = [linkStyles];\n\n @property({ type: String })\n href?: string;\n\n @property({ type: LinkTarget })\n target = LinkTarget.BLANK;\n\n @property({ type: MainVariant, reflect: true })\n variant = MainVariant.PRIMARY;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n private _getOptionalClasses(): ClassInfo {\n return {\n link: true,\n disabled: this.disabled,\n [MainVariant.SECONDARY]: this.variant === MainVariant.SECONDARY,\n };\n }\n\n private _anchorTemplate(): TemplateResult {\n return html`\n <a\n target=\"${this.disabled ? LinkTarget.SELF : this.target}\"\n class=\"${classMap(this._getOptionalClasses())}\"\n href=\"${this.disabled ? 'javascript:void(0)' : this.href}\"\n >\n <slot></slot>\n </a>\n `;\n }\n\n private _divTemplate(): TemplateResult {\n return html`\n <div class=\"${classMap(this._getOptionalClasses())}\">\n <slot></slot>\n </div>\n `;\n }\n\n render() {\n const isValidAnchor = this.href && !this.disabled;\n if (isValidAnchor) {\n return this._anchorTemplate();\n } else {\n return this._divTemplate();\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { MainVariant } from '../utils/mainVariant.enum';
|
|
3
|
+
import { Palette } from '../utils/colors';
|
|
4
|
+
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
5
|
+
import { DarkPalette } from '../utils/darkColors';
|
|
6
|
+
export const linkStyles = css `
|
|
7
|
+
${unsafeCSS(`
|
|
8
|
+
:host {
|
|
9
|
+
--t-link-border-color: ${Palette.MAIN};
|
|
10
|
+
--t-link-text-color: ${Palette.MAIN}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([dark]) {
|
|
14
|
+
--t-link-border-color: ${DarkPalette.MAIN};
|
|
15
|
+
--t-link-text-color: ${DarkPalette.MAIN}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([variant=${MainVariant.SECONDARY}]) {
|
|
19
|
+
--t-link-border-color: ${Palette.WHITE};
|
|
20
|
+
--t-link-text-color: ${Palette.WHITE}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host([variant=${MainVariant.SECONDARY}][dark]) {
|
|
24
|
+
--t-link-border-color: ${DarkPalette.WHITE};
|
|
25
|
+
--t-link-text-color: ${DarkPalette.WHITE}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([disabled]) .link.disabled {
|
|
29
|
+
--t-link-border-color: ${Palette.PRIMARY_300};
|
|
30
|
+
--t-link-text-color: ${Palette.PRIMARY_300}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.link {
|
|
34
|
+
font-family: 'Rubik', sans-serif;
|
|
35
|
+
font-size: 1.25rem;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
line-height: 24px;
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
display: inline;
|
|
40
|
+
color: var(--t-link-text-color);
|
|
41
|
+
border-bottom: solid 1px transparent;
|
|
42
|
+
}
|
|
43
|
+
.link:hover {
|
|
44
|
+
border-bottom: solid 1px var(--t-link-border-color);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
.link.secondary {
|
|
48
|
+
color: var(--t-link-text-color);
|
|
49
|
+
}
|
|
50
|
+
.link.secondary:hover {
|
|
51
|
+
border-bottom: solid 1px var(--t-link-border-color);
|
|
52
|
+
}
|
|
53
|
+
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
54
|
+
.link {
|
|
55
|
+
font-size: 1rem;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
line-height: 1.25rem;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
.link.disabled {
|
|
61
|
+
border-bottom: solid 1px var(--t-link-border-color);
|
|
62
|
+
color: var(--t-link-text-color);
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
}
|
|
65
|
+
`)}
|
|
66
|
+
`;
|
|
67
|
+
//# sourceMappingURL=TuixLink.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixLink.styles.js","sourceRoot":"","sources":["../../../src/tuix-link/TuixLink.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;IACzB,SAAS,CAAC;;6BAEe,OAAO,CAAC,IAAI;2BACd,OAAO,CAAC,IAAI;;;;6BAIV,WAAW,CAAC,IAAI;2BAClB,WAAW,CAAC,IAAI;;;mBAGxB,WAAW,CAAC,SAAS;6BACX,OAAO,CAAC,KAAK;2BACf,OAAO,CAAC,KAAK;;;mBAGrB,WAAW,CAAC,SAAS;6BACX,WAAW,CAAC,KAAK;2BACnB,WAAW,CAAC,KAAK;;;;6BAIf,OAAO,CAAC,WAAW;2BACrB,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;uCAuBP,WAAW,CAAC,MAAM;;;;;;;;;;;;CAYxD,CAAC;CACD,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { MainVariant } from '../utils/mainVariant.enum';\nimport { Palette } from '../utils/colors';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { DarkPalette } from '../utils/darkColors';\n\nexport const linkStyles = css`\n ${unsafeCSS(`\n :host {\n --t-link-border-color: ${Palette.MAIN};\n --t-link-text-color: ${Palette.MAIN}\n }\n\n :host([dark]) {\n --t-link-border-color: ${DarkPalette.MAIN};\n --t-link-text-color: ${DarkPalette.MAIN}\n }\n\n :host([variant=${MainVariant.SECONDARY}]) {\n --t-link-border-color: ${Palette.WHITE};\n --t-link-text-color: ${Palette.WHITE}\n }\n\n :host([variant=${MainVariant.SECONDARY}][dark]) {\n --t-link-border-color: ${DarkPalette.WHITE};\n --t-link-text-color: ${DarkPalette.WHITE}\n }\n\n :host([disabled]) .link.disabled {\n --t-link-border-color: ${Palette.PRIMARY_300};\n --t-link-text-color: ${Palette.PRIMARY_300}\n }\n\n .link {\n font-family: 'Rubik', sans-serif;\n font-size: 1.25rem;\n font-weight: 400;\n line-height: 24px;\n text-decoration: none;\n display: inline;\n color: var(--t-link-text-color);\n border-bottom: solid 1px transparent;\n }\n .link:hover {\n border-bottom: solid 1px var(--t-link-border-color);\n cursor: pointer;\n }\n .link.secondary {\n color: var(--t-link-text-color);\n }\n .link.secondary:hover {\n border-bottom: solid 1px var(--t-link-border-color);\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .link {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.25rem;\n }\n }\n .link.disabled {\n border-bottom: solid 1px var(--t-link-border-color);\n color: var(--t-link-text-color);\n cursor: not-allowed;\n }\n`)}\n`;\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { BorderRadiusPaper, PaperElevation } from './enums/tuix-paper.enum';
|
|
3
3
|
export declare class TuixPaper extends LitElement {
|
|
4
|
-
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
elevation: PaperElevation;
|
|
6
|
+
borderRadius: BorderRadiusPaper;
|
|
5
7
|
dark: boolean;
|
|
6
|
-
static styles: import("lit").CSSResult;
|
|
7
8
|
private _getOptionalClasses;
|
|
8
9
|
render(): TemplateResult;
|
|
9
10
|
}
|
|
@@ -1,52 +1,42 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement,
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import {
|
|
4
|
+
import { BorderRadiusPaper, PaperElevation } from './enums/tuix-paper.enum';
|
|
5
5
|
import { classMap } from 'lit/directives/class-map.js';
|
|
6
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
7
|
+
import { paperStyles } from './TuixPaper.styles';
|
|
6
8
|
let TuixPaper = class TuixPaper extends LitElement {
|
|
7
9
|
constructor() {
|
|
8
10
|
super(...arguments);
|
|
9
|
-
this.elevation =
|
|
11
|
+
this.elevation = PaperElevation.VARIANT_1;
|
|
12
|
+
this.borderRadius = BorderRadiusPaper.NONE;
|
|
10
13
|
this.dark = false;
|
|
11
14
|
}
|
|
12
15
|
_getOptionalClasses() {
|
|
13
|
-
const elevationClass = `elevation `;
|
|
14
16
|
const variantClass = `variant_${this.elevation}`;
|
|
15
17
|
const darkClass = `dark_${this.elevation}`;
|
|
16
18
|
return {
|
|
17
|
-
|
|
19
|
+
elevation: true,
|
|
18
20
|
[variantClass]: !this.dark,
|
|
19
21
|
[darkClass]: this.dark,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
render() {
|
|
23
|
-
return html ` <div
|
|
25
|
+
return html ` <div
|
|
26
|
+
class="${classMap(this._getOptionalClasses())}"
|
|
27
|
+
style="${styleMap({ borderRadius: this.borderRadius })}"
|
|
28
|
+
>
|
|
24
29
|
<slot></slot>
|
|
25
30
|
</div>`;
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
|
-
|
|
29
|
-
TuixPaper.styles = css `
|
|
30
|
-
.elevation {
|
|
31
|
-
border-radius: 20px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
${unsafeCSS(Object.values(PaperVariant).slice(1)
|
|
35
|
-
.map((variant, index) => {
|
|
36
|
-
return `
|
|
37
|
-
.elevation.variant_${variant} {
|
|
38
|
-
box-shadow: 0px ${Math.pow(2, index)}px ${Math.pow(2, (index + 2))}px rgba(66, 79, 101, 0.16);
|
|
39
|
-
}
|
|
40
|
-
.elevation.dark_${variant} {
|
|
41
|
-
background-color: ${unsafeCSS(`rgb(${23 + 3 * (index)}, ${23 + 3 * (index)}, ${26 + 5 * (index)})`)};
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
})
|
|
45
|
-
.join('\n'))}
|
|
46
|
-
`;
|
|
33
|
+
TuixPaper.styles = [paperStyles];
|
|
47
34
|
__decorate([
|
|
48
|
-
property({ type:
|
|
35
|
+
property({ type: PaperElevation })
|
|
49
36
|
], TuixPaper.prototype, "elevation", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
property({ type: String, attribute: 'border-radius' })
|
|
39
|
+
], TuixPaper.prototype, "borderRadius", void 0);
|
|
50
40
|
__decorate([
|
|
51
41
|
property({ type: Boolean, reflect: true })
|
|
52
42
|
], TuixPaper.prototype, "dark", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixPaper.js","sourceRoot":"","sources":["../../../src/tuix-paper/TuixPaper.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,
|
|
1
|
+
{"version":3,"file":"TuixPaper.js","sourceRoot":"","sources":["../../../src/tuix-paper/TuixPaper.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAAzC;;QAIE,cAAS,GAAG,cAAc,CAAC,SAAS,CAAC;QAGrC,iBAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC;QAGtC,SAAI,GAAG,KAAK,CAAC;IAoBf,CAAC;IAlBS,mBAAmB;QACzB,MAAM,YAAY,GAAG,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,QAAQ,IAAI,CAAC,SAAS,EAAE,CAAC;QAC3C,OAAO;YACL,SAAS,EAAE,IAAI;YACf,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI;YAC1B,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI;SACvB,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;eACA,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;eACpC,QAAQ,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;;;WAGjD,CAAC;IACV,CAAC;;AA5BM,gBAAM,GAAG,CAAC,WAAW,CAAC,AAAhB,CAAiB;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;4CACE;AAGrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;+CACjB;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAC9B;AAVF,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA8BrB;SA9BY,SAAS","sourcesContent":["import { LitElement, TemplateResult, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { BorderRadiusPaper, PaperElevation } from './enums/tuix-paper.enum';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { paperStyles } from './TuixPaper.styles';\n\n@customElement('tuix-paper')\nexport class TuixPaper extends LitElement {\n static styles = [paperStyles];\n\n @property({ type: PaperElevation })\n elevation = PaperElevation.VARIANT_1;\n\n @property({ type: String, attribute: 'border-radius' })\n borderRadius = BorderRadiusPaper.NONE;\n\n @property({ type: Boolean, reflect: true })\n dark = false;\n\n private _getOptionalClasses(): ClassInfo {\n const variantClass = `variant_${this.elevation}`;\n const darkClass = `dark_${this.elevation}`;\n return {\n elevation: true,\n [variantClass]: !this.dark,\n [darkClass]: this.dark,\n };\n }\n\n render(): TemplateResult {\n return html` <div\n class=\"${classMap(this._getOptionalClasses())}\"\n style=\"${styleMap({ borderRadius: this.borderRadius })}\"\n >\n <slot></slot>\n </div>`;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const paperStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { PaperElevation } from './enums/tuix-paper.enum';
|
|
3
|
+
import { Palette } from '../utils/colors';
|
|
4
|
+
const calculatedStyles = Object.values(PaperElevation)
|
|
5
|
+
.slice(1, -1)
|
|
6
|
+
.map((variant, index) => `
|
|
7
|
+
.elevation.variant_${variant} {
|
|
8
|
+
box-shadow: 0px ${2 ** index}px ${2 ** (index + 2)}px ${Palette.SHADOW};
|
|
9
|
+
}
|
|
10
|
+
.elevation.dark_${variant} {
|
|
11
|
+
background-color:rgb(${23 + 3 * index},${23 + 3 * index},${26 + 5 * index});
|
|
12
|
+
}`)
|
|
13
|
+
.join('\n');
|
|
14
|
+
export const paperStyles = css `
|
|
15
|
+
${unsafeCSS(`
|
|
16
|
+
.elevation {
|
|
17
|
+
background-color: ${Palette.WHITE};
|
|
18
|
+
}
|
|
19
|
+
.elevation.dark_${PaperElevation.VARIANT_0} {
|
|
20
|
+
background-color: ${Palette.BLACK};
|
|
21
|
+
}
|
|
22
|
+
${calculatedStyles}
|
|
23
|
+
.elevation.variant_${PaperElevation.VARIANT_4} {
|
|
24
|
+
box-shadow: 0px 7px 24px ${Palette.SHADOW};
|
|
25
|
+
}
|
|
26
|
+
.elevation.dark_${PaperElevation.VARIANT_4} {
|
|
27
|
+
background-color: rgb(33, 33, 40);
|
|
28
|
+
}
|
|
29
|
+
`)}
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=TuixPaper.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixPaper.styles.js","sourceRoot":"","sources":["../../../src/tuix-paper/TuixPaper.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;KACnD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACZ,GAAG,CACF,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;uBACD,OAAO;sBACR,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,OAAO,CAAC,MAAM;;oBAEtD,OAAO;2BACA,EAAE,GAAG,CAAC,GAAG,KAAK,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK;IACzE,CACD;KACA,IAAI,CAAC,IAAI,CAAC,CAAC;AAEd,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;IAC1B,SAAS,CAAC;;wBAEU,OAAO,CAAC,KAAK;;oBAEjB,cAAc,CAAC,SAAS;wBACpB,OAAO,CAAC,KAAK;;IAEjC,gBAAgB;uBACG,cAAc,CAAC,SAAS;+BAChB,OAAO,CAAC,MAAM;;oBAEzB,cAAc,CAAC,SAAS;;;CAG3C,CAAC;CACD,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { PaperElevation } from './enums/tuix-paper.enum';\nimport { Palette } from '../utils/colors';\n\nconst calculatedStyles = Object.values(PaperElevation)\n .slice(1, -1)\n .map(\n (variant, index) => `\n .elevation.variant_${variant} {\n box-shadow: 0px ${2 ** index}px ${2 ** (index + 2)}px ${Palette.SHADOW};\n }\n .elevation.dark_${variant} {\n background-color:rgb(${23 + 3 * index},${23 + 3 * index},${26 + 5 * index});\n }`\n )\n .join('\\n');\n\nexport const paperStyles = css`\n ${unsafeCSS(`\n .elevation {\n background-color: ${Palette.WHITE};\n }\n .elevation.dark_${PaperElevation.VARIANT_0} {\n background-color: ${Palette.BLACK};\n }\n ${calculatedStyles}\n .elevation.variant_${PaperElevation.VARIANT_4} {\n box-shadow: 0px 7px 24px ${Palette.SHADOW};\n }\n .elevation.dark_${PaperElevation.VARIANT_4} {\n background-color: rgb(33, 33, 40);\n }\n`)}\n`;\n"]}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum PaperElevation {
|
|
2
2
|
VARIANT_0 = "0",
|
|
3
3
|
VARIANT_1 = "1",
|
|
4
4
|
VARIANT_2 = "2",
|
|
5
5
|
VARIANT_3 = "3",
|
|
6
6
|
VARIANT_4 = "4"
|
|
7
7
|
}
|
|
8
|
+
export declare enum BorderRadiusPaper {
|
|
9
|
+
NONE = "0px",
|
|
10
|
+
SOFT = "4px",
|
|
11
|
+
MEDIUM = "10px",
|
|
12
|
+
STRONG = "20px"
|
|
13
|
+
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(
|
|
1
|
+
export var PaperElevation;
|
|
2
|
+
(function (PaperElevation) {
|
|
3
|
+
PaperElevation["VARIANT_0"] = "0";
|
|
4
|
+
PaperElevation["VARIANT_1"] = "1";
|
|
5
|
+
PaperElevation["VARIANT_2"] = "2";
|
|
6
|
+
PaperElevation["VARIANT_3"] = "3";
|
|
7
|
+
PaperElevation["VARIANT_4"] = "4";
|
|
8
|
+
})(PaperElevation || (PaperElevation = {}));
|
|
9
|
+
export var BorderRadiusPaper;
|
|
10
|
+
(function (BorderRadiusPaper) {
|
|
11
|
+
BorderRadiusPaper["NONE"] = "0px";
|
|
12
|
+
BorderRadiusPaper["SOFT"] = "4px";
|
|
13
|
+
BorderRadiusPaper["MEDIUM"] = "10px";
|
|
14
|
+
BorderRadiusPaper["STRONG"] = "20px";
|
|
15
|
+
})(BorderRadiusPaper || (BorderRadiusPaper = {}));
|
|
9
16
|
//# sourceMappingURL=tuix-paper.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuix-paper.enum.js","sourceRoot":"","sources":["../../../../src/tuix-paper/enums/tuix-paper.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"tuix-paper.enum.js","sourceRoot":"","sources":["../../../../src/tuix-paper/enums/tuix-paper.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,iCAAY,CAAA;IACZ,iCAAY,CAAA;IACZ,oCAAe,CAAA;IACf,oCAAe,CAAA;AACjB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B","sourcesContent":["export enum PaperElevation {\n VARIANT_0 = '0',\n VARIANT_1 = '1',\n VARIANT_2 = '2',\n VARIANT_3 = '3',\n VARIANT_4 = '4',\n}\n\nexport enum BorderRadiusPaper {\n NONE = '0px',\n SOFT = '4px',\n MEDIUM = '10px',\n STRONG = '20px',\n}\n"]}
|
|
@@ -115,7 +115,7 @@ export const radioButtonLabelStyles = css `
|
|
|
115
115
|
font-size: 1rem;
|
|
116
116
|
line-height: 1.5rem;
|
|
117
117
|
font-weight: 300;
|
|
118
|
-
font-family: '
|
|
118
|
+
font-family: 'Rubik', sans-serif;
|
|
119
119
|
color: var(--t-text-color-label);
|
|
120
120
|
margin-left: 0.625rem;
|
|
121
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixRadioButton.styles.js","sourceRoot":"","sources":["../../../src/tuix-radio-button/TuixRadioButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;IAC9B,UAAU;;;6CAG+B,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;;CAE1E,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyB5C,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CnC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BxC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBxC,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { hostStyles } from '../tuix-checkbox/TuixCheckbox.styles';\nimport { Palette } from '../utils/colors';\n\nexport const radioHostStyles = css`\n ${hostStyles}\n :host {\n --t-margin-between-radio-buttons: 1rem;\n --t-radio-button-inner-color-disabled: ${unsafeCSS(Palette.PRIMARY_300)};\n }\n`;\n\nexport const radioButtonContainerStyles = css`\n .t-radio-button-full-container {\n display: flex;\n justify-content: space-between;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n :host([disabled]) .t-radio-button-full-container {\n cursor: not-allowed;\n }\n .t-radio-button-container {\n display: block;\n position: relative;\n height: 1.5rem;\n width: 1.5rem;\n }\n .t-radio-button-container .t-radio-button {\n position: absolute;\n opacity: 0;\n height: 0;\n width: 0;\n }\n`;\n\nexport const radioButtonStyles = css`\n .t-radio-button-full-container.t-multiple-options {\n margin-bottom: var(--t-margin-between-radio-buttons);\n }\n .t-radio-button-full-container:not(.t-with-label-left) {\n justify-content: flex-start;\n }\n .t-radio-button-container .t-radio-button-checkmark {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n height: 1.5rem;\n width: 1.5rem;\n border-radius: 0.25rem;\n background-color: var(--t-bg-color-primary);\n border: 2px solid var(--t-stroke-color-grey);\n box-sizing: border-box;\n border-radius: 50%;\n }\n .t-radio-button-container\n .t-radio-button:checked\n ~ .t-radio-button-checkmark {\n border: 2px solid var(--t-main-color-tuix);\n }\n .t-radio-button-container .t-radio-button:focus ~ .t-radio-button-checkmark {\n box-shadow: 0 0 0px 2px var(--t-stroke-color-focus);\n }\n .t-radio-button-full-container:hover\n .t-radio-button-container\n .t-radio-button-checkmark {\n border: 2px solid var(--t-main-color-tuix);\n }\n .t-radio-button-full-container.t-with-error\n .t-radio-button-container\n .t-radio-button-checkmark {\n border: 2px solid var(--t-text-color-error);\n }\n .t-radio-button-container\n .t-radio-button:disabled\n ~ .t-radio-button-checkmark {\n background-color: var(--t-bg-color-disabled);\n border: none;\n box-shadow: none;\n }\n`;\n\nexport const radioButtonInnerStyles = css`\n .t-radio-button-container .t-radio-button-checkmark .t-radio-button-inner {\n background-color: var(--t-main-color-tuix);\n margin: auto;\n height: 0.625rem;\n width: 0.625rem;\n border-radius: 50%;\n display: none;\n }\n .t-radio-button-container\n .t-radio-button:checked\n ~ .t-radio-button-checkmark\n .t-radio-button-inner {\n display: block;\n }\n :host([error])\n .t-radio-button-container\n .t-radio-button-checkmark\n .t-radio-button-inner {\n background-color: var(--t-text-color-error);\n }\n :host([disabled])\n .t-radio-button-container\n .t-radio-button-checkmark\n .t-radio-button-inner {\n background-color: var(--t-radio-button-inner-color-disabled);\n cursor: not-allowed;\n }\n`;\n\nexport const radioButtonLabelStyles = css`\n .t-radio-button-label {\n display: block;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 300;\n font-family: '
|
|
1
|
+
{"version":3,"file":"TuixRadioButton.styles.js","sourceRoot":"","sources":["../../../src/tuix-radio-button/TuixRadioButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;IAC9B,UAAU;;;6CAG+B,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;;CAE1E,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyB5C,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CnC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BxC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBxC,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { hostStyles } from '../tuix-checkbox/TuixCheckbox.styles';\nimport { Palette } from '../utils/colors';\n\nexport const radioHostStyles = css`\n ${hostStyles}\n :host {\n --t-margin-between-radio-buttons: 1rem;\n --t-radio-button-inner-color-disabled: ${unsafeCSS(Palette.PRIMARY_300)};\n }\n`;\n\nexport const radioButtonContainerStyles = css`\n .t-radio-button-full-container {\n display: flex;\n justify-content: space-between;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n :host([disabled]) .t-radio-button-full-container {\n cursor: not-allowed;\n }\n .t-radio-button-container {\n display: block;\n position: relative;\n height: 1.5rem;\n width: 1.5rem;\n }\n .t-radio-button-container .t-radio-button {\n position: absolute;\n opacity: 0;\n height: 0;\n width: 0;\n }\n`;\n\nexport const radioButtonStyles = css`\n .t-radio-button-full-container.t-multiple-options {\n margin-bottom: var(--t-margin-between-radio-buttons);\n }\n .t-radio-button-full-container:not(.t-with-label-left) {\n justify-content: flex-start;\n }\n .t-radio-button-container .t-radio-button-checkmark {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n height: 1.5rem;\n width: 1.5rem;\n border-radius: 0.25rem;\n background-color: var(--t-bg-color-primary);\n border: 2px solid var(--t-stroke-color-grey);\n box-sizing: border-box;\n border-radius: 50%;\n }\n .t-radio-button-container\n .t-radio-button:checked\n ~ .t-radio-button-checkmark {\n border: 2px solid var(--t-main-color-tuix);\n }\n .t-radio-button-container .t-radio-button:focus ~ .t-radio-button-checkmark {\n box-shadow: 0 0 0px 2px var(--t-stroke-color-focus);\n }\n .t-radio-button-full-container:hover\n .t-radio-button-container\n .t-radio-button-checkmark {\n border: 2px solid var(--t-main-color-tuix);\n }\n .t-radio-button-full-container.t-with-error\n .t-radio-button-container\n .t-radio-button-checkmark {\n border: 2px solid var(--t-text-color-error);\n }\n .t-radio-button-container\n .t-radio-button:disabled\n ~ .t-radio-button-checkmark {\n background-color: var(--t-bg-color-disabled);\n border: none;\n box-shadow: none;\n }\n`;\n\nexport const radioButtonInnerStyles = css`\n .t-radio-button-container .t-radio-button-checkmark .t-radio-button-inner {\n background-color: var(--t-main-color-tuix);\n margin: auto;\n height: 0.625rem;\n width: 0.625rem;\n border-radius: 50%;\n display: none;\n }\n .t-radio-button-container\n .t-radio-button:checked\n ~ .t-radio-button-checkmark\n .t-radio-button-inner {\n display: block;\n }\n :host([error])\n .t-radio-button-container\n .t-radio-button-checkmark\n .t-radio-button-inner {\n background-color: var(--t-text-color-error);\n }\n :host([disabled])\n .t-radio-button-container\n .t-radio-button-checkmark\n .t-radio-button-inner {\n background-color: var(--t-radio-button-inner-color-disabled);\n cursor: not-allowed;\n }\n`;\n\nexport const radioButtonLabelStyles = css`\n .t-radio-button-label {\n display: block;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 300;\n font-family: 'Rubik', sans-serif;\n color: var(--t-text-color-label);\n margin-left: 0.625rem;\n }\n .t-radio-button-full-container.t-with-label-left {\n flex-direction: row-reverse;\n }\n .t-radio-button-full-container.t-with-label-left .t-radio-button-label {\n margin-right: 0.625rem;\n margin-left: 0;\n }\n`;\n"]}
|
|
@@ -2,7 +2,7 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import { TextSize, TextVariant } from './enums/tuix-text.enums.js';
|
|
3
3
|
export declare class TuixText extends LitElement {
|
|
4
4
|
size: TextSize;
|
|
5
|
-
color?: TextVariant;
|
|
5
|
+
color?: TextVariant | undefined;
|
|
6
6
|
dark: boolean;
|
|
7
7
|
static styles: import("lit").CSSResult[];
|
|
8
8
|
private _getTextColor;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement } from 'lit';
|
|
2
|
+
import { html, css, LitElement, unsafeCSS } from 'lit';
|
|
3
3
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
5
|
import { TextSize, TextVariant, colorText, colorTextDark, } from './enums/tuix-text.enums.js';
|
|
6
6
|
import { textStyles } from './TuixText.styles.js';
|
|
7
7
|
import { buttonSizeStyles } from '../tuix-button/TuixButton.styles.js';
|
|
8
|
+
import slottedClassName from '../utils/slottedClassName.js';
|
|
8
9
|
let TuixText = class TuixText extends LitElement {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
this.size = TextSize.Body1;
|
|
13
|
+
this.color = TextVariant.PRIMARY;
|
|
12
14
|
this.dark = false;
|
|
13
15
|
}
|
|
14
16
|
_getTextColor() {
|
|
15
|
-
const defaultColor = this.dark
|
|
16
|
-
? TextVariant.SECONDARY
|
|
17
|
-
: TextVariant.PRIMARY;
|
|
18
17
|
const colorMap = this.dark ? colorTextDark : colorText;
|
|
19
|
-
return colorMap[this.color ||
|
|
18
|
+
return colorMap[this.color || TextVariant.PRIMARY];
|
|
20
19
|
}
|
|
21
20
|
render() {
|
|
22
21
|
return html ` <div
|
|
@@ -31,8 +30,10 @@ let TuixText = class TuixText extends LitElement {
|
|
|
31
30
|
};
|
|
32
31
|
TuixText.styles = [
|
|
33
32
|
css `
|
|
34
|
-
|
|
33
|
+
${unsafeCSS(slottedClassName('text'))} {
|
|
35
34
|
font-family: 'Rubik', sans-serif;
|
|
35
|
+
display: block;
|
|
36
|
+
margin: 0;
|
|
36
37
|
}
|
|
37
38
|
`,
|
|
38
39
|
textStyles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixText.js","sourceRoot":"","sources":["../../../src/tuix-text/TuixText.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
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,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAG5D,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,UAAU;IAAxC;;QAEE,SAAI,GAAG,QAAQ,CAAC,KAAK,CAAC;QAGtB,UAAK,GAAI,WAAW,CAAC,OAAO,CAAC;QAG7B,SAAI,GAAG,KAAK,CAAC;IA6Bf,CAAC;IAfS,aAAa;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;QACvD,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;oBACK,IAAI,CAAC,IAAI;eACd,QAAQ,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE;SAC5B,CAAC;;;WAGG,CAAC;IACV,CAAC;;AA1BM,eAAM,GAAG;IACd,GAAG,CAAA;QACC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;;;;;KAKtC;IACD,UAAU;IACV,gBAAgB;CACjB,AAVY,CAUX;AAlBF;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,CAqCpB;SArCY,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 { textStyles } from './TuixText.styles.js';\nimport { buttonSizeStyles } from '../tuix-button/TuixButton.styles.js';\nimport slottedClassName from '../utils/slottedClassName.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: block;\n margin: 0;\n }\n `,\n textStyles,\n buttonSizeStyles,\n ];\n\n private _getTextColor() {\n const colorMap = this.dark ? colorTextDark : colorText;\n return colorMap[this.color || TextVariant.PRIMARY];\n }\n\n render() {\n return html` <div\n class=\"text ${this.size}\"\n style=\"${styleMap({\n color: this._getTextColor(),\n })}\"\n >\n <slot></slot>\n </div>`;\n }\n}\n"]}
|
|
@@ -1,86 +1,89 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
2
|
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
3
|
+
import { TextSize } from './enums/tuix-text.enums';
|
|
4
|
+
import slottedClassName from '../utils/slottedClassName';
|
|
3
5
|
export const textStyles = css `
|
|
4
|
-
|
|
6
|
+
${unsafeCSS(`
|
|
7
|
+
${slottedClassName(TextSize.XL)} {
|
|
5
8
|
font-size: 4rem;
|
|
6
9
|
font-weight: 600;
|
|
7
10
|
line-height: 4.4rem;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
.
|
|
13
|
+
${slottedClassName(TextSize.L)} {
|
|
11
14
|
font-size: 3.5rem;
|
|
12
15
|
font-weight: 600;
|
|
13
16
|
line-height: 4.2rem;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
|
-
.
|
|
19
|
+
${slottedClassName(TextSize.M)} {
|
|
17
20
|
font-size: 2.25rem;
|
|
18
21
|
font-weight: 500;
|
|
19
22
|
line-height: 2.7rem;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
.
|
|
25
|
+
${slottedClassName(TextSize.S)} {
|
|
23
26
|
font-size: 1.5rem;
|
|
24
27
|
font-weight: 500;
|
|
25
28
|
line-height: 1.8rem;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
.
|
|
31
|
+
${slottedClassName(TextSize.XS)} {
|
|
29
32
|
font-size: 1.125rem;
|
|
30
33
|
font-weight: 500;
|
|
31
34
|
line-height: 1.35rem;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
.
|
|
37
|
+
${slottedClassName(TextSize.Body1)} {
|
|
35
38
|
font-size: 1rem;
|
|
36
39
|
font-weight: 300;
|
|
37
40
|
line-height: 1.4rem;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
.
|
|
43
|
+
${slottedClassName(TextSize.Body2)} {
|
|
41
44
|
font-size: 0.875rem;
|
|
42
45
|
font-weight: 300;
|
|
43
46
|
line-height: 1.225rem;
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
.
|
|
49
|
+
${slottedClassName(TextSize.Field1)} {
|
|
47
50
|
font-size: 1rem;
|
|
48
51
|
font-weight: 300;
|
|
49
52
|
line-height: 1.5rem;
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
.
|
|
55
|
+
${slottedClassName(TextSize.Field2)} {
|
|
53
56
|
font-size: 0.75rem;
|
|
54
57
|
font-weight: 300;
|
|
55
58
|
line-height: 1rem;
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
@media only screen and (max-width: ${ScreenSizes.TABLET}px) {
|
|
59
|
-
.
|
|
62
|
+
${slottedClassName(TextSize.Body1)} {
|
|
60
63
|
line-height: 1.3rem;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
.
|
|
66
|
+
${slottedClassName(TextSize.Body2)} {
|
|
64
67
|
line-height: 1.1375rem;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
.
|
|
70
|
+
${slottedClassName(TextSize.XL)} {
|
|
68
71
|
font-size: 3rem;
|
|
69
72
|
line-height: 3.3rem;
|
|
70
73
|
}
|
|
71
|
-
.
|
|
74
|
+
${slottedClassName(TextSize.L)} {
|
|
72
75
|
font-size: 2rem;
|
|
73
76
|
line-height: 2.4rem;
|
|
74
77
|
}
|
|
75
|
-
.
|
|
78
|
+
${slottedClassName(TextSize.M)} {
|
|
76
79
|
font-size: 1.5rem;
|
|
77
80
|
line-height: 1.8rem;
|
|
78
81
|
}
|
|
79
|
-
.
|
|
82
|
+
${slottedClassName(TextSize.S)} {
|
|
80
83
|
font-size: 1.125rem;
|
|
81
84
|
line-height: 1.35rem;
|
|
82
85
|
}
|
|
83
|
-
.
|
|
86
|
+
${slottedClassName(TextSize.XS)} {
|
|
84
87
|
font-size: 1rem;
|
|
85
88
|
line-height: 1.2rem;
|
|
86
89
|
font-weight: 400;
|
|
@@ -88,27 +91,28 @@ export const textStyles = css `
|
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
@media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
|
|
91
|
-
.
|
|
94
|
+
${slottedClassName(TextSize.Body1)} {
|
|
92
95
|
font-size: 0.875rem;
|
|
93
96
|
font-weight: 300;
|
|
94
97
|
line-height: 1.1375rem;
|
|
95
98
|
}
|
|
96
|
-
.
|
|
99
|
+
${slottedClassName(TextSize.Body2)} {
|
|
97
100
|
font-size: 0.75rem;
|
|
98
101
|
line-height: 0.975rem;
|
|
99
102
|
}
|
|
100
|
-
.
|
|
103
|
+
${slottedClassName(TextSize.XL)} {
|
|
101
104
|
font-size: 1.5rem;
|
|
102
105
|
line-height: 1.8rem;
|
|
103
106
|
}
|
|
104
|
-
.
|
|
107
|
+
${slottedClassName(TextSize.L)} {
|
|
105
108
|
font-size: 1.375rem;
|
|
106
109
|
line-height: 1.65rem;
|
|
107
110
|
}
|
|
108
|
-
.
|
|
111
|
+
${slottedClassName(TextSize.M)} {
|
|
109
112
|
font-size: 1.25rem;
|
|
110
113
|
line-height: 1.5rem;
|
|
111
114
|
}
|
|
112
115
|
}
|
|
116
|
+
`)}
|
|
113
117
|
`;
|
|
114
118
|
//# sourceMappingURL=TuixText.styles.js.map
|