@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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Tag
|
|
3
|
+
category: feedback
|
|
4
|
+
import: '@mantis-core/ui/components/feedback/Tag'
|
|
5
|
+
whenToUse: Styled label chip for status labels, categories, or counts; wraps the PR11 Tag primitive.
|
|
6
|
+
baseLibrary: '@primereact/ui/tag'
|
|
7
|
+
relatedComponents: ['StatusBadge', 'Avatar']
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: children, type: ReactNode, required: false, description: 'Tag content — PR11 dropped value/icon; content is now children.' }
|
|
11
|
+
- { name: severity, type: "'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'contrast'", required: false }
|
|
12
|
+
- { name: rounded, type: boolean, required: false, default: 'false' }
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import Tag from '@mantis-core/ui/components/feedback/Tag';
|
|
19
|
+
|
|
20
|
+
function Example() {
|
|
21
|
+
return <Tag severity='success' rounded>Sold</Tag>;
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Notes
|
|
26
|
+
|
|
27
|
+
- PR11 `Tag` has no `value`/`icon` props like PR10 did — pass content as `children` instead.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: TagsInput
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/TagsInput'
|
|
5
|
+
whenToUse: RHF-bound tag/chip input over PR11's compound InputTags; stores value as string[].
|
|
6
|
+
baseLibrary: '@primereact/ui/inputtags'
|
|
7
|
+
formContract: FieldControllerProps
|
|
8
|
+
relatedComponents: []
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: placeholder, type: string, required: false, description: 'Shown on the entry input only while no tags are present.' }
|
|
12
|
+
- { name: max, type: number, required: false, description: 'Max number of tags.' }
|
|
13
|
+
- { name: delimiter, type: 'string | RegExp', required: false, description: 'Extra character(s) that commit a tag besides Enter.' }
|
|
14
|
+
- { name: allowDuplicate, type: boolean, required: false }
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { TagsInput } from '@mantis-core/ui/components/Forms/TagsInput';
|
|
21
|
+
import { useForm } from 'react-hook-form';
|
|
22
|
+
|
|
23
|
+
function Example() {
|
|
24
|
+
const { control } = useForm({ defaultValues: { tags: [] as string[] } });
|
|
25
|
+
return <TagsInput name='tags' control={control} label='Etiquetas' placeholder='Agregar etiqueta...' />;
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Notes
|
|
30
|
+
|
|
31
|
+
- Value shape: `string[]`, `[]` when unset. Enter (or `delimiter`) commits a tag; Backspace on an empty entry removes the last one.
|
|
32
|
+
- Chips render as themed `Chip.*`; the entry input is chrome-less (`.p-inputtags` owns the border/focus ring) to avoid a doubled focus ring.
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: TextArea
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/TextArea'
|
|
5
|
+
whenToUse: Multi-line text field wired to react-hook-form.
|
|
6
|
+
baseLibrary: '@primereact/ui/textarea'
|
|
7
|
+
formContract: FieldControllerProps
|
|
8
|
+
relatedComponents: ['TextField']
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: rows, type: number, required: false, description: 'Native <textarea> passthrough beyond FieldControllerProps.' }
|
|
12
|
+
---
|
|
10
13
|
|
|
11
14
|
## Example
|
|
12
15
|
|
|
13
16
|
```tsx
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
import { TextArea } from '@mantis-core/ui/components/Forms/TextArea';
|
|
18
|
+
import { useForm } from 'react-hook-form';
|
|
19
|
+
|
|
20
|
+
function Example() {
|
|
21
|
+
const { control } = useForm({ defaultValues: { notes: '' } });
|
|
22
|
+
return <TextArea name='notes' control={control} label='Notes' rows={4} />;
|
|
23
|
+
}
|
|
20
24
|
```
|
|
25
|
+
|
|
26
|
+
## Notes
|
|
27
|
+
|
|
28
|
+
- Thin wrapper over PR11 `Textarea`: value/onChange are native (`e.target.value`).
|
|
29
|
+
- Any extra prop not listed above (native `<textarea>` attrs or `TextareaProps`) passes straight
|
|
30
|
+
through as an escape hatch.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: TextField
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/TextField'
|
|
5
|
+
whenToUse: Single-line text field wired to react-hook-form.
|
|
6
|
+
baseLibrary: '@primereact/ui/inputtext'
|
|
7
|
+
formContract: FieldControllerProps
|
|
8
|
+
relatedComponents: ['TextArea', 'NumberField', 'FieldShell']
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: placeholder, type: string, required: false, description: 'Native <input> passthrough beyond FieldControllerProps.' }
|
|
12
|
+
- { name: maxLength, type: number, required: false, description: 'Native <input> passthrough beyond FieldControllerProps.' }
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { TextField } from '@mantis-core/ui/components/Forms/TextField';
|
|
19
|
+
import { useForm } from 'react-hook-form';
|
|
20
|
+
|
|
21
|
+
function Example() {
|
|
22
|
+
const { control } = useForm({ defaultValues: { title: '' } });
|
|
23
|
+
return <TextField name='title' control={control} label='Title' rules={{ required: true }} />;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Notes
|
|
28
|
+
|
|
29
|
+
- Thin wrapper over PR11 `InputText`: value/onChange are native (`e.target.value`), unlike the
|
|
30
|
+
compound `InputNumber`/`Select` primitives.
|
|
31
|
+
- Any extra prop not listed above (native `<input>` attrs or `InputTextProps`) passes straight
|
|
32
|
+
through as an escape hatch.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Timeline
|
|
3
|
+
category: data
|
|
4
|
+
import: '@mantis-core/ui/components/data/Timeline'
|
|
5
|
+
whenToUse: Vertical event timeline backed by the PR11 Timeline compound; items render a title, description, date, and optional icon/color.
|
|
6
|
+
baseLibrary: '@primereact/ui/timeline'
|
|
7
|
+
relatedNextCore: []
|
|
8
|
+
props:
|
|
9
|
+
- { name: items, type: '{ title: string; description?: string; date?: string; icon?: ReactNode; color?: string }[]', required: true }
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import Timeline from '@mantis-core/ui/components/data/Timeline';
|
|
16
|
+
|
|
17
|
+
function Example() {
|
|
18
|
+
return (
|
|
19
|
+
<Timeline
|
|
20
|
+
items={[
|
|
21
|
+
{ title: 'Lead created', date: '2025-01-10', description: 'Web form' },
|
|
22
|
+
{ title: 'Contacted', date: '2025-01-11' },
|
|
23
|
+
]}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Notes
|
|
30
|
+
|
|
31
|
+
- PR11's `Timeline` is fully compound (`Root`/`Event`/`Separator`/`Marker`/`Connector`/`Content`) with no render-prop API — the wrapper maps each `items` entry onto the sub-part tree for you, so callers keep the old flat item-list shape.
|
|
@@ -1,22 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
---
|
|
2
|
+
name: ToggleInlineButton
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/ToggleInlineButton'
|
|
5
|
+
whenToUse: Segmented single- or multi-choice control over PR11's ToggleButtonGroup; pass `multiple` for array-value mode.
|
|
6
|
+
baseLibrary: '@primereact/ui/togglebutton'
|
|
7
|
+
formContract: ChoiceFieldControllerProps
|
|
8
|
+
relatedComponents: ['RadioGroup', 'SelectField']
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: options, type: 'Record<string, unknown>[]', required: true, description: 'Option rows rendered as segments.' }
|
|
12
|
+
- { name: optionLabel, type: string, required: false, default: '''label''', description: 'Key read for each option''s display label.' }
|
|
13
|
+
- { name: optionValue, type: string, required: false, default: '''value''', description: 'Key read for each option''s bound value.' }
|
|
14
|
+
- { name: multiple, type: boolean, required: false, default: 'false', description: 'Array-value mode; toggles per-segment selection instead of single scalar selection.' }
|
|
15
|
+
- { name: renderOption, type: '(option: Record<string, unknown>, index: number) => ReactNode', required: false, description: 'Escape hatch: full custom per-segment render.' }
|
|
16
|
+
---
|
|
10
17
|
|
|
11
18
|
## Example
|
|
12
19
|
|
|
13
20
|
```tsx
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
import { ToggleInlineButton } from '@mantis-core/ui/components/Forms/ToggleInlineButton';
|
|
22
|
+
import { useForm } from 'react-hook-form';
|
|
23
|
+
|
|
24
|
+
const VIEWS = [
|
|
25
|
+
{ label: 'List', value: 'list' },
|
|
26
|
+
{ label: 'Grid', value: 'grid' },
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
function Example() {
|
|
30
|
+
const { control } = useForm({ defaultValues: { view: 'list' } });
|
|
31
|
+
return (
|
|
32
|
+
<ToggleInlineButton
|
|
33
|
+
name='view'
|
|
34
|
+
control={control}
|
|
35
|
+
label='View'
|
|
36
|
+
options={VIEWS}
|
|
37
|
+
optionLabel='label'
|
|
38
|
+
optionValue='value'
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
22
42
|
```
|
|
43
|
+
|
|
44
|
+
## Notes
|
|
45
|
+
|
|
46
|
+
- Value shape: scalar (or `null`) by default; an ARRAY when `multiple` — selecting a segment
|
|
47
|
+
appends its value, deselecting filters it out.
|
|
48
|
+
- `labelMode` defaults to `'beside'` for this wrapper (not the global config default).
|
|
49
|
+
- PR11 `11.0.0-rc.1` gotcha (same as `RadioGroup`): the styled `ToggleButtonGroup` and
|
|
50
|
+
`ToggleButton.Root` are wired through two different React contexts in this rc, so the group's
|
|
51
|
+
`value`/`onValueChange` never reaches its children (verified in-browser). Until fixed upstream,
|
|
52
|
+
this wrapper binds each `ToggleButton.Root` individually via its documented `pressed`/
|
|
53
|
+
`onPressedChange` props; `ToggleButtonGroup` itself is used for layout/styling only.
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
---
|
|
2
|
+
name: UploadFilesPreview
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/UploadFilesPreview'
|
|
5
|
+
whenToUse: Drag-and-drop upload zone with live preview grid, drag-to-reorder, and async upload queue; designed for image galleries, not react-hook-form bound.
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
relatedComponents: [FileDropzone]
|
|
8
|
+
relatedNextCore: []
|
|
9
|
+
props:
|
|
10
|
+
- { name: previews, type: 'TItem[]', required: false, default: '[]', description: 'Already-uploaded items to display in the preview grid' }
|
|
11
|
+
- { name: onUploadFile, type: '(file: File) => Promise<TItem>', required: true, description: 'Called per file; resolves to the stored item' }
|
|
12
|
+
- { name: onFileUploaded, type: '(file: TItem) => void', required: true, description: 'Called after each successful upload' }
|
|
13
|
+
- { name: onRemoveFile, type: '(item: TItem) => void', required: true, description: 'Called when user removes a preview item' }
|
|
14
|
+
- { name: onReorder, type: '(items: TItem[]) => void', required: true, description: 'Called after drag-to-reorder with new order' }
|
|
15
|
+
- { name: accept, type: string, required: false, default: '''image/*''', description: 'Accepted MIME types for the file input' }
|
|
16
|
+
- { name: disabled, type: boolean, required: false, default: 'false', description: 'Disable uploads and interactions' }
|
|
17
|
+
- { name: disabledMessage, type: string, required: false, description: 'Message shown in the drop zone when disabled' }
|
|
18
|
+
- { name: copy, type: 'Partial<UploadFilesPreviewCopy>', required: false, description: 'Override any UI text strings' }
|
|
19
|
+
---
|
|
9
20
|
|
|
10
21
|
## Example
|
|
11
22
|
|
|
12
23
|
```tsx
|
|
13
|
-
|
|
14
|
-
id: string;
|
|
15
|
-
fullUrl: string;
|
|
16
|
-
storagePath: string;
|
|
17
|
-
};
|
|
24
|
+
import UploadFilesPreview from '@mantis-core/ui/components/Forms/UploadFilesPreview';
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
function Example() {
|
|
27
|
+
return (
|
|
28
|
+
<UploadFilesPreview
|
|
29
|
+
previews={[{ id: '1', fullUrl: 'https://example.com/photo.jpg' }]}
|
|
30
|
+
onUploadFile={async (file) => ({ id: file.name, fullUrl: URL.createObjectURL(file) })}
|
|
31
|
+
onFileUploaded={() => {}}
|
|
32
|
+
onRemoveFile={() => {}}
|
|
33
|
+
onReorder={() => {}}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
26
37
|
```
|
|
38
|
+
|
|
39
|
+
## Notes
|
|
40
|
+
|
|
41
|
+
- Generic over `TItem extends { id: string; fullUrl: string }` — pass richer item shapes for
|
|
42
|
+
gallery-specific metadata.
|
|
43
|
+
- Uploads run per-file via `Promise.allSettled`; a failed `onUploadFile` marks that item `error` in
|
|
44
|
+
the queue with a discard action, it does not throw or block the rest of the batch.
|
|
45
|
+
- Not react-hook-form bound — the parent owns `previews` state and persistence via the callbacks.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: useFieldController
|
|
3
|
+
category: forms
|
|
4
|
+
import: '@mantis-core/ui/components/Forms/useFieldController'
|
|
5
|
+
whenToUse: 'Hook every RHF field wrapper calls internally to wire useController + a stable id/aria/disabled/error-message resolution; call it directly only when hand-building a new field wrapper (see field-controller.md).'
|
|
6
|
+
baseLibrary: custom
|
|
7
|
+
formContract: FieldControllerProps
|
|
8
|
+
relatedComponents: ['FieldShell', 'TextField']
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props: []
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { FieldShell } from '@mantis-core/ui/components/Forms/FieldShell';
|
|
17
|
+
import { useFieldController, type FieldControllerProps } from '@mantis-core/ui/components/Forms/useFieldController';
|
|
18
|
+
import { useForm, type FieldValues, type FieldPath } from 'react-hook-form';
|
|
19
|
+
|
|
20
|
+
function RatingField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>(
|
|
21
|
+
props: FieldControllerProps<TFieldValues, TName>,
|
|
22
|
+
) {
|
|
23
|
+
const f = useFieldController<TFieldValues, TName>(props);
|
|
24
|
+
return (
|
|
25
|
+
<FieldShell id={f.id} label={props.label} errorMessage={f.errorMessage}>
|
|
26
|
+
<input
|
|
27
|
+
id={f.id}
|
|
28
|
+
type='number'
|
|
29
|
+
value={(f.field.value as number) ?? 0}
|
|
30
|
+
onChange={(e) => f.field.onChange(Number(e.target.value))}
|
|
31
|
+
onBlur={f.field.onBlur}
|
|
32
|
+
disabled={f.disabled}
|
|
33
|
+
{...f.aria}
|
|
34
|
+
/>
|
|
35
|
+
</FieldShell>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function Example() {
|
|
40
|
+
const { control } = useForm({ defaultValues: { rating: 0 } });
|
|
41
|
+
return <RatingField name='rating' control={control} label='Rating' />;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Notes
|
|
46
|
+
|
|
47
|
+
- Takes `FieldControllerProps` verbatim (no extra params) — see
|
|
48
|
+
[`field-controller.md`](../contracts/field-controller.md) for the full prop list.
|
|
49
|
+
- Returns `{ field, fieldState, formState, id, errorId, helpId, variant, size, fluid, invalid,
|
|
50
|
+
disabled, errorMessage, aria }`. `disabled` is `props.disabled || formState.isSubmitting`;
|
|
51
|
+
`aria` is `{ 'aria-invalid', 'aria-describedby' }` (error id wins over help id) — PR11's own
|
|
52
|
+
`invalid` prop only drives styling, so this hook is the one place aria-invalid gets emitted.
|
|
53
|
+
- Portal-based compounds (e.g. `Select`) have no native blur — call `field.onBlur()` from the
|
|
54
|
+
compound's `onOpenChange` (fired on close) instead of relying on a bare blur event, and spread
|
|
55
|
+
`aria` onto the trigger element rather than a hidden input.
|
|
56
|
+
- `TFieldValues` defaults to `FieldValues` (untyped): if a caller omits both `control` and an
|
|
57
|
+
explicit generic, `name` silently accepts any string — pass `control` (or an explicit generic) to
|
|
58
|
+
keep full path-typing.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: UserMenu
|
|
3
|
+
category: auth
|
|
4
|
+
import: '@mantis-core/ui/components/auth/UserMenu'
|
|
5
|
+
whenToUse: Topbar avatar-triggered dropdown (custom nav items + sign-out); no auth-lib coupling.
|
|
6
|
+
baseLibrary: '@primereact/ui/menu'
|
|
7
|
+
requiredStyles: []
|
|
8
|
+
relatedComponents: [Avatar]
|
|
9
|
+
relatedNextCore: []
|
|
10
|
+
props:
|
|
11
|
+
- { name: user, type: UserMenuUser, required: true, description: '{ name?, email?, avatarUrl? } — displayName falls back to email.' }
|
|
12
|
+
- { name: items, type: 'UserMenuItem[]', required: false, description: '{ label, icon?, href?, onClick? }; href navigates via next/navigation, otherwise onClick fires.' }
|
|
13
|
+
- { name: onSignOut, type: '() => void', required: false, description: 'When set, appends a separator + sign-out item.' }
|
|
14
|
+
- { name: signOutLabel, type: string, required: false, default: '"Cerrar sesión"' }
|
|
15
|
+
- { name: className, type: string, required: false }
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import UserMenu from '@mantis-core/ui/components/auth/UserMenu';
|
|
22
|
+
|
|
23
|
+
function Example() {
|
|
24
|
+
return (
|
|
25
|
+
<UserMenu
|
|
26
|
+
user={{ name: 'Diego Condo', email: 'diego@example.com' }}
|
|
27
|
+
items={[{ label: 'Perfil', icon: 'pi pi-user', href: '/perfil' }]}
|
|
28
|
+
onSignOut={() => console.log('sign out')}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
|
|
36
|
+
- Migrated to PR11's compound `Menu`: `Menu.Root` owns open state; `Menu.Trigger` renders `as="button"`
|
|
37
|
+
wrapping the migrated `Avatar`. No manual outside-click listener or inline dropdown (PR10 shape) left.
|
|
38
|
+
- Each entry fires through `onSelect` — `href` items call `router.push` (next/navigation), `onClick`
|
|
39
|
+
items just run their handler. `icon` is a PrimeIcons class string (e.g. `pi pi-cog`), not a component.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Storybook Implementation & VoBo Rules — Mantis Core PR11 Forms stage
|
|
2
|
+
|
|
3
|
+
This is the executable contract for finishing the PrimeReact 11 migration of the **reusable** surface
|
|
4
|
+
(Forms family + `Button` + Toast) using Storybook as the isolated workbench and sign-off (VoBo) surface.
|
|
5
|
+
A subagent implementing a component MUST follow **Rule Set 1**; a reviewer/supervisor signing off MUST
|
|
6
|
+
apply **Rule Set 2**. Non-Forms components and `apps/demo-prime11` are FROZEN this stage (do not touch).
|
|
7
|
+
|
|
8
|
+
Scope this stage: existing Forms wrappers (buckets A/B/C), `Button`, Toast migration, and the
|
|
9
|
+
`useDataTableQuery` hook. **Deferred** (segregated but NOT built now): CheckboxGroup, Knob, Listbox,
|
|
10
|
+
ToggleButtonGroup, ButtonGroup, SpeedDial.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Forms segregation by compatibility (READ FIRST)
|
|
15
|
+
|
|
16
|
+
`ifta`/`float` label modes and icon-fields (`InputGroup` addons) apply **only** to text-box inputs.
|
|
17
|
+
Wrapping a checkbox/rating/otp in `FloatLabel`/`IftaLabel`/`InputGroup` breaks the render. Fields are
|
|
18
|
+
segregated into buckets; the props contract is restricted per bucket so misuse fails at compile time.
|
|
19
|
+
|
|
20
|
+
| Bucket | Components | labelMode | Icon addons | Props contract |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| **A — text-box** | TextField, TextArea\*, NumberField, PasswordInput, SearchInput, MaskField, PhoneInput, SelectField, AutoCompleteField, DateField, TagsInput | `ifta` \| `float`(in/on/over) \| `beside` \| `none` | **Yes** (`addonBefore`/`addonAfter`) | `FieldControllerProps` (full) |
|
|
23
|
+
| **B1 — toggle inline** | CheckboxField, SwitchField, ToggleInlineButton | `beside` \| `none` (default `beside`) | No | `ChoiceFieldControllerProps` |
|
|
24
|
+
| **B2 — group/range** | RadioGroup, RangeSlider, RatingInput, OtpInput, ColorPickerInput | `top` \| `none` (default `top`) | No | `ChoiceFieldControllerProps` |
|
|
25
|
+
| **C — special** | CKEditorInput, FileDropzone (+UploadFilesPreview) → `top`/`none`; HiddenField → no shell | per row | No | own |
|
|
26
|
+
|
|
27
|
+
\* TextArea: label modes yes; icon addons limited/none (document it). PasswordInput/SearchInput/DateField
|
|
28
|
+
have a built-in icon/trigger — document interaction with `addonAfter`.
|
|
29
|
+
|
|
30
|
+
`ChoiceFieldControllerProps = Omit<FieldControllerProps, "labelMode"|"floatVariant"|"addonBefore"|"addonAfter"|"variant"> & { labelMode?: "beside"|"top"|"none" }`.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Rule Set 1 — Implementation
|
|
35
|
+
|
|
36
|
+
### 1a. General (every reusable component)
|
|
37
|
+
|
|
38
|
+
1. **Clean PR11 API.** No legacy PR10 aliases; named imports from PR11 subpaths; use the primitive's compound/headless model.
|
|
39
|
+
2. **Reusable wrapper contract.** Extend/compose the primitive props; **merge `className`/`style`** (never swallow); spread safe `...rest`; overrideable defaults; **typed variants**; `forwardRef` when focus/overlay/scroll/interop matters.
|
|
40
|
+
3. **Token styling.** Base tokens / CSS vars only; **no hardcoded colors**; keep the `mantis-core-*` namespace; `cssLayer` order `theme, base, primereact`.
|
|
41
|
+
4. **Layers.** `app → modules|components|lib`, `components → lib`. Forbidden: `components→modules`, `lib→modules`, `lib→app`.
|
|
42
|
+
5. **Strict typing.** No `any`; `pnpm -s tsc --noEmit` clean.
|
|
43
|
+
6. **Story required**, co-located, with the bucket's minimum set. No story ⇒ not done.
|
|
44
|
+
7. **Fix = root cause.** A defect a story reveals is fixed at the shared point, not patched per caller.
|
|
45
|
+
|
|
46
|
+
### 1b. Forms-specific (configurable fields + RHF)
|
|
47
|
+
|
|
48
|
+
8. **Every field routes through the shared contract:** `useFieldController` (RHF binding + aria + id) → `FieldShell` (label/addon/help/error). Do not re-implement binding or label placement in the field.
|
|
49
|
+
9. **Honor the axis per bucket:** A respects `labelMode`(ifta/float/beside/none), `floatVariant`, `variant`, `size`, `fluid` from `useFieldConfig` with per-prop override; B1/B2 use `ChoiceFieldControllerProps` (label `beside`/`top`/`none`, no float/ifta/addons/variant). Never hardcode an applicable axis.
|
|
50
|
+
10. **Wire value/onChange/onBlur** correctly to the PR11 primitive; **one** `useController` per component.
|
|
51
|
+
11. **Type coercion at the controller level** when the primitive emits a different shape than the form (NumberField, DateField, OtpInput…). Document the `field.value` shape.
|
|
52
|
+
12. **Icon groups only in bucket A** via `addonBefore`/`addonAfter`. Pass the addon **wrapped in `InputGroup.Addon`** (from `@primereact/ui/inputgroup`), e.g. `addonBefore={<InputGroup.Addon>@</InputGroup.Addon>}` — raw content (a bare `<span>`) renders detached/unstyled. `FieldShell` owns `InputGroup.Root`; the consumer never wraps the whole field. B/C expose no addons.
|
|
53
|
+
13. **Cross-field dependencies** use `useWatch` (never `watch()` in render).
|
|
54
|
+
14. **`required` marker is presentational**; validation lives in `rules`.
|
|
55
|
+
15. **Docs.** Update the component doc frontmatter / `catalog.json` (`pnpm gen:catalog`) with the `field.value` shape and supported config axes.
|
|
56
|
+
|
|
57
|
+
### Parametrization (cross-cutting)
|
|
58
|
+
|
|
59
|
+
Every component must be configurable **globally** (context provider: `MantisThemeProvider` → theme/colors/surfaces/dark + `FieldConfigProvider` → labelMode/floatVariant/variant/size/fluid) **or independently** (per-prop override). `Button` and Toast are parametrized by **theme tokens** (no hardcoded color). Everything is exercised from Storybook: global axes via toolbar `globalTypes`, overrides via per-story args.
|
|
60
|
+
|
|
61
|
+
### Story taxonomy (CSF3) — per bucket
|
|
62
|
+
|
|
63
|
+
Common to all: `Default`, `Playground` (args via `argTypes`), `Invalid` (with `errorMessage`), `Disabled`,
|
|
64
|
+
`HelpText`, `WithReactHookForm` (form-decorator with `defaultValues` + submit that shows the captured value).
|
|
65
|
+
Dark mode and size/variant are exercised via toolbar toggles, not separate stories.
|
|
66
|
+
|
|
67
|
+
- **A (text-box)** — add: `LabelModes` (matrix ifta / float·in / float·on / float·over / beside / none), `Sizes`, `Variants` (outlined/filled), `Fluid`, `WithAddons`. `Async`/`Empty` where applicable (Select/AutoComplete).
|
|
68
|
+
- **B1 (toggle inline)** — add: `LabelBeside`, `LabelNone`. NO float/ifta `LabelModes`, NO `WithAddons`.
|
|
69
|
+
- **B2 (group/range)** — add: `LabelTop`, `LabelNone`, plus control-specific stories (RadioGroup `Options`/`renderOption`, Rating `stars`, Slider `range`). NO float/ifta, NO addons.
|
|
70
|
+
- **C (special)** — a story fitting the component; no label/addon axes.
|
|
71
|
+
- **Button** — `Variants`, `Sizes`, `Severities`, `Outlined`, `Text`, `Rounded`, `Loading`, `Disabled`.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Rule Set 2 — Review & VoBo
|
|
76
|
+
|
|
77
|
+
A component gets VoBo only when **ALL** hold:
|
|
78
|
+
|
|
79
|
+
1. **Typing** — `pnpm -s tsc --noEmit` clean; no `any`; generics `<TFieldValues, TName>` correct.
|
|
80
|
+
2. **Best practices / lint** — `pnpm lint` clean; meets the wrapper contract (merge `className`, `...rest`, `forwardRef`, defaults, typed variants); no hardcoded colors.
|
|
81
|
+
3. **Scalability** — composes over the primitive (does not duplicate it); honors the config axis; no layer-breaking coupling.
|
|
82
|
+
4. **Meets Rule Set 1** — item-by-item (incl. 1b for Forms).
|
|
83
|
+
5. **Risk tests** — Vitest green: RHF (value shape, coercion), state, async, transformation.
|
|
84
|
+
6. **Visual VoBo (most important)** — in the running Storybook, walk **every** story: it looks right; styles not bugged; **no overflow / no "arrows sticking out"**; alignment/spacing/focus/hover/dark/size correct; overlays/portals positioned; **zero console errors**. Check each `labelMode`/`floatVariant` and the icon groups specifically.
|
|
85
|
+
7. **Supervisor VoBo** — final human sign-off, recorded per component in the ledger.
|
|
86
|
+
|
|
87
|
+
**Support automation (cheap, advisory):** a11y addon (axe) 0 violations per story; render-smoke with no console
|
|
88
|
+
errors. `@storybook/test-runner` (Playwright) and Chromatic are deferred — add only if manual visual review
|
|
89
|
+
stops scaling.
|
|
90
|
+
|
|
91
|
+
Record sign-off in `STORYBOOK_VOBO_LEDGER.md`. A component is not `done` until its row is complete and the
|
|
92
|
+
supervisor has signed.
|