@eml-payments/ui-kit 1.8.1 → 1.8.3

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 (39) hide show
  1. package/dist/index.css +2 -2
  2. package/dist/src/assets/index.d.ts +2 -0
  3. package/dist/src/assets/index.js +3 -0
  4. package/dist/src/assets/index.ts +3 -0
  5. package/dist/src/components/Button/Button.js +2 -1
  6. package/dist/src/components/Button/index.d.ts +1 -0
  7. package/dist/src/components/Checkbox/Checkbox.js +1 -1
  8. package/dist/src/components/DatePicker/index.d.ts +1 -1
  9. package/dist/src/components/Filters/FilterSelect.d.ts +21 -0
  10. package/dist/src/components/Filters/FilterSelect.js +11 -0
  11. package/dist/src/components/Filters/Filters.d.ts +2 -0
  12. package/dist/src/components/Filters/Filters.js +64 -0
  13. package/dist/src/components/Filters/Filters.stories.d.ts +12 -0
  14. package/dist/src/components/Filters/Filters.stories.js +337 -0
  15. package/dist/src/components/Filters/Filters.types.d.ts +43 -0
  16. package/dist/src/components/Filters/Filters.types.js +4 -0
  17. package/dist/src/components/Filters/index.d.ts +2 -0
  18. package/dist/src/components/Filters/index.js +1 -0
  19. package/dist/src/components/index.d.ts +1 -0
  20. package/dist/src/components/index.js +1 -0
  21. package/package.json +2 -1
  22. package/dist/index.d.cts +0 -488
  23. package/dist/index.d.ts +0 -488
  24. package/dist/src/components/Table/BaseTable/index.d.ts +0 -1
  25. package/dist/src/components/Table/BaseTable/index.js +0 -1
  26. package/dist/src/components/Table/Pagination/PaginationControls.d.ts +0 -3
  27. package/dist/src/components/Table/Pagination/PaginationControls.js +0 -22
  28. package/dist/src/components/Table/Pagination/PaginationControls.types.d.ts +0 -24
  29. package/dist/src/components/Table/Pagination/PaginationControls.types.js +0 -1
  30. package/dist/src/components/Table/Table.d.ts +0 -4
  31. package/dist/src/components/Table/Table.js +0 -93
  32. package/dist/src/components/Table/Table.stories.d.ts +0 -31
  33. package/dist/src/components/Table/Table.stories.js +0 -479
  34. package/dist/src/components/Table/hooks/useInfiniteScrolling.d.ts +0 -29
  35. package/dist/src/components/Table/hooks/useInfiniteScrolling.js +0 -96
  36. package/dist/src/components/Table/hooks/usePaginationController.d.ts +0 -16
  37. package/dist/src/components/Table/hooks/usePaginationController.js +0 -30
  38. package/dist/src/components/Table/hooks/useTableController.d.ts +0 -26
  39. package/dist/src/components/Table/hooks/useTableController.js +0 -146
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useImperativeHandle, forwardRef } from 'react';
3
+ import { useForm, Controller, useWatch } from 'react-hook-form';
4
+ import { DatePicker } from '../DatePicker';
5
+ import { FilterSelect } from './FilterSelect';
6
+ import { Checkbox } from '../Checkbox';
7
+ import { BUTTON_GROUP_TYPE, CHECKBOX_TYPE, DATE_RANGE_TYPE, SELECT_TYPE, } from './Filters.types';
8
+ import { cn } from '../../lib/utils';
9
+ import { ButtonGroup } from '../ButtonGroup';
10
+ import { Button } from '../Button';
11
+ export const Filters = forwardRef(({ filters, defaultValues, onChange, onReset, onResetField, showResetButton = true, resetButtonText = 'Reset', resetButtonProps, }, ref) => {
12
+ const { control, reset, setValue } = useForm({
13
+ defaultValues,
14
+ });
15
+ const values = useWatch({ control });
16
+ useImperativeHandle(ref, () => ({
17
+ reset: () => {
18
+ reset();
19
+ onReset === null || onReset === void 0 ? void 0 : onReset();
20
+ },
21
+ resetField: (fieldName) => {
22
+ var _a;
23
+ setValue(fieldName, (_a = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues[fieldName]) !== null && _a !== void 0 ? _a : undefined);
24
+ onResetField === null || onResetField === void 0 ? void 0 : onResetField(fieldName);
25
+ },
26
+ }));
27
+ useEffect(() => {
28
+ onChange === null || onChange === void 0 ? void 0 : onChange(values);
29
+ }, [values, onChange]);
30
+ const renderFilterComponent = (filterConfig, field) => {
31
+ const { type, ...filterProps } = filterConfig;
32
+ switch (type) {
33
+ case DATE_RANGE_TYPE: {
34
+ const dateProps = filterProps;
35
+ return (_jsx(DatePicker, { ...dateProps, mode: "range", currentDate: field.value, onChangeDate: field.onChange, onBlur: field.onBlur, className: cn('min-w-[200px]', dateProps.className) }));
36
+ }
37
+ case SELECT_TYPE: {
38
+ const selectProps = filterProps;
39
+ return (_jsx(FilterSelect, { ...selectProps, value: field.value, onChange: field.onChange, onBlur: field.onBlur, className: cn('min-w-[200px]', selectProps.className) }));
40
+ }
41
+ case CHECKBOX_TYPE: {
42
+ const checkboxProps = filterProps;
43
+ return (_jsx(Checkbox, { ...checkboxProps, checked: field.value, onCheckedChange: field.onChange, labelPosition: "right", className: cn('border-(--uikit-inputEnabledBorder)', checkboxProps.className) }));
44
+ }
45
+ case BUTTON_GROUP_TYPE: {
46
+ const buttonGroupProps = filterProps;
47
+ return (_jsx(ButtonGroup, { ...buttonGroupProps, onValueChange: field.onChange, value: field.value, defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues[filterConfig.name], className: cn('h-full', buttonGroupProps.className), buttonClassName: cn('h-full min-w-[50px]', buttonGroupProps.buttonClassName) }));
48
+ }
49
+ default:
50
+ throw new Error(`Unknown filter type: ${type}`);
51
+ }
52
+ };
53
+ const handleResetFilters = () => {
54
+ reset();
55
+ onReset === null || onReset === void 0 ? void 0 : onReset();
56
+ };
57
+ const isResetDisabled = !Object.keys(values).some((key) => {
58
+ const defaultValue = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues[key];
59
+ const currentValue = values[key];
60
+ return JSON.stringify(defaultValue) !== JSON.stringify(currentValue);
61
+ });
62
+ return (_jsxs("div", { className: "flex items-center gap-3 h-15 w-full", children: [filters.map((filterConfig) => (_jsx("div", { className: "flex items-center mb-3 h-10", children: _jsx(Controller, { name: filterConfig.name, control: control, render: ({ field }) => renderFilterComponent(filterConfig, field) }) }, filterConfig.name))), showResetButton && (_jsx("div", { className: "flex items-center mb-3 h-10 ml-3", children: _jsx(Button, { ...resetButtonProps, variant: "secondaryOutlined", className: cn('min-w-[80px]', resetButtonProps === null || resetButtonProps === void 0 ? void 0 : resetButtonProps.className), onClick: handleResetFilters, disabled: isResetDisabled, children: resetButtonText }) }))] }));
63
+ });
64
+ Filters.displayName = 'Filters';
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { FiltersProps } from './Filters.types';
3
+ declare const meta: Meta<FiltersProps>;
4
+ type Story = StoryObj<FiltersProps>;
5
+ export declare const Default: Story;
6
+ export declare const WithDefaultValues: Story;
7
+ export declare const MultipleSelects: Story;
8
+ export declare const ComplexFilters: Story;
9
+ export declare const WithButtonGroup: Story;
10
+ export declare const WithResetButton: Story;
11
+ export declare const ResetSpecificFieldsFromParent: Story;
12
+ export default meta;
@@ -0,0 +1,337 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useRef } from 'react';
3
+ import { Filters } from './Filters';
4
+ import { dayjs } from '../../utils/dayjs';
5
+ import { Button } from '../Button';
6
+ const meta = {
7
+ title: 'UIKit/Filters',
8
+ component: Filters,
9
+ tags: ['autodocs'],
10
+ args: {
11
+ onChange: (values) => console.log('Filters changed:', values),
12
+ },
13
+ };
14
+ // Sample data for filter options
15
+ const selectOptions = [
16
+ { label: 'Active', value: 'active' },
17
+ { label: 'Inactive', value: 'inactive' },
18
+ { label: 'Pending', value: 'pending' },
19
+ ];
20
+ const statusOptions = [
21
+ { label: 'Approved', value: 'approved' },
22
+ { label: 'Rejected', value: 'rejected' },
23
+ { label: 'Under Review', value: 'under-review' },
24
+ ];
25
+ const periodOptions = [
26
+ { label: 'All', value: 'all' },
27
+ { label: 'In', value: 'in' },
28
+ { label: 'Out', value: 'out' },
29
+ ];
30
+ export const Default = {
31
+ args: {
32
+ filters: [
33
+ {
34
+ type: 'buttonGroup',
35
+ name: 'period',
36
+ options: periodOptions,
37
+ },
38
+ {
39
+ type: 'dateRange',
40
+ name: 'dateRange',
41
+ rangeDateFormat: 'D MMM YY',
42
+ placeholder: `${dayjs().subtract(6, 'month').format('D MMM YY')} - Today`,
43
+ },
44
+ {
45
+ type: 'select',
46
+ name: 'status',
47
+ label: 'Status',
48
+ options: selectOptions,
49
+ placeholder: 'Select status...',
50
+ },
51
+ {
52
+ type: 'checkbox',
53
+ name: 'active',
54
+ label: 'Active Only',
55
+ },
56
+ ],
57
+ defaultValues: {
58
+ period: 'all',
59
+ status: '',
60
+ active: false,
61
+ },
62
+ showResetButton: true,
63
+ },
64
+ render: (args) => {
65
+ const [values, setValues] = useState(args.defaultValues || {});
66
+ return (_jsxs("div", { children: [_jsx(Filters, { ...args, onChange: (newValues) => {
67
+ var _a;
68
+ setValues(newValues);
69
+ (_a = args.onChange) === null || _a === void 0 ? void 0 : _a.call(args, newValues);
70
+ } }), _jsxs("div", { className: "mt-4 rounded border border-gray-200 bg-gray-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold", children: "Current Values:" }), _jsx("pre", { className: "mt-2 text-xs", children: JSON.stringify(values, null, 2) })] })] }));
71
+ },
72
+ };
73
+ export const WithDefaultValues = {
74
+ args: {
75
+ filters: [
76
+ {
77
+ type: 'select',
78
+ name: 'category',
79
+ label: 'Category',
80
+ options: [
81
+ { label: 'Electronics', value: 'electronics' },
82
+ { label: 'Clothing', value: 'clothing' },
83
+ { label: 'Food', value: 'food' },
84
+ ],
85
+ placeholder: 'Select category...',
86
+ },
87
+ {
88
+ type: 'checkbox',
89
+ name: 'inStock',
90
+ label: 'In Stock Only',
91
+ },
92
+ ],
93
+ defaultValues: {
94
+ category: 'electronics',
95
+ inStock: true,
96
+ },
97
+ },
98
+ render: (args) => {
99
+ const [values, setValues] = useState(args.defaultValues || {});
100
+ return (_jsxs("div", { children: [_jsx(Filters, { ...args, onChange: (newValues) => {
101
+ var _a;
102
+ setValues(newValues);
103
+ (_a = args.onChange) === null || _a === void 0 ? void 0 : _a.call(args, newValues);
104
+ } }), _jsxs("div", { className: "mt-4 rounded border border-gray-200 bg-gray-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold", children: "Current Values:" }), _jsx("pre", { className: "mt-2 text-xs", children: JSON.stringify(values, null, 2) })] })] }));
105
+ },
106
+ };
107
+ export const MultipleSelects = {
108
+ args: {
109
+ filters: [
110
+ {
111
+ type: 'select',
112
+ name: 'department',
113
+ label: 'Department',
114
+ options: [
115
+ { label: 'Sales', value: 'sales' },
116
+ { label: 'Engineering', value: 'engineering' },
117
+ { label: 'HR', value: 'hr' },
118
+ { label: 'Finance', value: 'finance' },
119
+ ],
120
+ placeholder: 'Select department...',
121
+ },
122
+ {
123
+ type: 'select',
124
+ name: 'region',
125
+ label: 'Region',
126
+ options: [
127
+ { label: 'North America', value: 'na' },
128
+ { label: 'Europe', value: 'eu' },
129
+ { label: 'Asia', value: 'asia' },
130
+ { label: 'Australia', value: 'au' },
131
+ ],
132
+ placeholder: 'Select region...',
133
+ },
134
+ ],
135
+ showResetButton: false,
136
+ },
137
+ render: (args) => {
138
+ const [values, setValues] = useState(args.defaultValues || {});
139
+ return (_jsxs("div", { children: [_jsx(Filters, { ...args, onChange: (newValues) => {
140
+ var _a;
141
+ setValues(newValues);
142
+ (_a = args.onChange) === null || _a === void 0 ? void 0 : _a.call(args, newValues);
143
+ } }), _jsxs("div", { className: "mt-4 rounded border border-gray-200 bg-gray-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold", children: "Selected Filters:" }), _jsx("pre", { className: "mt-2 text-xs", children: JSON.stringify(values, null, 2) })] })] }));
144
+ },
145
+ };
146
+ export const ComplexFilters = {
147
+ args: {
148
+ filters: [
149
+ {
150
+ type: 'dateRange',
151
+ name: 'createdDate',
152
+ rangeDateFormat: 'D MMM YY',
153
+ placeholder: `${dayjs().subtract(3, 'month').format('D MMM YY')} - Today`,
154
+ },
155
+ {
156
+ type: 'select',
157
+ name: 'priority',
158
+ label: 'Priority',
159
+ options: [
160
+ { label: 'Low', value: 'low' },
161
+ { label: 'Medium', value: 'medium' },
162
+ { label: 'High', value: 'high' },
163
+ { label: 'Critical', value: 'critical' },
164
+ ],
165
+ placeholder: 'Select priority...',
166
+ },
167
+ {
168
+ type: 'checkbox',
169
+ name: 'urgent',
170
+ label: 'Urgent Only',
171
+ },
172
+ {
173
+ type: 'checkbox',
174
+ name: 'assigned',
175
+ label: 'Assigned to Me',
176
+ },
177
+ ],
178
+ defaultValues: {
179
+ createdDate: [dayjs().subtract(3, 'month').toDate(), dayjs().toDate()],
180
+ priority: 'high',
181
+ urgent: true,
182
+ assigned: true,
183
+ },
184
+ showResetButton: true,
185
+ },
186
+ render: (args) => {
187
+ const [values, setValues] = useState(args.defaultValues || {});
188
+ return (_jsxs("div", { children: [_jsx(Filters, { ...args, onChange: (newValues) => {
189
+ var _a;
190
+ setValues(newValues);
191
+ (_a = args.onChange) === null || _a === void 0 ? void 0 : _a.call(args, newValues);
192
+ } }), _jsxs("div", { className: "mt-4 rounded border border-gray-200 bg-gray-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold", children: "Applied Filters:" }), _jsx("pre", { className: "mt-2 text-xs", children: JSON.stringify(values, null, 2) })] })] }));
193
+ },
194
+ };
195
+ export const WithButtonGroup = {
196
+ args: {
197
+ filters: [
198
+ {
199
+ type: 'buttonGroup',
200
+ name: 'period',
201
+ options: periodOptions,
202
+ },
203
+ {
204
+ type: 'dateRange',
205
+ name: 'dateRange',
206
+ rangeDateFormat: 'D MMM YY',
207
+ placeholder: `${dayjs().subtract(1, 'month').format('D MMM YY')} - Today`,
208
+ },
209
+ {
210
+ type: 'select',
211
+ name: 'status',
212
+ label: 'Status',
213
+ options: selectOptions,
214
+ placeholder: 'Select status...',
215
+ },
216
+ ],
217
+ defaultValues: {
218
+ period: 'in',
219
+ dateRange: [dayjs().subtract(1, 'month').toDate(), dayjs().toDate()],
220
+ status: 'active',
221
+ },
222
+ showResetButton: true,
223
+ },
224
+ render: (args) => {
225
+ const [values, setValues] = useState(args.defaultValues || {});
226
+ return (_jsxs("div", { children: [_jsx(Filters, { ...args, onChange: (newValues) => {
227
+ var _a;
228
+ setValues(newValues);
229
+ (_a = args.onChange) === null || _a === void 0 ? void 0 : _a.call(args, newValues);
230
+ } }), _jsxs("div", { className: "mt-4 rounded border border-gray-200 bg-gray-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold", children: "Current Values:" }), _jsx("pre", { className: "mt-2 text-xs", children: JSON.stringify(values, null, 2) })] })] }));
231
+ },
232
+ };
233
+ export const WithResetButton = {
234
+ args: {
235
+ filters: [
236
+ {
237
+ type: 'select',
238
+ name: 'status',
239
+ label: 'Status',
240
+ options: statusOptions,
241
+ placeholder: 'Select status...',
242
+ },
243
+ {
244
+ type: 'dateRange',
245
+ name: 'dateRange',
246
+ rangeDateFormat: 'D MMM YY',
247
+ placeholder: `${dayjs().subtract(1, 'month').format('D MMM YY')} - Today`,
248
+ },
249
+ {
250
+ type: 'checkbox',
251
+ name: 'verified',
252
+ label: 'Verified Only',
253
+ },
254
+ ],
255
+ defaultValues: {
256
+ status: 'approved',
257
+ verified: true,
258
+ },
259
+ showResetButton: true,
260
+ resetButtonText: 'Clear Filters',
261
+ },
262
+ render: (args) => {
263
+ const [values, setValues] = useState(args.defaultValues || {});
264
+ const [resetCount, setResetCount] = useState(0);
265
+ return (_jsxs("div", { children: [_jsx(Filters, { ...args, onChange: (newValues) => {
266
+ var _a;
267
+ setValues(newValues);
268
+ (_a = args.onChange) === null || _a === void 0 ? void 0 : _a.call(args, newValues);
269
+ }, onReset: () => {
270
+ setResetCount((count) => count + 1);
271
+ } }), _jsxs("div", { className: "mt-4 rounded border border-gray-200 bg-gray-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold", children: "Current Values:" }), _jsx("pre", { className: "mt-2 text-xs", children: JSON.stringify(values, null, 2) }), _jsxs("p", { className: "mt-4 text-sm text-gray-600", children: ["Reset clicked: ", resetCount, " times"] })] })] }));
272
+ },
273
+ };
274
+ export const ResetSpecificFieldsFromParent = {
275
+ args: {
276
+ filters: [
277
+ {
278
+ type: 'select',
279
+ name: 'department',
280
+ label: 'Department',
281
+ options: [
282
+ { label: 'Sales', value: 'sales' },
283
+ { label: 'Engineering', value: 'engineering' },
284
+ { label: 'HR', value: 'hr' },
285
+ ],
286
+ placeholder: 'Select department...',
287
+ },
288
+ {
289
+ type: 'select',
290
+ name: 'region',
291
+ label: 'Region',
292
+ options: [
293
+ { label: 'North America', value: 'na' },
294
+ { label: 'Europe', value: 'eu' },
295
+ { label: 'Asia', value: 'asia' },
296
+ ],
297
+ placeholder: 'Select region...',
298
+ },
299
+ {
300
+ type: 'checkbox',
301
+ name: 'active',
302
+ label: 'Active Only',
303
+ },
304
+ ],
305
+ defaultValues: {
306
+ department: 'sales',
307
+ region: 'na',
308
+ active: true,
309
+ },
310
+ showResetButton: false,
311
+ },
312
+ render: (args) => {
313
+ const [values, setValues] = useState(args.defaultValues || {});
314
+ const [resetLog, setResetLog] = useState([]);
315
+ const filtersRef = useRef(null);
316
+ const handleResetDepartment = () => {
317
+ var _a;
318
+ (_a = filtersRef.current) === null || _a === void 0 ? void 0 : _a.resetField('department');
319
+ };
320
+ const handleResetRegion = () => {
321
+ var _a;
322
+ (_a = filtersRef.current) === null || _a === void 0 ? void 0 : _a.resetField('region');
323
+ };
324
+ const handleResetAll = () => {
325
+ var _a;
326
+ (_a = filtersRef.current) === null || _a === void 0 ? void 0 : _a.reset();
327
+ };
328
+ return (_jsxs("div", { children: [_jsxs("div", { className: "mb-4 flex gap-2", children: [_jsx(Button, { onClick: handleResetDepartment, variant: "outlined", children: "Reset Department" }), _jsx(Button, { onClick: handleResetRegion, variant: "outlined", children: "Reset Region" }), _jsx(Button, { onClick: handleResetAll, variant: "secondaryFilled", children: "Reset All" })] }), _jsx(Filters, { ref: filtersRef, ...args, onChange: (newValues) => {
329
+ var _a;
330
+ setValues(newValues);
331
+ (_a = args.onChange) === null || _a === void 0 ? void 0 : _a.call(args, newValues);
332
+ }, onResetField: (fieldName) => {
333
+ setResetLog((prev) => [...prev, `${new Date().toLocaleTimeString()}: ${fieldName} reset`]);
334
+ } }), _jsxs("div", { className: "mt-4 rounded border border-gray-200 bg-gray-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold", children: "Current Values:" }), _jsx("pre", { className: "mt-2 text-xs", children: JSON.stringify(values, null, 2) }), _jsx("p", { className: "mt-4 text-sm font-semibold", children: "Reset Log:" }), _jsx("div", { className: "mt-2 max-h-[150px] overflow-auto bg-white rounded border text-xs", children: resetLog.length === 0 ? (_jsx("p", { className: "p-2 text-gray-400", children: "No resets yet..." })) : (resetLog.map((log, idx) => (_jsx("p", { className: "p-1 border-b last:border-b-0", children: log }, idx)))) })] })] }));
335
+ },
336
+ };
337
+ export default meta;
@@ -0,0 +1,43 @@
1
+ import type { DatePickerProps } from '../DatePicker';
2
+ import type { CheckboxProps } from '../Checkbox';
3
+ import type { FilterSelectProps } from './FilterSelect';
4
+ import type { ButtonGroupProps } from '../ButtonGroup';
5
+ import type { ButtonProps } from '../Button';
6
+ export declare const DATE_RANGE_TYPE = "dateRange";
7
+ export declare const SELECT_TYPE = "select";
8
+ export declare const CHECKBOX_TYPE = "checkbox";
9
+ export declare const BUTTON_GROUP_TYPE = "buttonGroup";
10
+ export type FilterType = typeof DATE_RANGE_TYPE | typeof SELECT_TYPE | typeof CHECKBOX_TYPE | typeof BUTTON_GROUP_TYPE;
11
+ type DateRangeFilterOption = Omit<DatePickerProps, 'type'> & {
12
+ type: typeof DATE_RANGE_TYPE;
13
+ name: string;
14
+ };
15
+ type SelectFilterOption = Omit<FilterSelectProps, 'value' | 'onValueChange'> & {
16
+ type: typeof SELECT_TYPE;
17
+ name: string;
18
+ label?: string;
19
+ };
20
+ type CheckboxFilterOption = Omit<CheckboxProps, 'type'> & {
21
+ type: typeof CHECKBOX_TYPE;
22
+ name: string;
23
+ };
24
+ type ButtonGroupOption = ButtonGroupProps & {
25
+ type: typeof BUTTON_GROUP_TYPE;
26
+ name: string;
27
+ };
28
+ export type FilterConfigType = DateRangeFilterOption | SelectFilterOption | CheckboxFilterOption | ButtonGroupOption;
29
+ export type FiltersHandle = {
30
+ reset: () => void;
31
+ resetField: (fieldName: string) => void;
32
+ };
33
+ export type FiltersProps = {
34
+ filters: FilterConfigType[];
35
+ defaultValues?: Record<string, unknown>;
36
+ showResetButton?: boolean;
37
+ resetButtonText?: string;
38
+ resetButtonProps?: ButtonProps;
39
+ onReset?: () => void;
40
+ onResetField?: (fieldName: string) => void;
41
+ onChange: (values: Record<string, unknown>) => void;
42
+ };
43
+ export {};
@@ -0,0 +1,4 @@
1
+ export const DATE_RANGE_TYPE = 'dateRange';
2
+ export const SELECT_TYPE = 'select';
3
+ export const CHECKBOX_TYPE = 'checkbox';
4
+ export const BUTTON_GROUP_TYPE = 'buttonGroup';
@@ -0,0 +1,2 @@
1
+ export { Filters } from './Filters';
2
+ export type { FilterType, FilterConfigType, FiltersHandle, FiltersProps } from './Filters.types';
@@ -0,0 +1 @@
1
+ export { Filters } from './Filters';
@@ -37,3 +37,4 @@ export * from './InputGroup';
37
37
  export * from './PhoneInput';
38
38
  export * from './ButtonGroup';
39
39
  export * from './CreditCard';
40
+ export * from './Filters';
@@ -37,3 +37,4 @@ export * from './InputGroup';
37
37
  export * from './PhoneInput';
38
38
  export * from './ButtonGroup';
39
39
  export * from './CreditCard';
40
+ export * from './Filters';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eml-payments/ui-kit",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "private": false,
5
5
  "description": "ARLO UIKit",
6
6
  "homepage": "https://github.com/EML-Payments/arlo.npm.uikit#readme",
@@ -79,6 +79,7 @@
79
79
  "react": ">=18.0.0",
80
80
  "react-day-picker": "^9.13.0",
81
81
  "react-dom": ">=18.0.0",
82
+ "react-hook-form": "^7.75.0",
82
83
  "react-icons": "^5.5.0",
83
84
  "react-router-dom": "^7.9.5",
84
85
  "tailwind-merge": "^3.4.0",