@wireapp/react-ui-kit
Advanced tools
Comparing version 9.17.8 to 9.17.9
@@ -24,5 +24,6 @@ import { ReactElement } from 'react'; | ||
isSearchable?: boolean; | ||
overlayMenu?: boolean; | ||
} | ||
export declare const Select: <IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ id, label, error, helperText, disabled, dataUieName, options, isMulti, wrapperCSS, markInvalid, required, isSearchable, ...props }: SelectProps<IsMulti, Group>) => import("@emotion/react/jsx-runtime").JSX.Element; | ||
export declare const Select: <IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ id, label, error, helperText, disabled, dataUieName, options, isMulti, wrapperCSS, markInvalid, required, isSearchable, overlayMenu, ...props }: SelectProps<IsMulti, Group>) => import("@emotion/react/jsx-runtime").JSX.Element; | ||
export {}; | ||
//# sourceMappingURL=Select.d.ts.map |
@@ -26,3 +26,3 @@ "use strict"; | ||
const Select = (_a) => { | ||
var { id, label, error, helperText, disabled = false, dataUieName, options, isMulti, wrapperCSS = {}, markInvalid = false, required = false, isSearchable = false } = _a, props = __rest(_a, ["id", "label", "error", "helperText", "disabled", "dataUieName", "options", "isMulti", "wrapperCSS", "markInvalid", "required", "isSearchable"]); | ||
var { id, label, error, helperText, disabled = false, dataUieName, options, isMulti, wrapperCSS = {}, markInvalid = false, required = false, isSearchable = false, overlayMenu = true } = _a, props = __rest(_a, ["id", "label", "error", "helperText", "disabled", "dataUieName", "options", "isMulti", "wrapperCSS", "markInvalid", "required", "isSearchable", "overlayMenu"]); | ||
const theme = (0, react_1.useTheme)(); | ||
@@ -34,3 +34,7 @@ const hasError = !!error; | ||
color: theme.general.primaryColor, | ||
} }, wrapperCSS)), "data-uie-name": dataUieName, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, markInvalid: markInvalid, isRequired: required, children: label })), (0, jsx_runtime_1.jsx)(react_select_1.default, Object.assign({ id: id, styles: (0, SelectStyles_1.customStyles)(theme, markInvalid), components: { | ||
} }, wrapperCSS)), "data-uie-name": dataUieName, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, markInvalid: markInvalid, isRequired: required, children: label })), (0, jsx_runtime_1.jsx)(react_select_1.default, Object.assign({ id: id, styles: (0, SelectStyles_1.customStyles)({ | ||
theme: theme, | ||
markInvalid, | ||
menuPosition: overlayMenu ? 'absolute' : 'relative', | ||
}), components: { | ||
SelectContainer: SelectComponents_1.SelectContainer, | ||
@@ -37,0 +41,0 @@ DropdownIndicator: SelectComponents_1.DropdownIndicator, |
@@ -24,3 +24,3 @@ "use strict"; | ||
const SelectComponents_1 = require("./SelectComponents"); | ||
const customStyles = (theme, markInvalid = false) => ({ | ||
const customStyles = ({ theme, markInvalid = false, menuPosition = 'absolute' }) => ({ | ||
indicatorSeparator: () => ({ | ||
@@ -34,2 +34,16 @@ display: 'none', | ||
return { | ||
'& > div > div[class$="-Control"]': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, Input_1.inputStyle)(theme, { disabled: isSelectDisabled, markInvalid })), { borderRadius: 12, minHeight: 48 }), (isDisabled && { | ||
backgroundColor: theme.Input.backgroundColorDisabled, | ||
color: theme.Select.disabledColor, | ||
cursor: 'default', | ||
})), (markInvalid && { | ||
boxShadow: `0 0 0 1px ${theme.general.dangerColor}`, | ||
})), (menuIsOpen && { | ||
boxShadow: `0 0 0 1px ${theme.general.primaryColor}`, | ||
'&:hover': { | ||
boxShadow: `0 0 0 1px ${theme.general.primaryColor}`, | ||
}, | ||
})), { cursor: !isSelectDisabled && 'pointer', '&:focus:visible, active': { | ||
boxShadow: !isSelectDisabled && `0 0 0 1px ${theme.general.primaryColor}`, | ||
} }), | ||
'& > div': (0, SelectComponents_1.isGroup)(options) | ||
@@ -41,19 +55,12 @@ ? { | ||
} | ||
: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, Input_1.inputStyle)(theme, { disabled: isSelectDisabled, markInvalid })), { padding: 0, height: 'auto', minHeight: '48px', '&:-moz-focusring': { | ||
: { | ||
padding: 0, | ||
height: 'auto', | ||
minHeight: '48px', | ||
'&:-moz-focusring': { | ||
color: 'transparent', | ||
textShadow: '0 0 0 #000', | ||
}, position: 'relative' }), (isDisabled && { | ||
backgroundColor: theme.Input.backgroundColorDisabled, | ||
color: theme.Select.disabledColor, | ||
cursor: 'default', | ||
})), (markInvalid && { | ||
boxShadow: `0 0 0 1px ${theme.general.dangerColor}`, | ||
})), (menuIsOpen && { | ||
boxShadow: `0 0 0 1px ${theme.general.primaryColor}`, | ||
'&:hover': { | ||
boxShadow: `0 0 0 1px ${theme.general.primaryColor}`, | ||
}, | ||
})), { cursor: !isSelectDisabled && 'pointer', '&:focus:visible, active': { | ||
boxShadow: !isSelectDisabled && `0 0 0 1px ${theme.general.primaryColor}`, | ||
} }), | ||
position: 'relative', | ||
}, | ||
}; | ||
@@ -73,6 +80,6 @@ }, | ||
groupHeading: provided => (Object.assign(Object.assign({}, provided), { display: 'flex', fontSize: theme.fontSizes.small, lineHeight: '14px', color: theme.Select.disabledColor, padding: '8px 16px 6px 16px' })), | ||
menu: (provided, { options }) => (Object.assign(Object.assign(Object.assign({}, provided), { boxShadow: `0 0 0 1px ${theme.general.primaryColor}, 0 4px 11px hsl(0deg 0% 0% / 10%)`, borderRadius: 12, marginBottom: 0, marginTop: 4, overflowY: 'overlay' }), ((0, SelectComponents_1.isGroup)(options) && { | ||
menu: (provided, { options }) => (Object.assign(Object.assign(Object.assign({}, provided), { boxShadow: `0 0 0 1px ${theme.general.primaryColor}, 0 4px 11px hsl(0deg 0% 0% / 10%)`, borderRadius: 12, marginBottom: 0, marginTop: 4, overflowY: 'overlay', position: menuPosition }), ((0, SelectComponents_1.isGroup)(options) && { | ||
minWidth: '400px', | ||
}))), | ||
menuList: provided => (Object.assign(Object.assign({}, provided), { borderRadius: 12, paddingBottom: 0, paddingTop: 0, maxHeight: 400 })), | ||
menuList: provided => (Object.assign(Object.assign({}, provided), { borderRadius: 0, paddingBottom: 0, paddingTop: 0, maxHeight: 400 })), | ||
option: (provided, { isMulti, isDisabled, isFocused, isSelected, options, data }) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, provided), { backgroundColor: theme.Input.backgroundColor, color: theme.general.color, padding: (0, SelectComponents_1.isGroup)(options) ? '6px 16px' : '10px 18px', cursor: isDisabled ? 'not-allowed' : 'pointer', fontSize: theme.fontSizes.base, fontWeight: isSelected && (0, SelectComponents_1.isGroup)(options) ? 600 : 400, lineHeight: '1.5rem' }), (isSelected && | ||
@@ -130,7 +137,7 @@ !isDisabled && | ||
'&:first-of-type': { | ||
borderRadius: '12px 12px 0 0', | ||
borderRadius: '0', | ||
}, | ||
})), ((0, SelectComponents_1.isGroup)(options) && { | ||
textAlign: 'left', | ||
})), { '&:last-of-type': Object.assign(Object.assign({}, (!(0, SelectComponents_1.isGroup)(options) && { borderRadius: '0 0 12px 12px' })), ((0, SelectComponents_1.isGroup)(options) && | ||
})), { '&:last-of-type': Object.assign(Object.assign({}, (!(0, SelectComponents_1.isGroup)(options) && { borderRadius: '0' })), ((0, SelectComponents_1.isGroup)(options) && | ||
!options[options.length - 1].options.includes(data) && { | ||
@@ -137,0 +144,0 @@ borderBottom: `1px solid ${theme.Select.borderColor}`, |
@@ -73,4 +73,4 @@ { | ||
}, | ||
"version": "9.17.8", | ||
"gitHead": "c4ddaa39a608d9571f622760da080e3473d38dec" | ||
"version": "9.17.9", | ||
"gitHead": "0337d8fc17a5a20352faaa2d3dccfa2fc9c8e627" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
714729
10161