solidjs-community / solid-aria

A library of high-quality primitives that help you build accessible user interfaces with SolidJS.
Other
285 stars 16 forks source link

Pagination component #64

Open riccardoperra opened 2 years ago

riccardoperra commented 2 years ago

I'm using @solid-aria and I noticed that the pagination primitives are not already ported. Reading through the react-aria source code it seems that everything needed to the pagination is already done, since there are already the button and locale primitives.

If possible I can work on it too😄

But one thing I didn't understand though is how to implement localized strings. It seems that they have a json with static translations for each language, but currently in this port there is not already a primitive that handles that. Should these string be handled by the consumer user in order to pass the aria-label prop?

https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/pagination/intl/index.js

https://github.com/adobe/react-spectrum/blob/26b95c60e84a36ae8366b91f451b1b11d4819c73/packages/%40react-aria/pagination/src/usePagination.ts#L24

fabien-ml commented 2 years ago

Hi, for the i18n i've not ported all @react-aria/i18n at once but only thing that i've used step by step.

To start port the pagination package you need to port useLocalizedStringFormatter from @react-aria/i18n first.

Then in pagination you can replace useControlledState by createControllableSignal from soild-aria.

You can fork the develop branch to start working and create a package by copying the template folder.

fabien-ml commented 2 years ago

I'm using @solid-aria and I noticed that the pagination primitives are not already ported.

For the context @thetarnav is busy with solid-devtools, me with hope-ui and some personal things and we can't give soild-aria the amount of focus necessary to "get it right" at the moment.

So contribution are more than welcome.