@mantis-core/ui 0.4.0 → 0.5.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 (89) hide show
  1. package/COMPONENTS.md +115 -15
  2. package/docs/components/action-column.md +14 -13
  3. package/docs/components/admin-page-configurator.md +23 -0
  4. package/docs/components/admin-page-header.md +15 -17
  5. package/docs/components/admin-page-layout-shell.md +22 -0
  6. package/docs/components/admin-page-layout.md +11 -20
  7. package/docs/components/app-shell.md +20 -0
  8. package/docs/components/async-select.md +18 -17
  9. package/docs/components/avatar.md +19 -0
  10. package/docs/components/bar-chart.md +21 -0
  11. package/docs/components/breadcrumbs.md +15 -0
  12. package/docs/components/button.md +20 -15
  13. package/docs/components/card-skeleton.md +15 -0
  14. package/docs/components/change-password-form.md +17 -0
  15. package/docs/components/ckeditor-input.md +15 -16
  16. package/docs/components/color-picker-input.md +19 -0
  17. package/docs/components/combobox.md +19 -0
  18. package/docs/components/command-palette.md +17 -0
  19. package/docs/components/confirm-dialog.md +19 -17
  20. package/docs/components/currency-input.md +21 -0
  21. package/docs/components/data-state.md +15 -15
  22. package/docs/components/date-input.md +17 -18
  23. package/docs/components/date-presets.md +18 -0
  24. package/docs/components/date-range-input.md +20 -0
  25. package/docs/components/description-list.md +16 -0
  26. package/docs/components/dirty-form-guard.md +15 -23
  27. package/docs/components/donut-chart.md +21 -0
  28. package/docs/components/drawer.md +19 -0
  29. package/docs/components/drop-down.md +18 -20
  30. package/docs/components/empty-state.md +18 -0
  31. package/docs/components/error-boundary.md +17 -0
  32. package/docs/components/error-message.md +11 -9
  33. package/docs/components/file-dropzone.md +28 -16
  34. package/docs/components/filter-pannel.md +12 -14
  35. package/docs/components/forgot-password-form.md +18 -0
  36. package/docs/components/form-actions-bar.md +29 -18
  37. package/docs/components/form-field-render.md +16 -16
  38. package/docs/components/form-section.md +15 -11
  39. package/docs/components/form-wizard.md +18 -0
  40. package/docs/components/hidden-field.md +12 -15
  41. package/docs/components/index-column.md +12 -9
  42. package/docs/components/line-chart.md +21 -0
  43. package/docs/components/loading.md +14 -12
  44. package/docs/components/login-form.md +22 -0
  45. package/docs/components/map-picker-client.md +14 -14
  46. package/docs/components/map-picker-osm.md +16 -14
  47. package/docs/components/map-picker.md +14 -17
  48. package/docs/components/menu-button.md +14 -18
  49. package/docs/components/modal.md +20 -0
  50. package/docs/components/multi-select-filter.md +14 -16
  51. package/docs/components/multi-select.md +18 -19
  52. package/docs/components/number-input.md +17 -16
  53. package/docs/components/otp-input.md +18 -0
  54. package/docs/components/page-tabs.md +16 -0
  55. package/docs/components/page-title.md +11 -9
  56. package/docs/components/paginated-table.md +19 -26
  57. package/docs/components/pagination.md +15 -18
  58. package/docs/components/password-input.md +19 -0
  59. package/docs/components/phone-input.md +18 -0
  60. package/docs/components/radio-group.md +20 -0
  61. package/docs/components/range-slider.md +20 -0
  62. package/docs/components/rating-input.md +19 -0
  63. package/docs/components/render-field.md +15 -20
  64. package/docs/components/reset-password-form.md +17 -0
  65. package/docs/components/rich-text-preview.md +15 -14
  66. package/docs/components/search-input.md +19 -0
  67. package/docs/components/select.md +19 -19
  68. package/docs/components/stat-card.md +19 -0
  69. package/docs/components/status-badge.md +16 -10
  70. package/docs/components/switch.md +16 -19
  71. package/docs/components/table-filter-field.md +13 -17
  72. package/docs/components/table-skeleton.md +16 -0
  73. package/docs/components/table-toolbar.md +16 -15
  74. package/docs/components/tag.md +18 -0
  75. package/docs/components/tags-input.md +19 -0
  76. package/docs/components/text-area.md +16 -16
  77. package/docs/components/text-input.md +16 -15
  78. package/docs/components/time-picker.md +17 -14
  79. package/docs/components/timeline.md +15 -0
  80. package/docs/components/toggle-inline-button.md +17 -18
  81. package/docs/components/toggle.md +20 -17
  82. package/docs/components/upload-files-preview.md +20 -22
  83. package/docs/components/user-menu.md +19 -0
  84. package/docs/contracts/component-doc-schema.md +78 -0
  85. package/docs/contracts/dependency-map.md +68 -29
  86. package/docs/contracts/style-imports.md +38 -12
  87. package/llms.txt +106 -0
  88. package/package.json +2 -2
  89. package/PRIMEREACT_MAPPING.md +0 -6
