From 76574111280051b744877451fb0ca95c93461e78 Mon Sep 17 00:00:00 2001 From: Brett Dorrans Date: Wed, 25 May 2022 19:18:18 +0100 Subject: [PATCH] feat: small button size and tag improvements BREAKING CHANGE --- src/components/button/Button.spec.tsx | 22 +++- src/components/button/README.md | 73 +++++++++++-- .../button/__snapshots__/Button.spec.tsx.snap | 101 +++++++++++++++++- src/components/button/index.tsx | 8 +- src/components/button/styles.ts | 22 +++- src/components/tag/README.md | 4 +- .../tag/__snapshots__/Tag.spec.tsx.snap | 64 +++++------ src/components/tag/index.tsx | 9 +- src/components/tag/styles.ts | 12 +-- 9 files changed, 238 insertions(+), 77 deletions(-) diff --git a/src/components/button/Button.spec.tsx b/src/components/button/Button.spec.tsx index 85fadcda..6496e19c 100644 --- a/src/components/button/Button.spec.tsx +++ b/src/components/button/Button.spec.tsx @@ -18,9 +18,27 @@ test('it works', () => { expect(container.firstChild).toMatchSnapshot(); }); -test('it works with size', () => { +test('it works with size small', () => { const { container } = setup( - + ); + expect(container.firstChild).toMatchSnapshot(); +}); + +test('it works with size medium', () => { + const { container } = setup( + + ); + expect(container.firstChild).toMatchSnapshot(); +}); + +test('it works with size large', () => { + const { container } = setup( + ); diff --git a/src/components/button/README.md b/src/components/button/README.md index c4129b57..52444735 100644 --- a/src/components/button/README.md +++ b/src/components/button/README.md @@ -31,14 +31,41 @@ Small buttons import { ThemeProvider, Button } from '@lapidist/components'; - - - - - + + + + + ``` +Medium buttons +```jsx harmony +import { ThemeProvider, Button } from '@lapidist/components'; + + + + + + + + +``` + +Large buttons +```jsx harmony +import { ThemeProvider, Button } from '@lapidist/components'; + + + + + + + + +``` + + Ghost buttons ```jsx harmony import { ThemeProvider, Button } from '@lapidist/components'; @@ -70,10 +97,36 @@ Small ghost buttons import { ThemeProvider, Button } from '@lapidist/components'; - - - - - + + + + + + +``` + +Medium ghost buttons +```jsx harmony +import { ThemeProvider, Button } from '@lapidist/components'; + + + + + + + + +``` + +Large ghost buttons +```jsx harmony +import { ThemeProvider, Button } from '@lapidist/components'; + + + + + + + ``` diff --git a/src/components/button/__snapshots__/Button.spec.tsx.snap b/src/components/button/__snapshots__/Button.spec.tsx.snap index 939bc70b..e527af08 100644 --- a/src/components/button/__snapshots__/Button.spec.tsx.snap +++ b/src/components/button/__snapshots__/Button.spec.tsx.snap @@ -90,11 +90,57 @@ exports[`it works with ghost 1`] = ` `; -exports[`it works with size 1`] = ` +exports[`it works with size large 1`] = ` .c0 { border-style: solid; text-align: center; - font-size: 0.875rem; + font-size: 1rem; + font-weight: 400; + font-family: Montserrat,sans-serif; + line-height: 2; + border-radius: 0.3rem; + border-width: 1px; + box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06); + padding-left: 1rem; + padding-right: 1rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; + background-color: #ebc764; + color: white; + border-color: #937032; +} + +.c0:hover { + cursor: pointer; + background-color: #937032; + color: white; +} + +.c0:hover:disabled { + cursor: not-allowed; + background-color: #937032; +} + +.c0:disabled { + opacity: 0.7; + background-color: #937032; + color: white; +} + + +`; + +exports[`it works with size medium 1`] = ` +.c0 { + border-style: solid; + text-align: center; + font-size: 1rem; font-weight: 400; font-family: Montserrat,sans-serif; line-height: 2; @@ -103,8 +149,54 @@ exports[`it works with size 1`] = ` box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06); padding-left: 1rem; padding-right: 1rem; - padding-top: 0.25rem; - padding-bottom: 0.25rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; + background-color: #ebc764; + color: white; + border-color: #937032; +} + +.c0:hover { + cursor: pointer; + background-color: #937032; + color: white; +} + +.c0:hover:disabled { + cursor: not-allowed; + background-color: #937032; +} + +.c0:disabled { + opacity: 0.7; + background-color: #937032; + color: white; +} + + +`; + +exports[`it works with size small 1`] = ` +.c0 { + border-style: solid; + text-align: center; + font-size: 1rem; + font-weight: 400; + font-family: Montserrat,sans-serif; + line-height: 2; + border-radius: 0.3rem; + border-width: 1px; + box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06); + padding-left: 1rem; + padding-right: 1rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; background-color: #ebc764; color: white; border-color: #937032; @@ -129,6 +221,7 @@ exports[`it works with size 1`] = `