@lunit/oui 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/presentations/Accordion/Accordion.js +2 -2
- package/dist/presentations/AnalysisBar/AnalysisBar.js +2 -2
- package/dist/presentations/AnalysisBar/HeatmapGraphIcon/HeatmapGraphSVG.js +1 -1
- package/dist/presentations/Histogram/HistogramTabs.js +3 -10
- package/dist/presentations/ToggleControl/ToggleControl.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { v4 as uuidV4 } from 'uuid';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import theme from '../../theme';
|
|
@@ -15,7 +15,7 @@ const Accordion = ({ componentType = 'accordion', MuiAccordionProps, AccordionDe
|
|
|
15
15
|
display: 'flex',
|
|
16
16
|
alignItems: 'center',
|
|
17
17
|
}, children: _jsx(Information, {}) }) })), _jsx(PresentationTypography, { size: size, children: title }), metrics && (_jsx(PresentationTypography, { size: size, children: _jsxs(Box, { sx: { marginLeft: '4px' }, children: [": ", metrics] }) }))] }), _jsx(BaseAccordionDetails, { ...AccordionDetailsProps, sx: { display: 'flex', flexDirection: 'column', gap: '14px' }, children: items.map((item) => {
|
|
18
|
-
return (_jsxs(
|
|
18
|
+
return (_jsxs("div", { children: [item.componentType === 'statistic' && _jsx(Statistic, { ...item }), item.componentType === 'freeText' && _jsx(FreeText, { ...item }), item.componentType === 'score' && _jsx(Score, { ...item })] }, uuidV4()));
|
|
19
19
|
}) })] }));
|
|
20
20
|
};
|
|
21
21
|
export default Accordion;
|
|
@@ -8,11 +8,11 @@ const Segments = ({ segments, adjustForOnePercent }) => {
|
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
if (segments?.length === 1 && segments[0].color === 'jet') {
|
|
11
|
-
return (_jsx(Box, { sx: { width: '100%', height: '14px', transform: 'scaleY(0.8)' }, children: _jsx(HeatmapGraphSVG, {
|
|
11
|
+
return (_jsx(Box, { sx: { width: '100%', height: '14px', transform: 'scaleY(0.8)' }, children: _jsx(HeatmapGraphSVG, {}) }));
|
|
12
12
|
}
|
|
13
13
|
return (_jsx(_Fragment, { children: segments?.map((segment, i) => {
|
|
14
14
|
if (segment.color === 'jet') {
|
|
15
|
-
return
|
|
15
|
+
return _jsx(HeatmapGraphSVG, { width: `${segment.width}%` });
|
|
16
16
|
}
|
|
17
17
|
return (_jsx(GraphSegment, { color: segment.color, width: adjustForOnePercent ? adjustBarSegmentWidth(segment.width) : segment.width }, i));
|
|
18
18
|
}) }));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
const HeatmapGraphSVG = (props) => (_jsxs("svg", { width: "
|
|
2
|
+
const HeatmapGraphSVG = (props) => (_jsxs("svg", { width: "100%", height: "100%", viewBox: "0 0 234 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.30733e-07 4C5.85312e-08 1.79086 1.79086 5.86502e-08 4 1.30999e-07L230 7.53243e-06C232.209 7.60478e-06 234 1.79087 234 4.00001C234 6.20915 232.209 8.00001 230 8.00001L4 8C1.79086 8 2.02935e-07 6.20914 1.30733e-07 4Z", fill: "url(#paint0_linear_4060_316245)" }), _jsx("defs", { children: _jsxs("linearGradient", { id: "paint0_linear_4060_316245", x1: "-0.585003", y1: "5.99984", x2: "228.159", y2: "4.97311", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { stopColor: "#3000FF" }), _jsx("stop", { offset: "0.239583", stopColor: "#5CFFE2" }), _jsx("stop", { offset: "0.447917", stopColor: "#E2FFA4" }), _jsx("stop", { offset: "0.546875", stopColor: "#FCFF75" }), _jsx("stop", { offset: "0.78125", stopColor: "#FDBA73" }), _jsx("stop", { offset: "1", stopColor: "#FF0F00" })] }) })] }));
|
|
3
3
|
export default HeatmapGraphSVG;
|
|
@@ -5,23 +5,16 @@ import { HistogramTabsContainer, TabButton } from './Histogram.styled';
|
|
|
5
5
|
const HistogramTabs = ({ options, active, onChange }) => {
|
|
6
6
|
return (_jsx(HistogramTabsContainer, { children: options.map((tabLabel, idx) => {
|
|
7
7
|
const fontSize = calculateFontSize(tabLabel);
|
|
8
|
-
|
|
9
|
-
key: tabLabel,
|
|
10
|
-
disableRipple: true,
|
|
11
|
-
active: idx === active,
|
|
12
|
-
onClick: () => onChange(idx),
|
|
13
|
-
sx: {
|
|
8
|
+
return (_jsx(TabButton, { disableRipple: true, active: idx === active, onClick: () => onChange(idx), sx: {
|
|
14
9
|
padding: '4px 6px',
|
|
15
10
|
borderRadius: doBorderRadius(idx, options.length),
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
return (_jsx(TabButton, { ...commonButtonProps, children: _jsx(Typography, { variant: "body_sb1", sx: {
|
|
11
|
+
}, children: _jsx(Typography, { variant: "body_sb1", sx: {
|
|
19
12
|
fontSize: `${fontSize}px`,
|
|
20
13
|
whiteSpace: 'nowrap',
|
|
21
14
|
overflow: 'hidden',
|
|
22
15
|
textOverflow: 'ellipsis',
|
|
23
16
|
width: '100%',
|
|
24
|
-
}, children: tabLabel }) }));
|
|
17
|
+
}, children: tabLabel }) }, tabLabel));
|
|
25
18
|
}) }));
|
|
26
19
|
};
|
|
27
20
|
export default HistogramTabs;
|
|
@@ -19,6 +19,6 @@ const ToggleControl = ({ componentType = 'toggle', title, size = 'medium', symbo
|
|
|
19
19
|
return (_jsxs(ToggleControlOuter, { "data-toggle-name": `toggle-control-${title?.replace(/\s/g, '-')}`, hasBar: !!bar || !!content.length, style: { marginBottom: isParent ? '4px' : '0' }, children: [_jsxs(ToggleControlContainer, { className: "toggle-inner-container", size: size, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: '6px' }, className: "toggle-label", children: [!!tooltip.length && (_jsx(Tooltip, { arrow: true, size: "large", title: _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: tooltip.map((item) => (_jsxs(Box, { children: [item.componentType === 'freeText' && (_jsx(FreeText, { componentType: item.componentType, size: item.size, content: item.content })), item.componentType === 'statistic' && (_jsx(Statistic, { componentType: item.componentType, title: item.title, size: item.size, layout: item.layout, symbol: item.symbol, color: item.color }))] }, uuidV4()))) }), children: _jsx(Box, { sx: {
|
|
20
20
|
display: 'flex',
|
|
21
21
|
alignItems: 'center',
|
|
22
|
-
}, children: _jsx(Information, {}) }) })), symbol && (_jsx(PresentationSymbolIcon, { symbol: symbol, color: color, isDimmed: isDimmed || !isChecked })), _jsx(PresentationTypography, { size: size, isDimmed: isDimmed || !isChecked, children: title })] }), _jsx(StyledToggle, { disabled: disabled, checked: isChecked, onChange: handleChange })] }), content.length > 0 && (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: content.map((item) => (_jsx(Statistic, { ...item, isDimmed: isDimmed || !isChecked }))) }, uuidV4())), bar && (_jsx(Box, { sx: { padding: '0 8px', fontSize: '14px', lineHeight: '8px' }, children: _jsx(AnalysisBar, { isDimmed: isDimmed || !isChecked, componentType: bar.componentType, expressionValue: bar.expressionValue, expressionLevels: bar.expressionLevels, caption: bar.caption, segments: bar.segments }) }))] }));
|
|
22
|
+
}, children: _jsx(Information, {}) }) })), symbol && (_jsx(PresentationSymbolIcon, { symbol: symbol, color: color, isDimmed: isDimmed || !isChecked })), _jsx(PresentationTypography, { size: size, isDimmed: isDimmed || !isChecked, children: title })] }), _jsx(StyledToggle, { disabled: disabled, checked: isChecked, onChange: handleChange })] }), content.length > 0 && (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: content.map((item) => (_jsx(Statistic, { ...item, isDimmed: isDimmed || !isChecked }, uuidV4()))) }, uuidV4())), bar && (_jsx(Box, { sx: { padding: '0 8px', fontSize: '14px', lineHeight: '8px' }, children: _jsx(AnalysisBar, { isDimmed: isDimmed || !isChecked, componentType: bar.componentType, expressionValue: bar.expressionValue, expressionLevels: bar.expressionLevels, caption: bar.caption, segments: bar.segments }) }))] }));
|
|
23
23
|
};
|
|
24
24
|
export default ToggleControl;
|
package/package.json
CHANGED