@kolkrabbi/kol-component 0.333.3 → 0.334.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 +3 -3
- package/src/atoms/Badge.jsx +5 -1
- package/src/atoms/Button.jsx +15 -2
- package/src/atoms/Delta.jsx +27 -0
- package/src/atoms/Input.jsx +18 -1
- package/src/atoms/LiveDot.jsx +19 -0
- package/src/atoms/Pill.jsx +3 -1
- package/src/atoms/ProgressBar.jsx +7 -4
- package/src/atoms/SegmentedToggle.jsx +4 -1
- package/src/atoms/SizeChip.jsx +24 -0
- package/src/atoms/Tag.jsx +9 -3
- package/src/atoms/Textarea.jsx +5 -1
- package/src/atoms/ToggleCheckbox.jsx +7 -4
- package/src/atoms/ToggleSwitch.jsx +7 -2
- package/src/atoms/ValueField.jsx +24 -0
- package/src/atoms/ViewToggle.jsx +27 -0
- package/src/index.js +13 -0
- package/src/molecules/AccountMenu.jsx +27 -0
- package/src/molecules/ColorField.jsx +30 -0
- package/src/molecules/ContextMenu.jsx +3 -2
- package/src/molecules/Dropdown.jsx +15 -4
- package/src/molecules/FieldPair.jsx +21 -0
- package/src/molecules/InlineAddRow.jsx +38 -0
- package/src/molecules/LabeledControl.jsx +6 -2
- package/src/molecules/LinkAddRow.jsx +52 -0
- package/src/molecules/Menu.jsx +46 -24
- package/src/molecules/MenuItem.jsx +8 -3
- package/src/molecules/PanelsMenu.jsx +34 -0
- package/src/molecules/PasswordInput.jsx +38 -0
- package/src/molecules/QuantityInput.jsx +17 -0
- package/src/molecules/SearchInput.jsx +5 -4
- package/src/molecules/Slider.jsx +26 -1
- package/src/molecules/WorkspaceSwitcher.jsx +24 -0
- package/src/organisms/ContentFilters.jsx +12 -4
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Dropdown from './Dropdown.jsx'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WorkspaceSwitcher — Which workspace you are in. `WORKSPACE · Personal / Kolkrabbi ⌄` (float-everything W4 row 58,
|
|
5
|
+
* 2026-11-04 — the exploration's workspace selector at the top of a rail). A label in the float label role, tracked
|
|
6
|
+
* and uppercased, over a `Dropdown` of the workspaces; `variant="float"` is the float select on the well, the default
|
|
7
|
+
* the sm dropdown. A workspace is `{ value, label, icon? }`; a nested one reads `Studio / Personal` in its label.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} [label] default `Workspace`
|
|
10
|
+
* @param {Array} workspaces Dropdown options
|
|
11
|
+
* @param {string} value
|
|
12
|
+
* @param {Function} onChange `(value) => void`
|
|
13
|
+
* @param {'float'} [variant]
|
|
14
|
+
* @param {string} [className]
|
|
15
|
+
*/
|
|
16
|
+
export default function WorkspaceSwitcher({ label = 'Workspace', workspaces = [], value, onChange, variant, className = '' }) {
|
|
17
|
+
const float = variant === 'float'
|
|
18
|
+
return (
|
|
19
|
+
<div className={`inline-flex flex-col gap-3 ${className}`.trim()}>
|
|
20
|
+
<span className="kol-float-label uppercase tracking-[0.03em] text-fg-64">{label}</span>
|
|
21
|
+
<Dropdown variant={float ? 'float' : undefined} size={float ? 'md' : undefined} options={workspaces} value={value} onChange={onChange} ariaLabel={label} />
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -70,9 +70,13 @@ import { filterItems } from '../utilities/searchItems.js'
|
|
|
70
70
|
* @param {string} props.countClassName — the "N of N" type/ink
|
|
71
71
|
* @param {string} props.tone — 'default' | 'inverse' — forwarded to the search field (ControlToneInverse,
|
|
72
72
|
* 2026-08-27): a page on a wash sets its header row's tone in one place
|
|
73
|
+
* @param {'float'} props.variant — the float filter bar (float-everything W4 row 56, 2026-11-04): each group's
|
|
74
|
+
* chips are `Tag variant="float" size="md"` capsules with the count of items
|
|
75
|
+
* each would show, in a capsule track 5 in. Everything else stays.
|
|
73
76
|
*/
|
|
74
77
|
const ContentFilters = ({
|
|
75
78
|
tone = 'default',
|
|
79
|
+
variant,
|
|
76
80
|
items,
|
|
77
81
|
title,
|
|
78
82
|
totalCount,
|
|
@@ -320,6 +324,9 @@ const ContentFilters = ({
|
|
|
320
324
|
* rule sits in the components layer. */
|
|
321
325
|
const stacked = group.stack ?? index === 0
|
|
322
326
|
const first = index === 0 && stacked
|
|
327
|
+
const float = variant === 'float'
|
|
328
|
+
/* the float chip carries the count of items it would show (row 56) */
|
|
329
|
+
const countOf = (value) => items.filter((item) => { const v = item[group.key]; return Array.isArray(v) ? v.includes(value) : v === value }).length
|
|
323
330
|
return (
|
|
324
331
|
<div key={group.key} className={`flex flex-col gap-3 ${first ? 'kol-filters-first' : stacked ? 'shrink-0' : 'min-w-0 flex-1'} ${group.className ?? ''}`.trim()}>
|
|
325
332
|
{/* THE CATEGORY LABEL IS THE ACTIVE INK — `kol-helper-12` at `text-fg-96`,
|
|
@@ -337,16 +344,17 @@ const ContentFilters = ({
|
|
|
337
344
|
</h4>
|
|
338
345
|
{/* the fluid group keeps 48px of room on its right (it ran flush to the
|
|
339
346
|
* panel's edge); `group.wrapClassName` is the per-group seam */}
|
|
340
|
-
<div className={`${stacked ? 'flex flex-col items-start gap-2' : 'flex flex-wrap gap-2 pr-12'} ${group.wrapClassName ?? ''}`.trim()}>
|
|
347
|
+
<div className={`${float ? 'inline-flex self-start flex-wrap items-center gap-1 rounded-full bg-oq-04 p-[5px]' : stacked ? 'flex flex-col items-start gap-2' : 'flex flex-wrap gap-2 pr-12'} ${group.wrapClassName ?? ''}`.trim()}>
|
|
341
348
|
{group.values.map((value) => (
|
|
342
349
|
<Tag
|
|
343
350
|
key={value}
|
|
344
|
-
size={tagSize}
|
|
345
|
-
variant={tagVariant}
|
|
351
|
+
size={float ? 'md' : tagSize}
|
|
352
|
+
variant={float ? 'float' : tagVariant}
|
|
346
353
|
hash={false}
|
|
354
|
+
count={float ? countOf(value) : undefined}
|
|
347
355
|
active={activeFilters.has(`${group.key}:${value}`)}
|
|
348
356
|
onClick={() => toggleFilter(group.key, value)}
|
|
349
|
-
className={activeFilters.has(`${group.key}:${value}`) ? tagActiveClassName : tagRestClassName}
|
|
357
|
+
className={float ? undefined : activeFilters.has(`${group.key}:${value}`) ? tagActiveClassName : tagRestClassName}
|
|
350
358
|
>
|
|
351
359
|
{value}
|
|
352
360
|
</Tag>
|