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.
Files changed (36) hide show
  1. package/documentation.json +32 -32
  2. package/package.json +1 -1
  3. package/src/app/components/alert/mf-alert.component.spec.ts +2 -2
  4. package/src/app/components/alert/mf-alert.component.ts +1 -1
  5. package/src/app/components/chip/mf-chip.component.ts +1 -1
  6. package/src/app/components/datepicker/mf-datepicker.component.spec.ts +4 -4
  7. package/src/app/components/datepicker/mf-datepicker.component.ts +1 -1
  8. package/src/app/components/dialog/mf-dialog.component.ts +1 -1
  9. package/src/app/components/dialog/mf-dialog.service.spec.ts +2 -2
  10. package/src/app/components/menu/mf-menu.component.spec.ts +1 -1
  11. package/src/app/components/menu/mf-menu.component.ts +1 -1
  12. package/src/app/components/progress-bar/mf-progress-bar.component.spec.ts +2 -2
  13. package/src/app/components/progress-spinner/mf-progress-spinner.component.spec.ts +3 -3
  14. package/src/app/components/sidenav/mf-sidenav.component.ts +2 -2
  15. package/src/app/components/table/mf-table.component.ts +1 -1
  16. package/src/stories/About.mdx +72 -72
  17. package/src/stories/Welcome.mdx +26 -27
  18. package/src/stories/mf-a11y-contracts.stories.ts +49 -49
  19. package/src/stories/mf-autocomplete.stories.ts +194 -188
  20. package/src/stories/mf-button.stories.ts +152 -156
  21. package/src/stories/mf-card.stories.ts +147 -148
  22. package/src/stories/mf-checkbox.stories.ts +88 -88
  23. package/src/stories/mf-datepicker.stories.ts +118 -118
  24. package/src/stories/mf-dialog.stories.ts +159 -167
  25. package/src/stories/mf-form-field.stories.ts +108 -108
  26. package/src/stories/mf-grid-list.stories.ts +104 -105
  27. package/src/stories/mf-icon.stories.ts +133 -130
  28. package/src/stories/mf-input.stories.ts +158 -158
  29. package/src/stories/mf-menu.stories.ts +10 -10
  30. package/src/stories/mf-progress-bar.stories.ts +119 -119
  31. package/src/stories/mf-progress-spinner.stories.ts +124 -124
  32. package/src/stories/mf-radio-button.stories.ts +111 -111
  33. package/src/stories/mf-select.stories.ts +184 -178
  34. package/src/stories/mf-sidenav.stories.ts +331 -334
  35. package/src/stories/mf-table.stories.ts +13 -13
  36. 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: 'Fotografía', subtitle: '12 elementos', background: 'var(--mf-color-primary-100)' },