@@ -1,21 +1,23 @@
1
- # ConfirmDialog
2
-
3
- - Export: `ConfirmDialog`
4
- - Extra exports: `ConfirmDialogProps`, `ConfirmDialogSeverity`
5
- - Import: `import { ConfirmDialog } from "@mantis-core/ui";`
6
- - Base library: `primereact/dialog`
7
- - Base typing: explicit `ConfirmDialogProps`
8
- - Required styles: `@mantis-core/styles/scss/confirm-dialog.scss`
9
-
1
+ ---
2
+ name: ConfirmDialog
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/ui/ConfirmDialog'
5
+ whenToUse: Modal confirmation dialog with confirm/cancel buttons and severity-aware styling.
6
+ baseLibrary: primereact/dialog
7
+ requiredStyles: [scss/confirm-dialog.scss]
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: visible, type: boolean, required: true }
11
+ - { name: onConfirm, type: '() => void', required: true }
12
+ - { name: onCancel, type: '() => void', required: true }
13
+ - { name: title, type: ReactNode, required: false }
14
+ - { name: message, type: ReactNode, required: false }
15
+ - { name: confirmSeverity, type: '''primary'' | ''info'' | ''success'' | ''warning'' | ''danger''', required: false, default: '''danger''' }
16
+ - { name: loading, type: boolean, required: false }
17
+ - { name: width, type: string, required: false, default: '''30rem''' }
18
+ ---
10
19
  ## Example
11
20
 
12
21
  ```tsx
13
- <ConfirmDialog
14
- visible={open}
15
- title="Delete listing"
16
- message="This action cannot be undone."
17
- confirmSeverity="danger"
18
- onConfirm={handleDelete}
19
- onCancel={() => setOpen(false)}
20
- />
22
+ <ConfirmDialog visible={showConfirm} title='Delete?' message='This cannot be undone.' confirmSeverity='danger' onConfirm={handleDelete} onCancel={() => setShowConfirm(false)} />
21
23
  ```
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: CurrencyInput
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/CurrencyInput'
5
+ whenToUse: 'Numeric input pre-configured for currency display (mode=currency).'
6
+ baseLibrary: custom
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/inputs.scss]
9
+ relatedComponents: [FormFieldRender, NumberInput]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: currency, type: string, required: false, default: '''USD''' }
14
+ - { name: locale, type: string, required: false, default: '''en-US''' }
15
+ - { name: block, type: boolean, required: false }
16
+ ---
17
+ ## Example
18
+
19
+ ```tsx
20
+ <CurrencyInput controller={{ name: 'price' }} currency='USD' block />
21
+ ```
@@ -1,19 +1,19 @@
1
- # DataState
2
-
3
- - Export: `DataState`
4
- - Extra exports: `DataStateProps`, `DataStateStatus`
5
- - Import: `import { DataState } from "@mantis-core/ui";`
6
- - Base library: custom state wrapper + `Button`
7
- - Base typing: explicit `DataStateProps`
8
- - Required styles: `@mantis-core/styles/scss/data-state.scss`
9
-
1
+ ---
2
+ name: DataState
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/ui/DataState'
5
+ whenToUse: Full-area empty/error/loading state placeholder for data-fetching views.
6
+ baseLibrary: custom
7
+ requiredStyles: [scss/data-state.scss]
8
+ relatedComponents: [StatusBadge, Loading]
9
+ relatedNextCore: []
10
+ props:
11
+ - { name: status, type: DataStateStatus, required: true }
12
+ - { name: message, type: string, required: false }
13
+ - { name: action, type: ReactNode, required: false }
14
+ ---
10
15
  ## Example
