@kolkrabbi/kol-component 0.44.1 → 0.45.0
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/package.json +1 -1
- package/src/organisms/ContentFilters.jsx +38 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -3,7 +3,6 @@ import Tag from '../atoms/Tag.jsx'
|
|
|
3
3
|
import Divider from '../atoms/Divider.jsx'
|
|
4
4
|
import Button from '../atoms/Button.jsx'
|
|
5
5
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
6
|
-
import ViewToggle from '../atoms/ViewToggle'
|
|
7
6
|
import IconFrame from '../atoms/IconFrame.jsx'
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -19,7 +18,7 @@ import IconFrame from '../atoms/IconFrame.jsx'
|
|
|
19
18
|
* @param {number} props.totalCount — total count before filtering
|
|
20
19
|
* @param {Array} props.filterGroups — [{label, key, values}, ...]
|
|
21
20
|
* @param {Function} props.renderItem — (filteredItems, viewMode, layout) => ReactNode
|
|
22
|
-
* @param {Array} props.viewModeOptions — optional view mode options for
|
|
21
|
+
* @param {Array} props.viewModeOptions — optional view mode options for the view strip
|
|
23
22
|
* @param {string} props.defaultViewMode — default view mode (default: 'list')
|
|
24
23
|
* @param {Function} props.onFilterChange — optional callback when filters change
|
|
25
24
|
* @param {Array} props.mutuallyExclusiveFilters — filter keys that should be mutually exclusive
|
|
@@ -138,15 +137,20 @@ const ContentFilters = ({
|
|
|
138
137
|
* uppercase these themselves. */
|
|
139
138
|
const renderFilterGroup = (group) => (
|
|
140
139
|
<div key={group.key} className="flex flex-col gap-3">
|
|
141
|
-
{/*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
|
|
140
|
+
{/* THE CATEGORY LABEL IS THE ACTIVE INK — `kol-helper-12` at `text-fg-96`,
|
|
141
|
+
* the same full opacity a SELECTED layout item wears (user ruling
|
|
142
|
+
* 2026-08-15: "TAGS and other categories are ACTIVE state full opacity").
|
|
143
|
+
*
|
|
144
|
+
* Read the RENDER, not the default: the retired fork defaulted this to
|
|
145
|
+
* `text-fg-32` and kol-monitor overrode it per call site with
|
|
146
|
+
* `labelClassName="kol-helper-12 text-fg-96"` — so the fork's default was
|
|
147
|
+
* never what anyone looked at. No inline letter-spacing: the helper ramp
|
|
148
|
+
* carries its own, and the override the fork added was not in the
|
|
149
|
+
* rendered path either. */}
|
|
150
|
+
<h4 className="kol-helper-12 text-fg-96" style={{ textTransform: 'uppercase' }}>
|
|
147
151
|
{group.label}
|
|
148
152
|
</h4>
|
|
149
|
-
<div className="flex flex-wrap gap-
|
|
153
|
+
<div className="flex flex-wrap gap-4">
|
|
150
154
|
{group.values.map((value) => (
|
|
151
155
|
<Tag
|
|
152
156
|
key={value}
|
|
@@ -155,6 +159,7 @@ const ContentFilters = ({
|
|
|
155
159
|
hash={false}
|
|
156
160
|
active={activeFilters.has(`${group.key}:${value}`)}
|
|
157
161
|
onClick={() => toggleFilter(group.key, value)}
|
|
162
|
+
className={activeFilters.has(`${group.key}:${value}`) ? 'text-fg-96' : 'text-fg-48'}
|
|
158
163
|
>
|
|
159
164
|
{value}
|
|
160
165
|
</Tag>
|
|
@@ -187,7 +192,7 @@ const ContentFilters = ({
|
|
|
187
192
|
aria-label="Toggle filters"
|
|
188
193
|
style={{ background: 'transparent', border: 'none', cursor: 'pointer', color: 'inherit' }}
|
|
189
194
|
>
|
|
190
|
-
<IconSeam name="filter" size={
|
|
195
|
+
<IconSeam name="filter" size={16} />
|
|
191
196
|
</button>
|
|
192
197
|
<div
|
|
193
198
|
className="flex items-center justify-center rounded-sm cursor-pointer hover:bg-fg-04 transition-colors"
|
|
@@ -215,7 +220,7 @@ const ContentFilters = ({
|
|
|
215
220
|
position: searchOpen ? 'absolute' : 'relative',
|
|
216
221
|
}}
|
|
217
222
|
>
|
|
218
|
-
<IconSeam name="search" size={
|
|
223
|
+
<IconSeam name="search" size={16} />
|
|
219
224
|
</span>
|
|
220
225
|
{searchOpen && (
|
|
221
226
|
<input
|
|
@@ -250,16 +255,28 @@ const ContentFilters = ({
|
|
|
250
255
|
{filteredItems.length} of {totalCount}
|
|
251
256
|
</span>
|
|
252
257
|
)}
|
|
253
|
-
{/*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
258
|
+
{/* RECENT / SAVED is the SAME STRIP as LIST / GRID, not a ViewToggle.
|
|
259
|
+
* Read off kol-monitor's original (_tmp/2026-08-15-shell-adoption/
|
|
260
|
+
* ContentFilters.jsx:225-232): inline spans, `kol-helper-14`,
|
|
261
|
+
* uppercase + 1px tracking, `text-fg-96` active / `text-fg-32` rest.
|
|
262
|
+
* That file imports ViewToggle and never renders it for this.
|
|
263
|
+
*
|
|
264
|
+
* This REPLACES the filled-chip reading of the 2026-07-28 ruling on
|
|
265
|
+
* this surface — user ruling 2026-08-15: the fork's look, everywhere.
|
|
266
|
+
* One family across the whole row. */}
|
|
256
267
|
{viewModeOptions && (
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
268
|
+
<div className="flex items-center gap-4">
|
|
269
|
+
{viewModeOptions.map((opt) => (
|
|
270
|
+
<span
|
|
271
|
+
key={opt.value}
|
|
272
|
+
onClick={() => handleViewModeChange(opt.value)}
|
|
273
|
+
className={`kol-helper-14 cursor-pointer select-none ${viewMode === opt.value ? 'text-fg-96' : 'text-fg-32 hover:text-fg-48'}`}
|
|
274
|
+
style={{ textTransform: 'uppercase', letterSpacing: 1 }}
|
|
275
|
+
>
|
|
276
|
+
{opt.label}
|
|
277
|
+
</span>
|
|
278
|
+
))}
|
|
279
|
+
</div>
|
|
263
280
|
)}
|
|
264
281
|
</div>
|
|
265
282
|
</div>
|
|
@@ -283,7 +300,7 @@ const ContentFilters = ({
|
|
|
283
300
|
<button
|
|
284
301
|
type="button"
|
|
285
302
|
onClick={clearAllFilters}
|
|
286
|
-
className="kol-helper-12 transition-colors underline text-fg-48"
|
|
303
|
+
className="kol-helper-12 transition-colors underline text-fg-32 hover:text-fg-48"
|
|
287
304
|
style={{ background: 'transparent', border: 'none', cursor: 'pointer' }}
|
|
288
305
|
>
|
|
289
306
|
Clear all ({activeFilters.size})
|