# Coding Conventions

- **Language**: TypeScript with React functional components; strict mode in tsconfig.
- **Styling**: styled-components; props often prefixed with `$` to avoid DOM leakage and drive style variants. CSS variables expected from host (e.g., `--pri-clr`, `--sec-clr-bg`). Shared CSS fragments live in `src/assets/stylesheets` and `components/*/styles.ts`.
- **State**: `useState` and `use-state-with-callback` for cases needing post-set callbacks; components expose `isForceUpdate`/`setForceUpdate` and `reset/setReset` flags for parent-controlled resets.
- **Events**: callbacks prefixed with `ev*` (e.g., `evChange`, `evCreateMessage`); form-field updates use `evChangeCustom(name, value)` when `isField` is true.
- **Data typing**: shared types in `src/typeds` (`TObject`, `TState`, `TOption`, etc.). Component-specific `typed.ts` files accompany components with complex props.
- **Error handling**: UI-level guards (e.g., disable actions, prevent deletion below min count); uses helper validation via `approvejs` in utilities, but no central error boundary.
- **Logging**: none in codebase; rely on UI cues instead of console logging.
- **Formatting/number handling**: helpers like `formatNumber`, `currencyNumber`, `generateValue`, and multiple color/status mappers in `assets/javascripts`.
- **Structure**: components often rely on child `aria-label` markers to organize slots (table, popup, message).