11
16
 
12
17
  ```tsx
13
- <DataState
14
- status={query.isError ? "error" : query.isLoading ? "loading" : rows.length === 0 ? "empty" : "ready"}
15
- onRetry={() => query.refetch()}
16
- >
17
- <PaginatedTable value={rows}>{/* columns */}</PaginatedTable>
18
- </DataState>
18
+ <DataState status='empty' message='No properties found' action={<Button label='Add first' onClick={onCreate} />} />
19
19
  ```
@@ -1,22 +1,21 @@
1
- # DateInput
2
-
3
- - Export: `DateInput`
4
- - Extra exports: `DateInputProps`
5
- - Import: `import { DateInput } from "@mantis-core/ui";`
6
- - Base library: `primereact/calendar`
7
- - Base typing: `Omit<CalendarProps, "name" | "defaultValue"> & { controller: ControllerProps; block?: boolean }`
8
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
9
- - Required styles:
10
- - `@mantis-core/styles/scss/inputs.scss`
11
- - `@mantis-core/styles/scss/date-picker.scss`
12
-
1
+ ---
2
+ name: DateInput
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/DateInput'
5
+ whenToUse: 'Single date picker (PrimeReact Calendar, locale=es, format=dd/mm/yy).'
6
+ baseLibrary: primereact/calendar
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/inputs.scss]
9
+ relatedComponents: [FormFieldRender, DateRangeInput]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: block, type: boolean, required: false }
14
+ - { name: showTime, type: boolean, required: false }
15
+ - { name: minDate, type: Date, required: false }
16
+ ---
13
17
  ## Example
14
18
 
15
19
  ```tsx
16
- <DateInput
17
- controller={{ name: "publishAt", control: form.control }}
18
- block
19
- showIcon
20
- dateFormat="yy-mm-dd"
21
- />
20
+ <DateInput controller={{ name: 'publishedAt' }} block />
22
21
  ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: DatePresets
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/DatePresets'
5
+ whenToUse: 'Row of preset buttons (Hoy, 7 días, 30 días, Este mes) that fire onChange with a [Date, Date] range; pair with DateRangeInput.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: onChange, type: '(range: [Date, Date]) => void', required: true }
10
+ - { name: presets, type: '{ label: string; resolve: () => [Date, Date] }[]', required: false }
11
+ - { name: disabled, type: boolean, required: false }
12
+ - { name: className, type: string, required: false }
13
+ ---
14
+ ## Example
15
+
16
+ ```tsx
17
+ <DatePresets onChange={(range) => setValue('period', range)} />
18
+ ```
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: DateRangeInput
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/DateRangeInput'
5
+ whenToUse: 'Date range picker that stores [startDate, endDate] array; selectionMode is locked to ''range''.'
6
+ baseLibrary: custom
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/inputs.scss]
9
+ relatedComponents: [FormFieldRender, DateInput]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: block, type: boolean, required: false }
14
+ - { name: showTime, type: boolean, required: false }
15
+ ---
16
+ ## Example
17
+
18
+ ```tsx
19
+ <DateRangeInput controller={{ name: 'period' }} block />
20
+ ```
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: DescriptionList
3
+ category: data
4
+ import: '@mantis-core/ui/components/data/DescriptionList'
5
+ whenToUse: 'Grid-based label/value list for detail views; supports 1, 2, or 3 columns.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: items, type: '{ label: string; value: ReactNode }[]', required: true }
10
+ - { name: columns, type: '1 | 2 | 3', required: false, default: '1' }
11
+ ---
12
+ ## Example
13
+
14
+ ```tsx
15
+ <DescriptionList columns={2} items={[{ label: 'Nombre', value: lead.name }, { label: 'Email', value: lead.email }]} />
16
+ ```
@@ -1,28 +1,20 @@
1
- # DirtyFormGuard and useDirtyFormGuard
2
-
3
- - Exports: `DirtyFormGuard`, `useDirtyFormGuard`
4
- - Extra exports: `DirtyFormGuardProps`, `UseDirtyFormGuardOptions`, `UseDirtyFormGuardResult`
5
- - Base library: browser `beforeunload` + `window.confirm`
6
- - Required styles: none
7
-
8
- ## Component example
1
+ ---
2
+ name: DirtyFormGuard
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/DirtyFormGuard'
5
+ whenToUse: Blocks navigation when a react-hook-form has unsaved changes; also available as useDirtyFormGuard hook.
6
+ baseLibrary: custom
7
+ relatedComponents: [FormActionsBar]
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: isDirty, type: boolean, required: true, description: 'Pass formState.isDirty from react-hook-form' }
11
+ - { name: enabled, type: boolean, required: false, default: 'true', description: 'Set to false to temporarily disable the guard' }
12
+ - { name: message, type: string, required: false, description: 'Custom confirmation message shown to the user' }
13
+ ---
14
+ ## Example
9
15
 
10
16
  ```tsx
