ng-comps 1.0.0 → 1.0.2
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/angular.json +9 -8
- package/documentation.json +32 -32
- package/package.json +1 -1
- package/scripts/prepare-package.mjs +38 -19
- 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,88 +1,88 @@
|
|
|
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**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
| \`checked\` |
|
|
19
|
-
| \`indeterminate\` |
|
|
20
|
-
| \`disabled\` |
|
|
21
|
-
`,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
label: { control: 'text', description: '
|
|
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: '
|
|
40
|
-
checked: false,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const Checked: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
label: '
|
|
47
|
-
checked: true,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Indeterminate: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
label: '
|
|
54
|
-
indeterminate: true,
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Disabled: Story = {
|
|
59
|
-
args: {
|
|
60
|
-
label: '
|
|
61
|
-
disabled: true,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const DisabledChecked: Story = {
|
|
66
|
-
name: '
|
|
67
|
-
args: {
|
|
68
|
-
label: '
|
|
69
|
-
checked: true,
|
|
70
|
-
disabled: true,
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const AllStates: Story = {
|
|
75
|
-
name: '
|
|
76
|
-
render: () => ({
|
|
77
|
-
template: `
|
|
78
|
-
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
79
|
-
<mf-checkbox label="
|
|
80
|
-
<mf-checkbox label="
|
|
81
|
-
<mf-checkbox label="
|
|
82
|
-
<mf-checkbox label="
|
|
83
|
-
<mf-checkbox label="
|
|
84
|
-
</div>
|
|
85
|
-
`,
|
|
86
|
-
moduleMetadata: { imports: [MfCheckboxComponent] },
|
|
87
|
-
}),
|
|
88
|
-
};
|
|
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 +1,118 @@
|
|
|
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**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
| \`label\`
|
|
19
|
-
| \`placeholder\` |
|
|
20
|
-
| \`hint\`
|
|
21
|
-
| \`error\`
|
|
22
|
-
| \`min\`
|
|
23
|
-
| \`max\`
|
|
24
|
-
| \`disabled\`
|
|
25
|
-
| \`fullWidth\`
|
|
26
|
-
`,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
argTypes: {
|
|
31
|
-
label: { control: 'text', description: '
|
|
32
|
-
placeholder: { control: 'text', description: 'Placeholder' },
|
|
33
|
-
size: {
|
|
34
|
-
control: 'select',
|
|
35
|
-
options: ['sm', 'md', 'lg'],
|
|
36
|
-
description: '
|
|
37
|
-
},
|
|
38
|
-
disabled: { control: 'boolean' },
|
|
39
|
-
hint: { control: 'text', description: '
|
|
40
|
-
error: { control: 'text', description: '
|
|
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: '
|
|
53
|
-
placeholder: 'DD/MM/YYYY',
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const WithHint: Story = {
|
|
58
|
-
name: '
|
|
59
|
-
args: {
|
|
60
|
-
label: '
|
|
61
|
-
hint: '
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const WithError: Story = {
|
|
66
|
-
name: '
|
|
67
|
-
args: {
|
|
68
|
-
label: '
|
|
69
|
-
error: '
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Disabled: Story = {
|
|
74
|
-
args: {
|
|
75
|
-
label: '
|
|
76
|
-
disabled: true,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Small: Story = {
|
|
81
|
-
args: {
|
|
82
|
-
label: '
|
|
83
|
-
size: 'sm',
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const Large: Story = {
|
|
88
|
-
args: {
|
|
89
|
-
label: '
|
|
90
|
-
size: 'lg',
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const FullWidth: Story = {
|
|
95
|
-
name: '
|
|
96
|
-
args: {
|
|
97
|
-
label: '
|
|
98
|
-
fullWidth: true,
|
|
99
|
-
},
|
|
100
|
-
parameters: {
|
|
101
|
-
layout: 'padded',
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const AllVariants: Story = {
|
|
106
|
-
name: '
|
|
107
|
-
render: () => ({
|
|
108
|
-
template: `
|
|
109
|
-
<div style="display: flex; flex-direction: column; gap: 16px; max-width: 360px;">
|
|
110
|
-
<mf-datepicker label="
|
|
111
|
-
<mf-datepicker label="
|
|
112
|
-
<mf-datepicker label="
|
|
113
|
-
<mf-datepicker label="
|
|
114
|
-
</div>
|
|
115
|
-
`,
|
|
116
|
-
moduleMetadata: { imports: [MfDatepickerComponent] },
|
|
117
|
-
}),
|
|
118
|
-
};
|
|
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
|
+
};
|