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,194 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfAutocompleteComponent } from '../app/components/autocomplete';
|
|
4
|
-
|
|
5
|
-
const COUNTRIES = [
|
|
6
|
-
{ value: 'es', label: 'Spain' },
|
|
7
|
-
{ value: 'mx', label: 'Mexico' },
|
|
8
|
-
{ value: 'ar', label: 'Argentina' },
|
|
9
|
-
{ value: 'co', label: 'Colombia' },
|
|
10
|
-
{ value: 'cl', label: 'Chile' },
|
|
11
|
-
{ value: 'pe', label: 'Peru' },
|
|
12
|
-
{ value: 'us', label: 'United States' },
|
|
13
|
-
{ value: 'uk', label: 'United Kingdom' },
|
|
14
|
-
{ value: 'de', label: 'Germany' },
|
|
15
|
-
{ value: 'fr', label: 'France' },
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
const meta: Meta<MfAutocompleteComponent> = {
|
|
19
|
-
title: 'Atoms/MfAutocomplete',
|
|
20
|
-
component: MfAutocompleteComponent,
|
|
21
|
-
tags: ['autodocs'],
|
|
22
|
-
parameters: {
|
|
23
|
-
docs: {
|
|
24
|
-
description: {
|
|
25
|
-
component: `
|
|
26
|
-
**MfAutocomplete** is the autocomplete field from the ng-comps library.
|
|
27
|
-
It uses Angular Material \`mat-autocomplete\` under the hood while exposing a consistent branded API.
|
|
28
|
-
|
|
29
|
-
Options are filtered automatically based on the text typed into the field, matching against the option \`label\` property. You can pass the full option list and let the component handle filtering.
|
|
30
|
-
|
|
31
|
-
The dropdown panel is styled through the global \`mf-autocomplete-panel\` class. You can inject additional classes with \`panelClass\`.
|
|
32
|
-
|
|
33
|
-
| Property | Description |
|
|
34
|
-
|--------------------|-------------------------------------------------|
|
|
35
|
-
| \`options\` | Array of options \`{ value, label, disabled? }\` |
|
|
36
|
-
| \`label\` | Floating field label |
|
|
37
|
-
| \`placeholder\` | Placeholder text |
|
|
38
|
-
| \`hint\` | Helper text shown below the field |
|
|
39
|
-
| \`error\` | Error message |
|
|
40
|
-
| \`leadingIcon\` | Material icon shown at the start |
|
|
41
|
-
| \`trailingIcon\` | Material icon shown at the end |
|
|
42
|
-
| \`panelWidth\` | Panel width (\`'auto'\` by default) |
|
|
43
|
-
| \`panelClass\` | Extra classes for the dropdown panel |
|
|
44
|
-
| \`mfInput\` | Event emitted with the typed text |
|
|
45
|
-
| \`mfOptionSelected\` | Event emitted with the selected option |
|
|
46
|
-
`,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
argTypes: {
|
|
51
|
-
label: { control: 'text', description: 'Floating label' },
|
|
52
|
-
placeholder: { control: 'text', description: 'Placeholder' },
|
|
53
|
-
size: {
|
|
54
|
-
control: 'select',
|
|
55
|
-
options: ['sm', 'md', 'lg'],
|
|
56
|
-
description: 'Field size',
|
|
57
|
-
},
|
|
58
|
-
disabled: { control: 'boolean' },
|
|
59
|
-
hint: { control: 'text', description: 'Helper text' },
|
|
60
|
-
error: { control: 'text', description: 'Error message' },
|
|
61
|
-
leadingIcon: {
|
|
62
|
-
control: 'text',
|
|
63
|
-
description: 'Leading icon (Material icon name)',
|
|
64
|
-
},
|
|
65
|
-
trailingIcon: {
|
|
66
|
-
control: 'text',
|
|
67
|
-
description: 'Trailing icon (Material icon name)',
|
|
68
|
-
},
|
|
69
|
-
fullWidth: { control: 'boolean', description: 'Full width' },
|
|
70
|
-
panelWidth: { control: 'text', description: 'Dropdown panel width' },
|
|
71
|
-
mfInput: { action: 'mfInput' },
|
|
72
|
-
mfOptionSelected: { action: 'mfOptionSelected' },
|
|
73
|
-
mfBlur: { action: 'mfBlur' },
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default meta;
|
|
78
|
-
type Story = StoryObj<MfAutocompleteComponent>;
|
|
79
|
-
|
|
80
|
-
export const Default: Story = {
|
|
81
|
-
args: {
|
|
82
|
-
options: COUNTRIES,
|
|
83
|
-
label: 'Country',
|
|
84
|
-
placeholder: 'Type to search...',
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const WithHint: Story = {
|
|
89
|
-
name: 'With helper text',
|
|
90
|
-
args: {
|
|
91
|
-
options: COUNTRIES,
|
|
92
|
-
label: 'Country of origin',
|
|
93
|
-
hint: 'Start typing to filter the results',
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const WithError: Story = {
|
|
98
|
-
name: 'With error',
|
|
99
|
-
args: {
|
|
100
|
-
options: COUNTRIES,
|
|
101
|
-
label: 'Country',
|
|
102
|
-
error: 'Select a valid country',
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export const WithLeadingIcon: Story = {
|
|
107
|
-
name: 'With leading icon',
|
|
108
|
-
args: {
|
|
109
|
-
options: COUNTRIES,
|
|
110
|
-
label: 'Country',
|
|
111
|
-
placeholder: 'Search country...',
|
|
112
|
-
leadingIcon: 'search',
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const WithTrailingIcon: Story = {
|
|
117
|
-
name: 'With trailing icon',
|
|
118
|
-
args: {
|
|
119
|
-
options: COUNTRIES,
|
|
120
|
-
label: 'Country',
|
|
121
|
-
trailingIcon: 'public',
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export const Disabled: Story = {
|
|
126
|
-
args: {
|
|
127
|
-
options: COUNTRIES,
|
|
128
|
-
label: 'Country (disabled)',
|
|
129
|
-
value: 'Spain',
|
|
130
|
-
disabled: true,
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const Small: Story = {
|
|
135
|
-
args: {
|
|
136
|
-
options: COUNTRIES,
|
|
137
|
-
label: 'Small',
|
|
138
|
-
size: 'sm',
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const Large: Story = {
|
|
143
|
-
args: {
|
|
144
|
-
options: COUNTRIES,
|
|
145
|
-
label: 'Large',
|
|
146
|
-
size: 'lg',
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const FullWidth: Story = {
|
|
151
|
-
name: 'Full width',
|
|
152
|
-
args: {
|
|
153
|
-
options: COUNTRIES,
|
|
154
|
-
label: 'Country',
|
|
155
|
-
fullWidth: true,
|
|
156
|
-
},
|
|
157
|
-
parameters: {
|
|
158
|
-
layout: 'padded',
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export const CustomPanelClass: Story = {
|
|
163
|
-
name: 'Panel with custom class',
|
|
164
|
-
args: {
|
|
165
|
-
options: COUNTRIES,
|
|
166
|
-
label: 'Country',
|
|
167
|
-
panelClass: 'my-custom-autocomplete',
|
|
168
|
-
},
|
|
169
|
-
parameters: {
|
|
170
|
-
docs: {
|
|
171
|
-
description: {
|
|
172
|
-
story:
|
|
173
|
-
'Use `panelClass` to add CSS classes to the autocomplete panel and apply custom styling.',
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export const AllVariants: Story = {
|
|
180
|
-
name: 'All variants',
|
|
181
|
-
render: () => ({
|
|
182
|
-
template: `
|
|
183
|
-
<div style="display: flex; flex-direction: column; gap: 16px; max-width: 360px;">
|
|
184
|
-
<mf-autocomplete [options]="opts" label="Default" placeholder="Type to search..." />
|
|
185
|
-
<mf-autocomplete [options]="opts" label="With help" hint="Filter by country name" />
|
|
186
|
-
<mf-autocomplete [options]="opts" label="With error" error="Select a valid country" />
|
|
187
|
-
<mf-autocomplete [options]="opts" label="With icon" leadingIcon="search" placeholder="Search..." />
|
|
188
|
-
<mf-autocomplete [options]="opts" label="Disabled" value="Spain" [disabled]="true" />
|
|
189
|
-
</div>
|
|
190
|
-
`,
|
|
191
|
-
props: { opts: COUNTRIES },
|
|
192
|
-
moduleMetadata: { imports: [MfAutocompleteComponent] },
|
|
193
|
-
}),
|
|
194
|
-
};
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfButtonComponent } from '../app/components/button';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<MfButtonComponent> = {
|
|
6
|
-
title: 'Components/MfButton',
|
|
7
|
-
component: MfButtonComponent,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: `
|
|
13
|
-
**MfButton** is the button component from the ng-comps library.
|
|
14
|
-
It uses Angular Material under the hood while exposing a consistent branded API.
|
|
15
|
-
|
|
16
|
-
| Variant | When to use it |
|
|
17
|
-
|------------|-----------------------------------------------|
|
|
18
|
-
| \`filled\` | Primary action, usually one per section |
|
|
19
|
-
| \`outlined\` | Secondary action or soft destructive action |
|
|
20
|
-
| \`text\` | Tertiary action, internal navigation, or link |
|
|
21
|
-
`,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
variant: {
|
|
27
|
-
control: 'select',
|
|
28
|
-
options: ['filled', 'outlined', 'text'],
|
|
29
|
-
description: 'Visual button variant',
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
control: 'select',
|
|
33
|
-
options: ['sm', 'md', 'lg'],
|
|
34
|
-
description: 'Button size',
|
|
35
|
-
},
|
|
36
|
-
type: {
|
|
37
|
-
control: 'select',
|
|
38
|
-
options: ['button', 'submit', 'reset'],
|
|
39
|
-
},
|
|
40
|
-
disabled: { control: 'boolean' },
|
|
41
|
-
fullWidth: { control: 'boolean' },
|
|
42
|
-
leadingIcon: {
|
|
43
|
-
control: 'text',
|
|
44
|
-
description: 'Material icon name shown before the label',
|
|
45
|
-
},
|
|
46
|
-
trailingIcon: {
|
|
47
|
-
control: 'text',
|
|
48
|
-
description: 'Material icon name shown after the label',
|
|
49
|
-
},
|
|
50
|
-
mfClick: { action: 'mfClick' },
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default meta;
|
|
55
|
-
type Story = StoryObj<MfButtonComponent>;
|
|
56
|
-
|
|
57
|
-
export const Filled: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
label: 'Save changes',
|
|
60
|
-
variant: 'filled',
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const Outlined: Story = {
|
|
65
|
-
args: {
|
|
66
|
-
label: 'Cancel',
|
|
67
|
-
variant: 'outlined',
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const Text: Story = {
|
|
72
|
-
args: {
|
|
73
|
-
label: 'View details',
|
|
74
|
-
variant: 'text',
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const Small: Story = {
|
|
79
|
-
args: {
|
|
80
|
-
label: 'Small',
|
|
81
|
-
variant: 'filled',
|
|
82
|
-
size: 'sm',
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const Medium: Story = {
|
|
87
|
-
args: {
|
|
88
|
-
label: 'Medium',
|
|
89
|
-
variant: 'filled',
|
|
90
|
-
size: 'md',
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const Large: Story = {
|
|
95
|
-
args: {
|
|
96
|
-
label: 'Large',
|
|
97
|
-
variant: 'filled',
|
|
98
|
-
size: 'lg',
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const WithLeadingIcon: Story = {
|
|
103
|
-
name: 'With leading icon',
|
|
104
|
-
args: {
|
|
105
|
-
label: 'Create new',
|
|
106
|
-
variant: 'filled',
|
|
107
|
-
leadingIcon: 'add',
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const WithTrailingIcon: Story = {
|
|
112
|
-
name: 'With trailing icon',
|
|
113
|
-
args: {
|
|
114
|
-
label: 'Next',
|
|
115
|
-
variant: 'filled',
|
|
116
|
-
trailingIcon: 'arrow_forward',
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export const Disabled: Story = {
|
|
121
|
-
args: {
|
|
122
|
-
label: 'Disabled',
|
|
123
|
-
variant: 'filled',
|
|
124
|
-
disabled: true,
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const FullWidth: Story = {
|
|
129
|
-
name: 'Full width',
|
|
130
|
-
args: {
|
|
131
|
-
label: 'Sign in',
|
|
132
|
-
variant: 'filled',
|
|
133
|
-
fullWidth: true,
|
|
134
|
-
},
|
|
135
|
-
parameters: {
|
|
136
|
-
layout: 'padded',
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const AllVariants: Story = {
|
|
141
|
-
name: 'All variants',
|
|
142
|
-
render: () => ({
|
|
143
|
-
template: `
|
|
144
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
145
|
-
<mf-button label="Filled" variant="filled" />
|
|
146
|
-
<mf-button label="Outlined" variant="outlined" />
|
|
147
|
-
<mf-button label="Text" variant="text" />
|
|
148
|
-
</div>
|
|
149
|
-
`,
|
|
150
|
-
moduleMetadata: { imports: [MfButtonComponent] },
|
|
151
|
-
}),
|
|
152
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfCardComponent } from '../app/components/card';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<MfCardComponent> = {
|
|
6
|
-
title: 'Molecules/MfCard',
|
|
7
|
-
component: MfCardComponent,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: `
|
|
13
|
-
**MfCard** is the card component from the ng-comps library.
|
|
14
|
-
It uses Angular Material \`mat-card\` under the hood with a custom visual style that feels clean, elegant, and modern.
|
|
15
|
-
|
|
16
|
-
| Variant | When to use it |
|
|
17
|
-
|-------------|---------------------------------------------|
|
|
18
|
-
| \`elevated\` | Primary content highlighted with a shadow |
|
|
19
|
-
| \`outlined\` | Secondary content with a subtle border |
|
|
20
|
-
| \`flat\` | Background content with no border or shadow |
|
|
21
|
-
`,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
title: { control: 'text', description: 'Card title' },
|
|
27
|
-
subtitle: { control: 'text', description: 'Card subtitle' },
|
|
28
|
-
variant: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: ['elevated', 'outlined', 'flat'],
|
|
31
|
-
description: 'Visual variant',
|
|
32
|
-
},
|
|
33
|
-
padding: {
|
|
34
|
-
control: 'select',
|
|
35
|
-
options: ['none', 'sm', 'md', 'lg'],
|
|
36
|
-
description: 'Internal padding',
|
|
37
|
-
},
|
|
38
|
-
interactive: { control: 'boolean', description: 'Interactive hover effect' },
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default meta;
|
|
43
|
-
type Story = StoryObj<MfCardComponent>;
|
|
44
|
-
|
|
45
|
-
export const Elevated: Story = {
|
|
46
|
-
render: (args) => ({
|
|
47
|
-
props: args,
|
|
48
|
-
template: `
|
|
49
|
-
<mf-card [title]="title" [subtitle]="subtitle" [variant]="variant" [padding]="padding" [interactive]="interactive">
|
|
50
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600);">
|
|
51
|
-
This is the card content. It can include text, forms, lists, or other components.
|
|
52
|
-
</p>
|
|
53
|
-
</mf-card>
|
|
54
|
-
`,
|
|
55
|
-
moduleMetadata: { imports: [MfCardComponent] },
|
|
56
|
-
}),
|
|
57
|
-
args: {
|
|
58
|
-
title: 'Card title',
|
|
59
|
-
subtitle: 'Descriptive subtitle',
|
|
60
|
-
variant: 'elevated',
|
|
61
|
-
padding: 'md',
|
|
62
|
-
interactive: false,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const Outlined: Story = {
|
|
67
|
-
render: (args) => ({
|
|
68
|
-
props: args,
|
|
69
|
-
template: `
|
|
70
|
-
<mf-card [title]="title" [subtitle]="subtitle" variant="outlined">
|
|
71
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600);">
|
|
72
|
-
A subtle bordered card, ideal for secondary content.
|
|
73
|
-
</p>
|
|
74
|
-
</mf-card>
|
|
75
|
-
`,
|
|
76
|
-
moduleMetadata: { imports: [MfCardComponent] },
|
|
77
|
-
}),
|
|
78
|
-
args: {
|
|
79
|
-
title: 'Outlined card',
|
|
80
|
-
subtitle: 'Outlined variant',
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const Flat: Story = {
|
|
85
|
-
render: (args) => ({
|
|
86
|
-
props: args,
|
|
87
|
-
template: `
|
|
88
|
-
<mf-card [title]="title" variant="flat">
|
|
89
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600);">
|
|
90
|
-
A flat card with a subtle background and no border or shadow.
|
|
91
|
-
</p>
|
|
92
|
-
</mf-card>
|
|
93
|
-
`,
|
|
94
|
-
moduleMetadata: { imports: [MfCardComponent] },
|
|
95
|
-
}),
|
|
96
|
-
args: {
|
|
97
|
-
title: 'Flat card',
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export const Interactive: Story = {
|
|
102
|
-
render: () => ({
|
|
103
|
-
template: `
|
|
104
|
-
<mf-card title="Interactive card" subtitle="Hover to see the effect" variant="elevated" [interactive]="true">
|
|
105
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600);">
|
|
106
|
-
This card responds to hover with subtle elevation and motion.
|
|
107
|
-
</p>
|
|
108
|
-
</mf-card>
|
|
109
|
-
`,
|
|
110
|
-
moduleMetadata: { imports: [MfCardComponent] },
|
|
111
|
-
}),
|
|
112
|
-
args: {},
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export const NoHeader: Story = {
|
|
116
|
-
name: 'No header',
|
|
117
|
-
render: () => ({
|
|
118
|
-
template: `
|
|
119
|
-
<mf-card variant="outlined" padding="lg">
|
|
120
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600); font-size: var(--mf-text-lg);">
|
|
121
|
-
Card without a header, using only projected content.
|
|
122
|
-
</p>
|
|
123
|
-
</mf-card>
|
|
124
|
-
`,
|
|
125
|
-
moduleMetadata: { imports: [MfCardComponent] },
|
|
126
|
-
}),
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const AllVariants: Story = {
|
|
130
|
-
name: 'All variants',
|
|
131
|
-
render: () => ({
|
|
132
|
-
template: `
|
|
133
|
-
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
|
|
134
|
-
<mf-card title="Elevated" subtitle="With shadow" variant="elevated" style="width: 280px;">
|
|
135
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600);">Sample content.</p>
|
|
136
|
-
</mf-card>
|
|
137
|
-
<mf-card title="Outlined" subtitle="With border" variant="outlined" style="width: 280px;">
|
|
138
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600);">Sample content.</p>
|
|
139
|
-
</mf-card>
|
|
140
|
-
<mf-card title="Flat" subtitle="No elevation" variant="flat" style="width: 280px;">
|
|
141
|
-
<p style="margin: 0; color: var(--mf-color-neutral-600);">Sample content.</p>
|
|
142
|
-
</mf-card>
|
|
143
|
-
</div>
|
|
144
|
-
`,
|
|
145
|
-
moduleMetadata: { imports: [MfCardComponent] },
|
|
146
|
-
}),
|
|
147
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfCheckboxComponent } from '../app/components/checkbox';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<MfCheckboxComponent> = {
|
|
6
|
-
title: 'Atoms/MfCheckbox',
|
|
7
|
-
component: MfCheckboxComponent,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: `
|
|
13
|
-
**MfCheckbox** is the checkbox component from the ng-comps library.
|
|
14
|
-
It uses Angular Material \`mat-checkbox\` under the hood while exposing a consistent branded API.
|
|
15
|
-
|
|
16
|
-
| State | Description |
|
|
17
|
-
|-----------------|-------------------------|
|
|
18
|
-
| \`checked\` | Selected |
|
|
19
|
-
| \`indeterminate\` | Partial selection state |
|
|
20
|
-
| \`disabled\` | Not interactive |
|
|
21
|
-
`,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
label: { control: 'text', description: 'Checkbox label text' },
|
|
27
|
-
checked: { control: 'boolean' },
|
|
28
|
-
indeterminate: { control: 'boolean' },
|
|
29
|
-
disabled: { control: 'boolean' },
|
|
30
|
-
mfChange: { action: 'mfChange' },
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default meta;
|
|
35
|
-
type Story = StoryObj<MfCheckboxComponent>;
|
|
36
|
-
|
|
37
|
-
export const Default: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
label: 'I accept the terms and conditions',
|
|
40
|
-
checked: false,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const Checked: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
label: 'Selected option',
|
|
47
|
-
checked: true,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Indeterminate: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
label: 'Partial selection',
|
|
54
|
-
indeterminate: true,
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Disabled: Story = {
|
|
59
|
-
args: {
|
|
60
|
-
label: 'Disabled option',
|
|
61
|
-
disabled: true,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const DisabledChecked: Story = {
|
|
66
|
-
name: 'Disabled and checked',
|
|
67
|
-
args: {
|
|
68
|
-
label: 'Checked and disabled',
|
|
69
|
-
checked: true,
|
|
70
|
-
disabled: true,
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const AllStates: Story = {
|
|
75
|
-
name: 'All states',
|
|
76
|
-
render: () => ({
|
|
77
|
-
template: `
|
|
78
|
-
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
79
|
-
<mf-checkbox label="Unchecked" />
|
|
80
|
-
<mf-checkbox label="Checked" [checked]="true" />
|
|
81
|
-
<mf-checkbox label="Indeterminate" [indeterminate]="true" />
|
|
82
|
-
<mf-checkbox label="Disabled" [disabled]="true" />
|
|
83
|
-
<mf-checkbox label="Checked and disabled" [checked]="true" [disabled]="true" />
|
|
84
|
-
</div>
|
|
85
|
-
`,
|
|
86
|
-
moduleMetadata: { imports: [MfCheckboxComponent] },
|
|
87
|
-
}),
|
|
88
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfDatepickerComponent } from '../app/components/datepicker';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<MfDatepickerComponent> = {
|
|
6
|
-
title: 'Atoms/MfDatepicker',
|
|
7
|
-
component: MfDatepickerComponent,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: `
|
|
13
|
-
**MfDatepicker** is the date picker component from the ng-comps library.
|
|
14
|
-
It uses Angular Material \`mat-datepicker\` 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
|
-
| \`min\` | Minimum selectable date |
|
|
23
|
-
| \`max\` | Maximum selectable date |
|
|
24
|
-
| \`disabled\` | Disables the field |
|
|
25
|
-
| \`fullWidth\` | Makes the field fill its container |
|
|
26
|
-
`,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
argTypes: {
|
|
31
|
-
label: { control: 'text', description: 'Floating label' },
|
|
32
|
-
placeholder: { control: 'text', description: 'Placeholder' },
|
|
33
|
-
size: {
|
|
34
|
-
control: 'select',
|
|
35
|
-
options: ['sm', 'md', 'lg'],
|
|
36
|
-
description: 'Field size',
|
|
37
|
-
},
|
|
38
|
-
disabled: { control: 'boolean' },
|
|
39
|
-
hint: { control: 'text', description: 'Helper text' },
|
|
40
|
-
error: { control: 'text', description: 'Error message' },
|
|
41
|
-
fullWidth: { control: 'boolean' },
|
|
42
|
-
mfChange: { action: 'mfChange' },
|
|
43
|
-
mfBlur: { action: 'mfBlur' },
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default meta;
|
|
48
|
-
type Story = StoryObj<MfDatepickerComponent>;
|
|
49
|
-
|
|
50
|
-
export const Default: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
label: 'Birth date',
|
|
53
|
-
placeholder: 'DD/MM/YYYY',
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const WithHint: Story = {
|
|
58
|
-
name: 'With helper text',
|
|
59
|
-
args: {
|
|
60
|
-
label: 'Start date',
|
|
61
|
-
hint: 'Select a date after today',
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const WithError: Story = {
|
|
66
|
-
name: 'With error',
|
|
67
|
-
args: {
|
|
68
|
-
label: 'Due date',
|
|
69
|
-
error: 'Date is required',
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Disabled: Story = {
|
|
74
|
-
args: {
|
|
75
|
-
label: 'Date (disabled)',
|
|
76
|
-
disabled: true,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Small: Story = {
|
|
81
|
-
args: {
|
|
82
|
-
label: 'Small',
|
|
83
|
-
size: 'sm',
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const Large: Story = {
|
|
88
|
-
args: {
|
|
89
|
-
label: 'Large',
|
|
90
|
-
size: 'lg',
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const FullWidth: Story = {
|
|
95
|
-
name: 'Full width',
|
|
96
|
-
args: {
|
|
97
|
-
label: 'Delivery date',
|
|
98
|
-
fullWidth: true,
|
|
99
|
-
},
|
|
100
|
-
parameters: {
|
|
101
|
-
layout: 'padded',
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const AllVariants: Story = {
|
|
106
|
-
name: 'All variants',
|
|
107
|
-
render: () => ({
|
|
108
|
-
template: `
|
|
109
|
-
<div style="display: flex; flex-direction: column; gap: 16px; max-width: 360px;">
|
|
110
|
-
<mf-datepicker label="Default" />
|
|
111
|
-
<mf-datepicker label="With help" hint="Select a date" />
|
|
112
|
-
<mf-datepicker label="With error" error="Date required" />
|
|
113
|
-
<mf-datepicker label="Disabled" [disabled]="true" />
|
|
114
|
-
</div>
|
|
115
|
-
`,
|
|
116
|
-
moduleMetadata: { imports: [MfDatepickerComponent] },
|
|
117
|
-
}),
|
|
118
|
-
};
|