Skip to content

feat(core): add FileSizeFormatter utility and hook (DS-5343)#427

Merged
KamilEmeleev merged 2 commits into
mainfrom
feat/ds-5343
Jul 18, 2026
Merged

feat(core): add FileSizeFormatter utility and hook (DS-5343)#427
KamilEmeleev merged 2 commits into
mainfrom
feat/ds-5343

Conversation

@KamilEmeleev

Copy link
Copy Markdown
Collaborator

No description provided.

@KamilEmeleev KamilEmeleev added the enhancement New feature or request label Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit be66a82):

https://react-koobiq-next--prs-427-c0cd70m9.web.app

(expires Wed, 22 Jul 2026 15:41:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new locale-aware FileSizeFormatter utility to @koobiq/react-core along with a useFileSizeFormatter hook that binds the formatter to the current React Aria locale. It also reorganizes existing DateFormatter docs/stories into the Utilities/ Storybook group for consistency.

Changes:

  • Add FileSizeFormatter utility (SI/IEC support, localization, configurable precision) and export it from core utils/public API.
  • Add useFileSizeFormatter hook (memoized by locale + config) and export it from core hooks/public API.
  • Normalize DateFormatter docs/stories location in Storybook under Utilities/DateFormatter.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/public_api_guard/react-core.api.md Updates public API surface to include FileSizeFormatter + useFileSizeFormatter
packages/core/src/utils/index.ts Re-exports FileSizeFormatter from the core utils barrel
packages/core/src/utils/FileSizeFormatter/index.ts Barrel export for the new FileSizeFormatter utility
packages/core/src/utils/FileSizeFormatter/FileSizeFormatter.ts Implements localized SI/IEC file size formatting + precision handling
packages/core/src/utils/FileSizeFormatter/FileSizeFormatter.test.ts Adds unit tests for formatting behavior, localization, rounding, precision clamping
packages/core/src/utils/FileSizeFormatter/FileSizeFormatter.stories.tsx Adds Storybook stories for utility visualization
packages/core/src/utils/FileSizeFormatter/FileSizeFormatter.mdx Adds documentation page for the new utility + hook
packages/core/src/hooks/useFileSizeFormatter/useFileSizeFormatter.ts Adds hook to memoize formatter using the current locale
packages/core/src/hooks/useFileSizeFormatter/useFileSizeFormatter.test.tsx Adds tests for locale binding, config application, memoization
packages/core/src/hooks/useFileSizeFormatter/index.ts Barrel export for the new hook
packages/core/src/hooks/index.ts Re-exports useFileSizeFormatter from the hooks barrel
docs/date-formatting.stories.tsx Moves DateFormatter story into Utilities/DateFormatter and aligns table props
docs/11-date-formatting.mdx Updates MDX meta/title to match the new Storybook location

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/utils/FileSizeFormatter/FileSizeFormatter.ts
Comment thread packages/core/src/utils/FileSizeFormatter/FileSizeFormatter.ts Outdated
@KamilEmeleev
KamilEmeleev merged commit 6853984 into main Jul 18, 2026
6 checks passed
@KamilEmeleev
KamilEmeleev deleted the feat/ds-5343 branch July 18, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants