@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.
Files changed (175) hide show
  1. package/dist/BarChart/BarChart.d.ts +3 -0
  2. package/dist/BarChart/BarChart.js +511 -0
  3. package/dist/BarChart/BarChart.lib.d.ts +31 -0
  4. package/dist/BarChart/BarChart.lib.js +136 -0
  5. package/dist/BarChart/BarChart.styled.d.ts +49 -0
  6. package/dist/BarChart/BarChart.styled.js +111 -0
  7. package/dist/BarChart/BarChart.types.d.ts +170 -0
  8. package/dist/BarChart/BarChart.types.js +1 -0
  9. package/dist/BarChart/index.d.ts +3 -0
  10. package/dist/BarChart/index.js +2 -0
  11. package/dist/Button/Button.js +9 -58
  12. package/dist/Calendar/Calendar.d.ts +3 -1
  13. package/dist/Calendar/Calendar.js +134 -33
  14. package/dist/Calendar/CalendarStyles.d.ts +3 -0
  15. package/dist/Calendar/CalendarStyles.js +92 -14
  16. package/dist/Calendar/calendarHelpers.d.ts +5 -1
  17. package/dist/Calendar/calendarHelpers.js +13 -5
  18. package/dist/ChartPrimitives/chartLegend.styled.d.ts +12 -0
  19. package/dist/ChartPrimitives/chartLegend.styled.js +52 -0
  20. package/dist/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
  21. package/dist/ChartPrimitives/chartTooltip.styled.js +61 -0
  22. package/dist/ChartPrimitives/index.d.ts +2 -0
  23. package/dist/ChartPrimitives/index.js +2 -0
  24. package/dist/ChartUtils/chartColors.d.ts +8 -0
  25. package/dist/ChartUtils/chartColors.js +65 -0
  26. package/dist/ChartUtils/chartMath.d.ts +3 -0
  27. package/dist/ChartUtils/chartMath.js +3 -0
  28. package/dist/ChartUtils/index.d.ts +2 -0
  29. package/dist/ChartUtils/index.js +2 -0
  30. package/dist/Charts/BarChart/BarChart.d.ts +5 -0
  31. package/dist/Charts/BarChart/BarChart.js +549 -0
  32. package/dist/Charts/BarChart/BarChart.lib.d.ts +31 -0
  33. package/dist/Charts/BarChart/BarChart.lib.js +136 -0
  34. package/dist/Charts/BarChart/BarChart.styled.d.ts +51 -0
  35. package/dist/Charts/BarChart/BarChart.styled.js +115 -0
  36. package/dist/Charts/BarChart/BarChart.types.d.ts +171 -0
  37. package/dist/Charts/BarChart/BarChart.types.js +1 -0
  38. package/dist/Charts/BarChart/index.d.ts +3 -0
  39. package/dist/Charts/BarChart/index.js +2 -0
  40. package/dist/Charts/ChartPrimitives/ChartExportControl.d.ts +11 -0
  41. package/dist/Charts/ChartPrimitives/ChartExportControl.js +29 -0
  42. package/dist/Charts/ChartPrimitives/chartActions.styled.d.ts +1 -0
  43. package/dist/Charts/ChartPrimitives/chartActions.styled.js +8 -0
  44. package/dist/Charts/ChartPrimitives/chartLegend.styled.d.ts +12 -0
  45. package/dist/Charts/ChartPrimitives/chartLegend.styled.js +52 -0
  46. package/dist/Charts/ChartPrimitives/chartTooltip.styled.d.ts +19 -0
  47. package/dist/Charts/ChartPrimitives/chartTooltip.styled.js +61 -0
  48. package/dist/Charts/ChartPrimitives/index.d.ts +4 -0
  49. package/dist/Charts/ChartPrimitives/index.js +4 -0
  50. package/dist/Charts/ChartUtils/chartColors.d.ts +8 -0
  51. package/dist/Charts/ChartUtils/chartColors.js +65 -0
  52. package/dist/Charts/ChartUtils/chartExport.d.ts +47 -0
  53. package/dist/Charts/ChartUtils/chartExport.js +311 -0
  54. package/dist/Charts/ChartUtils/chartMath.d.ts +3 -0
  55. package/dist/Charts/ChartUtils/chartMath.js +3 -0
  56. package/dist/Charts/ChartUtils/index.d.ts +3 -0
  57. package/dist/Charts/ChartUtils/index.js +3 -0
  58. package/dist/Charts/HeatMap/HeatMap.d.ts +5 -0
  59. package/dist/Charts/HeatMap/HeatMap.js +212 -0
  60. package/dist/Charts/HeatMap/HeatMap.lib.d.ts +30 -0
  61. package/dist/Charts/HeatMap/HeatMap.lib.js +115 -0
  62. package/dist/Charts/HeatMap/HeatMap.styled.d.ts +37 -0
  63. package/dist/Charts/HeatMap/HeatMap.styled.js +91 -0
  64. package/dist/Charts/HeatMap/HeatMap.types.d.ts +80 -0
  65. package/dist/Charts/HeatMap/HeatMap.types.js +1 -0
  66. package/dist/Charts/HeatMap/index.d.ts +3 -0
  67. package/dist/Charts/HeatMap/index.js +2 -0
  68. package/dist/Charts/LineChart/LineChart.d.ts +5 -0
  69. package/dist/Charts/LineChart/LineChart.js +529 -0
  70. package/dist/Charts/LineChart/LineChart.lib.d.ts +24 -0
  71. package/dist/Charts/LineChart/LineChart.lib.js +132 -0
  72. package/dist/Charts/LineChart/LineChart.styled.d.ts +59 -0
  73. package/dist/Charts/LineChart/LineChart.styled.js +147 -0
  74. package/dist/Charts/LineChart/LineChart.types.d.ts +193 -0
  75. package/dist/Charts/LineChart/LineChart.types.js +1 -0
  76. package/dist/Charts/LineChart/index.d.ts +3 -0
  77. package/dist/Charts/LineChart/index.js +2 -0
  78. package/dist/Charts/PieChart/PieChart.d.ts +4 -0
  79. package/dist/Charts/PieChart/PieChart.js +199 -0
  80. package/dist/Charts/PieChart/PieChart.lib.d.ts +5 -0
  81. package/dist/Charts/PieChart/PieChart.lib.js +19 -0
  82. package/dist/Charts/PieChart/PieChart.styled.d.ts +51 -0
  83. package/dist/Charts/PieChart/PieChart.styled.js +163 -0
  84. package/dist/Charts/PieChart/PieChart.types.d.ts +100 -0
  85. package/dist/Charts/PieChart/PieChart.types.js +1 -0
  86. package/dist/Charts/PieChart/index.d.ts +2 -0
  87. package/dist/Charts/PieChart/index.js +1 -0
  88. package/dist/Charts/index.d.ts +5 -0
  89. package/dist/Charts/index.js +4 -0
  90. package/dist/CheckBox/CheckBox.js +2 -16
  91. package/dist/DateInput/DateInput.js +198 -143
  92. package/dist/DropDownMenu/components/MenuComponent.js +2 -1
  93. package/dist/DropDownMenu/components/MenuItem.js +5 -14
  94. package/dist/DropDownMenu/components/MenuItemList.js +7 -24
  95. package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
  96. package/dist/FieldLabel/FieldLabel.js +4 -12
  97. package/dist/FileInputField/FileInputField.js +4 -23
  98. package/dist/FormSection/FormSection.js +5 -25
  99. package/dist/HeatMap/HeatMap.d.ts +3 -0
  100. package/dist/HeatMap/HeatMap.js +174 -0
  101. package/dist/HeatMap/HeatMap.lib.d.ts +30 -0
  102. package/dist/HeatMap/HeatMap.lib.js +115 -0
  103. package/dist/HeatMap/HeatMap.styled.d.ts +34 -0
  104. package/dist/HeatMap/HeatMap.styled.js +83 -0
  105. package/dist/HeatMap/HeatMap.types.d.ts +79 -0
  106. package/dist/HeatMap/HeatMap.types.js +1 -0
  107. package/dist/HeatMap/index.d.ts +3 -0
  108. package/dist/HeatMap/index.js +2 -0
  109. package/dist/IconButton/IconButton.js +2 -16
  110. package/dist/Input/Input.js +7 -56
  111. package/dist/LineChart/LineChart.d.ts +3 -0
  112. package/dist/LineChart/LineChart.js +491 -0
  113. package/dist/LineChart/LineChart.lib.d.ts +24 -0
  114. package/dist/LineChart/LineChart.lib.js +132 -0
  115. package/dist/LineChart/LineChart.styled.d.ts +57 -0
  116. package/dist/LineChart/LineChart.styled.js +150 -0
  117. package/dist/LineChart/LineChart.types.d.ts +192 -0
  118. package/dist/LineChart/LineChart.types.js +1 -0
  119. package/dist/LineChart/index.d.ts +3 -0
  120. package/dist/LineChart/index.js +2 -0
  121. package/dist/PieChart/PieChart.d.ts +2 -0
  122. package/dist/PieChart/PieChart.js +161 -0
  123. package/dist/PieChart/PieChart.lib.d.ts +5 -0
  124. package/dist/PieChart/PieChart.lib.js +19 -0
  125. package/dist/PieChart/PieChart.styled.d.ts +49 -0
  126. package/dist/PieChart/PieChart.styled.js +161 -0
  127. package/dist/PieChart/PieChart.types.d.ts +99 -0
  128. package/dist/PieChart/PieChart.types.js +1 -0
  129. package/dist/PieChart/index.d.ts +2 -0
  130. package/dist/PieChart/index.js +1 -0
  131. package/dist/Pill/Pill.js +8 -79
  132. package/dist/Popover/Popover.context.d.ts +2 -1
  133. package/dist/Popover/Popover.js +5 -2
  134. package/dist/Popover/Popover.styles.d.ts +1 -6
  135. package/dist/Popover/Popover.styles.js +11 -28
  136. package/dist/Popover/Popover.transitions.d.ts +4 -2
  137. package/dist/Popover/Popover.transitions.js +23 -49
  138. package/dist/Popover/PopoverDropdown.js +6 -8
  139. package/dist/Popover/PopoverTarget.js +6 -3
  140. package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
  141. package/dist/SegmentedControl/SegmentedControl.utils.js +3 -30
  142. package/dist/SelectBox/SelectBox.js +3 -3
  143. package/dist/SelectBox/select-box.styled-components.d.ts +3 -1
  144. package/dist/SelectBox/select-box.styled-components.js +10 -48
  145. package/dist/SuperDatePicker/SuperDatePicker.d.ts +74 -0
  146. package/dist/SuperDatePicker/SuperDatePicker.js +557 -0
  147. package/dist/SuperDatePicker/index.d.ts +2 -0
  148. package/dist/SuperDatePicker/index.js +2 -0
  149. package/dist/Switch/Switch.d.ts +2 -2
  150. package/dist/Switch/Switch.js +18 -83
  151. package/dist/Table/StateStorage.d.ts +4 -0
  152. package/dist/Table/StateStorage.js +13 -0
  153. package/dist/Table/Table.js +160 -12
  154. package/dist/Table/TableComponents.d.ts +10 -0
  155. package/dist/Table/TableComponents.js +57 -0
  156. package/dist/Table/TableDefaults.d.ts +7 -0
  157. package/dist/Table/TableDefaults.js +7 -0
  158. package/dist/Table/TableProvider.js +263 -71
  159. package/dist/Table/TableRow.js +15 -10
  160. package/dist/Table/types.d.ts +64 -0
  161. package/dist/TagBox/TagBox.js +18 -76
  162. package/dist/TextArea/TextArea.js +4 -23
  163. package/dist/TextInput/TextInput.js +12 -6
  164. package/dist/Utilities/parseTimestamp.js +11 -6
  165. package/dist/core/ArrowButton.d.ts +2 -0
  166. package/dist/core/ArrowButton.js +7 -3
  167. package/dist/core/ClearButton.d.ts +2 -0
  168. package/dist/core/ClearButton.js +7 -3
  169. package/dist/core/controlSizes.d.ts +34 -0
  170. package/dist/core/controlSizes.js +190 -0
  171. package/dist/core/index.d.ts +1 -0
  172. package/dist/core/index.js +1 -0
  173. package/dist/index.d.ts +1 -0
  174. package/dist/index.js +1 -0
  175. package/package.json +5 -1
