-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add pagination component #66
feat: add pagination component #66
Conversation
🦋 Changeset detectedLatest commit: 08fd3b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
*Add @rollup/plugin-json to base rollup configuration
Hey @fabien-ml, I think I've finished the porting Unfortunately on react-aria website there is no documentation about the pagination component, but I tried to write one in the README. The example follows the react-spectrum Pagination component. Also, how should I handle the solid-aria i18n version since it will change? Currently i'm linking to the workspace package
I've also pushed the updated script I made to fetch the intl strings from react-aria repository. Tell me if that's okay.
The script is runnable with https://github.com/solidjs-community/solid-aria/blob/114ac940e7760182e567ba9b7fd1c071c2dc9efd/scripts/syncIntl.cts |
closes #64
Still not finished but I think the most of work it has been done. Something can already be checked
useLocalizedStringFormatter
in @solid-aria/i18nSome considerations:
https://github.com/adobe/react-spectrum/tree/26b95c60e84a36ae8366b91f451b1b11d4819c73/packages/%40react-aria/pagination/intl
Updates here: #66 (comment)
We might use a script like this. It can definitely be improved 😄
uncontrolled state might be broken with the current implementationYou must define a defaultValue or state will never be updatedThere are some @ts-expect-error in createPagination.test.ts since the intersection of the JSX.DOMAttributes types break the function call signature 🤔
Typescript types could be improved, it seems they support a string value (probably set by the text input?) and handles the "" stringYou are now able to pass string | number | undefined to onChange, but the new value will be skipped like react-aria/pagination does. All returned values from onNext, onPrevious, onChange, value are numbers. Default value when the new page is invalid or "" or undefined is 1