tuix-webcomponents 0.0.22 → 0.0.25

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.
Files changed (133) hide show
  1. package/README.md +110 -21
  2. package/dist/assets/tuix-styles.css +72 -0
  3. package/dist/src/index.d.ts +27 -1
  4. package/dist/src/index.js +19 -16
  5. package/dist/src/react/index.d.ts +42 -0
  6. package/dist/src/react/index.js +114 -0
  7. package/dist/src/tuix-button/TuixBaseButton.d.ts +17 -0
  8. package/dist/src/tuix-button/TuixBaseButton.js +60 -0
  9. package/dist/src/tuix-button/TuixButton.d.ts +6 -12
  10. package/dist/src/tuix-button/TuixButton.js +35 -59
  11. package/dist/src/tuix-button/TuixButton.styles.d.ts +1 -0
  12. package/dist/src/tuix-button/TuixButton.styles.js +77 -44
  13. package/dist/src/tuix-button/enums/tuix-button.enums.js +3 -4
  14. package/dist/src/tuix-button/interfaces/tuix-button.interface.d.ts +1 -0
  15. package/dist/src/tuix-button/interfaces/tuix-button.interface.js +1 -0
  16. package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +17 -0
  17. package/dist/src/tuix-checkbox/TuixCheckbox.js +108 -0
  18. package/dist/src/tuix-checkbox/TuixCheckbox.styles.d.ts +4 -0
  19. package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +132 -0
  20. package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.d.ts +21 -0
  21. package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +23 -0
  22. package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.d.ts +5 -0
  23. package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js +1 -0
  24. package/dist/src/tuix-dropdown/TuixDropdown.d.ts +13 -3
  25. package/dist/src/tuix-dropdown/TuixDropdown.js +125 -39
  26. package/dist/src/tuix-dropdown/TuixDropdown.styles.js +59 -19
  27. package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +0 -6
  28. package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +0 -8
  29. package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +15 -1
  30. package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +0 -1
  31. package/dist/src/tuix-icon/TuixIcon.d.ts +5 -1
  32. package/dist/src/tuix-icon/TuixIcon.icons.d.ts +2 -2
  33. package/dist/src/tuix-icon/TuixIcon.icons.js +299 -7
  34. package/dist/src/tuix-icon/TuixIcon.js +37 -23
  35. package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +67 -21
  36. package/dist/src/tuix-icon/enums/tuix-icon.enums.js +66 -22
  37. package/dist/src/tuix-icon-button/TuixIconButton.d.ts +6 -11
  38. package/dist/src/tuix-icon-button/TuixIconButton.js +20 -49
  39. package/dist/src/tuix-input/TuixInput.d.ts +12 -6
  40. package/dist/src/tuix-input/TuixInput.js +97 -50
  41. package/dist/src/tuix-input/TuixInput.styles.js +99 -110
  42. package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +10 -8
  43. package/dist/src/tuix-input/enums/tuix-input.enums.js +10 -11
  44. package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +11 -6
  45. package/dist/src/tuix-input/interfaces/tuix-input.interface.js +5 -2
  46. package/dist/src/tuix-link/TuixLink.d.ts +8 -4
  47. package/dist/src/tuix-link/TuixLink.js +37 -38
  48. package/dist/src/tuix-link/TuixLink.styles.d.ts +2 -0
  49. package/dist/src/tuix-link/TuixLink.styles.js +55 -0
  50. package/dist/src/tuix-link/enums/linkTarget.enum.d.ts +4 -4
  51. package/dist/src/tuix-link/enums/linkTarget.enum.js +4 -5
  52. package/dist/src/tuix-modal/TuixModal.d.ts +11 -0
  53. package/dist/src/tuix-modal/TuixModal.js +65 -0
  54. package/dist/src/tuix-modal/TuixModal.styles.d.ts +2 -0
  55. package/dist/src/tuix-modal/TuixModal.styles.js +55 -0
  56. package/dist/src/tuix-paper/TuixPaper.d.ts +7 -4
  57. package/dist/src/tuix-paper/TuixPaper.js +29 -23
  58. package/dist/src/tuix-paper/TuixPaper.styles.d.ts +1 -0
  59. package/dist/src/tuix-paper/TuixPaper.styles.js +30 -0
  60. package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +12 -6
  61. package/dist/src/tuix-paper/enums/tuix-paper.enum.js +15 -9
  62. package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +17 -0
  63. package/dist/src/tuix-radio-button/TuixRadioButton.js +96 -0
  64. package/dist/src/tuix-radio-button/TuixRadioButton.styles.d.ts +5 -0
  65. package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +135 -0
  66. package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +3 -0
  67. package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +1 -0
  68. package/dist/src/tuix-table/TuixTable.d.ts +48 -0
  69. package/dist/src/tuix-table/TuixTable.js +369 -0
  70. package/dist/src/tuix-table/TuixTable.styles.d.ts +2 -0
  71. package/dist/src/tuix-table/TuixTable.styles.js +197 -0
  72. package/dist/src/tuix-table/interfaces/tuix-table.interface.d.ts +45 -0
  73. package/dist/src/tuix-table/interfaces/tuix-table.interface.js +1 -0
  74. package/dist/src/tuix-text/TuixText.d.ts +7 -4
  75. package/dist/src/tuix-text/TuixText.js +44 -18
  76. package/dist/src/tuix-text/TuixText.styles.d.ts +1 -0
  77. package/dist/src/tuix-text/TuixText.styles.js +145 -64
  78. package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +25 -11
  79. package/dist/src/tuix-text/enums/tuix-text.enums.js +61 -14
  80. package/dist/src/tuix-toast/TuixToast.d.ts +18 -0
  81. package/dist/src/tuix-toast/TuixToast.js +103 -0
  82. package/dist/src/tuix-toast/TuixToast.styles.d.ts +3 -0
  83. package/dist/src/tuix-toast/TuixToast.styles.js +43 -0
  84. package/dist/src/tuix-toast/enums/tuix-toast.enums.d.ts +20 -0
  85. package/dist/src/tuix-toast/enums/tuix-toast.enums.js +59 -0
  86. package/dist/src/tuix-toggle-button/TuixToggleButton.d.ts +14 -0
  87. package/dist/src/tuix-toggle-button/TuixToggleButton.js +86 -0
  88. package/dist/src/tuix-toggle-button/TuixToggleButton.styles.d.ts +5 -0
  89. package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +134 -0
  90. package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.d.ts +2 -0
  91. package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js +1 -0
  92. package/dist/src/utils/colors.d.ts +29 -11
  93. package/dist/src/utils/colors.js +31 -46
  94. package/dist/src/utils/darkColors.d.ts +32 -1
  95. package/dist/src/utils/darkColors.js +33 -11
  96. package/dist/src/utils/hex-rgb.js +0 -1
  97. package/dist/src/utils/interfaces/detail-value.interface.d.ts +3 -0
  98. package/dist/src/utils/interfaces/detail-value.interface.js +1 -0
  99. package/dist/src/utils/mainVariant.enum.js +0 -1
  100. package/dist/src/utils/screenSizes.enum.d.ts +2 -2
  101. package/dist/src/utils/screenSizes.enum.js +2 -4
  102. package/dist/src/utils/slottedClassName.d.ts +2 -0
  103. package/dist/src/utils/slottedClassName.js +1 -0
  104. package/package.json +113 -68
  105. package/dist/src/index.js.map +0 -1
  106. package/dist/src/tuix-button/TuixButton.js.map +0 -1
  107. package/dist/src/tuix-button/TuixButton.styles.js.map +0 -1
  108. package/dist/src/tuix-button/enums/tuix-button.enums.js.map +0 -1
  109. package/dist/src/tuix-dropdown/TuixDropdown.js.map +0 -1
  110. package/dist/src/tuix-dropdown/TuixDropdown.styles.js.map +0 -1
  111. package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js.map +0 -1
  112. package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js.map +0 -1
  113. package/dist/src/tuix-icon/TuixIcon.icons.js.map +0 -1
  114. package/dist/src/tuix-icon/TuixIcon.js.map +0 -1
  115. package/dist/src/tuix-icon/enums/tuix-icon.enums.js.map +0 -1
  116. package/dist/src/tuix-icon-button/TuixIconButton.js.map +0 -1
  117. package/dist/src/tuix-input/TuixInput.js.map +0 -1
  118. package/dist/src/tuix-input/TuixInput.styles.js.map +0 -1
  119. package/dist/src/tuix-input/enums/tuix-input.enums.js.map +0 -1
  120. package/dist/src/tuix-input/interfaces/tuix-input.interface.js.map +0 -1
  121. package/dist/src/tuix-link/TuixLink.js.map +0 -1
  122. package/dist/src/tuix-link/enums/linkTarget.enum.js.map +0 -1
  123. package/dist/src/tuix-paper/TuixPaper.js.map +0 -1
  124. package/dist/src/tuix-paper/enums/tuix-paper.enum.js.map +0 -1
  125. package/dist/src/tuix-text/TuixText.js.map +0 -1
  126. package/dist/src/tuix-text/TuixText.styles.js.map +0 -1
  127. package/dist/src/tuix-text/enums/tuix-text.enums.js.map +0 -1
  128. package/dist/src/utils/colors.js.map +0 -1
  129. package/dist/src/utils/darkColors.js.map +0 -1
  130. package/dist/src/utils/hex-rgb.js.map +0 -1
  131. package/dist/src/utils/mainVariant.enum.js.map +0 -1
  132. package/dist/src/utils/screenSizes.enum.js.map +0 -1
  133. package/dist/tsconfig.publish.tsbuildinfo +0 -1
