Skip to content
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

Pill updates - updated colors, small pills are bigger for a11y #2154

Merged
merged 5 commits into from
Jan 4, 2024

Conversation

nishasy
Copy link
Contributor

@nishasy nishasy commented Dec 22, 2023

Summary:

Some updates need to be made to pill so they're more usable
within webapp.

  • small size needs 14px font and 24px height
  • Banner colors included
  • Needs fixed height
  • Needs a story for vertically stacked pills

More context for some of these changes can be found in
the following slack thread:
https://khanacademy.slack.com/archives/C8Z9DSKC7/p1693923761646739

Issue: https://khanacademy.atlassian.net/browse/WB-1602

Test plan:

yarn jest packages/wonder-blocks-pill/src/components/__tests__/pill.test.tsx

Storybook

  • All variants
    /?path=/story/pill--variants
  • Vertically stacked pills
    /?path=/story/pill--vertically-stacked

@nishasy nishasy self-assigned this Dec 22, 2023
Copy link

changeset-bot bot commented Dec 22, 2023

🦋 Changeset detected

Latest commit: 31ccbee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@khanacademy/wonder-blocks-theming Minor
@khanacademy/wonder-blocks-pill Minor
@khanacademy/wonder-blocks-accordion Patch
@khanacademy/wonder-blocks-dropdown Patch
@khanacademy/wonder-blocks-icon-button Patch
@khanacademy/wonder-blocks-modal Patch
@khanacademy/wonder-blocks-switch Patch
@khanacademy/wonder-blocks-birthday-picker Patch
@khanacademy/wonder-blocks-banner Patch
@khanacademy/wonder-blocks-popover Patch
@khanacademy/wonder-blocks-search-field Patch
@khanacademy/wonder-blocks-tooltip Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 22, 2023

Size Change: +248 B (0%)

Total Size: 92.1 kB

Filename Size Change
packages/wonder-blocks-accordion/dist/es/index.js 3.76 kB +67 B (+2%)
packages/wonder-blocks-dropdown/dist/es/index.js 12.3 kB -1 B (0%)
packages/wonder-blocks-pill/dist/es/index.js 1.19 kB +159 B (+15%) ⚠️
packages/wonder-blocks-theming/dist/es/index.js 1.23 kB +23 B (+2%)
ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-banner/dist/es/index.js 1.53 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.72 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 1.13 kB
packages/wonder-blocks-button/dist/es/index.js 4.27 kB
packages/wonder-blocks-cell/dist/es/index.js 2.24 kB
packages/wonder-blocks-clickable/dist/es/index.js 3.24 kB
packages/wonder-blocks-color/dist/es/index.js 1.15 kB
packages/wonder-blocks-core/dist/es/index.js 3.7 kB
packages/wonder-blocks-data/dist/es/index.js 6.33 kB
packages/wonder-blocks-form/dist/es/index.js 5.34 kB
packages/wonder-blocks-grid/dist/es/index.js 1.36 kB
packages/wonder-blocks-i18n/dist/es/index.js 4.54 kB
packages/wonder-blocks-icon-button/dist/es/index.js 3.21 kB
packages/wonder-blocks-icon/dist/es/index.js 1.06 kB
packages/wonder-blocks-labeled-field/dist/es/index.js 72 B
packages/wonder-blocks-layout/dist/es/index.js 1.88 kB
packages/wonder-blocks-link/dist/es/index.js 2.54 kB
packages/wonder-blocks-modal/dist/es/index.js 5.53 kB
packages/wonder-blocks-popover/dist/es/index.js 4.38 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.51 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.55 kB
packages/wonder-blocks-spacing/dist/es/index.js 158 B
packages/wonder-blocks-switch/dist/es/index.js 2.06 kB
packages/wonder-blocks-testing/dist/es/index.js 3.94 kB
packages/wonder-blocks-timing/dist/es/index.js 1.78 kB
packages/wonder-blocks-toolbar/dist/es/index.js 862 B
packages/wonder-blocks-tooltip/dist/es/index.js 5.05 kB
packages/wonder-blocks-typography/dist/es/index.js 1.49 kB

