From b6b3ea739194312c7ec238928480df83576a84bf Mon Sep 17 00:00:00 2001 From: Ira Date: Sun, 23 May 2021 16:55:48 +0300 Subject: [PATCH 01/10] fix button padding --- src/lib/global.ts | 5 +++++ src/ui/atoms/button/index.tsx | 13 ++----------- src/ui/atoms/button/usage.mdx | 3 +++ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/lib/global.ts b/src/lib/global.ts index f73df53d..64520215 100644 --- a/src/lib/global.ts +++ b/src/lib/global.ts @@ -5,6 +5,11 @@ export const Global = styled.div` font-family: 'Helvetica Neue', sans-serif; } + + button { + padding: 0; + } + --palette-snow-1000: #000000; --palette-snow-500: #c0c0c0; --palette-snow-300: #e5e5e5; diff --git a/src/ui/atoms/button/index.tsx b/src/ui/atoms/button/index.tsx index f6135c3c..41eae294 100644 --- a/src/ui/atoms/button/index.tsx +++ b/src/ui/atoms/button/index.tsx @@ -30,19 +30,12 @@ const ButtonBase: React.FC = ({ ); export const Button = styled(ButtonBase)` - --local-vertical: calc(1px * var(--woly-component-level) * var(--woly-main-level)); - --local-horizontal: calc( - var(--woly-const-m) + (1px * var(--woly-main-level)) + var(--local-vertical) - ); - --local-gap: var(--local-vertical); - --local-compensate: var(--woly-const-m); + ${box} --local-text-color: var(--woly-shape-text-default); --local-shape-color: var(--woly-shape-default); --local-border-color: var(--woly-shape-default); - ${box} - display: flex; flex-wrap: nowrap; justify-content: center; @@ -54,9 +47,7 @@ export const Button = styled(ButtonBase)` line-height: var(--woly-line-height); background-color: var(--local-shape-color); - border-color: var(--local-border-color); - border-style: solid; - border-width: var(--woly-border-width); + border: var(--woly-border-width) solid var(--local-border-color); border-radius: var(--woly-rounding); outline: none; diff --git a/src/ui/atoms/button/usage.mdx b/src/ui/atoms/button/usage.mdx index 6de8493e..8c9963c1 100644 --- a/src/ui/atoms/button/usage.mdx +++ b/src/ui/atoms/button/usage.mdx @@ -59,6 +59,9 @@ Button can be used with icon on the left side. Size controlled by the `component-level` block property not from the props. + + diff --git a/src/ui/molecules/toast/usage.mdx b/src/ui/molecules/toast/usage.mdx index 78011985..fbe4db60 100644 --- a/src/ui/molecules/toast/usage.mdx +++ b/src/ui/molecules/toast/usage.mdx @@ -160,5 +160,5 @@ Or even both | `action` | `React.ReactNode` | `null` | Block of action items (ex. One element or grop that can be clicked) | | `content` | `React.ReactNode` | `null` | Component to show the icon near the text (ex.: Icon on the left side) | | `children` | ``React.ReactNode` | `null` | Content block | -| `outlined` | `boolean` | `false` | Change toast`s view from filled to outlined | +| `outlined` | `boolean` | `false` | Change toast`s view from filled to outlined | | `variant` | `string` | `'secondary'` | Variant prop to style Toast component | From 1e5f0263122cebd3d22030ef54ece03a54ddd8e9 Mon Sep 17 00:00:00 2001 From: Ira Date: Fri, 18 Jun 2021 18:16:30 +0300 Subject: [PATCH 09/10] update lint --- src/ui/atoms/button/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/atoms/button/index.tsx b/src/ui/atoms/button/index.tsx index 0ba1a8a4..ffbcfb89 100644 --- a/src/ui/atoms/button/index.tsx +++ b/src/ui/atoms/button/index.tsx @@ -55,9 +55,8 @@ export const Button = styled(ButtonBase)` flex-wrap: nowrap; justify-content: center; - padding: 0; - box-sizing: border-box; + padding: 0; color: var(--local-text-color); font-size: var(--woly-font-size); From e147bd75c392b29c7acdb6d6ad2b1d1a39ef77ce Mon Sep 17 00:00:00 2001 From: Ira Date: Fri, 18 Jun 2021 18:20:18 +0300 Subject: [PATCH 10/10] update lint --- src/ui/atoms/button/index.tsx | 1 - src/ui/molecules/toast/index.tsx | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ui/atoms/button/index.tsx b/src/ui/atoms/button/index.tsx index ffbcfb89..46493f78 100644 --- a/src/ui/atoms/button/index.tsx +++ b/src/ui/atoms/button/index.tsx @@ -46,7 +46,6 @@ const ButtonBase: React.FC = ({ export const Button = styled(ButtonBase)` ${box} - --local-text-color: var(--woly-shape-text-default); --local-shape-color: var(--woly-shape-default); --local-border-color: var(--woly-shape-default); diff --git a/src/ui/molecules/toast/index.tsx b/src/ui/molecules/toast/index.tsx index b5116623..1bd234d5 100644 --- a/src/ui/molecules/toast/index.tsx +++ b/src/ui/molecules/toast/index.tsx @@ -26,16 +26,15 @@ const ToastBase: React.FC = ({ ); export const Toast = styled(ToastBase)` + ${box} --local-text-color: var(--woly-shape-text-default); --local-shape-color: var(--woly-shape-default); --local-border-color: var(--woly-shape-default); --local-toast-gap: max(9px, calc(1px * var(--woly-component-level) * var(--woly-main-level))); - ${box} - display: flex; - align-items: center; flex-wrap: nowrap; + align-items: center; min-width: fit-content; max-width: 75%;