@konstructio/ui 0.1.2-alpha.74 → 0.1.2-alpha.76
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-CXRo8f-h.js → Modal-BTOXCb0Y.js} +1 -1
- package/dist/assets/icons/components/Home2.d.ts +3 -0
- package/dist/assets/icons/components/Home2.js +28 -0
- package/dist/assets/icons/components/Upload.d.ts +3 -0
- package/dist/assets/icons/components/Upload.js +28 -0
- package/dist/assets/icons/components/index.d.ts +2 -0
- package/dist/assets/icons/components/index.js +70 -66
- package/dist/assets/icons/index.js +70 -66
- package/dist/components/Alert/Alert.d.ts +2 -2
- package/dist/components/Alert/Alert.types.d.ts +3 -1
- package/dist/components/AlertDialog/AlertDialog.d.ts +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +5 -3
- package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +2 -2
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +4 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +3 -1
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Badge/Badge.types.d.ts +3 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +3 -1
- package/dist/components/Breadcrumb/components/Item/Item.d.ts +2 -2
- package/dist/components/Breadcrumb/components/Item/Item.types.d.ts +3 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.types.d.ts +3 -1
- package/dist/components/Button/Button.variants.js +4 -5
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +1 -1
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Card/Card.types.d.ts +3 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.types.d.ts +3 -1
- package/dist/components/Command/Command.d.ts +2 -2
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/Command.types.d.ts +3 -1
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Counter/Counter.d.ts +2 -2
- package/dist/components/Counter/Counter.types.d.ts +3 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +3 -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/Datepicker/DatePicker.d.ts +2 -2
- package/dist/components/Datepicker/DatePicker.types.d.ts +3 -1
- package/dist/components/Filter/Filter.js +24 -22
- package/dist/components/Filter/Filter.types.d.ts +13 -3
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.d.ts +3 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +57 -41
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +75 -49
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.types.d.ts +2 -0
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +38 -37
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +31 -30
- package/dist/components/Filter/components/ResetButton/ResetButton.types.d.ts +1 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +64 -47
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.types.d.ts +2 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +35 -34
- package/dist/components/Filter/contexts/filter.context.d.ts +4 -0
- package/dist/components/Filter/contexts/filter.context.js +7 -0
- package/dist/components/Filter/contexts/filter.hook.d.ts +2 -0
- package/dist/components/Filter/contexts/filter.hook.js +11 -0
- package/dist/components/Filter/contexts/filter.provider.d.ts +5 -0
- package/dist/components/Filter/contexts/filter.provider.js +6 -0
- package/dist/components/Filter/contexts/index.d.ts +3 -0
- package/dist/components/Filter/contexts/index.js +8 -0
- package/dist/components/ImageUpload/ImageUpload.d.ts +2 -2
- package/dist/components/ImageUpload/ImageUpload.types.d.ts +3 -1
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.types.d.ts +3 -1
- package/dist/components/LineChart/LineChart.d.ts +2 -2
- package/dist/components/LineChart/LineChart.js +55 -52
- package/dist/components/LineChart/LineChart.types.d.ts +6 -2
- package/dist/components/Loading/Loading.d.ts +2 -2
- package/dist/components/Loading/Loading.types.d.ts +3 -1
- 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/MultiSelectDropdown/MultiSelectDropdown.d.ts +2 -2
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +3 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +394 -353
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +3 -1
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.types.d.ts +3 -1
- package/dist/components/RadioCard/RadioCard.d.ts +2 -2
- package/dist/components/RadioCard/RadioCard.types.d.ts +5 -3
- package/dist/components/RadioCardGroup/RadioCardGroup.d.ts +2 -2
- package/dist/components/RadioCardGroup/RadioCardGroup.types.d.ts +4 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +4 -2
- package/dist/components/Range/Range.d.ts +2 -2
- package/dist/components/Range/Range.types.d.ts +3 -1
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/Select/Select.types.d.ts +4 -1
- package/dist/components/Select/Select.variants.js +1 -1
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.types.d.ts +1 -1
- package/dist/components/Select/components/List/List.js +64 -61
- package/dist/components/Select/components/List/List.types.d.ts +2 -1
- package/dist/components/Select/components/Wrapper.js +46 -44
- package/dist/components/Select/constants/index.d.ts +1 -0
- package/dist/components/Select/constants/index.js +3 -1
- package/dist/components/Select/constants/list.d.ts +1 -0
- package/dist/components/Select/constants/list.js +4 -0
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.types.d.ts +3 -1
- package/dist/components/Sidebar/components/Footer/Footer.d.ts +2 -2
- package/dist/components/Sidebar/components/Footer/Footer.types.d.ts +3 -1
- package/dist/components/Sidebar/components/Logo/Logo.d.ts +2 -2
- package/dist/components/Sidebar/components/Logo/Logo.types.d.ts +3 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.d.ts +2 -2
- package/dist/components/Sidebar/components/Navigation/Navigation.types.d.ts +7 -5
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.d.ts +3 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.d.ts +3 -1
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.d.ts +3 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +1 -5
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.d.ts +3 -1
- package/dist/components/Sidebar/components/index.d.ts +7 -7
- package/dist/components/Slider/Slider.d.ts +2 -2
- package/dist/components/Slider/Slider.types.d.ts +3 -1
- package/dist/components/Spinner/Spinner.d.ts +2 -2
- package/dist/components/Spinner/Spinner.types.d.ts +4 -2
- package/dist/components/Stepper/Stepper.d.ts +2 -2
- package/dist/components/Stepper/Stepper.types.d.ts +3 -1
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Switch/Switch.types.d.ts +3 -1
- package/dist/components/Table/Table.types.d.ts +3 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.types.d.ts +3 -1
- package/dist/components/Tag/Tag.d.ts +2 -2
- package/dist/components/Tag/Tag.types.d.ts +3 -1
- package/dist/components/TagSelect/TagSelect.d.ts +2 -2
- package/dist/components/TagSelect/TagSelect.js +3 -1
- package/dist/components/TagSelect/TagSelect.types.d.ts +4 -2
- package/dist/components/TagSelect/components/Item/Item.types.d.ts +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/components/TagSelect/contexts/TagSelect.types.d.ts +1 -1
- package/dist/components/TextArea/TextArea.d.ts +2 -2
- package/dist/components/TextArea/TextArea.types.d.ts +3 -1
- package/dist/components/TimePicker/TimePicker.d.ts +2 -2
- package/dist/components/TimePicker/TimePicker.types.d.ts +3 -1
- package/dist/components/TimePicker/components/HoursList/HoursList.types.d.ts +1 -1
- package/dist/components/TimePicker/components/MeridianList/MeridianList.types.d.ts +1 -1
- package/dist/components/TimePicker/components/MinutesList/MinutesList.types.d.ts +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/components/TimePicker/components/WrapperList/WrapperList.types.d.ts +1 -1
- package/dist/components/Toast/Toast.d.ts +2 -2
- package/dist/components/Toast/Toast.js +191 -184
- package/dist/components/Toast/Toast.types.d.ts +3 -1
- package/dist/components/Toast/Toast.variants.js +6 -12
- package/dist/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.js +20 -20
- package/dist/components/Tooltip/Tooltip.types.d.ts +3 -1
- package/dist/components/Typography/Typography.d.ts +2 -2
- package/dist/components/Typography/Typography.types.d.ts +3 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +57 -55
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +3 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +55 -54
- package/dist/components/VirtualizedTable/components/Filter/Filter.types.d.ts +1 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.d.ts +1 -1
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +55 -26
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.types.d.ts +4 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +70 -66
- package/dist/index-BvEpLnOv.js +144 -0
- package/dist/{index-Dd_ZmIqU.js → index-C7zAY3xv.js} +1 -1
- package/dist/{index-Dfq4O3b4.js → index-CrCTywU1.js} +1 -1
- package/dist/{index-9a-FL_6D.js → index-DWyM654o.js} +41 -42
- package/dist/{index-B7-5g1Sm.js → index-mPinF0Ho.js} +407 -401
- package/dist/index.js +1 -1
- package/dist/package.json +10 -10
- package/dist/proxy-BvdTb_6B.js +4974 -0
- package/dist/styles.css +1 -1
- package/package.json +10 -10
- package/dist/index-CESXsoMn.js +0 -14
- package/dist/index-URQGEGX7.js +0 -136
- package/dist/proxy-0sbyKj-k.js +0 -4946
|
@@ -1,50 +1,54 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Badge as
|
|
2
|
+
import { Badge as y } from "../../../Badge/Badge.js";
|
|
3
3
|
import { Button as o } from "../../../Button/Button.js";
|
|
4
|
-
import { Checkbox as
|
|
5
|
-
import { filterButtonIconVariants as
|
|
4
|
+
import { Checkbox as p } from "../../../Checkbox/Checkbox.js";
|
|
5
|
+
import { filterButtonIconVariants as S, filterButtonVariants as O } from "../../Filter.variants.js";
|
|
6
6
|
import { cn as r } from "../../../../utils/index.js";
|
|
7
|
-
import { useBadgeMultiSelect as
|
|
8
|
-
import { C as
|
|
9
|
-
const
|
|
10
|
-
options:
|
|
11
|
-
label:
|
|
12
|
-
position:
|
|
13
|
-
onApply:
|
|
7
|
+
import { useBadgeMultiSelect as A } from "../BadgeDropdown/BadgeMultiSelect.hook.js";
|
|
8
|
+
import { C as B } from "../../../../chevron-down-BBFYYzZq.js";
|
|
9
|
+
const T = ({
|
|
10
|
+
options: l,
|
|
11
|
+
label: h,
|
|
12
|
+
position: c = "left",
|
|
13
|
+
onApply: f,
|
|
14
|
+
showSelectAll: x = !0,
|
|
15
|
+
selectAllLabel: u = "All"
|
|
14
16
|
}) => {
|
|
15
17
|
const {
|
|
16
|
-
wrapperRef:
|
|
17
|
-
isOpen:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
wrapperRef: g,
|
|
19
|
+
isOpen: d,
|
|
20
|
+
isAllSelected: i,
|
|
21
|
+
selectedOptions: b,
|
|
22
|
+
selectedCount: s,
|
|
23
|
+
handleOpen: k,
|
|
24
|
+
handleResetOptions: C,
|
|
25
|
+
handleApplyOptions: N,
|
|
26
|
+
handleSelectAll: v,
|
|
27
|
+
handleSelectOption: w
|
|
28
|
+
} = A({ onApply: f, options: l });
|
|
29
|
+
return l.length === 0 ? null : /* @__PURE__ */ a("div", { ref: g, className: "relative", children: [
|
|
26
30
|
/* @__PURE__ */ a(
|
|
27
31
|
"button",
|
|
28
32
|
{
|
|
29
|
-
className: r(
|
|
30
|
-
"text-slate-700 dark:text-metal-50":
|
|
33
|
+
className: r(O(), {
|
|
34
|
+
"text-slate-700 dark:text-metal-50": d
|
|
31
35
|
}),
|
|
32
|
-
onClick:
|
|
36
|
+
onClick: k,
|
|
33
37
|
children: [
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
h,
|
|
39
|
+
s.length > 0 && /* @__PURE__ */ e(y, { label: s.length.toString() }),
|
|
36
40
|
/* @__PURE__ */ e(
|
|
37
|
-
|
|
41
|
+
B,
|
|
38
42
|
{
|
|
39
|
-
className: r(
|
|
40
|
-
"rotate-180 text-blue-600 dark:text-aurora-500":
|
|
43
|
+
className: r(S(), {
|
|
44
|
+
"rotate-180 text-blue-600 dark:text-aurora-500": d
|
|
41
45
|
})
|
|
42
46
|
}
|
|
43
47
|
)
|
|
44
48
|
]
|
|
45
49
|
}
|
|
46
50
|
),
|
|
47
|
-
|
|
51
|
+
d && /* @__PURE__ */ a(
|
|
48
52
|
"div",
|
|
49
53
|
{
|
|
50
54
|
className: r(
|
|
@@ -62,28 +66,41 @@ const $ = ({
|
|
|
62
66
|
"dark:bg-metal-800",
|
|
63
67
|
"dark:border-metal-700",
|
|
64
68
|
{
|
|
65
|
-
"left-0":
|
|
66
|
-
"right-0":
|
|
69
|
+
"left-0": c === "left",
|
|
70
|
+
"right-0": c === "right"
|
|
67
71
|
}
|
|
68
72
|
),
|
|
69
73
|
children: [
|
|
70
|
-
/* @__PURE__ */ e("div", { className: "px-6 py-4", children: /* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
(d) => d.id === t.id
|
|
73
|
-
);
|
|
74
|
-
return /* @__PURE__ */ a("div", { className: "flex gap-4", children: [
|
|
74
|
+
/* @__PURE__ */ e("div", { className: "px-6 py-4", children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: [
|
|
75
|
+
x && /* @__PURE__ */ a("div", { className: "flex gap-4", children: [
|
|
75
76
|
/* @__PURE__ */ e(
|
|
76
|
-
|
|
77
|
+
p,
|
|
77
78
|
{
|
|
78
|
-
defaultChecked:
|
|
79
|
-
|
|
80
|
-
onChange: (d) => b(t, d)
|
|
79
|
+
defaultChecked: i,
|
|
80
|
+
onChange: (t) => v(l, t)
|
|
81
81
|
},
|
|
82
|
-
|
|
82
|
+
`select-all-${i}`
|
|
83
83
|
),
|
|
84
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-slate-700 dark:text-metal-200 whitespace-nowrap", children:
|
|
85
|
-
] },
|
|
86
|
-
|
|
84
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-slate-700 dark:text-metal-200 whitespace-nowrap", children: u })
|
|
85
|
+
] }),
|
|
86
|
+
l.map((t) => {
|
|
87
|
+
const m = !!b.find(
|
|
88
|
+
(n) => n.id === t.id
|
|
89
|
+
);
|
|
90
|
+
return /* @__PURE__ */ a("div", { className: "flex gap-4", children: [
|
|
91
|
+
/* @__PURE__ */ e(
|
|
92
|
+
p,
|
|
93
|
+
{
|
|
94
|
+
defaultChecked: m,
|
|
95
|
+
"data-label": t.id,
|
|
96
|
+
onChange: (n) => w(t, n)
|
|
97
|
+
},
|
|
98
|
+
`${t.id}-${m}`
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-slate-700 dark:text-metal-200 whitespace-nowrap", children: t.label })
|
|
101
|
+
] }, t.id);
|
|
102
|
+
})
|
|
103
|
+
] }) }),
|
|
87
104
|
/* @__PURE__ */ a(
|
|
88
105
|
"div",
|
|
89
106
|
{
|
|
@@ -104,11 +121,11 @@ const $ = ({
|
|
|
104
121
|
{
|
|
105
122
|
variant: "secondary",
|
|
106
123
|
appearance: "compact",
|
|
107
|
-
onClick:
|
|
124
|
+
onClick: C,
|
|
108
125
|
children: "Reset"
|
|
109
126
|
}
|
|
110
127
|
),
|
|
111
|
-
/* @__PURE__ */ e(o, { appearance: "compact", onClick:
|
|
128
|
+
/* @__PURE__ */ e(o, { appearance: "compact", onClick: N, children: "Apply" })
|
|
112
129
|
]
|
|
113
130
|
}
|
|
114
131
|
)
|
|
@@ -118,5 +135,5 @@ const $ = ({
|
|
|
118
135
|
] });
|
|
119
136
|
};
|
|
120
137
|
export {
|
|
121
|
-
|
|
138
|
+
T as TextMultiSelect
|
|
122
139
|
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { useRef as
|
|
1
|
+
import { useRef as k, useId as x, useState as i, useCallback as n, useEffect as g } from "react";
|
|
2
2
|
import { getFormattedTime as I } from "../../../TimePicker/utils/index.js";
|
|
3
|
-
import { sendOpenFilterEvent as
|
|
4
|
-
|
|
3
|
+
import { sendOpenFilterEvent as A, FilterEvent as h } from "../../events/index.js";
|
|
4
|
+
import { useFilterContext as D } from "../../contexts/filter.hook.js";
|
|
5
|
+
const B = ({
|
|
5
6
|
onApply: t,
|
|
6
|
-
format:
|
|
7
|
+
format: L = "24"
|
|
7
8
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
() =>
|
|
9
|
+
const { closeOnApply: l } = D(), c = k(null), s = x(), [C, o] = i(!1), [d, r] = i(), [b, m] = i(), [u, a] = i(), [O, f] = i(), T = O ?? (b ? I(b, L) : void 0), P = n(
|
|
10
|
+
() => o((e) => (e || A(s), !e)),
|
|
10
11
|
[s]
|
|
11
|
-
),
|
|
12
|
-
|
|
13
|
-
}, []),
|
|
14
|
-
|
|
15
|
-
}, []),
|
|
16
|
-
|
|
17
|
-
}, [t,
|
|
18
|
-
|
|
19
|
-
}, [t]);
|
|
12
|
+
), S = n((e) => {
|
|
13
|
+
r(e.value), a(e.label);
|
|
14
|
+
}, []), w = n((e) => {
|
|
15
|
+
r(e), a(void 0);
|
|
16
|
+
}, []), F = n(() => {
|
|
17
|
+
m(d), f(u), t?.(d), l && o(!1);
|
|
18
|
+
}, [l, t, d, u]), v = n(() => o(!1), []), R = n(() => {
|
|
19
|
+
r(void 0), m(void 0), a(void 0), f(void 0), t?.(), l && o(!1);
|
|
20
|
+
}, [l, t]);
|
|
20
21
|
return g(() => {
|
|
21
22
|
const e = new AbortController();
|
|
22
23
|
return document.addEventListener(
|
|
23
|
-
|
|
24
|
-
(
|
|
25
|
-
|
|
24
|
+
h.OPEN,
|
|
25
|
+
(p) => {
|
|
26
|
+
p.detail !== s && o(!1);
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
signal: e.signal
|
|
29
30
|
}
|
|
30
31
|
), document.addEventListener(
|
|
31
|
-
|
|
32
|
+
h.RESET,
|
|
32
33
|
() => {
|
|
33
|
-
|
|
34
|
+
r(void 0), m(void 0), a(void 0), f(void 0), t?.();
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
37
|
signal: e.signal
|
|
@@ -39,10 +40,10 @@ const q = ({
|
|
|
39
40
|
e.abort();
|
|
40
41
|
};
|
|
41
42
|
}, [s, t]), g(() => {
|
|
42
|
-
const e = new AbortController(),
|
|
43
|
-
|
|
43
|
+
const e = new AbortController(), p = (E) => {
|
|
44
|
+
c.current?.contains(E.target) || v();
|
|
44
45
|
};
|
|
45
|
-
return document.addEventListener("mousedown",
|
|
46
|
+
return document.addEventListener("mousedown", p, {
|
|
46
47
|
signal: e.signal
|
|
47
48
|
}), document.addEventListener(
|
|
48
49
|
"visibilitychange",
|
|
@@ -55,20 +56,20 @@ const q = ({
|
|
|
55
56
|
), () => {
|
|
56
57
|
e.abort();
|
|
57
58
|
};
|
|
58
|
-
}, [v,
|
|
59
|
+
}, [v, c]), {
|
|
59
60
|
id: s,
|
|
60
|
-
appliedLabel:
|
|
61
|
-
isOpen:
|
|
62
|
-
selectedTime:
|
|
61
|
+
appliedLabel: T,
|
|
62
|
+
isOpen: C,
|
|
63
|
+
selectedTime: d,
|
|
63
64
|
selectedPresetLabel: u,
|
|
64
|
-
wrapperRef:
|
|
65
|
-
handleApply:
|
|
66
|
-
handleOpen:
|
|
67
|
-
handleSelectPreset:
|
|
68
|
-
handleSelectCustom:
|
|
69
|
-
handleReset:
|
|
65
|
+
wrapperRef: c,
|
|
66
|
+
handleApply: F,
|
|
67
|
+
handleOpen: P,
|
|
68
|
+
handleSelectPreset: S,
|
|
69
|
+
handleSelectCustom: w,
|
|
70
|
+
handleReset: R
|
|
70
71
|
};
|
|
71
72
|
};
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
B as useTimeFilterDropdown
|
|
74
75
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext as e } from "react";
|
|
2
|
+
import { FilterContext as r } from "./filter.context.js";
|
|
3
|
+
const n = () => {
|
|
4
|
+
const t = e(r);
|
|
5
|
+
if (!t)
|
|
6
|
+
throw new Error("useFilterContext must be used within a FilterProvider");
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
n as useFilterContext
|
|
11
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Props } from './ImageUpload.types';
|
|
2
2
|
/**
|
|
3
3
|
* A file input component for uploading images with preview and validation.
|
|
4
4
|
* Supports drag states, file type validation, size limits, and upload progress.
|
|
@@ -19,7 +19,7 @@ import { ImageUploadProps } from './ImageUpload.types';
|
|
|
19
19
|
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-imageupload--docs Storybook}
|
|
20
20
|
*/
|
|
21
21
|
declare const ImageUpload: {
|
|
22
|
-
({ className, error, fileName, fileSize, fileUrl, helperText, isRequired, label, labelClassName, labelWrapperClassName, name, onChange, onRemove, status, theme, uploadButtonText, accept, maxSize, }:
|
|
22
|
+
({ className, error, fileName, fileSize, fileUrl, helperText, isRequired, label, labelClassName, labelWrapperClassName, name, onChange, onRemove, status, theme, uploadButtonText, accept, maxSize, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
export { ImageUpload };
|
|
@@ -29,7 +29,7 @@ export type ImageUploadStatusType = ImageUploadStatus;
|
|
|
29
29
|
* />
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
export interface
|
|
32
|
+
export interface Props extends Omit<VariantProps<typeof imageUploadVariants>, 'status'> {
|
|
33
33
|
/** Additional CSS classes */
|
|
34
34
|
className?: string;
|
|
35
35
|
/** Error message to display */
|
|
@@ -67,3 +67,5 @@ export interface ImageUploadProps extends Omit<VariantProps<typeof imageUploadVa
|
|
|
67
67
|
/** Maximum file size in bytes */
|
|
68
68
|
maxSize?: number;
|
|
69
69
|
}
|
|
70
|
+
/** @deprecated Use Props instead */
|
|
71
|
+
export type ImageUploadProps = Props;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Props } from './Input.types';
|
|
2
2
|
/**
|
|
3
3
|
* A text input component with label, error handling, and helper text support.
|
|
4
4
|
* Includes built-in password visibility toggle and search icon variant.
|
|
@@ -31,5 +31,5 @@ import { InputProps } from './Input.types';
|
|
|
31
31
|
*
|
|
32
32
|
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-input--docs Storybook}
|
|
33
33
|
*/
|
|
34
|
-
declare const Input: import('react').ForwardRefExoticComponent<
|
|
34
|
+
declare const Input: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
|
|
35
35
|
export { Input };
|
|
@@ -12,7 +12,7 @@ import { inputVariants } from './Input.variants';
|
|
|
12
12
|
* <Input error="Invalid email" helperText="We'll never share your email" />
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export interface
|
|
15
|
+
export interface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
16
16
|
/** Error message to display below the input */
|
|
17
17
|
error?: string;
|
|
18
18
|
/** Helper text displayed below the input when no error */
|
|
@@ -34,3 +34,5 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement>, Varia
|
|
|
34
34
|
/** Theme override for this component */
|
|
35
35
|
theme?: Theme;
|
|
36
36
|
}
|
|
37
|
+
/** @deprecated Use Props instead */
|
|
38
|
+
export type InputProps = Props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Props } from './LineChart.types';
|
|
3
3
|
/**
|
|
4
4
|
* A line chart component for time-series data visualization.
|
|
5
5
|
* Built on Chart.js with support for single and multi-line datasets.
|
|
@@ -14,4 +14,4 @@ import { LineChartProps } from './LineChart.types';
|
|
|
14
14
|
* />
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export declare const LineChart: FC<
|
|
17
|
+
export declare const LineChart: FC<Props>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { C as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { Typography as
|
|
5
|
-
import { resolveColor as
|
|
6
|
-
|
|
7
|
-
_,
|
|
1
|
+
import { jsxs as P, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { C as _, a as z, i as j, p as D, L as E, b as F, P as H, c as N, d as O } from "../../index-qDQP8rW4.js";
|
|
3
|
+
import { useMemo as h } from "react";
|
|
4
|
+
import { Typography as M } from "../Typography/Typography.js";
|
|
5
|
+
import { resolveColor as r, cn as V } from "../../utils/index.js";
|
|
6
|
+
_.register(
|
|
8
7
|
z,
|
|
9
8
|
j,
|
|
10
|
-
x,
|
|
11
9
|
D,
|
|
12
10
|
E,
|
|
13
|
-
F
|
|
11
|
+
F,
|
|
12
|
+
H,
|
|
13
|
+
N
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const a = [
|
|
16
16
|
"--color-aurora-500",
|
|
17
17
|
"--color-rose-500",
|
|
18
18
|
"--color-violet-500",
|
|
@@ -23,46 +23,47 @@ const l = [
|
|
|
23
23
|
"--color-fuchsia-500",
|
|
24
24
|
"--color-indigo-500",
|
|
25
25
|
"--color-cyan-500"
|
|
26
|
-
],
|
|
27
|
-
title:
|
|
28
|
-
titleProps:
|
|
29
|
-
labels:
|
|
30
|
-
datasets:
|
|
31
|
-
yAxisFormatter:
|
|
26
|
+
], J = ({
|
|
27
|
+
title: n,
|
|
28
|
+
titleProps: C,
|
|
29
|
+
labels: b,
|
|
30
|
+
datasets: t,
|
|
31
|
+
yAxisFormatter: i,
|
|
32
32
|
showLegend: u,
|
|
33
|
-
height:
|
|
34
|
-
smooth:
|
|
35
|
-
axisColor:
|
|
33
|
+
height: k = 300,
|
|
34
|
+
smooth: m = !0,
|
|
35
|
+
axisColor: c = "#9F9FA9",
|
|
36
36
|
gridColor: e = "#45556C",
|
|
37
37
|
showGrid: g = !0,
|
|
38
|
-
lineWidth:
|
|
39
|
-
showAxisBorder:
|
|
40
|
-
|
|
38
|
+
lineWidth: f = 2,
|
|
39
|
+
showAxisBorder: s = !1,
|
|
40
|
+
tooltipTextColor: d = r("--color-metal-100"),
|
|
41
|
+
className: L
|
|
41
42
|
}) => {
|
|
42
|
-
const
|
|
43
|
+
const y = u !== void 0 ? u : t.length > 1, S = h(
|
|
43
44
|
() => ({
|
|
44
|
-
labels:
|
|
45
|
-
datasets:
|
|
45
|
+
labels: b,
|
|
46
|
+
datasets: t.map((o, l) => ({
|
|
46
47
|
label: o.label,
|
|
47
48
|
data: o.data,
|
|
48
|
-
borderColor: o.color ??
|
|
49
|
-
backgroundColor: o.color ??
|
|
49
|
+
borderColor: o.color ?? r(a[l % a.length]),
|
|
50
|
+
backgroundColor: o.color ?? r(a[l % a.length]),
|
|
50
51
|
borderDash: o.borderDash,
|
|
51
|
-
borderWidth:
|
|
52
|
+
borderWidth: f,
|
|
52
53
|
pointRadius: 0,
|
|
53
54
|
pointHoverRadius: 4,
|
|
54
|
-
tension:
|
|
55
|
+
tension: m ? 0.3 : 0,
|
|
55
56
|
fill: !1
|
|
56
57
|
}))
|
|
57
58
|
}),
|
|
58
|
-
[
|
|
59
|
-
),
|
|
59
|
+
[b, t, m, f]
|
|
60
|
+
), R = h(
|
|
60
61
|
() => ({
|
|
61
62
|
responsive: !0,
|
|
62
63
|
maintainAspectRatio: !1,
|
|
63
|
-
onHover: (o,
|
|
64
|
+
onHover: (o, l) => {
|
|
64
65
|
const v = o.native?.target;
|
|
65
|
-
v && (v.style.cursor =
|
|
66
|
+
v && (v.style.cursor = l.length > 0 ? "pointer" : "default");
|
|
66
67
|
},
|
|
67
68
|
interaction: {
|
|
68
69
|
mode: "index",
|
|
@@ -70,7 +71,7 @@ const l = [
|
|
|
70
71
|
},
|
|
71
72
|
plugins: {
|
|
72
73
|
legend: {
|
|
73
|
-
display:
|
|
74
|
+
display: y,
|
|
74
75
|
position: "top",
|
|
75
76
|
align: "end",
|
|
76
77
|
labels: {
|
|
@@ -87,10 +88,12 @@ const l = [
|
|
|
87
88
|
},
|
|
88
89
|
tooltip: {
|
|
89
90
|
enabled: !0,
|
|
90
|
-
backgroundColor:
|
|
91
|
+
backgroundColor: r("--color-metal-700"),
|
|
92
|
+
titleColor: d,
|
|
93
|
+
bodyColor: d,
|
|
91
94
|
boxPadding: 6,
|
|
92
95
|
callbacks: {
|
|
93
|
-
labelTextColor: (
|
|
96
|
+
labelTextColor: () => d
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
},
|
|
@@ -100,13 +103,13 @@ const l = [
|
|
|
100
103
|
color: "transparent"
|
|
101
104
|
},
|
|
102
105
|
ticks: {
|
|
103
|
-
color:
|
|
106
|
+
color: c,
|
|
104
107
|
font: {
|
|
105
108
|
size: 12
|
|
106
109
|
}
|
|
107
110
|
},
|
|
108
111
|
border: {
|
|
109
|
-
display:
|
|
112
|
+
display: s,
|
|
110
113
|
color: e
|
|
111
114
|
}
|
|
112
115
|
},
|
|
@@ -115,40 +118,40 @@ const l = [
|
|
|
115
118
|
color: g ? e : "transparent"
|
|
116
119
|
},
|
|
117
120
|
ticks: {
|
|
118
|
-
color:
|
|
121
|
+
color: c,
|
|
119
122
|
font: {
|
|
120
123
|
size: 12
|
|
121
124
|
},
|
|
122
|
-
callback:
|
|
125
|
+
callback: i ? (o) => i(o) : void 0
|
|
123
126
|
},
|
|
124
127
|
border: {
|
|
125
|
-
display:
|
|
128
|
+
display: s,
|
|
126
129
|
color: e
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
}),
|
|
131
134
|
[
|
|
132
|
-
|
|
133
|
-
t,
|
|
135
|
+
y,
|
|
134
136
|
i,
|
|
137
|
+
c,
|
|
135
138
|
e,
|
|
136
139
|
g,
|
|
137
|
-
|
|
140
|
+
s
|
|
138
141
|
]
|
|
139
142
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
143
|
+
return /* @__PURE__ */ P("div", { className: V("w-full", L), children: [
|
|
144
|
+
n && /* @__PURE__ */ p(M, { variant: "subtitle2", className: "mb-6", ...C, children: n }),
|
|
145
|
+
/* @__PURE__ */ p("div", { style: { height: k }, children: /* @__PURE__ */ p(
|
|
146
|
+
O,
|
|
144
147
|
{
|
|
145
|
-
"aria-label":
|
|
146
|
-
data:
|
|
147
|
-
options:
|
|
148
|
+
"aria-label": n ?? "Line chart",
|
|
149
|
+
data: S,
|
|
150
|
+
options: R
|
|
148
151
|
}
|
|
149
152
|
) })
|
|
150
153
|
] });
|
|
151
154
|
};
|
|
152
155
|
export {
|
|
153
|
-
|
|
156
|
+
J as LineChart
|
|
154
157
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypographyProps } from '../Typography/Typography.types';
|
|
1
|
+
import { Props as TypographyProps } from '../Typography/Typography.types';
|
|
2
2
|
export interface LineChartDataset {
|
|
3
3
|
/** Dataset label (used in legend) */
|
|
4
4
|
label: string;
|
|
@@ -22,7 +22,7 @@ export interface LineChartDataset {
|
|
|
22
22
|
* />
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
export interface
|
|
25
|
+
export interface Props {
|
|
26
26
|
/** Chart title text */
|
|
27
27
|
title?: string;
|
|
28
28
|
/** Props passed to the Typography component used for the title */
|
|
@@ -49,6 +49,10 @@ export interface LineChartProps {
|
|
|
49
49
|
lineWidth?: number;
|
|
50
50
|
/** Show axis border lines (default: false) */
|
|
51
51
|
showAxisBorder?: boolean;
|
|
52
|
+
/** Tooltip text color (default: metal-100) */
|
|
53
|
+
tooltipTextColor?: string;
|
|
52
54
|
/** Additional className for wrapper */
|
|
53
55
|
className?: string;
|
|
54
56
|
}
|
|
57
|
+
/** @deprecated Use Props instead */
|
|
58
|
+
export type LineChartProps = Props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Props } from './Loading.types';
|
|
3
3
|
/**
|
|
4
4
|
* A spinning loading indicator.
|
|
5
5
|
*
|
|
@@ -20,5 +20,5 @@ import { LoadingProps } from './Loading.types';
|
|
|
20
20
|
*
|
|
21
21
|
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-loading--docs Storybook}
|
|
22
22
|
*/
|
|
23
|
-
declare const Loading: FC<
|
|
23
|
+
declare const Loading: FC<Props>;
|
|
24
24
|
export { Loading };
|
|
@@ -11,7 +11,9 @@ import { loadingVariants } from './Loading.variants';
|
|
|
11
11
|
* <Loading className="w-8 h-8" />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export type
|
|
14
|
+
export type Props = InputHTMLAttributes<SVGSVGElement> & VariantProps<typeof loadingVariants> & {
|
|
15
15
|
/** Theme override for this component */
|
|
16
16
|
theme?: Theme;
|
|
17
17
|
};
|
|
18
|
+
/** @deprecated Use Props instead */
|
|
19
|
+
export type LoadingProps = Props;
|