diff --git a/config/yo/generator-component/app/templates/Component.tsx b/config/yo/generator-component/app/templates/Component.tsx index f8427bee..82847d45 100644 --- a/config/yo/generator-component/app/templates/Component.tsx +++ b/config/yo/generator-component/app/templates/Component.tsx @@ -6,10 +6,7 @@ import { join } from '../../util/classNames'; import { <%= name %>Props, <%= name %>Type } from './<%= name %>.types'; import { getClassNames } from './<%= name %>.styles'; -/** - * Describe what `<%= name %>` does. This will also appear as part of this component's - * documentation. - */ + export class <%= name %> extends React.Component<<%= name %>Props & CustomizableComponentProps> { public render() { const { className, type = <%= name %>Type.BLACK, theme = defaultTheme } = this.props; @@ -23,5 +20,9 @@ export class <%= name %> extends React.Component<<%= name %>Props & Customizable } } +/** + * Describe what `<%= name %>` does. This will also appear as part of this component's + * documentation. + */ @customizable('<%= name %>', ['theme']) export default class Customizable<%= name %> extends <%= name %> {} diff --git a/package-lock.json b/package-lock.json index 5daadef9..10831def 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16327,9 +16327,9 @@ } }, "react-docgen-typescript": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/react-docgen-typescript/-/react-docgen-typescript-1.6.1.tgz", - "integrity": "sha512-GNjoMwGfksDcPKnMMJ8LKElV/gWZ478B3cJMDNp3MnZ6Dd49jicpmlVg11/IpuycwWAfCyDiyv2VJNNJ55q5zA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/react-docgen-typescript/-/react-docgen-typescript-1.7.0.tgz", + "integrity": "sha512-pK8gIef5sIZqR3WQJjQKljkibgMyEUsq9EpUMG7nvIBjopApSuN1CDwOiWQW1wuQ7dIg80Jwl/kkKi3/xXgM+g==", "dev": true }, "react-dom": { diff --git a/package.json b/package.json index ca1b8e4d..ad20474a 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "raw-loader": "0.5.1", "react": "16.3.2", "react-docgen": "2.21.0", - "react-docgen-typescript": "1.6.1", + "react-docgen-typescript": "1.7.0", "react-dom": "16.3.2", "react-styleguidist": "7.0.20", "react-styleguidist-visual": "0.8.0", diff --git a/src/components/AsideSection/AsideSection.tsx b/src/components/AsideSection/AsideSection.tsx index 6cf1d1eb..2c839d4d 100644 --- a/src/components/AsideSection/AsideSection.tsx +++ b/src/components/AsideSection/AsideSection.tsx @@ -9,9 +9,6 @@ import { AsideSectionProps } from './AsideSection.types'; import Text, { TextSize } from '../Text'; import { getClassNames } from './AsideSection.styles'; -/** - * A section component to be used primarily for sidebar modules - */ export class AsideSection extends React.Component { public render() { const { title, children, theme = defaultTheme } = this.props; @@ -47,5 +44,8 @@ export class AsideSection extends React.Component { public render() { const { children, textSize, className, theme = defaultTheme, ...remainingProps } = this.props; @@ -26,5 +20,11 @@ export class Block extends React.Component { public render() { const { children, onClick, className, backgroundColor, borderColor, theme = defaultTheme } = this.props; @@ -27,5 +23,9 @@ export class Box extends React.Component } } +/** + * A Box is a div with a border and fixed padding. It also has `display: relative` so you can + * absolutely-position elements like a close button. Boxes will primarily be used for card views. + */ @customizable('Box', ['theme']) export default class CustomizableBox extends Box {} diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index ec4f6201..9c7637ed 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -19,9 +19,6 @@ import { const hrefBlacklist = ['', '#', 'javascript://']; -/** - * A `Button` allows a user to take an action. - */ export class Button extends React.Component { public static propTypes = { // TypeScript does not support negated types, so we need to do a runtime validation instead. @@ -116,5 +113,8 @@ export class Button extends React.Component { private buttonRef = React.createRef(); @@ -48,5 +43,10 @@ export class Clickable extends React.Component { private textFieldFocusable: Focusable | null; private clickableFocusable: Focusable | null; @@ -140,5 +137,8 @@ export class EditableText extends React.Component` tag (or `NavigationLink` - * component). It is meant to be nested within unstyled `NavigationLink` or `Clickable` - * components, allowing an entire block of content to be an accessible tabbable element while - * still showing individual nested "links" for sighted users. - * - * NOTE: If you are looking for click interaction please see [Clickable](#clickable). - */ export class FakeLink extends React.Component { public render() { const { className, children, theme = defaultTheme } = this.props; @@ -23,5 +15,13 @@ export class FakeLink extends React.Component` tag (or `NavigationLink` + * component). It is meant to be nested within unstyled `NavigationLink` or `Clickable` + * components, allowing an entire block of content to be an accessible tabbable element while + * still showing individual nested "links" for sighted users. + * + * NOTE: If you are looking for click interaction please see [Clickable](#clickable). + */ @customizable('FakeLink', ['theme']) export default class CustomizableFakeLink extends FakeLink {} diff --git a/src/components/Hovercard/Hovercard.tsx b/src/components/Hovercard/Hovercard.tsx index b2c110ae..97a99f6d 100644 --- a/src/components/Hovercard/Hovercard.tsx +++ b/src/components/Hovercard/Hovercard.tsx @@ -12,11 +12,6 @@ import { HovercardProps, HovercardState, TriggerType } from './Hovercard.types'; const hideDelay = 500; const showDelay = 750; -/** - * A `Hovercard` is a small popover overlay. It opens on click or - * mouse enter, and closes on mouse out and `ESC`. It should be used with `HovercardHeader` and - * `HovercardBody` components for consistent internal padding. - */ export class Hovercard extends React.Component { public static defaultProps: Partial = { directionalHint: DirectionalHint.bottomCenter, @@ -203,5 +198,10 @@ export class Hovercard extends React.Component { public render() { const { className, children, theme = defaultTheme } = this.props; @@ -23,5 +20,8 @@ export class HovercardHeader extends React.Component { public render() { const { actions, children, className, type = MessageBarType.INFO, theme = defaultTheme } = this.props; @@ -32,5 +28,9 @@ export class MessageBar extends React.Component { public render() { const { children, className, isOpen, onDismiss, size, theme = defaultTheme } = this.props; @@ -69,5 +65,9 @@ export class ModalDialog extends React.Component { public render() { const { @@ -41,5 +38,8 @@ export class NavigationLink extends React.Component> {} -/** - * Pickers are used to pick one or more entities (e.g. people, groups, topics) from a list with typeahead capabilities. - */ export class Picker extends React.Component { public render() { const { @@ -101,5 +98,9 @@ export class Picker extends React.Component { constructor(props: PreviewCardProps) { super(props); @@ -156,5 +152,9 @@ export class PreviewCard extends React.Component { public render() { const { ariaValueText, percentComplete, className, theme = defaultTheme } = this.props; @@ -25,5 +21,9 @@ export class ProgressIndicator extends React.Component { public render() { const { @@ -77,5 +73,9 @@ export class Spinner extends React.Component { public render() { const { className, isLoading, theme = defaultTheme } = this.props; @@ -97,5 +94,8 @@ export class SuggestionsList extends React.PureComponent { public render() { const { children, screenreaderText } = this.props; @@ -40,5 +35,10 @@ export class Text extends React.Component { public render() { const { children } = this.props; @@ -23,5 +20,8 @@ export class Tile extends React.Component