@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.
Files changed (83) hide show
  1. package/dist/{Modal-BGcucTHv.js → Modal-CXRo8f-h.js} +1 -1
  2. package/dist/assets/icons/components/CheckCircleFilled.d.ts +3 -0
  3. package/dist/assets/icons/components/CheckCircleFilled.js +31 -0
  4. package/dist/assets/icons/components/CheckCircleOutline.d.ts +3 -0
  5. package/dist/assets/icons/components/{CheckCircle.js → CheckCircleOutline.js} +8 -8
  6. package/dist/assets/icons/components/CheckboxMarkedCircleOutline.d.ts +3 -0
  7. package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +26 -0
  8. package/dist/assets/icons/components/InfoCircle.d.ts +3 -0
  9. package/dist/assets/icons/components/InfoCircle.js +31 -0
  10. package/dist/assets/icons/components/WarningTriangle.d.ts +3 -0
  11. package/dist/assets/icons/components/WarningTriangle.js +28 -0
  12. package/dist/assets/icons/components/index.d.ts +5 -1
  13. package/dist/assets/icons/components/index.js +124 -116
  14. package/dist/assets/icons/index.js +124 -116
  15. package/dist/components/Alert/Alert.d.ts +5 -16
  16. package/dist/components/Alert/Alert.js +46 -32
  17. package/dist/components/Alert/Alert.types.d.ts +8 -8
  18. package/dist/components/Alert/Alert.variants.d.ts +11 -2
  19. package/dist/components/Alert/Alert.variants.js +77 -32
  20. package/dist/components/Badge/Badge.variants.d.ts +2 -2
  21. package/dist/components/Button/Button.variants.d.ts +1 -1
  22. package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
  23. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +1 -1
  24. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
  25. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
  26. package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.d.ts +1 -1
  27. package/dist/components/Filter/Filter.d.ts +2 -2
  28. package/dist/components/Filter/Filter.js +20 -14
  29. package/dist/components/Filter/Filter.types.d.ts +3 -1
  30. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.d.ts +3 -0
  31. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +122 -0
  32. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.types.d.ts +7 -0
  33. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.d.ts +3 -0
  34. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +14 -0
  35. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +74 -0
  36. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +155 -0
  37. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.types.d.ts +13 -0
  38. package/dist/components/Filter/components/index.d.ts +4 -0
  39. package/dist/components/Filter/components/index.js +8 -4
  40. package/dist/components/LineChart/LineChart.d.ts +17 -0
  41. package/dist/components/LineChart/LineChart.js +154 -0
  42. package/dist/components/LineChart/LineChart.types.d.ts +54 -0
  43. package/dist/components/Modal/Modal.js +1 -1
  44. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  45. package/dist/components/Modal/components/index.js +1 -1
  46. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
  47. package/dist/components/PieChart/PieChart.js +51 -5095
  48. package/dist/components/ProgressBar/ProgressBar.variants.d.ts +1 -1
  49. package/dist/components/RadioCardGroup/RadioCardGroup.variants.d.ts +1 -1
  50. package/dist/components/RadioGroup/RadioGroup.variants.d.ts +1 -1
  51. package/dist/components/Tabs/Tabs.variants.d.ts +1 -1
  52. package/dist/components/Toast/Toast.variants.d.ts +1 -1
  53. package/dist/components/Tooltip/Tooltip.d.ts +4 -9
  54. package/dist/components/Tooltip/Tooltip.js +35 -33
  55. package/dist/components/Tooltip/Tooltip.types.d.ts +22 -11
  56. package/dist/components/Typography/Typography.variants.d.ts +1 -1
  57. package/dist/components/VirtualizedTable/VirtualizedTable.js +61 -59
  58. package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +93 -8
  59. package/dist/components/VirtualizedTable/components/Filter/Filter.js +153 -71
  60. package/dist/components/VirtualizedTable/components/Filter/Filter.types.d.ts +7 -8
  61. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
  62. package/dist/components/VirtualizedTable/contexts/table.context.d.ts +12 -0
  63. package/dist/components/VirtualizedTable/contexts/table.context.js +9 -0
  64. package/dist/components/VirtualizedTable/contexts/table.provider.js +198 -162
  65. package/dist/components/index.d.ts +2 -1
  66. package/dist/components/index.js +124 -118
  67. package/dist/icons.d.ts +1 -1
  68. package/dist/icons.js +124 -116
  69. package/dist/{index-DPcwqB8q.js → index-B7-5g1Sm.js} +169 -168
  70. package/dist/index-qDQP8rW4.js +7281 -0
  71. package/dist/index.d.ts +1 -1
  72. package/dist/index.js +142 -135
  73. package/dist/package.json +8 -8
  74. package/dist/{proxy-CngVm5qA.js → proxy-0sbyKj-k.js} +732 -728
  75. package/dist/styles.css +1 -1
  76. package/dist/utils/index.d.ts +1 -0
  77. package/dist/utils/index.js +16 -15
  78. package/package.json +8 -8
  79. package/dist/assets/icons/components/CheckCircle.d.ts +0 -3
  80. package/dist/components/Tooltip/Tooltip.variants.d.ts +0 -6
  81. package/dist/components/Tooltip/Tooltip.variants.js +0 -86
  82. package/dist/components/Tooltip/hooks/useTooltip.d.ts +0 -4
  83. 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?: "warning" | "error" | "default" | "success" | null | undefined;
