@mantis-core/ui 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/COMPONENTS.md +115 -15
  2. package/docs/components/action-column.md +14 -13
  3. package/docs/components/admin-page-configurator.md +23 -0
  4. package/docs/components/admin-page-header.md +15 -17
  5. package/docs/components/admin-page-layout-shell.md +22 -0
  6. package/docs/components/admin-page-layout.md +11 -20
  7. package/docs/components/app-shell.md +20 -0
  8. package/docs/components/async-select.md +18 -17
  9. package/docs/components/avatar.md +19 -0
  10. package/docs/components/bar-chart.md +21 -0
  11. package/docs/components/breadcrumbs.md +15 -0
  12. package/docs/components/button.md +20 -15
  13. package/docs/components/card-skeleton.md +15 -0
  14. package/docs/components/change-password-form.md +17 -0
  15. package/docs/components/ckeditor-input.md +15 -16
  16. package/docs/components/color-picker-input.md +19 -0
  17. package/docs/components/combobox.md +19 -0
  18. package/docs/components/command-palette.md +17 -0
  19. package/docs/components/confirm-dialog.md +19 -17
  20. package/docs/components/currency-input.md +21 -0
  21. package/docs/components/data-state.md +15 -15
  22. package/docs/components/date-input.md +17 -18
  23. package/docs/components/date-presets.md +18 -0
  24. package/docs/components/date-range-input.md +20 -0
  25. package/docs/components/description-list.md +16 -0
  26. package/docs/components/dirty-form-guard.md +15 -23
  27. package/docs/components/donut-chart.md +21 -0
  28. package/docs/components/drawer.md +19 -0
  29. package/docs/components/drop-down.md +18 -20
  30. package/docs/components/empty-state.md +18 -0
  31. package/docs/components/error-boundary.md +17 -0
  32. package/docs/components/error-message.md +11 -9
  33. package/docs/components/file-dropzone.md +28 -16
  34. package/docs/components/filter-pannel.md +12 -14
  35. package/docs/components/forgot-password-form.md +18 -0
  36. package/docs/components/form-actions-bar.md +29 -18
  37. package/docs/components/form-field-render.md +16 -16
  38. package/docs/components/form-section.md +15 -11
  39. package/docs/components/form-wizard.md +18 -0
  40. package/docs/components/hidden-field.md +12 -15
  41. package/docs/components/index-column.md +12 -9
  42. package/docs/components/line-chart.md +21 -0
  43. package/docs/components/loading.md +14 -12
  44. package/docs/components/login-form.md +22 -0
  45. package/docs/components/map-picker-client.md +14 -14
  46. package/docs/components/map-picker-osm.md +16 -14
  47. package/docs/components/map-picker.md +14 -17
  48. package/docs/components/menu-button.md +14 -18
  49. package/docs/components/modal.md +20 -0
  50. package/docs/components/multi-select-filter.md +14 -16
  51. package/docs/components/multi-select.md +18 -19
  52. package/docs/components/number-input.md +17 -16
  53. package/docs/components/otp-input.md +18 -0
  54. package/docs/components/page-tabs.md +16 -0
  55. package/docs/components/page-title.md +11 -9
  56. package/docs/components/paginated-table.md +19 -26
  57. package/docs/components/pagination.md +15 -18
  58. package/docs/components/password-input.md +19 -0
  59. package/docs/components/phone-input.md +18 -0
  60. package/docs/components/radio-group.md +20 -0
  61. package/docs/components/range-slider.md +20 -0
  62. package/docs/components/rating-input.md +19 -0
  63. package/docs/components/render-field.md +15 -20
  64. package/docs/components/reset-password-form.md +17 -0
  65. package/docs/components/rich-text-preview.md +15 -14
  66. package/docs/components/search-input.md +19 -0
  67. package/docs/components/select.md +19 -19
  68. package/docs/components/stat-card.md +19 -0
  69. package/docs/components/status-badge.md +16 -10
  70. package/docs/components/switch.md +16 -19
  71. package/docs/components/table-filter-field.md +13 -17
  72. package/docs/components/table-skeleton.md +16 -0
  73. package/docs/components/table-toolbar.md +16 -15
  74. package/docs/components/tag.md +18 -0
  75. package/docs/components/tags-input.md +19 -0
  76. package/docs/components/text-area.md +16 -16
  77. package/docs/components/text-input.md +16 -15
  78. package/docs/components/time-picker.md +17 -14
  79. package/docs/components/timeline.md +15 -0
  80. package/docs/components/toggle-inline-button.md +17 -18
  81. package/docs/components/toggle.md +20 -17
  82. package/docs/components/upload-files-preview.md +20 -22
  83. package/docs/components/user-menu.md +19 -0
  84. package/docs/contracts/component-doc-schema.md +78 -0
  85. package/docs/contracts/dependency-map.md +68 -29
  86. package/docs/contracts/style-imports.md +38 -12
  87. package/llms.txt +106 -0
  88. package/package.json +2 -2
  89. package/PRIMEREACT_MAPPING.md +0 -6
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: RangeSlider
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/RangeSlider'
5
+ whenToUse: 'Dual-handle range slider that stores a [min, max] tuple; backed by PrimeReact Slider.'
6
+ baseLibrary: custom
7
+ formContract: ControllerProps
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: controller, type: ControllerProps, required: true }
11
+ - { name: min, type: number, required: false }
12
+ - { name: max, type: number, required: false }
13
+ - { name: step, type: number, required: false }
14
+ - { name: block, type: boolean, required: false }
15
+ ---
16
+ ## Example
17
+
18
+ ```tsx
19
+ <RangeSlider controller={{ name: 'priceRange' }} min={0} max={500000} step={1000} block />
20
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: RatingInput
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/RatingInput'
5
+ whenToUse: Star rating input (PrimeReact Rating) wired to react-hook-form; stores numeric value.
6
+ baseLibrary: custom
7
+ formContract: ControllerProps
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: controller, type: ControllerProps, required: true }
11
+ - { name: stars, type: number, required: false, default: '5' }
12
+ - { name: cancel, type: boolean, required: false }
13
+ - { name: block, type: boolean, required: false }
14
+ ---
15
+ ## Example
16
+
17
+ ```tsx
18
+ <RatingInput controller={{ name: 'score' }} stars={5} />
19
+ ```
@@ -1,24 +1,19 @@
1
- # RenderField
2
-
3
- - Export: `RenderField`
4
- - Extra exports: `RenderFieldProps`
5
- - Import: `import { RenderField } from "@mantis-core/ui";`
6
- - Base library: `react-hook-form` `Controller`
7
- - Base typing: `{ name: string; defaultValue?: any; control?: Control; render: (props: RenderProps) => ReactElement; rules?: RegisterOptions }`
8
- - Required styles: none
9
-
1
+ ---
2
+ name: RenderField
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/RenderField'
5
+ whenToUse: 'Low-level escape hatch: connects any custom UI to react-hook-form via a render prop.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: name, type: string, required: true }
10
+ - { name: render, type: '(props: RenderProps) => ReactElement', required: true }
11
+ - { name: defaultValue, type: any, required: false }
12
+ - { name: rules, type: RegisterOptions, required: false }
13
+ - { name: control, type: Control, required: false }
14
+ ---
10
15
  ## Example
11
16
 
12
17
  ```tsx
