Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { spacing, position, layout, dimensions } from 'ui-box'
import { Pane } from '../../layers'
import { Text } from '../../typography'
import Radio from './Radio'
let radioCount = 1 // Used for generating unique input names
export default class RadioGroup extends PureComponent {
static propTypes = {
/**
* Composes some Box APIs.
*/
...spacing.propTypes,
...position.propTypes,
...layout.propTypes,
...dimensions.propTypes,
/**
* The options for the radios of the Radio Group.
*/
options: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.node.isRequired,
value: PropTypes.string.isRequired,
isDisabled: PropTypes.bool
})
).isRequired,
/**
* The selected item value when controlled.
*/
value: PropTypes.string,
import PropTypes from 'prop-types'
import Box, { spacing, position, layout, dimensions } from 'ui-box'
import safeInvoke from '../../lib/safe-invoke'
import SegmentedControlRadio from './SegmentedControlRadio'
let radioCount = 1 // Used for generating unique input names
export default class SegmentedControl extends PureComponent {
static propTypes = {
/**
* Composes some Box APIs.
*/
...spacing.propTypes,
...position.propTypes,
...layout.propTypes,
...dimensions.propTypes,
/**
* The options for the radios of the Segmented Control.
*/
options: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.node.isRequired,
value: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
PropTypes.bool
]).isRequired
})
).isRequired,
/**
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import cx from 'classnames'
import { dimensions, spacing, position, layout } from 'ui-box'
import { Text } from '../../typography'
import { Icon } from '../../icon'
import { Spinner } from '../../spinner'
import { withTheme } from '../../theme'
class Button extends PureComponent {
static propTypes = {
/**
* Composes the dimensions spec from the Box primitivie.
*/
...dimensions.propTypes,
/**
* Composes the spacing spec from the Box primitivie.
*/
...spacing.propTypes,
/**
* Composes the position spec from the Box primitivie.
*/
...position.propTypes,
/**
* Composes the layout spec from the Box primitivie.
*/
...layout.propTypes,
/**
* An optional hint under the input element.
*/
hint: PropTypes.node,
/**
* If a validation message is passed it is shown under the input element
* and above the hint. This is unaffected by `isInvalid`.
*/
validationMessage: PropTypes.node,
/**
* Composes the dimensions spec from the Box primitive.
*/
...dimensions.propTypes,
/**
* Composes the spacing spec from the Box primitive.
*/
...spacing.propTypes,
/**
* Composes the position spec from the Box primitive.
*/
...position.propTypes,
/**
* Composes the layout spec from the Box primitive.
*/
...layout.propTypes
}
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { dimensions, spacing, position, layout } from 'ui-box'
import { Icon } from '../../icon'
import { withTheme } from '../../theme'
import Button from './Button'
class IconButton extends PureComponent {
static propTypes = {
/**
* Composes the dimensions spec from the Box primitivie.
*/
...dimensions.propTypes,
/**
* Composes the spacing spec from the Box primitivie.
*/
...spacing.propTypes,
/**
* Composes the position spec from the Box primitivie.
*/
...position.propTypes,
/**
* Composes the layout spec from the Box primitivie.
*/
...layout.propTypes,
)
MinusIcon.propTypes = {
fill: PropTypes.string
}
class Checkbox extends PureComponent {
static propTypes = {
/**
* Composes some Box APIs.
*/
...spacing.propTypes,
...position.propTypes,
...layout.propTypes,
...dimensions.propTypes,
/**
* The id attribute of the checkbox.
*/
id: PropTypes.string,
/**
* The id attribute of the checkbox.
*/
name: PropTypes.string,
/**
* Label of the checkbox.
*/
label: PropTypes.node,
import PropTypes from 'prop-types'
import { spacing, dimensions, position, layout } from 'ui-box'
import { withTheme } from '../../theme'
import { Pane } from '../../layers'
import { Text } from '../../typography'
import { Icon } from '../../icon'
class InlineAlert extends PureComponent {
static propTypes = {
/**
* Composes some Box APIs.
*/
...spacing.propTypes,
...position.propTypes,
...layout.propTypes,
...dimensions.propTypes,
/**
* The content of the alert.
*/
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
/**
* The intent of the alert. This should always be set explicitly.
*/
intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger'])
.isRequired,
/**
* When true, show a icon on the left matching the type.
* There is no point not showing this.
*/
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Box, { dimensions, spacing, position, layout } from 'ui-box'
import { Text } from '../../typography'
import { Icon } from '../../icon'
import { withTheme } from '../../theme'
class Select extends PureComponent {
static propTypes = {
/**
* Composes the dimensions spec from the Box primitivie.
*/
...dimensions.propTypes,
/**
* Composes the spacing spec from the Box primitivie.
*/
...spacing.propTypes,
/**
* Composes the position spec from the Box primitivie.
*/
...position.propTypes,
/**
* Composes the layout spec from the Box primitivie.
*/
...layout.propTypes,
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { dimensions, spacing, position, layout } from 'ui-box'
import { Text } from '../../typography'
import { Icon } from '../../icon'
import { Spinner } from '../../spinner'
import { withTheme } from '../../theme'
class TextDropdownButton extends PureComponent {
static propTypes = {
/**
* Composes the dimensions spec from the Box primitivie.
*/
...dimensions.propTypes,
/**
* Composes the spacing spec from the Box primitivie.
*/
...spacing.propTypes,
/**
* Composes the position spec from the Box primitivie.
*/
...position.propTypes,
/**
* Composes the layout spec from the Box primitivie.
*/
...layout.propTypes,
)
CircleIcon.propTypes = {
fill: PropTypes.string,
size: PropTypes.number
}
class Radio extends PureComponent {
static propTypes = {
/**
* Composes some Box APIs.
*/
...spacing.propTypes,
...position.propTypes,
...layout.propTypes,
...dimensions.propTypes,
/**
* The id attribute of the radio.
*/
id: PropTypes.string,
/**
* The name attribute of the radio.
*/
name: PropTypes.string,
/**
* Label of the radio.
*/
label: PropTypes.node,