@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.
Files changed (79) 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 +14 -11
  29. package/dist/components/Filter/Filter.types.d.ts +2 -1
  30. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.d.ts +3 -0
  31. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +14 -0
  32. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +74 -0
  33. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +155 -0
  34. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.types.d.ts +13 -0
  35. package/dist/components/Filter/components/index.d.ts +2 -0
  36. package/dist/components/Filter/components/index.js +10 -8
  37. package/dist/components/LineChart/LineChart.d.ts +17 -0
  38. package/dist/components/LineChart/LineChart.js +154 -0
  39. package/dist/components/LineChart/LineChart.types.d.ts +54 -0
  40. package/dist/components/Modal/Modal.js +1 -1
  41. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  42. package/dist/components/Modal/components/index.js +1 -1
  43. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
  44. package/dist/components/PieChart/PieChart.js +51 -5095
  45. package/dist/components/ProgressBar/ProgressBar.variants.d.ts +1 -1
  46. package/dist/components/RadioCardGroup/RadioCardGroup.variants.d.ts +1 -1
  47. package/dist/components/RadioGroup/RadioGroup.variants.d.ts +1 -1
  48. package/dist/components/Tabs/Tabs.variants.d.ts +1 -1
  49. package/dist/components/Toast/Toast.variants.d.ts +1 -1
  50. package/dist/components/Tooltip/Tooltip.d.ts +4 -9
  51. package/dist/components/Tooltip/Tooltip.js +35 -33
  52. package/dist/components/Tooltip/Tooltip.types.d.ts +22 -11
  53. package/dist/components/Typography/Typography.variants.d.ts +1 -1
  54. package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +28 -4
  55. package/dist/components/VirtualizedTable/components/Filter/Filter.js +121 -91
  56. package/dist/components/VirtualizedTable/components/Filter/Filter.types.d.ts +5 -8
  57. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
  58. package/dist/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
  59. package/dist/components/VirtualizedTable/contexts/table.context.js +3 -0
  60. package/dist/components/VirtualizedTable/contexts/table.provider.js +179 -168
  61. package/dist/components/index.d.ts +2 -1
  62. package/dist/components/index.js +117 -113
  63. package/dist/icons.d.ts +1 -1
  64. package/dist/icons.js +124 -116
  65. package/dist/{index-DPcwqB8q.js → index-B7-5g1Sm.js} +169 -168
  66. package/dist/index-qDQP8rW4.js +7281 -0
  67. package/dist/index.d.ts +1 -1
  68. package/dist/index.js +144 -139
  69. package/dist/package.json +8 -8
  70. package/dist/{proxy-CngVm5qA.js → proxy-0sbyKj-k.js} +732 -728
  71. package/dist/styles.css +1 -1
  72. package/dist/utils/index.d.ts +1 -0
  73. package/dist/utils/index.js +16 -15
  74. package/package.json +8 -8
  75. package/dist/assets/icons/components/CheckCircle.d.ts +0 -3
  76. package/dist/components/Tooltip/Tooltip.variants.d.ts +0 -6
  77. package/dist/components/Tooltip/Tooltip.variants.js +0 -86
  78. package/dist/components/Tooltip/hooks/useTooltip.d.ts +0 -4
  79. 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,9 +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';
4
5
  import { DateRange, DateRangeWithTime } from '../DateRangePicker/DateRangePicker.types';
6
+ import { TimePreset } from '../Filter/components/TimeFilterDropdown/TimeFilterDropdown.types';
5
7
  import { virtualizeTableVariants } from './VirtualizedTable.variants';
6
- import { FilterAction, Option } from './components/Filter/Filter.types';
8
+ import { Option } from './components/Filter/Filter.types';
7
9
  import { UseQueryOptions } from '@tanstack/react-query';
8
10
  /** Base row data type from TanStack Table */
9
11
  export type RowData = RowDataPrimitive;
@@ -84,10 +86,30 @@ export type DateRangeFilterConfig = FilterConfigBase & {
84
86
  /** Callback when the date range changes */
85
87
  onRangeChange?: (range: DateRangeWithTime) => void;
86
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
+ };
87
109
  /**
88
110
  * Union of all supported filter configurations.
89
111
  */
90
- export type FilterConfig = BadgeMultiSelectFilterConfig | TextMultiSelectFilterConfig | DateFilterConfig | DateRangeFilterConfig;
112
+ export type FilterConfig = BadgeMultiSelectFilterConfig | TextMultiSelectFilterConfig | DateFilterConfig | DateRangeFilterConfig | ActionFilterConfig | TimeFilterConfig;
91
113
  /**
92
114
  * @deprecated Use FilterConfig instead
93
115
  */
