From 3cd80e6de68c48b6865ed198f674377fa9a2e5f7 Mon Sep 17 00:00:00 2001 From: Adam Kudrna Date: Tue, 10 Oct 2023 18:00:08 +0200 Subject: [PATCH] Feat(web): Introduce Placement dictionary and use it in `Dropdown` and `Tooltip` #DS-923 --- docs/DICTIONARIES.md | 35 ++-- .../src/scss/components/Dropdown/README.md | 26 +-- .../scss/components/Dropdown/_Dropdown.scss | 32 ++-- .../components/Dropdown/_DropdownWrapper.scss | 4 +- .../src/scss/components/Dropdown/_theme.scss | 2 + .../src/scss/components/Dropdown/index.html | 8 +- .../web/src/scss/components/Tooltip/README.md | 15 +- .../src/scss/components/Tooltip/_Tooltip.scss | 118 +++--------- .../components/Tooltip/_TooltipWrapper.scss | 4 +- .../src/scss/components/Tooltip/_theme.scss | 4 + .../src/scss/components/Tooltip/_tools.scss | 6 +- .../src/scss/components/Tooltip/index.html | 126 +++++++++++++ .../web/src/scss/settings/_dictionaries.scss | 9 +- .../web/src/scss/tools/_dictionaries.scss | 50 +++++- packages/web/src/scss/tools/_list.scss | 17 ++ packages/web/src/scss/tools/_placement.scss | 168 ++++++++++++++++++ packages/web/src/scss/tools/_string.scss | 46 ++++- 17 files changed, 519 insertions(+), 151 deletions(-) create mode 100644 packages/web/src/scss/tools/_list.scss create mode 100644 packages/web/src/scss/tools/_placement.scss diff --git a/docs/DICTIONARIES.md b/docs/DICTIONARIES.md index 609dba06f2..88343b62a8 100644 --- a/docs/DICTIONARIES.md +++ b/docs/DICTIONARIES.md @@ -7,19 +7,19 @@ This project uses `dictionaries` to unify props between different components. - A given property is not a dictionary by itself. The property is contained in the dictionary. That is, the Action Primary Default color is contained in the Action Primary dictionary entry. - Products can extend their dictionaries. -## List of dictionaries +## List of Dictionaries -- [Size](#size) +- [Alignment](#alignment) - [Color](#color) +- [Placement](#placement) +- [Size](#size) - [Validation](#validation) -- [Alignment](#alignment) -### Size +### Alignment -| Dictionary | Values | Code name | -| ------------- | ------------------------------------ | ------------ | -| Size | `small`, `medium`, `large` | Size | -| Size Extended | Size Dictionary + `xsmall`, `xlarge` | SizeExtended | +| Dictionary | Values | Code name | +| ---------- | ------------------------- | ---------- | +| AlignmentX | `left`, `center`, `right` | AlignmentX | ### Color @@ -30,14 +30,21 @@ This project uses `dictionaries` to unify props between different components. | Emotion Color | `success`, `informative`, `warning`, `danger` | EmotionColor | | Text Color | `primary`, `secondary`, `primary-inverted`, `secondary-inverted` | TextColor | +### Placement + +| Dictionary | Values | Code name | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------- | +| Placement | `top`, `top-left`, `top-right`, `bottom`, `bottom-left`, `bottom-right`, `left`, `left-top`, `left-bottom`, `right`, `right-top`, `right-bottom` | Placement | + +### Size + +| Dictionary | Values | Code name | +| ------------- | ------------------------------------ | ------------ | +| Size | `small`, `medium`, `large` | Size | +| Size Extended | Size Dictionary + `xsmall`, `xlarge` | SizeExtended | + ### Validation | Dictionary | Values | Code name | | ---------- | ------------------------------ | ---------- | | Validation | `success`, `warning`, `danger` | Validation | - -### Alignment - -| Dictionary | Values | Code name | -| ---------- | ------------------------- | ---------- | -| AlignmentX | `left`, `center`, `right` | AlignmentX | diff --git a/packages/web/src/scss/components/Dropdown/README.md b/packages/web/src/scss/components/Dropdown/README.md index 099d22760c..37cbd51701 100644 --- a/packages/web/src/scss/components/Dropdown/README.md +++ b/packages/web/src/scss/components/Dropdown/README.md @@ -13,7 +13,7 @@ > Button as anchor -