From be1195472f3dd041d8df11d18ebd471e07160896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dabiel=20Gonz=C3=A1lez=20Ramos?= Date: Mon, 20 Mar 2023 16:17:45 +0200 Subject: [PATCH] feat(Tokens): add extended palette color and update declarative colors (#67) --- .eslintrc.json | 3 + package.json | 4 +- packages/bee-q/src/components.d.ts | 12 +- .../bee-q/src/components/avatar/bq-avatar.tsx | 2 +- .../badge/_storybook/bq-badge.stories.tsx | 2 +- .../bee-q/src/components/badge/bq-badge.tsx | 2 +- packages/bee-q/src/components/badge/readme.md | 15 +- .../src/components/badge/scss/bq-badge.scss | 2 +- .../badge/scss/bq-badge.variables.scss | 2 +- .../bee-q/src/components/button/bq-button.tsx | 4 +- .../bee-q/src/components/button/readme.md | 2 +- .../src/components/button/scss/bq-button.scss | 143 +++---- .../_storybook/bq-checkbox.stories.tsx | 8 +- .../src/components/checkbox/bq-checkbox.tsx | 9 +- .../components/checkbox/scss/bq-checkbox.scss | 39 +- .../divider/_storybook/bq-divider.stories.tsx | 4 +- .../src/components/divider/bq-divider.tsx | 2 +- .../bee-q/src/components/divider/readme.md | 22 +- .../divider/scss/bq-divider.variables.scss | 2 +- .../icon/_storybook/bq-icon.stories.tsx | 6 +- .../_storybook/bq-radio-group.stories.tsx | 19 +- .../components/radio-group/bq-radio-group.tsx | 24 +- .../src/components/radio-group/readme.md | 17 +- .../bee-q/src/components/radio/bq-radio.tsx | 11 +- .../src/components/radio/scss/bq-radio.scss | 41 +- .../bee-q/src/components/slider/bq-slider.tsx | 42 +- .../slider/scss/bq-slider-variables.scss | 3 +- .../src/components/slider/scss/bq-slider.scss | 15 +- .../src/components/spinner/bq-spinner.tsx | 2 +- .../spinner/scss/bq-spinner-variables.scss | 2 +- .../status/__tests__/bq-status.e2e.ts | 3 +- .../status/_storybook/bq-status.stories.tsx | 6 - .../bee-q/src/components/status/bq-status.tsx | 2 +- .../src/components/status/bq-status.types.ts | 2 +- .../bee-q/src/components/status/readme.md | 19 +- .../src/components/status/scss/bq-status.scss | 26 +- .../bee-q/src/components/switch/bq-switch.tsx | 8 +- .../src/components/switch/scss/bq-switch.scss | 12 +- packages/bee-q/src/global/styles/default.scss | 12 +- .../styles/themes/default/_bg-colors.scss | 11 + .../styles/themes/default/_icon-colors.scss | 26 ++ .../styles/themes/default/_stroke-colors.scss | 45 ++ .../styles/themes/default/_text-colors.scss | 28 ++ .../styles/themes/default/_ui-colors.scss | 51 +++ .../global/styles/themes/default/index.scss | 5 + .../src/global/styles/variables/_colors.scss | 185 ++++++++ .../src/global/styles/variables/index.scss | 1 + tailwind.config.js | 398 ++++++++++++++++-- 48 files changed, 1016 insertions(+), 285 deletions(-) create mode 100644 packages/bee-q/src/global/styles/themes/default/_bg-colors.scss create mode 100644 packages/bee-q/src/global/styles/themes/default/_icon-colors.scss create mode 100644 packages/bee-q/src/global/styles/themes/default/_stroke-colors.scss create mode 100644 packages/bee-q/src/global/styles/themes/default/_text-colors.scss create mode 100644 packages/bee-q/src/global/styles/themes/default/_ui-colors.scss create mode 100644 packages/bee-q/src/global/styles/themes/default/index.scss create mode 100644 packages/bee-q/src/global/styles/variables/_colors.scss diff --git a/.eslintrc.json b/.eslintrc.json index 9a53a2db3..177639dfd 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,9 @@ { "root": true, "plugins": ["@nrwl/nx"], + "parserOptions": { + "ecmaVersion": 2019 + }, "overrides": [ { "files": "*.json", diff --git a/package.json b/package.json index 8618c35f6..f0da94305 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "jest-config": "$jest" }, "volta": { - "node": "18.14.0", - "npm": "9.3.1" + "node": "18.15.0", + "npm": "9.5.0" } } diff --git a/packages/bee-q/src/components.d.ts b/packages/bee-q/src/components.d.ts index eb65b26c9..06479de5d 100644 --- a/packages/bee-q/src/components.d.ts +++ b/packages/bee-q/src/components.d.ts @@ -108,7 +108,7 @@ export namespace Components { */ "type": TButtonType; /** - * The variant of button to apply on top of the appearance + * The variant of button to apply on top of the appearance (applicable only to `appearance="primary"`) */ "variant": TButtonVariant; } @@ -260,6 +260,10 @@ export namespace Components { "value": string; } interface BqRadioGroup { + /** + * If true, all radio inputs in the group will display a background on hover + */ + "backgroundOnHover"?: boolean; /** * A number representing the delay time (in milliseconds) that `bqChange` event handler gets triggered once the value change */ @@ -668,7 +672,7 @@ declare namespace LocalJSX { */ "type"?: TButtonType; /** - * The variant of button to apply on top of the appearance + * The variant of button to apply on top of the appearance (applicable only to `appearance="primary"`) */ "variant"?: TButtonVariant; } @@ -828,6 +832,10 @@ declare namespace LocalJSX { "value": string; } interface BqRadioGroup { + /** + * If true, all radio inputs in the group will display a background on hover + */ + "backgroundOnHover"?: boolean; /** * A number representing the delay time (in milliseconds) that `bqChange` event handler gets triggered once the value change */ diff --git a/packages/bee-q/src/components/avatar/bq-avatar.tsx b/packages/bee-q/src/components/avatar/bq-avatar.tsx index 1189aa556..77d6a6b3c 100644 --- a/packages/bee-q/src/components/avatar/bq-avatar.tsx +++ b/packages/bee-q/src/components/avatar/bq-avatar.tsx @@ -105,7 +105,7 @@ export class BqAvatar { return (
bq-badge + style bq-badge fill:#f9f,stroke:#333,stroke-width:4px +``` + ---------------------------------------------- *Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/bee-q/src/components/badge/scss/bq-badge.scss b/packages/bee-q/src/components/badge/scss/bq-badge.scss index 09cde6da3..505d61c4c 100644 --- a/packages/bee-q/src/components/badge/scss/bq-badge.scss +++ b/packages/bee-q/src/components/badge/scss/bq-badge.scss @@ -9,7 +9,7 @@ } .bq-badge { - @apply flex items-center justify-center rounded-xl bg-[color:var(--bq-badge--background-color)] text-[color:var(--bq-badge--text-color)]; + @apply flex items-center justify-center rounded-xl border-[1px] border-solid border-stroke-primary bg-[color:var(--bq-badge--background-color)] text-[color:var(--bq-badge--text-color)]; } .size { diff --git a/packages/bee-q/src/components/badge/scss/bq-badge.variables.scss b/packages/bee-q/src/components/badge/scss/bq-badge.variables.scss index 8d8594a48..a00c23f01 100644 --- a/packages/bee-q/src/components/badge/scss/bq-badge.variables.scss +++ b/packages/bee-q/src/components/badge/scss/bq-badge.variables.scss @@ -6,6 +6,6 @@ --bq-badge--size-small: 8px; --bq-badge--size-medium: 12px; --bq-badge--size-large: 16px; - --bq-badge--background-color: theme('colors.data.red'); + --bq-badge--background-color: theme('colors.ui.danger'); --bq-badge--text-color: theme('colors.text.inverse'); } diff --git a/packages/bee-q/src/components/button/bq-button.tsx b/packages/bee-q/src/components/button/bq-button.tsx index 853ba7b14..84e68263b 100644 --- a/packages/bee-q/src/components/button/bq-button.tsx +++ b/packages/bee-q/src/components/button/bq-button.tsx @@ -77,7 +77,7 @@ export class BqButton { /** The default behavior of the button */ @Prop({ reflect: true }) type: TButtonType = 'button'; - /** The variant of button to apply on top of the appearance */ + /** The variant of button to apply on top of the appearance (applicable only to `appearance="primary"`) */ @Prop({ reflect: true }) variant: TButtonVariant = 'standard'; // Prop lifecycle events @@ -194,7 +194,7 @@ export class BqButton { rel={isLink && this.target ? 'noreferrer noopener' : undefined} target={isLink ? this.target : undefined} type={this.type} - tabIndex={0} + tabIndex={this.disabled ? -1 : 0} onBlur={this.handleBlur} onFocus={this.handleFocus} onClick={this.handleClick} diff --git a/packages/bee-q/src/components/button/readme.md b/packages/bee-q/src/components/button/readme.md index e3122e9ca..fed1b9007 100644 --- a/packages/bee-q/src/components/button/readme.md +++ b/packages/bee-q/src/components/button/readme.md @@ -21,7 +21,7 @@ Buttons are designed for users to take action on a page or a screen. | `size` | `size` | The size of the button | `"large" \| "medium" \| "small"` | `'medium'` | | `target` | `target` | Where to display the linked URL, as the name for a browsing context (a `tab`, `window`, or `