@yuno-payments/dashboard-design-system 1.0.4 → 1.0.6-beta.2

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.
@@ -98,7 +98,7 @@ const te = ({ message: n = "No results" }) => /* @__PURE__ */ t.jsx("div", { cla
98
98
  "aria-haspopup": "listbox",
99
99
  "aria-controls": c ? `${i}-listbox` : void 0,
100
100
  className: f(
101
- "flex h-auto min-h-[38px] w-full items-center justify-between gap-2 rounded-md border border-input bg-input px-3 py-1.5 text-sm shadow-xs ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
101
+ "flex h-auto min-h-[38px] w-full items-center justify-between gap-2 rounded-md border border-input bg-input px-3 py-2 text-sm shadow-xs ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 h-[38px]",
102
102
  u && "border-destructive",
103
103
  v && "w-full"
104
104
  ),
@@ -199,8 +199,31 @@ interface FilterConfig {
199
199
  clearable?: boolean;
200
200
  /**
201
201
  * Custom render function for 'custom' type filters
202
+ * When applyOnClose is enabled, receives a deferredContext with buffered handlers
202
203
  */
203
- renderContent?: () => ReactNode;
204
+ renderContent?: (deferredContext?: FilterDeferredContext) => ReactNode;
205
+ /**
206
+ * Callback fired when custom filter changes are applied (used with applyOnClose)
207
+ * This is called when the dropdown closes with buffered custom filter changes
208
+ */
209
+ onCustomChange?: (value: unknown) => void;
210
+ }
211
+ /**
212
+ * Context passed to custom renderContent when applyOnClose is enabled
213
+ */
214
+ interface FilterDeferredContext {
215
+ /**
216
+ * Current buffered value for this filter (if any changes were made)
217
+ */
218
+ bufferedValue: unknown;
219
+ /**
220
+ * Handler to update the buffered value (will be applied on close)
221
+ */
222
+ onDeferredChange: (value: unknown) => void;
223
+ /**
224
+ * Whether applyOnClose mode is enabled
225
+ */
226
+ isDeferred: boolean;
204
227
  }
205
228
  /**
206
229
  * Props for the FilterDropdown component
@@ -255,29 +278,12 @@ interface FilterDropdownProps {
255
278
  * @default false
256
279
  */
257
280
  disabled?: boolean;
281
+ /**
282
+ * When true, filter changes are buffered internally and only applied when
283
+ * the dropdown closes. This prevents triggering API calls on every change.
284
+ * @default false
285
+ */
286
+ applyOnClose?: boolean;
258
287
  }
259
- /**
260
- * Advanced filter dropdown component with sidebar navigation and multiple filter types.
261
- * Supports checkbox, radio, date range, and custom filters with applied filter badges.
262
- *
263
- * @example
264
- * ```tsx
265
- * <FilterDropdown
266
- * filters={[
267
- * {
268
- * id: 'status',
269
- * label: 'Status',
270
- * type: 'checkbox',
271
- * items: [{ value: 'active', label: 'Active' }],
272
- * selectedValues: ['active'],
273
- * onChange: (values) => console.log(values)
274
- * }
275
- * ]}
276
- * appliedFilters={[{ id: 'status', label: 'Status: Active' }]}
277
- * onRemoveFilter={(id) => console.log('Remove', id)}
278
- * onClearAllFilters={() => console.log('Clear all')}
279
- * />
280
- * ```
281
- */
282
288
  declare const FilterDropdown: import('react').ForwardRefExoticComponent<FilterDropdownProps & import('react').RefAttributes<HTMLDivElement>>;
283
- export { FilterDropdown, FilterMenu, FilterMenuItem, type FilterDropdownProps, type FilterConfig, type FilterMenuProps, type FilterMenuItemProps, };
289
+ export { FilterDropdown, FilterMenu, FilterMenuItem, type FilterDropdownProps, type FilterConfig, type FilterMenuProps, type FilterMenuItemProps, type FilterDeferredContext, };