-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-1501] Enable Lightweight User Names in User Kit (#4194)
**What does this PR do?** A clear and concise description with your runway ticket url. Allows user to set user names in `User` kit to lightweight. [Story 1501](https://runway.powerhrg.com/backlog_items/PLAY-1501) **Screenshots:** Screenshots to visualize your addition/change **Rails:** <img width="1050" alt="Screenshot 2025-01-29 at 3 33 00 PM" src="https://github.com/user-attachments/assets/a4beb309-254e-4bcf-8a23-1958e0eb108a" /> **React:** <img width="709" alt="Screenshot 2025-01-29 at 3 33 53 PM" src="https://github.com/user-attachments/assets/3599805d-774f-4653-8c0c-12cdca10a413" /> **How to test?** Steps to confirm the desired behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See addition/change #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [x] **TESTS** I have added test coverage to my code.
- Loading branch information
Showing
9 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
playbook/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div class="pb--doc-demo-row"> | ||
<div> | ||
<%= pb_rails("user", props: { | ||
name: "Anna Black", | ||
title: "Remodeling Consultant", | ||
orientation: "vertical", | ||
align: "center", | ||
size: "lg", | ||
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", | ||
bold: false | ||
}) %> | ||
</div> | ||
<div> | ||
<%= pb_rails("user", props: { | ||
name: "Anna Black", | ||
title: "Remodeling Consultant", | ||
orientation: "horizontal", | ||
align: "left", | ||
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", | ||
bold: false | ||
}) %> | ||
</div> | ||
<div> | ||
<%= pb_rails("user", props: { | ||
name: "Anna Black", | ||
orientation: "horizontal", | ||
align: "left", | ||
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg", | ||
bold: false | ||
}) %> | ||
|
||
<br> | ||
|
||
<%= pb_rails("user", props: { | ||
name: "Anna Black", | ||
orientation: "horizontal", | ||
align: "left", | ||
avatar: true, | ||
bold: false | ||
}) %> | ||
</div> | ||
</div> |
59 changes: 59 additions & 0 deletions
59
playbook/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react' | ||
import { User } from 'playbook-ui' | ||
|
||
const UserLightWeight = (props) => { | ||
return ( | ||
<div className="pb--doc-demo-row"> | ||
|
||
<div> | ||
<User | ||
align="center" | ||
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" | ||
bold={false} | ||
name="Anna Black" | ||
orientation="vertical" | ||
size="lg" | ||
title="Remodeling Consultant" | ||
{...props} | ||
/> | ||
</div> | ||
|
||
<div> | ||
<User | ||
align="left" | ||
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" | ||
bold={false} | ||
name="Anna Black" | ||
orientation="horizontal" | ||
title="Remodeling Consultant" | ||
{...props} | ||
/> | ||
</div> | ||
|
||
<div> | ||
<User | ||
align="left" | ||
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" | ||
bold={false} | ||
name="Anna Black" | ||
orientation="horizontal" | ||
{...props} | ||
/> | ||
|
||
<br /> | ||
|
||
<User | ||
align="left" | ||
avatar | ||
bold={false} | ||
name="Anna Black" | ||
orientation="horizontal" | ||
{...props} | ||
/> | ||
</div> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default UserLightWeight |
2 changes: 2 additions & 0 deletions
2
playbook/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
##### Prop | ||
Name will use `font-weight: 700` by default, if you want a lighter font weight, use the `bold` prop set to `false`. Name will then use `font-weight: 300`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters