UNPKG

@wix/design-system

Version:

@wix/design-system

24 lines 1.14 kB
import React from 'react'; import PropTypes from 'prop-types'; import { st, classes } from './Timeline.st.css.js'; import { dataHooks } from './Timeline.constants'; import TimelineItem from './TimelineItem'; function Timeline({ dataHook, items, className, gap, skin }) { return (React.createElement("ol", { className: st(classes.root, className), "data-hook": dataHook, "data-skin": skin }, items.map((item, idx) => (React.createElement(TimelineItem, { key: idx, item: item, idx: idx, dataHook: `${dataHooks.timelineListEvent}-${idx}`, gap: gap, skin: skin }))))); } Timeline.displayName = 'Timeline'; Timeline.propTypes = { dataHook: PropTypes.string, className: PropTypes.string, gap: PropTypes.string, items: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.node, labelAction: PropTypes.node, customPrefix: PropTypes.node, suffix: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), line: PropTypes.oneOf(['filled', 'dashed']), })).isRequired, skin: PropTypes.oneOf(['dark', 'standard', 'neutral']), }; export default Timeline; //# sourceMappingURL=Timeline.js.map