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

Add Khanmigo theming for buttons with icons #2088

Merged
merged 12 commits into from
Nov 8, 2023
Merged

Conversation

nishasy
Copy link
Contributor

@nishasy nishasy commented Oct 16, 2023

Summary:

We want to allow buttons to have a khanmigo-themed version of the icons.
The idea is that icons will be wrapped by a rounded container and have
different focus/hover states (probably worth defining a pressed state as well).

Still waiting on design confirmation that this looks right when there
are icons on both sides.

More info in this slack thread:
https://khanacademy.slack.com/archives/C8Z9DSKC7/p1697490308355979

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

Test plan:

Manual testing on Storybook (/button--khanmigo-theme)
For both the regular theme and the Khanmigo theme:

  • Make sure everything looks normal when idle and all the icons are visible
  • Make sure that the focus ring looks correct when tabbing through the buttons

Khanmigo theme:

  • Confirm that the background circle is visible for the secondary and
    tertiary buttons.
  • Confirm that the hoveer/active styles are as expected for all buttons.

@nishasy nishasy self-assigned this Oct 16, 2023
@changeset-bot
Copy link

changeset-bot bot commented Oct 16, 2023

🦋 Changeset detected

Latest commit: d73cff9

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

This PR includes changesets to release 3 packages
Name Type
@khanacademy/wonder-blocks-button Minor
@khanacademy/wonder-blocks-banner Patch
@khanacademy/wonder-blocks-birthday-picker 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

@nishasy nishasy requested review from jandrade and a team October 16, 2023 22:26
@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Size Change: -753 B (-1%)

Total Size: 92.2 kB

Filename Size Change
packages/wonder-blocks-accordion/dist/es/index.js 3.1 kB +232 B (+8%) 🔍
packages/wonder-blocks-banner/dist/es/index.js 1.53 kB -1.56 kB (-51%) 🏆
packages/wonder-blocks-button/dist/es/index.js 4.32 kB +228 B (+6%) 🔍
packages/wonder-blocks-icon-button/dist/es/index.js 3.06 kB +834 B (+38%) 🚨
packages/wonder-blocks-link/dist/es/index.js 2.54 kB -486 B (-16%) 👏
ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.69 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 1.13 kB
packages/wonder-blocks-cell/dist/es/index.js 2.19 kB
packages/wonder-blocks-clickable/dist/es/index.js 3.21 kB
packages/wonder-blocks-color/dist/es/index.js 1.15 kB
packages/wonder-blocks-core/dist/es/index.js 3.67 kB
packages/wonder-blocks-data/dist/es/index.js 6.33 kB
packages/wonder-blocks-dropdown/dist/es/index.js 12 kB
packages/wonder-blocks-form/dist/es/index.js 5.42 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/dist/es/index.js 3.04 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-modal/dist/es/index.js 5.04 kB
packages/wonder-blocks-pill/dist/es/index.js 1.03 kB
packages/wonder-blocks-popover/dist/es/index.js 4.33 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.51 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.53 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-theming/dist/es/index.js 1.21 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

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #2088 (d73cff9) into main (f620da3) will increase coverage by 0.06%.
Report is 16 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2088      +/-   ##
==========================================
+ Coverage   97.01%   97.08%   +0.06%     
==========================================
  Files         241      243       +2     
  Lines       27540    28055     +515     
  Branches     2415     2366      -49     
==========================================
+ Hits        26719    27236     +517     
+ Misses        821      819       -2     
Files Coverage Δ
...onder-blocks-button/src/components/button-core.tsx 99.81% <100.00%> (+0.01%) ⬆️
...ackages/wonder-blocks-button/src/themes/default.ts 100.00% <100.00%> (ø)
...ckages/wonder-blocks-button/src/themes/khanmigo.ts 100.00% <100.00%> (ø)

... and 18 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 f620da3...d73cff9. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

A new build was pushed to Chromatic! 🚀

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

Chromatic results:

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

@nishasy nishasy marked this pull request as ready for review October 27, 2023 18:22
@nishasy nishasy changed the title WIP: Add Khanmigo theming for buttons with icons Add Khanmigo theming for buttons with icons Oct 27, 2023
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Oct 27, 2023

Gerald

Required Reviewers
  • @Khan/wonder-blocks for changes to .changeset/stale-clocks-cheer.md, __docs__/wonder-blocks-button/button.stories.tsx, packages/wonder-blocks-button/src/components/button-core.tsx, packages/wonder-blocks-button/src/themes/default.ts, packages/wonder-blocks-button/src/themes/khanmigo.ts, packages/wonder-blocks-button/src/__tests__/__snapshots__/custom-snapshot.test.tsx.snap, packages/wonder-blocks-button/src/components/__tests__/button-with-icon.test.tsx, packages/wonder-blocks-button/src/components/__tests__/button.test.tsx

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2023

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (116b3f7) 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="PR2088"

Packages can also be installed manually by running:

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

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! just to confirm... is the final design approved? or is there any feedback we need from the Design team?

@@ -271,10 +287,41 @@ const themedSharedStyles: ThemedStylesFn<ButtonThemeContract> = (theme) => ({
},
startIcon: {
marginInlineEnd: theme.padding.small,
marginInlineStart: -theme.padding.small,
Copy link
Member

Choose a reason for hiding this comment

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

thought: One thing that got me thinking is that marginInlineStart (and end) is not supported by Safari v14 (we currently have to support this version). I think it would be fine to keep it this way as we haven't gotten any reports about this, but it's worth keeping an eye on it.

Hopefully we'll update our support list to support Safari v15+ in the near future.

</Button>
<Strut size={Spacing.medium_16} />
<Button
size="small"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding small buttons to story

@nishasy nishasy requested a review from jandrade November 8, 2023 02:07
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.

Changes look great, thanks! 🚢

@nishasy nishasy merged commit d73f698 into main Nov 8, 2023
13 checks passed
@nishasy nishasy deleted the button-khanmigo-theme branch November 8, 2023 22:44
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