@mantis-core/ui 0.5.0 → 0.7.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/CHANGELOG.md +155 -0
- package/COMPONENTS.md +71 -73
- package/README.md +19 -6
- package/bin/mantis-llm.mjs +242 -0
- package/catalog.json +3031 -0
- package/dist/components/Buttons/Button.d.ts +39 -9
- package/dist/components/Buttons/Button.d.ts.map +1 -1
- package/dist/components/Buttons/Button.js +21 -13
- package/dist/components/Buttons/Button.js.map +1 -1
- package/dist/components/Forms/AutoCompleteField.d.ts +60 -0
- package/dist/components/Forms/AutoCompleteField.d.ts.map +1 -0
- package/dist/components/Forms/AutoCompleteField.js +125 -0
- package/dist/components/Forms/AutoCompleteField.js.map +1 -0
- package/dist/components/Forms/CKEditorInput.d.ts +5 -2
- package/dist/components/Forms/CKEditorInput.d.ts.map +1 -1
- package/dist/components/Forms/CKEditorInput.js +5 -2
- package/dist/components/Forms/CKEditorInput.js.map +1 -1
- package/dist/components/Forms/CheckboxField.d.ts +14 -0
- package/dist/components/Forms/CheckboxField.d.ts.map +1 -0
- package/dist/components/Forms/CheckboxField.js +26 -0
- package/dist/components/Forms/CheckboxField.js.map +1 -0
- package/dist/components/Forms/ColorPickerInput.d.ts +27 -8
- package/dist/components/Forms/ColorPickerInput.d.ts.map +1 -1
- package/dist/components/Forms/ColorPickerInput.js +57 -11
- package/dist/components/Forms/ColorPickerInput.js.map +1 -1
- package/dist/components/Forms/DateField.d.ts +68 -0
- package/dist/components/Forms/DateField.d.ts.map +1 -0
- package/dist/components/Forms/DateField.js +108 -0
- package/dist/components/Forms/DateField.js.map +1 -0
- package/dist/components/Forms/DatePresets.d.ts.map +1 -1
- package/dist/components/Forms/DatePresets.js +6 -3
- package/dist/components/Forms/DatePresets.js.map +1 -1
- package/dist/components/Forms/FieldShell.d.ts +24 -0
- package/dist/components/Forms/FieldShell.d.ts.map +1 -0
- package/dist/components/Forms/FieldShell.js +39 -0
- package/dist/components/Forms/FieldShell.js.map +1 -0
- package/dist/components/Forms/FileDropzone.d.ts +4 -2
- package/dist/components/Forms/FileDropzone.d.ts.map +1 -1
- package/dist/components/Forms/FileDropzone.js.map +1 -1
- package/dist/components/Forms/FormActionsBar.js +2 -2
- package/dist/components/Forms/FormActionsBar.js.map +1 -1
- package/dist/components/Forms/FormWizard.d.ts +1 -1
- package/dist/components/Forms/FormWizard.d.ts.map +1 -1
- package/dist/components/Forms/FormWizard.js +4 -5
- package/dist/components/Forms/FormWizard.js.map +1 -1
- package/dist/components/Forms/HiddenField.d.ts +12 -6
- package/dist/components/Forms/HiddenField.d.ts.map +1 -1
- package/dist/components/Forms/HiddenField.js +14 -5
- package/dist/components/Forms/HiddenField.js.map +1 -1
- package/dist/components/Forms/MaskField.d.ts +28 -0
- package/dist/components/Forms/MaskField.d.ts.map +1 -0
- package/dist/components/Forms/MaskField.js +74 -0
- package/dist/components/Forms/MaskField.js.map +1 -0
- package/dist/components/Forms/NumberField.d.ts +14 -0
- package/dist/components/Forms/NumberField.d.ts.map +1 -0
- package/dist/components/Forms/NumberField.js +51 -0
- package/dist/components/Forms/NumberField.js.map +1 -0
- package/dist/components/Forms/OtpInput.d.ts +23 -8
- package/dist/components/Forms/OtpInput.d.ts.map +1 -1
- package/dist/components/Forms/OtpInput.js +37 -8
- package/dist/components/Forms/OtpInput.js.map +1 -1
- package/dist/components/Forms/PasswordInput.d.ts +22 -9
- package/dist/components/Forms/PasswordInput.d.ts.map +1 -1
- package/dist/components/Forms/PasswordInput.js +63 -28
- package/dist/components/Forms/PasswordInput.js.map +1 -1
- package/dist/components/Forms/PhoneInput.d.ts +16 -8
- package/dist/components/Forms/PhoneInput.d.ts.map +1 -1
- package/dist/components/Forms/PhoneInput.js +13 -6
- package/dist/components/Forms/PhoneInput.js.map +1 -1
- package/dist/components/Forms/RadioGroup.d.ts +34 -13
- package/dist/components/Forms/RadioGroup.d.ts.map +1 -1
- package/dist/components/Forms/RadioGroup.js +49 -6
- package/dist/components/Forms/RadioGroup.js.map +1 -1
- package/dist/components/Forms/RangeSlider.d.ts +26 -11
- package/dist/components/Forms/RangeSlider.d.ts.map +1 -1
- package/dist/components/Forms/RangeSlider.js +40 -7
- package/dist/components/Forms/RangeSlider.js.map +1 -1
- package/dist/components/Forms/RatingInput.d.ts +24 -8
- package/dist/components/Forms/RatingInput.d.ts.map +1 -1
- package/dist/components/Forms/RatingInput.js +41 -9
- package/dist/components/Forms/RatingInput.js.map +1 -1
- package/dist/components/Forms/SearchInput.d.ts +18 -10
- package/dist/components/Forms/SearchInput.d.ts.map +1 -1
- package/dist/components/Forms/SearchInput.js +44 -23
- package/dist/components/Forms/SearchInput.js.map +1 -1
- package/dist/components/Forms/SelectField.d.ts +41 -0
- package/dist/components/Forms/SelectField.d.ts.map +1 -0
- package/dist/components/Forms/SelectField.js +110 -0
- package/dist/components/Forms/SelectField.js.map +1 -0
- package/dist/components/Forms/SwitchField.d.ts +14 -0
- package/dist/components/Forms/SwitchField.d.ts.map +1 -0
- package/dist/components/Forms/SwitchField.js +26 -0
- package/dist/components/Forms/SwitchField.js.map +1 -0
- package/dist/components/Forms/TagsInput.d.ts +29 -8
- package/dist/components/Forms/TagsInput.d.ts.map +1 -1
- package/dist/components/Forms/TagsInput.js +53 -9
- package/dist/components/Forms/TagsInput.js.map +1 -1
- package/dist/components/Forms/TextArea.d.ts +13 -10
- package/dist/components/Forms/TextArea.d.ts.map +1 -1
- package/dist/components/Forms/TextArea.js +27 -9
- package/dist/components/Forms/TextArea.js.map +1 -1
- package/dist/components/Forms/TextField.d.ts +14 -0
- package/dist/components/Forms/TextField.d.ts.map +1 -0
- package/dist/components/Forms/TextField.js +29 -0
- package/dist/components/Forms/TextField.js.map +1 -0
- package/dist/components/Forms/ToggleInlineButton.d.ts +33 -12
- package/dist/components/Forms/ToggleInlineButton.d.ts.map +1 -1
- package/dist/components/Forms/ToggleInlineButton.js +56 -6
- package/dist/components/Forms/ToggleInlineButton.js.map +1 -1
- package/dist/components/Forms/UploadFilesPreview.js +3 -3
- package/dist/components/Forms/UploadFilesPreview.js.map +1 -1
- package/dist/components/Forms/field-typing.test-d.d.ts +2 -0
- package/dist/components/Forms/field-typing.test-d.d.ts.map +1 -0
- package/dist/components/Forms/field-typing.test-d.js +24 -0
- package/dist/components/Forms/field-typing.test-d.js.map +1 -0
- package/dist/components/Forms/useFieldController.d.ts +85 -0
- package/dist/components/Forms/useFieldController.d.ts.map +1 -0
- package/dist/components/Forms/useFieldController.js +54 -0
- package/dist/components/Forms/useFieldController.js.map +1 -0
- package/dist/components/Loaders/Loading.d.ts.map +1 -1
- package/dist/components/Loaders/Loading.js +3 -2
- package/dist/components/Loaders/Loading.js.map +1 -1
- package/dist/components/Tables/ActionColumn.d.ts +20 -4
- package/dist/components/Tables/ActionColumn.d.ts.map +1 -1
- package/dist/components/Tables/ActionColumn.js +24 -5
- package/dist/components/Tables/ActionColumn.js.map +1 -1
- package/dist/components/Tables/FilterPannel.d.ts +9 -2
- package/dist/components/Tables/FilterPannel.d.ts.map +1 -1
- package/dist/components/Tables/FilterPannel.js +15 -11
- package/dist/components/Tables/FilterPannel.js.map +1 -1
- package/dist/components/Tables/IndexColumn.d.ts +12 -3
- package/dist/components/Tables/IndexColumn.d.ts.map +1 -1
- package/dist/components/Tables/IndexColumn.js +21 -5
- package/dist/components/Tables/IndexColumn.js.map +1 -1
- package/dist/components/Tables/MantisDataTable.d.ts +45 -0
- package/dist/components/Tables/MantisDataTable.d.ts.map +1 -0
- package/dist/components/Tables/MantisDataTable.js +63 -0
- package/dist/components/Tables/MantisDataTable.js.map +1 -0
- package/dist/components/Tables/MenuButton.d.ts +28 -7
- package/dist/components/Tables/MenuButton.d.ts.map +1 -1
- package/dist/components/Tables/MenuButton.js +20 -10
- package/dist/components/Tables/MenuButton.js.map +1 -1
- package/dist/components/Tables/PaginatedTable.d.ts +26 -17
- package/dist/components/Tables/PaginatedTable.d.ts.map +1 -1
- package/dist/components/Tables/PaginatedTable.js +24 -22
- package/dist/components/Tables/PaginatedTable.js.map +1 -1
- package/dist/components/Tables/cell-presets.d.ts +35 -0
- package/dist/components/Tables/cell-presets.d.ts.map +1 -0
- package/dist/components/Tables/cell-presets.js +40 -0
- package/dist/components/Tables/cell-presets.js.map +1 -0
- package/dist/components/Tables/columns.d.ts +40 -0
- package/dist/components/Tables/columns.d.ts.map +1 -0
- package/dist/components/Tables/columns.js +2 -0
- package/dist/components/Tables/columns.js.map +1 -0
- package/dist/components/Tables/filters/MultiSelectFilter.d.ts +24 -6
- package/dist/components/Tables/filters/MultiSelectFilter.d.ts.map +1 -1
- package/dist/components/Tables/filters/MultiSelectFilter.js +19 -6
- package/dist/components/Tables/filters/MultiSelectFilter.js.map +1 -1
- package/dist/components/auth/ChangePasswordForm.d.ts.map +1 -1
- package/dist/components/auth/ChangePasswordForm.js +12 -12
- package/dist/components/auth/ChangePasswordForm.js.map +1 -1
- package/dist/components/auth/ForgotPasswordForm.d.ts.map +1 -1
- package/dist/components/auth/ForgotPasswordForm.js +7 -5
- package/dist/components/auth/ForgotPasswordForm.js.map +1 -1
- package/dist/components/auth/LoginForm.d.ts +2 -2
- package/dist/components/auth/LoginForm.d.ts.map +1 -1
- package/dist/components/auth/LoginForm.js +15 -15
- package/dist/components/auth/LoginForm.js.map +1 -1
- package/dist/components/auth/ResetPasswordForm.d.ts.map +1 -1
- package/dist/components/auth/ResetPasswordForm.js +11 -12
- package/dist/components/auth/ResetPasswordForm.js.map +1 -1
- package/dist/components/auth/UserMenu.d.ts +11 -1
- package/dist/components/auth/UserMenu.d.ts.map +1 -1
- package/dist/components/auth/UserMenu.js +30 -87
- package/dist/components/auth/UserMenu.js.map +1 -1
- package/dist/components/data/Timeline.d.ts +2 -2
- package/dist/components/data/Timeline.d.ts.map +1 -1
- package/dist/components/data/Timeline.js +17 -17
- package/dist/components/data/Timeline.js.map +1 -1
- package/dist/components/feedback/Avatar.d.ts +4 -2
- package/dist/components/feedback/Avatar.d.ts.map +1 -1
- package/dist/components/feedback/Avatar.js +4 -4
- package/dist/components/feedback/Avatar.js.map +1 -1
- package/dist/components/feedback/CardSkeleton.d.ts.map +1 -1
- package/dist/components/feedback/CardSkeleton.js +3 -3
- package/dist/components/feedback/CardSkeleton.js.map +1 -1
- package/dist/components/feedback/TableSkeleton.d.ts.map +1 -1
- package/dist/components/feedback/TableSkeleton.js +3 -3
- package/dist/components/feedback/TableSkeleton.js.map +1 -1
- package/dist/components/feedback/Tag.d.ts +4 -2
- package/dist/components/feedback/Tag.d.ts.map +1 -1
- package/dist/components/feedback/Tag.js +4 -4
- package/dist/components/feedback/Tag.js.map +1 -1
- package/dist/components/navigation/CommandPalette.d.ts.map +1 -1
- package/dist/components/navigation/CommandPalette.js +5 -2
- package/dist/components/navigation/CommandPalette.js.map +1 -1
- package/dist/components/navigation/PageTabs.d.ts +10 -8
- package/dist/components/navigation/PageTabs.d.ts.map +1 -1
- package/dist/components/navigation/PageTabs.js +17 -13
- package/dist/components/navigation/PageTabs.js.map +1 -1
- package/dist/components/overlays/Drawer.d.ts +16 -3
- package/dist/components/overlays/Drawer.d.ts.map +1 -1
- package/dist/components/overlays/Drawer.js +9 -5
- package/dist/components/overlays/Drawer.js.map +1 -1
- package/dist/components/overlays/Modal.d.ts +18 -3
- package/dist/components/overlays/Modal.d.ts.map +1 -1
- package/dist/components/overlays/Modal.js +13 -5
- package/dist/components/overlays/Modal.js.map +1 -1
- package/dist/components/pages/app-shell/AppShell.d.ts.map +1 -1
- package/dist/components/pages/app-shell/AppShell.js +6 -6
- package/dist/components/pages/app-shell/AppShell.js.map +1 -1
- package/dist/components/ui/ConfirmDialog.d.ts +1 -2
- package/dist/components/ui/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ui/ConfirmDialog.js +10 -4
- package/dist/components/ui/ConfirmDialog.js.map +1 -1
- package/dist/components/ui/DataState.js +2 -2
- package/dist/components/ui/DataState.js.map +1 -1
- package/dist/index.d.ts +71 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +114 -22
- package/dist/index.js.map +1 -1
- package/docs/README.md +1 -1
- package/docs/components/action-column.md +33 -7
- package/docs/components/admin-page-configurator.md +24 -5
- package/docs/components/admin-page-header.md +21 -3
- package/docs/components/admin-page-layout-shell.md +18 -4
- package/docs/components/admin-page-layout.md +34 -5
- package/docs/components/app-shell.md +31 -6
- package/docs/components/auto-complete-field.md +60 -0
- package/docs/components/avatar.md +18 -8
- package/docs/components/bar-chart.md +25 -7
- package/docs/components/breadcrumbs.md +15 -2
- package/docs/components/button.md +34 -15
- package/docs/components/card-skeleton.md +9 -3
- package/docs/components/change-password-form.md +23 -4
- package/docs/components/checkbox-field.md +38 -0
- package/docs/components/ckeditor-input.md +40 -8
- package/docs/components/color-picker-input.md +19 -8
- package/docs/components/command-palette.md +23 -2
- package/docs/components/confirm-dialog.md +36 -9
- package/docs/components/data-state.md +31 -6
- package/docs/components/date-field.md +39 -0
- package/docs/components/date-presets.md +19 -5
- package/docs/components/description-list.md +20 -2
- package/docs/components/dirty-form-guard.md +16 -4
- package/docs/components/donut-chart.md +24 -7
- package/docs/components/drawer.md +27 -8
- package/docs/components/empty-state.md +12 -2
- package/docs/components/error-boundary.md +16 -2
- package/docs/components/error-message.md +22 -3
- package/docs/components/field-shell.md +47 -0
- package/docs/components/file-dropzone.md +22 -6
- package/docs/components/filter-pannel.md +34 -7
- package/docs/components/forgot-password-form.md +23 -5
- package/docs/components/form-actions-bar.md +21 -2
- package/docs/components/form-field-render.md +36 -8
- package/docs/components/form-section.md +13 -1
- package/docs/components/form-wizard.md +34 -5
- package/docs/components/hidden-field.md +22 -6
- package/docs/components/index-column.md +25 -5
- package/docs/components/line-chart.md +25 -7
- package/docs/components/loading.md +14 -5
- package/docs/components/login-form.md +31 -6
- package/docs/components/mantis-data-table.md +61 -0
- package/docs/components/map-picker-client.md +29 -8
- package/docs/components/map-picker-osm.md +27 -9
- package/docs/components/map-picker.md +25 -4
- package/docs/components/mask-field.md +31 -0
- package/docs/components/menu-button.md +22 -7
- package/docs/components/modal.md +34 -9
- package/docs/components/multi-select-filter.md +25 -7
- package/docs/components/number-field.md +40 -0
- package/docs/components/otp-input.md +20 -7
- package/docs/components/page-tabs.md +23 -4
- package/docs/components/page-title.md +6 -1
- package/docs/components/paginated-table.md +36 -13
- package/docs/components/pagination.md +20 -7
- package/docs/components/password-input.md +20 -8
- package/docs/components/phone-input.md +17 -7
- package/docs/components/radio-group.md +39 -9
- package/docs/components/range-slider.md +18 -6
- package/docs/components/rating-input.md +19 -8
- package/docs/components/render-field.md +31 -3
- package/docs/components/reset-password-form.md +24 -4
- package/docs/components/rich-text-preview.md +17 -5
- package/docs/components/search-input.md +18 -7
- package/docs/components/select-field.md +55 -0
- package/docs/components/stat-card.md +14 -3
- package/docs/components/status-badge.md +17 -7
- package/docs/components/switch-field.md +32 -0
- package/docs/components/table-filter-field.md +22 -4
- package/docs/components/table-skeleton.md +9 -3
- package/docs/components/table-toolbar.md +18 -5
- package/docs/components/tag.md +16 -7
- package/docs/components/tags-input.md +21 -8
- package/docs/components/text-area.md +18 -8
- package/docs/components/text-field.md +32 -0
- package/docs/components/timeline.md +19 -3
- package/docs/components/toggle-inline-button.md +42 -10
- package/docs/components/upload-files-preview.md +23 -2
- package/docs/components/use-field-controller.md +58 -0
- package/docs/components/user-menu.md +26 -6
- package/docs/contracts/dependency-map.md +50 -52
- package/docs/contracts/field-controller.md +138 -0
- package/docs/contracts/style-imports.md +1 -20
- package/llms.txt +70 -72
- package/package.json +48 -11
- package/dist/components/Forms/AsyncSelect.d.ts +0 -20
- package/dist/components/Forms/AsyncSelect.d.ts.map +0 -1
- package/dist/components/Forms/AsyncSelect.js +0 -77
- package/dist/components/Forms/AsyncSelect.js.map +0 -1
- package/dist/components/Forms/Combobox.d.ts +0 -10
- package/dist/components/Forms/Combobox.d.ts.map +0 -1
- package/dist/components/Forms/Combobox.js +0 -11
- package/dist/components/Forms/Combobox.js.map +0 -1
- package/dist/components/Forms/CurrencyInput.d.ts +0 -12
- package/dist/components/Forms/CurrencyInput.d.ts.map +0 -1
- package/dist/components/Forms/CurrencyInput.js +0 -9
- package/dist/components/Forms/CurrencyInput.js.map +0 -1
- package/dist/components/Forms/DateInput.d.ts +0 -10
- package/dist/components/Forms/DateInput.d.ts.map +0 -1
- package/dist/components/Forms/DateInput.js +0 -11
- package/dist/components/Forms/DateInput.js.map +0 -1
- package/dist/components/Forms/DateRangeInput.d.ts +0 -10
- package/dist/components/Forms/DateRangeInput.d.ts.map +0 -1
- package/dist/components/Forms/DateRangeInput.js +0 -13
- package/dist/components/Forms/DateRangeInput.js.map +0 -1
- package/dist/components/Forms/DropDown.d.ts +0 -10
- package/dist/components/Forms/DropDown.d.ts.map +0 -1
- package/dist/components/Forms/DropDown.js +0 -11
- package/dist/components/Forms/DropDown.js.map +0 -1
- package/dist/components/Forms/MultiSelect.d.ts +0 -10
- package/dist/components/Forms/MultiSelect.d.ts.map +0 -1
- package/dist/components/Forms/MultiSelect.js +0 -13
- package/dist/components/Forms/MultiSelect.js.map +0 -1
- package/dist/components/Forms/NumberInput.d.ts +0 -10
- package/dist/components/Forms/NumberInput.d.ts.map +0 -1
- package/dist/components/Forms/NumberInput.js +0 -16
- package/dist/components/Forms/NumberInput.js.map +0 -1
- package/dist/components/Forms/Select.d.ts +0 -15
- package/dist/components/Forms/Select.d.ts.map +0 -1
- package/dist/components/Forms/Select.js +0 -48
- package/dist/components/Forms/Select.js.map +0 -1
- package/dist/components/Forms/Switch.d.ts +0 -18
- package/dist/components/Forms/Switch.d.ts.map +0 -1
- package/dist/components/Forms/Switch.js +0 -30
- package/dist/components/Forms/Switch.js.map +0 -1
- package/dist/components/Forms/TextInput.d.ts +0 -11
- package/dist/components/Forms/TextInput.d.ts.map +0 -1
- package/dist/components/Forms/TextInput.js +0 -12
- package/dist/components/Forms/TextInput.js.map +0 -1
- package/dist/components/Forms/TimePicker.d.ts +0 -13
- package/dist/components/Forms/TimePicker.d.ts.map +0 -1
- package/dist/components/Forms/TimePicker.js +0 -19
- package/dist/components/Forms/TimePicker.js.map +0 -1
- package/dist/components/Forms/Toggle.d.ts +0 -14
- package/dist/components/Forms/Toggle.d.ts.map +0 -1
- package/dist/components/Forms/Toggle.js +0 -10
- package/dist/components/Forms/Toggle.js.map +0 -1
- package/dist/components/Forms/types.d.ts +0 -9
- package/dist/components/Forms/types.d.ts.map +0 -1
- package/dist/components/Forms/types.js +0 -2
- package/dist/components/Forms/types.js.map +0 -1
- package/docs/components/async-select.md +0 -27
- package/docs/components/combobox.md +0 -19
- package/docs/components/currency-input.md +0 -21
- package/docs/components/date-input.md +0 -21
- package/docs/components/date-range-input.md +0 -20
- package/docs/components/drop-down.md +0 -26
- package/docs/components/multi-select.md +0 -22
- package/docs/components/number-input.md +0 -21
- package/docs/components/select.md +0 -28
- package/docs/components/switch.md +0 -24
- package/docs/components/text-input.md +0 -24
- package/docs/components/time-picker.md +0 -25
- package/docs/components/toggle.md +0 -24
- package/docs/contracts/component-doc-schema.md +0 -78
- package/docs/contracts/controller-props.md +0 -28
|
@@ -2,17 +2,35 @@
|
|
|
2
2
|
name: ForgotPasswordForm
|
|
3
3
|
category: auth
|
|
4
4
|
import: '@mantis-core/ui/components/auth/ForgotPasswordForm'
|
|
5
|
-
whenToUse: Email-only form to trigger password
|
|
5
|
+
whenToUse: Email-only form to trigger a password-reset email; caller owns the actual reset request.
|
|
6
6
|
baseLibrary: custom
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [LoginForm, ResetPasswordForm]
|
|
7
9
|
relatedNextCore: []
|
|
8
10
|
props:
|
|
9
|
-
- { name: onSubmit, type: '(values:
|
|
10
|
-
- { name: title, type: string, required: false }
|
|
11
|
-
- { name:
|
|
11
|
+
- { name: onSubmit, type: '(values: ForgotPasswordFormValues) => void | Promise<void>', required: true, description: 'Receives { email }; form manages isSubmitting via RHF.' }
|
|
12
|
+
- { name: title, type: string, required: false, default: '"Recuperar contraseña"' }
|
|
13
|
+
- { name: subtitle, type: string, required: false }
|
|
14
|
+
- { name: submitLabel, type: string, required: false, default: '"Enviar enlace"' }
|
|
15
|
+
- { name: backSlot, type: ReactNode, required: false, description: 'Rendered below the submit button (e.g. a "back to login" link).' }
|
|
12
16
|
- { name: className, type: string, required: false }
|
|
13
17
|
---
|
|
18
|
+
|
|
14
19
|
## Example
|
|
15
20
|
|
|
16
21
|
```tsx
|
|
17
|
-
|
|
22
|
+
import ForgotPasswordForm from '@mantis-core/ui/components/auth/ForgotPasswordForm';
|
|
23
|
+
import type { ForgotPasswordFormValues } from '@mantis-core/ui/components/auth/ForgotPasswordForm';
|
|
24
|
+
|
|
25
|
+
function Example() {
|
|
26
|
+
const handleSubmit = async ({ email }: ForgotPasswordFormValues) => {
|
|
27
|
+
await fetch('/api/auth/forgot-password', { method: 'POST', body: JSON.stringify({ email }) });
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return <ForgotPasswordForm onSubmit={handleSubmit} />;
|
|
31
|
+
}
|
|
18
32
|
```
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
|
|
36
|
+
- Single `TextField` (email, `emailRule()`), own `useForm<ForgotPasswordFormValues>({ mode: 'onChange' })`.
|
|
@@ -5,7 +5,7 @@ import: '@mantis-core/ui/components/Forms/FormActionsBar'
|
|
|
5
5
|
whenToUse: Sticky-capable action bar with primary/secondary buttons and optional left/right slots for form pages.
|
|
6
6
|
baseLibrary: custom
|
|
7
7
|
requiredStyles: [scss/form-actions.scss]
|
|
8
|
-
relatedComponents: [
|
|
8
|
+
relatedComponents: [FormWizard, DirtyFormGuard]
|
|
9
9
|
relatedNextCore: []
|
|
10
10
|
props:
|
|
11
11
|
- { name: className, type: string, required: false, description: 'Additional CSS class on the root element' }
|
|
@@ -26,8 +26,27 @@ props:
|
|
|
26
26
|
- { name: secondaryDisabled, type: boolean, required: false, default: 'false', description: 'Disable secondary button' }
|
|
27
27
|
- { name: onSecondaryClick, type: '() => void', required: false, description: 'Click handler for secondary button' }
|
|
28
28
|
---
|
|
29
|
+
|
|
29
30
|
## Example
|
|
30
31
|
|
|
31
32
|
```tsx
|
|
32
|
-
|
|
33
|
+
import FormActionsBar from '@mantis-core/ui/components/Forms/FormActionsBar';
|
|
34
|
+
|
|
35
|
+
function Example() {
|
|
36
|
+
return (
|
|
37
|
+
<FormActionsBar
|
|
38
|
+
primaryLabel='Save'
|
|
39
|
+
secondaryLabel='Cancel'
|
|
40
|
+
onPrimaryClick={() => {}}
|
|
41
|
+
onSecondaryClick={() => {}}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
33
45
|
```
|
|
46
|
+
|
|
47
|
+
## Notes
|
|
48
|
+
|
|
49
|
+
- `primaryType` defaults to `submit` — inside a `<form onSubmit={handleSubmit(onSubmit)}>` the
|
|
50
|
+
primary button submits without an explicit `onPrimaryClick`.
|
|
51
|
+
- `secondaryDisabled` is OR-ed with `primaryLoading`, so the secondary action is blocked while the
|
|
52
|
+
primary one is in flight.
|
|
@@ -2,19 +2,47 @@
|
|
|
2
2
|
name: FormFieldRender
|
|
3
3
|
category: forms
|
|
4
4
|
import: '@mantis-core/ui/components/Forms/FormFieldRender'
|
|
5
|
-
whenToUse: '
|
|
5
|
+
whenToUse: 'Composes a label, a render-prop input slot, and an inline ErrorMessage for one field; use to wrap a custom/non-Mantis input with the same label+error layout as the field wrappers.'
|
|
6
6
|
baseLibrary: custom
|
|
7
|
-
relatedComponents: [
|
|
7
|
+
relatedComponents: ['ErrorMessage', 'RenderField']
|
|
8
8
|
relatedNextCore: []
|
|
9
9
|
props:
|
|
10
|
-
- { name:
|
|
11
|
-
- { name:
|
|
12
|
-
- { name:
|
|
13
|
-
- { name:
|
|
14
|
-
- { name:
|
|
10
|
+
- { name: name, type: string, required: true, description: 'RHF field name; forwarded to `render` and to the inline ErrorMessage.' }
|
|
11
|
+
- { name: label, type: 'string | ReactElement', required: true }
|
|
12
|
+
- { name: labelProps, type: 'LabelHTMLAttributes<HTMLLabelElement>', required: false }
|
|
13
|
+
- { name: containerClassName, type: string, required: false }
|
|
14
|
+
- { name: render, type: '({ name }: { name: string }) => ReactElement | ReactNode', required: true, description: 'Renders the actual input; receives `name` to wire to your own Controller/register call.' }
|
|
15
15
|
---
|
|
16
|
+
|
|
16
17
|
## Example
|
|
17
18
|
|
|
18
19
|
```tsx
|
|
19
|
-
|
|
20
|
+
import FormFieldRender from '@mantis-core/ui/components/Forms/FormFieldRender';
|
|
21
|
+
import { Controller, FormProvider, useForm, type FieldValues } from 'react-hook-form';
|
|
22
|
+
|
|
23
|
+
function Example() {
|
|
24
|
+
const methods = useForm<FieldValues>({ defaultValues: { email: '' } });
|
|
25
|
+
return (
|
|
26
|
+
<FormProvider {...methods}>
|
|
27
|
+
<FormFieldRender
|
|
28
|
+
name='email'
|
|
29
|
+
label='Email'
|
|
30
|
+
render={({ name }) => (
|
|
31
|
+
<Controller
|
|
32
|
+
name={name}
|
|
33
|
+
control={methods.control}
|
|
34
|
+
render={({ field }) => <input {...field} id={name} />}
|
|
35
|
+
/>
|
|
36
|
+
)}
|
|
37
|
+
/>
|
|
38
|
+
</FormProvider>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
20
41
|
```
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
- Pre-`FieldControllerProps` composition primitive: `render` gets only `{ name }`, not `control` —
|
|
46
|
+
wire the actual RHF binding yourself (e.g. with `Controller`, or `RenderField`).
|
|
47
|
+
- Renders an `ErrorMessage` internally, which reads react-hook-form via context — this component
|
|
48
|
+
must be used inside a `<FormProvider>`.
|
|
@@ -12,8 +12,20 @@ props:
|
|
|
12
12
|
- { name: children, type: ReactNode, required: true }
|
|
13
13
|
- { name: className, type: string, required: false }
|
|
14
14
|
---
|
|
15
|
+
|
|
15
16
|
## Example
|
|
16
17
|
|
|
17
18
|
```tsx
|
|
18
|
-
|
|
19
|
+
import FormSection from '@mantis-core/ui/components/pages/FormSection';
|
|
20
|
+
import { TextField } from '@mantis-core/ui/components/Forms/TextField';
|
|
21
|
+
import { useForm } from 'react-hook-form';
|
|
22
|
+
|
|
23
|
+
function Example() {
|
|
24
|
+
const { control } = useForm({ defaultValues: { email: '' } });
|
|
25
|
+
return (
|
|
26
|
+
<FormSection title='Contact Info' description='Public contact details'>
|
|
27
|
+
<TextField name='email' control={control} label='Email' />
|
|
28
|
+
</FormSection>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
19
31
|
```
|
|
@@ -2,17 +2,46 @@
|
|
|
2
2
|
name: FormWizard
|
|
3
3
|
category: forms
|
|
4
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:
|
|
5
|
+
whenToUse: 'Multi-step form navigator with a PR11 Stepper step indicator and per-step field validation; must render inside a FormProvider, parent owns the <form onSubmit>.'
|
|
6
|
+
baseLibrary: '@primereact/ui/stepper'
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [FormActionsBar, DirtyFormGuard]
|
|
7
9
|
relatedNextCore: []
|
|
8
10
|
props:
|
|
9
|
-
- { name: steps, type: 'FormWizardStep[]', required: true }
|
|
10
|
-
- { name: onComplete, type: '() => void | Promise<void>', required: false }
|
|
11
|
+
- { name: steps, type: 'FormWizardStep[]', required: true, description: 'Each step: `{ label, fields?: string[], content: ReactNode }`. `fields` are validated (via `trigger`) before advancing.' }
|
|
12
|
+
- { name: onComplete, type: '() => void | Promise<void>', required: false, description: 'Escape hatch for wizard usage outside a <form> element; when set, the final step''s button uses type="button" instead of "submit".' }
|
|
11
13
|
- { name: submitLabel, type: string, required: false, default: '''Finalizar''' }
|
|
12
14
|
- { name: className, type: string, required: false }
|
|
13
15
|
---
|
|
16
|
+
|
|
14
17
|
## Example
|
|
15
18
|
|
|
16
19
|
```tsx
|
|
17
|
-
|
|
20
|
+
import FormWizard from '@mantis-core/ui/components/Forms/FormWizard';
|
|
21
|
+
import { FormProvider, useForm } from 'react-hook-form';
|
|
22
|
+
|
|
23
|
+
function Example() {
|
|
24
|
+
const form = useForm({ defaultValues: { name: '', email: '' } });
|
|
25
|
+
return (
|
|
26
|
+
<FormProvider {...form}>
|
|
27
|
+
<form onSubmit={form.handleSubmit(() => {})}>
|
|
28
|
+
<FormWizard
|
|
29
|
+
steps={[
|
|
30
|
+
{ label: 'Data', fields: ['name', 'email'], content: <div>Step 1</div> },
|
|
31
|
+
{ label: 'Confirm', content: <div>Step 2</div> },
|
|
32
|
+
]}
|
|
33
|
+
submitLabel='Save'
|
|
34
|
+
/>
|
|
35
|
+
</form>
|
|
36
|
+
</FormProvider>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
18
39
|
```
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
- `Stepper.Root` (PR11) is uncontrolled — its `value` only sets the initial step, so the indicator
|
|
44
|
+
is remounted via `key={active}` + `defaultValue={active}` to track the wizard's own step state.
|
|
45
|
+
- Without `onComplete`, the final step's button is `type="submit"` — the surrounding
|
|
46
|
+
`<form onSubmit={handleSubmit(onSubmit)}>` fires with no extra wiring.
|
|
47
|
+
- Steps with no `fields` skip validation entirely on "Siguiente"/next.
|
|
@@ -2,15 +2,31 @@
|
|
|
2
2
|
name: HiddenField
|
|
3
3
|
category: forms
|
|
4
4
|
import: '@mantis-core/ui/components/Forms/HiddenField'
|
|
5
|
-
whenToUse: Registers a
|
|
6
|
-
baseLibrary:
|
|
7
|
-
formContract:
|
|
5
|
+
whenToUse: Registers a react-hook-form value with no visible UI.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: FieldControllerProps
|
|
8
|
+
relatedComponents: ['TextField']
|
|
8
9
|
relatedNextCore: []
|
|
9
|
-
props:
|
|
10
|
-
- { name: controller, type: ControllerProps, required: true }
|
|
10
|
+
props: []
|
|
11
11
|
---
|
|
12
|
+
|
|
12
13
|
## Example
|
|
13
14
|
|
|
14
15
|
```tsx
|
|
15
|
-
|
|
16
|
+
import { HiddenField } from '@mantis-core/ui/components/Forms/HiddenField';
|
|
17
|
+
import { useForm } from 'react-hook-form';
|
|
18
|
+
|
|
19
|
+
function Example() {
|
|
20
|
+
const { control } = useForm({ defaultValues: { id: '' } });
|
|
21
|
+
return <HiddenField name='id' control={control} />;
|
|
22
|
+
}
|
|
16
23
|
```
|
|
24
|
+
|
|
25
|
+
## Notes
|
|
26
|
+
|
|
27
|
+
- Not the full `FieldControllerProps`: only the RHF-binding subset —
|
|
28
|
+
`name | control | rules | defaultValue | shouldUnregister | id` — since there is no visible
|
|
29
|
+
control, so `label`/`labelMode`/`addonBefore`/`variant`/`size`/`fluid`/`required`/`helpText`
|
|
30
|
+
don't apply. Passing them fails to compile, not just render wrong.
|
|
31
|
+
- Renders a real `<input type="hidden">` (mirrors `field.value`) so the value participates in
|
|
32
|
+
native form serialization.
|
|
@@ -2,15 +2,35 @@
|
|
|
2
2
|
name: IndexColumn
|
|
3
3
|
category: tables
|
|
4
4
|
import: '@mantis-core/ui/components/Tables/IndexColumn'
|
|
5
|
-
whenToUse:
|
|
6
|
-
baseLibrary: primereact/
|
|
7
|
-
relatedComponents: [PaginatedTable]
|
|
5
|
+
whenToUse: 'Factory that returns a 1-based row-number `ColumnDef` for MantisDataTable/PaginatedTable''s `columns` array.'
|
|
6
|
+
baseLibrary: '@primereact/ui/datatable'
|
|
7
|
+
relatedComponents: [MantisDataTable, PaginatedTable]
|
|
8
8
|
relatedNextCore: []
|
|
9
9
|
props:
|
|
10
|
-
- { name:
|
|
10
|
+
- { name: overrides, type: 'Partial<ColumnDef<T>>', required: false, description: 'Overrides merged onto the default index ColumnDef (field/header/width/body).' }
|
|
11
11
|
---
|
|
12
|
+
|
|
12
13
|
## Example
|
|
13
14
|
|
|
14
15
|
```tsx
|
|
15
|
-
{
|
|
16
|
+
import { indexColumn } from '@mantis-core/ui/components/Tables/IndexColumn';
|
|
17
|
+
import { MantisDataTable } from '@mantis-core/ui/components/Tables/MantisDataTable';
|
|
18
|
+
import type { ColumnDef } from '@mantis-core/ui/components/Tables/columns';
|
|
19
|
+
|
|
20
|
+
interface Property {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function Example() {
|
|
26
|
+
const rows: Property[] = [{ id: '1', name: 'Casa Ceibos' }];
|
|
27
|
+
const columns: ColumnDef<Property>[] = [indexColumn<Property>({ width: '3rem' }), { field: 'name', header: 'Name' }];
|
|
28
|
+
return <MantisDataTable rows={rows} columns={columns} />;
|
|
29
|
+
}
|
|
16
30
|
```
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
- Reshaped from the PR10 `<Column/>` JSX element to a `ColumnDef<T>` factory — the canonical table is descriptor-driven, not JSX-children-driven.
|
|
35
|
+
- `field` on the returned descriptor is the non-data key `"__index__"` (required by `ColumnDef` but unused for the cell); the cell renders `index + 1` via the `body` render-prop.
|
|
36
|
+
- `PaginatedTable`'s `showIndexColumn`/`indexColumnOptions` props call this factory for you — reach for those first before prepending `indexColumn` by hand.
|
|
@@ -2,20 +2,38 @@
|
|
|
2
2
|
name: LineChart
|
|
3
3
|
category: charts
|
|
4
4
|
import: '@mantis-core/ui/components/charts/LineChart'
|
|
5
|
-
whenToUse: Time-series
|
|
6
|
-
baseLibrary:
|
|
5
|
+
whenToUse: Time-series/trend data rendered as a line chart, zero-config over chart.js defaults.
|
|
6
|
+
baseLibrary: chart.js
|
|
7
|
+
requiredStyles: []
|
|
7
8
|
relatedComponents: [BarChart, DonutChart]
|
|
8
9
|
relatedNextCore: []
|
|
9
10
|
props:
|
|
10
11
|
- { name: labels, type: 'string[]', required: true }
|
|
11
|
-
- { name: datasets, type: 'LineChartDataset[]', required: true, description: '
|
|
12
|
-
- { name: options, type: 'ChartOptions<''line''>', required: false, description: Deep-merged over
|
|
13
|
-
- { name: colors, type: 'string[]', required: false, default: DEFAULT_COLORS palette }
|
|
14
|
-
- { name: height, type: number, required: false, default: '300' }
|
|
12
|
+
- { name: datasets, type: 'LineChartDataset[]', required: true, description: 'ChartDataset<''line''> minus ''data'', plus data: number[].' }
|
|
13
|
+
- { name: options, type: 'ChartOptions<''line''>', required: false, description: 'Deep-merged over defaultLineOptions (plugins/scales merge shallowly one level).' }
|
|
14
|
+
- { name: colors, type: 'string[]', required: false, default: 'DEFAULT_COLORS (8-color palette)', description: 'Applied per-dataset (cycled by index) to datasets that don''t specify their own borderColor/backgroundColor.' }
|
|
15
|
+
- { name: height, type: number, required: false, default: '300', description: 'Container height in px.' }
|
|
15
16
|
- { name: className, type: string, required: false }
|
|
16
17
|
---
|
|
18
|
+
|
|
17
19
|
## Example
|
|
18
20
|
|
|
19
21
|
```tsx
|
|
20
|
-
|
|
22
|
+
import LineChart from '@mantis-core/ui/components/charts/LineChart';
|
|
23
|
+
|
|
24
|
+
function Example() {
|
|
25
|
+
return (
|
|
26
|
+
<LineChart
|
|
27
|
+
labels={['Jan', 'Feb', 'Mar']}
|
|
28
|
+
datasets={[{ label: 'Revenue', data: [100, 200, 150] }]}
|
|
29
|
+
height={250}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
21
33
|
```
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
- Not re-exported from the package root — import from the deep path above (`@mantis-core/ui/components/charts/LineChart`), not `@mantis-core/ui`.
|
|
38
|
+
- Calls `registerCharts()` (module-level, from `./chart-setup`) on import — no separate chart.js registration needed.
|
|
39
|
+
- Default `tension: 0.3` (curved line) and a 20%-opacity fill color per dataset unless overridden.
|
|
@@ -2,22 +2,31 @@
|
|
|
2
2
|
name: Loading
|
|
3
3
|
category: feedback
|
|
4
4
|
import: '@mantis-core/ui/components/Loaders/Loading'
|
|
5
|
-
whenToUse:
|
|
6
|
-
baseLibrary:
|
|
5
|
+
whenToUse: Full-screen loading overlay with a themed spinner; renders children unchanged when not loading.
|
|
6
|
+
baseLibrary: '@primereact/ui/progressspinner'
|
|
7
7
|
relatedNextCore: []
|
|
8
8
|
props:
|
|
9
9
|
- { name: loading, type: boolean, required: false, default: 'false' }
|
|
10
|
-
- { name: texto, type: string, required: false, default: '
|
|
10
|
+
- { name: texto, type: string, required: false, default: "'Cargando...'" }
|
|
11
11
|
- { name: className, type: string, required: false }
|
|
12
12
|
- { name: children, type: ReactNode, required: false }
|
|
13
13
|
---
|
|
14
|
+
|
|
14
15
|
## Example
|
|
15
16
|
|
|
16
17
|
```tsx
|
|
17
|
-
|
|
18
|
+
import Loading from '@mantis-core/ui/components/Loaders/Loading';
|
|
19
|
+
|
|
20
|
+
function Example() {
|
|
21
|
+
return (
|
|
22
|
+
<Loading loading={true} texto='Loading...'>
|
|
23
|
+
<div>Page content</div>
|
|
24
|
+
</Loading>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
18
27
|
```
|
|
19
28
|
|
|
20
29
|
## Notes
|
|
21
30
|
|
|
22
31
|
- When `loading` is `false`, it returns `children` unchanged.
|
|
23
|
-
- This is a
|
|
32
|
+
- This is a fixed, full-viewport overlay (indeterminate PR11 `ProgressSpinner`), not an inline spinner primitive.
|
|
@@ -2,21 +2,46 @@
|
|
|
2
2
|
name: LoginForm
|
|
3
3
|
category: auth
|
|
4
4
|
import: '@mantis-core/ui/components/auth/LoginForm'
|
|
5
|
-
whenToUse: Self-contained login form
|
|
5
|
+
whenToUse: Self-contained login form (identifier + password) built on migrated TextField/PasswordInput/Button; pass onSubmit to wire signIn/Supabase from the app layer.
|
|
6
6
|
baseLibrary: custom
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [ForgotPasswordForm, ResetPasswordForm, ChangePasswordForm, UserMenu]
|
|
7
9
|
relatedNextCore: []
|
|
8
10
|
props:
|
|
9
|
-
- { name: onSubmit, type: '(values: LoginFormValues) => void | Promise<void>', required: true }
|
|
10
|
-
- { name: brand, type: ReactNode, required: false }
|
|
11
|
+
- { name: onSubmit, type: '(values: LoginFormValues) => void | Promise<void>', required: true, description: 'Receives { identifier, password }; form manages isSubmitting via RHF.' }
|
|
12
|
+
- { name: brand, type: ReactNode, required: false, description: 'Rendered above the title.' }
|
|
11
13
|
- { name: title, type: string, required: false, default: '"Iniciar sesión"' }
|
|
12
14
|
- { 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: footer, type: ReactNode, required: false, description: 'Rendered below the submit button (e.g. forgot-password link).' }
|
|
16
|
+
- { name: identifierField, type: '''email'' | ''username''', required: false, default: '"email"', description: 'Switches the identifier field''s validation, type, and autoComplete between email and plain username.' }
|
|
17
|
+
- { name: identifierLabel, type: string, required: false, description: 'Overrides the default label ("Correo electrónico" / "Usuario") derived from identifierField.' }
|
|
18
|
+
- { name: identifierPlaceholder, type: string, required: false }
|
|
19
|
+
- { name: passwordLabel, type: string, required: false, default: '"Contraseña"' }
|
|
20
|
+
- { name: passwordPlaceholder, type: string, required: false }
|
|
15
21
|
- { name: submitLabel, type: string, required: false, default: '"Ingresar"' }
|
|
16
22
|
- { name: className, type: string, required: false }
|
|
17
23
|
---
|
|
24
|
+
|
|
18
25
|
## Example
|
|
19
26
|
|
|
20
27
|
```tsx
|
|
21
|
-
|
|
28
|
+
import LoginForm from '@mantis-core/ui/components/auth/LoginForm';
|
|
29
|
+
import type { LoginFormValues } from '@mantis-core/ui/components/auth/LoginForm';
|
|
30
|
+
|
|
31
|
+
function Example() {
|
|
32
|
+
const handleSubmit = async (values: LoginFormValues) => {
|
|
33
|
+
await fetch('/api/auth/login', { method: 'POST', body: JSON.stringify(values) });
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return <LoginForm onSubmit={handleSubmit} identifierField='email' />;
|
|
37
|
+
}
|
|
22
38
|
```
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- Owns its own `useForm<LoginFormValues>({ mode: 'onChange' })` — it is not a field wrapper, so
|
|
43
|
+
there is no `control`/`FieldControllerProps` to pass in from outside.
|
|
44
|
+
- `identifierField='email'` applies `emailRule()` + `notEmptyRule()`; `'username'` applies only
|
|
45
|
+
`notEmptyRule()`. Both cases still submit the value under the `identifier` key.
|
|
46
|
+
- Submit `Button` shows `loading`/`disabled` from `form.formState.isSubmitting` — no extra wiring
|
|
47
|
+
needed for a pending state.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: MantisDataTable
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/MantisDataTable'
|
|
5
|
+
whenToUse: 'The 90% shortcut over PR11''s compound DataTable — one flat `columns: ColumnDef[]` array renders the whole TableContainer→Table→THead→TBody→EmptyTBody tree with striped rows + gridlines. Default table for any grid; drop to `PaginatedTable` for pagination + index/action columns baked in.'
|
|
6
|
+
baseLibrary: '@primereact/ui/datatable'
|
|
7
|
+
requiredStyles: [scss/table.scss]
|
|
8
|
+
relatedComponents: [PaginatedTable, ActionColumn, IndexColumn, MenuButton, FilterPannel, MultiSelectFilter]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: rows, type: 'T[]', required: true, description: 'Row data (PR11''s `data`, renamed since PR11 root''s own `rows` means page size).' }
|
|
12
|
+
- { name: columns, type: 'ColumnDef<T>[]', required: true, description: 'Flat column descriptor array — see ColumnDef shape below.' }
|
|
13
|
+
- { name: rowsPerPage, type: number, required: false, description: 'Forwarded to PR11 Root''s `rows` (page size). Only relevant with `paginator`.' }
|
|
14
|
+
- { name: selectable, type: boolean, required: false, default: 'false', description: 'Prepends a checkbox selection column. Requires `selectionMode` on the passthrough root props.' }
|
|
15
|
+
- { name: emptyMessage, type: ReactNode, required: false, default: "'No records'" }
|
|
16
|
+
- { name: filters, type: 'Record<string, string>', required: false, description: 'Current per-field filter values (page-owned state, not RHF).' }
|
|
17
|
+
- { name: onFilterChange, type: '(field: string, value: string) => void', required: false, description: 'Fires when a header filter control (text/dropdown preset or custom filterElement) changes.' }
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { MantisDataTable } from '@mantis-core/ui/components/Tables/MantisDataTable';
|
|
24
|
+
import { currencyCell, badgeCell } from '@mantis-core/ui/components/Tables/cell-presets';
|
|
25
|
+
import type { ColumnDef } from '@mantis-core/ui/components/Tables/columns';
|
|
26
|
+
|
|
27
|
+
interface Property {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
price: number;
|
|
31
|
+
status: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const COLUMNS: ColumnDef<Property>[] = [
|
|
35
|
+
{ field: 'name', header: 'Name', sortable: true, filter: 'text' },
|
|
36
|
+
{ field: 'price', header: 'Price', cell: currencyCell({ currency: 'USD' }) },
|
|
37
|
+
{
|
|
38
|
+
field: 'status',
|
|
39
|
+
header: 'Status',
|
|
40
|
+
cell: badgeCell({ styles: { active: 'bg-green-100 text-green-700' } }),
|
|
41
|
+
filter: 'dropdown',
|
|
42
|
+
filterOptions: [
|
|
43
|
+
{ label: 'Active', value: 'active' },
|
|
44
|
+
{ label: 'Draft', value: 'draft' },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
function Example() {
|
|
50
|
+
const rows: Property[] = [{ id: '1', name: 'Casa Ceibos', price: 125000, status: 'active' }];
|
|
51
|
+
return <MantisDataTable rows={rows} columns={COLUMNS} emptyMessage='No properties yet' />;
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Notes
|
|
56
|
+
|
|
57
|
+
- `ColumnDef<T>` fields: `field` (`keyof T & string`, also the sort/filter key), `header`, `sortable?`, `width?`; cell rendering via preset `cell?: CellRenderer` or escape hatch `body?: (item: T, index: number) => ReactNode` (escape hatch always wins); filtering via preset `filter?: 'text' | 'dropdown'` (+ `filterOptions?` for dropdown) or escape hatch `filterElement?: (ctx: { value, onChange }) => ReactNode` (escape hatch always wins).
|
|
58
|
+
- Cell presets from `./cell-presets`: `currencyCell({ currency?, locale? })` (defaults USD/en-US, no decimals), `dateCell({ locale?, options? })` (short localized date), `badgeCell({ styles?, className? })` (maps a cell value to Tailwind tone classes).
|
|
59
|
+
- Column factories `indexColumn()` and `actionColumn()` live in `IndexColumn`/`ActionColumn` and return a `ColumnDef<T>` to prepend/append — see their own docs, or reach for `PaginatedTable`'s `showIndexColumn`/`showActionColumn` shortcuts instead of wiring them by hand.
|
|
60
|
+
- Any `DataTableRootProps` not owned by this wrapper (e.g. `paginator`, `selectionMode`, `lazy`, `sortField`, `onLazyLoad`, `dataKey`) passes straight through to PR11's `DataTable.Root`.
|
|
61
|
+
- The `dropdown` filter preset renders the themed PR11 `Select` (page-owned scalar value, not RHF); pagination UI only renders when `paginator` is passed through and true.
|
|
@@ -2,21 +2,42 @@
|
|
|
2
2
|
name: MapPickerClient
|
|
3
3
|
category: maps
|
|
4
4
|
import: '@mantis-core/ui/components/Maps/MapPickerClient'
|
|
5
|
-
whenToUse: Client-only
|
|
6
|
-
baseLibrary:
|
|
7
|
-
|
|
5
|
+
whenToUse: Client-only react-leaflet map (click-to-pick marker); the piece MapPicker lazy-loads. Use directly only if you already own the ssr:false boundary.
|
|
6
|
+
baseLibrary: leaflet
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [MapPicker, MapPickerOSM]
|
|
8
9
|
relatedNextCore: []
|
|
9
10
|
props:
|
|
10
|
-
- { name: onLocationSelect, type: '(lat: number, lng: number) => void', required: true, description: '
|
|
11
|
-
- { name: initialLat, type: 'number | null', required: false, description: 'Initial latitude
|
|
12
|
-
- { name: initialLng, type: 'number | null', required: false, description: 'Initial longitude
|
|
11
|
+
- { name: onLocationSelect, type: '(lat: number, lng: number) => void', required: true, description: 'Fired on map click with the picked coordinates.' }
|
|
12
|
+
- { name: initialLat, type: 'number | null', required: false, description: 'Initial marker/center latitude; defaults to a fixed Yunguilla-area center when omitted.' }
|
|
13
|
+
- { name: initialLng, type: 'number | null', required: false, description: 'Initial marker/center longitude; defaults to a fixed Yunguilla-area center when omitted.' }
|
|
13
14
|
---
|
|
15
|
+
|
|
14
16
|
## Example
|
|
15
17
|
|
|
16
18
|
```tsx
|
|
17
|
-
|
|
19
|
+
'use client';
|
|
20
|
+
import { useState } from 'react';
|
|
21
|
+
import MapPickerClient from '@mantis-core/ui/components/Maps/MapPickerClient';
|
|
22
|
+
|
|
23
|
+
function Example() {
|
|
24
|
+
const [coords, setCoords] = useState<{ lat: number; lng: number } | null>(null);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<MapPickerClient
|
|
28
|
+
onLocationSelect={(lat, lng) => setCoords({ lat, lng })}
|
|
29
|
+
initialLat={-3.26}
|
|
30
|
+
initialLng={-79.28}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
18
34
|
```
|
|
19
35
|
|
|
20
36
|
## Notes
|
|
21
37
|
|
|
22
|
-
-
|
|
38
|
+
- `"use client"` component — imports `leaflet/dist/leaflet.css` and `react-leaflet` directly, so it
|
|
39
|
+
cannot render during SSR. Prefer `MapPicker` unless the caller already guarantees a client-only tree.
|
|
40
|
+
- Marker icon assets are expected at `/leaflet/marker-icon.png`, `/leaflet/marker-icon-2x.png`,
|
|
41
|
+
`/leaflet/marker-shadow.png` (served from the consuming app's `public/`).
|
|
42
|
+
- Internally handles container resize (`ResizeObserver` + `map.invalidateSize`) and recenters when
|
|
43
|
+
`initialLat`/`initialLng` change — no manual `invalidateSize` call needed from the caller.
|
|
@@ -2,19 +2,37 @@
|
|
|
2
2
|
name: MapPickerOSM
|
|
3
3
|
category: maps
|
|
4
4
|
import: '@mantis-core/ui/components/Maps/MapPickerOSM'
|
|
5
|
-
whenToUse: Script-injected Leaflet map (no SSR bundle cost) with
|
|
6
|
-
baseLibrary:
|
|
7
|
-
|
|
5
|
+
whenToUse: Script-injected Leaflet map (no react-leaflet/SSR bundle cost) with a draggable marker and an explicit "save location" button.
|
|
6
|
+
baseLibrary: leaflet
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [MapPicker, MapPickerClient]
|
|
8
9
|
relatedNextCore: []
|
|
9
10
|
props:
|
|
10
|
-
- { name: initialPosition, type: LatLng, required: false, default: '{ lat: -12.0464, lng: -77.0428 }', description: 'Initial marker
|
|
11
|
-
- { name: zoom, type: number, required: false, default: '12'
|
|
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: '
|
|
14
|
-
- { name: onSave, type: '(pos: LatLng) => void', required: false, description: '
|
|
11
|
+
- { name: initialPosition, type: LatLng, required: false, default: '{ lat: -12.0464, lng: -77.0428 }', description: 'Initial marker/center position.' }
|
|
12
|
+
- { name: zoom, type: number, required: false, default: '12' }
|
|
13
|
+
- { name: height, type: string, required: false, default: '''400px''', description: 'CSS height of the map container.' }
|
|
14
|
+
- { name: onChange, type: '(pos: LatLng) => void', required: false, description: 'Fired on every click or marker drag.' }
|
|
15
|
+
- { name: onSave, type: '(pos: LatLng) => void', required: false, description: 'Fired only when the user clicks the "Guardar ubicación" button.' }
|
|
15
16
|
---
|
|
17
|
+
|
|
16
18
|
## Example
|
|
17
19
|
|
|
18
20
|
```tsx
|
|
19
|
-
|
|
21
|
+
'use client';
|
|
22
|
+
import MapPickerOSM from '@mantis-core/ui/components/Maps/MapPickerOSM';
|
|
23
|
+
import type { LatLng } from '@mantis-core/ui/components/Maps/MapPickerOSM';
|
|
24
|
+
|
|
25
|
+
function Example() {
|
|
26
|
+
const handleSave = (pos: LatLng) => console.log('saved', pos);
|
|
27
|
+
|
|
28
|
+
return <MapPickerOSM initialPosition={{ lat: -3.26, lng: -79.28 }} onSave={handleSave} />;
|
|
29
|
+
}
|
|
20
30
|
```
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
- Loads Leaflet from the `unpkg.com` CDN at runtime (script + stylesheet injected into
|
|
35
|
+
`document.head`/`document.body`) instead of importing the `leaflet` package — no bundler cost, but
|
|
36
|
+
requires network access to `unpkg.com` and has no offline/self-hosted mode.
|
|
37
|
+
- Spanish-only UI strings are hardcoded ("Cargando mapa...", "Guardar ubicación", error text) — not
|
|
38
|
+
currently prop-configurable.
|
|
@@ -2,17 +2,38 @@
|
|
|
2
2
|
name: MapPicker
|
|
3
3
|
category: maps
|
|
4
4
|
import: '@mantis-core/ui/components/Maps/MapPicker'
|
|
5
|
-
whenToUse:
|
|
6
|
-
baseLibrary:
|
|
5
|
+
whenToUse: SSR-safe entry point for the Leaflet lat/lng picker; lazy-loads MapPickerClient via next/dynamic (ssr:false).
|
|
6
|
+
baseLibrary: leaflet
|
|
7
|
+
requiredStyles: []
|
|
7
8
|
relatedComponents: [MapPickerClient, MapPickerOSM]
|
|
8
9
|
relatedNextCore: []
|
|
9
10
|
props:
|
|
10
|
-
- { name: onLocationSelect, type: '(lat: number, lng: number) => void', required: true }
|
|
11
|
+
- { name: onLocationSelect, type: '(lat: number, lng: number) => void', required: true, description: 'Fired on map click with the picked coordinates.' }
|
|
11
12
|
- { name: initialLat, type: 'number | null', required: false }
|
|
12
13
|
- { name: initialLng, type: 'number | null', required: false }
|
|
13
14
|
---
|
|
15
|
+
|
|
14
16
|
## Example
|
|
15
17
|
|
|
16
18
|
```tsx
|
|
17
|
-
|
|
19
|
+
import { useState } from 'react';
|
|
20
|
+
import MapPicker from '@mantis-core/ui/components/Maps/MapPicker';
|
|
21
|
+
|
|
22
|
+
function Example() {
|
|
23
|
+
const [coords, setCoords] = useState<{ lat: number; lng: number } | null>(null);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<MapPicker
|
|
27
|
+
onLocationSelect={(lat, lng) => setCoords({ lat, lng })}
|
|
28
|
+
initialLat={-3.26}
|
|
29
|
+
initialLng={-79.28}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
18
33
|
```
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
- Just a `next/dynamic(() => import('./MapPickerClient'), { ssr: false })` wrapper — use this
|
|
38
|
+
(not `MapPickerClient` directly) in App Router pages/layouts to avoid a `leaflet` SSR crash.
|
|
39
|
+
- Loading fallback is a plain `<p>Loading map...</p>` (not themed) while the client chunk loads.
|