@konstructio/ui 0.1.2-alpha.71 → 0.1.2-alpha.72
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/{Modal-BGcucTHv.js → Modal-CXRo8f-h.js} +1 -1
- package/dist/assets/icons/components/CheckCircleFilled.d.ts +3 -0
- package/dist/assets/icons/components/CheckCircleFilled.js +31 -0
- package/dist/assets/icons/components/CheckCircleOutline.d.ts +3 -0
- package/dist/assets/icons/components/{CheckCircle.js → CheckCircleOutline.js} +8 -8
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.d.ts +3 -0
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +26 -0
- package/dist/assets/icons/components/InfoCircle.d.ts +3 -0
- package/dist/assets/icons/components/InfoCircle.js +31 -0
- package/dist/assets/icons/components/WarningTriangle.d.ts +3 -0
- package/dist/assets/icons/components/WarningTriangle.js +28 -0
- package/dist/assets/icons/components/index.d.ts +5 -1
- package/dist/assets/icons/components/index.js +124 -116
- package/dist/assets/icons/index.js +124 -116
- package/dist/components/Alert/Alert.d.ts +5 -16
- package/dist/components/Alert/Alert.js +46 -32
- package/dist/components/Alert/Alert.types.d.ts +8 -8
- package/dist/components/Alert/Alert.variants.d.ts +11 -2
- package/dist/components/Alert/Alert.variants.js +77 -32
- package/dist/components/Badge/Badge.variants.d.ts +2 -2
- package/dist/components/Button/Button.variants.d.ts +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.d.ts +1 -1
- package/dist/components/Filter/Filter.d.ts +2 -2
- package/dist/components/Filter/Filter.js +14 -11
- package/dist/components/Filter/Filter.types.d.ts +2 -1
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.d.ts +3 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +14 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +74 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +155 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.types.d.ts +13 -0
- package/dist/components/Filter/components/index.d.ts +2 -0
- package/dist/components/Filter/components/index.js +10 -8
- package/dist/components/LineChart/LineChart.d.ts +17 -0
- package/dist/components/LineChart/LineChart.js +154 -0
- package/dist/components/LineChart/LineChart.types.d.ts +54 -0
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PieChart/PieChart.js +51 -5095
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +1 -1
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.variants.d.ts +1 -1
- package/dist/components/Tabs/Tabs.variants.d.ts +1 -1
- package/dist/components/Toast/Toast.variants.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +4 -9
- package/dist/components/Tooltip/Tooltip.js +35 -33
- package/dist/components/Tooltip/Tooltip.types.d.ts +22 -11
- package/dist/components/Typography/Typography.variants.d.ts +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +28 -4
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +121 -91
- package/dist/components/VirtualizedTable/components/Filter/Filter.types.d.ts +5 -8
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +3 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +179 -168
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +117 -113
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +124 -116
- package/dist/{index-DPcwqB8q.js → index-B7-5g1Sm.js} +169 -168
- package/dist/index-qDQP8rW4.js +7281 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +144 -139
- package/dist/package.json +8 -8
- package/dist/{proxy-CngVm5qA.js → proxy-0sbyKj-k.js} +732 -728
- package/dist/styles.css +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +16 -15
- package/package.json +8 -8
- package/dist/assets/icons/components/CheckCircle.d.ts +0 -3
- package/dist/components/Tooltip/Tooltip.variants.d.ts +0 -6
- package/dist/components/Tooltip/Tooltip.variants.js +0 -86
- package/dist/components/Tooltip/hooks/useTooltip.d.ts +0 -4
- package/dist/components/Tooltip/hooks/useTooltip.js +0 -24
|
@@ -6,7 +6,7 @@ import { CalendarDivider as F } from "../CalendarDivider/CalendarDivider.js";
|
|
|
6
6
|
import { CalendarMonth as G } from "../CalendarMonth/CalendarMonth.js";
|
|
7
7
|
import { NavigationButton as m } from "../NavigationButton/NavigationButton.js";
|
|
8
8
|
import { useTogetherCarousel as H } from "../../hooks/useTogetherCarousel.js";
|
|
9
|
-
import { m as R } from "../../../../../../proxy-
|
|
9
|
+
import { m as R } from "../../../../../../proxy-0sbyKj-k.js";
|
|
10
10
|
const S = ({
|
|
11
11
|
className: s,
|
|
12
12
|
calendarWidth: h = 550,
|
package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type UseDateTimeInputsProps = {
|
|
|
6
6
|
errorEndBeforeStart: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const useDateTimeInputs: ({ errorInvalidDate, errorDateNotAvailable, errorStartAfterEnd, errorEndBeforeStart, }: UseDateTimeInputsProps) => {
|
|
9
|
-
timeFormat: "
|
|
9
|
+
timeFormat: "24" | "12";
|
|
10
10
|
showTime: boolean;
|
|
11
11
|
name: string | undefined;
|
|
12
12
|
disabled: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterComponentProps } from './Filter.types';
|
|
2
|
-
import { BadgeMultiSelect, DateFilterDropdown, DateRangeFilterDropdown, TextMultiSelect } from './components';
|
|
2
|
+
import { BadgeMultiSelect, DateFilterDropdown, DateRangeFilterDropdown, TextMultiSelect, TimeFilterDropdown } from './components';
|
|
3
3
|
/**
|
|
4
4
|
* A compound component for building filter interfaces.
|
|
5
5
|
* Includes sub-components for badge multi-select, date filtering, and reset actions.
|
|
@@ -23,4 +23,4 @@ import { BadgeMultiSelect, DateFilterDropdown, DateRangeFilterDropdown, TextMult
|
|
|
23
23
|
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-filter--docs Storybook}
|
|
24
24
|
*/
|
|
25
25
|
declare const Filter: FilterComponentProps;
|
|
26
|
-
export { Filter, BadgeMultiSelect, TextMultiSelect, DateFilterDropdown, DateRangeFilterDropdown, };
|
|
26
|
+
export { Filter, BadgeMultiSelect, TextMultiSelect, DateFilterDropdown, DateRangeFilterDropdown, TimeFilterDropdown, };
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { cn as m } from "../../utils/index.js";
|
|
3
3
|
import { filterVariants as l } from "./Filter.variants.js";
|
|
4
|
-
import { BadgeMultiSelect as
|
|
5
|
-
import { TextMultiSelect as
|
|
4
|
+
import { BadgeMultiSelect as p } from "./components/BadgeDropdown/BadgeMultiSelect.js";
|
|
5
|
+
import { TextMultiSelect as a } from "./components/TextMultiSelect/TextMultiSelect.js";
|
|
6
6
|
import { DateFilterDropdown as n } from "./components/DateFilterDropdown/DateFilterDropdown.js";
|
|
7
|
-
import { DateRangeFilterDropdown as
|
|
8
|
-
import {
|
|
7
|
+
import { DateRangeFilterDropdown as d } from "./components/DateRangeFilterDropdown/DateRangeFilterDropdown.js";
|
|
8
|
+
import { TimeFilterDropdown as f } from "./components/TimeFilterDropdown/TimeFilterDropdown.js";
|
|
9
|
+
import { ResetButton as D } from "./components/ResetButton/ResetButton.js";
|
|
9
10
|
const t = ({
|
|
10
11
|
className: e,
|
|
11
12
|
theme: o = "civo",
|
|
12
13
|
children: r
|
|
13
14
|
}) => /* @__PURE__ */ i("div", { className: m(l({ className: e })), "data-theme": o, children: r });
|
|
14
15
|
t.displayName = "KonstructFilter";
|
|
15
|
-
t.BadgeMultiSelect =
|
|
16
|
-
t.TextMultiSelect =
|
|
16
|
+
t.BadgeMultiSelect = p;
|
|
17
|
+
t.TextMultiSelect = a;
|
|
17
18
|
t.DateFilterDropdown = n;
|
|
18
|
-
t.DateRangeFilterDropdown =
|
|
19
|
-
t.
|
|
19
|
+
t.DateRangeFilterDropdown = d;
|
|
20
|
+
t.TimeFilterDropdown = f;
|
|
21
|
+
t.ResetButton = D;
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
p as BadgeMultiSelect,
|
|
22
24
|
n as DateFilterDropdown,
|
|
23
|
-
|
|
25
|
+
d as DateRangeFilterDropdown,
|
|
24
26
|
t as Filter,
|
|
25
|
-
|
|
27
|
+
a as TextMultiSelect,
|
|
28
|
+
f as TimeFilterDropdown
|
|
26
29
|
};
|
|
@@ -3,7 +3,7 @@ import { FC, PropsWithChildren } from 'react';
|
|
|
3
3
|
import { Theme } from '../../domain/theme';
|
|
4
4
|
import { BadgeProps } from '../Badge/Badge.types';
|
|
5
5
|
import { filterVariants } from './Filter.variants';
|
|
6
|
-
import { BadgeMultiSelectProps, DateFilterDropdownProps, DateRangeFilterDropdownProps, ResetButtonProps, TextMultiSelectProps } from './components';
|
|
6
|
+
import { BadgeMultiSelectProps, DateFilterDropdownProps, DateRangeFilterDropdownProps, ResetButtonProps, TextMultiSelectProps, TimeFilterDropdownProps } from './components';
|
|
7
7
|
/**
|
|
8
8
|
* Configuration for a filter option.
|
|
9
9
|
*/
|
|
@@ -50,5 +50,6 @@ export type FilterComponentProps = FC<FilterProps> & {
|
|
|
50
50
|
TextMultiSelect: FC<TextMultiSelectProps>;
|
|
51
51
|
DateFilterDropdown: FC<DateFilterDropdownProps>;
|
|
52
52
|
DateRangeFilterDropdown: FC<DateRangeFilterDropdownProps>;
|
|
53
|
+
TimeFilterDropdown: FC<TimeFilterDropdownProps>;
|
|
53
54
|
ResetButton: FC<ResetButtonProps>;
|
|
54
55
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TimeFilterDropdownProps, TimePreset } from './TimeFilterDropdown.types';
|
|
2
|
+
export declare const useTimeFilterDropdown: ({ onApply, format, }: Pick<TimeFilterDropdownProps, "onApply" | "format">) => {
|
|
3
|
+
id: string;
|
|
4
|
+
appliedLabel: string | undefined;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
selectedTime: Date | undefined;
|
|
7
|
+
selectedPresetLabel: string | undefined;
|
|
8
|
+
wrapperRef: import('react').RefObject<HTMLDivElement | null>;
|
|
9
|
+
handleApply: () => void;
|
|
10
|
+
handleOpen: () => void;
|
|
11
|
+
handleSelectPreset: (preset: TimePreset) => void;
|
|
12
|
+
handleSelectCustom: (time: Date) => void;
|
|
13
|
+
handleReset: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useRef as R, useId as k, useState as o, useCallback as n, useEffect as g } from "react";
|
|
2
|
+
import { getFormattedTime as I } from "../../../TimePicker/utils/index.js";
|
|
3
|
+
import { sendOpenFilterEvent as x, FilterEvent as p } from "../../events/index.js";
|
|
4
|
+
const q = ({
|
|
5
|
+
onApply: t,
|
|
6
|
+
format: h = "24"
|
|
7
|
+
}) => {
|
|
8
|
+
const r = R(null), s = k(), [L, a] = o(!1), [i, l] = o(), [b, c] = o(), [u, d] = o(), [T, m] = o(), C = T ?? (b ? I(b, h) : void 0), O = n(
|
|
9
|
+
() => a((e) => (e || x(s), !e)),
|
|
10
|
+
[s]
|
|
11
|
+
), P = n((e) => {
|
|
12
|
+
l(e.value), d(e.label);
|
|
13
|
+
}, []), S = n((e) => {
|
|
14
|
+
l(e), d(void 0);
|
|
15
|
+
}, []), w = n(() => {
|
|
16
|
+
c(i), m(u), t?.(i);
|
|
17
|
+
}, [t, i, u]), v = n(() => a(!1), []), F = n(() => {
|
|
18
|
+
l(void 0), c(void 0), d(void 0), m(void 0), t?.();
|
|
19
|
+
}, [t]);
|
|
20
|
+
return g(() => {
|
|
21
|
+
const e = new AbortController();
|
|
22
|
+
return document.addEventListener(
|
|
23
|
+
p.OPEN,
|
|
24
|
+
(f) => {
|
|
25
|
+
f.detail !== s && a(!1);
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
signal: e.signal
|
|
29
|
+
}
|
|
30
|
+
), document.addEventListener(
|
|
31
|
+
p.RESET,
|
|
32
|
+
() => {
|
|
33
|
+
l(void 0), c(void 0), d(void 0), m(void 0), t?.();
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
signal: e.signal
|
|
37
|
+
}
|
|
38
|
+
), () => {
|
|
39
|
+
e.abort();
|
|
40
|
+
};
|
|
41
|
+
}, [s, t]), g(() => {
|
|
42
|
+
const e = new AbortController(), f = (E) => {
|
|
43
|
+
r.current?.contains(E.target) || v();
|
|
44
|
+
};
|
|
45
|
+
return document.addEventListener("mousedown", f, {
|
|
46
|
+
signal: e.signal
|
|
47
|
+
}), document.addEventListener(
|
|
48
|
+
"visibilitychange",
|
|
49
|
+
() => {
|
|
50
|
+
document.hidden && v();
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
signal: e.signal
|
|
54
|
+
}
|
|
55
|
+
), () => {
|
|
56
|
+
e.abort();
|
|
57
|
+
};
|
|
58
|
+
}, [v, r]), {
|
|
59
|
+
id: s,
|
|
60
|
+
appliedLabel: C,
|
|
61
|
+
isOpen: L,
|
|
62
|
+
selectedTime: i,
|
|
63
|
+
selectedPresetLabel: u,
|
|
64
|
+
wrapperRef: r,
|
|
65
|
+
handleApply: w,
|
|
66
|
+
handleOpen: O,
|
|
67
|
+
handleSelectPreset: P,
|
|
68
|
+
handleSelectCustom: S,
|
|
69
|
+
handleReset: F
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
q as useTimeFilterDropdown
|
|
74
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as N } from "../../../Badge/Badge.js";
|
|
3
|
+
import { Button as p } from "../../../Button/Button.js";
|
|
4
|
+
import { filterButtonIconVariants as w, filterButtonVariants as C } from "../../Filter.variants.js";
|
|
5
|
+
import { TimePicker as B } from "../../../TimePicker/TimePicker.js";
|
|
6
|
+
import { cn as a } from "../../../../utils/index.js";
|
|
7
|
+
import { useTimeFilterDropdown as j } from "./TimeFilterDropdown.hook.js";
|
|
8
|
+
import { C as D } from "../../../../chevron-down-BBFYYzZq.js";
|
|
9
|
+
const V = ({
|
|
10
|
+
label: b,
|
|
11
|
+
position: o = "left",
|
|
12
|
+
format: r = "24",
|
|
13
|
+
presets: n,
|
|
14
|
+
showTimePicker: d = !0,
|
|
15
|
+
onApply: h
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
appliedLabel: c,
|
|
19
|
+
isOpen: i,
|
|
20
|
+
selectedTime: x,
|
|
21
|
+
selectedPresetLabel: m,
|
|
22
|
+
wrapperRef: g,
|
|
23
|
+
handleApply: f,
|
|
24
|
+
handleOpen: u,
|
|
25
|
+
handleSelectPreset: y,
|
|
26
|
+
handleSelectCustom: k,
|
|
27
|
+
handleReset: v
|
|
28
|
+
} = j({ onApply: h, format: r }), s = n && n.length > 0;
|
|
29
|
+
return /* @__PURE__ */ l("div", { ref: g, className: "relative", children: [
|
|
30
|
+
/* @__PURE__ */ l(
|
|
31
|
+
"button",
|
|
32
|
+
{
|
|
33
|
+
className: a(C(), {
|
|
34
|
+
"text-slate-700 dark:text-metal-100": i
|
|
35
|
+
}),
|
|
36
|
+
onClick: u,
|
|
37
|
+
children: [
|
|
38
|
+
b,
|
|
39
|
+
c && /* @__PURE__ */ e(N, { label: c }),
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
D,
|
|
42
|
+
{
|
|
43
|
+
className: a(w(), {
|
|
44
|
+
"rotate-180 text-blue-600 dark:text-aurora-500": i
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
i && /* @__PURE__ */ l(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
className: a(
|
|
55
|
+
"absolute",
|
|
56
|
+
"top-full",
|
|
57
|
+
"mt-1",
|
|
58
|
+
"bg-white",
|
|
59
|
+
"rounded-md",
|
|
60
|
+
"shadow-md",
|
|
61
|
+
"animate-in",
|
|
62
|
+
"fade-in-0",
|
|
63
|
+
"z-10",
|
|
64
|
+
"border",
|
|
65
|
+
"border-gray-200",
|
|
66
|
+
"flex",
|
|
67
|
+
"flex-col",
|
|
68
|
+
"dark:bg-metal-800",
|
|
69
|
+
"dark:border-metal-700",
|
|
70
|
+
{
|
|
71
|
+
"left-0": o === "left",
|
|
72
|
+
"right-0": o === "right"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ l("div", { className: "flex", children: [
|
|
77
|
+
s && /* @__PURE__ */ e("div", { className: "flex flex-col gap-1 py-4 px-4 min-w-40", children: n.map((t) => /* @__PURE__ */ e(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
className: a(
|
|
82
|
+
"text-left",
|
|
83
|
+
"px-3",
|
|
84
|
+
"py-1.5",
|
|
85
|
+
"rounded",
|
|
86
|
+
"cursor-pointer",
|
|
87
|
+
"text-sm",
|
|
88
|
+
"whitespace-nowrap",
|
|
89
|
+
"transition-colors",
|
|
90
|
+
"hover:bg-gray-100",
|
|
91
|
+
"dark:hover:bg-metal-700",
|
|
92
|
+
{
|
|
93
|
+
"bg-blue-50 text-blue-600 dark:bg-metal-700 dark:text-aurora-500": m === t.label,
|
|
94
|
+
"text-gray-700 dark:text-gray-300": m !== t.label
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
onClick: () => y(t),
|
|
98
|
+
children: t.label
|
|
99
|
+
},
|
|
100
|
+
t.label
|
|
101
|
+
)) }),
|
|
102
|
+
s && d && /* @__PURE__ */ e("div", { className: "w-px bg-gray-200 dark:bg-metal-700" }),
|
|
103
|
+
d && /* @__PURE__ */ e("div", { className: "py-4 px-6", children: /* @__PURE__ */ e(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: a({
|
|
107
|
+
"w-35.5": r === "24",
|
|
108
|
+
"w-52": r === "12"
|
|
109
|
+
}),
|
|
110
|
+
children: /* @__PURE__ */ e(
|
|
111
|
+
B,
|
|
112
|
+
{
|
|
113
|
+
format: r,
|
|
114
|
+
time: x,
|
|
115
|
+
onChange: k,
|
|
116
|
+
mode: "input"
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
) })
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ e("div", { className: "h-px bg-gray-200 dark:bg-metal-700" }),
|
|
123
|
+
/* @__PURE__ */ l(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: a(
|
|
127
|
+
"flex",
|
|
128
|
+
"justify-end",
|
|
129
|
+
"items-center",
|
|
130
|
+
"gap-4",
|
|
131
|
+
"px-6",
|
|
132
|
+
"py-3"
|
|
133
|
+
),
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ e(
|
|
136
|
+
p,
|
|
137
|
+
{
|
|
138
|
+
variant: "secondary",
|
|
139
|
+
appearance: "compact",
|
|
140
|
+
onClick: v,
|
|
141
|
+
children: "Reset"
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ e(p, { appearance: "compact", onClick: f, children: "Apply" })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] });
|
|
152
|
+
};
|
|
153
|
+
export {
|
|
154
|
+
V as TimeFilterDropdown
|
|
155
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type TimePreset = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: Date;
|
|
4
|
+
};
|
|
5
|
+
export type TimeFilterDropdownProps = {
|
|
6
|
+
label: string;
|
|
7
|
+
position?: 'left' | 'right';
|
|
8
|
+
format?: '12' | '24';
|
|
9
|
+
presets?: TimePreset[];
|
|
10
|
+
/** Whether to show the TimePicker for custom time selection (default: true) */
|
|
11
|
+
showTimePicker?: boolean;
|
|
12
|
+
onApply?: (time?: Date) => void;
|
|
13
|
+
};
|
|
@@ -8,3 +8,5 @@ export * from './ResetButton/ResetButton';
|
|
|
8
8
|
export * from './ResetButton/ResetButton.types';
|
|
9
9
|
export * from './TextMultiSelect/TextMultiSelect';
|
|
10
10
|
export * from './TextMultiSelect/TextMultiSelect.types';
|
|
11
|
+
export * from './TimeFilterDropdown/TimeFilterDropdown';
|
|
12
|
+
export * from './TimeFilterDropdown/TimeFilterDropdown.types';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { BadgeMultiSelect as
|
|
1
|
+
import { BadgeMultiSelect as t } from "./BadgeDropdown/BadgeMultiSelect.js";
|
|
2
2
|
import { DateFilterDropdown as p } from "./DateFilterDropdown/DateFilterDropdown.js";
|
|
3
|
-
import { DateRangeFilterDropdown as
|
|
4
|
-
import { ResetButton as
|
|
5
|
-
import { TextMultiSelect as
|
|
3
|
+
import { DateRangeFilterDropdown as m } from "./DateRangeFilterDropdown/DateRangeFilterDropdown.js";
|
|
4
|
+
import { ResetButton as f } from "./ResetButton/ResetButton.js";
|
|
5
|
+
import { TextMultiSelect as n } from "./TextMultiSelect/TextMultiSelect.js";
|
|
6
|
+
import { TimeFilterDropdown as a } from "./TimeFilterDropdown/TimeFilterDropdown.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
t as BadgeMultiSelect,
|
|
8
9
|
p as DateFilterDropdown,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
m as DateRangeFilterDropdown,
|
|
11
|
+
f as ResetButton,
|
|
12
|
+
n as TextMultiSelect,
|
|
13
|
+
a as TimeFilterDropdown
|
|
12
14
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { LineChartProps } from './LineChart.types';
|
|
3
|
+
/**
|
|
4
|
+
* A line chart component for time-series data visualization.
|
|
5
|
+
* Built on Chart.js with support for single and multi-line datasets.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <LineChart
|
|
10
|
+
* title="Disk Usage %"
|
|
11
|
+
* labels={['11:20', '11:25', '11:30']}
|
|
12
|
+
* datasets={[{ label: 'Usage', data: [6, 3, 8, 5] }]}
|
|
13
|
+
* yAxisFormatter={(v) => `${v}%`}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const LineChart: FC<LineChartProps>;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { jsxs as R, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { C as P, a as _, i as z, p as j, L as x, b as D, P as E, c as F, d as H } from "../../index-qDQP8rW4.js";
|
|
3
|
+
import { useMemo as y } from "react";
|
|
4
|
+
import { Typography as N } from "../Typography/Typography.js";
|
|
5
|
+
import { resolveColor as d, cn as O } from "../../utils/index.js";
|
|
6
|
+
P.register(
|
|
7
|
+
_,
|
|
8
|
+
z,
|
|
9
|
+
j,
|
|
10
|
+
x,
|
|
11
|
+
D,
|
|
12
|
+
E,
|
|
13
|
+
F
|
|
14
|
+
);
|
|
15
|
+
const l = [
|
|
16
|
+
"--color-aurora-500",
|
|
17
|
+
"--color-rose-500",
|
|
18
|
+
"--color-violet-500",
|
|
19
|
+
"--color-emerald-500",
|
|
20
|
+
"--color-sky-500",
|
|
21
|
+
"--color-teal-500",
|
|
22
|
+
"--color-amber-500",
|
|
23
|
+
"--color-fuchsia-500",
|
|
24
|
+
"--color-indigo-500",
|
|
25
|
+
"--color-cyan-500"
|
|
26
|
+
], A = ({
|
|
27
|
+
title: a,
|
|
28
|
+
titleProps: h,
|
|
29
|
+
labels: p,
|
|
30
|
+
datasets: n,
|
|
31
|
+
yAxisFormatter: t,
|
|
32
|
+
showLegend: u,
|
|
33
|
+
height: C = 300,
|
|
34
|
+
smooth: b = !0,
|
|
35
|
+
axisColor: i = "#9F9FA9",
|
|
36
|
+
gridColor: e = "#45556C",
|
|
37
|
+
showGrid: g = !0,
|
|
38
|
+
lineWidth: m = 2,
|
|
39
|
+
showAxisBorder: c = !1,
|
|
40
|
+
className: k
|
|
41
|
+
}) => {
|
|
42
|
+
const f = u !== void 0 ? u : n.length > 1, L = y(
|
|
43
|
+
() => ({
|
|
44
|
+
labels: p,
|
|
45
|
+
datasets: n.map((o, r) => ({
|
|
46
|
+
label: o.label,
|
|
47
|
+
data: o.data,
|
|
48
|
+
borderColor: o.color ?? d(l[r % l.length]),
|
|
49
|
+
backgroundColor: o.color ?? d(l[r % l.length]),
|
|
50
|
+
borderDash: o.borderDash,
|
|
51
|
+
borderWidth: m,
|
|
52
|
+
pointRadius: 0,
|
|
53
|
+
pointHoverRadius: 4,
|
|
54
|
+
tension: b ? 0.3 : 0,
|
|
55
|
+
fill: !1
|
|
56
|
+
}))
|
|
57
|
+
}),
|
|
58
|
+
[p, n, b, m]
|
|
59
|
+
), S = y(
|
|
60
|
+
() => ({
|
|
61
|
+
responsive: !0,
|
|
62
|
+
maintainAspectRatio: !1,
|
|
63
|
+
onHover: (o, r) => {
|
|
64
|
+
const v = o.native?.target;
|
|
65
|
+
v && (v.style.cursor = r.length > 0 ? "pointer" : "default");
|
|
66
|
+
},
|
|
67
|
+
interaction: {
|
|
68
|
+
mode: "index",
|
|
69
|
+
intersect: !1
|
|
70
|
+
},
|
|
71
|
+
plugins: {
|
|
72
|
+
legend: {
|
|
73
|
+
display: f,
|
|
74
|
+
position: "top",
|
|
75
|
+
align: "end",
|
|
76
|
+
labels: {
|
|
77
|
+
color: "#9FAFBC",
|
|
78
|
+
font: {
|
|
79
|
+
size: 12,
|
|
80
|
+
weight: 500
|
|
81
|
+
},
|
|
82
|
+
usePointStyle: !0,
|
|
83
|
+
pointStyle: "line",
|
|
84
|
+
boxWidth: 24,
|
|
85
|
+
padding: 16
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
tooltip: {
|
|
89
|
+
enabled: !0,
|
|
90
|
+
backgroundColor: d("--color-metal-700"),
|
|
91
|
+
boxPadding: 6,
|
|
92
|
+
callbacks: {
|
|
93
|
+
labelTextColor: (o) => o.dataset.borderColor
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
scales: {
|
|
98
|
+
x: {
|
|
99
|
+
grid: {
|
|
100
|
+
color: "transparent"
|
|
101
|
+
},
|
|
102
|
+
ticks: {
|
|
103
|
+
color: i,
|
|
104
|
+
font: {
|
|
105
|
+
size: 12
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
border: {
|
|
109
|
+
display: c,
|
|
110
|
+
color: e
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
y: {
|
|
114
|
+
grid: {
|
|
115
|
+
color: g ? e : "transparent"
|
|
116
|
+
},
|
|
117
|
+
ticks: {
|
|
118
|
+
color: i,
|
|
119
|
+
font: {
|
|
120
|
+
size: 12
|
|
121
|
+
},
|
|
122
|
+
callback: t ? (o) => t(o) : void 0
|
|
123
|
+
},
|
|
124
|
+
border: {
|
|
125
|
+
display: c,
|
|
126
|
+
color: e
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
[
|
|
132
|
+
f,
|
|
133
|
+
t,
|
|
134
|
+
i,
|
|
135
|
+
e,
|
|
136
|
+
g,
|
|
137
|
+
c
|
|
138
|
+
]
|
|
139
|
+
);
|
|
140
|
+
return /* @__PURE__ */ R("div", { className: O("w-full", k), children: [
|
|
141
|
+
a && /* @__PURE__ */ s(N, { variant: "subtitle2", className: "mb-6", ...h, children: a }),
|
|
142
|
+
/* @__PURE__ */ s("div", { style: { height: C }, children: /* @__PURE__ */ s(
|
|
143
|
+
H,
|
|
144
|
+
{
|
|
145
|
+
"aria-label": a ?? "Line chart",
|
|
146
|
+
data: L,
|
|
147
|
+
options: S
|
|
148
|
+
}
|
|
149
|
+
) })
|
|
150
|
+
] });
|
|
151
|
+
};
|
|
152
|
+
export {
|
|
153
|
+
A as LineChart
|
|
154
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TypographyProps } from '../Typography/Typography.types';
|
|
2
|
+
export interface LineChartDataset {
|
|
3
|
+
/** Dataset label (used in legend) */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Array of numeric values */
|
|
6
|
+
data: number[];
|
|
7
|
+
/** Line/point color (defaults to palette color) */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Dashed line pattern (e.g. [5, 5]) */
|
|
10
|
+
borderDash?: number[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Props for the LineChart component.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <LineChart
|
|
18
|
+
* title="Disk Usage %"
|
|
19
|
+
* labels={['11:20', '11:25', '11:30']}
|
|
20
|
+
* datasets={[{ label: 'Usage', data: [6, 3, 8, 5] }]}
|
|
21
|
+
* yAxisFormatter={(v) => `${v}%`}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export interface LineChartProps {
|
|
26
|
+
/** Chart title text */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** Props passed to the Typography component used for the title */
|
|
29
|
+
titleProps?: Partial<Omit<TypographyProps, 'children' | 'ref'>>;
|
|
30
|
+
/** X-axis labels (e.g. time values) */
|
|
31
|
+
labels: string[];
|
|
32
|
+
/** One or more datasets (lines) */
|
|
33
|
+
datasets: LineChartDataset[];
|
|
34
|
+
/** Y-axis tick formatter (e.g. value => `${value}%`) */
|
|
35
|
+
yAxisFormatter?: (value: number) => string;
|
|
36
|
+
/** Show legend (auto-shown when datasets > 1) */
|
|
37
|
+
showLegend?: boolean;
|
|
38
|
+
/** Chart height in px (default: 300) */
|
|
39
|
+
height?: number;
|
|
40
|
+
/** Smooth lines (default: true). Set to false for straight/rigid lines */
|
|
41
|
+
smooth?: boolean;
|
|
42
|
+
/** Color for axis tick labels (default: '#9F9FA9') */
|
|
43
|
+
axisColor?: string;
|
|
44
|
+
/** Color for grid lines (default: '#45556C') */
|
|
45
|
+
gridColor?: string;
|
|
46
|
+
/** Show horizontal grid lines (default: true) */
|
|
47
|
+
showGrid?: boolean;
|
|
48
|
+
/** Line thickness in px (default: 2) */
|
|
49
|
+
lineWidth?: number;
|
|
50
|
+
/** Show axis border lines (default: false) */
|
|
51
|
+
showAxisBorder?: boolean;
|
|
52
|
+
/** Additional className for wrapper */
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
import { M as d } from "../../Modal-
|
|
4
|
+
import { M as d } from "../../Modal-CXRo8f-h.js";
|
|
5
5
|
import "./components/Header/Header.js";
|
|
6
6
|
import "./components/Body/Body.js";
|
|
7
7
|
import "./components/Footer/Footer.js";
|
|
@@ -2,10 +2,10 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "../../../../index-BKjcReYh.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../../../../Combination-BtmnusWq.js";
|
|
5
|
-
import { W as s } from "../../../../Modal-
|
|
5
|
+
import { W as s } from "../../../../Modal-CXRo8f-h.js";
|
|
6
6
|
import "../../../../utils/index.js";
|
|
7
7
|
import "./Wrapper.variants.js";
|
|
8
|
-
import "../../../../proxy-
|
|
8
|
+
import "../../../../proxy-0sbyKj-k.js";
|
|
9
9
|
import "../../../../x-Eoa9FJjA.js";
|
|
10
10
|
export {
|
|
11
11
|
s as Wrapper
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Body as e } from "./Body/Body.js";
|
|
2
2
|
import { Footer as t } from "./Footer/Footer.js";
|
|
3
3
|
import { Header as m } from "./Header/Header.js";
|
|
4
|
-
import { W as a } from "../../../Modal-
|
|
4
|
+
import { W as a } from "../../../Modal-CXRo8f-h.js";
|
|
5
5
|
export {
|
|
6
6
|
e as Body,
|
|
7
7
|
t as Footer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { P as f, R as u, T as b, C as m } from "../../../../index-
|
|
2
|
+
import { P as f, R as u, T as b, C as m } from "../../../../index-B7-5g1Sm.js";
|
|
3
3
|
import { d as h } from "../../../../debounce-DJveWHr_.js";
|
|
4
4
|
import { useRef as p, useState as w, useCallback as g, useEffect as i } from "react";
|
|
5
5
|
const C = ({ text: r, prefix: n }) => {
|