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

[WB-1814.9] Refactor Clickable and Pill to use semantic colors #2472

Merged
merged 6 commits into from
Feb 20, 2025

Conversation

@jandrade jandrade self-assigned this Feb 12, 2025
Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: 1edb69f

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

This PR includes changesets to release 15 packages
Name Type
@khanacademy/wonder-blocks-pill Patch
@khanacademy/wonder-blocks-clickable Patch
@khanacademy/wonder-blocks-dropdown Patch
@khanacademy/wonder-blocks-accordion Patch
@khanacademy/wonder-blocks-button Patch
@khanacademy/wonder-blocks-cell Patch
@khanacademy/wonder-blocks-form Patch
@khanacademy/wonder-blocks-icon-button Patch
@khanacademy/wonder-blocks-link Patch
@khanacademy/wonder-blocks-birthday-picker Patch
@khanacademy/wonder-blocks-banner Patch
@khanacademy/wonder-blocks-search-field Patch
@khanacademy/wonder-blocks-modal Patch
@khanacademy/wonder-blocks-popover 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 Feb 12, 2025

Size Change: +95 B (+0.1%)

Total Size: 97.6 kB

Filename Size Change
packages/wonder-blocks-clickable/dist/es/index.js 3.05 kB +16 B (+0.53%)
packages/wonder-blocks-pill/dist/es/index.js 1.48 kB +79 B (+5.64%) 🔍
ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-accordion/dist/es/index.js 3.54 kB
packages/wonder-blocks-banner/dist/es/index.js 1.55 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.82 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 886 B
packages/wonder-blocks-button/dist/es/index.js 4.3 kB
packages/wonder-blocks-cell/dist/es/index.js 2.01 kB
packages/wonder-blocks-core/dist/es/index.js 2.85 kB
packages/wonder-blocks-data/dist/es/index.js 6.25 kB
packages/wonder-blocks-dropdown/dist/es/index.js 19 kB
packages/wonder-blocks-form/dist/es/index.js 6.03 kB
packages/wonder-blocks-grid/dist/es/index.js 1.36 kB
packages/wonder-blocks-icon-button/dist/es/index.js 3.11 kB
packages/wonder-blocks-icon/dist/es/index.js 873 B
packages/wonder-blocks-labeled-field/dist/es/index.js 1.22 kB
packages/wonder-blocks-layout/dist/es/index.js 1.82 kB
packages/wonder-blocks-link/dist/es/index.js 2.22 kB
packages/wonder-blocks-modal/dist/es/index.js 5.5 kB
packages/wonder-blocks-popover/dist/es/index.js 4.92 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.52 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.33 kB
packages/wonder-blocks-switch/dist/es/index.js 2 kB
packages/wonder-blocks-testing-core/dist/es/index.js 3.73 kB
packages/wonder-blocks-testing/dist/es/index.js 1.07 kB
packages/wonder-blocks-theming/dist/es/index.js 679 B
packages/wonder-blocks-timing/dist/es/index.js 1.79 kB
packages/wonder-blocks-tokens/dist/es/index.js 2.51 kB
packages/wonder-blocks-toolbar/dist/es/index.js 923 B
packages/wonder-blocks-tooltip/dist/es/index.js 7.01 kB
packages/wonder-blocks-typography/dist/es/index.js 1.23 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Feb 12, 2025

A new build was pushed to Chromatic! 🚀

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

Chromatic results:

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

Juan Andrade added 3 commits February 13, 2025 15:42
@@ -204,153 +210,6 @@ export const Variants: StoryComponentType = {
},
};

// Test visual styles
Copy link
Member Author

Choose a reason for hiding this comment

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

note: This is now being tested in pill-variants.stories.tsx.

@@ -149,32 +147,4 @@ describe("Pill", () => {
// Assert
expect(await screen.findByText("Hello, world!")).toBeInTheDocument();
});

test.each`
Copy link
Member Author

Choose a reason for hiding this comment

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

note: Also being tested in chromatic directly.

@jandrade jandrade marked this pull request as ready for review February 13, 2025 21:51
@khan-actions-bot khan-actions-bot requested a review from a team February 13, 2025 21:51
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Feb 13, 2025

Gerald

Required Reviewers
  • @Khan/wonder-blocks for changes to .changeset/friendly-weeks-drum.md, .changeset/shaggy-windows-rescue.md, __docs__/wonder-blocks-clickable/accessibility.stories.tsx, __docs__/wonder-blocks-clickable/clickable-behavior.stories.tsx, __docs__/wonder-blocks-clickable/clickable.stories.tsx, __docs__/wonder-blocks-pill/pill-variants.stories.tsx, __docs__/wonder-blocks-pill/pill.stories.tsx, packages/wonder-blocks-clickable/src/components/clickable.tsx, 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 Feb 13, 2025

npm Snapshot: Published

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

Packages can also be installed manually by running:

pnpm add @khanacademy/wonder-blocks-<package-name>@PR2472

Copy link
Member

@beaesguerra beaesguerra left a comment

Choose a reason for hiding this comment

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

Looks good! Left a non-blocking question 😄

Comment on lines +347 to +348
color: semanticColor.text.inverse,
backgroundColor: semanticColor.surface.overlay,
Copy link
Member

Choose a reason for hiding this comment

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

Should we use semanticColor.text.disabled? Would it be helpful to have a different token for the background color since the clickable isn't an overlay?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't want to use text.disabled because it's being used in the background. I think I'm going to change this to use action.disabled instead.

title: "Packages / Pill / Pill - All Variants",
component: Pill,
render: (args) => (
<AllVariants rows={rows} columns={columns}>
Copy link
Member

Choose a reason for hiding this comment

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

praise: So nice we can use this reusable component for AllVariants 🎉

@jandrade jandrade merged commit 8fc65a9 into main Feb 20, 2025
14 checks passed
@jandrade jandrade deleted the semantic-clickable-pill branch February 20, 2025 18:44
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (d9c3fae) to head (1edb69f).
Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@     Coverage Diff      @@
##   main   #2472   +/-   ##
============================
============================

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 d9c3fae...1edb69f. Read the comment docs.

jandrade added a commit that referenced this pull request Feb 20, 2025
…2474)

## Summary:

Last PR that migrates the remaining components to use semantic colors.

- Added `All Variants` stories to `ActionItem` and `OptionItem`.
- Refactored `ActionItem` and `OptionItem` to use semantic colors.
- Also refactored `ActionMenu`, `SingleSelect`, `MultiSelect` and `Combobox` to
use semantic colors.
- Simplified the styles in `ActionMenuOpenerCore` to use a single static
StyleSheet instance (instead of generating another one in runtime).

### Implementation plan:

1. #2439
2. #2440
3. #2441
4. #2446
5. #2449
6. #2464
7. #2468
8. #2470
9. #2472
10. Dropdown (current PR)

Issue: WB-1814

## Test plan:

Verify that all the dropdown stories are still working as expected.

Author: jandrade

Reviewers: jandrade, beaesguerra

Required Reviewers:

Approved By: beaesguerra

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Chromatic - Build and test on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️  dependabot, ✅ gerald

Pull Request URL: #2474
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