codeimage icon indicating copy to clipboard operation
codeimage copied to clipboard

🤖 - UI components with @solid-aria

Open riccardoperra opened this issue 2 years ago • 0 comments

Description

solid-aria is the newest SolidJS library that exports primitives to build suer accessible user interface.

This porting currently affect these components:

Implementation notes

Retrocomptibility with Rollup

With the newest implementation of rollup-plugin of Vanilla-extract, @codeimage/ui will be ported from a vite setup to Rollup in order to use the rollup-preset-solid package and supports in the future solid-start

  • https://github.com/riccardoperra/codeimage/issues/235

Exports

Every new component must be in his own folder and must be exported in a index.tsx file. Since there is Vite in library mode enabled, each type exported outside must be import using the import type keywords

https://github.com/riccardoperra/codeimage/blob/8c5135861293c37d7236c5aa73e3d89eab1b877b/packages/ui/src/lib/primitives/index.ts#L3-L9

Styling

Examples of solid-aria show simple styling style attribute. Obviously in @codeimage/ui this is not possible, so every type of style must be made with vanilla-extract.

The recommended approaches are:

  • Recipes
  • Through vanilla-extract style function and data-attributes (solid-aria will automatically handle these)

riccardoperra avatar Jun 04 '22 09:06 riccardoperra