├── .babelrc
├── .browserslistrc
├── .eslintignore
├── .eslintrc
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── dependency-update.md
│ └── feature_request.md
├── actions
│ ├── build-prod
│ │ ├── action.yml
│ │ ├── awaiting.js
│ │ ├── build
│ │ │ └── index.js
│ │ └── script.js
│ └── log-github
│ │ ├── action.yml
│ │ ├── build
│ │ └── index.js
│ │ └── script.js
├── issue-branch.yml
└── workflows
│ └── main.yml
├── .gitignore
├── .markdownlint.json
├── .npmignore
├── LICENSE
├── README.md
├── bitbucket-pipelines.yml
├── favicon.ico
├── jestconfig.json
├── lib
├── assets
│ ├── images
│ │ └── grape-ui-header-logo.svg
│ └── json
│ │ ├── border.json
│ │ ├── breakpoints.json
│ │ ├── buttonVariant.json
│ │ ├── colors.json
│ │ ├── fontFamily.json
│ │ ├── fontSize.json
│ │ ├── grid.json
│ │ ├── shadow.json
│ │ └── zIndex.json
├── elements
│ ├── Button
│ │ ├── component.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── tests
│ │ │ ├── Button.test.js
│ │ │ └── Button.theme.test.js
│ │ └── utils.js
│ ├── Card
│ │ ├── component.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── subComponents
│ │ │ ├── CardActions
│ │ │ │ └── index.js
│ │ │ ├── CardBody
│ │ │ │ └── index.js
│ │ │ ├── CardHeader
│ │ │ │ └── index.js
│ │ │ ├── CardInner
│ │ │ │ └── index.js
│ │ │ ├── CardRichMedia
│ │ │ │ └── index.js
│ │ │ ├── CardSecondaryMedia
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── tests
│ │ │ └── Card.test.js
│ │ └── utils
│ │ │ ├── index.js
│ │ │ └── props.js
│ ├── Image
│ │ ├── component.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ └── tests
│ │ │ └── Image.test.js
│ ├── Progress
│ │ ├── CircleProgress
│ │ │ ├── component.js
│ │ │ └── index.js
│ │ ├── LinearProgress
│ │ │ ├── component.js
│ │ │ └── index.js
│ │ ├── getProgress.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── tests
│ │ │ ├── Progress.test.js
│ │ │ └── getProgress.test.js
│ │ └── utils
│ │ │ ├── index.js
│ │ │ ├── keyframes.js
│ │ │ ├── props.js
│ │ │ └── styledHelpers.js
│ ├── Table
│ │ ├── Paginator
│ │ │ ├── index.js
│ │ │ └── tests
│ │ │ │ └── Paginator.test.js
│ │ ├── component.js
│ │ ├── examples
│ │ │ └── utils
│ │ │ │ ├── data.js
│ │ │ │ ├── index.js
│ │ │ │ └── sortHelpers.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── tests
│ │ │ ├── Table.expandedRows.test.js
│ │ │ ├── Table.fetchData.test.js
│ │ │ ├── Table.hiddenColumns.test.js
│ │ │ ├── Table.test.js
│ │ │ └── utils
│ │ │ │ ├── columns.js
│ │ │ │ ├── index.js
│ │ │ │ └── testData.js
│ │ └── utils
│ │ │ ├── constants.js
│ │ │ ├── cssDefaults.js
│ │ │ ├── index.js
│ │ │ ├── props.js
│ │ │ ├── styled
│ │ │ ├── StyledTable
│ │ │ │ └── index.js
│ │ │ ├── StyledTableBody
│ │ │ │ └── index.js
│ │ │ ├── StyledTableCell
│ │ │ │ └── index.js
│ │ │ ├── StyledTableHeader
│ │ │ │ └── index.js
│ │ │ ├── StyledTableResponsiveWrapper
│ │ │ │ └── index.js
│ │ │ ├── StyledTableRow
│ │ │ │ └── index.js
│ │ │ ├── StyledTableWrapper
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ │ └── viewState.js
│ ├── Toolbar
│ │ ├── component.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── tests
│ │ │ └── Toolbar.test.js
│ │ └── utils
│ │ │ ├── index.js
│ │ │ └── props.js
│ ├── forms
│ │ ├── CheckboxField
│ │ │ ├── CheckboxInput
│ │ │ │ └── index.js
│ │ │ ├── CheckboxLabel
│ │ │ │ └── index.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── CheckboxField.test.js
│ │ │ │ └── CheckboxField.theme.test.js
│ │ ├── DateField
│ │ │ ├── component.js
│ │ │ ├── constants.js
│ │ │ ├── index.js
│ │ │ ├── props.js
│ │ │ ├── styled.js
│ │ │ ├── styledHelpers.js
│ │ │ ├── tests
│ │ │ │ ├── DateField.ref.test.js
│ │ │ │ ├── DateField.test.js
│ │ │ │ ├── DateFieldComponent.test.js
│ │ │ │ └── DateFieldUtils.test.js
│ │ │ └── utils.js
│ │ ├── Form
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ └── Form.test.js
│ │ ├── SelectField
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ ├── SelectField.ref.test.js
│ │ │ │ ├── SelectField.test.js
│ │ │ │ ├── SelectField.theme.test.js
│ │ │ │ ├── SelectFieldComponent.test.js
│ │ │ │ └── examples
│ │ │ │ │ └── index.js
│ │ │ └── utils.js
│ │ ├── TextField
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ ├── TextField.ref.test.js
│ │ │ │ ├── TextField.test.js
│ │ │ │ ├── TextField.theme.test.js
│ │ │ │ ├── TextField.utils.test.js
│ │ │ │ └── TextFieldComponent.test.js
│ │ │ └── utils.js
│ │ ├── examples
│ │ │ └── index.js
│ │ ├── index.js
│ │ └── utils
│ │ │ ├── AssistiveText
│ │ │ ├── component.js
│ │ │ ├── helpers.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── AssistiveText.test.js
│ │ │ │ └── AssistiveText.theme.test.js
│ │ │ ├── ControlGroup
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ └── styled.js
│ │ │ ├── ControlLabel
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── ControlLabel.test.js
│ │ │ │ └── ControlLabel.theme.test.js
│ │ │ ├── PlainText
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── PlainText.test.js
│ │ │ │ └── PlainText.theme.test.js
│ │ │ └── index.js
│ ├── grid
│ │ ├── Box
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Box.flexbox.test.js
│ │ │ │ └── Box.test.js
│ │ ├── Flex
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ └── Flex.test.js
│ │ ├── examples
│ │ │ └── index.js
│ │ ├── index.js
│ │ └── utils
│ │ │ └── index.js
│ ├── typography
│ │ ├── Header
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Header.test.js
│ │ │ │ └── Header.theme.test.js
│ │ ├── Link
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ ├── Link.test.js
│ │ │ │ └── Link.theme.test.js
│ │ │ └── utils.js
│ │ ├── List
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── List.test.js
│ │ │ │ └── List.theme.test.js
│ │ ├── ListItem
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── ListItem.test.js
│ │ │ │ └── ListItem.theme.test.js
│ │ ├── Paragraph
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Paragraph.test.js
│ │ │ │ └── Paragraph.theme.test.js
│ │ ├── Text
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Text.test.js
│ │ │ │ └── Text.theme.test.js
│ │ ├── codeElements
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ └── CodeBlock.test.js
│ │ │ └── utils
│ │ │ │ ├── index.js
│ │ │ │ ├── props.js
│ │ │ │ └── styles.js
│ │ └── index.js
│ └── utils
│ │ ├── Hideable
│ │ └── index.js
│ │ ├── index.js
│ │ └── tests
│ │ └── Hideable.test.js
├── global-styles
│ ├── index.js
│ └── tests
│ │ ├── getGlobalOverrides.test.js
│ │ └── getGlobalStyles.test.js
├── index.js
├── internals
│ ├── mocks
│ │ └── cssModule.js
│ ├── testing
│ │ └── test-bundler.js
│ └── webpack
│ │ ├── webpack.config.js
│ │ └── webpack.config.test.js
└── utils
│ ├── componentHelpers
│ ├── componentHelpers.js
│ └── index.js
│ ├── momentHelpers
│ ├── index.js
│ └── momentLocaleUtils.js
│ ├── objectHelpers
│ ├── index.js
│ ├── objectHelpers.js
│ └── tests
│ │ └── objectHelpers.test.js
│ └── styledHelpers
│ ├── controlStyles.js
│ ├── core.js
│ ├── cssDefaults.js
│ ├── index.js
│ ├── tests
│ └── controlStyles.test.js
│ └── utils
│ ├── buttonThemes.js
│ ├── index.js
│ ├── props.js
│ ├── resolvers.js
│ ├── scaleFont.js
│ └── tests
│ ├── buttonThemes.test.js
│ ├── colorCore.test.js
│ ├── fontFamilyCore.test.js
│ ├── getButtonThemesByVariant.test.js
│ ├── resolveBorderRadius.test.js
│ ├── resolveBoxShadow.test.js
│ ├── resolveColor.test.js
│ ├── resolveElevation.test.js
│ ├── resolveFontFamily.test.js
│ ├── resolveGlobal.test.js
│ ├── resolveZIndex.test.js
│ └── scaleFont.test.js
├── package-lock.json
├── package.json
├── src
├── assets
│ ├── images
│ │ └── grape-ui-header-logo.svg
│ └── json
│ │ ├── border.json
│ │ ├── breakpoints.json
│ │ ├── buttonVariant.json
│ │ ├── colors.json
│ │ ├── fontFamily.json
│ │ ├── fontSize.json
│ │ ├── grid.json
│ │ ├── shadow.json
│ │ └── zIndex.json
├── elements
│ ├── Button
│ │ ├── Readme.md
│ │ ├── component.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── tests
│ │ │ ├── Button.test.js
│ │ │ ├── Button.theme.test.js
│ │ │ └── __snapshots__
│ │ │ │ ├── Button.test.js.snap
│ │ │ │ └── Button.theme.test.js.snap
│ │ └── utils.js
│ ├── Card
│ │ ├── Readme.md
│ │ ├── cardPadding.md
│ │ ├── component.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── subComponents
│ │ │ ├── AdditionalCardProps.md
│ │ │ ├── CardActions.md
│ │ │ ├── CardActions
│ │ │ │ └── index.js
│ │ │ ├── CardBody.md
│ │ │ ├── CardBody
│ │ │ │ └── index.js
│ │ │ ├── CardHeader.md
│ │ │ ├── CardHeader
│ │ │ │ └── index.js
│ │ │ ├── CardInner
│ │ │ │ └── index.js
│ │ │ ├── CardMedia.md
│ │ │ ├── CardRichMedia
│ │ │ │ └── index.js
│ │ │ ├── CardSecondaryMedia
│ │ │ │ └── index.js
│ │ │ ├── Readme.md
│ │ │ └── index.js
│ │ ├── tests
│ │ │ ├── Card.test.js
│ │ │ └── __snapshots__
│ │ │ │ └── Card.test.js.snap
│ │ └── utils
│ │ │ ├── index.js
│ │ │ └── props.js
│ ├── Image
│ │ ├── Readme.md
│ │ ├── component.js
│ │ ├── examples
│ │ │ └── nacho-dominguez-argenta-cCVzi_mKovs-unsplash.jpg
│ │ ├── index.js
│ │ ├── styled.js
│ │ └── tests
│ │ │ ├── Image.test.js
│ │ │ └── __snapshots__
│ │ │ └── Image.test.js.snap
│ ├── Progress
│ │ ├── CircleProgress
│ │ │ ├── component.js
│ │ │ └── index.js
│ │ ├── LinearProgress
│ │ │ ├── component.js
│ │ │ └── index.js
│ │ ├── Readme.md
│ │ ├── getProgress.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── tests
│ │ │ ├── Progress.test.js
│ │ │ ├── __snapshots__
│ │ │ │ └── Progress.test.js.snap
│ │ │ └── getProgress.test.js
│ │ └── utils
│ │ │ ├── index.js
│ │ │ ├── keyframes.js
│ │ │ ├── props.js
│ │ │ └── styledHelpers.js
│ ├── Table
│ │ ├── Paginator
│ │ │ ├── index.js
│ │ │ └── tests
│ │ │ │ └── Paginator.test.js
│ │ ├── Readme.md
│ │ ├── component.js
│ │ ├── examples
│ │ │ ├── examples.md
│ │ │ ├── expandedRows.md
│ │ │ ├── hideComponents.md
│ │ │ ├── loadingState.md
│ │ │ ├── manualPagination.md
│ │ │ ├── pagination.md
│ │ │ ├── tableStriped.md
│ │ │ └── utils
│ │ │ │ ├── data.js
│ │ │ │ ├── index.js
│ │ │ │ └── sortHelpers.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── styles.md
│ │ ├── tests
│ │ │ ├── Table.expandedRows.test.js
│ │ │ ├── Table.fetchData.test.js
│ │ │ ├── Table.hiddenColumns.test.js
│ │ │ ├── Table.test.js
│ │ │ ├── __snapshots__
│ │ │ │ └── Table.test.js.snap
│ │ │ └── utils
│ │ │ │ ├── columns.js
│ │ │ │ ├── index.js
│ │ │ │ └── testData.js
│ │ └── utils
│ │ │ ├── constants.js
│ │ │ ├── cssDefaults.js
│ │ │ ├── index.js
│ │ │ ├── props.js
│ │ │ ├── styled
│ │ │ ├── StyledTable
│ │ │ │ └── index.js
│ │ │ ├── StyledTableBody
│ │ │ │ └── index.js
│ │ │ ├── StyledTableCell
│ │ │ │ └── index.js
│ │ │ ├── StyledTableHeader
│ │ │ │ └── index.js
│ │ │ ├── StyledTableResponsiveWrapper
│ │ │ │ └── index.js
│ │ │ ├── StyledTableRow
│ │ │ │ └── index.js
│ │ │ ├── StyledTableWrapper
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ │ └── viewState.js
│ ├── Toolbar
│ │ ├── Readme.md
│ │ ├── component.js
│ │ ├── index.js
│ │ ├── styled.js
│ │ ├── tests
│ │ │ ├── Toolbar.test.js
│ │ │ └── __snapshots__
│ │ │ │ └── Toolbar.test.js.snap
│ │ └── utils
│ │ │ ├── index.js
│ │ │ └── props.js
│ ├── forms
│ │ ├── CheckboxField
│ │ │ ├── CheckboxInput
│ │ │ │ └── index.js
│ │ │ ├── CheckboxLabel
│ │ │ │ └── index.js
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── CheckboxField.test.js
│ │ │ │ ├── CheckboxField.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── CheckboxField.test.js.snap
│ │ │ │ └── CheckboxField.theme.test.js.snap
│ │ ├── DateField
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── constants.js
│ │ │ ├── index.js
│ │ │ ├── props.js
│ │ │ ├── styled.js
│ │ │ ├── styledHelpers.js
│ │ │ ├── tests
│ │ │ │ ├── DateField.ref.test.js
│ │ │ │ ├── DateField.test.js
│ │ │ │ ├── DateFieldComponent.test.js
│ │ │ │ ├── DateFieldUtils.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ │ ├── DateField.test.js.snap
│ │ │ │ │ └── DateFieldComponent.test.js.snap
│ │ │ └── utils.js
│ │ ├── Form
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Form.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ └── Form.test.js.snap
│ │ ├── Readme.md
│ │ ├── SelectField
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ ├── SelectField.ref.test.js
│ │ │ │ ├── SelectField.test.js
│ │ │ │ ├── SelectField.theme.test.js
│ │ │ │ ├── SelectFieldComponent.test.js
│ │ │ │ ├── __snapshots__
│ │ │ │ │ ├── SelectField.test.js.snap
│ │ │ │ │ ├── SelectField.theme.test.js.snap
│ │ │ │ │ └── SelectFieldComponent.test.js.snap
│ │ │ │ └── examples
│ │ │ │ │ └── index.js
│ │ │ └── utils.js
│ │ ├── TextField
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ ├── TextField.ref.test.js
│ │ │ │ ├── TextField.test.js
│ │ │ │ ├── TextField.theme.test.js
│ │ │ │ ├── TextField.utils.test.js
│ │ │ │ ├── TextFieldComponent.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ │ ├── TextField.test.js.snap
│ │ │ │ │ ├── TextField.theme.test.js.snap
│ │ │ │ │ └── TextFieldComponent.test.js.snap
│ │ │ └── utils.js
│ │ ├── components.md
│ │ ├── examples
│ │ │ └── index.js
│ │ ├── index.js
│ │ └── utils
│ │ │ ├── AssistiveText
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── helpers.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── AssistiveText.test.js
│ │ │ │ ├── AssistiveText.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── AssistiveText.test.js.snap
│ │ │ │ └── AssistiveText.theme.test.js.snap
│ │ │ ├── ControlGroup
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ └── styled.js
│ │ │ ├── ControlLabel
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── ControlLabel.test.js
│ │ │ │ ├── ControlLabel.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── ControlLabel.test.js.snap
│ │ │ │ └── ControlLabel.theme.test.js.snap
│ │ │ ├── PlainText
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── PlainText.test.js
│ │ │ │ ├── PlainText.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── PlainText.test.js.snap
│ │ │ │ └── PlainText.theme.test.js.snap
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ └── validationError.md
│ ├── grid
│ │ ├── Box
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Box.flexbox.test.js
│ │ │ │ ├── Box.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── Box.flexbox.test.js.snap
│ │ │ │ └── Box.test.js.snap
│ │ ├── Flex
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Flex.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ └── Flex.test.js.snap
│ │ ├── Readme.md
│ │ ├── advancedExamples.md
│ │ ├── breakpointsAndSpace.md
│ │ ├── components.md
│ │ ├── examples
│ │ │ ├── amos-bar-zeev-GibvqWh_OcE-unsplash.jpg
│ │ │ ├── index.js
│ │ │ └── karly-jones-6aRIh3j_F4I-unsplash.jpg
│ │ ├── index.js
│ │ └── utils
│ │ │ └── index.js
│ ├── typography
│ │ ├── Header
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Header.test.js
│ │ │ │ ├── Header.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── Header.test.js.snap
│ │ │ │ └── Header.theme.test.js.snap
│ │ ├── Link
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ ├── Link.test.js
│ │ │ │ ├── Link.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ │ ├── Link.test.js.snap
│ │ │ │ │ └── Link.theme.test.js.snap
│ │ │ └── utils.js
│ │ ├── List
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── List.test.js
│ │ │ │ ├── List.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── List.test.js.snap
│ │ │ │ └── List.theme.test.js.snap
│ │ ├── ListItem
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── ListItem.test.js
│ │ │ │ ├── ListItem.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── ListItem.test.js.snap
│ │ │ │ └── ListItem.theme.test.js.snap
│ │ ├── Paragraph
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Paragraph.test.js
│ │ │ │ ├── Paragraph.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── Paragraph.test.js.snap
│ │ │ │ └── Paragraph.theme.test.js.snap
│ │ ├── Readme.md
│ │ ├── Text
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ └── tests
│ │ │ │ ├── Text.test.js
│ │ │ │ ├── Text.theme.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ ├── Text.test.js.snap
│ │ │ │ └── Text.theme.test.js.snap
│ │ ├── codeElements
│ │ │ ├── Readme.md
│ │ │ ├── component.js
│ │ │ ├── index.js
│ │ │ ├── styled.js
│ │ │ ├── tests
│ │ │ │ ├── CodeBlock.test.js
│ │ │ │ └── __snapshots__
│ │ │ │ │ └── CodeBlock.test.js.snap
│ │ │ └── utils
│ │ │ │ ├── index.js
│ │ │ │ ├── props.js
│ │ │ │ └── styles.js
│ │ ├── color.md
│ │ ├── components.md
│ │ ├── fontFamily.md
│ │ ├── fontSizes.md
│ │ ├── fontUtilities.md
│ │ └── index.js
│ └── utils
│ │ ├── Hideable
│ │ ├── Readme.md
│ │ └── index.js
│ │ ├── components.md
│ │ ├── index.js
│ │ └── tests
│ │ ├── Hideable.test.js
│ │ └── __snapshots__
│ │ └── Hideable.test.js.snap
├── global-styles
│ ├── index.js
│ └── tests
│ │ ├── getGlobalOverrides.test.js
│ │ └── getGlobalStyles.test.js
├── index.js
├── internals
│ ├── mocks
│ │ └── cssModule.js
│ ├── testing
│ │ └── test-bundler.js
│ └── webpack
│ │ ├── webpack.config.js
│ │ └── webpack.config.test.js
└── utils
│ ├── componentHelpers
│ ├── componentHelpers.js
│ └── index.js
│ ├── momentHelpers
│ ├── index.js
│ └── momentLocaleUtils.js
│ ├── objectHelpers
│ ├── index.js
│ ├── objectHelpers.js
│ └── tests
│ │ └── objectHelpers.test.js
│ └── styledHelpers
│ ├── controlStyles.js
│ ├── core.js
│ ├── cssDefaults.js
│ ├── index.js
│ ├── tests
│ └── controlStyles.test.js
│ └── utils
│ ├── buttonThemes.js
│ ├── index.js
│ ├── props.js
│ ├── resolvers.js
│ ├── scaleFont.js
│ └── tests
│ ├── buttonThemes.test.js
│ ├── colorCore.test.js
│ ├── fontFamilyCore.test.js
│ ├── getButtonThemesByVariant.test.js
│ ├── resolveBorderRadius.test.js
│ ├── resolveBoxShadow.test.js
│ ├── resolveColor.test.js
│ ├── resolveElevation.test.js
│ ├── resolveFontFamily.test.js
│ ├── resolveGlobal.test.js
│ ├── resolveZIndex.test.js
│ └── scaleFont.test.js
├── styleguide.config.js
└── styleguide
├── build
├── bundle.02d0c177.js
└── bundle.02d0c177.js.LICENSE.txt
├── components
├── AppBar
│ └── index.js
├── Footer
│ └── index.js
├── constants.js
└── index.js
├── containers
├── CodeRenderer
│ └── index.js
├── ComponentsListRenderer
│ └── index.js
├── HeadingRenderer
│ └── index.js
├── LinkRenderer
│ └── index.js
├── ParaRenderer
│ └── index.js
├── PathlineRenderer
│ └── index.js
├── StyleGuideRenderer
│ └── index.js
├── TabButtonRenderer
│ └── index.js
├── TableOfContentsRenderer
│ └── index.js
├── ToolbarButtonRenderer
│ └── index.js
└── index.js
├── default.css
├── index.html
├── static
└── media
│ ├── amos-bar-zeev-GibvqWh_OcE-unsplash.45520a43.jpg
│ ├── grape-ui-header-logo.4e78d99f.svg
│ ├── karly-jones-6aRIh3j_F4I-unsplash.3d4e4073.jpg
│ └── nacho-dominguez-argenta-cCVzi_mKovs-unsplash.7ca92b41.jpg
├── styles.js
└── themes.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@babel/plugin-transform-modules-commonjs",
4 | "@babel/plugin-proposal-class-properties",
5 | [ "babel-plugin-webpack-alias", { "config": "src/internals/webpack/webpack.config.js" } ],
6 | [ "@babel/transform-runtime", { "corejs": 3 } ]
7 | ],
8 | "presets": [
9 | [
10 | "@babel/preset-env",
11 | {
12 | "corejs":
13 | {
14 | "version": 3.6
15 | },
16 | "useBuiltIns": "entry"
17 | }
18 | ],
19 | "@babel/preset-react"
20 | ],
21 | "env": {
22 | "test": {
23 | "plugins": [
24 | "transform-es2015-modules-commonjs",
25 | "dynamic-import-node",
26 | [ "babel-plugin-webpack-alias", { "config": "src/internals/webpack/webpack.config.test.js" } ]
27 | ]
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 0.25%
2 | not dead
3 | not IE 11
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | coverage/*
2 | dist/*
3 | lib/*
4 | node_modules/*
5 | src/internals/*
6 | styleguide/*
7 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[BUG] Bug Title"
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 |
16 | 1. Go to '...'
17 | 2. Click on '....'
18 | 3. Scroll down to '....'
19 | 4. See error
20 |
21 | **Expected behavior**
22 | A clear and concise description of what you expected to happen.
23 |
24 | **Screenshots**
25 | If applicable, add screenshots to help explain your problem.
26 |
27 | **Desktop (please complete the following information):**
28 |
29 | - OS: [e.g. iOS]
30 | - Browser [e.g. chrome, safari]
31 | - Version [e.g. 22]
32 |
33 | **Smartphone (please complete the following information):**
34 |
35 | - Device: [e.g. iPhone6]
36 | - OS: [e.g. iOS8.1]
37 | - Browser [e.g. stock browser, safari]
38 | - Version [e.g. 22]
39 |
40 | **Additional context**
41 | Add any other context about the problem here.
42 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/dependency-update.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Dependency Update
3 | about: Suggest what existing dependency needs to update
4 | title: ''
5 | labels: dependencies
6 | assignees: ''
7 |
8 | ---
9 |
10 | * Dependency Name: ???
11 | * Version Number: #.#.#
12 |
13 | Additional Notes:
14 | * If any, enter them here.
15 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/actions/build-prod/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Build for Production'
2 | description: 'Build artifacts and push to grape-ui-production'
3 | outputs:
4 | time: # id of output
5 | description: 'The time of build'
6 | runs:
7 | using: 'node12'
8 | main: 'build/index.js'
--------------------------------------------------------------------------------
/.github/actions/build-prod/awaiting.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-console */
2 | const core = require('@actions/core');
3 | const github = require('@actions/github');
4 | const exec = require('@actions/exec');
5 |
6 | let output = '';
7 | let myError = '';
8 | const buildProcess = (async () => {
9 | try {
10 | const options = {};
11 | options.listeners = {
12 | stdout: data => {
13 | output += data.toString();
14 | },
15 | stderr: data => {
16 | myError += data.toString();
17 | }
18 | };
19 | await exec.exec('pwd', null, options);
20 | console.log({ output, myError });
21 | const { payload } = github.context;
22 |
23 | const time = (new Date()).toTimeString();
24 | core.setOutput('time', time);
25 | // Get the JSON webhook payload for the event that triggered the workflow
26 | const payloadAsStr = JSON.stringify(payload, undefined, 2);
27 | console.log(`The event payload: ${payloadAsStr}`);
28 | } catch (error) {
29 | core.setFailed(error.message);
30 | }
31 | }) ();
32 | export { buildProcess, output };
33 |
--------------------------------------------------------------------------------
/.github/actions/build-prod/script.js:
--------------------------------------------------------------------------------
1 | const { buildProcess, output } = require('./awaiting.js');
2 | buildProcess.then(() => {
3 | console.log({ output });
4 | });
--------------------------------------------------------------------------------
/.github/actions/log-github/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Log Github Events'
2 | description: 'Logs Github events'
3 | outputs:
4 | time: # id of output
5 | description: 'The time of event'
6 | runs:
7 | using: 'node12'
8 | main: 'build/index.js'
--------------------------------------------------------------------------------
/.github/actions/log-github/script.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-console */
2 | const core = require('@actions/core');
3 | const github = require('@actions/github');
4 |
5 | try {
6 | const { payload } = github.context;
7 | const time = (new Date()).toTimeString();
8 | core.setOutput('time', time);
9 | // Get the JSON webhook payload for the event that triggered the workflow
10 | const payloadAsStr = JSON.stringify(payload, undefined, 2);
11 | console.log(`The event payload: ${payloadAsStr}`);
12 | } catch (error) {
13 | core.setFailed(error.message);
14 | }
15 |
--------------------------------------------------------------------------------
/.github/issue-branch.yml:
--------------------------------------------------------------------------------
1 | branches:
2 | - label: enhancement
3 | prefix: feature/
4 | - label: bug
5 | prefix: bugfix/
6 | - label: dependencies
7 | prefix: dependencyupdate/
8 | - label: devops
9 | prefix: devops/
10 | - label: '*'
11 | prefix: issues/
12 | branchName: '${issue.number}'
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Don't check auto-generated stuff into git
2 | coverage
3 | node_modules
4 | stats.json
5 | .vscode
6 |
7 | # Cruft
8 | .DS_Store
9 | .idea
10 | *.log
11 | dist/
12 | npm-debug.log.*
13 |
--------------------------------------------------------------------------------
/.markdownlint.json:
--------------------------------------------------------------------------------
1 | {
2 | "MD013": false,
3 | "MD041": false
4 | }
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .babelrc
2 | CODE_OF_CONDUCT.md
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018-2020 Napa Group, LLC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | ## Getting Started
4 |
5 | These instructions will allow you to use the extensible grape-ui component library in any React project.
6 |
7 | ### Prerequisites
8 |
9 | * [ReactJS](https://reactjs.org/)
10 | * [Styled Components](https://www.styled-components.com/)
11 |
12 | ### Installing
13 |
14 | Add grape-ui as a dependency to your project
15 |
16 | ```bash
17 | npm install grape-ui-react
18 | ```
19 |
20 | ### Usage
21 |
22 | Import grape-ui components into your project
23 |
24 | ```jsx static
25 | import { Paragraph } from 'grape-ui-react';
26 | ```
27 |
28 | Use the components in your app
29 |
30 | ```jsx static
31 | render() {
32 | return (
33 |
34 | ...
35 |
grape-ui is Groovy
36 | ...
37 |
38 | );
39 | };
40 | ```
41 |
42 | And that's it!
43 |
--------------------------------------------------------------------------------
/bitbucket-pipelines.yml:
--------------------------------------------------------------------------------
1 | image: node:10.15.3
2 | clone:
3 | depth: full
4 |
5 | definitions:
6 | caches:
7 | sonar: ~/.sonar/cache
8 | steps:
9 | - step: &build-test-sonarcloud
10 | name: Build, test and analyze on SonarCloud
11 | caches:
12 | - sonar
13 | script:
14 | - npm install
15 | - npm run build
16 | - step: &check-quality-gate-sonarcloud
17 | name: Check the Quality Gate on SonarCloud
18 | script:
19 | - pipe: sonarsource/sonarcloud-quality-gate:0.1.3
20 |
21 | pipelines: # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
22 | branches:
23 | master:
24 | - step: *build-test-sonarcloud
25 | - step: *check-quality-gate-sonarcloud
26 | pull-requests:
27 | '**':
28 | - step: *build-test-sonarcloud
29 | - step: *check-quality-gate-sonarcloud
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/napagroup/grape-ui-react/c8a4da679e30197d947b4fa9c6a79f97f1845790/favicon.ico
--------------------------------------------------------------------------------
/jestconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "testURL": "http://localhost",
3 | "collectCoverageFrom": [
4 | "src/**/*.{js,jsx}",
5 | "!src/**/*.test.{js,jsx}",
6 | "!src/*/RbGenerated*/*.{js,jsx}",
7 | "!src/index.js",
8 | "!src/global-styles.js",
9 | "!src/*/*/Loadable.{js,jsx}",
10 | "!src/**/examples/**",
11 | "!src/utils/momentHelpers/*"
12 | ],
13 | "coverageThreshold": {
14 | "global": {
15 | "statements": 91,
16 | "branches": 91,
17 | "functions": 91,
18 | "lines": 91
19 | }
20 | },
21 | "moduleDirectories": [
22 | "node_modules",
23 | "src"
24 | ],
25 | "moduleNameMapper": {
26 | ".*\\.(css|less|styl|scss|sass)$": "/internals/mocks/cssModule.js",
27 | ".*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/internals/mocks/image.js"
28 | },
29 | "modulePathIgnorePatterns": [
30 | "/lib",
31 | "/src/internals",
32 | "/src/elements/typography/index.js"
33 | ],
34 | "resolver": null,
35 | "setupFilesAfterEnv": [
36 | "/src/internals/testing/test-bundler.js"
37 | ],
38 | "testRegex": "tests/.*\\.test\\.js$",
39 | "snapshotSerializers": [
40 | "enzyme-to-json/serializer"
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/lib/assets/json/border.json:
--------------------------------------------------------------------------------
1 | {
2 | "borderRadius": {
3 | "sm": "2px",
4 | "base": "4px",
5 | "lg": "8px"
6 | }
7 | }
--------------------------------------------------------------------------------
/lib/assets/json/breakpoints.json:
--------------------------------------------------------------------------------
1 | {
2 | "xs": "28em",
3 | "sm": "40em",
4 | "md": "52em",
5 | "lg": "64em",
6 | "xl": "76em"
7 | }
--------------------------------------------------------------------------------
/lib/assets/json/fontFamily.json:
--------------------------------------------------------------------------------
1 | {
2 | "base": "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"",
3 | "monospace": "Consolas, \"Andale Mono WT\", \"Andale Mono\", \"Lucida Console\", \"Lucida Sans Typewriter\", \"DejaVu Sans Mono\", \"Bitstream Vera Sans Mono\", \"Liberation Mono\", \"Nimbus Mono L\", Monaco, \"Courier New\", Courier, monospace",
4 | "native": "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"",
5 | "sansSerif": "Frutiger, \"Frutiger Linotype\", Univers, Calibri, \"Gill Sans\", \"Gill Sans MT\", \"Myriad Pro\", Myriad, \"DejaVu Sans Condensed\", \"Liberation Sans\", \"Nimbus Sans L\", Tahoma, Geneva, \"Helvetica Neue\", Helvetica, Arial, sans-serif",
6 | "serif": "\"Palatino Linotype\", Palatino, Palladio, \"URW Palladio L\", \"Book Antiqua\", Baskerville, \"Bookman Old Style\", \"Bitstream Charter\", \"Nimbus Roman No9 L\", Garamond, \"Apple Garamond\", \"ITC Garamond Narrow\", \"New Century Schoolbook\", \"Century Schoolbook\", \"Century Schoolbook L\", Georgia, serif"
7 | }
8 |
--------------------------------------------------------------------------------
/lib/assets/json/fontSize.json:
--------------------------------------------------------------------------------
1 | {
2 | "baseFontSize": "1rem",
3 | "displayHeader": {
4 | "h1": "6rem",
5 | "h2": "4.8rem",
6 | "h3": "4.2rem",
7 | "h4": "3.6rem",
8 | "h5": "3rem",
9 | "h6": "2.4rem"
10 | },
11 | "h1": "2.5rem",
12 | "h2": "2rem",
13 | "h3": "1.75rem",
14 | "h4": "1.5rem",
15 | "h5": "1.25rem",
16 | "h6": "1rem",
17 | "sizeVariants": {
18 | "sm": ".8",
19 | "base": "1",
20 | "lg": "1.2"
21 | }
22 | }
--------------------------------------------------------------------------------
/lib/assets/json/grid.json:
--------------------------------------------------------------------------------
1 | {
2 | "gutter": "1rem"
3 | }
--------------------------------------------------------------------------------
/lib/assets/json/shadow.json:
--------------------------------------------------------------------------------
1 | {
2 | "01": "0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",
3 | "02": "0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.3)",
4 | "03": "0 8px 17px 2px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12), 0 5px 5px -3px rgba(0,0,0,0.2)",
5 | "04": "0 16px 24px 2px rgba(0,0,0,0.14), 0 6px 30px 5px rgba(0,0,0,0.12), 0 8px 10px -7px rgba(0,0,0,0.2)",
6 | "05": "0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12), 0 11px 15px -7px rgba(0,0,0,0.2)",
7 | "06": "0 32px 59px 3px rgba(0,0,0,0.14), 0 12px 72px 11px rgba(0,0,0,0.12), 0 14px 20px -8px rgba(0,0,0,0.2)"
8 | }
--------------------------------------------------------------------------------
/lib/assets/json/zIndex.json:
--------------------------------------------------------------------------------
1 | {
2 | "01": "1010",
3 | "02": "1020",
4 | "03": "1030",
5 | "04": "1040",
6 | "05": "1050",
7 | "06": "1060"
8 | }
--------------------------------------------------------------------------------
/lib/elements/Button/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2, _context3;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
40 |
41 | var _utils = require("./utils");
42 |
43 | _forEachInstanceProperty(_context3 = _Object$keys(_utils)).call(_context3, function (key) {
44 | if (key === "default" || key === "__esModule") return;
45 |
46 | _Object$defineProperty(exports, key, {
47 | enumerable: true,
48 | get: function get() {
49 | return _utils[key];
50 | }
51 | });
52 | });
--------------------------------------------------------------------------------
/lib/elements/Button/utils.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4 |
5 | _Object$defineProperty(exports, "__esModule", {
6 | value: true
7 | });
8 |
9 | exports.hoverColorButton = exports.activeColorButton = void 0;
10 |
11 | var _styledHelpers = require("../../utils/styledHelpers");
12 |
13 | const hasVariant = variant => {
14 | if (!variant) {
15 | return false;
16 | }
17 |
18 | return !!variant;
19 | };
20 |
21 | const activeColorButton = props => {
22 | const bgActiveColor = props.bgActiveColor,
23 | variant = props.variant;
24 |
25 | if (hasVariant(variant)) {
26 | return null;
27 | }
28 |
29 | const color = !bgActiveColor || bgActiveColor === null ? (0, _styledHelpers.resolveColor)('white.light') : (0, _styledHelpers.resolveColor)(bgActiveColor);
30 | return "background-color: ".concat(color);
31 | };
32 |
33 | exports.activeColorButton = activeColorButton;
34 |
35 | const hoverColorButton = props => {
36 | const bgHoverColor = props.bgHoverColor,
37 | variant = props.variant;
38 |
39 | if (hasVariant(variant)) {
40 | return null;
41 | }
42 |
43 | const color = !bgHoverColor || bgHoverColor === null ? (0, _styledHelpers.resolveColor)('white.dark') : (0, _styledHelpers.resolveColor)(bgHoverColor);
44 | return "background-color: ".concat(color);
45 | };
46 |
47 | exports.hoverColorButton = hoverColorButton;
--------------------------------------------------------------------------------
/lib/elements/Card/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/Card/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _props = require("./props");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_props)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _props[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/elements/Image/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/Progress/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _getProgress = require("./getProgress");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_getProgress)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _getProgress[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/Progress/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2, _context3;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _keyframes = require("./keyframes");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_keyframes)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _keyframes[key];
24 | }
25 | });
26 | });
27 |
28 | var _props = require("./props");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_props)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _props[key];
37 | }
38 | });
39 | });
40 |
41 | var _styledHelpers = require("./styledHelpers");
42 |
43 | _forEachInstanceProperty(_context3 = _Object$keys(_styledHelpers)).call(_context3, function (key) {
44 | if (key === "default" || key === "__esModule") return;
45 |
46 | _Object$defineProperty(exports, key, {
47 | enumerable: true,
48 | get: function get() {
49 | return _styledHelpers[key];
50 | }
51 | });
52 | });
--------------------------------------------------------------------------------
/lib/elements/Table/examples/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _data = require("./data");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_data)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _data[key];
24 | }
25 | });
26 | });
27 |
28 | var _sortHelpers = require("./sortHelpers");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_sortHelpers)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _sortHelpers[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/Table/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _styled = require("./styled");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_styled)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _styled[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/elements/Table/styled.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6 |
7 | _Object$defineProperty(exports, "__esModule", {
8 | value: true
9 | });
10 |
11 | exports.Table = void 0;
12 |
13 | var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/taggedTemplateLiteral"));
14 |
15 | var _styledComponents = _interopRequireDefault(require("styled-components"));
16 |
17 | var _styledSystem = require("styled-system");
18 |
19 | var _Hideable = require("../../elements/utils/Hideable");
20 |
21 | var _component = require("./component");
22 |
23 | var _utils = require("./utils");
24 |
25 | function _templateObject() {
26 | const data = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n"]);
27 |
28 | _templateObject = function _templateObject() {
29 | return data;
30 | };
31 |
32 | return data;
33 | }
34 |
35 | const Table = (0, _styledComponents.default)((0, _Hideable.withHideable)(_component.TableComponent))(_templateObject(), _utils.defaultTableStylesBase, _styledSystem.flexbox);
36 | /** @component */
37 |
38 | exports.Table = Table;
--------------------------------------------------------------------------------
/lib/elements/Table/tests/utils/columns.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4 |
5 | _Object$defineProperty(exports, "__esModule", {
6 | value: true
7 | });
8 |
9 | exports.columns = void 0;
10 | const columns = [{
11 | columns: [{
12 | accessor: 'firstName',
13 | Header: 'First Name',
14 | title: 'test-first-name-column'
15 | }, {
16 | accessor: 'lastName',
17 | Header: 'Last Name',
18 | title: 'test-last-name-column'
19 | }],
20 | Header: 'Name',
21 | title: 'test-name-column'
22 | }, {
23 | columns: [{
24 | accessor: 'age',
25 | Header: 'Age',
26 | title: 'test-age-column'
27 | }],
28 | Header: 'Info',
29 | title: 'test-info-column'
30 | }];
31 | exports.columns = columns;
--------------------------------------------------------------------------------
/lib/elements/Table/tests/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _columns = require("./columns");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_columns)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _columns[key];
24 | }
25 | });
26 | });
27 |
28 | var _testData = require("./testData");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_testData)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _testData[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/Table/utils/constants.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4 |
5 | _Object$defineProperty(exports, "__esModule", {
6 | value: true
7 | });
8 |
9 | exports.defaultPageOptions = void 0;
10 | const defaultPageOptions = [10, 15, 25, 30, 50];
11 | exports.defaultPageOptions = defaultPageOptions;
--------------------------------------------------------------------------------
/lib/elements/Toolbar/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/Toolbar/tests/Toolbar.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _react = _interopRequireDefault(require("react"));
6 |
7 | var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
8 |
9 | require("jest-styled-components");
10 |
11 | var _styledComponents = require("styled-components");
12 |
13 | var _Toolbar = require("../../../elements/Toolbar");
14 |
15 | const emptyTheme = {};
16 |
17 | const assertReactElement = element => {
18 | const component = _reactTestRenderer.default.create(element);
19 |
20 | return component.toJSON();
21 | };
22 |
23 | describe('Box Component base', () => {
24 | it('should return an empty Toolbar with base styling', () => {
25 | const element = /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
26 | theme: emptyTheme
27 | }, /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, null));
28 |
29 | expect(assertReactElement(element)).toMatchSnapshot();
30 | });
31 | });
--------------------------------------------------------------------------------
/lib/elements/Toolbar/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _props = require("./props");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_props)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _props[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/elements/forms/CheckboxField/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _styled = require("./styled");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_styled)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _styled[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/elements/forms/DateField/tests/DateField.ref.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
6 |
7 | var _react = _interopRequireDefault(require("react"));
8 |
9 | require("jest-styled-components");
10 |
11 | var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
12 |
13 | var _enzyme = require("enzyme");
14 |
15 | var _styledComponents = require("styled-components");
16 |
17 | var _ = require("..");
18 |
19 | (0, _enzyme.configure)({
20 | adapter: new _enzymeAdapterReact.default()
21 | });
22 | describe('When supporting a forward ref for TextField ', () => {
23 | it('should reference the underlying input element', () => {
24 | const ref = _react.default.createRef();
25 |
26 | const register = e => {
27 | ref.current = e;
28 | };
29 |
30 | const component = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
31 | theme: {}
32 | }, /*#__PURE__*/_react.default.createElement(_.DateField, {
33 | inputRef: register,
34 | labelText: "Desired Date",
35 | name: "desiredDate"
36 | })));
37 | expect((0, _find.default)(component).call(component, 'input').instance()).toEqual(ref.current);
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/forms/Form/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/forms/SelectField/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/forms/SelectField/tests/SelectField.ref.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
6 |
7 | var _react = _interopRequireDefault(require("react"));
8 |
9 | require("jest-styled-components");
10 |
11 | var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
12 |
13 | var _enzyme = require("enzyme");
14 |
15 | var _styledComponents = require("styled-components");
16 |
17 | var _ = require("..");
18 |
19 | (0, _enzyme.configure)({
20 | adapter: new _enzymeAdapterReact.default()
21 | });
22 | describe('When supporting a forward ref for SelectField ', () => {
23 | it('should reference the underlying input element', () => {
24 | const ref = _react.default.createRef();
25 |
26 | const register = e => {
27 | ref.current = e;
28 | };
29 |
30 | const component = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
31 | theme: {}
32 | }, /*#__PURE__*/_react.default.createElement(_.SelectField, {
33 | inputRef: register,
34 | labelText: "Name",
35 | name: "name"
36 | })));
37 | const instance = (0, _find.default)(component).call(component, 'input').at(0).getDOMNode();
38 | expect(instance).toEqual(ref.current.select.inputRef);
39 | });
40 | });
--------------------------------------------------------------------------------
/lib/elements/forms/SelectField/tests/examples/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4 |
5 | _Object$defineProperty(exports, "__esModule", {
6 | value: true
7 | });
8 |
9 | exports.colorOptions = void 0;
10 | const colorOptions = [{
11 | color: '#FF5630',
12 | label: 'Red',
13 | value: 'red'
14 | }, {
15 | color: '#FFC400',
16 | label: 'Yellow',
17 | value: 'yellow'
18 | }, {
19 | color: '#36B37E',
20 | label: 'Green',
21 | value: 'green'
22 | }];
23 | exports.colorOptions = colorOptions;
--------------------------------------------------------------------------------
/lib/elements/forms/TextField/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2, _context3;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
40 |
41 | var _utils = require("./utils");
42 |
43 | _forEachInstanceProperty(_context3 = _Object$keys(_utils)).call(_context3, function (key) {
44 | if (key === "default" || key === "__esModule") return;
45 |
46 | _Object$defineProperty(exports, key, {
47 | enumerable: true,
48 | get: function get() {
49 | return _utils[key];
50 | }
51 | });
52 | });
--------------------------------------------------------------------------------
/lib/elements/forms/utils/AssistiveText/helpers.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4 |
5 | _Object$defineProperty(exports, "__esModule", {
6 | value: true
7 | });
8 |
9 | exports.getAssistiveText = void 0;
10 |
11 | const getAssistiveText = props => {
12 | const assistiveText = props.assistiveText,
13 | isRequired = props.isRequired;
14 |
15 | if (isRequired && !assistiveText) {
16 | return '*Required';
17 | }
18 |
19 | return assistiveText || '';
20 | };
21 |
22 | exports.getAssistiveText = getAssistiveText;
--------------------------------------------------------------------------------
/lib/elements/forms/utils/AssistiveText/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2, _context3;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
40 |
41 | var _helpers = require("./helpers");
42 |
43 | _forEachInstanceProperty(_context3 = _Object$keys(_helpers)).call(_context3, function (key) {
44 | if (key === "default" || key === "__esModule") return;
45 |
46 | _Object$defineProperty(exports, key, {
47 | enumerable: true,
48 | get: function get() {
49 | return _helpers[key];
50 | }
51 | });
52 | });
--------------------------------------------------------------------------------
/lib/elements/forms/utils/AssistiveText/tests/AssistiveText.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _react = _interopRequireDefault(require("react"));
6 |
7 | var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
8 |
9 | var _styledComponents = require("styled-components");
10 |
11 | var _ = require("..");
12 |
13 | require("jest-styled-components");
14 |
15 | const emptyTheme = {};
16 |
17 | const assertReactElement = element => {
18 | const component = _reactTestRenderer.default.create(element);
19 |
20 | return component.toJSON();
21 | };
22 |
23 | describe('Assistive Text Component base', () => {
24 | it('should return an Assistive Text object', () => {
25 | const element = /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
26 | theme: emptyTheme
27 | }, /*#__PURE__*/_react.default.createElement(_.AssistiveText, {
28 | id: "assitiveTextIdHelp"
29 | }, "Helper text is here"));
30 |
31 | expect(assertReactElement(element)).toMatchSnapshot();
32 | });
33 | it('should return an Assistive Text object with danger text color', () => {
34 | const element = /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
35 | theme: emptyTheme
36 | }, /*#__PURE__*/_react.default.createElement(_.AssistiveText, {
37 | color: "brandDanger",
38 | id: "assitiveTextIdError"
39 | }, "Error text is here"));
40 |
41 | expect(assertReactElement(element)).toMatchSnapshot();
42 | });
43 | });
--------------------------------------------------------------------------------
/lib/elements/forms/utils/ControlGroup/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/forms/utils/ControlLabel/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/forms/utils/ControlLabel/tests/ControlLabel.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _react = _interopRequireDefault(require("react"));
6 |
7 | var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
8 |
9 | var _styledComponents = require("styled-components");
10 |
11 | var _ = require("..");
12 |
13 | require("jest-styled-components");
14 |
15 | describe('ControlLabel Component base', () => {
16 | it('should return a ControlLabel object', () => {
17 | const component = _reactTestRenderer.default.create( /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
18 | theme: {}
19 | }, /*#__PURE__*/_react.default.createElement(_.ControlLabel, {
20 | htmlFor: "forWhatId"
21 | }, "Label text is here")));
22 |
23 | const tree = component.toJSON();
24 | expect(tree).toMatchSnapshot();
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/elements/forms/utils/PlainText/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/grid/Box/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/grid/Flex/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/grid/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _Box = require("./Box");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_Box)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _Box[key];
24 | }
25 | });
26 | });
27 |
28 | var _Flex = require("./Flex");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_Flex)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _Flex[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/grid/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6 |
7 | _Object$defineProperty(exports, "__esModule", {
8 | value: true
9 | });
10 |
11 | exports.defaultFlexBoxStylesPropsToTrim = void 0;
12 |
13 | var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
14 |
15 | var _propTypes = _interopRequireDefault(require("@styled-system/prop-types"));
16 |
17 | var _Progress = require("../../../elements/Progress");
18 |
19 | const defaultFlexBoxStylesPropsToTrim = [...(0, _keys.default)(_propTypes.default.background), ...(0, _keys.default)(_propTypes.default.border), ...(0, _keys.default)(_propTypes.default.flexbox), ...(0, _keys.default)(_propTypes.default.grid), ...(0, _keys.default)(_propTypes.default.layout), ...(0, _keys.default)(_propTypes.default.position), ...(0, _keys.default)(_propTypes.default.shadow), ...(0, _keys.default)(_propTypes.default.space), ...(0, _keys.default)(_Progress.getProgressPropTypes), 'boxSizing'];
20 | exports.defaultFlexBoxStylesPropsToTrim = defaultFlexBoxStylesPropsToTrim;
--------------------------------------------------------------------------------
/lib/elements/typography/Header/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _styled = require("./styled");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_styled)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _styled[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/elements/typography/Link/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/typography/Link/utils.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6 |
7 | _Object$defineProperty(exports, "__esModule", {
8 | value: true
9 | });
10 |
11 | exports.emailHrefString = emailHrefString;
12 |
13 | var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
14 |
15 | var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
16 |
17 | var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
18 |
19 | var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
20 |
21 | function emailHrefString(props) {
22 | var _context, _context2, _context4, _context5;
23 |
24 | const otherProps = {
25 | bcc: props.bcc,
26 | body: props.body,
27 | cc: props.cc,
28 | subject: props.subject
29 | };
30 | const trimmedProps = (0, _map.default)(_context = (0, _filter.default)(_context2 = (0, _keys.default)(otherProps)).call(_context2, key => !!props[key])).call(_context, key => {
31 | var _context3;
32 |
33 | return encodeURI((0, _concat.default)(_context3 = "".concat(key, "=")).call(_context3, props[key]));
34 | }).join('&');
35 | return (0, _concat.default)(_context4 = (0, _concat.default)(_context5 = "".concat(props.to || trimmedProps ? 'mailto:' : '')).call(_context5, props.to || '')).call(_context4, trimmedProps ? "?".concat(trimmedProps) : '');
36 | }
--------------------------------------------------------------------------------
/lib/elements/typography/List/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _styled = require("./styled");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_styled)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _styled[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/elements/typography/ListItem/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/typography/Paragraph/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/typography/Text/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/typography/codeElements/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _component = require("./component");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_component)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _component[key];
24 | }
25 | });
26 | });
27 |
28 | var _styled = require("./styled");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styled)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styled[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/typography/codeElements/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context, _context2;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _props = require("./props");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_props)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _props[key];
24 | }
25 | });
26 | });
27 |
28 | var _styles = require("./styles");
29 |
30 | _forEachInstanceProperty(_context2 = _Object$keys(_styles)).call(_context2, function (key) {
31 | if (key === "default" || key === "__esModule") return;
32 |
33 | _Object$defineProperty(exports, key, {
34 | enumerable: true,
35 | get: function get() {
36 | return _styles[key];
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/lib/elements/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _Hideable = require("./Hideable");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_Hideable)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _Hideable[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/internals/mocks/cssModule.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | module.exports = 'CSS_MODULE';
--------------------------------------------------------------------------------
/lib/internals/webpack/webpack.config.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | const path = require('path');
4 |
5 | module.exports = {
6 | entry: path.join(process.cwd(), 'src/index.js'),
7 | output: {
8 | filename: 'bundle.js',
9 | path: path.resolve(process.cwd(), 'dist')
10 | },
11 | module: {
12 | rules: [{
13 | test: /\.jsx?$/,
14 | exclude: /node_modules/,
15 | use: {
16 | loader: 'babel-loader',
17 | options: {
18 | presets: ['@babel/preset-react', '@babel/preset-env']
19 | }
20 | }
21 | }, {
22 | test: /\.css$/,
23 | use: ['style-loader', 'css-loader']
24 | }, {
25 | test: /\.(png|svg|jpg|gif)$/,
26 | loader: 'file-loader',
27 | query: {
28 | name: 'static/media/[name].[hash:8].[ext]'
29 | }
30 | }]
31 | },
32 | resolve: {
33 | modules: ['node_modules'],
34 | alias: {
35 | src: path.join(process.cwd(), 'src')
36 | }
37 | }
38 | };
--------------------------------------------------------------------------------
/lib/internals/webpack/webpack.config.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | const path = require('path');
4 |
5 | module.exports = {
6 | entry: path.join(process.cwd(), 'src/index.js'),
7 | output: {
8 | filename: 'bundle.js',
9 | path: path.resolve(process.cwd(), 'dist')
10 | },
11 | module: {
12 | rules: [{
13 | test: /\.css$/i,
14 | use: ['style-loader', 'css-loader']
15 | }, {
16 | test: /\.js$/,
17 | // Transform all .js files required somewhere with Babel
18 | exclude: /node_modules/,
19 | use: {
20 | loader: 'babel-loader'
21 | }
22 | }]
23 | },
24 | plugins: [],
25 | resolve: {
26 | modules: ['node_modules'],
27 | alias: {
28 | src: path.join(process.cwd(), 'src')
29 | }
30 | }
31 | };
--------------------------------------------------------------------------------
/lib/utils/componentHelpers/componentHelpers.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6 |
7 | _Object$defineProperty(exports, "__esModule", {
8 | value: true
9 | });
10 |
11 | exports.removeSomeProps = exports.passThrough = void 0;
12 |
13 | var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
14 |
15 | var _except = _interopRequireDefault(require("except"));
16 |
17 | const removeSomeProps = (originalProps, toBeRemovedProps) => (0, _except.default)(originalProps, toBeRemovedProps);
18 |
19 | exports.removeSomeProps = removeSomeProps;
20 |
21 | const passThrough = (component, props) => {
22 | const omit = (0, _keys.default)(component.propTypes || {});
23 | return (0, _except.default)(props, omit);
24 | };
25 |
26 | exports.passThrough = passThrough;
--------------------------------------------------------------------------------
/lib/utils/componentHelpers/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _componentHelpers = require("./componentHelpers");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_componentHelpers)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _componentHelpers[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/utils/momentHelpers/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _momentLocaleUtils = require("./momentLocaleUtils");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_momentLocaleUtils)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _momentLocaleUtils[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/utils/objectHelpers/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4 |
5 | var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6 |
7 | var _context;
8 |
9 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
10 |
11 | _Object$defineProperty(exports, "__esModule", {
12 | value: true
13 | });
14 |
15 | var _objectHelpers = require("./objectHelpers");
16 |
17 | _forEachInstanceProperty(_context = _Object$keys(_objectHelpers)).call(_context, function (key) {
18 | if (key === "default" || key === "__esModule") return;
19 |
20 | _Object$defineProperty(exports, key, {
21 | enumerable: true,
22 | get: function get() {
23 | return _objectHelpers[key];
24 | }
25 | });
26 | });
--------------------------------------------------------------------------------
/lib/utils/objectHelpers/objectHelpers.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4 |
5 | var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6 |
7 | _Object$defineProperty(exports, "__esModule", {
8 | value: true
9 | });
10 |
11 | exports.isKeyNestedProp = exports.resolveToProperty = void 0;
12 |
13 | var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
14 |
15 | /*
16 | * Allows access to nested JavaScript objects with a string key.
17 | * Example usage:
18 | * resolveToProperty("style.width", document.body)
19 | */
20 | const resolveToProperty = (path, obj) => {
21 | var _context;
22 |
23 | return typeof path !== 'string' ? undefined : (0, _reduce.default)(_context = path.split('.')).call(_context, (prev, curr) => prev ? prev[curr] : undefined, obj);
24 | };
25 | /**
26 | * Returns true if path is represented as a nested prop. Otherwise false.
27 | * @param {string} path the string representation of a path to the nested property.
28 | */
29 |
30 |
31 | exports.resolveToProperty = resolveToProperty;
32 |
33 | const isKeyNestedProp = path => /[a-zA-Z_](\w*\.[a-z_]\w*)+/i.test(path);
34 |
35 | exports.isKeyNestedProp = isKeyNestedProp;
--------------------------------------------------------------------------------
/lib/utils/styledHelpers/utils/tests/colorCore.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _globalStyles = require("../../../../global-styles");
4 |
5 | var _ = require("../..");
6 |
7 | /* eslint-disable import/no-duplicates */
8 | const _getGlobalStyles = (0, _globalStyles.getGlobalStyles)(),
9 | colorSchema = _getGlobalStyles.colors;
10 |
11 | describe('When given props with undefined color and bg', () => {
12 | it('should return the default styling for background and color', () => {
13 | const props = {};
14 | const expected = {
15 | backgroundColor: _.defaultStylesBase.bg,
16 | color: _.defaultStylesBase.color
17 | };
18 | expect((0, _.colorCore)(props)).toEqual(expected);
19 | });
20 | });
21 | describe('When given props with color and bg', () => {
22 | it('should return the default styling for background and color', () => {
23 | const props = {
24 | bg: 'green.dark',
25 | color: 'green'
26 | };
27 | const expected = {
28 | backgroundColor: colorSchema.green.dark,
29 | color: colorSchema.green.base
30 | };
31 | expect((0, _.colorCore)(props)).toEqual(expected);
32 | });
33 | });
34 | describe('When given props with non-variable color and bg', () => {
35 | it('should return the default styling for background and color', () => {
36 | const props = {
37 | bg: '#ff0000',
38 | color: '#ffffff'
39 | };
40 | const expected = {
41 | backgroundColor: props.bg,
42 | color: props.color
43 | };
44 | expect((0, _.colorCore)(props)).toEqual(expected);
45 | });
46 | });
--------------------------------------------------------------------------------
/lib/utils/styledHelpers/utils/tests/resolveBoxShadow.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _cssDefaults = require("../../cssDefaults");
4 |
5 | var _resolvers = require("../resolvers");
6 |
7 | describe('resolveBoxShadow', () => {
8 | it('should return the inherit value if no depth or globalOverrides given', () => {
9 | // Act
10 | const actual = (0, _resolvers.resolveBoxShadow)(); // Assert
11 |
12 | expect(actual).toBe(_cssDefaults.CSS_INHERIT_VALUE);
13 | });
14 | it('should return the inherit value depth is not a string', () => {
15 | // Act
16 | const actual = (0, _resolvers.resolveBoxShadow)(5); // Assert
17 |
18 | expect(actual).toBe(_cssDefaults.CSS_INHERIT_VALUE);
19 | });
20 | it('should return the inherit value depth is a string but not valid', () => {
21 | // Act
22 | const actual = (0, _resolvers.resolveBoxShadow)('07'); // Assert
23 |
24 | expect(actual).toBe(_cssDefaults.CSS_INHERIT_VALUE);
25 | });
26 | it('should return the specified box shadow value', () => {
27 | // Arrange
28 | const depth = '06'; // Act
29 |
30 | const actual = (0, _resolvers.resolveBoxShadow)(depth); // Assert
31 |
32 | expect(actual).toBe('0 32px 59px 3px rgba(0,0,0,0.14), 0 12px 72px 11px rgba(0,0,0,0.12), 0 14px 20px -8px rgba(0,0,0,0.2)');
33 | });
34 | });
--------------------------------------------------------------------------------
/lib/utils/styledHelpers/utils/tests/resolveZIndex.test.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _cssDefaults = require("../../cssDefaults");
4 |
5 | var _resolvers = require("../resolvers");
6 |
7 | describe('resolveZIndex', () => {
8 | it('should return the inherit value if no depth or globalOverrides given', () => {
9 | // Act
10 | const actual = (0, _resolvers.resolveZIndex)(); // Assert
11 |
12 | expect(actual).toBe(_cssDefaults.CSS_INHERIT_VALUE);
13 | });
14 | it('should return the inherit value depth is not a string', () => {
15 | // Act
16 | const actual = (0, _resolvers.resolveZIndex)(5); // Assert
17 |
18 | expect(actual).toBe(_cssDefaults.CSS_INHERIT_VALUE);
19 | });
20 | it('should return the inherit value depth is a string but not valid', () => {
21 | // Act
22 | const actual = (0, _resolvers.resolveZIndex)('07'); // Assert
23 |
24 | expect(actual).toBe(_cssDefaults.CSS_INHERIT_VALUE);
25 | });
26 | it('should return the specified z-index value', () => {
27 | // Arrange
28 | const depth = '06'; // Act
29 |
30 | const actual = (0, _resolvers.resolveZIndex)(depth); // Assert
31 |
32 | expect(actual).toBe('1060');
33 | });
34 | });
--------------------------------------------------------------------------------
/src/assets/json/border.json:
--------------------------------------------------------------------------------
1 | {
2 | "borderRadius": {
3 | "sm": "2px",
4 | "base": "4px",
5 | "lg": "8px"
6 | }
7 | }
--------------------------------------------------------------------------------
/src/assets/json/breakpoints.json:
--------------------------------------------------------------------------------
1 | {
2 | "xs": "28em",
3 | "sm": "40em",
4 | "md": "52em",
5 | "lg": "64em",
6 | "xl": "76em"
7 | }
--------------------------------------------------------------------------------
/src/assets/json/fontFamily.json:
--------------------------------------------------------------------------------
1 | {
2 | "base": "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"",
3 | "monospace": "Consolas, \"Andale Mono WT\", \"Andale Mono\", \"Lucida Console\", \"Lucida Sans Typewriter\", \"DejaVu Sans Mono\", \"Bitstream Vera Sans Mono\", \"Liberation Mono\", \"Nimbus Mono L\", Monaco, \"Courier New\", Courier, monospace",
4 | "native": "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"",
5 | "sansSerif": "Frutiger, \"Frutiger Linotype\", Univers, Calibri, \"Gill Sans\", \"Gill Sans MT\", \"Myriad Pro\", Myriad, \"DejaVu Sans Condensed\", \"Liberation Sans\", \"Nimbus Sans L\", Tahoma, Geneva, \"Helvetica Neue\", Helvetica, Arial, sans-serif",
6 | "serif": "\"Palatino Linotype\", Palatino, Palladio, \"URW Palladio L\", \"Book Antiqua\", Baskerville, \"Bookman Old Style\", \"Bitstream Charter\", \"Nimbus Roman No9 L\", Garamond, \"Apple Garamond\", \"ITC Garamond Narrow\", \"New Century Schoolbook\", \"Century Schoolbook\", \"Century Schoolbook L\", Georgia, serif"
7 | }
8 |
--------------------------------------------------------------------------------
/src/assets/json/fontSize.json:
--------------------------------------------------------------------------------
1 | {
2 | "baseFontSize": "1rem",
3 | "displayHeader": {
4 | "h1": "6rem",
5 | "h2": "4.8rem",
6 | "h3": "4.2rem",
7 | "h4": "3.6rem",
8 | "h5": "3rem",
9 | "h6": "2.4rem"
10 | },
11 | "h1": "2.5rem",
12 | "h2": "2rem",
13 | "h3": "1.75rem",
14 | "h4": "1.5rem",
15 | "h5": "1.25rem",
16 | "h6": "1rem",
17 | "sizeVariants": {
18 | "sm": ".8",
19 | "base": "1",
20 | "lg": "1.2"
21 | }
22 | }
--------------------------------------------------------------------------------
/src/assets/json/grid.json:
--------------------------------------------------------------------------------
1 | {
2 | "gutter": "1rem"
3 | }
--------------------------------------------------------------------------------
/src/assets/json/shadow.json:
--------------------------------------------------------------------------------
1 | {
2 | "01": "0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",
3 | "02": "0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.3)",
4 | "03": "0 8px 17px 2px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12), 0 5px 5px -3px rgba(0,0,0,0.2)",
5 | "04": "0 16px 24px 2px rgba(0,0,0,0.14), 0 6px 30px 5px rgba(0,0,0,0.12), 0 8px 10px -7px rgba(0,0,0,0.2)",
6 | "05": "0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12), 0 11px 15px -7px rgba(0,0,0,0.2)",
7 | "06": "0 32px 59px 3px rgba(0,0,0,0.14), 0 12px 72px 11px rgba(0,0,0,0.12), 0 14px 20px -8px rgba(0,0,0,0.2)"
8 | }
--------------------------------------------------------------------------------
/src/assets/json/zIndex.json:
--------------------------------------------------------------------------------
1 | {
2 | "01": "1010",
3 | "02": "1020",
4 | "03": "1030",
5 | "04": "1040",
6 | "05": "1050",
7 | "06": "1060"
8 | }
--------------------------------------------------------------------------------
/src/elements/Button/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './styled';
3 | export * from './utils';
4 |
--------------------------------------------------------------------------------
/src/elements/Button/utils.js:
--------------------------------------------------------------------------------
1 | import { resolveColor } from 'src/utils/styledHelpers';
2 |
3 | const hasVariant = variant => {
4 | if (!variant) {
5 | return false;
6 | }
7 | return !!variant;
8 | };
9 |
10 | export const activeColorButton = props => {
11 | const { bgActiveColor, variant } = props;
12 | if (hasVariant(variant)) {
13 | return null;
14 | }
15 | const color = (!bgActiveColor || bgActiveColor === null) ? resolveColor('white.light') : resolveColor(bgActiveColor);
16 | return `background-color: ${color}`;
17 | };
18 |
19 | export const hoverColorButton = props => {
20 | const { bgHoverColor, variant } = props;
21 | if (hasVariant(variant)) {
22 | return null;
23 | }
24 | const color = (!bgHoverColor || bgHoverColor === null) ? resolveColor('white.dark') : resolveColor(bgHoverColor);
25 | return `background-color: ${color}`;
26 | };
27 |
--------------------------------------------------------------------------------
/src/elements/Card/component.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Box } from 'src/elements/grid';
3 | import { removeSomeProps } from 'src/utils/componentHelpers';
4 | import {
5 | cardDefaultProps,
6 | cardPropTypes,
7 | } from './utils';
8 | import {
9 | CardHeader,
10 | CardInner,
11 | getCardActions,
12 | getCardBody,
13 | getCardRichMedia,
14 | getCardSecondaryMedia,
15 | } from './subComponents';
16 |
17 | export const CardComponent = props => {
18 | const {
19 | cardPadding,
20 | cardSecondaryMedia,
21 | children,
22 | } = props;
23 | return (
24 |
25 | {getCardRichMedia(props)}
26 |
27 |
28 | {!cardSecondaryMedia ? getCardBody(props) : ''}
29 | {children ? {children} : ''}
30 |
31 | {getCardSecondaryMedia(props)}
32 | {getCardActions(props)}
33 |
34 | );
35 | };
36 |
37 | CardComponent.propTypes = {
38 | ...cardPropTypes,
39 | };
40 |
41 | CardComponent.defaultProps = {
42 | ...cardDefaultProps,
43 | };
44 |
--------------------------------------------------------------------------------
/src/elements/Card/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './styled';
3 |
--------------------------------------------------------------------------------
/src/elements/Card/subComponents/CardActions/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Box } from 'src/elements/grid';
3 | import { Card } from 'src/elements/Card';
4 |
5 | export const getCardActions = ({
6 | cardActions,
7 | cardActionsProps,
8 | cardActionsLeft,
9 | cardActionsLeftProps,
10 | cardActionsRight,
11 | cardActionsRightProps,
12 | cardPadding,
13 | }) => {
14 | if (cardActions || cardActionsLeft) {
15 | return (
16 |
22 | {cardActions}
23 |
24 | {cardActionsLeft}
25 |
26 |
27 | {cardActionsRight}
28 |
29 |
30 | );
31 | }
32 | if (cardActionsRight) {
33 | return (
34 |
39 |
40 | {cardActionsRight}
41 |
42 |
43 | );
44 | }
45 | return '';
46 | };
47 |
--------------------------------------------------------------------------------
/src/elements/Card/subComponents/CardBody.md:
--------------------------------------------------------------------------------
1 | Card body is reserved for the content of the card. It appears below the secondary media area and above the actions area. It is a [``](#/Flexbox/Components/Box) component.
2 |
3 | #### Examples
4 |
5 | ```jsx in Markdown
6 | import { Card } from 'src/elements/Card';
7 | import { Box, Flex } from 'src/elements/grid';
8 |
9 | const baseCardStyleProps = {
10 | m: 1,
11 | maxWidth: 300,
12 | width: 1,
13 | };
14 |
15 | const containerStyleProps = {
16 | alignItems: 'center',
17 | background: '#fdf4fb',
18 | flexWrap: 'wrap',
19 | justifyContent: 'space-evenly',
20 | p: [2, null, 3],
21 | };
22 |
23 |
24 |
25 |
29 |
30 |
31 | ```
32 |
33 | ### List of Props
34 |
35 | | Prop Name | Passed Props | SubComponent | Root Component | Default Props | Description |
36 | | - | - | - | - | - | - |
37 | | `cardBody` | `cardBodyProps` | `` | [``](#/Flexbox/Components/Box) | None | Container for the body content of the card. |
38 |
--------------------------------------------------------------------------------
/src/elements/Card/subComponents/CardBody/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card } from 'src/elements/Card';
3 | import {
4 | cardBaseDefaultProps,
5 | cardBasePropTypes,
6 | cardBodyBaseDefaultProps,
7 | cardBodyBasePropTypes,
8 | cardSecondaryMediaBasePropTypes,
9 | cardSecondaryMediaBaseDefaultProps,
10 | } from 'src/elements/Card/utils';
11 |
12 | const getPaddingTop = ({
13 | cardPadding,
14 | cardSubtitle,
15 | cardThumbnail,
16 | cardTitle,
17 | }) => {
18 | if (!cardTitle && !cardThumbnail && !cardSubtitle) {
19 | return cardPadding;
20 | }
21 | return '';
22 | };
23 |
24 | export const getCardBody = props => {
25 | const {
26 | cardBody,
27 | cardBodyProps,
28 | cardPadding,
29 | cardSecondaryMedia,
30 | } = props;
31 | if (cardBody) {
32 | return (
33 |
38 | {cardBody}
39 |
40 | );
41 | }
42 | return null;
43 | };
44 |
45 | getCardBody.propTypes = {
46 | ...cardBasePropTypes,
47 | ...cardBodyBasePropTypes,
48 | ...cardSecondaryMediaBasePropTypes,
49 | };
50 |
51 | getCardBody.defaultProps = {
52 | ...cardBaseDefaultProps,
53 | ...cardBodyBaseDefaultProps,
54 | ...cardSecondaryMediaBaseDefaultProps,
55 | };
56 |
--------------------------------------------------------------------------------
/src/elements/Card/subComponents/CardRichMedia/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card } from 'src/elements/Card';
3 | import {
4 | cardRichMediaBasePropTypes,
5 | cardRichMediaBaseDefaultProps,
6 | } from 'src/elements/Card/utils';
7 |
8 | export const getCardRichMedia = ({
9 | cardRichMedia,
10 | cardRichMediaProps,
11 | }) => {
12 | if (cardRichMedia) {
13 | return {cardRichMedia};
14 | }
15 | return null;
16 | };
17 |
18 | getCardRichMedia.propTypes = {
19 | ...cardRichMediaBasePropTypes,
20 | };
21 |
22 | getCardRichMedia.defaultProps = {
23 | ...cardRichMediaBaseDefaultProps,
24 | };
25 |
--------------------------------------------------------------------------------
/src/elements/Card/subComponents/CardSecondaryMedia/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card } from 'src/elements/Card';
3 | import {
4 | cardBasePropTypes,
5 | cardBaseDefaultProps,
6 | cardSecondaryMediaBasePropTypes,
7 | cardSecondaryMediaBaseDefaultProps,
8 | } from 'src/elements/Card/utils';
9 | import { Box } from 'src/elements/grid';
10 | import { getCardBody } from 'src/elements/Card/subComponents';
11 | import { getCardActions } from '../CardActions';
12 |
13 | export const getCardSecondaryMedia = props => {
14 | const {
15 | cardBody,
16 | cardPadding,
17 | cardSecondaryMedia,
18 | cardSecondaryMediaProps,
19 | } = props;
20 | if (cardSecondaryMedia) {
21 | return (
22 |
23 |
27 | {cardSecondaryMedia}
28 |
29 | {getCardBody(props)}
30 |
31 | );
32 | }
33 | return null;
34 | };
35 |
36 | getCardSecondaryMedia.propTypes = {
37 | ...cardBasePropTypes,
38 | ...cardSecondaryMediaBasePropTypes,
39 | };
40 |
41 | getCardSecondaryMedia.defaultProps = {
42 | ...cardBaseDefaultProps,
43 | ...cardSecondaryMediaBaseDefaultProps,
44 | };
45 |
--------------------------------------------------------------------------------
/src/elements/Card/subComponents/index.js:
--------------------------------------------------------------------------------
1 | export * from './CardActions';
2 | export * from './CardBody';
3 | export * from './CardHeader';
4 | export * from './CardInner';
5 | export * from './CardRichMedia';
6 | export * from './CardSecondaryMedia';
7 |
--------------------------------------------------------------------------------
/src/elements/Card/utils/index.js:
--------------------------------------------------------------------------------
1 | export * from './props';
2 |
--------------------------------------------------------------------------------
/src/elements/Image/component.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { removeSomeProps } from 'src/utils/componentHelpers';
4 | import { Img } from 'react-image';
5 | import propTypes from '@styled-system/prop-types';
6 |
7 | const componentPropsToRemove = {
8 | ...propTypes.border,
9 | ...propTypes.layout,
10 | ...propTypes.space,
11 | };
12 |
13 | export const ImageComponent = ({ alt, ...props }) => (
14 |
15 | );
16 |
17 | ImageComponent.propTypes = {
18 | alt: PropTypes.string,
19 | };
20 |
21 | ImageComponent.defaultProps = {
22 | alt: '',
23 | };
24 |
--------------------------------------------------------------------------------
/src/elements/Image/examples/nacho-dominguez-argenta-cCVzi_mKovs-unsplash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/napagroup/grape-ui-react/c8a4da679e30197d947b4fa9c6a79f97f1845790/src/elements/Image/examples/nacho-dominguez-argenta-cCVzi_mKovs-unsplash.jpg
--------------------------------------------------------------------------------
/src/elements/Image/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './styled';
3 |
--------------------------------------------------------------------------------
/src/elements/Image/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 | import PropTypes from 'prop-types';
3 | import { border, layout } from 'styled-system';
4 | import propTypes from '@styled-system/prop-types';
5 | import { withHideable } from 'src/elements/utils/Hideable';
6 | import { ImageComponent } from './component';
7 |
8 | const Image = styled(withHideable(ImageComponent))`
9 | ${border}
10 | ${layout}
11 | `;
12 |
13 | Image.propTypes = {
14 | /** Required for web accessibility. Should be short and descriptive. */
15 | alt: PropTypes.string.isRequired,
16 | /** Hides component */
17 | isHidden: PropTypes.bool,
18 | ...propTypes.border,
19 | ...propTypes.layout,
20 | };
21 |
22 | Image.defaultProps = {
23 | isHidden: false,
24 | maxWidth: '100%',
25 | width: '100%',
26 | };
27 |
28 | /** @component */
29 | export { Image };
30 |
--------------------------------------------------------------------------------
/src/elements/Progress/CircleProgress/component.js:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import PropTypes from 'prop-types';
4 | import { Box } from 'src/elements/grid';
5 | import { removeSomeProps } from 'src/utils/componentHelpers';
6 | import { defaultProgressPropsToTrim } from '../utils';
7 |
8 | export const RootComponent = ({ children, ...props }) => (
9 |
10 | {children}
11 |
12 | );
13 | RootComponent.propTypes = {
14 | children: PropTypes.any,
15 | };
16 |
17 | RootComponent.defaultProps = {
18 | children: null,
19 | };
20 |
21 | export const CircleComponent = ({ children, ...props }) => {
22 | const { indicatorPropsToTrim, trackPropsToTrim } = props;
23 | const propsToTrim = [
24 | ...defaultProgressPropsToTrim,
25 | ...indicatorPropsToTrim,
26 | ...trackPropsToTrim,
27 | ];
28 | return (
29 |
30 | {children}
31 |
32 | );
33 | };
34 |
35 | CircleComponent.propTypes = {
36 | children: PropTypes.any,
37 | indicatorPropsToTrim: PropTypes.arrayOf(PropTypes.string),
38 | trackPropsToTrim: PropTypes.arrayOf(PropTypes.string),
39 | };
40 |
41 | CircleComponent.defaultProps = {
42 | children: null,
43 | indicatorPropsToTrim: [],
44 | trackPropsToTrim: [],
45 | };
46 |
--------------------------------------------------------------------------------
/src/elements/Progress/LinearProgress/component.js:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import PropTypes from 'prop-types';
4 | import { Box } from 'src/elements/grid';
5 | import { removeSomeProps } from 'src/utils/componentHelpers';
6 | import { defaultProgressPropsToTrim } from '../utils';
7 |
8 | export const TrackComponent = ({ children, ...props }) => (
9 |
10 | {children}
11 |
12 | );
13 |
14 | TrackComponent.propTypes = {
15 | children: PropTypes.any,
16 | };
17 |
18 | TrackComponent.defaultProps = {
19 | children: null,
20 | };
21 |
22 | export const LineComponent = ({ children, ...props }) => {
23 | const { indicatorPropsToTrim, trackPropsToTrim } = props;
24 | const propsToTrim = [
25 | ...defaultProgressPropsToTrim,
26 | ...indicatorPropsToTrim,
27 | ...trackPropsToTrim,
28 | ];
29 | return (
30 |
31 | {children}
32 |
33 | );
34 | };
35 |
36 | LineComponent.propTypes = {
37 | children: PropTypes.any,
38 | indicatorPropsToTrim: PropTypes.arrayOf(PropTypes.string),
39 | trackPropsToTrim: PropTypes.arrayOf(PropTypes.string),
40 | };
41 |
42 | LineComponent.defaultProps = {
43 | children: null,
44 | indicatorPropsToTrim: [],
45 | trackPropsToTrim: [],
46 | };
47 |
--------------------------------------------------------------------------------
/src/elements/Progress/getProgress.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Progress } from 'src/elements/Progress';
4 |
5 | export const getProgressDefaultProps = {
6 | progress: null,
7 | progressPlacement: 'top',
8 | progressProps: {},
9 | showProgress: false,
10 | };
11 |
12 | export const getProgressPropTypes = {
13 | progress: PropTypes.any,
14 | progressPlacement: PropTypes.oneOf([
15 | 'bottom',
16 | 'left',
17 | 'right',
18 | 'top',
19 | ]),
20 | progressProps: PropTypes.object,
21 | showProgress: PropTypes.bool,
22 | };
23 |
24 | export const getProgress = options => {
25 | const {
26 | progress,
27 | progressProps,
28 | showProgress,
29 | } = options;
30 | if (React.isValidElement(progress)) {
31 | return progress;
32 | }
33 | return (
34 |
38 | );
39 | };
40 |
--------------------------------------------------------------------------------
/src/elements/Progress/index.js:
--------------------------------------------------------------------------------
1 | export * from './getProgress';
2 | export * from './styled';
3 |
--------------------------------------------------------------------------------
/src/elements/Progress/tests/getProgress.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import '@testing-library/jest-dom';
3 | import 'jest-styled-components';
4 | import {
5 | getProgress,
6 | Progress,
7 | } from 'src/elements/Progress';
8 |
9 | describe('Util Test - getProgress', () => {
10 | const linearProgress = (
11 |
17 | );
18 | const options = {
19 | progress: linearProgress,
20 | progressPlacement: 'top',
21 | progressProps: {},
22 | showProgress: true,
23 | };
24 | it('should return the provided progress when given as a valid element', () => {
25 | const actual = getProgress(options);
26 | expect(actual).toEqual(options.progress);
27 | });
28 | it('should return the built-in progress when progress is not a valid element', () => {
29 | const actual = getProgress({ ...options, progress: null });
30 | expect(actual).not.toEqual(options.progress);
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/src/elements/Progress/utils/index.js:
--------------------------------------------------------------------------------
1 | export * from './keyframes';
2 | export * from './props';
3 | export * from './styledHelpers';
4 |
--------------------------------------------------------------------------------
/src/elements/Progress/utils/keyframes.js:
--------------------------------------------------------------------------------
1 | import { css, keyframes } from 'styled-components';
2 |
3 | const determinateKeyframesBase = keyframes`
4 | 0% {
5 | transform: translate(-100%, 0);
6 | }
7 | 100% {
8 | transform: translate(0, 0);
9 | }
10 | `;
11 |
12 | export const determinateKeyframes = () => css`
13 | ${determinateKeyframesBase}
14 | `;
15 |
16 | const indeterminateKeyframesBase = keyframes`
17 | 0% {
18 | transform: translate(-100%, 0);
19 | }
20 | 50% {
21 | transform: translate(60%, 0);
22 | }
23 | 65% {
24 | transform: translate(100%, 0);
25 | }
26 | 65.1% {
27 | transform: translate(-100%, 100%);
28 | }
29 | 65.2% {
30 | transform: translate(-100%, 0);
31 | }
32 | 100% {
33 | transform: translate(100%, 0);
34 | }
35 | `;
36 |
37 | export const indeterminateKeyframes = () => css`
38 | ${indeterminateKeyframesBase}
39 | `;
40 |
--------------------------------------------------------------------------------
/src/elements/Progress/utils/styledHelpers.js:
--------------------------------------------------------------------------------
1 | import { css } from 'styled-components';
2 | import { system } from 'styled-system';
3 | import { resolveColor } from 'src/utils/styledHelpers';
4 | import { getGlobalOverrides } from 'src/global-styles';
5 |
6 | export const getAnimationIterationCount = props => {
7 | const {
8 | animationIterationCount,
9 | loop,
10 | } = props;
11 | if (animationIterationCount) {
12 | return animationIterationCount;
13 | }
14 | if (loop) {
15 | return 'infinite';
16 | }
17 | return 1;
18 | };
19 |
20 | export const makeColorResolver = (styleName, propName) => props => ({
21 | [styleName]: resolveColor(props[propName], getGlobalOverrides(props)),
22 | });
23 |
24 | export const styledSystemAnimation = css`
25 | ${system({ animationDuration: true })}
26 | ${system({ animationTimingFunction: true })}
27 | ${system({ animationDelay: true })}
28 | ${system({ animationIterationCount: true })}
29 | ${system({ animationDirection: true })}
30 | ${system({ animationFillMode: true })}
31 | ${system({ animationPlayState: true })}
32 | ${system({ animation: true })}
33 | `;
34 |
--------------------------------------------------------------------------------
/src/elements/Table/examples/examples.md:
--------------------------------------------------------------------------------
1 | ## [`Pagination`](#/Table/Examples/Pagination)
2 |
3 | Example on controlled pagination.
4 | ***
5 |
6 | ## [`Manual Pagination`](#/Table/Examples/Manual%20Pagination)
7 |
8 | Example on manual pagination.
9 | ***
10 |
11 | ## [`Expandable Rows`](#/Table/Examples/Expandable%20Rows)
12 |
13 | Example on expandable rows.
14 | ***
15 |
16 | ## [`Table Striped`](#/Table/Examples/Table%20Striped)
17 |
18 | Example on striped table.
19 | ***
20 |
21 | ## [`Hide Components`](#/Table/Examples/Hide%20Components)
22 |
23 | Examples on hideable components.
24 | ***
25 |
26 | ## [`Loading State`](#/Table/Examples/Loading%20State)
27 |
28 | How to use the progress component in Table.
29 | ***
30 |
--------------------------------------------------------------------------------
/src/elements/Table/examples/utils/index.js:
--------------------------------------------------------------------------------
1 | export * from './data';
2 | export * from './sortHelpers';
3 |
--------------------------------------------------------------------------------
/src/elements/Table/examples/utils/sortHelpers.js:
--------------------------------------------------------------------------------
1 |
2 | export const makeSanitizeString = (isCaseSensitive = false) => a => (isCaseSensitive ? String(a) : String(a).toLowerCase());
3 | export const makeSanitizeNumber = () => a => Number(a);
4 |
5 | const sanitizeItem = (sanitizer, a, propName) => sanitizer(propName ? a[propName] : a);
6 |
7 | export const sortComparison = (sanitizer, isDescending = false, propName = '') => (a, b) => {
8 | const aValue = sanitizeItem(sanitizer, a, propName);
9 | const bValue = sanitizeItem(sanitizer, b, propName);
10 | let result = 0;
11 | if (aValue > bValue) {
12 | result = 1;
13 | }
14 | if (aValue < bValue) {
15 | result = -1;
16 | }
17 | return isDescending ? result * -1 : result;
18 | };
19 |
20 | export const sortAsString = (isDescending = false, propName = '', isCaseSensitive = false) => sortComparison(makeSanitizeString(isCaseSensitive), isDescending, propName);
21 |
22 | export const sortAsNumber = (isDescending = false, propName = '') => sortComparison(makeSanitizeNumber(), isDescending, propName);
23 |
--------------------------------------------------------------------------------
/src/elements/Table/index.js:
--------------------------------------------------------------------------------
1 | export * from './styled';
2 |
--------------------------------------------------------------------------------
/src/elements/Table/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 | import { flexbox } from 'styled-system';
3 | import { withHideable } from 'src/elements/utils/Hideable';
4 | import { TableComponent } from './component';
5 | import { defaultTableStylesBase } from './utils';
6 |
7 | const Table = styled(withHideable(TableComponent))`
8 | ${defaultTableStylesBase}
9 | ${flexbox}
10 | `;
11 |
12 | /** @component */
13 | export { Table };
14 |
--------------------------------------------------------------------------------
/src/elements/Table/tests/utils/columns.js:
--------------------------------------------------------------------------------
1 | export const columns = [
2 | {
3 | columns: [
4 | {
5 | accessor: 'firstName',
6 | Header: 'First Name',
7 | title: 'test-first-name-column',
8 | },
9 | {
10 | accessor: 'lastName',
11 | Header: 'Last Name',
12 | title: 'test-last-name-column',
13 | },
14 | ],
15 | Header: 'Name',
16 | title: 'test-name-column',
17 | },
18 | {
19 | columns: [
20 | {
21 | accessor: 'age',
22 | Header: 'Age',
23 | title: 'test-age-column',
24 | },
25 | ],
26 | Header: 'Info',
27 | title: 'test-info-column',
28 | },
29 | ];
30 |
--------------------------------------------------------------------------------
/src/elements/Table/tests/utils/index.js:
--------------------------------------------------------------------------------
1 | export * from './columns';
2 | export * from './testData';
3 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/constants.js:
--------------------------------------------------------------------------------
1 | export const defaultPageOptions = [10, 15, 25, 30, 50];
2 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/index.js:
--------------------------------------------------------------------------------
1 | export * from './constants';
2 | export * from './cssDefaults';
3 | export * from './props';
4 | export * from './styled';
5 | export * from './viewState';
6 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/props.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import propTypes from '@styled-system/prop-types';
3 | import { typography } from 'src/utils/styledHelpers';
4 |
5 | export const defaultTableStylesPropsToTrim = [
6 | ...Object.keys(propTypes.border),
7 | ...Object.keys(propTypes.layout),
8 | ...Object.keys(propTypes.space),
9 | ];
10 |
11 | const defaultTableStylesBasePropTypes = {
12 | ...propTypes.border,
13 | ...propTypes.layout,
14 | ...propTypes.space,
15 | };
16 |
17 | export const defaultTableStripedPropTypes = {
18 | even: PropTypes.shape({
19 | bg: PropTypes.string,
20 | }),
21 | odd: PropTypes.shape({
22 | bg: PropTypes.string,
23 | }),
24 | };
25 |
26 | export const tablePropTypes = {
27 | ...typography.propTypes,
28 | ...defaultTableStylesBasePropTypes,
29 | };
30 |
31 | export const tableBodyPropTypes = {};
32 |
33 | export const tableCellPropTypes = {
34 | ...defaultTableStylesBasePropTypes,
35 | ...propTypes.fontWeight,
36 | };
37 |
38 | export const tableHeadPropTypes = {
39 | ...defaultTableStylesBasePropTypes,
40 | ...propTypes.fontWeight,
41 | };
42 |
43 | export const tableHeaderPropTypes = {
44 | ...defaultTableStylesBasePropTypes,
45 | };
46 |
47 | export const tableResponsiveWrapperPropTypes = {};
48 |
49 | export const tableRowPropTypes = {
50 | ...defaultTableStylesBasePropTypes,
51 | };
52 |
53 | export const tableWrapperPropTypes = {
54 | ...typography.propTypes,
55 | ...propTypes.border,
56 | };
57 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/styled/StyledTable/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import styled from 'styled-components';
4 | import { removeSomeProps } from 'src/utils/componentHelpers';
5 | import {
6 | defaultTableProps,
7 | defaultTableStylesBase,
8 | defaultTableStylesPropsToTrim,
9 | tablePropTypes,
10 | } from '../..';
11 |
12 | function StyledTableComponent(props) {
13 | const { children, ...otherProps } = props;
14 | return (
15 |
18 | );
19 | }
20 |
21 | StyledTableComponent.propTypes = {
22 | children: PropTypes.node,
23 | };
24 |
25 | StyledTableComponent.defaultProps = {
26 | children: '',
27 | };
28 |
29 | const StyledTable = styled(StyledTableComponent)`
30 | border-spacing: 0;
31 | ${defaultTableStylesBase}
32 | `;
33 |
34 | StyledTable.propTypes = {
35 | ...tablePropTypes,
36 | };
37 |
38 | StyledTable.defaultProps = {
39 | ...defaultTableProps,
40 | };
41 |
42 | export { StyledTable };
43 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/styled/StyledTableHeader/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import styled from 'styled-components';
4 | import { removeSomeProps } from 'src/utils/componentHelpers';
5 | import {
6 | defaultTableHeaderProps,
7 | defaultTableStylesBase,
8 | defaultTableStylesPropsToTrim,
9 | tableHeaderPropTypes,
10 | } from '../..';
11 |
12 | function StyledTableHeaderComponent(props) {
13 | const { children, ...otherProps } = props;
14 | return {children};
15 | }
16 |
17 | StyledTableHeaderComponent.propTypes = {
18 | children: PropTypes.node,
19 | };
20 |
21 | StyledTableHeaderComponent.defaultProps = {
22 | children: '',
23 | };
24 |
25 | const StyledTableHeader = styled(StyledTableHeaderComponent)(defaultTableStylesBase);
26 |
27 | StyledTableHeader.propTypes = {
28 | ...tableHeaderPropTypes,
29 | };
30 |
31 | StyledTableHeader.defaultProps = {
32 | ...defaultTableHeaderProps,
33 | };
34 |
35 | export { StyledTableHeader };
36 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/styled/StyledTableResponsiveWrapper/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import styled from 'styled-components';
4 | import { removeSomeProps } from 'src/utils/componentHelpers';
5 | import { Box } from 'src/elements/grid';
6 | import {
7 | defaultTableResponsiveWrapperProps,
8 | defaultTableStylesBase,
9 | defaultTableStylesPropsToTrim,
10 | tableResponsiveWrapperPropTypes,
11 | } from '../..';
12 |
13 | function StyledTableResponsiveWrapperComponent(props) {
14 | const { children, ...otherProps } = props;
15 | return {children};
16 | }
17 |
18 | StyledTableResponsiveWrapperComponent.propTypes = {
19 | children: PropTypes.node,
20 | };
21 |
22 | StyledTableResponsiveWrapperComponent.defaultProps = {
23 | children: '',
24 | };
25 |
26 | const StyledTableResponsiveWrapper = styled(StyledTableResponsiveWrapperComponent)(defaultTableStylesBase);
27 |
28 | StyledTableResponsiveWrapper.propTypes = {
29 | ...tableResponsiveWrapperPropTypes,
30 | };
31 |
32 | StyledTableResponsiveWrapper.defaultProps = {
33 | ...defaultTableResponsiveWrapperProps,
34 | };
35 |
36 | export { StyledTableResponsiveWrapper };
37 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/styled/StyledTableRow/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import styled from 'styled-components';
4 | import { removeSomeProps } from 'src/utils/componentHelpers';
5 | import {
6 | defaultTableRowProps,
7 | defaultTableStylesBase,
8 | defaultTableStylesPropsToTrim,
9 | tableRowPropTypes,
10 | } from '../..';
11 |
12 | function StyledTableRowComponent(props) {
13 | const { children, ...otherProps } = props;
14 | return {children}
;
15 | }
16 |
17 | StyledTableRowComponent.propTypes = {
18 | children: PropTypes.node,
19 | };
20 |
21 | StyledTableRowComponent.defaultProps = {
22 | children: '',
23 | };
24 |
25 | const StyledTableRow = styled(StyledTableRowComponent)(defaultTableStylesBase);
26 |
27 | StyledTableRow.propTypes = {
28 | ...tableRowPropTypes,
29 | };
30 |
31 | StyledTableRow.defaultProps = {
32 | ...defaultTableRowProps,
33 | };
34 |
35 | export { StyledTableRow };
36 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/styled/StyledTableWrapper/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import styled from 'styled-components';
4 | import { Box } from 'src/elements/grid';
5 | import {
6 | defaultTableWrapperProps,
7 | tableWrapperPropTypes,
8 | } from '../..';
9 |
10 | function StyledTableWrapperComponent(props) {
11 | const { children, ...otherProps } = props;
12 | return {children};
13 | }
14 |
15 | StyledTableWrapperComponent.propTypes = {
16 | children: PropTypes.node,
17 | };
18 |
19 | StyledTableWrapperComponent.defaultProps = {
20 | children: '',
21 | };
22 |
23 | const StyledTableWrapper = styled(StyledTableWrapperComponent)``;
24 |
25 | StyledTableWrapper.propTypes = {
26 | ...tableWrapperPropTypes,
27 | };
28 |
29 | StyledTableWrapper.defaultProps = {
30 | ...defaultTableWrapperProps,
31 | };
32 |
33 | export { StyledTableWrapper };
34 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/styled/index.js:
--------------------------------------------------------------------------------
1 | export * from './StyledTable';
2 | export * from './StyledTableBody';
3 | export * from './StyledTableCell';
4 | export * from './StyledTableHeader';
5 | export * from './StyledTableResponsiveWrapper';
6 | export * from './StyledTableRow';
7 | export * from './StyledTableWrapper';
8 |
--------------------------------------------------------------------------------
/src/elements/Table/utils/viewState.js:
--------------------------------------------------------------------------------
1 | export const getPaginationViewState = props => {
2 | const {
3 | showPagination,
4 | showPaginationBottom,
5 | showPaginationTop,
6 | } = props;
7 | return {
8 | paginationBottom: {
9 | visible: (showPagination && showPaginationBottom) || (showPagination && !showPaginationTop),
10 | },
11 | paginationTop: {
12 | visible: showPagination && showPaginationTop,
13 | },
14 | };
15 | };
16 | export const getTableViewState = props => ({
17 | ...getPaginationViewState(props),
18 | });
19 |
--------------------------------------------------------------------------------
/src/elements/Toolbar/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './styled';
3 |
--------------------------------------------------------------------------------
/src/elements/Toolbar/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 | import {
3 | background,
4 | border,
5 | color,
6 | flexbox,
7 | layout,
8 | position,
9 | shadow,
10 | space,
11 | system,
12 | } from 'styled-system';
13 | import { withHideable } from 'src/elements/utils/Hideable';
14 | import { ToolbarComponent } from './component';
15 | import { toolbarDefaultProps, toolbarPropTypes } from './utils';
16 |
17 | const Toolbar = styled(withHideable(ToolbarComponent))`
18 | ${system({ boxSizing: true })}
19 | ${background}
20 | ${border}
21 | ${color}
22 | ${flexbox}
23 | ${layout}
24 | ${position}
25 | ${shadow}
26 | ${space}
27 | `;
28 |
29 | Toolbar.propTypes = {
30 | ...toolbarPropTypes,
31 | };
32 |
33 | Toolbar.defaultProps = {
34 | ...toolbarDefaultProps,
35 | };
36 |
37 | /** @component */
38 | export { Toolbar };
39 |
--------------------------------------------------------------------------------
/src/elements/Toolbar/tests/Toolbar.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import renderer from 'react-test-renderer';
3 | import 'jest-styled-components';
4 | import { ThemeProvider } from 'styled-components';
5 | import { Toolbar } from 'src/elements/Toolbar';
6 |
7 | const emptyTheme = {};
8 |
9 | const assertReactElement = element => {
10 | const component = renderer.create(element);
11 | return component.toJSON();
12 | };
13 |
14 | describe('Box Component base', () => {
15 | it('should return an empty Toolbar with base styling', () => {
16 | const element = (
17 |
18 |
19 |
20 | );
21 | expect(assertReactElement(element)).toMatchSnapshot();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/elements/Toolbar/utils/index.js:
--------------------------------------------------------------------------------
1 | export * from './props';
2 |
--------------------------------------------------------------------------------
/src/elements/Toolbar/utils/props.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import propTypes from '@styled-system/prop-types';
3 | import { resolveBoxShadow } from 'src/utils/styledHelpers';
4 | import {
5 | getProgressDefaultProps,
6 | getProgressPropTypes,
7 | } from 'src/elements/Progress';
8 |
9 | export const toolbarPropTypes = {
10 | ...propTypes.background,
11 | ...propTypes.border,
12 | ...propTypes.color,
13 | ...propTypes.flexbox,
14 | ...propTypes.layout,
15 | ...propTypes.position,
16 | ...propTypes.shadow,
17 | ...propTypes.space,
18 | ...getProgressPropTypes,
19 | boxSizing: PropTypes.oneOfType([
20 | PropTypes.array,
21 | PropTypes.string,
22 | ]),
23 | containerComponent: PropTypes.node,
24 | /** Hides component */
25 | isHidden: PropTypes.bool,
26 | toolbarInnerProps: PropTypes.object,
27 | };
28 |
29 | export const toolbarDefaultProps = {
30 | ...getProgressDefaultProps,
31 | alignItems: 'center',
32 | boxShadow: resolveBoxShadow('01'),
33 | boxSizing: 'border-box',
34 | centerAreaProps: {
35 | flex: 1,
36 | },
37 | containerComponent: 'header',
38 | display: 'flex',
39 | flex: 'none',
40 | isHidden: false,
41 | justifyContent: 'center',
42 | minHeight: [48, 5, 64],
43 | progressPlacement: 'bottom',
44 | px: [3, null, 4],
45 | toolbarInnerProps: {
46 | display: 'flex',
47 | justifyContent: 'space-between',
48 | maxWidth: 960,
49 | width: 1,
50 | },
51 | };
52 |
--------------------------------------------------------------------------------
/src/elements/forms/CheckboxField/index.js:
--------------------------------------------------------------------------------
1 | export * from './styled';
2 |
--------------------------------------------------------------------------------
/src/elements/forms/DateField/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './constants';
3 | export * from './styled';
4 | export * from './utils';
5 |
--------------------------------------------------------------------------------
/src/elements/forms/DateField/props.js:
--------------------------------------------------------------------------------
1 | import { typography } from 'src/utils/styledHelpers';
2 |
3 | export const defaultControlColorProps = {
4 | captionColor: 'inherit',
5 | dayHoverBgColor: 'brandLinkHover',
6 | dayHoverColor: 'white.light',
7 | disabledColor: 'gray.light',
8 | menuBgColor: 'white.light',
9 | outsideColor: 'gray.dark',
10 | selectedBetweenBgColor: 'brandLink.light',
11 | selectedBetweenColor: 'black',
12 | selectedBgColor: 'brandLink',
13 | selectedColor: 'white.light',
14 | todayBorderColor: 'black',
15 | weekdayColor: 'gray.light',
16 | weekNumberBorderColor: 'gray.light',
17 | weekNumberColor: 'gray',
18 | };
19 |
20 | export const defaultDayPickerProps = {
21 | numberOfMonths: 1,
22 | weekdaysShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
23 | };
24 |
25 | export const propsToTrim = [
26 | 'assistiveText',
27 | 'color',
28 | 'controlId',
29 | 'isHidden',
30 | 'isRequired',
31 | 'plainText',
32 | ];
33 |
34 | export const styledWrapperPropsToTrim = [
35 | ...Object.keys(propsToTrim),
36 | ...Object.keys(typography.propTypes),
37 | 'disabled',
38 | 'format',
39 | 'value',
40 | ];
41 |
--------------------------------------------------------------------------------
/src/elements/forms/DateField/tests/DateField.ref.test.js:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import 'jest-styled-components';
4 | import Adapter from 'enzyme-adapter-react-16';
5 | import { configure, mount } from 'enzyme';
6 | import { ThemeProvider } from 'styled-components';
7 | import { DateField } from '..';
8 |
9 | configure({ adapter: new Adapter() });
10 | describe('When supporting a forward ref for TextField ', () => {
11 | it('should reference the underlying input element', () => {
12 | const ref = React.createRef();
13 | const register = e => { ref.current = e; };
14 | const component = mount(
15 |
16 |
21 |
22 | );
23 | expect(component.find('input').instance()).toEqual(ref.current);
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/elements/forms/DateField/utils.js:
--------------------------------------------------------------------------------
1 | import moment from 'moment';
2 | import { dayPickerClassTypes, DEFAULT_DATE_FORMAT, DEFAULT_DATE_VALUE_FORMAT } from './constants';
3 |
4 | export const dayPickerInputClassNames = dayPickerClassTypes.reduce((dayPickerClassNames, classType) => ({
5 | ...dayPickerClassNames,
6 | [classType]: `grape-ui-day-picker-${classType}`,
7 | }), {});
8 |
9 | /**
10 | * Converts the Date from react-day-picker to a string value based on the valueFormat for saving to form controls, etc.
11 | */
12 | export const formatForOnChange = (value, format, locale) => {
13 | if (value && value instanceof Date) {
14 | return moment(`${(value.getMonth() + 1)}/${value.getDate()}/${value.getFullYear()}}`, DEFAULT_DATE_FORMAT)
15 | .local()
16 | .locale(locale || 'en')
17 | .format(format || DEFAULT_DATE_VALUE_FORMAT);
18 | }
19 | return '';
20 | };
21 |
22 | /**
23 | * Converts the Date from react-day-picker to a string value based on the formate for display on the input controls, etc.
24 | * Not Used for now as we are using the default parseDate and formatDate
25 | */
26 | export const formatForSelectedDay = (value, valueFormat, format, locale) => {
27 | if (value && typeof value === 'string') {
28 | const result = moment(value, valueFormat)
29 | .local()
30 | .locale(locale || 'en')
31 | .format(format);
32 | return result === 'Invalid date' ? undefined : result;
33 | }
34 | return undefined;
35 | };
36 |
--------------------------------------------------------------------------------
/src/elements/forms/Form/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './styled';
3 |
--------------------------------------------------------------------------------
/src/elements/forms/Form/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 | import {
3 | flexbox,
4 | position,
5 | layout,
6 | space,
7 | } from 'styled-system';
8 | import PropTypes from 'prop-types';
9 | import { withHideable } from 'src/elements/utils/Hideable';
10 | import { FormComponent } from './component';
11 |
12 | const Form = styled(withHideable(FormComponent))`
13 | ${flexbox}
14 | ${position}
15 | ${layout}
16 | ${space}
17 | `;
18 |
19 | Form.propTypes = {
20 | /** Define which style of form controls should be used
21 | * @see See [Material Design/Components/Text Fields/Usage](https://material.io/components/text-fields/#usage) for more on these styles. */
22 | formStyle: PropTypes.string,
23 | /** Hides component */
24 | isHidden: PropTypes.bool,
25 | };
26 |
27 | Form.defaultProps = {
28 | display: 'flex',
29 | flexDirection: 'column',
30 | formStyle: '',
31 | isHidden: false,
32 | };
33 |
34 | /** @component */
35 | export { Form };
36 |
--------------------------------------------------------------------------------
/src/elements/forms/SelectField/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './styled';
3 |
--------------------------------------------------------------------------------
/src/elements/forms/SelectField/tests/SelectField.ref.test.js:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import 'jest-styled-components';
4 | import Adapter from 'enzyme-adapter-react-16';
5 | import { configure, mount } from 'enzyme';
6 | import { ThemeProvider } from 'styled-components';
7 | import { SelectField } from '..';
8 |
9 | configure({ adapter: new Adapter() });
10 | describe('When supporting a forward ref for SelectField ', () => {
11 | it('should reference the underlying input element', () => {
12 | const ref = React.createRef();
13 | const register = e => { ref.current = e; };
14 | const component = mount(
15 |
16 |
21 |
22 | );
23 | const instance = component.find('input').at(0).getDOMNode();
24 | expect(instance).toEqual(ref.current.select.inputRef);
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/src/elements/forms/SelectField/tests/examples/index.js:
--------------------------------------------------------------------------------
1 | export const colorOptions = [
2 | { color: '#FF5630', label: 'Red', value: 'red' },
3 | { color: '#FFC400', label: 'Yellow', value: 'yellow' },
4 | { color: '#36B37E', label: 'Green', value: 'green' },
5 | ];
6 |
--------------------------------------------------------------------------------
/src/elements/forms/TextField/index.js:
--------------------------------------------------------------------------------
1 | export * from './component';
2 | export * from './styled';
3 | export * from './utils';
4 |
--------------------------------------------------------------------------------
/src/elements/forms/TextField/utils.js:
--------------------------------------------------------------------------------
1 | const cleaveMap = new Map();
2 | cleaveMap.set('phone', {
3 | delimiter: '-',
4 | phone: true,
5 | phoneRegionCode: 'US',
6 | });
7 | cleaveMap.set('currency', {
8 | numeral: true,
9 | numeralThousandsGroupStyle: 'thousand',
10 | prefix: '$',
11 | });
12 | cleaveMap.set('integer', {
13 | numeral: true,
14 | numeralDecimalScale: 0,
15 | numeralThousandsGroupStyle: 'thousand',
16 | });
17 | cleaveMap.set('numeric', {
18 | numeral: true,
19 | numeralThousandsGroupStyle: 'thousand',
20 | });
21 | cleaveMap.set('postalCode', {
22 | blocks: [5, 4],
23 | delimiter: '-',
24 | delimiterLazyShow: true,
25 | numericOnly: true,
26 | });
27 |
28 | export const isCleaveInput = props => {
29 | if (props.email || props.password) {
30 | return false;
31 | }
32 | if (props.formatterOptions) {
33 | return true;
34 | }
35 | let foundKey = false;
36 | const checkKeys = (value, key) => {
37 | if (props[key] && !foundKey) {
38 | foundKey = true;
39 | }
40 | };
41 |
42 | cleaveMap.forEach(checkKeys);
43 | return foundKey;
44 | };
45 |
46 | export const cleaveOption = props => {
47 | if (props.formatterOptions) {
48 | return props.formatterOptions;
49 | }
50 | let options = null;
51 | const setOptionWhenFound = (value, key) => {
52 | if (props[key]) {
53 | options = value;
54 | }
55 | };
56 |
57 | cleaveMap.forEach(setOptionWhenFound);
58 | return options;
59 | };
60 |
--------------------------------------------------------------------------------
/src/elements/forms/components.md:
--------------------------------------------------------------------------------
1 | ## [``](#/Forms/Components/CheckboxField)
2 |
3 | Learn about our CheckboxField component.
4 | ***
5 |
6 | ## [``](#/Forms/Components/DateField)
7 |
8 | Learn about our DateField component, which is built on react-day-picker.
9 | ***
10 |
11 | ## [`