@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
41 lines (40 loc) • 1.31 kB
JavaScript
/**
* @jsxRuntime classic
* @jsx jsx
*/
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
import { css, jsx } from '@emotion/react';
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
import { Box, xcss } from '@atlaskit/primitives';
var barStyles = css({
position: 'absolute',
left: 0,
right: 0,
top: '18px',
margin: 'auto',
width: "var(--ds-space-200, 16px)",
height: '3px'
});
var textColorIconWrapper = xcss({
position: 'relative'
});
var getBackground = function getBackground(selectedColor, disabled) {
if (selectedColor) {
return selectedColor;
}
return disabled ? "var(--ds-icon-disabled, #080F214A)" : "var(--ds-icon, #292A2E)";
};
export var DynamicStrokeIconDecoration = function DynamicStrokeIconDecoration(_ref) {
var selectedColor = _ref.selectedColor,
disabled = _ref.disabled,
icon = _ref.icon;
return jsx(Box, {
xcss: textColorIconWrapper
}, icon, jsx("div", {
"data-testid": "toolbar-icon-dynamic-stroke",
style: {
background: getBackground(selectedColor, disabled)
},
css: barStyles
}));
};