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,43 @@
|
|
|
1
|
+
import { Story } from "@storybook/blocks";
|
|
2
|
+
import { Meta } from "@storybook/addon-docs";
|
|
3
|
+
import * as ComponentStories from "./card.stories";
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms / Card / Documentação" />
|
|
6
|
+
|
|
7
|
+
# Card
|
|
8
|
+
|
|
9
|
+
> _card_ "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">Card overview</span>
|
|
19
|
+
<div class="matcha-card background-bg">
|
|
20
|
+
<Story of={ComponentStories.CardOverview} />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="d-flex-column">
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<matcha-card blockquoteColor="foreground" elevation="1" blockquote="left" backgroundColor="surface" alpha="false">
|
|
27
|
+
Card Content
|
|
28
|
+
</matcha-card>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<br />
|
|
38
|
+
|
|
39
|
+
### Installation
|
|
40
|
+
|
|
41
|
+
`import { MatchaCardModule } from 'matcha-components';`
|
|
42
|
+
|
|
43
|
+
<br />
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatchaCardComponent } from './card.component';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
declarations: [MatchaCardComponent],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [MatchaCardComponent],
|
|
9
|
+
})
|
|
10
|
+
export class MatchaCardModule {}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { MatchaCardModule } from './card.module';
|
|
3
|
+
import { cardArgtypes } from './card-argtype';
|
|
4
|
+
|
|
5
|
+
/** Este é o card principal */
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Atoms/Card',
|
|
8
|
+
decorators: [
|
|
9
|
+
moduleMetadata({
|
|
10
|
+
imports: [MatchaCardModule],
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
// tags: ['autodocs'],
|
|
14
|
+
args: {
|
|
15
|
+
elevation: 1,
|
|
16
|
+
blockquote: 'left',
|
|
17
|
+
blockquoteColor: 'accent',
|
|
18
|
+
color: 'surface',
|
|
19
|
+
label: 'Card Content',
|
|
20
|
+
},
|
|
21
|
+
argTypes: cardArgtypes,
|
|
22
|
+
parameters: {
|
|
23
|
+
docs: {
|
|
24
|
+
// canvas: { sourceState: 'shown' },
|
|
25
|
+
source: { type: 'code' },
|
|
26
|
+
},
|
|
27
|
+
controls: {
|
|
28
|
+
expanded: true,
|
|
29
|
+
exclude: ['mode'],
|
|
30
|
+
},
|
|
31
|
+
componentSubtitle: 'Displays an image that represents a user or organization',
|
|
32
|
+
},
|
|
33
|
+
} as Meta;
|
|
34
|
+
|
|
35
|
+
/** Este é o card principal */
|
|
36
|
+
export const CardOverview: StoryObj = {
|
|
37
|
+
render: (args) => ({
|
|
38
|
+
props: {
|
|
39
|
+
...args,
|
|
40
|
+
},
|
|
41
|
+
template: `
|
|
42
|
+
<div class="d-flex-column gap-16">
|
|
43
|
+
<matcha-card [blockquoteColor]="blockquoteColor" [elevation]="elevation" [blockquote]="blockquote" [color]="color" [alpha]="alpha">{{ label }}</matcha-card>
|
|
44
|
+
<div>
|
|
45
|
+
`,
|
|
46
|
+
}),
|
|
47
|
+
name: 'Card Overview',
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const WithNestedUsage: StoryObj = {
|
|
51
|
+
render: () => ({
|
|
52
|
+
props: {
|
|
53
|
+
elevation: 10,
|
|
54
|
+
blockquote: 'left',
|
|
55
|
+
blockquoteColor: 'foreground',
|
|
56
|
+
color: 'surface',
|
|
57
|
+
label: 'Card Content',
|
|
58
|
+
},
|
|
59
|
+
template: `
|
|
60
|
+
<div class="d-flex-column gap-16">
|
|
61
|
+
<matcha-card elevation="1" blockquote="left" color="surface">
|
|
62
|
+
Surface Color
|
|
63
|
+
<matcha-card elevation="1" blockquote="right" color="bg" class="p-0">
|
|
64
|
+
Background color
|
|
65
|
+
<matcha-card elevation="1" blockquote="left" color="surface" alpha="true">
|
|
66
|
+
Surface Alpha
|
|
67
|
+
<matcha-card elevation="1" blockquote="right" color="bg" alpha="true">Background Alpha</matcha-card>
|
|
68
|
+
</matcha-card>
|
|
69
|
+
</matcha-card>
|
|
70
|
+
</matcha-card>
|
|
71
|
+
<div>
|
|
72
|
+
`,
|
|
73
|
+
inlineStory: true,
|
|
74
|
+
}),
|
|
75
|
+
name: 'Nested',
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const WithColoredUsage: StoryObj = {
|
|
79
|
+
render: (args) => ({
|
|
80
|
+
props: {
|
|
81
|
+
...args,
|
|
82
|
+
elevation: 1,
|
|
83
|
+
blockquote: 'left',
|
|
84
|
+
blockquoteColor: 'yellow',
|
|
85
|
+
color: 'yellow',
|
|
86
|
+
},
|
|
87
|
+
template: `
|
|
88
|
+
<matcha-card [blockquoteColor]="blockquoteColor" [elevation]="elevation" [blockquote]="blockquote" [color]="color">{{ label }}</matcha-card>
|
|
89
|
+
`,
|
|
90
|
+
}),
|
|
91
|
+
name: 'Raised',
|
|
92
|
+
};
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import { MatchaCardModule } from './matcha-card/
|
|
3
|
-
import {
|
|
2
|
+
import { MatchaCardModule } from './matcha-card/card.module';
|
|
3
|
+
import { MatchaHeadersModule } from './matcha-headers/headers.module';
|
|
4
4
|
|
|
5
5
|
import { MatchaAutocompleteModule } from './matcha-autocomplete/autocomplete.module';
|
|
6
6
|
import { MatchaBadgeModule } from './matcha-badge/badge.module';
|
|
7
7
|
import { MatchaTabsModule } from './matcha-tabs/tabs.module';
|
|
8
8
|
import { MatchaBottomSheetModule } from './matcha-bottom-sheet/bottom-sheet.module';
|
|
9
9
|
import { MatchaButtonToggleModule } from './matcha-button-toggle/button-toggle.module';
|
|
10
|
-
import {
|
|
10
|
+
import { MatchaButtonModule } from './matcha-button/button.module';
|
|
11
11
|
import { MatchaCheckboxModule } from './matcha-checkbox/checkbox.module';
|
|
12
12
|
import { MatchaChipsModule } from './matcha-chips/chips.module';
|
|
13
13
|
import { MatchaDatepickerModule } from './matcha-datepicker/datepicker.module';
|
|
14
14
|
import { MatchaDialogModule } from './matcha-dialog/dialog.module';
|
|
15
15
|
import { MatchaDividerModule } from './matcha-divider/divider.module';
|
|
16
|
-
import {
|
|
16
|
+
import { MatchaElevationModule } from './matcha-elevation/elevation.module';
|
|
17
|
+
import { MatchaExpansionModule } from './matcha-expansion/expansion.module';
|
|
17
18
|
import { MatchaFormsModule } from './matcha-forms/forms.module';
|
|
18
19
|
import { MatchaIconModule } from './matcha-icon/icon.module';
|
|
20
|
+
import { MatchaInputModule } from './matcha-input/input.module';
|
|
19
21
|
import { MatchaListModule } from './matcha-list/list.module';
|
|
20
22
|
import { MatchaMenuModule } from './matcha-menu/menu.module';
|
|
23
|
+
import { MatchaSidenavModule } from './matcha-sidenav/sidenav.module';
|
|
21
24
|
import { MatchaPaginatorModule } from './matcha-paginator/paginator.module';
|
|
22
25
|
import { MatchaProgressBarModule } from './matcha-progress-bar/progress-bar.module';
|
|
23
26
|
import { MatchaProgressSpinnerModule } from './matcha-progress-spinner/progress-spinner.module';
|
|
@@ -25,54 +28,16 @@ import { MatchaRadioButtonModule } from './matcha-radio-button/radio-button.modu
|
|
|
25
28
|
import { MatchaSelectModule } from './matcha-select/select.module';
|
|
26
29
|
import { MatchaSlideToggleModule } from './matcha-slide-toggle/slide-toggle.module';
|
|
27
30
|
import { MatchaSliderModule } from './matcha-slider/slider.module';
|
|
28
|
-
import {
|
|
31
|
+
import { MatchaSnackBarModule } from './matcha-snackbar/snack-bar.module';
|
|
29
32
|
import { MatchaSortHeaderModule } from './matcha-sort-header/sort-header.module';
|
|
30
33
|
import { MatchaStepperModule } from './matcha-stepper/stepper.module';
|
|
31
34
|
import { MatchaTableModule } from './matcha-table/table.module';
|
|
32
35
|
import { MatchaTooltipModule } from './matcha-tooltip/tooltip.module';
|
|
33
36
|
import { MatchaTreeModule } from './matcha-tree/tree.module';
|
|
34
37
|
|
|
35
|
-
|
|
36
38
|
@NgModule({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
MatchaCardModule,
|
|
40
|
-
MatchaTitleModule,
|
|
41
|
-
],
|
|
42
|
-
exports: [
|
|
43
|
-
MatchaCardModule,
|
|
44
|
-
MatchaTitleModule,
|
|
45
|
-
|
|
46
|
-
MatchaAutocompleteModule,
|
|
47
|
-
MatchaBadgeModule,
|
|
48
|
-
MatchaTabsModule,
|
|
49
|
-
MatchaBottomSheetModule,
|
|
50
|
-
MatchaButtonToggleModule,
|
|
51
|
-
MatchaButtonsModule,
|
|
52
|
-
MatchaCheckboxModule,
|
|
53
|
-
MatchaChipsModule,
|
|
54
|
-
MatchaDatepickerModule,
|
|
55
|
-
MatchaDialogModule,
|
|
56
|
-
MatchaDividerModule,
|
|
57
|
-
MatchaExpansionPanelModule,
|
|
58
|
-
MatchaFormsModule,
|
|
59
|
-
MatchaIconModule,
|
|
60
|
-
MatchaListModule,
|
|
61
|
-
MatchaMenuModule,
|
|
62
|
-
MatchaPaginatorModule,
|
|
63
|
-
MatchaProgressBarModule,
|
|
64
|
-
MatchaProgressSpinnerModule,
|
|
65
|
-
MatchaRadioButtonModule,
|
|
66
|
-
MatchaSelectModule,
|
|
67
|
-
MatchaSlideToggleModule,
|
|
68
|
-
MatchaSliderModule,
|
|
69
|
-
MatchaSnackbarModule,
|
|
70
|
-
MatchaSortHeaderModule,
|
|
71
|
-
MatchaStepperModule,
|
|
72
|
-
MatchaTableModule,
|
|
73
|
-
MatchaTabsModule,
|
|
74
|
-
MatchaTooltipModule,
|
|
75
|
-
MatchaTreeModule,
|
|
76
|
-
]
|
|
39
|
+
declarations: [],
|
|
40
|
+
imports: [MatchaCardModule, MatchaHeadersModule],
|
|
41
|
+
exports: [MatchaCardModule, MatchaHeadersModule, MatchaAutocompleteModule, MatchaBadgeModule, MatchaTabsModule, MatchaBottomSheetModule, MatchaButtonToggleModule, MatchaButtonModule, MatchaCheckboxModule, MatchaChipsModule, MatchaDatepickerModule, MatchaDialogModule, MatchaDividerModule, MatchaElevationModule, MatchaExpansionModule, MatchaFormsModule, MatchaIconModule, MatchaInputModule, MatchaListModule, MatchaMenuModule, MatchaSidenavModule, MatchaPaginatorModule, MatchaProgressBarModule, MatchaProgressSpinnerModule, MatchaRadioButtonModule, MatchaSelectModule, MatchaSlideToggleModule, MatchaSliderModule, MatchaSnackBarModule, MatchaSortHeaderModule, MatchaStepperModule, MatchaTableModule, MatchaTabsModule, MatchaTooltipModule, MatchaTreeModule],
|
|
77
42
|
})
|
|
78
|
-
export class MatchaComponentsModule {
|
|
43
|
+
export class MatchaComponentsModule {}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
3
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
template: `
|
|
8
|
+
<section>
|
|
9
|
+
<button mat-stroked-button (click)="openDialog()">OPEN DIALOG</button>
|
|
10
|
+
</section>
|
|
11
|
+
`,
|
|
12
|
+
styles: ['section {display: flex; justify-content: center; align-items: center; height: 100%}', '.dialog-border mat-dialog-container {border-radius: 20px; border: 5px solid green} '],
|
|
13
|
+
standalone: true,
|
|
14
|
+
imports: [MatDialogModule, MatButtonModule],
|
|
15
|
+
encapsulation: ViewEncapsulation.None,
|
|
16
|
+
})
|
|
17
|
+
export class ConfirmationDialogComponent {
|
|
18
|
+
constructor(private readonly dialog: MatDialog) {}
|
|
19
|
+
|
|
20
|
+
openDialog(): void {
|
|
21
|
+
this.dialog.open(ConfirmationDialogDialogComponent, {
|
|
22
|
+
width: '460px',
|
|
23
|
+
autoFocus: false,
|
|
24
|
+
panelClass: 'dialog-border',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Component({
|
|
30
|
+
template: `
|
|
31
|
+
<mat-icon>check_circle</mat-icon>
|
|
32
|
+
<h3>Your order has been created successfully!</h3>
|
|
33
|
+
<button mat-stroked-button mat-dialog-close>TRACK MY ORDER</button>
|
|
34
|
+
`,
|
|
35
|
+
styles: [':host {display: flex; justify-content: center; align-items: center; flex-direction: column}', 'h3 {text-align: center}', 'mat-icon {color: green; height: 6rem; width: 6rem; font-size: 6rem}'],
|
|
36
|
+
standalone: true,
|
|
37
|
+
imports: [MatIconModule, MatButtonModule, MatDialogModule],
|
|
38
|
+
})
|
|
39
|
+
class ConfirmationDialogDialogComponent {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { ConfirmationDialogComponent } from './confirmation-dialog.component';
|
|
3
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Atoms / Dialog',
|
|
7
|
+
component: ConfirmationDialogComponent,
|
|
8
|
+
decorators: [
|
|
9
|
+
moduleMetadata({
|
|
10
|
+
imports: [BrowserAnimationsModule],
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
parameters: {},
|
|
14
|
+
} as Meta;
|
|
15
|
+
|
|
16
|
+
export const Template: StoryObj<ConfirmationDialogComponent> = {
|
|
17
|
+
render: (args) => ({
|
|
18
|
+
props: args,
|
|
19
|
+
}),
|
|
20
|
+
name: 'success (custom css)',
|
|
21
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const dividerArgtypes = {
|
|
2
|
+
inset: {
|
|
3
|
+
description: 'Whether the divider is an inset divider.',
|
|
4
|
+
control: 'boolean',
|
|
5
|
+
defaultValue: false,
|
|
6
|
+
table: {
|
|
7
|
+
type: { summary: 'boolean' },
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
vertical: {
|
|
11
|
+
description: 'Whether the divider is vertically aligned.',
|
|
12
|
+
control: 'boolean',
|
|
13
|
+
defaultValue: false,
|
|
14
|
+
table: {
|
|
15
|
+
type: { summary: 'boolean' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Story } from "@storybook/blocks";
|
|
2
|
+
import { Meta } from "@storybook/addon-docs";
|
|
3
|
+
import * as ComponentStories from "./divider.stories";
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms / Divider / Documentação" />
|
|
6
|
+
|
|
7
|
+
# Divider
|
|
8
|
+
|
|
9
|
+
> _divider_ É um componente que permite a estilização de um separador em forma de linha com várias opções de orientação.
|
|
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">Divider overview</span>
|
|
19
|
+
<div class="matcha-card background-bg">
|
|
20
|
+
<Story of={ComponentStories.DividerOverview} />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="d-flex-column">
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
|
|
27
|
+
<mat-list>
|
|
28
|
+
<mat-list-item>Item 1</mat-list-item>
|
|
29
|
+
<mat-divider></mat-divider>
|
|
30
|
+
<mat-list-item>Item 2</mat-list-item>
|
|
31
|
+
<mat-divider></mat-divider>
|
|
32
|
+
<mat-list-item>Item 3</mat-list-item>
|
|
33
|
+
</mat-list>
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<br />
|
|
44
|
+
|
|
45
|
+
### Installation
|
|
46
|
+
|
|
47
|
+
`import {MatDividerModule} from '@angular/material/divider';`
|
|
48
|
+
|
|
49
|
+
[Official documentation](https://https://material.angular.io/components/divider/overview)
|
|
50
|
+
|
|
51
|
+
<br />
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { MatchaDividerDirective } from './
|
|
3
|
+
import { MatchaDividerDirective } from './divider.directive';
|
|
4
4
|
|
|
5
5
|
@NgModule({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
],
|
|
10
|
-
exports:[
|
|
11
|
-
MatchaDividerDirective
|
|
12
|
-
]
|
|
6
|
+
declarations: [MatchaDividerDirective],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [MatchaDividerDirective],
|
|
13
9
|
})
|
|
14
|
-
export class MatchaDividerModule {
|
|
10
|
+
export class MatchaDividerModule {}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
6
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
8
|
+
import { dividerArgtypes } from './divider.argtypes';
|
|
9
|
+
import { MatchaDividerDirective } from './divider.directive';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Atoms / Divider',
|
|
13
|
+
decorators: [
|
|
14
|
+
applicationConfig({
|
|
15
|
+
providers: [provideAnimations()],
|
|
16
|
+
}),
|
|
17
|
+
|
|
18
|
+
moduleMetadata({
|
|
19
|
+
imports: [CommonModule, MatIconModule, MatDividerModule, MatButtonModule, NgIf, JsonPipe, NgFor, AsyncPipe],
|
|
20
|
+
declarations: [MatchaDividerDirective],
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
args: {
|
|
24
|
+
inset: false,
|
|
25
|
+
vertical: false,
|
|
26
|
+
},
|
|
27
|
+
argTypes: dividerArgtypes,
|
|
28
|
+
parameters: {
|
|
29
|
+
controls: { expanded: true },
|
|
30
|
+
},
|
|
31
|
+
} as Meta;
|
|
32
|
+
|
|
33
|
+
export const DividerOverview: StoryObj = {
|
|
34
|
+
render: (args) => ({
|
|
35
|
+
props: {
|
|
36
|
+
...args,
|
|
37
|
+
},
|
|
38
|
+
template: `
|
|
39
|
+
<mat-list>
|
|
40
|
+
<mat-list-item>Item 1</mat-list-item>
|
|
41
|
+
<mat-divider></mat-divider>
|
|
42
|
+
<mat-list-item>Item 2</mat-list-item>
|
|
43
|
+
<mat-divider></mat-divider>
|
|
44
|
+
<mat-list-item>Item 3</mat-list-item>
|
|
45
|
+
</mat-list>
|
|
46
|
+
`,
|
|
47
|
+
}),
|
|
48
|
+
name: ' Divider Overview',
|
|
49
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const elevationArgtypes = {
|
|
2
|
+
elevation: {
|
|
3
|
+
description: 'Elevation value of the element',
|
|
4
|
+
defaultValue: 0,
|
|
5
|
+
table: {
|
|
6
|
+
type: { summary: 'range' },
|
|
7
|
+
defaultValue: { summary: 0 },
|
|
8
|
+
},
|
|
9
|
+
control: {
|
|
10
|
+
type: 'range',
|
|
11
|
+
min: 0,
|
|
12
|
+
max: 24,
|
|
13
|
+
step: 1,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Directive, ElementRef, Input, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[elevation]',
|
|
5
|
+
})
|
|
6
|
+
export class MatchaElevationDirective {
|
|
7
|
+
@Input('elevation') elevation: number = 0; // Valor padrão para elevação é 0
|
|
8
|
+
|
|
9
|
+
constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {}
|
|
10
|
+
|
|
11
|
+
ngOnChanges() {
|
|
12
|
+
// Remove qualquer classe de elevação existente
|
|
13
|
+
for (let i = 0; i <= 24; i++) {
|
|
14
|
+
this._renderer.removeClass(this._elementRef.nativeElement, `elevation-z-${i}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Adiciona a classe de elevação correspondente
|
|
18
|
+
if (this.elevation >= 1 && this.elevation <= 24) {
|
|
19
|
+
this._renderer.addClass(this._elementRef.nativeElement, `elevation-z-${this.elevation}`);
|
|
20
|
+
} else {
|
|
21
|
+
this._renderer.addClass(this._elementRef.nativeElement, `elevation-z-0`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Story } from "@storybook/blocks";
|
|
2
|
+
import { Meta } from "@storybook/addon-docs";
|
|
3
|
+
import * as ComponentStories from "./elevation.stories";
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms / Elevation / Documentação" />
|
|
6
|
+
|
|
7
|
+
# Elevation
|
|
8
|
+
|
|
9
|
+
> _elevation_ "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">Elevation overview</span>
|
|
19
|
+
<div class="matcha-card background-bg">
|
|
20
|
+
<Story of={ComponentStories.ElevationOverview} />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="d-flex-column">
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="d-flex-column w-500 gap-16">
|
|
27
|
+
<div class="d-flex-column gap-16">
|
|
28
|
+
<div class="p-16" elevation="1">Element with a elevation 1</div>
|
|
29
|
+
<div class="p-16" elevation="2">Element with a elevation 2</div>
|
|
30
|
+
<div class="p-16" elevation="3">Element with a elevation 3</div>
|
|
31
|
+
<div class="p-16" elevation="4">Element with a elevation 4</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<br />
|
|
43
|
+
|
|
44
|
+
### Installation
|
|
45
|
+
|
|
46
|
+
`import {MatElevationModule} from '@angular/material/elevation';`
|
|
47
|
+
|
|
48
|
+
[Official documentation](https://https://material.angular.io/components/elevation/overview)
|
|
49
|
+
|
|
50
|
+
<br />
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatchaElevationDirective } from './elevation.directive';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
declarations: [MatchaElevationDirective],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [MatchaElevationDirective],
|
|
9
|
+
})
|
|
10
|
+
export class MatchaElevationModule {}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
|
|
5
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
6
|
+
import { elevationArgtypes } from './elevation.argtypes';
|
|
7
|
+
import { MatchaElevationDirective } from './elevation.directive';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Atoms / Elevation',
|
|
11
|
+
decorators: [
|
|
12
|
+
applicationConfig({
|
|
13
|
+
providers: [provideAnimations()],
|
|
14
|
+
}),
|
|
15
|
+
|
|
16
|
+
moduleMetadata({
|
|
17
|
+
imports: [CommonModule, NgIf, JsonPipe, NgFor, AsyncPipe],
|
|
18
|
+
declarations: [MatchaElevationDirective],
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
args: {
|
|
22
|
+
elevation: 2,
|
|
23
|
+
},
|
|
24
|
+
argTypes: elevationArgtypes,
|
|
25
|
+
parameters: {
|
|
26
|
+
controls: { expanded: true },
|
|
27
|
+
},
|
|
28
|
+
} as Meta;
|
|
29
|
+
|
|
30
|
+
export const ElevationOverview: StoryObj = {
|
|
31
|
+
render: (args) => ({
|
|
32
|
+
props: {
|
|
33
|
+
...args,
|
|
34
|
+
},
|
|
35
|
+
template: `
|
|
36
|
+
<div class="d-flex-column w-500 gap-16">
|
|
37
|
+
<div class="d-flex-colmun">
|
|
38
|
+
<div class="matcha-card" [elevation]="elevation">Element with a elevation {{elevation}}</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="d-flex-column gap-16">
|
|
41
|
+
<div class="matcha-card" elevation="1">Element with a elevation 1</div>
|
|
42
|
+
<div class="matcha-card" elevation="2">Element with a elevation 2</div>
|
|
43
|
+
<div class="matcha-card" elevation="3">Element with a elevation 3</div>
|
|
44
|
+
<div class="matcha-card" elevation="4">Element with a elevation 4</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
`,
|
|
48
|
+
}),
|
|
49
|
+
name: ' Elevation Overview',
|
|
50
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const expansionArgtypes = {
|
|
2
|
+
displayMode: {
|
|
3
|
+
description: 'Display mode used for all expansion 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 expansion 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 expansion 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
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Directive, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Directive({
|
|
4
|
+
selector: '[matchaExpansion]',
|
|
5
|
+
})
|
|
6
|
+
export class MatchaExpansionDirective {
|
|
7
|
+
constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {
|
|
8
|
+
//this._elementRef.nativeElement.style.backgroundColor = 'grey';
|
|
9
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'matcha-expansion-panel');
|
|
10
|
+
}
|
|
11
|
+
}
|