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.
Files changed (38) hide show
  1. package/angular.json +9 -8
  2. package/documentation.json +32 -32
  3. package/package.json +1 -1
  4. package/scripts/prepare-package.mjs +38 -19
  5. package/src/app/components/alert/mf-alert.component.spec.ts +2 -2
  6. package/src/app/components/alert/mf-alert.component.ts +1 -1
  7. package/src/app/components/chip/mf-chip.component.ts +1 -1
  8. package/src/app/components/datepicker/mf-datepicker.component.spec.ts +4 -4
  9. package/src/app/components/datepicker/mf-datepicker.component.ts +1 -1
  10. package/src/app/components/dialog/mf-dialog.component.ts +1 -1
  11. package/src/app/components/dialog/mf-dialog.service.spec.ts +2 -2
  12. package/src/app/components/menu/mf-menu.component.spec.ts +1 -1
  13. package/src/app/components/menu/mf-menu.component.ts +1 -1
  14. package/src/app/components/progress-bar/mf-progress-bar.component.spec.ts +2 -2
  15. package/src/app/components/progress-spinner/mf-progress-spinner.component.spec.ts +3 -3
  16. package/src/app/components/sidenav/mf-sidenav.component.ts +2 -2
  17. package/src/app/components/table/mf-table.component.ts +1 -1
  18. package/src/stories/About.mdx +72 -72
  19. package/src/stories/Welcome.mdx +26 -27
  20. package/src/stories/mf-a11y-contracts.stories.ts +49 -49
  21. package/src/stories/mf-autocomplete.stories.ts +194 -188
  22. package/src/stories/mf-button.stories.ts +152 -156
  23. package/src/stories/mf-card.stories.ts +147 -148
  24. package/src/stories/mf-checkbox.stories.ts +88 -88
  25. package/src/stories/mf-datepicker.stories.ts +118 -118
  26. package/src/stories/mf-dialog.stories.ts +159 -167
  27. package/src/stories/mf-form-field.stories.ts +108 -108
  28. package/src/stories/mf-grid-list.stories.ts +104 -105
  29. package/src/stories/mf-icon.stories.ts +133 -130
  30. package/src/stories/mf-input.stories.ts +158 -158
  31. package/src/stories/mf-menu.stories.ts +10 -10
  32. package/src/stories/mf-progress-bar.stories.ts +119 -119
  33. package/src/stories/mf-progress-spinner.stories.ts +124 -124
  34. package/src/stories/mf-radio-button.stories.ts +111 -111
  35. package/src/stories/mf-select.stories.ts +184 -178
  36. package/src/stories/mf-sidenav.stories.ts +331 -334
  37. package/src/stories/mf-table.stories.ts +13 -13
  38. 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** es el checkbox de la librería ng-comps.
