@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
42 lines • 1.18 kB
JavaScript
import * as React from "react";
import styled, { css } from "styled-components";
import ListChoice from "../../ListChoice";
import defaultTheme from "../../defaultTheme";
import CheckCircle from "../../icons/CheckCircle";
const StyledListChoiceWrapper = styled.li.withConfig({
displayName: "InputSelectOption__StyledListChoiceWrapper",
componentId: "sc-y957wq-0"
})(["", ";"], ({
theme,
$active
}) => css([".orbit-list-choice{background:", ";}"], $active && theme.orbit.paletteCloudLight));
StyledListChoiceWrapper.defaultProps = {
theme: defaultTheme
};
const InputSelectOption = /*#__PURE__*/React.forwardRef(({
active,
id,
onClick,
isSelected,
title,
description,
prefix
}, ref) => {
return /*#__PURE__*/React.createElement(StyledListChoiceWrapper, {
$active: active
}, /*#__PURE__*/React.createElement(ListChoice, {
id: id,
onClick: onClick,
ref: ref,
tabIndex: -1,
selected: isSelected,
action: isSelected && /*#__PURE__*/React.createElement(CheckCircle, {
color: "info"
}),
role: "option",
title: title,
description: description,
icon: prefix
}));
});
export default InputSelectOption;