magoo 0.1.0-beta.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.
Files changed (93) hide show
  1. package/README.md +159 -0
  2. package/README.pt-BR.md +167 -0
  3. package/dist/favicon.svg +1 -0
  4. package/dist/icons.svg +24 -0
  5. package/dist/index.d.ts +1 -0
  6. package/dist/magoo.css +2 -0
  7. package/dist/magoo.es.js +2084 -0
  8. package/dist/magoo.umd.js +1 -0
  9. package/dist/src/App.vue.d.ts +2 -0
  10. package/dist/src/components/MButton/MButton.spec.d.ts +1 -0
  11. package/dist/src/components/MButton/MButton.stories.d.ts +8 -0
  12. package/dist/src/components/MButton/MButton.vue.d.ts +31 -0
  13. package/dist/src/components/MButton/index.d.ts +1 -0
  14. package/dist/src/components/MCheckbox/MCheckbox.spec.d.ts +1 -0
  15. package/dist/src/components/MCheckbox/MCheckbox.stories.d.ts +8 -0
  16. package/dist/src/components/MCheckbox/MCheckbox.vue.d.ts +35 -0
  17. package/dist/src/components/MCheckbox/index.d.ts +1 -0
  18. package/dist/src/components/MCheckboxList/MCheckboxList.spec.d.ts +1 -0
  19. package/dist/src/components/MCheckboxList/MCheckboxList.stories.d.ts +8 -0
  20. package/dist/src/components/MCheckboxList/MCheckboxList.vue.d.ts +45 -0
  21. package/dist/src/components/MCheckboxList/index.d.ts +1 -0
  22. package/dist/src/components/MErrorMessage/MErrorMessage.spec.d.ts +1 -0
  23. package/dist/src/components/MErrorMessage/MErrorMessage.stories.d.ts +8 -0
  24. package/dist/src/components/MErrorMessage/MErrorMessage.vue.d.ts +8 -0
  25. package/dist/src/components/MErrorMessage/index.d.ts +1 -0
  26. package/dist/src/components/MFieldsetPanel/MFieldsetPanel.spec.d.ts +1 -0
  27. package/dist/src/components/MFieldsetPanel/MFieldsetPanel.stories.d.ts +7 -0
  28. package/dist/src/components/MFieldsetPanel/MFieldsetPanel.vue.d.ts +26 -0
  29. package/dist/src/components/MFieldsetPanel/index.d.ts +1 -0
  30. package/dist/src/components/MFileUpload/MFileUpload.spec.d.ts +1 -0
  31. package/dist/src/components/MFileUpload/MFileUpload.stories.d.ts +10 -0
  32. package/dist/src/components/MFileUpload/MFileUpload.vue.d.ts +65 -0
  33. package/dist/src/components/MFileUpload/index.d.ts +1 -0
  34. package/dist/src/components/MForm/MForm.spec.d.ts +1 -0
  35. package/dist/src/components/MForm/MForm.stories.d.ts +7 -0
  36. package/dist/src/components/MForm/MForm.vue.d.ts +46 -0
  37. package/dist/src/components/MForm/index.d.ts +1 -0
  38. package/dist/src/components/MInput/MInput.spec.d.ts +1 -0
  39. package/dist/src/components/MInput/MInput.stories.d.ts +12 -0
  40. package/dist/src/components/MInput/MInput.vue.d.ts +39 -0
  41. package/dist/src/components/MInput/index.d.ts +1 -0
  42. package/dist/src/components/MList/MList.spec.d.ts +1 -0
  43. package/dist/src/components/MList/MList.stories.d.ts +15 -0
  44. package/dist/src/components/MList/MList.vue.d.ts +142 -0
  45. package/dist/src/components/MList/index.d.ts +1 -0
  46. package/dist/src/components/MNumber/MNumber.spec.d.ts +1 -0
  47. package/dist/src/components/MNumber/MNumber.stories.d.ts +9 -0
  48. package/dist/src/components/MNumber/MNumber.vue.d.ts +41 -0
  49. package/dist/src/components/MNumber/index.d.ts +1 -0
  50. package/dist/src/components/MPassword/MPassword.spec.d.ts +1 -0
  51. package/dist/src/components/MPassword/MPassword.stories.d.ts +8 -0
  52. package/dist/src/components/MPassword/MPassword.vue.d.ts +43 -0
  53. package/dist/src/components/MPassword/index.d.ts +1 -0
  54. package/dist/src/components/MRadio/MRadio.spec.d.ts +1 -0
  55. package/dist/src/components/MRadio/MRadio.stories.d.ts +8 -0
  56. package/dist/src/components/MRadio/MRadio.vue.d.ts +33 -0
  57. package/dist/src/components/MRadio/index.d.ts +1 -0
  58. package/dist/src/components/MRadioList/MRadioList.spec.d.ts +1 -0
  59. package/dist/src/components/MRadioList/MRadioList.stories.d.ts +8 -0
  60. package/dist/src/components/MRadioList/MRadioList.vue.d.ts +45 -0
  61. package/dist/src/components/MRadioList/index.d.ts +1 -0
  62. package/dist/src/components/MSelect/MSelect.spec.d.ts +1 -0
  63. package/dist/src/components/MSelect/MSelect.stories.d.ts +8 -0
  64. package/dist/src/components/MSelect/MSelect.vue.d.ts +43 -0
  65. package/dist/src/components/MSelect/index.d.ts +1 -0
  66. package/dist/src/components/MSwitch/MSwitch.spec.d.ts +1 -0
  67. package/dist/src/components/MSwitch/MSwitch.stories.d.ts +11 -0
  68. package/dist/src/components/MSwitch/MSwitch.vue.d.ts +41 -0
  69. package/dist/src/components/MSwitch/index.d.ts +1 -0
  70. package/dist/src/components/MTextarea/MTextarea.spec.d.ts +1 -0
  71. package/dist/src/components/MTextarea/MTextarea.stories.d.ts +8 -0
  72. package/dist/src/components/MTextarea/MTextarea.vue.d.ts +37 -0
  73. package/dist/src/components/MTextarea/index.d.ts +1 -0
  74. package/dist/src/components/MValidationSummary/MValidationSummary.spec.d.ts +1 -0
  75. package/dist/src/components/MValidationSummary/MValidationSummary.stories.d.ts +8 -0
  76. package/dist/src/components/MValidationSummary/MValidationSummary.vue.d.ts +25 -0
  77. package/dist/src/components/MValidationSummary/index.d.ts +1 -0
  78. package/dist/src/components/index.d.ts +17 -0
  79. package/dist/src/composables/useFieldDescribedBy.d.ts +4 -0
  80. package/dist/src/composables/useFieldErrors.d.ts +7 -0
  81. package/dist/src/composables/useFieldIds.d.ts +6 -0
  82. package/dist/src/index.d.ts +9 -0
  83. package/dist/src/main.d.ts +0 -0
  84. package/dist/src/themes/theme.d.ts +3 -0
  85. package/dist/src/types/forms.d.ts +32 -0
  86. package/dist/src/types/index.d.ts +1 -0
  87. package/dist/src/validation/index.d.ts +4 -0
  88. package/dist/src/validation/types.d.ts +40 -0
  89. package/dist/src/validation/useFormValidation.d.ts +56 -0
  90. package/dist/src/validation/useFormValidation.spec.d.ts +1 -0
  91. package/dist/src/validation/utils.d.ts +17 -0
  92. package/dist/src/validation/utils.spec.d.ts +1 -0
  93. package/package.json +72 -0
