matcha-components 1.0.5 → 1.0.6

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 (177) hide show
  1. package/README.md +239 -2
  2. package/assets/open_in_new.png +0 -0
  3. package/ng-package.json +7 -0
  4. package/package.json +10 -23
  5. package/src/foundation/colors/base/amber.mdx +232 -0
  6. package/src/foundation/colors/base/blue.mdx +232 -0
  7. package/src/foundation/colors/base/cyan.mdx +232 -0
  8. package/src/foundation/colors/base/deep-orange.mdx +232 -0
  9. package/src/foundation/colors/base/deep-purple.mdx +232 -0
  10. package/src/foundation/colors/base/green.mdx +232 -0
  11. package/src/foundation/colors/base/indigo.mdx +232 -0
  12. package/src/foundation/colors/base/light-blue.mdx +232 -0
  13. package/src/foundation/colors/base/light-green.mdx +232 -0
  14. package/src/foundation/colors/base/lime.mdx +232 -0
  15. package/src/foundation/colors/base/orange.mdx +232 -0
  16. package/src/foundation/colors/base/pink.mdx +232 -0
  17. package/src/foundation/colors/base/purple.mdx +232 -0
  18. package/src/foundation/colors/base/red.mdx +232 -0
  19. package/src/foundation/colors/base/teal.mdx +232 -0
  20. package/src/foundation/colors/base/yellow.mdx +232 -0
  21. package/src/foundation/colors/base-colors.mdx +141 -0
  22. package/src/foundation/colors/surface-colors.mdx +93 -0
  23. package/src/foundation/colors/theme/accent.mdx +232 -0
  24. package/src/foundation/colors/theme/primary.mdx +232 -0
  25. package/src/foundation/colors/theme/warn.mdx +232 -0
  26. package/src/foundation/colors/theme-colors.mdx +159 -0
  27. package/src/foundation/sizes/heights.mdx +232 -0
  28. package/src/foundation/sizes/max-heights.mdx +237 -0
  29. package/src/foundation/sizes/max-width.mdx +236 -0
  30. package/src/foundation/sizes/min-heights.mdx +237 -0
  31. package/src/foundation/sizes/min-width.mdx +236 -0
  32. package/src/foundation/sizes/sizes.mdx +219 -0
  33. package/src/foundation/sizes/widths.mdx +234 -0
  34. package/src/lib/matcha-autocomplete/autocomplete-overview.directive.ts +16 -0
  35. package/src/lib/matcha-autocomplete/autocomplete.argtypes.ts +64 -0
  36. package/src/lib/matcha-autocomplete/autocomplete.directive.ts +14 -0
  37. package/src/lib/matcha-autocomplete/autocomplete.mdx +112 -0
  38. package/src/lib/matcha-autocomplete/autocomplete.module.ts +14 -0
  39. package/src/lib/matcha-autocomplete/autocomplete.stories.ts +113 -0
  40. package/src/lib/matcha-badge/badge.module.ts +14 -0
  41. package/src/lib/matcha-badge/matcha-badge.directive.ts +16 -0
  42. package/src/lib/matcha-bottom-sheet/bottom-sheet.module.ts +14 -0
  43. package/src/lib/matcha-bottom-sheet/matcha-bottom-sheet.directive.ts +16 -0
  44. package/src/lib/matcha-button-toggle/button-toggle.module.ts +14 -0
  45. package/src/lib/matcha-button-toggle/matcha-button-toggle.directive.ts +16 -0
  46. package/src/lib/matcha-buttons/button.stories.ts +111 -0
  47. package/src/lib/matcha-buttons/buttons.module.ts +27 -0
  48. package/src/lib/matcha-buttons/matcha-btn-md.directive.ts +16 -0
  49. package/src/lib/matcha-buttons/matcha-btn-pill.directive.ts +15 -0
  50. package/src/lib/matcha-buttons/matcha-btn-size.directive.ts +17 -0
  51. package/src/lib/matcha-buttons/matcha-btn-xl.directive.ts +15 -0
  52. package/src/lib/matcha-card/card.mdx.txt +55 -0
  53. package/src/lib/matcha-card/matcha-card-argtype.ts +123 -0
  54. package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.html +3 -0
  55. package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.scss +0 -0
  56. package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.spec.ts +21 -0
  57. package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.ts +10 -0
  58. package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.html +3 -0
  59. package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.scss +0 -0
  60. package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.spec.ts +21 -0
  61. package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.ts +10 -0
  62. package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.html +4 -0
  63. package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.scss +0 -0
  64. package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.spec.ts +21 -0
  65. package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.ts +10 -0
  66. package/src/lib/matcha-card/matcha-card.component.html +3 -0
  67. package/src/lib/matcha-card/matcha-card.component.scss +117 -0
  68. package/src/lib/matcha-card/matcha-card.component.spec.ts +21 -0
  69. package/src/lib/matcha-card/matcha-card.component.ts +43 -0
  70. package/src/lib/matcha-card/matcha-card.module.ts +27 -0
  71. package/src/lib/matcha-card/matcha-card.stories.ts +80 -0
  72. package/src/lib/matcha-checkbox/checkbox.argtype.ts +79 -0
  73. package/src/lib/matcha-checkbox/checkbox.directive.ts +14 -0
  74. package/src/lib/matcha-checkbox/checkbox.mdx +76 -0
  75. package/src/lib/matcha-checkbox/checkbox.module.ts +9 -0
  76. package/src/lib/matcha-checkbox/checkbox.stories.ts +161 -0
  77. package/src/lib/matcha-checkbox/checkbox.stories.txt +74 -0
  78. package/src/lib/matcha-chips/chips.module.ts +12 -0
  79. package/src/lib/matcha-chips/matcha-chips.directive.ts +16 -0
  80. package/src/lib/matcha-components.module.ts +78 -0
  81. package/src/lib/matcha-datepicker/datepicker.argtypes.ts +63 -0
  82. package/src/lib/matcha-datepicker/datepicker.directive.ts +14 -0
  83. package/src/lib/matcha-datepicker/datepicker.mdx +73 -0
  84. package/src/lib/matcha-datepicker/datepicker.module.ts +9 -0
  85. package/src/lib/matcha-datepicker/datepicker.stories.ts +277 -0
  86. package/src/lib/matcha-dialog/dialog.module.ts +14 -0
  87. package/src/lib/matcha-dialog/matcha-dialog.directive.ts +16 -0
  88. package/src/lib/matcha-dialog2/confirmation-dialog.component.ts.txt +54 -0
  89. package/src/lib/matcha-dialog2/confirmation-dialog.stories.ts.txt +24 -0
  90. package/src/lib/matcha-divider/divider.module.ts +14 -0
  91. package/src/lib/matcha-divider/matcha-divider.directive.ts +16 -0
  92. package/src/lib/matcha-expansion-panel/expansion-panel.module.ts +14 -0
  93. package/src/lib/matcha-expansion-panel/matcha-expansion-panel.directive.ts +16 -0
  94. package/src/lib/matcha-forms/forms.module.ts +19 -0
  95. package/src/lib/matcha-forms/matcha-form-field-appearance.directive.ts +16 -0
  96. package/src/lib/matcha-forms/matcha-form-field-argtype.ts +73 -0
  97. package/src/lib/matcha-forms/matcha-form-field.mdx +284 -0
  98. package/src/lib/matcha-forms/matcha-form-field.stories.ts +345 -0
  99. package/src/lib/matcha-forms/matcha-form-input-text.directive.ts +16 -0
  100. package/src/lib/matcha-icon/icon.module.ts +19 -0
  101. package/src/lib/matcha-icon/matcha-icon-position-pos.directive.ts +15 -0
  102. package/src/lib/matcha-icon/matcha-icon-position-pre.directive.ts +15 -0
  103. package/src/lib/matcha-list/list.module.ts +14 -0
  104. package/src/lib/matcha-list/matcha-list.directive.ts +16 -0
  105. package/src/lib/matcha-menu/matcha-menu.directive.ts +16 -0
  106. package/src/lib/matcha-menu/menu.module.ts +14 -0
  107. package/src/lib/matcha-menu/menu.stories.txt +76 -0
  108. package/src/lib/matcha-paginator/matcha-paginator.directive.ts +16 -0
  109. package/src/lib/matcha-paginator/paginator.module.ts +14 -0
  110. package/src/lib/matcha-progress-bar/progress-bar.argtype.ts +48 -0
  111. package/src/lib/matcha-progress-bar/progress-bar.directive.ts +16 -0
  112. package/src/lib/matcha-progress-bar/progress-bar.mdx +95 -0
  113. package/src/lib/matcha-progress-bar/progress-bar.module.ts +14 -0
  114. package/src/lib/matcha-progress-bar/progress-bar.stories.ts +89 -0
  115. package/src/lib/matcha-progress-spinner/progress-spinner.argtype.ts +65 -0
  116. package/src/lib/matcha-progress-spinner/progress-spinner.directive.ts +16 -0
  117. package/src/lib/matcha-progress-spinner/progress-spinner.mdx +23 -0
  118. package/src/lib/matcha-progress-spinner/progress-spinner.module.ts +14 -0
  119. package/src/lib/matcha-progress-spinner/progress-spinner.stories.ts +44 -0
  120. package/src/lib/matcha-radio-button/matcha-radio-button.argtype.ts +85 -0
  121. package/src/lib/matcha-radio-button/matcha-radio-button.directive.ts +16 -0
  122. package/src/lib/matcha-radio-button/matcha-radio-button.stories.ts +44 -0
  123. package/src/lib/matcha-radio-button/radio-button.module.ts +12 -0
  124. package/src/lib/matcha-select/matcha-select.directive.ts +16 -0
  125. package/src/lib/matcha-select/select.module.ts +12 -0
  126. package/src/lib/matcha-select/select.stories.txt +109 -0
  127. package/src/lib/matcha-slide-toggle/slide-toggle.argtype.ts +66 -0
  128. package/src/lib/matcha-slide-toggle/slide-toggle.directive.ts +16 -0
  129. package/src/lib/matcha-slide-toggle/slide-toggle.mdx +92 -0
  130. package/src/lib/matcha-slide-toggle/slide-toggle.module.ts +12 -0
  131. package/src/lib/matcha-slide-toggle/slide-toggle.stories.ts +167 -0
  132. package/src/lib/matcha-slider/matcha-slider.directive.ts +16 -0
  133. package/src/lib/matcha-slider/slider.module.ts +12 -0
  134. package/src/lib/matcha-snackbar/matcha-snackbar.directive.ts +16 -0
  135. package/src/lib/matcha-snackbar/snackbar.module.ts +12 -0
  136. package/src/lib/matcha-sort-header/matcha-sort-header.directive.ts +16 -0
  137. package/src/lib/matcha-sort-header/sort-header.module.ts +12 -0
  138. package/src/lib/matcha-stepper/matcha-stepper.directive.ts +16 -0
  139. package/src/lib/matcha-stepper/stepper.module.ts +12 -0
  140. package/src/lib/matcha-table/matcha-table.directive.ts +16 -0
  141. package/src/lib/matcha-table/table.module.ts +12 -0
  142. package/src/lib/matcha-tabs/matcha-tabs.directive.ts +17 -0
  143. package/src/lib/matcha-tabs/tabs.module.ts +16 -0
  144. package/src/lib/matcha-tabs/tabs.stories.txt +18 -0
  145. package/src/lib/matcha-title/matcha-title.component.html +33 -0
  146. package/src/lib/matcha-title/matcha-title.component.scss +0 -0
  147. package/src/lib/matcha-title/matcha-title.component.spec.ts +21 -0
  148. package/src/lib/matcha-title/matcha-title.component.ts +24 -0
  149. package/src/lib/matcha-title/matcha-title.module.ts +18 -0
  150. package/src/lib/matcha-tooltip/matcha-tooltip.directive.ts +16 -0
  151. package/src/lib/matcha-tooltip/tooltip.module.ts +12 -0
  152. package/src/lib/matcha-tree/matcha-tree.directive.ts +16 -0
  153. package/src/lib/matcha-tree/tree.module.ts +12 -0
  154. package/src/public-api.ts +93 -0
  155. package/tsconfig.lib.json +18 -0
  156. package/tsconfig.lib.prod.json +10 -0
  157. package/tsconfig.spec.json +14 -0
  158. package/esm2022/lib/matcha-button/matcha-button.component.mjs +0 -12
  159. package/esm2022/lib/matcha-card/matcha-card-content/matcha-card-content.component.mjs +0 -12
  160. package/esm2022/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.mjs +0 -12
  161. package/esm2022/lib/matcha-card/matcha-card-header/matcha-card-header.component.mjs +0 -12
  162. package/esm2022/lib/matcha-card/matcha-card.component.mjs +0 -12
  163. package/esm2022/lib/matcha-card/matcha-card.module.mjs +0 -40
  164. package/esm2022/lib/matcha-components.module.mjs +0 -27
  165. package/esm2022/matcha-components.mjs +0 -5
  166. package/esm2022/public-api.mjs +0 -20
  167. package/fesm2022/matcha-components.mjs +0 -113
  168. package/fesm2022/matcha-components.mjs.map +0 -1
  169. package/index.d.ts +0 -5
  170. package/lib/matcha-button/matcha-button.component.d.ts +0 -5
  171. package/lib/matcha-card/matcha-card-content/matcha-card-content.component.d.ts +0 -5
  172. package/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.d.ts +0 -5
  173. package/lib/matcha-card/matcha-card-header/matcha-card-header.component.d.ts +0 -5
  174. package/lib/matcha-card/matcha-card.component.d.ts +0 -5
  175. package/lib/matcha-card/matcha-card.module.d.ts +0 -11
  176. package/lib/matcha-components.module.d.ts +0 -8
  177. package/public-api.d.ts +0 -7
