Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle design review #613

Merged
merged 13 commits into from
Nov 24, 2021
Binary file added Halstack UI-Kit/UI_kit_Halstack_v3.12.0.xd
Binary file not shown.
Binary file modified contributing/assets/components/toggle_images.xd
Binary file not shown.
89 changes: 58 additions & 31 deletions guidelines/components/toggle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Toggles should be used in place of radio buttons whenever the options are:

## Variants

![Toggle component single and multiple variants](images/toggle_variants.png)
![Toggle component single and multiple variants](images/toggle_group_variants.png)

_Toggle component single and multiple variants_

Expand All @@ -24,17 +24,21 @@ The selection of the toggle group can be mutually exclusive (single variant) or
Different states are defined in the life cycle of the component:
**Unselected enabled**, **unselected hover**, **unselected focus**, **unselected active**, **unselected disabled**, **selected enabled**, **selected hover**, **selected focus**, **selected active** and **selected disabled**

![Toggle button states example](images/toggle_states.png)
![Toggle button states example](images/toggle_group_states.png)

_Toggle button states example_


## Anatomy

![Toggle component anatomy](images/toggle_anatomy.png)
![Toggle component anatomy](images/toggle_group_anatomy.png)

1. Container
2. Label/Icon
1. Label
2. Helper text
3. Container
4. Button
5. Button icon
6. Button label


## Icon Usage
Expand All @@ -44,54 +48,77 @@ Inside the toggle button, it is possible to use icons to represent recognizable

## Design Specifications

![Toggle design specifications](images/toggle_specs.png)
![Toggle design specifications](images/toggle_group_specs.png)

_Toggle design specifications_

### Color

| Component token | Element | Token | Value |
| :---------------------------------- | :-------------------------- | :----------------------- | :---------- |
| `unselectedBackgroundColor` | Container fill:enabled | `color-grey-200` | #e6e6e6 |
| `unselectedHoverBackgroundColor` | Container fill:hover | `color-grey-300` | #cccccc |
| `unselectedActiveBackgroundColor` | Container fill:active | `color-purple-700` | #5f249f |
| `unselectedDisabledBackgroundColor` | Container fill:disabled | `color-grey-100` | #f2f2f2 |
| `unselectedFontColor` | Label | `color-black` | #000000 |
| `unselectedDisabledFontColor` | Label:disabled | `color-grey-500` | #999999 |
| `selectedBackgroundColor` | Container fill:enabled | `color-purple-700` | #5f249f |
| `selectedHoverBackgroundColor` | Container fill:hover | `color-purple-800` | #4b1c7d |
| `selectedActiveBackgroundColor` | Container fill:active | `color-purple-900` | #321353 |
| `selectedDisabledBackgroundColor` | Container fill:disabled | `color-purple-100` | #f2eafa |
| `selectedFontColor` | Label | `color-white` | #ffffff |
| `selectedDisabledFontColor` | Label:disabled | `color-purple-300` | #cbacec |
| `focusColor` | Border:focus | `color-blue-600` | #0095ff |
| `labelFontColor` | Label | `color-black` | #000000 |
| `disabledLabelFontColor` | Label:disabled | `color-grey-500` | #999999 |
| `helperTextFontColor` | Helper text | `color-black` | #000000 |
| `disabledHelperTextFontColor` | Helper text:disabled | `color-grey-500` | #999999 |
| `containerBackgroundColor` | Container | `color-grey-50` | #fafafa |
| `containerBorderColor` | Container | `color-grey-500` | #999999 |
| `unselectedBackgroundColor` | Button fill:enabled | `color-grey-200` | #e6e6e6 |
| `unselectedHoverBackgroundColor` | Button fill:hover | `color-grey-300` | #cccccc |
| `unselectedActiveBackgroundColor` | Button fill:active | `color-purple-700` | #5f249f |
| `unselectedDisabledBackgroundColor` | Button fill:disabled | `color-grey-100` | #f2f2f2 |
| `unselectedFontColor` | Button label | `color-black` | #000000 |
| `unselectedDisabledFontColor` | Button label:disabled | `color-grey-500` | #999999 |
| `selectedBackgroundColor` | Button fill:enabled | `color-purple-700` | #5f249f |
| `selectedHoverBackgroundColor` | Button fill:hover | `color-purple-800` | #4b1c7d |
| `selectedActiveBackgroundColor` | Button fill:active | `color-purple-900` | #321353 |
| `selectedDisabledBackgroundColor` | Button fill:disabled | `color-purple-100` | #f2eafa |
| `selectedFontColor` | Button label | `color-white` | #ffffff |
| `selectedDisabledFontColor` | Button label:disabled | `color-purple-300` | #cbacec |
| `focusColor` | Focus indicator | `color-blue-600` | #0095ff |

