página del paquete→ /norms/rules/design-components/DSC-R03.md
pages/norms/rules/design-components/DSC-R03.md
29 líneas, 1.5 KB. Como página.
Este texto aún no está traducido. Debajo está el original en inglés.
- ---
- type: Rule
- ruleId: DSC-R03
- title: 'A component does not use a component of a higher level'
- 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.