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.
- package/README.md +239 -2
- package/assets/open_in_new.png +0 -0
- package/ng-package.json +7 -0
- package/package.json +10 -23
- package/src/foundation/colors/base/amber.mdx +232 -0
- package/src/foundation/colors/base/blue.mdx +232 -0
- package/src/foundation/colors/base/cyan.mdx +232 -0
- package/src/foundation/colors/base/deep-orange.mdx +232 -0
- package/src/foundation/colors/base/deep-purple.mdx +232 -0
- package/src/foundation/colors/base/green.mdx +232 -0
- package/src/foundation/colors/base/indigo.mdx +232 -0
- package/src/foundation/colors/base/light-blue.mdx +232 -0
- package/src/foundation/colors/base/light-green.mdx +232 -0
- package/src/foundation/colors/base/lime.mdx +232 -0
- package/src/foundation/colors/base/orange.mdx +232 -0
- package/src/foundation/colors/base/pink.mdx +232 -0
- package/src/foundation/colors/base/purple.mdx +232 -0
- package/src/foundation/colors/base/red.mdx +232 -0
- package/src/foundation/colors/base/teal.mdx +232 -0
- package/src/foundation/colors/base/yellow.mdx +232 -0
- package/src/foundation/colors/base-colors.mdx +141 -0
- package/src/foundation/colors/surface-colors.mdx +93 -0
- package/src/foundation/colors/theme/accent.mdx +232 -0
- package/src/foundation/colors/theme/primary.mdx +232 -0
- package/src/foundation/colors/theme/warn.mdx +232 -0
- package/src/foundation/colors/theme-colors.mdx +159 -0
- package/src/foundation/sizes/heights.mdx +232 -0
- package/src/foundation/sizes/max-heights.mdx +237 -0
- package/src/foundation/sizes/max-width.mdx +236 -0
- package/src/foundation/sizes/min-heights.mdx +237 -0
- package/src/foundation/sizes/min-width.mdx +236 -0
- package/src/foundation/sizes/sizes.mdx +219 -0
- package/src/foundation/sizes/widths.mdx +234 -0
- package/src/lib/matcha-autocomplete/autocomplete-overview.directive.ts +16 -0
- package/src/lib/matcha-autocomplete/autocomplete.argtypes.ts +64 -0
- package/src/lib/matcha-autocomplete/autocomplete.directive.ts +14 -0
- package/src/lib/matcha-autocomplete/autocomplete.mdx +112 -0
- package/src/lib/matcha-autocomplete/autocomplete.module.ts +14 -0
- package/src/lib/matcha-autocomplete/autocomplete.stories.ts +113 -0
- package/src/lib/matcha-badge/badge.module.ts +14 -0
- package/src/lib/matcha-badge/matcha-badge.directive.ts +16 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet.module.ts +14 -0
- package/src/lib/matcha-bottom-sheet/matcha-bottom-sheet.directive.ts +16 -0
- package/src/lib/matcha-button-toggle/button-toggle.module.ts +14 -0
- package/src/lib/matcha-button-toggle/matcha-button-toggle.directive.ts +16 -0
- package/src/lib/matcha-buttons/button.stories.ts +111 -0
- package/src/lib/matcha-buttons/buttons.module.ts +27 -0
- package/src/lib/matcha-buttons/matcha-btn-md.directive.ts +16 -0
- package/src/lib/matcha-buttons/matcha-btn-pill.directive.ts +15 -0
- package/src/lib/matcha-buttons/matcha-btn-size.directive.ts +17 -0
- package/src/lib/matcha-buttons/matcha-btn-xl.directive.ts +15 -0
- package/src/lib/matcha-card/card.mdx.txt +55 -0
- package/src/lib/matcha-card/matcha-card-argtype.ts +123 -0
- package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.html +3 -0
- package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.scss +0 -0
- package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.spec.ts +21 -0
- package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.ts +10 -0
- package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.html +3 -0
- package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.scss +0 -0
- package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.spec.ts +21 -0
- package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.ts +10 -0
- package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.html +4 -0
- package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.scss +0 -0
- package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.spec.ts +21 -0
- package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.ts +10 -0
- package/src/lib/matcha-card/matcha-card.component.html +3 -0
- package/src/lib/matcha-card/matcha-card.component.scss +117 -0
- package/src/lib/matcha-card/matcha-card.component.spec.ts +21 -0
- package/src/lib/matcha-card/matcha-card.component.ts +43 -0
- package/src/lib/matcha-card/matcha-card.module.ts +27 -0
- package/src/lib/matcha-card/matcha-card.stories.ts +80 -0
- package/src/lib/matcha-checkbox/checkbox.argtype.ts +79 -0
- package/src/lib/matcha-checkbox/checkbox.directive.ts +14 -0
- package/src/lib/matcha-checkbox/checkbox.mdx +76 -0
- package/src/lib/matcha-checkbox/checkbox.module.ts +9 -0
- package/src/lib/matcha-checkbox/checkbox.stories.ts +161 -0
- package/src/lib/matcha-checkbox/checkbox.stories.txt +74 -0
- package/src/lib/matcha-chips/chips.module.ts +12 -0
- package/src/lib/matcha-chips/matcha-chips.directive.ts +16 -0
- package/src/lib/matcha-components.module.ts +78 -0
- package/src/lib/matcha-datepicker/datepicker.argtypes.ts +63 -0
- package/src/lib/matcha-datepicker/datepicker.directive.ts +14 -0
- package/src/lib/matcha-datepicker/datepicker.mdx +73 -0
- package/src/lib/matcha-datepicker/datepicker.module.ts +9 -0
- package/src/lib/matcha-datepicker/datepicker.stories.ts +277 -0
- package/src/lib/matcha-dialog/dialog.module.ts +14 -0
- package/src/lib/matcha-dialog/matcha-dialog.directive.ts +16 -0
- package/src/lib/matcha-dialog2/confirmation-dialog.component.ts.txt +54 -0
- package/src/lib/matcha-dialog2/confirmation-dialog.stories.ts.txt +24 -0
- package/src/lib/matcha-divider/divider.module.ts +14 -0
- package/src/lib/matcha-divider/matcha-divider.directive.ts +16 -0
- package/src/lib/matcha-expansion-panel/expansion-panel.module.ts +14 -0
- package/src/lib/matcha-expansion-panel/matcha-expansion-panel.directive.ts +16 -0
- package/src/lib/matcha-forms/forms.module.ts +19 -0
- package/src/lib/matcha-forms/matcha-form-field-appearance.directive.ts +16 -0
- package/src/lib/matcha-forms/matcha-form-field-argtype.ts +73 -0
- package/src/lib/matcha-forms/matcha-form-field.mdx +284 -0
- package/src/lib/matcha-forms/matcha-form-field.stories.ts +345 -0
- package/src/lib/matcha-forms/matcha-form-input-text.directive.ts +16 -0
- package/src/lib/matcha-icon/icon.module.ts +19 -0
- package/src/lib/matcha-icon/matcha-icon-position-pos.directive.ts +15 -0
- package/src/lib/matcha-icon/matcha-icon-position-pre.directive.ts +15 -0
- package/src/lib/matcha-list/list.module.ts +14 -0
- package/src/lib/matcha-list/matcha-list.directive.ts +16 -0
- package/src/lib/matcha-menu/matcha-menu.directive.ts +16 -0
- package/src/lib/matcha-menu/menu.module.ts +14 -0
- package/src/lib/matcha-menu/menu.stories.txt +76 -0
- package/src/lib/matcha-paginator/matcha-paginator.directive.ts +16 -0
- package/src/lib/matcha-paginator/paginator.module.ts +14 -0
- package/src/lib/matcha-progress-bar/progress-bar.argtype.ts +48 -0
- package/src/lib/matcha-progress-bar/progress-bar.directive.ts +16 -0
- package/src/lib/matcha-progress-bar/progress-bar.mdx +95 -0
- package/src/lib/matcha-progress-bar/progress-bar.module.ts +14 -0
- package/src/lib/matcha-progress-bar/progress-bar.stories.ts +89 -0
- package/src/lib/matcha-progress-spinner/progress-spinner.argtype.ts +65 -0
- package/src/lib/matcha-progress-spinner/progress-spinner.directive.ts +16 -0
- package/src/lib/matcha-progress-spinner/progress-spinner.mdx +23 -0
- package/src/lib/matcha-progress-spinner/progress-spinner.module.ts +14 -0
- package/src/lib/matcha-progress-spinner/progress-spinner.stories.ts +44 -0
- package/src/lib/matcha-radio-button/matcha-radio-button.argtype.ts +85 -0
- package/src/lib/matcha-radio-button/matcha-radio-button.directive.ts +16 -0
- package/src/lib/matcha-radio-button/matcha-radio-button.stories.ts +44 -0
- package/src/lib/matcha-radio-button/radio-button.module.ts +12 -0
- package/src/lib/matcha-select/matcha-select.directive.ts +16 -0
- package/src/lib/matcha-select/select.module.ts +12 -0
- package/src/lib/matcha-select/select.stories.txt +109 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.argtype.ts +66 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.directive.ts +16 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.mdx +92 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.module.ts +12 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.stories.ts +167 -0
- package/src/lib/matcha-slider/matcha-slider.directive.ts +16 -0
- package/src/lib/matcha-slider/slider.module.ts +12 -0
- package/src/lib/matcha-snackbar/matcha-snackbar.directive.ts +16 -0
- package/src/lib/matcha-snackbar/snackbar.module.ts +12 -0
- package/src/lib/matcha-sort-header/matcha-sort-header.directive.ts +16 -0
- package/src/lib/matcha-sort-header/sort-header.module.ts +12 -0
- package/src/lib/matcha-stepper/matcha-stepper.directive.ts +16 -0
- package/src/lib/matcha-stepper/stepper.module.ts +12 -0
- package/src/lib/matcha-table/matcha-table.directive.ts +16 -0
- package/src/lib/matcha-table/table.module.ts +12 -0
- package/src/lib/matcha-tabs/matcha-tabs.directive.ts +17 -0
- package/src/lib/matcha-tabs/tabs.module.ts +16 -0
- package/src/lib/matcha-tabs/tabs.stories.txt +18 -0
- package/src/lib/matcha-title/matcha-title.component.html +33 -0
- package/src/lib/matcha-title/matcha-title.component.scss +0 -0
- package/src/lib/matcha-title/matcha-title.component.spec.ts +21 -0
- package/src/lib/matcha-title/matcha-title.component.ts +24 -0
- package/src/lib/matcha-title/matcha-title.module.ts +18 -0
- package/src/lib/matcha-tooltip/matcha-tooltip.directive.ts +16 -0
- package/src/lib/matcha-tooltip/tooltip.module.ts +12 -0
- package/src/lib/matcha-tree/matcha-tree.directive.ts +16 -0
- package/src/lib/matcha-tree/tree.module.ts +12 -0
- package/src/public-api.ts +93 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/lib/matcha-button/matcha-button.component.mjs +0 -12
- package/esm2022/lib/matcha-card/matcha-card-content/matcha-card-content.component.mjs +0 -12
- package/esm2022/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.mjs +0 -12
- package/esm2022/lib/matcha-card/matcha-card-header/matcha-card-header.component.mjs +0 -12
- package/esm2022/lib/matcha-card/matcha-card.component.mjs +0 -12
- package/esm2022/lib/matcha-card/matcha-card.module.mjs +0 -40
- package/esm2022/lib/matcha-components.module.mjs +0 -27
- package/esm2022/matcha-components.mjs +0 -5
- package/esm2022/public-api.mjs +0 -20
- package/fesm2022/matcha-components.mjs +0 -113
- package/fesm2022/matcha-components.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/matcha-button/matcha-button.component.d.ts +0 -5
- package/lib/matcha-card/matcha-card-content/matcha-card-content.component.d.ts +0 -5
- package/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.d.ts +0 -5
- package/lib/matcha-card/matcha-card-header/matcha-card-header.component.d.ts +0 -5
- package/lib/matcha-card/matcha-card.component.d.ts +0 -5
- package/lib/matcha-card/matcha-card.module.d.ts +0 -11
- package/lib/matcha-components.module.d.ts +0 -8
- package/public-api.d.ts +0 -7
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applicationConfig,
|
|
3
|
+
Meta,
|
|
4
|
+
moduleMetadata,
|
|
5
|
+
StoryObj,
|
|
6
|
+
} from '@storybook/angular';
|
|
7
|
+
import { NgFor, AsyncPipe } from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
10
|
+
import { map, startWith } from 'rxjs';
|
|
11
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
12
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
|
+
import { MatInputModule } from '@angular/material/input';
|
|
14
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
15
|
+
import { autocompleteArgtypes } from './autocomplete.argtypes';
|
|
16
|
+
import { MatchaAutocompleteDirective } from './autocomplete.directive';
|
|
17
|
+
import { MatchaAutocompleteOverviewDirective } from './autocomplete-overview.directive';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Atoms / Autocomplete',
|
|
21
|
+
decorators: [
|
|
22
|
+
applicationConfig({
|
|
23
|
+
providers: [provideAnimations()],
|
|
24
|
+
}),
|
|
25
|
+
moduleMetadata({
|
|
26
|
+
imports: [
|
|
27
|
+
CommonModule,
|
|
28
|
+
FormsModule,
|
|
29
|
+
MatFormFieldModule,
|
|
30
|
+
MatInputModule,
|
|
31
|
+
MatAutocompleteModule,
|
|
32
|
+
ReactiveFormsModule,
|
|
33
|
+
NgFor,
|
|
34
|
+
AsyncPipe,
|
|
35
|
+
],
|
|
36
|
+
declarations: [
|
|
37
|
+
MatchaAutocompleteDirective,
|
|
38
|
+
MatchaAutocompleteOverviewDirective,
|
|
39
|
+
],
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
// tags: ['autodocs'],
|
|
43
|
+
args: {
|
|
44
|
+
label: 'Number',
|
|
45
|
+
autoActiveFirstOption: false,
|
|
46
|
+
class: '',
|
|
47
|
+
color: 'accent',
|
|
48
|
+
disableRipple: false,
|
|
49
|
+
panelWidth: '',
|
|
50
|
+
autocompleteTriggerDisabled: false,
|
|
51
|
+
autocompleteTriggerPosition: 'auto',
|
|
52
|
+
},
|
|
53
|
+
argTypes: autocompleteArgtypes,
|
|
54
|
+
parameters: {
|
|
55
|
+
controls: { expanded: true },
|
|
56
|
+
},
|
|
57
|
+
} as Meta;
|
|
58
|
+
|
|
59
|
+
function _filter(value: string): string[] {
|
|
60
|
+
const filterValue = value.toLowerCase();
|
|
61
|
+
return options.filter((option) =>
|
|
62
|
+
option.toLowerCase().includes(filterValue)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const myControl = new FormControl();
|
|
67
|
+
const options = ['One', 'Two', 'Three', 'Four'];
|
|
68
|
+
const filteredOptions = myControl.valueChanges.pipe(
|
|
69
|
+
startWith(''),
|
|
70
|
+
map((value) => _filter(value || ''))
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
export const AutocompleteDefault: StoryObj = {
|
|
74
|
+
render: (args) => ({
|
|
75
|
+
props: {
|
|
76
|
+
...args,
|
|
77
|
+
myControl,
|
|
78
|
+
options,
|
|
79
|
+
filteredOptions,
|
|
80
|
+
},
|
|
81
|
+
template: `
|
|
82
|
+
<div class="matcha-card background-surface">
|
|
83
|
+
<form>
|
|
84
|
+
<mat-form-field matcha-autocomplete appearance="outline" [color]="color">
|
|
85
|
+
<mat-label>{{label}}</mat-label>
|
|
86
|
+
<input type="text"
|
|
87
|
+
placeholder="Pick one"
|
|
88
|
+
aria-label="Number"
|
|
89
|
+
matInput
|
|
90
|
+
[formControl]="myControl"
|
|
91
|
+
[matAutocomplete]="auto"
|
|
92
|
+
[matAutocompleteDisabled]="autocompleteTriggerDisabled"
|
|
93
|
+
[matAutocompletePosition]="autocompleteTriggerPosition">
|
|
94
|
+
<mat-autocomplete #auto="matAutocomplete"
|
|
95
|
+
[autoActiveFirstOption]="autoActiveFirstOption"
|
|
96
|
+
[class]="class"
|
|
97
|
+
[disableRipple]="disableRipple"
|
|
98
|
+
[panelWidth]="panelWidth"
|
|
99
|
+
(closed)="onClosed()"
|
|
100
|
+
(opened)="onOpened()"
|
|
101
|
+
(optionActivated)="onOptionActivated($event)"
|
|
102
|
+
(optionSelected)="onOptionSelected($event)">
|
|
103
|
+
<mat-option *ngFor="let option of filteredOptions | async" [value]="option">
|
|
104
|
+
{{option}}
|
|
105
|
+
</mat-option>
|
|
106
|
+
</mat-autocomplete>
|
|
107
|
+
</mat-form-field>
|
|
108
|
+
</form>
|
|
109
|
+
</div>
|
|
110
|
+
`,
|
|
111
|
+
}),
|
|
112
|
+
name: 'Autocomplete Default',
|
|
113
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { MatchaBadgeDirective } from './matcha-badge.directive';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
declarations: [
|
|
6
|
+
MatchaBadgeDirective
|
|
7
|
+
],
|
|
8
|
+
imports: [
|
|
9
|
+
],
|
|
10
|
+
exports: [
|
|
11
|
+
MatchaBadgeDirective
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
export class MatchaBadgeModule { }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matcha-badge]'
|
|
5
|
+
})
|
|
6
|
+
export class MatchaBadgeDirective {
|
|
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-badge')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { MatchaBottomSheetDirective } from './matcha-bottom-sheet.directive';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
declarations: [
|
|
6
|
+
MatchaBottomSheetDirective
|
|
7
|
+
],
|
|
8
|
+
imports: [
|
|
9
|
+
],
|
|
10
|
+
exports: [
|
|
11
|
+
MatchaBottomSheetDirective
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
export class MatchaBottomSheetModule { }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matcha-bottom-sheet]'
|
|
5
|
+
})
|
|
6
|
+
export class MatchaBottomSheetDirective {
|
|
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-bottom-sheet')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { MatchaButtonToggleDirective } from './matcha-button-toggle.directive';
|
|
3
|
+
|
|
4
|
+
@NgModule({
|
|
5
|
+
declarations: [
|
|
6
|
+
MatchaButtonToggleDirective
|
|
7
|
+
],
|
|
8
|
+
imports: [
|
|
9
|
+
],
|
|
10
|
+
exports: [
|
|
11
|
+
MatchaButtonToggleDirective
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
export class MatchaButtonToggleModule { }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matcha-button-toggle]'
|
|
5
|
+
})
|
|
6
|
+
export class MatchaButtonToggleDirective {
|
|
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-button-toggle')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { MatButton, MatButtonModule } from '@angular/material/button';
|
|
2
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
3
|
+
import { moduleMetadata } from '@storybook/angular';
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/angular';
|
|
5
|
+
import { action } from '@storybook/addon-actions';
|
|
6
|
+
import { MatchaBtnSizeDirective } from './matcha-btn-size.directive';
|
|
7
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Componentes/Matcha Button',
|
|
11
|
+
component: MatButton,
|
|
12
|
+
decorators: [
|
|
13
|
+
moduleMetadata({
|
|
14
|
+
imports: [MatButtonModule, BrowserAnimationsModule],
|
|
15
|
+
declarations: [MatchaBtnSizeDirective],
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
args: {
|
|
19
|
+
label: 'Clique em mim',
|
|
20
|
+
color: 'accent',
|
|
21
|
+
defaultColor: 'primary',
|
|
22
|
+
disableRipple: false,
|
|
23
|
+
disabled: false,
|
|
24
|
+
size: '',
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
label: { control: 'text' },
|
|
28
|
+
color: { control: 'select', options: ['accent', 'primary', 'warn'] },
|
|
29
|
+
defaultColor: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: ['primary', 'accent', 'warn'],
|
|
32
|
+
},
|
|
33
|
+
disableRipple: { control: 'boolean' },
|
|
34
|
+
disabled: { control: 'boolean' },
|
|
35
|
+
size: { control: 'radio', options: ['xs', 'sm', 'md', 'lg', 'xl'] },
|
|
36
|
+
},
|
|
37
|
+
} as Meta;
|
|
38
|
+
|
|
39
|
+
const Template = (args: MatButton) => ({
|
|
40
|
+
template: `
|
|
41
|
+
<button mat-raised-button
|
|
42
|
+
[color]="${args.color}"
|
|
43
|
+
[disableRipple]="${args.disableRipple}"
|
|
44
|
+
[disabled]="${args.disabled}">
|
|
45
|
+
</button>
|
|
46
|
+
`,
|
|
47
|
+
props: args,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const Default = Template.bind({
|
|
51
|
+
args: {
|
|
52
|
+
label: 'Clique em mim',
|
|
53
|
+
color: 'accent',
|
|
54
|
+
disableRipple: false,
|
|
55
|
+
disabled: false,
|
|
56
|
+
size: 'md',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const Primary = () => ({
|
|
61
|
+
component: MatButton,
|
|
62
|
+
props: {
|
|
63
|
+
text: 'Clique em mim',
|
|
64
|
+
onClick: action('Botão primário clicado'),
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const Secondary = () => ({
|
|
69
|
+
component: MatButton,
|
|
70
|
+
props: {
|
|
71
|
+
text: 'Botão secundário',
|
|
72
|
+
color: 'accent',
|
|
73
|
+
onClick: action('Botão secundário clicado'),
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const Disabled = () => ({
|
|
78
|
+
component: MatButton,
|
|
79
|
+
props: {
|
|
80
|
+
text: 'Botão desativado',
|
|
81
|
+
disabled: true,
|
|
82
|
+
onClick: action('Botão desativado clicado'),
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export const Icon = () => ({
|
|
87
|
+
component: MatButton,
|
|
88
|
+
props: {
|
|
89
|
+
text: 'Botão com ícone',
|
|
90
|
+
icon: 'favorite',
|
|
91
|
+
onClick: action('Botão com ícone clicado'),
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export const Accent = () => ({
|
|
96
|
+
component: MatButton,
|
|
97
|
+
template: `
|
|
98
|
+
<button mat-raised-button color="accent" [style.borderRadius.px]="10">Botão com estilo personalizado</button>
|
|
99
|
+
`,
|
|
100
|
+
props: {
|
|
101
|
+
onClick: action('Botão com estilo personalizado clicado'),
|
|
102
|
+
},
|
|
103
|
+
decorators: [
|
|
104
|
+
moduleMetadata({
|
|
105
|
+
declarations: [MatchaBtnSizeDirective],
|
|
106
|
+
imports: [
|
|
107
|
+
/* Importe outros módulos necessários */
|
|
108
|
+
],
|
|
109
|
+
}),
|
|
110
|
+
],
|
|
111
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { MatchaBtnMdDirective } from './matcha-btn-md.directive';
|
|
4
|
+
import { MatchaBtnSizeDirective } from './matcha-btn-size.directive';
|
|
5
|
+
import { MatchaBtnXlDirective } from './matcha-btn-xl.directive';
|
|
6
|
+
import { MatchaBtnPillDirective } from './matcha-btn-pill.directive';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@NgModule({
|
|
10
|
+
declarations: [
|
|
11
|
+
MatchaBtnMdDirective,
|
|
12
|
+
MatchaBtnSizeDirective,
|
|
13
|
+
MatchaBtnXlDirective,
|
|
14
|
+
MatchaBtnPillDirective,
|
|
15
|
+
],
|
|
16
|
+
imports: [
|
|
17
|
+
],
|
|
18
|
+
exports:[
|
|
19
|
+
MatchaBtnMdDirective,
|
|
20
|
+
MatchaBtnSizeDirective,
|
|
21
|
+
MatchaBtnXlDirective,
|
|
22
|
+
MatchaBtnPillDirective
|
|
23
|
+
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
})
|
|
27
|
+
export class MatchaButtonsModule { }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matcha-btn-md]'
|
|
5
|
+
})
|
|
6
|
+
export class MatchaBtnMdDirective {
|
|
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-button-md')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matcha-btn-pill]'
|
|
5
|
+
})
|
|
6
|
+
export class MatchaBtnPillDirective {
|
|
7
|
+
|
|
8
|
+
constructor(
|
|
9
|
+
private _elementRef: ElementRef,
|
|
10
|
+
private _renderer: Renderer2
|
|
11
|
+
) {
|
|
12
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'matcha-button-pill')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Directive, ElementRef, Input, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[size]'
|
|
5
|
+
})
|
|
6
|
+
export class MatchaBtnSizeDirective {
|
|
7
|
+
@Input('size') size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null = null;
|
|
8
|
+
|
|
9
|
+
constructor(
|
|
10
|
+
private _elementRef: ElementRef,
|
|
11
|
+
private _renderer: Renderer2
|
|
12
|
+
) {
|
|
13
|
+
//this._elementRef.nativeElement.style.backgroundColor = 'grey';
|
|
14
|
+
|
|
15
|
+
this.size == null ? null : this._renderer.addClass(this._elementRef.nativeElement,`matcha-button-${this.size}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matcha-btn-xl]'
|
|
5
|
+
})
|
|
6
|
+
export class MatchaBtnXlDirective {
|
|
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-button-xl')
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Story } from '@storybook/blocks';
|
|
2
|
+
import * as ComponentStories from './matcha-card.stories';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# Progress bar
|
|
6
|
+
|
|
7
|
+
> *matcha-card* the purpose of the matcha-card is to visually separate content, and it may also receive some options to improve understanding of the content presented.
|
|
8
|
+
|
|
9
|
+
<br/>
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
`import { MatchaCardModule } from './matcha-card/matcha-card.module';`
|
|
14
|
+
|
|
15
|
+
<br/>
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
<br/>
|
|
20
|
+
|
|
21
|
+
<Story of={ComponentStories.WithBasicUsage} />
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
import { Story } from '@storybook/blocks';
|
|
27
|
+
import * as ComponentStories from './matcha-card.stories';
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# Progress bar
|
|
31
|
+
|
|
32
|
+
> *matcha-card* the purpose of the matcha-card is to visually separate content, and it may also receive some options to improve understanding of the content presented.
|
|
33
|
+
|
|
34
|
+
<br/>
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
`import { MatchaCardModule } from './matcha-card/matcha-card.module';`
|
|
39
|
+
|
|
40
|
+
<br/>
|
|
41
|
+
|
|
42
|
+
## Example
|
|
43
|
+
|
|
44
|
+
<br/>
|
|
45
|
+
|
|
46
|
+
<Story name="matcha-card - Flat" of={ComponentStories.WithBasicUsage} />
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<br/>
|
|
50
|
+
|
|
51
|
+
## Code
|
|
52
|
+
```html
|
|
53
|
+
<matcha-card elevation="0" background="surface">Meu card</matcha-card>
|
|
54
|
+
```
|
|
55
|
+
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export const matchaCardArgtypes = {
|
|
2
|
+
elevation: {
|
|
3
|
+
description: 'Elevation level of the card',
|
|
4
|
+
control: 'select',
|
|
5
|
+
defaultValue: '1',
|
|
6
|
+
table: {
|
|
7
|
+
defaultValue: { summary: '1' },
|
|
8
|
+
},
|
|
9
|
+
options: [
|
|
10
|
+
'0' ,
|
|
11
|
+
'1' ,
|
|
12
|
+
'2' ,
|
|
13
|
+
'3' ,
|
|
14
|
+
'4' ,
|
|
15
|
+
'5' ,
|
|
16
|
+
'6' ,
|
|
17
|
+
'7' ,
|
|
18
|
+
'8' ,
|
|
19
|
+
'9' ,
|
|
20
|
+
'10' ,
|
|
21
|
+
'11' ,
|
|
22
|
+
'12' ,
|
|
23
|
+
'13' ,
|
|
24
|
+
'14' ,
|
|
25
|
+
'15' ,
|
|
26
|
+
'16' ,
|
|
27
|
+
'17' ,
|
|
28
|
+
'18' ,
|
|
29
|
+
'19' ,
|
|
30
|
+
'20' ,
|
|
31
|
+
'21' ,
|
|
32
|
+
'22' ,
|
|
33
|
+
'23' ,
|
|
34
|
+
'24'
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
blockquote: {
|
|
38
|
+
description: 'Position of the blockquote bar',
|
|
39
|
+
control: 'select',
|
|
40
|
+
defaultValue: '',
|
|
41
|
+
table: {
|
|
42
|
+
defaultValue: { summary: '' },
|
|
43
|
+
},
|
|
44
|
+
options: [
|
|
45
|
+
'left',
|
|
46
|
+
'right',
|
|
47
|
+
'none'
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
blockquoteColor: {
|
|
51
|
+
description: 'Theme color palette for the blockquote bar',
|
|
52
|
+
control: 'select',
|
|
53
|
+
defaultValue: 'primary',
|
|
54
|
+
table: {
|
|
55
|
+
defaultValue: { summary: 'primary' },
|
|
56
|
+
},
|
|
57
|
+
options: [
|
|
58
|
+
'accent',
|
|
59
|
+
'primary',
|
|
60
|
+
'warn',
|
|
61
|
+
'background',
|
|
62
|
+
'foreground',
|
|
63
|
+
'red',
|
|
64
|
+
'pink',
|
|
65
|
+
'purple',
|
|
66
|
+
'deep-purple',
|
|
67
|
+
'indigo',
|
|
68
|
+
'blue',
|
|
69
|
+
'light-blue',
|
|
70
|
+
'cyan',
|
|
71
|
+
'teal',
|
|
72
|
+
'green',
|
|
73
|
+
'light-green',
|
|
74
|
+
'lime',
|
|
75
|
+
'yellow',
|
|
76
|
+
'amber',
|
|
77
|
+
'orange',
|
|
78
|
+
'deep-orange'
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
backgroundColor: {
|
|
82
|
+
description: 'Theme color palette for the card background',
|
|
83
|
+
control: 'select',
|
|
84
|
+
defaultValue: 'surface',
|
|
85
|
+
table: {
|
|
86
|
+
defaultValue: { summary: 'surface' },
|
|
87
|
+
},
|
|
88
|
+
options: [
|
|
89
|
+
'surface',
|
|
90
|
+
'surface',
|
|
91
|
+
'bg',
|
|
92
|
+
'background',
|
|
93
|
+
'foreground',
|
|
94
|
+
'red',
|
|
95
|
+
'pink',
|
|
96
|
+
'purple',
|
|
97
|
+
'deep-purple',
|
|
98
|
+
'indigo',
|
|
99
|
+
'blue',
|
|
100
|
+
'light-blue',
|
|
101
|
+
'cyan',
|
|
102
|
+
'teal',
|
|
103
|
+
'green',
|
|
104
|
+
'light-green',
|
|
105
|
+
'lime',
|
|
106
|
+
'yellow',
|
|
107
|
+
'amber',
|
|
108
|
+
'orange',
|
|
109
|
+
'deep-orange'
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
alpha: {
|
|
113
|
+
description: 'Opacity of the backgroundColor',
|
|
114
|
+
control: 'boolean',
|
|
115
|
+
defaultValue: true,
|
|
116
|
+
table: {
|
|
117
|
+
defaultValue: { summary: true },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
label: {
|
|
121
|
+
control: 'text'
|
|
122
|
+
},
|
|
123
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { MatchaCardContentComponent } from './matcha-card-content.component';
|
|
4
|
+
|
|
5
|
+
describe('MatchaCardContentComponent', () => {
|
|
6
|
+
let component: MatchaCardContentComponent;
|
|
7
|
+
let fixture: ComponentFixture<MatchaCardContentComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [MatchaCardContentComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(MatchaCardContentComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { MatchaCardFooterComponent } from './matcha-card-footer.component';
|
|
4
|
+
|
|
5
|
+
describe('MatchaCardFooterComponent', () => {
|
|
6
|
+
let component: MatchaCardFooterComponent;
|
|
7
|
+
let fixture: ComponentFixture<MatchaCardFooterComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [MatchaCardFooterComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(MatchaCardFooterComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|