-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Chip #11
Conversation
MarikTar
commented
Apr 7, 2021
•
edited
Loading
edited
- Make point 1 in New components added (Inputs with labels, Chips) #9
/** | ||
* Used to render icon elements inside the Chip | ||
*/ | ||
icon?: React.ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, use the icon from mockups and don't allow to change the icon using props.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove icon
prop.
/** | ||
* Used to render icon elements inside the Chip | ||
*/ | ||
icon?: React.ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove icon
prop.
dataTestId?: string; | ||
}; | ||
|
||
type ChipProps = BaseProps & React.ButtonHTMLAttributes<HTMLButtonElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now Chip
component can use props from HTMLButtonElement
, but you forgot to add ...other
props to your root element.
[stylesEffects()]: !selected || !isChoice, | ||
[className]: !!className, | ||
})} | ||
tabIndex={selected && isChoice ? -1 : 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use tabIndex
from props for default state.
|
||
type ChipProps = BaseProps & React.ButtonHTMLAttributes<HTMLButtonElement>; | ||
|
||
const stylesBase = () => css({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.