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

ThemeProvider: add component & add cambio versions of Button / IconButton & LinkButton #317

Merged
merged 6 commits into from Mar 1, 2024

Conversation

christianvuerings
Copy link
Contributor

@christianvuerings christianvuerings commented Feb 24, 2024

Description

In order to get ready for Cambio, the Cambly redesign, we're adding a "Cambio" theme and convert buttons over to the new design

Changes

  • ThemeProvider: add component
  • Storybook: add theme selector
  • Button / IconButton / LinkButton: add Cambio versions

Video

syntax-cambio-storybook-v2.mp4

Copy link

changeset-bot bot commented Feb 24, 2024

🦋 Changeset detected

Latest commit: 0efb08e

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

This PR includes changesets to release 4 packages
Name Type
@cambly/syntax-design-tokens Minor
@cambly/syntax-core Minor
@syntax/storybook Minor
@cambly/syntax-floating-components 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

vercel bot commented Feb 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
syntax ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2024 7:15pm

@christianvuerings christianvuerings marked this pull request as ready for review February 26, 2024 17:21
@christianvuerings christianvuerings changed the title ThemeProvider: add component & base cambio theme ThemeProvider: add component & add cambio versions of Button / IconButton & LinkButton Feb 26, 2024
Copy link

@btorndorff btorndorff left a comment

Choose a reason for hiding this comment

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

LGTM just had a question

Comment on lines 24 to 31
if (color === "quaternary") {
return "inverse";
} else if (color === "destructive-tertiary") {
return "destructive-secondary";
} else if (color === "success-primary" || color === "success-secondary") {
return "success";
}
return color;

Choose a reason for hiding this comment

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

Is this here so the classic buttons don't break if we convert them to cambio? Is it going to be removed eventually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@btorndorff that is correct - added so both themes work with each other. Goal is to remove the classic them eventually

Copy link
Contributor

@zprong zprong left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -30,25 +36,46 @@ type ButtonProps = {
/**
* The color of the button
*
* Classic only:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a typo that success-primary and success-secondary are in both the Classic and Cambio portion of the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zprong updated - success is classic only, success-primary, success-secondary and success-tertiary are cambio only

@@ -40,78 +40,6 @@
"format": "json/flat"
}
]
},
"android": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed since they aren't used

@@ -7,7 +7,7 @@
},
"test": {
"outputs": ["coverage/**"],
"dependsOn": []
"dependsOn": ["^build"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

required now since we rely on a build version of our design tokens when running the tests

@@ -26,7 +26,6 @@
"glob": "10.3.10",
"jsdom": "22.0.0",
"prettier": "2.8.8",
"storybook-addon-rtl": "^0.5.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nathan-ong @somethiiing fyi follow up from
https://github.com/Cambly/syntax/pull/289/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R29

Storybook specific dependencies should go inside the storybook app so moved it to apps/storybook/package.json

const classicToCambioKeyLookup = {
"color-base-black": "color-cambio-black",
"color-base-destructive-100": "color-cambio-destructive-100",
"color-base-destructive-200": undefined, // Deprecated - to be deleted
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ajmooo fyi still seeing quite a lot of usage of deprecated colors so just falling back to the legacy "classic" colors and will remove in a follow up

@christianvuerings christianvuerings merged commit 0bbf4b1 into Cambly:main Mar 1, 2024
10 checks passed
@christianvuerings christianvuerings deleted the add-cambio-theme branch March 1, 2024 21:48
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.

None yet

3 participants