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
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
54adc57
Fix the problem with aria-describedby: unintentional empty space
ketsappi Nov 23, 2020
3560a58
Add more tests for Textarea
ketsappi Nov 23, 2020
661e7db
Change the test name to be more describing
ketsappi Nov 24, 2020
54bd462
Add test for id prop of Textarea
ketsappi Nov 24, 2020
5a85a53
Move Textarea's logic from components level to core
ketsappi Nov 24, 2020
afc8fb7
Remove the styles and classnames that are no longer used
ketsappi Nov 27, 2020
8cc2cca
Update snapshots of the Textarea
ketsappi Nov 27, 2020
44ee032
Fix tests to reflect use of internal components
ketsappi Nov 27, 2020
e5e7708
Remove Textarea from components level
ketsappi Nov 27, 2020
2ef8893
Change Textarea to use AutoId instead of idGenerator
ketsappi Nov 27, 2020
cf9476b
Add the missing colour tokens
ketsappi Nov 27, 2020
43f59b9
Add status prop for StatusText component
ketsappi Nov 27, 2020
d7af398
Add status type for Textarea based on common InputStatus
ketsappi Nov 30, 2020
e812699
Change the JSDoc of Checkbox's id attribute
ketsappi Nov 30, 2020
b575a15
Remove the renaming of resize prop to indicate the discarding it
ketsappi Nov 30, 2020
330e675
Add aria util for ariaDescribedBy
ketsappi Dec 1, 2020
57e4912
Move aria helpers from components level to utils
ketsappi Dec 1, 2020
64b5525
Add fullWidth prop to Textarea
ketsappi Dec 1, 2020
9b7970e
Add containerProps for Textarea
ketsappi Dec 1, 2020
a418d0c
Add default width to Textarea
ketsappi Dec 4, 2020
d0817a4
Change Textarea to Omit `placeholder` attribute as we have `visualPla…
ketsappi Dec 4, 2020
aaa545d
Update test of aria describedby
ketsappi Dec 7, 2020
c381c40
Change to use string format to tell the width for Textarea
ketsappi Dec 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 0 additions & 176 deletions src/components/Form/Textarea.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export {
export { Expander, ExpanderProps } from './Expander/Expander';
export { Paragraph, ParagraphProps } from './Paragraph/Paragraph';
export { Text, TextProps } from './Text/Text';
export { Textarea, TextareaProps } from './Form/Textarea';
export { VisuallyHidden } from './Visually-hidden/Visually-hidden';
export { RadioButton, RadioButtonProps } from './Form/RadioButton';
export {
Expand Down
15 changes: 0 additions & 15 deletions src/components/utils/aria.ts

This file was deleted.

31 changes: 10 additions & 21 deletions src/core/Form/Textarea/Textarea.baseStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,14 @@ export const baseStyles = withSuomifiTheme(
display: flex;
flex-direction: column;
ketsappi marked this conversation as resolved.
Show resolved Hide resolved
color: ${theme.colors.blackBase};
width: 290px;

& .fi-textarea_label {
${font({ theme })('actionElementInnerTextBold')};
color: ${theme.colors.blackBase};
& .fi-label-text_label-span {
margin-bottom: 0;
}

& .fi-textarea_optionalText {
${theme.typography.bodyTextSmall};
}

& .fi-textarea_hintText {
display: block;
color: ${theme.colors.blackBase};
${theme.typography.bodyTextSmall};
word-break: break-word;
& .fi-hint-text {
margin-bottom: 0;
}

& .fi-textarea_textarea-element-container {
Expand Down Expand Up @@ -65,13 +58,9 @@ export const baseStyles = withSuomifiTheme(
}
}

& .fi-textarea_statusText {
& .fi-status-text {
display: block;
margin-top: ${theme.spacing.xxs};
font-size: 14px;
line-height: 18px;
font-weight: 600;
word-break: break-word;
}

&.fi-textarea--disabled {
Expand All @@ -87,11 +76,11 @@ export const baseStyles = withSuomifiTheme(
& .fi-textarea_textarea {
border: 2px solid ${theme.colors.alertBase};
}

& .fi-textarea_statusText {
color: ${theme.colors.alertBase};
}
}
}

&.fi-textarea--full-width {
width: 100%;
}
`,
);
19 changes: 19 additions & 0 deletions src/core/Form/Textarea/Textarea.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,22 @@ import { Textarea } from 'suomifi-ui-components';
</Textarea>
</>;
```

```js
import { Textarea } from 'suomifi-ui-components';

<>
<Textarea labelText="Textarea with 100% width" fullWidth>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis
vestibulum iaculis augue, sit amet tincidunt ipsum.
</Textarea>

<Textarea
labelText="Textarea with fixed width of 250px"
containerProps={{ style: { width: 250 } }}
aappoalander marked this conversation as resolved.
Show resolved Hide resolved
>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis
vestibulum iaculis augue, sit amet tincidunt ipsum.
</Textarea>
</>;
```
Loading