tuix-webcomponents 0.0.21 → 0.0.24

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 (116) hide show
  1. package/README.md +110 -4
  2. package/dist/assets/tuix-styles.css +72 -0
  3. package/dist/src/index.d.ts +34 -1
  4. package/dist/src/index.js +26 -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 +11 -0
  10. package/dist/src/tuix-button/TuixButton.js +84 -0
  11. package/dist/src/tuix-button/TuixButton.styles.d.ts +3 -0
  12. package/dist/src/tuix-button/TuixButton.styles.js +107 -0
  13. package/dist/src/tuix-button/enums/tuix-button.enums.d.ts +2 -0
  14. package/dist/src/tuix-button/enums/tuix-button.enums.js +6 -0
  15. package/dist/src/tuix-button/interfaces/tuix-button.interface.d.ts +1 -0
  16. package/dist/src/tuix-button/interfaces/tuix-button.interface.js +1 -0
  17. package/dist/src/tuix-checkbox/TuixCheckbox.d.ts +17 -0
  18. package/dist/src/tuix-checkbox/TuixCheckbox.js +108 -0
  19. package/dist/src/tuix-checkbox/TuixCheckbox.styles.d.ts +4 -0
  20. package/dist/src/tuix-checkbox/TuixCheckbox.styles.js +132 -0
  21. package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.d.ts +21 -0
  22. package/dist/src/tuix-checkbox/enums/tuix-checkbox.enums.js +23 -0
  23. package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.d.ts +5 -0
  24. package/dist/src/tuix-checkbox/interfaces/tuix-checkbox.interface.js +1 -0
  25. package/dist/src/tuix-dropdown/TuixDropdown.d.ts +56 -0
  26. package/dist/src/tuix-dropdown/TuixDropdown.js +361 -0
  27. package/dist/src/tuix-dropdown/TuixDropdown.styles.d.ts +3 -0
  28. package/dist/src/tuix-dropdown/TuixDropdown.styles.js +125 -0
  29. package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.d.ts +4 -0
  30. package/dist/src/tuix-dropdown/enums/tuix-dropdown.enums.js +5 -0
  31. package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.d.ts +15 -0
  32. package/dist/src/tuix-dropdown/interfaces/tuix-dropdown.interface.js +1 -0
  33. package/dist/src/tuix-icon/TuixIcon.d.ts +15 -0
  34. package/dist/src/tuix-icon/TuixIcon.icons.d.ts +6 -0
  35. package/dist/src/tuix-icon/TuixIcon.icons.js +395 -0
  36. package/dist/src/tuix-icon/TuixIcon.js +79 -0
  37. package/dist/src/tuix-icon/enums/tuix-icon.enums.d.ts +89 -0
  38. package/dist/src/tuix-icon/enums/tuix-icon.enums.js +96 -0
  39. package/dist/src/tuix-icon-button/TuixIconButton.d.ts +9 -0
  40. package/dist/src/tuix-icon-button/TuixIconButton.js +51 -0
  41. package/dist/src/tuix-input/TuixInput.d.ts +52 -0
  42. package/dist/src/tuix-input/TuixInput.js +374 -0
  43. package/dist/src/tuix-input/TuixInput.styles.d.ts +8 -0
  44. package/dist/src/tuix-input/TuixInput.styles.js +296 -0
  45. package/dist/src/tuix-input/enums/tuix-input.enums.d.ts +38 -0
  46. package/dist/src/tuix-input/enums/tuix-input.enums.js +41 -0
  47. package/dist/src/tuix-input/interfaces/tuix-input.interface.d.ts +18 -0
  48. package/dist/src/tuix-input/interfaces/tuix-input.interface.js +5 -0
  49. package/dist/src/tuix-link/TuixLink.d.ts +15 -0
  50. package/dist/src/tuix-link/TuixLink.js +71 -0
  51. package/dist/src/tuix-link/TuixLink.styles.d.ts +2 -0
  52. package/dist/src/tuix-link/TuixLink.styles.js +55 -0
  53. package/dist/src/tuix-link/enums/linkTarget.enum.d.ts +6 -0
  54. package/dist/src/tuix-link/enums/linkTarget.enum.js +7 -0
  55. package/dist/src/tuix-modal/TuixModal.d.ts +11 -0
  56. package/dist/src/tuix-modal/TuixModal.js +65 -0
  57. package/dist/src/tuix-modal/TuixModal.styles.d.ts +2 -0
  58. package/dist/src/tuix-modal/TuixModal.styles.js +55 -0
  59. package/dist/src/tuix-paper/TuixPaper.d.ts +10 -0
  60. package/dist/src/tuix-paper/TuixPaper.js +46 -0
  61. package/dist/src/tuix-paper/TuixPaper.styles.d.ts +1 -0
  62. package/dist/src/tuix-paper/TuixPaper.styles.js +30 -0
  63. package/dist/src/tuix-paper/enums/tuix-paper.enum.d.ts +13 -0
  64. package/dist/src/tuix-paper/enums/tuix-paper.enum.js +15 -0
  65. package/dist/src/tuix-radio-button/TuixRadioButton.d.ts +17 -0
  66. package/dist/src/tuix-radio-button/TuixRadioButton.js +96 -0
  67. package/dist/src/tuix-radio-button/TuixRadioButton.styles.d.ts +5 -0
  68. package/dist/src/tuix-radio-button/TuixRadioButton.styles.js +135 -0
  69. package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.d.ts +3 -0
  70. package/dist/src/tuix-radio-button/interfaces/tuix-radio-button.interface.js +1 -0
  71. package/dist/src/tuix-table/TuixTable.d.ts +48 -0
  72. package/dist/src/tuix-table/TuixTable.js +369 -0
  73. package/dist/src/tuix-table/TuixTable.styles.d.ts +2 -0
  74. package/dist/src/tuix-table/TuixTable.styles.js +197 -0
  75. package/dist/src/tuix-table/interfaces/tuix-table.interface.d.ts +45 -0
  76. package/dist/src/tuix-table/interfaces/tuix-table.interface.js +1 -0
  77. package/dist/src/tuix-text/TuixText.d.ts +7 -5
  78. package/dist/src/tuix-text/TuixText.js +45 -137
  79. package/dist/src/tuix-text/TuixText.styles.d.ts +2 -0
  80. package/dist/src/tuix-text/TuixText.styles.js +195 -0
  81. package/dist/src/tuix-text/enums/tuix-text.enums.d.ts +36 -0
  82. package/dist/src/tuix-text/enums/tuix-text.enums.js +72 -0
  83. package/dist/src/tuix-toast/TuixToast.d.ts +18 -0
  84. package/dist/src/tuix-toast/TuixToast.js +103 -0
  85. package/dist/src/tuix-toast/TuixToast.styles.d.ts +3 -0
  86. package/dist/src/tuix-toast/TuixToast.styles.js +43 -0
  87. package/dist/src/tuix-toast/enums/tuix-toast.enums.d.ts +20 -0
  88. package/dist/src/tuix-toast/enums/tuix-toast.enums.js +59 -0
  89. package/dist/src/tuix-toggle-button/TuixToggleButton.d.ts +14 -0
  90. package/dist/src/tuix-toggle-button/TuixToggleButton.js +86 -0
  91. package/dist/src/tuix-toggle-button/TuixToggleButton.styles.d.ts +5 -0
  92. package/dist/src/tuix-toggle-button/TuixToggleButton.styles.js +134 -0
  93. package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.d.ts +2 -0
  94. package/dist/src/tuix-toggle-button/interfaces/tuix-toggle.interface.js +1 -0
  95. package/dist/src/utils/colors.d.ts +30 -10
  96. package/dist/src/utils/colors.js +31 -11
  97. package/dist/src/utils/darkColors.d.ts +32 -0
  98. package/dist/src/utils/darkColors.js +33 -0
  99. package/dist/src/utils/hex-rgb.d.ts +5 -0
  100. package/dist/src/utils/hex-rgb.js +15 -0
  101. package/dist/src/utils/interfaces/detail-value.interface.d.ts +3 -0
  102. package/dist/src/utils/interfaces/detail-value.interface.js +1 -0
  103. package/dist/src/utils/mainVariant.enum.d.ts +4 -0
  104. package/dist/src/utils/mainVariant.enum.js +5 -0
  105. package/dist/src/utils/screenSizes.enum.d.ts +4 -0
  106. package/dist/src/utils/screenSizes.enum.js +5 -0
  107. package/dist/src/utils/slottedClassName.d.ts +2 -0
  108. package/dist/src/utils/slottedClassName.js +1 -0
  109. package/package.json +118 -66
  110. package/dist/src/enums/tuix-text.enums.d.ts +0 -24
  111. package/dist/src/enums/tuix-text.enums.js +0 -29
  112. package/dist/src/enums/tuix-text.enums.js.map +0 -1
  113. package/dist/src/index.js.map +0 -1
  114. package/dist/src/tuix-text/TuixText.js.map +0 -1
  115. package/dist/src/utils/colors.js.map +0 -1
  116. package/dist/tsconfig.publish.tsbuildinfo +0 -1
