@plastic-js/tsumiki 0.1.30 → 0.1.31
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.
- package/dist/components/FilterGroup.js +28 -12
- package/docs/api.md +1 -0
- package/package.json +1 -1
|
@@ -42,13 +42,22 @@ var defaultStyle = {
|
|
|
42
42
|
"--_fg-gap": "var(--tsu-spacing-sm)"
|
|
43
43
|
};
|
|
44
44
|
var rootClass = css({
|
|
45
|
-
display: "
|
|
45
|
+
display: "flex",
|
|
46
|
+
width: "100%",
|
|
47
|
+
alignItems: "center",
|
|
46
48
|
gap: "var(--_fg-gap, var(--tsu-spacing-sm))"
|
|
47
49
|
});
|
|
50
|
+
var stickyClass = css({
|
|
51
|
+
position: "sticky",
|
|
52
|
+
top: 0,
|
|
53
|
+
zIndex: "var(--tsu-z-dropdown)",
|
|
54
|
+
backgroundColor: "var(--tsu-bg)"
|
|
55
|
+
});
|
|
48
56
|
var allClass = css({
|
|
49
57
|
display: "flex",
|
|
50
58
|
alignItems: "center",
|
|
51
59
|
justifyContent: "center",
|
|
60
|
+
flexShrink: 0,
|
|
52
61
|
padding: "var(--_tg-padding-y, var(--tsu-comp-padding-y-md)) var(--_tg-padding-x, var(--tsu-comp-padding-x-md))",
|
|
53
62
|
border: "1px solid var(--_tg-border)",
|
|
54
63
|
borderRadius: "var(--tsu-radius-round)",
|
|
@@ -71,12 +80,16 @@ var allClass = css({
|
|
|
71
80
|
});
|
|
72
81
|
var groupClass = css({
|
|
73
82
|
border: "none",
|
|
74
|
-
|
|
83
|
+
overflowX: "auto",
|
|
84
|
+
overflowY: "hidden",
|
|
85
|
+
flex: "1 1 auto",
|
|
86
|
+
minWidth: 0,
|
|
75
87
|
gap: "var(--_fg-gap, var(--tsu-spacing-sm))"
|
|
76
88
|
});
|
|
77
89
|
var itemClass = css({
|
|
78
90
|
border: "1px solid var(--_tg-border)",
|
|
79
91
|
borderRadius: "var(--tsu-radius-round)",
|
|
92
|
+
flexShrink: 0,
|
|
80
93
|
"&:last-child": { border: "1px solid var(--_tg-border)" }
|
|
81
94
|
});
|
|
82
95
|
var FilterGroup = (props = {}) => {
|
|
@@ -92,10 +105,12 @@ var FilterGroup = (props = {}) => {
|
|
|
92
105
|
"allLabel",
|
|
93
106
|
"size",
|
|
94
107
|
"buttonClass",
|
|
95
|
-
"groupClass"
|
|
108
|
+
"groupClass",
|
|
109
|
+
"sticky"
|
|
96
110
|
]);
|
|
97
111
|
const value = () => access(local.value) ?? [];
|
|
98
112
|
const allActive = () => value().length === 0;
|
|
113
|
+
const sticky = () => access(local.sticky);
|
|
99
114
|
const emit = (val) => {
|
|
100
115
|
local.onValueChange?.(val);
|
|
101
116
|
};
|
|
@@ -105,15 +120,16 @@ var FilterGroup = (props = {}) => {
|
|
|
105
120
|
};
|
|
106
121
|
const handleChange = (value) => emit(value);
|
|
107
122
|
return jsx("div", mergeProps(rest, {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
className: () => [
|
|
124
|
+
rootClass,
|
|
125
|
+
sticky() && stickyClass,
|
|
126
|
+
local.className
|
|
127
|
+
].filter(Boolean).join(" "),
|
|
128
|
+
style: () => ({
|
|
129
|
+
...defaultStyle,
|
|
130
|
+
...sizeVars[access(local.size)],
|
|
131
|
+
...typeof sticky() === "number" ? { top: `${sticky()}px` } : void 0
|
|
132
|
+
}),
|
|
117
133
|
children: [() => {
|
|
118
134
|
const _el0 = _tmpl.cloneNode(true);
|
|
119
135
|
insert(_el0, () => local.allLabel);
|
package/docs/api.md
CHANGED
|
@@ -282,6 +282,7 @@ Multi-select filter bar built on `ToggleGroup`. Renders an "All" toggle; selecti
|
|
|
282
282
|
| `size` | `string` | `md` | See size values. |
|
|
283
283
|
| `buttonClass` | `string` | — | Class applied to every button. |
|
|
284
284
|
| `groupClass` | `string` | — | Class applied to the inner `ToggleGroup`. |
|
|
285
|
+
| `sticky` | `boolean \| number` | — | Sticky to the top of the scroll container; pass a number for a `top` offset in px. |
|
|
285
286
|
| `className` | `string` | — | Root class. |
|
|
286
287
|
|
|
287
288
|
### RadioGroup
|