ng-comps 1.0.0 → 1.0.1
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/documentation.json +32 -32
- package/package.json +1 -1
- package/src/app/components/alert/mf-alert.component.spec.ts +2 -2
- package/src/app/components/alert/mf-alert.component.ts +1 -1
- package/src/app/components/chip/mf-chip.component.ts +1 -1
- package/src/app/components/datepicker/mf-datepicker.component.spec.ts +4 -4
- package/src/app/components/datepicker/mf-datepicker.component.ts +1 -1
- package/src/app/components/dialog/mf-dialog.component.ts +1 -1
- package/src/app/components/dialog/mf-dialog.service.spec.ts +2 -2
- package/src/app/components/menu/mf-menu.component.spec.ts +1 -1
- package/src/app/components/menu/mf-menu.component.ts +1 -1
- package/src/app/components/progress-bar/mf-progress-bar.component.spec.ts +2 -2
- package/src/app/components/progress-spinner/mf-progress-spinner.component.spec.ts +3 -3
- package/src/app/components/sidenav/mf-sidenav.component.ts +2 -2
- package/src/app/components/table/mf-table.component.ts +1 -1
- package/src/stories/About.mdx +72 -72
- package/src/stories/Welcome.mdx +26 -27
- package/src/stories/mf-a11y-contracts.stories.ts +49 -49
- package/src/stories/mf-autocomplete.stories.ts +194 -188
- package/src/stories/mf-button.stories.ts +152 -156
- package/src/stories/mf-card.stories.ts +147 -148
- package/src/stories/mf-checkbox.stories.ts +88 -88
- package/src/stories/mf-datepicker.stories.ts +118 -118
- package/src/stories/mf-dialog.stories.ts +159 -167
- package/src/stories/mf-form-field.stories.ts +108 -108
- package/src/stories/mf-grid-list.stories.ts +104 -105
- package/src/stories/mf-icon.stories.ts +133 -130
- package/src/stories/mf-input.stories.ts +158 -158
- package/src/stories/mf-menu.stories.ts +10 -10
- package/src/stories/mf-progress-bar.stories.ts +119 -119
- package/src/stories/mf-progress-spinner.stories.ts +124 -124
- package/src/stories/mf-radio-button.stories.ts +111 -111
- package/src/stories/mf-select.stories.ts +184 -178
- package/src/stories/mf-sidenav.stories.ts +331 -334
- package/src/stories/mf-table.stories.ts +13 -13
- package/src/stories/mf-toolbar.stories.ts +112 -112
|
@@ -1,105 +1,104 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
-
|
|
3
|
-
import { MfGridListComponent } from '../app/components/grid-list';
|
|
4
|
-
|
|
5
|
-
const SAMPLE_TILES = [
|
|
6
|
-
{ title: '
|
|
7
|
-
{ title: '
|
|
8
|
-
{ title: '
|
|
9
|
-
{ title: 'Marketing', subtitle: '6
|
|
10
|
-
{ title: '
|
|
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**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
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,130 +1,133 @@
|
|
|
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**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
| \`sm\` | 16px
|
|
19
|
-
| \`md\` | 20px
|
|
20
|
-
| \`lg\` | 24px
|
|
21
|
-
| \`xl\` | 32px
|
|
22
|
-
`,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
argTypes: {
|
|
27
|
-
name: { control: 'text', description: '
|
|
28
|
-
size: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: ['sm', 'md', 'lg', 'xl'],
|
|
31
|
-
description: '
|
|
32
|
-
},
|
|
33
|
-
color: {
|
|
34
|
-
control: 'select',
|
|
35
|
-
options: ['default', 'brand', 'muted', 'error', 'inherit'],
|
|
36
|
-
description: '
|
|
37
|
-
},
|
|
38
|
-
label: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<mf-icon name="settings" size="
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<mf-icon name="circle" size="lg" color="
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
+
};
|