DSC-R03/norms/rules/design-components/DSC-R03.md
Este texto aún no está traducido. Debajo está el original en inglés.
A component does not use a component of a higher level
MUSTbloqueacomprobaciónactiva
A component uses only components of its own level or below (primitive, composite, block, page), and the uses do not go in a circle.
Por qué: The levels are what makes the library a tree: a button that is built from a card cannot be used inside a card. A dependency that points up, or in a circle, breaks the order the catalog and the registry rely on.
Campos de la página (15)
| ruleId | DSC-R03 |
| requirement | A component uses only components of its own level or below (primitive, composite, block, page), and the uses do not go in a circle. |
| level | MUST |
| floor | false |
| status | active |
| sphere | design |
| appliesTo | /design |
| enforcers | .shtukbase/packages/design-components/checks/no-level-up.ts |
| enforcerKind | gate |
| mode | enforce |
| because | The levels are what makes the library a tree: a button that is built from a card cannot be used inside a card. A dependency that points up, or in a circle, breaks the order the catalog and the registry rely on. |
| baseline | 0 |
| reviewBy | 2027-05-29 |
| pack | design-components |
| rail | Move the shared part down into a primitive, or lift the component to the higher level. |
A component uses only components of its own level or below (primitive < composite < block < page), and the uses do not go in a circle.
What counts as a violation. A primitive that uses a composite, a composite that uses a block, and so on up; or a component that reaches itself through its uses.
Why. The levels are what makes the library a tree: a button that is built from a card cannot be used inside a card. A dependency that points up, or in a circle, breaks the order the catalog and the registry rely on.
Run. shtuk run design-components no-level-up. A violation is a line, exit code 1.
How to fix. Move the shared part down into a primitive, or lift the component to the higher level.