sapcc / juno

Monorepo for the Juno microfrontend framework, microfrontend apps, design system and component library
Apache License 2.0
7 stars 2 forks source link

Rework form layout #330

Closed franzheidl closed 1 year ago

franzheidl commented 1 year ago

This PR introduces label and required props to TextInput, Textarea, Select, Checkbox and Radio. It removes the variant -prop from TextInputRow, TextareaRow, and SelectRow, as these will only support floating labels from now on.

TextInput, Textarea, Select, Checkbox, and Radio can now render their own label (and mark as required if passed) WITHOUT the need to use TextInputRow, TextareaRow, SelectRow, CheckboxRow, or RadioRow respectively.

For now, the respective ā€¦-Row components will continue to work, but the mid-term aim is to remove them. They will now pass the label and required prop directly to the actual input component.

Also, this PR introduces a generic FormRow component to take care of form element spacing.

The minimising logic of floating labels has been moved to the Label component. It now accepts a floating prop to set it up (position it absolute), and a minimised prop if it is to be minimised. All form input elements that can render labels will now use this Label component internally.

TODO:

ArtieReus commented 1 year ago

Hi @franzheidl !! if you don't want someone merge a PR I would recommend setting the PR to draft. Look under the reviewers you will see a link with Convert to draft. Then is not anymore for other users to merge until you switch back the PR :)

franzheidl commented 1 year ago

Hey @ArtieReus, tu ets un sabelotodo! šŸ¤“ Done just as you recommended. Wasn't quite sure whether Draft-PRs can be viewed by other users but they can, so works fine for me, thanks. šŸ™šŸ‘‹