@@ -157,7 +179,8 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
157
179
  filters?: FilterConfig[];
158
180
  showFilter: true;
159
181
  showFilterInput?: boolean;
160
- filterActions?: FilterAction[];
182
+ /** @deprecated Use `ActionFilterConfig` items in `filters` instead */
183
+ filterActions?: ActionFilterConfig[];
161
184
  showResetButton?: boolean;
162
185
  resetButtonClassName?: string;
163
186
  } | {
@@ -167,7 +190,8 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
167
190
  filters?: never;
168
191
  showFilter?: false | undefined;
169
192
  showFilterInput?: never;
170
- filterActions?: FilterAction[];
193
+ /** @deprecated Use `ActionFilterConfig` items in `filters` instead */
194
+ filterActions?: ActionFilterConfig[];
171
195
  showResetButton?: never;
172
196
  resetButtonClassName?: never;
173
197
  }) & ({
@@ -1,80 +1,107 @@
1
- import { jsxs as D, jsx as n } from "react/jsx-runtime";
2
- import { d as N } from "../../../../debounce-DJveWHr_.js";
3
- import { useRef as P, useMemo as m, useCallback as S } from "react";
4
- import { Button as I } from "../../../Button/Button.js";
5
- import { Filter as r } from "../../../Filter/Filter.js";
6
- import { Input as $ } from "../../../Input/Input.js";
7
- import { cn as q } from "../../../../utils/index.js";
8
- import { useTableContext as z } from "../../contexts/table.hook.js";
9
- const U = ({
10
- actions: b,
1
+ import { jsxs as S, jsx as s } from "react/jsx-runtime";
2
+ import { d as q } from "../../../../debounce-DJveWHr_.js";
3
+ import { useRef as z, useMemo as m, useCallback as w } from "react";
4
+ import { Button as E } from "../../../Button/Button.js";
5
+ import { Filter as n } from "../../../Filter/Filter.js";
6
+ import { Input as G } from "../../../Input/Input.js";
7
+ import { cn as H } from "../../../../utils/index.js";
8
+ import { useTableContext as J } from "../../contexts/table.hook.js";
9
+ const C = ({
10
+ actions: p,
11
11
  filters: u,
12
- multiSelectFilter: p,
13
- placeholder: x,
14
- showFilterInput: w = !0,
15
- showResetButton: M = !0,
16
- resetButtonClassName: v
12
+ multiSelectFilter: d,
13
+ placeholder: T,
14
+ showFilterInput: v = !0,
15
+ showResetButton: x = !0,
16
+ resetButtonClassName: M
17
17
  }) => {
18
- const c = P(null), {
19
- termOfSearch: d,
20
- multiselectSelected: i,
21
- dateFilters: h,
22
- dateRangeFilters: y,
23
- onChangeTermOfSearch: s,
24
- onSelectMultiselect: F,
18
+ const l = z(null), {
19
+ termOfSearch: i,
20
+ multiselectSelected: h,
21
+ dateFilters: y,
22
+ dateRangeFilters: F,
23
+ timeFilters: b,
24
+ onChangeTermOfSearch: c,
25
+ onSelectMultiselect: D,
25
26
  onSelectDateFilter: j,
26
- onSelectDateRangeFilter: O
27
- } = z(), T = m(
28
- () => u ?? p?.map((e) => ({
29
- ...e,
27
+ onSelectDateRangeFilter: O,
28
+ onSelectTimeFilter: A
29
+ } = J(), B = m(() => {
30
+ const e = u ?? d?.map((o) => ({
31
+ ...o,
30
32
  type: "badgeMultiSelect"
31
- })) ?? [],
32
- [u, p]
33
- ), R = S(
34
- (e, t) => F(
33
+ })) ?? [], t = p ?? [];
34
+ return [...e, ...t];
35
+ }, [u, d, p]), R = w(
36
+ (e, t) => D(
35
37
  e,
36
- t.map((a) => a.id)
38
+ t.map((o) => o.id)
37
39
  ),
38
- [F]
39
- ), g = S(() => {
40
- s(""), c.current && (c.current.value = "");
41
- }, [s]), B = m(
42
- () => N((e) => {
43
- s(e.target.value);
40
+ [D]
41
+ ), k = w(() => {
42
+ c(""), l.current && (l.current.value = "");
43
+ }, [c]), P = m(
44
+ () => q((e) => {
45
+ c(e.target.value);
44
46
  }, 500),
45
- [s]
46
- ), A = m(
47
- () => !!d || Object.values(i ?? {}).flat().length > 0 || Object.values(h ?? {}).some(Boolean) || Object.values(y ?? {}).some(Boolean),
48
- [d, i, h, y]
49
- ), k = (e) => {
50
- const { key: t, label: a, position: l = "right" } = e;
51
- return e.type === "textMultiSelect" ? /* @__PURE__ */ n(
52
- r.TextMultiSelect,
53
- {
47
+ [c]
48
+ ), N = m(
49
+ () => !!i || Object.values(h ?? {}).flat().length > 0 || Object.values(y ?? {}).some(Boolean) || Object.values(F ?? {}).some(Boolean) || Object.values(b ?? {}).some(Boolean),
50
+ [
51
+ i,
52
+ h,
53
+ y,
54
+ F,
55
+ b
56
+ ]
57
+ ), I = (e) => {
58
+ if (e.type === "action") {
59
+ const {
54
60
  label: a,
55
- position: l,
61
+ appearance: _ = "compact",
62
+ variant: $ = "secondary",
63
+ type: K,
64
+ ...g
65
+ } = e;
66
+ return /* @__PURE__ */ s(
67
+ E,
68
+ {
69
+ appearance: _,
70
+ variant: $,
71
+ ...g,
72
+ children: a
73
+ },
74
+ a
75
+ );
76
+ }
77
+ const { key: t, label: o, position: r = "right" } = e;
78
+ return e.type === "textMultiSelect" ? /* @__PURE__ */ s(
79
+ n.TextMultiSelect,
80
+ {
81
+ label: o,
82
+ position: r,
56
83
  options: e.options,
57
- onApply: (o) => {
58
- R(t, o);
84
+ onApply: (a) => {
85
+ R(t, a);
59
86
  }
60
87
  },
61
88
  t
62
- ) : e.type === "date" ? /* @__PURE__ */ n(
63
- r.DateFilterDropdown,
89
+ ) : e.type === "date" ? /* @__PURE__ */ s(
90
+ n.DateFilterDropdown,
64
91
  {
65
- label: a,
66
- position: l,
92
+ label: o,
93
+ position: r,
67
94
  countryCode: e.countryCode,
68
- onApply: (o) => {
69
- j(t, o);
95
+ onApply: (a) => {
96
+ j(t, a);
70
97
  }
71
98
  },
72
99
  t
73
- ) : e.type === "dateRange" ? /* @__PURE__ */ n(
74
- r.DateRangeFilterDropdown,
100
+ ) : e.type === "dateRange" ? /* @__PURE__ */ s(
101
+ n.DateRangeFilterDropdown,
75
102
  {
76
- label: a,
77
- position: l,
103
+ label: o,
104
+ position: r,
78
105
  showTime: e.showTime,
79
106
  timeFormat: e.timeFormat,
80
107
  showPresets: e.showPresets,
@@ -82,61 +109,64 @@ const U = ({
82
109
  minDate: e.minDate,
83
110
  maxDate: e.maxDate,
84
111
  countryCode: e.countryCode,
85
- onApply: (o) => {
86
- O(t, o);
112
+ onApply: (a) => {
113
+ O(t, a);
87
114
  },
88
115
  onRangeChange: e.onRangeChange
89
116
  },
90
117
  t
91
- ) : /* @__PURE__ */ n(
92
- r.BadgeMultiSelect,
118
+ ) : e.type === "time" ? /* @__PURE__ */ s(
119
+ n.TimeFilterDropdown,
93
120
  {
94
- label: a,
95
- position: l,
121
+ label: o,
122
+ position: r,
123
+ format: e.format,
124
+ presets: e.presets,
125
+ showTimePicker: e.showTimePicker,
126
+ onApply: (a) => {
127
+ A(t, a);
128
+ }
129
+ },
130
+ t
131
+ ) : /* @__PURE__ */ s(
132
+ n.BadgeMultiSelect,
133
+ {
134
+ label: o,
135
+ position: r,
96
136
  options: e.options,
97
- onApply: (o) => {
98
- R(t, o);
137
+ onApply: (a) => {
138
+ R(t, a);
99
139
  }
100
140
  },
101
141
  t
102
142
  );
103
143
  };
104
- return /* @__PURE__ */ D("div", { className: "w-full flex items-center justify-end pb-6", children: [
105
- w && /* @__PURE__ */ n(
106
- $,
144
+ return /* @__PURE__ */ S("div", { className: "w-full flex items-center justify-end pb-6", children: [
145
+ v && /* @__PURE__ */ s(
146
+ G,
107
147
  {
108
- ref: c,
109
- placeholder: x,
148
+ ref: l,
149
+ placeholder: T,
110
150
  isSearch: !0,
111
151
  autoComplete: "false",
112
152
  className: "w-72",
113
153
  inputMode: "search",
114
- onChange: B
154
+ onChange: P
115
155
  }
116
156
  ),
117
- /* @__PURE__ */ D(r, { children: [
118
- T.map(k),
119
- b?.map(({ label: e, onClick: t, variant: a = "secondary" }) => /* @__PURE__ */ n(
120
- I,
121
- {
122
- variant: a,
123
- appearance: "compact",
124
- onClick: t,
125
- children: e
126
- },
127
- e
128
- )),
129
- M && /* @__PURE__ */ n(
130
- r.ResetButton,
157
+ /* @__PURE__ */ S(n, { children: [
158
+ B.map(I),
159
+ x && /* @__PURE__ */ s(
160
+ n.ResetButton,
131
161
  {
132
- className: q("select-none", v),
133
- disabled: !A,
134
- onClick: g
162
+ className: H("select-none", M),
163
+ disabled: !N,
164
+ onClick: k
135
165
  }
136
166
  )
137
167
  ] })
138
168
  ] });
139
169
  };
140
170
  export {
141
- U as Filter
171
+ C as Filter
142
172
  };
@@ -1,16 +1,13 @@
1
- import { ButtonProps } from '../../../Button/Button.types';
2
- import { FilterConfig, MultiSelectFilter } from '../../VirtualizedTable.types';
1
+ import { ActionFilterConfig, FilterConfig, MultiSelectFilter } from '../../VirtualizedTable.types';
3
2
  export type { Option } from '../../../Filter/Filter.types';
4
- export type FilterAction = {
5
- label: string;
6
- onClick: () => void;
7
- variant?: ButtonProps['variant'];
8
- };
3
+ /** @deprecated Use `ActionFilterConfig` with `type: 'action'` in the `filters` array instead */
4
+ export type FilterAction = ActionFilterConfig;
9
5
  export type Props = {
10
- actions?: FilterAction[];
11
6
  filters?: FilterConfig[];
12
7
  /** @deprecated Use `filters` instead */
13
8
  multiSelectFilter?: MultiSelectFilter[];
9
+ /** @deprecated Use `ActionFilterConfig` items in `filters` instead */
10
+ actions?: FilterAction[];
14
11
  placeholder: string;
15
12
  showFilterInput?: boolean;
16
13
  showResetButton?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { P as u, R as b, T as m, C as p } from "../../../../index-DPcwqB8q.js";
2
+ import { P as u, R as b, T as m, C as p } from "../../../../index-B7-5g1Sm.js";
3
3
  import { d as h } from "../../../../debounce-DJveWHr_.js";
4
4
  import { useRef as x, useState as w, useCallback as g, useEffect as s } from "react";
5
5
  const v = ({ getValue: l, value: i }) => {
@@ -16,6 +16,7 @@ export type ContextType<TData extends RowData = RowData> = {
16
16
  from?: string;
17
17
  to?: string;
18
18
  } | undefined>;
19
+ timeFilters?: Record<string, string | undefined>;
19
20
  totalPages: number;
20
21
  isFirstLoad: boolean;
21
22
  enableExpandedRow?: boolean;
@@ -38,5 +39,6 @@ export type ContextType<TData extends RowData = RowData> = {
38
39
  from?: Date;
39
40
  to?: Date;
40
41
  }) => void;
42
+ onSelectTimeFilter: (key: string, time?: Date) => void;
41
43
  };
42
44
  export declare const TableContext: import('react').Context<ContextType<unknown>>;
@@ -26,6 +26,9 @@ const r = e({
26
26
  onSelectDateRangeFilter() {
27
27
  throw new Error("onSelectDateRangeFilter function is not implemented");
28
28
  },
29
+ onSelectTimeFilter() {
30
+ throw new Error("onSelectTimeFilter function is not implemented");
31
+ },
29
32
  handlePage() {
30
33
  throw new Error("handlePage function is not implemented");
31
34
  },