@@ -1,63 +1,25 @@
1
1
  import { __decorate } from "tslib";
2
- import { LitElement, css, html, nothing } from 'lit';
2
+ import { css, html, nothing } from 'lit';
3
3
  import { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';
4
- import { buttonSizeStyles, buttonColorStyles } from './TuixButton.styles';
4
+ import { buttonSizeStyles, buttonColorStyles, hostButtonStyles, } from './TuixButton.styles';
5
5
  import { customElement, property } from 'lit/decorators.js';
6
- import '../tuix-icon/TuixIcon.js';
7
- import { palette } from '../utils/colors';
8
- import { MainVariant } from '../utils/mainVariant.enum';
9
- import { buttonTextColor } from './enums/tuix-button.enums';
10
6
  import { ScreenSizes } from '../utils/screenSizes.enum';
11
- let TuixButton = class TuixButton extends LitElement {
7
+ import { TuixBaseButton } from './TuixBaseButton';
8
+ let TuixButton = class TuixButton extends TuixBaseButton {
12
9
  constructor() {
13
10
  super(...arguments);
14
- this.iconColor = '';
15
- this.variant = MainVariant.PRIMARY;
16
- this.disabled = false;
11
+ this.full = false;
17
12
  }
18
- _getIconColor() {
19
- this.iconColor = buttonTextColor[this.variant];
20
- if (this.disabled)
21
- this.iconColor = palette.primary_300;
22
- return this.iconColor;
23
- }
24
- _handleClick() {
25
- this.dispatchEvent(new CustomEvent('click', { bubbles: true }));
26
- }
27
- _iconTemplate(iconName) {
28
- let iconSize = IconSizeVariant.MEDIUM;
29
- if (screen.width <= ScreenSizes.TABLET) {
30
- iconSize = IconSizeVariant.SMALL;
31
- }
32
- return html `<tuix-icon
33
- size="${iconSize}"
34
- name="${iconName}"
35
- color="${this._getIconColor()}"
36
- ></tuix-icon>`;
37
- }
38
- getButtonStyles() {
39
- return `${this.variant}`;
40
- }
41
- render() {
42
- return html `<button
43
- @click=${this._handleClick}
44
- class="button ${this.getButtonStyles()}"
45
- ?disabled="${this.disabled}"
46
- >
47
- <div class="container">
48
- ${this.iconLeft ? this._iconTemplate(this.iconLeft) : nothing}
49
- <slot></slot>
50
- ${this.iconRight ? this._iconTemplate(this.iconRight) : nothing}
51
- </div>
52
- </button>`;
53
- }
54
- };
55
- TuixButton.styles = [
56
- css `
13
+ static { this.styles = [
14
+ css `
15
+ :host([full]) .button {
16
+ width: 100%;
17
+ }
57
18
  .button {
58
19
  padding: 16px 32px;
59
20
  border-radius: 4px;
60
- font-family: 'rubik', sans-serif;
21
+ border: none;
22
+ font-family: 'Rubik', sans-serif;
61
23
  }
62
24
 
63
25
  @media only screen and (max-width: ${ScreenSizes.TABLET}px) {
@@ -86,15 +48,30 @@ TuixButton.styles = [
86
48
  }
87
49
  }
88
50
  `,
89
- buttonColorStyles,
90
- buttonSizeStyles,
91
- ];
92
- __decorate([
93
- property({ type: MainVariant })
94
- ], TuixButton.prototype, "variant", void 0);
51
+ hostButtonStyles,
52
+ buttonColorStyles,
53
+ buttonSizeStyles,
54
+ ]; }
55
+ _updateIconColor() {
56
+ if (!this.iconLeft && !this.iconRight)
57
+ return;
58
+ this.iconColor = this._getTextColor();
59
+ }
60
+ _buttonContent() {
61
+ let iconSize = IconSizeVariant.MEDIUM;
62
+ if (screen.width <= ScreenSizes.TABLET) {
63
+ iconSize = IconSizeVariant.SMALL;
64
+ }
65
+ return html ` <div class="container">
66
+ ${this.iconLeft ? this._iconTemplate(this.iconLeft, iconSize) : nothing}
67
+ <slot></slot>
68
+ ${this.iconRight ? this._iconTemplate(this.iconRight, iconSize) : nothing}
69
+ </div>`;
70
+ }
71
+ };
95
72
  __decorate([
96
- property({ type: Boolean })
97
- ], TuixButton.prototype, "disabled", void 0);
73
+ property({ type: Boolean, reflect: true })
74
+ ], TuixButton.prototype, "full", void 0);
98
75
  __decorate([
99
76
  property({ type: IconName })
100
77
  ], TuixButton.prototype, "iconRight", void 0);
@@ -105,4 +82,3 @@ TuixButton = __decorate([
105
82
  customElement('tuix-button')
106
83
  ], TuixButton);
107
84
  export { TuixButton };
108
- //# sourceMappingURL=TuixButton.js.map
@@ -1,2 +1,3 @@
1
+ export declare const hostButtonStyles: import("lit").CSSResult;
1
2
  export declare const buttonSizeStyles: import("lit").CSSResult;
2
3
  export declare const buttonColorStyles: import("lit").CSSResult;
@@ -1,74 +1,107 @@
1
1
  import { css, unsafeCSS } from 'lit';
2
- import { palette } from '../utils/colors';
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
+ import slottedClassName from '../utils/slottedClassName';
7
+ import { TextSize } from '../tuix-text/enums/tuix-text.enums';
8
+ export const hostButtonStyles = css `
9
+ :host {
10
+ --t-button-primary-color: ${unsafeCSS(Palette.MAIN)};
11
+ --t-button-secondary-color: ${unsafeCSS(Palette.WHITE)};
12
+ --t-button-accent-color: ${unsafeCSS(Palette.SECONDARY)};
13
+ --t-button-text-color: ${unsafeCSS(Palette.WHITE)};
14
+ --t-button-text-secondary-color: ${unsafeCSS(Palette.MAIN)};
15
+ --t-button-text-muted-color: ${unsafeCSS(Palette.PRIMARY_300)};
16
+ --t-button-disabled-bg-color: ${unsafeCSS(Palette.PRIMARY_100)};
17
+ --t-button-hover-primary-color: ${unsafeCSS(Palette.PRIMARY_600)};
18
+ --t-button-active-primary-color: ${unsafeCSS(Palette.PRIMARY_800)};
19
+ --t-button-hover-secondary-color: ${unsafeCSS(Palette.PRIMARY_100)};
20
+ --t-button-active-secondary-color: ${unsafeCSS(Palette.PRIMARY_200)};
21
+ }
22
+ :host([dark]) {
23
+ --t-button-primary-color: ${unsafeCSS(DarkPalette.MAIN)};
24
+ --t-button-text-color: ${unsafeCSS(DarkPalette.WHITE)};
25
+ --t-button-text-muted-color: ${unsafeCSS(Palette.PRIMARY_800)};
26
+ --t-button-disabled-bg-color: ${unsafeCSS(Palette.PRIMARY_950)};
27
+ --t-button-hover-primary-color: ${unsafeCSS(Palette.MAIN)};
28
+ --t-button-active-primary-color: ${unsafeCSS(Palette.PRIMARY_600)};
29
+ --t-button-secondary-color: ${unsafeCSS(Palette.BLACK)};
30
+ --t-button-hover-secondary-color: ${unsafeCSS(Palette.PRIMARY_950)};
31
+ --t-button-active-secondary-color: ${unsafeCSS(Palette.PRIMARY_800)};
32
+ }
33
+ `;
4
34
  export const buttonSizeStyles = css `
5
- .button {
6
- font-size: 1.25rem;
35
+ ${unsafeCSS(`
36
+ ${slottedClassName(TextSize.Button)} {
37
+ font-size: 1rem;
7
38
  font-weight: 400;
8
- line-height: 1.5rem;
39
+ line-height: 1.25rem;
9
40
  }
10
41
  @media only screen and (max-width: ${ScreenSizes.TABLET}px) {
11
- .button {
12
- font-size: 1rem;
42
+ ${slottedClassName(TextSize.Button)} {
43
+ font-size: 0.938rem;
13
44
  font-weight: 400;
14
- line-height: 1.25rem;
45
+ line-height: 1.125rem;
15
46
  }
16
47
  }
17
48
  @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
18
- .button {
49
+ ${slottedClassName(TextSize.Button)} {
19
50
  font-size: 0.875rem;
20
51
  font-weight: 400;
21
52
  line-height: 1rem;
22
53
  }
23
54
  }
55
+ `)}
24
56
  `;
25
57
  export const buttonColorStyles = css `
26
- .button.primary {
27
- background-color: ${unsafeCSS(palette.main)};
28
- border: none;
29
- color: ${unsafeCSS(palette.white)};
58
+ :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button {
59
+ background-color: var(--t-button-primary-color);
60
+ outline: none;
61
+ color: var(--t-button-text-color);
30
62
  }
31
- .button.primary:hover {
32
- background-color: ${unsafeCSS(palette.primary_600)};
63
+ :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:hover {
64
+ background-color: var(--t-button-hover-primary-color);
33
65
  cursor: pointer;
34
66
  }
35
- .button.primary:focus {
36
- background-color: ${unsafeCSS(palette.primary_600)};
37
- border: 2px solid ${unsafeCSS(palette.secondary)};
67
+ :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:focus {
68
+ background-color: var(--t-button-hover-primary-color);
69
+ outline: 2px solid var(--t-button-accent-color);
38
70
  }
39
- .button.primary:active {
40
- background-color: ${unsafeCSS(palette.primary_800)};
41
- border: none;
71
+ :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:active {
72
+ background-color: var(--t-button-active-primary-color);
73
+ outline: none;
42
74
  }
43
- .button.primary:disabled {
44
- background-color: ${unsafeCSS(palette.primary_100)};
45
- color: ${unsafeCSS(palette.primary_300)};
46
- cursor: not-allowed;
47
- }
48
- .button.secondary {
49
- background-color: ${unsafeCSS(palette.white)};
50
- border: 2px solid ${unsafeCSS(palette.main)};
51
- color: ${unsafeCSS(palette.main)};
75
+
76
+ :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button {
77
+ background-color: var(--t-button-secondary-color);
78
+ outline: 1px solid var(--t-button-hover-primary-color);
79
+ color: var(--t-button-text-secondary-color);
52
80
  }
53
- .button.secondary:hover {
54
- background-color: ${unsafeCSS(palette.primary_100)};
55
- border: 2px solid ${unsafeCSS(palette.main)};
81
+ :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:hover {
82
+ background-color: var(--t-button-hover-secondary-color);
83
+ outline: 1px solid var(--t-button-primary-color);
84
+ color: var(--t-button-primary-color);
56
85
  cursor: pointer;
57
86
  }
58
- .button.secondary:focus {
59
- background-color: ${unsafeCSS(palette.primary_100)};
60
- border: 2px solid ${unsafeCSS(palette.secondary)};
87
+ :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:focus {
88
+ background-color: var(--t-button-hover-secondary-color);
89
+ outline: 2px solid var(--t-button-accent-color);
90
+ color: var(--t-button-primary-color);
91
+ }
92
+ :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:active {
93
+ background-color: var(--t-button-active-secondary-color);
94
+ outline: 1px solid var(--t-button-primary-color);
95
+ color: var(--t-button-primary-color);
61
96
  }
62
- .button.secondary:active {
63
- background-color: ${unsafeCSS(palette.primary_200)};
64
- border: none;
65
- color: ${unsafeCSS(palette.main)};
97
+ :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:disabled {
98
+ outline: 1px solid var(--t-button-text-muted-color);
66
99
  }
67
- .button.secondary:disabled {
68
- background-color: ${unsafeCSS(palette.primary_100)};
69
- border: none;
70
- color: ${unsafeCSS(palette.primary_300)};
100
+
101
+ :host([variant='${unsafeCSS(MainVariant.SECONDARY)}'][disabled]) .button,
102
+ :host([variant='${unsafeCSS(MainVariant.PRIMARY)}'][disabled]) .button {
103
+ background-color: var(--t-button-disabled-bg-color);
104
+ color: var(--t-button-text-muted-color);
71
105
  cursor: not-allowed;
72
106
  }
73
107
  `;
74
- //# sourceMappingURL=TuixButton.styles.js.map
@@ -1,7 +1,6 @@
1
- import { palette } from '../../utils/colors';
1
+ import { Palette } from '../../utils/colors';
2
2
  import { MainVariant } from '../../utils/mainVariant.enum';
3
3
  export const buttonTextColor = {
4
- [MainVariant.PRIMARY]: palette.white,
5
- [MainVariant.SECONDARY]: palette.main,
4
+ [MainVariant.PRIMARY]: Palette.WHITE,
5
+ [MainVariant.SECONDARY]: Palette.MAIN,
6
6
  };
7
- //# sourceMappingURL=tuix-button.enums.js.map
@@ -0,0 +1 @@
1
+ export type CustomEventTuixButton = CustomEvent<undefined>;
@@ -0,0 +1,17 @@
1
+ import { LitElement, type TemplateResult } from 'lit';
2
+ import '../tuix-icon/TuixIcon.js';
3
+ import '../tuix-text/TuixText.js';
4
+ import { CheckboxLabelSide } from './enums/tuix-checkbox.enums';
5
+ export declare class TuixCheckbox extends LitElement {
6
+ static styles: import("lit").CSSResult[];
7
+ checked: boolean;
8
+ disabled: boolean;
9
+ dark: boolean;
10
+ error: boolean;
11
+ label: string;
12
+ labelSide: CheckboxLabelSide;
13
+ private _onCheckboxChange;
14
+ private _getIconMode;
15
+ private _getFullContainerClasses;
16
+ protected render(): TemplateResult;
17
+ }
@@ -0,0 +1,108 @@
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 '../tuix-icon/TuixIcon.js';
6
+ import '../tuix-text/TuixText.js';
7
+ import { IconName, IconSizeVariant } from '../tuix-icon/enums/tuix-icon.enums';
8
+ import { TextSize, TextVariant } from '../tuix-text/enums/tuix-text.enums';
9
+ import { checkboxCheckmarkStyles, checkboxContainerStyles, checkboxLabelStyles, hostStyles, } from './TuixCheckbox.styles';
10
+ import { CheckboxIconColorDark, CheckboxIconColorLight, CheckboxIconMode, CheckboxLabelSide, } from './enums/tuix-checkbox.enums';
11
+ let TuixCheckbox = class TuixCheckbox extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.checked = false;
15
+ this.disabled = false;
16
+ this.dark = false;
17
+ this.error = false;
18
+ this.label = '';
19
+ this.labelSide = CheckboxLabelSide.RIGHT;
20
+ }
21
+ static { this.styles = [
22
+ hostStyles,
23
+ checkboxContainerStyles,
24
+ checkboxCheckmarkStyles,
25
+ checkboxLabelStyles,
26
+ ]; }
27
+ _onCheckboxChange(event) {
28
+ this.dispatchEvent(new CustomEvent('change', {
29
+ detail: {
30
+ value: event.target.checked,
31
+ label: this.label,
32
+ },
33
+ bubbles: true,
34
+ }));
35
+ }
36
+ _getIconMode() {
37
+ if (this.disabled) {
38
+ return CheckboxIconMode.DISABLED;
39
+ }
40
+ if (this.error) {
41
+ return CheckboxIconMode.ERROR;
42
+ }
43
+ return CheckboxIconMode.DEFAULT;
44
+ }
45
+ _getFullContainerClasses() {
46
+ return {
47
+ 't-checkbox-full-container': true,
48
+ 't-with-error': this.error && !this.disabled,
49
+ 't-with-label-left': this.labelSide === CheckboxLabelSide.LEFT,
50
+ };
51
+ }
52
+ render() {
53
+ return html `<label class="${classMap(this._getFullContainerClasses())}">
54
+ <div class="t-checkbox-container">
55
+ <input
56
+ type="checkbox"
57
+ class="t-checkbox"
58
+ .checked="${this.checked}"
59
+ ?disabled="${this.disabled}"
60
+ @change="${this._onCheckboxChange}"
61
+ />
62
+ <div class="t-checkbox-checkmark">
63
+ <tuix-icon
64
+ size="${IconSizeVariant.FULL}"
65
+ name="${IconName.CHECK}"
66
+ color="${this.dark
67
+ ? CheckboxIconColorDark[this._getIconMode()]
68
+ : CheckboxIconColorLight[this._getIconMode()]}"
69
+ >
70
+ </tuix-icon>
71
+ </div>
72
+ </div>
73
+ <div class="t-checkbox-label">
74
+ <slot>
75
+ <tuix-text
76
+ size="${TextSize.FieldPlaceholder}"
77
+ color="${TextVariant.PRIMARY}"
78
+ ?dark="${this.dark}"
79
+ >
80
+ ${this.label}
81
+ </tuix-text>
82
+ </slot>
83
+ </div>
84
+ </label>`;
85
+ }
86
+ };
87
+ __decorate([
88
+ property({ type: Boolean })
89
+ ], TuixCheckbox.prototype, "checked", void 0);
90
+ __decorate([
91
+ property({ type: Boolean, reflect: true })
92
+ ], TuixCheckbox.prototype, "disabled", void 0);
93
+ __decorate([
94
+ property({ type: Boolean, reflect: true })
95
+ ], TuixCheckbox.prototype, "dark", void 0);
96
+ __decorate([
97
+ property({ type: Boolean, reflect: true })
98
+ ], TuixCheckbox.prototype, "error", void 0);
99
+ __decorate([
100
+ property({ type: String })
101
+ ], TuixCheckbox.prototype, "label", void 0);
102
+ __decorate([
103
+ property({ type: String })
104
+ ], TuixCheckbox.prototype, "labelSide", void 0);
105
+ TuixCheckbox = __decorate([
106
+ customElement('tuix-checkbox')
107
+ ], TuixCheckbox);
108
+ export { TuixCheckbox };
@@ -0,0 +1,4 @@
1
+ export declare const hostStyles: import("lit").CSSResult;
2
+ export declare const checkboxContainerStyles: import("lit").CSSResult;
3
+ export declare const checkboxCheckmarkStyles: import("lit").CSSResult;
4
+ export declare const checkboxLabelStyles: import("lit").CSSResult;
@@ -0,0 +1,132 @@
1
+ import { css, unsafeCSS } from 'lit';
2
+ import { Palette } from '../utils/colors';
3
+ import { DarkPalette } from '../utils/darkColors';
4
+ import { ScreenSizes } from '../utils/screenSizes.enum';
5
+ export const hostStyles = css `
6
+ :host {
7
+ --t-main-color-tuix: ${unsafeCSS(Palette.MAIN)};
8
+ --t-bg-color-primary: ${unsafeCSS(Palette.WHITE)};
9
+ --t-bg-color-disabled: ${unsafeCSS(Palette.PRIMARY_100)};
10
+ --t-text-color-error: ${unsafeCSS(Palette.ERROR)};
11
+ --t-stroke-color-focus: ${unsafeCSS(Palette.SECONDARY)};
12
+ --t-stroke-color-grey: ${unsafeCSS(Palette.PRIMARY_300)};
13
+ --t-text-color-label: ${unsafeCSS(Palette.BLACK)};
14
+ --t-label-right-default-justify: flex-start;
15
+ --t-label-left-default-justify: space-between;
16
+ }
17
+ :host([dark]) {
18
+ --t-main-color-tuix: ${unsafeCSS(DarkPalette.MAIN)};
19
+ --t-bg-color-primary: ${unsafeCSS(DarkPalette.BLACK)};
20
+ --t-bg-color-disabled: ${unsafeCSS(DarkPalette.PRIMARY_800)};
21
+ --t-text-color-error: ${unsafeCSS(DarkPalette.ERROR)};
22
+ --t-stroke-color-focus: ${unsafeCSS(DarkPalette.SECONDARY)};
23
+ --t-stroke-color-grey: ${unsafeCSS(DarkPalette.PRIMARY_100)};
24
+ --t-text-color-label: ${unsafeCSS(DarkPalette.WHITE)};
25
+ }
26
+ `;
27
+ export const checkboxContainerStyles = css `
28
+ .t-checkbox-full-container {
29
+ display: flex;
30
+ justify-content: var(--t-label-right-default-justify, flex-start);
31
+ cursor: pointer;
32
+ -webkit-user-select: none;
33
+ -moz-user-select: none;
34
+ -ms-user-select: none;
35
+ user-select: none;
36
+ }
37
+ :host([disabled]) .t-checkbox-full-container {
38
+ cursor: not-allowed;
39
+ }
40
+ .t-checkbox-container {
41
+ --t-checkbox-size-box: 1.5rem;
42
+ --t-checkbox-shadow-width: 2px;
43
+ --t-checkbox-border-radius: 0.25rem;
44
+ display: block;
45
+ position: relative;
46
+ height: var(--t-checkbox-size-box);
47
+ width: var(--t-checkbox-size-box);
48
+ min-width: var(--t-checkbox-size-box);
49
+ }
50
+ .t-checkbox-container .t-checkbox {
51
+ position: absolute;
52
+ opacity: 0;
53
+ height: 0;
54
+ width: 0;
55
+ }
56
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
57
+ .t-checkbox-container {
58
+ --t-checkbox-size-box: 1rem;
59
+ --t-checkbox-shadow-width: 1px;
60
+ --t-checkbox-border-radius: 0.125rem;
61
+ margin-top: 1px;
62
+ }
63
+ }
64
+ `;
65
+ export const checkboxCheckmarkStyles = css `
66
+ .t-checkbox-container .t-checkbox-checkmark {
67
+ position: absolute;
68
+ top: 0;
69
+ left: 0;
70
+ display: flex;
71
+ height: var(--t-checkbox-size-box);
72
+ width: var(--t-checkbox-size-box);
73
+ border-radius: var(--t-checkbox-border-radius);
74
+ background-color: var(--t-bg-color-primary);
75
+ border: 1px solid var(--t-stroke-color-grey);
76
+ box-sizing: border-box;
77
+ }
78
+ .t-checkbox-container .t-checkbox-checkmark tuix-icon {
79
+ margin: auto;
80
+ display: none;
81
+ width: calc(var(--t-checkbox-size-box) - 0.5rem);
82
+ height: calc(var(--t-checkbox-size-box) - 0.5rem);
83
+ }
84
+ .t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark {
85
+ background-color: var(--t-main-color-tuix);
86
+ border: none;
87
+ }
88
+ .t-checkbox-container .t-checkbox:focus ~ .t-checkbox-checkmark {
89
+ box-shadow: 0 0 0px var(--t-checkbox-shadow-width)
90
+ var(--t-stroke-color-focus);
91
+ border: 1px solid var(--t-main-color-tuix);
92
+ }
93
+ .t-checkbox-container .t-checkbox:checked ~ .t-checkbox-checkmark tuix-icon {
94
+ display: block;
95
+ }
96
+ .t-checkbox-full-container:hover .t-checkbox-container .t-checkbox-checkmark {
97
+ border: 1px solid var(--t-main-color-tuix);
98
+ }
99
+ .t-checkbox-full-container.t-with-error
100
+ .t-checkbox-container
101
+ .t-checkbox-checkmark {
102
+ border: 1px solid var(--t-text-color-error);
103
+ }
104
+ .t-checkbox-full-container.t-with-error
105
+ .t-checkbox-container
106
+ .t-checkbox:checked
107
+ ~ .t-checkbox-checkmark {
108
+ background-color: var(--t-text-color-error);
109
+ border: none;
110
+ }
111
+
112
+ .t-checkbox-container .t-checkbox:disabled ~ .t-checkbox-checkmark {
113
+ background-color: var(--t-bg-color-disabled);
114
+ border: none;
115
+ box-shadow: none;
116
+ }
117
+ `;
118
+ export const checkboxLabelStyles = css `
119
+ .t-checkbox-label {
120
+ display: block;
121
+ color: var(--t-text-color-label);
122
+ margin-left: 0.625rem;
123
+ }
124
+ .t-checkbox-full-container.t-with-label-left {
125
+ flex-direction: row-reverse;
126
+ justify-content: var(--t-label-left-default-justify, space-between);
127
+ }
128
+ .t-checkbox-full-container.t-with-label-left .t-checkbox-label {
129
+ margin-right: 0.625rem;
130
+ margin-left: 0;
131
+ }
132
+ `;
@@ -0,0 +1,21 @@
1
+ import { Palette } from '../../utils/colors';
2
+ import { DarkPalette } from '../../utils/darkColors';
3
+ export declare enum CheckboxIconMode {
4
+ DEFAULT = "default",
5
+ DISABLED = "disabled",
6
+ ERROR = "error"
7
+ }
8
+ export declare enum CheckboxLabelSide {
9
+ LEFT = "left",
10
+ RIGHT = "right"
11
+ }
12
+ export declare const CheckboxIconColorLight: {
13
+ default: Palette;
14
+ disabled: Palette;
15
+ error: Palette;
16
+ };
17
+ export declare const CheckboxIconColorDark: {
18
+ default: DarkPalette;
19
+ disabled: DarkPalette;
20
+ error: DarkPalette;
21
+ };
@@ -0,0 +1,23 @@
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
+ };
@@ -0,0 +1,5 @@
1
+ import { type DetailValue } from '../../utils/interfaces/detail-value.interface';
2
+ export interface DetailValueCheckbox extends DetailValue<boolean> {
3
+ label?: string;
4
+ }
5
+ export type CustomEventTuixCheckbox = CustomEvent<DetailValueCheckbox>;
@@ -1,5 +1,6 @@
1
- import { LitElement, PropertyValues, TemplateResult } from 'lit';
2
- import { TuixDropdownOption } from './interfaces/tuix-dropdown.interface';
1
+ import { LitElement, type PropertyValues, type TemplateResult } from 'lit';
2
+ import '../tuix-input/TuixInput.js';
3
+ import type { TuixDropdownExtendedOption, TuixDropdownOption } from './interfaces/tuix-dropdown.interface';
3
4
  import { DescriptionType } from '../tuix-input/enums/tuix-input.enums';
4
5
  import { DropdownType } from './enums/tuix-dropdown.enums';
5
6
  export declare class TuixDropdown extends LitElement {
@@ -10,11 +11,13 @@ export declare class TuixDropdown extends LitElement {
10
11
  title: string;
11
12
  disabled: boolean;
12
13
  dark: boolean;
13
- description: undefined;
14
+ description?: string;
14
15
  descriptionType: DescriptionType;
15
16
  type: DropdownType;
16
17
  private _value;
17
18
  private _isOptionsVisible;
19
+ private _searchingOption;
20
+ _extendedOptions: TuixDropdownExtendedOption[];
18
21
  private _optionsContainer;
19
22
  private _inputDropdown;
20
23
  private _previousSelectedOption;
@@ -28,7 +31,12 @@ export declare class TuixDropdown extends LitElement {
28
31
  private _onClickOption;
29
32
  protected _onInputSingle(e: CustomEvent): void;
30
33
  protected _handleSelectEvent(event: MouseEvent | KeyboardEvent): void;
34
+ private _handleBlur;
35
+ private _getOptionName;
36
+ private _getOptionValue;
37
+ private _findIndex;
31
38
  private _handleInputBase;
39
+ private _extendOptionsList;
32
40
  private _handleArrowDown;
33
41
  private _handleArrowUp;
34
42
  private _handleClickOutside;
@@ -36,11 +44,13 @@ export declare class TuixDropdown extends LitElement {
36
44
  private _toggleOptions;
37
45
  private _focusOptionsContainer;
38
46
  private _unselectPreviousOption;
47
+ private _hasCompleteDescription;
39
48
  private _getOptionsContainerClasses;
40
49
  private _triggerUpdateByExternalValueChange;
41
50
  private _resetPreviousSelection;
42
51
  private _getOptionsTemplate;
43
52
  protected updated(changedProperties: Map<string, any>): void;
44
53
  protected willUpdate(changedProperties: PropertyValues<this>): void;
54
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
45
55
  protected render(): TemplateResult;
46
56
  }