UNPKG

@zendeskgarden/react-dropdowns

Version:

Components related to dropdowns in the Garden Design System

1,383 lines (1,330 loc) 70.6 kB
/** * Copyright Zendesk, Inc. * * Use of this source code is governed under the Apache License, Version 2.0 * found at http://www.apache.org/licenses/LICENSE-2.0. */ 'use strict'; var React = require('react'); var PropTypes = require('prop-types'); var styled = require('styled-components'); var containerCombobox = require('@zendeskgarden/container-combobox'); var reactTheming = require('@zendeskgarden/react-theming'); var reactForms = require('@zendeskgarden/react-forms'); var polished = require('polished'); var reactTags = require('@zendeskgarden/react-tags'); var reactDom$1 = require('react-dom'); var reactDom = require('@floating-ui/react-dom'); var containerUtilities = require('@zendeskgarden/container-utilities'); var reactTooltips = require('@zendeskgarden/react-tooltips'); var reactMergeRefs = require('react-merge-refs'); var containerMenu = require('@zendeskgarden/container-menu'); var reactButtons = require('@zendeskgarden/react-buttons'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var React__namespace = /*#__PURE__*/_interopNamespace(React); var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes); var styled__default = /*#__PURE__*/_interopDefault(styled); var _path$4; function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); } var SvgChevronDownStroke = function SvgChevronDownStroke(props) { return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({ xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, focusable: "false", viewBox: "0 0 16 16", "aria-hidden": "true" }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", { fill: "currentColor", d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z" }))); }; const ComboboxContext = React.createContext(undefined); const useComboboxContext = () => { const context = React.useContext(ComboboxContext); if (!context) { throw new Error('Error: this component must be rendered within a <Combobox>.'); } return context; }; const FieldContext = React.createContext(undefined); const useFieldContext = () => { const context = React.useContext(FieldContext); if (!context) { throw new Error('Error: this component must be rendered within a <Field>.'); } return context; }; const COMPONENT_ID$v = 'dropdowns.combobox.label'; const StyledLabel = styled__default.default(reactForms.Field.Label).attrs({ 'data-garden-id': COMPONENT_ID$v, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledLabel", componentId: "sc-az6now-0" })(["vertical-align:revert;", ";"], reactTheming.componentStyles); const COMPONENT_ID$u = 'dropdowns.combobox.hint'; const StyledHint = styled__default.default(reactForms.Field.Hint).attrs({ 'data-garden-id': COMPONENT_ID$u, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledHint", componentId: "sc-106qvqx-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$t = 'dropdowns.combobox.message'; const StyledMessage = styled__default.default(reactForms.Field.Message).attrs({ 'data-garden-id': COMPONENT_ID$t, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledMessage", componentId: "sc-jux8m5-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$s = 'dropdowns.combobox'; const sizeStyles$b = props => { const minWidth = `${props.$isCompact ? 100 : 144}px`; const marginTop = `${props.theme.space.base * (props.$isCompact ? 1 : 2)}px`; return styled.css(["min-width:", ";", ":not([hidden]) + &&,", " + &&,", " + &&,&& + ", ",&& + ", "{margin-top:", ";}"], minWidth, StyledLabel, StyledHint, StyledMessage, StyledHint, StyledMessage, marginTop); }; const StyledCombobox = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$s, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledCombobox", componentId: "sc-13eybg8-0" })(["", ";", ";"], sizeStyles$b, reactTheming.componentStyles); const COMPONENT_ID$r = 'dropdowns.combobox.container'; const StyledContainer = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$r, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledContainer", componentId: "sc-14i9jid-0" })(["display:flex;", ";"], reactTheming.componentStyles); const COMPONENT_ID$q = 'dropdowns.combobox.field'; const StyledField = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$q, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledField", componentId: "sc-zc57xl-0" })(["direction:", ";text-align:start;", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', reactTheming.componentStyles); const COMPONENT_ID$p = 'dropdowns.combobox.floating'; const StyledFloatingListbox = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$p, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledFloatingListbox", componentId: "sc-1cp6spf-0" })(["top:0;left:0;", ";", ";"], props => reactTheming.menuStyles(props.$position, { theme: props.theme, hidden: props.$isHidden, animationModifier: '[data-garden-animate="true"]', zIndex: props.$zIndex }), reactTheming.componentStyles); const COMPONENT_ID$o = 'dropdowns.combobox.input'; const colorStyles$a = _ref => { let { theme } = _ref; const placeholderColor = reactTheming.getColor({ theme, variable: 'foreground.disabled' }); return styled.css(["background-color:inherit;color:inherit;&::placeholder{opacity:1;color:", ";}"], placeholderColor); }; const getHeight = props => { if (props.$isBare && !props.$isMultiselectable) { return props.theme.space.base * 5; } return props.theme.space.base * (props.$isCompact ? 5 : 8); }; const sizeStyles$a = props => { const height = props.theme.space.base * 5; const fontSize = props.theme.fontSizes.md; const lineHeight = reactTheming.getLineHeight(height, fontSize); const margin = polished.math(`${props.theme.shadowWidths.sm} + ${(getHeight(props) - height) / 2}`); const minWidth = `${props.theme.space.base * 8}px`; return styled.css(["min-width:", ";height:", "px;line-height:", ";font-size:", ";&&{margin-top:", ";margin-bottom:", ";}"], minWidth, height, lineHeight, fontSize, margin, margin); }; const StyledInput = styled__default.default.input.attrs({ 'data-garden-id': COMPONENT_ID$o, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledInput", componentId: "sc-1lkqdg-0" })(["flex-basis:0;flex-grow:1;border:none;padding:0;font-family:inherit;&:focus{outline:none;}", ";", ";&[hidden]{display:revert;", "}&[aria-hidden='true']{display:none;}", ";"], sizeStyles$a, colorStyles$a, props => props.$isEditable && polished.hideVisually(), reactTheming.componentStyles); const COMPONENT_ID$n = 'dropdowns.combobox.input_group'; const sizeStyles$9 = props => { const margin = props.theme.shadowWidths.sm; return styled.css(["margin:-", ";min-width:0;& > *{margin:", ";}"], margin, margin); }; const StyledInputGroup = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$n, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledInputGroup", componentId: "sc-yx3q7u-0" })(["display:flex;flex-grow:1;flex-wrap:wrap;", ";", ";"], sizeStyles$9, reactTheming.componentStyles); const COMPONENT_ID$m = 'dropdowns.combobox.trigger'; const colorStyles$9 = _ref => { let { theme, $validation, $isBare, $isLabelHovered, $focusInset } = _ref; const foregroundColor = reactTheming.getColor({ theme, variable: 'foreground.default' }); const backgroundColor = $isBare ? 'transparent' : reactTheming.getColor({ theme, variable: 'background.default' }); let borderColor; let borderVariable; let hoverBorderColor; let focusBorderColor; if ($validation) { if ($validation === 'success') { borderVariable = 'border.successEmphasis'; } else if ($validation === 'warning') { borderVariable = 'border.warningEmphasis'; } else if ($validation === 'error') { borderVariable = 'border.dangerEmphasis'; } borderColor = reactTheming.getColor({ theme, variable: borderVariable }); hoverBorderColor = borderColor; focusBorderColor = borderColor; } else { borderColor = reactTheming.getColor({ theme, variable: 'border.default', dark: { offset: -100 }, light: { offset: 100 } }); borderVariable = 'border.primaryEmphasis'; hoverBorderColor = reactTheming.getColor({ theme, variable: borderVariable }); focusBorderColor = hoverBorderColor; } const disabledBackgroundColor = $isBare ? undefined : reactTheming.getColor({ theme, variable: 'background.disabled' }); const disabledBorderColor = reactTheming.getColor({ theme, variable: 'border.disabled' }); const disabledForegroundColor = reactTheming.getColor({ theme, variable: 'foreground.disabled' }); const focusSelector = ` &:focus-within:not([aria-disabled='true']), &:focus-visible `; return styled.css(["color-scheme:only ", ";border-color:", ";background-color:", ";color:", ";&:hover{border-color:", ";}", " &[aria-disabled='true']{border-color:", ";background-color:", ";color:", ";}"], theme.colors.base, $isLabelHovered ? hoverBorderColor : borderColor, backgroundColor, foregroundColor, hoverBorderColor, reactTheming.focusStyles({ theme, inset: $focusInset, color: { variable: borderVariable }, selector: focusSelector, styles: { borderColor: focusBorderColor }, condition: !$isBare }), disabledBorderColor, disabledBackgroundColor, disabledForegroundColor); }; const sizeStyles$8 = props => { const inputHeight = getHeight(props); let minHeight; let horizontalPadding; if (props.$isBare) { if (props.$isMultiselectable) { minHeight = polished.math(`${props.theme.shadowWidths.sm} * 2 + ${inputHeight}`); horizontalPadding = props.theme.shadowWidths.sm; } else { minHeight = `${inputHeight}px`; horizontalPadding = '0'; } } else { minHeight = `${props.theme.space.base * (props.$isCompact ? 3 : 2) + inputHeight}px`; horizontalPadding = `${props.theme.space.base * 3}px`; } const $maxHeight = props.$maxHeight || minHeight; const verticalPadding = polished.math(`(${minHeight} - ${inputHeight} - (${props.$isBare ? 0 : props.theme.borderWidths.sm} * 2)) / 2`); return styled.css(["padding:", " ", ";min-height:", ";max-height:", ";font-size:", ";"], verticalPadding, horizontalPadding, minHeight, $maxHeight, props.theme.fontSizes.md); }; const StyledTrigger = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$m, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledTrigger", componentId: "sc-116nftk-0" })(["overflow-y:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;border:", ";border-radius:", ";cursor:", ";box-sizing:border-box;", ";&:focus{outline:none;}", ";&[aria-disabled='true']{cursor:default;}", ";"], props => props.$isBare && !props.$isMultiselectable ? 'visible' : 'auto', props => props.$isBare ? 'none' : props.theme.borders.sm, props => props.$isBare ? '0' : props.theme.borderRadii.md, props => !props.$isAutocomplete && props.$isEditable ? 'text' : 'pointer', sizeStyles$8, colorStyles$9, reactTheming.componentStyles); const COMPONENT_ID$l = 'dropdowns.combobox.input_icon'; const colorStyles$8 = _ref => { let { theme, $isLabelHovered } = _ref; const options = { theme, variable: 'foreground.subtle' }; const color = reactTheming.getColor(options); const focusColor = reactTheming.getColor({ ...options, dark: { offset: -100 }, light: { offset: 100 } }); const disabledColor = reactTheming.getColor({ theme, variable: 'foreground.disabled' }); return styled.css(["color:", ";", ":hover &&,", ":focus-within &&,", ":focus &&{color:", ";}", "[aria-disabled='true'] &&{color:", ";}"], $isLabelHovered ? focusColor : color, StyledTrigger, StyledTrigger, StyledTrigger, focusColor, StyledTrigger, disabledColor); }; const sizeStyles$7 = props => { const size = props.theme.iconSizes.md; const position = polished.math(`(${getHeight(props)} - ${size}) / 2`); const margin = `${props.theme.space.base * 2}px`; let side; if (props.$isEnd) { side = props.theme.rtl ? 'right' : 'left'; } else { side = props.theme.rtl ? 'left' : 'right'; } return styled.css(["top:", ";margin-", ":", ";width:", ";height:", ";"], position, side, margin, size, size); }; const StyledInputIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({ 'data-garden-id': COMPONENT_ID$l, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledInputIcon", componentId: "sc-gqbs1s-0" })(["position:sticky;flex-shrink:0;transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", ";", ";"], props => props.$isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, sizeStyles$7, colorStyles$8, reactTheming.componentStyles); const COMPONENT_ID$k = 'dropdowns.combobox.option'; const colorStyles$7 = _ref => { let { theme, $isActive, $type } = _ref; let backgroundColor; let boxShadow; if ($isActive && $type !== 'group' && $type !== 'header') { const variable = 'background.primaryEmphasis'; backgroundColor = reactTheming.getColor({ theme, variable, transparency: theme.opacity[100] }); boxShadow = `inset ${theme.rtl ? `-${theme.shadowWidths.md}` : theme.shadowWidths.md} 0 ${reactTheming.getColor({ theme, variable })}`; } let foregroundVariable; if ($type === 'add') { foregroundVariable = 'foreground.primary'; } else if ($type === 'danger') { foregroundVariable = 'foreground.danger'; } else { foregroundVariable = 'foreground.default'; } const foregroundColor = reactTheming.getColor({ theme, variable: foregroundVariable }); const disabledForegroundColor = reactTheming.getColor({ theme, variable: 'foreground.disabled' }); return styled.css(["box-shadow:", ";background-color:", ";color:", ";&[aria-disabled='true']{background-color:transparent;color:", ";}"], boxShadow, backgroundColor, foregroundColor, disabledForegroundColor); }; const getMinHeight = props => props.theme.space.base * (props.$isCompact ? 7 : 9); const sizeStyles$6 = props => { const lineHeight = props.theme.lineHeights.md; const minHeight = getMinHeight(props); const paddingHorizontal = props.$type === 'group' ? 0 : `${props.theme.space.base * 9}px`; const paddingVertical = props.$type === 'group' ? 0 : polished.math(`(${minHeight} - ${lineHeight}) / 2`); return styled.css(["box-sizing:border-box;padding:", " ", ";min-height:", "px;line-height:", ";"], paddingVertical, paddingHorizontal, minHeight, lineHeight); }; const StyledOption = styled__default.default.li.attrs({ 'data-garden-id': COMPONENT_ID$k, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledOption", componentId: "sc-jl4wn6-0" })(["display:flex;position:relative;transition:color 0.25s ease-in-out;cursor:", ";overflow-wrap:anywhere;font-weight:", ";user-select:none;&:focus{outline:none;}", ";", ";&[aria-disabled='true']{cursor:default;}&[aria-hidden='true']{", ";}", ";"], props => props.$type === 'group' || props.$type === 'header' ? 'default' : 'pointer', props => props.$type === 'header' || props.$type === 'previous' ? props.theme.fontWeights.semibold : props.theme.fontWeights.regular, sizeStyles$6, colorStyles$7, polished.hideVisually(), reactTheming.componentStyles); const COMPONENT_ID$j = 'dropdowns.combobox.option.content'; const StyledOptionContent = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$j, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledOptionContent", componentId: "sc-121ujpu-0" })(["display:flex;flex-direction:column;flex-grow:1;", ";"], reactTheming.componentStyles); const COMPONENT_ID$i = 'dropdowns.combobox.optgroup'; const StyledOptGroup = styled__default.default.ul.attrs({ 'data-garden-id': COMPONENT_ID$i, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledOptGroup", componentId: "sc-1kavqsx-0" })(["margin:0;padding:0;list-style-type:none;", ";"], reactTheming.componentStyles); const COMPONENT_ID$h = 'dropdowns.combobox.separator'; const colorStyles$6 = _ref => { let { theme } = _ref; const backgroundColor = reactTheming.getColor({ theme, variable: 'border.subtle' }); return styled.css(["background-color:", ";"], backgroundColor); }; const sizeStyles$5 = props => { const margin = `${props.theme.space.base}px`; const height = props.theme.borderWidths.sm; return styled.css(["margin:", " 0;height:", ";"], margin, height); }; const StyledListboxSeparator = styled__default.default.li.attrs({ 'data-garden-id': COMPONENT_ID$h, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledListboxSeparator", componentId: "sc-1p6toh2-0" })(["cursor:default;", ";", ";", ";"], sizeStyles$5, colorStyles$6, reactTheming.componentStyles); const COMPONENT_ID$g = 'dropdowns.combobox.listbox'; const sizeStyles$4 = props => { const padding = props.theme.space.base; const $minHeight = props.$minHeight === undefined ? `${getMinHeight(props) + padding * 2}px` : props.$minHeight; return styled.css(["min-height:", ";max-height:", ";&&&{padding-top:", "px;padding-bottom:", "px;}"], $minHeight, props.$maxHeight, padding, padding); }; const StyledListbox = styled__default.default.ul.attrs({ 'data-garden-id': COMPONENT_ID$g, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledListbox", componentId: "sc-1k13ba7-0" })(["overflow-y:auto;list-style-type:none;", ";&&&{display:block;}", ":first-child ", " ", ":first-child ", "[role='none']:first-child{display:none;}"], sizeStyles$4, StyledOption, StyledOptionContent, StyledOptGroup, StyledListboxSeparator); const COMPONENT_ID$f = 'dropdowns.combobox.option.icon'; const colorStyles$5 = _ref => { let { theme, $isDisabled, $type } = _ref; let variable; if ($isDisabled) { variable = 'foreground.disabled'; } else if ($type === 'danger') { variable = 'foreground.danger'; } else if ($type === 'add') { variable = 'foreground.primary'; } else { variable = 'foreground.subtle'; } const color = reactTheming.getColor({ theme, variable }); return styled.css(["color:", ";"], color); }; const sizeStyles$3 = props => { const size = props.theme.iconSizes.md; const marginTop = polished.math(`(${props.theme.lineHeights.md} - ${size}) / 2`); const marginHorizontal = `${props.theme.space.base * 2}px`; return styled.css(["margin-top:", ";margin-", ":", ";width:", ";height:", ";"], marginTop, props.theme.rtl ? 'left' : 'right', marginHorizontal, size, size); }; const StyledOptionIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({ 'data-garden-id': COMPONENT_ID$f, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledOptionIcon", componentId: "sc-qsab3y-0" })(["flex-shrink:0;", ";", ";", ";"], sizeStyles$3, colorStyles$5, reactTheming.componentStyles); const COMPONENT_ID$e = 'dropdowns.combobox.option.meta'; const colorStyles$4 = _ref => { let { theme, $isDisabled } = _ref; const variable = $isDisabled ? 'foreground.disabled' : 'foreground.subtle'; const color = reactTheming.getColor({ theme, variable }); return styled.css(["color:", ";"], color); }; const sizeStyles$2 = props => { const lineHeight = props.theme.lineHeights.sm; const fontSize = props.theme.fontSizes.sm; return styled.css(["line-height:", ";font-size:", ";"], lineHeight, fontSize); }; const StyledOptionMeta = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$e, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledOptionMeta", componentId: "sc-j6pu10-0" })(["transition:color 0.25s ease-in-out;font-weight:", ";", ";", ";", ";"], props => props.theme.fontWeights.regular, sizeStyles$2, colorStyles$4, reactTheming.componentStyles); const COMPONENT_ID$d = 'dropdowns.combobox.option.selection_icon'; const colorStyles$3 = _ref => { let { theme } = _ref; const color = reactTheming.getColor({ theme, variable: 'foreground.primary' }); return styled.css(["color:", ";"], color); }; const sizeStyles$1 = _ref2 => { let { theme, $isCompact } = _ref2; const size = theme.iconSizes.sm; const position = `${theme.space.base * 3.5}px`; const top = polished.math(`(${getMinHeight({ theme, $isCompact })} - ${size}) / 2`); const side = theme.rtl ? 'right' : 'left'; return styled.css(["top:", ";", ":", ";width:", ";height:", ";"], top, side, position, size, size); }; const StyledOptionSelectionIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({ 'data-garden-id': COMPONENT_ID$d, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledOptionSelectionIcon", componentId: "sc-12wj24m-0" })(["position:absolute;", ";", ";", ";"], sizeStyles$1, colorStyles$3, reactTheming.componentStyles); const COMPONENT_ID$c = 'dropdowns.combobox.option.type_icon'; const colorStyles$2 = _ref => { let { theme, $type } = _ref; const opacity = $type && $type !== 'danger' ? 1 : 0; let color; if ($type === 'add') { color = 'inherit'; } else if ($type === 'header' || $type === 'next' || $type === 'previous') { color = reactTheming.getColor({ theme, variable: 'foreground.subtle' }); } else { color = reactTheming.getColor({ theme, variable: 'foreground.primary' }); } return styled.css(["opacity:", ";color:", ";", "[aria-selected='true'] > &{opacity:1;}", "[aria-disabled='true'] > &{color:inherit;}"], opacity, color, StyledOption, StyledOption); }; const sizeStyles = props => { const size = props.theme.iconSizes.md; const position = `${props.theme.space.base * 3}px`; const top = polished.math(`(${getMinHeight(props)} - ${size}) / 2`); let side; if (props.$type === 'next') { side = props.theme.rtl ? 'left' : 'right'; } else { side = props.theme.rtl ? 'right' : 'left'; } return styled.css(["top:", ";", ":", ";width:", ";height:", ";"], top, side, position, size, size); }; const StyledOptionTypeIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({ 'data-garden-id': COMPONENT_ID$c, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledOptionTypeIcon", componentId: "sc-xpink2-0" })(["position:absolute;transform:", ";transition:opacity 0.1s ease-in-out;", ";", ";", ";"], props => props.theme.rtl && (props.$type === 'next' || props.$type === 'previous') && 'rotate(180deg)', sizeStyles, colorStyles$2, reactTheming.componentStyles); const COMPONENT_ID$b = 'dropdowns.combobox.tag'; const StyledTag = styled__default.default(reactTags.Tag).attrs({ 'data-garden-id': COMPONENT_ID$b, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledTag", componentId: "sc-1alam0r-0" })(["&[aria-disabled='true']{color:", ";}&[hidden]{display:revert;", "}", ";"], props => props.hue ? undefined : reactTheming.getColor({ theme: props.theme, variable: 'foreground.disabled' }), polished.hideVisually(), reactTheming.componentStyles); const COMPONENT_ID$a = 'dropdowns.combobox.value'; const colorStyles$1 = _ref => { let { theme, $isPlaceholder } = _ref; const foregroundColor = $isPlaceholder && reactTheming.getColor({ theme, variable: 'foreground.disabled' }); return styled.css(["color:", ";"], foregroundColor); }; const StyledValue = styled__default.default.div.attrs({ 'data-garden-id': COMPONENT_ID$a, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledValue", componentId: "sc-t719sx-0" })(["flex-basis:0;flex-grow:1;cursor:", ";overflow:hidden;text-overflow:ellipsis;white-space:pre;user-select:none;", ";", ";&[hidden]{display:none;}", ";"], props => { if (props.$isDisabled) { return 'default'; } return props.$isEditable && !props.$isAutocomplete ? 'text' : 'pointer'; }, sizeStyles$a, colorStyles$1, reactTheming.componentStyles); const COMPONENT_ID$9 = 'dropdowns.combobox.tags_button'; const colorStyles = _ref => { let { theme } = _ref; const color = reactTheming.getColor({ theme, variable: 'foreground.primary' }); return styled.css(["color:", ";&:disabled{color:inherit;}"], color); }; const StyledTagsButton = styled__default.default(StyledValue).attrs({ as: 'button', 'data-garden-id': COMPONENT_ID$9, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledTagsButton", componentId: "sc-6q5w33-0" })(["display:inline-flex;flex:0 1 auto;align-items:center;border:none;background-color:transparent;cursor:pointer;min-width:auto;font-family:inherit;&:hover{text-decoration:underline;}", ";&:disabled{cursor:default;text-decoration:none;}", ";"], colorStyles, reactTheming.componentStyles); const COMPONENT_ID$8 = 'dropdowns.menu'; const StyledMenu = styled__default.default(StyledListbox).attrs({ 'data-garden-id': COMPONENT_ID$8, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledMenu", componentId: "sc-f77ntu-0" })(["position:static !important;", ";", ";"], props => props.$arrowPosition && reactTheming.arrowStyles(props.$arrowPosition, { size: `${props.theme.space.base * 1.5}px`, inset: '1px', animationModifier: '[data-garden-animate-arrow="true"]' }), reactTheming.componentStyles); const COMPONENT_ID$7 = 'dropdowns.menu.floating'; const StyledFloatingMenu = styled__default.default(StyledFloatingListbox).attrs({ 'data-garden-id': COMPONENT_ID$7, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledFloatingMenu", componentId: "sc-1rc7ahb-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$6 = 'dropdowns.menu.item'; const StyledItem = styled__default.default(StyledOption).attrs({ 'data-garden-id': COMPONENT_ID$6, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledItem", componentId: "sc-1jp99dq-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$5 = 'dropdowns.menu.item.content'; const StyledItemContent = styled__default.default(StyledOptionContent).attrs({ 'data-garden-id': COMPONENT_ID$5, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledItemContent", componentId: "sc-1opglsb-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$4 = 'dropdowns.menu.item_group'; const StyledItemGroup = styled__default.default(StyledOptGroup).attrs({ 'data-garden-id': COMPONENT_ID$4, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledItemGroup", componentId: "sc-1umk3cg-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$3 = 'dropdowns.menu.item.icon'; const StyledItemIcon = styled__default.default(StyledOptionIcon).attrs({ 'data-garden-id': COMPONENT_ID$3, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledItemIcon", componentId: "sc-w9orqb-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$2 = 'dropdowns.menu.item.meta'; const StyledItemMeta = styled__default.default(StyledOptionMeta).attrs({ 'data-garden-id': COMPONENT_ID$2, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledItemMeta", componentId: "sc-1unw3x1-0" })(["", ";"], reactTheming.componentStyles); const COMPONENT_ID$1 = 'dropdowns.menu.item.type_icon'; const StyledItemTypeIcon = styled__default.default(StyledOptionTypeIcon).attrs({ 'data-garden-id': COMPONENT_ID$1, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledItemTypeIcon", componentId: "sc-1pll3nu-0" })(["", "[aria-checked='true'] > &{opacity:1;}", ";"], StyledItem, reactTheming.componentStyles); const COMPONENT_ID = 'dropdowns.menu.separator'; const StyledSeparator = styled__default.default(StyledListboxSeparator).attrs({ 'data-garden-id': COMPONENT_ID, 'data-garden-version': '9.5.4' }).withConfig({ displayName: "StyledSeparator", componentId: "sc-8kqwen-0" })(["", ";"], reactTheming.componentStyles); const Listbox = React.forwardRef((_ref, ref) => { let { appendToNode, children, isCompact, isExpanded, maxHeight, minHeight, onMouseDown, triggerRef, zIndex, ...props } = _ref; const floatingRef = React.useRef(null); const [isVisible, setIsVisible] = React.useState(false); const [height, setHeight] = React.useState(); const [width, setWidth] = React.useState(); const theme = React.useContext(styled.ThemeContext) || reactTheming.DEFAULT_THEME; const { refs, placement, update, floatingStyles: { transform } } = reactDom.useFloating({ elements: { reference: triggerRef?.current, floating: floatingRef?.current }, placement: 'bottom-start', middleware: [reactDom.offset(theme.space.base), reactDom.flip(), reactDom.size({ apply: _ref2 => { let { rects, availableHeight } = _ref2; if (rects.reference.width > 0) { setWidth(rects.reference.width); if (!(minHeight === null || minHeight === 'fit-content') && rects.floating.height > availableHeight) { setHeight(availableHeight); } } } })] }); const handleMouseDown = event => event.preventDefault(); React.useEffect(() => { let cleanup; if (isExpanded && refs.reference.current && refs.floating.current) { cleanup = reactDom.autoUpdate(refs.reference.current, refs.floating.current, update, { elementResize: typeof ResizeObserver === 'function' }); } return () => cleanup && cleanup(); }, [isExpanded, refs.reference, refs.floating, update]); React.useEffect(() => { let timeout; if (isExpanded) { setIsVisible(true); } else { timeout = setTimeout(() => { setIsVisible(false); setHeight(undefined); }, 200 ); } return () => clearTimeout(timeout); }, [isExpanded]); React.useEffect(() => { if (height) { setHeight(undefined); update(); } }, [ children, update]); const Node = React__namespace.default.createElement(StyledFloatingListbox, { "data-garden-animate": isVisible ? 'true' : 'false', $isHidden: !isExpanded, $position: placement === 'bottom-start' ? 'bottom' : 'top', style: { transform, width }, $zIndex: zIndex, ref: floatingRef }, React__namespace.default.createElement(StyledListbox, Object.assign({ $isCompact: isCompact, $maxHeight: maxHeight, $minHeight: minHeight, "aria-hidden": !isExpanded, onMouseDown: containerUtilities.composeEventHandlers(onMouseDown, handleMouseDown), style: { height } }, props, { ref: ref }), !!isVisible && children)); return appendToNode ? reactDom$1.createPortal(Node, appendToNode) : Node; }); Listbox.displayName = 'Listbox'; Listbox.propTypes = { appendToNode: PropTypes__default.default.any, isCompact: PropTypes__default.default.bool, isExpanded: PropTypes__default.default.bool, maxHeight: PropTypes__default.default.string, triggerRef: PropTypes__default.default.any.isRequired, zIndex: PropTypes__default.default.number }; const TagAvatarComponent = reactTags.Tag.Avatar; TagAvatarComponent.displayName = 'Tag.Avatar'; const TagAvatar = TagAvatarComponent; const TagComponent = React.forwardRef((_ref, ref) => { let { children, option, removeLabel, tooltipZIndex, ...props } = _ref; const { getTagProps, isCompact, removeSelection } = useComboboxContext(); const text = option.label || option.value; const ariaLabel = reactTheming.useText( Tag, props, 'aria-label', `${text}, press delete or backspace to remove`, !option.disabled); const tagProps = getTagProps({ option, 'aria-label': ariaLabel }); const theme = React.useContext(styled.ThemeContext) || reactTheming.DEFAULT_THEME; const doc = reactTheming.useDocument(theme); const handleClick = () => removeSelection(option.value); return React__namespace.default.createElement(StyledTag, Object.assign({ "aria-disabled": option.disabled, tabIndex: option.disabled ? undefined : 0 }, tagProps, props, { size: isCompact ? 'medium' : 'large', ref: ref }), children || React__namespace.default.createElement("span", null, text), !option.disabled && (removeLabel ? React__namespace.default.createElement(reactTooltips.Tooltip, { appendToNode: doc?.body, content: removeLabel, zIndex: tooltipZIndex }, React__namespace.default.createElement(StyledTag.Close, { "aria-label": removeLabel, onClick: handleClick })) : React__namespace.default.createElement(StyledTag.Close, { onClick: handleClick }))); }); TagComponent.displayName = 'Tag'; TagComponent.propTypes = { hue: PropTypes__default.default.string, isPill: PropTypes__default.default.bool, isRegular: PropTypes__default.default.bool, removeLabel: PropTypes__default.default.string }; const Tag = TagComponent; Tag.Avatar = TagAvatar; const TagGroup = _ref => { let { children, isDisabled, isExpanded, listboxZIndex, maxTags, optionTagProps, selection } = _ref; return React__namespace.default.createElement(React__namespace.default.Fragment, null, selection.map((option, index) => { const disabled = isDisabled || option.disabled; return React__namespace.default.createElement(Tag, Object.assign({ key: option.value, hidden: !isExpanded && index >= maxTags, option: { ...option, disabled }, tooltipZIndex: listboxZIndex ? listboxZIndex + 1 : undefined }, optionTagProps[option.value])); }), children); }; TagGroup.displayName = 'TagGroup'; const toOption = props => { return { value: props.value, label: props.label, hidden: props.isHidden, disabled: props.isDisabled, selected: props.isSelected }; }; const toOptions = (children, optionTagProps) => React.Children.toArray(children).reduce((options, option) => { const retVal = options; if (React.isValidElement(option)) { if ('value' in option.props) { retVal.push(toOption(option.props)); optionTagProps[option.props.value] = option.props.tagProps; } else { const props = option.props; const groupOptions = toOptions(props.children, optionTagProps); retVal.push({ label: props.legend, options: groupOptions }); } } return retVal; }, []); const MAX_TAGS = 4; const Combobox = React.forwardRef((_ref, ref) => { let { children, activeIndex, defaultActiveIndex, defaultExpanded, endIcon, focusInset, inputProps: _inputProps, inputValue: _inputValue, isAutocomplete, isBare, isCompact, isDisabled, isEditable, isExpanded: _isExpanded, isMultiselectable, listboxAppendToNode, listboxAriaLabel, listboxMaxHeight, listboxMinHeight, listboxZIndex, maxHeight, maxTags = MAX_TAGS, onChange, placeholder, renderExpandTags, renderValue, selectionValue, startIcon, validation, ...props } = _ref; const { hasHint, hasMessage, labelProps, setLabelProps, hintProps, setHintProps, messageProps, setMessageProps } = useFieldContext(); const [isInputHidden, setIsInputHidden] = React.useState(true); const [isLabelHovered, setIsLabelHovered] = React.useState(false); const [isTagGroupExpanded, setIsTagGroupExpanded] = React.useState(false); const [optionTagProps, setOptionTagProps] = React.useState({}); const options = React.useMemo(() => { const tagProps = {}; const retVal = toOptions(children, tagProps); if (isMultiselectable) { setOptionTagProps(value => ({ ...value, ...tagProps })); } return retVal; }, [children, isMultiselectable]); const triggerRef = React.useRef(null); const inputRef = React.useRef(null); const listboxRef = React.useRef(null); const theme = React.useContext(styled.ThemeContext) || reactTheming.DEFAULT_THEME; const environment = reactTheming.useWindow(theme); const { activeValue, inputValue, isExpanded, getTriggerProps, getHintProps, getInputProps, getLabelProps, getListboxProps, getMessageProps, getOptionProps, getOptGroupProps, getTagProps, removeSelection, selection } = containerCombobox.useCombobox({ idPrefix: props.id, triggerRef, inputRef, listboxRef, options, environment, hasHint, hasMessage, isAutocomplete, isEditable, isMultiselectable, disabled: isDisabled, inputValue: _inputValue, selectionValue, isExpanded: _isExpanded, defaultExpanded, activeIndex, defaultActiveIndex, onChange }); const contextValue = React.useMemo(() => ({ activeValue, getOptionProps, getOptGroupProps, getTagProps, isCompact, removeSelection }), [activeValue, getOptionProps, getOptGroupProps, getTagProps, isCompact, removeSelection]); const hasChevron = React.useMemo(() => !isBare && (isAutocomplete || !isEditable), [isAutocomplete, isBare, isEditable]); const expandTags = reactTheming.useText(Combobox, { renderExpandTags }, 'renderExpandTags', '+ {{value}} more', isMultiselectable || false); const _listboxAriaLabel = reactTheming.useText(Combobox, { listboxAriaLabel }, 'listboxAriaLabel', 'Options'); const triggerProps = getTriggerProps({ onFocus: () => { if (!isDisabled) { if (isEditable) { setIsInputHidden(false); } if (isMultiselectable) { setIsTagGroupExpanded(true); } } }, onBlur: event => { if (event.relatedTarget === null || !triggerRef.current?.contains(event.relatedTarget)) { if (isEditable) { setIsInputHidden(true); } if (isMultiselectable) { setIsTagGroupExpanded(false); } } } }); const inputProps = { 'aria-invalid': validation === 'error' || validation === 'warning', hidden: isInputHidden, placeholder, ...getInputProps({ ..._inputProps }) }; const listboxProps = getListboxProps({ 'aria-label': _listboxAriaLabel }); React.useEffect(() => { if (!labelProps) { const _labelProps = getLabelProps({ onMouseEnter: () => setIsLabelHovered(true), onMouseLeave: () => setIsLabelHovered(false) }); setLabelProps(_labelProps); } return () => labelProps && setLabelProps(undefined); }, [getLabelProps, labelProps, setLabelProps]); React.useEffect(() => { if (!hintProps) { const _hintProps = getHintProps(); setHintProps(_hintProps); } return () => hintProps && setHintProps(undefined); }, [getHintProps, hintProps, setHintProps]); React.useEffect(() => { if (!messageProps) { const _messageProps = getMessageProps(); setMessageProps(_messageProps); } return () => messageProps && setMessageProps(undefined); }, [getMessageProps, messageProps, setMessageProps]); return React__namespace.default.createElement(ComboboxContext.Provider, { value: contextValue }, React__namespace.default.createElement(StyledCombobox, Object.assign({ $isCompact: isCompact, tabIndex: -1 }, props, { ref: ref }), React__namespace.default.createElement(StyledTrigger, Object.assign({ $isAutocomplete: isAutocomplete, $isBare: isBare, $isCompact: isCompact, $isEditable: isEditable, $isLabelHovered: isLabelHovered, $isMultiselectable: isMultiselectable, $maxHeight: maxHeight, $focusInset: focusInset, $validation: validation }, triggerProps), React__namespace.default.createElement(StyledContainer, null, !!startIcon && React__namespace.default.createElement(StyledInputIcon, { $isLabelHovered: isLabelHovered, $isCompact: isCompact }, startIcon), React__namespace.default.createElement(StyledInputGroup, null, !!isMultiselectable && Array.isArray(selection) && React__namespace.default.createElement(TagGroup, { isDisabled: isDisabled, isExpanded: isTagGroupExpanded, maxTags: maxTags, optionTagProps: optionTagProps, selection: selection }, selection.length > maxTags && React__namespace.default.createElement(StyledTagsButton, { disabled: isDisabled, hidden: isTagGroupExpanded, $isCompact: isCompact, tabIndex: -1, type: "button" }, (() => { const value = selection.length - maxTags; return renderExpandTags ? renderExpandTags(value) : expandTags?.replace('{{value}}', value.toString()); })())), React__namespace.default.createElement(StyledValue, { hidden: !isInputHidden, $isAutocomplete: isAutocomplete, $isBare: isBare, $isCompact: isCompact, $isDisabled: isDisabled, $isEditable: isEditable, $isMultiselectable: isMultiselectable, $isPlaceholder: !(inputValue || renderValue) }, renderValue ? renderValue({ selection, inputValue }) : inputValue || placeholder), React__namespace.default.createElement(StyledInput, Object.assign({ $isBare: isBare, $isCompact: isCompact, $isEditable: isEditable, $isMultiselectable: isMultiselectable }, inputProps))), !!(hasChevron || endIcon) && React__namespace.default.createElement(StyledInputIcon, { $isCompact: isCompact, $isEnd: true, $isLabelHovered: isLabelHovered, $isRotated: !!(hasChevron && isExpanded) }, hasChevron ? React__namespace.default.createElement(SvgChevronDownStroke, null) : endIcon))), React__namespace.default.createElement(Listbox, Object.assign({ appendToNode: listboxAppendToNode, isCompact: isCompact, isExpanded: isExpanded, maxHeight: listboxMaxHeight, minHeight: listboxMinHeight, triggerRef: triggerRef, zIndex: listboxZIndex }, listboxProps), children))); }); Combobox.displayName = 'Combobox'; Combobox.propTypes = { activeIndex: PropTypes__default.default.number, defaultActiveIndex: PropTypes__default.default.number, defaultExpanded: PropTypes__default.default.bool, endIcon: PropTypes__default.default.any, focusInset: PropTypes__default.default.bool, id: PropTypes__default.default.string, inputProps: PropTypes__default.default.object, inputValue: PropTypes__default.default.string, isAutocomplete: PropTypes__default.default.bool, isBare: PropTypes__default.default.bool, isCompact: PropTypes__default.default.bool, isDisabled: PropTypes__default.default.bool, isEditable: PropTypes__default.default.bool, isExpanded: PropTypes__default.default.bool, isMultiselectable: PropTypes__default.default.bool, listboxAppendToNode: PropTypes__default.default.any, listboxAriaLabel: PropTypes__default.default.string, listboxMaxHeight: PropTypes__default.default.string, listboxMinHeight: PropTypes__default.default.string, listboxZIndex: PropTypes__default.default.number, maxHeight: PropTypes__default.default.string, maxTags: PropTypes__default.default.number, onChange: PropTypes__default.default.func, placeholder: PropTypes__default.default.string, renderExpandTags: PropTypes__default.default.func, renderValue: PropTypes__default.default.func, selectionValue: PropTypes__default.default.any, startIcon: PropTypes__default.default.any, validation: PropTypes__default.default.oneOf(reactForms.VALIDATION) }; Combobox.defaultProps = { isEditable: true, listboxMaxHeight: '400px', listboxZIndex: 1000, maxTags: MAX_TAGS }; const Hint = React.forwardRef((props, ref) => { const { hintProps, setHasHint } = useFieldContext(); React.useEffect(() => { setHasHint(true); return () => setHasHint(false); }, [setHasHint]); return React__namespace.default.createElement(StyledHint, Object.assign({}, hintProps, props, { ref: ref })); }); Hint.displayName = 'Field.Hint'; const Label = React.forwardRef((_ref, ref) => { let { onClick, onMouseEnter, onMouseLeave, ...props } = _ref; const { labelProps } = useFieldContext(); return React__namespace.default.createElement(StyledLabel, Object.assign({}, labelProps, { onClick: containerUtilities.composeEventHandlers(onClick, labelProps?.onClick), onMouseEnter: containerUtilities.composeEventHandlers(onMouseEnter, labelProps?.onMouseEnter), onMouseLeave: containerUtilities.composeEventHandlers(onMouseLeave, labelProps?.onMouseLeave) }, props, { ref: ref })); }); Label.displayName = 'Field.Label'; Label.propTypes = { hidden: PropTypes__default.default.bool, isRegular: PropTypes__default.default.bool }; const Message = React.forwardRef((props, ref) => { const { messageProps, setHasMessage } = useFieldContext(); React.useEffect(() => { setHasMessage(true); return () => setHasMessage(false); }, [setHasMessage]); return React__namespace.default.createElement(StyledMessage, Object.assign({}, messageProps, props, { ref: ref })); }); Message.displayName = 'Field.Message'; Message.propTypes = { validation: PropTypes__default.default.oneOf(reactForms.VALIDATION), validationLabel: PropTypes__default.default.string }; const FieldComponent = React.forwardRef((props, ref) => { const [labelProps, setLabelProps] = React.useState(undefined); const [hintProps, setHintProps] = React.useState(undefined); const [messageProps, setMessageProps] = React.useState(undefined); const [hasHint, setHasHint] = React.useState(false); const [hasMessage, setHasMessage] = React.useState(false); const contextValue = React.useMemo(() => ({ labelProps, setLabelProps, hasHint, setHasHint, hintProps, setHintProps, hasMessage, setHasMessage, messageProps, setMessageProps }), [labelProps, setLabelProps, hasHint, setHasHint, hintProps, setHintProps, hasMessage, setHasMessage, messageProps, setMessageProps]); return React__namespace.default.createElement(FieldContext.Provider, { value: contextValue }, React__namespace.default.createElement(StyledField, Object.assign({}, props, { ref: ref }))); }); FieldComponent.displayName = 'Field'; const Field = FieldComponent; Field.Hint = Hint; Field.Label = Label; Field.Message = Message; var _path$3; function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); } var SvgPlusStroke = function SvgPlusStroke(props) { return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({ xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, focusable: "false", viewBox: "0 0 16 16", "aria-hidden": "true" }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", { stroke: "currentColor", strokeLinecap: "round", d: "M7.5 2.5v12m6-6h-12" }))); }; var _path$2; function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); } var SvgChevronRightStroke = function SvgChevronRightStroke(props) { return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({ xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, focusable: "false", viewBox: "0 0 16 16", "aria-hidden": "true" }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", { fill: "currentColor", d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z" }))); }; var _path$1; function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); } var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) { return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({ xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, focusable: "false", viewBox: "0 0 16 16", "aria-hidden": "true" }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", { fill: "currentColor", d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z" }))); }; var _path; function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.l