11
- <DirtyFormGuard
12
- isDirty={form.formState.isDirty}
13
- message="You have unsaved changes."
14
- />
15
- ```
16
-
17
- ## Hook example
18
-
19
- ```tsx
20
- const guard = useDirtyFormGuard({
21
- isDirty: form.formState.isDirty,
22
- message: "Leave without saving?",
23
- });
24
-
25
- void guard.confirmIfDirty(async () => router.push("/admin"));
17
+ {/* TODO: add example */}
26
18
  ```
27
19
 
28
20
  ## Notes
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: DonutChart
3
+ category: charts
4
+ import: '@mantis-core/ui/components/charts/DonutChart'
5
+ whenToUse: Part-to-whole breakdown rendered as a doughnut chart.
6
+ baseLibrary: custom
7
+ relatedComponents: [LineChart, BarChart]
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: labels, type: 'string[]', required: true }
11
+ - { name: datasets, type: '{ data: number[]; label?: string }[]', required: true }
12
+ - { name: options, type: 'ChartOptions<''doughnut''>', required: false }
13
+ - { name: colors, type: 'string[]', required: false, default: DEFAULT_COLORS palette }
14
+ - { name: height, type: number, required: false, default: '300' }
15
+ - { name: className, type: string, required: false }
16
+ ---
17
+ ## Example
18
+
19
+ ```tsx
20
+ <DonutChart labels={['Leads','Closed','Lost']} datasets={[{ data: [60,25,15] }]} />
21
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Drawer
3
+ category: overlays
4
+ import: '@mantis-core/ui/components/overlays/Drawer'
5
+ whenToUse: Slide-in side panel (PrimeReact Sidebar wrapper); defaults to right position.
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: visible, type: boolean, required: true }
10
+ - { name: onHide, type: '() => void', required: true }
11
+ - { name: position, type: '''left'' | ''right'' | ''top'' | ''bottom''', required: false, default: '''right''' }
12
+ - { name: header, type: ReactNode, required: false }
13
+ - { name: className, type: string, required: false }
14
+ ---
15
+ ## Example
16
+
17
+ ```tsx
18
+ <Drawer visible={open} onHide={() => setOpen(false)} header='Filtros'><FilterForm /></Drawer>
19
+ ```
@@ -1,26 +1,24 @@
1
- # DropDown
2
-
3
- - Export: `DropDown`
4
- - Extra exports: `DropDownProps`
5
- - Import: `import { DropDown } from "@mantis-core/ui";`
6
- - Base library: `primereact/dropdown`
7
- - Base typing: `Omit<DropdownProps, "name" | "defaultValue"> & { controller: ControllerProps; block?: boolean }`
8
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
9
- - Required styles: `@mantis-core/styles/scss/inputs.scss`
10
-
1
+ ---
2
+ name: DropDown
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/DropDown'
5
+ whenToUse: PrimeReact Dropdown (single select with filter) wired to react-hook-form; use when you need PrimeReact styling over react-select.
6
+ baseLibrary: primereact/dropdown
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/inputs.scss]
9
+ relatedComponents: [FormFieldRender]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: options, type: 'any[]', required: false }
14
+ - { name: optionLabel, type: string, required: false }
15
+ - { name: optionValue, type: string, required: false }
16
+ - { name: block, type: boolean, required: false }
17
+ ---
11
18
  ## Example
