Skip to content

Commit 7b48fda

Browse files
authored
Added support for additional tailwind props (#31)
1 parent 867c357 commit 7b48fda

File tree

30 files changed

+88
-113
lines changed

30 files changed

+88
-113
lines changed

package-lock.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"lodash.includes": "^4.3.0",
7272
"lodash.merge": "^4.6.1",
7373
"lodash.uniqueid": "^4.0.1",
74+
"param-case": "^2.1.1",
7475
"prop-types": "^15.6.2",
7576
"react-transition-group": "^2.4.0"
7677
},

src/components/button/Button.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const Button = ({
2727
p: { x: theme.spacing.md, y: theme.spacing.sm },
2828
rounded: theme.radius,
2929
select: 'none',
30+
noUnderline: true,
3031
}
3132

3233
if (large) {
@@ -60,6 +61,7 @@ const Button = ({
6061
break
6162
case 'link':
6263
props.rounded = undefined
64+
props.noUnderline = undefined
6365
props.leading = 'normal'
6466
props.p = 0
6567
props.underline = true

src/components/button/__tests__/__snapshots__/Button.jsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ exports[`Button renders matching snapshot 1`] = `
1414
focusable={true}
1515
is="button"
1616
leading="tight"
17+
noUnderline={true}
1718
p={
1819
Object {
1920
"x": 4,

src/components/content/ContentBlock.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ ContentBlock.propTypes = {
4343
theme: PropTypes.shape({}).isRequired,
4444
is: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]),
4545
children: PropTypes.node,
46-
className: PropTypes.string,
4746
}
4847

4948
ContentBlock.defaultProps = {
5049
is: 'section',
5150
children: undefined,
52-
className: undefined,
5351
}
5452

5553
export { ContentBlock as component }

src/components/content/ContentTitle.jsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@ import React from 'react'
22
import PropTypes from 'prop-types'
33

44
import { Title } from '../typography'
5-
import { VisuallyHidden } from '../visuallyHidden'
65

7-
const ContentTitle = ({ content: { id }, visuallyHidden, ...rest }) =>
8-
!visuallyHidden ? (
9-
<Title id={id} {...rest} />
10-
) : (
11-
<VisuallyHidden>
12-
<Title id={id} {...rest} />
13-
</VisuallyHidden>
14-
)
6+
const ContentTitle = ({ content: { id }, visuallyHidden, ...rest }) => (
7+
<Title id={id} visuallyHidden={visuallyHidden} {...rest} />
8+
)
159

1610
ContentTitle.propTypes = {
1711
content: PropTypes.shape({

src/components/footer/Footer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Footer = ({ theme, is, children, ...rest }) => (
1111
role="contentinfo"
1212
p={{ t: theme.spacing.lg, b: theme.spacing.xl }}
1313
bg={theme.brandColors.secondary}
14-
text={[theme.textColors.on.secondary, theme.text.size.body[0]]}
14+
text={theme.textColors.on.secondary}
1515
{...rest}
1616
>
1717
<Container padding>{children}</Container>

src/components/footer/__tests__/__snapshots__/Footer.jsx.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ exports[`Footer renders matching snapshot 1`] = `
1111
}
1212
}
1313
role="contentinfo"
14-
text={
15-
Array [
16-
"white",
17-
"sm",
18-
]
19-
}
14+
text="white"
2015
>
2116
<WithTheme(Container)
2217
padding={true}

src/components/footer/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ Simple wrapper around the `<footer />` element
22

33
```jsx
44
<Footer>
5-
<p className="mb-4">&copy; E Corp {new Date().getFullYear()}</p>
6-
<p>
5+
<Text is="p">&copy; E Corp {new Date().getFullYear()}</Text>
6+
<Text size={1}>
77
Cookies are used by our fictional third party partners to track your
88
browsing habits, DNA and thoughts. View our{' '}
99
<a href="#footer" className="text-white hover:text-black">
1010
privacy policy
1111
</a>{' '}
1212
to attempt to manage your preferences.
13-
</p>
13+
</Text>
1414
</Footer>
1515
```

src/components/form/Field.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Field extends PureComponent {
3737
is={is}
3838
id={this.id}
3939
m={{ b: theme.spacing.md }}
40-
className="max-w-sm"
40+
maxW="sm"
4141
{...rest}
4242
>
4343
{React.Children.map(children, child =>

0 commit comments

Comments
 (0)