@@ -0,0 +1,136 @@
1
+ import { useMemo } from "react";
2
+ import { useTheme } from "styled-components";
3
+ import { clamp, easeOutCubic, formatDefaultValue, getGradientColor, getGradientColorFromStops, getGradientStops, mixColors, } from "../ChartUtils";
4
+ export { clamp, easeOutCubic, formatDefaultValue, getGradientColor, getGradientColorFromStops, getGradientStops, mixColors, };
5
+ export const getBarKey = (datum, index) => { var _a; return (_a = datum.id) !== null && _a !== void 0 ? _a : `${datum.label}-${index}`; };
6
+ export const getSeriesKey = (series, index) => {
7
+ if (series.id != null)
8
+ return series.id;
9
+ if (typeof series.label === "string" || typeof series.label === "number") {
10
+ return String(series.label);
11
+ }
12
+ return `series-${index}`;
13
+ };
14
+ export const getSeriesLabelText = (label, fallbackLabel) => {
15
+ if (typeof label === "string" || typeof label === "number") {
16
+ return String(label);
17
+ }
18
+ return fallbackLabel;
19
+ };
20
+ export const getCategoryKey = (datum) => datum.label;
21
+ export const useThemeColors = (colors) => {
22
+ const theme = useTheme();
23
+ return useMemo(() => (colors === null || colors === void 0 ? void 0 : colors.length)
24
+ ? colors
25
+ : [
26
+ theme.palette.primary.main,
27
+ theme.alert.info.color,
28
+ theme.alert.success.color,
29
+ theme.alert.warning.color,
30
+ theme.alert.error.color,
31
+ theme.palette.fourth.main,
32
+ theme.button.text.secondary,
33
+ ], [colors, theme]);
34
+ };
35
+ export const getBandPadding = (barGap, span, count) => {
36
+ if (count <= 1 || barGap <= 0 || span <= 0) {
37
+ return { inner: 0.08, outer: 0.04 };
38
+ }
39
+ const approximateStep = span / count;
40
+ const inner = clamp(barGap / Math.max(approximateStep, 1), 0, 0.72);
41
+ return {
42
+ inner,
43
+ outer: clamp(inner / 2, 0.04, 0.3),
44
+ };
45
+ };
46
+ export const getValueDomain = (values, minValue, maxValue) => {
47
+ const actualMin = values.length ? Math.min(...values) : 0;
48
+ const actualMax = values.length ? Math.max(...values) : 0;
49
+ const resolvedMin = minValue != null ? Math.min(minValue, 0) : Math.min(actualMin, 0);
50
+ const resolvedMax = maxValue != null ? Math.max(maxValue, 0) : Math.max(actualMax, 0);
51
+ if (resolvedMin === resolvedMax) {
52
+ if (resolvedMin === 0)
53
+ return [0, 1];
54
+ return [Math.min(resolvedMin, 0), Math.max(resolvedMax, 0) + 1];
55
+ }
56
+ return [resolvedMin, resolvedMax];
57
+ };
58
+ export const getDefaultMargin = (orientation, showCategoryAxisLabels, showValueAxisLabels, showLabels) => {
59
+ if (orientation === "horizontal") {
60
+ return {
61
+ top: showLabels ? 22 : 16,
62
+ right: showLabels ? 42 : 24,
63
+ bottom: showValueAxisLabels ? 34 : 18,
64
+ left: showCategoryAxisLabels ? 108 : 18,
65
+ };
66
+ }
67
+ return {
68
+ top: showLabels ? 28 : 16,
69
+ right: 18,
70
+ bottom: showCategoryAxisLabels ? 52 : 18,
71
+ left: showValueAxisLabels ? 52 : 18,
72
+ };
73
+ };
74
+ export const mergeChartMargin = (orientation, margin, showCategoryAxisLabels, showValueAxisLabels, showLabels) => {
75
+ var _a, _b, _c, _d;
76
+ const defaults = getDefaultMargin(orientation, showCategoryAxisLabels, showValueAxisLabels, showLabels);
77
+ return {
78
+ top: (_a = margin === null || margin === void 0 ? void 0 : margin.top) !== null && _a !== void 0 ? _a : defaults.top,
79
+ right: (_b = margin === null || margin === void 0 ? void 0 : margin.right) !== null && _b !== void 0 ? _b : defaults.right,
80
+ bottom: (_c = margin === null || margin === void 0 ? void 0 : margin.bottom) !== null && _c !== void 0 ? _c : defaults.bottom,
81
+ left: (_d = margin === null || margin === void 0 ? void 0 : margin.left) !== null && _d !== void 0 ? _d : defaults.left,
82
+ };
83
+ };
84
+ export const normalizeTickValue = (value) => Math.abs(value) < 1e-9 ? 0 : value;
85
+ export const getRoundedBarPath = ({ x, y, width, height, radius, orientation, value, }) => {
86
+ if (width <= 0 || height <= 0)
87
+ return "";
88
+ const safeRadius = clamp(radius, 0, Math.min(width, height) / 2);
89
+ const right = x + width;
90
+ const bottom = y + height;
91
+ if (safeRadius === 0) {
92
+ return `M ${x} ${y} H ${right} V ${bottom} H ${x} Z`;
93
+ }
94
+ if (orientation === "vertical") {
95
+ if (value >= 0) {
96
+ return [
97
+ `M ${x} ${bottom}`,
98
+ `L ${x} ${y + safeRadius}`,
99
+ `Q ${x} ${y} ${x + safeRadius} ${y}`,
100
+ `L ${right - safeRadius} ${y}`,
101
+ `Q ${right} ${y} ${right} ${y + safeRadius}`,
102
+ `L ${right} ${bottom}`,
103
+ "Z",
104
+ ].join(" ");
105
+ }
106
+ return [
107
+ `M ${x} ${y}`,
108
+ `L ${x} ${bottom - safeRadius}`,
109
+ `Q ${x} ${bottom} ${x + safeRadius} ${bottom}`,
110
+ `L ${right - safeRadius} ${bottom}`,
111
+ `Q ${right} ${bottom} ${right} ${bottom - safeRadius}`,
112
+ `L ${right} ${y}`,
113
+ "Z",
114
+ ].join(" ");
115
+ }
116
+ if (value >= 0) {
117
+ return [
118
+ `M ${x} ${y}`,
119
+ `L ${right - safeRadius} ${y}`,
120
+ `Q ${right} ${y} ${right} ${y + safeRadius}`,
121
+ `L ${right} ${bottom - safeRadius}`,
122
+ `Q ${right} ${bottom} ${right - safeRadius} ${bottom}`,
123
+ `L ${x} ${bottom}`,
124
+ "Z",
125
+ ].join(" ");
126
+ }
127
+ return [
128
+ `M ${right} ${y}`,
129
+ `L ${x + safeRadius} ${y}`,
130
+ `Q ${x} ${y} ${x} ${y + safeRadius}`,
131
+ `L ${x} ${bottom - safeRadius}`,
132
+ `Q ${x} ${bottom} ${x + safeRadius} ${bottom}`,
133
+ `L ${right} ${bottom}`,
134
+ "Z",
135
+ ].join(" ");
136
+ };
@@ -0,0 +1,49 @@
1
+ export declare const StyledContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const StyledChartScroller: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const StyledChartFrame: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
+ export declare const StyledSvg: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGProps<SVGSVGElement>, never>> & string;
5
+ export declare const StyledBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").SVGProps<SVGPathElement>, {
6
+ $active: boolean;
7
+ }>> & string;
8
+ export declare const StyledGridLine: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGLineElementAttributes<SVGLineElement>, never>> & string;
9
+ export declare const StyledAxisLine: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGLineElementAttributes<SVGLineElement>, never>> & string;
10
+ export declare const StyledAxisText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGTextElementAttributes<SVGTextElement>, never>> & string;
11
+ export declare const StyledValueLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGTextElementAttributes<SVGTextElement>, never>> & string;
12
+ export declare const StyledLegend: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
13
+ export declare const StyledLegendItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
14
+ $active: boolean;
15
+ $showSwatch: boolean;
16
+ $showLabel: boolean;
17
+ $showValue: boolean;
18
+ }>> & string;
19
+ export declare const StyledSwatch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
20
+ $color: string;
21
+ $width?: number;
22
+ $height?: number;
23
+ $radius?: number;
24
+ }>> & string;
25
+ export declare const StyledLegendLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
26
+ export declare const StyledLegendValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
27
+ export declare const StyledEmptyState: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
28
+ $width: number;
29
+ $height: number;
30
+ }>> & string;
31
+ export declare const StyledTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
32
+ $minWidth?: number;
33
+ $maxWidth?: number;
34
+ $transform?: string;
35
+ }>> & string;
36
+ export declare const StyledTooltipHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
37
+ export declare const StyledTooltipSwatch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
38
+ $color: string;
39
+ $radius?: string;
40
+ }>> & string;
41
+ export declare const StyledTooltipLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
42
+ export declare const StyledTooltipMeta: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$marginTop" | "$direction" | "$gap"> & {
43
+ $marginTop?: number;
44
+ $direction?: "row" | "column";
45
+ $gap?: number;
46
+ }, never>> & string;
47
+ export declare const StyledTooltipList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
48
+ export declare const StyledTooltipRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
49
+ export declare const StyledTooltipValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
@@ -0,0 +1,111 @@
1
+ import styled from "styled-components";
2
+ import { StyledChartLegend, StyledChartLegendLabel, StyledChartLegendSwatch, StyledChartLegendValue, StyledChartTooltip, StyledChartTooltipHeader, StyledChartTooltipLabel, StyledChartTooltipList, StyledChartTooltipMeta, StyledChartTooltipRow, StyledChartTooltipSwatch, StyledChartTooltipValue, sharedLegendItemStyles, } from "../ChartPrimitives";
3
+ const activeBarStyles = `
4
+ opacity: 0.98;
5
+ filter: brightness(1.1) saturate(1.08);
6
+ transform: scale(1.01);
7
+ `;
8
+ export const StyledContainer = styled.div `
9
+ position: relative;
10
+ display: flex;
11
+ align-items: flex-start;
12
+ flex-wrap: wrap;
13
+ gap: 20px;
14
+ width: fit-content;
15
+ max-width: 100%;
16
+ color: ${({ theme }) => theme.palette.text.primary};
17
+ box-sizing: border-box;
18
+ overflow: visible;
19
+ `;
20
+ export const StyledChartScroller = styled.div `
21
+ max-width: 100%;
22
+ overflow-x: auto;
23
+ overflow-y: visible;
24
+ padding-bottom: 2px;
25
+ `;
26
+ export const StyledChartFrame = styled.div `
27
+ position: relative;
28
+ display: flex;
29
+ flex: 0 0 auto;
30
+ `;
31
+ export const StyledSvg = styled.svg `
32
+ display: block;
33
+ overflow: visible;
34
+ `;
35
+ export const StyledBar = styled.path `
36
+ cursor: pointer;
37
+ outline: none;
38
+ transform-box: fill-box;
39
+ transform-origin: center;
40
+ transition:
41
+ opacity 0.18s ease,
42
+ filter 0.18s ease,
43
+ transform 0.18s ease;
44
+
45
+ &:hover,
46
+ &:focus-visible {
47
+ ${activeBarStyles}
48
+ }
49
+
50
+ ${({ $active }) => $active && activeBarStyles}
51
+ `;
52
+ export const StyledGridLine = styled.line `
53
+ stroke: ${({ theme }) => theme.palette.divider};
54
+ stroke-opacity: 0.65;
55
+ stroke-dasharray: 3 4;
56
+ `;
57
+ export const StyledAxisLine = styled.line `
58
+ stroke: ${({ theme }) => theme.palette.divider};
59
+ stroke-width: 1;
60
+ `;
61
+ export const StyledAxisText = styled.text `
62
+ fill: ${({ theme }) => theme.palette.text.secondary};
63
+ font-size: 11px;
64
+ `;
65
+ export const StyledValueLabel = styled.text `
66
+ fill: ${({ theme }) => theme.palette.text.primary};
67
+ font-size: 11px;
68
+ font-weight: 600;
69
+ pointer-events: none;
70
+ `;
71
+ export const StyledLegend = StyledChartLegend;
72
+ export const StyledLegendItem = styled.div `
73
+ display: grid;
74
+ grid-template-columns: ${({ $showSwatch, $showLabel, $showValue }) => [
75
+ $showSwatch ? "4px" : null,
76
+ $showLabel ? "minmax(0, 1fr)" : null,
77
+ $showValue ? "auto" : null,
78
+ ]
79
+ .filter(Boolean)
80
+ .join(" ")};
81
+ ${sharedLegendItemStyles}
82
+ `;
83
+ export const StyledSwatch = StyledChartLegendSwatch;
84
+ export const StyledLegendLabel = StyledChartLegendLabel;
85
+ export const StyledLegendValue = StyledChartLegendValue;
86
+ export const StyledEmptyState = styled.div `
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ width: ${({ $width }) => $width}px;
91
+ height: ${({ $height }) => $height}px;
92
+ border: 1px dashed ${({ theme }) => theme.palette.divider};
93
+ border-radius: 8px;
94
+ background: linear-gradient(
95
+ 180deg,
96
+ ${({ theme }) => theme.palette.background.paper} 0%,
97
+ ${({ theme }) => theme.palette.background.secondary} 100%
98
+ );
99
+ font-size: 12px;
100
+ color: ${({ theme }) => theme.palette.text.secondary};
101
+ `;
102
+ export const StyledTooltip = StyledChartTooltip;
103
+ export const StyledTooltipHeader = StyledChartTooltipHeader;
104
+ export const StyledTooltipSwatch = StyledChartTooltipSwatch;
105
+ export const StyledTooltipLabel = StyledChartTooltipLabel;
106
+ export const StyledTooltipMeta = styled(StyledChartTooltipMeta) `
107
+ display: block;
108
+ `;
109
+ export const StyledTooltipList = StyledChartTooltipList;
110
+ export const StyledTooltipRow = StyledChartTooltipRow;
111
+ export const StyledTooltipValue = StyledChartTooltipValue;
@@ -0,0 +1,170 @@
1
+ import React, { HTMLAttributes } from "react";
2
+ export type BarChartDatum<TData = unknown> = {
3
+ /** Stable identifier for the bar. Falls back to label and index when omitted. */
4
+ id?: string | number;
5
+ /** Display label used for axes, labels, legends, tooltips, and accessibility text. */
6
+ label: string;
7
+ /** Numeric value rendered by the bar. Zero and negative values are supported. */
8
+ value: number;
9
+ /** Optional per-bar color. Takes precedence over colorGradient, colors, and theme colors. */
10
+ color?: string;
11
+ /** Optional contextual payload returned in click callbacks and formatter functions. */
12
+ data?: TData;
13
+ };
14
+ export type BarChartSeries<TData = unknown> = {
15
+ /** Stable identifier for the series. Falls back to its label and index when omitted. */
16
+ id?: string | number;
17
+ /** Display label used in legends, tooltips, and accessibility text. */
18
+ label: React.ReactNode;
19
+ /** Optional per-series color. Takes precedence over colors, colorGradient, and theme colors. */
20
+ color?: string;
21
+ /** Optional gradient used to resolve this series color when no per-datum color is provided. */
22
+ colorGradient?: BarChartColorGradient;
23
+ /** Values rendered for this series. Categories are matched by datum label. */
24
+ data: BarChartDatum<TData>[];
25
+ };
26
+ export type BarChartColorGradient =
27
+ /** Ordered color stops used to generate bar colors across a gradient scale. */
28
+ string[]
29
+ /** Two-color gradient range used to generate bar colors from start to end. */
30
+ | {
31
+ /** Starting color for generated bar colors. */
32
+ from: string;
33
+ /** Ending color for generated bar colors. */
34
+ to: string;
35
+ };
36
+ export type BarChartOrientation = "vertical" | "horizontal";
37
+ export type BarChartSeriesLayout = "grouped" | "stacked";
38
+ export type BarChartMargin = {
39
+ top: number;
40
+ right: number;
41
+ bottom: number;
42
+ left: number;
43
+ };
44
+ export type ResolvedBar<TData = unknown> = BarChartDatum<TData> & {
45
+ key: string | number;
46
+ keyString: string;
47
+ color: string;
48
+ index: number;
49
+ renderIndex: number;
50
+ seriesKey: string | number;
51
+ seriesIndex: number;
52
+ seriesLabel: React.ReactNode;
53
+ seriesLabelText: string;
54
+ categoryKey: string;
55
+ categoryLabel: string;
56
+ valueStart: number;
57
+ valueEnd: number;
58
+ sourceSeries?: BarChartSeries<TData>;
59
+ };
60
+ export type ResolvedBarSeries<TData = unknown> = {
61
+ key: string | number;
62
+ label: React.ReactNode;
63
+ labelText: string;
64
+ color: string;
65
+ index: number;
66
+ totalValue: number;
67
+ sourceSeries?: BarChartSeries<TData>;
68
+ };
69
+ export type ResolvedBarCategory<TData = unknown> = {
70
+ key: string;
71
+ label: string;
72
+ index: number;
73
+ representativeDatum: BarChartDatum<TData>;
74
+ bars: ResolvedBar<TData>[];
75
+ positiveTotal: number;
76
+ negativeTotal: number;
77
+ };
78
+ export type ActiveTooltip = {
79
+ barKey: string | number;
80
+ x: number;
81
+ y: number;
82
+ };
83
+ export type BarChartProps<TData = unknown> = HTMLAttributes<HTMLDivElement> & {
84
+ /** Single-series bar data. Ignored when series is provided. */
85
+ data?: BarChartDatum<TData>[];
86
+ /** Multi-series bar data. Takes precedence over data when provided. */
87
+ series?: BarChartSeries<TData>[];
88
+ /** SVG width in pixels. Defaults to 640. */
89
+ width?: number;
90
+ /** SVG height in pixels. Defaults to 320. */
91
+ height?: number;
92
+ /** Bar layout direction. Defaults to "vertical". */
93
+ orientation?: BarChartOrientation;
94
+ /** Multi-series layout mode. Defaults to "grouped". */
95
+ seriesLayout?: BarChartSeriesLayout;
96
+ /** Partial chart margin overrides. Defaults are based on orientation and visible labels. */
97
+ margin?: Partial<BarChartMargin>;
98
+ /** Gap between bars in pixels. Defaults to 10. */
99
+ barGap?: number;
100
+ /** Gap between bars within each grouped category. Defaults to barGap. */
101
+ groupBarGap?: number;
102
+ /** Maximum bar thickness in pixels before bars are centered within their band. */
103
+ maxBarThickness?: number;
104
+ /** Bar corner radius in pixels. Defaults to 3. */
105
+ barRadius?: number;
106
+ /** Categorical color palette for bars. Used after per-bar colors and colorGradient. */
107
+ colors?: string[];
108
+ /** Generates bar colors along a gradient scale. Per-bar color values still take precedence. */
109
+ colorGradient?: BarChartColorGradient;
110
+ /** Opacity applied to bar fills. Clamped between 0 and 1. Defaults to 1. */
111
+ barOpacity?: number;
112
+ /** Stroke color around each bar. Defaults to the theme divider color. */
113
+ barBorderColor?: string;
114
+ /** Stroke width around each bar in pixels. Defaults to 1. */
115
+ barBorderWidth?: number;
116
+ /** Stroke opacity around each bar. Clamped between 0 and 1. Defaults to 1. */
117
+ barBorderOpacity?: number;
118
+ /** Minimum domain value used for the value axis. Zero is always included. */
119
+ minValue?: number;
120
+ /** Maximum domain value used for the value axis. Zero is always included. */
121
+ maxValue?: number;
122
+ /** Approximate number of value-axis ticks. Defaults to 5. */
123
+ valueTickCount?: number;
124
+ /** Shows or hides value-axis grid lines. Defaults to true. */
125
+ showGridLines?: boolean;
126
+ /** Shows or hides axis lines. Defaults to true. */
127
+ showAxisLines?: boolean;
128
+ /** Shows or hides category-axis labels. Defaults to true. */
129
+ showCategoryAxisLabels?: boolean;
130
+ /** Shows or hides value-axis labels. Defaults to true. */
131
+ showValueAxisLabels?: boolean;
132
+ /** Shows or hides legend items. Defaults to false. */
133
+ showLegend?: boolean;
134
+ /** Shows or hides legend color swatches. Defaults to true. */
135
+ showLegendSwatches?: boolean;
136
+ /** Shows or hides legend labels. Defaults to true. */
137
+ showLegendLabels?: boolean;
138
+ /** Shows or hides legend formatted values. Defaults to true. */
139
+ showLegendValues?: boolean;
140
+ /** Shows or hides formatted value labels near bars. Defaults to false. */
141
+ showLabels?: boolean;
142
+ /** Content shown when no valid numeric data values are available. Defaults to "No data". */
143
+ emptyLabel?: React.ReactNode;
144
+ /** Accessible label for the SVG chart image. Defaults to "Bar chart". */
145
+ ariaLabel?: string;
146
+ /** Animates bars on initial render from the zero baseline. Defaults to false. */
147
+ animateOnRender?: boolean;
148
+ /** Duration in milliseconds for each bar animation. Defaults to 520. */
149
+ animationDuration?: number;
150
+ /** Delay in milliseconds between each bar animation. Defaults to 35. */
151
+ animationStagger?: number;
152
+ /** Shows a custom themed tooltip when hovering over bars. Defaults to false. */
153
+ showTooltips?: boolean;
154
+ /** Formats values shown in labels, legends, tooltips, and accessibility text. */
155
+ valueFormatter?: (value: number, datum: BarChartDatum<TData>, series?: BarChartSeries<TData>) => React.ReactNode;
156
+ /** Formats category labels shown on the category axis. */
157
+ categoryLabelFormatter?: (datum: BarChartDatum<TData>, index: number, series?: BarChartSeries<TData>) => React.ReactNode;
158
+ /** Formats value-axis tick labels. */
159
+ tickFormatter?: (value: number) => React.ReactNode;
160
+ /** Formats labels rendered near bars. */
161
+ labelFormatter?: (datum: BarChartDatum<TData>, index: number, series?: BarChartSeries<TData>) => React.ReactNode;
162
+ /** Custom tooltip renderer. Receives the original datum and its index. */
163
+ tooltipFormatter?: (datum: BarChartDatum<TData>, index: number, series?: BarChartSeries<TData>) => React.ReactNode;
164
+ /** Called when a bar is clicked or activated with Enter/Space. */
165
+ onBarClick?: (event: React.MouseEvent<SVGPathElement> | React.KeyboardEvent<SVGPathElement>, datum: BarChartDatum<TData>, series?: BarChartSeries<TData>) => void;
166
+ /** Called when a single-series legend item is clicked or activated with Enter/Space. */
167
+ onLegendItemClick?: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, datum: BarChartDatum<TData>) => void;
168
+ /** Called when a multi-series legend item is clicked or activated with Enter/Space. */
169
+ onSeriesLegendItemClick?: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, series: BarChartSeries<TData>) => void;
170
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export { default } from "./BarChart";
2
+ export { BarChart } from "./BarChart";
3
+ export type { BarChartColorGradient, BarChartDatum, BarChartMargin, BarChartOrientation, BarChartProps, BarChartSeries, BarChartSeriesLayout, } from "./BarChart.types";
@@ -0,0 +1,2 @@
1
+ export { default } from "./BarChart";
2
+ export { BarChart } from "./BarChart";
@@ -13,6 +13,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
13
13
  import { forwardRef } from "react";