13
- <RenderField
14
- name="featured"
15
- control={form.control}
16
- render={({ field }) => (
17
- <input
18
- type="checkbox"
19
- checked={!!field.value}
20
- onChange={(e) => field.onChange(e.target.checked)}
21
- />
22
- )}
23
- />
18
+ <RenderField name='rating' render={({ field }) => <StarPicker value={field.value} onChange={field.onChange} />} />
24
19
  ```
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: ResetPasswordForm
3
+ category: auth
4
+ import: '@mantis-core/ui/components/auth/ResetPasswordForm'
5
+ whenToUse: New password + confirm form; caller owns token validation and API call.
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: onSubmit, type: '(values: ResetPasswordFormValues) => void | Promise<void>', required: true }
10
+ - { name: minPasswordLength, type: number, required: false, default: '8' }
11
+ - { name: className, type: string, required: false }
12
+ ---
13
+ ## Example
14
+
15
+ ```tsx
16
+ <ResetPasswordForm onSubmit={({ newPassword }) => resetPassword(token, newPassword)} />
17
+ ```
@@ -1,18 +1,19 @@
1
- # RichTextPreview
2
-
3
- - Export: `RichTextPreview`
4
- - Extra exports: `RichTextPreviewProps`
5
- - Import: `import { RichTextPreview } from "@mantis-core/ui";`
6
- - Base library: sanitized HTML renderer via `@mantis-core/utils`
7
- - Base typing: `{ html?: string | null; className?: string; sanitize?: boolean; size?: "sm" | "md" | "lg"; emptyFallback?: ReactNode }`
8
- - Required styles: `@mantis-core/styles/scss/rich-text-preview.scss`
9
-
1
+ ---
2
+ name: RichTextPreview
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/ui/RichTextPreview'
5
+ whenToUse: Safely renders a CKEditor HTML string with correct CKEditor content styles.
6
+ baseLibrary: custom
7
+ requiredStyles: [scss/rich-text-preview.scss]
8
+ relatedComponents: [CKEditorInput]
9
+ relatedNextCore: []
10
+ props:
11
+ - { name: content, type: string, required: true }
12
+ - { name: size, type: '''sm'' | ''md'' | ''lg''', required: false }
13
+ - { name: className, type: string, required: false }
14
+ ---
10
15
  ## Example
11
16
 
12
17
  ```tsx