@@ -0,0 +1,4 @@
1
+ <div class="matcha-card-header d-flex-space-between pb-8">
2
+ <ng-content></ng-content>
3
+ </div>
4
+
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MatchaCardHeaderComponent } from './matcha-card-header.component';
4
+
5
+ describe('MatchaCardHeaderComponent', () => {
6
+ let component: MatchaCardHeaderComponent;
7
+ let fixture: ComponentFixture<MatchaCardHeaderComponent>;
8
+
9
+ beforeEach(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [MatchaCardHeaderComponent]
12
+ });
13
+ fixture = TestBed.createComponent(MatchaCardHeaderComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,10 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'matcha-card-header',
5
+ templateUrl: './matcha-card-header.component.html',
6
+ styleUrls: ['./matcha-card-header.component.scss']
7
+ })
8
+ export class MatchaCardHeaderComponent {
9
+
10
+ }
@@ -0,0 +1,3 @@
1
+ <div [class]="classes">
2
+ <ng-content></ng-content>
3
+ </div>
@@ -0,0 +1,117 @@
1
+ // -----------------------------------------------------------------------------------------------------
2
+ // @ Cards
3
+ // -----------------------------------------------------------------------------------------------------
4
+ .matcha-card,
5
+ .matcha-card-raised,
6
+ .matcha-card-flat {
7
+ padding: 16px;
8
+ border-radius: 8px;
9
+
10
+ &-border,
11
+ &.matcha-card-border,
12
+ &-border-left,
13
+ &.matcha-card-border-left {
14
+ border-left: 8px solid;
15
+ }
16
+
17
+ &-border-right,
18
+ &.matcha-card-border-right {
19
+ border-right: 8px solid;
20
+ }
21
+
22
+ &.disabled {
23
+ transition: opacity 100ms linear;
24
+ opacity: 0.5;
25
+ pointer-events: none;
26
+ }
27
+
28
+ &.enabled {
29
+ transition: opacity 100ms linear;
30
+ opacity: 1;
31
+ }
32
+
33
+ &.variable-width {
34
+ min-width: 0;
35
+ }
36
+
37
+ &.auto-width {
38
+ min-width: 0;
39
+ max-width: none;
40
+ }
41
+
42
+ &.fixed-width {
43
+ min-width: 264px;
44
+ max-width: 264px;
45
+ width: 264px;
46
+ }
47
+
48
+ // Buttons
49
+ .mat-button {
50
+ min-width: 0 !important;
51
+ padding: 0 8px !important;
52
+ }
53
+
54
+ // Button Toggle Group
55
+ .mat-button-toggle-group,
56
+ .mat-button-toggle-standalone {
57
+ box-shadow: none !important;
58
+ }
59
+
60
+ .mat-tab-label {
61
+ min-width: 0 !important;
62
+ }
63
+
64
+ // Divider
65
+ .card-divider {
66
+ margin: 16px;
67
+
68
+ &.full-width {
69
+ margin: 0;
70
+ }
71
+ }
72
+
73
+ // Expand Area
74
+ .card-expand-area {
75
+ overflow: hidden;
76
+
77
+ .card-expanded-content {
78
+ padding: 8px 16px 16px 16px;
79
+ line-height: 1.75;
80
+ }
81
+ }
82
+
83
+ .title {
84
+ line-height: 24px;
85
+ margin: 0 0 16px 0;
86
+ display: flex;
87
+ align-items: center;
88
+
89
+ .title-bullet {
90
+ height: 100%;
91
+ width: 8px;
92
+ margin: 0px 8px 0 0;
93
+ display: inline-block;
94
+ position: relative;
95
+ border-radius: 10px;
96
+ }
97
+
98
+ .title-content {
99
+ line-height: 20px;
100
+ display: -webkit-box;
101
+ -webkit-line-clamp: 2;
102
+ overflow: hidden;
103
+ text-overflow: ellipsis;
104
+ word-break: break-word;
105
+ white-space: initial;
106
+ -webkit-box-orient: vertical;
107
+ text-transform: capitalize;
108
+ }
109
+ }
110
+
111
+ .title-sm {
112
+ display: block;
113
+ overflow: hidden;
114
+ text-overflow: ellipsis;
115
+ white-space: nowrap;
116
+ }
117
+ }
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MatchaCardComponent } from './matcha-card.component';
4
+
5
+ describe('MatchaCardComponent', () => {
6
+ let component: MatchaCardComponent;
7
+ let fixture: ComponentFixture<MatchaCardComponent>;
8
+
9
+ beforeEach(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [MatchaCardComponent]
12
+ });
13
+ fixture = TestBed.createComponent(MatchaCardComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,43 @@
1
+ import { Component, Input } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'matcha-card',
5
+ templateUrl: './matcha-card.component.html',
6
+ styleUrls: ['./matcha-card.component.scss']
7
+ })
8
+
9
+ export class MatchaCardComponent {
10
+
11
+ // border-color-bg
12
+ // background-bg
13
+ // fill-bg
14
+ // stroke-bg
15
+
16
+ @Input()
17
+ elevation: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23' | '24' = '0';
18
+
19
+ @Input()
20
+ blockquote: 'left' | 'right' | 'none' = 'none';
21
+
22
+ @Input()
23
+ blockquoteColor: 'bg' | 'fg' | 'accent' | 'primary' | 'warn' | 'red' | 'pink' | 'purple' | 'deep-purple' | 'indigo' | 'blue' | 'light-blue' | 'cyan' | 'teal' | 'green' | 'light-green' | 'lime' | 'yellow' | 'amber' | 'orange' | 'deep-orange' = 'fg';
24
+
25
+ @Input()
26
+ backgroundColor: 'bg' | 'fg' | 'surface' | 'accent' | 'primary' | 'warn' | 'red' | 'pink' | 'purple' | 'deep-purple' | 'indigo' | 'blue' | 'light-blue' | 'cyan' | 'teal' | 'green' | 'light-green' | 'lime' | 'yellow' | 'amber' | 'orange' | 'deep-orange' = 'surface';
27
+
28
+ @Input()
29
+ alpha: boolean = false;
30
+
31
+ @Input()
32
+ loading: boolean = false;
33
+
34
+ public get classes(): string {
35
+ const backgroundColor = this.backgroundColor ? `background-${this.backgroundColor}` : '';
36
+ const blockquoteColor = this.blockquoteColor ? `border-color-${this.blockquoteColor}` : '';
37
+ const elevation = `elevation-z-${this.elevation}`;
38
+ const blockquoteLeft = this.blockquote === 'left' ? `matcha-card-border-${this.blockquote}` : '';
39
+ const blockquoteRight = this.blockquote === 'right' ? `matcha-card-border-${this.blockquote}` : '';
40
+ const activeClasses = `matcha-card ${elevation} ${blockquoteLeft} ${blockquoteRight} ${blockquoteColor} ${backgroundColor}${this.alpha ? '-alpha' : ''} ${this.loading ? 'loading' : ''}`;
41
+ return activeClasses;
42
+ }
43
+ }
@@ -0,0 +1,27 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaCardHeaderComponent } from './matcha-card-header/matcha-card-header.component';
4
+ import { MatchaCardContentComponent } from './matcha-card-content/matcha-card-content.component';
5
+ import { MatchaCardFooterComponent } from './matcha-card-footer/matcha-card-footer.component';
6
+ import { MatchaCardComponent } from './matcha-card.component';
7
+
8
+
9
+
10
+ @NgModule({
11
+ declarations: [
12
+ MatchaCardHeaderComponent,
13
+ MatchaCardContentComponent,
14
+ MatchaCardFooterComponent,
15
+ MatchaCardComponent
16
+ ],
17
+ imports: [
18
+ CommonModule,
19
+ ],
20
+ exports:[
21
+ MatchaCardHeaderComponent,
22
+ MatchaCardContentComponent,
23
+ MatchaCardFooterComponent,
24
+ MatchaCardComponent
25
+ ]
26
+ })
27
+ export class MatchaCardModule { }
@@ -0,0 +1,80 @@
1
+ import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
2
+ import { MatchaCardModule } from './matcha-card.module';
3
+ import { matchaCardArgtypes } from './matcha-card-argtype';
4
+
5
+ /** Este é o card principal */
6
+ export default {
7
+ title: 'Atoms/Card',
8
+ decorators: [
9
+ moduleMetadata({
10
+ imports: [MatchaCardModule],
11
+ }),
12
+ ],
13
+ tags: ['autodocs'],
14
+
15
+ args: {
16
+ elevation: '1',
17
+ blockquote: 'left',
18
+ blockquoteColor: 'foreground',
19
+ backgroundColor: 'surface',
20
+ label: 'O mais incrível é que funciona.',
21
+ },
22
+ argTypes: matchaCardArgtypes,
23
+ parameters: {
24
+ docs:{
25
+ // canvas: { sourceState: 'shown' },
26
+ source: { type: 'code' },
27
+ },
28
+ controls: {
29
+ expanded: true,
30
+ exclude: ['mode'],
31
+ },
32
+ componentSubtitle: 'Displays an image that represents a user or organization',
33
+ },
34
+ } as Meta;
35
+
36
+ /** Este é o card principal */
37
+ export const WithBasicUsage: StoryObj = {
38
+ render: (args) => ({
39
+ props: {
40
+ ...args,
41
+ },
42
+ template: `
43
+ <matcha-card [blockquoteColor]="blockquoteColor" [elevation]="elevation" [blockquote]="blockquote" [backgroundColor]="backgroundColor" [alpha]="alpha">{{ label }}</matcha-card>
44
+ `,
45
+ }),
46
+ name: 'Matcha Card - Flat',
47
+ };
48
+
49
+ export const WithBlockquoteUsage: StoryObj = {
50
+ render: () => ({
51
+ props: {
52
+ elevation: '10',
53
+ blockquote: 'left',
54
+ blockquoteColor: 'foreground',
55
+ backgroundColor: 'surface',
56
+ label: 'O mais incrível é que funciona.',
57
+ },
58
+ template: `
59
+ <matcha-card blockquoteColor="foreground" elevation="1" blockquote="left" backgroundColor="surface"> Seu conteúdo vai aqui </matcha-card>
60
+ `,
61
+ inlineStory: true,
62
+ }),
63
+ name: 'Card - Blockquote Left',
64
+ };
65
+
66
+ export const WithColoredUsage: StoryObj = {
67
+ render: (args) => ({
68
+ props: {
69
+ ...args,
70
+ elevation: '1',
71
+ blockquote: 'left',
72
+ blockquoteColor: 'yellow',
73
+ backgroundColor: 'yellow',
74
+ },
75
+ template: `
76
+ <matcha-card [blockquoteColor]="blockquoteColor" [elevation]="elevation" [blockquote]="blockquote" [backgroundColor]="backgroundColor">{{ label }}</matcha-card>
77
+ `,
78
+ }),
79
+ name: 'matcha-card - Raised',
80
+ };
@@ -0,0 +1,79 @@
1
+ export const checkboxArgtypes = {
2
+ disabled: {
3
+ description: 'Whether the checkbox is disabled',
4
+ control: 'boolean',
5
+ defaultValue: true,
6
+ table: {
7
+ defaultValue: { summary: true },
8
+ },
9
+ },
10
+ checked: {
11
+ description: 'Whether the checkbox is checked',
12
+ control: 'boolean',
13
+ defaultValue: true,
14
+ table: {
15
+ defaultValue: { summary: true },
16
+ },
17
+ },
18
+ required: {
19
+ description: 'Whether the checkbox is required',
20
+ control: 'boolean',
21
+ defaultValue: true,
22
+ table: {
23
+ defaultValue: { summary: true },
24
+ },
25
+ },
26
+ indeterminate: {
27
+ description: 'Whether the checkbox is indeterminate',
28
+ control: 'boolean',
29
+ defaultValue: true,
30
+ table: {
31
+ defaultValue: { summary: true },
32
+ },
33
+ },
34
+ disableRipple: {
35
+ description: 'Whether the checkbox is disableRipple',
36
+ control: 'boolean',
37
+ defaultValue: true,
38
+ table: {
39
+ defaultValue: { summary: true },
40
+ },
41
+ },
42
+ color: {
43
+ description: 'Theme color palette',
44
+ control: 'select',
45
+ defaultValue: 'accent',
46
+ table: {
47
+ defaultValue: { summary: 'accent' },
48
+ },
49
+ options: ['primary', 'accent', 'warn'],
50
+ },
51
+ labelPosition: {
52
+ description: 'Theme color palette',
53
+ control: 'select',
54
+ defaultValue: 'after',
55
+ table: {
56
+ defaultValue: { summary: 'after' },
57
+ },
58
+ options: ['before', 'after'],
59
+ },
60
+ value: {
61
+ description: 'Value of the checkbox',
62
+ defaultValue: 'Option Selected',
63
+ table: {
64
+ defaultValue: { summary: 'Option Selected' },
65
+ },
66
+ control: 'text',
67
+ },
68
+ change: {
69
+ action: 'change',
70
+ },
71
+ label: {
72
+ description: 'Value of the checkbox',
73
+ defaultValue: 'Check-me',
74
+ table: {
75
+ defaultValue: { summary: 'Check-me' },
76
+ },
77
+ control: 'text',
78
+ },
79
+ };
@@ -0,0 +1,14 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[matcha-checkbox]',
5
+ })
6
+ export class MatchaCheckboxDirective {
7
+ constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {
8
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
9
+ this._renderer.addClass(
10
+ this._elementRef.nativeElement,
11
+ 'matcha-checkbox'
12
+ );
13
+ }
14
+ }
@@ -0,0 +1,76 @@
1
+ import { Story } from "@storybook/blocks";
2
+ import { Meta } from "@storybook/addon-docs";
3
+ import * as ComponentStories from "./checkbox.stories";
4
+
5
+ <Meta title="Atoms / Checkbox / Documentação" />
6
+
7
+ # Checkbox
8
+
9
+ > _checkbox_ é um componente atômico usado para permitir que os usuários selecionem várias opções independentes, ou seja, podem marcar ou desmarcar várias caixas de seleção ao mesmo tempo.
10
+
11
+ ---
12
+
13
+ ### Modes
14
+ <div class="d-flex-column gap-16">
15
+ <div class="d-flex-column">
16
+ <div class="matcha-card background-surface d-flex-column gap-16">
17
+ <span class="h5">Checkbox - Colors</span>
18
+ <div class="matcha-card background-bg">
19
+ <Story of={ComponentStories.CheckboxColors} />
20
+ </div>
21
+ <div class="d-flex-column">
22
+ ```html
23
+ <mat-checkbox checked="true" color="primary">primary</mat-checkbox>
24
+ <mat-checkbox checked="true" color="accent">accent</mat-checkbox>
25
+ <mat-checkbox checked="true" color="warn">warn</mat-checkbox>
26
+ ```
27
+ </div>
28
+ </div>
29
+ </div>
30
+
31
+ <div class="grid-md-2 gap-16">
32
+ <div class="matcha-card background-surface d-flex-column gap-16">
33
+ <span class="h5">Checkbox - Label Position</span>
34
+ <div class="matcha-card background-bg">
35
+ <Story of={ComponentStories.CheckboxLabelPosition} />
36
+ </div>
37
+ <div class="d-flex-column">
38
+ ```html
39
+ <mat-checkbox checked='true' labelPosition="before">
40
+ Check me
41
+ </mat-checkbox>
42
+ <mat-checkbox checked='true' labelPosition="after">
43
+ Check me
44
+ </mat-checkbox>
45
+ ```
46
+ </div>
47
+ </div>
48
+
49
+ <div class="matcha-card background-surface d-flex-column gap-16">
50
+ <span class="h5">Checkbox - Disabled</span>
51
+ <div class="matcha-card background-bg">
52
+ <Story of={ComponentStories.CheckboxDisabled} />
53
+ </div>
54
+ <div class="d-flex-column">
55
+ ```html
56
+ <mat-checkbox disabled='false' checked='true'>
57
+ Check me
58
+ </mat-checkbox>
59
+ <mat-checkbox disabled='false' checked='false'>
60
+ Check me
61
+ </mat-checkbox>
62
+ ```
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+
68
+ <br />
69
+
70
+ ### Installation
71
+
72
+ `import {MatCheckboxModule} from '@angular/material/checkbox';`
73
+
74
+ [Official documentation](https://material.angular.io/components/checkbox/overview)
75
+
76
+ <br />
@@ -0,0 +1,9 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { MatchaCheckboxDirective } from './checkbox.directive';
3
+
4
+ @NgModule({
5
+ declarations: [MatchaCheckboxDirective],
6
+ imports: [],
7
+ exports: [MatchaCheckboxDirective],
8
+ })
9
+ export class MatchaCheckboxModule {}
@@ -0,0 +1,161 @@
1
+ import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
2
+
3
+ import { MatCheckboxModule } from '@angular/material/checkbox';
4
+ import { action } from '@storybook/addon-actions';
5
+ import { checkboxArgtypes } from './checkbox.argtype';
6
+ import { MatchaCheckboxDirective } from './checkbox.directive';
7
+
8
+ import { config } from '@storybook/addon-designs';
9
+
10
+ export default {
11
+ title: 'Atoms / Checkbox',
12
+ decorators: [
13
+ moduleMetadata({
14
+ imports: [MatCheckboxModule],
15
+ declarations: [MatchaCheckboxDirective],
16
+ }),
17
+ ],
18
+ args: {
19
+ disabled: false,
20
+ label: 'Check me',
21
+ change: action('change'),
22
+ checked: true,
23
+ required: false,
24
+ indeterminate: false,
25
+ disableRipple: false,
26
+ color: 'accent',
27
+ labelPosition: 'after',
28
+ value: 'Option Selected',
29
+ },
30
+ argTypes: checkboxArgtypes,
31
+ parameters: {
32
+ controls: {
33
+ expanded: false,
34
+ },
35
+ design: config({
36
+ type: 'figma',
37
+ url: 'https://www.figma.com/file/Enji6Zk0UvtHyt8fdOPdBx/DS-PAINEL-(Copy)?type=design&mode=design&t=IKqH3YB1sj5qgDHJ-1',
38
+ }),
39
+ },
40
+ } as Meta;
41
+
42
+ export const CheckboxDefault: StoryObj = {
43
+ render: (args) => ({
44
+ props: args,
45
+ template: `
46
+ <div class="d-flex gap-16">
47
+ <mat-checkbox matcha-checkbox [disabled]="disabled" [checked]='checked' [color]="color" [labelPosition]="labelPosition" [value]="label" (change)="change($event)">
48
+ {{label}}
49
+ </mat-checkbox>
50
+ </div>
51
+ `,
52
+ }),
53
+ name: 'Checkbox Default',
54
+ };
55
+
56
+ export const CheckboxColors: StoryObj = {
57
+ render: (args) => ({
58
+ props: args,
59
+ template: `
60
+ <div class="d-flex gap-16">
61
+ <mat-checkbox matcha-checkbox [checked]='checked' color="primary" [labelPosition]="labelPosition" [disabled]="disabled" [value]="value" (change)="change($event)">
62
+ Primary
63
+ </mat-checkbox>
64
+
65
+ <mat-checkbox matcha-checkbox [checked]='checked' color="accent" [labelPosition]="labelPosition" [disabled]="disabled" [value]="value" (change)="change($event)">
66
+ Accent
67
+ </mat-checkbox>
68
+
69
+ <mat-checkbox matcha-checkbox [checked]='checked' color="warn" [labelPosition]="labelPosition" [disabled]="disabled" [value]="value" (change)="change($event)">
70
+ Warn
71
+ </mat-checkbox>
72
+ </div>
73
+ `,
74
+ }),
75
+ parameters: {
76
+ controls: {
77
+ exclude: [
78
+ 'color',
79
+ 'indeterminate',
80
+ 'required',
81
+ 'disableRipple',
82
+ 'label',
83
+ ],
84
+ },
85
+ },
86
+ name: 'Checkbox Colors',
87
+ };
88
+
89
+ export const CheckboxDisabled: StoryObj = {
90
+ render: (args) => ({
91
+ props: args,
92
+ template: `
93
+ <div class="d-flex gap-16">
94
+ <mat-checkbox matcha-checkbox disabled="disabled" checked='true'>
95
+ {{label}}
96
+ </mat-checkbox>
97
+
98
+ <div class="d-flex-center-center">
99
+ <div class="border-color-disabled br-2 h-24"></div>
100
+ </div>
101
+
102
+ <mat-checkbox matcha-checkbox disabled="disabled" checked='false'>
103
+ {{label}}
104
+ </mat-checkbox>
105
+ </div>
106
+ `,
107
+ }),
108
+ parameters: {
109
+ controls: {
110
+ exclude: [
111
+ 'change',
112
+ 'color',
113
+ 'labelPosition',
114
+ 'checked',
115
+ 'disabled',
116
+ 'indeterminate',
117
+ 'required',
118
+ 'disableRipple',
119
+ 'value',
120
+ ],
121
+ },
122
+ },
123
+ name: 'Checkbox Disabled',
124
+ };
125
+
126
+ export const CheckboxLabelPosition: StoryObj = {
127
+ render: (args) => ({
128
+ props: args,
129
+ template: `
130
+ <div class="d-flex gap-16">
131
+ <mat-checkbox matcha-checkbox checked='true' labelPosition="before">
132
+ {{label}}
133
+ </mat-checkbox>
134
+
135
+ <div class="d-flex-center-center">
136
+ <div class="border-color-disabled br-2 h-24"></div>
137
+ </div>
138
+
139
+ <mat-checkbox matcha-checkbox checked='true' labelPosition="after">
140
+ {{label}}
141
+ </mat-checkbox>
142
+ </div>
143
+ `,
144
+ }),
145
+ parameters: {
146
+ controls: {
147
+ exclude: [
148
+ 'change',
149
+ 'color',
150
+ 'labelPosition',
151
+ 'checked',
152
+ 'disabled',
153
+ 'indeterminate',
154
+ 'required',
155
+ 'disableRipple',
156
+ 'value',
157
+ ],
158
+ },
159
+ },
160
+ name: 'Checkbox Label Position',
161
+ };