compressed-size-action

Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Merging #2154 (31ccbee) into main (48e939d) will decrease coverage by 1.52%.
Report is 13 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2154      +/-   ##
==========================================
- Coverage   97.06%   95.55%   -1.52%     
==========================================
  Files         244      245       +1     
  Lines       28256    28334      +78     
  Branches     2461     2344     -117     
==========================================
- Hits        27428    27074     -354     
- Misses        828     1260     +432     
Files Coverage Δ
...ackages/wonder-blocks-pill/src/components/pill.tsx 100.00% <100.00%> (+2.39%) ⬆️
packages/wonder-blocks-theming/src/tokens.ts 100.00% <100.00%> (ø)

... and 48 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48e939d...31ccbee. Read the comment docs.

Copy link
Contributor

github-actions bot commented Dec 22, 2023

A new build was pushed to Chromatic! 🚀

https://5e1bf4b385e3fb0020b7073c-qdcoscnlxs.chromatic.com/

Chromatic results:

Metric Total
Captured snapshots 319
Tests with visual changes 12
Total stories 402
Inherited (not captured) snapshots [TurboSnap] 0
Tests on the build 319

@nishasy nishasy requested review from jandrade and a team December 22, 2023 03:46
@nishasy nishasy marked this pull request as ready for review December 22, 2023 03:46
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Dec 22, 2023

Gerald

Required Reviewers
  • @Khan/wonder-blocks for changes to .changeset/witty-crabs-clean.md, __docs__/wonder-blocks-pill/pill.argtypes.tsx, __docs__/wonder-blocks-pill/pill.stories.tsx, packages/wonder-blocks-pill/package.json, packages/wonder-blocks-pill/tsconfig-build.json, packages/wonder-blocks-theming/src/tokens.ts, packages/wonder-blocks-pill/src/components/pill.tsx, packages/wonder-blocks-pill/src/components/__tests__/pill.test.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Jan 4, 2024

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (5683aef) and published all packages with changesets to npm.

You can install the packages in webapp by running:

./services/static/dev/tools/deploy_wonder_blocks.js --tag="PR2154"

Packages can also be installed manually by running:

yarn add @khanacademy/wonder-blocks-<package-name>@PR2154

Copy link
Member

@jandrade jandrade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! thanks for working on improving this! 🚢 🚀

I only have an open question about 20px vs 24px that I'd like to understand better before landing, but everything looks really solid to me.

Comment on lines +113 to +116
// Font size should be at least 14px for accessibility.
expect(pill).toHaveStyle({
fontSize: 14,
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Thanks for adding this assertion :accessibility:

Comment on lines +145 to +153
test.each`
kind | color
${"neutral"} | ${tokens.color.offBlack8}
${"accent"} | ${tokens.color.blue}
${"info"} | ${tokens.color.fadedBlue16}
${"success"} | ${tokens.color.fadedGreen16}
${"warning"} | ${tokens.color.fadedGold16}
${"critical"} | ${tokens.color.fadedRed16}
`(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice!

paddingRight: tokens.spacing.xSmall_8,
borderRadius: tokens.spacing.xxSmall_6,
// Minimum tap area recommendation for a11y
height: tokens.spacing.large_24,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I remember that one of the changes was to make this 20px tall. So if I understand correctly, we are using 24 instead for the reasons you stated in the comment right? If that's the case, it would be worth checking how that looks in the places where we are hard-coding 20px.

Copy link
Contributor Author

@nishasy nishasy Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that was originally the case, but then we were asked to just bump it up to 24 in this thread:
https://khanacademy.slack.com/archives/C8Z9DSKC7/p1693925664214919?thread_ts=1693923761.646739&cid=C8Z9DSKC7

They're being hard coded to 20px in webapp right now, so I'll just update the ones that will look okay at 24px.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, that makes sense, thanks!

@nishasy nishasy merged commit 80592e7 into main Jan 4, 2024
15 of 16 checks passed
@nishasy nishasy deleted the pill-updates branch January 4, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants