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,66 @@
1
+ export const slideToggleArgtypes = {
2
+ checked: {
3
+ description: 'Whether the slide toggle is checked',
4
+ control: 'boolean',
5
+ defaultValue: true,
6
+ table: {
7
+ defaultValue: { summary: true },
8
+ },
9
+ },
10
+ color: {
11
+ description: 'Theme color palette',
12
+ control: 'select',
13
+ defaultValue: 'accent',
14
+ table: {
15
+ defaultValue: { summary: 'accent' },
16
+ },
17
+ options: ['primary', 'accent', 'warn'],
18
+ },
19
+ disableRipple: {
20
+ description: 'Whether the slide toggle is disableRipple',
21
+ control: 'boolean',
22
+ defaultValue: true,
23
+ table: {
24
+ defaultValue: { summary: true },
25
+ },
26
+ },
27
+ disabled: {
28
+ description: 'Whether the slide toggle is disabled',
29
+ control: 'boolean',
30
+ defaultValue: true,
31
+ table: {
32
+ defaultValue: { summary: true },
33
+ },
34
+ },
35
+ hideIcon: {
36
+ description: 'Whether the slide toggle is disabled',
37
+ control: 'boolean',
38
+ defaultValue: true,
39
+ table: {
40
+ defaultValue: { summary: true },
41
+ },
42
+ },
43
+ labelPosition: {
44
+ description: 'Theme color palette',
45
+ control: 'select',
46
+ defaultValue: 'after',
47
+ table: {
48
+ defaultValue: { summary: 'after' },
49
+ },
50
+ options: ['before', 'after'],
51
+ },
52
+ label: {
53
+ description: 'Value of the slide toggle',
54
+ defaultValue: 'Slide me',
55
+ table: {
56
+ defaultValue: { summary: 'Slide me' },
57
+ },
58
+ control: 'text',
59
+ },
60
+ onChange: {
61
+ action: 'change',
62
+ },
63
+ toggleChange: {
64
+ action: 'toggleChange',
65
+ },
66
+ };
@@ -0,0 +1,16 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[slide-toggle]'
5
+ })
6
+ export class MatchaSlideToggleDirective {
7
+
8
+ constructor(
9
+ private _elementRef: ElementRef,
10
+ private _renderer: Renderer2
11
+ ) {
12
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
13
+ this._renderer.addClass(this._elementRef.nativeElement, 'matcha-slide-toggle')
14
+ }
15
+
16
+ }
@@ -0,0 +1,92 @@
1
+ import { Story } from "@storybook/blocks";
2
+ import { Meta } from "@storybook/addon-docs";
3
+ import * as ComponentStories from "./slide-toggle.stories";
4
+
5
+ <Meta title="Atoms / Slide Toggle / Documentação" />
6
+
7
+ # Slide Toggle
8
+
9
+ > _mat-slide-toggle_ is an on/off control that can be toggled via clicking.
10
+
11
+ ---
12
+
13
+ ### Modes
14
+
15
+ <div class="d-flex-column gap-16">
16
+ <div class="d-flex-column">
17
+ <div class="matcha-card background-surface d-flex-column gap-16">
18
+ <span class="h5">SlideToggle - Colors</span>
19
+ <div class="matcha-card background-bg">
20
+ <Story of={ComponentStories.SlideToggleColors} />
21
+ </div>
22
+ <div class="d-flex-column">
23
+ ```html
24
+ <mat-slide-toggle matcha-slide-toggle checked="true" color="primary">primary</mat-slide-toggle>
25
+ <mat-slide-toggle matcha-slide-toggle checked="true" color="accent">accent</mat-slide-toggle>
26
+ <mat-slide-toggle matcha-slide-toggle checked="true" color="warn">warn</mat-slide-toggle>
27
+ ```
28
+ </div>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="grid-md-2 gap-16">
33
+ <div class="matcha-card background-surface d-flex-column gap-16">
34
+ <span class="h5">SlideToggle - Label Position</span>
35
+ <div class="matcha-card background-bg">
36
+ <Story of={ComponentStories.SlideToggleLabelPosition} />
37
+ </div>
38
+ <div class="d-flex-column">
39
+ ```html
40
+ <mat-slide-toggle
41
+ matcha-slide-toggle
42
+ checked='true'
43
+ labelPosition="before">
44
+ Slide-me
45
+ </mat-slide-toggle>
46
+
47
+ <mat-slide-toggle
48
+ matcha-slide-toggle
49
+ checked='true'
50
+ labelPosition="after">
51
+ Slide-me
52
+ </mat-slide-toggle>
53
+ ```
54
+ </div>
55
+ </div>
56
+
57
+ <div class="matcha-card background-surface d-flex-column gap-16">
58
+ <span class="h5">SlideToggle - Disabled</span>
59
+ <div class="matcha-card background-bg">
60
+ <Story of={ComponentStories.SlideToggleDisabled} />
61
+ </div>
62
+ <div class="d-flex-column">
63
+ ```html
64
+ <mat-slide-toggle
65
+ matcha-slide-toggle
66
+ checked='true'
67
+ disabled='true'>
68
+ Slide-me
69
+ </mat-slide-toggle>
70
+
71
+ <mat-slide-toggle
72
+ matcha-slide-toggle
73
+ checked='false'
74
+ disabled="true">
75
+ Slide-me
76
+ </mat-slide-toggle>
77
+ ```
78
+ </div>
79
+ </div>
80
+ </div>
81
+
82
+ </div>
83
+
84
+ <br />
85
+
86
+ ### Installation
87
+
88
+ `import {MatSlideToggleModule} from '@angular/material/slide-toggle';`
89
+
90
+ [Official documentation](https://material.angular.io/components/slide-toggle/overview)
91
+
92
+ <br />
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaSlideToggleDirective } from './slide-toggle.directive';
4
+
5
+ @NgModule({
6
+ declarations: [MatchaSlideToggleDirective],
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ exports:[MatchaSlideToggleDirective]
11
+ })
12
+ export class MatchaSlideToggleModule { }
@@ -0,0 +1,167 @@
1
+ import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
2
+ import { action } from '@storybook/addon-actions';
3
+ import { config } from '@storybook/addon-designs';
4
+
5
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
6
+ import { slideToggleArgtypes } from './slide-toggle.argtype';
7
+ import { MatchaSlideToggleDirective } from './slide-toggle.directive';
8
+
9
+ export default {
10
+ title: 'Atoms / Slide Toggle',
11
+ decorators: [
12
+ moduleMetadata({
13
+ imports: [MatSlideToggleModule],
14
+ declarations: [MatchaSlideToggleDirective],
15
+ }),
16
+ ],
17
+ args: {
18
+ checked: true,
19
+ color: 'accent',
20
+ disableRipple: false,
21
+ disabled: false,
22
+ hideIcon: false,
23
+ labelPosition: 'after',
24
+ label: 'Slide me',
25
+ onChange: action('change'),
26
+ toggleChange: action('toggleChange'),
27
+ },
28
+ argTypes: slideToggleArgtypes,
29
+ parameters: {
30
+ controls: {
31
+ expanded: false,
32
+ },
33
+ design: config({
34
+ type: 'figma',
35
+ url: 'https://www.figma.com/file/Enji6Zk0UvtHyt8fdOPdBx/DS-PAINEL-(Copy)?type=design&mode=design&t=IKqH3YB1sj5qgDHJ-1',
36
+ }),
37
+ },
38
+ } as Meta;
39
+
40
+ export const SlideToggleDefault: StoryObj = {
41
+ render: (args) => ({
42
+ props: args,
43
+ template: `
44
+ <div class="d-flex gap-16">
45
+ <mat-slide-toggle
46
+ matcha-slide-toggle
47
+ [color]="color"
48
+ [checked]="checked"
49
+ [disabled]="disabled"
50
+ [hideIcon]="hideIcon"
51
+ [labelPosition]="labelPosition"
52
+ (change)="onChange($event)"
53
+ (toggleChange)="toggleChange('data', this.$event)">
54
+ {{label}}
55
+ </mat-slide-toggle>
56
+ </div>
57
+ `,
58
+ }),
59
+ name: 'SlideToggle Default',
60
+ };
61
+
62
+ export const SlideToggleColors: StoryObj = {
63
+ render: (args) => ({
64
+ props: args,
65
+ template: `
66
+ <div class="d-flex gap-16">
67
+ <mat-slide-toggle matcha-slide-toggle (change)="onChange($event)" (toggleChange)="toggleChange('Primary', this.$event)" [checked]='checked' color="primary" [labelPosition]="labelPosition" [disabled]="disabled" [hideIcon]="hideIcon">
68
+ Primary
69
+ </mat-slide-toggle>
70
+
71
+ <mat-slide-toggle matcha-slide-toggle (change)="onChange($event)" (toggleChange)="toggleChange('Accent', this.$event)" [checked]='checked' color="accent" [labelPosition]="labelPosition" [disabled]="disabled" [hideIcon]="hideIcon">
72
+ Accent
73
+ </mat-slide-toggle>
74
+
75
+ <mat-slide-toggle matcha-slide-toggle (change)="onChange($event)" (toggleChange)="toggleChange('Warn', this.$event)" [checked]='checked' color="warn" [labelPosition]="labelPosition" [disabled]="disabled" [hideIcon]="hideIcon">
76
+ Warn
77
+ </mat-slide-toggle>
78
+ </div>
79
+ `,
80
+ }),
81
+ parameters: {
82
+ controls: {
83
+ exclude: [
84
+ 'color',
85
+ 'indeterminate',
86
+ 'required',
87
+ 'disableRipple',
88
+ 'label',
89
+ ],
90
+ },
91
+ },
92
+ name: 'SlideToggle Colors',
93
+ };
94
+
95
+ export const SlideToggleDisabled: StoryObj = {
96
+ render: (args) => ({
97
+ props: args,
98
+ template: `
99
+ <div class="d-flex gap-16">
100
+ <mat-slide-toggle matcha-slide-toggle checked='true' disabled="true" [hideIcon]="hideIcon">
101
+ {{label}}
102
+ </mat-slide-toggle>
103
+
104
+ <div class="d-flex-center-center">
105
+ <div class="border-color-disabled br-2 h-24"></div>
106
+ </div>
107
+
108
+ <mat-slide-toggle matcha-slide-toggle checked='false' disabled="true" [hideIcon]="hideIcon">
109
+ {{label}}
110
+ </mat-slide-toggle>
111
+ </div>
112
+ `,
113
+ }),
114
+ parameters: {
115
+ controls: {
116
+ exclude: [
117
+ 'toggleChange',
118
+ 'color',
119
+ 'labelPosition',
120
+ 'onChange',
121
+ 'checked',
122
+ 'disabled',
123
+ 'indeterminate',
124
+ 'required',
125
+ 'disableRipple',
126
+ ],
127
+ },
128
+ },
129
+ name: 'SlideToggle Disabled',
130
+ };
131
+
132
+ export const SlideToggleLabelPosition: StoryObj = {
133
+ render: (args) => ({
134
+ props: args,
135
+ template: `
136
+ <div class="d-flex gap-16">
137
+ <mat-slide-toggle matcha-slide-toggle checked="true" labelPosition="before" (change)="onChange($event)" (toggleChange)="toggleChange('data', this.$event)">
138
+ Label before
139
+ </mat-slide-toggle>
140
+
141
+ <div class="d-flex-center-center">
142
+ <div class="border-color-disabled br-2 h-24"></div>
143
+ </div>
144
+
145
+ <mat-slide-toggle matcha-slide-toggle checked="true" labelPosition="after" (change)="onChange($event)" (toggleChange)="toggleChange('data', this.$event)">
146
+ Label after
147
+ </mat-slide-toggle>
148
+ </div>
149
+ `,
150
+ }),
151
+ parameters: {
152
+ controls: {
153
+ exclude: [
154
+ 'color',
155
+ 'labelPosition',
156
+ 'checked',
157
+ 'disabled',
158
+ 'indeterminate',
159
+ 'required',
160
+ 'disableRipple',
161
+ 'hideIcon',
162
+ 'label',
163
+ ],
164
+ },
165
+ },
166
+ name: 'SlideToggle Label Position',
167
+ };
@@ -0,0 +1,16 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[matchaSlider]'
5
+ })
6
+ export class MatchaSliderDirective {
7
+
8
+ constructor(
9
+ private _elementRef: ElementRef,
10
+ private _renderer: Renderer2
11
+ ) {
12
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
13
+ this._renderer.addClass(this._elementRef.nativeElement, 'matcha-slider')
14
+ }
15
+
16
+ }
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaSliderDirective } from './matcha-slider.directive';
4
+
5
+ @NgModule({
6
+ declarations: [MatchaSliderDirective],
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ exports:[MatchaSliderDirective]
11
+ })
12
+ export class MatchaSliderModule { }
@@ -0,0 +1,16 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[matchaSnackbar]'
5
+ })
6
+ export class MatchaSnackbarDirective {
7
+
8
+ constructor(
9
+ private _elementRef: ElementRef,
10
+ private _renderer: Renderer2
11
+ ) {
12
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
13
+ this._renderer.addClass(this._elementRef.nativeElement, 'matcha-snackbar')
14
+ }
15
+
16
+ }
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaSnackbarDirective } from './matcha-snackbar.directive';
4
+
5
+ @NgModule({
6
+ declarations: [MatchaSnackbarDirective],
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ exports:[MatchaSnackbarDirective]
11
+ })
12
+ export class MatchaSnackbarModule { }
@@ -0,0 +1,16 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[matchaSortHeader]'
5
+ })
6
+ export class MatchaSortHeaderDirective {
7
+
8
+ constructor(
9
+ private _elementRef: ElementRef,
10
+ private _renderer: Renderer2
11
+ ) {
12
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
13
+ this._renderer.addClass(this._elementRef.nativeElement, 'matcha-sort-header')
14
+ }
15
+
16
+ }
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaSortHeaderDirective } from './matcha-sort-header.directive';
4
+
5
+ @NgModule({
6
+ declarations: [MatchaSortHeaderDirective],
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ exports:[MatchaSortHeaderDirective]
11
+ })
12
+ export class MatchaSortHeaderModule { }
@@ -0,0 +1,16 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[matchaStepper]'
5
+ })
6
+ export class MatchaStepperDirective {
7
+
8
+ constructor(
9
+ private _elementRef: ElementRef,
10
+ private _renderer: Renderer2
11
+ ) {
12
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
13
+ this._renderer.addClass(this._elementRef.nativeElement, 'matcha-stepper')
14
+ }
15
+
16
+ }
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaStepperDirective } from './matcha-stepper.directive';
4
+
5
+ @NgModule({
6
+ declarations: [MatchaStepperDirective],
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ exports:[MatchaStepperDirective]
11
+ })
12
+ export class MatchaStepperModule { }
@@ -0,0 +1,16 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[matchaTable]'
5
+ })
6
+ export class MatchaTableDirective {
7
+
8
+ constructor(
9
+ private _elementRef: ElementRef,
10
+ private _renderer: Renderer2
11
+ ) {
12
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
13
+ this._renderer.addClass(this._elementRef.nativeElement, 'matcha-table')
14
+ }
15
+
16
+ }
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaTableDirective } from './matcha-table.directive';
4
+
5
+ @NgModule({
6
+ declarations: [MatchaTableDirective],
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ exports:[MatchaTableDirective]
11
+ })
12
+ export class MatchaTableModule { }
@@ -0,0 +1,17 @@
1
+ import { Directive, ElementRef, Renderer2 } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: '[matchaTabs]'
5
+ })
6
+ export class MatchaTabsDirective {
7
+
8
+ constructor(
9
+ private _elementRef: ElementRef,
10
+ private _renderer: Renderer2
11
+ ) {
12
+ //this._elementRef.nativeElement.style.backgroundColor = 'grey';
13
+ this._renderer.addClass(this._elementRef.nativeElement, 'matcha-tabs')
14
+ }
15
+
16
+
17
+ }
@@ -0,0 +1,16 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaTabsDirective } from './matcha-tabs.directive';
4
+
5
+ @NgModule({
6
+ declarations: [
7
+ MatchaTabsDirective
8
+ ],
9
+ imports: [
10
+ CommonModule
11
+ ],
12
+ exports: [
13
+ MatchaTabsDirective
14
+ ]
15
+ })
16
+ export class MatchaTabsModule { }
@@ -0,0 +1,18 @@
1
+ import {storiesOf} from '@storybook/angular';
2
+ import {MatTabsModule} from '@angular/material/tabs';
3
+ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
4
+
5
+ storiesOf('Tabs', module)
6
+ .add('Basic', () => ({
7
+ template: `
8
+ <div>
9
+ <mat-tab-group>
10
+ <mat-tab label="Tab 1">Content 1</mat-tab>
11
+ <mat-tab label="Tab 2">Content 2</mat-tab>
12
+ </mat-tab-group>
13
+ </div>
14
+ `,
15
+ moduleMetadata: {
16
+ imports: [BrowserAnimationsModule, MatTabsModule]
17
+ }
18
+ }));
@@ -0,0 +1,33 @@
1
+ <ng-container [ngSwitch]="level">
2
+
3
+ <h1 class="title" *ngSwitchCase="1">
4
+ <span class="title-bullet h-32 w-8" [ngClass]="bulletColor" *ngIf="bulletColor"></span>
5
+ {{title}}
6
+ </h1>
7
+
8
+ <h2 class="title" *ngSwitchCase="2">
9
+ <span class="title-bullet h-28 w-8" [ngClass]="bulletColor" *ngIf="bulletColor"></span>
10
+ {{title}}
11
+ </h2>
12
+
13
+ <h3 class="title" *ngSwitchCase="3">
14
+ <span class="title-bullet h-24 w-8" [ngClass]="bulletColor" *ngIf="bulletColor"></span>
15
+ {{title}}
16
+ </h3>
17
+
18
+ <h4 class="title" *ngSwitchCase="4">
19
+ <span class="title-bullet h-24 w-8" [ngClass]="bulletColor" *ngIf="bulletColor"></span>
20
+ {{title}}
21
+ </h4>
22
+
23
+ <h5 class="title" *ngSwitchCase="5">
24
+ <span class="title-bullet h-20 w-8" [ngClass]="bulletColor" *ngIf="bulletColor"></span>
25
+ {{title}}
26
+ </h5>
27
+
28
+ <h6 class="title" *ngSwitchCase="6">
29
+ <span class="title-bullet h-16 w-8" [ngClass]="bulletColor" *ngIf="bulletColor"></span>
30
+ {{title}}
31
+ </h6>
32
+
33
+ </ng-container>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MatchaTitleComponent } from './matcha-title.component';
4
+
5
+ describe('MatchaTitleComponent', () => {
6
+ let component: MatchaTitleComponent;
7
+ let fixture: ComponentFixture<MatchaTitleComponent>;
8
+
9
+ beforeEach(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [MatchaTitleComponent]
12
+ });
13
+ fixture = TestBed.createComponent(MatchaTitleComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,24 @@
1
+ import { Component, Input, OnInit, Sanitizer } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'matcha-title',
5
+ templateUrl: './matcha-title.component.html',
6
+ styleUrls: ['./matcha-title.component.scss']
7
+ })
8
+ export class MatchaTitleComponent implements OnInit {
9
+
10
+ @Input('level') level: number = 1;
11
+
12
+ @Input('bulletColor') bulletColor: string = '';
13
+
14
+ @Input('title') title: string = '';
15
+
16
+ constructor() {}
17
+
18
+
19
+ ngOnInit(): void {
20
+ this.bulletColor = this.bulletColor ? `background-${this.bulletColor}` : '';
21
+ }
22
+
23
+
24
+ }
@@ -0,0 +1,18 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MatchaTitleComponent } from './matcha-title.component';
4
+
5
+
6
+
7
+ @NgModule({
8
+ declarations: [
9
+ MatchaTitleComponent
10
+ ],
11
+ imports: [
12
+ CommonModule
13
+ ],
14
+ exports:[
15
+ MatchaTitleComponent
16
+ ]
17
+ })
18
+ export class MatchaTitleModule { }