From 941041f639c01a448f92bd97deabb3655da5766c Mon Sep 17 00:00:00 2001 From: Christian Vuerings Date: Mon, 18 Mar 2024 08:45:10 -0700 Subject: [PATCH] Button/IconButton/LinkButton: add 'on' lightBackground or darkBackground prop (#333) --- .changeset/fluffy-files-press.md | 5 ++ packages/syntax-core/package.json | 2 +- .../syntax-core/src/Button/Button.stories.tsx | 32 +++++++++ packages/syntax-core/src/Button/Button.tsx | 13 +++- packages/syntax-core/src/Chip/Chip.module.css | 8 +++ .../syntax-core/src/Chip/Chip.stories.tsx | 22 +++++- packages/syntax-core/src/Chip/Chip.tsx | 54 +++++++++++++-- .../src/IconButton/IconButton.module.css | 7 -- .../src/IconButton/IconButton.stories.tsx | 26 +++++++ .../syntax-core/src/IconButton/IconButton.tsx | 12 +++- .../src/LinkButton/LinkButton.stories.tsx | 30 +++++++- .../syntax-core/src/LinkButton/LinkButton.tsx | 11 ++- .../syntax-core/src/colors/backgroundColor.ts | 68 +++++++++++++------ .../syntax-core/src/colors/foregroundColor.ts | 47 +++++++++---- 14 files changed, 278 insertions(+), 59 deletions(-) create mode 100644 .changeset/fluffy-files-press.md diff --git a/.changeset/fluffy-files-press.md b/.changeset/fluffy-files-press.md new file mode 100644 index 00000000..6d250bfa --- /dev/null +++ b/.changeset/fluffy-files-press.md @@ -0,0 +1,5 @@ +--- +"@cambly/syntax-core": minor +--- + +Button/Chip/IconButton/LinkButton: add 'on' lightBackground or darkBackground prop (Cambio only) diff --git a/packages/syntax-core/package.json b/packages/syntax-core/package.json index c9bff360..386b4655 100644 --- a/packages/syntax-core/package.json +++ b/packages/syntax-core/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsup", "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", - "dev": "NODE_OPTIONS=--max_old_space_size=4096 tsup --watch", + "dev": "NODE_OPTIONS=--max_old_space_size=8192 tsup --watch", "lint": "TIMING=1 eslint \"src/**/*.ts*\" --max-warnings 0", "stylelint": "stylelint \"**/*.css\"", "stylelint:fix": "npm run stylelint --fix", diff --git a/packages/syntax-core/src/Button/Button.stories.tsx b/packages/syntax-core/src/Button/Button.stories.tsx index aa75c506..6b100952 100644 --- a/packages/syntax-core/src/Button/Button.stories.tsx +++ b/packages/syntax-core/src/Button/Button.stories.tsx @@ -1,6 +1,7 @@ import { type StoryObj, type Meta } from "@storybook/react"; import Button from "./Button"; import FavoriteBorder from "@mui/icons-material/FavoriteBorder"; +import Box from "../Box/Box"; export default { title: "Components/Button", @@ -11,6 +12,20 @@ export default { url: "https://www.figma.com/file/p7LKna9JMU0JEkcKamzs53/Cambly-Design-System-(Draft)?node-id=994%3A2346", }, }, + args: { + text: "Call to action", + color: "primary", + on: "lightBackground", + size: "md", + disabled: false, + loading: false, + fullWidth: false, + "data-testid": "", + loadingText: "", + accessibilityLabel: "", + tooltip: "", + type: "button", + }, argTypes: { color: { options: [ @@ -29,6 +44,10 @@ export default { ], control: { type: "radio" }, }, + on: { + options: ["lightBackground", "darkBackground"], + control: { type: "radio" }, + }, size: { options: ["sm", "md", "lg"], control: { type: "radio" }, @@ -43,12 +62,25 @@ export default { control: "boolean", }, onClick: { action: "clicked" }, + type: { + options: ["button", "submit", "reset"], + }, }, tags: ["autodocs"], } as Meta; export const Default: StoryObj = { args: { text: "Call to action" }, + render: (args) => { + return ( + +