@pagamio/frontend-commons-lib 0.8.320 → 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;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
const FilterWrapper = ({ isNarrow, children }) => {
|
|
3
|
-
return (
|
|
3
|
+
return (
|
|
4
|
+
// `min-w-0` so this card can shrink inside a flex/grid parent;
|
|
5
|
+
// `overflow-hidden` so wide filter rows never punch out of the toolbar.
|
|
6
|
+
_jsx("div", { className: "bg-card shadow-xl rounded-lg p-4 mb-2 min-w-0 overflow-hidden", children: _jsx("div", { className: isNarrow
|
|
7
|
+
? 'flex flex-col w-full gap-3'
|
|
8
|
+
: // `flex-wrap` lets the filter pills drop onto a second row instead of
|
|
9
|
+
// overflowing the toolbar; each child group is set to `min-w-0` via its own
|
|
10
|
+
// styles so individual items can shrink too.
|
|
11
|
+
'flex flex-wrap items-start justify-between gap-4 w-full min-w-0', children: children }) }));
|
|
4
12
|
};
|
|
5
13
|
export default FilterWrapper;
|
package/lib/styles.css
CHANGED
|
@@ -1551,6 +1551,9 @@ video {
|
|
|
1551
1551
|
.flex-shrink-0 {
|
|
1552
1552
|
flex-shrink: 0;
|
|
1553
1553
|
}
|
|
1554
|
+
.shrink {
|
|
1555
|
+
flex-shrink: 1;
|
|
1556
|
+
}
|
|
1554
1557
|
.shrink-0 {
|
|
1555
1558
|
flex-shrink: 0;
|
|
1556
1559
|
}
|
|
@@ -6414,14 +6417,6 @@ video {
|
|
|
6414
6417
|
width: 1.75rem;
|
|
6415
6418
|
}
|
|
6416
6419
|
|
|
6417
|
-
.sm\:w-\[240px\] {
|
|
6418
|
-
width: 240px;
|
|
6419
|
-
}
|
|
6420
|
-
|
|
6421
|
-
.sm\:w-\[300px\] {
|
|
6422
|
-
width: 300px;
|
|
6423
|
-
}
|
|
6424
|
-
|
|
6425
6420
|
.sm\:w-\[400px\] {
|
|
6426
6421
|
width: 400px;
|
|
6427
6422
|
}
|
|
@@ -6430,10 +6425,30 @@ video {
|
|
|
6430
6425
|
width: auto;
|
|
6431
6426
|
}
|
|
6432
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
|
+
|
|
6433
6444
|
.sm\:max-w-sm {
|
|
6434
6445
|
max-width: 24rem;
|
|
6435
6446
|
}
|
|
6436
6447
|
|
|
6448
|
+
.sm\:flex-1 {
|
|
6449
|
+
flex: 1 1 0%;
|
|
6450
|
+
}
|
|
6451
|
+
|
|
6437
6452
|
.sm\:translate-x-0 {
|
|
6438
6453
|
--tw-translate-x: 0px;
|
|
6439
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
|