Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Summary: The current button doesn’t allow to display the text contents in multiple lines. This is required so we can remove the truncate functionality for certain cases like the `ActionBubble` component in webapp. This is needed so we can wrap the text instead and allow the button’s content to be displayed in two (or more) lines when needed. This PR adds a new prop `labelStyle` to the `Button` component that allows to style the inner label element. Also changed the `border` property to `outline` to be consistent with the overall strategy for visual indicatorss in all the WB components. This will also help us to avoid some layout issues in case folks override the button styles. Issue: https://khanacademy.atlassian.net/browse/WB-1635 ## Test plan: Verify that the following story works as expected: /?path=/story/button--custom-styles <img width="696" alt="Screenshot 2023-11-14 at 5 00 45 PM" src="https://github.com/Khan/wonder-blocks/assets/843075/8171a66e-304b-492c-b63f-3ee0f41acd6a"> By working as expected, it means that the custom button should be displayed in multiple lines and the text should be wrapped instead of being truncated. Also verify that the other stories work as expected. Author: jandrade Reviewers: nishasy, jandrade Required Reviewers: Approved By: nishasy Checks: ✅ codecov/project, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 16.x), ✅ Test (ubuntu-latest, 16.x, 2/2), ✅ Test (ubuntu-latest, 16.x, 1/2), ✅ Check build sizes (ubuntu-latest, 16.x), ✅ Lint (ubuntu-latest, 16.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 16.x), ✅ Publish npm snapshot (ubuntu-latest, 16.x), ⏭ Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 16.x), ✅ gerald, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 16.x), ⏭ dependabot Pull Request URL: #2112
- Loading branch information