@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
40 lines • 975 B
JavaScript
/**
* @jsxRuntime classic
* @jsx jsx
*/
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
import { css, jsx } from '@emotion/react';
import { Box, xcss } from '@atlaskit/primitives';
const barStyles = css({
position: 'absolute',
left: 0,
right: 0,
top: '18px',
margin: 'auto',
width: "var(--ds-space-200, 16px)",
height: '3px'
});
const textColorIconWrapper = xcss({
position: 'relative'
});
const getBackground = (selectedColor, disabled) => {
if (selectedColor) {
return selectedColor;
}
return disabled ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon, #44546F)";
};
export const DynamicStrokeIconDecoration = ({
selectedColor,
disabled,
icon
}) => {
return jsx(Box, {
xcss: textColorIconWrapper
}, icon, jsx("div", {
"data-testid": "toolbar-icon-dynamic-stroke",
style: {
background: getBackground(selectedColor, disabled)
},
css: barStyles
}));
};