13
- <RichTextPreview
14
- html={post.bodyHtml}
15
- size="lg"
16
- emptyFallback={<p>No content yet.</p>}
17
- />
18
+ <RichTextPreview content={post.body} size='md' />
18
19
  ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: SearchInput
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/SearchInput'
5
+ whenToUse: Debounced text input that calls onSearch instead of using react-hook-form; ideal for live table/list filtering.
6
+ baseLibrary: custom
7
+ formContract: ControllerProps
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: controller, type: ControllerProps, required: true }
11
+ - { name: onSearch, type: '(value: string) => void', required: false }
12
+ - { name: debounceMs, type: number, required: false, default: '300' }
13
+ - { name: block, type: boolean, required: false }
14
+ ---
15
+ ## Example
16
+
17
+ ```tsx
18
+ <SearchInput controller={{ name: 'q' }} onSearch={setQuery} debounceMs={400} block />
19
+ ```
@@ -1,25 +1,25 @@
1
- # Select
2
-
3
- - Export: `Select`
4
- - Import: `import { Select } from "@mantis-core/ui";`
5
- - Base library: `react-select` or `react-select/creatable`
6
- - Base typing: `Omit<ReactSelectProps, "name" | "defaultValue"> & { controller: ControllerProps; block?: boolean; variant?: ButtonVariant; isCreatable?: boolean; onCreateOption?; formatCreateLabel? }`
7
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
8
- - Required styles: `@mantis-core/styles/scss/select.scss`
9
-
1
+ ---
2
+ name: Select
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/Select'
5
+ whenToUse: Single-value searchable select (react-select); supports creatable mode.
6
+ baseLibrary: react-select
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/select.scss]
9
+ relatedComponents: [FormFieldRender, AsyncSelect, DropDown]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: options, type: OptionsOrGroups, required: false }
14
+ - { name: isCreatable, type: boolean, required: false, default: 'false' }
15
+ - { name: variant, type: ButtonVariant, required: false, default: '''primary''' }
16
+ - { name: block, type: boolean, required: false }
17
+ - { name: isLoading, type: boolean, required: false }
18
+ ---
10
19
  ## Example
11
20
 
12
21
  ```tsx
13
- <Select
14
- controller={{ name: "agent", control: form.control }}
15
- block
16
- variant="secondary"
17
- options={[
18
- { label: "Alice", value: "alice" },
19
- { label: "Bob", value: "bob" },
20
- ]}
21
- isClearable
22
- />
22
+ <Select controller={{ name: 'status' }} options={statusOptions} block />
23
23
  ```
24
24
 