12
19
 
13
20
  ```tsx
14
- <DropDown
15
- controller={{ name: "status", control: form.control }}
16
- block
17
- options={[
18
- { label: "Draft", value: "draft" },
19
- { label: "Published", value: "published" },
20
- ]}
21
- optionLabel="label"
22
- optionValue="value"
23
- />
21
+ <DropDown controller={{ name: 'category' }} options={categories} optionLabel='name' optionValue='id' block />
24
22
  ```
25
23
 
26
24
  ## Notes
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: EmptyState
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/feedback/EmptyState'
5
+ whenToUse: 'Centered empty-state placeholder with icon, title, optional description, and action button.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: title, type: ReactNode, required: true }
10
+ - { name: icon, type: ReactNode, required: false }
11
+ - { name: description, type: ReactNode, required: false }
12
+ - { name: action, type: ReactNode, required: false }
13
+ ---
14
+ ## Example
15
+
16
+ ```tsx
17
+ <EmptyState icon={<i className='pi pi-inbox' />} title='Sin propiedades' description='Crea tu primera propiedad.' action={<Button label='Nueva' onClick={onCreate} />} />
18
+ ```
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: ErrorBoundary
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/feedback/ErrorBoundary'
5
+ whenToUse: React error boundary; renders fallback UI on uncaught errors; fallback can be a ReactNode or render function.
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: children, type: ReactNode, required: true }
10
+ - { name: fallback, type: 'ReactNode | ((error: Error) => ReactNode)', required: false }
11
+ - { name: onError, type: '(error: Error, info: ErrorInfo) => void', required: false }
12
+ ---
13
+ ## Example
14
+
15
+ ```tsx
16
+ <ErrorBoundary fallback={<p>Algo salió mal.</p>}><FeatureView /></ErrorBoundary>
17
+ ```
@@ -1,13 +1,15 @@
1
- # ErrorMessage
2
-
3
- - Export: `ErrorMessage`
4
- - Import: `import { ErrorMessage } from "@mantis-core/ui";`
5
- - Base library: `@hookform/error-message`
6
- - Base typing: wrapper export around hook-form error rendering
7
- - Required styles: none
8
-
1
+ ---
2
+ name: ErrorMessage
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/ErrorMessage'
5
+ whenToUse: Displays a validation error string; use standalone when not using FormFieldRender.
6
+ baseLibrary: '@hookform/error-message'
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: message, type: string, required: false }
10
+ ---
9
11
  ## Example
10
12
 
11
13
  ```tsx
12
- <ErrorMessage errors={form.formState.errors} name="title" />
14
+ <ErrorMessage message={errors.email?.message} />
13
15
  ```
