@pagamio/frontend-commons-lib 0.8.353 → 0.8.355

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.
@@ -3,6 +3,12 @@ interface EmptyStateProps {
3
3
  title: string;
4
4
  description?: string;
5
5
  icon?: React.ReactNode;
6
+ /**
7
+ * Optional CTA rendered below the description. Pass a Button (or a
8
+ * cluster of buttons in a Fragment) so the empty state can guide the
9
+ * user toward the next step.
10
+ */
11
+ action?: React.ReactNode;
6
12
  }
7
13
  declare const EmptyState: React.FC<EmptyStateProps>;
8
14
  export default EmptyState;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { MdOutlineFolder } from 'react-icons/md';
3
- const EmptyState = ({ title, description, icon }) => {
4
- return (_jsxs("div", { className: "flex flex-col items-center justify-center rounded-lg border border-input bg-muted p-8 text-center", children: [_jsx("div", { className: "mb-4 flex h-32 w-32 items-center justify-center", children: icon ?? _jsx(MdOutlineFolder, { className: "h-full w-full text-muted-foreground" }) }), _jsx("h2", { className: "mb-2 text-lg font-semibold text-foreground", children: title }), _jsx("p", { className: "text-muted-foreground", children: description ?? "We couldn't find any data at this moment. Please try again later or adjust your filters." })] }));
3
+ const EmptyState = ({ title, description, icon, action }) => {
4
+ return (_jsxs("div", { className: "flex flex-col items-center justify-center rounded-lg border border-input bg-muted p-8 text-center", children: [_jsx("div", { className: "mb-4 flex h-32 w-32 items-center justify-center", children: icon ?? _jsx(MdOutlineFolder, { className: "h-full w-full text-muted-foreground" }) }), _jsx("h2", { className: "mb-2 text-lg font-semibold text-foreground", children: title }), _jsx("p", { className: "text-muted-foreground", children: description ?? "We couldn't find any data at this moment. Please try again later or adjust your filters." }), action && _jsx("div", { className: "mt-4", children: action })] }));
5
5
  };
6
6
  export default EmptyState;
@@ -66,9 +66,12 @@ const FilterComponent = ({ filters, selectedFilters, showApplyFilterButton = tru
66
66
  if (type === 'multi-select') {
67
67
  return (_jsx(MultiSelect, { options: Array.isArray(options) ? options : [], placeholder: filter.placeholder ?? `Select ${name}`, value: value || [], onChange: (val) => handleFilterChange(name, val), className: "w-full" }));
68
68
  }
69
- // Default: select
70
- const currentValue = value || '';
71
- return (_jsxs(Select, { value: currentValue || undefined, onValueChange: (val) => handleFilterChange(name, val === '__clear__' ? '' : val), children: [_jsx(SelectTrigger, { className: "h-9 w-full border-border bg-background text-sm text-foreground", "aria-label": filter.placeholder ?? name, children: _jsx(SelectValue, { placeholder: filter.placeholder ?? `Select ${name}` }) }), _jsxs(SelectContent, { children: [currentValue && (_jsx(SelectItem, { value: "__clear__", className: "text-muted-foreground", children: filter.placeholder ?? 'All' })), (Array.isArray(options) ? options : []).map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value)))] })] }));
69
+ // Default: select — always keep controlled via sentinel to avoid
70
+ // Radix switching to uncontrolled mode when value is cleared.
71
+ const SENTINEL = '__all__';
72
+ const currentValue = value ?? '';
73
+ const selectValue = currentValue !== '' ? currentValue : SENTINEL;
74
+ return (_jsxs(Select, { value: selectValue, onValueChange: (val) => handleFilterChange(name, val === SENTINEL ? '' : val), children: [_jsx(SelectTrigger, { className: "h-9 w-full border-border bg-background text-sm text-foreground", "aria-label": filter.placeholder ?? name, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: SENTINEL, className: "text-muted-foreground", children: filter.placeholder ?? 'All' }), (Array.isArray(options) ? options : []).map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value)))] })] }));
72
75
  };
73
76
  return (
74
77
  // Fluid width: full width on mobile, fluid 180–260px on wider
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagamio/frontend-commons-lib",
3
3
  "description": "Pagamio library for Frontend reusable components like the form engine and table container",
4
- "version": "0.8.353",
4
+ "version": "0.8.355",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false