@monolith-forensics/monolith-ui 1.8.0 → 1.8.1-dev.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/BarChart/BarChart.d.ts +3 -0
- package/dist/BarChart/BarChart.js +511 -0
- package/dist/BarChart/BarChart.lib.d.ts +31 -0
- package/dist/BarChart/BarChart.lib.js +136 -0
- package/dist/BarChart/BarChart.styled.d.ts +49 -0
- package/dist/BarChart/BarChart.styled.js +111 -0
- package/dist/BarChart/BarChart.types.d.ts +170 -0
- package/dist/BarChart/BarChart.types.js +1 -0
- package/dist/BarChart/index.d.ts +3 -0
- package/dist/BarChart/index.js +2 -0
- package/dist/Button/Button.js +9 -58
- package/dist/Calendar/Calendar.d.ts +3 -1
- package/dist/Calendar/Calendar.js +134 -33
- package/dist/Calendar/CalendarStyles.d.ts +3 -0
- package/dist/Calendar/CalendarStyles.js +92 -14
- package/dist/Calendar/calendarHelpers.d.ts +5 -1
- package/dist/Calendar/calendarHelpers.js +13 -5
- package/dist/ChartPrimitives/chartLegend.styled.d.ts +12 -0
- package/dist/ChartPrimitives/chartLegend.styled.js +52 -0
- package/dist/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
- package/dist/ChartPrimitives/chartTooltip.styled.js +61 -0
- package/dist/ChartPrimitives/index.d.ts +2 -0
- package/dist/ChartPrimitives/index.js +2 -0
- package/dist/ChartUtils/chartColors.d.ts +8 -0
- package/dist/ChartUtils/chartColors.js +65 -0
- package/dist/ChartUtils/chartMath.d.ts +3 -0
- package/dist/ChartUtils/chartMath.js +3 -0
- package/dist/ChartUtils/index.d.ts +2 -0
- package/dist/ChartUtils/index.js +2 -0
- package/dist/Charts/BarChart/BarChart.d.ts +5 -0
- package/dist/Charts/BarChart/BarChart.js +549 -0
- package/dist/Charts/BarChart/BarChart.lib.d.ts +31 -0
- package/dist/Charts/BarChart/BarChart.lib.js +136 -0
- package/dist/Charts/BarChart/BarChart.styled.d.ts +51 -0
- package/dist/Charts/BarChart/BarChart.styled.js +115 -0
- package/dist/Charts/BarChart/BarChart.types.d.ts +171 -0
- package/dist/Charts/BarChart/BarChart.types.js +1 -0
- package/dist/Charts/BarChart/index.d.ts +3 -0
- package/dist/Charts/BarChart/index.js +2 -0
- package/dist/Charts/ChartPrimitives/ChartExportControl.d.ts +11 -0
- package/dist/Charts/ChartPrimitives/ChartExportControl.js +29 -0
- package/dist/Charts/ChartPrimitives/chartActions.styled.d.ts +1 -0
- package/dist/Charts/ChartPrimitives/chartActions.styled.js +8 -0
- package/dist/Charts/ChartPrimitives/chartLegend.styled.d.ts +12 -0
- package/dist/Charts/ChartPrimitives/chartLegend.styled.js +52 -0
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.js +61 -0
- package/dist/Charts/ChartPrimitives/index.d.ts +4 -0
- package/dist/Charts/ChartPrimitives/index.js +4 -0
- package/dist/Charts/ChartUtils/chartColors.d.ts +8 -0
- package/dist/Charts/ChartUtils/chartColors.js +65 -0
- package/dist/Charts/ChartUtils/chartExport.d.ts +47 -0
- package/dist/Charts/ChartUtils/chartExport.js +311 -0
- package/dist/Charts/ChartUtils/chartMath.d.ts +3 -0
- package/dist/Charts/ChartUtils/chartMath.js +3 -0
- package/dist/Charts/ChartUtils/index.d.ts +3 -0
- package/dist/Charts/ChartUtils/index.js +3 -0
- package/dist/Charts/HeatMap/HeatMap.d.ts +5 -0
- package/dist/Charts/HeatMap/HeatMap.js +212 -0
- package/dist/Charts/HeatMap/HeatMap.lib.d.ts +30 -0
- package/dist/Charts/HeatMap/HeatMap.lib.js +115 -0
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +37 -0
- package/dist/Charts/HeatMap/HeatMap.styled.js +91 -0
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +80 -0
- package/dist/Charts/HeatMap/HeatMap.types.js +1 -0
- package/dist/Charts/HeatMap/index.d.ts +3 -0
- package/dist/Charts/HeatMap/index.js +2 -0
- package/dist/Charts/LineChart/LineChart.d.ts +5 -0
- package/dist/Charts/LineChart/LineChart.js +529 -0
- package/dist/Charts/LineChart/LineChart.lib.d.ts +24 -0
- package/dist/Charts/LineChart/LineChart.lib.js +132 -0
- package/dist/Charts/LineChart/LineChart.styled.d.ts +59 -0
- package/dist/Charts/LineChart/LineChart.styled.js +147 -0
- package/dist/Charts/LineChart/LineChart.types.d.ts +193 -0
- package/dist/Charts/LineChart/LineChart.types.js +1 -0
- package/dist/Charts/LineChart/index.d.ts +3 -0
- package/dist/Charts/LineChart/index.js +2 -0
- package/dist/Charts/PieChart/PieChart.d.ts +4 -0
- package/dist/Charts/PieChart/PieChart.js +199 -0
- package/dist/Charts/PieChart/PieChart.lib.d.ts +5 -0
- package/dist/Charts/PieChart/PieChart.lib.js +19 -0
- package/dist/Charts/PieChart/PieChart.styled.d.ts +51 -0
- package/dist/Charts/PieChart/PieChart.styled.js +163 -0
- package/dist/Charts/PieChart/PieChart.types.d.ts +100 -0
- package/dist/Charts/PieChart/PieChart.types.js +1 -0
- package/dist/Charts/PieChart/index.d.ts +2 -0
- package/dist/Charts/PieChart/index.js +1 -0
- package/dist/Charts/index.d.ts +5 -0
- package/dist/Charts/index.js +4 -0
- package/dist/CheckBox/CheckBox.js +2 -16
- package/dist/DateInput/DateInput.js +198 -143
- package/dist/DropDownMenu/components/MenuComponent.js +2 -1
- package/dist/DropDownMenu/components/MenuItem.js +5 -14
- package/dist/DropDownMenu/components/MenuItemList.js +7 -24
- package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
- package/dist/FieldLabel/FieldLabel.js +4 -12
- package/dist/FileInputField/FileInputField.js +4 -23
- package/dist/FormSection/FormSection.js +5 -25
- package/dist/HeatMap/HeatMap.d.ts +3 -0
- package/dist/HeatMap/HeatMap.js +174 -0
- package/dist/HeatMap/HeatMap.lib.d.ts +30 -0
- package/dist/HeatMap/HeatMap.lib.js +115 -0
- package/dist/HeatMap/HeatMap.styled.d.ts +34 -0
- package/dist/HeatMap/HeatMap.styled.js +83 -0
- package/dist/HeatMap/HeatMap.types.d.ts +79 -0
- package/dist/HeatMap/HeatMap.types.js +1 -0
- package/dist/HeatMap/index.d.ts +3 -0
- package/dist/HeatMap/index.js +2 -0
- package/dist/IconButton/IconButton.js +2 -16
- package/dist/Input/Input.js +7 -56
- package/dist/LineChart/LineChart.d.ts +3 -0
- package/dist/LineChart/LineChart.js +491 -0
- package/dist/LineChart/LineChart.lib.d.ts +24 -0
- package/dist/LineChart/LineChart.lib.js +132 -0
- package/dist/LineChart/LineChart.styled.d.ts +57 -0
- package/dist/LineChart/LineChart.styled.js +150 -0
- package/dist/LineChart/LineChart.types.d.ts +192 -0
- package/dist/LineChart/LineChart.types.js +1 -0
- package/dist/LineChart/index.d.ts +3 -0
- package/dist/LineChart/index.js +2 -0
- package/dist/PieChart/PieChart.d.ts +2 -0
- package/dist/PieChart/PieChart.js +161 -0
- package/dist/PieChart/PieChart.lib.d.ts +5 -0
- package/dist/PieChart/PieChart.lib.js +19 -0
- package/dist/PieChart/PieChart.styled.d.ts +49 -0
- package/dist/PieChart/PieChart.styled.js +161 -0
- package/dist/PieChart/PieChart.types.d.ts +99 -0
- package/dist/PieChart/PieChart.types.js +1 -0
- package/dist/PieChart/index.d.ts +2 -0
- package/dist/PieChart/index.js +1 -0
- package/dist/Pill/Pill.js +8 -79
- package/dist/Popover/Popover.context.d.ts +2 -1
- package/dist/Popover/Popover.js +5 -2
- package/dist/Popover/Popover.styles.d.ts +1 -6
- package/dist/Popover/Popover.styles.js +11 -28
- package/dist/Popover/Popover.transitions.d.ts +4 -2
- package/dist/Popover/Popover.transitions.js +23 -49
- package/dist/Popover/PopoverDropdown.js +6 -8
- package/dist/Popover/PopoverTarget.js +6 -3
- package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControl.utils.js +3 -30
- package/dist/SelectBox/SelectBox.js +3 -3
- package/dist/SelectBox/select-box.styled-components.d.ts +3 -1
- package/dist/SelectBox/select-box.styled-components.js +10 -48
- package/dist/SuperDatePicker/SuperDatePicker.d.ts +74 -0
- package/dist/SuperDatePicker/SuperDatePicker.js +557 -0
- package/dist/SuperDatePicker/index.d.ts +2 -0
- package/dist/SuperDatePicker/index.js +2 -0
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.js +18 -83
- package/dist/Table/StateStorage.d.ts +4 -0
- package/dist/Table/StateStorage.js +13 -0
- package/dist/Table/Table.js +160 -12
- package/dist/Table/TableComponents.d.ts +10 -0
- package/dist/Table/TableComponents.js +57 -0
- package/dist/Table/TableDefaults.d.ts +7 -0
- package/dist/Table/TableDefaults.js +7 -0
- package/dist/Table/TableProvider.js +263 -71
- package/dist/Table/TableRow.js +15 -10
- package/dist/Table/types.d.ts +64 -0
- package/dist/TagBox/TagBox.js +18 -76
- package/dist/TextArea/TextArea.js +4 -23
- package/dist/TextInput/TextInput.js +12 -6
- package/dist/Utilities/parseTimestamp.js +11 -6
- package/dist/core/ArrowButton.d.ts +2 -0
- package/dist/core/ArrowButton.js +7 -3
- package/dist/core/ClearButton.d.ts +2 -0
- package/dist/core/ClearButton.js +7 -3
- package/dist/core/controlSizes.d.ts +34 -0
- package/dist/core/controlSizes.js +190 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
export const StyledChartTooltip = styled.div `
|
|
3
|
+
position: absolute;
|
|
4
|
+
z-index: 1;
|
|
5
|
+
min-width: ${({ $minWidth = 120 }) => $minWidth}px;
|
|
6
|
+
max-width: ${({ $maxWidth = 220 }) => $maxWidth}px;
|
|
7
|
+
padding: 7px 9px;
|
|
8
|
+
border: 1px solid ${({ theme }) => theme.palette.divider};
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
background: ${({ theme }) => theme.palette.background.paper};
|
|
11
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
12
|
+
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
line-height: 1.35;
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
transform: ${({ $transform = "translate(10px, -50%)" }) => $transform};
|
|
17
|
+
`;
|
|
18
|
+
export const StyledChartTooltipHeader = styled.div `
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 7px;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
`;
|
|
25
|
+
export const StyledChartTooltipSwatch = styled.span `
|
|
26
|
+
width: 8px;
|
|
27
|
+
height: 8px;
|
|
28
|
+
flex: 0 0 auto;
|
|
29
|
+
border-radius: ${({ $radius = "2px" }) => $radius};
|
|
30
|
+
background: ${({ $color }) => $color};
|
|
31
|
+
`;
|
|
32
|
+
export const StyledChartTooltipLabel = styled.span `
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
`;
|
|
37
|
+
export const StyledChartTooltipMeta = styled.div `
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: ${({ $direction = "row" }) => $direction};
|
|
40
|
+
gap: ${({ $gap = 8 }) => $gap}px;
|
|
41
|
+
margin-top: ${({ $marginTop = 3 }) => $marginTop}px;
|
|
42
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
43
|
+
font-variant-numeric: tabular-nums;
|
|
44
|
+
`;
|
|
45
|
+
export const StyledChartTooltipList = styled.div `
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: 5px;
|
|
49
|
+
margin-top: 8px;
|
|
50
|
+
`;
|
|
51
|
+
export const StyledChartTooltipRow = styled.div `
|
|
52
|
+
display: grid;
|
|
53
|
+
grid-template-columns: 8px minmax(0, 1fr) auto;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 7px;
|
|
56
|
+
`;
|
|
57
|
+
export const StyledChartTooltipValue = styled.span `
|
|
58
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
59
|
+
font-variant-numeric: tabular-nums;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ChartColorGradientInput = string[] | {
|
|
2
|
+
from: string;
|
|
3
|
+
to: string;
|
|
4
|
+
} | null | undefined;
|
|
5
|
+
export declare const mixColors: (from: string, to: string, amount: number) => string;
|
|
6
|
+
export declare const getGradientStops: (colorGradient?: ChartColorGradientInput) => string[] | null;
|
|
7
|
+
export declare const getGradientColorFromStops: (stops: string[] | null | undefined, index: number, total: number) => string | undefined;
|
|
8
|
+
export declare const getGradientColor: (colorGradient: ChartColorGradientInput, index: number, total: number) => string | undefined;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { clamp } from "./chartMath";
|
|
2
|
+
const parseColor = (color) => {
|
|
3
|
+
const trimmedColor = color.trim();
|
|
4
|
+
const hexMatch = trimmedColor.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
|
|
5
|
+
if (hexMatch) {
|
|
6
|
+
const normalizedHex = hexMatch[1].length === 3
|
|
7
|
+
? hexMatch[1]
|
|
8
|
+
.split("")
|
|
9
|
+
.map((character) => character + character)
|
|
10
|
+
.join("")
|
|
11
|
+
: hexMatch[1];
|
|
12
|
+
return {
|
|
13
|
+
r: parseInt(normalizedHex.slice(0, 2), 16),
|
|
14
|
+
g: parseInt(normalizedHex.slice(2, 4), 16),
|
|
15
|
+
b: parseInt(normalizedHex.slice(4, 6), 16),
|
|
16
|
+
a: 1,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const rgbMatch = trimmedColor.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/i);
|
|
20
|
+
if (!rgbMatch) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
r: clamp(Number(rgbMatch[1]), 0, 255),
|
|
25
|
+
g: clamp(Number(rgbMatch[2]), 0, 255),
|
|
26
|
+
b: clamp(Number(rgbMatch[3]), 0, 255),
|
|
27
|
+
a: rgbMatch[4] ? clamp(Number(rgbMatch[4]), 0, 1) : 1,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export const mixColors = (from, to, amount) => {
|
|
31
|
+
const normalizedAmount = clamp(amount, 0, 1);
|
|
32
|
+
if (normalizedAmount === 0)
|
|
33
|
+
return from;
|
|
34
|
+
if (normalizedAmount === 1)
|
|
35
|
+
return to;
|
|
36
|
+
const fromColor = parseColor(from);
|
|
37
|
+
const toColor = parseColor(to);
|
|
38
|
+
if (!fromColor || !toColor) {
|
|
39
|
+
return `color-mix(in srgb, ${from} ${(1 - normalizedAmount) * 100}%, ${to})`;
|
|
40
|
+
}
|
|
41
|
+
const r = Math.round(fromColor.r + (toColor.r - fromColor.r) * normalizedAmount);
|
|
42
|
+
const g = Math.round(fromColor.g + (toColor.g - fromColor.g) * normalizedAmount);
|
|
43
|
+
const b = Math.round(fromColor.b + (toColor.b - fromColor.b) * normalizedAmount);
|
|
44
|
+
const a = fromColor.a + (toColor.a - fromColor.a) * normalizedAmount;
|
|
45
|
+
return a === 1 ? `rgb(${r}, ${g}, ${b})` : `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
46
|
+
};
|
|
47
|
+
export const getGradientStops = (colorGradient) => {
|
|
48
|
+
if (!colorGradient)
|
|
49
|
+
return null;
|
|
50
|
+
return Array.isArray(colorGradient)
|
|
51
|
+
? colorGradient.filter(Boolean)
|
|
52
|
+
: [colorGradient.from, colorGradient.to].filter(Boolean);
|
|
53
|
+
};
|
|
54
|
+
export const getGradientColorFromStops = (stops, index, total) => {
|
|
55
|
+
if (!(stops === null || stops === void 0 ? void 0 : stops.length))
|
|
56
|
+
return undefined;
|
|
57
|
+
if (stops.length === 1 || total <= 1)
|
|
58
|
+
return stops[0];
|
|
59
|
+
const progress = index / (total - 1);
|
|
60
|
+
const scaledProgress = progress * (stops.length - 1);
|
|
61
|
+
const stopIndex = Math.min(Math.floor(scaledProgress), stops.length - 2);
|
|
62
|
+
const stopProgress = scaledProgress - stopIndex;
|
|
63
|
+
return mixColors(stops[stopIndex], stops[stopIndex + 1], stopProgress);
|
|
64
|
+
};
|
|
65
|
+
export const getGradientColor = (colorGradient, index, total) => getGradientColorFromStops(getGradientStops(colorGradient), index, total);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactElement, RefAttributes } from "react";
|
|
2
|
+
import { ChartHandle } from "../ChartUtils";
|
|
3
|
+
import { BarChartProps } from "./BarChart.types";
|
|
4
|
+
export declare const BarChart: <TData>(props: BarChartProps<TData> & RefAttributes<ChartHandle>) => ReactElement | null;
|
|
5
|
+
export default BarChart;
|