Skip to content

Phase 8 — Utilities, hooks, formatters #9

@jonmatum

Description

@jonmatum

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 primitive
  • useLocalStorage(), useSessionStorage() — SSR-safe
  • useCopyToClipboard()
  • useDebouncedValue(), useDebouncedCallback()
  • useControllableState() — Radix-style controlled/uncontrolled
  • useHotkey() — keyboard shortcut helper
  • useMounted(), useIsomorphicLayoutEffect()

Formatters (locale-aware)

  • formatDate, formatRelativeTime
  • formatNumber, formatCurrency, formatPercent
  • formatFileSize, formatDuration
  • truncate, pluralize

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions