-
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.
* add links support to stories * undo not needed changes
- Loading branch information
Hadas Farhi
authored
Nov 16, 2021
1 parent
889b4a2
commit 77c8b8f
Showing
8 changed files
with
69 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import cx from "classnames"; | ||
import PropTypes from "prop-types"; | ||
import CoreLink from "../../../components/Link/Link"; | ||
import "./link.scss"; | ||
import { BEMClass } from "../../../helpers/bem-helper"; | ||
|
||
const BASE_CLASS = "monday-storybook-link"; | ||
const bemHelper = BEMClass(BASE_CLASS); | ||
|
||
export const Link = ({ children, href, size }) => ( | ||
<CoreLink | ||
text={children} | ||
href={href} | ||
componentClassName={cx(BASE_CLASS, { | ||
[bemHelper({ state: "small" })]: size === Link.sizes.SMALL, | ||
[bemHelper({ state: "medium" })]: size === Link.sizes.MEDIUM | ||
})} | ||
/> | ||
); | ||
|
||
Link.sizes = { | ||
SMALL: "small", | ||
MEDIUM: "medium" | ||
}; | ||
|
||
Link.defaultProps = { | ||
children: undefined, | ||
href: undefined, | ||
size: Link.sizes.SMALL | ||
}; | ||
|
||
Link.propTypes = { | ||
children: PropTypes.string, | ||
href: PropTypes.string, | ||
size: PropTypes.oneOf([Link.sizes.SMALL, Link.sizes.MEDIUM]) | ||
}; |
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,11 @@ | ||
@import "../styles/typography.scss"; | ||
|
||
.monday-storybook-link { | ||
display: inline-flex; | ||
&--small { | ||
@include paragraph-text-without-color; | ||
} | ||
&--medium { | ||
@include content-text-without-color; | ||
} | ||
} |
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