tuix-webcomponents 0.1.0 → 0.2.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 +3 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tuix-button/TuixButton.d.ts +4 -3
- package/dist/src/tuix-button/TuixButton.js +29 -14
- package/dist/src/tuix-button/TuixButton.js.map +1 -1
- package/dist/src/tuix-button/TuixButton.styles.d.ts +1 -0
- package/dist/src/tuix-button/TuixButton.styles.js +63 -33
- package/dist/src/tuix-button/TuixButton.styles.js.map +1 -1
- package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +15 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.js +95 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.js.map +1 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.d.ts +4 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +117 -0
- package/dist/src/tuix-checkbox/TuixCheckbox.styles.js.map +1 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.d.ts +19 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +24 -0
- package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js.map +1 -0
- package/dist/src/tuix-dropdown/TuixDropdown.styles.js +6 -2
- 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 +4 -0
- package/dist/src/tuix-icon/TuixIcon.icons.js.map +1 -1
- package/dist/src/tuix-icon/TuixIcon.js +8 -4
- 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-icon-button/TuixIconButton.d.ts +4 -1
- package/dist/src/tuix-icon-button/TuixIconButton.js +29 -11
- package/dist/src/tuix-icon-button/TuixIconButton.js.map +1 -1
- package/dist/src/tuix-input/TuixInput.styles.js +7 -2
- package/dist/src/tuix-input/TuixInput.styles.js.map +1 -1
- package/dist/src/tuix-link/TuixLink.d.ts +2 -0
- package/dist/src/tuix-link/TuixLink.js +15 -1
- package/dist/src/tuix-link/TuixLink.js.map +1 -1
- package/dist/src/tuix-paper/TuixPaper.d.ts +2 -0
- package/dist/src/tuix-paper/TuixPaper.js +19 -1
- package/dist/src/tuix-paper/TuixPaper.js.map +1 -1
- package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +16 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.js +87 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.js.map +1 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.d.ts +5 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +130 -0
- package/dist/src/tuix-radio-button/TuixRadioButton.styles.js.map +1 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +1 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +2 -0
- package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js.map +1 -0
- package/dist/src/tuix-text/TuixText.d.ts +4 -3
- package/dist/src/tuix-text/TuixText.js +16 -3
- package/dist/src/tuix-text/TuixText.js.map +1 -1
- package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +11 -9
- package/dist/src/tuix-text/enums/tuix-text.enums.js +29 -11
- package/dist/src/tuix-text/enums/tuix-text.enums.js.map +1 -1
- package/dist/src/tuix-toggle-button/TuixToggleButton.d.ts +13 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.js +76 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.js.map +1 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.d.ts +5 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +116 -0
- package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js.map +1 -0
- package/dist/src/utils/colors.d.ts +0 -11
- package/dist/src/utils/colors.js +0 -21
- package/dist/src/utils/colors.js.map +1 -1
- package/dist/src/utils/darkColors.js +2 -0
- package/dist/src/utils/darkColors.js.map +1 -1
- package/dist/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -6,4 +6,7 @@ export { TuixIconButton } from './tuix-icon-button/TuixIconButton.js';
|
|
|
6
6
|
export { TuixLink } from './tuix-link/TuixLink.js';
|
|
7
7
|
export { TuixInput } from './tuix-input/TuixInput.js';
|
|
8
8
|
export { TuixDropdown } from './tuix-dropdown/TuixDropdown.js';
|
|
9
|
+
export { TuixCheckbox } from './tuix-checkbox/TuixCheckbox.js';
|
|
10
|
+
export { TuixRadioButton } from './tuix-radio-button/TuixRadioButton.js';
|
|
11
|
+
export { TuixToggleButton } from './tuix-toggle-button/TuixToggleButton.js';
|
|
9
12
|
export declare function loadFonts(): void;
|
package/dist/src/index.js
CHANGED
|
@@ -6,6 +6,9 @@ export { TuixIconButton } from './tuix-icon-button/TuixIconButton.js';
|
|
|
6
6
|
export { TuixLink } from './tuix-link/TuixLink.js';
|
|
7
7
|
export { TuixInput } from './tuix-input/TuixInput.js';
|
|
8
8
|
export { TuixDropdown } from './tuix-dropdown/TuixDropdown.js';
|
|
9
|
+
export { TuixCheckbox } from './tuix-checkbox/TuixCheckbox.js';
|
|
10
|
+
export { TuixRadioButton } from './tuix-radio-button/TuixRadioButton.js';
|
|
11
|
+
export { TuixToggleButton } from './tuix-toggle-button/TuixToggleButton.js';
|
|
9
12
|
export function loadFonts() {
|
|
10
13
|
const link1 = document.createElement('link');
|
|
11
14
|
link1.rel = 'preconnect';
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"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AC;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,GAAG,GAAG,YAAY,CAAC;IACzB,KAAK,CAAC,IAAI,GAAG,2BAA2B,CAAC;IACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,GAAG,GAAG,YAAY,CAAC;IACzB,KAAK,CAAC,IAAI;QACR,2JAA2J,CAAC;IAC9J,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["export { TuixText } from './tuix-text/TuixText.js';\nexport { TuixIcon } from './tuix-icon/TuixIcon.js';\nexport { TuixButton } from './tuix-button/TuixButton.js';\nexport { TuixPaper } from './tuix-paper/TuixPaper.js';\nexport { TuixIconButton } from './tuix-icon-button/TuixIconButton.js';\nexport { TuixLink } from './tuix-link/TuixLink.js';\nexport { TuixInput } from './tuix-input/TuixInput.js';\nexport { TuixDropdown } from './tuix-dropdown/TuixDropdown.js';\nexport { TuixCheckbox } from './tuix-checkbox/TuixCheckbox.js';\nexport { TuixRadioButton } from './tuix-radio-button/TuixRadioButton.js';\nexport { TuixToggleButton } from './tuix-toggle-button/TuixToggleButton.js';\n\nexport function loadFonts() {\n const link1 = document.createElement('link');\n link1.rel = 'preconnect';\n link1.href = 'https://fonts.googleapis.com';\n const link2 = document.createElement('link');\n link2.rel = 'preconnect';\n link2.href = 'https://fonts.gstatic.com';\n const link3 = document.createElement('link');\n link3.rel = 'stylesheet';\n link3.href =\n 'https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap';\n document.head.appendChild(link1);\n document.head.appendChild(link2);\n document.head.appendChild(link3);\n}\n"]}
|
|
@@ -4,14 +4,15 @@ import '../tuix-icon/TuixIcon.js';
|
|
|
4
4
|
import { MainVariant } from '../utils/mainVariant.enum';
|
|
5
5
|
export declare class TuixButton extends LitElement {
|
|
6
6
|
static styles: import("lit").CSSResult[];
|
|
7
|
-
iconColor: string;
|
|
8
7
|
variant: MainVariant;
|
|
9
8
|
disabled: boolean;
|
|
10
9
|
iconRight?: IconName;
|
|
11
10
|
iconLeft?: IconName;
|
|
12
|
-
|
|
11
|
+
dark: boolean;
|
|
12
|
+
iconColor: string;
|
|
13
|
+
private _getTextColor;
|
|
14
|
+
private _updateIconColor;
|
|
13
15
|
private _handleClick;
|
|
14
16
|
private _iconTemplate;
|
|
15
|
-
getButtonStyles(): string;
|
|
16
17
|
protected render(): TemplateResult;
|
|
17
18
|
}
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, css, html, nothing } from 'lit';
|
|
3
3
|
import { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';
|
|
4
|
-
import { buttonSizeStyles, buttonColorStyles } from './TuixButton.styles';
|
|
5
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { buttonSizeStyles, buttonColorStyles, hostButtonStyles, } from './TuixButton.styles';
|
|
5
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
6
6
|
import '../tuix-icon/TuixIcon.js';
|
|
7
|
-
import { palette } from '../utils/colors';
|
|
8
7
|
import { MainVariant } from '../utils/mainVariant.enum';
|
|
9
8
|
import { buttonTextColor } from './enums/tuix-button.enums';
|
|
10
9
|
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
11
10
|
let TuixButton = class TuixButton extends LitElement {
|
|
12
11
|
constructor() {
|
|
13
12
|
super(...arguments);
|
|
14
|
-
this.iconColor = '';
|
|
15
13
|
this.variant = MainVariant.PRIMARY;
|
|
16
14
|
this.disabled = false;
|
|
15
|
+
this.dark = false;
|
|
16
|
+
this.iconColor = '';
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
_getTextColor() {
|
|
19
|
+
var _a;
|
|
20
|
+
const element = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.button');
|
|
21
|
+
if (!element)
|
|
22
|
+
return buttonTextColor[this.variant];
|
|
23
|
+
const computedStyle = getComputedStyle(element);
|
|
24
|
+
return computedStyle.color;
|
|
25
|
+
}
|
|
26
|
+
_updateIconColor() {
|
|
27
|
+
if (!this.iconLeft && !this.iconRight)
|
|
28
|
+
return;
|
|
29
|
+
this.iconColor = this._getTextColor();
|
|
23
30
|
}
|
|
24
31
|
_handleClick() {
|
|
25
32
|
this.dispatchEvent(new CustomEvent('click', { bubbles: true }));
|
|
@@ -29,20 +36,21 @@ let TuixButton = class TuixButton extends LitElement {
|
|
|
29
36
|
if (screen.width <= ScreenSizes.TABLET) {
|
|
30
37
|
iconSize = IconSizeVariant.SMALL;
|
|
31
38
|
}
|
|
39
|
+
this._updateIconColor();
|
|
32
40
|
return html `<tuix-icon
|
|
33
41
|
size="${iconSize}"
|
|
34
42
|
name="${iconName}"
|
|
35
|
-
color="${this.
|
|
43
|
+
color="${this.iconColor}"
|
|
36
44
|
></tuix-icon>`;
|
|
37
45
|
}
|
|
38
|
-
getButtonStyles() {
|
|
39
|
-
return `${this.variant}`;
|
|
40
|
-
}
|
|
41
46
|
render() {
|
|
42
47
|
return html `<button
|
|
43
48
|
@click=${this._handleClick}
|
|
44
|
-
|
|
49
|
+
@mouseenter=${this._updateIconColor}
|
|
50
|
+
@mouseleave=${this._updateIconColor}
|
|
51
|
+
@blur=${this._updateIconColor}
|
|
45
52
|
?disabled="${this.disabled}"
|
|
53
|
+
class="button"
|
|
46
54
|
>
|
|
47
55
|
<div class="container">
|
|
48
56
|
${this.iconLeft ? this._iconTemplate(this.iconLeft) : nothing}
|
|
@@ -86,6 +94,7 @@ TuixButton.styles = [
|
|
|
86
94
|
}
|
|
87
95
|
}
|
|
88
96
|
`,
|
|
97
|
+
hostButtonStyles,
|
|
89
98
|
buttonColorStyles,
|
|
90
99
|
buttonSizeStyles,
|
|
91
100
|
];
|
|
@@ -101,6 +110,12 @@ __decorate([
|
|
|
101
110
|
__decorate([
|
|
102
111
|
property({ type: IconName })
|
|
103
112
|
], TuixButton.prototype, "iconLeft", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Boolean })
|
|
115
|
+
], TuixButton.prototype, "dark", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
state()
|
|
118
|
+
], TuixButton.prototype, "iconColor", void 0);
|
|
104
119
|
TuixButton = __decorate([
|
|
105
120
|
customElement('tuix-button')
|
|
106
121
|
], TuixButton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixButton.js","sourceRoot":"","sources":["../../../src/tuix-button/TuixButton.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"TuixButton.js","sourceRoot":"","sources":["../../../src/tuix-button/TuixButton.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,0BAA0B,CAAC;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AAC,SAAS;kBACX,CAAC;IACjB,CAAC;IAES,MAAM;QACd,OAAO,IAAI,CAAA;eACA,IAAI,CAAC,YAAY;oBACZ,IAAI,CAAC,gBAAgB;oBACrB,IAAI,CAAC,gBAAgB;cAC3B,IAAI,CAAC,gBAAgB;mBAChB,IAAI,CAAC,QAAQ;;;;UAItB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO;;UAE3D,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO;;cAEzD,CAAC;IACb,CAAC;;AAxGM,iBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;2CAOoC,WAAW,CAAC,MAAM;;;;;;2CAMlB,WAAW,CAAC,MAAM;;;;;;;;;;;;;;2CAclB,WAAW,CAAC,MAAM;;;;;KAKxD;IACD,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;CACjB,AArCY,CAqCX;AAGF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;2CACF;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;6CACR;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;4CACT;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACf;AAGb;IADC,KAAK,EAAE;6CACO;AAxDJ,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA0GtB;SA1GY,UAAU","sourcesContent":["import { LitElement, TemplateResult, css, html, nothing } from 'lit';\nimport { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';\nimport {\n buttonSizeStyles,\n buttonColorStyles,\n hostButtonStyles,\n} from './TuixButton.styles';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport '../tuix-icon/TuixIcon.js';\nimport { MainVariant } from '../utils/mainVariant.enum';\nimport { buttonTextColor } from './enums/tuix-button.enums';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\n\n@customElement('tuix-button')\nexport class TuixButton extends LitElement {\n static styles = [\n css`\n .button {\n padding: 16px 32px;\n border-radius: 4px;\n font-family: 'rubik', sans-serif;\n }\n\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .button {\n padding: 14px 32px;\n }\n }\n\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .button {\n padding: 12px 24px;\n }\n }\n\n .container {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 8px;\n }\n\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .container {\n gap: 6px;\n }\n }\n `,\n hostButtonStyles,\n buttonColorStyles,\n buttonSizeStyles,\n ];\n\n @property({ type: MainVariant })\n variant = MainVariant.PRIMARY;\n\n @property({ type: Boolean })\n disabled = false;\n\n @property({ type: IconName })\n iconRight?: IconName;\n\n @property({ type: IconName })\n iconLeft?: IconName;\n\n @property({ type: Boolean })\n dark = false;\n\n @state()\n iconColor = '';\n\n private _getTextColor() {\n const element = this.shadowRoot?.querySelector('.button');\n if (!element) return buttonTextColor[this.variant];\n const computedStyle = getComputedStyle(element);\n return computedStyle.color;\n }\n\n private _updateIconColor() {\n if (!this.iconLeft && !this.iconRight) return;\n this.iconColor = this._getTextColor();\n }\n\n private _handleClick() {\n this.dispatchEvent(new CustomEvent('click', { bubbles: true }));\n }\n\n private _iconTemplate(iconName: IconName): TemplateResult {\n let iconSize = IconSizeVariant.MEDIUM;\n\n if (screen.width <= ScreenSizes.TABLET) {\n iconSize = IconSizeVariant.SMALL;\n }\n\n this._updateIconColor();\n\n return html`<tuix-icon\n size=\"${iconSize}\"\n name=\"${iconName as IconName}\"\n color=\"${this.iconColor}\"\n ></tuix-icon>`;\n }\n\n protected render(): TemplateResult {\n return html`<button\n @click=${this._handleClick}\n @mouseenter=${this._updateIconColor}\n @mouseleave=${this._updateIconColor}\n @blur=${this._updateIconColor}\n ?disabled=\"${this.disabled}\"\n class=\"button\"\n >\n <div class=\"container\">\n ${this.iconLeft ? this._iconTemplate(this.iconLeft) : nothing}\n <slot></slot>\n ${this.iconRight ? this._iconTemplate(this.iconRight) : nothing}\n </div>\n </button>`;\n }\n}\n"]}
|
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import { css, unsafeCSS } from 'lit';
|
|
2
2
|
import { palette } from '../utils/colors';
|
|
3
3
|
import { ScreenSizes } from '../utils/screenSizes.enum';
|
|
4
|
+
import { darkPalette } from '../utils/darkColors';
|
|
5
|
+
import { MainVariant } from '../utils/mainVariant.enum';
|
|
6
|
+
export const hostButtonStyles = css `
|
|
7
|
+
:host {
|
|
8
|
+
--t-button-primary-color: ${unsafeCSS(palette.main)};
|
|
9
|
+
--t-button-secondary-color: ${unsafeCSS(palette.white)};
|
|
10
|
+
--t-button-accent-color: ${unsafeCSS(palette.secondary)};
|
|
11
|
+
--t-button-text-color: ${unsafeCSS(palette.white)};
|
|
12
|
+
--t-button-text-secondary-color: ${unsafeCSS(palette.main)};
|
|
13
|
+
--t-button-text-muted-color: ${unsafeCSS(palette.primary_300)};
|
|
14
|
+
--t-button-disabled-bg-color: ${unsafeCSS(palette.primary_100)};
|
|
15
|
+
--t-button-hover-primary-color: ${unsafeCSS(palette.primary_600)};
|
|
16
|
+
--t-button-active-primary-color: ${unsafeCSS(palette.primary_800)};
|
|
17
|
+
--t-button-hover-secondary-color: ${unsafeCSS(palette.primary_100)};
|
|
18
|
+
--t-button-active-secondary-color: ${unsafeCSS(palette.primary_200)};
|
|
19
|
+
}
|
|
20
|
+
:host([dark]) {
|
|
21
|
+
--t-button-primary-color: ${unsafeCSS(darkPalette.main)};
|
|
22
|
+
--t-button-text-color: ${unsafeCSS(darkPalette.white)};
|
|
23
|
+
--t-button-text-muted-color: ${unsafeCSS(palette.primary_800)};
|
|
24
|
+
--t-button-disabled-bg-color: ${unsafeCSS(palette.primary_950)};
|
|
25
|
+
--t-button-hover-primary-color: ${unsafeCSS(palette.main)};
|
|
26
|
+
--t-button-active-primary-color: ${unsafeCSS(palette.primary_800)};
|
|
27
|
+
--t-button-secondary-color: ${unsafeCSS(palette.black)};
|
|
28
|
+
--t-button-hover-secondary-color: ${unsafeCSS(palette.primary_950)};
|
|
29
|
+
--t-button-active-secondary-color: ${unsafeCSS(palette.primary_800)};
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
4
32
|
export const buttonSizeStyles = css `
|
|
5
33
|
.button {
|
|
6
34
|
font-size: 1.25rem;
|
|
@@ -23,51 +51,53 @@ export const buttonSizeStyles = css `
|
|
|
23
51
|
}
|
|
24
52
|
`;
|
|
25
53
|
export const buttonColorStyles = css `
|
|
26
|
-
.button
|
|
27
|
-
background-color:
|
|
54
|
+
:host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button {
|
|
55
|
+
background-color: var(--t-button-primary-color);
|
|
28
56
|
border: none;
|
|
29
|
-
color:
|
|
57
|
+
color: var(--t-button-text-color);
|
|
30
58
|
}
|
|
31
|
-
.button
|
|
32
|
-
background-color:
|
|
59
|
+
:host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:hover {
|
|
60
|
+
background-color: var(--t-button-hover-primary-color);
|
|
33
61
|
cursor: pointer;
|
|
34
62
|
}
|
|
35
|
-
.button
|
|
36
|
-
background-color:
|
|
37
|
-
border: 2px solid
|
|
63
|
+
:host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:focus {
|
|
64
|
+
background-color: var(--t-button-hover-primary-color);
|
|
65
|
+
border: 2px solid var(--t-button-accent-color);
|
|
38
66
|
}
|
|
39
|
-
.button
|
|
40
|
-
background-color:
|
|
67
|
+
:host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:active {
|
|
68
|
+
background-color: var(--t-button-active-primary-color);
|
|
41
69
|
border: none;
|
|
42
70
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
color:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.button.secondary {
|
|
49
|
-
background-color: ${unsafeCSS(palette.white)};
|
|
50
|
-
border: 2px solid ${unsafeCSS(palette.main)};
|
|
51
|
-
color: ${unsafeCSS(palette.main)};
|
|
71
|
+
|
|
72
|
+
:host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button {
|
|
73
|
+
background-color: var(--t-button-secondary-color);
|
|
74
|
+
border: 1px solid var(--t-button-hover-primary-color);
|
|
75
|
+
color: var(--t-button-text-secondary-color);
|
|
52
76
|
}
|
|
53
|
-
.button
|
|
54
|
-
background-color:
|
|
55
|
-
border:
|
|
77
|
+
:host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:hover {
|
|
78
|
+
background-color: var(--t-button-hover-secondary-color);
|
|
79
|
+
border: 1px solid var(--t-button-primary-color);
|
|
80
|
+
color: var(--t-button-primary-color);
|
|
56
81
|
cursor: pointer;
|
|
57
82
|
}
|
|
58
|
-
.button
|
|
59
|
-
background-color:
|
|
60
|
-
border: 2px solid
|
|
83
|
+
:host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:focus {
|
|
84
|
+
background-color: var(--t-button-hover-secondary-color);
|
|
85
|
+
border: 2px solid var(--t-button-accent-color);
|
|
86
|
+
color: var(--t-button-primary-color);
|
|
61
87
|
}
|
|
62
|
-
.button
|
|
63
|
-
background-color:
|
|
64
|
-
border:
|
|
65
|
-
color:
|
|
88
|
+
:host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:active {
|
|
89
|
+
background-color: var(--t-button-active-secondary-color);
|
|
90
|
+
border: 1px solid var(--t-button-primary-color);
|
|
91
|
+
color: var(--t-button-primary-color);
|
|
66
92
|
}
|
|
67
|
-
.button
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
93
|
+
:host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:disabled {
|
|
94
|
+
border: 1px solid var(--t-button-text-muted-color);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([variant='${unsafeCSS(MainVariant.SECONDARY)}'][disabled]) .button,
|
|
98
|
+
:host([variant='${unsafeCSS(MainVariant.PRIMARY)}'][disabled]) .button {
|
|
99
|
+
background-color: var(--t-button-disabled-bg-color);
|
|
100
|
+
color: var(--t-button-text-muted-color);
|
|
71
101
|
cursor: not-allowed;
|
|
72
102
|
}
|
|
73
103
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TuixButton.styles.js","sourceRoot":"","sources":["../../../src/tuix-button/TuixButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"TuixButton.styles.js","sourceRoot":"","sources":["../../../src/tuix-button/TuixButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;gCAEH,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;kCACrB,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;+BAC3B,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC;6BAC9B,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;uCACd,SA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CAAC;;;;;oBAKhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;;;;;oBAKhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;;;;oBAIhC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;oBAChC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;;;;;CAKjD,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { palette } from '../utils/colors';\nimport { ScreenSizes } from '../utils/screenSizes.enum';\nimport { darkPalette } from '../utils/darkColors';\nimport { MainVariant } from '../utils/mainVariant.enum';\n\nexport const hostButtonStyles = css`\n :host {\n --t-button-primary-color: ${unsafeCSS(palette.main)};\n --t-button-secondary-color: ${unsafeCSS(palette.white)};\n --t-button-accent-color: ${unsafeCSS(palette.secondary)};\n --t-button-text-color: ${unsafeCSS(palette.white)};\n --t-button-text-secondary-color: ${unsafeCSS(palette.main)};\n --t-button-text-muted-color: ${unsafeCSS(palette.primary_300)};\n --t-button-disabled-bg-color: ${unsafeCSS(palette.primary_100)};\n --t-button-hover-primary-color: ${unsafeCSS(palette.primary_600)};\n --t-button-active-primary-color: ${unsafeCSS(palette.primary_800)};\n --t-button-hover-secondary-color: ${unsafeCSS(palette.primary_100)};\n --t-button-active-secondary-color: ${unsafeCSS(palette.primary_200)};\n }\n :host([dark]) {\n --t-button-primary-color: ${unsafeCSS(darkPalette.main)};\n --t-button-text-color: ${unsafeCSS(darkPalette.white)};\n --t-button-text-muted-color: ${unsafeCSS(palette.primary_800)};\n --t-button-disabled-bg-color: ${unsafeCSS(palette.primary_950)};\n --t-button-hover-primary-color: ${unsafeCSS(palette.main)};\n --t-button-active-primary-color: ${unsafeCSS(palette.primary_800)};\n --t-button-secondary-color: ${unsafeCSS(palette.black)};\n --t-button-hover-secondary-color: ${unsafeCSS(palette.primary_950)};\n --t-button-active-secondary-color: ${unsafeCSS(palette.primary_800)};\n }\n`;\n\nexport const buttonSizeStyles = css`\n .button {\n font-size: 1.25rem;\n font-weight: 400;\n line-height: 1.5rem;\n }\n @media only screen and (max-width: ${ScreenSizes.TABLET}px) {\n .button {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.25rem;\n }\n }\n @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {\n .button {\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 1rem;\n }\n }\n`;\n\nexport const buttonColorStyles = css`\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button {\n background-color: var(--t-button-primary-color);\n border: none;\n color: var(--t-button-text-color);\n }\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:hover {\n background-color: var(--t-button-hover-primary-color);\n cursor: pointer;\n }\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:focus {\n background-color: var(--t-button-hover-primary-color);\n border: 2px solid var(--t-button-accent-color);\n }\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:active {\n background-color: var(--t-button-active-primary-color);\n border: none;\n }\n\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button {\n background-color: var(--t-button-secondary-color);\n border: 1px solid var(--t-button-hover-primary-color);\n color: var(--t-button-text-secondary-color);\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:hover {\n background-color: var(--t-button-hover-secondary-color);\n border: 1px solid var(--t-button-primary-color);\n color: var(--t-button-primary-color);\n cursor: pointer;\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:focus {\n background-color: var(--t-button-hover-secondary-color);\n border: 2px solid var(--t-button-accent-color);\n color: var(--t-button-primary-color);\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:active {\n background-color: var(--t-button-active-secondary-color);\n border: 1px solid var(--t-button-primary-color);\n color: var(--t-button-primary-color);\n }\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:disabled {\n border: 1px solid var(--t-button-text-muted-color);\n }\n\n :host([variant='${unsafeCSS(MainVariant.SECONDARY)}'][disabled]) .button,\n :host([variant='${unsafeCSS(MainVariant.PRIMARY)}'][disabled]) .button {\n background-color: var(--t-button-disabled-bg-color);\n color: var(--t-button-text-muted-color);\n cursor: not-allowed;\n }\n`;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { CheckboxLabelSide } from './enums/tuix-checkbox.enums';
|
|
3
|
+
export declare class TuixCheckbox extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
checked: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
dark: boolean;
|
|
8
|
+
error: boolean;
|
|
9
|
+
label: string;
|
|
10
|
+
labelSide: CheckboxLabelSide;
|
|
11
|
+
private _onCheckboxChange;
|
|
12
|
+
private _getIconMode;
|
|
13
|
+
private _getFullContainerClasses;
|
|
14
|
+
protected render(): TemplateResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';
|
|
6
|
+
import { checkboxCheckmarkStyles, checkboxContainerStyles, checkboxLabelStyles, hostStyles, } from './TuixCheckbox.styles';
|
|
7
|
+
import { CheckboxIconColorDark, CheckboxIconColorLight, CheckboxIconMode, CheckboxLabelSide, } from './enums/tuix-checkbox.enums';
|
|
8
|
+
let TuixCheckbox = class TuixCheckbox extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.checked = false;
|
|
12
|
+
this.disabled = false;
|
|
13
|
+
this.dark = false;
|
|
14
|
+
this.error = false;
|
|
15
|
+
this.label = '';
|
|
16
|
+
this.labelSide = CheckboxLabelSide.RIGHT;
|
|
17
|
+
}
|
|
18
|
+
_onCheckboxChange(event) {
|
|
19
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
20
|
+
detail: {
|
|
21
|
+
value: event.target.checked,
|
|
22
|
+
},
|
|
23
|
+
bubbles: true,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
_getIconMode() {
|
|
27
|
+
if (this.disabled) {
|
|
28
|
+
return CheckboxIconMode.DISABLED;
|
|
29
|
+
}
|
|
30
|
+
if (this.error) {
|
|
31
|
+
return CheckboxIconMode.ERROR;
|
|
32
|
+
}
|
|
33
|
+
return CheckboxIconMode.DEFAULT;
|
|
34
|
+
}
|
|
35
|
+
_getFullContainerClasses() {
|
|
36
|
+
return {
|
|
37
|
+
't-checkbox-full-container': true,
|
|
38
|
+
't-with-error': this.error && !this.disabled,
|
|
39
|
+
't-with-label-left': this.labelSide === CheckboxLabelSide.LEFT,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return html `<label class="${classMap(this._getFullContainerClasses())}">
|
|
44
|
+
<div class="t-checkbox-container">
|
|
45
|
+
<input
|
|
46
|
+
type="checkbox"
|
|
47
|
+
class="t-checkbox"
|
|
48
|
+
.checked="${this.checked}"
|
|
49
|
+
?disabled="${this.disabled}"
|
|
50
|
+
@change="${this._onCheckboxChange}"
|
|
51
|
+
/>
|
|
52
|
+
<div class="t-checkbox-checkmark">
|
|
53
|
+
<tuix-icon
|
|
54
|
+
size="${IconSizeVariant.SMALL}"
|
|
55
|
+
name="${IconName.CHECK}"
|
|
56
|
+
color="${this.dark
|
|
57
|
+
? CheckboxIconColorDark[this._getIconMode()]
|
|
58
|
+
: CheckboxIconColorLight[this._getIconMode()]}"
|
|
59
|
+
>
|
|
60
|
+
</tuix-icon>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="t-checkbox-label"><slot>${this.label}</slot></div>
|
|
64
|
+
</label>`;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
TuixCheckbox.styles = [
|
|
68
|
+
hostStyles,
|
|
69
|
+
checkboxContainerStyles,
|
|
70
|
+
checkboxCheckmarkStyles,
|
|
71
|
+
checkboxLabelStyles,
|
|
72
|
+
];
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ type: Boolean })
|
|
75
|
+
], TuixCheckbox.prototype, "checked", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: Boolean })
|
|
78
|
+
], TuixCheckbox.prototype, "disabled", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Boolean })
|
|
81
|
+
], TuixCheckbox.prototype, "dark", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
property({ type: Boolean })
|
|
84
|
+
], TuixCheckbox.prototype, "error", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ type: String })
|
|
87
|
+
], TuixCheckbox.prototype, "label", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ type: String })
|
|
90
|
+
], TuixCheckbox.prototype, "labelSide", void 0);
|
|
91
|
+
TuixCheckbox = __decorate([
|
|
92
|
+
customElement('tuix-checkbox')
|
|
93
|
+
], TuixCheckbox);
|
|
94
|
+
export { TuixCheckbox };
|
|
95
|
+
//# sourceMappingURL=TuixCheckbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixCheckbox.js","sourceRoot":"","sources":["../../../src/tuix-checkbox/TuixCheckbox.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,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,q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BACb,IAAI,CAAC,IAAI;YAChB,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC5C,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;;;;;4CAKf,IAAI,CAAC,KAAK;aACzC,CAAC;IACZ,CAAC;;AA7EM,mBAAM,GAAG;IACd,UAAU;IACV,uBAAuB;IACvB,uBAAuB;IACvB,mBAAmB;CACpB,AALY,CAKX;AAGF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACf;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACd;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACS;AAxBzB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA+ExB;SA/EY,YAAY","sourcesContent":["import { LitElement, TemplateResult, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js';\nimport { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';\nimport {\n checkboxCheckmarkStyles,\n checkboxContainerStyles,\n checkboxLabelStyles,\n hostStyles,\n} from './TuixCheckbox.styles';\nimport {\n CheckboxIconColorDark,\n CheckboxIconColorLight,\n CheckboxIconMode,\n CheckboxLabelSide,\n} from './enums/tuix-checkbox.enums';\n\n@customElement('tuix-checkbox')\nexport class TuixCheckbox extends LitElement {\n static styles = [\n hostStyles,\n checkboxContainerStyles,\n checkboxCheckmarkStyles,\n checkboxLabelStyles,\n ];\n\n @property({ type: Boolean })\n checked = false;\n\n @property({ type: Boolean })\n disabled = false;\n\n @property({ type: Boolean })\n dark = false;\n\n @property({ type: Boolean })\n error = false;\n\n @property({ type: String })\n label = '';\n\n @property({ type: String })\n labelSide = CheckboxLabelSide.RIGHT;\n\n private _onCheckboxChange(event: InputEvent) {\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: {\n value: (event.target as HTMLInputElement).checked,\n },\n bubbles: true,\n })\n );\n }\n\n private _getIconMode() {\n if (this.disabled) {\n return CheckboxIconMode.DISABLED;\n }\n if (this.error) {\n return CheckboxIconMode.ERROR;\n }\n return CheckboxIconMode.DEFAULT;\n }\n\n private _getFullContainerClasses(): ClassInfo {\n return {\n 't-checkbox-full-container': true,\n 't-with-error': this.error && !this.disabled,\n 't-with-label-left': this.labelSide === CheckboxLabelSide.LEFT,\n };\n }\n\n protected render(): TemplateResult {\n return html`<label class=\"${classMap(this._getFullContainerClasses())}\">\n <div class=\"t-checkbox-container\">\n <input\n type=\"checkbox\"\n class=\"t-checkbox\"\n .checked=\"${this.checked}\"\n ?disabled=\"${this.disabled}\"\n @change=\"${this._onCheckboxChange}\"\n />\n <div class=\"t-checkbox-checkmark\">\n <tuix-icon\n size=\"${IconSizeVariant.SMALL}\"\n name=\"${IconName.CHECK}\"\n color=\"${this.dark\n ? CheckboxIconColorDark[this._getIconMode()]\n : CheckboxIconColorLight[this._getIconMode()]}\"\n >\n </tuix-icon>\n </div>\n </div>\n <div class=\"t-checkbox-label\"><slot>${this.label}</slot></div>\n </label>`;\n }\n}\n"]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { palette } from '../utils/colors';
|
|
3
|
+
import { darkPalette } from '../utils/darkColors';
|
|
4
|
+
export const hostStyles = css `
|
|
5
|
+
:host {
|
|
6
|
+
--t-main-color-tuix: ${unsafeCSS(palette.main)};
|
|
7
|
+
--t-bg-color-primary: ${unsafeCSS(palette.white)};
|
|
8
|
+
--t-bg-color-disabled: ${unsafeCSS(palette.primary_100)};
|
|
9
|
+
--t-text-color-error: ${unsafeCSS(palette.error)};
|
|
10
|
+
--t-stroke-color-focus: ${unsafeCSS(palette.secondary)};
|
|
11
|
+
--t-stroke-color-grey: ${unsafeCSS(palette.primary_300)};
|
|
12
|
+
--t-text-color-label: ${unsafeCSS(palette.black)};
|
|
13
|
+
}
|
|
14
|
+
:host([dark]) {
|
|
15
|
+
--t-main-color-tuix: ${unsafeCSS(darkPalette.main)};
|
|
16
|
+
--t-bg-color-primary: ${unsafeCSS(darkPalette.black)};
|
|
17
|
+
--t-bg-color-disabled: ${unsafeCSS(darkPalette.primary_800)};
|
|
18
|
+
--t-text-color-error: ${unsafeCSS(darkPalette.error)};
|
|
19
|
+
--t-stroke-color-focus: ${unsafeCSS(darkPalette.secondary)};
|
|
20
|
+
--t-stroke-color-grey: ${unsafeCSS(darkPalette.primary_100)};
|
|
21
|
+
--t-text-color-label: ${unsafeCSS(darkPalette.white)};
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const checkboxContainerStyles = css `
|
|
25
|
+
.t-checkbox-full-container {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
-webkit-user-select: none;
|
|
30
|
+
-moz-user-select: none;
|
|
31
|
+
-ms-user-select: none;
|
|
32
|
+
user-select: none;
|
|
33
|
+
}
|
|
34
|
+
:host([disabled]) .t-checkbox-full-container {
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
}
|
|
37
|
+
.t-checkbox-container {
|
|
38
|
+
display: block;
|
|
39
|
+
position: relative;
|
|
40
|
+
height: 1.5rem;
|
|
41
|
+
width: 1.5rem;
|
|
42
|
+
}
|
|
43
|
+
.t-checkbox-container .t-checkbox {
|
|
44
|
+
position: absolute;
|
|
45
|
+
opacity: 0;
|
|
46
|
+
height: 0;
|
|
47
|
+
width: 0;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
export const checkboxCheckmarkStyles = css `
|
|
51
|
+
.t-checkbox-container .t-checkbox-checkmark {
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
display: flex;
|
|
56
|
+
height: 1.5rem;
|
|
57
|
+
width: 1.5rem;
|
|
58
|
+
border-radius: 0.25rem;
|
|
59
|
+
background-color: var(--t-bg-color-primary);
|
|
60
|
+
border: 2px solid var(--t-stroke-color-grey);
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
}
|
|
63
|
+
.t-checkbox-container .t-checkbox-checkmark tuix-icon {
|
|
64
|
+
margin: auto;
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
.t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark {
|
|
68
|
+
background-color: var(--t-main-color-tuix);
|
|
69
|
+
border: none;
|
|
70
|
+
}
|
|
71
|
+
.t-checkbox-container .t-checkbox:focus ~ .t-checkbox-checkmark {
|
|
72
|
+
box-shadow: 0 0 0px 2px var(--t-stroke-color-focus);
|
|
73
|
+
border: 2px solid var(--t-main-color-tuix);
|
|
74
|
+
}
|
|
75
|
+
.t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark tuix-icon {
|
|
76
|
+
display: block;
|
|
77
|
+
}
|
|
78
|
+
.t-checkbox-full-container:hover .t-checkbox-container .t-checkbox-checkmark {
|
|
79
|
+
border: 2px solid var(--t-main-color-tuix);
|
|
80
|
+
}
|
|
81
|
+
.t-checkbox-full-container.t-with-error
|
|
82
|
+
.t-checkbox-container
|
|
83
|
+
.t-checkbox-checkmark {
|
|
84
|
+
border: 2px solid var(--t-text-color-error);
|
|
85
|
+
}
|
|
86
|
+
.t-checkbox-full-container.t-with-error
|
|
87
|
+
.t-checkbox-container
|
|
88
|
+
.t-checkbox:checked
|
|
89
|
+
~ .t-checkbox-checkmark {
|
|
90
|
+
background-color: var(--t-text-color-error);
|
|
91
|
+
border: none;
|
|
92
|
+
}
|
|
93
|
+
.t-checkbox-container .t-checkbox:disabled ~ .t-checkbox-checkmark {
|
|
94
|
+
background-color: var(--t-bg-color-disabled);
|
|
95
|
+
border: none;
|
|
96
|
+
box-shadow: none;
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
export const checkboxLabelStyles = css `
|
|
100
|
+
.t-checkbox-label {
|
|
101
|
+
display: block;
|
|
102
|
+
font-size: 1rem;
|
|
103
|
+
line-height: 1.5rem;
|
|
104
|
+
font-weight: 300;
|
|
105
|
+
font-family: 'rubik', sans-serif;
|
|
106
|
+
color: var(--t-text-color-label);
|
|
107
|
+
margin-left: 0.625rem;
|
|
108
|
+
}
|
|
109
|
+
.t-checkbox-full-container.t-with-label-left {
|
|
110
|
+
flex-direction: row-reverse;
|
|
111
|
+
}
|
|
112
|
+
.t-checkbox-full-container.t-with-label-left .t-checkbox-label {
|
|
113
|
+
margin-right: 0.625rem;
|
|
114
|
+
margin-left: 0;
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
//# sourceMappingURL=TuixCheckbox.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TuixCheckbox.styles.js","sourceRoot":"","sources":["../../../src/tuix-checkbox/TuixCheckbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;2BAEF,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;4BACtB,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;6BACvB,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC/B,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;8BACtB,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC;6BAC7B,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC/B,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;;;2BAGzB,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;4BAC1B,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;6BAC3B,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC;4BACnC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;8BAC1B,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC;6BACjC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC;4BACnC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;;CAEvD,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDzC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBrC,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport { palette } from '../utils/colors';\nimport { darkPalette } from '../utils/darkColors';\n\nexport const hostStyles = css`\n :host {\n --t-main-color-tuix: ${unsafeCSS(palette.main)};\n --t-bg-color-primary: ${unsafeCSS(palette.white)};\n --t-bg-color-disabled: ${unsafeCSS(palette.primary_100)};\n --t-text-color-error: ${unsafeCSS(palette.error)};\n --t-stroke-color-focus: ${unsafeCSS(palette.secondary)};\n --t-stroke-color-grey: ${unsafeCSS(palette.primary_300)};\n --t-text-color-label: ${unsafeCSS(palette.black)};\n }\n :host([dark]) {\n --t-main-color-tuix: ${unsafeCSS(darkPalette.main)};\n --t-bg-color-primary: ${unsafeCSS(darkPalette.black)};\n --t-bg-color-disabled: ${unsafeCSS(darkPalette.primary_800)};\n --t-text-color-error: ${unsafeCSS(darkPalette.error)};\n --t-stroke-color-focus: ${unsafeCSS(darkPalette.secondary)};\n --t-stroke-color-grey: ${unsafeCSS(darkPalette.primary_100)};\n --t-text-color-label: ${unsafeCSS(darkPalette.white)};\n }\n`;\n\nexport const checkboxContainerStyles = css`\n .t-checkbox-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-checkbox-full-container {\n cursor: not-allowed;\n }\n .t-checkbox-container {\n display: block;\n position: relative;\n height: 1.5rem;\n width: 1.5rem;\n }\n .t-checkbox-container .t-checkbox {\n position: absolute;\n opacity: 0;\n height: 0;\n width: 0;\n }\n`;\n\nexport const checkboxCheckmarkStyles = css`\n .t-checkbox-container .t-checkbox-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 }\n .t-checkbox-container .t-checkbox-checkmark tuix-icon {\n margin: auto;\n display: none;\n }\n .t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark {\n background-color: var(--t-main-color-tuix);\n border: none;\n }\n .t-checkbox-container .t-checkbox:focus ~ .t-checkbox-checkmark {\n box-shadow: 0 0 0px 2px var(--t-stroke-color-focus);\n border: 2px solid var(--t-main-color-tuix);\n }\n .t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark tuix-icon {\n display: block;\n }\n .t-checkbox-full-container:hover .t-checkbox-container .t-checkbox-checkmark {\n border: 2px solid var(--t-main-color-tuix);\n }\n .t-checkbox-full-container.t-with-error\n .t-checkbox-container\n .t-checkbox-checkmark {\n border: 2px solid var(--t-text-color-error);\n }\n .t-checkbox-full-container.t-with-error\n .t-checkbox-container\n .t-checkbox:checked\n ~ .t-checkbox-checkmark {\n background-color: var(--t-text-color-error);\n border: none;\n }\n .t-checkbox-container .t-checkbox:disabled ~ .t-checkbox-checkmark {\n background-color: var(--t-bg-color-disabled);\n border: none;\n box-shadow: none;\n }\n`;\n\nexport const checkboxLabelStyles = css`\n .t-checkbox-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-checkbox-full-container.t-with-label-left {\n flex-direction: row-reverse;\n }\n .t-checkbox-full-container.t-with-label-left .t-checkbox-label {\n margin-right: 0.625rem;\n margin-left: 0;\n }\n`;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum CheckboxIconMode {
|
|
2
|
+
DEFAULT = "default",
|
|
3
|
+
DISABLED = "disabled",
|
|
4
|
+
ERROR = "error"
|
|
5
|
+
}
|
|
6
|
+
export declare enum CheckboxLabelSide {
|
|
7
|
+
LEFT = "left",
|
|
8
|
+
RIGHT = "right"
|
|
9
|
+
}
|
|
10
|
+
export declare const CheckboxIconColorLight: {
|
|
11
|
+
default: string;
|
|
12
|
+
disabled: string;
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const CheckboxIconColorDark: {
|
|
16
|
+
default: string;
|
|
17
|
+
disabled: string;
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { palette } from '../../utils/colors';
|
|
2
|
+
import { darkPalette } from '../../utils/darkColors';
|
|
3
|
+
export var CheckboxIconMode;
|
|
4
|
+
(function (CheckboxIconMode) {
|
|
5
|
+
CheckboxIconMode["DEFAULT"] = "default";
|
|
6
|
+
CheckboxIconMode["DISABLED"] = "disabled";
|
|
7
|
+
CheckboxIconMode["ERROR"] = "error";
|
|
8
|
+
})(CheckboxIconMode || (CheckboxIconMode = {}));
|
|
9
|
+
export var CheckboxLabelSide;
|
|
10
|
+
(function (CheckboxLabelSide) {
|
|
11
|
+
CheckboxLabelSide["LEFT"] = "left";
|
|
12
|
+
CheckboxLabelSide["RIGHT"] = "right";
|
|
13
|
+
})(CheckboxLabelSide || (CheckboxLabelSide = {}));
|
|
14
|
+
export const CheckboxIconColorLight = {
|
|
15
|
+
[CheckboxIconMode.DEFAULT]: palette.white,
|
|
16
|
+
[CheckboxIconMode.DISABLED]: palette.primary_300,
|
|
17
|
+
[CheckboxIconMode.ERROR]: palette.white,
|
|
18
|
+
};
|
|
19
|
+
export const CheckboxIconColorDark = {
|
|
20
|
+
[CheckboxIconMode.DEFAULT]: darkPalette.white,
|
|
21
|
+
[CheckboxIconMode.DISABLED]: darkPalette.primary_100,
|
|
22
|
+
[CheckboxIconMode.ERROR]: darkPalette.white,
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=tuix-checkbox.enums.js.map
|