@machinemetrics/mm-react-components 1.5.0-0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -31
- package/README.md +0 -27
- package/agent-docs/agent-documentation-reference.md +13 -106
- package/agent-docs/ai-agent-guide.md +13 -15
- package/agent-docs/ai-agent-init-guide.md +1 -1
- package/agent-docs/chakra-migration-readme.md +7 -6
- package/agent-docs/chakra-migration-troubleshooting.md +8 -8
- package/agent-docs/component-mapping-reference.md +46 -12
- package/agent-docs/{cursor-skill-mm-carbide.md → cursor-skill-components.md} +18 -14
- package/agent-docs/lovable.md +0 -1
- package/dist/README.md +0 -27
- package/dist/components/ui/accordion.d.ts +2 -9
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +2 -11
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert.d.ts +3 -4
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/avatar.d.ts +1 -5
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +1 -9
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +1 -7
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +3 -25
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/collapsible.d.ts +1 -22
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/command.d.ts +0 -3
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/data-table/pagination.d.ts.map +1 -1
- package/dist/components/ui/data-table/toolbar/DataTableToolbar.d.ts.map +1 -1
- package/dist/components/ui/data-table/toolbar/filters/FilterMenu.d.ts.map +1 -1
- package/dist/components/ui/data-table/toolbar/filters/index.d.ts +0 -2
- package/dist/components/ui/data-table/toolbar/filters/index.d.ts.map +1 -1
- package/dist/components/ui/date-picker.d.ts +1 -8
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/date-range-picker.d.ts +8 -2
- package/dist/components/ui/date-range-picker.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +2 -12
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +2 -16
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/form.d.ts +1 -19
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +0 -21
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/popover.d.ts +2 -11
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +2 -10
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/sheet-banner.d.ts +1 -1
- package/dist/components/ui/sheet-banner.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +1 -4
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/table.d.ts +2 -8
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +26 -5
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +0 -6
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts +1 -6
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/cursor-skill/components/SKILL.md +231 -0
- package/dist/cursor-skill/components/component-structure.md +33 -0
- package/dist/cursor-skill/components/reference.md +39 -0
- package/dist/cursor-skill/{mm-carbide → components}/widget-rules.md +16 -50
- package/dist/docs/GETTING_STARTED.md +0 -26
- package/dist/index.d.ts +3 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/mm-react-components.css +1 -1
- package/dist/mm-react-components.es.js +816 -971
- package/dist/mm-react-components.es.js.map +1 -1
- package/dist/mm-react-components.umd.js +1 -1
- package/dist/mm-react-components.umd.js.map +1 -1
- package/dist/preview/AccordionPreview.d.ts.map +1 -1
- package/dist/preview/BreadcrumbPreview.d.ts.map +1 -1
- package/dist/preview/ButtonPreview.d.ts.map +1 -1
- package/dist/preview/CardPreview.d.ts.map +1 -1
- package/dist/preview/CollapsiblePreview.d.ts.map +1 -1
- package/dist/preview/DataTableLimitationsPreview.d.ts.map +1 -1
- package/dist/preview/DateRangePickerPreview.d.ts.map +1 -1
- package/dist/preview/SearchInputPreview.d.ts +2 -0
- package/dist/preview/SearchInputPreview.d.ts.map +1 -0
- package/dist/preview/SheetBannerPreview.d.ts.map +1 -1
- package/dist/preview/SimplePaginationPreview.d.ts +2 -0
- package/dist/preview/SimplePaginationPreview.d.ts.map +1 -0
- package/dist/preview/SpinnerCarbidePreview.d.ts +2 -0
- package/dist/preview/SpinnerCarbidePreview.d.ts.map +1 -0
- package/dist/scripts/init.cjs +3 -3
- package/dist/scripts/install-skill.cjs +425 -47
- package/dist/themes/carbide.css +21 -234
- package/package.json +6 -5
- package/agent-docs/tickets-pattern.md +0 -78
- package/dist/components/ui/data-table/toolbar/filters/FilterControl.d.ts +0 -14
- package/dist/components/ui/data-table/toolbar/filters/FilterControl.d.ts.map +0 -1
- package/dist/components/ui/data-table/toolbar/filters/InlineFilterMenu.d.ts +0 -13
- package/dist/components/ui/data-table/toolbar/filters/InlineFilterMenu.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/get-range-calendar-selected.d.ts +0 -8
- package/dist/components/ui/date-range-picker/get-range-calendar-selected.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/hooks/use-date-range-picker-state.d.ts +0 -38
- package/dist/components/ui/date-range-picker/hooks/use-date-range-picker-state.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/index.d.ts +0 -9
- package/dist/components/ui/date-range-picker/index.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/company-day-settings-row.d.ts +0 -7
- package/dist/components/ui/date-range-picker/parts/company-day-settings-row.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/custom-hours-selects.d.ts +0 -8
- package/dist/components/ui/date-range-picker/parts/custom-hours-selects.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/date-range-picker-cancel-apply-buttons.d.ts +0 -10
- package/dist/components/ui/date-range-picker/parts/date-range-picker-cancel-apply-buttons.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/date-range-picker-clear-button.d.ts +0 -5
- package/dist/components/ui/date-range-picker/parts/date-range-picker-clear-button.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/date-range-picker-trigger.d.ts +0 -24
- package/dist/components/ui/date-range-picker/parts/date-range-picker-trigger.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/dual-month-range-calendars.d.ts +0 -15
- package/dist/components/ui/date-range-picker/parts/dual-month-range-calendars.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/full-variant-header.d.ts +0 -2
- package/dist/components/ui/date-range-picker/parts/full-variant-header.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/preset-sidebar.d.ts +0 -9
- package/dist/components/ui/date-range-picker/parts/preset-sidebar.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/parts/range-calendar.d.ts +0 -16
- package/dist/components/ui/date-range-picker/parts/range-calendar.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/presets.d.ts +0 -34
- package/dist/components/ui/date-range-picker/presets.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/types.d.ts +0 -29
- package/dist/components/ui/date-range-picker/types.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/utils.d.ts +0 -24
- package/dist/components/ui/date-range-picker/utils.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/variants/full.d.ts +0 -11
- package/dist/components/ui/date-range-picker/variants/full.d.ts.map +0 -1
- package/dist/components/ui/date-range-picker/variants/simple.d.ts +0 -9
- package/dist/components/ui/date-range-picker/variants/simple.d.ts.map +0 -1
- package/dist/components/ui/kanban/KanbanBoard.d.ts +0 -8
- package/dist/components/ui/kanban/KanbanBoard.d.ts.map +0 -1
- package/dist/components/ui/kanban/KanbanCard.d.ts +0 -8
- package/dist/components/ui/kanban/KanbanCard.d.ts.map +0 -1
- package/dist/components/ui/kanban/KanbanCardOverlay.d.ts +0 -8
- package/dist/components/ui/kanban/KanbanCardOverlay.d.ts.map +0 -1
- package/dist/components/ui/kanban/KanbanColumn.d.ts +0 -8
- package/dist/components/ui/kanban/KanbanColumn.d.ts.map +0 -1
- package/dist/components/ui/kanban/KanbanContext.d.ts +0 -28
- package/dist/components/ui/kanban/KanbanContext.d.ts.map +0 -1
- package/dist/components/ui/kanban/dragEndUtils.d.ts +0 -26
- package/dist/components/ui/kanban/dragEndUtils.d.ts.map +0 -1
- package/dist/components/ui/kanban/index.d.ts +0 -9
- package/dist/components/ui/kanban/index.d.ts.map +0 -1
- package/dist/components/ui/kanban/types.d.ts +0 -58
- package/dist/components/ui/kanban/types.d.ts.map +0 -1
- package/dist/components/ui/status/index.d.ts +0 -7
- package/dist/components/ui/status/index.d.ts.map +0 -1
- package/dist/components/ui/status/status-badge.d.ts +0 -17
- package/dist/components/ui/status/status-badge.d.ts.map +0 -1
- package/dist/components/ui/status/status-intent.d.ts +0 -21
- package/dist/components/ui/status/status-intent.d.ts.map +0 -1
- package/dist/components/ui/status/status-progress.d.ts +0 -20
- package/dist/components/ui/status/status-progress.d.ts.map +0 -1
- package/dist/components/ui/tabs/index.d.ts +0 -6
- package/dist/components/ui/tabs/index.d.ts.map +0 -1
- package/dist/components/ui/tabs/scroll-tabs-row.d.ts +0 -6
- package/dist/components/ui/tabs/scroll-tabs-row.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs-constants.d.ts +0 -11
- package/dist/components/ui/tabs/tabs-constants.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs-content.d.ts +0 -5
- package/dist/components/ui/tabs/tabs-content.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs-context.d.ts +0 -9
- package/dist/components/ui/tabs/tabs-context.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs-list-underline.d.ts +0 -7
- package/dist/components/ui/tabs/tabs-list-underline.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs-list.d.ts +0 -8
- package/dist/components/ui/tabs/tabs-list.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs-trigger.d.ts +0 -7
- package/dist/components/ui/tabs/tabs-trigger.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs-variants.d.ts +0 -7
- package/dist/components/ui/tabs/tabs-variants.d.ts.map +0 -1
- package/dist/components/ui/tabs/tabs.d.ts +0 -15
- package/dist/components/ui/tabs/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs/use-tabs-underline-scroll.d.ts +0 -15
- package/dist/components/ui/tabs/use-tabs-underline-scroll.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketActivitySection.d.ts +0 -20
- package/dist/components/ui/tickets/TicketActivitySection.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketDates.d.ts +0 -20
- package/dist/components/ui/tickets/TicketDates.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketDetailLayout.d.ts +0 -32
- package/dist/components/ui/tickets/TicketDetailLayout.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketDetails.d.ts +0 -34
- package/dist/components/ui/tickets/TicketDetails.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketDetailsSidebar.d.ts +0 -21
- package/dist/components/ui/tickets/TicketDetailsSidebar.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketFieldControl.d.ts +0 -32
- package/dist/components/ui/tickets/TicketFieldControl.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketForm.d.ts +0 -22
- package/dist/components/ui/tickets/TicketForm.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketLabels.d.ts +0 -57
- package/dist/components/ui/tickets/TicketLabels.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketTypes.d.ts +0 -67
- package/dist/components/ui/tickets/TicketTypes.d.ts.map +0 -1
- package/dist/components/ui/tickets/TicketUserSelect.d.ts +0 -17
- package/dist/components/ui/tickets/TicketUserSelect.d.ts.map +0 -1
- package/dist/components/ui/tickets/UserDisplay.d.ts +0 -21
- package/dist/components/ui/tickets/UserDisplay.d.ts.map +0 -1
- package/dist/components/ui/tickets/UserFieldValue.d.ts +0 -24
- package/dist/components/ui/tickets/UserFieldValue.d.ts.map +0 -1
- package/dist/components/ui/tickets/index.d.ts +0 -12
- package/dist/components/ui/tickets/index.d.ts.map +0 -1
- package/dist/cursor-skill/mm-carbide/SKILL.md +0 -84
- package/dist/cursor-skill/mm-carbide/reference.md +0 -71
- package/dist/lib/normalize-host-color-mode.d.ts +0 -6
- package/dist/lib/normalize-host-color-mode.d.ts.map +0 -1
- package/dist/lib/theme-root.d.ts +0 -18
- package/dist/lib/theme-root.d.ts.map +0 -1
- package/dist/lib/use-host-theme.d.ts +0 -15
- package/dist/lib/use-host-theme.d.ts.map +0 -1
- package/dist/lib/with-display-name.d.ts +0 -2
- package/dist/lib/with-display-name.d.ts.map +0 -1
- package/dist/preview/KanbanPreview.d.ts +0 -2
- package/dist/preview/KanbanPreview.d.ts.map +0 -1
- package/dist/preview/StatusPreview.d.ts +0 -2
- package/dist/preview/StatusPreview.d.ts.map +0 -1
- package/dist/preview/TicketsPreview.d.ts +0 -2
- package/dist/preview/TicketsPreview.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,46 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.0] - 2026-08-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`components` skill for AI coding assistants:** the package now ships a
|
|
13
|
+
canonical skill (`dist/cursor-skill/components/`) that steers agents to
|
|
14
|
+
current mm-react-components guidance, installable into Cursor, VS Code
|
|
15
|
+
Copilot, Claude Code, and Gemini CLI via `npx mm-install-skill` (and
|
|
16
|
+
`mm-init`). Replaces the outdated `mm-carbide` skill: a managed legacy
|
|
17
|
+
install triggers a migration warning; user files are never deleted, and
|
|
18
|
+
locally modified managed files are backed up to non-colliding `.bak` names.
|
|
19
|
+
- **Authoring gates in `npm run verify`:** `check:theme-parity` (light/dark
|
|
20
|
+
rule and token parity in `carbide.css`; theme-invariant rules skipped
|
|
21
|
+
automatically; exemptions recorded and announced) and
|
|
22
|
+
`check:component-artifacts` (the eight-artifacts checklist per component,
|
|
23
|
+
resolving `data-slot`s through imports and matching real export names).
|
|
24
|
+
Baselines grandfather pre-existing gaps so only new drift fails.
|
|
25
|
+
- **`scripts/scaffold-component.cjs`:** generates the eight-artifact skeleton
|
|
26
|
+
for a new component; refuses on collisions; `--dry-run` previews.
|
|
27
|
+
- **`npm run verify:component`:** scoped iteration gate (changed-component
|
|
28
|
+
detection, scoped lint, incremental type-check, both checkers, only your
|
|
29
|
+
visual spec) — seconds per loop instead of the full verify.
|
|
30
|
+
- **Previews and both-theme visual coverage** for `SearchInput`,
|
|
31
|
+
`SimplePagination`, and `SpinnerCarbide`; `date-range-picker` spec renamed
|
|
32
|
+
to match conventions.
|
|
33
|
+
- **`agent-docs/component-mapping-reference.md`:** mapping rows for 25
|
|
34
|
+
previously undocumented components.
|
|
35
|
+
- Repo-local `add-component` authoring skill documenting the eight-artifact
|
|
36
|
+
contract for library contributors.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- Shipped agent docs converged on the `components` skill contract (no shadcn
|
|
41
|
+
fallback recommendations or palette-class guidance).
|
|
42
|
+
|
|
43
|
+
### Security
|
|
44
|
+
|
|
45
|
+
- Dependency audit fixes: 0 known vulnerabilities remaining (undici, vite,
|
|
46
|
+
postcss/nanoid, brace-expansion, and @babel/core chains bumped).
|
|
47
|
+
|
|
8
48
|
## [1.4.0] - 2026-06-17
|
|
9
49
|
|
|
10
50
|
### Added
|
|
@@ -96,37 +136,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
96
136
|
|
|
97
137
|
- Preview app: `CodePreview` route remains hash-only for tests; sidebar exclusions updated. Preview build trims `esbuild.keepNames` where snippet naming no longer requires it.
|
|
98
138
|
|
|
99
|
-
## [Unreleased]
|
|
100
|
-
|
|
101
|
-
### Changed
|
|
102
|
-
|
|
103
|
-
- **TicketDetails:** Two-column **narrative + metadata** layout: header includes ticket id, title, and **status / priority / due** (keys `status`, `priority`, `dueDate`, `due`); main column is **description** then **Activity** with **All / Comments / Updates** tabs; right rail is **Details** (people), **Dates**, and **Custom fields** with optional **Show more** and sticky positioning on large viewports. Optional `onBack` and `onAddCustomField`. `data-slot` hooks for Carbide theming.
|
|
104
|
-
- **`partitionDetailFields`:** Now returns `headerFields`, `mainColumnFields`, `sidebarPeopleFields`, `sidebarDateFields`, `sidebarCustomFields`, and composed `sidebarFields` (people → dates → custom). `assignee` key maps to the people rail. **Breaking for consumers** that assumed `status` / `priority` / `dueDate` lived only in `sidebarFields` or that `otherMainFields` rendered in the main column — those fields are repositioned in the default `TicketDetails` shell (see `PartitionDetailFieldsResult`).
|
|
105
|
-
|
|
106
|
-
### Added
|
|
107
|
-
|
|
108
|
-
- **`TicketSystemEvent`** and optional `TicketDetails` prop **`systemEvents`** for the Updates timeline and All-tab merge.
|
|
109
|
-
- **`TicketFieldControl`:** optional **`layout="inline"`** for compact header controls; **`date`** fields use the Carbide **`DatePicker`** (not native `<input type="date">`).
|
|
110
|
-
- **`DatePicker`:** optional **`triggerClassName`** for trigger button styling; optional **`aria-invalid`** / **`aria-describedby`** on the trigger; **controlled `month`** resets when the popover opens so the calendar shows the **selected date’s month** (or `defaultMonth` / today when empty).
|
|
111
|
-
- **`TicketForm`:** **`date`** fields use **`DatePicker`** (not native `<input type="date">`).
|
|
112
|
-
- **`parseTicketDateString`** / **`formatTicketDateString`** exported from the tickets module for host apps.
|
|
113
|
-
- **`TicketFieldType` `updatedDate`:** Read-only timestamp for “last updated” (and similar). Renders as styled text in **`TicketForm`** and **`TicketDetails`** — never an `<input>`. Use **`formatTicketTimestampDisplay`** for custom UIs; value is typically ISO or `YYYY-MM-DD` on the ticket payload.
|
|
114
|
-
- **`TicketDetailsLabels`:** strings for activity tabs, sidebar section titles, back button, show more/less, add field, and comment body label.
|
|
115
|
-
|
|
116
|
-
## [1.3.0] - 2026-03-19
|
|
117
|
-
|
|
118
|
-
### Changed
|
|
119
|
-
|
|
120
|
-
- **TicketDetails** (formerly `TicketDetailSheet`): Renders **detail content only** (no outer `Sheet`), same presentation-only model as `TicketForm`. No `open` / `onClose` / `onOpen`; the host controls visibility and chrome (e.g. `Sheet` + `SheetContent` with its own close). Renamed exports: `TicketDetails`, `TicketDetailsProps`, `TicketDetailsLabels`, `defaultTicketDetailsLabels`, `mergeTicketDetailsLabels`. Removed `closeAriaLabel` from detail labels (library no longer renders a close control).
|
|
121
|
-
- **Tickets module file names:** Renamed to PascalCase under `src/components/ui/tickets/` (`TicketTypes.ts`, `TicketLabels.ts`, `UserFieldValue.ts`, `TicketUserSelect.tsx`, `TicketDates.ts`, `TicketDetailLayout.ts`) for consistency with other feature folders.
|
|
122
|
-
|
|
123
|
-
### Added
|
|
124
|
-
|
|
125
|
-
- **Ticket pattern components:** `TicketForm`, `TicketDetails`, `TicketFieldControl`, and `UserDisplay` for schema-driven ticket create/edit and detail UI. Host apps inject `userSelectComponent` and own persistence (`onSubmit`, `onCancel`, `onValuesChange`, `onPostComment`). Optional `labels` props override default copy.
|
|
126
|
-
- **Ticket utilities and types:** Exported `Ticket`, `TicketFieldDefinition`, `Comment`, and helpers (`fieldKeyToHeader`, `getMergedDetailFields`, `partitionDetailFields`, `formatCreationDate`, `formatRelativeTime`, user-field JSON helpers).
|
|
127
|
-
- **Docs:** `src/components/ui/tickets/README.md`, `agent-docs/tickets-pattern.md`, and agent-documentation-reference table entry.
|
|
128
|
-
- **Kanban:** Compound `KanbanBoard`, `KanbanColumn`, `KanbanCard`, and `KanbanCardOverlay` with `@dnd-kit` drag-and-drop. Helpers `dataToKanbanItems`, `normalizeToKanbanColumn`, and `computeMoveFromDragEnd` map table-shaped data to board items and derive moves from drag-end events. Column chrome uses `SheetBanner`; README, preview, Playwright visual tests, and agent-documentation-reference updates.
|
|
129
|
-
|
|
130
139
|
---
|
|
131
140
|
|
|
132
141
|
## [1.2.3] - 2026-03-23
|
package/README.md
CHANGED
|
@@ -186,33 +186,6 @@ document.documentElement.classList.add('carbide');
|
|
|
186
186
|
- You want to minimize bundle size
|
|
187
187
|
- You're using our components with your own Tailwind config
|
|
188
188
|
|
|
189
|
-
#### Embedded apps: `ThemeRoot` and `useHostTheme`
|
|
190
|
-
|
|
191
|
-
For apps hosted inside the MachineMetrics shell (or any host that passes a light/dark value), wrap the tree once and sync the host value—no `next-themes` setup boilerplate.
|
|
192
|
-
|
|
193
|
-
`ThemeRoot` wraps your React tree (e.g. inside `#root`). It does **not** replace `<html>` in `index.html`; it still toggles `light` / `dark` on `document.documentElement`. Keep `class="carbide"` on `<html>` and import Carbide CSS as usual.
|
|
194
|
-
|
|
195
|
-
```tsx
|
|
196
|
-
// index.tsx
|
|
197
|
-
import { ThemeRoot } from '@machinemetrics/mm-react-components';
|
|
198
|
-
|
|
199
|
-
<ThemeRoot>
|
|
200
|
-
<App />
|
|
201
|
-
</ThemeRoot>
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
```tsx
|
|
205
|
-
// App.tsx — pass the host color mode (example: mm-react-tools)
|
|
206
|
-
import { useHostTheme } from '@machinemetrics/mm-react-components';
|
|
207
|
-
import { useMMAppParams } from '@machinemetrics/mm-react-tools';
|
|
208
|
-
|
|
209
|
-
useHostTheme(useMMAppParams().colorMode);
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
If you need `useTheme()` elsewhere (e.g. markdown styling), import it from **`@machinemetrics/mm-react-components`** so it uses the same context as `ThemeRoot`—not from the `next-themes` package directly.
|
|
213
|
-
|
|
214
|
-
Optional: pass any `ThemeProvider` prop to `ThemeRoot` to override defaults (e.g. `storageKey` for standalone persistence).
|
|
215
|
-
|
|
216
189
|
#### Option 3: Use Theme Utilities
|
|
217
190
|
|
|
218
191
|
```tsx
|
|
@@ -54,16 +54,14 @@ This directory contains comprehensive documentation and tools for AI agents work
|
|
|
54
54
|
|
|
55
55
|
### Layout & Navigation
|
|
56
56
|
|
|
57
|
-
| Component
|
|
58
|
-
|
|
|
59
|
-
| **
|
|
60
|
-
| **
|
|
61
|
-
| **
|
|
62
|
-
| **
|
|
63
|
-
| **
|
|
64
|
-
| **
|
|
65
|
-
| **Breadcrumb** | `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis` | Navigation breadcrumbs |
|
|
66
|
-
| **PageHeader** | `PageHeader` (+ types) | Application page header with actions/tabs |
|
|
57
|
+
| Component | Exports | Description |
|
|
58
|
+
| -------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| **Card** | `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, `CardFooter` | Content container with sections (no built-in scroll) |
|
|
60
|
+
| **ScrollArea** | `ScrollArea`, `ScrollBar` | Scrollable region; **must have constrained height** (e.g. `h-[300px]`, `max-h-[50vh]`, or `flex-1 min-h-0` in flex layout) or it won’t scroll |
|
|
61
|
+
| **Separator** | `Separator` | Visual divider |
|
|
62
|
+
| **Tabs** | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` | Tabbed interface |
|
|
63
|
+
| **Breadcrumb** | `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis` | Navigation breadcrumbs |
|
|
64
|
+
| **PageHeader** | `PageHeader` (+ types) | Application page header with actions/tabs |
|
|
67
65
|
|
|
68
66
|
### Overlays & Modals
|
|
69
67
|
|
|
@@ -98,20 +96,18 @@ This directory contains comprehensive documentation and tools for AI agents work
|
|
|
98
96
|
|
|
99
97
|
### Advanced Components
|
|
100
98
|
|
|
101
|
-
| Component | Exports | Description
|
|
102
|
-
| ------------------- |
|
|
99
|
+
| Component | Exports | Description |
|
|
100
|
+
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
103
101
|
| **DataTable** | `DataTable`, `DataTablePagination`, `ResponsiveTable`, `TABLE_TOKENS`, column creators, `useTableController`, `UseTableControllerReturn`, toolbar, CSV export (+ types); optional **`controller`** prop to share state with `FileGrid` | Full-featured data table with sorting, filtering, pagination (client-side & server-side) |
|
|
104
102
|
| **Thumbnail** | `Thumbnail` (+ types) | Bordered thumbnail shell with optional footer (`data-slot` for Carbide) |
|
|
105
|
-
| **FileIcon** | `FileIcon`, `FileIconGlyph`, `inferFileIconKind`, `getExtensionFromFileName`, `formatFileIconExtensionLabel` (+ types)
|
|
103
|
+
| **FileIcon** | `FileIcon`, `FileIconGlyph`, `inferFileIconKind`, `getExtensionFromFileName`, `formatFileIconExtensionLabel` (+ types) | File glyph + label from extension inference or overrides |
|
|
106
104
|
| **FileThumbnail** | `FileThumbnail` (+ types); `FileThumbnailBadgeConfig` | Button wrapping `Thumbnail` + `FileIcon` and optional badge |
|
|
107
105
|
| **FileGrid** | `FileGrid` (+ types) | Icon grid bound to a TanStack `Table` (same `controller` as `DataTable`) |
|
|
108
106
|
| **HeroMetricCard** | `HeroMetricCard`, `HeroMetricCardItem` (+ types) | Metrics dashboard card with trends |
|
|
109
107
|
| **Calendar** | `Calendar` | Date picker calendar |
|
|
110
108
|
| **DatePicker** | `DatePicker` | Single date selection with label and placeholder |
|
|
111
|
-
| **DateRangePicker** | `DateRangePicker
|
|
109
|
+
| **DateRangePicker** | `DateRangePicker` | Date range selection |
|
|
112
110
|
| **Dropzone** | `Dropzone`, `DropzoneContent`, `DropzoneEmptyState` | File upload drag-drop |
|
|
113
|
-
| **Kanban** | `KanbanBoard`, `KanbanColumn`, `KanbanCard`, `KanbanCardOverlay`, `normalizeToKanbanColumn`, `dataToKanbanItems` (+ types) | Drag-and-drop Kanban board; compound API; same columns/data as DataTable |
|
|
114
|
-
| **Tickets** | `TicketForm`, `TicketDetails`, `TicketFieldControl`, `UserDisplay`, field helpers (`formatTicketTimestampDisplay`, …), `TicketSystemEvent`, `PartitionDetailFieldsResult` (+ `TicketUserSelectComponent`) | Schema-driven ticket form and detail UI; **`data-slot`** on form/details/field wrapper (see tickets README); optional `systemEvents` / `onBack` / `onAddCustomField` |
|
|
115
111
|
| **Chart** | `ChartContainer`, `ChartTooltip`, `ChartTooltipContent`, `ChartLegend`, `ChartLegendContent`, `ChartStyle` (+ `ChartConfig` type) | Recharts integration |
|
|
116
112
|
|
|
117
113
|
### Interactive Elements
|
|
@@ -130,36 +126,12 @@ This directory contains comprehensive documentation and tools for AI agents work
|
|
|
130
126
|
| `cn` | Class name utility for merging Tailwind classes |
|
|
131
127
|
| **Theme Utils** | `activateCarbideTheme`, `deactivateCarbideTheme`, `toggleCarbideTheme`, `isCarbideThemeActive`, `activateDarkMode`, `deactivateDarkMode`, `toggleDarkMode`, `isDarkModeActive` |
|
|
132
128
|
|
|
133
|
-
### Total:
|
|
129
|
+
### Total: 44+ Components
|
|
134
130
|
|
|
135
131
|
All components follow shadcn/ui patterns with Carbide theme integration for industrial/manufacturing contexts.
|
|
136
132
|
|
|
137
133
|
## Component Usage Guides
|
|
138
134
|
|
|
139
|
-
### Table + Kanban from same columns and data
|
|
140
|
-
|
|
141
|
-
Use the same column definitions and data for both DataTable and Kanban:
|
|
142
|
-
|
|
143
|
-
- **Columns**: Pass table column objects directly to `KanbanColumn` via `column={col}` (accepts `{ id, title? }` or `{ id, header? }`).
|
|
144
|
-
- **Items**: `const items = dataToKanbanItems(data, { columnIdKey: 'status', titleKey: 'name' });` then filter by column when rendering cards.
|
|
145
|
-
- **Compound API**: `<KanbanBoard onMove={...}><KanbanColumn column={col}>…<KanbanCard item={item}>…</KanbanCard>…</KanbanColumn></KanbanBoard>`. Card content is children of `KanbanCard`. Optional `renderDragPreview(item)` for custom drag overlay.
|
|
146
|
-
|
|
147
|
-
### Ticket form and detail sheet
|
|
148
|
-
|
|
149
|
-
Schema-driven ticket UI (`TicketForm`, `TicketDetails`, `TicketFieldControl`) — inject a user picker (`TicketUserSelectComponent`), pass `onSubmit` / `onCancel`, and wire `onValuesChange` + `comments` / `onPostComment` / optional `systemEvents`. `TicketDetails` has no open/close API; mount it wherever needed (header metadata, Activity tabs, sticky sidebar). See **[tickets-pattern.md](./tickets-pattern.md)**.
|
|
150
|
-
### Layout and panel-like UI: don’t use Card for every section
|
|
151
|
-
|
|
152
|
-
Use the right component for the job instead of wrapping everything in Card:
|
|
153
|
-
|
|
154
|
-
| Need | Use | Notes |
|
|
155
|
-
|------|-----|--------|
|
|
156
|
-
| **Split workspace / dashboard / IDE-like layout** | **ResizablePanelGroup** | Horizontal or vertical split; drag-to-resize; keyboard accessible. Best for admin panels, SaaS tools, file-explorer style UIs. On mobile, use CSS to stack panels vertically. |
|
|
157
|
-
| **Navigation panel (app nav, links, structural sidebar)** | **Sidebar** | Composable, themeable, collapsible to icons. Use for application layout with nav links and groups, not for arbitrary “panel” content. |
|
|
158
|
-
| **Temporary or slide-out panel (settings, details, filters)** | **Sheet** | Slides in from any side (left, right, top, bottom). Use for settings, notifications, detail views, form overlays. See Overlays & Modals table. |
|
|
159
|
-
| **Discrete content block (summary box, metric, form section)** | **Card** | Card is for **content** with sections (header, body, footer), not for structural layout. Do not use Card as the main wrapper for full-page sections, side panels, or workspace areas. |
|
|
160
|
-
|
|
161
|
-
**Best practice for full app layout:** Combine Sidebar for navigation and ResizablePanelGroup (or a main content area) for the main workspace. Use Sheet for overlay panels; use Card only for distinct content blocks within a panel or page.
|
|
162
|
-
|
|
163
135
|
### Scrolling content: Card vs ScrollArea
|
|
164
136
|
|
|
165
137
|
**There is no "Panel" component.** For a panel-like or card-like region where content may be longer than the visible area, use **ScrollArea** around the scrollable content. **Card** is a structural container (border, padding, sections) and does not add scrolling.
|
|
@@ -262,71 +234,6 @@ The `DataTable` component supports both client-side and server-side pagination.
|
|
|
262
234
|
4. The component automatically handles edge cases (empty data, partial last page, etc.)
|
|
263
235
|
5. See component README at `src/components/ui/data-table/README.md` for detailed examples
|
|
264
236
|
|
|
265
|
-
### DateRangePicker: date ranges, presets, and helpers
|
|
266
|
-
|
|
267
|
-
Use **`DateRangePicker`** when the user needs a **start/end date range** (filters, reports, scheduling). Use **`DatePicker`** for a **single date**. Both are in `@machinemetrics/mm-react-components`.
|
|
268
|
-
|
|
269
|
-
**Imports (typical):**
|
|
270
|
-
|
|
271
|
-
```tsx
|
|
272
|
-
import {
|
|
273
|
-
DateRangePicker,
|
|
274
|
-
PRESET_IDS,
|
|
275
|
-
// Optional — programmatic preset matching / same subset as the picker:
|
|
276
|
-
DATE_RANGE_PRESETS,
|
|
277
|
-
findMatchingPreset,
|
|
278
|
-
resolvePresets,
|
|
279
|
-
} from '@machinemetrics/mm-react-components';
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
**Value shape:** Controlled with `value` and `onValueChange`. Type is `[string | null, string | null] | null | undefined` — dates are **`yyyy-MM-dd`** strings (ISO date only), e.g. `['2026-03-01', '2026-03-15']`. `allowSingleDate` allows one-day selections.
|
|
283
|
-
|
|
284
|
-
**Variants:**
|
|
285
|
-
|
|
286
|
-
| Variant | Prop | What you get |
|
|
287
|
-
| ------- | ---- | -------------- |
|
|
288
|
-
| **Simple** (default) | omit or `variant="simple"` | Single-calendar popover; Clear / Cancel / Apply (Clear reverts draft to last committed `value` without closing). |
|
|
289
|
-
| **Full** | `variant="full"` | Presets sidebar, dual-month calendar, company start time + optional custom hours, footer with summary and same Clear/Cancel/Apply behavior. |
|
|
290
|
-
|
|
291
|
-
**Full variant — presets:** The sidebar lists built-in quick ranges (Today, Yesterday, Last 7/30/90 days, week/month/year rollups, week/month/quarter/year-to-date, Custom). Full list and behavior: **`src/components/ui/date-range-picker/README.md`** in the repo (or browse package source after install).
|
|
292
|
-
|
|
293
|
-
**Customizing presets (full variant only):**
|
|
294
|
-
|
|
295
|
-
- **`presetIds`** — Pass a **subset and order** of presets using **`PRESET_IDS`** constants (not raw strings in app code, so IDs stay typed and consistent):
|
|
296
|
-
|
|
297
|
-
```tsx
|
|
298
|
-
presetIds={[
|
|
299
|
-
PRESET_IDS.TODAY,
|
|
300
|
-
PRESET_IDS.LAST_7_DAYS,
|
|
301
|
-
PRESET_IDS.MONTH_TO_DATE,
|
|
302
|
-
PRESET_IDS.CUSTOM,
|
|
303
|
-
]}
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
Omit `presetIds` for all defaults. Use `presetIds={[]}` to hide every preset row.
|
|
307
|
-
|
|
308
|
-
- **`presetLabels`** — Override labels (i18n or wording), keyed by **`PresetId`** / `PRESET_IDS`:
|
|
309
|
-
|
|
310
|
-
```tsx
|
|
311
|
-
presetLabels={{ [PRESET_IDS.MONTH_TO_DATE]: 'This month' }}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
**Programmatic use (outside the picker):**
|
|
315
|
-
|
|
316
|
-
- **`DATE_RANGE_PRESETS`** — Array of preset definitions (`id`, label, `getRange()`).
|
|
317
|
-
- **`resolvePresets(presetIds?)`** — Resolves which preset objects to use (same logic as the full picker). Pass the **same `presetIds` array** as the picker so “which preset is active” matches the UI.
|
|
318
|
-
- **`findMatchingPreset(start, end, now, presets?)`** — Given two dates and an optional resolved preset list, returns which **preset id** matches the range (or `undefined`).
|
|
319
|
-
|
|
320
|
-
Use these when syncing URL/query params, highlighting an active filter, or validating that a range matches a named preset.
|
|
321
|
-
|
|
322
|
-
**Related:** `Calendar` for bare calendars; `DatePicker` for single date with label. Carbide styles apply with the usual **`carbide`** wrapper and library **`/styles`** import.
|
|
323
|
-
|
|
324
|
-
**Important notes for AI agents:**
|
|
325
|
-
|
|
326
|
-
1. Prefer **`PRESET_IDS.*`** in source code for `presetIds` / `presetLabels` keys — do not hardcode string literals like `'month-to-date'` unless you are sure of the id contract.
|
|
327
|
-
2. Full variant may need horizontal space (dual months); avoid squeezing inside tiny columns without testing.
|
|
328
|
-
3. Detailed props table and Copy/paste examples: package **README** at `src/components/ui/date-range-picker/README.md`.
|
|
329
|
-
|
|
330
237
|
## Directory Structure
|
|
331
238
|
|
|
332
239
|
```
|
|
@@ -37,8 +37,8 @@ The migration configuration is located at `scripts/chakra-to-shadcn-migrator/cha
|
|
|
37
37
|
|
|
38
38
|
| Chakra Component | Replacement | Notes |
|
|
39
39
|
| ---------------- | ------------------------------------------------------------------------ | ---------------------------------- |
|
|
40
|
-
| `Box` | `<div>` |
|
|
41
|
-
| `Flex` | `<div className="flex">` |
|
|
40
|
+
| `Box` | `<div>` | Layout utilities only; appearance via semantic tokens/variants, never palette classes |
|
|
41
|
+
| `Flex` | `<div className="flex">` | Layout utilities only; appearance via semantic tokens/variants, never palette classes |
|
|
42
42
|
| `VStack` | `<div className="flex flex-col gap-4">` | Adjust spacing as needed |
|
|
43
43
|
| `HStack` | `<div className="flex flex-row gap-4">` | Adjust spacing as needed |
|
|
44
44
|
| `Stack` | `<div className="flex flex-col gap-4">` | Adjust direction/spacing as needed |
|
|
@@ -57,10 +57,10 @@ The migration configuration is located at `scripts/chakra-to-shadcn-migrator/cha
|
|
|
57
57
|
|
|
58
58
|
| Chakra Component | Replacement | Notes |
|
|
59
59
|
| ---------------- | ----------------------- | --------------------------------------------- |
|
|
60
|
-
| `Field` |
|
|
61
|
-
| `NumberInput` |
|
|
62
|
-
| `Slider` | `<input type="range">`
|
|
63
|
-
| `NativeSelect` |
|
|
60
|
+
| `Field` | `Field` form composition | `Field`, `FieldLabel`, `FieldDescription`, `FieldError` from `@machinemetrics/mm-react-components` |
|
|
61
|
+
| `NumberInput` | `Input` (`type="number"`) | `Input` from `@machinemetrics/mm-react-components`, not a raw `<input>` |
|
|
62
|
+
| `Slider` | `Slider` / `LabeledSlider` | `Slider`/`LabeledSlider` from `@machinemetrics/mm-react-components`, not a raw `<input type="range">` |
|
|
63
|
+
| `NativeSelect` | `Select` family | `Select`, `SelectTrigger`, `SelectContent`, `SelectItem` from `@machinemetrics/mm-react-components` |
|
|
64
64
|
|
|
65
65
|
### UI Components (Direct Mappings Available)
|
|
66
66
|
|
|
@@ -186,8 +186,6 @@ The migration configuration is located at `scripts/chakra-to-shadcn-migrator/cha
|
|
|
186
186
|
|
|
187
187
|
### Card Components
|
|
188
188
|
|
|
189
|
-
Use Card for **discrete content blocks** (summary, metric, form section), not for panel or layout structure. For panel-like UI use **ResizablePanelGroup**, **Sidebar**, or **Sheet** (see agent-documentation-reference.md).
|
|
190
|
-
|
|
191
189
|
```tsx
|
|
192
190
|
// Chakra UI
|
|
193
191
|
<Card>
|
|
@@ -282,7 +280,7 @@ import { Button, Input, Dialog } from '@machinemetrics/mm-react-components';
|
|
|
282
280
|
</Box>
|
|
283
281
|
|
|
284
282
|
// After
|
|
285
|
-
<div className="p-4 bg-
|
|
283
|
+
<div className="p-4 bg-muted">
|
|
286
284
|
<div className="flex flex-col gap-4">
|
|
287
285
|
<div className="flex flex-col gap-4">
|
|
288
286
|
<div className="flex flex-row gap-2">
|
|
@@ -305,10 +303,10 @@ import { Button, Input, Dialog } from '@machinemetrics/mm-react-components';
|
|
|
305
303
|
</Text>
|
|
306
304
|
|
|
307
305
|
// After
|
|
308
|
-
<h2 className="text-lg font-semibold text-
|
|
306
|
+
<h2 className="text-lg font-semibold text-primary">
|
|
309
307
|
Title
|
|
310
308
|
</h2>
|
|
311
|
-
<p className="text-sm text-
|
|
309
|
+
<p className="text-sm text-muted-foreground">
|
|
312
310
|
Description
|
|
313
311
|
</p>
|
|
314
312
|
```
|
|
@@ -400,8 +398,8 @@ import { Plus, Trash2 } from 'lucide-react'
|
|
|
400
398
|
// Chakra UI colors
|
|
401
399
|
<Box bg="blue.500" color="white">
|
|
402
400
|
|
|
403
|
-
//
|
|
404
|
-
<div className="bg-
|
|
401
|
+
// Semantic theme tokens (never palette classes like bg-blue-500)
|
|
402
|
+
<div className="bg-primary text-primary-foreground">
|
|
405
403
|
```
|
|
406
404
|
|
|
407
405
|
### 3. Responsive Design
|
|
@@ -455,7 +453,7 @@ import '@machinemetrics/mm-react-components/themes/carbide';
|
|
|
455
453
|
|
|
456
454
|
**Error**: Layout components like `Box`, `Flex` not found
|
|
457
455
|
|
|
458
|
-
**Solution**: Replace with generic HTML elements and Tailwind classes
|
|
456
|
+
**Solution**: Replace with generic HTML elements and layout-only Tailwind utilities (appearance still comes from semantic tokens/variants, never palette classes)
|
|
459
457
|
|
|
460
458
|
```tsx
|
|
461
459
|
// Instead of <Box>, use <div>
|
|
@@ -515,7 +513,7 @@ If you have custom components built on Chakra UI:
|
|
|
515
513
|
|
|
516
514
|
1. Identify the base Chakra component used
|
|
517
515
|
2. Replace with equivalent MachineMetrics component
|
|
518
|
-
3. Update
|
|
516
|
+
3. Update layout with Tailwind layout utilities; update appearance via semantic tokens/variants, never palette classes
|
|
519
517
|
4. Test functionality thoroughly
|
|
520
518
|
|
|
521
519
|
### Complex Layout Migrations
|
|
@@ -129,7 +129,7 @@ function MyComponent() {
|
|
|
129
129
|
}
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
**Done!** Components are ready to use.
|
|
132
|
+
**Done!** Components are ready to use.
|
|
133
133
|
|
|
134
134
|
## Project Structure After Setup (zero-config)
|
|
135
135
|
|
|
@@ -82,9 +82,10 @@ These components can be automatically migrated:
|
|
|
82
82
|
|
|
83
83
|
### Manual Replacements Required
|
|
84
84
|
|
|
85
|
-
These components need manual conversion to HTML + Tailwind
|
|
85
|
+
These components need manual conversion to HTML + Tailwind layout utilities. Appearance
|
|
86
|
+
(color) always comes from semantic tokens/variants, never hardcoded palette classes:
|
|
86
87
|
|
|
87
|
-
- `Box` → `<div>` with Tailwind
|
|
88
|
+
- `Box` → `<div>` with layout-only Tailwind utilities
|
|
88
89
|
- `Flex` → `<div className="flex">` with flex classes
|
|
89
90
|
- `VStack` → `<div className="flex flex-col gap-4">`
|
|
90
91
|
- `HStack` → `<div className="flex flex-row gap-4">`
|
|
@@ -92,8 +93,8 @@ These components need manual conversion to HTML + Tailwind:
|
|
|
92
93
|
- `Container` → `<div className="container mx-auto px-4">`
|
|
93
94
|
- `Center` → `<div className="flex items-center justify-center">`
|
|
94
95
|
- `SimpleGrid` → `<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">`
|
|
95
|
-
- `Heading` → `<h1>`, `<h2>`, etc. with Tailwind typography
|
|
96
|
-
- `Text` → `<p>`, `<span>`, etc. with Tailwind typography
|
|
96
|
+
- `Heading` → `<h1>`, `<h2>`, etc. with Tailwind typography sizing; color via semantic tokens
|
|
97
|
+
- `Text` → `<p>`, `<span>`, etc. with Tailwind typography sizing; color via semantic tokens
|
|
97
98
|
|
|
98
99
|
## Migration Process
|
|
99
100
|
|
|
@@ -154,7 +155,7 @@ import { AddIcon } from '@chakra-ui/icons';
|
|
|
154
155
|
// After
|
|
155
156
|
import { Button, Input, Dialog } from '@machinemetrics/mm-react-components';
|
|
156
157
|
import { Plus } from 'lucide-react';
|
|
157
|
-
// Layout components become generic HTML elements with Tailwind
|
|
158
|
+
// Layout components become generic HTML elements with layout-only Tailwind utilities
|
|
158
159
|
```
|
|
159
160
|
|
|
160
161
|
### Step 4: Convert Components
|
|
@@ -202,7 +203,7 @@ node scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.js --apply --verbose
|
|
|
202
203
|
|
|
203
204
|
1. **Missing Dependencies**: Install all required packages
|
|
204
205
|
2. **Theme Not Applied**: Ensure Carbide theme is imported and applied
|
|
205
|
-
3. **Layout Components**: Replace with HTML + Tailwind
|
|
206
|
+
3. **Layout Components**: Replace with HTML + layout-only Tailwind utilities
|
|
206
207
|
4. **Icons Not Working**: Update to Lucide React icons
|
|
207
208
|
5. **Form Components**: Use new Form component structure
|
|
208
209
|
|
|
@@ -86,7 +86,7 @@ function App() {
|
|
|
86
86
|
|
|
87
87
|
#### Issue: Custom colors not working
|
|
88
88
|
|
|
89
|
-
**Cause**: Using Chakra color tokens instead of
|
|
89
|
+
**Cause**: Using Chakra color tokens instead of the library's semantic theme tokens.
|
|
90
90
|
|
|
91
91
|
**Solution**:
|
|
92
92
|
|
|
@@ -94,8 +94,8 @@ function App() {
|
|
|
94
94
|
// Before (Chakra)
|
|
95
95
|
<Box bg="blue.500" color="white">
|
|
96
96
|
|
|
97
|
-
// After (
|
|
98
|
-
<div className="bg-
|
|
97
|
+
// After (semantic tokens — never palette classes like bg-blue-500)
|
|
98
|
+
<div className="bg-primary text-primary-foreground">
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
### 3. Layout Component Issues
|
|
@@ -112,8 +112,8 @@ function App() {
|
|
|
112
112
|
Content
|
|
113
113
|
</Box>
|
|
114
114
|
|
|
115
|
-
// After
|
|
116
|
-
<div className="p-4 bg-
|
|
115
|
+
// After (layout utility + semantic token)
|
|
116
|
+
<div className="p-4 bg-muted">
|
|
117
117
|
Content
|
|
118
118
|
</div>
|
|
119
119
|
```
|
|
@@ -369,7 +369,7 @@ const [isOpen, setIsOpen] = useState(false)
|
|
|
369
369
|
|
|
370
370
|
#### Issue: Colors not working
|
|
371
371
|
|
|
372
|
-
**Cause**: Chakra color tokens not converted to
|
|
372
|
+
**Cause**: Chakra color tokens not converted to semantic theme tokens.
|
|
373
373
|
|
|
374
374
|
**Solution**:
|
|
375
375
|
|
|
@@ -377,8 +377,8 @@ const [isOpen, setIsOpen] = useState(false)
|
|
|
377
377
|
// Before (Chakra)
|
|
378
378
|
<Box bg="blue.500" color="white">
|
|
379
379
|
|
|
380
|
-
// After (
|
|
381
|
-
<div className="bg-
|
|
380
|
+
// After (semantic tokens — never palette classes like bg-blue-500)
|
|
381
|
+
<div className="bg-primary text-primary-foreground">
|
|
382
382
|
```
|
|
383
383
|
|
|
384
384
|
#### Issue: Responsive design not working
|
|
@@ -41,7 +41,7 @@ This reference provides detailed mappings between Chakra UI components and Machi
|
|
|
41
41
|
|
|
42
42
|
| Chakra UI | Replacement | Tailwind Classes | Notes |
|
|
43
43
|
| ------------ | ----------- | ------------------------------------------------------ | -------------------------------- |
|
|
44
|
-
| `Box` | `<div>` |
|
|
44
|
+
| `Box` | `<div>` | Layout utilities only (e.g. `p-4`, `flex`) | Appearance via semantic tokens/variants, never palette classes |
|
|
45
45
|
| `Flex` | `<div>` | `flex` | Add flex-related classes |
|
|
46
46
|
| `VStack` | `<div>` | `flex flex-col gap-4` | Adjust spacing as needed |
|
|
47
47
|
| `HStack` | `<div>` | `flex flex-row gap-4` | Adjust spacing as needed |
|
|
@@ -54,8 +54,8 @@ This reference provides detailed mappings between Chakra UI components and Machi
|
|
|
54
54
|
|
|
55
55
|
| Chakra UI | Replacement | Tailwind Classes | Notes |
|
|
56
56
|
| --------- | --------------------- | -------------------------------- | ----------------- |
|
|
57
|
-
| `Heading` | `<h1>`, `<h2>`, etc. | `font-semibold
|
|
58
|
-
| `Text` | `<p>`, `<span>`, etc. |
|
|
57
|
+
| `Heading` | `<h1>`, `<h2>`, etc. | Size/weight utilities (`text-lg`, `font-semibold`); color only via semantic tokens (`text-foreground`) | Use semantic HTML |
|
|
58
|
+
| `Text` | `<p>`, `<span>`, etc. | Semantic tokens for color (`text-muted-foreground`), never palette classes | Use semantic HTML |
|
|
59
59
|
|
|
60
60
|
### Modal/Dialog Components
|
|
61
61
|
|
|
@@ -82,7 +82,7 @@ This reference provides detailed mappings between Chakra UI components and Machi
|
|
|
82
82
|
| Chakra UI | MachineMetrics | Import | Notes |
|
|
83
83
|
| --------- | -------------- | ------------------------------------- | ------------------ |
|
|
84
84
|
| `Table` | `Table` | `@machinemetrics/mm-react-components` | Direct replacement |
|
|
85
|
-
| `Card` | `Card` | `@machinemetrics/mm-react-components` |
|
|
85
|
+
| `Card` | `Card` | `@machinemetrics/mm-react-components` | New component |
|
|
86
86
|
| `Avatar` | `Avatar` | `@machinemetrics/mm-react-components` | New component |
|
|
87
87
|
| `Tooltip` | `Tooltip` | `@machinemetrics/mm-react-components` | Direct replacement |
|
|
88
88
|
| `Popover` | `Popover` | `@machinemetrics/mm-react-components` | Direct replacement |
|
|
@@ -93,7 +93,7 @@ This reference provides detailed mappings between Chakra UI components and Machi
|
|
|
93
93
|
| --------- | -------------- | ------------------------------------- | -------------------- |
|
|
94
94
|
| `Alert` | `Alert` | `@machinemetrics/mm-react-components` | New component |
|
|
95
95
|
| `Toast` | `Toaster` | `@machinemetrics/mm-react-components` | New component |
|
|
96
|
-
| `Spinner` |
|
|
96
|
+
| `Spinner` | `Spinner` | `@machinemetrics/mm-react-components` | New component |
|
|
97
97
|
|
|
98
98
|
### Overlay Components
|
|
99
99
|
|
|
@@ -120,6 +120,38 @@ This reference provides detailed mappings between Chakra UI components and Machi
|
|
|
120
120
|
| `Dropzone` | `Dropzone` | `@machinemetrics/mm-react-components` | New component |
|
|
121
121
|
| `SearchInput` | `SearchInput` | `@machinemetrics/mm-react-components` | New component |
|
|
122
122
|
|
|
123
|
+
### Additional Components
|
|
124
|
+
|
|
125
|
+
Components without a one-to-one Chakra UI ancestor (or replacing composed Chakra patterns). Same import (`@machinemetrics/mm-react-components`) unless noted.
|
|
126
|
+
|
|
127
|
+
| Chakra UI / pattern | MachineMetrics | When to use |
|
|
128
|
+
| ------------------------ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
129
|
+
| `AspectRatio` | `AspectRatio` | Constrain media (images, video, maps) to a fixed width/height ratio |
|
|
130
|
+
| `ButtonGroup` | `ButtonGroup`, `ButtonGroupSeparator`, `ButtonGroupText` | Group related buttons into one segmented control with merged borders |
|
|
131
|
+
| Custom carousel | `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselPrevious`, `CarouselNext` | Horizontally scrollable slides with previous/next controls (Embla-based) |
|
|
132
|
+
| — | `CodePreview` | Preview-app demo shell only — renders a component beside copyable code in this repo's preview app; not exported from the package, never use in apps |
|
|
133
|
+
| Searchable `Select` | `Combobox` | Single-select with type-to-filter search over a moderate option list |
|
|
134
|
+
| Command palette | `Command`, `CommandDialog`, `CommandInput`, `CommandList`, `CommandGroup`, `CommandItem`, `CommandEmpty` | Filterable command palette or searchable list, inline or in a dialog |
|
|
135
|
+
| Right-click `Menu` | `ContextMenu` | Context (right-click) menus with items, submenus, checkbox/radio items |
|
|
136
|
+
| Single date input | `DatePicker` | Pick a single date from a popover calendar (pair of `DateRangePicker`) |
|
|
137
|
+
| Empty state pattern | `Empty`, `EmptyHeader`, `EmptyMedia`, `EmptyTitle`, `EmptyDescription`, `EmptyContent` | Empty-state placeholder with icon, title, description, and actions |
|
|
138
|
+
| `Stat` / stat group | `HeroMetricCard`, `HeroMetricCardItem` | Headline strip of 1–6 key metrics with optional trends, action or filter modes |
|
|
139
|
+
| Hover `Popover` | `HoverCard`, `HoverCardTrigger`, `HoverCardContent` | Rich preview shown on hover (non-modal, pointer-only) |
|
|
140
|
+
| `InputGroup` / addons | `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupInput`, `InputGroupText`, `InputGroupTextarea` | Input with leading/trailing icons, text addons, or buttons |
|
|
141
|
+
| `PinInput` | `InputOTP`, `InputOTPGroup`, `InputOTPSlot`, `InputOTPSeparator` | One-time-code / PIN entry with per-character slots |
|
|
142
|
+
| `Kbd` | `Kbd`, `KbdGroup` | Render keyboard shortcuts and key combinations |
|
|
143
|
+
| Menu bar pattern | `Menubar`, `MenubarMenu`, `MenubarTrigger`, `MenubarContent`, `MenubarItem`, `MenubarSub` | Horizontal application menu bar with nested dropdown menus |
|
|
144
|
+
| Top-level nav pattern | `NavigationMenu`, `NavigationMenuList`, `NavigationMenuItem`, `NavigationMenuTrigger`, `NavigationMenuContent`, `NavigationMenuLink` | Site/app top navigation with dropdown panels |
|
|
145
|
+
| Page number pagination | `Pagination`, `PaginationContent`, `PaginationItem`, `PaginationLink`, `PaginationPrevious`, `PaginationNext`, `PaginationEllipsis` | Full pagination with numbered page links and ellipsis |
|
|
146
|
+
| Split panes | `ResizablePanelGroup`, `ResizablePanel`, `ResizableHandle` | User-resizable side-by-side or stacked panels with drag handles |
|
|
147
|
+
| Custom scrollbars | `ScrollArea`, `ScrollBar` | Scroll container with themed, cross-browser-consistent scrollbars |
|
|
148
|
+
| Banner / callout strip | `SheetBanner` | Shared/company context banner strip at the top of a sheet or panel (`variant="shared" \| "company"`) |
|
|
149
|
+
| App shell nav | `Sidebar`, `SidebarProvider`, `SidebarMenu`, `SidebarMenuItem`, `SidebarMenuButton`, `SidebarTrigger`, `useSidebar` | Collapsible application sidebar shell with grouped navigation |
|
|
150
|
+
| Prev/next pager | `SimplePagination` | Compact "Page X of Y" pager with previous/next buttons — prefer over `Pagination` when page links are unnecessary |
|
|
151
|
+
| `Spinner` | `SpinnerCarbide` | Carbide-styled loading spinner (inherits `currentColor`; size via `size-*` utility classes) |
|
|
152
|
+
| Grouped `Toggle`s | `ToggleGroup`, `ToggleGroupItem` | Single- or multi-select groups of toggle buttons (view switchers, formatting bars) |
|
|
153
|
+
| Large-list `Select` | `VirtualizedCombobox` (+ `useLazyComboboxOptions`) | Combobox over large or lazily fetched option lists (virtualized rendering, async paging) |
|
|
154
|
+
|
|
123
155
|
## Compound Component Mappings
|
|
124
156
|
|
|
125
157
|
### Modal/Dialog Structure
|
|
@@ -216,8 +248,6 @@ This reference provides detailed mappings between Chakra UI components and Machi
|
|
|
216
248
|
|
|
217
249
|
### Card Structure
|
|
218
250
|
|
|
219
|
-
Use Card for **discrete content blocks** (e.g. summary box, metric card, form section). Do not use Card for structural layout or panel-like UI—prefer **ResizablePanelGroup** (split workspaces), **Sidebar** (nav panels), or **Sheet** (slide-out panels). See agent-documentation-reference.md “Layout and panel-like UI.”
|
|
220
|
-
|
|
221
251
|
```tsx
|
|
222
252
|
// Chakra UI Structure
|
|
223
253
|
<Card>
|
|
@@ -346,9 +376,13 @@ Use Card for **discrete content blocks** (e.g. summary box, metric card, form se
|
|
|
346
376
|
|
|
347
377
|
| Chakra UI | Tailwind CSS | Notes |
|
|
348
378
|
| ------------------------ | ----------------- | ---------------- |
|
|
349
|
-
| `bg="blue.500"` | `bg-
|
|
350
|
-
| `color="white"` | `text-
|
|
351
|
-
| `borderColor="gray.300"` | `border-
|
|
379
|
+
| `bg="blue.500"` | `bg-primary` | Map by role, not hue — semantic tokens only |
|
|
380
|
+
| `color="white"` | `text-primary-foreground` | Pairs with `bg-primary` |
|
|
381
|
+
| `borderColor="gray.300"` | `border-border` | Semantic border token |
|
|
382
|
+
|
|
383
|
+
Never translate Chakra colors to Tailwind palette classes (`bg-blue-500`, `text-white`,
|
|
384
|
+
`border-gray-300`); those hardcode appearance and break theming. Pick the semantic token
|
|
385
|
+
that matches the color's role.
|
|
352
386
|
|
|
353
387
|
### Layout
|
|
354
388
|
|
|
@@ -419,7 +453,7 @@ import { Plus } from 'lucide-react';
|
|
|
419
453
|
</Box>
|
|
420
454
|
|
|
421
455
|
// After
|
|
422
|
-
<div className="p-4 bg-
|
|
456
|
+
<div className="p-4 bg-muted">
|
|
423
457
|
<div className="flex flex-col gap-4">
|
|
424
458
|
<div className="flex flex-col gap-4">
|
|
425
459
|
Content
|
|
@@ -452,7 +486,7 @@ import { Plus } from 'lucide-react';
|
|
|
452
486
|
2. **Layout Issues**: Replace layout components with HTML + Tailwind
|
|
453
487
|
3. **Icon Issues**: Update icon imports to Lucide React
|
|
454
488
|
4. **Prop Issues**: Update prop names according to mapping table
|
|
455
|
-
5. **Styling Issues**: Convert Chakra props to Tailwind classes
|
|
489
|
+
5. **Styling Issues**: Convert Chakra layout props to Tailwind layout utilities; convert color/appearance props to semantic tokens and component variants — never hardcoded palette classes
|
|
456
490
|
|
|
457
491
|
### Validation Steps
|
|
458
492
|
|