3
+ status?: "success" | "warning" | "error" | "default" | null | undefined;
4
4
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -1,3 +1,3 @@
1
1
  export declare const radioCardGroupVariants: (props?: ({
2
- direction?: "col" | "row" | null | undefined;
2
+ direction?: "row" | "col" | null | undefined;
3
3
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -1,3 +1,3 @@
1
1
  export declare const radioGroupVariants: (props?: ({
2
- direction?: "col" | "row" | null | undefined;
2
+ direction?: "row" | "col" | null | undefined;
3
3
  } & 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?: "default" | "horizontal" | "vertical" | null | undefined;
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?: "warning" | "error" | "success" | null | undefined;
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
- * Wraps any element and displays content on mouse enter.
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
- * // Tooltip with position
15
- * <Tooltip content="More information" position="bottom">
13
+ * <Tooltip content="More information" side="bottom">
16
14
  * <InfoIcon />
17
15
  * </Tooltip>
18
16
  *
19
- * // Tooltip on text
20
- * <Tooltip content="This is a helpful tip">
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 s } from "react/jsx-runtime";
2
- import { S as u } from "../../index-BvoZGpli.js";
3
- import { forwardRef as v, useRef as N, useImperativeHandle as h, useMemo as w, isValidElement as x } from "react";
4
- import { cn as o } from "../../utils/index.js";
5
- import { arrowVariants as R, tooltipVariants as V } from "./Tooltip.variants.js";
6
- import { useTooltip as T } from "./hooks/useTooltip.js";
7
- import { Typography as b } from "../Typography/Typography.js";
8
- const I = v(
9
- ({ children: r, content: i, className: m, theme: l, position: a, wrapperClassName: n }, p) => {
10
- const c = N(null), { isVisible: f, componentRef: t } = T();
11
- h(p, () => t.current, [t]);
12
- const d = w(
13
- () => x(r) ? r : /* @__PURE__ */ e("p", { className: "p-2", children: r }),
14
- [r]
15
- );
16
- return /* @__PURE__ */ e("div", { className: o("w-full", n), "data-theme": l, children: /* @__PURE__ */ s("div", { className: "relative w-max", children: [
17
- /* @__PURE__ */ e(u, { ref: t, className: o("cursor-pointer ", m), children: d }),
18
- /* @__PURE__ */ s(
19
- "div",
20
- {
21
- ref: c,
22
- className: o(V({ position: a })),
23
- "data-visible": f,
24
- children: [
25
- /* @__PURE__ */ e("span", { className: o(R({ position: a })) }),
26
- /* @__PURE__ */ e(b, { variant: "tooltip", className: "text-white", children: i })
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
- I as Tooltip
36
+ j as Tooltip
35
37
  };
@@ -1,7 +1,4 @@
1
- import { VariantProps } from 'class-variance-authority';
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" position="bottom">
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 extends PropsWithChildren, VariantProps<typeof tooltipVariants> {
20
+ export interface TooltipProps {
20
21
  /** Tooltip text or content */
21
22
  content: ReactNode | string;
22
- /** CSS classes for the trigger element */
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
- /** CSS classes for the tooltip wrapper */
25
- wrapperClassName?: string;
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" | "tooltip" | "subtitle1" | "subtitle2" | "subtitle3" | "labelLarge" | "labelMedium" | "labelSmall" | "buttonSmall" | "body1" | "body2" | "body3" | null | undefined;
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 U } from "react";
2
+ import { useMemo as X } from "react";
3
3
  import { cn as s } from "../../utils/index.js";
4
- import { sendToggleRowEvent as X, sendCollapseRowEvent as Y, sendExpandRowEvent as Z } from "./events/index.js";
5
- import { TableProvider as _ } from "./contexts/table.provider.js";
6
- import { Filter as $ } from "./components/Filter/Filter.js";
7
- import { WrapperBody as D } from "./components/WrapperBody/WrapperBody.js";
8
- import { Header as L } from "./components/Header/Header.js";
9
- import { Body as rr } from "./components/Body/Body.js";
10
- import { Pagination as er } from "./components/Pagination/Pagination.js";
11
- import { TruncateText as or } from "./components/TruncateText/TruncateText.js";
12
- import { Actions as ar } from "./components/Actions/Actions.js";
13
- const tr = ({
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
- multiSelectFilter: g,
41
- filterActions: j,
42
- showResetButton: k = !0,
43
- resetButtonClassName: P,
40
+ filters: g,
41
+ multiSelectFilter: j,
42
+ filterActions: k,
43
+ showResetButton: P = !0,
44
+ resetButtonClassName: C,
44
45
  // Hover row
45
- enableHoverRow: C,
46
- classNameHoverRow: H,
46
+ enableHoverRow: H,
47
+ classNameHoverRow: I,
47
48
  // Expandable rows
48
- enableExpandedRow: I,
49
- expandedState: K,
50
- defaultExpanded: M,
51
- classNameExpandedRow: W,
52
- classNameExpandedCell: q,
53
- classNameExpandedContent: F,
54
- classNameExpandedHeader: G,
55
- classNameActiveExpandedRow: J,
56
- onExpandedChange: O,
57
- renderExpandedRow: Q,
58
- keepExpandColumnVisible: S
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 = U(
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: I,
81
- expandedState: K,
82
- onExpandedChange: O,
83
- defaultExpanded: M,
84
- classNameExpandedRow: W,
85
- classNameExpandedCell: q,
86
- classNameExpandedContent: F,
87
- classNameExpandedHeader: G,
88
- classNameActiveExpandedRow: J,
89
- enableHoverRow: C,
90
- classNameHoverRow: H,
91
- renderExpandedRow: Q,
92
- keepExpandColumnVisible: S,
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: j,
98
- multiSelectFilter: g,
98
+ actions: k,
99
+ filters: g,
100
+ multiSelectFilter: j,
99
101
  placeholder: V,
100
102
  showFilterInput: R,
101
- showResetButton: k,
102
- resetButtonClassName: P
103
+ showResetButton: P,
104
+ resetButtonClassName: C
103
105
  }
104
106
  ),
105
107
  /* @__PURE__ */ r(
106
- D,
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
- L,
124
+ rr,
123
125
  {
124
126
  className: x,
125
127
  classNameArrows: v,
126
128
  classNameActiveArrows: T
127
129
  }
128
130
  ),
129
- /* @__PURE__ */ r(rr, { isLoading: a, showPagination: e })
131
+ /* @__PURE__ */ r(er, { isLoading: a, showPagination: e })
130
132
  ]
131
133
  }
132
134
  )
133
135
  }
134
136
  ),
135
137
  e && /* @__PURE__ */ r(
136
- er,
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 = tr;
151
+ }, o = ir;
150
152
  o.displayName = "KonstructVirtualizedTable";
151
- o.TruncateText = or;
152
- o.Actions = ar;
153
+ o.TruncateText = ar;
154
+ o.Actions = tr;
153
155
  o.Events = {
154
- sendExpandRowEvent: Z,
155
- sendCollapseRowEvent: Y,
156
- sendToggleRowEvent: X
156
+ sendExpandRowEvent: _,
157
+ sendCollapseRowEvent: Z,
158
+ sendToggleRowEvent: Y
157
159
  };
158
160
  export {
159
- or as TruncateText,
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 { FilterAction, Option } from './components/Filter/Filter.types';
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
- * Configuration for a multi-select filter in the table.
30
+ * Base shape shared by all filter configurations.
28
31
  */
29
- export type MultiSelectFilter = {
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 filter dropdown */
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
- filterActions?: FilterAction[];
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
- filterActions?: FilterAction[];
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 {};