@pagamio/frontend-commons-lib 0.8.321 → 0.8.322
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.
|
@@ -31,7 +31,7 @@ const FilterComponent = ({ filters, selectedFilters, showApplyFilterButton = tru
|
|
|
31
31
|
resetFilters();
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
return (_jsxs(FilterWrapper, { isNarrow: isNarrow, children: [_jsxs("div", { className: "flex
|
|
34
|
+
return (_jsxs(FilterWrapper, { isNarrow: isNarrow, children: [_jsxs("div", { className: "flex flex-1 flex-wrap items-center gap-2 min-w-0", children: [showSearch && (_jsxs("div", { className: "relative w-full sm:flex-1 sm:min-w-[200px] sm:max-w-[340px] min-w-0", children: [_jsx(IconSearch, { size: 16, className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground" }), _jsx("input", { type: "text", placeholder: searctInputPlaceHolder, value: searchQuery, onChange: onSearch, onKeyDown: handleSearchKeyDown, "aria-label": "Search", className: cn('h-9 w-full rounded-md border border-border bg-background pl-9 pr-3 text-sm text-foreground', 'placeholder:text-muted-foreground', 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring', 'disabled:cursor-not-allowed disabled:opacity-50') })] })), filters.map((filter) => {
|
|
35
35
|
const { name, type, options } = filter;
|
|
36
36
|
const value = selectedFilters[name];
|
|
37
37
|
const renderFilterInput = () => {
|
|
@@ -70,7 +70,10 @@ const FilterComponent = ({ filters, selectedFilters, showApplyFilterButton = tru
|
|
|
70
70
|
const currentValue = value || '';
|
|
71
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' })), (options ?? []).map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value)))] })] }));
|
|
72
72
|
};
|
|
73
|
-
return (
|
|
73
|
+
return (
|
|
74
|
+
// Fluid width: full width on mobile, fluid 180–260px on wider
|
|
75
|
+
// viewports so filters share the row evenly and shrink under pressure.
|
|
76
|
+
_jsx("div", { className: "w-full sm:flex-1 sm:min-w-[180px] sm:max-w-[260px] min-w-0", children: renderFilterInput() }, name));
|
|
74
77
|
}), showApplyFilterButton && shouldShowActionButtons && (_jsx(Button, { onClick: handleApplyFilters, variant: "primary", className: "w-full sm:w-auto", style: { height: 36 }, tabIndex: 0, "aria-label": "Apply Filters", children: "Apply Filters" })), showClearFilters && shouldShowActionButtons && (_jsx(Button, { onClick: resetFilters, variant: "outline-primary", className: "w-full sm:w-auto", style: { height: 36 }, tabIndex: 0, "aria-label": "Clear Filters", children: "Clear Filters" }))] }), _jsx("div", { className: "ml-auto flex flex-wrap items-center justify-end gap-2", children: children })] }));
|
|
75
78
|
};
|
|
76
79
|
export default FilterComponent;
|
package/lib/styles.css
CHANGED
|
@@ -6417,14 +6417,6 @@ video {
|
|
|
6417
6417
|
width: 1.75rem;
|
|
6418
6418
|
}
|
|
6419
6419
|
|
|
6420
|
-
.sm\:w-\[240px\] {
|
|
6421
|
-
width: 240px;
|
|
6422
|
-
}
|
|
6423
|
-
|
|
6424
|
-
.sm\:w-\[300px\] {
|
|
6425
|
-
width: 300px;
|
|
6426
|
-
}
|
|
6427
|
-
|
|
6428
6420
|
.sm\:w-\[400px\] {
|
|
6429
6421
|
width: 400px;
|
|
6430
6422
|
}
|
|
@@ -6433,10 +6425,30 @@ video {
|
|
|
6433
6425
|
width: auto;
|
|
6434
6426
|
}
|
|
6435
6427
|
|
|
6428
|
+
.sm\:min-w-\[180px\] {
|
|
6429
|
+
min-width: 180px;
|
|
6430
|
+
}
|
|
6431
|
+
|
|
6432
|
+
.sm\:min-w-\[200px\] {
|
|
6433
|
+
min-width: 200px;
|
|
6434
|
+
}
|
|
6435
|
+
|
|
6436
|
+
.sm\:max-w-\[260px\] {
|
|
6437
|
+
max-width: 260px;
|
|
6438
|
+
}
|
|
6439
|
+
|
|
6440
|
+
.sm\:max-w-\[340px\] {
|
|
6441
|
+
max-width: 340px;
|
|
6442
|
+
}
|
|
6443
|
+
|
|
6436
6444
|
.sm\:max-w-sm {
|
|
6437
6445
|
max-width: 24rem;
|
|
6438
6446
|
}
|
|
6439
6447
|
|
|
6448
|
+
.sm\:flex-1 {
|
|
6449
|
+
flex: 1 1 0%;
|
|
6450
|
+
}
|
|
6451
|
+
|
|
6440
6452
|
.sm\:translate-x-0 {
|
|
6441
6453
|
--tw-translate-x: 0px;
|
|
6442
6454
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
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.
|
|
4
|
+
"version": "0.8.322",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|