25
25
  ## Notes
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: StatCard
3
+ category: data
4
+ import: '@mantis-core/ui/components/data/StatCard'
5
+ whenToUse: 'KPI card showing a metric label, large value, optional icon, trend indicator, and footer.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: label, type: string, required: true }
10
+ - { name: value, type: ReactNode, required: true }
11
+ - { name: icon, type: ReactNode, required: false }
12
+ - { name: trend, type: '{ value: number; direction: ''up'' | ''down'' }', required: false }
13
+ - { name: footer, type: ReactNode, required: false }
14
+ ---
15
+ ## Example
16
+
17
+ ```tsx
18
+ <StatCard label='Leads' value={142} icon={<i className='pi pi-users' />} trend={{ value: 12, direction: 'up' }} />
19
+ ```
@@ -1,14 +1,20 @@
1
- # StatusBadge
2
-
3
- - Export: `StatusBadge`
4
- - Extra exports: `StatusBadgeProps`, `StatusBadgeTone`, `StatusBadgeSize`
5
- - Import: `import { StatusBadge } from "@mantis-core/ui";`
6
- - Base library: custom span primitive
7
- - Base typing: `Omit<HTMLAttributes<HTMLSpanElement>, "children"> & { label?: ReactNode; tone?: "success" | "muted" | "warning" | "info" | "danger"; size?: "sm" | "md"; block?: boolean; children?: ReactNode }`
8
- - Required styles: `@mantis-core/styles/scss/status-badge.scss`
9
-
1
+ ---
2
+ name: StatusBadge
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/ui/StatusBadge'
5
+ whenToUse: Colored pill badge to communicate a status or label with semantic tone.
6
+ baseLibrary: custom
7
+ requiredStyles: [scss/status-badge.scss]
8
+ relatedComponents: [DataState]
9
+ relatedNextCore: []
10
+ props:
11
+ - { name: label, type: ReactNode, required: false }
12
+ - { name: tone, type: '''success'' | ''muted'' | ''warning'' | ''info'' | ''danger''', required: false, default: '''muted''' }
13
+ - { name: size, type: '''sm'' | ''md''', required: false, default: '''md''' }
14
+ - { name: block, type: boolean, required: false }
15
+ ---
10
16
  ## Example
11
17
 
12
18
  ```tsx
13
- <StatusBadge tone="success" size="sm" label="Published" />
19
+ <StatusBadge label='Activo' tone='success' />
14
20
  ```
@@ -1,25 +1,22 @@
1
- # Switch
2
-
3
- - Export: `Switch`
4
- - Extra exports: `SwitchProps`
5
- - Import: `import { Switch } from "@mantis-core/ui";`
6
- - Base library: custom bootstrap-switch-like markup
7
- - Base typing: `ControllerProps & { onLabel?; offLabel?; size?; onStyle?; offStyle?; width?; height?; disabled?; onChange?; className?; style? }`
8
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
9
- - Required styles: `@mantis-core/styles/scss/switch.scss`
10
-
1
+ ---
2
+ name: Switch
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/Switch'
5
+ whenToUse: Toggle/boolean switch wired to react-hook-form.
6
+ baseLibrary: custom
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/switch.scss]
9
+ relatedComponents: [FormFieldRender, Toggle]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: label, type: string, required: false }
14
+ - { name: block, type: boolean, required: false }
15
+ ---
11
16
  ## Example
12
17
 
13
18
  ```tsx
14
- <Switch
15
- name="enabled"
16
- control={form.control}
17
- defaultValue={true}
18
- onLabel="Enabled"
19
- offLabel="Disabled"
20
- onStyle="success"
21
- offStyle="light"
22
- />
19
+ <Switch controller={{ name: 'isActive' }} label='Active' />
23
20
  ```
24
21
 
25
22
  ## Notes
@@ -1,21 +1,17 @@
1
- # TableFilterField
2
-
3
- - Export: `TableFilterField`
4
- - Extra exports: `TableFilterFieldProps`
5
- - Import: `import { TableFilterField } from "@mantis-core/ui";`
6
- - Base library: custom filter wrapper
7
- - Base typing: `{ label: ReactNode; htmlFor: string; children: ReactNode; className?: string; labelClassName?: string }`
8
- - Required styles: `@mantis-core/styles/scss/table.scss`
9
-
1
+ ---
2
+ name: TableFilterField
3
+ category: tables
4
+ import: '@mantis-core/ui/components/table-filter-field'
5
+ whenToUse: Wraps a form control inside FilterPannel with a label; provides consistent layout.
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: label, type: string, required: true }
10
+ - { name: htmlFor, type: string, required: false }
11
+ - { name: className, type: string, required: false }
12
+ ---
10
13
  ## Example
