Skip to content

Commit

Permalink
fix: support more sizes link and fix minor issues with arg types
Browse files Browse the repository at this point in the history
  • Loading branch information
glrodasz committed Jul 17, 2021
1 parent 6157dc2 commit 63b3a2a
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 25 deletions.
6 changes: 4 additions & 2 deletions atoms/Link/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import withStyles from '../../hocs/withStyles'

import Paragraph from '../Paragraph'

export const Link = ({ children, color, getStyles }) => {
export const Link = ({ children, size, color, getStyles }) => {
return (
<a className={getStyles('link', ['color'])}>
<Paragraph color={color} weight="semibold" isInline>
<Paragraph size={size} color={color} weight="semibold" isInline>
{children}
</Paragraph>
</a>
Expand All @@ -21,11 +21,13 @@ Link.propTypes = {
children: PropTypes.node.isRequired,
getStyles: PropTypes.func.isRequired,
color: PropTypes.oneOf(options.colors),
size: PropTypes.oneOf(options.sizes),
}

Link.defaultProps = {
getStyles: () => {},
color: 'primary',
size: 'md',
}

export default withStyles(styles)(Link)
7 changes: 6 additions & 1 deletion atoms/Link/Link.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ export default {
children: 'Mouths Muil',
},
argTypes: {
colors: getOptionsArgTypes(options.colors),
color: getOptionsArgTypes(options.colors),
size: getOptionsArgTypes(options.sizes),
},
}

export const Default = Template.bind({})

export const Colors = ListTemplate.bind({})
Colors.args = { items: options.colors.map((color) => ({ color })) }

export const Sizes = ListTemplate.bind({})
Sizes.args = { items: options.sizes.map((size) => ({ size })) }
6 changes: 5 additions & 1 deletion atoms/Link/constants.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export const options = { colors: ['primary', 'tertiary'] }
import { options as paragraphOptions } from '../Paragraph/constants'
export const options = {
colors: ['primary', 'tertiary'],
sizes: paragraphOptions.sizes,
}
2 changes: 1 addition & 1 deletion layout/Container/Container.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
height: 100%;
flex: auto;
justify-content: center;
padding: 40px 30px 20px;
padding: 20px 15px 20px;
margin: 0 auto;
}

Expand Down
4 changes: 2 additions & 2 deletions molecules/AddButton/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { options as optionsIcons } from '../../atoms/Icon'
import { options as iconOptions } from '../../atoms/Icon'

export const options = {
types: ['primary', 'secondary'],
icons: optionsIcons.names,
icons: iconOptions.names,
}
7 changes: 2 additions & 5 deletions molecules/Error/Error.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Error, styles, options } from '.'
import { Error, styles } from '.'

import { getTemplate, getOptionsArgTypes } from '../../helpers/storybook'
import { getTemplate } from '../../helpers/storybook'

const Template = getTemplate(Error, styles)

Expand All @@ -11,9 +11,6 @@ export default {
children:
"Meets counts consumed 200 Meriadoc tombs rabble noble crash thread. Another kind Imladris. Dump each Kingdom mere other's by blame ugly sending bestow mist adventure.",
},
argTypes: {
types: getOptionsArgTypes(options.types),
},
}

export const Default = Template.bind({})
Expand Down
1 change: 0 additions & 1 deletion molecules/Error/constants.js

This file was deleted.

1 change: 0 additions & 1 deletion molecules/Error/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { default, Error } from './Error'
export { options } from './constants'
export { default as styles } from './Error.module.css'
2 changes: 1 addition & 1 deletion molecules/Modal/Modal.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.modal {
position: absolute;
position: fixed;
z-index: var(--z-index-50);
top: 0;
right: 0;
Expand Down
2 changes: 1 addition & 1 deletion molecules/Modal/Modal.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
"Successful boar world's somebody herbs helpful spiders Samwise Gamgee helps unlost circles guard? Investment Thofin folly? Troublemaker minutes moldy Rivendell eve late traveling around crescent fault never naught",
},
argTypes: {
types: getOptionsArgTypes(options.types),
type: getOptionsArgTypes(options.types),
onClose: { action: 'clicked' },
},
parameters: { __sb: { fd: 'row' } },
Expand Down
10 changes: 5 additions & 5 deletions styles/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@
--font-family-mono: 'Roboto Mono', 'Courier New', monospace;

--font-size-base: 10px;
--font-size-xs: 1.1rem;
--font-size-sm: 1.3rem;
--font-size-md: 1.5rem;
--font-size-xs: 1.2rem;
--font-size-sm: 1.4rem;
--font-size-md: 1.6rem;
--font-size-lg: 1.8rem;
--font-size-xl: 2.1rem;
--font-size-xl: 2.2rem;
--font-size-2xl: 6rem;

--font-weight-hairline: 100;
Expand Down Expand Up @@ -360,7 +360,7 @@
--input-max-width: 400px;
--input-background: #fff;
--input-border-radius: 30px;
--input-font-size: 1.3rem;
--input-font-size: 1.4rem;

--picture-border: 1px solid #7e858c;

Expand Down
8 changes: 4 additions & 4 deletions tokens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ const choices = {
},
fontSize: {
base: '10px',
xs: '1.1rem',
sm: '1.3rem',
md: '1.5rem',
xs: '1.2rem',
sm: '1.4rem',
md: '1.6rem',
lg: '1.8rem',
xl: '2.1rem',
xl: '2.2rem',
'2xl': '6rem',
},
fontWeight: {
Expand Down

0 comments on commit 63b3a2a

Please sign in to comment.