14
14
  import styled from "styled-components";
15
15
  import { Loader2Icon } from "lucide-react";
16
+ import { getControlSizeTokens } from "../core";
16
17
  const colors = {
17
18
  gray: "#888888",
18
19
  lightGray: "#f0f0f0",
@@ -35,63 +36,14 @@ const StyledButton = styled.button `
35
36
  white-space: nowrap;
36
37
 
37
38
  width: ${({ fullWidth }) => (fullWidth ? "100%" : "fit-content")};
38
- height: ${({ theme, size }) => {
39
- switch (size) {
40
- case "xxs":
41
- return `24px`;
42
- case "xs":
43
- return `28px`;
44
- case "sm":
45
- return `34px`;
46
- case "md":
47
- return `40px`;
48
- case "lg":
49
- return `48px`;
50
- case "xl":
51
- return `58px`;
52
- default:
53
- return `34px`;
54
- }
55
- }};
39
+ height: ${({ size }) => `${getControlSizeTokens(size).height}px`};
56
40
 
57
- font-size: ${({ theme, size }) => {
58
- switch (size) {
59
- case "xxs":
60
- return `11px`;
61
- case "xs":
62
- return `12px`;
63
- case "sm":
64
- return `14px`;
65
- case "md":
66
- return `16px`;
67
- case "lg":
68
- return `18px`;
69
- case "xl":
70
- return `20px`;
71
- default:
72
- return `14px`;
73
- }
74
- }};
41
+ font-size: ${({ size }) => `${getControlSizeTokens(size).fontSize}px`};
75
42
 
76
43
  padding: ${({ theme, size, variant }) => {
77
44
  if (variant === "text")
78
45
  return `0px 0px`;
79
- switch (size) {
80
- case "xxs":
81
- return `0px 8px`;
82
- case "xs":
83
- return `0px 12px`;
84
- case "sm":
85
- return `0px 16px`;
86
- case "md":
87
- return `0px 20px`;
88
- case "lg":
89
- return `0px 24px`;
90
- case "xl":
91
- return `0px 30px`;
92
- default:
93
- return `0px 16px`;
94
- }
46
+ return `0px ${getControlSizeTokens(size).buttonPaddingX}px`;
95
47
  }};
96
48
 
97
49
  color: ${({ theme, variant, color }) => {
@@ -175,6 +127,7 @@ const StyledButton = styled.button `
175
127
  display: flex;
176
128
  align-items: center;
177
129
  justify-content: center;
130
+ gap: ${({ size }) => `${getControlSizeTokens(size).iconGap}px`};
178
131
  }
