@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.
- package/COMPONENTS.md +115 -15
- package/docs/components/action-column.md +14 -13
- package/docs/components/admin-page-configurator.md +23 -0
- package/docs/components/admin-page-header.md +15 -17
- package/docs/components/admin-page-layout-shell.md +22 -0
- package/docs/components/admin-page-layout.md +11 -20
- package/docs/components/app-shell.md +20 -0
- package/docs/components/async-select.md +18 -17
- package/docs/components/avatar.md +19 -0
- package/docs/components/bar-chart.md +21 -0
- package/docs/components/breadcrumbs.md +15 -0
- package/docs/components/button.md +20 -15
- package/docs/components/card-skeleton.md +15 -0
- package/docs/components/change-password-form.md +17 -0
- package/docs/components/ckeditor-input.md +15 -16
- package/docs/components/color-picker-input.md +19 -0
- package/docs/components/combobox.md +19 -0
- package/docs/components/command-palette.md +17 -0
- package/docs/components/confirm-dialog.md +19 -17
- package/docs/components/currency-input.md +21 -0
- package/docs/components/data-state.md +15 -15
- package/docs/components/date-input.md +17 -18
- package/docs/components/date-presets.md +18 -0
- package/docs/components/date-range-input.md +20 -0
- package/docs/components/description-list.md +16 -0
- package/docs/components/dirty-form-guard.md +15 -23
- package/docs/components/donut-chart.md +21 -0
- package/docs/components/drawer.md +19 -0
- package/docs/components/drop-down.md +18 -20
- package/docs/components/empty-state.md +18 -0
- package/docs/components/error-boundary.md +17 -0
- package/docs/components/error-message.md +11 -9
- package/docs/components/file-dropzone.md +28 -16
- package/docs/components/filter-pannel.md +12 -14
- package/docs/components/forgot-password-form.md +18 -0
- package/docs/components/form-actions-bar.md +29 -18
- package/docs/components/form-field-render.md +16 -16
- package/docs/components/form-section.md +15 -11
- package/docs/components/form-wizard.md +18 -0
- package/docs/components/hidden-field.md +12 -15
- package/docs/components/index-column.md +12 -9
- package/docs/components/line-chart.md +21 -0
- package/docs/components/loading.md +14 -12
- package/docs/components/login-form.md +22 -0
- package/docs/components/map-picker-client.md +14 -14
- package/docs/components/map-picker-osm.md +16 -14
- package/docs/components/map-picker.md +14 -17
- package/docs/components/menu-button.md +14 -18
- package/docs/components/modal.md +20 -0
- package/docs/components/multi-select-filter.md +14 -16
- package/docs/components/multi-select.md +18 -19
- package/docs/components/number-input.md +17 -16
- package/docs/components/otp-input.md +18 -0
- package/docs/components/page-tabs.md +16 -0
- package/docs/components/page-title.md +11 -9
- package/docs/components/paginated-table.md +19 -26
- package/docs/components/pagination.md +15 -18
- package/docs/components/password-input.md +19 -0
- package/docs/components/phone-input.md +18 -0
- package/docs/components/radio-group.md +20 -0
- package/docs/components/range-slider.md +20 -0
- package/docs/components/rating-input.md +19 -0
- package/docs/components/render-field.md +15 -20
- package/docs/components/reset-password-form.md +17 -0
- package/docs/components/rich-text-preview.md +15 -14
- package/docs/components/search-input.md +19 -0
- package/docs/components/select.md +19 -19
- package/docs/components/stat-card.md +19 -0
- package/docs/components/status-badge.md +16 -10
- package/docs/components/switch.md +16 -19
- package/docs/components/table-filter-field.md +13 -17
- package/docs/components/table-skeleton.md +16 -0
- package/docs/components/table-toolbar.md +16 -15
- package/docs/components/tag.md +18 -0
- package/docs/components/tags-input.md +19 -0
- package/docs/components/text-area.md +16 -16
- package/docs/components/text-input.md +16 -15
- package/docs/components/time-picker.md +17 -14
- package/docs/components/timeline.md +15 -0
- package/docs/components/toggle-inline-button.md +17 -18
- package/docs/components/toggle.md +20 -17
- package/docs/components/upload-files-preview.md +20 -22
- package/docs/components/user-menu.md +19 -0
- package/docs/contracts/component-doc-schema.md +78 -0
- package/docs/contracts/dependency-map.md +68 -29
- package/docs/contracts/style-imports.md +38 -12
- package/llms.txt +106 -0
- package/package.json +2 -2
- package/PRIMEREACT_MAPPING.md +0 -6
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
14
|
+
<ErrorMessage message={errors.email?.message} />
|
|
13
15
|
```
|
|
@@ -1,22 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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=
|
|
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
|
+
```
|