Phase 8 — Utilities, hooks, formatters
Cross-cutting helpers used internally by the shell and worth sharing.
Hooks
Formatters (locale-aware)
Acceptance
- Each hook / formatter has unit tests
- All formatters honor the active locale from
I18nProvider
- Tree-shakeable — importing one helper does not pull the whole module
Part of the next-shell app shell extraction plan.
Phase 8 — Utilities, hooks, formatters
Cross-cutting helpers used internally by the shell and worth sharing.
Hooks
cn()— classnames merger (clsx + tailwind-merge)useBreakpoint(),useMediaQuery()useDisclosure()— open / close / toggle primitiveuseLocalStorage(),useSessionStorage()— SSR-safeuseCopyToClipboard()useDebouncedValue(),useDebouncedCallback()useControllableState()— Radix-style controlled/uncontrolleduseHotkey()— keyboard shortcut helperuseMounted(),useIsomorphicLayoutEffect()Formatters (locale-aware)
formatDate,formatRelativeTimeformatNumber,formatCurrency,formatPercentformatFileSize,formatDurationtruncate,pluralizeAcceptance
I18nProviderPart of the
next-shellapp shell extraction plan.