-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/handleTools-CMEM-5037
# Conflicts: # CHANGELOG.md # src/components/Dialog/Modal.tsx
- Loading branch information
Showing
10 changed files
with
191 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,38 +1,42 @@ | ||
import React from "react"; | ||
|
||
import { CLASSPREFIX as eccgui } from "../../configuration/constants"; | ||
|
||
export interface SpacingProps { | ||
export interface SpacingProps extends React.HTMLAttributes<HTMLDivElement> { | ||
/** | ||
* Set the amount of white space that separates two elements. | ||
*/ | ||
size?: "tiny" | "small" | "medium" | "large" | "xlarge" | ||
size?: "tiny" | "small" | "medium" | "large" | "xlarge"; | ||
/** | ||
* If set then is a ruler displayed in the middle of the spacing area. | ||
* The direction of the ruler is used from the spacing. | ||
*/ | ||
hasDivider?: boolean | ||
hasDivider?: boolean; | ||
/** | ||
* If set then the spacing separates two elements on the horizontal axis. | ||
* The spacing area then is created on a vertical axis. | ||
*/ | ||
vertical?: boolean | ||
vertical?: boolean; | ||
} | ||
|
||
/** | ||
* Adds horizontal or vertical space between neighbouring elements. | ||
* It also can add a visual ruler inside. | ||
*/ | ||
export const Spacing = ({ size = "medium", hasDivider = false, vertical = false }: SpacingProps) => { | ||
export const Spacing = ({ size = "medium", hasDivider = false, vertical = false, ...otherDivProps }: SpacingProps) => { | ||
const direction = vertical ? "vertical" : "horizontal"; | ||
return ( | ||
<div | ||
className={ | ||
`${eccgui}-separation__spacing-` + direction + | ||
` ${eccgui}-separation__spacing--` + size + | ||
`${eccgui}-separation__spacing-` + | ||
direction + | ||
` ${eccgui}-separation__spacing--` + | ||
size + | ||
(hasDivider ? ` ${eccgui}-separation__spacing--hasdivider` : "") | ||
} | ||
{...otherDivProps} | ||
/> | ||
); | ||
} | ||
}; | ||
|
||
export default Spacing; |
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
Oops, something went wrong.