@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
package/COMPONENTS.md
CHANGED
|
@@ -1,20 +1,120 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- GENERATED by `pnpm gen:catalog` — do not edit. Source: docs/components/*.md -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @mantis-core/ui — Component Index
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
One doc per component under [`docs/components/`](./docs/components). Edit those `.md` files and run `pnpm gen:catalog` to refresh this index.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [Shared contracts](./docs/contracts/controller-props.md)
|
|
9
|
-
- [Underlying library map](./docs/contracts/dependency-map.md)
|
|
10
|
-
- [Style import guide](./docs/contracts/style-imports.md)
|
|
7
|
+
## forms
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
- [AsyncSelect](./docs/components/async-select.md) — Searchable select that loads options asynchronously via loadOptions callback.
|
|
10
|
+
- [CKEditorInput](./docs/components/ckeditor-input.md) — Rich-text WYSIWYG editor (CKEditor 5) wired to react-hook-form; emits HTML string.
|
|
11
|
+
- [ColorPickerInput](./docs/components/color-picker-input.md) — Color picker (PrimeReact ColorPicker, hex format) wired to react-hook-form.
|
|
12
|
+
- [Combobox](./docs/components/combobox.md) — Autocomplete text input (PrimeReact AutoComplete) wired to react-hook-form; pass suggestions via the suggestions prop.
|
|
13
|
+
- [CurrencyInput](./docs/components/currency-input.md) — Numeric input pre-configured for currency display (mode=currency).
|
|
14
|
+
- [DateInput](./docs/components/date-input.md) — Single date picker (PrimeReact Calendar, locale=es, format=dd/mm/yy).
|
|
15
|
+
- [DatePresets](./docs/components/date-presets.md) — Row of preset buttons (Hoy, 7 días, 30 días, Este mes) that fire onChange with a [Date, Date] range; pair with DateRangeInput.
|
|
16
|
+
- [DateRangeInput](./docs/components/date-range-input.md) — Date range picker that stores [startDate, endDate] array; selectionMode is locked to 'range'.
|
|
17
|
+
- [DirtyFormGuard](./docs/components/dirty-form-guard.md) — Blocks navigation when a react-hook-form has unsaved changes; also available as useDirtyFormGuard hook.
|
|
18
|
+
- [DropDown](./docs/components/drop-down.md) — PrimeReact Dropdown (single select with filter) wired to react-hook-form; use when you need PrimeReact styling over react-select.
|
|
19
|
+
- [ErrorMessage](./docs/components/error-message.md) — Displays a validation error string; use standalone when not using FormFieldRender.
|
|
20
|
+
- [FileDropzone](./docs/components/file-dropzone.md) — Drag-and-drop file input with validation (type, size, count); supports react-hook-form mode and plain controlled mode.
|
|
21
|
+
- [FormActionsBar](./docs/components/form-actions-bar.md) — Sticky-capable action bar with primary/secondary buttons and optional left/right slots for form pages.
|
|
22
|
+
- [FormFieldRender](./docs/components/form-field-render.md) — Wrapper that renders a label, the input slot, and a validation error message; use to compose any form control.
|
|
23
|
+
- [FormWizard](./docs/components/form-wizard.md) — Multi-step form navigator with step indicator and per-step validation; must render inside a FormProvider, parent owns the <form onSubmit>.
|
|
24
|
+
- [HiddenField](./docs/components/hidden-field.md) — Registers a hidden value in react-hook-form without rendering any UI.
|
|
25
|
+
- [MultiSelect](./docs/components/multi-select.md) — Multi-value select (PrimeReact) wired to react-hook-form.
|
|
26
|
+
- [NumberInput](./docs/components/number-input.md) — Numeric input (integer or decimal) wired to react-hook-form.
|
|
27
|
+
- [OtpInput](./docs/components/otp-input.md) — One-time password input (PrimeReact InputOtp) wired to react-hook-form.
|
|
28
|
+
- [PasswordInput](./docs/components/password-input.md) — Password field with show/hide toggle; Controller pattern, same API as TextInput.
|
|
29
|
+
- [PhoneInput](./docs/components/phone-input.md) — Masked phone number input; default mask (999) 999-9999.
|
|
30
|
+
- [RadioGroup](./docs/components/radio-group.md) — Renders a set of radio buttons from an options array; value is the selected option's value.
|
|
31
|
+
- [RangeSlider](./docs/components/range-slider.md) — Dual-handle range slider that stores a [min, max] tuple; backed by PrimeReact Slider.
|
|
32
|
+
- [RatingInput](./docs/components/rating-input.md) — Star rating input (PrimeReact Rating) wired to react-hook-form; stores numeric value.
|
|
33
|
+
- [RenderField](./docs/components/render-field.md) — Low-level escape hatch: connects any custom UI to react-hook-form via a render prop.
|
|
34
|
+
- [SearchInput](./docs/components/search-input.md) — Debounced text input that calls onSearch instead of using react-hook-form; ideal for live table/list filtering.
|
|
35
|
+
- [Select](./docs/components/select.md) — Single-value searchable select (react-select); supports creatable mode.
|
|
36
|
+
- [Switch](./docs/components/switch.md) — Toggle/boolean switch wired to react-hook-form.
|
|
37
|
+
- [TagsInput](./docs/components/tags-input.md) — Chip/tags input (PrimeReact Chips) wired to react-hook-form; stores value as string[].
|
|
38
|
+
- [TextArea](./docs/components/text-area.md) — Multi-line text field wired to react-hook-form.
|
|
39
|
+
- [TextInput](./docs/components/text-input.md) — Single-line text field wired to react-hook-form.
|
|
40
|
+
- [TimePicker](./docs/components/time-picker.md) — Time-only picker (15-min intervals) wired to react-hook-form; renders as a styled InputText trigger.
|
|
41
|
+
- [Toggle](./docs/components/toggle.md) — Checkbox-based boolean toggle wired to react-hook-form with configurable on/off labels.
|
|
42
|
+
- [ToggleInlineButton](./docs/components/toggle-inline-button.md) — Segmented button group (single or multi-select) wired to react-hook-form via a controller prop.
|
|
43
|
+
- [UploadFilesPreview](./docs/components/upload-files-preview.md) — Drag-and-drop upload zone with live preview grid, drag-to-reorder, and async upload queue; designed for image galleries.
|
|
13
44
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- [
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
45
|
+
## tables
|
|
46
|
+
|
|
47
|
+
- [ActionColumn](./docs/components/action-column.md) — Factory function that returns a PrimeReact Column with a dropdown action menu; call as ActionColumn(itemsFn, props).
|
|
48
|
+
- [FilterPannel](./docs/components/filter-pannel.md) — Slide-in sidebar filter panel for tables; wraps children in FormProvider and calls onApplyFilter with cleaned form data.
|
|
49
|
+
- [IndexColumn](./docs/components/index-column.md) — Returns a PrimeReact Column that renders the row's 1-based visual index; call as IndexColumn(colProps).
|
|
50
|
+
- [MenuButton](./docs/components/menu-button.md) — Dropdown button with a list of actions; used inside table rows.
|
|
51
|
+
- [MultiSelectFilter](./docs/components/multi-select-filter.md) — PrimeReact MultiSelect wired for use as a DataTable column filter template.
|
|
52
|
+
- [PaginatedTable](./docs/components/paginated-table.md) — Generic server-side paginated DataTable with built-in index column, action column, and Mantis Core CSS. Wraps PrimeReact DataTable.
|
|
53
|
+
- [TableFilterField](./docs/components/table-filter-field.md) — Wraps a form control inside FilterPannel with a label; provides consistent layout.
|
|
54
|
+
- [TableToolbar](./docs/components/table-toolbar.md) — Header bar above a table showing title, record count, and action buttons slot.
|
|
55
|
+
|
|
56
|
+
## pages
|
|
57
|
+
|
|
58
|
+
- [AdminPageConfigurator](./docs/components/admin-page-configurator.md) — Sets the page title, description, and breadcrumbs in the admin layout shell via context; wrap each page's content with this.
|
|
59
|
+
- [AdminPageHeader](./docs/components/admin-page-header.md) — Gradient page header with title, optional description, breadcrumbs, and right-side actions slot; rendered by AdminPageLayoutShell — avoid rendering directly inside feature views.
|
|
60
|
+
- [AdminPageLayout](./docs/components/admin-page-layout.md) — Overview of the admin page layout system — Provider, Configurator, and Shell exports that together compose admin pages.
|
|
61
|
+
- [AdminPageLayoutShell](./docs/components/admin-page-layout-shell.md) — Root layout shell for admin pages; renders AdminPageHeader from context set by AdminPageConfigurator and provides the layout grid.
|
|
62
|
+
- [AppShell](./docs/components/app-shell.md) — Full-page app shell with responsive sidebar nav, topbar, and mobile drawer; use as the root layout wrapper for authenticated pages.
|
|
63
|
+
- [Breadcrumbs](./docs/components/breadcrumbs.md) — Standalone breadcrumb nav; renders nothing when items is empty.
|
|
64
|
+
- [FormSection](./docs/components/form-section.md) — Bordered card section with a header (title + description + icon) and a padded body; groups related form fields.
|
|
65
|
+
- [PageTitle](./docs/components/page-title.md) — Centered display-font heading for public-facing pages.
|
|
66
|
+
|
|
67
|
+
## maps
|
|
68
|
+
|
|
69
|
+
- [MapPicker](./docs/components/map-picker.md) — Interactive Leaflet map that lets the user click to select a lat/lng coordinate; SSR-safe via next/dynamic.
|
|
70
|
+
- [MapPickerClient](./docs/components/map-picker-client.md) — Client-only Leaflet map that lets the user click to pick a coordinate; controlled via initialLat/initialLng.
|
|
71
|
+
- [MapPickerOSM](./docs/components/map-picker-osm.md) — Script-injected Leaflet map (no SSR bundle cost) with click/drag marker and a save-location button.
|
|
72
|
+
|
|
73
|
+
## overlays
|
|
74
|
+
|
|
75
|
+
- [Drawer](./docs/components/drawer.md) — Slide-in side panel (PrimeReact Sidebar wrapper); defaults to right position.
|
|
76
|
+
- [Modal](./docs/components/modal.md) — Dialog/modal (PrimeReact Dialog wrapper); dismissable mask and non-draggable by default.
|
|
77
|
+
|
|
78
|
+
## navigation
|
|
79
|
+
|
|
80
|
+
- [CommandPalette](./docs/components/command-palette.md) — Keyboard-driven command search overlay (Ctrl+K); pair with useCommandPalette hook to wire the shortcut.
|
|
81
|
+
- [PageTabs](./docs/components/page-tabs.md) — Tab menu bar for page-level navigation; auto-detects active tab from Next.js pathname when tabs have href.
|
|
82
|
+
|
|
83
|
+
## data
|
|
84
|
+
|
|
85
|
+
- [DescriptionList](./docs/components/description-list.md) — Grid-based label/value list for detail views; supports 1, 2, or 3 columns.
|
|
86
|
+
- [StatCard](./docs/components/stat-card.md) — KPI card showing a metric label, large value, optional icon, trend indicator, and footer.
|
|
87
|
+
- [Timeline](./docs/components/timeline.md) — Vertical event timeline backed by PrimeReact Timeline; items render title, description, date, and optional icon.
|
|
88
|
+
|
|
89
|
+
## feedback
|
|
90
|
+
|
|
91
|
+
- [Avatar](./docs/components/avatar.md) — User avatar that auto-generates initials from a name when no image is supplied; wraps PrimeReact Avatar.
|
|
92
|
+
- [CardSkeleton](./docs/components/card-skeleton.md) — Animated skeleton for card grid layouts while data loads.
|
|
93
|
+
- [ConfirmDialog](./docs/components/confirm-dialog.md) — Modal confirmation dialog with confirm/cancel buttons and severity-aware styling.
|
|
94
|
+
- [DataState](./docs/components/data-state.md) — Full-area empty/error/loading state placeholder for data-fetching views.
|
|
95
|
+
- [EmptyState](./docs/components/empty-state.md) — Centered empty-state placeholder with icon, title, optional description, and action button.
|
|
96
|
+
- [ErrorBoundary](./docs/components/error-boundary.md) — React error boundary; renders fallback UI on uncaught errors; fallback can be a ReactNode or render function.
|
|
97
|
+
- [Loading](./docs/components/loading.md) — Full-screen loading overlay with animated spinner; renders children when loading=false.
|
|
98
|
+
- [Pagination](./docs/components/pagination.md) — Standalone pagination control; use when not relying on PaginatedTable's built-in paginator.
|
|
99
|
+
- [RichTextPreview](./docs/components/rich-text-preview.md) — Safely renders a CKEditor HTML string with correct CKEditor content styles.
|
|
100
|
+
- [StatusBadge](./docs/components/status-badge.md) — Colored pill badge to communicate a status or label with semantic tone.
|
|
101
|
+
- [TableSkeleton](./docs/components/table-skeleton.md) — Animated skeleton placeholder that mimics a table grid while data loads.
|
|
102
|
+
- [Tag](./docs/components/tag.md) — Styled label chip (PrimeReact Tag wrapper with Mantis Core CSS); use for status labels, categories, or counts.
|
|
103
|
+
|
|
104
|
+
## auth
|
|
105
|
+
|
|
106
|
+
- [ChangePasswordForm](./docs/components/change-password-form.md) — Current + new + confirm password form for authenticated users.
|
|
107
|
+
- [ForgotPasswordForm](./docs/components/forgot-password-form.md) — Email-only form to trigger password reset; caller owns the reset logic.
|
|
108
|
+
- [LoginForm](./docs/components/login-form.md) — Self-contained login form with email/username + password fields; pass onSubmit to wire signIn/Supabase from the app layer.
|
|
109
|
+
- [ResetPasswordForm](./docs/components/reset-password-form.md) — New password + confirm form; caller owns token validation and API call.
|
|
110
|
+
- [UserMenu](./docs/components/user-menu.md) — Topbar user avatar + dropdown with custom nav items and sign-out; no auth lib coupling.
|
|
111
|
+
|
|
112
|
+
## buttons
|
|
113
|
+
|
|
114
|
+
- [Button](./docs/components/button.md) — Primary action button; wraps PrimeReact Button with Mantis Core variant tokens and optional Next.js href navigation.
|
|
115
|
+
|
|
116
|
+
## charts
|
|
117
|
+
|
|
118
|
+
- [BarChart](./docs/components/bar-chart.md) — Categorical comparisons rendered as a bar chart. Same prop shape as LineChart.
|
|
119
|
+
- [DonutChart](./docs/components/donut-chart.md) — Part-to-whole breakdown rendered as a doughnut chart.
|
|
120
|
+
- [LineChart](./docs/components/line-chart.md) — Time-series or trend data rendered as a line chart. Zero-config defaults with full options override.
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: ActionColumn
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/ActionColumn'
|
|
5
|
+
whenToUse: 'Factory function that returns a PrimeReact Column with a dropdown action menu; call as ActionColumn(itemsFn, props).'
|
|
6
|
+
baseLibrary: primereact/column
|
|
7
|
+
relatedComponents: [PaginatedTable, MenuButton]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: items, type: '(rowData: TRow) => ActionMenuItem[]', required: true }
|
|
11
|
+
- { name: label, type: string, required: false }
|
|
12
|
+
- { name: icon, type: string, required: false }
|
|
13
|
+
---
|
|
10
14
|
## Example
|
|
11
15
|
|
|
12
16
|
```tsx
|
|
13
|
-
{ActionColumn(
|
|
14
|
-
(row) => [{ label: "Open", route: `/admin/items/${row.id}` }],
|
|
15
|
-
{ label: "Actions" },
|
|
16
|
-
)}
|
|
17
|
+
{ActionColumn((row) => [{ label: 'Delete', command: () => del(row.id) }])}
|
|
17
18
|
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: AdminPageConfigurator
|
|
3
|
+
category: pages
|
|
4
|
+
import: '@mantis-core/ui/components/pages/admin-layout/AdminPageConfigurator'
|
|
5
|
+
whenToUse: Sets the page title, description, and breadcrumbs in the admin layout shell via context; wrap each page's content with this.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: ['AdminPageLayoutShell', 'AdminPageHeader']
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: config, type: AdminPageLayoutConfig, required: true }
|
|
12
|
+
- { name: children, type: ReactNode, required: true }
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<AdminPageConfigurator config={{ title: 'Properties', description: 'Manage listings', breadcrumbs: [{ label: 'Home', href: '/' }, { label: 'Properties' }] }}><PropertiesView /></AdminPageConfigurator>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Notes
|
|
22
|
+
|
|
23
|
+
- Pairs with [AdminPageLayoutShell](./admin-page-layout-shell.md), which reads the config from context and renders the header. See [admin-page-layout.md](./admin-page-layout.md) for the overview.
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: AdminPageHeader
|
|
3
|
+
category: pages
|
|
4
|
+
import: '@mantis-core/ui/components/pages/AdminPageHeader'
|
|
5
|
+
whenToUse: 'Gradient page header with title, optional description, breadcrumbs, and right-side actions slot; rendered by AdminPageLayoutShell — avoid rendering directly inside feature views.'
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: [AdminPageLayoutShell]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: title, type: string, required: true }
|
|
11
|
+
- { name: description, type: string, required: false }
|
|
12
|
+
- { name: actions, type: ReactNode, required: false }
|
|
13
|
+
- { name: breadcrumbs, type: 'readonly AdminBreadcrumbItem[]', required: false }
|
|
14
|
+
---
|
|
9
15
|
## Example
|
|
10
16
|
|
|
11
17
|
```tsx
|
|
12
|
-
<AdminPageHeader
|
|
13
|
-
title="Clients"
|
|
14
|
-
description="Manage B2B accounts"
|
|
15
|
-
breadcrumbs={[
|
|
16
|
-
{ label: "Dashboard", href: "/admin" },
|
|
17
|
-
{ label: "Clients" },
|
|
18
|
-
]}
|
|
19
|
-
actions={<Button label="New client" icon="pi pi-plus" />}
|
|
20
|
-
/>
|
|
18
|
+
<AdminPageHeader title='Blog' description='Manage posts' actions={<Button label='New Post' onClick={onCreate} />} />
|
|
21
19
|
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: AdminPageLayoutShell
|
|
3
|
+
category: pages
|
|
4
|
+
import: '@mantis-core/ui/components/pages/admin-layout/AdminPageLayoutShell'
|
|
5
|
+
whenToUse: Root layout shell for admin pages; renders AdminPageHeader from context set by AdminPageConfigurator and provides the layout grid.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: ['AdminPageConfigurator', 'AdminPageHeader']
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: children, type: ReactNode, required: true }
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
<AdminPageLayoutShell>{children}</AdminPageLayoutShell>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Notes
|
|
21
|
+
|
|
22
|
+
- Reads page config from the context set by [AdminPageConfigurator](./admin-page-configurator.md). See [admin-page-layout.md](./admin-page-layout.md) for the overview.
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- `AdminPageLayoutConfig`
|
|
10
|
-
- Import: `import { AdminPageLayoutProvider, AdminPageConfigurator, AdminPageLayoutShell } from "@mantis-core/ui";`
|
|
11
|
-
- Base library: React context + custom shell
|
|
12
|
-
- Required styles: none
|
|
13
|
-
|
|
1
|
+
---
|
|
2
|
+
name: AdminPageLayout
|
|
3
|
+
category: pages
|
|
4
|
+
whenToUse: Overview of the admin page layout system — Provider, Configurator, and Shell exports that together compose admin pages.
|
|
5
|
+
baseLibrary: React context + custom shell
|
|
6
|
+
relatedNextCore: []
|
|
7
|
+
props: []
|
|
8
|
+
---
|
|
14
9
|
## Example
|
|
15
10
|
|
|
16
11
|
```tsx
|
|
17
|
-
|
|
18
|
-
<AdminPageLayoutShell>
|
|
19
|
-
<AdminPageConfigurator config={{ title: "Leads" }}>
|
|
20
|
-
<LeadsTable />
|
|
21
|
-
</AdminPageConfigurator>
|
|
22
|
-
</AdminPageLayoutShell>
|
|
23
|
-
</AdminPageLayoutProvider>
|
|
12
|
+
{/* TODO: add example */}
|
|
24
13
|
```
|
|
25
14
|
|
|
26
15
|
## Notes
|
|
27
16
|
|
|
17
|
+
> Overview doc — individual exports are documented in their own entries.
|
|
18
|
+
|
|
28
19
|
- `useAdminPageLayout` must run inside `AdminPageLayoutProvider`.
|
|
29
20
|
- `AdminPageLayoutShell` renders `AdminPageHeader` when `config.title` exists and `hideHeader` is not set.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: AppShell
|
|
3
|
+
category: pages
|
|
4
|
+
import: '@mantis-core/ui/components/pages/app-shell/AppShell'
|
|
5
|
+
whenToUse: 'Full-page app shell with responsive sidebar nav, topbar, and mobile drawer; use as the root layout wrapper for authenticated pages.'
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: navItems, type: 'AppNavItem[]', required: true }
|
|
10
|
+
- { name: children, type: ReactNode, required: true }
|
|
11
|
+
- { name: brand, type: ReactNode, required: false }
|
|
12
|
+
- { name: topbarActions, type: ReactNode, required: false }
|
|
13
|
+
- { name: user, type: ReactNode, required: false }
|
|
14
|
+
- { name: footer, type: ReactNode, required: false }
|
|
15
|
+
---
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<AppShell navItems={NAV_ITEMS} brand={<Logo />} user={<UserMenu />}>{children}</AppShell>
|
|
20
|
+
```
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
---
|
|
2
|
+
name: AsyncSelect
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/AsyncSelect'
|
|
5
|
+
whenToUse: Searchable select that loads options asynchronously via loadOptions callback.
|
|
6
|
+
baseLibrary: react-select/async
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
requiredStyles: [scss/select.scss]
|
|
9
|
+
relatedComponents: [FormFieldRender, Select]
|
|
10
|
+
relatedNextCore: []
|
|
11
|
+
props:
|
|
12
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
13
|
+
- { name: loadOptions, type: '(inputValue: string) => Promise<OptionsOrGroups>', required: true }
|
|
14
|
+
- { name: isCreatable, type: boolean, required: false, default: 'false' }
|
|
15
|
+
- { name: debounceMs, type: number, required: false, default: '250' }
|
|
16
|
+
- { name: block, type: boolean, required: false }
|
|
17
|
+
---
|
|
11
18
|
## Example
|
|
12
19
|
|
|
13
20
|
```tsx
|
|
14
|
-
<AsyncSelect
|
|
15
|
-
controller={{ name: "city", control: form.control }}
|
|
16
|
-
block
|
|
17
|
-
loadOptions={async (input) => searchCities(input)}
|
|
18
|
-
defaultOptions
|
|
19
|
-
debounceMs={300}
|
|
20
|
-
/>
|
|
21
|
+
<AsyncSelect controller={{ name: 'client' }} loadOptions={searchClients} block />
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
## Notes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Avatar
|
|
3
|
+
category: feedback
|
|
4
|
+
import: '@mantis-core/ui/components/feedback/Avatar'
|
|
5
|
+
whenToUse: User avatar that auto-generates initials from a name when no image is supplied; wraps PrimeReact Avatar.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: name, type: string, required: false }
|
|
10
|
+
- { name: image, type: string, required: false }
|
|
11
|
+
- { name: label, type: string, required: false }
|
|
12
|
+
- { name: size, type: '''normal'' | ''large'' | ''xlarge''', required: false }
|
|
13
|
+
- { name: shape, type: '''square'' | ''circle''', required: false }
|
|
14
|
+
---
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<Avatar name='Diego Condo' size='large' shape='circle' />
|
|
19
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: BarChart
|
|
3
|
+
category: charts
|
|
4
|
+
import: '@mantis-core/ui/components/charts/BarChart'
|
|
5
|
+
whenToUse: Categorical comparisons rendered as a bar chart. Same prop shape as LineChart.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: [LineChart, DonutChart]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: labels, type: 'string[]', required: true }
|
|
11
|
+
- { name: datasets, type: 'BarChartDataset[]', required: true }
|
|
12
|
+
- { name: options, type: 'ChartOptions<''bar''>', 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
|
+
<BarChart labels={['Q1','Q2','Q3']} datasets={[{ label: 'Sales', data: [40,70,55] }]} />
|
|
21
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Breadcrumbs
|
|
3
|
+
category: pages
|
|
4
|
+
import: '@mantis-core/ui/components/pages/app-shell/Breadcrumbs'
|
|
5
|
+
whenToUse: Standalone breadcrumb nav; renders nothing when items is empty.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: items, type: 'readonly AdminBreadcrumbItem[]', required: true }
|
|
10
|
+
---
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<Breadcrumbs items={[{ label: 'Home', href: '/' }, { label: 'Settings' }]} />
|
|
15
|
+
```
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: Button
|
|
3
|
+
category: buttons
|
|
4
|
+
import: '@mantis-core/ui/components/Buttons/Button'
|
|
5
|
+
whenToUse: Primary action button; wraps PrimeReact Button with Mantis Core variant tokens and optional Next.js href navigation.
|
|
6
|
+
baseLibrary: primereact/button
|
|
7
|
+
requiredStyles: [scss/buttons.scss]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: variant, type: '''primary'' | ''secondary'' | ''accent'' | ''success'' | ''warning'' | ''error'' | ''info'' | ''gray'' | ''danger''', required: false, default: '''primary''' }
|
|
11
|
+
- { name: label, type: string, required: false }
|
|
12
|
+
- { name: icon, type: string, required: false }
|
|
13
|
+
- { name: href, type: string, required: false }
|
|
14
|
+
- { name: outlined, type: boolean, required: false }
|
|
15
|
+
- { name: block, type: boolean, required: false }
|
|
16
|
+
- { name: text, type: boolean, required: false }
|
|
17
|
+
- { name: loading, type: boolean, required: false }
|
|
18
|
+
- { name: disabled, type: boolean, required: false }
|
|
19
|
+
---
|
|
9
20
|
## Example
|
|
10
21
|
|
|
11
22
|
```tsx
|
|
12
|
-
<Button
|
|
13
|
-
label="Save"
|
|
14
|
-
icon="pi pi-check"
|
|
15
|
-
variant="primary"
|
|
16
|
-
rounded
|
|
17
|
-
onClick={() => console.log("saved")}
|
|
18
|
-
/>
|
|
23
|
+
<Button variant='danger' outlined label='Delete' icon={PrimeIcons.TRASH} onClick={onDelete} />
|
|
19
24
|
```
|
|
20
25
|
|
|
21
26
|
## Notes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: CardSkeleton
|
|
3
|
+
category: feedback
|
|
4
|
+
import: '@mantis-core/ui/components/feedback/CardSkeleton'
|
|
5
|
+
whenToUse: Animated skeleton for card grid layouts while data loads.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: count, type: number, required: false, default: '3' }
|
|
10
|
+
---
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<CardSkeleton count={6} />
|
|
15
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ChangePasswordForm
|
|
3
|
+
category: auth
|
|
4
|
+
import: '@mantis-core/ui/components/auth/ChangePasswordForm'
|
|
5
|
+
whenToUse: Current + new + confirm password form for authenticated users.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: onSubmit, type: '(values: ChangePasswordFormValues) => void | Promise<void>', required: true }
|
|
10
|
+
- { name: minPasswordLength, type: number, required: false, default: '8' }
|
|
11
|
+
- { name: className, type: string, required: false }
|
|
12
|
+
---
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<ChangePasswordForm onSubmit={changePassword} />
|
|
17
|
+
```
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
---
|
|
2
|
+
name: CKEditorInput
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/CKEditorInput'
|
|
5
|
+
whenToUse: Rich-text WYSIWYG editor (CKEditor 5) wired to react-hook-form; emits HTML string.
|
|
6
|
+
baseLibrary: '@ckeditor/ckeditor5-react'
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
requiredStyles: [scss/ckeditor.scss]
|
|
9
|
+
relatedComponents: [FormFieldRender, RichTextPreview]
|
|
10
|
+
relatedNextCore: []
|
|
11
|
+
props:
|
|
12
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
13
|
+
- { name: block, type: boolean, required: false }
|
|
14
|
+
---
|
|
11
15
|
## Example
|
|
12
16
|
|
|
13
17
|
```tsx
|
|
14
|
-
<CKEditorInput
|
|
15
|
-
controller={{ name: "body", control: form.control }}
|
|
16
|
-
minHeight="20rem"
|
|
17
|
-
showStats
|
|
18
|
-
onMetricsChange={(metrics) => console.log(metrics.words)}
|
|
19
|
-
/>
|
|
18
|
+
<CKEditorInput controller={{ name: 'body', rules: { required: true } }} block />
|
|
20
19
|
```
|
|
21
20
|
|
|
22
21
|
## Notes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ColorPickerInput
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/ColorPickerInput'
|
|
5
|
+
whenToUse: 'Color picker (PrimeReact ColorPicker, hex format) wired to react-hook-form.'
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
11
|
+
- { name: format, type: '''hex'' | ''rgb'' | ''hsb''', required: false, default: '''hex''' }
|
|
12
|
+
- { name: inline, type: boolean, required: false }
|
|
13
|
+
- { name: block, type: boolean, required: false }
|
|
14
|
+
---
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<ColorPickerInput controller={{ name: 'brandColor' }} />
|
|
19
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Combobox
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/Combobox'
|
|
5
|
+
whenToUse: Autocomplete text input (PrimeReact AutoComplete) wired to react-hook-form; pass suggestions via the suggestions prop.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: ControllerProps
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: controller, type: ControllerProps, required: true }
|
|
11
|
+
- { name: suggestions, type: 'any[]', required: false }
|
|
12
|
+
- { name: completeMethod, type: '(e: AutoCompleteCompleteEvent) => void', required: false }
|
|
13
|
+
- { name: block, type: boolean, required: false }
|
|
14
|
+
---
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<Combobox controller={{ name: 'city' }} suggestions={cities} completeMethod={searchCities} block />
|
|
19
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: CommandPalette
|
|
3
|
+
category: navigation
|
|
4
|
+
import: '@mantis-core/ui/components/navigation/CommandPalette'
|
|
5
|
+
whenToUse: Keyboard-driven command search overlay (Ctrl+K); pair with useCommandPalette hook to wire the shortcut.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: commands, type: '{ id: string; label: string; icon?: ReactNode; keywords?: string[]; onSelect: () => void }[]', required: true }
|
|
10
|
+
- { name: open, type: boolean, required: false, default: 'false' }
|
|
11
|
+
- { name: onOpenChange, type: '(open: boolean) => void', required: false }
|
|
12
|
+
---
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<CommandPalette commands={cmds} open={paletteOpen} onOpenChange={setPaletteOpen} />
|
|
17
|
+
```
|