@@ -1,22 +1,34 @@
1
- # FileDropzone
2
-
3
- - Export: `FileDropzone`
4
- - Extra exports: `FileDropzoneProps`, `FileDropzoneRejectedFile`, `FileDropzoneRejectCode`
5
- - Import: `import { FileDropzone } from "@mantis-core/ui";`
6
- - Base library: custom drag-and-drop file input
7
- - Base typing: explicit `FileDropzoneProps`
8
- - Required styles: `@mantis-core/styles/scss/file-dropzone.scss`
9
-
1
+ ---
2
+ name: FileDropzone
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/FileDropzone'
5
+ whenToUse: Drag-and-drop file input with validation (type, size, count); supports react-hook-form mode and plain controlled mode.
6
+ baseLibrary: custom
7
+ requiredStyles: [scss/file-dropzone.scss]
8
+ relatedComponents: [UploadFilesPreview]
9
+ relatedNextCore: []
10
+ props:
11
+ - { name: controller, type: ControllerProps, required: false, description: 'When provided, wires to react-hook-form' }
12
+ - { name: value, type: 'File[]', required: false, description: 'Controlled file list (plain mode)' }
13
+ - { name: onChange, type: '(files: File[]) => void', required: false, description: 'Change handler (plain mode)' }
14
+ - { name: onFilesAccepted, type: '(files: File[]) => void', required: false, description: 'Called with accepted files after drop' }
15
+ - { name: onFilesRejected, type: '(rejections: FileDropzoneRejectedFile[]) => void', required: false, description: 'Called with rejected files after drop' }
16
+ - { name: multiple, type: boolean, required: false, default: 'true', description: 'Allow multiple files' }
17
+ - { name: maxFiles, type: number, required: false, default: '10', description: 'Maximum number of files' }
18
+ - { name: maxSizeBytes, type: number, required: false, default: '10485760', description: 'Max file size in bytes (default 10 MB)' }
19
+ - { name: accept, type: 'string | string[]', required: false, description: 'Accepted MIME types or extensions' }
20
+ - { name: disabled, type: boolean, required: false, default: 'false', description: 'Disable the dropzone' }
21
+ - { name: block, type: boolean, required: false, default: 'true', description: 'Full-width layout' }
22
+ - { name: label, type: string, required: false, description: 'Optional label above the zone' }
23
+ - { name: hint, type: string, required: false, description: 'Hint text inside the zone' }
24
+ - { name: dropTitle, type: string, required: false, description: 'Title text when idle' }
25
+ - { name: dragOverTitle, type: string, required: false, description: 'Title text while dragging over' }
26
+ - { name: className, type: string, required: false, description: 'Additional CSS class on the root element' }
27
+ ---
10
28
  ## Example
11
29
 
12
30
  ```tsx
13
- <FileDropzone
14
- controller={{ name: "attachments", control: form.control, defaultValue: [] }}
15
- accept={["image/*", ".pdf"]}
16
- maxFiles={5}
17
- maxSizeBytes={5 * 1024 * 1024}
18
- label="Attachments"
19
- />
31
+ {/* TODO: add example */}
20
32
  ```
21
33
 
22
34
  ## Notes
@@ -1,20 +1,18 @@
1
- # FilterPannel
2
-
3
- - Export: `FilterPannel`
4
- - Import: `import { FilterPannel } from "@mantis-core/ui";`
5
- - Base library: `primereact/sidebar` + `react-hook-form`
6
- - Base typing: `PropsWithChildren<{ onApplyFilter: (data: T) => Promise<void> }>`
7
- - Required styles: none
8
-
1
+ ---
2
+ name: FilterPannel
3
+ category: tables
4
+ import: '@mantis-core/ui/components/Tables/FilterPannel'
5
+ whenToUse: Slide-in sidebar filter panel for tables; wraps children in FormProvider and calls onApplyFilter with cleaned form data.
6
+ baseLibrary: primereact/sidebar
7
+ relatedComponents: [PaginatedTable, MultiSelectFilter]
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: onApplyFilter, type: '(data: T) => Promise<void>', required: true }
11
+ ---
9
12
  ## Example
10
13
 
11
14
  ```tsx
12
- <FilterPannel<{ status: string | null; city: string | null }>
13
- onApplyFilter={async (filters) => setFilters(filters)}
14
- >
15
- <DropDown controller={{ name: "status" }} options={statusOptions} />
16
- <DropDown controller={{ name: "city" }} options={cityOptions} />
17
- </FilterPannel>
15
+ <FilterPannel onApplyFilter={pagination.applyFilters}><TableFilterField label='Search'><TextInput controller={{ name: 'search' }} /></TableFilterField></FilterPannel>
18
16
  ```
