@konstructio/ui 0.1.2-alpha.70 → 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 +20 -14
- package/dist/components/Filter/Filter.types.d.ts +3 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.d.ts +3 -0
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +122 -0
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.types.d.ts +7 -0
- 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 +4 -0
- package/dist/components/Filter/components/index.js +8 -4
- 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.js +61 -59
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +93 -8
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +153 -71
- package/dist/components/VirtualizedTable/components/Filter/Filter.types.d.ts +7 -8
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.d.ts +12 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +9 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +198 -162
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +124 -118
- 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 +142 -135
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const progressBarTrackVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
2
2
|
export declare const progressBarFillVariants: (props?: ({
|
|
3
|
-
status?: "
|
|
3
|
+
status?: "success" | "warning" | "error" | "default" | null | undefined;
|
|
4
4
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -5,7 +5,7 @@ export declare const contentVariants: (props?: ({
|
|
|
5
5
|
variant?: "default" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export declare const listVariants: (props?: ({
|
|
8
|
-
variant?: "
|
|
8
|
+
variant?: "horizontal" | "vertical" | "default" | null | undefined;
|
|
9
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
10
|
export declare const triggerVariants: (props?: ({
|
|
11
11
|
variant?: "default" | "active" | "inactive" | null | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const toastVariants: (props?: ({
|
|
2
|
-
variant?: "
|
|
2
|
+
variant?: "success" | "warning" | "error" | null | undefined;
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
4
|
export declare const viewportToastVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
5
5
|
export declare const closeToastVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
@@ -2,26 +2,21 @@ import { FC } from 'react';
|
|
|
2
2
|
import { TooltipProps } from './Tooltip.types';
|
|
3
3
|
/**
|
|
4
4
|
* A tooltip component that shows on hover.
|
|
5
|
-
*
|
|
5
|
+
* Built on Radix UI for accessible, well-positioned tooltips.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* // Basic tooltip
|
|
10
9
|
* <Tooltip content="Click to save">
|
|
11
10
|
* <Button>Save</Button>
|
|
12
11
|
* </Tooltip>
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
* <Tooltip content="More information" position="bottom">
|
|
13
|
+
* <Tooltip content="More information" side="bottom">
|
|
16
14
|
* <InfoIcon />
|
|
17
15
|
* </Tooltip>
|
|
18
16
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* <span>Hover me</span>
|
|
17
|
+
* <Tooltip content="Danger!" bgClassName="bg-red-500">
|
|
18
|
+
* <Button variant="danger">Delete</Button>
|
|
22
19
|
* </Tooltip>
|
|
23
20
|
* ```
|
|
24
|
-
*
|
|
25
|
-
* @see {@link https://konstructio.github.io/konstruct-ui/?path=/docs/components-tooltip--docs Storybook}
|
|
26
21
|
*/
|
|
27
22
|
export declare const Tooltip: FC<TooltipProps>;
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { P as p, R as c, T as h, C as x, A as f } from "../../index-B7-5g1Sm.js";
|
|
3
|
+
import { cn as g } from "../../utils/index.js";
|
|
4
|
+
const j = ({
|
|
5
|
+
content: s,
|
|
6
|
+
children: t,
|
|
7
|
+
side: o = "top",
|
|
8
|
+
sideOffset: a = 4,
|
|
9
|
+
bgClassName: i = "bg-slate-700",
|
|
10
|
+
arrowClassName: n = "fill-slate-700",
|
|
11
|
+
textClassName: l = "text-white",
|
|
12
|
+
className: d,
|
|
13
|
+
delayDuration: m = 0
|
|
14
|
+
}) => /* @__PURE__ */ e(p, { delayDuration: m, children: /* @__PURE__ */ r(c, { children: [
|
|
15
|
+
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e("span", { children: t }) }),
|
|
16
|
+
/* @__PURE__ */ r(
|
|
17
|
+
x,
|
|
18
|
+
{
|
|
19
|
+
side: o,
|
|
20
|
+
sideOffset: a,
|
|
21
|
+
className: g(
|
|
22
|
+
"rounded px-2 py-1 text-xs shadow-md",
|
|
23
|
+
"animate-in fade-in-0",
|
|
24
|
+
i,
|
|
25
|
+
l,
|
|
26
|
+
d
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
s,
|
|
30
|
+
/* @__PURE__ */ e(f, { className: n })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] }) });
|
|
33
35
|
export {
|
|
34
|
-
|
|
36
|
+
j as Tooltip
|
|
35
37
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
-
import { Theme } from '../../domain/theme';
|
|
4
|
-
import { tooltipVariants } from './Tooltip.variants';
|
|
1
|
+
import { ReactNode } from 'react';
|
|
5
2
|
/**
|
|
6
3
|
* Props for the Tooltip component.
|
|
7
4
|
*
|
|
@@ -11,18 +8,32 @@ import { tooltipVariants } from './Tooltip.variants';
|
|
|
11
8
|
* <Button>Edit</Button>
|
|
12
9
|
* </Tooltip>
|
|
13
10
|
*
|
|
14
|
-
* <Tooltip content="More info here"
|
|
11
|
+
* <Tooltip content="More info here" side="bottom">
|
|
15
12
|
* <InfoIcon />
|
|
16
13
|
* </Tooltip>
|
|
14
|
+
*
|
|
15
|
+
* <Tooltip content="Danger!" bgClassName="bg-red-500">
|
|
16
|
+
* <Button variant="danger">Delete</Button>
|
|
17
|
+
* </Tooltip>
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
|
-
export interface TooltipProps
|
|
20
|
+
export interface TooltipProps {
|
|
20
21
|
/** Tooltip text or content */
|
|
21
22
|
content: ReactNode | string;
|
|
22
|
-
/**
|
|
23
|
+
/** The trigger element */
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
/** Tooltip position relative to trigger */
|
|
26
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
27
|
+
/** Distance from trigger in px */
|
|
28
|
+
sideOffset?: number;
|
|
29
|
+
/** Background color class for tooltip (e.g. 'bg-slate-700', 'bg-red-500') */
|
|
30
|
+
bgClassName?: string;
|
|
31
|
+
/** Arrow fill color class (e.g. 'fill-slate-700', 'fill-red-500'). Should match bgClassName */
|
|
32
|
+
arrowClassName?: string;
|
|
33
|
+
/** Text color class (e.g. 'text-white') */
|
|
34
|
+
textClassName?: string;
|
|
35
|
+
/** Additional className for tooltip content */
|
|
23
36
|
className?: string;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/** Theme override for this component */
|
|
27
|
-
theme?: Theme;
|
|
37
|
+
/** Delay before showing tooltip in ms */
|
|
38
|
+
delayDuration?: number;
|
|
28
39
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const typographyVariants: (props?: ({
|
|
2
|
-
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "
|
|
2
|
+
variant?: "tooltip" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "subtitle3" | "labelLarge" | "labelMedium" | "labelSmall" | "buttonSmall" | "body1" | "body2" | "body3" | null | undefined;
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as X } from "react";
|
|
3
3
|
import { cn as s } from "../../utils/index.js";
|
|
4
|
-
import { sendToggleRowEvent as
|
|
5
|
-
import { TableProvider as
|
|
6
|
-
import { Filter as
|
|
7
|
-
import { WrapperBody as
|
|
8
|
-
import { Header as
|
|
9
|
-
import { Body as
|
|
10
|
-
import { Pagination as
|
|
11
|
-
import { TruncateText as
|
|
12
|
-
import { Actions as
|
|
13
|
-
const
|
|
4
|
+
import { sendToggleRowEvent as Y, sendCollapseRowEvent as Z, sendExpandRowEvent as _ } from "./events/index.js";
|
|
5
|
+
import { TableProvider as $ } from "./contexts/table.provider.js";
|
|
6
|
+
import { Filter as D } from "./components/Filter/Filter.js";
|
|
7
|
+
import { WrapperBody as L } from "./components/WrapperBody/WrapperBody.js";
|
|
8
|
+
import { Header as rr } from "./components/Header/Header.js";
|
|
9
|
+
import { Body as er } from "./components/Body/Body.js";
|
|
10
|
+
import { Pagination as or } from "./components/Pagination/Pagination.js";
|
|
11
|
+
import { TruncateText as ar } from "./components/TruncateText/TruncateText.js";
|
|
12
|
+
import { Actions as tr } from "./components/Actions/Actions.js";
|
|
13
|
+
const ir = ({
|
|
14
14
|
id: c,
|
|
15
15
|
ariaLabel: p,
|
|
16
16
|
columns: d,
|
|
@@ -37,27 +37,28 @@ const tr = ({
|
|
|
37
37
|
showFilter: B = !1,
|
|
38
38
|
showFilterInput: R,
|
|
39
39
|
filterSearchPlaceholder: V = "",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
filters: g,
|
|
41
|
+
multiSelectFilter: j,
|
|
42
|
+
filterActions: k,
|
|
43
|
+
showResetButton: P = !0,
|
|
44
|
+
resetButtonClassName: C,
|
|
44
45
|
// Hover row
|
|
45
|
-
enableHoverRow:
|
|
46
|
-
classNameHoverRow:
|
|
46
|
+
enableHoverRow: H,
|
|
47
|
+
classNameHoverRow: I,
|
|
47
48
|
// Expandable rows
|
|
48
|
-
enableExpandedRow:
|
|
49
|
-
expandedState:
|
|
50
|
-
defaultExpanded:
|
|
51
|
-
classNameExpandedRow:
|
|
52
|
-
classNameExpandedCell:
|
|
53
|
-
classNameExpandedContent:
|
|
54
|
-
classNameExpandedHeader:
|
|
55
|
-
classNameActiveExpandedRow:
|
|
56
|
-
onExpandedChange:
|
|
57
|
-
renderExpandedRow:
|
|
58
|
-
keepExpandColumnVisible:
|
|
49
|
+
enableExpandedRow: K,
|
|
50
|
+
expandedState: M,
|
|
51
|
+
defaultExpanded: W,
|
|
52
|
+
classNameExpandedRow: q,
|
|
53
|
+
classNameExpandedCell: F,
|
|
54
|
+
classNameExpandedContent: G,
|
|
55
|
+
classNameExpandedHeader: J,
|
|
56
|
+
classNameActiveExpandedRow: O,
|
|
57
|
+
onExpandedChange: Q,
|
|
58
|
+
renderExpandedRow: S,
|
|
59
|
+
keepExpandColumnVisible: U
|
|
59
60
|
}) => {
|
|
60
|
-
const e =
|
|
61
|
+
const e = X(
|
|
61
62
|
() => h || [
|
|
62
63
|
t,
|
|
63
64
|
i,
|
|
@@ -67,7 +68,7 @@ const tr = ({
|
|
|
67
68
|
[]
|
|
68
69
|
);
|
|
69
70
|
return /* @__PURE__ */ r(
|
|
70
|
-
|
|
71
|
+
$,
|
|
71
72
|
{
|
|
72
73
|
id: c,
|
|
73
74
|
columns: d,
|
|
@@ -77,33 +78,34 @@ const tr = ({
|
|
|
77
78
|
totalItems: u,
|
|
78
79
|
queryOptions: y,
|
|
79
80
|
isPaginationEnabled: e,
|
|
80
|
-
enableExpandedRow:
|
|
81
|
-
expandedState:
|
|
82
|
-
onExpandedChange:
|
|
83
|
-
defaultExpanded:
|
|
84
|
-
classNameExpandedRow:
|
|
85
|
-
classNameExpandedCell:
|
|
86
|
-
classNameExpandedContent:
|
|
87
|
-
classNameExpandedHeader:
|
|
88
|
-
classNameActiveExpandedRow:
|
|
89
|
-
enableHoverRow:
|
|
90
|
-
classNameHoverRow:
|
|
91
|
-
renderExpandedRow:
|
|
92
|
-
keepExpandColumnVisible:
|
|
81
|
+
enableExpandedRow: K,
|
|
82
|
+
expandedState: M,
|
|
83
|
+
onExpandedChange: Q,
|
|
84
|
+
defaultExpanded: W,
|
|
85
|
+
classNameExpandedRow: q,
|
|
86
|
+
classNameExpandedCell: F,
|
|
87
|
+
classNameExpandedContent: G,
|
|
88
|
+
classNameExpandedHeader: J,
|
|
89
|
+
classNameActiveExpandedRow: O,
|
|
90
|
+
enableHoverRow: H,
|
|
91
|
+
classNameHoverRow: I,
|
|
92
|
+
renderExpandedRow: S,
|
|
93
|
+
keepExpandColumnVisible: U,
|
|
93
94
|
children: /* @__PURE__ */ n("section", { className: s("w-full min-w-fit", b), children: [
|
|
94
95
|
B && /* @__PURE__ */ r(
|
|
95
|
-
|
|
96
|
+
D,
|
|
96
97
|
{
|
|
97
|
-
actions:
|
|
98
|
-
|
|
98
|
+
actions: k,
|
|
99
|
+
filters: g,
|
|
100
|
+
multiSelectFilter: j,
|
|
99
101
|
placeholder: V,
|
|
100
102
|
showFilterInput: R,
|
|
101
|
-
showResetButton:
|
|
102
|
-
resetButtonClassName:
|
|
103
|
+
showResetButton: P,
|
|
104
|
+
resetButtonClassName: C
|
|
103
105
|
}
|
|
104
106
|
),
|
|
105
107
|
/* @__PURE__ */ r(
|
|
106
|
-
|
|
108
|
+
L,
|
|
107
109
|
{
|
|
108
110
|
showPagination: e,
|
|
109
111
|
classNameWrapperTable: N,
|
|
@@ -119,21 +121,21 @@ const tr = ({
|
|
|
119
121
|
"aria-label": p,
|
|
120
122
|
children: [
|
|
121
123
|
/* @__PURE__ */ r(
|
|
122
|
-
|
|
124
|
+
rr,
|
|
123
125
|
{
|
|
124
126
|
className: x,
|
|
125
127
|
classNameArrows: v,
|
|
126
128
|
classNameActiveArrows: T
|
|
127
129
|
}
|
|
128
130
|
),
|
|
129
|
-
/* @__PURE__ */ r(
|
|
131
|
+
/* @__PURE__ */ r(er, { isLoading: a, showPagination: e })
|
|
130
132
|
]
|
|
131
133
|
}
|
|
132
134
|
)
|
|
133
135
|
}
|
|
134
136
|
),
|
|
135
137
|
e && /* @__PURE__ */ r(
|
|
136
|
-
|
|
138
|
+
or,
|
|
137
139
|
{
|
|
138
140
|
showTotalItems: t,
|
|
139
141
|
showDropdownPagination: i,
|
|
@@ -146,16 +148,16 @@ const tr = ({
|
|
|
146
148
|
] })
|
|
147
149
|
}
|
|
148
150
|
);
|
|
149
|
-
}, o =
|
|
151
|
+
}, o = ir;
|
|
150
152
|
o.displayName = "KonstructVirtualizedTable";
|
|
151
|
-
o.TruncateText =
|
|
152
|
-
o.Actions =
|
|
153
|
+
o.TruncateText = ar;
|
|
154
|
+
o.Actions = tr;
|
|
153
155
|
o.Events = {
|
|
154
|
-
sendExpandRowEvent:
|
|
155
|
-
sendCollapseRowEvent:
|
|
156
|
-
sendToggleRowEvent:
|
|
156
|
+
sendExpandRowEvent: _,
|
|
157
|
+
sendCollapseRowEvent: Z,
|
|
158
|
+
sendToggleRowEvent: Y
|
|
157
159
|
};
|
|
158
160
|
export {
|
|
159
|
-
|
|
161
|
+
ar as TruncateText,
|
|
160
162
|
o as VirtualizedTable
|
|
161
163
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ColumnDef as ColumnDefPrimitive, ExpandedState, OnChangeFn, RowData as RowDataPrimitive } from '@tanstack/react-table';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
+
import { ButtonProps } from '../Button/Button.types';
|
|
5
|
+
import { DateRange, DateRangeWithTime } from '../DateRangePicker/DateRangePicker.types';
|
|
6
|
+
import { TimePreset } from '../Filter/components/TimeFilterDropdown/TimeFilterDropdown.types';
|
|
4
7
|
import { virtualizeTableVariants } from './VirtualizedTable.variants';
|
|
5
|
-
import {
|
|
8
|
+
import { Option } from './components/Filter/Filter.types';
|
|
6
9
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
7
10
|
/** Base row data type from TanStack Table */
|
|
8
11
|
export type RowData = RowDataPrimitive;
|
|
@@ -24,18 +27,93 @@ export type RowDataWithMeta = Record<string, unknown> & {
|
|
|
24
27
|
meta?: RowMetadata;
|
|
25
28
|
};
|
|
26
29
|
/**
|
|
27
|
-
*
|
|
30
|
+
* Base shape shared by all filter configurations.
|
|
28
31
|
*/
|
|
29
|
-
|
|
30
|
-
/** Unique key for the filter */
|
|
32
|
+
type FilterConfigBase = {
|
|
33
|
+
/** Unique key for the filter, used as query parameter key */
|
|
31
34
|
key: string;
|
|
32
|
-
/** Display label for the filter */
|
|
35
|
+
/** Display label for the filter trigger button */
|
|
33
36
|
label: string;
|
|
34
|
-
/** Position of the
|
|
37
|
+
/** Position of the dropdown relative to the button */
|
|
35
38
|
position?: 'right' | 'left';
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Configuration for a badge multi-select filter.
|
|
42
|
+
* Options are displayed with Badge components.
|
|
43
|
+
*/
|
|
44
|
+
export type BadgeMultiSelectFilterConfig = FilterConfigBase & {
|
|
45
|
+
/** Filter type — defaults to 'badgeMultiSelect' when omitted */
|
|
46
|
+
type?: 'badgeMultiSelect';
|
|
47
|
+
/** Available filter options */
|
|
48
|
+
options: Option[];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Configuration for a text multi-select filter.
|
|
52
|
+
* Options are displayed as plain text labels.
|
|
53
|
+
*/
|
|
54
|
+
export type TextMultiSelectFilterConfig = FilterConfigBase & {
|
|
55
|
+
type: 'textMultiSelect';
|
|
36
56
|
/** Available filter options */
|
|
37
57
|
options: Option[];
|
|
38
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Configuration for a single date filter.
|
|
61
|
+
*/
|
|
62
|
+
export type DateFilterConfig = FilterConfigBase & {
|
|
63
|
+
type: 'date';
|
|
64
|
+
/** Country code for locale formatting (default: 'US') */
|
|
65
|
+
countryCode?: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Configuration for a date range filter.
|
|
69
|
+
*/
|
|
70
|
+
export type DateRangeFilterConfig = FilterConfigBase & {
|
|
71
|
+
type: 'dateRange';
|
|
72
|
+
/** Whether to show time inputs (default: false) */
|
|
73
|
+
showTime?: boolean;
|
|
74
|
+
/** Time format: '12' for 12-hour or '24' for 24-hour */
|
|
75
|
+
timeFormat?: '12' | '24';
|
|
76
|
+
/** Whether to show preset options (default: true) */
|
|
77
|
+
showPresets?: boolean;
|
|
78
|
+
/** Initial date range */
|
|
79
|
+
defaultRange?: DateRange;
|
|
80
|
+
/** Minimum selectable date */
|
|
81
|
+
minDate?: Date;
|
|
82
|
+
/** Maximum selectable date */
|
|
83
|
+
maxDate?: Date;
|
|
84
|
+
/** Country code for locale formatting (default: 'US') */
|
|
85
|
+
countryCode?: string;
|
|
86
|
+
/** Callback when the date range changes */
|
|
87
|
+
onRangeChange?: (range: DateRangeWithTime) => void;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Configuration for an action button rendered inline with filters.
|
|
91
|
+
*/
|
|
92
|
+
export type ActionFilterConfig = {
|
|
93
|
+
type: 'action';
|
|
94
|
+
/** Text displayed inside the button. Also used as the React key. */
|
|
95
|
+
label: string;
|
|
96
|
+
} & Omit<ButtonProps, 'children' | 'type'>;
|
|
97
|
+
/**
|
|
98
|
+
* Configuration for a time filter with optional presets and a TimePicker.
|
|
99
|
+
*/
|
|
100
|
+
export type TimeFilterConfig = FilterConfigBase & {
|
|
101
|
+
type: 'time';
|
|
102
|
+
/** Time format: '12' for AM/PM or '24' for military time (default: '12') */
|
|
103
|
+
format?: '12' | '24';
|
|
104
|
+
/** Preset time options for quick selection */
|
|
105
|
+
presets?: TimePreset[];
|
|
106
|
+
/** Whether to show the TimePicker for custom time selection (default: true) */
|
|
107
|
+
showTimePicker?: boolean;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Union of all supported filter configurations.
|
|
111
|
+
*/
|
|
112
|
+
export type FilterConfig = BadgeMultiSelectFilterConfig | TextMultiSelectFilterConfig | DateFilterConfig | DateRangeFilterConfig | ActionFilterConfig | TimeFilterConfig;
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated Use FilterConfig instead
|
|
115
|
+
*/
|
|
116
|
+
export type MultiSelectFilter = BadgeMultiSelectFilterConfig;
|
|
39
117
|
/**
|
|
40
118
|
* Props for the VirtualizedTable component.
|
|
41
119
|
* A feature-rich data table with filtering, pagination, and sorting.
|
|
@@ -96,18 +174,24 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
96
174
|
totalItems?: never;
|
|
97
175
|
}) & ({
|
|
98
176
|
filterSearchPlaceholder?: string;
|
|
177
|
+
/** @deprecated Use `filters` instead */
|
|
99
178
|
multiSelectFilter?: MultiSelectFilter[];
|
|
179
|
+
filters?: FilterConfig[];
|
|
100
180
|
showFilter: true;
|
|
101
181
|
showFilterInput?: boolean;
|
|
102
|
-
|
|
182
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
183
|
+
filterActions?: ActionFilterConfig[];
|
|
103
184
|
showResetButton?: boolean;
|
|
104
185
|
resetButtonClassName?: string;
|
|
105
186
|
} | {
|
|
106
187
|
filterSearchPlaceholder?: never;
|
|
188
|
+
/** @deprecated Use `filters` instead */
|
|
107
189
|
multiSelectFilter?: never;
|
|
190
|
+
filters?: never;
|
|
108
191
|
showFilter?: false | undefined;
|
|
109
192
|
showFilterInput?: never;
|
|
110
|
-
|
|
193
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
194
|
+
filterActions?: ActionFilterConfig[];
|
|
111
195
|
showResetButton?: never;
|
|
112
196
|
resetButtonClassName?: never;
|
|
113
197
|
}) & ({
|
|
@@ -135,3 +219,4 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
135
219
|
renderExpandedRow?: never;
|
|
136
220
|
keepExpandColumnVisible?: never;
|
|
137
221
|
});
|
|
222
|
+
export {};
|