11
14
 
12
15
  ```tsx
13
- <TableFilterField label="Status" htmlFor="status-filter">
14
- <DropDown
15
- controller={{ name: "status", control: form.control }}
16
- block
17
- inputId="status-filter"
18
- options={statusOptions}
19
- />
20
- </TableFilterField>
16
+ <TableFilterField label='Status' htmlFor='filter-status'><DropDown controller={{ name: 'status' }} options={statusOpts} /></TableFilterField>
21
17
  ```
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: TableSkeleton
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/feedback/TableSkeleton'
5
+ whenToUse: Animated skeleton placeholder that mimics a table grid while data loads.
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: rows, type: number, required: false, default: '5' }
10
+ - { name: columns, type: number, required: false, default: '4' }
11
+ ---
12
+ ## Example
13
+
14
+ ```tsx
15
+ <TableSkeleton rows={8} columns={5} />
16
+ ```
@@ -1,19 +1,20 @@
1
- # TableToolbar
2
-
3
- - Export: `TableToolbar`
4
- - Extra exports: `TableToolbarProps`
5
- - Import: `import { TableToolbar } from "@mantis-core/ui";`
6
- - Base library: custom layout
7
- - Base typing: `{ title?: ReactNode; totalRecords?: number; meta?: ReactNode; actions?: ReactNode; className?: string; copyClassName?: string; actionsClassName?: string }`
8
- - Required styles: `@mantis-core/styles/scss/table.scss`
9
-
1
+ ---
2
+ name: TableToolbar
3
+ category: tables
4
+ import: '@mantis-core/ui/components/table-toolbar'
5
+ whenToUse: 'Header bar above a table showing title, record count, and action buttons slot.'
6
+ baseLibrary: custom
7
+ relatedComponents: [PaginatedTable, Button]
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: title, type: ReactNode, required: false }
11
+ - { name: totalRecords, type: number, required: false }
12
+ - { name: actions, type: ReactNode, required: false }
13
+ - { name: meta, type: ReactNode, required: false }
14
+ - { name: className, type: string, required: false }
15
+ ---
10
16
  ## Example
11
17
 
12
18
  ```tsx
13
- <TableToolbar
14
- title="Listings"
15
- totalRecords={total}
16
- meta="Updated today"
17
- actions={<Button label="New listing" icon="pi pi-plus" />}
18
- />
19
+ <TableToolbar title='Users' totalRecords={total} actions={<Button label='New' onClick={onCreate} />} />
19
20
  ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: Tag
3
+ category: feedback
4
+ import: '@mantis-core/ui/components/feedback/Tag'
5
+ whenToUse: 'Styled label chip (PrimeReact Tag wrapper with Mantis Core CSS); use for status labels, categories, or counts.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: value, type: ReactNode, required: false }
10
+ - { name: severity, type: '''success'' | ''info'' | ''warning'' | ''danger'' | null', required: false }
11
+ - { name: icon, type: string, required: false }
12
+ - { name: rounded, type: boolean, required: false }
13
+ ---
14
+ ## Example
15
+
16
+ ```tsx
17
+ <Tag value='Vendido' severity='success' rounded />
18
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: TagsInput
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/TagsInput'
5
+ whenToUse: 'Chip/tags input (PrimeReact Chips) wired to react-hook-form; stores value as string[].'
6
+ baseLibrary: custom
7
+ formContract: ControllerProps
8
+ relatedNextCore: []
9
+ props:
10
+ - { name: controller, type: ControllerProps, required: true }
11
+ - { name: placeholder, type: string, required: false }
12
+ - { name: max, type: number, required: false }
13
+ - { name: block, type: boolean, required: false }
14
+ ---
15
+ ## Example
16
+
17
+ ```tsx
18
+ <TagsInput controller={{ name: 'amenities' }} placeholder='Agregar etiqueta...' block />
19
+ ```
@@ -1,20 +1,20 @@
1
- # TextArea
2
-
3
- - Export: `TextArea`
4
- - Extra exports: `TextAreaProps`
5
- - Import: `import { TextArea } from "@mantis-core/ui";`
6
- - Base library: `primereact/inputtextarea`
7
- - Base typing: `Omit<InputTextareaProps, "name" | "defaultValue" | "ref" | "onChange"> & { controller: ControllerProps; block?: boolean; loading?: boolean }`
8
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
9
- - Required styles: `@mantis-core/styles/scss/inputs.scss`
10
-
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/inputtextarea
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/inputs.scss]
9
+ relatedComponents: [FormFieldRender, TextInput]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: block, type: boolean, required: false }
14
+ - { name: rows, type: number, required: false }
15
+ ---
11
16
  ## Example