@@ -0,0 +1,107 @@
1
+ import { css, unsafeCSS } from 'lit';
2
+ import { Palette } from '../utils/colors.js';
3
+ import { ScreenSizes } from '../utils/screenSizes.enum.js';
4
+ import { DarkPalette } from '../utils/darkColors.js';
5
+ import { MainVariant } from '../utils/mainVariant.enum.js';
6
+ import slottedClassName from '../utils/slottedClassName.js';
7
+ import { TextSize } from '../tuix-text/enums/tuix-text.enums.js';
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
+ `;
34
+ export const buttonSizeStyles = css `
35
+ ${unsafeCSS(`
36
+ ${slottedClassName(TextSize.Button)} {
37
+ font-size: 1rem;
38
+ font-weight: 400;
39
+ line-height: 1.25rem;
40
+ }
41
+ @media only screen and (max-width: ${ScreenSizes.TABLET}px) {
42
+ ${slottedClassName(TextSize.Button)} {
43
+ font-size: 0.938rem;
44
+ font-weight: 400;
45
+ line-height: 1.125rem;
46
+ }
47
+ }
48
+ @media only screen and (max-width: ${ScreenSizes.MOBILE}px) {
49
+ ${slottedClassName(TextSize.Button)} {
50
+ font-size: 0.875rem;
51
+ font-weight: 400;
52
+ line-height: 1rem;
53
+ }
54
+ }
55
+ `)}
56
+ `;
57
+ export const buttonColorStyles = css `
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);
62
+ }
63
+ :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:hover {
64
+ background-color: var(--t-button-hover-primary-color);
65
+ cursor: pointer;
66
+ }
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);
70
+ }
71
+ :host([variant='${unsafeCSS(MainVariant.PRIMARY)}']) .button:active {
72
+ background-color: var(--t-button-active-primary-color);
73
+ outline: none;
74
+ }
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);
80
+ }
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);
85
+ cursor: pointer;
86
+ }
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);
96
+ }
97
+ :host([variant='${unsafeCSS(MainVariant.SECONDARY)}']) .button:disabled {
98
+ outline: 1px solid var(--t-button-text-muted-color);
99
+ }
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);
105
+ cursor: not-allowed;
106
+ }
107
+ `;
@@ -0,0 +1,2 @@
1
+ import { MainVariant } from '../../utils/mainVariant.enum.js';
2
+ export declare const buttonTextColor: Record<MainVariant, string>;
@@ -0,0 +1,6 @@
1
+ import { Palette } from '../../utils/colors.js';
2
+ import { MainVariant } from '../../utils/mainVariant.enum.js';
3
+ export const buttonTextColor = {
4
+ [MainVariant.PRIMARY]: Palette.WHITE,
5
+ [MainVariant.SECONDARY]: Palette.MAIN,
6
+ };
@@ -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.js';
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.js';
8
+ import { TextSize, TextVariant } from '../tuix-text/enums/tuix-text.enums.js';
9
+ import { checkboxCheckmarkStyles, checkboxContainerStyles, checkboxLabelStyles, hostStyles, } from './TuixCheckbox.styles.js';
10
+ import { CheckboxIconColorDark, CheckboxIconColorLight, CheckboxIconMode, CheckboxLabelSide, } from './enums/tuix-checkbox.enums.js';
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.js';
3
+ import { DarkPalette } from '../utils/darkColors.js';
4
+ import { ScreenSizes } from '../utils/screenSizes.enum.js';
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.js';
2
+ import { DarkPalette } from '../../utils/darkColors.js';
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.js';
2
+ import { DarkPalette } from '../../utils/darkColors.js';
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.js';
2
+ export interface DetailValueCheckbox extends DetailValue<boolean> {
3
+ label?: string;
4
+ }
5
+ export type CustomEventTuixCheckbox = CustomEvent<DetailValueCheckbox>;
@@ -0,0 +1,56 @@
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.js';
4
+ import { DescriptionType } from '../tuix-input/enums/tuix-input.enums.js';
5
+ import { DropdownType } from './enums/tuix-dropdown.enums.js';
6
+ export declare class TuixDropdown extends LitElement {
7
+ static styles: import("lit").CSSResult[];
8
+ value?: TuixDropdownOption;
9
+ options: TuixDropdownOption[];
10
+ placeholder: string;
11
+ title: string;
12
+ disabled: boolean;
13
+ dark: boolean;
14
+ description?: string;
15
+ descriptionType: DescriptionType;
16
+ type: DropdownType;
17
+ private _value;
18
+ private _isOptionsVisible;
19
+ private _searchingOption;
20
+ _extendedOptions: TuixDropdownExtendedOption[];
21
+ private _optionsContainer;
22
+ private _inputDropdown;
23
+ private _previousSelectedOption;
24
+ private _previousFocusedOption;
25
+ connectedCallback(): void;
26
+ disconnectedCallback(): void;
27
+ private _onEnterPress;
28
+ private _onKeyDownOption;
29
+ private _onKeyPressOption;
30
+ private _onMouseOverOption;
31
+ private _onClickOption;
32
+ protected _onInputSingle(e: CustomEvent): void;
33
+ protected _handleSelectEvent(event: MouseEvent | KeyboardEvent): void;
34
+ private _handleBlur;
35
+ private _getOptionName;
36
+ private _getOptionValue;
37
+ private _findIndex;
38
+ private _handleInputBase;
39
+ private _extendOptionsList;
40
+ private _handleArrowDown;
41
+ private _handleArrowUp;
42
+ private _handleClickOutside;
43
+ private _focusTargetOption;
44
+ private _toggleOptions;
45
+ private _focusOptionsContainer;
46
+ private _unselectPreviousOption;
47
+ private _hasCompleteDescription;
48
+ private _getOptionsContainerClasses;
49
+ private _triggerUpdateByExternalValueChange;
50
+ private _resetPreviousSelection;
51
+ private _getOptionsTemplate;
52
+ protected updated(changedProperties: Map<string, any>): void;
53
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
54
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
55
+ protected render(): TemplateResult;
56
+ }