179
132
 
180
133
  .button-label {
@@ -183,17 +136,15 @@ const StyledButton = styled.button `
183
136
  }
184
137
 
185
138
  [data-position="left"] {
186
- margin-inline-end: 6px;
187
139
  display: flex;
188
140
  align-items: center;
189
141
  }
190
142
 
191
143
  [data-position="right"] {
192
- margin-inline-start: 6px;
193
- padding-inline-start: 6px;
194
144
  margin-left: auto;
195
145
  display: flex;
196
146
  align-items: center;
147
+ padding-inline-start: ${({ size }) => `${getControlSizeTokens(size).iconGap}px`};
197
148
  }
198
149
 
199
150
  &:hover {
@@ -264,8 +215,8 @@ const StyledAnchor = styled.a `
264
215
  `;
265
216
  const StyledLoader = styled.span `
266
217
  svg {
267
- width: 16px;
268
- height: 16px;
218
+ width: ${({ size }) => `${getControlSizeTokens(size).iconSize}px`};
219
+ height: ${({ size }) => `${getControlSizeTokens(size).iconSize}px`};
269
220
  color: ${({ theme, color }) => {
270
221
  var _a;
271
222
  return color
@@ -285,6 +236,6 @@ const StyledLoader = styled.span `
285
236
  `;
286
237
  export const Button = forwardRef((props, ref) => {
287
238
  const { children, loading = false, leftSection = null, rightSection = null, href = null, download = null, justify = "center" } = props, other = __rest(props, ["children", "loading", "leftSection", "rightSection", "href", "download", "justify"]);
288
- const buttonContent = (_jsx("div", { className: "inner-span", style: { height: "100%", width: "100%", justifyContent: justify }, children: loading ? (_jsx(StyledLoader, { children: _jsx(Loader2Icon, {}) })) : (_jsxs(_Fragment, { children: [leftSection && _jsx("div", { "data-position": "left", children: leftSection }), _jsx("div", { className: "button-label", children: children }), rightSection && _jsx("div", { "data-position": "right", children: rightSection })] })) }));
239
+ const buttonContent = (_jsx("div", { className: "inner-span", style: { height: "100%", width: "100%", justifyContent: justify }, children: loading ? (_jsx(StyledLoader, { size: other.size, children: _jsx(Loader2Icon, {}) })) : (_jsxs(_Fragment, { children: [leftSection && _jsx("div", { "data-position": "left", children: leftSection }), _jsx("div", { className: "button-label", children: children }), rightSection && _jsx("div", { "data-position": "right", children: rightSection })] })) }));
289
240
  return (_jsx(StyledButton, Object.assign({ ref: ref }, other, { children: href ? (_jsx(StyledAnchor, { href: href, download: download, children: buttonContent })) : (buttonContent) })));
290
241
  });
@@ -1,7 +1,9 @@
1
1
  interface CalendarProps {
2
2
  defaultValue?: Date;
3
3
  value?: Date | null;
4
- onChange?: (date: Date | null) => void;
4
+ onChange?: (date: Date | null, meta?: {
5
+ source: "date" | "month" | "year" | "time" | "clear";
6
+ }) => void;
5
7
  hourFormat?: "12" | "24";
6
8
  includeTime?: boolean;
7
9
  clearable?: boolean;