@monolith-forensics/monolith-ui 1.7.1 → 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 (176) 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/Tabs/Tab.js +8 -0
  162. package/dist/TagBox/TagBox.js +18 -76
  163. package/dist/TextArea/TextArea.js +4 -23
  164. package/dist/TextInput/TextInput.js +12 -6
  165. package/dist/Utilities/parseTimestamp.js +11 -6
  166. package/dist/core/ArrowButton.d.ts +2 -0
  167. package/dist/core/ArrowButton.js +7 -3
  168. package/dist/core/ClearButton.d.ts +2 -0
  169. package/dist/core/ClearButton.js +7 -3
  170. package/dist/core/controlSizes.d.ts +34 -0
  171. package/dist/core/controlSizes.js +190 -0
  172. package/dist/core/index.d.ts +1 -0
  173. package/dist/core/index.js +1 -0
  174. package/dist/index.d.ts +1 -0
  175. package/dist/index.js +1 -0
  176. package/package.json +5 -1
@@ -23,8 +23,9 @@ const PopoverRoot = ({ children, opened, defaultOpened = false, onChange, trigge
23
23
  }
24
24
  },
25
25
  placement: position,
26
+ transform: false,
26
27
  middleware: [
27
- offset(offsetValue + (withArrow ? resolvedArrowSize / 2 : 0)),
28
+ offset(offsetValue + (withArrow ? resolvedArrowSize : 0)),
28
29
  flip({ padding: flipPadding }),
29
30
  shift({ padding: shiftPadding }),
30
31
  size({
@@ -42,7 +43,7 @@ const PopoverRoot = ({ children, opened, defaultOpened = false, onChange, trigge
42
43
  ? [
43
44
  arrow({
44
45
  element: arrowRef,
45
- padding: 8,
46
+ padding: Math.max(8, resolvedArrowSize),
46
47
  }),
47
48
  ]
48
49
  : []),
@@ -92,6 +93,7 @@ const PopoverRoot = ({ children, opened, defaultOpened = false, onChange, trigge
92
93
  returnFocus,
93
94
  keepMounted,
94
95
  zIndex,
96
+ role,
95
97
  dropdownId,
96
98
  transitionProps,
97
99
  }), [
@@ -109,6 +111,7 @@ const PopoverRoot = ({ children, opened, defaultOpened = false, onChange, trigge
109
111
  returnFocus,
110
112
  keepMounted,
111
113
  zIndex,
114
+ role,
112
115
  dropdownId,
113
116
  transitionProps,
114
117
  ]);
@@ -1,7 +1,2 @@
1
1
  export declare const StyledDropdown: 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 ARROW_STYLES: Record<"top" | "right" | "bottom" | "left", {
3
- clipPath: string;
4
- borderTransparent: string[];
5
- radiusCorner: string;
6
- staticProp: string;
7
- }>;
2
+ export declare const StyledArrow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@floating-ui/react").FloatingArrowProps, "ref"> & import("react").RefAttributes<SVGSVGElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("@floating-ui/react").FloatingArrowProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>, keyof import("react").Component<any, {}, any>>;
@@ -1,10 +1,14 @@
1
+ import { FloatingArrow } from "@floating-ui/react";
1
2
  import styled from "styled-components";
2
3
  export const StyledDropdown = styled.div `
4
+ --mf-popover-arrow-fill: ${({ theme }) => theme.palette.background.default};
5
+ --mf-popover-arrow-border: ${({ theme }) => theme.palette.divider};
6
+
3
7
  position: relative;
4
8
  min-width: 180px;
5
9
  border-radius: 8px;
6
- border: 1px solid ${({ theme }) => theme.palette.divider};
7
- background-color: ${({ theme }) => theme.palette.background.default};
10
+ border: 1px solid var(--mf-popover-arrow-border);
11
+ background-color: var(--mf-popover-arrow-fill);
8
12
  color: ${({ theme }) => theme.palette.text.primary};
9
13
  box-shadow:
10
14
  rgba(15, 23, 42, 0.1) 0px 10px 15px -3px,
@@ -12,29 +16,8 @@ export const StyledDropdown = styled.div `
12
16
  padding: 10px 12px;
13
17
  outline: none;
14
18
  `;
15
- export const ARROW_STYLES = {
16
- bottom: {
17
- clipPath: "polygon(0 100%, 0 0, 100% 0)",
18
- borderTransparent: ["borderBottomColor", "borderRightColor"],
19
- radiusCorner: "borderTopLeftRadius",
20
- staticProp: "top",
21
- },
22
- top: {
23
- clipPath: "polygon(0 100%, 100% 100%, 100% 0)",
24
- borderTransparent: ["borderTopColor", "borderLeftColor"],
25
- radiusCorner: "borderBottomRightRadius",
26
- staticProp: "bottom",
27
- },
28
- left: {
29
- clipPath: "polygon(100% 0, 0 0, 100% 100%)",
30
- borderTransparent: ["borderLeftColor", "borderBottomColor"],
31
- radiusCorner: "borderTopRightRadius",
32
- staticProp: "right",
33
- },
34
- right: {
35
- clipPath: "polygon(0 100%, 0 0, 100% 100%)",
36
- borderTransparent: ["borderRightColor", "borderTopColor"],
37
- radiusCorner: "borderBottomLeftRadius",
38
- staticProp: "left",
39
- },
40
- };
19
+ export const StyledArrow = styled(FloatingArrow) `
20
+ display: block;
21
+ overflow: visible;
22
+ z-index: 1;
23
+ `;
@@ -1,5 +1,7 @@
1
+ import { FloatingContext } from "@floating-ui/react";
2
+ import { CSSProperties } from "react";
1
3
  import { PopoverTransitionProps } from "./Popover.types";
2
- export declare function usePopoverTransition(opened: boolean, { transition, duration, timingFunction }: PopoverTransitionProps): {
4
+ export declare function usePopoverTransition(context: FloatingContext, { transition, duration, timingFunction, }: PopoverTransitionProps): {
3
5
  mounted: boolean;
4
- styles: React.CSSProperties;
6
+ styles: CSSProperties;
5
7
  };
@@ -1,63 +1,37 @@
1
- import { useEffect, useRef, useState } from "react";
1
+ import { useTransitionStyles } from "@floating-ui/react";
2
2
  const TRANSITION_PRESETS = {
3
3
  fade: {
4
- from: { opacity: 0 },
5
- to: { opacity: 1 },
4
+ initial: { opacity: 0 },
5
+ open: { opacity: 1 },
6
6
  },
7
7
  scale: {
8
- from: { opacity: 0, scale: "0.85" },
9
- to: { opacity: 1, scale: "1" },
8
+ initial: { opacity: 0, transform: "scale(0.85)" },
9
+ open: { opacity: 1, transform: "scale(1)" },
10
10
  },
11
11
  "scale-y": {
12
- from: { opacity: 0, scale: "1 0.7" },
13
- to: { opacity: 1, scale: "1 1" },
12
+ initial: { opacity: 0, transform: "scaleY(0.7)" },
13
+ open: { opacity: 1, transform: "scaleY(1)" },
14
14
  },
15
15
  pop: {
16
- from: { opacity: 0, scale: "0.6" },
17
- to: { opacity: 1, scale: "1" },
16
+ initial: { opacity: 0, transform: "scale(0.6)" },
17
+ open: { opacity: 1, transform: "scale(1)" },
18
18
  },
19
19
  };
20
- export function usePopoverTransition(opened, { transition = "fade", duration = 150, timingFunction = "ease" }) {
21
- const [mounted, setMounted] = useState(opened);
22
- const [transitionEnabled, setTransitionEnabled] = useState(false);
23
- const [phase, setPhase] = useState(opened ? "enter" : "exit");
24
- const frameRef = useRef(0);
25
- useEffect(() => {
26
- cancelAnimationFrame(frameRef.current);
27
- if (opened) {
28
- setMounted(true);
29
- setTransitionEnabled(false);
30
- setPhase("exit");
31
- frameRef.current = requestAnimationFrame(() => {
32
- frameRef.current = requestAnimationFrame(() => {
33
- setTransitionEnabled(true);
34
- setPhase("enter");
35
- });
36
- });
37
- }
38
- else {
39
- setTransitionEnabled(true);
40
- setPhase("exit");
41
- const timer = setTimeout(() => {
42
- setMounted(false);
43
- setTransitionEnabled(false);
44
- }, duration);
45
- return () => clearTimeout(timer);
46
- }
47
- }, [opened, duration]);
48
- useEffect(() => {
49
- return () => cancelAnimationFrame(frameRef.current);
50
- }, []);
20
+ export function usePopoverTransition(context, { transition = "fade", duration = 150, timingFunction = "ease", }) {
21
+ var _a;
51
22
  const preset = TRANSITION_PRESETS[transition];
52
- const transitionStyles = phase === "enter" ? preset.to : preset.from;
53
- const properties = [
54
- ...new Set([...Object.keys(preset.from), ...Object.keys(preset.to)]),
55
- ];
56
- const transitionValue = properties
57
- .map((prop) => `${prop} ${duration}ms ${timingFunction}`)
58
- .join(", ");
23
+ const { isMounted, styles } = useTransitionStyles(context, {
24
+ duration,
25
+ initial: preset.initial,
26
+ open: preset.open,
27
+ close: (_a = preset.close) !== null && _a !== void 0 ? _a : preset.initial,
28
+ common: {
29
+ transitionTimingFunction: timingFunction,
30
+ willChange: transition === "fade" ? "opacity" : "opacity, transform",
31
+ },
32
+ });
59
33
  return {
60
- mounted: mounted || opened,
61
- styles: Object.assign(Object.assign({}, transitionStyles), (transitionEnabled ? { transition: transitionValue } : {})),
34
+ mounted: isMounted,
35
+ styles,
62
36
  };
63
37
  }
@@ -12,17 +12,15 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { FloatingFocusManager, FloatingPortal } from "@floating-ui/react";
14
14
  import { usePopoverContext } from "./Popover.context";
15
- import { ARROW_STYLES, StyledDropdown } from "./Popover.styles";
15
+ import { StyledArrow, StyledDropdown } from "./Popover.styles";
16
16
  import { usePopoverTransition } from "./Popover.transitions";
17
17
  export const PopoverDropdown = (_a) => {
18
- var _b, _c;
19
18
  var { children, className, style } = _a, props = __rest(_a, ["children", "className", "style"]);
20
- const { opened, refs, context, floatingStyles, getFloatingProps, withArrow, arrowSize, arrowRadius, arrowRef, withinPortal, trapFocus, returnFocus, keepMounted, zIndex, dropdownId, transitionProps: ctxTransitionProps, } = usePopoverContext();
21
- const { mounted, styles: transitionStyles } = usePopoverTransition(opened, ctxTransitionProps);
22
- const arrowX = (_b = context.middlewareData.arrow) === null || _b === void 0 ? void 0 : _b.x;
23
- const arrowY = (_c = context.middlewareData.arrow) === null || _c === void 0 ? void 0 : _c.y;
19
+ const { refs, context, floatingStyles, getFloatingProps, withArrow, arrowSize, arrowRadius, arrowRef, withinPortal, trapFocus, returnFocus, keepMounted, zIndex, dropdownId, transitionProps: ctxTransitionProps, } = usePopoverContext();
20
+ const { mounted, styles: transitionStyles } = usePopoverTransition(context, ctxTransitionProps);
21
+ const resolvedArrowSize = Math.max(arrowSize, 6);
22
+ const resolvedArrowRadius = Math.min(Math.max(arrowRadius, 0), resolvedArrowSize / 2);
24
23
  const [placementSide, placementAlignment] = context.placement.split("-");
25
- const arrowConfig = ARROW_STYLES[placementSide];
26
24
  const originSide = {
27
25
  top: "bottom",
28
26
  bottom: "top",
@@ -44,7 +42,7 @@ export const PopoverDropdown = (_a) => {
44
42
  }
45
43
  const dropdown = (_jsx(FloatingFocusManager, { context: context, modal: trapFocus, returnFocus: returnFocus, children: _jsxs(StyledDropdown, Object.assign({}, getFloatingProps(props), { id: dropdownId, ref: refs.setFloating, className: className, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, floatingStyles), transitionStyles), { transformOrigin }), style), { zIndex }), (keepMounted && !mounted
46
44
  ? { visibility: "hidden", pointerEvents: "none" }
47
- : {})), children: [children, withArrow && (_jsx("div", { ref: arrowRef, style: Object.assign(Object.assign(Object.assign({ position: "absolute", width: Math.max(arrowSize, 6), height: Math.max(arrowSize, 6), transform: "rotate(45deg)", background: "inherit", border: "1px solid", borderColor: "inherit", pointerEvents: "none", zIndex: 1 }, (arrowX != null ? { left: arrowX } : {})), (arrowY != null ? { top: arrowY } : {})), { [arrowConfig.staticProp]: -Math.max(arrowSize, 6) / 2, [arrowConfig.radiusCorner]: arrowRadius, [arrowConfig.borderTransparent[0]]: "transparent", [arrowConfig.borderTransparent[1]]: "transparent", clipPath: arrowConfig.clipPath }) }))] })) }));
45
+ : {})), children: [children, withArrow && (_jsx(StyledArrow, { ref: arrowRef, context: context, width: resolvedArrowSize * 2, height: resolvedArrowSize, tipRadius: resolvedArrowRadius, strokeWidth: 1, fill: "var(--mf-popover-arrow-fill)", stroke: "var(--mf-popover-arrow-border)" }))] })) }));
48
46
  if (!withinPortal) {
49
47
  return dropdown;
50
48
  }
@@ -2,10 +2,13 @@ import { useMergeRefs } from "@floating-ui/react";
2
2
  import { cloneElement, isValidElement } from "react";
3
3
  import { usePopoverContext } from "./Popover.context";
4
4
  export const PopoverTarget = ({ children }) => {
5
- const { refs, getReferenceProps, opened, dropdownId } = usePopoverContext();
5
+ const { refs, getReferenceProps, opened, dropdownId, role } = usePopoverContext();
6
6
  if (!isValidElement(children)) {
7
7
  return null;
8
8
  }
9
- const mergedRef = useMergeRefs([refs.setReference, children.ref]);
10
- return cloneElement(children, getReferenceProps(Object.assign({ ref: mergedRef, "aria-expanded": opened, "aria-controls": dropdownId, "aria-haspopup": "dialog" }, children.props)));
9
+ const mergedRef = useMergeRefs([
10
+ refs.setReference,
11
+ children.ref,
12
+ ]);
13
+ return cloneElement(children, getReferenceProps(Object.assign({ ref: mergedRef, "aria-expanded": opened, "aria-controls": dropdownId, "aria-haspopup": role === "tooltip" ? undefined : role }, children.props)));
11
14
  };
@@ -4,8 +4,8 @@ export declare const resolveActiveColor: (theme: any, activeColor?: string) => {
4
4
  main: any;
5
5
  contrastText: any;
6
6
  };
7
- export declare const getSegmentHeight: (size?: Size) => 32 | 38 | 22 | 26 | 46 | 56;
8
- export declare const getSegmentFontSize: (size?: Size) => "11px" | "12px" | "14px" | "16px" | "18px" | "20px";
7
+ export declare const getSegmentHeight: (size?: Size) => number;
8
+ export declare const getSegmentFontSize: (size?: Size) => string;
9
9
  export declare const normalizeSegmentedData: (data: SegmentedControlDataItem[]) => NormalizedSegmentedItem[];
10
10
  export declare const getFirstEnabledIndex: (data: NormalizedSegmentedItem[]) => number;
11
11
  export declare const getNextEnabledIndex: (data: NormalizedSegmentedItem[], startIndex: number, direction: 1 | -1) => number;
@@ -1,3 +1,4 @@
1
+ import { getControlSizeTokens } from "../core";
1
2
  export const resolveActiveColor = (theme, activeColor) => {
2
3
  var _a;
3
4
  const fallback = {
@@ -21,38 +22,10 @@ export const resolveActiveColor = (theme, activeColor) => {
21
22
  };
22
23
  };
23
24
  export const getSegmentHeight = (size) => {
24
- switch (size) {
25
- case "xxs":
26
- return 22;
27
- case "xs":
28
- return 26;
29
- case "md":
30
- return 38;
31
- case "lg":
32
- return 46;
33
- case "xl":
34
- return 56;
35
- case "sm":
36
- default:
37
- return 32;
38
- }
25
+ return getControlSizeTokens(size).segmentedHeight;
39
26
  };
40
27
  export const getSegmentFontSize = (size) => {
41
- switch (size) {
42
- case "xxs":
43
- return "11px";
44
- case "xs":
45
- return "12px";
46
- case "md":
47
- return "16px";
48
- case "lg":
49
- return "18px";
50
- case "xl":
51
- return "20px";
52
- case "sm":
53
- default:
54
- return "14px";
55
- }
28
+ return `${getControlSizeTokens(size).segmentedFontSize}px`;
56
29
  };
57
30
  export const normalizeSegmentedData = (data) => data.map((item) => {
58
31
  var _a;
@@ -279,13 +279,13 @@ triggerFocus = false, triggerOpen = false, onFocused, onOpened, }) => {
279
279
  const renderOptionItem = (item, index) => (_jsx(Tooltip, { content: OptionTooltip ? _jsx(OptionTooltip, { data: item.data }) : null, side: "left", children: _jsx(StyledItem, { className: "mfFloatingItem", onClick: (e) => handleItemClick(e, item), "data-selected": (_value === null || _value === void 0 ? void 0 : _value.value) === item.value, "data-disabled": item.disabled, size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index) }, index));
280
280
  const renderActionButton = () => {
281
281
  if (clearable && (_value || !!inputValue)) {
282
- return (_jsx(ClearButton, { className: "input-btn", onClick: handleClear, onMouseDown: (e) => {
282
+ return (_jsx(ClearButton, { size: size, className: "input-btn", onClick: handleClear, onMouseDown: (e) => {
283
283
  e.preventDefault();
284
284
  e.stopPropagation();
285
285
  } }));
286
286
  }
287
287
  if (arrow) {
288
- return (_jsx(ArrowButton, { onClick: (e) => {
288
+ return (_jsx(ArrowButton, { size: size, onClick: (e) => {
289
289
  e.preventDefault();
290
290
  }, onMouseDown: (e) => {
291
291
  e.preventDefault();
@@ -393,7 +393,7 @@ triggerFocus = false, triggerOpen = false, onFocused, onOpened, }) => {
393
393
  : "",
394
394
  }, variant: variant, "data-empty": filteredItems.length === 0 }, DropDownProps, { children: [loading && _jsx(Loader, {}), !loading && actionComponent && (_jsx(ActionMenu, { onClick: () => {
395
395
  setIsOpen(false);
396
- }, children: actionComponent })), !loading && filteredItems.length === 0 && (_jsx(EmptyComponent, { children: getEmptyMessage(allowCustomValue, searchValue) })), !loading && (_jsx(StyledInnerItemContainer, { ref: scrollContainerRef, "data-scroll-active": scrollActive, onScroll: onScroll, children: grouped
396
+ }, children: actionComponent })), !loading && filteredItems.length === 0 && (_jsx(EmptyComponent, { size: size, children: getEmptyMessage(allowCustomValue, searchValue) })), !loading && (_jsx(StyledInnerItemContainer, { ref: scrollContainerRef, "data-scroll-active": scrollActive, onScroll: onScroll, children: grouped
397
397
  ? groups.map((group, index) => (_jsxs("div", { children: [_jsx(GroupTitle, { size: size, children: group.label }), group.items.map((item, index) => renderOptionItem(item, index))] }, group.label)))
398
398
  : filteredItems.map((item, index) => renderOptionItem(item, index)) }))] })) }) }))] }));
399
399
  };
@@ -4,7 +4,9 @@ export declare const StyledInputContainer: import("styled-components/dist/types"
4
4
  width?: string | number | null;
5
5
  }>> & string;
6
6
  export declare const StyledInnerItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
- export declare const EmptyComponent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
+ export declare const EmptyComponent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
8
+ size?: Size;
9
+ }>> & string;
8
10
  interface GroupTitleProps {
9
11
  className?: string;
10
12
  children?: ReactNode;
@@ -11,6 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import styled from "styled-components";
14
+ import { getControlSizeTokens } from "../core";
14
15
  export const StyledInputContainer = styled.div `
15
16
  font-family: ${({ theme }) => theme.typography.fontFamily};
16
17
 
@@ -58,7 +59,7 @@ export const EmptyComponent = styled.div `
58
59
  align-items: center;
59
60
  justify-content: center;
60
61
  padding: 5px;
61
- font-size: 12px;
62
+ font-size: ${({ size = "sm" }) => `${getControlSizeTokens(size).supportingFontSize}px`};
62
63
  font-weight: 500;
63
64
  color: ${(props) => props.theme.palette.text.secondary};
64
65
  `;
@@ -74,17 +75,8 @@ export const GroupTitle = styled((_a) => {
74
75
 
75
76
  color: ${(props) => props.theme.palette.text.secondary};
76
77
 
77
- padding: ${({ size }) => size === "xs"
78
- ? "2px 8px"
79
- : size === "sm"
80
- ? "4px 10px"
81
- : size === "md"
82
- ? "4px 12px"
83
- : size === "lg"
84
- ? "5px 14px"
85
- : size === "xl"
86
- ? "6px 16px"
87
- : "2px 8px"};
78
+ min-height: ${({ size = "sm" }) => `${getControlSizeTokens(size).menuRowHeight}px`};
79
+ padding: ${({ size = "sm" }) => `0px ${getControlSizeTokens(size).menuItemPaddingX}px`};
88
80
 
89
81
  .group-label {
90
82
  white-space: nowrap;
@@ -95,17 +87,7 @@ export const GroupTitle = styled((_a) => {
95
87
 
96
88
  font-weight: 500;
97
89
 
98
- font-size: ${({ size }) => size === "xs"
99
- ? "11px"
100
- : size === "sm"
101
- ? "13px"
102
- : size === "md"
103
- ? "15px"
104
- : size === "lg"
105
- ? "17px"
106
- : size === "xl"
107
- ? "19px"
108
- : "11px"};
90
+ font-size: ${({ size = "sm" }) => `${getControlSizeTokens(size).menuGroupFontSize}px`};
109
91
  }
110
92
 
111
93
  .group-line {
@@ -119,8 +101,8 @@ export const StyledItem = styled.div `
119
101
  border-radius: 3px;
120
102
  display: flex;
121
103
  align-items: center;
122
- min-height: 25px;
123
- padding: 7px 10px;
104
+ min-height: ${({ size }) => `${getControlSizeTokens(size).menuRowHeight}px`};
105
+ height: ${({ size }) => `${getControlSizeTokens(size).menuRowHeight}px`};
124
106
  position: relative;
125
107
  user-select: none;
126
108
  outline: none;
@@ -129,29 +111,9 @@ export const StyledItem = styled.div `
129
111
 
130
112
  font-family: ${({ theme }) => theme.typography.fontFamily};
131
113
 
132
- font-size: ${({ size }) => size === "xs"
133
- ? "11px"
134
- : size === "sm"
135
- ? "13px"
136
- : size === "md"
137
- ? "15px"
138
- : size === "lg"
139
- ? "17px"
140
- : size === "xl"
141
- ? "19px"
142
- : "11px"};
143
-
144
- padding: ${({ size }) => size === "xs"
145
- ? "2px 8px"
146
- : size === "sm"
147
- ? "4px 10px"
148
- : size === "md"
149
- ? "4px 12px"
150
- : size === "lg"
151
- ? "5px 14px"
152
- : size === "xl"
153
- ? "6px 16px"
154
- : "2px 8px"};
114
+ font-size: ${({ size }) => `${getControlSizeTokens(size).fontSize}px`};
115
+
116
+ padding: ${({ size }) => `0px ${getControlSizeTokens(size).menuItemPaddingX}px`};
155
117
 
156
118
  &:hover {
157
119
  background-color: ${(props) => props.theme.palette.action.hover};
@@ -0,0 +1,74 @@
1
+ import moment from "moment";
2
+ import { CSSProperties, ReactElement, ReactNode } from "react";
3
+ import { ButtonProps } from "../Button";
4
+ import { Size, Variant } from "../core";
5
+ export type SuperDatePickerUnit = "s" | "m" | "h" | "d" | "w" | "M" | "y";
6
+ export type SuperDatePickerRefreshUnit = "s" | "m" | "h";
7
+ export type DurationRange = {
8
+ start: string;
9
+ end: string;
10
+ label: string;
11
+ };
12
+ export type SuperDatePickerQuickSelectPanel = {
13
+ title: string;
14
+ content: ReactElement;
15
+ };
16
+ export type SuperDatePickerTimeChangeProps = {
17
+ start: string;
18
+ end: string;
19
+ isInvalid: boolean;
20
+ isQuickSelection: boolean;
21
+ };
22
+ export type SuperDatePickerRefreshChangeProps = {
23
+ isPaused: boolean;
24
+ refreshInterval: number;
25
+ intervalUnits: SuperDatePickerRefreshUnit;
26
+ };
27
+ export type SuperDatePickerRefreshProps = {
28
+ start: string;
29
+ end: string;
30
+ refreshInterval: number;
31
+ };
32
+ export type SuperDatePickerTimeWindowButtonsConfig = {
33
+ zoomFactor?: number;
34
+ showZoomIn?: boolean;
35
+ };
36
+ export type SuperDatePickerProps = {
37
+ className?: string;
38
+ style?: CSSProperties;
39
+ start?: string;
40
+ end?: string;
41
+ defaultStart?: string;
42
+ defaultEnd?: string;
43
+ onTimeChange?: (props: SuperDatePickerTimeChangeProps) => void;
44
+ commonlyUsedRanges?: DurationRange[];
45
+ recentlyUsedRanges?: DurationRange[];
46
+ customQuickSelectPanels?: SuperDatePickerQuickSelectPanel[];
47
+ isDisabled?: boolean | {
48
+ display: ReactNode;
49
+ };
50
+ isLoading?: boolean;
51
+ width?: "auto" | "restricted" | "full";
52
+ size?: Size;
53
+ variant?: Variant;
54
+ compressed?: boolean;
55
+ showUpdateButton?: boolean | "iconOnly";
56
+ updateButtonProps?: ButtonProps;
57
+ quickSelectButtonProps?: ButtonProps;
58
+ isQuickSelectOnly?: boolean;
59
+ isAutoRefreshOnly?: boolean;
60
+ isPaused?: boolean;
61
+ refreshInterval?: number;
62
+ refreshMinInterval?: number;
63
+ refreshIntervalUnits?: SuperDatePickerRefreshUnit;
64
+ onRefresh?: (props: SuperDatePickerRefreshProps) => void | Promise<void>;
65
+ onRefreshChange?: (props: SuperDatePickerRefreshChangeProps) => void;
66
+ showTimeWindowButtons?: boolean | SuperDatePickerTimeWindowButtonsConfig;
67
+ minDate?: Date | moment.Moment;
68
+ maxDate?: Date | moment.Moment;
69
+ timeZoneDisplay?: ReactNode;
70
+ dateFormat?: string;
71
+ "aria-label"?: string;
72
+ };
73
+ export declare const SuperDatePicker: React.FC<SuperDatePickerProps>;
74
+ export default SuperDatePicker;