Design system / Organisms
Organism / Management and configuration
CategoryEditor
CategoryEditor coordinates category creation, editing, deletion and pointer/keyboard ordering through supplied callbacks.
Intent and composition
CategoryFields edits one definition. CategoryEditor adds collection coordination, useCategoryEditor draft behavior and dnd-kit sensors. Supplied callbacks determine available actions; the parent owns collection updates and persistence. A stable useId value connects drag handles to prerendered instructions. EditionSettings delegates persistence to useEditionCategories and editionCategoriesApi. That owner disables editing during saves and restores the displayed snapshot on failure.
Coordinated concerns: Category collection, create/edit fields, deletion actions and accessible ordering.
Receives categories and mutation/reorder callbacks; useCategoryEditor and local disclosure state coordinate editing. CategoryFields alone is a focused molecule.
Real component specimen
Actual CategoryEditor with a local category collection and callbacks. Add/edit/delete and ordering change only this specimen, never an edition. Edit controls remain visible for keyboard and touch. onUpdate may return false, or resolve false, to retain an unsuccessful draft; the feature reports the failure. Unsaved changes are guarded before navigation.
Real component, fictional data. Interactive callbacks remain local.
Fictional data. All changes are local to this specimen.
Categories
Creative craft(craft)
Supported inputs and ownership
| Input | Responsibility |
|---|---|
| categories | Controlled category entries. |
| onCreate / onUpdate / onDelete / onReorder | Optional commands determining which editing capabilities appear. |
| disabled | Supported read-only/busy feedback. |
This is an integration summary, not a replacement for the implementation's complete prop types. A disabled control or hidden destination does not enforce permission.
Using it in a page
Integrate the section through its supported props and context requirements. Routes supply permitted data; instances bind product copy and behavior; templates arrange slots. Keep feature hooks and operations with their feature owner. Generic layouts must not load business data or enforce product policy.
Implementation
Repository path: src/components/editions/categories/categoryEditor.tsx