### Typography



| Component token | Element | Token | Value |
| :---------------------------------- | :------------------- | :------------------------------ | :-------------------------- |
| `fontFamily` | Label | `font-family` | 'Open Sans', sans-serif |
| `fontSize` | Label | `font-scale-03` | 1rem / 16px |
| `fontStyle` | Label | `font-style-normal` | normal |
| `fontWeight` | Label | `font-weight-regular` | 400 |
| `labelFontFamily` | Label | `font-family` | 'Open Sans', sans-serif |
| `labelFontSize` | Label | `font-scale-02` | 0.875rem / 14px |
| `labelFontStyle` | Label | `font-style-normal` | normal |
| `labelFontWeight` | Label | `font-weight-semibold` | 600 |
| `labelLineHeight` | Label | `font-leading-loose-01` | 1.75em |
| `helperTextFontFamily` | Helper text | `font-family` | 'Open Sans', sans-serif |
| `helperTextFontSize` | Helper text | `font-scale-01` | 0.75rem / 12px |
| `helperTextFontStyle` | Helper text | `font-style-normal` | normal |
| `helperTextFontWeight` | Helper text | `font-weight-regular` | 400 |
| `helperTextLineHeight` | Helper text | `font-leading-normal` | 1.5em |
| `optionLabelFontFamily` | Button label | `font-family` | 'Open Sans', sans-serif |
| `optionLabelFontSize` | Button label | `font-scale-03` | 1rem / 16px |
| `optionLabelFontStyle` | Button label | `font-style-normal` | normal |
| `optionLabelFontWeight` | Button label | `font-weight-regular` | 400 |


### Spacing

| Component token | Element | Token | Value |
| :---------------------------------- | :------------------- | :------------------------------ | :-------------------------- |
| `iconPaddingRight` | Icon | `spacing-03` | 0.5rem / 8px |
| `iconPaddingLeft` | Icon | `spacing-03` | 0.5rem / 8px |
| `labelPaddingLeft` | Label | `spacing-06` | 1.5rem / 24px |
| `labelPaddingRight` | Label | `spacing-06` | 1.5rem / 24px |

| `iconPaddingRight` | Icon | `spacing-03` | 0.5rem / 8px |
| `iconPaddingLeft` | Icon | `spacing-03` | 0.5rem / 8px |
| `labelPaddingLeft` | Label (Label + icon) | `spacing-06` | 1.5rem / 24px |
| `labelPaddingRight` | Label (Label + icon) | `spacing-06` | 1.5rem / 24px |
| `iconMarginRight` | Icon (Label + icon) | `spacing-03` | 0.5rem / 8px |
| `containerMarginTop` | Container | `spacing-02` | 0.25rem / 4px |

### Border

| Property | Element | Core token | Value |
| :----------------------- | :--------------- | :------------------------- | :--------------- |
| `border-width` | Container | `border-width-0` | 0 |
| `border-style` | Container | `border-style-none` | none |
| `border-radius` | Container | `border-radius-medium` | 0.25rem / 4px |
| `border-width` | Button | `border-width-0` | 0 |
| `border-style` | Button | `border-style-none` | none |
| `border-radius` | Button | `border-radius-medium` | 0.25rem / 4px |
| `border-width` | Container | `border-width-1` | 1px |
| `border-style` | Container | `border-style-solid` | solid |
| `border-radius` | Container | - | 0.375rem / 6px |
| `border-width` | Focus border | `border-width-2` | 2 |
| `border-style` | Focus border | `border-style-solid` | solid |
| `border-radius` | Focus border | `border-radius-medium` | 0.25rem / 4px |
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed guidelines/components/toggle/images/toggle_specs.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified guidelines/components/toggle/miniature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.