UNPKG

suomifi-ui-components

Version:
83 lines (80 loc) 3.26 kB
import { __extends, __rest, __assign, __makeTemplateObject } from 'tslib'; import React, { Component } from 'react'; import { styled } from 'styled-components'; import classnames from 'classnames'; import { SuomifiThemeConsumer } from '../../theme/SuomifiThemeProvider/SuomifiThemeProvider.js'; import '../../theme/SuomifiTheme/SuomifiTheme.js'; import '../../theme/SpacingProvider/SpacingProvider.js'; import '../../../reset/HtmlA/HtmlA.js'; import '../../../reset/HtmlButton/HtmlButton.js'; import { HtmlDiv } from '../../../reset/HtmlDiv/HtmlDiv.js'; import '../../../reset/HtmlFieldSet/HtmlFieldSet.js'; import '../../../reset/HtmlH/HtmlH.js'; import '../../../reset/HtmlInput/HtmlInput.js'; import '../../../reset/HtmlLabel/HtmlLabel.js'; import '../../../reset/HtmlLegend/HtmlLegend.js'; import '../../../reset/HtmlLi/HtmlLi.js'; import '../../../reset/HtmlNav/HtmlNav.js'; import '../../../reset/HtmlOl/HtmlOl.js'; import '../../../reset/HtmlSpan/HtmlSpan.js'; import '../../../reset/HtmlTextarea/HtmlTextarea.js'; import '../../../reset/HtmlUl/HtmlUl.js'; import '../../../reset/HtmlTable/HtmlTable.js'; import '../../../reset/HtmlTable/HtmlTableCaption.js'; import '../../../reset/HtmlTable/HtmlTableHeader.js'; import '../../../reset/HtmlTable/HtmlTableRow.js'; import '../../../reset/HtmlTable/HtmlTableBody.js'; import '../../../reset/HtmlTable/HtmlTableHeaderCell.js'; import '../../../reset/HtmlTable/HtmlTableCell.js'; import { AutoId } from '../../utils/AutoId/AutoId.js'; import { baseStyles } from './ChipList.baseStyles.js'; var baseClassName = 'fi-chip-list'; var chipListClassNames = { content_wrapper: "".concat(baseClassName, "_content_wrapper") }; var BaseChipList = function (_super) { __extends(BaseChipList, _super); function BaseChipList() { return _super !== null && _super.apply(this, arguments) || this; } BaseChipList.prototype.render = function () { var _a = this.props, className = _a.className; _a.theme; var children = _a.children, id = _a.id, passProps = __rest(_a, ["className", "theme", "children", "id"]); return /*#__PURE__*/React.createElement(HtmlDiv, { className: classnames(baseClassName, className, {}), id: id }, /*#__PURE__*/React.createElement(HtmlDiv, __assign({ className: chipListClassNames.content_wrapper }, passProps), children)); }; return BaseChipList; }(Component); var StyledChipList = styled(BaseChipList).withConfig({ componentId: "sc-139mv72-0" })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) { var theme = _a.theme; return baseStyles(theme); }); var ChipList = function ChipList(props) { var propId = props.id, passProps = __rest(props, ["id"]); return /*#__PURE__*/React.createElement(SuomifiThemeConsumer, null, function (_a) { var suomifiTheme = _a.suomifiTheme; return /*#__PURE__*/React.createElement(AutoId, { id: propId }, function (id) { return /*#__PURE__*/React.createElement(StyledChipList, __assign({ theme: suomifiTheme, id: id }, passProps)); }); }); }; ChipList.displayName = 'ChipList'; var templateObject_1; export { ChipList }; //# sourceMappingURL=ChipList.js.map