19
17
 
20
18
  ## Notes
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: ForgotPasswordForm
3
+ category: auth
4
+ import: '@mantis-core/ui/components/auth/ForgotPasswordForm'
5
+ whenToUse: Email-only form to trigger password reset; caller owns the reset logic.
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: onSubmit, type: '(values: { email: string }) => void | Promise<void>', required: true }
10
+ - { name: title, type: string, required: false }
11
+ - { name: backSlot, type: ReactNode, required: false }
12
+ - { name: className, type: string, required: false }
13
+ ---
14
+ ## Example
15
+
16
+ ```tsx
17
+ <ForgotPasswordForm onSubmit={({ email }) => sendResetEmail(email)} />
18
+ ```
@@ -1,22 +1,33 @@
1
- # FormActionsBar
2
-
3
- - Export: `FormActionsBar`
4
- - Import: `import { FormActionsBar } from "@mantis-core/ui";`
5
- - Base library: custom layout + `Button`
6
- - Base typing: explicit `FormActionsBarProps`
7
- - Required styles: `@mantis-core/styles/scss/form-actions.scss`
8
-
1
+ ---
2
+ name: FormActionsBar
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/FormActionsBar'
5
+ whenToUse: Sticky-capable action bar with primary/secondary buttons and optional left/right slots for form pages.
6
+ baseLibrary: custom
7
+ requiredStyles: [scss/form-actions.scss]
8
+ relatedComponents: [FormFieldRender, DirtyFormGuard]
9
+ relatedNextCore: []
10
+ props:
11
+ - { name: className, type: string, required: false, description: 'Additional CSS class on the root element' }
12
+ - { name: align, type: '''start'' | ''end'' | ''between''', required: false, default: '''between''', description: 'Horizontal alignment of action groups' }
13
+ - { name: sticky, type: boolean, required: false, default: 'false', description: 'Fix bar to bottom of viewport' }
14
+ - { name: leftSlot, type: ReactNode, required: false, description: 'Content rendered on the left side' }
15
+ - { name: rightSlot, type: ReactNode, required: false, description: 'Content rendered before the action buttons on the right' }
16
+ - { name: primaryLabel, type: string, required: false, default: '''Guardar''', description: 'Label for the primary button' }
17
+ - { name: primaryVariant, type: ButtonVariant, required: false, default: '''primary''', description: 'Design-system variant for primary button' }
18
+ - { name: primaryType, type: '''button'' | ''submit'' | ''reset''', required: false, default: '''submit''', description: 'HTML type for primary button' }
19
+ - { name: primaryLoading, type: boolean, required: false, default: 'false', description: 'Show loading spinner on primary button' }
20
+ - { name: primaryDisabled, type: boolean, required: false, default: 'false', description: 'Disable primary button' }
21
+ - { name: onPrimaryClick, type: '() => void', required: false, description: 'Click handler for primary button' }
22
+ - { name: secondaryLabel, type: string, required: false, description: 'Label for the secondary button; omit to hide it' }
23
+ - { name: secondaryVariant, type: ButtonVariant, required: false, default: '''secondary''', description: 'Design-system variant for secondary button' }
24
+ - { name: secondaryType, type: '''button'' | ''submit'' | ''reset''', required: false, default: '''button''', description: 'HTML type for secondary button' }
25
+ - { name: secondaryOutlined, type: boolean, required: false, default: 'true', description: 'Render secondary button as outlined' }
26
+ - { name: secondaryDisabled, type: boolean, required: false, default: 'false', description: 'Disable secondary button' }
27
+ - { name: onSecondaryClick, type: '() => void', required: false, description: 'Click handler for secondary button' }
28
+ ---
9
29
  ## Example
10
30
 
