matcha-components 1.0.6 → 1.0.8
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/index.ts +1 -0
- package/package.json +1 -1
- package/src/documentation/presentation.mdx +105 -0
- package/src/foundation/borders/borders.mdx +180 -0
- package/src/foundation/colors/base/amber.mdx +12 -9
- package/src/foundation/colors/base/blue.mdx +12 -9
- package/src/foundation/colors/base/cyan.mdx +12 -9
- package/src/foundation/colors/base/deep-orange.mdx +12 -9
- package/src/foundation/colors/base/deep-purple.mdx +12 -9
- package/src/foundation/colors/base/green.mdx +12 -9
- package/src/foundation/colors/base/indigo.mdx +12 -9
- package/src/foundation/colors/base/light-blue.mdx +12 -9
- package/src/foundation/colors/base/light-green.mdx +12 -9
- package/src/foundation/colors/base/lime.mdx +12 -9
- package/src/foundation/colors/base/orange.mdx +12 -9
- package/src/foundation/colors/base/pink.mdx +12 -9
- package/src/foundation/colors/base/purple.mdx +12 -9
- package/src/foundation/colors/base/red.mdx +12 -9
- package/src/foundation/colors/base/teal.mdx +12 -9
- package/src/foundation/colors/base/yellow.mdx +12 -9
- package/src/foundation/colors/base-colors.mdx +21 -18
- package/src/foundation/colors/theme/accent.mdx +12 -9
- package/src/foundation/colors/theme/primary.mdx +12 -9
- package/src/foundation/colors/theme/warn.mdx +12 -9
- package/src/foundation/colors/theme-colors.mdx +11 -37
- package/src/foundation/spacing/margins.mdx +183 -0
- package/src/foundation/spacing/paddings.mdx +156 -0
- package/src/foundation/typography/colors.mdx +26 -0
- package/src/foundation/typography/font-size.mdx +57 -0
- package/src/foundation/typography/font-weight.mdx +65 -0
- package/src/foundation/typography/helpers.mdx +86 -0
- package/src/foundation/typography/letter-spacing.mdx +35 -0
- package/src/foundation/typography/line-height.mdx +52 -0
- package/src/foundation/typography/message-box.mdx +43 -0
- package/src/foundation/typography/text-align.mdx +22 -0
- package/src/foundation/typography/text-styles.mdx +88 -0
- package/src/lib/matcha-autocomplete/autocomplete.mdx +1 -1
- package/src/lib/matcha-autocomplete/autocomplete.stories.ts +16 -25
- package/src/lib/matcha-autocomplete/example/autocomplete-auto-active-first-option-example.css +9 -0
- package/src/lib/matcha-autocomplete/example/autocomplete-auto-active-first-option-example.html +9 -0
- package/src/lib/matcha-autocomplete/example/autocomplete-auto-active-first-option-example.ts +37 -0
- package/src/lib/matcha-autocomplete/example/autocomplete-overview-example.css +19 -0
- package/src/lib/matcha-autocomplete/example/autocomplete-overview-example.html +17 -0
- package/src/lib/matcha-autocomplete/example/autocomplete-overview-example.ts +70 -0
- package/src/lib/matcha-badge/badge.argtypes.ts +77 -0
- package/src/lib/matcha-badge/badge.directive.ts +11 -0
- package/src/lib/matcha-badge/badge.mdx +69 -0
- package/src/lib/matcha-badge/badge.module.ts +5 -10
- package/src/lib/matcha-badge/badge.stories.ts +79 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet-overview-example-sheet.html +21 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet-overview-example.component.ts +34 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet-overview-example.html +2 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet.argtypes.ts +117 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet.mdx +69 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet.module.ts +5 -10
- package/src/lib/matcha-bottom-sheet/bottom-sheet.stories.ts +39 -0
- package/src/lib/matcha-button/button-overview-example.component.ts +18 -0
- package/src/lib/matcha-button/button-overview-example.html +118 -0
- package/src/lib/matcha-button/button-overview-example.scss +31 -0
- package/src/lib/matcha-button/button.argtypes.ts +20 -0
- package/src/lib/matcha-button/button.directive.ts +39 -0
- package/src/lib/matcha-button/button.mdx +171 -0
- package/src/lib/matcha-button/button.module.ts +10 -0
- package/src/lib/matcha-button/button.stories.ts +38 -0
- package/src/lib/matcha-button-toggle/button-toggle.argtype.ts +115 -0
- package/src/lib/matcha-button-toggle/button-toggle.directive.ts +13 -0
- package/src/lib/matcha-button-toggle/button-toggle.mdx +63 -0
- package/src/lib/matcha-button-toggle/button-toggle.stories.ts +64 -0
- package/src/lib/matcha-button-toggle/matcha-button-toggle.directive.ts +0 -1
- package/src/lib/matcha-card/card-argtype.ts +54 -0
- package/src/lib/matcha-card/card-header.html +10 -0
- package/src/lib/matcha-card/card-title-group.html +12 -0
- package/src/lib/matcha-card/card.component.spec.ts +21 -0
- package/src/lib/matcha-card/card.component.ts +47 -0
- package/src/lib/matcha-card/card.mdx +43 -0
- package/src/lib/matcha-card/card.module.ts +10 -0
- package/src/lib/matcha-card/card.stories.ts +92 -0
- package/src/lib/matcha-components.module.ts +12 -47
- package/src/lib/matcha-dialog/confirmation-dialog.component.ts +39 -0
- package/src/lib/matcha-dialog/confirmation-dialog.stories.ts +21 -0
- package/src/lib/matcha-divider/divider.argtypes.ts +18 -0
- package/src/lib/matcha-divider/divider.mdx +51 -0
- package/src/lib/matcha-divider/divider.module.ts +5 -9
- package/src/lib/matcha-divider/divider.stories.ts +49 -0
- package/src/lib/matcha-elevation/elevation.argtypes.ts +16 -0
- package/src/lib/matcha-elevation/elevation.directive.ts +24 -0
- package/src/lib/matcha-elevation/elevation.mdx +50 -0
- package/src/lib/matcha-elevation/elevation.module.ts +10 -0
- package/src/lib/matcha-elevation/elevation.stories.ts +50 -0
- package/src/lib/matcha-expansion/expansion.argtypes.ts +44 -0
- package/src/lib/matcha-expansion/expansion.directive.ts +11 -0
- package/src/lib/matcha-expansion/expansion.mdx +69 -0
- package/src/lib/matcha-expansion/expansion.module.ts +10 -0
- package/src/lib/matcha-expansion/expansion.stories.ts +67 -0
- package/src/lib/matcha-forms/form-field-argtype.ts +60 -0
- package/src/lib/matcha-forms/form-field.directive.ts +11 -0
- package/src/lib/matcha-forms/form-field.mdx +20 -0
- package/src/lib/matcha-forms/{matcha-form-field.stories.ts → form-field.stories.ts} +64 -68
- package/src/lib/matcha-forms/forms.module.ts +5 -14
- package/src/lib/matcha-headers/headers.argtype.ts +14 -0
- package/src/lib/matcha-headers/headers.mdx +94 -0
- package/src/lib/matcha-headers/headers.module.ts +12 -0
- package/src/lib/matcha-headers/headers.stories.ts +88 -0
- package/src/lib/matcha-headers/headine/headline.component.html +1 -0
- package/src/lib/matcha-headers/headine/headline.component.ts +20 -0
- package/src/lib/matcha-headers/subhead/subhead.component.html +1 -0
- package/src/lib/matcha-headers/subhead/subhead.component.ts +20 -0
- package/src/lib/matcha-headers/title/title.component.html +1 -0
- package/src/lib/matcha-headers/title/title.component.ts +20 -0
- package/src/lib/matcha-icon/icon-argtype.ts +36 -0
- package/src/lib/matcha-icon/icon.component.html +3 -0
- package/src/lib/matcha-icon/icon.component.scss +0 -0
- package/src/lib/matcha-icon/icon.component.ts +34 -0
- package/src/lib/matcha-icon/icon.mdx +60 -0
- package/src/lib/matcha-icon/icon.module.ts +5 -14
- package/src/lib/matcha-icon/icon.stories.ts +423 -0
- package/src/lib/matcha-input/input.argtypes.ts +42 -0
- package/src/lib/matcha-input/input.directive.ts +11 -0
- package/src/lib/matcha-input/input.mdx +73 -0
- package/src/lib/matcha-input/input.module.ts +9 -0
- package/src/lib/matcha-input/input.stories.ts +97 -0
- package/src/lib/matcha-list/list.argtypes.ts +44 -0
- package/src/lib/matcha-list/{matcha-list.directive.ts → list.directive.ts} +3 -8
- package/src/lib/matcha-list/list.mdx +69 -0
- package/src/lib/matcha-list/list.module.ts +5 -9
- package/src/lib/matcha-list/list.stories.ts +101 -0
- package/src/lib/matcha-menu/menu.argtypes.ts +114 -0
- package/src/lib/matcha-menu/menu.mdx +59 -0
- package/src/lib/matcha-menu/menu.module.ts +5 -9
- package/src/lib/matcha-menu/menu.stories.ts +122 -0
- package/src/lib/matcha-paginator/paginator-overview-example.component.ts +13 -0
- package/src/lib/matcha-paginator/paginator-overview-example.css +0 -0
- package/src/lib/matcha-paginator/paginator-overview-example.html +1 -0
- package/src/lib/matcha-paginator/paginator.argtypes.ts +11 -0
- package/src/lib/matcha-paginator/paginator.mdx +53 -0
- package/src/lib/matcha-paginator/paginator.module.ts +5 -9
- package/src/lib/matcha-paginator/paginator.stories.ts +34 -0
- package/src/lib/matcha-progress-bar/progress-bar.mdx +1 -1
- package/src/lib/matcha-progress-spinner/progress-spinner.mdx +33 -13
- package/src/lib/matcha-progress-spinner/progress-spinner.stories.ts +8 -8
- package/src/lib/matcha-select/select.argtypes.ts +265 -0
- package/src/lib/matcha-select/{matcha-select.directive.ts → select.directive.ts} +3 -8
- package/src/lib/matcha-select/select.mdx +54 -0
- package/src/lib/matcha-select/select.module.ts +5 -7
- package/src/lib/matcha-select/select.stories.ts +164 -0
- package/src/lib/matcha-sidenav/sidenav.argtypes.ts +60 -0
- package/src/lib/matcha-sidenav/sidenav.directive.ts +11 -0
- package/src/lib/matcha-sidenav/sidenav.mdx +57 -0
- package/src/lib/matcha-sidenav/sidenav.module.ts +10 -0
- package/src/lib/matcha-sidenav/sidenav.stories.ts +79 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.mdx +1 -1
- package/src/lib/matcha-slider/slider.argtypes.ts +83 -0
- package/src/lib/matcha-slider/slider.mdx +45 -0
- package/src/lib/matcha-slider/slider.stories.ts +149 -0
- package/src/lib/matcha-snackbar/snack-bar-overview-example.component.ts +23 -0
- package/src/lib/matcha-snackbar/snack-bar-overview-example.css +3 -0
- package/src/lib/matcha-snackbar/snack-bar-overview-example.html +11 -0
- package/src/lib/matcha-snackbar/snack-bar.argtypes.ts +11 -0
- package/src/lib/matcha-snackbar/snack-bar.directive.ts +11 -0
- package/src/lib/matcha-snackbar/snack-bar.mdx +53 -0
- package/src/lib/matcha-snackbar/snack-bar.module.ts +10 -0
- package/src/lib/matcha-snackbar/snack-bar.stories.ts +34 -0
- package/src/lib/matcha-sort-header/example/sort-overview-example.component.ts +67 -0
- package/src/lib/matcha-sort-header/example/sort-overview-example.css +3 -0
- package/src/lib/matcha-sort-header/example/sort-overview-example.html +21 -0
- package/src/lib/matcha-sort-header/sort-header.argtypes.ts +11 -0
- package/src/lib/matcha-sort-header/sort-header.mdx +78 -0
- package/src/lib/matcha-sort-header/sort-header.module.ts +5 -7
- package/src/lib/matcha-sort-header/sort-header.stories.ts +34 -0
- package/src/lib/matcha-stepper/stepper.argtypes.ts +92 -0
- package/src/lib/matcha-stepper/stepper.mdx +68 -0
- package/src/lib/matcha-stepper/stepper.module.ts +5 -7
- package/src/lib/matcha-stepper/stepper.stories.ts +163 -0
- package/src/lib/matcha-table/example/table-basic-example.component.ts +37 -0
- package/src/lib/matcha-table/example/table-basic-example.css +0 -0
- package/src/lib/matcha-table/example/table-basic-example.html +35 -0
- package/src/lib/matcha-table/table.argtypes.ts +11 -0
- package/src/lib/matcha-table/table.mdx +78 -0
- package/src/lib/matcha-table/table.module.ts +5 -7
- package/src/lib/matcha-table/table.stories.ts +34 -0
- package/src/lib/matcha-tabs/tabs.argtypes.ts +11 -0
- package/src/lib/matcha-tabs/tabs.mdx +69 -0
- package/src/lib/matcha-tabs/tabs.module.ts +5 -11
- package/src/lib/matcha-tabs/tabs.stories.ts +49 -0
- package/src/lib/matcha-toolbar/toolbar.argtypes.ts +20 -0
- package/src/lib/matcha-toolbar/toolbar.directive.ts +11 -0
- package/src/lib/matcha-toolbar/toolbar.mdx +57 -0
- package/src/lib/matcha-toolbar/toolbar.module.ts +10 -0
- package/src/lib/matcha-toolbar/toolbar.stories.ts +100 -0
- package/src/lib/matcha-tooltip/tooltip.argtypes.ts +11 -0
- package/src/lib/matcha-tooltip/tooltip.mdx +69 -0
- package/src/lib/matcha-tooltip/tooltip.module.ts +5 -7
- package/src/lib/matcha-tooltip/tooltip.stories.ts +79 -0
- package/src/lib/matcha-tree/tree.argtypes.ts +42 -0
- package/src/lib/matcha-tree/tree.mdx +49 -0
- package/src/lib/matcha-tree/tree.module.ts +5 -7
- package/src/lib/matcha-tree/tree.stories.ts +130 -0
- package/src/public-api.ts +27 -28
- package/src/lib/matcha-badge/matcha-badge.directive.ts +0 -16
- package/src/lib/matcha-buttons/buttons.module.ts +0 -27
- package/src/lib/matcha-buttons/matcha-btn-md.directive.ts +0 -16
- package/src/lib/matcha-buttons/matcha-btn-pill.directive.ts +0 -15
- package/src/lib/matcha-buttons/matcha-btn-size.directive.ts +0 -17
- package/src/lib/matcha-buttons/matcha-btn-xl.directive.ts +0 -15
- package/src/lib/matcha-card/card.mdx.txt +0 -55
- package/src/lib/matcha-card/matcha-card-argtype.ts +0 -123
- package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.html +0 -3
- package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.spec.ts +0 -21
- package/src/lib/matcha-card/matcha-card-content/matcha-card-content.component.ts +0 -10
- package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.html +0 -3
- package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.spec.ts +0 -21
- package/src/lib/matcha-card/matcha-card-footer/matcha-card-footer.component.ts +0 -10
- package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.html +0 -4
- package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.spec.ts +0 -21
- package/src/lib/matcha-card/matcha-card-header/matcha-card-header.component.ts +0 -10
- package/src/lib/matcha-card/matcha-card.component.scss +0 -117
- package/src/lib/matcha-card/matcha-card.component.spec.ts +0 -21
- package/src/lib/matcha-card/matcha-card.component.ts +0 -43
- package/src/lib/matcha-card/matcha-card.module.ts +0 -27
- package/src/lib/matcha-card/matcha-card.stories.ts +0 -80
- package/src/lib/matcha-expansion-panel/expansion-panel.module.ts +0 -14
- package/src/lib/matcha-expansion-panel/matcha-expansion-panel.directive.ts +0 -16
- package/src/lib/matcha-forms/matcha-form-field-appearance.directive.ts +0 -16
- package/src/lib/matcha-forms/matcha-form-field-argtype.ts +0 -73
- package/src/lib/matcha-forms/matcha-form-field.mdx +0 -284
- package/src/lib/matcha-forms/matcha-form-input-text.directive.ts +0 -16
- package/src/lib/matcha-icon/matcha-icon-position-pos.directive.ts +0 -15
- package/src/lib/matcha-icon/matcha-icon-position-pre.directive.ts +0 -15
- package/src/lib/matcha-menu/menu.stories.txt +0 -76
- package/src/lib/matcha-snackbar/matcha-snackbar.directive.ts +0 -16
- package/src/lib/matcha-snackbar/snackbar.module.ts +0 -12
- package/src/lib/matcha-title/matcha-title.component.html +0 -33
- package/src/lib/matcha-title/matcha-title.component.spec.ts +0 -21
- package/src/lib/matcha-title/matcha-title.component.ts +0 -24
- package/src/lib/matcha-title/matcha-title.module.ts +0 -18
- /package/src/lib/matcha-bottom-sheet/{matcha-bottom-sheet.directive.ts → bottom-sheet.directive.ts} +0 -0
- /package/src/lib/{matcha-buttons/button.stories.ts → matcha-button/button.stories.ts.TXT} +0 -0
- /package/src/lib/matcha-card/{matcha-card.component.html → card.component.html} +0 -0
- /package/src/lib/matcha-card/{matcha-card-content/matcha-card-content.component.scss → card.component.scss} +0 -0
- /package/src/lib/matcha-divider/{matcha-divider.directive.ts → divider.directive.ts} +0 -0
- /package/src/lib/{matcha-card/matcha-card-footer/matcha-card-footer.component.scss → matcha-headers/headine/headline.component.scss} +0 -0
- /package/src/lib/{matcha-card/matcha-card-header/matcha-card-header.component.scss → matcha-headers/subhead/subhead.component.scss} +0 -0
- /package/src/lib/{matcha-title/matcha-title.component.scss → matcha-headers/title/title.component.scss} +0 -0
- /package/src/lib/matcha-menu/{matcha-menu.directive.ts → menu.directive.ts} +0 -0
- /package/src/lib/matcha-paginator/{matcha-paginator.directive.ts → paginator.directive.ts} +0 -0
- /package/src/lib/matcha-sort-header/{matcha-sort-header.directive.ts → sort-header.directive.ts} +0 -0
- /package/src/lib/matcha-stepper/{matcha-stepper.directive.ts → stepper.directive.ts} +0 -0
- /package/src/lib/matcha-table/{matcha-table.directive.ts → table.directive.ts} +0 -0
- /package/src/lib/matcha-tabs/{matcha-tabs.directive.ts → tabs.directive.ts} +0 -0
- /package/src/lib/matcha-tooltip/{matcha-tooltip.directive.ts → tooltip.directive.ts} +0 -0
- /package/src/lib/matcha-tree/{matcha-tree.directive.ts → tree.directive.ts} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const inputArgtypes = {
|
|
2
|
+
errorStateMatcher: {
|
|
3
|
+
description: 'An object used to control when error messages are shown.',
|
|
4
|
+
control: null, // Como é um objeto, não é necessário um controle.
|
|
5
|
+
table: {
|
|
6
|
+
disable: true, // Desativamos a tabela para evitar a exibição de informações desnecessárias.
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
readonly: {
|
|
10
|
+
description: 'Whether the element is readonly.',
|
|
11
|
+
control: 'boolean',
|
|
12
|
+
defaultValue: false, // Defina o valor padrão conforme necessário.
|
|
13
|
+
table: {
|
|
14
|
+
type: { summary: 'boolean' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
description: 'Input type of the element.',
|
|
19
|
+
control: 'text', // Você pode alterar o controle para 'select' se houver opções específicas de tipo que deseja listar.
|
|
20
|
+
defaultValue: 'text', // Defina o valor padrão conforme necessário.
|
|
21
|
+
table: {
|
|
22
|
+
type: { summary: 'string' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
errorState: {
|
|
26
|
+
description: 'Whether the component is in an error state.',
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
defaultValue: false, // Defina o valor padrão conforme necessário.
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: 'boolean' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
description: 'Theme color palette',
|
|
35
|
+
control: 'select',
|
|
36
|
+
defaultValue: 'accent',
|
|
37
|
+
table: {
|
|
38
|
+
defaultValue: { summary: 'accent' },
|
|
39
|
+
},
|
|
40
|
+
options: ['primary', 'accent', 'warn'],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matcha-input]',
|
|
5
|
+
})
|
|
6
|
+
export class MatchaInputDirective {
|
|
7
|
+
constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {
|
|
8
|
+
//this._elementRef.nativeElement.style.backgroundColor = 'grey';
|
|
9
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'matcha-input');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Story } from "@storybook/blocks";
|
|
2
|
+
import { Meta } from "@storybook/addon-docs";
|
|
3
|
+
import * as ComponentStories from "./input.stories";
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms / Input / Documentação" />
|
|
6
|
+
|
|
7
|
+
# Input
|
|
8
|
+
|
|
9
|
+
> _input_ "ESCREVER DEFINIÇÃO DO ATÔMICO"
|
|
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">Input - Date range picker comparison ranges</span>
|
|
19
|
+
<div class="matcha-card background-bg">
|
|
20
|
+
<Story of={ComponentStories.InputClearButton} />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="d-flex-column">
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<form>
|
|
27
|
+
<mat-form-field matcha-input appearance="outline" [color]="color">
|
|
28
|
+
<mat-label>First campaign</mat-label>
|
|
29
|
+
<mat-date-range-input
|
|
30
|
+
[formGroup]="campaignOne"
|
|
31
|
+
[rangePicker]="campaignOnePicker"
|
|
32
|
+
[comparisonStart]="campaignTwo.value.start"
|
|
33
|
+
[comparisonEnd]="campaignTwo.value.end">
|
|
34
|
+
<input matStartDate placeholder="Start date" formControlName="start">
|
|
35
|
+
<input matEndDate placeholder="End date" formControlName="end">
|
|
36
|
+
</mat-date-range-input>
|
|
37
|
+
<mat-hint>MM/DD/YYYY - MM/DD/YYYY</mat-hint>
|
|
38
|
+
<mat-datepicker-toggle matIconSuffix [for]="campaignOnePicker"></mat-datepicker-toggle>
|
|
39
|
+
<mat-date-range-picker #campaignOnePicker></mat-date-range-picker>
|
|
40
|
+
</mat-form-field>
|
|
41
|
+
|
|
42
|
+
<mat-form-field matcha-datepicker appearance="outline" [color]="color">
|
|
43
|
+
<mat-label>Second campaign</mat-label>
|
|
44
|
+
<mat-date-range-input
|
|
45
|
+
[formGroup]="campaignTwo"
|
|
46
|
+
[rangePicker]="campaignTwoPicker"
|
|
47
|
+
[comparisonStart]="campaignOne.value.start"
|
|
48
|
+
[comparisonEnd]="campaignOne.value.end">
|
|
49
|
+
<input matStartDate placeholder="Start date" formControlName="start">
|
|
50
|
+
<input matEndDate placeholder="End date" formControlName="end">
|
|
51
|
+
</mat-date-range-input>
|
|
52
|
+
<mat-datepicker-toggle matIconSuffix [for]="campaignTwoPicker"></mat-datepicker-toggle>
|
|
53
|
+
<mat-hint>MM/DD/YYYY - MM/DD/YYYY</mat-hint>
|
|
54
|
+
<mat-date-range-picker #campaignTwoPicker></mat-date-range-picker>
|
|
55
|
+
</mat-form-field>
|
|
56
|
+
</form>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<br />
|
|
66
|
+
|
|
67
|
+
### Installation
|
|
68
|
+
|
|
69
|
+
`import {MatDatepickerModule} from '@angular/material/input';`
|
|
70
|
+
|
|
71
|
+
[Official documentation](https://https://material.angular.io/components/input/overview)
|
|
72
|
+
|
|
73
|
+
<br />
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { applicationConfig, Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { NgIf, NgFor, AsyncPipe, JsonPipe } from '@angular/common';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { FormControl, FormGroupDirective, FormsModule, NgForm, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
5
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
|
+
import { MatInputModule } from '@angular/material/input';
|
|
7
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
9
|
+
import { ErrorStateMatcher } from '@angular/material/core';
|
|
10
|
+
import { inputArgtypes } from './input.argtypes';
|
|
11
|
+
import { MatchaInputDirective } from './input.directive';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Atoms / Input',
|
|
15
|
+
decorators: [
|
|
16
|
+
applicationConfig({
|
|
17
|
+
providers: [provideAnimations()],
|
|
18
|
+
}),
|
|
19
|
+
|
|
20
|
+
moduleMetadata({
|
|
21
|
+
imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatButtonModule, ReactiveFormsModule, NgIf, JsonPipe, NgFor, AsyncPipe],
|
|
22
|
+
declarations: [MatchaInputDirective],
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
args: {
|
|
26
|
+
color: 'accent',
|
|
27
|
+
},
|
|
28
|
+
argTypes: inputArgtypes,
|
|
29
|
+
parameters: {
|
|
30
|
+
controls: { expanded: true },
|
|
31
|
+
},
|
|
32
|
+
} as Meta;
|
|
33
|
+
|
|
34
|
+
const value = 'Clear me';
|
|
35
|
+
|
|
36
|
+
export const InputClearButton: StoryObj = {
|
|
37
|
+
render: (args) => ({
|
|
38
|
+
props: {
|
|
39
|
+
...args,
|
|
40
|
+
value,
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<div class="d-flex-center-center">
|
|
44
|
+
<form class="matcha-card background-surface d-flex-column gap-16 max-w-256 w-256">
|
|
45
|
+
<mat-form-field appearance="outline" [color]="color">
|
|
46
|
+
|
|
47
|
+
<mat-label>Clearable input</mat-label>
|
|
48
|
+
<input matInput [type]="text" [(ngModel)]="value">
|
|
49
|
+
<button *ngIf="value" matSuffix mat-icon-button aria-label="Clear" (click)="value=''">
|
|
50
|
+
<span class="i-matcha-action_close"></span>
|
|
51
|
+
</button>
|
|
52
|
+
|
|
53
|
+
</mat-form-field>
|
|
54
|
+
</form>
|
|
55
|
+
</div>
|
|
56
|
+
`,
|
|
57
|
+
}),
|
|
58
|
+
name: 'Input Clear Button',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const emailFormControl = new FormControl('', [Validators.required, Validators.email]);
|
|
62
|
+
|
|
63
|
+
export const InputWithErrorMessage: StoryObj = {
|
|
64
|
+
render: (args) => ({
|
|
65
|
+
props: {
|
|
66
|
+
...args,
|
|
67
|
+
emailFormControl,
|
|
68
|
+
},
|
|
69
|
+
template: `
|
|
70
|
+
<div class="d-flex-center-center">
|
|
71
|
+
<form class="matcha-card background-surface d-flex-column gap-16 max-w-256">
|
|
72
|
+
<mat-form-field appearance="outline" [color]="color">
|
|
73
|
+
|
|
74
|
+
<mat-label>Email</mat-label>
|
|
75
|
+
<input type="email" matInput [formControl]="emailFormControl" placeholder="Ex. pat@example.com">
|
|
76
|
+
<mat-error *ngIf="emailFormControl.hasError('email') && !emailFormControl.hasError('required')">
|
|
77
|
+
Please enter a valid email address
|
|
78
|
+
</mat-error>
|
|
79
|
+
<mat-error *ngIf="emailFormControl.hasError('required')">
|
|
80
|
+
Email is <strong>required</strong>
|
|
81
|
+
</mat-error>
|
|
82
|
+
|
|
83
|
+
</mat-form-field>
|
|
84
|
+
</form>
|
|
85
|
+
</div>
|
|
86
|
+
`,
|
|
87
|
+
}),
|
|
88
|
+
name: 'Input with error messages',
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** Error when invalid control is dirty, touched, or submitted. */
|
|
92
|
+
export class MyErrorStateMatcher implements ErrorStateMatcher {
|
|
93
|
+
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
|
|
94
|
+
const isSubmitted = form && form.submitted;
|
|
95
|
+
return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const listArgtypes = {
|
|
2
|
+
displayMode: {
|
|
3
|
+
description: 'Display mode used for all list panels in the accordion.',
|
|
4
|
+
control: 'select',
|
|
5
|
+
options: ['default', 'flat'],
|
|
6
|
+
defaultValue: 'default',
|
|
7
|
+
table: {
|
|
8
|
+
type: { summary: 'MatAccordionDisplayMode' },
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
hideToggle: {
|
|
12
|
+
description: 'Whether the list indicator should be hidden.',
|
|
13
|
+
control: 'boolean',
|
|
14
|
+
defaultValue: false,
|
|
15
|
+
table: {
|
|
16
|
+
type: { summary: 'boolean' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
multi: {
|
|
20
|
+
description: 'Whether the accordion should allow multiple expanded accordion items simultaneously.',
|
|
21
|
+
control: 'boolean',
|
|
22
|
+
defaultValue: false,
|
|
23
|
+
table: {
|
|
24
|
+
type: { summary: 'boolean' },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
togglePosition: {
|
|
28
|
+
description: 'The position of the list indicator.',
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: ['before', 'after'],
|
|
31
|
+
defaultValue: 'before',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'MatAccordionTogglePosition' },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
id: {
|
|
37
|
+
description: 'A readonly id value to use for unique selection coordination.',
|
|
38
|
+
control: 'text',
|
|
39
|
+
defaultValue: '',
|
|
40
|
+
table: {
|
|
41
|
+
type: { summary: 'string' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
@Directive({
|
|
4
|
-
|
|
4
|
+
selector: '[matchaList]',
|
|
5
5
|
})
|
|
6
6
|
export class MatchaListDirective {
|
|
7
|
-
|
|
8
|
-
constructor(
|
|
9
|
-
private _elementRef: ElementRef,
|
|
10
|
-
private _renderer: Renderer2
|
|
11
|
-
) {
|
|
7
|
+
constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {
|
|
12
8
|
//this._elementRef.nativeElement.style.backgroundColor = 'grey';
|
|
13
|
-
this._renderer.addClass(this._elementRef.nativeElement, 'matcha-list')
|
|
9
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'matcha-list');
|
|
14
10
|
}
|
|
15
|
-
|
|
16
11
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Story } from "@storybook/blocks";
|
|
2
|
+
import { Meta } from "@storybook/addon-docs";
|
|
3
|
+
import * as ComponentStories from "./list.stories";
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms / List / Documentação" />
|
|
6
|
+
|
|
7
|
+
# List
|
|
8
|
+
|
|
9
|
+
> _list_ "ESCREVER DEFINIÇÃO DO ATÔMICO"
|
|
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">List overview</span>
|
|
19
|
+
<div class="matcha-card background-bg">
|
|
20
|
+
<Story of={ComponentStories.ListOverview} />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="d-flex-column">
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
|
|
27
|
+
<mat-accordion>
|
|
28
|
+
<mat-list-panel hideToggle>
|
|
29
|
+
<mat-list-panel-header>
|
|
30
|
+
<mat-panel-title>
|
|
31
|
+
This is the list title
|
|
32
|
+
</mat-panel-title>
|
|
33
|
+
<mat-panel-description>
|
|
34
|
+
This is a summary of the content
|
|
35
|
+
</mat-panel-description>
|
|
36
|
+
</mat-list-panel-header>
|
|
37
|
+
<p>This is the primary content of the panel.</p>
|
|
38
|
+
</mat-list-panel>
|
|
39
|
+
<mat-list-panel (opened)="panelOpenState = true"
|
|
40
|
+
(closed)="panelOpenState = false">
|
|
41
|
+
<mat-list-panel-header>
|
|
42
|
+
<mat-panel-title>
|
|
43
|
+
Self aware panel
|
|
44
|
+
</mat-panel-title>
|
|
45
|
+
<mat-panel-description>
|
|
46
|
+
Currently I am {{panelOpenState ? 'open' : 'closed'}}
|
|
47
|
+
</mat-panel-description>
|
|
48
|
+
</mat-list-panel-header>
|
|
49
|
+
<p>I'm visible because I am open</p>
|
|
50
|
+
</mat-list-panel>
|
|
51
|
+
</mat-accordion>
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<br />
|
|
62
|
+
|
|
63
|
+
### Installation
|
|
64
|
+
|
|
65
|
+
`import {MatListModule} from '@angular/material/list';`
|
|
66
|
+
|
|
67
|
+
[Official documentation](https://https://material.angular.io/components/list/overview)
|
|
68
|
+
|
|
69
|
+
<br />
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { MatchaListDirective } from './
|
|
3
|
+
import { MatchaListDirective } from './list.directive';
|
|
4
4
|
|
|
5
5
|
@NgModule({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
],
|
|
10
|
-
exports:[
|
|
11
|
-
MatchaListDirective
|
|
12
|
-
]
|
|
6
|
+
declarations: [MatchaListDirective],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [MatchaListDirective],
|
|
13
9
|
})
|
|
14
|
-
export class MatchaListModule {
|
|
10
|
+
export class MatchaListModule {}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { applicationConfig, Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
|
|
3
|
+
import { NgIf, NgFor, AsyncPipe, JsonPipe, DatePipe } from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
7
|
+
|
|
8
|
+
import { MatListModule } from '@angular/material/list';
|
|
9
|
+
|
|
10
|
+
import { listArgtypes } from './list.argtypes';
|
|
11
|
+
import { MatchaListDirective } from './list.directive';
|
|
12
|
+
|
|
13
|
+
export interface Section {
|
|
14
|
+
name: string;
|
|
15
|
+
updated: Date;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
title: 'Atoms / List',
|
|
20
|
+
decorators: [
|
|
21
|
+
applicationConfig({
|
|
22
|
+
providers: [provideAnimations()],
|
|
23
|
+
}),
|
|
24
|
+
|
|
25
|
+
moduleMetadata({
|
|
26
|
+
imports: [CommonModule, MatListModule, NgIf, JsonPipe, NgFor, AsyncPipe, DatePipe],
|
|
27
|
+
declarations: [MatchaListDirective],
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
args: {},
|
|
31
|
+
argTypes: listArgtypes,
|
|
32
|
+
parameters: {
|
|
33
|
+
controls: { expanded: true },
|
|
34
|
+
},
|
|
35
|
+
} as Meta;
|
|
36
|
+
|
|
37
|
+
export const ListOverview: StoryObj = {
|
|
38
|
+
render: (args) => ({
|
|
39
|
+
props: {
|
|
40
|
+
...args,
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<mat-list role="list">
|
|
44
|
+
<mat-list-item role="listitem">Item 1</mat-list-item>
|
|
45
|
+
<mat-list-item role="listitem">Item 2</mat-list-item>
|
|
46
|
+
<mat-list-item role="listitem">Item 3</mat-list-item>
|
|
47
|
+
</mat-list>
|
|
48
|
+
`,
|
|
49
|
+
}),
|
|
50
|
+
name: 'List Overview',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const folders: Section[] = [
|
|
54
|
+
{
|
|
55
|
+
name: 'Photos',
|
|
56
|
+
updated: new Date('1/1/16'),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Recipes',
|
|
60
|
+
updated: new Date('1/17/16'),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Work',
|
|
64
|
+
updated: new Date('1/28/16'),
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const notes: Section[] = [
|
|
69
|
+
{
|
|
70
|
+
name: 'Vacation Itinerary',
|
|
71
|
+
updated: new Date('2/20/16'),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Kitchen Remodel',
|
|
75
|
+
updated: new Date('1/18/16'),
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
export const ListWithSections: StoryObj = {
|
|
80
|
+
render: (args) => ({
|
|
81
|
+
props: {
|
|
82
|
+
...args,
|
|
83
|
+
},
|
|
84
|
+
template: `
|
|
85
|
+
<mat-list>
|
|
86
|
+
<div mat-subheader>Folders</div>
|
|
87
|
+
<mat-list-item *ngFor="let folder of folders">
|
|
88
|
+
<div matListItemTitle>{{folder.name}}</div>
|
|
89
|
+
<div matListItemLine>{{folder.updated | date}}</div>
|
|
90
|
+
</mat-list-item>
|
|
91
|
+
<mat-divider></mat-divider>
|
|
92
|
+
<div mat-subheader>Notes</div>
|
|
93
|
+
<mat-list-item *ngFor="let note of notes">
|
|
94
|
+
<div matListItemTitle>{{note.name}}</div>
|
|
95
|
+
<div matListItemLine>{{note.updated | date}}</div>
|
|
96
|
+
</mat-list-item>
|
|
97
|
+
</mat-list>
|
|
98
|
+
`,
|
|
99
|
+
}),
|
|
100
|
+
name: 'List With Sections',
|
|
101
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
let menuPanelUid = 0;
|
|
2
|
+
|
|
3
|
+
export const menuArgtypes = {
|
|
4
|
+
'aria-describedby': {
|
|
5
|
+
description: 'aria-describedby for the menu panel.',
|
|
6
|
+
control: 'text',
|
|
7
|
+
defaultValue: '',
|
|
8
|
+
table: {
|
|
9
|
+
type: { summary: 'string' },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
'aria-label': {
|
|
13
|
+
description: 'aria-label for the menu panel.',
|
|
14
|
+
control: 'text',
|
|
15
|
+
defaultValue: '',
|
|
16
|
+
table: {
|
|
17
|
+
type: { summary: 'string' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
'aria-labelledby': {
|
|
21
|
+
description: 'aria-labelledby for the menu panel.',
|
|
22
|
+
control: 'text',
|
|
23
|
+
defaultValue: '',
|
|
24
|
+
table: {
|
|
25
|
+
type: { summary: 'string' },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
backdropClass: {
|
|
29
|
+
description: 'Class to be added to the backdrop element.',
|
|
30
|
+
control: 'text',
|
|
31
|
+
defaultValue: '',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'string' },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
hasBackdrop: {
|
|
37
|
+
description: 'Whether the menu has a backdrop.',
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
defaultValue: false,
|
|
40
|
+
table: {
|
|
41
|
+
type: { summary: 'boolean | undefined' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
overlapTrigger: {
|
|
45
|
+
description: 'Whether the menu should overlap its trigger.',
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
defaultValue: false,
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: 'boolean' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
class: {
|
|
53
|
+
description: "This method takes classes set on the host mat-menu element and applies them on the menu template that displays in the overlay container. Otherwise, it's difficult to style the containing menu from outside the component.",
|
|
54
|
+
control: 'text',
|
|
55
|
+
defaultValue: '',
|
|
56
|
+
table: {
|
|
57
|
+
type: { summary: 'string' },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
xPosition: {
|
|
61
|
+
description: 'Position of the menu in the X axis.',
|
|
62
|
+
control: 'select',
|
|
63
|
+
options: ['before', 'after'],
|
|
64
|
+
defaultValue: 'after',
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: 'MenuPositionX' },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
yPosition: {
|
|
70
|
+
description: 'Position of the menu in the Y axis.',
|
|
71
|
+
control: 'select',
|
|
72
|
+
options: ['above', 'below'],
|
|
73
|
+
defaultValue: 'below',
|
|
74
|
+
table: {
|
|
75
|
+
type: { summary: 'MenuPositionY' },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
closed: {
|
|
79
|
+
description: 'Event emitted when the menu is closed.',
|
|
80
|
+
action: 'closed',
|
|
81
|
+
},
|
|
82
|
+
direction: {
|
|
83
|
+
description: 'Layout direction of the menu.',
|
|
84
|
+
control: 'select',
|
|
85
|
+
options: ['ltr', 'rtl'],
|
|
86
|
+
defaultValue: 'ltr',
|
|
87
|
+
table: {
|
|
88
|
+
type: { summary: 'Direction' },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
overlayPanelClass: {
|
|
92
|
+
description: 'Class or list of classes to be added to the overlay panel.',
|
|
93
|
+
control: 'text',
|
|
94
|
+
defaultValue: '',
|
|
95
|
+
table: {
|
|
96
|
+
type: { summary: 'string | string[]' },
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
panelId: {
|
|
100
|
+
description: 'ID of the menu panel.',
|
|
101
|
+
control: 'text',
|
|
102
|
+
defaultValue: `mat-menu-panel-${menuPanelUid++}`,
|
|
103
|
+
table: {
|
|
104
|
+
type: { summary: 'string' },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
parentMenu: {
|
|
108
|
+
description: 'Parent menu of the current menu panel.',
|
|
109
|
+
control: null, // Como é um componente, não é necessário um controle.
|
|
110
|
+
table: {
|
|
111
|
+
disable: true,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Story } from "@storybook/blocks";
|
|
2
|
+
import { Meta } from "@storybook/addon-docs";
|
|
3
|
+
import * as ComponentStories from "./menu.stories";
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms / Menu / Documentação" />
|
|
6
|
+
|
|
7
|
+
# Menu
|
|
8
|
+
|
|
9
|
+
> _menu_ é um painel flutuante contendo uma lista de opções.
|
|
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">Menu com ícones</span>
|
|
19
|
+
<div class="matcha-card background-bg">
|
|
20
|
+
<Story of={ComponentStories.MenuWithIcons} />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="d-flex-column">
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
|
|
27
|
+
<span class="i-matcha-favorite"></span>
|
|
28
|
+
</button>
|
|
29
|
+
<mat-menu #menu="matMenu">
|
|
30
|
+
<button mat-menu-item>
|
|
31
|
+
<span class="i-matcha-favorite mr-8"></span>
|
|
32
|
+
<span class="par-m">Radial</span>
|
|
33
|
+
</button>
|
|
34
|
+
<button mat-menu-item disabled>
|
|
35
|
+
<span class="i-matcha-favorite mr-8"></span>
|
|
36
|
+
<span class="par-m">Check voice mail</span>
|
|
37
|
+
</button>
|
|
38
|
+
<button mat-menu-item>
|
|
39
|
+
<span class="i-matcha-favorite mr-8"></span>
|
|
40
|
+
<span class="par-m">Disable alerts</span>
|
|
41
|
+
</button>
|
|
42
|
+
</mat-menu>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<br />
|
|
52
|
+
|
|
53
|
+
### Installation
|
|
54
|
+
|
|
55
|
+
`import {MatDatepickerModule} from '@angular/material/menu';`
|
|
56
|
+
|
|
57
|
+
[Official documentation](https://https://material.angular.io/components/menu/overview)
|
|
58
|
+
|
|
59
|
+
<br />
|