12
17
 
13
18
  ```tsx
14
- <TextArea
15
- controller={{ name: "description", control: form.control }}
16
- block
17
- rows={6}
18
- autoResize
19
- />
19
+ <TextArea controller={{ name: 'description' }} rows={4} block />
20
20
  ```
@@ -1,21 +1,22 @@
1
- # TextInput
2
-
3
- - Export: `TextInput`
4
- - Extra exports: `TextInputProps`
5
- - Import: `import { TextInput } from "@mantis-core/ui";`
6
- - Base library: `primereact/inputtext`
7
- - Base typing: `Omit<InputTextProps, "name" | "defaultValue"> & { controller: ControllerProps; block?: boolean; defaultValue?: string }`
8
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
9
- - Required styles: `@mantis-core/styles/scss/inputs.scss`
10
-
1
+ ---
2
+ name: TextInput
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/TextInput'
5
+ whenToUse: Single-line text field wired to react-hook-form.
6
+ baseLibrary: primereact/inputtext
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/inputs.scss]
9
+ relatedComponents: [FormFieldRender, TextArea]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true }
13
+ - { name: block, type: boolean, required: false, default: 'false' }
14
+ - { name: defaultValue, type: string, required: false, default: '''''' }
15
+ ---
11
16
  ## Example
12
17
 
13
18
  ```tsx
14
- <TextInput
15
- controller={{ name: "title", control: form.control }}
16
- block
17
- placeholder="Listing title"
18
- />
19
+ <TextInput controller={{ name: 'email', rules: { required: true } }} block />
19
20
  ```
20
21
 
21
22
  ## Notes
@@ -1,20 +1,23 @@
1
- # TimePicker
2
-
3
- - Export: `TimePicker`
4
- - Import: `import { TimePicker } from "@mantis-core/ui";`
5
- - Base library: `react-datepicker`
6
- - Base typing: explicit `TimePickerProps`
7
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
8
- - Required styles: none
9
-
1
+ ---
2
+ name: TimePicker
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/TimePicker'
5
+ whenToUse: Time-only picker (15-min intervals) wired to react-hook-form; renders as a styled InputText trigger.
6
+ baseLibrary: react-datepicker
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/inputs.scss]
9
+ relatedNextCore: []
10
+ props:
11
+ - { name: controller, type: ControllerProps, required: true, description: 'react-hook-form controller config' }
12
+ - { name: block, type: boolean, required: false, default: 'false', description: 'Expand to full width' }
13
+ - { name: datePicker, type: DatePickerProps, required: false, description: 'Passthrough props for react-datepicker' }
14
+ - { name: className, type: string, required: false, description: 'Additional CSS class on the DatePicker wrapper' }
15
+ - { name: timePeriod, type: '''AM'' | ''PM''', required: false, description: 'Default time period hint' }
16
+ ---
10
17
  ## Example
11
18
 
12
19
  ```tsx
13
- <TimePicker
14
- controller={{ name: "openingTime", control: form.control }}
15
- block
16
- datePicker={{ showTimeSelectOnly: true, timeIntervals: 30 }}
17
- />
20
+ {/* TODO: add example */}
18
21
  ```
19
22
 
