@lunit/oui 1.2.0 → 2.0.0
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/assets/ic-bell-noti-outlined-20px.js +1 -1
- package/dist/assets/ic-close-large-outlined-20px.js +1 -1
- package/dist/assets/ic-close-small-outlined-20px.js +1 -1
- package/dist/assets/ic-copy-coordinates-outlined-20px.d.ts +3 -0
- package/dist/assets/ic-copy-coordinates-outlined-20px.js +3 -0
- package/dist/assets/ic-download-pdf-outlined-20px.js +1 -1
- package/dist/assets/ic-ellipse-outlined-20px.js +1 -1
- package/dist/assets/ic-filter-noti-outlined-20px.js +1 -1
- package/dist/assets/ic-hide-large-outlined-20px.js +1 -1
- package/dist/assets/ic-hide-small-outlined-20px.js +1 -1
- package/dist/assets/ic-information-large-outlined-20px.js +1 -1
- package/dist/assets/ic-information-small-outlined-20px.js +1 -1
- package/dist/assets/ic-manufacturer-outlined-20px.js +1 -1
- package/dist/assets/ic-rectangle-outlined-20px.js +1 -1
- package/dist/assets/ic-refresh-left-outlined-20px.js +1 -1
- package/dist/assets/ic-refresh-right-outlined-20px.js +1 -1
- package/dist/assets/ic-show-large-outlined-20px.js +1 -1
- package/dist/assets/ic-show-small-outlined-20px.js +1 -1
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.js +1 -0
- package/dist/components/Alert/Alert.utils.js +3 -3
- package/dist/components/Chip/Chip.utils.js +3 -3
- package/dist/components/TextField/TextArea.types.d.ts +2 -1
- package/dist/components/TextField/TextInput.js +5 -1
- package/dist/components/TextField/TextInput.styled.js +2 -1
- package/dist/components/TextField/TextInput.types.d.ts +6 -2
- package/dist/components/TextField/TextInput.utils.d.ts +3 -3
- package/dist/components/TextField/TextInput.utils.js +4 -2
- package/dist/components/TextField/components/Buttons.d.ts +7 -1
- package/dist/components/TextField/components/Buttons.js +15 -1
- package/dist/components/TextField/components/FileInput.d.ts +4 -0
- package/dist/components/TextField/components/FileInput.js +21 -0
- package/dist/components/Toggle/Toggle.d.ts +3 -0
- package/dist/components/Toggle/Toggle.js +16 -0
- package/dist/components/Toggle/Toggle.styled.d.ts +7 -0
- package/dist/components/Toggle/Toggle.styled.js +90 -0
- package/dist/components/Toggle/Toggle.types.d.ts +18 -0
- package/dist/components/Toggle/Toggle.types.js +1 -0
- package/dist/components/Toggle/index.d.ts +4 -0
- package/dist/components/Toggle/index.js +2 -0
- package/dist/components/UploadManager/UploadManager.js +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/icons/CopyCoordinates/index.d.ts +12 -0
- package/dist/icons/CopyCoordinates/index.js +13 -0
- package/dist/icons/index.d.ts +3 -1
- package/dist/icons/index.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/presentations/Accordion/Accordion.d.ts +3 -0
- package/dist/presentations/Accordion/Accordion.js +21 -0
- package/dist/presentations/Accordion/Accordion.styled.d.ts +22 -0
- package/dist/presentations/Accordion/Accordion.styled.js +39 -0
- package/dist/presentations/Accordion/Accordion.types.d.ts +22 -0
- package/dist/presentations/Accordion/Accordion.types.js +1 -0
- package/dist/presentations/Accordion/index.d.ts +2 -0
- package/dist/presentations/Accordion/index.js +2 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.d.ts +3 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.js +26 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.styled.d.ts +31 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.styled.js +103 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.types.d.ts +11 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.types.js +1 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.utils.d.ts +5 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.utils.js +34 -0
- package/dist/presentations/AnalysisBar/HeatmapGraphIcon/HeatmapGraphSVG.d.ts +3 -0
- package/dist/presentations/AnalysisBar/HeatmapGraphIcon/HeatmapGraphSVG.js +3 -0
- package/dist/presentations/AnalysisBar/HeatmapGraphIcon/index.d.ts +7 -0
- package/dist/presentations/AnalysisBar/HeatmapGraphIcon/index.js +8 -0
- package/dist/presentations/AnalysisBar/index.d.ts +4 -0
- package/dist/presentations/AnalysisBar/index.js +2 -0
- package/dist/presentations/FreeText/FreeText.d.ts +3 -0
- package/dist/presentations/FreeText/FreeText.js +27 -0
- package/dist/presentations/FreeText/FreeText.types.d.ts +9 -0
- package/dist/presentations/FreeText/FreeText.types.js +1 -0
- package/dist/presentations/FreeText/index.d.ts +4 -0
- package/dist/presentations/FreeText/index.js +2 -0
- package/dist/presentations/Histogram/Histogram.d.ts +3 -0
- package/dist/presentations/Histogram/Histogram.js +15 -0
- package/dist/presentations/Histogram/Histogram.styled.d.ts +23 -0
- package/dist/presentations/Histogram/Histogram.styled.js +47 -0
- package/dist/presentations/Histogram/Histogram.types.d.ts +27 -0
- package/dist/presentations/Histogram/Histogram.types.js +1 -0
- package/dist/presentations/Histogram/Histogram.utils.d.ts +23 -0
- package/dist/presentations/Histogram/Histogram.utils.js +45 -0
- package/dist/presentations/Histogram/HistogramCharts.d.ts +3 -0
- package/dist/presentations/Histogram/HistogramCharts.js +20 -0
- package/dist/presentations/Histogram/HistogramTabs.d.ts +3 -0
- package/dist/presentations/Histogram/HistogramTabs.js +27 -0
- package/dist/presentations/Histogram/index.d.ts +4 -0
- package/dist/presentations/Histogram/index.js +2 -0
- package/dist/presentations/HorizonDivider/HorizonDivider.d.ts +3 -0
- package/dist/presentations/HorizonDivider/HorizonDivider.js +6 -0
- package/dist/presentations/HorizonDivider/HorizonDivider.types.d.ts +4 -0
- package/dist/presentations/HorizonDivider/HorizonDivider.types.js +1 -0
- package/dist/presentations/HorizonDivider/index.d.ts +4 -0
- package/dist/presentations/HorizonDivider/index.js +2 -0
- package/dist/presentations/Score/Score.d.ts +3 -0
- package/dist/presentations/Score/Score.js +9 -0
- package/dist/presentations/Score/Score.types.d.ts +13 -0
- package/dist/presentations/Score/Score.types.js +1 -0
- package/dist/presentations/Score/index.d.ts +4 -0
- package/dist/presentations/Score/index.js +2 -0
- package/dist/presentations/Statistic/Statistic.d.ts +3 -0
- package/dist/presentations/Statistic/Statistic.js +12 -0
- package/dist/presentations/Statistic/Statistic.styled.d.ts +11 -0
- package/dist/presentations/Statistic/Statistic.styled.js +17 -0
- package/dist/presentations/Statistic/Statistic.types.d.ts +11 -0
- package/dist/presentations/Statistic/Statistic.types.js +1 -0
- package/dist/presentations/Statistic/index.d.ts +4 -0
- package/dist/presentations/Statistic/index.js +2 -0
- package/dist/presentations/ToggleControl/ToggleControl.d.ts +3 -0
- package/dist/presentations/ToggleControl/ToggleControl.js +22 -0
- package/dist/presentations/ToggleControl/ToggleControl.styled.d.ts +15 -0
- package/dist/presentations/ToggleControl/ToggleControl.styled.js +27 -0
- package/dist/presentations/ToggleControl/ToggleControl.types.d.ts +21 -0
- package/dist/presentations/ToggleControl/ToggleControl.types.js +1 -0
- package/dist/presentations/ToggleControl/index.d.ts +4 -0
- package/dist/presentations/ToggleControl/index.js +2 -0
- package/dist/presentations/ToggleControlGroup/ToggleControlGroup.d.ts +3 -0
- package/dist/presentations/ToggleControlGroup/ToggleControlGroup.js +32 -0
- package/dist/presentations/ToggleControlGroup/ToggleControlGroup.styled.d.ts +4 -0
- package/dist/presentations/ToggleControlGroup/ToggleControlGroup.styled.js +9 -0
- package/dist/presentations/ToggleControlGroup/ToggleControlGroup.types.d.ts +21 -0
- package/dist/presentations/ToggleControlGroup/ToggleControlGroup.types.js +1 -0
- package/dist/presentations/ToggleControlGroup/index.d.ts +2 -0
- package/dist/presentations/ToggleControlGroup/index.js +2 -0
- package/dist/presentations/index.d.ts +9 -0
- package/dist/presentations/index.js +9 -0
- package/dist/presentations/presentations.styled.d.ts +3 -0
- package/dist/presentations/presentations.styled.js +91 -0
- package/dist/presentations/presentations.types.d.ts +12 -0
- package/dist/presentations/presentations.types.js +1 -0
- package/package.json +7 -3
package/dist/icons/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { default as RefreshLeft } from './RefreshLeft';
|
|
|
14
14
|
export { default as RefreshRight } from './RefreshRight';
|
|
15
15
|
export { default as ShowLarge } from './ShowLarge';
|
|
16
16
|
export { default as ShowSmall } from './ShowSmall';
|
|
17
|
+
export { default as CopyCoordinates } from './CopyCoordinates';
|
|
17
18
|
export { Analyze } from '@lunit/design-system-icons';
|
|
18
19
|
export { Annotation } from '@lunit/design-system-icons';
|
|
19
20
|
export { Apps } from '@lunit/design-system-icons';
|
|
@@ -159,7 +160,7 @@ export { TagT1 } from '@lunit/design-system-icons';
|
|
|
159
160
|
export { TagT2 } from '@lunit/design-system-icons';
|
|
160
161
|
export { TagT3 } from '@lunit/design-system-icons';
|
|
161
162
|
export { Text } from '@lunit/design-system-icons';
|
|
162
|
-
export { Toggle } from '@lunit/design-system-icons';
|
|
163
|
+
export { Toggle as ToggleIcon } from '@lunit/design-system-icons';
|
|
163
164
|
export { Undo } from '@lunit/design-system-icons';
|
|
164
165
|
export { Unlock } from '@lunit/design-system-icons';
|
|
165
166
|
export { UploadFolder } from '@lunit/design-system-icons';
|
|
@@ -177,3 +178,4 @@ export { Warning16 } from '@lunit/design-system-icons';
|
|
|
177
178
|
export { Warning } from '@lunit/design-system-icons';
|
|
178
179
|
export { ZoomIn } from '@lunit/design-system-icons';
|
|
179
180
|
export { ZoomOut } from '@lunit/design-system-icons';
|
|
181
|
+
export { MonitoringSystem } from '@lunit/design-system-icons';
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AccordionProps } from './Accordion.types';
|
|
2
|
+
declare const Accordion: ({ componentType, MuiAccordionProps, AccordionDetailsProps, AccordionSummaryProps, size, tooltip, title, items, metrics, isOpen, onChange, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Accordion;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { v4 as uuidV4 } from 'uuid';
|
|
3
|
+
import { Box } from '@mui/material';
|
|
4
|
+
import theme from '../../theme';
|
|
5
|
+
import { ArrowDown, Information } from '../../icons';
|
|
6
|
+
import { Tooltip } from '../../components';
|
|
7
|
+
import { BaseAccordion, BaseAccordionDetails, BaseAccordionSummary } from './Accordion.styled';
|
|
8
|
+
import { PresentationTypography } from '../presentations.styled';
|
|
9
|
+
import { FreeText } from '../FreeText';
|
|
10
|
+
import { Statistic } from '../Statistic';
|
|
11
|
+
import { Score } from '../Score';
|
|
12
|
+
const Accordion = ({ componentType = 'accordion', MuiAccordionProps, AccordionDetailsProps, AccordionSummaryProps, size = 'medium', tooltip = [], title, items, metrics, isOpen, onChange, }) => {
|
|
13
|
+
return (_jsxs(BaseAccordion, { ...MuiAccordionProps, expanded: isOpen, onChange: onChange, sx: { alignItems: 'center' }, children: [_jsxs(BaseAccordionSummary, { expandIcon: _jsx(ArrowDown, { sx: { fill: theme.palette.neutralGrey[40] } }), ...AccordionSummaryProps, 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: {
|
|
14
|
+
marginRight: size.includes('small') ? '4px' : '6px',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: 'center',
|
|
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: '8px' }, children: items.map((item) => {
|
|
18
|
+
return (_jsxs(_Fragment, { children: [item.componentType === 'statistic' && _jsx(Statistic, { ...item }), item.componentType === 'freeText' && _jsx(FreeText, { ...item }), item.componentType === 'score' && _jsx(Score, { ...item })] }));
|
|
19
|
+
}) })] }));
|
|
20
|
+
};
|
|
21
|
+
export default Accordion;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const BaseAccordion: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
children: NonNullable<import("react").ReactNode>;
|
|
4
|
+
classes?: Partial<import("@mui/material").AccordionClasses> | undefined;
|
|
5
|
+
defaultExpanded?: boolean | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
disableGutters?: boolean | undefined;
|
|
8
|
+
expanded?: boolean | undefined;
|
|
9
|
+
onChange?: ((event: import("react").SyntheticEvent<Element, Event>, expanded: boolean) => void) | undefined;
|
|
10
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
11
|
+
TransitionComponent?: import("react").JSXElementConstructor<import("@mui/material/transitions").TransitionProps & {
|
|
12
|
+
children?: import("react").ReactElement<any, any> | undefined;
|
|
13
|
+
}> | undefined;
|
|
14
|
+
TransitionProps?: import("@mui/material/transitions").TransitionProps | undefined;
|
|
15
|
+
} & Omit<import("@mui/material").PaperOwnProps, "classes" | "onChange"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
16
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
17
|
+
}, "disabled" | "expanded" | "square" | keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "onChange" | "elevation" | "TransitionComponent" | "disableGutters" | "defaultExpanded" | "TransitionProps"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
18
|
+
declare const BaseAccordionSummary: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionSummaryOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
20
|
+
}, "disabled" | "style" | "classes" | "className" | "children" | "sx" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "expandIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
|
+
declare const BaseAccordionDetails: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionDetailsProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
22
|
+
export { BaseAccordion, BaseAccordionDetails, BaseAccordionSummary };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Accordion, AccordionDetails, AccordionSummary, styled } from '@mui/material';
|
|
2
|
+
const baseAccordionStyle = {
|
|
3
|
+
background: 'transparent',
|
|
4
|
+
padding: '0',
|
|
5
|
+
border: 'none',
|
|
6
|
+
boxShadow: 'none',
|
|
7
|
+
minHeight: '36px',
|
|
8
|
+
'&::before': {
|
|
9
|
+
display: 'none', // This removes an extra divider line
|
|
10
|
+
},
|
|
11
|
+
'&.Mui-expanded': {
|
|
12
|
+
margin: 0,
|
|
13
|
+
minHeight: 'initial',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const baseAccordionSummaryStyle = {
|
|
17
|
+
height: '36px',
|
|
18
|
+
};
|
|
19
|
+
const baseAccordionDetailStyle = {
|
|
20
|
+
paddingTop: '8px',
|
|
21
|
+
};
|
|
22
|
+
const BaseAccordion = styled(Accordion)(() => {
|
|
23
|
+
return {
|
|
24
|
+
...baseAccordionStyle,
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
const BaseAccordionSummary = styled(AccordionSummary)(() => {
|
|
28
|
+
return {
|
|
29
|
+
...baseAccordionStyle,
|
|
30
|
+
...baseAccordionSummaryStyle,
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
const BaseAccordionDetails = styled(AccordionDetails)(() => {
|
|
34
|
+
return {
|
|
35
|
+
...baseAccordionStyle,
|
|
36
|
+
...baseAccordionDetailStyle,
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
export { BaseAccordion, BaseAccordionDetails, BaseAccordionSummary };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { AccordionDetailsProps, AccordionSummaryProps, AccordionProps as MuiAccordionProps } from '@mui/material';
|
|
3
|
+
import { PresentationElementSize } from '../presentations.types';
|
|
4
|
+
import { FreeTextProps } from '../FreeText';
|
|
5
|
+
import { StatisticProps } from '../Statistic';
|
|
6
|
+
import { ScoreProps } from '../Score';
|
|
7
|
+
export interface AccordionSpec {
|
|
8
|
+
componentType: 'accordion';
|
|
9
|
+
title: string;
|
|
10
|
+
size?: PresentationElementSize;
|
|
11
|
+
items: (StatisticProps | FreeTextProps | ScoreProps)[];
|
|
12
|
+
isOpen?: boolean;
|
|
13
|
+
tooltip?: (StatisticProps | FreeTextProps)[];
|
|
14
|
+
metrics?: string;
|
|
15
|
+
}
|
|
16
|
+
interface AccordionProps extends AccordionSpec {
|
|
17
|
+
MuiAccordionProps?: MuiAccordionProps;
|
|
18
|
+
AccordionSummaryProps?: AccordionSummaryProps;
|
|
19
|
+
AccordionDetailsProps?: AccordionDetailsProps;
|
|
20
|
+
onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
export type { AccordionProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { AnalysisBarSegmentContainer, AnalysisBarOuter, AxisLabels, GraphAxisLabel, GraphScoreIndicator, GraphSegment, } from './AnalysisBar.styled';
|
|
4
|
+
import { adjustBarSegmentWidth, parseStringValToNumber } from './AnalysisBar.utils';
|
|
5
|
+
import HeatmapGraphSVG from './HeatmapGraphIcon/HeatmapGraphSVG';
|
|
6
|
+
const Segments = ({ segments, adjustForOnePercent }) => {
|
|
7
|
+
if (!segments) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (segments?.length === 1 && segments[0].color === 'jet') {
|
|
11
|
+
return (_jsx(Box, { sx: { width: '100%', height: '12px', transform: 'scaleY(0.8) translateY(-10px)' }, children: _jsx(HeatmapGraphSVG, { width: 'auto', height: 'auto' }) }));
|
|
12
|
+
}
|
|
13
|
+
return (_jsx(_Fragment, { children: segments?.map((segment, i) => {
|
|
14
|
+
if (segment.color === 'jet') {
|
|
15
|
+
return (_jsx(HeatmapGraphSVG, { width: `${segment.width}%`, height: 'auto' }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsx(GraphSegment, { color: segment.color, width: adjustForOnePercent ? adjustBarSegmentWidth(segment.width) : segment.width }, i));
|
|
18
|
+
}) }));
|
|
19
|
+
};
|
|
20
|
+
const AnalysisBar = ({ componentType = 'analysisBar', expressionValue, caption, expressionLevels, segments, isDimmed = false, }) => {
|
|
21
|
+
const hasAdjustedOnePercentSegment = segments?.[0].width === 1;
|
|
22
|
+
return (_jsxs(AnalysisBarOuter, { className: "analysis-bar", isDimmed: isDimmed, children: [_jsxs(AnalysisBarSegmentContainer, { children: [expressionValue && (_jsx(GraphScoreIndicator, { adjustForOnePercent: hasAdjustedOnePercentSegment, value: expressionValue })), _jsx(Segments, { segments: segments, adjustForOnePercent: hasAdjustedOnePercentSegment })] }), _jsxs(AxisLabels, { children: [expressionLevels.map((val, i) => {
|
|
23
|
+
return (_jsx(GraphAxisLabel, { label: val, adjustForOnePercent: hasAdjustedOnePercentSegment, leftPos: parseStringValToNumber(val) }, i));
|
|
24
|
+
}), caption && (_jsx(GraphAxisLabel, { label: caption, adjustForOnePercent: hasAdjustedOnePercentSegment, leftPos: 50 }))] })] }));
|
|
25
|
+
};
|
|
26
|
+
export default AnalysisBar;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
export declare const AnalysisBarOuter: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
|
+
isDimmed: boolean;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export declare const AnalysisBarSegmentContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
9
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
10
|
+
export declare const GraphScoreIndicator: ({ value, adjustForOnePercent, }: {
|
|
11
|
+
value: string;
|
|
12
|
+
adjustForOnePercent: boolean;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const GraphAxisLabel: ({ label, leftPos, adjustForOnePercent, }: {
|
|
15
|
+
label: string;
|
|
16
|
+
leftPos: number;
|
|
17
|
+
adjustForOnePercent: boolean;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const AxisLabels: ({ children }: {
|
|
20
|
+
percent?: boolean;
|
|
21
|
+
} & PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const AnalysisBarCaption: ({ label }: {
|
|
23
|
+
label: string;
|
|
24
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
interface GraphSegmentProps {
|
|
26
|
+
color: string | undefined;
|
|
27
|
+
width: number;
|
|
28
|
+
square?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const GraphSegment: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & GraphSegmentProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, styled, Typography } from '@mui/material';
|
|
3
|
+
import { adjustBarLabelPosition, clampBarLabelPosition, parseStringValToNumber, } from './AnalysisBar.utils';
|
|
4
|
+
export const AnalysisBarOuter = styled(Box, {
|
|
5
|
+
shouldForwardProp: (prop) => prop !== 'isDimmed',
|
|
6
|
+
})(({ isDimmed }) => ({
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
width: '100%',
|
|
11
|
+
gap: '4px',
|
|
12
|
+
opacity: isDimmed ? 0.4 : 1,
|
|
13
|
+
}));
|
|
14
|
+
export const AnalysisBarSegmentContainer = styled(Box)(() => ({
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
position: 'relative',
|
|
18
|
+
width: '100%',
|
|
19
|
+
}));
|
|
20
|
+
const GraphScoreIndicatorContainer = styled('span')(() => {
|
|
21
|
+
return {
|
|
22
|
+
width: '20px',
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
top: '-20px',
|
|
28
|
+
zIndex: 999,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
const GraphScoreIndicatorPip = styled('span')(() => {
|
|
32
|
+
return {
|
|
33
|
+
height: '8px !important',
|
|
34
|
+
width: '8px !important',
|
|
35
|
+
borderRadius: '50%',
|
|
36
|
+
border: '3px solid black',
|
|
37
|
+
background: 'white',
|
|
38
|
+
boxSizing: 'content-box',
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
export const GraphScoreIndicator = ({ value, adjustForOnePercent, }) => {
|
|
42
|
+
let leftPos = parseStringValToNumber(value);
|
|
43
|
+
if (adjustForOnePercent) {
|
|
44
|
+
leftPos = adjustBarLabelPosition(leftPos);
|
|
45
|
+
}
|
|
46
|
+
return (_jsxs(GraphScoreIndicatorContainer, { className: "analysis-bar-score-indicator", sx: {
|
|
47
|
+
left: `${leftPos}%`,
|
|
48
|
+
transform: 'translateX(-50%)',
|
|
49
|
+
}, children: [_jsx(Typography, { variant: "small_body_sb1", sx: { textAlign: 'center' }, children: value }), _jsx(GraphScoreIndicatorPip, {})] }));
|
|
50
|
+
};
|
|
51
|
+
const GraphAxisLabelContainer = styled('span')(() => {
|
|
52
|
+
return {
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
width: 'auto',
|
|
55
|
+
height: '10px',
|
|
56
|
+
display: 'flex',
|
|
57
|
+
justifyContent: 'center',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
export const GraphAxisLabel = ({ label, leftPos, adjustForOnePercent, }) => {
|
|
62
|
+
const getLeft = (value, adjustForOnePercent) => {
|
|
63
|
+
if (adjustForOnePercent) {
|
|
64
|
+
return `${adjustBarLabelPosition(value)}%`;
|
|
65
|
+
}
|
|
66
|
+
return `${clampBarLabelPosition(value)}%`;
|
|
67
|
+
};
|
|
68
|
+
return (_jsx(GraphAxisLabelContainer, { sx: {
|
|
69
|
+
left: getLeft(leftPos, adjustForOnePercent),
|
|
70
|
+
transform: 'translateX(-50%)',
|
|
71
|
+
}, className: "analysis-bar-axis-label", children: _jsx(Typography, { variant: "small_body_m5", sx: { textAlign: 'center' }, children: label }) }));
|
|
72
|
+
};
|
|
73
|
+
export const AxisLabels = ({ children }) => {
|
|
74
|
+
return (_jsx(Box, { sx: {
|
|
75
|
+
position: 'relative',
|
|
76
|
+
display: 'flex',
|
|
77
|
+
justifyContent: 'space-between',
|
|
78
|
+
width: '100%',
|
|
79
|
+
height: '10px',
|
|
80
|
+
}, className: "analysis-bar-axis-label-box", children: children }));
|
|
81
|
+
};
|
|
82
|
+
export const AnalysisBarCaption = ({ label }) => {
|
|
83
|
+
return (_jsx(GraphAxisLabelContainer, { sx: {
|
|
84
|
+
left: '50%',
|
|
85
|
+
transform: 'translateX(-50%)',
|
|
86
|
+
width: 'auto',
|
|
87
|
+
}, className: "analysis-bar-caption", children: _jsx(Typography, { variant: "small_body_m5", sx: { textAlign: 'center' }, children: label }) }));
|
|
88
|
+
};
|
|
89
|
+
const segmentStyle = (color, width, square) => {
|
|
90
|
+
return {
|
|
91
|
+
backgroundColor: color,
|
|
92
|
+
width: `${width}%`,
|
|
93
|
+
height: '8px',
|
|
94
|
+
borderRadius: square ? '0px' : '12px',
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export const GraphSegment = styled('span', {
|
|
98
|
+
shouldForwardProp: (prop) => !['color', 'width', 'square'].includes(prop.toString()),
|
|
99
|
+
})(({ color, width, square }) => {
|
|
100
|
+
return {
|
|
101
|
+
...segmentStyle(color ?? 'red', width, square ?? false), // fallback color
|
|
102
|
+
};
|
|
103
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function parseStringValToNumber(val: string): number;
|
|
2
|
+
export declare function adjustBarSegmentWidth(value: number): number;
|
|
3
|
+
export declare function adjustBarLabelPosition(value: number): number;
|
|
4
|
+
export declare function clampNumericalPercentage(value: number): number;
|
|
5
|
+
export declare function clampBarLabelPosition(value: number): number;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function parseStringValToNumber(val) {
|
|
2
|
+
const value = val.endsWith('%') ? val.slice(0, -1) : val;
|
|
3
|
+
return parseInt(value, 10);
|
|
4
|
+
}
|
|
5
|
+
export function adjustBarSegmentWidth(value) {
|
|
6
|
+
if (value === 0)
|
|
7
|
+
return 0;
|
|
8
|
+
const adjusted = Math.floor((value / 100) * 97);
|
|
9
|
+
return adjusted + 4;
|
|
10
|
+
}
|
|
11
|
+
export function adjustBarLabelPosition(value) {
|
|
12
|
+
if (value === 0)
|
|
13
|
+
return 1;
|
|
14
|
+
if (value === 1)
|
|
15
|
+
return 4;
|
|
16
|
+
if (value === 100)
|
|
17
|
+
return 98;
|
|
18
|
+
const adjusted = Math.floor((value / 100) * 93);
|
|
19
|
+
return adjusted + 6;
|
|
20
|
+
}
|
|
21
|
+
export function clampNumericalPercentage(value) {
|
|
22
|
+
if (value >= 100)
|
|
23
|
+
return 100;
|
|
24
|
+
if (value <= 0)
|
|
25
|
+
return 0;
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
export function clampBarLabelPosition(value) {
|
|
29
|
+
if (value >= 100)
|
|
30
|
+
return 97;
|
|
31
|
+
if (value <= 0)
|
|
32
|
+
return 1;
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const HeatmapGraphSVG = (props) => (_jsxs("svg", { width: "234", height: "8", 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
|
+
export default HeatmapGraphSVG;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import SvgIcon from '@mui/material/SvgIcon';
|
|
3
|
+
import HeatmapGraph from './HeatmapGraphSVG';
|
|
4
|
+
const HeatmapGraphIcon = (props) => {
|
|
5
|
+
return (_jsx(SvgIcon, { ...props, component: HeatmapGraph, inheritViewBox: true }));
|
|
6
|
+
};
|
|
7
|
+
HeatmapGraphIcon.displayName = 'HeatmapGraphIcon';
|
|
8
|
+
export default HeatmapGraphIcon;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import theme from '../../theme';
|
|
4
|
+
import { PresentationTypography } from '../presentations.styled';
|
|
5
|
+
const FreeText = ({ componentType = 'freeText', size = 'medium', content, height, background = false, }) => {
|
|
6
|
+
return (_jsx(Box, { sx: {
|
|
7
|
+
padding: background ? '8px 6px 8px 16px' : 0,
|
|
8
|
+
borderRadius: background ? '8px' : 0,
|
|
9
|
+
backgroundColor: background ? theme.palette.neutralGrey[75] : 'transparent',
|
|
10
|
+
height: height ? height : 'auto',
|
|
11
|
+
}, children: _jsx(PresentationTypography, { size: size, sx: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
whiteSpace: 'pre-wrap',
|
|
14
|
+
overflow: 'auto',
|
|
15
|
+
color: background ? '#FFFFFF' : 'inherit',
|
|
16
|
+
height: height ? '100%' : 'auto',
|
|
17
|
+
'&::-webkit-scrollbar': {
|
|
18
|
+
width: '12px',
|
|
19
|
+
},
|
|
20
|
+
'&::-webkit-scrollbar-thumb': {
|
|
21
|
+
width: '6px',
|
|
22
|
+
backgroundColor: theme.palette.neutralGrey[65],
|
|
23
|
+
borderRadius: '6px',
|
|
24
|
+
},
|
|
25
|
+
}, children: content }) }));
|
|
26
|
+
};
|
|
27
|
+
export default FreeText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Box } from '@mui/material';
|
|
4
|
+
import { HistogramContainer, HistogramChartContainer, HistogramTitle, HistogramNoData, } from './Histogram.styled';
|
|
5
|
+
import HistogramTabs from './HistogramTabs';
|
|
6
|
+
import HistogramChart from './HistogramCharts';
|
|
7
|
+
const Histogram = ({ componentType = 'histogram', title, xAxisLabels, yAxisLabels, tabs, }) => {
|
|
8
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
9
|
+
const noData = tabs[activeIndex].data.length === 0;
|
|
10
|
+
return (_jsxs(HistogramContainer, { children: [noData && _jsx(HistogramNoData, { children: "No Data" }), title && _jsx(HistogramTitle, { children: title }), _jsx(HistogramTabs, { options: tabs.map((tab) => tab.label), active: activeIndex, onChange: setActiveIndex }), _jsx(HistogramChartContainer, { children: _jsx(Box, { sx: {
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
left: '-25px',
|
|
13
|
+
}, children: _jsx(HistogramChart, { dataset: tabs[activeIndex], xAxisLabels: xAxisLabels, yAxisLabels: yAxisLabels }) }) })] }));
|
|
14
|
+
};
|
|
15
|
+
export default Histogram;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const HistogramContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
+
export declare const HistogramTitle: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
6
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
7
|
+
}, "width" | "zIndex" | "typography" | "color" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textTransform" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "top" | "visibility" | "whiteSpace" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "style" | "classes" | "className" | "children" | "sx" | "variant" | "p" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
8
|
+
export declare const HistogramNoData: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
9
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
10
|
+
}, "width" | "zIndex" | "typography" | "color" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "textTransform" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "top" | "visibility" | "whiteSpace" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "style" | "classes" | "className" | "children" | "sx" | "variant" | "p" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
|
+
export declare const HistogramTabsContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
14
|
+
export declare const HistogramChartContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
|
+
export declare const TabButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
18
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
19
|
+
}, "color" | "disabled" | "size" | "style" | "fullWidth" | "classes" | "className" | "children" | "sx" | "variant" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "href" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
20
|
+
component?: import("react").ElementType<any> | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
active?: boolean | undefined;
|
|
23
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Box, Button, styled, Typography } from '@mui/material';
|
|
2
|
+
export const HistogramContainer = styled(Box)({
|
|
3
|
+
display: 'flex',
|
|
4
|
+
flexDirection: 'column',
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
gap: '5px',
|
|
7
|
+
position: 'relative',
|
|
8
|
+
});
|
|
9
|
+
export const HistogramTitle = styled(Typography)({
|
|
10
|
+
width: '100%',
|
|
11
|
+
paddingBottom: '12px',
|
|
12
|
+
});
|
|
13
|
+
export const HistogramNoData = styled(Typography)(({ theme }) => ({
|
|
14
|
+
top: '42%',
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
padding: '8px 16px',
|
|
17
|
+
borderRadius: '4px',
|
|
18
|
+
background: theme.palette.neutralGrey[75],
|
|
19
|
+
zIndex: 9999,
|
|
20
|
+
}));
|
|
21
|
+
export const HistogramTabsContainer = styled(Box)({
|
|
22
|
+
width: '100%',
|
|
23
|
+
display: 'grid',
|
|
24
|
+
gridTemplateColumns: '1fr 1fr',
|
|
25
|
+
});
|
|
26
|
+
export const HistogramChartContainer = styled(Box)({
|
|
27
|
+
position: 'relative',
|
|
28
|
+
height: '200px',
|
|
29
|
+
width: '244px',
|
|
30
|
+
marginBottom: '32px',
|
|
31
|
+
});
|
|
32
|
+
export const TabButton = styled(Button, {
|
|
33
|
+
shouldForwardProp: (prop) => prop !== 'active',
|
|
34
|
+
})(({ theme, active = false }) => ({
|
|
35
|
+
borderRadius: '8px',
|
|
36
|
+
backgroundColor: active ? theme.palette.neutralGrey[75] : 'transparent',
|
|
37
|
+
border: `1px solid ${theme.palette.neutralGrey[75]} !important`,
|
|
38
|
+
textTransform: 'none',
|
|
39
|
+
color: active ? theme.palette.neutralGrey[0] : theme.palette.neutralGrey[45],
|
|
40
|
+
cursor: active ? 'default' : 'pointer',
|
|
41
|
+
height: '28px',
|
|
42
|
+
width: '128px',
|
|
43
|
+
minWidth: '128px',
|
|
44
|
+
'&:hover': {
|
|
45
|
+
backgroundColor: active ? theme.palette.neutralGrey[75] : 'transparent',
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface HistogramTab {
|
|
2
|
+
label: string;
|
|
3
|
+
data: number[];
|
|
4
|
+
}
|
|
5
|
+
export interface HistogramProps {
|
|
6
|
+
componentType: 'histogram';
|
|
7
|
+
title?: string;
|
|
8
|
+
xAxisLabels: number[];
|
|
9
|
+
yAxisLabels: number[];
|
|
10
|
+
tabs: HistogramTab[];
|
|
11
|
+
}
|
|
12
|
+
export interface HistogramTabsProps {
|
|
13
|
+
options: string[];
|
|
14
|
+
active: number;
|
|
15
|
+
onChange: (index: number) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface HistogramChartProps {
|
|
18
|
+
dataset: HistogramTab;
|
|
19
|
+
xAxisLabels: number[];
|
|
20
|
+
yAxisLabels: number[];
|
|
21
|
+
}
|
|
22
|
+
interface HistogramDatapoint {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
}
|
|
26
|
+
export type VictoryStructuredData = HistogramDatapoint[];
|
|
27
|
+
export {};
|