-
Notifications
You must be signed in to change notification settings - Fork 40
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
FormField components #2311
Comments
This is a React specific issue. I would argue, that we should in general skip the
When the base component is rendering a actual HTML element, as this clean and a very common pattern: When using This separation makes it easier to resonate and exemplify about how our design system translates between React and HTML and other frameworks, as the functional That said, I think we can maybe flip the question, and ask;
Could the interface then be something like:
...where
(dropping |
Root
pattern?- Resolves #2553 - Resolves #2587 - Part of #2311 - Make standalone `<Input>` - Adds support for `type="radio"` and `type="checkbox"` - Adds support for `role="switch"` - Documentation for standalone components should be discussed with the team (#2566) and not solved in this PR - Some changes might occur later after #2561, but I suggest we merge this first to be able to move forward
commit ce23f32 Author: Eirik Backer <eirik.backer@gmail.com> Date: Mon Oct 28 10:31:21 2024 +0100 fix(Chip): use input component (#2683) - Fixes #2669 - Fixes wrong height implemented (now correctly `32px`) - Implements simplified states after dialogue with Marianne - Fixes better alignment of label vs. radio/checkbox - Implements logic so elements with the `ds-focus--visible` class automatically hides focus ring on children (no need for confusing, nested focus rings) commit d5e0ba1 Author: Lasse Febakke Straum <33222679+Febakke@users.noreply.github.com> Date: Fri Oct 25 15:08:14 2024 +0200 refactor(tokens): changed spacing and sizing type to dimension (#2688) Co-authored-by: Tobias Barsnes <tobias.barsnes@digdir.no> Co-authored-by: Michael Marszalek <mimarz@gmail.com> commit 6c1f99d Author: Eirik Backer <eirik.backer@gmail.com> Date: Fri Oct 25 13:52:51 2024 +0200 chore: remove tmp field styling in testing story (#2687) - Since field styling is now merged, `testing.stories.tsx` no longer needs to fake it commit f4f76d3 Author: Eirik Backer <eirik.backer@gmail.com> Date: Fri Oct 25 13:41:36 2024 +0200 fix(Heading+Label+ValidationMessage): clean up css styles (#2677) Figma task is added as #2676 commit d2fc6b9 Author: Tobias Barsnes <tobias.barsnes@digdir.no> Date: Fri Oct 25 13:16:17 2024 +0200 feat: rename `size` prop to `data-size` (#2680) resolves #2673 commit acef771 Author: Eirik Backer <eirik.backer@gmail.com> Date: Fri Oct 25 10:24:19 2024 +0200 fix(Input): inherit line-height (#2685) As pointed out by hawk-eye @mimarz 💪 🙏 🦅 https://designsystemet.slack.com/archives/C07K7NEKXEW/p1729843841118129 commit d3c58b0 Author: Eirik Backer <eirik.backer@gmail.com> Date: Fri Oct 25 10:04:16 2024 +0200 fix(Spinner): use forwardRef and aria-label for consistency (#2682) - Use `aria-label` for accessible spinner label to be consistent with other components - Use `forwardRef` on Spinner --------- Co-authored-by: Tobias Barsnes <tobias.barsnes@digdir.no> commit 326671a Author: Une Sofie Kinn Ekroll <une.kinn.ekroll@bekk.no> Date: Fri Oct 25 08:26:49 2024 +0200 feat(tokens): add modes for semantic color categories main & support (#2643) Co-authored-by: Lasse Febakke Straum <33222679+Febakke@users.noreply.github.com> commit 7520547 Author: Eirik Backer <eirik.backer@gmail.com> Date: Thu Oct 24 14:19:33 2024 +0200 fix(Radio+Checkbox): use input component (#2607) - Part of #2311 - Fieldset at compound components moved to task #2666 - Fixes #2459 commit f96289a Author: Tobias Barsnes <tobias.barsnes@digdir.no> Date: Thu Oct 24 11:17:42 2024 +0200 chore: enable `noUnusedImports` biome rule (#2675) enables https://biomejs.dev/linter/rules/no-unused-imports/ commit a452813 Author: Une Sofie Kinn Ekroll <une.kinn.ekroll@bekk.no> Date: Thu Oct 24 10:38:59 2024 +0200 feat(cli,theme): don't output underlying primitives for semantic color variables (#2641)
part of #2311 New API: ```tsx <Search> <Search.Input aria-label='Søk' /> <Search.Clear /> <Search.Button /> /* can be removed to get a simple variant */ </Search> ``` --------- Co-authored-by: Eirik Backer <eirik.backer@gmail.com>
We have finished this, further tweaks and adjustments will be done in separate issues |
- Resolves #2553 - Resolves #2587 - Part of #2311 - Make standalone `<Input>` - Adds support for `type="radio"` and `type="checkbox"` - Adds support for `role="switch"` - Documentation for standalone components should be discussed with the team (#2566) and not solved in this PR - Some changes might occur later after #2561, but I suggest we merge this first to be able to move forward
part of #2311 New API: ```tsx <Search> <Search.Input aria-label='Søk' /> <Search.Clear /> <Search.Button /> /* can be removed to get a simple variant */ </Search> ``` --------- Co-authored-by: Eirik Backer <eirik.backer@gmail.com>
Some designsystems use generic form classes/components, usually called
form-group
orform-field
for their form components to have consistent placement of label, descriptions and such around an input/textarea/select element.Notes:
This could be possible if we split up
Textfield
into multiple sub-components or generic form scaffolding components.More generic, example from Radix:
Or more scoped, Example from Ark UI
Tasks
Textfield
to useField
#2713Field.Affix*
to support prefix/suffix #2715The text was updated successfully, but these errors were encountered: