UNPKG

@kiwicom/orbit-components

Version:

<div align="center"> <a href="https://orbit.kiwi" target="_blank"> <img alt="orbit-components" src="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components.png" srcset="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components@2x.png 2x"

19 lines (15 loc) 569 B
// @flow import SPACINGS_AFTER from "./consts"; import type { Props } from "."; const getSpacingToken = ({ spaceAfter, theme }: Props) => { const tokens = { [SPACINGS_AFTER.SMALLEST]: theme.orbit.spaceXXSmall, [SPACINGS_AFTER.SMALL]: theme.orbit.spaceXSmall, [SPACINGS_AFTER.NORMAL]: theme.orbit.spaceSmall, [SPACINGS_AFTER.MEDIUM]: theme.orbit.spaceMedium, [SPACINGS_AFTER.LARGE]: theme.orbit.spaceLarge, [SPACINGS_AFTER.LARGEST]: theme.orbit.spaceXLarge, }; return spaceAfter && tokens[spaceAfter]; }; export default getSpacingToken;