ng-comps 1.0.2 → 2.0.0
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/fesm2022/ng-comps.mjs +4254 -0
- package/package.json +54 -58
- package/src/styles.css +54 -0
- package/types/ng-comps.d.ts +1348 -0
- package/.editorconfig +0 -17
- package/.github/copilot-instructions.md +0 -55
- package/.github/workflows/ci.yml +0 -29
- package/.prettierrc +0 -12
- package/.storybook/main.ts +0 -21
- package/.storybook/preview.ts +0 -27
- package/.storybook/tsconfig.doc.json +0 -10
- package/.storybook/tsconfig.json +0 -15
- package/.storybook/typings.d.ts +0 -4
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/mcp.json +0 -9
- package/.vscode/tasks.json +0 -42
- package/ACCESSIBILITY.md +0 -127
- package/angular.json +0 -106
- package/documentation.json +0 -13394
- package/ng-package.json +0 -27
- package/public/favicon.ico +0 -0
- package/scripts/prepare-package.mjs +0 -80
- package/src/app/a11y/accessibility.utils.ts +0 -35
- package/src/app/a11y/index.ts +0 -6
- package/src/app/accessibility/ng-comps.a11y.spec.ts +0 -108
- package/src/app/app.config.ts +0 -11
- package/src/app/app.css +0 -107
- package/src/app/app.html +0 -48
- package/src/app/app.routes.ts +0 -3
- package/src/app/app.spec.ts +0 -23
- package/src/app/app.ts +0 -10
- package/src/app/components/accordion/index.ts +0 -2
- package/src/app/components/accordion/mf-accordion.component.css +0 -38
- package/src/app/components/accordion/mf-accordion.component.spec.ts +0 -48
- package/src/app/components/accordion/mf-accordion.component.ts +0 -53
- package/src/app/components/alert/index.ts +0 -2
- package/src/app/components/alert/mf-alert.component.css +0 -100
- package/src/app/components/alert/mf-alert.component.spec.ts +0 -59
- package/src/app/components/alert/mf-alert.component.ts +0 -68
- package/src/app/components/autocomplete/index.ts +0 -5
- package/src/app/components/autocomplete/mf-autocomplete.component.css +0 -105
- package/src/app/components/autocomplete/mf-autocomplete.component.spec.ts +0 -116
- package/src/app/components/autocomplete/mf-autocomplete.component.ts +0 -307
- package/src/app/components/avatar/index.ts +0 -2
- package/src/app/components/avatar/mf-avatar.component.css +0 -27
- package/src/app/components/avatar/mf-avatar.component.spec.ts +0 -49
- package/src/app/components/avatar/mf-avatar.component.ts +0 -99
- package/src/app/components/badge/index.ts +0 -2
- package/src/app/components/badge/mf-badge.component.css +0 -32
- package/src/app/components/badge/mf-badge.component.spec.ts +0 -40
- package/src/app/components/badge/mf-badge.component.ts +0 -105
- package/src/app/components/breadcrumb/index.ts +0 -2
- package/src/app/components/breadcrumb/mf-breadcrumb.component.css +0 -61
- package/src/app/components/breadcrumb/mf-breadcrumb.component.spec.ts +0 -61
- package/src/app/components/breadcrumb/mf-breadcrumb.component.ts +0 -75
- package/src/app/components/button/index.ts +0 -2
- package/src/app/components/button/mf-button.component.css +0 -136
- package/src/app/components/button/mf-button.component.ts +0 -174
- package/src/app/components/card/index.ts +0 -2
- package/src/app/components/card/mf-card.component.css +0 -82
- package/src/app/components/card/mf-card.component.ts +0 -59
- package/src/app/components/checkbox/index.ts +0 -1
- package/src/app/components/checkbox/mf-checkbox.component.css +0 -75
- package/src/app/components/checkbox/mf-checkbox.component.ts +0 -187
- package/src/app/components/chip/index.ts +0 -2
- package/src/app/components/chip/mf-chip.component.css +0 -69
- package/src/app/components/chip/mf-chip.component.spec.ts +0 -47
- package/src/app/components/chip/mf-chip.component.ts +0 -77
- package/src/app/components/datepicker/index.ts +0 -2
- package/src/app/components/datepicker/mf-datepicker.component.css +0 -102
- package/src/app/components/datepicker/mf-datepicker.component.spec.ts +0 -69
- package/src/app/components/datepicker/mf-datepicker.component.ts +0 -233
- package/src/app/components/dialog/index.ts +0 -3
- package/src/app/components/dialog/mf-dialog.component.css +0 -73
- package/src/app/components/dialog/mf-dialog.component.ts +0 -160
- package/src/app/components/dialog/mf-dialog.service.spec.ts +0 -61
- package/src/app/components/dialog/mf-dialog.service.ts +0 -52
- package/src/app/components/divider/index.ts +0 -2
- package/src/app/components/divider/mf-divider.component.css +0 -38
- package/src/app/components/divider/mf-divider.component.spec.ts +0 -40
- package/src/app/components/divider/mf-divider.component.ts +0 -44
- package/src/app/components/form-field/index.ts +0 -1
- package/src/app/components/form-field/mf-form-field.component.css +0 -51
- package/src/app/components/form-field/mf-form-field.component.ts +0 -74
- package/src/app/components/grid-list/index.ts +0 -2
- package/src/app/components/grid-list/mf-grid-list.component.css +0 -47
- package/src/app/components/grid-list/mf-grid-list.component.spec.ts +0 -57
- package/src/app/components/grid-list/mf-grid-list.component.ts +0 -68
- package/src/app/components/icon/index.ts +0 -2
- package/src/app/components/icon/mf-icon.component.css +0 -56
- package/src/app/components/icon/mf-icon.component.ts +0 -41
- package/src/app/components/input/index.ts +0 -2
- package/src/app/components/input/mf-input.component.css +0 -105
- package/src/app/components/input/mf-input.component.ts +0 -217
- package/src/app/components/menu/index.ts +0 -2
- package/src/app/components/menu/mf-menu.component.css +0 -31
- package/src/app/components/menu/mf-menu.component.spec.ts +0 -49
- package/src/app/components/menu/mf-menu.component.ts +0 -66
- package/src/app/components/paginator/index.ts +0 -1
- package/src/app/components/paginator/mf-paginator.component.css +0 -32
- package/src/app/components/paginator/mf-paginator.component.spec.ts +0 -44
- package/src/app/components/paginator/mf-paginator.component.ts +0 -52
- package/src/app/components/progress-bar/index.ts +0 -2
- package/src/app/components/progress-bar/mf-progress-bar.component.css +0 -53
- package/src/app/components/progress-bar/mf-progress-bar.component.spec.ts +0 -65
- package/src/app/components/progress-bar/mf-progress-bar.component.ts +0 -79
- package/src/app/components/progress-spinner/index.ts +0 -2
- package/src/app/components/progress-spinner/mf-progress-spinner.component.css +0 -38
- package/src/app/components/progress-spinner/mf-progress-spinner.component.spec.ts +0 -59
- package/src/app/components/progress-spinner/mf-progress-spinner.component.ts +0 -81
- package/src/app/components/radio-button/index.ts +0 -2
- package/src/app/components/radio-button/mf-radio-button.component.css +0 -86
- package/src/app/components/radio-button/mf-radio-button.component.spec.ts +0 -55
- package/src/app/components/radio-button/mf-radio-button.component.ts +0 -219
- package/src/app/components/select/index.ts +0 -2
- package/src/app/components/select/mf-select.component.css +0 -121
- package/src/app/components/select/mf-select.component.spec.ts +0 -108
- package/src/app/components/select/mf-select.component.ts +0 -252
- package/src/app/components/sidenav/index.ts +0 -2
- package/src/app/components/sidenav/mf-sidenav.component.css +0 -168
- package/src/app/components/sidenav/mf-sidenav.component.spec.ts +0 -57
- package/src/app/components/sidenav/mf-sidenav.component.ts +0 -126
- package/src/app/components/slide-toggle/index.ts +0 -1
- package/src/app/components/slide-toggle/mf-slide-toggle.component.css +0 -42
- package/src/app/components/slide-toggle/mf-slide-toggle.component.spec.ts +0 -43
- package/src/app/components/slide-toggle/mf-slide-toggle.component.ts +0 -188
- package/src/app/components/snackbar/index.ts +0 -2
- package/src/app/components/snackbar/mf-snackbar.service.css +0 -31
- package/src/app/components/snackbar/mf-snackbar.service.spec.ts +0 -81
- package/src/app/components/snackbar/mf-snackbar.service.ts +0 -77
- package/src/app/components/table/index.ts +0 -2
- package/src/app/components/table/mf-table.component.css +0 -68
- package/src/app/components/table/mf-table.component.spec.ts +0 -76
- package/src/app/components/table/mf-table.component.ts +0 -117
- package/src/app/components/tabs/index.ts +0 -2
- package/src/app/components/tabs/mf-tabs.component.css +0 -31
- package/src/app/components/tabs/mf-tabs.component.spec.ts +0 -50
- package/src/app/components/tabs/mf-tabs.component.ts +0 -62
- package/src/app/components/textarea/index.ts +0 -2
- package/src/app/components/textarea/mf-textarea.component.css +0 -48
- package/src/app/components/textarea/mf-textarea.component.spec.ts +0 -55
- package/src/app/components/textarea/mf-textarea.component.ts +0 -227
- package/src/app/components/toolbar/index.ts +0 -2
- package/src/app/components/toolbar/mf-toolbar.component.css +0 -77
- package/src/app/components/toolbar/mf-toolbar.component.ts +0 -56
- package/src/app/components/tooltip/index.ts +0 -3
- package/src/app/components/tooltip/mf-tooltip.component.css +0 -7
- package/src/app/components/tooltip/mf-tooltip.component.spec.ts +0 -37
- package/src/app/components/tooltip/mf-tooltip.component.ts +0 -47
- package/src/app/components/tooltip/mf-tooltip.directive.ts +0 -22
- package/src/index.html +0 -18
- package/src/main.ts +0 -6
- package/src/public-api.ts +0 -31
- package/src/stories/About.mdx +0 -72
- package/src/stories/Accessibility.mdx +0 -59
- package/src/stories/Welcome.mdx +0 -26
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/mf-a11y-contracts.stories.ts +0 -472
- package/src/stories/mf-autocomplete.stories.ts +0 -194
- package/src/stories/mf-button.stories.ts +0 -152
- package/src/stories/mf-card.stories.ts +0 -147
- package/src/stories/mf-checkbox.stories.ts +0 -88
- package/src/stories/mf-datepicker.stories.ts +0 -118
- package/src/stories/mf-dialog.stories.ts +0 -159
- package/src/stories/mf-form-field.stories.ts +0 -108
- package/src/stories/mf-grid-list.stories.ts +0 -104
- package/src/stories/mf-icon.stories.ts +0 -133
- package/src/stories/mf-input.stories.ts +0 -158
- package/src/stories/mf-menu.stories.ts +0 -71
- package/src/stories/mf-progress-bar.stories.ts +0 -119
- package/src/stories/mf-progress-spinner.stories.ts +0 -124
- package/src/stories/mf-radio-button.stories.ts +0 -111
- package/src/stories/mf-select.stories.ts +0 -184
- package/src/stories/mf-sidenav.stories.ts +0 -331
- package/src/stories/mf-table.stories.ts +0 -80
- package/src/stories/mf-toolbar.stories.ts +0 -112
- package/src/stories/user.ts +0 -3
- package/tsconfig.app.json +0 -15
- package/tsconfig.json +0 -33
- package/tsconfig.spec.json +0 -15
- package/vercel.json +0 -6
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
import { Component, inject } from '@angular/core';
|
|
3
|
-
import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
|
4
|
-
|
|
5
|
-
import { MfDialogComponent } from '../app/components/dialog';
|
|
6
|
-
import { MfButtonComponent } from '../app/components/button';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'mf-dialog-content-demo',
|
|
10
|
-
imports: [MfDialogComponent, MfButtonComponent],
|
|
11
|
-
template: `
|
|
12
|
-
<mf-dialog
|
|
13
|
-
title="Confirm action"
|
|
14
|
-
message="Are you sure you want to continue? This action cannot be undone."
|
|
15
|
-
[showClose]="true"
|
|
16
|
-
[showActions]="true"
|
|
17
|
-
(mfClose)="dialogRef.close()"
|
|
18
|
-
>
|
|
19
|
-
<div mfDialogActions>
|
|
20
|
-
<mf-button label="Cancel" variant="outlined" size="sm" (mfClick)="dialogRef.close()" />
|
|
21
|
-
<mf-button label="Confirm" variant="filled" size="sm" (mfClick)="dialogRef.close()" />
|
|
22
|
-
</div>
|
|
23
|
-
</mf-dialog>
|
|
24
|
-
`,
|
|
25
|
-
})
|
|
26
|
-
class MfDialogContentDemoComponent {
|
|
27
|
-
readonly dialogRef = inject(MatDialogRef<MfDialogContentDemoComponent>);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Component({
|
|
31
|
-
selector: 'mf-dialog-demo',
|
|
32
|
-
imports: [MfButtonComponent, MatDialogModule],
|
|
33
|
-
template: `
|
|
34
|
-
<mf-button
|
|
35
|
-
label="Open dialog"
|
|
36
|
-
variant="filled"
|
|
37
|
-
(mfClick)="openDialog()"
|
|
38
|
-
/>
|
|
39
|
-
`,
|
|
40
|
-
})
|
|
41
|
-
class MfDialogDemoComponent {
|
|
42
|
-
private readonly dialog = inject(MatDialog);
|
|
43
|
-
|
|
44
|
-
openDialog(): void {
|
|
45
|
-
this.dialog.open(MfDialogContentDemoComponent, {
|
|
46
|
-
panelClass: 'mf-dialog-panel',
|
|
47
|
-
autoFocus: true,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const meta: Meta<MfDialogComponent> = {
|
|
53
|
-
title: 'Organisms/MfDialog',
|
|
54
|
-
component: MfDialogComponent,
|
|
55
|
-
tags: ['autodocs'],
|
|
56
|
-
parameters: {
|
|
57
|
-
docs: {
|
|
58
|
-
description: {
|
|
59
|
-
component: `
|
|
60
|
-
**MfDialog** is the dialog component from the ng-comps library.
|
|
61
|
-
It uses Angular Material \`MatDialog\` under the hood with a clean, minimal presentation.
|
|
62
|
-
|
|
63
|
-
It can be used in two ways:
|
|
64
|
-
1. **Inline** as part of a template for conditional content
|
|
65
|
-
2. **Programmatically** with \`MatDialog.open()\`
|
|
66
|
-
`,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
argTypes: {
|
|
71
|
-
title: { control: 'text', description: 'Dialog title' },
|
|
72
|
-
message: { control: 'text', description: 'Descriptive message' },
|
|
73
|
-
showClose: { control: 'boolean', description: 'Show close button' },
|
|
74
|
-
showActions: {
|
|
75
|
-
control: 'boolean',
|
|
76
|
-
description: 'Show actions area',
|
|
77
|
-
},
|
|
78
|
-
mfClose: { action: 'mfClose' },
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default meta;
|
|
83
|
-
type Story = StoryObj<MfDialogComponent>;
|
|
84
|
-
|
|
85
|
-
export const Default: Story = {
|
|
86
|
-
render: (args) => ({
|
|
87
|
-
props: args,
|
|
88
|
-
template: `
|
|
89
|
-
<div style="border: 1px solid var(--mf-color-border); border-radius: var(--mf-radius-xl, 20px); box-shadow: var(--mf-shadow-lg); max-width: 480px;">
|
|
90
|
-
<mf-dialog [title]="title" [message]="message" [showClose]="showClose" [showActions]="showActions">
|
|
91
|
-
<div mfDialogActions>
|
|
92
|
-
<mf-button label="Cancel" variant="outlined" size="sm" />
|
|
93
|
-
<mf-button label="Confirm" variant="filled" size="sm" />
|
|
94
|
-
</div>
|
|
95
|
-
</mf-dialog>
|
|
96
|
-
</div>
|
|
97
|
-
`,
|
|
98
|
-
moduleMetadata: { imports: [MfDialogComponent, MfButtonComponent] },
|
|
99
|
-
}),
|
|
100
|
-
args: {
|
|
101
|
-
title: 'Confirm action',
|
|
102
|
-
message: 'Are you sure you want to continue? This action cannot be undone.',
|
|
103
|
-
showClose: true,
|
|
104
|
-
showActions: true,
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export const WithoutMessage: Story = {
|
|
109
|
-
name: 'Title only',
|
|
110
|
-
render: () => ({
|
|
111
|
-
template: `
|
|
112
|
-
<div style="border: 1px solid var(--mf-color-border); border-radius: var(--mf-radius-xl, 20px); box-shadow: var(--mf-shadow-lg); max-width: 480px;">
|
|
113
|
-
<mf-dialog title="Settings" [showClose]="true" [showActions]="true">
|
|
114
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600); font-size: var(--mf-text-sm);">
|
|
115
|
-
Here you can customize your account settings.
|
|
116
|
-
</p>
|
|
117
|
-
<div mfDialogActions>
|
|
118
|
-
<mf-button label="Cancel" variant="text" size="sm" />
|
|
119
|
-
<mf-button label="Save" variant="filled" size="sm" />
|
|
120
|
-
</div>
|
|
121
|
-
</mf-dialog>
|
|
122
|
-
</div>
|
|
123
|
-
`,
|
|
124
|
-
moduleMetadata: { imports: [MfDialogComponent, MfButtonComponent] },
|
|
125
|
-
}),
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const Danger: Story = {
|
|
129
|
-
name: 'Destructive',
|
|
130
|
-
render: () => ({
|
|
131
|
-
template: `
|
|
132
|
-
<div style="border: 1px solid var(--mf-color-border); border-radius: var(--mf-radius-xl, 20px); box-shadow: var(--mf-shadow-lg); max-width: 480px;">
|
|
133
|
-
<mf-dialog title="Delete project" message="The project and all its data will be permanently deleted. This action cannot be undone." [showClose]="true" [showActions]="true">
|
|
134
|
-
<div mfDialogActions>
|
|
135
|
-
<mf-button label="Cancel" variant="outlined" size="sm" />
|
|
136
|
-
<mf-button label="Delete" variant="filled" size="sm" />
|
|
137
|
-
</div>
|
|
138
|
-
</mf-dialog>
|
|
139
|
-
</div>
|
|
140
|
-
`,
|
|
141
|
-
moduleMetadata: { imports: [MfDialogComponent, MfButtonComponent] },
|
|
142
|
-
}),
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export const OpenDialog: Story = {
|
|
146
|
-
name: 'Open with MatDialog',
|
|
147
|
-
render: () => ({
|
|
148
|
-
template: `<mf-dialog-demo />`,
|
|
149
|
-
moduleMetadata: { imports: [MfDialogDemoComponent] },
|
|
150
|
-
}),
|
|
151
|
-
parameters: {
|
|
152
|
-
docs: {
|
|
153
|
-
description: {
|
|
154
|
-
story:
|
|
155
|
-
'Click the button to open the dialog using `MatDialog.open()`.',
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfFormFieldComponent } from '../app/components/form-field';
|
|
4
|
-
import { MfInputComponent } from '../app/components/input';
|
|
5
|
-
import { MfCheckboxComponent } from '../app/components/checkbox';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<MfFormFieldComponent> = {
|
|
8
|
-
title: 'Molecules/MfFormField',
|
|
9
|
-
component: MfFormFieldComponent,
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component: `
|
|
15
|
-
**MfFormField** is the form field wrapper from the ng-comps library.
|
|
16
|
-
It provides a consistent layout with label, projected content, and optional helper or error messages.
|
|
17
|
-
|
|
18
|
-
Use it as a wrapper for \`mf-input\`, \`mf-checkbox\`, or other controls when you want a uniform structure.
|
|
19
|
-
`,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
argTypes: {
|
|
24
|
-
label: { control: 'text', description: 'Field label' },
|
|
25
|
-
fieldId: { control: 'text', description: 'Accessibility id' },
|
|
26
|
-
hint: { control: 'text', description: 'Helper text' },
|
|
27
|
-
error: { control: 'text', description: 'Error message' },
|
|
28
|
-
required: { control: 'boolean', description: 'Required field' },
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default meta;
|
|
33
|
-
type Story = StoryObj<MfFormFieldComponent>;
|
|
34
|
-
|
|
35
|
-
export const WithInput: Story = {
|
|
36
|
-
name: 'With input',
|
|
37
|
-
render: (args) => ({
|
|
38
|
-
props: args,
|
|
39
|
-
template: `
|
|
40
|
-
<mf-form-field [label]="label" [hint]="hint" [required]="required">
|
|
41
|
-
<mf-input placeholder="Type your name..." [fullWidth]="true" />
|
|
42
|
-
</mf-form-field>
|
|
43
|
-
`,
|
|
44
|
-
moduleMetadata: { imports: [MfFormFieldComponent, MfInputComponent] },
|
|
45
|
-
}),
|
|
46
|
-
args: {
|
|
47
|
-
label: 'Full name',
|
|
48
|
-
hint: 'First and last name',
|
|
49
|
-
required: true,
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const WithError: Story = {
|
|
54
|
-
name: 'With error',
|
|
55
|
-
render: (args) => ({
|
|
56
|
-
props: args,
|
|
57
|
-
template: `
|
|
58
|
-
<mf-form-field [label]="label" [error]="error" [required]="required">
|
|
59
|
-
<mf-input placeholder="name@example.com" [fullWidth]="true" />
|
|
60
|
-
</mf-form-field>
|
|
61
|
-
`,
|
|
62
|
-
moduleMetadata: { imports: [MfFormFieldComponent, MfInputComponent] },
|
|
63
|
-
}),
|
|
64
|
-
args: {
|
|
65
|
-
label: 'Email address',
|
|
66
|
-
error: 'This field is required',
|
|
67
|
-
required: true,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const WithCheckbox: Story = {
|
|
72
|
-
name: 'With checkbox',
|
|
73
|
-
render: () => ({
|
|
74
|
-
template: `
|
|
75
|
-
<mf-form-field label="Notification preferences" hint="Choose the ones you want">
|
|
76
|
-
<div style="display: flex; flex-direction: column; gap: 8px; padding-top: 4px;">
|
|
77
|
-
<mf-checkbox label="Email notifications" />
|
|
78
|
-
<mf-checkbox label="Push notifications" />
|
|
79
|
-
<mf-checkbox label="SMS" />
|
|
80
|
-
</div>
|
|
81
|
-
</mf-form-field>
|
|
82
|
-
`,
|
|
83
|
-
moduleMetadata: { imports: [MfFormFieldComponent, MfCheckboxComponent] },
|
|
84
|
-
}),
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const FormExample: Story = {
|
|
88
|
-
name: 'Form example',
|
|
89
|
-
render: () => ({
|
|
90
|
-
template: `
|
|
91
|
-
<div style="display: flex; flex-direction: column; gap: 20px; max-width: 400px;">
|
|
92
|
-
<mf-form-field label="Name" [required]="true">
|
|
93
|
-
<mf-input placeholder="Your name..." [fullWidth]="true" />
|
|
94
|
-
</mf-form-field>
|
|
95
|
-
<mf-form-field label="Email" [required]="true" hint="We will use this email to contact you">
|
|
96
|
-
<mf-input placeholder="name@example.com" type="email" [fullWidth]="true" />
|
|
97
|
-
</mf-form-field>
|
|
98
|
-
<mf-form-field label="Password" [required]="true" hint="Minimum 8 characters">
|
|
99
|
-
<mf-input type="password" [fullWidth]="true" />
|
|
100
|
-
</mf-form-field>
|
|
101
|
-
<mf-form-field>
|
|
102
|
-
<mf-checkbox label="I accept the terms and conditions" />
|
|
103
|
-
</mf-form-field>
|
|
104
|
-
</div>
|
|
105
|
-
`,
|
|
106
|
-
moduleMetadata: { imports: [MfFormFieldComponent, MfInputComponent, MfCheckboxComponent] },
|
|
107
|
-
}),
|
|
108
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfGridListComponent } from '../app/components/grid-list';
|
|
4
|
-
|
|
5
|
-
const SAMPLE_TILES = [
|
|
6
|
-
{ title: 'Photography', subtitle: '12 items', background: 'var(--mf-color-primary-100)' },
|
|
7
|
-
{ title: 'Design', subtitle: '8 items', background: 'var(--mf-color-secondary-100)' },
|
|
8
|
-
{ title: 'Development', subtitle: '25 items', background: 'var(--mf-color-accent-300)', colspan: 2 },
|
|
9
|
-
{ title: 'Marketing', subtitle: '6 items', background: 'var(--mf-color-neutral-100)' },
|
|
10
|
-
{ title: 'Data', subtitle: '15 items', background: 'var(--mf-color-primary-200)' },
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const meta: Meta<MfGridListComponent> = {
|
|
14
|
-
title: 'Organisms/MfGridList',
|
|
15
|
-
component: MfGridListComponent,
|
|
16
|
-
tags: ['autodocs'],
|
|
17
|
-
parameters: {
|
|
18
|
-
docs: {
|
|
19
|
-
description: {
|
|
20
|
-
component: `
|
|
21
|
-
**MfGridList** is the grid list component from the ng-comps library.
|
|
22
|
-
It wraps Angular Material \`mat-grid-list\` and exposes a consistent branded API.
|
|
23
|
-
|
|
24
|
-
It supports declarative tiles through the \`tiles\` input (an array of \`MfGridTile\`) or \`mat-grid-tile\` content projection for advanced use cases.
|
|
25
|
-
`,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
argTypes: {
|
|
30
|
-
cols: {
|
|
31
|
-
control: { type: 'range', min: 1, max: 6 },
|
|
32
|
-
description: 'Number of columns',
|
|
33
|
-
},
|
|
34
|
-
rowHeight: {
|
|
35
|
-
control: 'text',
|
|
36
|
-
description: 'Height of each row (for example "200px", "1:1", or "fit")',
|
|
37
|
-
},
|
|
38
|
-
gutterSize: {
|
|
39
|
-
control: 'text',
|
|
40
|
-
description: 'Space between tiles',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default meta;
|
|
46
|
-
type Story = StoryObj<MfGridListComponent>;
|
|
47
|
-
|
|
48
|
-
export const Default: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
cols: 3,
|
|
51
|
-
rowHeight: '160px',
|
|
52
|
-
gutterSize: '8px',
|
|
53
|
-
tiles: SAMPLE_TILES,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const TwoColumns: Story = {
|
|
58
|
-
name: 'Two columns',
|
|
59
|
-
args: {
|
|
60
|
-
cols: 2,
|
|
61
|
-
rowHeight: '180px',
|
|
62
|
-
tiles: SAMPLE_TILES,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const FourColumns: Story = {
|
|
67
|
-
name: 'Four columns',
|
|
68
|
-
args: {
|
|
69
|
-
cols: 4,
|
|
70
|
-
rowHeight: '120px',
|
|
71
|
-
tiles: SAMPLE_TILES,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const SquareTiles: Story = {
|
|
76
|
-
name: 'Square tiles',
|
|
77
|
-
args: {
|
|
78
|
-
cols: 3,
|
|
79
|
-
rowHeight: '1:1',
|
|
80
|
-
tiles: SAMPLE_TILES,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const AllVariants: Story = {
|
|
85
|
-
name: 'All variants',
|
|
86
|
-
render: () => ({
|
|
87
|
-
template: `
|
|
88
|
-
<div style="display: flex; flex-direction: column; gap: 32px;">
|
|
89
|
-
<div>
|
|
90
|
-
<p style="font-size: 0.875rem; color: #475569; margin-bottom: 8px;">3 columns</p>
|
|
91
|
-
<mf-grid-list [cols]="3" rowHeight="140px" [tiles]="tiles" />
|
|
92
|
-
</div>
|
|
93
|
-
<div>
|
|
94
|
-
<p style="font-size: 0.875rem; color: #475569; margin-bottom: 8px;">4 columns</p>
|
|
95
|
-
<mf-grid-list [cols]="4" rowHeight="120px" [tiles]="tiles" />
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
`,
|
|
99
|
-
props: {
|
|
100
|
-
tiles: SAMPLE_TILES,
|
|
101
|
-
},
|
|
102
|
-
moduleMetadata: { imports: [MfGridListComponent] },
|
|
103
|
-
}),
|
|
104
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfIconComponent } from '../app/components/icon';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<MfIconComponent> = {
|
|
6
|
-
title: 'Atoms/MfIcon',
|
|
7
|
-
component: MfIconComponent,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: `
|
|
13
|
-
**MfIcon** is the icon component from the ng-comps library.
|
|
14
|
-
It uses Material Icons under the hood and exposes a consistent API with branded sizes and colors.
|
|
15
|
-
|
|
16
|
-
| Size | Pixels | When to use it |
|
|
17
|
-
|--------|--------|---------------------------------|
|
|
18
|
-
| \`sm\` | 16px | Inside buttons, chips, or actions |
|
|
19
|
-
| \`md\` | 20px | General use, lists, forms |
|
|
20
|
-
| \`lg\` | 24px | Headers and navigation |
|
|
21
|
-
| \`xl\` | 32px | Illustrations and empty states |
|
|
22
|
-
`,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
argTypes: {
|
|
27
|
-
name: { control: 'text', description: 'Material icon name' },
|
|
28
|
-
size: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: ['sm', 'md', 'lg', 'xl'],
|
|
31
|
-
description: 'Icon size',
|
|
32
|
-
},
|
|
33
|
-
color: {
|
|
34
|
-
control: 'select',
|
|
35
|
-
options: ['default', 'brand', 'muted', 'error', 'inherit'],
|
|
36
|
-
description: 'Semantic icon color',
|
|
37
|
-
},
|
|
38
|
-
label: {
|
|
39
|
-
control: 'text',
|
|
40
|
-
description: 'Accessible label (leave empty when decorative)',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default meta;
|
|
46
|
-
type Story = StoryObj<MfIconComponent>;
|
|
47
|
-
|
|
48
|
-
export const Default: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
name: 'home',
|
|
51
|
-
size: 'md',
|
|
52
|
-
color: 'default',
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const Brand: Story = {
|
|
57
|
-
args: {
|
|
58
|
-
name: 'favorite',
|
|
59
|
-
size: 'md',
|
|
60
|
-
color: 'brand',
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const Muted: Story = {
|
|
65
|
-
args: {
|
|
66
|
-
name: 'info',
|
|
67
|
-
size: 'md',
|
|
68
|
-
color: 'muted',
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const ErrorColor: Story = {
|
|
73
|
-
name: 'Error',
|
|
74
|
-
args: {
|
|
75
|
-
name: 'error',
|
|
76
|
-
size: 'md',
|
|
77
|
-
color: 'error',
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const Small: Story = {
|
|
82
|
-
args: {
|
|
83
|
-
name: 'check_circle',
|
|
84
|
-
size: 'sm',
|
|
85
|
-
color: 'brand',
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const Large: Story = {
|
|
90
|
-
args: {
|
|
91
|
-
name: 'star',
|
|
92
|
-
size: 'lg',
|
|
93
|
-
color: 'default',
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const ExtraLarge: Story = {
|
|
98
|
-
args: {
|
|
99
|
-
name: 'rocket_launch',
|
|
100
|
-
size: 'xl',
|
|
101
|
-
color: 'brand',
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const AllSizes: Story = {
|
|
106
|
-
name: 'All sizes',
|
|
107
|
-
render: () => ({
|
|
108
|
-
template: `
|
|
109
|
-
<div style="display: flex; gap: 16px; align-items: center;">
|
|
110
|
-
<mf-icon name="settings" size="sm" />
|
|
111
|
-
<mf-icon name="settings" size="md" />
|
|
112
|
-
<mf-icon name="settings" size="lg" />
|
|
113
|
-
<mf-icon name="settings" size="xl" />
|
|
114
|
-
</div>
|
|
115
|
-
`,
|
|
116
|
-
moduleMetadata: { imports: [MfIconComponent] },
|
|
117
|
-
}),
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export const AllColors: Story = {
|
|
121
|
-
name: 'All colors',
|
|
122
|
-
render: () => ({
|
|
123
|
-
template: `
|
|
124
|
-
<div style="display: flex; gap: 16px; align-items: center;">
|
|
125
|
-
<mf-icon name="circle" size="lg" color="default" />
|
|
126
|
-
<mf-icon name="circle" size="lg" color="brand" />
|
|
127
|
-
<mf-icon name="circle" size="lg" color="muted" />
|
|
128
|
-
<mf-icon name="circle" size="lg" color="error" />
|
|
129
|
-
</div>
|
|
130
|
-
`,
|
|
131
|
-
moduleMetadata: { imports: [MfIconComponent] },
|
|
132
|
-
}),
|
|
133
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfInputComponent } from '../app/components/input';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<MfInputComponent> = {
|
|
6
|
-
title: 'Atoms/MfInput',
|
|
7
|
-
component: MfInputComponent,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: `
|
|
13
|
-
**MfInput** is the text field component from the ng-comps library.
|
|
14
|
-
It uses Angular Material \`mat-form-field\` under the hood while exposing a consistent branded API.
|
|
15
|
-
|
|
16
|
-
| Property | Description |
|
|
17
|
-
|----------------|-------------------------------|
|
|
18
|
-
| \`label\` | Floating field label |
|
|
19
|
-
| \`placeholder\` | Placeholder text |
|
|
20
|
-
| \`hint\` | Helper text below the field |
|
|
21
|
-
| \`error\` | Error message |
|
|
22
|
-
| \`leadingIcon\` | Icon shown at the start |
|
|
23
|
-
| \`trailingIcon\` | Icon shown at the end |
|
|
24
|
-
`,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
argTypes: {
|
|
29
|
-
label: { control: 'text', description: 'Floating label' },
|
|
30
|
-
placeholder: { control: 'text', description: 'Placeholder' },
|
|
31
|
-
type: {
|
|
32
|
-
control: 'select',
|
|
33
|
-
options: ['text', 'email', 'password', 'number', 'search', 'tel', 'url'],
|
|
34
|
-
},
|
|
35
|
-
size: {
|
|
36
|
-
control: 'select',
|
|
37
|
-
options: ['sm', 'md', 'lg'],
|
|
38
|
-
description: 'Field size',
|
|
39
|
-
},
|
|
40
|
-
value: { control: 'text' },
|
|
41
|
-
disabled: { control: 'boolean' },
|
|
42
|
-
readonly: { control: 'boolean' },
|
|
43
|
-
hint: { control: 'text', description: 'Helper text' },
|
|
44
|
-
error: { control: 'text', description: 'Error message' },
|
|
45
|
-
leadingIcon: { control: 'text' },
|
|
46
|
-
trailingIcon: { control: 'text' },
|
|
47
|
-
fullWidth: { control: 'boolean' },
|
|
48
|
-
mfInput: { action: 'mfInput' },
|
|
49
|
-
mfBlur: { action: 'mfBlur' },
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export default meta;
|
|
54
|
-
type Story = StoryObj<MfInputComponent>;
|
|
55
|
-
|
|
56
|
-
export const Default: Story = {
|
|
57
|
-
args: {
|
|
58
|
-
label: 'Email address',
|
|
59
|
-
placeholder: 'name@example.com',
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const WithHint: Story = {
|
|
64
|
-
name: 'With helper text',
|
|
65
|
-
args: {
|
|
66
|
-
label: 'Password',
|
|
67
|
-
type: 'password',
|
|
68
|
-
hint: 'Minimum 8 characters',
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const WithError: Story = {
|
|
73
|
-
name: 'With error',
|
|
74
|
-
args: {
|
|
75
|
-
label: 'Email',
|
|
76
|
-
value: 'invalid-email',
|
|
77
|
-
error: 'Enter a valid email address',
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const WithLeadingIcon: Story = {
|
|
82
|
-
name: 'With leading icon',
|
|
83
|
-
args: {
|
|
84
|
-
label: 'Search',
|
|
85
|
-
placeholder: 'Search...',
|
|
86
|
-
leadingIcon: 'search',
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const WithTrailingIcon: Story = {
|
|
91
|
-
name: 'With trailing icon',
|
|
92
|
-
args: {
|
|
93
|
-
label: 'Email',
|
|
94
|
-
placeholder: 'name@example.com',
|
|
95
|
-
trailingIcon: 'mail',
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const Disabled: Story = {
|
|
100
|
-
args: {
|
|
101
|
-
label: 'Disabled field',
|
|
102
|
-
value: 'Not editable',
|
|
103
|
-
disabled: true,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const Readonly: Story = {
|
|
108
|
-
name: 'Read only',
|
|
109
|
-
args: {
|
|
110
|
-
label: 'Read only',
|
|
111
|
-
value: 'Fixed value',
|
|
112
|
-
readonly: true,
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const Small: Story = {
|
|
117
|
-
args: {
|
|
118
|
-
label: 'Small',
|
|
119
|
-
placeholder: 'Text...',
|
|
120
|
-
size: 'sm',
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export const Large: Story = {
|
|
125
|
-
args: {
|
|
126
|
-
label: 'Large',
|
|
127
|
-
placeholder: 'Text...',
|
|
128
|
-
size: 'lg',
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const FullWidth: Story = {
|
|
133
|
-
name: 'Full width',
|
|
134
|
-
args: {
|
|
135
|
-
label: 'Full name',
|
|
136
|
-
placeholder: 'Jane Doe',
|
|
137
|
-
fullWidth: true,
|
|
138
|
-
},
|
|
139
|
-
parameters: {
|
|
140
|
-
layout: 'padded',
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export const AllVariants: Story = {
|
|
145
|
-
name: 'All variants',
|
|
146
|
-
render: () => ({
|
|
147
|
-
template: `
|
|
148
|
-
<div style="display: flex; flex-direction: column; gap: 16px; max-width: 360px;">
|
|
149
|
-
<mf-input label="Default" placeholder="Type here..." />
|
|
150
|
-
<mf-input label="With help" hint="This is helper text" />
|
|
151
|
-
<mf-input label="With error" value="bad" error="This field is required" />
|
|
152
|
-
<mf-input label="Search" leadingIcon="search" placeholder="Search..." />
|
|
153
|
-
<mf-input label="Disabled" value="Not editable" [disabled]="true" />
|
|
154
|
-
</div>
|
|
155
|
-
`,
|
|
156
|
-
moduleMetadata: { imports: [MfInputComponent] },
|
|
157
|
-
}),
|
|
158
|
-
};
|