Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

callout

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
96
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
2 years ago
SIZE
39 KB
Callouts combine panels and alerts from Foundation 5 into one generic container component.
Install callout as a package?
Copied
npm i @bit/digiaonline.react-foundation.callout
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
components/callout.js
32 Lines(21 sloc)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react';
import PropTypes from 'prop-types';
import { CalloutColors, CalloutSizes } from '../enums';
import { GeneralPropTypes, FlexboxPropTypes, createClassName, generalClassNames, removeProps, objectKeys, objectValues } from '../utils';

/**
 * Callout component.
 * http://foundation.zurb.com/sites/docs/callout.html
 *
 * @param {Object} props
 * @returns {Object}
 */
export const Callout = props => {
  const className = createClassName(
    props.noDefaultClassName ? null : 'callout',
    props.className,
    props.color,
    props.size,
    generalClassNames(props)
  );

  const passProps = removeProps(props, objectKeys(Callout.propTypes));

  return <div {...passProps} className={className}/>;
};

Callout.propTypes = {
  ...GeneralPropTypes,
  ...FlexboxPropTypes,
  color: PropTypes.oneOf(objectValues(CalloutColors)),
  size: PropTypes.oneOf(objectValues(CalloutSizes))
};