11
31
  ```tsx
12
- <FormActionsBar
13
- align="between"
14
- sticky
15
- leftSlot={<span>Unsaved changes</span>}
16
- primaryLabel="Save"
17
- primaryType="submit"
18
- secondaryLabel="Cancel"
19
- secondaryOutlined
20
- onSecondaryClick={() => router.back()}
21
- />
32
+ {/* TODO: add example */}
22
33
  ```
@@ -1,20 +1,20 @@
1
- # FormFieldRender
2
-
3
- - Export: `FormFieldRender`
4
- - Extra exports: `FormFieldRenderProps`
5
- - Import: `import { FormFieldRender } from "@mantis-core/ui";`
6
- - Base library: custom label and error wrapper
7
- - Base typing: `{ name: string; label: string | ReactElement; labelProps?; containerClassName?; render: ({ name }) => ReactElement | ReactNode }`
8
- - Required styles: none
9
-
1
+ ---
2
+ name: FormFieldRender
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/FormFieldRender'
5
+ whenToUse: 'Wrapper that renders a label, the input slot, and a validation error message; use to compose any form control.'
6
+ baseLibrary: custom
7
+ relatedComponents: [TextInput, FormActionsBar]
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: label, type: string, required: false }
11
+ - { name: htmlFor, type: string, required: false }
12
+ - { name: error, type: 'string | FieldError', required: false }
13
+ - { name: required, type: boolean, required: false }
14
+ - { name: className, type: string, required: false }
15
+ ---
10
16
  ## Example
11
17
 
12
18
  ```tsx
13
- <FormFieldRender
14
- name="email"
15
- label="Email"
16
- render={({ name }) => (
17
- <TextInput controller={{ name, control: form.control }} block />
18
- )}
19
- />
19
+ <FormFieldRender label='Email' htmlFor='email' error={errors.email}><TextInput controller={{ name: 'email' }} id='email' block /></FormFieldRender>
20
20
  ```
@@ -1,15 +1,19 @@
1
- # FormSection
2
-
3
- - Export: `FormSection`
4
- - Import: `import { FormSection } from "@mantis-core/ui";`
5
- - Base library: custom card section
6
- - Base typing: `{ title: string; description?: string; icon?: ReactNode; children: ReactNode; className?: string }`
7
- - Required styles: none
8
-
1
+ ---
2
+ name: FormSection
3
+ category: pages
4
+ import: '@mantis-core/ui/components/pages/FormSection'
5
+ whenToUse: Bordered card section with a header (title + description + icon) and a padded body; groups related form fields.
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: title, type: string, required: true }
10
+ - { name: description, type: string, required: false }
11
+ - { name: icon, type: ReactNode, required: false }
12
+ - { name: children, type: ReactNode, required: true }
13
+ - { name: className, type: string, required: false }
14
+ ---
9
15
  ## Example
10
16
 
11
17
  ```tsx
12
- <FormSection title="Publishing" description="Visibility and timing controls">
13
- <Switch name="published" control={form.control} />
14
- </FormSection>
18
+ <FormSection title='Contact Info' description='Public contact details'><TextInput controller={{ name: 'email' }} block /></FormSection>
15
19
  ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: FormWizard
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/FormWizard'
5
+ whenToUse: 'Multi-step form navigator with step indicator and per-step validation; must render inside a FormProvider, parent owns the <form onSubmit>.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: steps, type: 'FormWizardStep[]', required: true }
10
+ - { name: onComplete, type: '() => void | Promise<void>', required: false }
11
+ - { name: submitLabel, type: string, required: false, default: '''Finalizar''' }
12
+ - { name: className, type: string, required: false }
13
+ ---
14
+ ## Example
15
+
16
+ ```tsx
17
+ <FormProvider {...form}><form onSubmit={form.handleSubmit(onSubmit)}><FormWizard steps={[{ label: 'Datos', fields: ['name', 'email'], content: <Step1 /> }, { label: 'Confirmar', content: <Step2 /> }]} submitLabel='Guardar' /></form></FormProvider>
18
+ ```