@mittwald/flow-react-components 1.5.0-next.41 → 1.5.0-next.42

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/AGENTS.md CHANGED
@@ -91,9 +91,21 @@ Conventions:
91
91
  - Most components wrap `react-aria-components` primitives; expose ARIA props
92
92
  directly only where React Aria lacks the behavior.
93
93
  - **Keep the returned JSX readable.** Lift computed nodes (icon, label, tooltip
94
- text) and non-trivial conditionals into named consts above the `return`; the
95
- returned tree should stay scannable — no large inline ternaries or deep logic
96
- in the markup. Split a growing tree into subcomponents.
94
+ text) into named consts above the `return`; the returned tree should stay
95
+ scannable — no large inline ternaries or deep logic in the markup. Split a
96
+ growing tree into subcomponents.
97
+ - **Alternative UI parts get one const each; the JSX picks.** When the output
98
+ switches between variants, give every variant its own const and decide in the
99
+ returned JSX with a one-line ternary or `&&`. Never assign a multi-line
100
+ ternary to a const — it hides the decision inside the variable and forces the
101
+ reader through both branches at once.
102
+
103
+ ```tsx
104
+ const skeletonDonut = <span className={styles.skeleton} inert />;
105
+ const donut = <Aria.ProgressBar …>…</Aria.ProgressBar>;
106
+
107
+ return <div>{isSkeleton ? skeletonDonut : donut}</div>;
108
+ ```
97
109
 
98
110
  ## PropsContext — contextual composability
99
111