@konstructio/ui 0.1.2-alpha.71 → 0.1.2-alpha.73

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