@mantis-core/ui 0.4.0 → 0.6.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 +144 -0
- package/COMPONENTS.md +113 -15
- package/README.md +13 -6
- 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 +39 -12
- package/docs/components/admin-page-configurator.md +42 -0
- package/docs/components/admin-page-header.md +32 -16
- package/docs/components/admin-page-layout-shell.md +36 -0
- package/docs/components/admin-page-layout.md +41 -21
- package/docs/components/app-shell.md +45 -0
- package/docs/components/auto-complete-field.md +60 -0
- package/docs/components/avatar.md +29 -0
- package/docs/components/bar-chart.md +39 -0
- package/docs/components/breadcrumbs.md +28 -0
- package/docs/components/button.md +41 -17
- package/docs/components/card-skeleton.md +21 -0
- package/docs/components/change-password-form.md +36 -0
- package/docs/components/checkbox-field.md +38 -0
- package/docs/components/ckeditor-input.md +47 -16
- package/docs/components/color-picker-input.md +30 -0
- package/docs/components/command-palette.md +38 -0
- package/docs/components/confirm-dialog.md +45 -16
- package/docs/components/data-state.md +39 -14
- package/docs/components/date-field.md +39 -0
- package/docs/components/date-presets.md +32 -0
- package/docs/components/description-list.md +34 -0
- package/docs/components/dirty-form-guard.md +28 -24
- package/docs/components/donut-chart.md +38 -0
- package/docs/components/drawer.md +38 -0
- package/docs/components/empty-state.md +28 -0
- package/docs/components/error-boundary.md +31 -0
- package/docs/components/error-message.md +29 -8
- package/docs/components/field-shell.md +47 -0
- package/docs/components/file-dropzone.md +45 -17
- package/docs/components/filter-pannel.md +40 -15
- package/docs/components/forgot-password-form.md +36 -0
- package/docs/components/form-actions-bar.md +47 -17
- package/docs/components/form-field-render.md +43 -15
- package/docs/components/form-section.md +26 -10
- package/docs/components/form-wizard.md +47 -0
- package/docs/components/hidden-field.md +27 -14
- package/docs/components/index-column.md +31 -8
- package/docs/components/line-chart.md +39 -0
- package/docs/components/loading.md +23 -12
- package/docs/components/login-form.md +47 -0
- package/docs/components/mantis-data-table.md +61 -0
- package/docs/components/map-picker-client.md +35 -14
- package/docs/components/map-picker-osm.md +33 -13
- package/docs/components/map-picker.md +34 -16
- package/docs/components/mask-field.md +31 -0
- package/docs/components/menu-button.md +28 -17
- package/docs/components/modal.md +45 -0
- package/docs/components/multi-select-filter.md +31 -15
- package/docs/components/number-field.md +40 -0
- package/docs/components/otp-input.md +31 -0
- package/docs/components/page-tabs.md +35 -0
- package/docs/components/page-title.md +15 -8
- package/docs/components/paginated-table.md +42 -26
- package/docs/components/pagination.md +28 -18
- package/docs/components/password-input.md +31 -0
- package/docs/components/phone-input.md +28 -0
- package/docs/components/radio-group.md +50 -0
- package/docs/components/range-slider.md +32 -0
- package/docs/components/rating-input.md +30 -0
- package/docs/components/render-field.md +41 -18
- package/docs/components/reset-password-form.md +37 -0
- package/docs/components/rich-text-preview.md +26 -13
- package/docs/components/search-input.md +30 -0
- package/docs/components/select-field.md +55 -0
- package/docs/components/stat-card.md +30 -0
- package/docs/components/status-badge.md +25 -9
- package/docs/components/switch-field.md +32 -0
- package/docs/components/table-filter-field.md +30 -16
- package/docs/components/table-skeleton.md +22 -0
- package/docs/components/table-toolbar.md +28 -14
- package/docs/components/tag.md +27 -0
- package/docs/components/tags-input.md +32 -0
- package/docs/components/text-area.md +25 -15
- package/docs/components/text-field.md +32 -0
- package/docs/components/timeline.md +31 -0
- package/docs/components/toggle-inline-button.md +48 -17
- package/docs/components/upload-files-preview.md +39 -20
- package/docs/components/use-field-controller.md +58 -0
- package/docs/components/user-menu.md +39 -0
- package/docs/contracts/STORYBOOK_IMPLEMENTATION_AND_VOBO.md +92 -0
- package/docs/contracts/STORYBOOK_VOBO_LEDGER.md +195 -0
- package/docs/contracts/component-doc-schema.md +120 -0
- package/docs/contracts/dependency-map.md +76 -39
- package/docs/contracts/field-controller.md +138 -0
- package/docs/contracts/style-imports.md +21 -14
- package/llms.txt +104 -0
- package/package.json +39 -10
- package/PRIMEREACT_MAPPING.md +0 -6
- 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 -26
- package/docs/components/date-input.md +0 -22
- package/docs/components/drop-down.md +0 -28
- package/docs/components/multi-select.md +0 -23
- package/docs/components/number-input.md +0 -20
- package/docs/components/select.md +0 -28
- package/docs/components/switch.md +0 -27
- package/docs/components/text-input.md +0 -23
- package/docs/components/time-picker.md +0 -22
- package/docs/components/toggle.md +0 -21
- package/docs/contracts/controller-props.md +0 -28
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
---
|
|
2
|
+
name: FilterPannel
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/FilterPannel'
|
|
5
|
+
whenToUse: 'Slide-in filter sidebar for tables; wraps RHF-bound filter fields in their own `FormProvider` and calls `onApplyFilter` with the cleaned form data.'
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: [PaginatedTable, MultiSelectFilter, TableFilterField]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: onApplyFilter, type: '(data: T) => Promise<void>', required: true, description: 'Called with the cleaned form data on submit (Aplicar), or `{}` on reset (Restaurar).' }
|
|
11
|
+
---
|
|
8
12
|
|
|
9
13
|
## Example
|
|
10
14
|
|
|
11
15
|
```tsx
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import FilterPannel from '@mantis-core/ui/components/Tables/FilterPannel';
|
|
17
|
+
import TableFilterField from '@mantis-core/ui/components/table-filter-field';
|
|
18
|
+
import { useFormContext } from 'react-hook-form';
|
|
19
|
+
|
|
20
|
+
interface Filters {
|
|
21
|
+
search: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SearchField() {
|
|
25
|
+
const { register } = useFormContext<Filters>();
|
|
26
|
+
return (
|
|
27
|
+
<TableFilterField label='Search' htmlFor='search'>
|
|
28
|
+
<input id='search' {...register('search')} />
|
|
29
|
+
</TableFilterField>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function Example() {
|
|
34
|
+
const onApplyFilter = async (data: Filters) => console.log(data);
|
|
35
|
+
return (
|
|
36
|
+
<FilterPannel<Filters> onApplyFilter={onApplyFilter}>
|
|
37
|
+
<SearchField />
|
|
38
|
+
</FilterPannel>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
18
41
|
```
|
|
19
42
|
|
|
20
43
|
## Notes
|
|
21
44
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
45
|
+
- Not re-exported from the package root — import the deep path.
|
|
46
|
+
- Migrated to the PR11 `Drawer` (was PR10 `primereact/sidebar`, hence `baseLibrary: custom` — the sidebar itself is a Mantis wrapper, not a direct PrimeReact base) and the migrated `Button`.
|
|
47
|
+
- Children must read the panel's own `useForm` instance via `useFormContext` (a `FormProvider` is created internally) — do not pass an outer `control`.
|
|
48
|
+
- Empty (`""`/`null`/`undefined`) values are normalized to `null` before `onApplyFilter`; reset applies `{}`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ForgotPasswordForm
|
|
3
|
+
category: auth
|
|
4
|
+
import: '@mantis-core/ui/components/auth/ForgotPasswordForm'
|
|
5
|
+
whenToUse: Email-only form to trigger a password-reset email; caller owns the actual reset request.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [LoginForm, ResetPasswordForm]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
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).' }
|
|
16
|
+
- { name: className, type: string, required: false }
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
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
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
|
|
36
|
+
- Single `TextField` (email, `emailRule()`), own `useForm<ForgotPasswordFormValues>({ mode: 'onChange' })`.
|
|
@@ -1,22 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
---
|
|
2
|
+
name: FormActionsBar
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/FormActionsBar'
|
|
5
|
+
whenToUse: Sticky-capable action bar with primary/secondary buttons and optional left/right slots for form pages.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
requiredStyles: [scss/form-actions.scss]
|
|
8
|
+
relatedComponents: [FormWizard, DirtyFormGuard]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: className, type: string, required: false, description: 'Additional CSS class on the root element' }
|
|
12
|
+
- { name: align, type: '''start'' | ''end'' | ''between''', required: false, default: '''between''', description: 'Horizontal alignment of action groups' }
|
|
13
|
+
- { name: sticky, type: boolean, required: false, default: 'false', description: 'Fix bar to bottom of viewport' }
|
|
14
|
+
- { name: leftSlot, type: ReactNode, required: false, description: 'Content rendered on the left side' }
|
|
15
|
+
- { name: rightSlot, type: ReactNode, required: false, description: 'Content rendered before the action buttons on the right' }
|
|
16
|
+
- { name: primaryLabel, type: string, required: false, default: '''Guardar''', description: 'Label for the primary button' }
|
|
17
|
+
- { name: primaryVariant, type: ButtonVariant, required: false, default: '''primary''', description: 'Design-system variant for primary button' }
|
|
18
|
+
- { name: primaryType, type: '''button'' | ''submit'' | ''reset''', required: false, default: '''submit''', description: 'HTML type for primary button' }
|
|
19
|
+
- { name: primaryLoading, type: boolean, required: false, default: 'false', description: 'Show loading spinner on primary button' }
|
|
20
|
+
- { name: primaryDisabled, type: boolean, required: false, default: 'false', description: 'Disable primary button' }
|
|
21
|
+
- { name: onPrimaryClick, type: '() => void', required: false, description: 'Click handler for primary button' }
|
|
22
|
+
- { name: secondaryLabel, type: string, required: false, description: 'Label for the secondary button; omit to hide it' }
|
|
23
|
+
- { name: secondaryVariant, type: ButtonVariant, required: false, default: '''secondary''', description: 'Design-system variant for secondary button' }
|
|
24
|
+
- { name: secondaryType, type: '''button'' | ''submit'' | ''reset''', required: false, default: '''button''', description: 'HTML type for secondary button' }
|
|
25
|
+
- { name: secondaryOutlined, type: boolean, required: false, default: 'true', description: 'Render secondary button as outlined' }
|
|
26
|
+
- { name: secondaryDisabled, type: boolean, required: false, default: 'false', description: 'Disable secondary button' }
|
|
27
|
+
- { name: onSecondaryClick, type: '() => void', required: false, description: 'Click handler for secondary button' }
|
|
28
|
+
---
|
|
8
29
|
|
|
9
30
|
## Example
|
|
10
31
|
|
|
11
32
|
```tsx
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/>
|
|
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
|
+
}
|
|
22
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.
|
|
@@ -1,20 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: FormFieldRender
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/FormFieldRender'
|
|
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
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: ['ErrorMessage', 'RenderField']
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
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
|
+
---
|
|
9
16
|
|
|
10
17
|
## Example
|
|
11
18
|
|
|
12
19
|
```tsx
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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>`.
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
---
|
|
2
|
+
name: FormSection
|
|
3
|
+
category: pages
|
|
4
|
+
import: '@mantis-core/ui/components/pages/FormSection'
|
|
5
|
+
whenToUse: Bordered card section with a header (title + description + icon) and a padded body; groups related form fields.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: title, type: string, required: true }
|
|
10
|
+
- { name: description, type: string, required: false }
|
|
11
|
+
- { name: icon, type: ReactNode, required: false }
|
|
12
|
+
- { name: children, type: ReactNode, required: true }
|
|
13
|
+
- { name: className, type: string, required: false }
|
|
14
|
+
---
|
|
8
15
|
|
|
9
16
|
## Example
|
|
10
17
|
|
|
11
18
|
```tsx
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
}
|
|
15
31
|
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: FormWizard
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/FormWizard'
|
|
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]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
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".' }
|
|
13
|
+
- { name: submitLabel, type: string, required: false, default: '''Finalizar''' }
|
|
14
|
+
- { name: className, type: string, required: false }
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
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
|
+
}
|
|
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.
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: HiddenField
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/HiddenField'
|
|
5
|
+
whenToUse: Registers a react-hook-form value with no visible UI.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: FieldControllerProps
|
|
8
|
+
relatedComponents: ['TextField']
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props: []
|
|
11
|
+
---
|
|
10
12
|
|
|
11
13
|
## Example
|
|
12
14
|
|
|
13
15
|
```tsx
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
}
|
|
19
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.
|
|
@@ -1,13 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
---
|
|
2
|
+
name: IndexColumn
|
|
3
|
+
category: tables
|
|
4
|
+
import: '@mantis-core/ui/components/Tables/IndexColumn'
|
|
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
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: overrides, type: 'Partial<ColumnDef<T>>', required: false, description: 'Overrides merged onto the default index ColumnDef (field/header/width/body).' }
|
|
11
|
+
---
|
|
8
12
|
|
|
9
13
|
## Example
|
|
10
14
|
|
|
11
15
|
```tsx
|
|
12
|
-
|
|
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
|
+
}
|
|
13
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.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LineChart
|
|
3
|
+
category: charts
|
|
4
|
+
import: '@mantis-core/ui/components/charts/LineChart'
|
|
5
|
+
whenToUse: Time-series/trend data rendered as a line chart, zero-config over chart.js defaults.
|
|
6
|
+
baseLibrary: chart.js
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [BarChart, DonutChart]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: labels, type: 'string[]', required: true }
|
|
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.' }
|
|
16
|
+
- { name: className, type: string, required: false }
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
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
|
+
}
|
|
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.
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: Loading
|
|
3
|
+
category: feedback
|
|
4
|
+
import: '@mantis-core/ui/components/Loaders/Loading'
|
|
5
|
+
whenToUse: Full-screen loading overlay with a themed spinner; renders children unchanged when not loading.
|
|
6
|
+
baseLibrary: '@primereact/ui/progressspinner'
|
|
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
|
+
---
|
|
9
14
|
|
|
10
15
|
## Example
|
|
11
16
|
|
|
12
17
|
```tsx
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
+
}
|
|
16
27
|
```
|
|
17
28
|
|
|
18
29
|
## Notes
|
|
19
30
|
|
|
20
31
|
- When `loading` is `false`, it returns `children` unchanged.
|
|
21
|
-
- This is a
|
|
32
|
+
- This is a fixed, full-viewport overlay (indeterminate PR11 `ProgressSpinner`), not an inline spinner primitive.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LoginForm
|
|
3
|
+
category: auth
|
|
4
|
+
import: '@mantis-core/ui/components/auth/LoginForm'
|
|
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
|
+
baseLibrary: custom
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [ForgotPasswordForm, ResetPasswordForm, ChangePasswordForm, UserMenu]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
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.' }
|
|
13
|
+
- { name: title, type: string, required: false, default: '"Iniciar sesión"' }
|
|
14
|
+
- { name: subtitle, type: string, required: false }
|
|
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 }
|
|
21
|
+
- { name: submitLabel, type: string, required: false, default: '"Ingresar"' }
|
|
22
|
+
- { name: className, type: string, required: false }
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
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
|
+
}
|
|
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.
|