@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,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
---
|
|
2
|
+
name: HiddenField
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/HiddenField'
|
|
5
|
+
whenToUse: Registers a hidden value in react-hook-form without rendering any UI.
|
|
6
|
+
baseLibrary: react-hook-form
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
11
|
+
---
|
|
11
12
|
## Example
|
|
12
13
|
|
|
13
14
|
```tsx
|
|
14
|
-
<HiddenField
|
|
15
|
-
name="tenantId"
|
|
16
|
-
control={form.control}
|
|
17
|
-
defaultValue={tenantId}
|
|
18
|
-
/>
|
|
15
|
+
<HiddenField controller={{ name: 'id' }} />
|
|
19
16
|
```
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: IndexColumn
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/IndexColumn'
|
|
5
|
+
whenToUse: Returns a PrimeReact Column that renders the row's 1-based visual index; call as IndexColumn(colProps).
|
|
6
|
+
baseLibrary: primereact/column
|
|
7
|
+
relatedComponents: [PaginatedTable]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: props, type: ColumnProps, required: false }
|
|
11
|
+
---
|
|
9
12
|
## Example
|
|
10
13
|
|
|
11
14
|
```tsx
|
|
12
|
-
|
|
15
|
+
{IndexColumn({ style: { width: '50px' } })}
|
|
13
16
|
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LineChart
|
|
3
|
+
category: charts
|
|
4
|
+
import: '@mantis-core/ui/components/charts/LineChart'
|
|
5
|
+
whenToUse: Time-series or trend data rendered as a line chart. Zero-config defaults with full options override.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: [BarChart, DonutChart]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: labels, type: 'string[]', required: true }
|
|
11
|
+
- { name: datasets, type: 'LineChartDataset[]', required: true, description: 'Array of ChartDataset<''line''> minus ''data'' field, which is number[]' }
|
|
12
|
+
- { name: options, type: 'ChartOptions<''line''>', required: false, description: Deep-merged over defaults }
|
|
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
|
+
<LineChart labels={['Jan','Feb','Mar']} datasets={[{ label: 'Revenue', data: [100,200,150] }]} height={250} />
|
|
21
|
+
```
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: Loading
|
|
3
|
+
category: feedback
|
|
4
|
+
import: '@mantis-core/ui/components/Loaders/Loading'
|
|
5
|
+
whenToUse: 'Full-screen loading overlay with animated spinner; renders children when loading=false.'
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: loading, type: boolean, required: false, default: 'false' }
|
|
10
|
+
- { name: texto, type: string, required: false, default: '''Cargando...''' }
|
|
11
|
+
- { name: className, type: string, required: false }
|
|
12
|
+
- { name: children, type: ReactNode, required: false }
|
|
13
|
+
---
|
|
10
14
|
## Example
|
|
11
15
|
|
|
12
16
|
```tsx
|
|
13
|
-
<Loading loading={
|
|
14
|
-
<FormScreen />
|
|
15
|
-
</Loading>
|
|
17
|
+
<Loading loading={isLoading}><PageContent /></Loading>
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
## Notes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LoginForm
|
|
3
|
+
category: auth
|
|
4
|
+
import: '@mantis-core/ui/components/auth/LoginForm'
|
|
5
|
+
whenToUse: Self-contained login form with email/username + password fields; pass onSubmit to wire signIn/Supabase from the app layer.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: onSubmit, type: '(values: LoginFormValues) => void | Promise<void>', required: true }
|
|
10
|
+
- { name: brand, type: ReactNode, required: false }
|
|
11
|
+
- { name: title, type: string, required: false, default: '"Iniciar sesión"' }
|
|
12
|
+
- { name: subtitle, type: string, required: false }
|
|
13
|
+
- { name: footer, type: ReactNode, required: false }
|
|
14
|
+
- { name: identifierField, type: '''email'' | ''username''', required: false, default: '"email"' }
|
|
15
|
+
- { name: submitLabel, type: string, required: false, default: '"Ingresar"' }
|
|
16
|
+
- { name: className, type: string, required: false }
|
|
17
|
+
---
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<LoginForm onSubmit={async (v) => { await signIn('credentials', { email: v.identifier, password: v.password }); }} brand={<Logo />} />
|
|
22
|
+
```
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: MapPickerClient
|
|
3
|
+
category: maps
|
|
4
|
+
import: '@mantis-core/ui/components/Maps/MapPickerClient'
|
|
5
|
+
whenToUse: Client-only Leaflet map that lets the user click to pick a coordinate; controlled via initialLat/initialLng.
|
|
6
|
+
baseLibrary: react-leaflet
|
|
7
|
+
relatedComponents: [MapPicker]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: onLocationSelect, type: '(lat: number, lng: number) => void', required: true, description: 'Callback fired on map click with the selected coordinates' }
|
|
11
|
+
- { name: initialLat, type: 'number | null', required: false, description: 'Initial latitude for the marker and map center' }
|
|
12
|
+
- { name: initialLng, type: 'number | null', required: false, description: 'Initial longitude for the marker and map center' }
|
|
13
|
+
---
|
|
10
14
|
## Example
|
|
11
15
|
|
|
12
16
|
```tsx
|
|
13
|
-
|
|
14
|
-
initialLat={-2.9}
|
|
15
|
-
initialLng={-79.0}
|
|
16
|
-
onLocationSelect={(lat, lng) => console.log(lat, lng)}
|
|
17
|
-
/>
|
|
17
|
+
{/* TODO: add example */}
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Notes
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: MapPickerOSM
|
|
3
|
+
category: maps
|
|
4
|
+
import: '@mantis-core/ui/components/Maps/MapPickerOSM'
|
|
5
|
+
whenToUse: Script-injected Leaflet map (no SSR bundle cost) with click/drag marker and a save-location button.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: [MapPicker]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: initialPosition, type: LatLng, required: false, default: '{ lat: -12.0464, lng: -77.0428 }', description: 'Initial marker and center position' }
|
|
11
|
+
- { name: zoom, type: number, required: false, default: '12', description: 'Initial zoom level' }
|
|
12
|
+
- { name: height, type: string, required: false, default: '''400px''', description: 'CSS height of the map container' }
|
|
13
|
+
- { name: onChange, type: '(pos: LatLng) => void', required: false, description: 'Called on every click or marker drag' }
|
|
14
|
+
- { name: onSave, type: '(pos: LatLng) => void', required: false, description: 'Called when user clicks "Guardar ubicación"' }
|
|
15
|
+
---
|
|
10
16
|
## Example
|
|
11
17
|
|
|
12
18
|
```tsx
|
|
13
|
-
|
|
14
|
-
initialPosition={{ lat: -12.0464, lng: -77.0428 }}
|
|
15
|
-
onChange={(pos) => console.log(pos)}
|
|
16
|
-
onSave={(pos) => saveCoordinates(pos)}
|
|
17
|
-
/>
|
|
19
|
+
{/* TODO: add example */}
|
|
18
20
|
```
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: MapPicker
|
|
3
|
+
category: maps
|
|
4
|
+
import: '@mantis-core/ui/components/Maps/MapPicker'
|
|
5
|
+
whenToUse: Interactive Leaflet map that lets the user click to select a lat/lng coordinate; SSR-safe via next/dynamic.
|
|
6
|
+
baseLibrary: next/dynamic
|
|
7
|
+
relatedComponents: [MapPickerClient, MapPickerOSM]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: onLocationSelect, type: '(lat: number, lng: number) => void', required: true }
|
|
11
|
+
- { name: initialLat, type: 'number | null', required: false }
|
|
12
|
+
- { name: initialLng, type: 'number | null', required: false }
|
|
13
|
+
---
|
|
10
14
|
## Example
|
|
11
15
|
|
|
12
16
|
```tsx
|
|
13
|
-
<MapPicker
|
|
14
|
-
initialLat={-2.9}
|
|
15
|
-
initialLng={-79.0}
|
|
16
|
-
onLocationSelect={(lat, lng) => {
|
|
17
|
-
form.setValue("lat", lat);
|
|
18
|
-
form.setValue("lng", lng);
|
|
19
|
-
}}
|
|
20
|
-
/>
|
|
17
|
+
<MapPicker onLocationSelect={(lat, lng) => setValue('coords', { lat, lng })} initialLat={-3.26} initialLng={-79.28} />
|
|
21
18
|
```
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
1
|
+
---
|
|
2
|
+
name: MenuButton
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/MenuButton'
|
|
5
|
+
whenToUse: Dropdown button with a list of actions; used inside table rows.
|
|
6
|
+
baseLibrary: primereact/tieredmenu
|
|
7
|
+
relatedComponents: [ActionColumn]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: items, type: 'ActionMenuItem[]', required: true }
|
|
11
|
+
- { name: label, type: string, required: false }
|
|
12
|
+
- { name: icon, type: string, required: false }
|
|
13
|
+
---
|
|
12
14
|
## Example
|
|
13
15
|
|
|
14
16
|
```tsx
|
|
15
|
-
<MenuButton
|
|
16
|
-
label="Actions"
|
|
17
|
-
items={[
|
|
18
|
-
{ label: "Edit", icon: "pi pi-pencil", route: "/admin/listings/1" },
|
|
19
|
-
{ label: "Delete", icon: "pi pi-trash", command: () => setOpen(true) },
|
|
20
|
-
]}
|
|
21
|
-
/>
|
|
17
|
+
<MenuButton items={[{ label: 'Edit', command: onEdit }, { label: 'Delete', command: onDelete }]} />
|
|
22
18
|
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Modal
|
|
3
|
+
category: overlays
|
|
4
|
+
import: '@mantis-core/ui/components/overlays/Modal'
|
|
5
|
+
whenToUse: Dialog/modal (PrimeReact Dialog wrapper); dismissable mask and non-draggable by default.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: visible, type: boolean, required: true }
|
|
10
|
+
- { name: onHide, type: '() => void', required: true }
|
|
11
|
+
- { name: header, type: ReactNode, required: false }
|
|
12
|
+
- { name: footer, type: ReactNode, required: false }
|
|
13
|
+
- { name: style, type: CSSProperties, required: false }
|
|
14
|
+
- { name: className, type: string, required: false }
|
|
15
|
+
---
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<Modal visible={showModal} onHide={() => setShowModal(false)} header='Editar propiedad' style={{ width: '40rem' }}><PropertyForm /></Modal>
|
|
20
|
+
```
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: MultiSelectFilter
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/filters/MultiSelectFilter'
|
|
5
|
+
whenToUse: PrimeReact MultiSelect wired for use as a DataTable column filter template.
|
|
6
|
+
baseLibrary: primereact/multiselect
|
|
7
|
+
relatedComponents: [FilterPannel]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: filterProps, type: ColumnFilterElementTemplateOptions, required: true }
|
|
11
|
+
- { name: options, type: 'any[]', required: false }
|
|
12
|
+
- { name: loading, type: boolean, required: false }
|
|
13
|
+
---
|
|
9
14
|
## Example
|
|
10
15
|
|
|
11
16
|
```tsx
|
|
12
|
-
filterElement={(
|
|
13
|
-
<MultiSelectFilter
|
|
14
|
-
filterProps={filterProps}
|
|
15
|
-
options={statusOptions}
|
|
16
|
-
optionLabel="label"
|
|
17
|
-
optionValue="value"
|
|
18
|
-
/>
|
|
19
|
-
)}
|
|
17
|
+
<Column field='status' filterElement={(opts) => <MultiSelectFilter filterProps={opts} options={statusOptions} />} />
|
|
20
18
|
```
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: MultiSelect
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/MultiSelect'
|
|
5
|
+
whenToUse: Multi-value select (PrimeReact) wired to react-hook-form.
|
|
6
|
+
baseLibrary: primereact/multiselect
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
requiredStyles: [scss/inputs.scss]
|
|
9
|
+
relatedComponents: [FormFieldRender, MultiSelectFilter]
|
|
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
|
+
---
|
|
10
18
|
## Example
|
|
11
19
|
|
|
12
20
|
```tsx
|
|
13
|
-
<MultiSelect
|
|
14
|
-
controller={{ name: "tags", control: form.control }}
|
|
15
|
-
block
|
|
16
|
-
options={[
|
|
17
|
-
{ label: "Featured", value: "featured" },
|
|
18
|
-
{ label: "Luxury", value: "luxury" },
|
|
19
|
-
]}
|
|
20
|
-
optionLabel="label"
|
|
21
|
-
optionValue="value"
|
|
22
|
-
/>
|
|
21
|
+
<MultiSelect controller={{ name: 'tags' }} options={tagOptions} optionLabel='name' optionValue='id' block />
|
|
23
22
|
```
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
---
|
|
2
|
+
name: NumberInput
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/NumberInput'
|
|
5
|
+
whenToUse: Numeric input (integer or decimal) wired to react-hook-form.
|
|
6
|
+
baseLibrary: primereact/inputnumber
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
requiredStyles: [scss/inputs.scss]
|
|
9
|
+
relatedComponents: [FormFieldRender]
|
|
10
|
+
relatedNextCore: []
|
|
11
|
+
props:
|
|
12
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
13
|
+
- { name: block, type: boolean, required: false }
|
|
14
|
+
- { name: min, type: number, required: false }
|
|
15
|
+
- { name: max, type: number, required: false }
|
|
16
|
+
---
|
|
11
17
|
## Example
|
|
12
18
|
|
|
13
19
|
```tsx
|
|
14
|
-
<NumberInput
|
|
15
|
-
controller={{ name: "price", control: form.control }}
|
|
16
|
-
block
|
|
17
|
-
mode="currency"
|
|
18
|
-
currency="USD"
|
|
19
|
-
/>
|
|
20
|
+
<NumberInput controller={{ name: 'price', rules: { min: 0 } }} block />
|
|
20
21
|
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: OtpInput
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/OtpInput'
|
|
5
|
+
whenToUse: One-time password input (PrimeReact InputOtp) wired to react-hook-form.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
11
|
+
- { name: length, type: number, required: false, default: '6' }
|
|
12
|
+
- { name: block, type: boolean, required: false }
|
|
13
|
+
---
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
<OtpInput controller={{ name: 'otp', rules: { required: true } }} length={6} />
|
|
18
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PageTabs
|
|
3
|
+
category: navigation
|
|
4
|
+
import: '@mantis-core/ui/components/navigation/PageTabs'
|
|
5
|
+
whenToUse: Tab menu bar for page-level navigation; auto-detects active tab from Next.js pathname when tabs have href.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: tabs, type: '{ label: string; icon?: ReactNode; href?: string; command?: () => void }[]', required: true }
|
|
10
|
+
- { name: activeIndex, type: number, required: false }
|
|
11
|
+
---
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
<PageTabs tabs={[{ label: 'General', href: '/admin/settings' }, { label: 'Seguridad', href: '/admin/settings/security' }]} />
|
|
16
|
+
```
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: PageTitle
|
|
3
|
+
category: pages
|
|
4
|
+
import: '@mantis-core/ui/components/pages/PageTitle'
|
|
5
|
+
whenToUse: Centered display-font heading for public-facing pages.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: children, type: ReactNode, required: true }
|
|
10
|
+
---
|
|
9
11
|
## Example
|
|
10
12
|
|
|
11
13
|
```tsx
|
|
12
|
-
<PageTitle>
|
|
14
|
+
<PageTitle>Propiedades en Venta</PageTitle>
|
|
13
15
|
```
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: PaginatedTable
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/PaginatedTable'
|
|
5
|
+
whenToUse: 'Generic server-side paginated DataTable with built-in index column, action column, and Mantis Core CSS. Wraps PrimeReact DataTable.'
|
|
6
|
+
baseLibrary: primereact/datatable
|
|
7
|
+
requiredStyles: [scss/table.scss]
|
|
8
|
+
relatedComponents: [ActionColumn, IndexColumn, TableToolbar, FilterPannel]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: value, type: TValue, required: true }
|
|
12
|
+
- { name: totalRecords, type: number, required: false }
|
|
13
|
+
- { name: showIndexColumn, type: boolean, required: false, default: 'true' }
|
|
14
|
+
- { name: showActionColumn, type: boolean, required: false, default: 'false' }
|
|
15
|
+
- { name: actionColumnItems, type: '(rowData: TValue[number]) => ActionMenuItem[]', required: false }
|
|
16
|
+
- { name: useMantisCoreStyles, type: boolean, required: false, default: 'true' }
|
|
17
|
+
- { name: lazy, type: boolean, required: false, default: 'true' }
|
|
18
|
+
---
|
|
10
19
|
## Example
|
|
11
20
|
|
|
12
21
|
```tsx
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<PaginatedTable
|
|
16
|
-
value={rows}
|
|
17
|
-
totalRecords={total}
|
|
18
|
-
lazy
|
|
19
|
-
first={first}
|
|
20
|
-
rows={pageSize}
|
|
21
|
-
onPage={onPage}
|
|
22
|
-
showActionColumn
|
|
23
|
-
actionColumnItems={(row) => [
|
|
24
|
-
{ label: "Edit", icon: "pi pi-pencil", route: `/admin/listings/${row.id}` },
|
|
25
|
-
]}
|
|
26
|
-
>
|
|
27
|
-
<Column field="name" header="Name" sortable />
|
|
28
|
-
<Column field="status" header="Status" />
|
|
29
|
-
</PaginatedTable>
|
|
22
|
+
<PaginatedTable value={rows} totalRecords={total} showActionColumn actionColumnItems={(row) => [{ label: 'Edit', command: () => edit(row) }]}><Column field='name' header='Name' /></PaginatedTable>
|
|
30
23
|
```
|
|
31
24
|
|
|
32
25
|
## Notes
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: Pagination
|
|
3
|
+
category: feedback
|
|
4
|
+
import: '@mantis-core/ui/components/ui/Pagination'
|
|
5
|
+
whenToUse: Standalone pagination control; use when not relying on PaginatedTable's built-in paginator.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: [PaginationInfo, PageSizeSelector]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: totalRecords, type: number, required: true }
|
|
11
|
+
- { name: pageSize, type: number, required: true }
|
|
12
|
+
- { name: currentPage, type: number, required: true }
|
|
13
|
+
- { name: onPageChange, type: '(page: number) => void', required: true }
|
|
14
|
+
---
|
|
9
15
|
## Example
|
|
10
16
|
|
|
11
17
|
```tsx
|
|
12
|
-
<Pagination
|
|
13
|
-
currentPage={page}
|
|
14
|
-
totalPages={totalPages}
|
|
15
|
-
onPageChange={setPage}
|
|
16
|
-
maxVisible={5}
|
|
17
|
-
/>
|
|
18
|
-
|
|
19
|
-
<PaginationInfo currentPage={page} pageSize={pageSize} totalCount={total} />
|
|
20
|
-
|
|
21
|
-
<PageSizeSelector pageSize={pageSize} onPageSizeChange={setPageSize} />
|
|
18
|
+
<Pagination totalRecords={200} pageSize={20} currentPage={page} onPageChange={setPage} />
|
|
22
19
|
```
|
|
23
20
|
|
|
24
21
|
## Notes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PasswordInput
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/PasswordInput'
|
|
5
|
+
whenToUse: 'Password field with show/hide toggle; Controller pattern, same API as TextInput.'
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
requiredStyles: [scss/inputs.scss]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
12
|
+
- { name: block, type: boolean, required: false }
|
|
13
|
+
- { name: showToggle, type: boolean, required: false, default: 'true' }
|
|
14
|
+
---
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<PasswordInput controller={{ name: 'password', rules: notEmptyRule() }} block />
|
|
19
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PhoneInput
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/PhoneInput'
|
|
5
|
+
whenToUse: Masked phone number input; default mask (999) 999-9999.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
11
|
+
- { name: mask, type: string, required: false, default: '''(999) 999-9999''' }
|
|
12
|
+
- { name: block, type: boolean, required: false }
|
|
13
|
+
---
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
<PhoneInput controller={{ name: 'phone', rules: { required: true } }} block />
|
|
18
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: RadioGroup
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/RadioGroup'
|
|
5
|
+
whenToUse: Renders a set of radio buttons from an options array; value is the selected option's value.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
11
|
+
- { name: options, type: '{ label: string; value: any }[]', required: true }
|
|
12
|
+
- { name: block, type: boolean, required: false }
|
|
13
|
+
- { name: disabled, type: boolean, required: false }
|
|
14
|
+
- { name: className, type: string, required: false }
|
|
15
|
+
---
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<RadioGroup controller={{ name: 'role' }} options={[{ label: 'Admin', value: 'admin' }, { label: 'User', value: 'user' }]} />
|
|
20
|
+
```
|