matcha-components 1.0.5 → 1.0.7
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/documentation/presentation.mdx +105 -0
- package/src/foundation/borders/borders.mdx +180 -0
- package/src/foundation/colors/base/amber.mdx +235 -0
- package/src/foundation/colors/base/blue.mdx +235 -0
- package/src/foundation/colors/base/cyan.mdx +235 -0
- package/src/foundation/colors/base/deep-orange.mdx +235 -0
- package/src/foundation/colors/base/deep-purple.mdx +235 -0
- package/src/foundation/colors/base/green.mdx +235 -0
- package/src/foundation/colors/base/indigo.mdx +235 -0
- package/src/foundation/colors/base/light-blue.mdx +235 -0
- package/src/foundation/colors/base/light-green.mdx +235 -0
- package/src/foundation/colors/base/lime.mdx +235 -0
- package/src/foundation/colors/base/orange.mdx +235 -0
- package/src/foundation/colors/base/pink.mdx +235 -0
- package/src/foundation/colors/base/purple.mdx +235 -0
- package/src/foundation/colors/base/red.mdx +235 -0
- package/src/foundation/colors/base/teal.mdx +235 -0
- package/src/foundation/colors/base/yellow.mdx +235 -0
- package/src/foundation/colors/base-colors.mdx +144 -0
- package/src/foundation/colors/surface-colors.mdx +93 -0
- package/src/foundation/colors/theme/accent.mdx +235 -0
- package/src/foundation/colors/theme/primary.mdx +235 -0
- package/src/foundation/colors/theme/warn.mdx +235 -0
- package/src/foundation/colors/theme-colors.mdx +133 -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/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-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 +104 -0
- 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 +9 -0
- 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.directive.ts +16 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet.mdx +69 -0
- package/src/lib/matcha-bottom-sheet/bottom-sheet.module.ts +9 -0
- 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/button.stories.ts.TXT +111 -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.module.ts +14 -0
- package/src/lib/matcha-button-toggle/button-toggle.stories.ts +64 -0
- package/src/lib/matcha-button-toggle/matcha-button-toggle.directive.ts +15 -0
- 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.html +3 -0
- package/src/lib/matcha-card/card.component.scss +0 -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-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 +43 -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/confirmation-dialog.component.ts +39 -0
- package/src/lib/matcha-dialog/confirmation-dialog.stories.ts +21 -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.argtypes.ts +18 -0
- package/src/lib/matcha-divider/divider.directive.ts +16 -0
- package/src/lib/matcha-divider/divider.mdx +51 -0
- package/src/lib/matcha-divider/divider.module.ts +10 -0
- 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/form-field.stories.ts +341 -0
- package/src/lib/matcha-forms/forms.module.ts +10 -0
- 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.scss +0 -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.scss +0 -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.scss +0 -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 +10 -0
- package/src/lib/matcha-icon/icon.stories.ts +416 -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/list.directive.ts +11 -0
- package/src/lib/matcha-list/list.mdx +69 -0
- package/src/lib/matcha-list/list.module.ts +10 -0
- 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.directive.ts +16 -0
- package/src/lib/matcha-menu/menu.mdx +59 -0
- package/src/lib/matcha-menu/menu.module.ts +10 -0
- 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.directive.ts +16 -0
- package/src/lib/matcha-paginator/paginator.mdx +53 -0
- package/src/lib/matcha-paginator/paginator.module.ts +10 -0
- package/src/lib/matcha-paginator/paginator.stories.ts +34 -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 +43 -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/select.argtypes.ts +265 -0
- package/src/lib/matcha-select/select.directive.ts +11 -0
- package/src/lib/matcha-select/select.mdx +54 -0
- package/src/lib/matcha-select/select.module.ts +10 -0
- package/src/lib/matcha-select/select.stories.ts +164 -0
- package/src/lib/matcha-select/select.stories.txt +109 -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.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.argtypes.ts +83 -0
- package/src/lib/matcha-slider/slider.mdx +45 -0
- package/src/lib/matcha-slider/slider.module.ts +12 -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.directive.ts +16 -0
- package/src/lib/matcha-sort-header/sort-header.mdx +78 -0
- package/src/lib/matcha-sort-header/sort-header.module.ts +10 -0
- 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.directive.ts +16 -0
- package/src/lib/matcha-stepper/stepper.mdx +68 -0
- package/src/lib/matcha-stepper/stepper.module.ts +10 -0
- 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.directive.ts +16 -0
- package/src/lib/matcha-table/table.mdx +78 -0
- package/src/lib/matcha-table/table.module.ts +10 -0
- 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.directive.ts +17 -0
- package/src/lib/matcha-tabs/tabs.mdx +69 -0
- package/src/lib/matcha-tabs/tabs.module.ts +10 -0
- package/src/lib/matcha-tabs/tabs.stories.ts +49 -0
- package/src/lib/matcha-tabs/tabs.stories.txt +18 -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.directive.ts +16 -0
- package/src/lib/matcha-tooltip/tooltip.mdx +69 -0
- package/src/lib/matcha-tooltip/tooltip.module.ts +10 -0
- 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.directive.ts +16 -0
- package/src/lib/matcha-tree/tree.mdx +49 -0
- package/src/lib/matcha-tree/tree.module.ts +10 -0
- package/src/lib/matcha-tree/tree.stories.ts +130 -0
- package/src/public-api.ts +92 -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,341 @@
|
|
|
1
|
+
import { applicationConfig, Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
3
|
+
import { MatInputModule } from '@angular/material/input';
|
|
4
|
+
import { BrowserAnimationsModule, provideAnimations } from '@angular/platform-browser/animations';
|
|
5
|
+
import { formFieldArgtypes } from './form-field-argtype';
|
|
6
|
+
import { MatchaFormFieldDirective } from './form-field.directive';
|
|
7
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
10
|
+
import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
11
|
+
import { userEvent, within } from '@storybook/testing-library';
|
|
12
|
+
import { expect } from '@storybook/jest';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Atoms / Forms',
|
|
16
|
+
decorators: [
|
|
17
|
+
applicationConfig({
|
|
18
|
+
providers: [provideAnimations()],
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
moduleMetadata({
|
|
22
|
+
imports: [BrowserAnimationsModule, MatFormFieldModule, MatInputModule, MatSelectModule, MatIconModule, MatButtonModule, ReactiveFormsModule, FormsModule],
|
|
23
|
+
declarations: [MatchaFormFieldDirective],
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
args: {
|
|
27
|
+
appearance: 'outline',
|
|
28
|
+
color: 'accent',
|
|
29
|
+
},
|
|
30
|
+
argTypes: formFieldArgtypes,
|
|
31
|
+
parameters: {
|
|
32
|
+
actions: { argTypesRegex: '^on.*' },
|
|
33
|
+
controls: { expanded: true },
|
|
34
|
+
},
|
|
35
|
+
} as Meta;
|
|
36
|
+
|
|
37
|
+
export const WithBasicUsage: StoryObj = {
|
|
38
|
+
render: (args) => ({
|
|
39
|
+
props: args,
|
|
40
|
+
template: `
|
|
41
|
+
<mat-form-field matchaFormField id="email" appearance="outline" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
42
|
+
<mat-label>email</mat-label>
|
|
43
|
+
<input type="text" matInput>
|
|
44
|
+
</mat-form-field>
|
|
45
|
+
|
|
46
|
+
<mat-form-field matchaFormField id="password" appearance="outline" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
47
|
+
<mat-label>Password</mat-label>
|
|
48
|
+
<input type="text" matInput>
|
|
49
|
+
</mat-form-field>
|
|
50
|
+
`,
|
|
51
|
+
}),
|
|
52
|
+
// Added an example of how to use the play function
|
|
53
|
+
// For more information, see https://storybook.js.org/docs/angular/writing-tests/interaction-testing
|
|
54
|
+
// See https://storybook.js.org/docs/angular/essentials/actions#automatically-matching-args to learn how to setup logging in the Actions panel
|
|
55
|
+
play: async ({ canvasElement }) => {
|
|
56
|
+
const canvas = within(canvasElement);
|
|
57
|
+
|
|
58
|
+
// 👇 Simulate interactions with the component
|
|
59
|
+
await userEvent.type(canvas.getByTestId('email'), 'email@provider.com');
|
|
60
|
+
await userEvent.type(canvas.getByTestId('password'), 'a-random-password');
|
|
61
|
+
await userEvent.click(canvas.getByRole('button'));
|
|
62
|
+
// 👇 Assert DOM structure
|
|
63
|
+
await expect(canvas.getByText('Everything is perfect. Your account is ready and we should probably get you started!'));
|
|
64
|
+
},
|
|
65
|
+
name: 'basic usage',
|
|
66
|
+
parameters: {
|
|
67
|
+
controls: {
|
|
68
|
+
exclude: ['alignHint'],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const WithStateFilled: StoryObj = {
|
|
74
|
+
render: (args) => ({
|
|
75
|
+
props: {
|
|
76
|
+
args,
|
|
77
|
+
appearance: 'outline',
|
|
78
|
+
},
|
|
79
|
+
template: `
|
|
80
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
81
|
+
<mat-label>Password</mat-label>
|
|
82
|
+
<input type="text" matInput [ngModel]="'admin'">
|
|
83
|
+
</mat-form-field>
|
|
84
|
+
`,
|
|
85
|
+
}),
|
|
86
|
+
name: 'with state (filled)',
|
|
87
|
+
parameters: {
|
|
88
|
+
controls: {
|
|
89
|
+
exclude: ['alignHint'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const WithStateDisabled: StoryObj = {
|
|
95
|
+
render: (args) => ({
|
|
96
|
+
props: {
|
|
97
|
+
...args,
|
|
98
|
+
appearance: 'outline',
|
|
99
|
+
},
|
|
100
|
+
template: `
|
|
101
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
102
|
+
<mat-label>Password</mat-label>
|
|
103
|
+
<input type="text" matInput disabled>
|
|
104
|
+
</mat-form-field>
|
|
105
|
+
`,
|
|
106
|
+
}),
|
|
107
|
+
name: 'with state (disabled)',
|
|
108
|
+
parameters: {
|
|
109
|
+
controls: {
|
|
110
|
+
exclude: ['alignHint'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const WithStateFocused: StoryObj = {
|
|
116
|
+
render: (args) => ({
|
|
117
|
+
props: {
|
|
118
|
+
...args,
|
|
119
|
+
appearance: 'outline',
|
|
120
|
+
},
|
|
121
|
+
template: `
|
|
122
|
+
<mat-form-field matchaFormField class="mat-focused" [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
123
|
+
<mat-label>Password 1</mat-label>
|
|
124
|
+
<input type="text" matInput [ngModel]="'admin'">
|
|
125
|
+
</mat-form-field>
|
|
126
|
+
`,
|
|
127
|
+
}),
|
|
128
|
+
name: 'with state (focused)',
|
|
129
|
+
parameters: {
|
|
130
|
+
controls: {
|
|
131
|
+
exclude: ['alignHint'],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const WithStateHover: StoryObj = {
|
|
137
|
+
render: (args) => ({
|
|
138
|
+
props: {
|
|
139
|
+
...args,
|
|
140
|
+
appearance: 'outline',
|
|
141
|
+
},
|
|
142
|
+
template: `
|
|
143
|
+
<mat-form-field matchaFormField class="mat-focused" [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
144
|
+
<mat-label>Password</mat-label>
|
|
145
|
+
<input type="text" matInput>
|
|
146
|
+
</mat-form-field>
|
|
147
|
+
`,
|
|
148
|
+
}),
|
|
149
|
+
name: 'with state (hover)',
|
|
150
|
+
parameters: {
|
|
151
|
+
controls: {
|
|
152
|
+
exclude: ['alignHint'],
|
|
153
|
+
},
|
|
154
|
+
pseudo: {
|
|
155
|
+
hover: true,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const WithAppearanceOutline: StoryObj = {
|
|
161
|
+
render: (args) => ({
|
|
162
|
+
props: {
|
|
163
|
+
...args,
|
|
164
|
+
appearance: 'outline',
|
|
165
|
+
},
|
|
166
|
+
template: `
|
|
167
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
168
|
+
<mat-label>Password</mat-label>
|
|
169
|
+
<input type="text" matInput>
|
|
170
|
+
</mat-form-field>
|
|
171
|
+
`,
|
|
172
|
+
}),
|
|
173
|
+
name: 'with appearance (outline)',
|
|
174
|
+
parameters: {
|
|
175
|
+
controls: {
|
|
176
|
+
exclude: ['alignHint'],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const WithStartHint: StoryObj = {
|
|
182
|
+
render: (args) => ({
|
|
183
|
+
props: args,
|
|
184
|
+
template: `
|
|
185
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
186
|
+
<mat-label>Password</mat-label>
|
|
187
|
+
<input type="text" matInput>
|
|
188
|
+
<mat-hint align="start">at least 8 characters</mat-hint>
|
|
189
|
+
</mat-form-field>
|
|
190
|
+
`,
|
|
191
|
+
}),
|
|
192
|
+
name: 'with hint (start)',
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const WithEndHint: StoryObj = {
|
|
196
|
+
render: (args) => ({
|
|
197
|
+
props: args,
|
|
198
|
+
template: `
|
|
199
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
200
|
+
<mat-label>Contributions</mat-label>
|
|
201
|
+
<mat-select>
|
|
202
|
+
<mat-option>Components</mat-option>
|
|
203
|
+
<mat-option>Use cases</mat-option>
|
|
204
|
+
</mat-select>
|
|
205
|
+
<mat-hint align="end">Choose an option ^</mat-hint>
|
|
206
|
+
</mat-form-field>
|
|
207
|
+
`,
|
|
208
|
+
}),
|
|
209
|
+
name: 'with hint (end)',
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export const WithDoubleHints: StoryObj = {
|
|
213
|
+
render: (args) => ({
|
|
214
|
+
props: args,
|
|
215
|
+
template: `
|
|
216
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
217
|
+
<mat-label>Username</mat-label>
|
|
218
|
+
<input type="text" matInput #input [attr.maxlength]="10">
|
|
219
|
+
<mat-hint align="start">Max 10 characters</mat-hint>
|
|
220
|
+
<mat-hint align="end">{{input.value.length || 0}}/10</mat-hint>
|
|
221
|
+
</mat-form-field>
|
|
222
|
+
`,
|
|
223
|
+
}),
|
|
224
|
+
name: 'with hint (double)',
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const WithPrefix: StoryObj = {
|
|
228
|
+
render: (args) => ({
|
|
229
|
+
props: {
|
|
230
|
+
...args,
|
|
231
|
+
hide: true,
|
|
232
|
+
},
|
|
233
|
+
template: `
|
|
234
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
235
|
+
<mat-label>Password</mat-label>
|
|
236
|
+
<input matInput [type]="hide ? 'password' : 'text'">
|
|
237
|
+
<span class="i-matcha-action_key"></span>
|
|
238
|
+
</mat-form-field>
|
|
239
|
+
`,
|
|
240
|
+
}),
|
|
241
|
+
name: 'with prefix',
|
|
242
|
+
parameters: {
|
|
243
|
+
controls: {
|
|
244
|
+
exclude: ['alignHint'],
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export const WithSuffix: StoryObj = {
|
|
250
|
+
render: (args) => ({
|
|
251
|
+
props: {
|
|
252
|
+
...args,
|
|
253
|
+
hide: true,
|
|
254
|
+
},
|
|
255
|
+
template: `
|
|
256
|
+
<div class="d-flex-column max-w-600 gap-16">
|
|
257
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
258
|
+
<mat-label>Password</mat-label>
|
|
259
|
+
<input matInput [type]="hide ? 'password' : 'text'">
|
|
260
|
+
<button mat-icon-button matSuffix (click)="hide = !hide" [attr.aria-label]="'Hide password'" [attr.aria-pressed]="hide">
|
|
261
|
+
<span class="{{hide ? 'i-matcha-visibility-on' : 'i-matcha-visibility-off'}}"></span>
|
|
262
|
+
</button>
|
|
263
|
+
</mat-form-field>
|
|
264
|
+
|
|
265
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
266
|
+
<mat-label>Name</mat-label>
|
|
267
|
+
<input matInput #suffix_hint maxlength="50">
|
|
268
|
+
<span matSuffix class="small pr-8">{{ suffix_hint.value?.length || 0}}/50</span>
|
|
269
|
+
</mat-form-field>
|
|
270
|
+
</div>
|
|
271
|
+
`,
|
|
272
|
+
}),
|
|
273
|
+
name: 'with suffix',
|
|
274
|
+
parameters: {
|
|
275
|
+
controls: {
|
|
276
|
+
exclude: ['alignHint'],
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export const WithPrefixAndSuffix: StoryObj = {
|
|
282
|
+
render: (args) => ({
|
|
283
|
+
props: {
|
|
284
|
+
...args,
|
|
285
|
+
hide: true,
|
|
286
|
+
},
|
|
287
|
+
template: `
|
|
288
|
+
<style>
|
|
289
|
+
.example-right-align {
|
|
290
|
+
text-align: right;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
input.example-right-align::-webkit-outer-spin-button,
|
|
294
|
+
input.example-right-align::-webkit-inner-spin-button {
|
|
295
|
+
display: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
input.example-right-align {
|
|
299
|
+
-moz-appearance: textfield;
|
|
300
|
+
}
|
|
301
|
+
</style>
|
|
302
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
303
|
+
<mat-label>Amount</mat-label>
|
|
304
|
+
<input matInput type="number" class="example-right-align" placeholder="0">
|
|
305
|
+
<span matPrefix>$ </span>
|
|
306
|
+
<span matSuffix>.00</span>
|
|
307
|
+
</mat-form-field>
|
|
308
|
+
`,
|
|
309
|
+
}),
|
|
310
|
+
name: 'with prefix and suffix',
|
|
311
|
+
parameters: {
|
|
312
|
+
controls: {
|
|
313
|
+
exclude: ['alignHint'],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
const control = new FormControl('', Validators.required);
|
|
319
|
+
control.markAsTouched();
|
|
320
|
+
|
|
321
|
+
export const WithErrorMessage: StoryObj = {
|
|
322
|
+
render: (args) => ({
|
|
323
|
+
props: {
|
|
324
|
+
...args,
|
|
325
|
+
control: control,
|
|
326
|
+
},
|
|
327
|
+
template: `
|
|
328
|
+
<mat-form-field matchaFormField [appearance]="appearance" [color]="color" [floatLabel]="floatLabel" [hideRequiredMarker]="hideRequiredMarker" [hintLabel]="hintLabel">
|
|
329
|
+
<mat-label>Password</mat-label>
|
|
330
|
+
<input type="text" matInput [formControl]="control">
|
|
331
|
+
<mat-error *ngIf="control.hasError('required')">This field is required</mat-error>
|
|
332
|
+
</mat-form-field>
|
|
333
|
+
`,
|
|
334
|
+
}),
|
|
335
|
+
name: 'with error message',
|
|
336
|
+
parameters: {
|
|
337
|
+
controls: {
|
|
338
|
+
exclude: ['alignHint'],
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatchaFormFieldDirective } from './form-field.directive';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
declarations: [MatchaFormFieldDirective],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [MatchaFormFieldDirective],
|
|
9
|
+
})
|
|
10
|
+
export class MatchaFormsModule {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const headersArgtypes = {
|
|
2
|
+
bulletColor: {
|
|
3
|
+
description: 'The color theme for the bullet of the title.',
|
|
4
|
+
control: 'select',
|
|
5
|
+
defaultValue: 'surface',
|
|
6
|
+
table: {
|
|
7
|
+
defaultValue: { summary: 'accent' },
|
|
8
|
+
},
|
|
9
|
+
options: ['fg', 'accent', 'primary', 'warn', 'red', 'pink', 'purple', 'deep-purple', 'indigo', 'blue', 'light-blue', 'cyan', 'teal', 'green', 'light-green', 'lime', 'yellow', 'amber', 'orange', 'deep-orange', null],
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
control: 'text',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Story } from "@storybook/blocks";
|
|
2
|
+
import { Meta } from "@storybook/addon-docs";
|
|
3
|
+
import * as ComponentStories from "./headers.stories";
|
|
4
|
+
|
|
5
|
+
<Meta title="Atoms / Headers / Documentação" />
|
|
6
|
+
|
|
7
|
+
# Title
|
|
8
|
+
|
|
9
|
+
> _title_ "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">Headers overview</span>
|
|
19
|
+
<div class="matcha-card background-bg">
|
|
20
|
+
<Story of={ComponentStories.HeadersOverview}/>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="d-flex-column">
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="d-flex-center-center gap-16">
|
|
27
|
+
<matcha-headline bulletColor="accent">Headline Example</matcha-headline>
|
|
28
|
+
<matcha-subhead bulletColor="accent">Subhead Example</matcha-subhead>
|
|
29
|
+
<matcha-title bulletColor="accent">Title Example</matcha-title>
|
|
30
|
+
</div>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="d-flex-column">
|
|
38
|
+
<div class="matcha-card background-surface d-flex-column gap-16">
|
|
39
|
+
<span class="h5">Headline overview</span>
|
|
40
|
+
<div class="matcha-card background-bg">
|
|
41
|
+
<Story of={ComponentStories.HeadlineOverview}/>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="d-flex-column">
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<div class="d-flex-center-center">
|
|
48
|
+
<matcha-headline bulletColor="accent">Headline Example</matcha-headline>
|
|
49
|
+
</div>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div class="d-flex-column">
|
|
57
|
+
<div class="matcha-card background-surface d-flex-column gap-16">
|
|
58
|
+
<span class="h5">Subhead overview</span>
|
|
59
|
+
<div class="matcha-card background-bg">
|
|
60
|
+
<Story of={ComponentStories.SubheadOverview}/>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div class="d-flex-column">
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<div class="d-flex-center-center">
|
|
67
|
+
<matcha-subhead bulletColor="accent">Subhead Example</matcha-subhead>
|
|
68
|
+
</div>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="d-flex-column">
|
|
76
|
+
<div class="matcha-card background-surface d-flex-column gap-16">
|
|
77
|
+
<span class="h5">Title overview</span>
|
|
78
|
+
<div class="matcha-card background-bg">
|
|
79
|
+
<Story of={ComponentStories.TitleOverview}/>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div class="d-flex-column">
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<div class="d-flex-center-center">
|
|
86
|
+
<matcha-title bulletColor="accent">Title Example</matcha-title>
|
|
87
|
+
</div>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatchaTitleComponent } from './title/title.component';
|
|
4
|
+
import { MatchaHeadlineComponent } from './headine/headline.component';
|
|
5
|
+
import { MatchaSubheadComponent } from './subhead/subhead.component';
|
|
6
|
+
|
|
7
|
+
@NgModule({
|
|
8
|
+
declarations: [MatchaTitleComponent, MatchaHeadlineComponent, MatchaSubheadComponent],
|
|
9
|
+
imports: [CommonModule],
|
|
10
|
+
exports: [MatchaTitleComponent, MatchaHeadlineComponent, MatchaSubheadComponent],
|
|
11
|
+
})
|
|
12
|
+
export class MatchaHeadersModule {}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { applicationConfig, Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { NgIf, NgFor, AsyncPipe, JsonPipe } from '@angular/common';
|
|
3
|
+
import { MatchaHeadersModule } from './headers.module';
|
|
4
|
+
import { headersArgtypes } from './headers.argtype';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Atoms / Headers',
|
|
10
|
+
decorators: [
|
|
11
|
+
applicationConfig({
|
|
12
|
+
providers: [provideAnimations()],
|
|
13
|
+
}),
|
|
14
|
+
moduleMetadata({
|
|
15
|
+
imports: [CommonModule, MatchaHeadersModule, NgIf, JsonPipe, NgFor, AsyncPipe],
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
args: {
|
|
19
|
+
label: 'Headline Example',
|
|
20
|
+
bulletColor: 'accent',
|
|
21
|
+
},
|
|
22
|
+
argTypes: headersArgtypes,
|
|
23
|
+
parameters: {
|
|
24
|
+
controls: { expanded: true },
|
|
25
|
+
},
|
|
26
|
+
} as Meta;
|
|
27
|
+
|
|
28
|
+
/** Este é o card principal */
|
|
29
|
+
export const HeadersOverview: StoryObj = {
|
|
30
|
+
render: (args) => ({
|
|
31
|
+
props: {
|
|
32
|
+
...args,
|
|
33
|
+
},
|
|
34
|
+
template: `
|
|
35
|
+
<div class="d-flex-column d-flex-center-center gap-24">
|
|
36
|
+
<matcha-headline [bulletColor]="bulletColor">{{label}}</matcha-headline>
|
|
37
|
+
<matcha-subhead [bulletColor]="bulletColor">{{label}}</matcha-subhead>
|
|
38
|
+
<matcha-title [bulletColor]="bulletColor">{{label}}</matcha-title>
|
|
39
|
+
</div>
|
|
40
|
+
`,
|
|
41
|
+
}),
|
|
42
|
+
name: 'Headers Overview',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Este é o card principal */
|
|
46
|
+
export const HeadlineOverview: StoryObj = {
|
|
47
|
+
render: (args) => ({
|
|
48
|
+
props: {
|
|
49
|
+
...args,
|
|
50
|
+
},
|
|
51
|
+
template: `
|
|
52
|
+
<div class="d-flex-center-center">
|
|
53
|
+
<matcha-headline [bulletColor]="bulletColor">{{label}}</matcha-headline>
|
|
54
|
+
</div>
|
|
55
|
+
`,
|
|
56
|
+
}),
|
|
57
|
+
name: 'Headline Overview',
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** Este é o card principal */
|
|
61
|
+
export const SubheadOverview: StoryObj = {
|
|
62
|
+
render: (args) => ({
|
|
63
|
+
props: {
|
|
64
|
+
...args,
|
|
65
|
+
},
|
|
66
|
+
template: `
|
|
67
|
+
<div class="d-flex-center-center">
|
|
68
|
+
<matcha-subhead [bulletColor]="bulletColor">{{label}}</matcha-subhead>
|
|
69
|
+
</div>
|
|
70
|
+
`,
|
|
71
|
+
}),
|
|
72
|
+
name: 'Subhead Overview',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** Este é o card principal */
|
|
76
|
+
export const TitleOverview: StoryObj = {
|
|
77
|
+
render: (args) => ({
|
|
78
|
+
props: {
|
|
79
|
+
...args,
|
|
80
|
+
},
|
|
81
|
+
template: `
|
|
82
|
+
<div class="d-flex-center-center">
|
|
83
|
+
<matcha-title [bulletColor]="bulletColor">{{label}}</matcha-title>
|
|
84
|
+
</div>
|
|
85
|
+
`,
|
|
86
|
+
}),
|
|
87
|
+
name: 'Title Overview',
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h4 class="lh-16 d-flex d-flex-align-center m-0 h4"><span [class]="classes"></span><ng-content></ng-content></h4>
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'matcha-headline',
|
|
5
|
+
templateUrl: './headline.component.html',
|
|
6
|
+
styleUrls: ['./headline.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class MatchaHeadlineComponent {
|
|
9
|
+
@Input()
|
|
10
|
+
bulletColor: 'fg' | 'accent' | 'primary' | 'warn' | 'red' | 'pink' | 'purple' | 'deep-purple' | 'indigo' | 'blue' | 'light-blue' | 'cyan' | 'teal' | 'green' | 'light-green' | 'lime' | 'yellow' | 'amber' | 'orange' | 'deep-orange' = 'accent';
|
|
11
|
+
|
|
12
|
+
@Input()
|
|
13
|
+
loading: boolean = false;
|
|
14
|
+
|
|
15
|
+
public get classes(): string {
|
|
16
|
+
const bullet = this.bulletColor ? `background-${this.bulletColor} min-h-24 h-24 max-h-24 max-w-8 w-8 min-w-8 d-inline-block position-relative mr-8 border-radius-8` : '';
|
|
17
|
+
const activeClasses = `${bullet} ${this.loading ? 'loading' : ''}`;
|
|
18
|
+
return activeClasses;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h5 class="lh-16 d-flex d-flex-align-center m-0 h5"><span [class]="classes"></span><ng-content></ng-content></h5>
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'matcha-subhead',
|
|
5
|
+
templateUrl: './subhead.component.html',
|
|
6
|
+
styleUrls: ['./subhead.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class MatchaSubheadComponent {
|
|
9
|
+
@Input()
|
|
10
|
+
bulletColor: 'fg' | 'accent' | 'primary' | 'warn' | 'red' | 'pink' | 'purple' | 'deep-purple' | 'indigo' | 'blue' | 'light-blue' | 'cyan' | 'teal' | 'green' | 'light-green' | 'lime' | 'yellow' | 'amber' | 'orange' | 'deep-orange' = 'accent';
|
|
11
|
+
|
|
12
|
+
@Input()
|
|
13
|
+
loading: boolean = false;
|
|
14
|
+
|
|
15
|
+
public get classes(): string {
|
|
16
|
+
const bullet = this.bulletColor ? `background-${this.bulletColor} min-h-20 h-20 max-h-20 max-w-8 w-8 min-w-8 d-inline-block position-relative mr-8 border-radius-8` : '';
|
|
17
|
+
const activeClasses = `${bullet} ${this.loading ? 'loading' : ''}`;
|
|
18
|
+
return activeClasses;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h6 class="lh-24 d-flex d-flex-align-center m-0 h8"><span [class]="classes"></span><ng-content></ng-content></h6>
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'matcha-title',
|
|
5
|
+
templateUrl: './title.component.html',
|
|
6
|
+
styleUrls: ['./title.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class MatchaTitleComponent {
|
|
9
|
+
@Input()
|
|
10
|
+
bulletColor: 'fg' | 'accent' | 'primary' | 'warn' | 'red' | 'pink' | 'purple' | 'deep-purple' | 'indigo' | 'blue' | 'light-blue' | 'cyan' | 'teal' | 'green' | 'light-green' | 'lime' | 'yellow' | 'amber' | 'orange' | 'deep-orange' = 'accent';
|
|
11
|
+
|
|
12
|
+
@Input()
|
|
13
|
+
loading: boolean = false;
|
|
14
|
+
|
|
15
|
+
public get classes(): string {
|
|
16
|
+
const bullet = this.bulletColor ? `background-${this.bulletColor} min-h-16 h-16 max-h-16 max-w-8 w-8 min-w-8 d-inline-block position-relative mr-8 border-radius-8` : '';
|
|
17
|
+
const activeClasses = `${bullet} ${this.loading ? 'loading' : ''}`;
|
|
18
|
+
return activeClasses;
|
|
19
|
+
}
|
|
20
|
+
}
|