@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
12 lines (11 loc) • 955 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Box, Flex } from '../../../../../components/Flex';
import { getVariableColor } from '../../../../../Utilities/Helpers/StyleHelper';
const stripClassName = 'twa:h-6 twa:w-[128px] twa:rounded twa:overflow-hidden twa:border twa:border-[color-mix(in_srgb,var(--ab-color-foreground)_15%,transparent)]';
export const PercentBarStylePreview = (props) => {
const trackColor = props.backgroundColor ? getVariableColor(props.backgroundColor) : undefined;
const barColor = props.barBackgroundColor
? getVariableColor(props.barBackgroundColor)
: undefined;
return (_jsx(Box, { className: stripClassName, children: _jsx(Flex, { className: "twa:h-full twa:relative", style: trackColor ? { backgroundColor: trackColor } : undefined, children: barColor && (_jsx(Box, { className: "twa:absolute twa:top-0 twa:left-0 twa:h-full twa:w-1/2", style: { background: barColor } })) }) }));
};