From f497dc6323112b14ffb5cedd963dfcbfedac002f Mon Sep 17 00:00:00 2001
From: Irina Aristova <38761239+Irinaristova@users.noreply.github.com>
Date: Mon, 5 Jul 2021 18:18:31 +0300
Subject: [PATCH] [FRNT-559] add toast weight (#165)
* add toast weight
* fix chip and button usage
* fix toast styles
---
src/lib/global.ts | 8 +-
src/woly/atoms/button-icon/usage.mdx | 6 +-
src/woly/atoms/button/usage.mdx | 8 +-
src/woly/atoms/chip/index.tsx | 6 +-
src/woly/atoms/chip/usage.mdx | 24 +++---
src/woly/molecules/toast/index.tsx | 114 ++++++++++++++++++++-------
src/woly/molecules/toast/usage.mdx | 105 ++++++++++++++++++++----
7 files changed, 203 insertions(+), 68 deletions(-)
diff --git a/src/lib/global.ts b/src/lib/global.ts
index 91b8c503..fca36d8f 100644
--- a/src/lib/global.ts
+++ b/src/lib/global.ts
@@ -159,16 +159,16 @@ export const Global = styled.div`
--woly-canvas-text-active: hsla(var(--bw-0), 1);
}
- [data-priority='tertiary'] {
+ [data-priority='goast'] {
--woly-shape-default: transparent;
--woly-shape-disabled: hsla(var(--bw-200), 1);
--woly-shape-hover: transparent;
--woly-shape-active: transparent;
- --woly-shape-text-default: hsla(var(--bw-0), 1);
+ --woly-shape-text-default: hsla(var(--bw-1000), 1);
--woly-shape-text-disabled: hsla(var(--bw-300), 1);
- --woly-shape-text-hover: hsla(var(--bw-600), 1);
- --woly-shape-text-active: hsla(var(--bw-700), 1);
+ --woly-shape-text-hover: hsla(var(--bw-400), 1);
+ --woly-shape-text-active: hsla(var(--bw-500), 1);
--woly-canvas-default: transparent;
--woly-canvas-disabled: hsla(var(--bw-200), 1);
diff --git a/src/woly/atoms/button-icon/usage.mdx b/src/woly/atoms/button-icon/usage.mdx
index a8afd105..08bace67 100644
--- a/src/woly/atoms/button-icon/usage.mdx
+++ b/src/woly/atoms/button-icon/usage.mdx
@@ -62,8 +62,8 @@ Button-icon's size can controlled by block-container and it`s width is equal to
### Weight and priority
-Button-icon can be represented in primary, secondary, default or tertiary priorities and can be styled with fill or outline.
-In case of choosing button-icon in tertiary priority with outline styles use the opposite background color to the text color of button-icon.
+Button-icon can be represented in primary, secondary, default or goast priorities and can be styled with fill or outline.
+In case of choosing button-icon in goast priority with outline styles use the opposite background color to the text color of button-icon.
}
onClick={() => console.info('ButtonIcon clicked')}
- priority="tertiary"
+ priority="goast"
/>
diff --git a/src/woly/atoms/button/usage.mdx b/src/woly/atoms/button/usage.mdx
index 78b50d64..751d9d2f 100644
--- a/src/woly/atoms/button/usage.mdx
+++ b/src/woly/atoms/button/usage.mdx
@@ -61,10 +61,12 @@ Secondary priority should be used as a default priority.
-Tertiary priority should be used as an alternative priority to secondary and can`t be used with outline.
+Goast priority should be used as an alternative priority to secondary and can`t be used with outline.
-
+
+
+
### Icons
@@ -78,7 +80,7 @@ Button can be used with icon on the left side.
### Sizes
-Size controlled by the `component-level` block property not from the props.
+Size is controlled by the `component-level` block property not from the props.
diff --git a/src/woly/atoms/chip/index.tsx b/src/woly/atoms/chip/index.tsx
index 4b844637..4c41592d 100644
--- a/src/woly/atoms/chip/index.tsx
+++ b/src/woly/atoms/chip/index.tsx
@@ -89,7 +89,7 @@ export const Chip = styled(ChipBase)`
outline: none;
}
- [data-icon] {
+ [data-icon='chip-visual-block'] {
display: flex;
flex-shrink: 0;
align-items: center;
@@ -104,7 +104,7 @@ export const Chip = styled(ChipBase)`
--woly-component-level: 0;
}
- [data-icon='chip-visual-block'] {
+ [data-icon] {
width: var(--local-icon-size);
height: var(--local-icon-size);
svg {
@@ -117,7 +117,7 @@ export const Chip = styled(ChipBase)`
--local-shape-color: transparent;
--local-text-color: var(--woly-shape-default);
- svg > path {
+ [data-icon='chip-visual-block'] > svg > path {
fill: var(--woly-shape-default);
}
&:hover {
diff --git a/src/woly/atoms/chip/usage.mdx b/src/woly/atoms/chip/usage.mdx
index b9f45bc0..6954e3da 100644
--- a/src/woly/atoms/chip/usage.mdx
+++ b/src/woly/atoms/chip/usage.mdx
@@ -23,14 +23,22 @@ As a standalone component, the most common use will be in some form of input.
### Weight and priority
-Chip can be represented in primary, secondary, default or tertiary prioritys and can be styled with fill or outline.
-In case of choosing chip in tertiary priority with outline styles use the opposite background color to the text color of chip.
+Chip can be represented in primary, secondary, default or goast priorities and can be styled with fill or outline.
-
-
-
-
-
+
+