Skip to content

Commit

Permalink
Addon-docs: Tweak props table paragraph spacing (#9307)
Browse files Browse the repository at this point in the history
Addon-docs: Tweak props table paragraph spacing
  • Loading branch information
shilman authored Jan 3, 2020
2 parents b92f181 + e914793 commit 497050b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion examples/official-storybook/components/DocgenButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import React from 'react';
import PropTypes from 'prop-types';

/** DocgenButton component description imported from comments inside the component file */
/**
* DocgenButton component description imported from comments inside the component file,
*
* *Important Note*: Unlike with normal `<input>` elements, setting this will
* not validate the input contents. This is because in this project we use
* Formik and Yup to validate fields at the form-level, not at the individual
* input level. It is still very important to set this value properly for
* accessibility and user experience.
*
* Here's a list to test out formatting.
*
* * `"number"` Any number not represented by a more specific type.
* * `"password"` A password.
* * `"email"` An email address.
* * `"tel"` A phone or fax number. Shows the phone number keypad on
* mobile keyboards.
*/
export const DocgenButton = ({ disabled, label, onClick }) => (
<button type="button" disabled={disabled} onClick={onClick}>
{label}
Expand Down Expand Up @@ -131,6 +147,11 @@ DocgenButton.propTypes = {
msg: PropTypes.instanceOf(Set),
/**
* `oneOf` is basically an Enum which is also supported but can be pretty big.
*
* Testing a list:
*
* - `News` first
* - `Photos` second
*/
enm: PropTypes.oneOf(['News', 'Photos']),
enmEval: PropTypes.oneOf((() => ['News', 'Photos'])()),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/src/blocks/PropsTable/PropRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Required = styled.span(({ theme }) => ({
const Description = styled.div(({ theme }) => ({
'&&': {
p: {
margin: 0,
margin: '0 0 10px 0',
},
},

Expand Down

1 comment on commit 497050b

@vercel
Copy link

@vercel vercel bot commented on 497050b Jan 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.