14
- Usa Angular Material \`mat-checkbox\` por debajo pero expone una API uniforme con look and feel de marca.
15
-
16
- | Estado | Descripción |
17
- |-----------------|--------------------------------------------|
18
- | \`checked\` | Marcado |
19
- | \`indeterminate\` | Estado intermedio (selección parcial) |
20
- | \`disabled\` | No interactivo |
21
- `,
22
- },
23
- },
24
- },
25
- argTypes: {
26
- label: { control: 'text', description: 'Texto del checkbox' },
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: 'Acepto los términos y condiciones',
40
- checked: false,
41
- },
42
- };
43
-
44
- export const Checked: Story = {
45
- args: {
46
- label: 'Opción seleccionada',
47
- checked: true,
48
- },
49
- };
50
-
51
- export const Indeterminate: Story = {
52
- args: {
53
- label: 'Selección parcial',
54
- indeterminate: true,
55
- },
56
- };
57
-
58
- export const Disabled: Story = {
59
- args: {
60
- label: 'Opción deshabilitada',
61
- disabled: true,
62
- },
63
- };
64
-
65
- export const DisabledChecked: Story = {
66
- name: 'Deshabilitado y marcado',
67
- args: {
68
- label: 'Marcado y deshabilitado',
69
- checked: true,
70
- disabled: true,
71
- },
72
- };
73
-
74
- export const AllStates: Story = {
75
- name: 'Todos los estados',
76
- render: () => ({
77
- template: `
78
- <div style="display: flex; flex-direction: column; gap: 12px;">
79
- <mf-checkbox label="Sin marcar" />
80
- <mf-checkbox label="Marcado" [checked]="true" />
81
- <mf-checkbox label="Indeterminado" [indeterminate]="true" />
82
- <mf-checkbox label="Deshabilitado" [disabled]="true" />
83
- <mf-checkbox label="Marcado y deshabilitado" [checked]="true" [disabled]="true" />
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** es el selector de fecha de la librería ng-comps.
14
- Usa Angular Material \`mat-datepicker\` por debajo pero expone una API uniforme con look and feel de marca.
15
-
16
- | Propiedad | Descripción |
17
- |-------------|------------------------------------------|
18
- | \`label\` | Etiqueta flotante del campo |
19
- | \`placeholder\` | Texto de placeholder |
20
- | \`hint\` | Texto de ayuda debajo del campo |
21
- | \`error\` | Mensaje de error |
22
- | \`min\` | Fecha mínima seleccionable |
23
- | \`max\` | Fecha máxima seleccionable |
24
- | \`disabled\` | Deshabilita el campo |
25
- | \`fullWidth\` | Ocupa el ancho del contenedor |
26
- `,
27
- },
28
- },
29
- },
30
- argTypes: {
31
- label: { control: 'text', description: 'Etiqueta flotante' },
32
- placeholder: { control: 'text', description: 'Placeholder' },
33
- size: {
34
- control: 'select',
35
- options: ['sm', 'md', 'lg'],
36
- description: 'Tamaño del campo',
37
- },
38
- disabled: { control: 'boolean' },
39
- hint: { control: 'text', description: 'Texto de ayuda' },
40
- error: { control: 'text', description: 'Mensaje de error' },
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: 'Fecha de nacimiento',
53
- placeholder: 'DD/MM/YYYY',
54
- },
55
- };
56
-
57
- export const WithHint: Story = {
58
- name: 'Con texto de ayuda',
59
- args: {
60
- label: 'Fecha de inicio',
61
- hint: 'Selecciona una fecha posterior a hoy',
62
- },
63
- };
64
-
65
- export const WithError: Story = {
66
- name: 'Con error',
67
- args: {
68
- label: 'Fecha de vencimiento',
69
- error: 'La fecha es obligatoria',
70
- },
71
- };
72
-
73
- export const Disabled: Story = {
74
- args: {
75
- label: 'Fecha (deshabilitada)',
76
- disabled: true,
77
- },
78
- };
79
-
80
- export const Small: Story = {
81
- args: {
82
- label: 'Pequeño',
83
- size: 'sm',
84
- },
85
- };
86
-
87
- export const Large: Story = {
88
- args: {
89
- label: 'Grande',
90
- size: 'lg',
91
- },
92
- };
93
-
94
- export const FullWidth: Story = {
95
- name: 'Ancho completo',
96
- args: {
97
- label: 'Fecha de entrega',
98
- fullWidth: true,
99
- },
100
- parameters: {
101
- layout: 'padded',
102
- },
103
- };
104
-
105
- export const AllVariants: Story = {
106
- name: 'Todas las variantes',
107
- render: () => ({
108
- template: `
109
- <div style="display: flex; flex-direction: column; gap: 16px; max-width: 360px;">
110
- <mf-datepicker label="Normal" />
111
- <mf-datepicker label="Con ayuda" hint="Selecciona una fecha" />
112
- <mf-datepicker label="Con error" error="Fecha requerida" />
113
- <mf-datepicker label="Deshabilitado" [disabled]="true" />
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
+ };