semantic-ui-react
Version:
The official Semantic-UI-React integration.
51 lines (39 loc) • 1.52 kB
JavaScript
import _extends from 'babel-runtime/helpers/extends';
import cx from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import { getUnhandledProps, META, useKeyOnly } from '../../lib';
import AccordionAccordion from './AccordionAccordion';
import AccordionContent from './AccordionContent';
import AccordionTitle from './AccordionTitle';
/**
* An accordion allows users to toggle the display of sections of content.
*/
function Accordion(props) {
var className = props.className,
fluid = props.fluid,
inverted = props.inverted,
styled = props.styled;
var classes = cx('ui', useKeyOnly(fluid, 'fluid'), useKeyOnly(inverted, 'inverted'), useKeyOnly(styled, 'styled'), className);
var rest = getUnhandledProps(Accordion, props);
return React.createElement(AccordionAccordion, _extends({}, rest, { className: classes }));
}
Accordion.handledProps = ['className', 'fluid', 'inverted', 'styled'];
Accordion._meta = {
name: 'Accordion',
type: META.TYPES.MODULE
};
Accordion.propTypes = process.env.NODE_ENV !== "production" ? {
/** Additional classes. */
className: PropTypes.string,
/** Format to take up the width of its container. */
fluid: PropTypes.bool,
/** Format for dark backgrounds. */
inverted: PropTypes.bool,
/** Adds some basic styling to accordion panels. */
styled: PropTypes.bool
} : {};
Accordion.Accordion = AccordionAccordion;
Accordion.Content = AccordionContent;
Accordion.Title = AccordionTitle;
export default Accordion;