From d64400d66b1c662b577d0ab50270ff91bbad2c4d Mon Sep 17 00:00:00 2001 From: Jeroen Reumkens Date: Tue, 22 Nov 2022 18:07:55 +0100 Subject: [PATCH] Added proper dark mode support for buttons (#5603) * Added proper dark mode support for buttons, and converted buttons to use CVA for better maintainable variant styling. * Added animations to buttons. * Added cva types to buttonbase type since thats imported in different places * Fixed issue with styled buttons when false was pas for disabled instead of undefined. Added a small util function that now accepts arrays of variants, and creates all the possible combinations. This way we have less duplicate compoundvariants defined. This fixes the styles in the eventsinglelayout component. * Undo disabling of api jest tests. * Fixed remaining buttons using combined prop, which is replace by button group. Co-authored-by: Peer Richelsen Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> --- .vscode/settings.json | 5 +- apps/console | 2 +- apps/storybook/components/VariantsTable.tsx | 2 +- .../components/booking/pages/BookingPage.tsx | 3 +- .../eventtype/EventTypeSingleLayout.tsx | 1 - .../integrations/DisconnectIntegration.tsx | 4 +- apps/web/pages/event-types/index.tsx | 3 - .../web/pages/getting-started/[[...step]].tsx | 2 +- .../routing-forms/components/FormActions.tsx | 1 - .../pages/forms/[...appPages].tsx | 2 - .../ee/teams/components/MemberListItem.tsx | 3 - .../ee/teams/components/TeamListItem.tsx | 1 - .../components/v2/WorkflowListPage.tsx | 3 - .../schedules/components/Schedule.tsx | 2 +- packages/lib/cva/cva.test.ts | 52 ++++++ packages/lib/cva/cva.ts | 61 +++++++ packages/lib/cva/index.ts | 1 + packages/ui/components/button/Button.tsx | 163 ++++++++++++------ .../ui/components/button/button.stories.mdx | 7 +- packages/ui/package.json | 5 +- .../ui/v2/core/layouts/SettingsLayout.tsx | 7 +- yarn.lock | 12 +- 22 files changed, 258 insertions(+), 84 deletions(-) create mode 100644 packages/lib/cva/cva.test.ts create mode 100644 packages/lib/cva/cva.ts create mode 100644 packages/lib/cva/index.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index c2124f8fc6..804ec75057 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,8 @@ }, "typescript.preferences.importModuleSpecifier": "non-relative", "spellright.language": ["en"], - "spellright.documentTypes": ["markdown", "typescript"] + "spellright.documentTypes": ["markdown", "typescript"], + "tailwindCSS.experimental.classRegex": [ + ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"] + ] } diff --git a/apps/console b/apps/console index 2219900e06..7d53a77c07 160000 --- a/apps/console +++ b/apps/console @@ -1 +1 @@ -Subproject commit 2219900e06c3a683c85ce066e6ea3eb2d6ae14e9 +Subproject commit 7d53a77c07ab2b2f0fd0567b4d8ee4905d448442 diff --git a/apps/storybook/components/VariantsTable.tsx b/apps/storybook/components/VariantsTable.tsx index 8f4e80f0db..781b74f92a 100644 --- a/apps/storybook/components/VariantsTable.tsx +++ b/apps/storybook/components/VariantsTable.tsx @@ -19,7 +19,7 @@ export function VariantsTable({
diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index bb27d4b03c..9520b50c0c 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -860,7 +860,7 @@ const BookingPage = ({ {!eventType.disableGuests && !guestToggle && (