@@ -0,0 +1,142 @@
1
+ export interface MListSortOption {
2
+ label: string;
3
+ value: string;
4
+ compare?: (a: Record<string, unknown>, b: Record<string, unknown>) => number;
5
+ }
6
+ type ListItem = Record<string, unknown>;
7
+ type SortDirection = 'asc' | 'desc';
8
+ export interface MListQuery {
9
+ page: number;
10
+ pageSize: number | 'all';
11
+ search: string;
12
+ sort: string;
13
+ sortDirection: SortDirection;
14
+ }
15
+ type __VLS_Props = {
16
+ items?: ListItem[];
17
+ id?: string;
18
+ label?: string;
19
+ hint?: string;
20
+ ariaLabel?: string;
21
+ itemKey?: string | ((item: ListItem, index: number) => string | number);
22
+ itemLabel?: string | ((item: ListItem, index: number) => string);
23
+ searchable?: boolean;
24
+ searchLabel?: string;
25
+ searchPlaceholder?: string;
26
+ searchAutocomplete?: string;
27
+ searchFields?: string[];
28
+ searchDebounce?: number;
29
+ clearSearchLabel?: string;
30
+ sortable?: boolean;
31
+ sortLabel?: string;
32
+ sortPlaceholder?: string;
33
+ ascendingLabel?: string;
34
+ descendingLabel?: string;
35
+ sortOptions?: MListSortOption[];
36
+ sort?: string;
37
+ sortDirection?: SortDirection;
38
+ page?: number;
39
+ pageSize?: number;
40
+ pageSizeOptions?: (number | 'all')[];
41
+ pageSizeLabel?: string;
42
+ allPageSizeLabel?: string;
43
+ density?: 'compact' | 'comfortable';
44
+ serverSide?: boolean;
45
+ totalItems?: number;
46
+ loadError?: string;
47
+ retryLabel?: string;
48
+ loading?: boolean;
49
+ emptyLabel?: string;
50
+ loadingLabel?: string;
51
+ paginationLabel?: string;
52
+ previousPageLabel?: string;
53
+ nextPageLabel?: string;
54
+ };
55
+ declare function __VLS_template(): {
56
+ attrs: Partial<{}>;
57
+ slots: {
58
+ header?(_: {
59
+ total: number;
60
+ }): any;
61
+ item?(_: {
62
+ item: ListItem;
63
+ index: number;
64
+ }): any;
65
+ };
66
+ refs: {
67
+ searchInput: HTMLInputElement;
68
+ sortSelect: HTMLSelectElement;
69
+ pageSizeSelect: HTMLSelectElement;
70
+ paginationNav: HTMLElement;
71
+ };
72
+ rootEl: any;
73
+ };
74
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
75
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
76
+ search: (value: string) => any;
77
+ "update:page": (value: number) => any;
78
+ "update:sort": (value: string) => any;
79
+ "update:sortDirection": (value: SortDirection) => any;
80
+ "update:pageSize": (value: number | "all") => any;
81
+ query: (value: MListQuery) => any;
82
+ retry: () => any;
83
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
84
+ onSearch?: ((value: string) => any) | undefined;
85
+ "onUpdate:page"?: ((value: number) => any) | undefined;
86
+ "onUpdate:sort"?: ((value: string) => any) | undefined;
87
+ "onUpdate:sortDirection"?: ((value: SortDirection) => any) | undefined;
88
+ "onUpdate:pageSize"?: ((value: number | "all") => any) | undefined;
89
+ onQuery?: ((value: MListQuery) => any) | undefined;
90
+ onRetry?: (() => any) | undefined;
91
+ }>, {
92
+ sort: string;
93
+ label: string;
94
+ loading: boolean;
95
+ ariaLabel: string;
96
+ id: string;
97
+ hint: string;
98
+ items: ListItem[];
99
+ itemKey: string | ((item: ListItem, index: number) => string | number);
100
+ itemLabel: string | ((item: ListItem, index: number) => string);
101
+ searchable: boolean;
102
+ searchLabel: string;
103
+ searchPlaceholder: string;
104
+ searchAutocomplete: string;
105
+ searchFields: string[];
106
+ searchDebounce: number;
107
+ clearSearchLabel: string;
108
+ sortable: boolean;
109
+ sortLabel: string;
110
+ sortPlaceholder: string;
111
+ ascendingLabel: string;
112
+ descendingLabel: string;
113
+ sortOptions: MListSortOption[];
114
+ sortDirection: SortDirection;
115
+ page: number;
116
+ pageSize: number;
117
+ pageSizeOptions: (number | "all")[];
118
+ pageSizeLabel: string;
119
+ allPageSizeLabel: string;
120
+ density: "compact" | "comfortable";
121
+ serverSide: boolean;
122
+ totalItems: number;
123
+ loadError: string;
124
+ retryLabel: string;
125
+ emptyLabel: string;
126
+ loadingLabel: string;
127
+ paginationLabel: string;
128
+ previousPageLabel: string;
129
+ nextPageLabel: string;
130
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
131
+ searchInput: HTMLInputElement;
132
+ sortSelect: HTMLSelectElement;
133
+ pageSizeSelect: HTMLSelectElement;
134
+ paginationNav: HTMLElement;
135
+ }, any>;
136
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
137
+ export default _default;
138
+ type __VLS_WithTemplateSlots<T, S> = T & {
139
+ new (): {
140
+ $slots: S;
141
+ };
142
+ };
@@ -0,0 +1 @@
1
+ export { default as MList } from './MList.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MNumber } from './MNumber.vue';
3
+ declare const meta: Meta<typeof MNumber>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MNumber>;
6
+ export declare const Default: Story;
7
+ export declare const Decimal: Story;
8
+ export declare const WithError: Story;
9
+ export declare const Disabled: Story;
@@ -0,0 +1,41 @@
1
+ type __VLS_Props = {
2
+ modelValue?: number | null;
3
+ label?: string;
4
+ id?: string;
5
+ name?: string;
6
+ min?: number;
7
+ max?: number;
8
+ step?: number | 'any';
9
+ required?: boolean;
10
+ disabled?: boolean;
11
+ error?: string | string[];
12
+ hint?: string;
13
+ invalid?: boolean;
14
+ loading?: boolean;
15
+ submitTriggered?: boolean;
16
+ };
17
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
18
+ "update:modelValue": (value: number | null) => any;
19
+ blur: (event: FocusEvent) => any;
20
+ focus: (event: FocusEvent) => any;
21
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
23
+ onBlur?: ((event: FocusEvent) => any) | undefined;
24
+ onFocus?: ((event: FocusEvent) => any) | undefined;
25
+ }>, {
26
+ name: string;
27
+ label: string;
28
+ disabled: boolean;
29
+ loading: boolean;
30
+ modelValue: number | null;
31
+ id: string;
32
+ required: boolean;
33
+ error: string | string[];
34
+ hint: string;
35
+ invalid: boolean;
36
+ submitTriggered: boolean;
37
+ min: number;
38
+ max: number;
39
+ step: number | "any";
40
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
41
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MNumber } from './MNumber.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MPassword } from './MPassword.vue';
3
+ declare const meta: Meta<typeof MPassword>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MPassword>;
6
+ export declare const Default: Story;
7
+ export declare const WithError: Story;
8
+ export declare const Disabled: Story;
@@ -0,0 +1,43 @@
1
+ type __VLS_Props = {
2
+ label?: string;
3
+ id?: string;
4
+ modelValue?: string;
5
+ name?: string;
6
+ required?: boolean;
7
+ disabled?: boolean;
8
+ error?: string | string[];
9
+ hint?: string;
10
+ invalid?: boolean;
11
+ loading?: boolean;
12
+ autocomplete?: string;
13
+ submitTriggered?: boolean;
14
+ showPasswordLabel?: string;
15
+ hidePasswordLabel?: string;
16
+ };
17
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
18
+ "update:modelValue": (value: string) => any;
19
+ blur: (event: FocusEvent) => any;
20
+ focus: (event: FocusEvent) => any;
21
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
23
+ onBlur?: ((event: FocusEvent) => any) | undefined;
24
+ onFocus?: ((event: FocusEvent) => any) | undefined;
25
+ }>, {
26
+ name: string;
27
+ label: string;
28
+ disabled: boolean;
29
+ loading: boolean;
30
+ modelValue: string;
31
+ id: string;
32
+ required: boolean;
33
+ error: string | string[];
34
+ hint: string;
35
+ invalid: boolean;
36
+ submitTriggered: boolean;
37
+ autocomplete: string;
38
+ showPasswordLabel: string;
39
+ hidePasswordLabel: string;
40
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
41
+ passwordInput: HTMLInputElement;
42
+ }, any>;
43
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MPassword } from './MPassword.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MRadio } from './MRadio.vue';
3
+ declare const meta: Meta<typeof MRadio>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MRadio>;
6
+ export declare const Default: Story;
7
+ export declare const Checked: Story;
8
+ export declare const Disabled: Story;
@@ -0,0 +1,33 @@
1
+ type __VLS_Props = {
2
+ modelValue?: boolean;
3
+ label?: string;
4
+ id?: string;
5
+ name?: string;
6
+ disabled?: boolean;
7
+ error?: string | string[];
8
+ hint?: string;
9
+ invalid?: boolean;
10
+ loading?: boolean;
11
+ submitTriggered?: boolean;
12
+ };
13
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
14
+ "update:modelValue": (value: boolean) => any;
15
+ blur: (event: FocusEvent) => any;
16
+ focus: (event: FocusEvent) => any;
17
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
19
+ onBlur?: ((event: FocusEvent) => any) | undefined;
20
+ onFocus?: ((event: FocusEvent) => any) | undefined;
21
+ }>, {
22
+ name: string;
23
+ label: string;
24
+ disabled: boolean;
25
+ loading: boolean;
26
+ modelValue: boolean;
27
+ id: string;
28
+ error: string | string[];
29
+ hint: string;
30
+ invalid: boolean;
31
+ submitTriggered: boolean;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
33
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MRadio } from './MRadio.vue';
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MRadioList } from './MRadioList.vue';
3
+ declare const meta: Meta<typeof MRadioList>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MRadioList>;
6
+ export declare const Default: Story;
7
+ export declare const WithError: Story;
8
+ export declare const Disabled: Story;
@@ -0,0 +1,45 @@
1
+ type __VLS_Props = {
2
+ modelValue?: string;
3
+ legend?: string;
4
+ label?: string;
5
+ id?: string;
6
+ name?: string;
7
+ required?: boolean;
8
+ options?: Array<{
9
+ label: string;
10
+ value: string;
11
+ }>;
12
+ disabled?: boolean;
13
+ error?: string | string[];
14
+ hint?: string;
15
+ invalid?: boolean;
16
+ loading?: boolean;
17
+ submitTriggered?: boolean;
18
+ };
19
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
+ "update:modelValue": (value: string) => any;
21
+ blur: (event: FocusEvent) => any;
22
+ focus: (event: FocusEvent) => any;
23
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
25
+ onBlur?: ((event: FocusEvent) => any) | undefined;
26
+ onFocus?: ((event: FocusEvent) => any) | undefined;
27
+ }>, {
28
+ name: string;
29
+ label: string;
30
+ disabled: boolean;
31
+ loading: boolean;
32
+ legend: string;
33
+ modelValue: string;
34
+ id: string;
35
+ required: boolean;
36
+ error: string | string[];
37
+ hint: string;
38
+ invalid: boolean;
39
+ submitTriggered: boolean;
40
+ options: Array<{
41
+ label: string;
42
+ value: string;
43
+ }>;
44
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
45
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MRadioList } from './MRadioList.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MSelect } from './MSelect.vue';
3
+ declare const meta: Meta<typeof MSelect>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MSelect>;
6
+ export declare const Default: Story;
7
+ export declare const WithError: Story;
8
+ export declare const Disabled: Story;
@@ -0,0 +1,43 @@
1
+ type __VLS_Props = {
2
+ modelValue?: string;
3
+ label?: string;
4
+ id?: string;
5
+ name?: string;
6
+ options?: Array<{
7
+ label: string;
8
+ value: string;
9
+ }>;
10
+ required?: boolean;
11
+ disabled?: boolean;
12
+ error?: string | string[];
13
+ hint?: string;
14
+ invalid?: boolean;
15
+ loading?: boolean;
16
+ submitTriggered?: boolean;
17
+ };
18
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
19
+ "update:modelValue": (value: string) => any;
20
+ blur: (event: FocusEvent) => any;
21
+ focus: (event: FocusEvent) => any;
22
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
24
+ onBlur?: ((event: FocusEvent) => any) | undefined;
25
+ onFocus?: ((event: FocusEvent) => any) | undefined;
26
+ }>, {
27
+ name: string;
28
+ label: string;
29
+ disabled: boolean;
30
+ loading: boolean;
31
+ modelValue: string;
32
+ id: string;
33
+ required: boolean;
34
+ error: string | string[];
35
+ hint: string;
36
+ invalid: boolean;
37
+ submitTriggered: boolean;
38
+ options: Array<{
39
+ label: string;
40
+ value: string;
41
+ }>;
42
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
43
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MSelect } from './MSelect.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MSwitch } from './MSwitch.vue';
3
+ declare const meta: Meta<typeof MSwitch>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MSwitch>;
6
+ export declare const Default: Story;
7
+ export declare const Checked: Story;
8
+ export declare const WithStateLabels: Story;
9
+ export declare const WithError: Story;
10
+ export declare const Disabled: Story;
11
+ export declare const Loading: Story;
@@ -0,0 +1,41 @@
1
+ type __VLS_Props = {
2
+ modelValue?: boolean;
3
+ label?: string;
4
+ id?: string;
5
+ name?: string;
6
+ required?: boolean;
7
+ disabled?: boolean;
8
+ loading?: boolean;
9
+ error?: string | string[];
10
+ hint?: string;
11
+ invalid?: boolean;
12
+ submitTriggered?: boolean;
13
+ onLabel?: string;
14
+ offLabel?: string;
15
+ };
16
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
17
+ "update:modelValue": (value: boolean) => any;
18
+ blur: (event: FocusEvent) => any;
19
+ focus: (event: FocusEvent) => any;
20
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
22
+ onBlur?: ((event: FocusEvent) => any) | undefined;
23
+ onFocus?: ((event: FocusEvent) => any) | undefined;
24
+ }>, {
25
+ name: string;
26
+ label: string;
27
+ disabled: boolean;
28
+ loading: boolean;
29
+ modelValue: boolean;
30
+ id: string;
31
+ required: boolean;
32
+ error: string | string[];
33
+ hint: string;
34
+ invalid: boolean;
35
+ submitTriggered: boolean;
36
+ onLabel: string;
37
+ offLabel: string;
38
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
39
+ switchInput: HTMLInputElement;
40
+ }, any>;
41
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MSwitch } from './MSwitch.vue';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MTextarea } from './MTextarea.vue';
3
+ declare const meta: Meta<typeof MTextarea>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MTextarea>;
6
+ export declare const Default: Story;
7
+ export declare const WithError: Story;
8
+ export declare const Disabled: Story;
@@ -0,0 +1,37 @@
1
+ type __VLS_Props = {
2
+ modelValue?: string;
3
+ label?: string;
4
+ id?: string;
5
+ name?: string;
6
+ rows?: number;
7
+ required?: boolean;
8
+ disabled?: boolean;
9
+ error?: string | string[];
10
+ hint?: string;
11
+ invalid?: boolean;
12
+ loading?: boolean;
13
+ submitTriggered?: boolean;
14
+ };
15
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
+ "update:modelValue": (value: string) => any;
17
+ blur: (event: FocusEvent) => any;
18
+ focus: (event: FocusEvent) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
21
+ onBlur?: ((event: FocusEvent) => any) | undefined;
22
+ onFocus?: ((event: FocusEvent) => any) | undefined;
23
+ }>, {
24
+ name: string;
25
+ label: string;
26
+ disabled: boolean;
27
+ loading: boolean;
28
+ modelValue: string;
29
+ id: string;
30
+ required: boolean;
31
+ error: string | string[];
32
+ hint: string;
33
+ invalid: boolean;
34
+ submitTriggered: boolean;
35
+ rows: number;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
37
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MTextarea } from './MTextarea.vue';
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { default as MValidationSummary } from './MValidationSummary.vue';
3
+ declare const meta: Meta<typeof MValidationSummary>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MValidationSummary>;
6
+ export declare const Default: Story;
7
+ export declare const WithFormLevelError: Story;
8
+ export declare const WithValidationEngine: Story;
@@ -0,0 +1,25 @@
1
+ import { MagooFieldError } from '../../types';
2
+ type __VLS_Props = {
3
+ errors?: Record<string, MagooFieldError>;
4
+ /** Nomes legíveis por campo, exibidos como prefixo da mensagem. */
5
+ labels?: Record<string, string>;
6
+ /** IDs dos controles quando diferem do `name`. */
7
+ fieldIds?: Record<string, string>;
8
+ title?: string;
9
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
10
+ /** Move o foco para o resumo quando ele passa a exibir erros. */
11
+ autofocus?: boolean;
12
+ };
13
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
14
+ focus: () => void | undefined;
15
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
16
+ title: string;
17
+ errors: Record<string, MagooFieldError>;
18
+ labels: Record<string, string>;
19
+ fieldIds: Record<string, string>;
20
+ headingLevel: 2 | 3 | 4 | 5 | 6;
21
+ autofocus: boolean;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
23
+ root: HTMLDivElement;
24
+ }, any>;
25
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MValidationSummary } from './MValidationSummary.vue';
@@ -0,0 +1,17 @@
1
+ export * from './MButton';
2
+ export * from './MInput';
3
+ export * from './MNumber';
4
+ export * from './MPassword';
5
+ export * from './MFileUpload';
6
+ export * from './MSwitch';
7
+ export * from './MCheckbox';
8
+ export * from './MCheckboxList';
9
+ export * from './MErrorMessage';
10
+ export * from './MFieldsetPanel';
11
+ export * from './MForm';
12
+ export * from './MRadio';
13
+ export * from './MRadioList';
14
+ export * from './MSelect';
15
+ export * from './MTextarea';
16
+ export * from './MValidationSummary';
17
+ export * from './MList';
@@ -0,0 +1,4 @@
1
+ import { MaybeRefOrGetter } from 'vue';
2
+ export declare function useFieldDescribedBy(hint: MaybeRefOrGetter<string | undefined>, hintId: MaybeRefOrGetter<string>, errorId: MaybeRefOrGetter<string>, hasVisibleErrors: MaybeRefOrGetter<boolean>): {
3
+ describedBy: import('vue').ComputedRef<string>;
4
+ };
@@ -0,0 +1,7 @@
1
+ import { MaybeRefOrGetter, Ref } from 'vue';
2
+ import { MagooFieldError } from '../types';
3
+ export declare function normalizeFieldErrors(error?: MagooFieldError): string[];
4
+ export declare function useFieldErrors(name: MaybeRefOrGetter<string | undefined>, error: MaybeRefOrGetter<MagooFieldError | undefined>): {
5
+ formSubmitTriggered: Ref<boolean, boolean>;
6
+ resolvedErrors: import('vue').ComputedRef<string[]>;
7
+ };
@@ -0,0 +1,6 @@
1
+ import { MaybeRefOrGetter } from 'vue';
2
+ export declare function useFieldIds(id?: MaybeRefOrGetter<string | undefined>): {
3
+ fieldId: import('vue').ComputedRef<string>;
4
+ hintId: import('vue').ComputedRef<string>;
5
+ errorId: import('vue').ComputedRef<string>;
6
+ };
@@ -0,0 +1,9 @@
1
+ import { App } from 'vue';
2
+ export { applyTheme } from './themes/theme';
3
+ export * from './components';
4
+ export * from './validation';
5
+ export type { MagooFieldAdapterState, MagooFieldError, MagooFieldState } from './types';
6
+ declare const _default: {
7
+ install(app: App): void;
8
+ };
9
+ export default _default;
File without changes
@@ -0,0 +1,3 @@
1
+ export type MagooTheme = 'light' | 'dark' | 'system';
2
+ export declare function resolveTheme(theme: MagooTheme | undefined): "light" | "dark";
3
+ export declare function applyTheme(theme: MagooTheme | undefined, target?: HTMLElement): void;