7
- { title: 'Diseño', subtitle: '8 elementos', background: 'var(--mf-color-secondary-100)' },
8
- { title: 'Desarrollo', subtitle: '25 elementos', background: 'var(--mf-color-accent-300)', colspan: 2 },
9
- { title: 'Marketing', subtitle: '6 elementos', background: 'var(--mf-color-neutral-100)' },
10
- { title: 'Datos', subtitle: '15 elementos', 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** es la lista en cuadrícula de la librería ng-comps.
22
- Envuelve Angular Material \`mat-grid-list\` y expone una API uniforme con look and feel de marca.
23
-
24
- Acepta tiles declarativas vía el input \`tiles\` (array de \`MfGridTile\`) o
25
- content projection de \`mat-grid-tile\` para casos avanzados.
26
- `,
27
- },
28
- },
29
- },
30
- argTypes: {
31
- cols: {
32
- control: { type: 'range', min: 1, max: 6 },
33
- description: 'Número de columnas',
34
- },
35
- rowHeight: {
36
- control: 'text',
37
- description: 'Altura de cada fila (ej: "200px", "1:1", "fit")',
38
- },
39
- gutterSize: {
40
- control: 'text',
41
- description: 'Espacio entre tiles',
42
- },
43
- },
44
- };
45
-
46
- export default meta;
47
- type Story = StoryObj<MfGridListComponent>;
48
-
49
- export const Default: Story = {
50
- args: {
51
- cols: 3,
52
- rowHeight: '160px',
53
- gutterSize: '8px',
54
- tiles: SAMPLE_TILES,
55
- },
56
- };
57
-
58
- export const TwoColumns: Story = {
59
- name: 'Dos columnas',
60
- args: {
61
- cols: 2,
62
- rowHeight: '180px',
63
- tiles: SAMPLE_TILES,
64
- },
65
- };
66
-
67
- export const FourColumns: Story = {
68
- name: 'Cuatro columnas',
69
- args: {
70
- cols: 4,
71
- rowHeight: '120px',
72
- tiles: SAMPLE_TILES,
73
- },
74
- };
75
-
76
- export const SquareTiles: Story = {
77
- name: 'Tiles cuadradas',
78
- args: {
79
- cols: 3,
80
- rowHeight: '1:1',
81
- tiles: SAMPLE_TILES,
82
- },
83
- };
84
-
85
- export const AllVariants: Story = {
86
- name: 'Todas las variantes',
87
- render: () => ({
88
- template: `
89
- <div style="display: flex; flex-direction: column; gap: 32px;">
90
- <div>
91
- <p style="font-size: 0.875rem; color: #475569; margin-bottom: 8px;">3 columnas</p>
92
- <mf-grid-list [cols]="3" rowHeight="140px" [tiles]="tiles" />
93
- </div>
94
- <div>
95
- <p style="font-size: 0.875rem; color: #475569; margin-bottom: 8px;">4 columnas</p>
96
- <mf-grid-list [cols]="4" rowHeight="120px" [tiles]="tiles" />
97
- </div>
98
- </div>
99
- `,
100
- props: {
101
- tiles: SAMPLE_TILES,
102
- },
103
- moduleMetadata: { imports: [MfGridListComponent] },
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** es el componente de iconos de la librería ng-comps.
14
- Usa Material Icons por debajo y expone una API consistente con tamaños y colores de marca.
15
-
16
- | Tamaño | Pixeles | Cuándo usarlo |
17
- |--------|---------|------------------------------------------|
18
- | \`sm\` | 16px | Dentro de botones, chips o acciones |
19
- | \`md\` | 20px | Uso general, listas, formularios |
20
- | \`lg\` | 24px | Headers, navegación |
21
- | \`xl\` | 32px | Ilustraciones, estados vacíos |
22
- `,
23
- },
24
- },
25
- },
26
- argTypes: {
27
- name: { control: 'text', description: 'Nombre del icono Material' },
28
- size: {
29
- control: 'select',
30
- options: ['sm', 'md', 'lg', 'xl'],
31
- description: 'Tamaño del icono',
32
- },
33
- color: {
34
- control: 'select',
35
- options: ['default', 'brand', 'muted', 'error', 'inherit'],
36
- description: 'Color semántico del icono',
37
- },
38
- label: { control: 'text', description: 'Etiqueta accesible (si es decorativo, dejar vacío)' },
39
- },
40
- };
41
-
42
- export default meta;
43
- type Story = StoryObj<MfIconComponent>;
44
-
45
- export const Default: Story = {
46
- args: {
47
- name: 'home',
48
- size: 'md',
49
- color: 'default',
50
- },
51
- };
52
-
53
- export const Brand: Story = {
54
- args: {
55
- name: 'favorite',
56
- size: 'md',
57
- color: 'brand',
58
- },
59
- };
60
-
61
- export const Muted: Story = {
62
- args: {
63
- name: 'info',
64
- size: 'md',
65
- color: 'muted',
66
- },
67
- };
68
-
69
- export const ErrorColor: Story = {
70
- name: 'Error',
71
- args: {
72
- name: 'error',
73
- size: 'md',
74
- color: 'error',
75
- },
76
- };
77
-
78
- export const Small: Story = {
79
- args: {
80
- name: 'check_circle',
81
- size: 'sm',
82
- color: 'brand',
83
- },
84
- };
85
-
86
- export const Large: Story = {
87
- args: {
88
- name: 'star',
89
- size: 'lg',
90
- color: 'default',
91
- },
92
- };
93
-
94
- export const ExtraLarge: Story = {
95
- args: {
96
- name: 'rocket_launch',
97
- size: 'xl',
98
- color: 'brand',
99
- },
100
- };
101
-
102
- export const AllSizes: Story = {
103
- name: 'Todos los tamaños',
104
- render: () => ({
105
- template: `
106
- <div style="display: flex; gap: 16px; align-items: center;">
107
- <mf-icon name="settings" size="sm" />
108
- <mf-icon name="settings" size="md" />
109
- <mf-icon name="settings" size="lg" />
110
- <mf-icon name="settings" size="xl" />
111
- </div>
112
- `,
113
- moduleMetadata: { imports: [MfIconComponent] },
114
- }),
115
- };
116
-
117
- export const AllColors: Story = {
118
- name: 'Todos los colores',
119
- render: () => ({
120
- template: `
121
- <div style="display: flex; gap: 16px; align-items: center;">
122
- <mf-icon name="circle" size="lg" color="default" />
123
- <mf-icon name="circle" size="lg" color="brand" />
124
- <mf-icon name="circle" size="lg" color="muted" />
125
- <mf-icon name="circle" size="lg" color="error" />
126
- </div>
127
- `,
128
- moduleMetadata: { imports: [MfIconComponent] },
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
+ };