Skip to content
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

[Feature] Textarea adjustments #413

Merged
merged 23 commits into from
Dec 7, 2020
Merged

Conversation

ketsappi
Copy link
Contributor

@ketsappi ketsappi commented Nov 27, 2020

Description

Textarea

  • Remove from components level
  • Change to use AutoId to generate id, instead of idGenerator
  • Change to use internal components for label-, hint- and status texts
  • Fix the empty space bug with aria-describedby
  • Add more tests
  • Add fullWidth prop
  • Add containerProps prop
  • Add default width for Textarea, 290px (same as for TextInput)
  • Change placeholder attribute tone omitted as we have the visualPlaceholder prop for this.

Other

  • Add missing color tokens to suomifi-ui-components/src/core/theme/colors.ts
    • depthDark2
    • depthDark3
  • Add getAriaDescribedByProp helper to src/utils/aria.ts
  • Move existing aria utils from src/components/utils/aria.ts level to src/utils/aria.ts

Motivation and Context

To better work with SSR setup and to increase developer experience by removing duplicate code (by using internal components)

How Has This Been Tested?

  • Locally in styleguidist with VoiceOver
  • In next.js (SSR) with VoiceOver

Release notes

  • Breaking changes: Style classnames changes for Textarea's labelText, hintText and statusText
  • Fix the empty space bug with aria-describedby on Textarea
  • Add fullWidth and containerProps props for Textarea

@ketsappi ketsappi added bug Something isn't working enhancement New feature or request DX Refactoring for maintainability labels Nov 27, 2020
Remove status text style to change color on error, as it will become automatically from StatusText component
@ketsappi ketsappi marked this pull request as ready for review November 27, 2020 12:44
Resize prop is used only on the baseStyles, so that is the reason why it is not used when it is destructured from props.
LJKaski
LJKaski previously approved these changes Dec 1, 2020
Able to use the same in existing and new places
Able to e.g to give custom style to container and specify fixed width.
Add undefined in the middle to ensure that no extra space/whitespace is added between.
Used in test and example of the use case. Changed to be consistent with the style with existing places; TextInput and SearchInput
@ketsappi ketsappi merged commit 2fd08c9 into develop Dec 7, 2020
@ketsappi ketsappi deleted the feature/textarea-adjustments branch December 7, 2020 10:30
@aappoalander aappoalander mentioned this pull request Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DX Refactoring for maintainability enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants