-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* spacing page wip * spacing story - add spacing sizes component * spacing story - remove old spacing story * add temp assets until receiving good assets * fix spacing assets * fix spacing assets * fix spacing in spacing component * code review notes
- Loading branch information
Hadas Farhi
authored
Dec 16, 2021
1 parent
8fdd067
commit 6ac9477
Showing
13 changed files
with
187 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/storybook/stand-alone-documentaion/spacing/assets/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import menuExample from "./menuExample.png"; | ||
import tipseenExample from "./tipseenExample.png"; | ||
import toolbarExample from "./toolbarExample.png"; | ||
|
||
export { menuExample, tipseenExample, toolbarExample }; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+100 KB
src/storybook/stand-alone-documentaion/spacing/assets/tipseenExample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.4 KB
src/storybook/stand-alone-documentaion/spacing/assets/toolbarExample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...ok/stand-alone-documentaion/spacing/spacing-sizes/spacing-component/spacing-component.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import cx from "classnames"; | ||
|
||
import "./spacing-component.scss"; | ||
|
||
const SpacingComponent = ({ title, sizeInPx, spacingVariableName }) => { | ||
return ( | ||
<div className="spacing-component"> | ||
<div className={cx(spacingVariableName, "spacing-component-visualizer")} /> | ||
<div className="spacing-component_description"> | ||
<div className="spacing-component_title-container"> | ||
<span className="spacing-component_title">{title}</span> | ||
<span className="spacing-component_px-size">{sizeInPx}</span> | ||
</div> | ||
<span className="spacing-component_variable-name">{`var(--${spacingVariableName})`}</span> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SpacingComponent; |
67 changes: 67 additions & 0 deletions
67
...k/stand-alone-documentaion/spacing/spacing-sizes/spacing-component/spacing-component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
@import "../../../../../styles/themes.scss"; | ||
@import "../../../../styles/typography.scss"; | ||
|
||
.spacing-xs { | ||
height: var(--spacing-xs); | ||
} | ||
|
||
.spacing-small { | ||
height: var(--spacing-small); | ||
} | ||
|
||
.spacing-medium { | ||
height: var(--spacing-medium); | ||
} | ||
|
||
.spacing-large { | ||
height: var(--spacing-large); | ||
} | ||
|
||
.spacing-xl { | ||
height: var(--spacing-xl); | ||
} | ||
|
||
.spacing-xxl { | ||
height: var(--spacing-xxl); | ||
} | ||
|
||
.spacing-xxxl { | ||
height: var(--spacing-xxxl); | ||
} | ||
|
||
.spacing-component-visualizer { | ||
@include theme-prop(background-color, negative-color-selected); | ||
width: 75px; | ||
} | ||
|
||
.spacing-component { | ||
display: flex; | ||
width: fit-content; | ||
flex-direction: column; | ||
margin: 0 var(--spacing-medium); | ||
align-items: center; | ||
|
||
&_title-container { | ||
display: flex; | ||
justify-content: center; | ||
padding: var(--spacing-medium) var(--spacing-xs) var(--spacing-medium) var(--spacing-xs); | ||
color: var(--primary-text-color); | ||
font-size: $small-text-font-size; | ||
} | ||
|
||
&_description { | ||
display: flex; | ||
justify-content: flex-end; | ||
flex-direction: column; | ||
} | ||
|
||
&_title { | ||
margin-right: var(--spacing-small); | ||
} | ||
|
||
&_variable-name { | ||
margin: 0; | ||
font-size: 11px; | ||
font-weight: 500; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/storybook/stand-alone-documentaion/spacing/spacing-sizes/spacing-sizes.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import SpacingComponent from "./spacing-component/spacing-component"; | ||
import { Frame } from "../../../components"; | ||
import "./spacing-sizes.scss"; | ||
|
||
export const SpacingSizes = () => ( | ||
<Frame className="monday-storybook-spacing-sizes"> | ||
<SpacingComponent title="XS" sizeInPx="4px" spacingVariableName="spacing-xs" /> | ||
<SpacingComponent title="S" sizeInPx="8px" spacingVariableName="spacing-small" /> | ||
<SpacingComponent title="MD" sizeInPx="16px" spacingVariableName="spacing-medium" /> | ||
<SpacingComponent title="L" sizeInPx="24px" spacingVariableName="spacing-large" /> | ||
<SpacingComponent title="XL" sizeInPx="32px" spacingVariableName="spacing-xl" /> | ||
<SpacingComponent title="XXL" sizeInPx="48px" spacingVariableName="spacing-xxl" /> | ||
<SpacingComponent title="XXXL" sizeInPx="64px" spacingVariableName="spacing-xxxl" /> | ||
</Frame> | ||
); |
9 changes: 9 additions & 0 deletions
9
src/storybook/stand-alone-documentaion/spacing/spacing-sizes/spacing-sizes.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import "../../../styles/content-spacing"; | ||
|
||
.monday-storybook-spacing-sizes { | ||
margin: $spacing-between-section-items 0; | ||
display: flex; | ||
justify-content: center; | ||
flex-direction: row; | ||
align-items: flex-end; | ||
} |
46 changes: 46 additions & 0 deletions
46
src/storybook/stand-alone-documentaion/spacing/spacing.stories.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Meta } from "@storybook/addon-docs"; | ||
import { SpacingSizes } from "./spacing-sizes/spacing-sizes"; | ||
import { Frame } from "../../components"; | ||
import {menuExample, tipseenExample, toolbarExample} from "./assets"; | ||
import "./spacing.stories.scss"; | ||
|
||
<Meta | ||
title="Foundations/Spacing" | ||
/> | ||
|
||
<!--- Component documentation --> | ||
|
||
# Spacing | ||
- [Overview](#overview) | ||
- [Spacing sizes](#spacing-sizes) | ||
- [Usage and examples](#usage-and-examples) | ||
- [Feedback](#feedback) | ||
|
||
## Overview | ||
Positioning UI should be with taught including the empty space between components. | ||
This is what creates relationships and hierarchy withing the visual controls. | ||
|
||
## Spacing sizes | ||
Using the right sizes will create consistency and hierarchy in user interface. | ||
<SpacingSizes/> | ||
|
||
<Tip title="Applying spacing"> | ||
Elements with more spacing around them perceived as more important because they get more focus on the page, | ||
while small spacing makes components look stacked and not stand out.</Tip> | ||
|
||
## Usage and examples | ||
<UsageGuidelines guidelines={[ | ||
"You can double the sizes to create bigger spacings", | ||
"Stay consistent with paddings and sizes across different UI components", | ||
"Align all the elements to the same spacing within the components or a page" | ||
]}/> | ||
|
||
<Frame className="monday-storybook-spacing_image-container"> | ||
<img className="monday-storybook-spacing_image--menu" src={menuExample} alt=""/> | ||
</Frame> | ||
<Frame className="monday-storybook-spacing_image-container"> | ||
<img className="monday-storybook-spacing_image--toolbar" src={toolbarExample} alt=""/> | ||
</Frame> | ||
<Frame className="monday-storybook-spacing_image-container "> | ||
<img className="monday-storybook-spacing_image--tipseen" src={tipseenExample} alt=""/> | ||
</Frame> |
24 changes: 24 additions & 0 deletions
24
src/storybook/stand-alone-documentaion/spacing/spacing.stories.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.monday-storybook-spacing { | ||
&_image { | ||
&-container { | ||
margin-top: 40px; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
&--menu { | ||
height: 334px; | ||
width: 470px; | ||
} | ||
|
||
&--toolbar { | ||
height: 179px; | ||
width: 527px; | ||
} | ||
|
||
&--tipseen { | ||
height: 306px; | ||
width: 439px; | ||
} | ||
} | ||
} |