-
Notifications
You must be signed in to change notification settings - Fork 65
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
Support for unit in TextField #1152
Conversation
We discussed to maybe use some |
I'm still finding missing stuffs 🤷♀️ The disabled color was not in code. |
|
ugh, I was hoping we could drop absolute positioning all-together, but hmm. One option could be an absolute container with padding equal to the width of that container on the input, but that feels a tad hacky tho.... What are your thoughts? @wenche |
I suggest to just use |
Thats fair tbh, we should document that people should then use the native |
Yup, I'll add a line or two about that in the storybook |
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.
Reviewed in pair by @mimarz & @pomfrida.
Lots of good changes here! We like the way you wrote token values in css some places 😍
Mostly suggestions on cleaner code and some new stuff for discussion 😅
We also found a small visual bug when using multilines with scroll-bar and box-shadow
as border. Not breaking (and in production). If you know of a fix for it, or else we can live with it I guess.
box-shadow: ${() => | ||
isFocused | ||
? `none` | ||
: variant === 'default' | ||
? `inset 0 -1px 0 0 ${ | ||
token.border?.type === 'border' && token.border?.color | ||
}` | ||
: `0 0 0 1px ${ | ||
token.border?.type === 'border' && token.border?.color | ||
}`}; |
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.
Don't think this needs to be inside an anonymous function.
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.
Struggled a lot to find the easiest syntax for this 🔥 styled-components. Couldn't make it work without the func Might be a user error, but I gave up. 😓
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.
I just tested, and I couldn't not see any difference without the removed func, so I suggest we remove it to avoid unintended consequences in the future
libraries/core-react/src/components/TextField/TextField.tokens.ts
Outdated
Show resolved
Hide resolved
spacings: { comfortable }, | ||
} = tokens | ||
|
||
export const textfield: ComponentToken = { |
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.
Recommend creating a TextFieldToken
with a intersection type for which entities are present to help typing. In this case we are missing "unit".
export type TextFieldToken = ComponentToken & {
entities?: { unit?: ComponentToken }
}
<RelativeContainer> | ||
{inputIcon ? ( | ||
<> | ||
<PaddedInputWrapper {...inputProps} /> | ||
<Icon isDisabled={disabled} variant={variant}> | ||
{inputIcon} | ||
</Icon> | ||
</> | ||
) : ( | ||
<InputWrapper {...inputProps} /> | ||
)} | ||
</RelativeContainer> |
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.
🔥😍
) | ||
Multiline.parameters = { | ||
docs: { | ||
storyDescription: `With multiline we recommend to use <code>rows</code> in combination with a CSS rule of |
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.
Should maybe resize
be set as default to none
internally (with a default number of rows). Created a separate issue for this to be discussed later. #1155
Will probably remove outline all together as we move on and this will make things more simple.
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.
Just nitpicking, there's also a few label="Multline"
typos left in Textfield.stories, just do a search and replace 👍
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.
LGTM 👍
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.
Looks good! I think we should still remove some code as suggested to keep it clean 😅
box-shadow: ${() => | ||
isFocused | ||
? `none` | ||
: variant === 'default' | ||
? `inset 0 -1px 0 0 ${ | ||
token.border?.type === 'border' && token.border?.color | ||
}` | ||
: `0 0 0 1px ${ | ||
token.border?.type === 'border' && token.border?.color | ||
}`}; |
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.
I just tested, and I couldn't not see any difference without the removed func, so I suggest we remove it to avoid unintended consequences in the future
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.
Resolve #1111 and #1128