@atlaskit/dropdown-menu
Version:
A dropdown menu displays a list of actions or options to a user.
51 lines • 1.98 kB
JavaScript
import React from 'react';
import SVGIcon from '@atlaskit/icon/svg';
import { fg } from '@atlaskit/platform-feature-flags';
import { B400, N10, N100 } from '@atlaskit/theme/colors';
/**
* __Checkbox icon__
*
* Used to visually represent the selected state in DropdownItemCheckbox
*
* @internal
*/
const CheckboxIcon = ({
checked
}) => {
return /*#__PURE__*/React.createElement(SVGIcon, {
label: "",
size: "medium",
primaryColor: checked ? `var(--ds-background-selected-bold, ${B400})` : `var(--ds-background-input, ${N10})`,
secondaryColor: checked ? `var(--ds-icon-inverse, ${N10})` : 'transparent'
}, /*#__PURE__*/React.createElement("g", {
fillRule: "evenodd"
},
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
fg('platform-visual-refresh-icons') ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("rect", {
stroke: checked ? `var(--ds-border-selected, ${B400})` : `var(--ds-border-input, ${N100})`,
x: "5.5",
y: "5.5",
width: "13",
height: "13",
rx: "1.5",
fill: "currentColor"
}), /*#__PURE__*/React.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M16.3262 9.48011L15.1738 8.51984L10.75 13.8284L8.82616 11.5198L7.67383 12.4801L10.1738 15.4801C10.3163 15.6511 10.5274 15.75 10.75 15.75C10.9726 15.75 11.1837 15.6511 11.3262 15.4801L16.3262 9.48011Z",
fill: "inherit"
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("rect", {
fill: "currentColor",
x: "6",
y: "6",
width: "12",
height: "12",
rx: "2",
stroke: checked ? `var(--ds-border-selected, ${B400})` : `var(--ds-border-input, ${N100})`,
strokeWidth: 1
}), /*#__PURE__*/React.createElement("path", {
d: "M9.707 11.293a1 1 0 10-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 10-1.414-1.414L11 12.586l-1.293-1.293z",
fill: "inherit"
}))));
};
export default CheckboxIcon;