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

TextField and TextArea components adapted to the new design system #538

Merged
merged 9 commits into from
Nov 25, 2022

Conversation

vmilan
Copy link
Contributor

@vmilan vmilan commented Nov 23, 2022

Description

Shortcut: #268673
[sc-268673]

  • TextField and TextArea components with the new design system applied.
  • Custom component to create Password Fields
  • Also added some minor details to Tabs stories.

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #268673: COMPONENTS - Basic components (forms).

@vmilan vmilan marked this pull request as ready for review November 24, 2022 14:24
@vmilan vmilan requested a review from a team November 24, 2022 14:25
Comment on lines +20 to +24
<InputAdornment position='end'>
<IconButton onClick={handleClickShowPassword}>
{showPassword ? <VisibilityOutlined /> : <VisibilityOffOutlined />}
</IconButton>
</InputAdornment>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see the value here. At the beginning I thought we were just going to manage 'password' mode as hardcode. Obviously this makes more sense

import { IconButton, InputAdornment, TextField } from '@mui/material';
import { VisibilityOffOutlined, VisibilityOutlined } from '@mui/icons-material';

const PasswordField = forwardRef(({ style, ...otherProps }, ref) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you extract here 'style' vs 'otherProps'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, is not needed. Removed!

@@ -219,3 +219,8 @@ type TooltipDataProps = {
];
title?: string;
};

// PasswordField
export interface PasswordFieldProps {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to declare this interface, couldn't we just allow same TextField props?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this custom TextField here: https://mui.com/material-ui/react-text-field/#customization (eg RedditTextField). It basically passes down all props, using TextFieldProps .

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, totally, removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also cleaned up Button, which had the same unnecessary interface.

@vmilan vmilan merged commit 79741f0 into feature/design-system Nov 25, 2022
@vmilan vmilan deleted the feature/text-field branch November 25, 2022 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants