-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat!: rework Avatar, User and UserLabel components #1991
Conversation
Preview is ready. |
Visual Tests Report is ready. |
9c488e7
to
4c23e0b
Compare
387a2ec
to
b6b7654
Compare
b6b7654
to
c2dec6b
Compare
&__icon { | ||
color: var(--g-avatar-color, var(--_--color)); | ||
|
||
& > svg { |
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.
Why we need it? Looks unreliable
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.
It is used to center svg element in the icon properly
@@ -1,6 +1,7 @@ | |||
@use 'sass:map'; | |||
|
|||
$sizes: ( | |||
'3xs': 16px, | |||
'2xs': 20px, | |||
'xs': 24px, | |||
's': 28px, |
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 thought that we wanted to change this sizes like in Button?
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.
Decided to make in the next major release
src/components/User/README.md
Outdated
| `--g-user-line-height` | Name and description line height | | ||
| Name | Description | | ||
| :--------------------------------- | :-------------------------------- | | ||
| `--g-user-gap` | Gap between avatar and text block | |
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.
What about --g-user-avatar-offset
name for this?
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.
FIXED
c2dec6b
to
33876a5
Compare
src/components/Avatar/README.md
Outdated
| `--g-avatar-inner-border-width` | Inner border width | | ||
| `--g-avatar-border-color` | Border color | | ||
| `--g-avatar-background-color` | Background color | | ||
| `--g-avatar-color` | Icon and text 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.
Let's name it --g-avatar-text-color
similar to other components
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 color
because this color is used for icon and text both
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.
FIXED
| `--g-user-label-text-font-weight` | Text font weight | | ||
| `--g-user-label-text-font-size` | Text font size | | ||
| `--g-user-label-text-line-height` | Text line height | |
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.
Why text
and not name
like in User?
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 use text
because the property in the component is named text
too. The property is called so because it can be email also.
src/components/UserLabel/README.md
Outdated
| `--g-user-label-outer-gap` | Label horizontal padding | | ||
| `--g-user-label-inner-gap` | Gap between elements (avatar, text, close icon) | |
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.
These names are not meaningful enough. Can we improve them?
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.
Renamed to --g-user-label-padding
and --g-user-label-gap
33876a5
to
077aded
Compare
077aded
to
150c867
Compare
Ticket: DATAUI-2913
Breaking changes
Avatar
imgUrl
,icon
ortext
s
size2xs
size--g-avatar-color
to--g-avatar-text-color
User
m
sizexl
sizeUserLabel
children
property withtext
Features
Avatar
3xs
sizeAriaLabelingProps
--g-avatar-border-width
,--g-avatar-inner-border-width
and--g-avatar-font-weight
to CSS APIUser
3xs
sizeAriaLabelingProps
UserLabel
3xs
and2xs
sizesdescription
property