20
23
  ## Notes
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: Timeline
3
+ category: data
4
+ import: '@mantis-core/ui/components/data/Timeline'
5
+ whenToUse: 'Vertical event timeline backed by PrimeReact Timeline; items render title, description, date, and optional icon.'
6
+ baseLibrary: custom
7
+ relatedNextCore: []
8
+ props:
9
+ - { name: items, type: '{ title: string; description?: string; date?: string; icon?: ReactNode; color?: string }[]', required: true }
10
+ ---
11
+ ## Example
12
+
13
+ ```tsx
14
+ <Timeline items={[{ title: 'Lead creado', date: '2025-01-10', description: 'Formulario web' }, { title: 'Contactado', date: '2025-01-11' }]} />
15
+ ```
@@ -1,22 +1,21 @@
1
- # ToggleInlineButton
2
-
3
- - Export: `ToggleInlineButton`
4
- - Extra exports: `ToggleInlineButtonProps`
5
- - Import: `import { ToggleInlineButton } from "@mantis-core/ui";`
6
- - Base library: `primereact/selectbutton`
7
- - Base typing: `{ controller: ControllerProps; options: any[]; variant?: ButtonVariant; multiple?: boolean }`
8
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
9
- - Required styles: `@mantis-core/styles/scss/select-button.scss`
10
-
1
+ ---
2
+ name: ToggleInlineButton
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/ToggleInlineButton'
5
+ whenToUse: Segmented button group (single or multi-select) wired to react-hook-form via a controller prop.
6
+ baseLibrary: primereact/selectbutton
7
+ formContract: ControllerProps
8
+ requiredStyles: [scss/select-button.scss]
9
+ relatedComponents: [FormFieldRender]
10
+ relatedNextCore: []
11
+ props:
12
+ - { name: controller, type: ControllerProps, required: true, description: 'react-hook-form controller config' }
13
+ - { name: options, type: 'any[]', required: true, description: 'Options array passed to SelectButton' }
14
+ - { name: variant, type: ButtonVariant, required: false, default: '''primary''', description: 'Design-system color variant' }
15
+ - { name: multiple, type: boolean, required: false, default: 'false', description: 'Allow selecting multiple options' }
16
+ ---
11
17
  ## Example
12
18
 
13
19
  ```tsx
14
- <ToggleInlineButton
15
- controller={{ name: "visibility", control: form.control }}
16
- variant="accent"
17
- options={[
18
- { label: "Public", value: "public" },
19
- { label: "Private", value: "private" },
20
- ]}
21
- />
20
+ {/* TODO: add example */}
22
21
  ```
@@ -1,21 +1,24 @@
1
- # Toggle
2
-
3
- - Export: `Toggle`
4
- - Extra exports: `ToggleProps`
5
- - Import: `import { Toggle } from "@mantis-core/ui";`
6
- - Base library: `primereact/checkbox`
7
- - Base typing: `ControllerProps & { on?; off?; size?; offstyle?; onstyle?; onClick?; active? }`
8
- - Form contract: [`ControllerProps`](../contracts/controller-props.md)
9
- - Required styles: none
10
-
1
+ ---
2
+ name: Toggle
3
+ category: forms
4
+ import: '@mantis-core/ui/components/Forms/Toggle'
5
+ whenToUse: Checkbox-based boolean toggle wired to react-hook-form with configurable on/off labels.
6
+ baseLibrary: primereact/checkbox
7
+ formContract: ControllerProps
8
+ relatedComponents: [FormFieldRender, Switch]
9
+ relatedNextCore: []
10
+ props:
11
+ - { name: controller, type: ControllerProps, required: true, description: 'react-hook-form controller config (name, rules, defaultValue)' }
12
+ - { name: on, type: 'string | any', required: false, default: '''SI''', description: 'Label shown when value is true' }
13
+ - { name: off, type: 'string | any', required: false, default: '''NO''', description: 'Label shown when value is false' }
14
+ - { name: size, type: '''sm'' | ''lg'' | ''md''', required: false, description: 'Visual size variant' }
15
+ - { name: offstyle, type: '''primary'' | ''secondary'' | ''dark''', required: false, description: 'Style when off' }
16
+ - { name: onstyle, type: '''primary'' | ''secondary'' | ''dark''', required: false, description: 'Style when on' }
17
+ - { name: onClick, type: any, required: false, description: 'Click handler passthrough' }
18
+ - { name: active, type: boolean, required: false, description: 'Controlled active state' }
19
+ ---
11
20
  ## Example
12
21
 
13
22
  ```tsx
14
- <Toggle
15
- name="published"
16
- control={form.control}
17
- defaultValue={false}
18
- on="YES"
19
- off="NO"
20
- />
23
+ {/* TODO: add example */}
21
24
  ```