From 9c8f4090b7bce7d874bbde05ba19ea823789058e Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Fri, 8 Feb 2019 10:36:08 +1100 Subject: [PATCH 01/14] fix: Shrink API WIP --- docs/src/App/App.tsx | 106 ++++++++++-------- .../src/App/ComponentProps/ComponentProps.tsx | 6 +- .../src/App/ComponentRoute/ComponentRoute.tsx | 78 +++++++------ lib/componentDocs/globsToReactDocgen.js | 5 +- lib/components/Alert/Alert.tsx | 19 +++- lib/components/Bullet/Bullet.css.js | 4 +- lib/components/Bullet/Bullet.css.js.d.ts | 2 +- lib/components/Bullet/Bullet.tsx | 23 ++-- lib/components/BulletList/BulletList.tsx | 12 +- lib/components/Card/Card.docs.tsx | 33 +++--- lib/components/Card/Card.tsx | 16 ++- lib/components/Checkbox/Checkbox.tsx | 37 ++---- lib/components/Divider/Divider.tsx | 32 ++---- lib/components/FieldLabel/FieldLabel.tsx | 16 ++- lib/components/FieldMessage/FieldMessage.tsx | 40 +++---- lib/components/Text/Text.css.js | 3 +- lib/components/Text/Text.tsx | 15 ++- .../icons/ChevronIcon/ChevronIcon.tsx | 13 ++- lib/components/icons/Icon/Icon.tsx | 11 +- 19 files changed, 242 insertions(+), 229 deletions(-) diff --git a/docs/src/App/App.tsx b/docs/src/App/App.tsx index 2f3019c9994..3f7ad2cfba5 100644 --- a/docs/src/App/App.tsx +++ b/docs/src/App/App.tsx @@ -103,54 +103,64 @@ export default withRouter( paddingLeft="gutter" paddingRight="gutter" > - - Tools - - - - - Source - - - - - Playroom - - - - - Components - - - {Object.keys(components) - .filter(x => !/icon/i.test(x)) - .sort() - .map(componentName => ( - - - {componentName} - - - ))} - - - Icons - + + + Tools + + + + + + + Source + + + + + Playroom + + + + + + + Components + + + + + {Object.keys(components) + .filter(x => !/icon/i.test(x)) + .sort() + .map(componentName => ( + + + {componentName} + + + ))} + + + + + Icons + + {Object.keys(components) .filter(x => /icon/i.test(x) && x !== 'Icon') diff --git a/docs/src/App/ComponentProps/ComponentProps.tsx b/docs/src/App/ComponentProps/ComponentProps.tsx index d9032990ceb..9c6da2676e4 100644 --- a/docs/src/App/ComponentProps/ComponentProps.tsx +++ b/docs/src/App/ComponentProps/ComponentProps.tsx @@ -27,9 +27,9 @@ export default class ComponentProps extends Component { return Object.keys(props).length === 0 ? null : ( - - Options - + + Options + {map(props, (option, propName) => { if (!option) { return null; diff --git a/docs/src/App/ComponentRoute/ComponentRoute.tsx b/docs/src/App/ComponentRoute/ComponentRoute.tsx index 38f713e4c77..a056b44bc3f 100644 --- a/docs/src/App/ComponentRoute/ComponentRoute.tsx +++ b/docs/src/App/ComponentRoute/ComponentRoute.tsx @@ -34,36 +34,42 @@ export default class ComponentRoute extends Component { return ( - - {componentName} - - {examples.length > 0 ? ( - - Example - {examples.length > 1 ? 's' : ''} + + + {componentName} + + {examples.length > 0 ? ( + + + Example + {examples.length > 1 ? 's' : ''} + + ) : null} {examples.map(({ label, render, code }, index) => ( - {label ? {label} : null} + {label ? ( + + {label} + + ) : null} {render ? themes.map(theme => ( - - Theme: {theme.name} - + + Theme: {theme.name} + {render({ id: `${index}_${theme.name}` })} )) : null} - - Code: - - + Code: + + { overflowX: 'auto' }} > - {render - ? reactElementToJSXString(render({ id: 'id' }), { - useBooleanShorthandSyntax: false, - showDefaultProps: false, - showFunctions: true - }) - : null} - {code ? dedent(code) : null} - + + {render + ? reactElementToJSXString(render({ id: 'id' }), { + useBooleanShorthandSyntax: false, + showDefaultProps: false, + showFunctions: true + }) + : null} + {code ? dedent(code) : null} + + ))} @@ -90,14 +98,16 @@ export default class ComponentRoute extends Component { - - Source - - - - View on GitHub - - + + Source + + + + + View on GitHub + + + ); } diff --git a/lib/componentDocs/globsToReactDocgen.js b/lib/componentDocs/globsToReactDocgen.js index 4b44be85694..2276a76caed 100644 --- a/lib/componentDocs/globsToReactDocgen.js +++ b/lib/componentDocs/globsToReactDocgen.js @@ -1,10 +1,7 @@ const path = require('path'); const fastGlob = require('fast-glob').async; const { parse: parseTs } = require('react-docgen-typescript').withCustomConfig( - path.join(process.cwd(), 'tsconfig.json'), - { - propFilter: prop => !/node_modules/.test(prop.parent.fileName) - } + path.join(process.cwd(), 'tsconfig.json') ); module.exports = async ({ include = '', exclude: ignore = [] } = {}) => { diff --git a/lib/components/Alert/Alert.tsx b/lib/components/Alert/Alert.tsx index 8b0e7151f6b..694da841f4b 100644 --- a/lib/components/Alert/Alert.tsx +++ b/lib/components/Alert/Alert.tsx @@ -1,5 +1,5 @@ import React, { Component, ReactNode } from 'react'; -import Box, { BoxProps } from '../Box/Box'; +import Box from '../Box/Box'; import Text from '../Text/Text'; import InfoIcon from '../icons/InfoIcon/InfoIcon'; import ErrorIcon from '../icons/ErrorIcon/ErrorIcon'; @@ -7,18 +7,26 @@ import styles from './Alert.css.js'; type Tone = 'info' | 'critical'; -export interface AlertProps extends BoxProps { +export interface AlertProps { tone?: Tone; children: ReactNode; } const iconForTone = (tone: Tone) => { if (tone === 'info') { - return ; + return ( + + + + ); } if (tone === 'critical') { - return ; + return ( + + + + ); } return null; @@ -40,7 +48,7 @@ export default class Alert extends Component { static displayName = 'Alert'; render() { - const { tone = 'info', children, ...restProps } = this.props; + const { tone = 'info', children } = this.props; const icon = iconForTone(tone); const color = textColorForTone(tone); @@ -52,7 +60,6 @@ export default class Alert extends Component { paddingRight="gutter" paddingTop="medium" paddingBottom="medium" - {...restProps} >
{icon}
diff --git a/lib/components/Bullet/Bullet.css.js b/lib/components/Bullet/Bullet.css.js index bc97108a679..93705707c93 100644 --- a/lib/components/Bullet/Bullet.css.js +++ b/lib/components/Bullet/Bullet.css.js @@ -1,5 +1,3 @@ export default { - '.root': { - marginLeft: '1.3em' - } + '.block': { display: 'block' } }; diff --git a/lib/components/Bullet/Bullet.css.js.d.ts b/lib/components/Bullet/Bullet.css.js.d.ts index 62114034288..7a06bcd0400 100644 --- a/lib/components/Bullet/Bullet.css.js.d.ts +++ b/lib/components/Bullet/Bullet.css.js.d.ts @@ -1,3 +1,3 @@ // This file is automatically generated. // Please do not change this file! -export const root: string; +export const block: string; diff --git a/lib/components/Bullet/Bullet.tsx b/lib/components/Bullet/Bullet.tsx index ac5c0d719b5..1de86283604 100644 --- a/lib/components/Bullet/Bullet.tsx +++ b/lib/components/Bullet/Bullet.tsx @@ -1,23 +1,24 @@ -import React, { Component } from 'react'; -import classnames from 'classnames'; -import Text, { TextProps } from '../Text/Text'; +import React, { Component, ReactNode } from 'react'; +import Box from '../Box/Box'; +import Text from '../Text/Text'; import styles from './Bullet.css.js'; -export type BulletProps = TextProps; +export interface BulletProps { + children?: ReactNode; +} export default class Bullet extends Component { static displayName = 'Bullet'; render() { - const { className } = this.props; + const { children } = this.props; return ( - + + + {children} + + ); } } diff --git a/lib/components/BulletList/BulletList.tsx b/lib/components/BulletList/BulletList.tsx index 316d40e2cb2..fe73c6945e0 100644 --- a/lib/components/BulletList/BulletList.tsx +++ b/lib/components/BulletList/BulletList.tsx @@ -1,12 +1,16 @@ -import React, { Component } from 'react'; -import Box, { BoxProps } from '../Box/Box'; +import React, { Component, ReactNode } from 'react'; +import Box from '../Box/Box'; -export type BulletListProps = BoxProps; +export interface BulletListProps { + children?: ReactNode; +} export default class BulletList extends Component { static displayName = 'BulletList'; render() { - return ; + const { children } = this.props; + + return {children}; } } diff --git a/lib/components/Card/Card.docs.tsx b/lib/components/Card/Card.docs.tsx index 3e297e2252e..e7f71551094 100644 --- a/lib/components/Card/Card.docs.tsx +++ b/lib/components/Card/Card.docs.tsx @@ -16,22 +16,25 @@ const docs: ComponentDocs = { paddingBottom="small" style={{ backgroundColor: '#ccc' }} > - - This text is inside a card. + + + This text is inside a card. + - - This text is inside a card. + + + This text is inside a card. + ) diff --git a/lib/components/Card/Card.tsx b/lib/components/Card/Card.tsx index 67715d2b3f7..af47f4309a9 100644 --- a/lib/components/Card/Card.tsx +++ b/lib/components/Card/Card.tsx @@ -1,12 +1,20 @@ -import React, { Component } from 'react'; -import Box, { BoxProps } from '../Box/Box'; +import React, { Component, ReactNode } from 'react'; +import Box from '../Box/Box'; -export type CardProps = BoxProps; +export interface CardProps { + children?: ReactNode; +} export default class Card extends Component { static displayName = 'Card'; render() { - return ; + const { children } = this.props; + + return ( + + {children} + + ); } } diff --git a/lib/components/Checkbox/Checkbox.tsx b/lib/components/Checkbox/Checkbox.tsx index 3ed02dc83f4..987ba354858 100644 --- a/lib/components/Checkbox/Checkbox.tsx +++ b/lib/components/Checkbox/Checkbox.tsx @@ -1,6 +1,5 @@ import React, { Component, ReactNode, AllHTMLAttributes } from 'react'; import classnames from 'classnames'; -import { Omit } from 'utility-types'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; import getCheckboxRadioSize from '../private/getCheckboxRadioSize'; import Box from '../Box/Box'; @@ -22,19 +21,16 @@ const textColorForState = (disabled: boolean, hovered: boolean) => { return 'neutral'; }; +type InputProps = AllHTMLAttributes; +type RequiredInputProps = 'id' | 'checked' | 'onChange'; +type OptionalInputProps = 'disabled' | 'children'; export interface CheckboxProps - extends Omit, 'label'> { + extends Required>, + Pick { variant?: 'default' | 'inChecklistCard'; - id: string; - checked: boolean; label: ReactNode; - disabled?: boolean; - inputProps?: object; - labelProps?: object; tone?: 'neutral' | 'critical' | 'positive'; message?: ReactNode | false; - messageProps?: object; - children?: ReactNode; } interface State { @@ -73,15 +69,9 @@ export default class Checkbox extends Component { checked, label, disabled = false, - className, - style, - inputProps, - labelProps, tone, message, - messageProps, - children, - ...restProps + children } = this.props; const { hovered } = this.state; @@ -91,12 +81,11 @@ export default class Checkbox extends Component { return (
{ checked={checked} disabled={disabled} aria-describedby={fieldMessageId} - {...restProps} - {...inputProps} />
{ ) }} htmlFor={id} - {...labelProps} onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut} > @@ -207,14 +193,14 @@ export default class Checkbox extends Component { theme.atoms.transition.fast )} /> - + > + + { id={fieldMessageId} tone={tone} message={message} - {...messageProps} /> ) : null} diff --git a/lib/components/Divider/Divider.tsx b/lib/components/Divider/Divider.tsx index 01dac145875..6b0c06bec2d 100644 --- a/lib/components/Divider/Divider.tsx +++ b/lib/components/Divider/Divider.tsx @@ -1,35 +1,21 @@ import React, { Component } from 'react'; -import classnames from 'classnames'; import styles from './Divider.css.js'; -import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; -import Box, { BoxProps } from '../Box/Box'; -import { BorderColorVariants, BorderWidthVariants } from '../../themes/theme'; +import Box from '../Box/Box'; -export interface DividerProps extends BoxProps { - borderColor?: BorderColorVariants; - borderWidth?: BorderWidthVariants; -} +export type DividerProps = {}; export default class Divider extends Component { static displayName = 'Divider'; render() { - const { borderColor, borderWidth, className, ...restProps } = this.props; - return ( - - {theme => ( - -
- - )} - + + + ); } } diff --git a/lib/components/FieldLabel/FieldLabel.tsx b/lib/components/FieldLabel/FieldLabel.tsx index 9954fc46a0b..99ad997afec 100644 --- a/lib/components/FieldLabel/FieldLabel.tsx +++ b/lib/components/FieldLabel/FieldLabel.tsx @@ -1,12 +1,20 @@ -import React, { Component } from 'react'; -import Text, { TextProps } from '../Text/Text'; +import React, { Component, ReactNode } from 'react'; +import Text from '../Text/Text'; -export type FieldLabelProps = TextProps; +export interface FieldLabelProps { + children?: ReactNode; +} export default class FieldLabel extends Component { static displayName = 'FieldLabel'; render() { - return ; + const { children } = this.props; + + return ( + + {children} + + ); } } diff --git a/lib/components/FieldMessage/FieldMessage.tsx b/lib/components/FieldMessage/FieldMessage.tsx index 51843ba8cb2..a8370ec3e4b 100644 --- a/lib/components/FieldMessage/FieldMessage.tsx +++ b/lib/components/FieldMessage/FieldMessage.tsx @@ -1,33 +1,31 @@ import React, { Component, ReactNode } from 'react'; -import classnames from 'classnames'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; -import { Theme } from '../../themes/theme'; +import Box from '../Box/Box'; import Text, { TextProps } from '../Text/Text'; import ErrorIcon from '../icons/ErrorIcon/ErrorIcon'; import TickCircleIcon from '../icons/TickCircleIcon/TickCircleIcon'; import styles from './FieldMessage.css.js'; export interface FieldMessageProps extends TextProps { + id?: string; tone?: 'neutral' | 'critical' | 'positive'; message: ReactNode | false; } -const renderIcon = (theme: Theme, tone: FieldMessageProps['tone']) => { +const renderIcon = (tone: FieldMessageProps['tone']) => { if (tone === 'critical') { return ( - + + + ); } if (tone === 'positive') { return ( - + + + ); } @@ -38,19 +36,21 @@ export default class FieldMessage extends Component { static displayName = 'FieldMessage'; render() { - const { tone = 'neutral', message, ...restProps } = this.props; + const { id, tone = 'neutral', message } = this.props; return message === false ? null : ( {theme => ( - -
- {/* This element acts as a min-height, preserving vertical space for the message: */} -
- {renderIcon(theme, tone)} -
{message}
-
- + + +
+ {/* This element acts as a min-height, preserving vertical space for the message: */} +
+ {renderIcon(tone)} +
{message}
+
+ + )} ); diff --git a/lib/components/Text/Text.css.js b/lib/components/Text/Text.css.js index 6cee325927e..00ca02daa6d 100644 --- a/lib/components/Text/Text.css.js +++ b/lib/components/Text/Text.css.js @@ -4,6 +4,7 @@ export default { }, '.listItem': { display: 'list-item', - listStyle: 'disc' + listStyle: 'disc', + marginLeft: '1.3em' } }; diff --git a/lib/components/Text/Text.tsx b/lib/components/Text/Text.tsx index 90227504338..504c5f8321c 100644 --- a/lib/components/Text/Text.tsx +++ b/lib/components/Text/Text.tsx @@ -1,5 +1,4 @@ -import React, { Component } from 'react'; -import { Omit } from 'utility-types'; +import React, { Component, ReactNode } from 'react'; import classnames from 'classnames'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; import styles from './Text.css.js'; @@ -11,7 +10,8 @@ import { TransformVariants } from '../../themes/theme'; -export interface TextProps extends Omit { +export interface TextProps extends Pick { + children?: ReactNode; size?: FontSizeVariants; color?: ColorVariants; weight?: FontWeightVariants; @@ -37,8 +37,7 @@ export default class Text extends Component { color, weight, baseline = true, - className, - ...restProps + children } = this.props; const transformSize = `${size}Text`; @@ -51,7 +50,6 @@ export default class Text extends Component { { typeof component === 'string' && /^li$/i.test(component) } )} - {...restProps} - /> + > + {children} + ); }} diff --git a/lib/components/icons/ChevronIcon/ChevronIcon.tsx b/lib/components/icons/ChevronIcon/ChevronIcon.tsx index ac918071a6d..1786e682dd8 100644 --- a/lib/components/icons/ChevronIcon/ChevronIcon.tsx +++ b/lib/components/icons/ChevronIcon/ChevronIcon.tsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import classnames from 'classnames'; import { Omit } from 'utility-types'; +import Box from '../../Box/Box'; import Icon, { IconProps } from '../Icon/Icon'; import ChevronSvg from './ChevronSvg'; import styles from './ChevronIcon.css.js'; @@ -13,18 +14,18 @@ export default class ChevronIcon extends Component { static displayName = 'ChevronIcon'; render() { - const { className, direction = 'down', ...restProps } = this.props; + const { direction = 'down' } = this.props; return ( - + > + + ); } } diff --git a/lib/components/icons/Icon/Icon.tsx b/lib/components/icons/Icon/Icon.tsx index 810ff419f46..288a52aca5a 100644 --- a/lib/components/icons/Icon/Icon.tsx +++ b/lib/components/icons/Icon/Icon.tsx @@ -1,12 +1,11 @@ import React, { Component, ComponentType } from 'react'; -import { Omit } from 'utility-types'; import classnames from 'classnames'; -import Box, { BoxProps } from '../../Box/Box'; +import Box from '../../Box/Box'; import ThemeConsumer from '../../ThemeConsumer/ThemeConsumer'; import styles from './Icon.css.js'; import { TextSize, FillVariants, SizeVariants } from '../../../themes/theme'; -export interface IconProps extends Omit { +export interface IconProps { size?: TextSize | 'fill'; inline?: boolean; fill?: FillVariants; @@ -26,12 +25,10 @@ export default class Icon extends Component { {theme => { const { - className, size = 'standard', svgComponent, inline = false, - fill, - ...restProps + fill } = this.props; const sizeAtom = `${size}Text${inline ? 'Inline' : ''}`; const widthAtom = isSizeVariant(theme.atoms.width, sizeAtom) @@ -45,7 +42,6 @@ export default class Icon extends Component { { [styles.inline]: inline } )} - {...restProps} /> ); }} From 26d765531a1df19f3f8fb1ded36af03e80f41b60 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Thu, 14 Feb 2019 10:47:58 +1100 Subject: [PATCH 02/14] fix: Finish shrink of API surface area --- .../Alert/__snapshots__/Alert.test.tsx.snap | 392 +++++---- .../Bullet/__snapshots__/Bullet.test.tsx.snap | 32 +- .../__snapshots__/Checkbox.test.tsx.snap | 808 +++++++++++------- .../__snapshots__/ChecklistCard.test.tsx.snap | 448 ++++++---- lib/components/Divider/Divider.tsx | 4 +- .../__snapshots__/Divider.test.tsx.snap | 8 +- .../__snapshots__/FieldMessage.test.tsx.snap | 408 +++++---- lib/components/Radio/Radio.tsx | 29 +- .../Radio/__snapshots__/Radio.test.tsx.snap | 368 +++++--- lib/components/Strong/Strong.tsx | 16 +- .../Strong/__snapshots__/Strong.test.tsx.snap | 16 +- .../__snapshots__/ChevronIcon.test.tsx.snap | 616 +++++++------ lib/components/private/examplesForIcon.tsx | 17 +- 13 files changed, 1888 insertions(+), 1274 deletions(-) diff --git a/lib/components/Alert/__snapshots__/Alert.test.tsx.snap b/lib/components/Alert/__snapshots__/Alert.test.tsx.snap index 168ad742d14..50dfdf5600a 100644 --- a/lib/components/Alert/__snapshots__/Alert.test.tsx.snap +++ b/lib/components/Alert/__snapshots__/Alert.test.tsx.snap @@ -10,16 +10,20 @@ exports[`Alert Theme: jobStreet Tones critical 1`] = `
- - - + + + +
- - - - - + + + + + +
- - - - - + + + + + +
- - - + + + +
- - - - - + + + + + +
- - - - - + + + + + +
- - - + + + +
- - - - - + + + + + +
- - - - - + + + + + +
- - - + + + +
- - - - - + + + + + +
- - - - - + + + + + +
- Bullet + + Bullet + `; exports[`Bullet Theme: seekAnz Default 1`] = `
  • - Bullet + + Bullet +
  • `; exports[`Bullet Theme: seekAsia Default 1`] = `
  • - Bullet + + Bullet +
  • `; exports[`Bullet Theme: wireframe Default 1`] = `
  • - Bullet + + Bullet +
  • `; diff --git a/lib/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap b/lib/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap index 0f373aa633f..b47b9fb5dfa 100644 --- a/lib/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +++ b/lib/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap @@ -42,16 +42,20 @@ exports[`Checkbox Theme: jobStreet Checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -123,16 +131,20 @@ exports[`Checkbox Theme: jobStreet Children when checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -213,16 +229,20 @@ exports[`Checkbox Theme: jobStreet Children when unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -303,16 +327,20 @@ exports[`Checkbox Theme: jobStreet Unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -384,16 +416,20 @@ exports[`Checkbox Theme: jobStreet With message 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 1;" /> - - - + + + +
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -487,16 +531,20 @@ exports[`Checkbox Theme: seekAnz Checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -568,16 +620,20 @@ exports[`Checkbox Theme: seekAnz Children when checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -658,16 +718,20 @@ exports[`Checkbox Theme: seekAnz Children when unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -748,16 +816,20 @@ exports[`Checkbox Theme: seekAnz Unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -829,16 +905,20 @@ exports[`Checkbox Theme: seekAnz With message 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 1;" /> - - - + + + +
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -932,16 +1020,20 @@ exports[`Checkbox Theme: seekAsia Checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1013,16 +1109,20 @@ exports[`Checkbox Theme: seekAsia Children when checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1103,16 +1207,20 @@ exports[`Checkbox Theme: seekAsia Children when unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1193,16 +1305,20 @@ exports[`Checkbox Theme: seekAsia Unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1274,16 +1394,20 @@ exports[`Checkbox Theme: seekAsia With message 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 1;" /> - - - + + + +
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -1377,16 +1509,20 @@ exports[`Checkbox Theme: wireframe Checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1458,16 +1598,20 @@ exports[`Checkbox Theme: wireframe Children when checked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1548,16 +1696,20 @@ exports[`Checkbox Theme: wireframe Children when unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1638,16 +1794,20 @@ exports[`Checkbox Theme: wireframe Unchecked 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1719,16 +1883,20 @@ exports[`Checkbox Theme: wireframe With message 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 1;" /> - - - + + + +
    - - - -
    - Message +
    + + + +
    +
    + Message +
    diff --git a/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap b/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap index a2ba6cb6201..d32ebc7e6dc 100644 --- a/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap +++ b/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap @@ -44,16 +44,20 @@ exports[`ChecklistCard Theme: jobStreet Default 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -85,7 +93,7 @@ exports[`ChecklistCard Theme: jobStreet Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -169,7 +185,7 @@ exports[`ChecklistCard Theme: jobStreet Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -296,16 +320,20 @@ exports[`ChecklistCard Theme: seekAnz Default 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -337,7 +369,7 @@ exports[`ChecklistCard Theme: seekAnz Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -421,7 +461,7 @@ exports[`ChecklistCard Theme: seekAnz Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -548,16 +596,20 @@ exports[`ChecklistCard Theme: seekAsia Default 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -589,7 +645,7 @@ exports[`ChecklistCard Theme: seekAsia Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -673,7 +737,7 @@ exports[`ChecklistCard Theme: seekAsia Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -800,16 +872,20 @@ exports[`ChecklistCard Theme: wireframe Default 1`] = ` class="Checkbox__checkbox Checkbox__checkboxCritical borderRadius__standard transition__fast Box__root borderColor__critical borderWidth__standard" style="opacity: 0;" /> - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -841,7 +921,7 @@ exports[`ChecklistCard Theme: wireframe Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -925,7 +1013,7 @@ exports[`ChecklistCard Theme: wireframe Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    - - - + + + +
    -
    + class="FieldMessage__content" + > +
    +
    +
    diff --git a/lib/components/Divider/Divider.tsx b/lib/components/Divider/Divider.tsx index 6b0c06bec2d..ed2547472e1 100644 --- a/lib/components/Divider/Divider.tsx +++ b/lib/components/Divider/Divider.tsx @@ -2,9 +2,7 @@ import React, { Component } from 'react'; import styles from './Divider.css.js'; import Box from '../Box/Box'; -export type DividerProps = {}; - -export default class Divider extends Component { +export default class Divider extends Component<{}> { static displayName = 'Divider'; render() { diff --git a/lib/components/Divider/__snapshots__/Divider.test.tsx.snap b/lib/components/Divider/__snapshots__/Divider.test.tsx.snap index 2e4260c1d0b..a6abd243345 100644 --- a/lib/components/Divider/__snapshots__/Divider.test.tsx.snap +++ b/lib/components/Divider/__snapshots__/Divider.test.tsx.snap @@ -5,7 +5,7 @@ exports[`Divider Theme: jobStreet Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    `; @@ -15,7 +15,7 @@ exports[`Divider Theme: seekAnz Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    `; @@ -25,7 +25,7 @@ exports[`Divider Theme: seekAsia Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    `; @@ -35,7 +35,7 @@ exports[`Divider Theme: wireframe Default 1`] = ` class="Divider__root Box__root borderColor__standard" >
    `; diff --git a/lib/components/FieldMessage/__snapshots__/FieldMessage.test.tsx.snap b/lib/components/FieldMessage/__snapshots__/FieldMessage.test.tsx.snap index ab0e5bfad96..26ca68cf907 100644 --- a/lib/components/FieldMessage/__snapshots__/FieldMessage.test.tsx.snap +++ b/lib/components/FieldMessage/__snapshots__/FieldMessage.test.tsx.snap @@ -2,27 +2,35 @@ exports[`FieldMessage Theme: jobStreet Critical 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -30,17 +38,21 @@ exports[`FieldMessage Theme: jobStreet Critical 1`] = ` exports[`FieldMessage Theme: jobStreet Default 1`] = `
    -
    - Message + class="FieldMessage__content" + > +
    +
    + Message +
    @@ -48,16 +60,20 @@ exports[`FieldMessage Theme: jobStreet Default 1`] = ` exports[`FieldMessage Theme: jobStreet Empty 1`] = `
    -
    + class="FieldMessage__content" + > +
    +
    +
    `; @@ -66,27 +82,35 @@ exports[`FieldMessage Theme: jobStreet False 1`] = `null`; exports[`FieldMessage Theme: jobStreet Positive 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -94,27 +118,35 @@ exports[`FieldMessage Theme: jobStreet Positive 1`] = ` exports[`FieldMessage Theme: seekAnz Critical 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -122,17 +154,21 @@ exports[`FieldMessage Theme: seekAnz Critical 1`] = ` exports[`FieldMessage Theme: seekAnz Default 1`] = `
    -
    - Message + class="FieldMessage__content" + > +
    +
    + Message +
    @@ -140,16 +176,20 @@ exports[`FieldMessage Theme: seekAnz Default 1`] = ` exports[`FieldMessage Theme: seekAnz Empty 1`] = `
    -
    + class="FieldMessage__content" + > +
    +
    +
    `; @@ -158,27 +198,35 @@ exports[`FieldMessage Theme: seekAnz False 1`] = `null`; exports[`FieldMessage Theme: seekAnz Positive 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -186,27 +234,35 @@ exports[`FieldMessage Theme: seekAnz Positive 1`] = ` exports[`FieldMessage Theme: seekAsia Critical 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -214,17 +270,21 @@ exports[`FieldMessage Theme: seekAsia Critical 1`] = ` exports[`FieldMessage Theme: seekAsia Default 1`] = `
    -
    - Message + class="FieldMessage__content" + > +
    +
    + Message +
    @@ -232,16 +292,20 @@ exports[`FieldMessage Theme: seekAsia Default 1`] = ` exports[`FieldMessage Theme: seekAsia Empty 1`] = `
    -
    + class="FieldMessage__content" + > +
    +
    +
    `; @@ -250,27 +314,35 @@ exports[`FieldMessage Theme: seekAsia False 1`] = `null`; exports[`FieldMessage Theme: seekAsia Positive 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -278,27 +350,35 @@ exports[`FieldMessage Theme: seekAsia Positive 1`] = ` exports[`FieldMessage Theme: wireframe Critical 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -306,17 +386,21 @@ exports[`FieldMessage Theme: wireframe Critical 1`] = ` exports[`FieldMessage Theme: wireframe Default 1`] = `
    -
    - Message + class="FieldMessage__content" + > +
    +
    + Message +
    @@ -324,16 +408,20 @@ exports[`FieldMessage Theme: wireframe Default 1`] = ` exports[`FieldMessage Theme: wireframe Empty 1`] = `
    -
    + class="FieldMessage__content" + > +
    +
    +
    `; @@ -342,27 +430,35 @@ exports[`FieldMessage Theme: wireframe False 1`] = `null`; exports[`FieldMessage Theme: wireframe Positive 1`] = `
    - - - -
    - Message +
    + + + +
    +
    + Message +
    diff --git a/lib/components/Radio/Radio.tsx b/lib/components/Radio/Radio.tsx index cb227ffd1e1..08adf2ca699 100644 --- a/lib/components/Radio/Radio.tsx +++ b/lib/components/Radio/Radio.tsx @@ -1,6 +1,5 @@ import React, { Component, ReactNode, AllHTMLAttributes } from 'react'; import classnames from 'classnames'; -import { Omit } from 'utility-types'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; import getCheckboxRadioSize from '../private/getCheckboxRadioSize'; import Box from '../Box/Box'; @@ -21,19 +20,16 @@ const textColorForState = (disabled: boolean, hovered: boolean) => { return 'neutral'; }; +type InputProps = AllHTMLAttributes; +type RequiredInputProps = 'id' | 'checked' | 'onChange'; +type OptionalInputProps = 'disabled' | 'children'; export interface RadioProps - extends Omit, 'label'> { + extends Required>, + Pick { variant?: 'default' | 'inChecklistCard'; - id: string; - checked: boolean; label: ReactNode; - disabled?: boolean; - inputProps?: object; - labelProps?: object; tone?: 'neutral' | 'critical' | 'positive'; message?: ReactNode | false; - messageProps?: object; - children?: ReactNode; } interface State { @@ -72,15 +68,9 @@ export default class Radio extends Component { label, checked, disabled = false, - className, - style, - inputProps, - labelProps, tone = 'neutral', message, - messageProps, - children, - ...restProps + children } = this.props; const { hovered } = this.state; @@ -91,12 +81,11 @@ export default class Radio extends Component { return (
    { checked={checked} disabled={disabled} aria-describedby={fieldMessageId} - {...restProps} - {...inputProps} />
    { ) }} htmlFor={id} - {...labelProps} onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut} > @@ -227,7 +213,6 @@ export default class Radio extends Component { id={fieldMessageId} tone={tone} message={message} - {...messageProps} /> ) : null} diff --git a/lib/components/Radio/__snapshots__/Radio.test.tsx.snap b/lib/components/Radio/__snapshots__/Radio.test.tsx.snap index c8ff475aa4b..91962d2bc66 100644 --- a/lib/components/Radio/__snapshots__/Radio.test.tsx.snap +++ b/lib/components/Radio/__snapshots__/Radio.test.tsx.snap @@ -55,17 +55,21 @@ exports[`Radio Theme: jobStreet Checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -137,17 +141,21 @@ exports[`Radio Theme: jobStreet Children when checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -218,17 +226,21 @@ exports[`Radio Theme: jobStreet Children when unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -289,17 +301,21 @@ exports[`Radio Theme: jobStreet Unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -371,28 +387,36 @@ exports[`Radio Theme: jobStreet With message 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -455,17 +479,21 @@ exports[`Radio Theme: seekAnz Checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -537,17 +565,21 @@ exports[`Radio Theme: seekAnz Children when checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -618,17 +650,21 @@ exports[`Radio Theme: seekAnz Children when unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -689,17 +725,21 @@ exports[`Radio Theme: seekAnz Unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -771,28 +811,36 @@ exports[`Radio Theme: seekAnz With message 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -855,17 +903,21 @@ exports[`Radio Theme: seekAsia Checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -937,17 +989,21 @@ exports[`Radio Theme: seekAsia Children when checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1018,17 +1074,21 @@ exports[`Radio Theme: seekAsia Children when unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1089,17 +1149,21 @@ exports[`Radio Theme: seekAsia Unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1171,28 +1235,36 @@ exports[`Radio Theme: seekAsia With message 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    - - - -
    - Message +
    + + + +
    +
    + Message +
    @@ -1255,17 +1327,21 @@ exports[`Radio Theme: wireframe Checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1337,17 +1413,21 @@ exports[`Radio Theme: wireframe Children when checked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1418,17 +1498,21 @@ exports[`Radio Theme: wireframe Children when unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1489,17 +1573,21 @@ exports[`Radio Theme: wireframe Unchecked 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    -
    + class="FieldMessage__content" + > +
    +
    +
    @@ -1571,28 +1659,36 @@ exports[`Radio Theme: wireframe With message 1`] = ` class="Box__root borderColor__standard paddingRight__none paddingLeft__none" >
    - - - -
    - Message +
    + + + +
    +
    + Message +
    diff --git a/lib/components/Strong/Strong.tsx b/lib/components/Strong/Strong.tsx index a046df48ee5..9162c2d4f66 100644 --- a/lib/components/Strong/Strong.tsx +++ b/lib/components/Strong/Strong.tsx @@ -1,24 +1,14 @@ -import React, { Component, AllHTMLAttributes } from 'react'; -import classnames from 'classnames'; +import React, { Component } from 'react'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; -export type StrongProps = AllHTMLAttributes; - -export default class Strong extends Component { +export default class Strong extends Component<{}> { static displayName = 'Strong'; render() { return ( {theme => { - const { className, ...restProps } = this.props; - - return ( - - ); + return ; }} ); diff --git a/lib/components/Strong/__snapshots__/Strong.test.tsx.snap b/lib/components/Strong/__snapshots__/Strong.test.tsx.snap index 6a416230572..082a4dcae2b 100644 --- a/lib/components/Strong/__snapshots__/Strong.test.tsx.snap +++ b/lib/components/Strong/__snapshots__/Strong.test.tsx.snap @@ -3,31 +3,23 @@ exports[`Strong Theme: jobStreet Default 1`] = ` - Children - +/> `; exports[`Strong Theme: seekAnz Default 1`] = ` - Children - +/> `; exports[`Strong Theme: seekAsia Default 1`] = ` - Children - +/> `; exports[`Strong Theme: wireframe Default 1`] = ` - Children - +/> `; diff --git a/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap b/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap index 8ad09c4d089..fee91a1441e 100644 --- a/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap +++ b/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap @@ -1,365 +1,477 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ChevronIcon Theme: jobStreet Default 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: jobStreet Down 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: jobStreet Inline 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: jobStreet Left 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: jobStreet Right 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: jobStreet Sized 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: jobStreet Up 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAnz Default 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAnz Down 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAnz Inline 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAnz Left 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAnz Right 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAnz Sized 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAnz Up 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAsia Default 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAsia Down 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAsia Inline 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAsia Left 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAsia Right 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAsia Sized 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: seekAsia Up 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: wireframe Default 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: wireframe Down 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: wireframe Inline 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: wireframe Left 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: wireframe Right 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: wireframe Sized 1`] = ` - - - + + + +
    `; exports[`ChevronIcon Theme: wireframe Up 1`] = ` - - - + + + +
    `; diff --git a/lib/components/private/examplesForIcon.tsx b/lib/components/private/examplesForIcon.tsx index 94009f297f7..683db66346b 100644 --- a/lib/components/private/examplesForIcon.tsx +++ b/lib/components/private/examplesForIcon.tsx @@ -1,6 +1,7 @@ import React, { ComponentType } from 'react'; import { Omit } from 'utility-types'; import Text from '../Text/Text'; +import Box from '../Box/Box'; import { IconProps } from '../icons/Icon/Icon'; export default (Icon: ComponentType>) => { @@ -9,7 +10,9 @@ export default (Icon: ComponentType>) => { label: 'Standard', render: () => (
    - + + + Standard text
    ) @@ -19,7 +22,9 @@ export default (Icon: ComponentType>) => { render: () => ( Standard - + + + text ) @@ -28,7 +33,9 @@ export default (Icon: ComponentType>) => { label: 'Large', render: () => (
    - + + + Large text @@ -40,7 +47,9 @@ export default (Icon: ComponentType>) => { render: () => ( Large - + + + text ) From a7bb745199986f3e2950779364208204e99e396b Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Thu, 14 Feb 2019 11:36:06 +1100 Subject: [PATCH 03/14] chore: Tweaks --- lib/components/Checkbox/Checkbox.tsx | 1 - lib/components/Strong/Strong.tsx | 15 ++++++++++++--- .../Strong/__snapshots__/Strong.test.tsx.snap | 16 ++++++++++++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/lib/components/Checkbox/Checkbox.tsx b/lib/components/Checkbox/Checkbox.tsx index 09a99b14208..31c2a8a1d59 100644 --- a/lib/components/Checkbox/Checkbox.tsx +++ b/lib/components/Checkbox/Checkbox.tsx @@ -1,6 +1,5 @@ import React, { Component, ReactNode, AllHTMLAttributes } from 'react'; import classnames from 'classnames'; -import { Omit } from 'utility-types'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; import getCheckboxRadioSize from '../private/getCheckboxRadioSize'; import Box from '../Box/Box'; diff --git a/lib/components/Strong/Strong.tsx b/lib/components/Strong/Strong.tsx index 9162c2d4f66..cb4f2ef8a25 100644 --- a/lib/components/Strong/Strong.tsx +++ b/lib/components/Strong/Strong.tsx @@ -1,14 +1,23 @@ -import React, { Component } from 'react'; +import React, { Component, ReactNode } from 'react'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; +import { children } from '../Radio/Radio.css.js'; -export default class Strong extends Component<{}> { +export interface StrongProps { + children: ReactNode; +} + +export default class Strong extends Component { static displayName = 'Strong'; render() { return ( {theme => { - return ; + return ( + + {children} + + ); }} ); diff --git a/lib/components/Strong/__snapshots__/Strong.test.tsx.snap b/lib/components/Strong/__snapshots__/Strong.test.tsx.snap index 082a4dcae2b..362e0627c4d 100644 --- a/lib/components/Strong/__snapshots__/Strong.test.tsx.snap +++ b/lib/components/Strong/__snapshots__/Strong.test.tsx.snap @@ -3,23 +3,31 @@ exports[`Strong Theme: jobStreet Default 1`] = ` +> + Radio__children + `; exports[`Strong Theme: seekAnz Default 1`] = ` +> + Radio__children + `; exports[`Strong Theme: seekAsia Default 1`] = ` +> + Radio__children + `; exports[`Strong Theme: wireframe Default 1`] = ` +> + Radio__children + `; From 3bf89ab4043a1dff06f365204b6045ee1197d291 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Fri, 15 Feb 2019 14:32:35 +1100 Subject: [PATCH 04/14] fix: Fix visual bugs with Strong and Icon --- lib/components/Strong/Strong.tsx | 3 ++- lib/components/icons/Icon/Icon.css.js | 3 +++ lib/components/icons/Icon/Icon.css.js.d.ts | 1 + lib/components/icons/Icon/Icon.tsx | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/components/Strong/Strong.tsx b/lib/components/Strong/Strong.tsx index cb4f2ef8a25..882edffe372 100644 --- a/lib/components/Strong/Strong.tsx +++ b/lib/components/Strong/Strong.tsx @@ -1,6 +1,5 @@ import React, { Component, ReactNode } from 'react'; import ThemeConsumer from '../ThemeConsumer/ThemeConsumer'; -import { children } from '../Radio/Radio.css.js'; export interface StrongProps { children: ReactNode; @@ -10,6 +9,8 @@ export default class Strong extends Component { static displayName = 'Strong'; render() { + const { children } = this.props; + return ( {theme => { diff --git a/lib/components/icons/Icon/Icon.css.js b/lib/components/icons/Icon/Icon.css.js index 98498e39554..c5537b3f970 100644 --- a/lib/components/icons/Icon/Icon.css.js +++ b/lib/components/icons/Icon/Icon.css.js @@ -1,4 +1,7 @@ export default { + '.root': { + display: 'block' + }, '.fillSize': { width: '100%', height: '100%' diff --git a/lib/components/icons/Icon/Icon.css.js.d.ts b/lib/components/icons/Icon/Icon.css.js.d.ts index 6933e2c2baf..fe4c408e0aa 100644 --- a/lib/components/icons/Icon/Icon.css.js.d.ts +++ b/lib/components/icons/Icon/Icon.css.js.d.ts @@ -2,3 +2,4 @@ // Please do not change this file! export const fillSize: string; export const inline: string; +export const root: string; diff --git a/lib/components/icons/Icon/Icon.tsx b/lib/components/icons/Icon/Icon.tsx index 288a52aca5a..25249680340 100644 --- a/lib/components/icons/Icon/Icon.tsx +++ b/lib/components/icons/Icon/Icon.tsx @@ -42,6 +42,7 @@ export default class Icon extends Component { Date: Fri, 15 Feb 2019 14:41:37 +1100 Subject: [PATCH 05/14] test: Update snapshots --- .../Alert/__snapshots__/Alert.test.tsx.snap | 24 ++++---- .../__snapshots__/Checkbox.test.tsx.snap | 48 ++++++++-------- .../__snapshots__/ChecklistCard.test.tsx.snap | 24 ++++---- .../__snapshots__/FieldMessage.test.tsx.snap | 16 +++--- .../Radio/__snapshots__/Radio.test.tsx.snap | 8 +-- .../Strong/__snapshots__/Strong.test.tsx.snap | 8 +-- .../__snapshots__/ChevronIcon.test.tsx.snap | 56 +++++++++---------- .../__snapshots__/ErrorIcon.test.tsx.snap | 24 ++++---- .../__snapshots__/InfoIcon.test.tsx.snap | 24 ++++---- .../TickCircleIcon.test.tsx.snap | 24 ++++---- .../__snapshots__/TickIcon.test.tsx.snap | 24 ++++---- 11 files changed, 140 insertions(+), 140 deletions(-) diff --git a/lib/components/Alert/__snapshots__/Alert.test.tsx.snap b/lib/components/Alert/__snapshots__/Alert.test.tsx.snap index 50dfdf5600a..0f2a40c5b6f 100644 --- a/lib/components/Alert/__snapshots__/Alert.test.tsx.snap +++ b/lib/components/Alert/__snapshots__/Alert.test.tsx.snap @@ -14,7 +14,7 @@ exports[`Alert Theme: jobStreet Tones critical 1`] = ` class="Box__root borderColor__standard paddingRight__small" > - Radio__children + Children `; @@ -12,7 +12,7 @@ exports[`Strong Theme: seekAnz Default 1`] = ` - Radio__children + Children `; @@ -20,7 +20,7 @@ exports[`Strong Theme: seekAsia Default 1`] = ` - Radio__children + Children `; @@ -28,6 +28,6 @@ exports[`Strong Theme: wireframe Default 1`] = ` - Radio__children + Children `; diff --git a/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap b/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap index fee91a1441e..49703feb125 100644 --- a/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap +++ b/lib/components/icons/ChevronIcon/__snapshots__/ChevronIcon.test.tsx.snap @@ -5,7 +5,7 @@ exports[`ChevronIcon Theme: jobStreet Default 1`] = ` class="ChevronIcon__root Box__root borderColor__standard" > Date: Fri, 15 Feb 2019 14:58:10 +1100 Subject: [PATCH 06/14] fix: Fix icons --- .../Alert/__snapshots__/Alert.test.tsx.snap | 24 ++++---- .../__snapshots__/Checkbox.test.tsx.snap | 48 ++++++++-------- .../__snapshots__/ChecklistCard.test.tsx.snap | 24 ++++---- .../__snapshots__/FieldMessage.test.tsx.snap | 16 +++--- .../Radio/__snapshots__/Radio.test.tsx.snap | 8 +-- .../__snapshots__/ChevronIcon.test.tsx.snap | 56 +++++++++---------- .../__snapshots__/ErrorIcon.test.tsx.snap | 24 ++++---- lib/components/icons/Icon/Icon.css.js | 2 +- lib/components/icons/Icon/Icon.css.js.d.ts | 2 +- lib/components/icons/Icon/Icon.tsx | 4 +- .../__snapshots__/InfoIcon.test.tsx.snap | 24 ++++---- .../TickCircleIcon.test.tsx.snap | 24 ++++---- .../__snapshots__/TickIcon.test.tsx.snap | 24 ++++---- lib/components/private/examplesForIcon.tsx | 12 +--- 14 files changed, 142 insertions(+), 150 deletions(-) diff --git a/lib/components/Alert/__snapshots__/Alert.test.tsx.snap b/lib/components/Alert/__snapshots__/Alert.test.tsx.snap index 0f2a40c5b6f..24d4a298d2b 100644 --- a/lib/components/Alert/__snapshots__/Alert.test.tsx.snap +++ b/lib/components/Alert/__snapshots__/Alert.test.tsx.snap @@ -14,7 +14,7 @@ exports[`Alert Theme: jobStreet Tones critical 1`] = ` class="Box__root borderColor__standard paddingRight__small" > { diff --git a/lib/components/icons/InfoIcon/__snapshots__/InfoIcon.test.tsx.snap b/lib/components/icons/InfoIcon/__snapshots__/InfoIcon.test.tsx.snap index 3e3e0d4d3ca..aef4b2e97c7 100644 --- a/lib/components/icons/InfoIcon/__snapshots__/InfoIcon.test.tsx.snap +++ b/lib/components/icons/InfoIcon/__snapshots__/InfoIcon.test.tsx.snap @@ -2,7 +2,7 @@ exports[`InfoIcon Theme: jobStreet Default 1`] = ` >) => { label: 'Standard Inline', render: () => ( - Standard - - - - text + Standard text ) }, @@ -46,11 +42,7 @@ export default (Icon: ComponentType>) => { label: 'Large Inline', render: () => ( - Large - - - - text + Large text ) } From 512273837027a61f1e133aad2af5e9b267448f6c Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Fri, 15 Feb 2019 15:04:51 +1100 Subject: [PATCH 07/14] fix(Card): Use padding instead of margin to prevent collapse --- lib/components/Card/Card.docs.tsx | 1 - lib/components/Card/Card.tsx | 4 +- .../Card/__snapshots__/Card.test.tsx.snap | 32 +- .../__snapshots__/ChecklistCard.test.tsx.snap | 1584 +++++++++-------- 4 files changed, 826 insertions(+), 795 deletions(-) diff --git a/lib/components/Card/Card.docs.tsx b/lib/components/Card/Card.docs.tsx index e7f71551094..1a9e53a37fa 100644 --- a/lib/components/Card/Card.docs.tsx +++ b/lib/components/Card/Card.docs.tsx @@ -13,7 +13,6 @@ const docs: ComponentDocs = { paddingLeft="small" paddingRight="small" paddingTop="small" - paddingBottom="small" style={{ backgroundColor: '#ccc' }} > diff --git a/lib/components/Card/Card.tsx b/lib/components/Card/Card.tsx index af47f4309a9..0f5528711f0 100644 --- a/lib/components/Card/Card.tsx +++ b/lib/components/Card/Card.tsx @@ -12,8 +12,8 @@ export default class Card extends Component { const { children } = this.props; return ( - - {children} + + {children} ); } diff --git a/lib/components/Card/__snapshots__/Card.test.tsx.snap b/lib/components/Card/__snapshots__/Card.test.tsx.snap index 7b8fe529365..7031be0ad96 100644 --- a/lib/components/Card/__snapshots__/Card.test.tsx.snap +++ b/lib/components/Card/__snapshots__/Card.test.tsx.snap @@ -2,32 +2,48 @@ exports[`Card Theme: jobStreet Default 1`] = `
    - Children +
    + Children +
    `; exports[`Card Theme: seekAnz Default 1`] = `
    - Children +
    + Children +
    `; exports[`Card Theme: seekAsia Default 1`] = `
    - Children +
    + Children +
    `; exports[`Card Theme: wireframe Default 1`] = `
    - Children +
    + Children +
    `; diff --git a/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap b/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap index 2d8a1ffcb6b..7c808c82ff9 100644 --- a/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap +++ b/lib/components/ChecklistCard/__snapshots__/ChecklistCard.test.tsx.snap @@ -2,260 +2,264 @@ exports[`ChecklistCard Theme: jobStreet Default 1`] = `
    -
    -