@kolkrabbi/kol-component 0.334.0 → 0.336.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/SectionLabel.jsx +29 -0
- package/src/index.js +25 -0
- package/src/molecules/ContentRow.jsx +30 -1
- package/src/molecules/DocsToc.jsx +16 -1
- package/src/molecules/EmptyState.jsx +15 -1
- package/src/molecules/FlyoutRow.jsx +10 -0
- package/src/molecules/IndexRow.jsx +37 -0
- package/src/molecules/LayerRow.jsx +53 -0
- package/src/molecules/Modal.jsx +58 -19
- package/src/molecules/NoticeBanner.jsx +28 -0
- package/src/molecules/QuantityInput.jsx +7 -3
- package/src/molecules/QuickLookFrame.jsx +31 -27
- package/src/molecules/QuickLookHeader.jsx +60 -0
- package/src/molecules/ReadingActions.jsx +31 -0
- package/src/molecules/ReadingChapterNav.jsx +38 -0
- package/src/molecules/ReadingHighlight.jsx +26 -0
- package/src/molecules/ReadingNotes.jsx +39 -0
- package/src/molecules/ReadingSettings.jsx +53 -0
- package/src/molecules/SectionText.jsx +15 -1
- package/src/molecules/SpecList.jsx +21 -1
- package/src/molecules/SummaryLine.jsx +18 -0
- package/src/molecules/TabsRow.jsx +54 -7
- package/src/molecules/TaskRow.jsx +43 -0
- package/src/molecules/TocRow.jsx +29 -0
- package/src/molecules/TreeRow.jsx +72 -0
- package/src/organisms/CalendarDay.jsx +60 -0
- package/src/organisms/CalendarMonth.jsx +75 -0
- package/src/organisms/CalendarTimeline.jsx +65 -0
- package/src/organisms/CalendarWeek.jsx +72 -0
- package/src/organisms/MediaLibrary.jsx +55 -0
- package/src/organisms/NavDrawer.jsx +67 -0
- package/src/organisms/NavRail.jsx +4 -1
- package/src/organisms/NavRailFloat.jsx +110 -0
- package/src/organisms/ReadingColumn.jsx +42 -0
- package/src/organisms/ReadingContents.jsx +54 -0
- package/src/organisms/ReadingOverview.jsx +60 -0
- package/src/organisms/ReadingPanel.jsx +36 -0
- package/src/organisms/Table.jsx +50 -1
- package/src/organisms/calendarDates.js +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.336.0",
|
|
4
4
|
"description": "The core component library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@kolkrabbi/kol-markdown": "^0.2.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@kolkrabbi/kol-icons": ">=0.
|
|
37
|
+
"@kolkrabbi/kol-icons": ">=0.61.1",
|
|
38
38
|
"framer-motion": "^12.0.0",
|
|
39
39
|
"gsap": "^3.13.0",
|
|
40
40
|
"hls.js": "^1.6.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@kolkrabbi/kol-icons": "^0.61.
|
|
45
|
+
"@kolkrabbi/kol-icons": "^0.61.1"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
48
|
"src",
|
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* SectionLabel — A section's name with its arrow.
|
|
5
|
+
*
|
|
6
|
+
* `variant="float"` (float-everything W5 row 68, 2026-11-04 — kol-float--style 46:1976): a rail section's header on the
|
|
7
|
+
* float — the name in `kol-float-label` on fg-64, rendered as authored (`APPEARANCE`), and, when `onAdd` is given, a +
|
|
8
|
+
* at the far end (14, oq-64, bright under the pointer) that adds an item to the section. No arrow, no rule.
|
|
9
|
+
*
|
|
10
|
+
* @param {ReactNode} text
|
|
11
|
+
* @param {'sm'|'md'|'lg'} [size='md'] the default look's size
|
|
12
|
+
* @param {'float'} [variant]
|
|
13
|
+
* @param {Function} [onAdd] float: the + control
|
|
14
|
+
* @param {string} [addLabel] float: the +'s accessible name (default `Add`)
|
|
15
|
+
* @param {string} [className]
|
|
16
|
+
*/
|
|
3
17
|
export default function SectionLabel({
|
|
4
18
|
text,
|
|
5
19
|
size = 'md',
|
|
20
|
+
variant,
|
|
21
|
+
onAdd,
|
|
22
|
+
addLabel = 'Add',
|
|
6
23
|
className = ''
|
|
7
24
|
}) {
|
|
25
|
+
if (variant === 'float') {
|
|
26
|
+
return (
|
|
27
|
+
<div className={`flex h-4 w-full items-center justify-between gap-2 ${className}`.trim()}>
|
|
28
|
+
<span className="kol-float-label truncate text-fg-64">{text}</span>
|
|
29
|
+
{onAdd && (
|
|
30
|
+
<button type="button" aria-label={addLabel} onClick={onAdd} className="inline-flex size-5 shrink-0 items-center justify-center rounded-full text-oq-64 hover:text-oq-96 focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] cursor-pointer">
|
|
31
|
+
<Icon name="plus" size={14} />
|
|
32
|
+
</button>
|
|
33
|
+
)}
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
8
37
|
// Size variants: sm (16px), md (20px), lg (32px).
|
|
9
38
|
// Migrated off the deleted legacy kol-label-* family (2026-07-15): current
|
|
10
39
|
// helper/heading classes, no text-transform — labels render as authored.
|
package/src/index.js
CHANGED
|
@@ -83,6 +83,31 @@ export { default as InlineAddRow } from './molecules/InlineAddRow.jsx'
|
|
|
83
83
|
export { default as LinkAddRow } from './molecules/LinkAddRow.jsx'
|
|
84
84
|
export { default as ColorField } from './molecules/ColorField.jsx'
|
|
85
85
|
export { default as PanelsMenu } from './molecules/PanelsMenu.jsx'
|
|
86
|
+
/* float-everything W6 · W8 (0.335.0) */
|
|
87
|
+
export { default as SummaryLine } from './molecules/SummaryLine.jsx'
|
|
88
|
+
export { default as QuickLookHeader } from './molecules/QuickLookHeader.jsx'
|
|
89
|
+
export { default as NoticeBanner } from './molecules/NoticeBanner.jsx'
|
|
90
|
+
export { default as TreeRow, TREE_ROW } from './molecules/TreeRow.jsx'
|
|
91
|
+
export { default as FlyoutRow } from './molecules/FlyoutRow.jsx'
|
|
92
|
+
export { default as LayerRow } from './molecules/LayerRow.jsx'
|
|
93
|
+
export { default as IndexRow } from './molecules/IndexRow.jsx'
|
|
94
|
+
export { default as TaskRow } from './molecules/TaskRow.jsx'
|
|
95
|
+
export { default as TocRow } from './molecules/TocRow.jsx'
|
|
96
|
+
export { default as NavDrawer } from './organisms/NavDrawer.jsx'
|
|
97
|
+
/* float-everything W11 — calendar + reader (0.336.0) */
|
|
98
|
+
export { default as CalendarTimeline } from './organisms/CalendarTimeline.jsx'
|
|
99
|
+
export { default as CalendarMonth } from './organisms/CalendarMonth.jsx'
|
|
100
|
+
export { default as CalendarWeek } from './organisms/CalendarWeek.jsx'
|
|
101
|
+
export { default as CalendarDay } from './organisms/CalendarDay.jsx'
|
|
102
|
+
export { default as ReadingColumn } from './organisms/ReadingColumn.jsx'
|
|
103
|
+
export { default as ReadingHighlight } from './molecules/ReadingHighlight.jsx'
|
|
104
|
+
export { default as ReadingActions } from './molecules/ReadingActions.jsx'
|
|
105
|
+
export { default as ReadingChapterNav } from './molecules/ReadingChapterNav.jsx'
|
|
106
|
+
export { default as ReadingContents } from './organisms/ReadingContents.jsx'
|
|
107
|
+
export { default as ReadingPanel } from './organisms/ReadingPanel.jsx'
|
|
108
|
+
export { default as ReadingNotes } from './molecules/ReadingNotes.jsx'
|
|
109
|
+
export { default as ReadingSettings } from './molecules/ReadingSettings.jsx'
|
|
110
|
+
export { default as ReadingOverview } from './organisms/ReadingOverview.jsx'
|
|
86
111
|
export { default as WorkspaceSwitcher } from './molecules/WorkspaceSwitcher.jsx'
|
|
87
112
|
export { default as AccountMenu } from './molecules/AccountMenu.jsx'
|
|
88
113
|
export { default as OptionRow } from './molecules/OptionRow.jsx'
|
|
@@ -2,6 +2,7 @@ import ContentMedia from './ContentMedia.jsx'
|
|
|
2
2
|
import ContentText from './ContentText.jsx'
|
|
3
3
|
import { useAppItem } from './AppItem.jsx'
|
|
4
4
|
import { toneClass } from '../utilities/tone.js'
|
|
5
|
+
import { Icon } from '@kolkrabbi/kol-icons'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* ContentRow — The row form of a content card. the row form of the content-card system: leading thumb (where
|
|
@@ -12,7 +13,9 @@ import { toneClass } from '../utilities/tone.js'
|
|
|
12
13
|
* 36 square thumb when `media` is passed (none without); article rides a 120px 16:9 thumb; work a framed 64px row; typeface a
|
|
13
14
|
* framed no-thumb block.
|
|
14
15
|
*
|
|
15
|
-
* @param {string} variant file | app | catalog | print | article | work | typeface | roster
|
|
16
|
+
* @param {string} variant file | app | catalog | print | article | work | typeface | roster | float
|
|
17
|
+
* (`float` = the link row: `title` · `url` · ↗, float-everything W8 row 124 — props
|
|
18
|
+
* `title`, `url`, `href`, `external`, `onClick`, `className`)
|
|
16
19
|
* (`app` = the file row with `verbs` · `menuItems` slotted — AppItem.jsx)
|
|
17
20
|
* (`default` is an alias of `file`). `roster` is the pickable
|
|
18
21
|
* row: filled tile, no border or divider, a FIXED 56px height the
|
|
@@ -154,6 +157,30 @@ const BOX = {
|
|
|
154
157
|
const ALIAS = { default: 'file', print: 'catalog', work: 'showcase', typeface: 'showcaseCanvas' }
|
|
155
158
|
const LAYOUT_KEY = { column: 'showcaseCanvas', line: 'showcase' }
|
|
156
159
|
|
|
160
|
+
/* THE LINK ROW (`variant="float"`, float-everything W8 row 124, 2026-11-04 — kol-float--style 48:3922): title · url · ↗.
|
|
161
|
+
* A link to somewhere else, on the float: the well's ground (`--kol-float-well`) on the list radius, 16 in, the title
|
|
162
|
+
* in `kol-float-hint` at 13 on the emphasis ink over the address in mono (`kol-float-timecode` at 11, fg-64), the
|
|
163
|
+
* `arrow-upright` glyph at the right on oq-64 — bright with the row under the pointer, which lifts the ground fg-08.
|
|
164
|
+
* `url` is shown as given (strip the scheme yourself); `href` defaults to it. Opens in a new tab when `external`
|
|
165
|
+
* (default: the href is absolute). Its own path — none of the variants' box table applies. */
|
|
166
|
+
function ContentRowFloat({ title, url, href = url, external, onClick, className = '' }) {
|
|
167
|
+
const ext = external ?? /^https?:/.test(href ?? '')
|
|
168
|
+
return (
|
|
169
|
+
<a
|
|
170
|
+
href={href}
|
|
171
|
+
onClick={onClick}
|
|
172
|
+
{...(ext ? { target: '_blank', rel: 'noreferrer' } : {})}
|
|
173
|
+
className={`group flex w-full items-center gap-4 rounded-[var(--kol-float-list-r)] bg-[var(--kol-float-well)] px-4 py-3 no-underline hover:bg-fg-08 focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] ${className}`.trim()}
|
|
174
|
+
>
|
|
175
|
+
<span className="flex min-w-0 flex-1 flex-col gap-1">
|
|
176
|
+
<span className="kol-float-hint truncate text-fg-emphasis" style={{ fontSize: 13 }}>{title}</span>
|
|
177
|
+
{url && <span className="kol-float-timecode truncate text-fg-64" style={{ fontSize: 11 }}>{url}</span>}
|
|
178
|
+
</span>
|
|
179
|
+
<Icon name="arrow-upright" size={16} className="shrink-0 text-oq-64 group-hover:text-oq-96" />
|
|
180
|
+
</a>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
157
184
|
export default function ContentRow({
|
|
158
185
|
variant: variantProp = 'file',
|
|
159
186
|
layout,
|
|
@@ -198,6 +225,8 @@ export default function ContentRow({
|
|
|
198
225
|
* None of them reach ContentText; an app row's `tags` are the rail's, never chips in the row. */
|
|
199
226
|
const app = useAppItem(variantProp, { title: text.title, verbs: text.verbs, download: text.download, menuItems: text.menuItems, date: text.date, size: text.size, media, back: text.back, tone, tags: text.tags, details: text.details, onTags: text.onTags, note: text.note, onNote: text.onNote, mark: text.mark, onCover: text.onCover, onInsert: text.onInsert, images: text.images, onImages: text.onImages, onBack: text.onBack, row: true })
|
|
200
227
|
delete text.verbs; delete text.download; delete text.menuItems; delete text.details; delete text.onTags; delete text.note; delete text.onNote; delete text.mark; delete text.onCover; delete text.onInsert; delete text.back; delete text.images; delete text.onImages; delete text.onBack
|
|
228
|
+
/* `float` is the link row — its own path, after the hook so the hook order never depends on the variant */
|
|
229
|
+
if (variantProp === 'float') return <ContentRowFloat title={text.title} url={text.url} href={href ?? text.url} external={text.external} onClick={onClick} className={className} />
|
|
201
230
|
if (app) {
|
|
202
231
|
delete text.tags
|
|
203
232
|
variantProp = 'file'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef } from 'react'
|
|
2
2
|
import useScrollSpy from '../hooks/useScrollSpy.js'
|
|
3
|
+
import TocRow from './TocRow.jsx'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* DocsToc — A page's table of contents. on-page table of contents for long docs pages: a flat list of
|
|
@@ -74,7 +75,10 @@ import useScrollSpy from '../hooks/useScrollSpy.js'
|
|
|
74
75
|
* knowledge and does not belong in the package.
|
|
75
76
|
*
|
|
76
77
|
* @param {Array<{id: string, label: string, children?: Array<{id: string, label: string}>}>} toc headings to render + observe; RAIL: `children` are the section's entries, one tick each in place of `minors`
|
|
77
|
-
* @param {'list'|'rail'} variant render (default 'list' — the docs-sidebar column)
|
|
78
|
+
* @param {'list'|'rail'|'float'} variant render (default 'list' — the docs-sidebar column); `float` (float-everything
|
|
79
|
+
* W8 row 121, 2026-11-04) — the numbered contents list: one `TocRow` per heading
|
|
80
|
+
* (`01 · First interlude`), the one in view lifted fg-16 as `current`
|
|
81
|
+
* @param {boolean} numbered FLOAT: number the rows 01, 02 … (default true)
|
|
78
82
|
* @param {Function} onNavigate (event) => void — optional click handler on every link
|
|
79
83
|
* @param {string} rootMargin IntersectionObserver rootMargin passed to the
|
|
80
84
|
* spy. Default keeps the ported source's tighter
|
|
@@ -101,6 +105,7 @@ export default function DocsToc({
|
|
|
101
105
|
position = 'right',
|
|
102
106
|
minSections = 2,
|
|
103
107
|
ariaLabel = 'On this page',
|
|
108
|
+
numbered = true,
|
|
104
109
|
className = '',
|
|
105
110
|
}) {
|
|
106
111
|
/* Children are observed too, in document order; the active SECTION is the
|
|
@@ -111,6 +116,16 @@ export default function DocsToc({
|
|
|
111
116
|
)
|
|
112
117
|
const activeSection = toc.find((item) => item.id === activeId || item.children?.some((c) => c.id === activeId))?.id
|
|
113
118
|
|
|
119
|
+
if (variant === 'float') {
|
|
120
|
+
return (
|
|
121
|
+
<nav aria-label={ariaLabel} className={`flex flex-col gap-0.5 ${className}`.trim()}>
|
|
122
|
+
{toc.map((item, i) => (
|
|
123
|
+
<TocRow key={item.id} number={numbered ? i + 1 : undefined} label={item.label} href={`#${item.id}`} current={activeSection === item.id} onClick={onNavigate} />
|
|
124
|
+
))}
|
|
125
|
+
</nav>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
|
|
114
129
|
if (variant === 'rail') {
|
|
115
130
|
return (
|
|
116
131
|
<TocRail
|
|
@@ -17,8 +17,22 @@
|
|
|
17
17
|
* @param {string} footer optional note above a top hairline
|
|
18
18
|
* @param {boolean} gated hide unless placeholders are switched on (default false)
|
|
19
19
|
* @param {string} className extra classes on the wrapper
|
|
20
|
+
* @param {'float'} [variant] `float` (float-everything W6 row 92, 2026-11-04 — kol-float--style 46:3073): the empty panel
|
|
21
|
+
* on a float — the title in `kol-float-window` (Inter 18), the body in `kol-float-body` on fg-64, the
|
|
22
|
+
* footer pinned to the panel's foot in `kol-float-hint` (`Panel stays open.`), no rule above it. It
|
|
23
|
+
* fills its panel's height (`flex-1`) so the footer lands at the bottom.
|
|
20
24
|
*/
|
|
21
|
-
export default function EmptyState({ eyebrow, title, body, footer, gated = false, className = '' }) {
|
|
25
|
+
export default function EmptyState({ eyebrow, title, body, footer, gated = false, variant, className = '' }) {
|
|
26
|
+
if (variant === 'float') {
|
|
27
|
+
return (
|
|
28
|
+
<div className={`flex min-h-0 flex-1 flex-col${gated ? ' kol-placeholder' : ''} ${className}`.trim()}>
|
|
29
|
+
{eyebrow && <p className="kol-float-label mb-1 text-fg-64">{eyebrow}</p>}
|
|
30
|
+
{title && <p className="kol-float-window mb-3 text-fg-emphasis">{title}</p>}
|
|
31
|
+
{body && <p className="kol-float-body whitespace-pre-line text-fg-64">{body}</p>}
|
|
32
|
+
{footer && <p className="kol-float-hint mt-auto pt-6 text-fg-64">{footer}</p>}
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
22
36
|
return (
|
|
23
37
|
<div className={`${gated ? 'kol-placeholder' : ''}${className ? ` ${className}` : ''}` || undefined}>
|
|
24
38
|
{/* helper (line-height 1) is single-line chrome ONLY — title and footer
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import TreeRow from './TreeRow.jsx'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* FlyoutRow — A destination in a hover flyout: glyph · name · count. `Tasks 5` (float-everything W8 row 123,
|
|
5
|
+
* 2026-11-04 — kol-float--style 48:3904). `TreeRow` at `md` — 34 tall, a 16 glyph, the 12 name, the count in mono —
|
|
6
|
+
* so a flyout lists the same rows as the sidebar it flies out of. Every TreeRow prop passes through.
|
|
7
|
+
*/
|
|
8
|
+
export default function FlyoutRow(props) {
|
|
9
|
+
return <TreeRow size="md" {...props} />
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import ToggleCheckbox from '../atoms/ToggleCheckbox.jsx'
|
|
2
|
+
|
|
3
|
+
/* taxonomy-ok: molecule — nests ToggleCheckbox (atom). */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* IndexRow — One line of a dense index: check · title · columns. `□ Design the Tasks tab · Briefs · — · Open`
|
|
7
|
+
* (float-everything W8 row 117, 2026-11-04 — kol-float--style 48:3503). 28 tall on the list radius, 10 in: a float
|
|
8
|
+
* ToggleCheckbox (when `onCheck` is given), the title in `kol-float-hint` on the emphasis ink taking the room, then
|
|
9
|
+
* `cells` — short facts in fixed columns (`kol-float-label` on fg-64; a cell `{ value, mono: true }` is mono, a date or
|
|
10
|
+
* a count). `selected` lifts the row to fg-16; hover lifts it to fg-08. The whole row is the press.
|
|
11
|
+
*
|
|
12
|
+
* @param {ReactNode} title
|
|
13
|
+
* @param {Array<ReactNode|{value: ReactNode, mono?: boolean, width?: number}>} [cells] each 96 wide unless `width`
|
|
14
|
+
* @param {boolean} [checked] · {Function} [onCheck]
|
|
15
|
+
* @param {boolean} [selected]
|
|
16
|
+
* @param {Function} [onClick]
|
|
17
|
+
* @param {string} [className]
|
|
18
|
+
*/
|
|
19
|
+
export default function IndexRow({ title, cells = [], checked = false, onCheck, selected = false, onClick, className = '' }) {
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
role={onClick ? 'button' : undefined}
|
|
23
|
+
tabIndex={onClick ? 0 : undefined}
|
|
24
|
+
onClick={onClick}
|
|
25
|
+
onKeyDown={onClick ? (e) => { if (e.key === 'Enter') onClick(e) } : undefined}
|
|
26
|
+
aria-selected={onClick ? selected : undefined}
|
|
27
|
+
className={`flex h-7 w-full items-center gap-3 rounded-[var(--kol-float-list-r)] px-2.5 ${onClick ? 'cursor-pointer focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]' : ''} ${selected ? 'bg-fg-16' : 'hover:bg-fg-08'} ${className}`.trim()}
|
|
28
|
+
>
|
|
29
|
+
{onCheck && <span onClick={(e) => e.stopPropagation()} className="inline-flex shrink-0"><ToggleCheckbox variant="float" checked={checked} onChange={onCheck} aria-label="Done" /></span>}
|
|
30
|
+
<span className={`kol-float-hint min-w-0 flex-1 truncate ${checked ? 'text-fg-48' : 'text-fg-emphasis'}`}>{title}</span>
|
|
31
|
+
{cells.map((c, i) => {
|
|
32
|
+
const cell = c && typeof c === 'object' && 'value' in c ? c : { value: c }
|
|
33
|
+
return <span key={i} className={`${cell.mono ? 'kol-float-ruler' : 'kol-float-label'} shrink-0 truncate text-fg-64`} style={{ width: cell.width ?? 96 }}>{cell.value}</span>
|
|
34
|
+
})}
|
|
35
|
+
</div>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Icon } from '@kolkrabbi/kol-icons'
|
|
2
|
+
import TreeRow from './TreeRow.jsx'
|
|
3
|
+
|
|
4
|
+
/* taxonomy-ok: molecule — TreeRow (molecule) + kol-icons's Icon. */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* LayerRow — A layer in a layers list: glyph · name · eye · lock. `Orbit field` (float-everything W8 row 119,
|
|
8
|
+
* 2026-11-04 — kol-float--style 48:3546). `TreeRow` at `xs` (26, a 14 glyph, the 11 name) with two toggles at its end:
|
|
9
|
+
* the eye (`visible` · `onToggleVisible`) and the lock (`locked` · `onToggleLock`). The toggles stay on oq-64 and go
|
|
10
|
+
* oq-96 under the pointer; a hidden layer's name drops to fg-48 and its eye shows `eye-off`. `selected` lifts the row
|
|
11
|
+
* to fg-16.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} [icon='layers']
|
|
14
|
+
* @param {ReactNode} name
|
|
15
|
+
* @param {boolean} [selected]
|
|
16
|
+
* @param {boolean} [visible=true] · {Function} [onToggleVisible]
|
|
17
|
+
* @param {boolean} [locked=false] · {Function} [onToggleLock]
|
|
18
|
+
* @param {number} [depth=0]
|
|
19
|
+
* @param {Function} [onClick]
|
|
20
|
+
* @param {string} [className]
|
|
21
|
+
*/
|
|
22
|
+
export default function LayerRow({ icon = 'layers', name, selected = false, visible = true, onToggleVisible, locked = false, onToggleLock, depth = 0, onClick, className = '' }) {
|
|
23
|
+
const ctl = (label, glyph, on, fn) => (
|
|
24
|
+
<span
|
|
25
|
+
role="button"
|
|
26
|
+
tabIndex={0}
|
|
27
|
+
aria-label={label}
|
|
28
|
+
aria-pressed={on}
|
|
29
|
+
onClick={(e) => { e.stopPropagation(); fn?.() }}
|
|
30
|
+
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); fn?.() } }}
|
|
31
|
+
className="inline-flex size-5 shrink-0 items-center justify-center rounded-full text-oq-64 hover:text-oq-96 focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]"
|
|
32
|
+
>
|
|
33
|
+
<Icon name={glyph} size={12} />
|
|
34
|
+
</span>
|
|
35
|
+
)
|
|
36
|
+
return (
|
|
37
|
+
<TreeRow
|
|
38
|
+
size="xs"
|
|
39
|
+
icon={icon}
|
|
40
|
+
label={<span className={visible ? undefined : 'text-fg-48'}>{name}</span>}
|
|
41
|
+
active={selected}
|
|
42
|
+
depth={depth}
|
|
43
|
+
onClick={onClick}
|
|
44
|
+
className={`gap-2 pr-1.5 ${className}`.trim()}
|
|
45
|
+
trailing={(
|
|
46
|
+
<span className="flex shrink-0 items-center">
|
|
47
|
+
{ctl(visible ? 'Hide layer' : 'Show layer', visible ? 'eye-on' : 'eye-off', !visible, onToggleVisible)}
|
|
48
|
+
{ctl(locked ? 'Unlock layer' : 'Lock layer', locked ? 'lock' : 'unlock', locked, onToggleLock)}
|
|
49
|
+
</span>
|
|
50
|
+
)}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
}
|
package/src/molecules/Modal.jsx
CHANGED
|
@@ -3,6 +3,7 @@ import { createPortal } from 'react-dom'
|
|
|
3
3
|
import Button from '../atoms/Button.jsx'
|
|
4
4
|
import Input from '../atoms/Input.jsx'
|
|
5
5
|
import ToggleCheckbox from '../atoms/ToggleCheckbox.jsx'
|
|
6
|
+
import QuickLookHeader from './QuickLookHeader.jsx'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Modal — promise-based prompt + confirm + alert dialogs.
|
|
@@ -58,6 +59,17 @@ import ToggleCheckbox from '../atoms/ToggleCheckbox.jsx'
|
|
|
58
59
|
* `values` comes back on cancel too (the toggles as left), so a consumer can remember them either
|
|
59
60
|
* way. Without `options`, confirm still resolves a plain boolean — existing callers untouched.
|
|
60
61
|
*
|
|
62
|
+
* THE FLOAT (`variant: 'float'` on any call or on the provider, float-everything W6 rows 84 · 85 · 89 · 90, 2026-11-04 —
|
|
63
|
+
* kol-float--style 46:2795): the window on `kol-float-solid` at `--kol-float-window-r`, 24 in, 18 between its parts.
|
|
64
|
+
* A `header` (with its `icon`) draws `QuickLookHeader variant="float"` over the title; the title is the heading
|
|
65
|
+
* (`kol-float-section`… at 20: Inter 500), `body` a line under it in the hint ink; fields are float Inputs, toggles float
|
|
66
|
+
* ToggleCheckboxes; the actions sit apart — the quiet cancel at the left (`tone="ghost"`), the next step at the right
|
|
67
|
+
* (`inverted`, or `danger` when `tone: 'danger'` — the destructive confirm). Still a blocking task, so the scrim
|
|
68
|
+
* stays: the scrim rule is "only when blocking", and a prompt always blocks.
|
|
69
|
+
*
|
|
70
|
+
* await confirm('Delete “Orbit field”?', { variant: 'float', header: 'Delete layer', icon: 'alert-triangle',
|
|
71
|
+
* body: 'This removes the layer and its 4 keyframes from Scene 01.', tone: 'danger', okLabel: 'Delete layer', cancelLabel: 'Keep layer' })
|
|
72
|
+
*
|
|
61
73
|
* Mounted once at the app root (BrandLayout). Renders into `document.body`
|
|
62
74
|
* via portal, so it floats above any rail / scroll-context.
|
|
63
75
|
*/
|
|
@@ -69,6 +81,8 @@ const ModalCtx = (globalThis[Symbol.for('@kolkrabbi/kol-component/ModalCtx')] ??
|
|
|
69
81
|
* hairline. Each modal keeps its own default (prompts bordered, Dialog lift) until he picks one. */
|
|
70
82
|
const MODAL_VARIANTS = {
|
|
71
83
|
lift: { className: 'kol-overlay-panel', style: {} },
|
|
84
|
+
/* float (W6, 2026-11-04): the float window — solid ground + the float shadow, the window radius, no edge */
|
|
85
|
+
float: { className: 'kol-float-solid !rounded-[var(--kol-float-window-r)] text-fg-emphasis', style: {} },
|
|
72
86
|
bordered: { className: 'border border-fg-08', style: { background: 'var(--kol-surface-primary)', color: 'var(--kol-surface-on-primary)' } },
|
|
73
87
|
}
|
|
74
88
|
const modalVariant = (v, fallback) => MODAL_VARIANTS[v] ?? MODAL_VARIANTS[fallback]
|
|
@@ -83,20 +97,20 @@ export function ModalProvider({ children, variant = 'bordered' }) {
|
|
|
83
97
|
})
|
|
84
98
|
}, [])
|
|
85
99
|
|
|
86
|
-
const prompt = useCallback((title, defaultValue = '', { okLabel, cancelLabel, type = 'text', placeholder, variant } = {}) =>
|
|
87
|
-
new Promise((resolve) => setState({ kind: 'prompt', title, defaultValue, okLabel, cancelLabel, type, placeholder, variant, resolve })),
|
|
100
|
+
const prompt = useCallback((title, defaultValue = '', { okLabel, cancelLabel, type = 'text', placeholder, variant, header, icon, body } = {}) =>
|
|
101
|
+
new Promise((resolve) => setState({ kind: 'prompt', title, defaultValue, okLabel, cancelLabel, type, placeholder, variant, header, icon, body, resolve })),
|
|
88
102
|
[])
|
|
89
103
|
|
|
90
|
-
const confirm = useCallback((title, { okLabel, cancelLabel, options, variant } = {}) =>
|
|
91
|
-
new Promise((resolve) => setState({ kind: 'confirm', title, okLabel, cancelLabel, options: options?.length ? options : null, variant, resolve })),
|
|
104
|
+
const confirm = useCallback((title, { okLabel, cancelLabel, options, variant, header, icon, body, tone } = {}) =>
|
|
105
|
+
new Promise((resolve) => setState({ kind: 'confirm', title, okLabel, cancelLabel, options: options?.length ? options : null, variant, header, icon, body, tone, resolve })),
|
|
92
106
|
[])
|
|
93
107
|
|
|
94
|
-
const alert = useCallback((title, { okLabel, variant } = {}) =>
|
|
95
|
-
new Promise((resolve) => setState({ kind: 'alert', title, okLabel, variant, resolve })),
|
|
108
|
+
const alert = useCallback((title, { okLabel, variant, header, icon, body } = {}) =>
|
|
109
|
+
new Promise((resolve) => setState({ kind: 'alert', title, okLabel, variant, header, icon, body, resolve })),
|
|
96
110
|
[])
|
|
97
111
|
|
|
98
|
-
const form = useCallback((title, fields = [], { okLabel, cancelLabel, variant } = {}) =>
|
|
99
|
-
new Promise((resolve) => setState({ kind: 'form', title, fields, okLabel, cancelLabel, variant, resolve })),
|
|
112
|
+
const form = useCallback((title, fields = [], { okLabel, cancelLabel, variant, header, icon, body } = {}) =>
|
|
113
|
+
new Promise((resolve) => setState({ kind: 'form', title, fields, okLabel, cancelLabel, variant, header, icon, body, resolve })),
|
|
100
114
|
[])
|
|
101
115
|
|
|
102
116
|
return (
|
|
@@ -112,6 +126,7 @@ export function ModalProvider({ children, variant = 'bordered' }) {
|
|
|
112
126
|
|
|
113
127
|
function ModalView({ state, closeWith, variant }) {
|
|
114
128
|
const look = modalVariant(variant, 'bordered')
|
|
129
|
+
const float = variant === 'float'
|
|
115
130
|
const [val, setVal] = useState(state.defaultValue ?? '')
|
|
116
131
|
const [values, setValues] = useState(() => Object.fromEntries((state.options ?? []).map((o) => [o.id, !!o.defaultValue])))
|
|
117
132
|
const [fieldVals, setFieldVals] = useState(() => Object.fromEntries((state.fields ?? []).map((f) => [f.id, f.defaultValue ?? ''])))
|
|
@@ -194,25 +209,28 @@ function ModalView({ state, closeWith, variant }) {
|
|
|
194
209
|
aria-modal="true"
|
|
195
210
|
aria-labelledby="kol-modal-title"
|
|
196
211
|
onMouseDown={(e) => e.stopPropagation()}
|
|
197
|
-
className={`kol-modal flex flex-col gap-4 p-5 rounded ${look.className}`}
|
|
212
|
+
className={float ? `kol-modal flex flex-col gap-[18px] p-6 ${look.className}` : `kol-modal flex flex-col gap-4 p-5 rounded ${look.className}`}
|
|
198
213
|
style={{
|
|
199
214
|
...look.style,
|
|
200
215
|
minWidth: 320,
|
|
201
216
|
maxWidth: '90vw',
|
|
217
|
+
...(float ? { width: 562 } : {}),
|
|
202
218
|
}}
|
|
203
219
|
>
|
|
220
|
+
{float && state.header && <QuickLookHeader variant="float" icon={state.icon} title={state.header} onClose={cancel} />}
|
|
204
221
|
{/* kol-mono-12, not helper: dialog copy WRAPS, and helper's
|
|
205
222
|
* line-height 1 is single-line chrome only (type protocol). */}
|
|
206
223
|
{/* pre-line: an alert can carry a failure list, one per line */}
|
|
207
|
-
<p id="kol-modal-title" className=
|
|
224
|
+
<p id="kol-modal-title" className={float ? 'font-[family-name:var(--kol-font-family-float)] text-[20px] font-medium leading-[28px] text-fg-emphasis whitespace-pre-line' : 'kol-mono-12 text-emphasis whitespace-pre-line'}>{state.title}</p>
|
|
225
|
+
{float && state.body && <p className="kol-float-body text-fg-64 whitespace-pre-line">{state.body}</p>}
|
|
208
226
|
{state.kind === 'prompt' && (
|
|
209
227
|
<Input
|
|
210
228
|
ref={inputRef}
|
|
211
229
|
type={state.type}
|
|
212
230
|
autoComplete={state.type === 'password' ? 'current-password' : undefined}
|
|
213
231
|
placeholder={state.placeholder}
|
|
214
|
-
variant=
|
|
215
|
-
size=
|
|
232
|
+
variant={float ? 'float' : 'outline'}
|
|
233
|
+
size={float ? 'md' : 'sm'}
|
|
216
234
|
value={val}
|
|
217
235
|
onChange={(e) => setVal(e.target.value)}
|
|
218
236
|
className="w-full"
|
|
@@ -226,8 +244,8 @@ function ModalView({ state, closeWith, variant }) {
|
|
|
226
244
|
autoComplete={f.autoComplete}
|
|
227
245
|
placeholder={f.placeholder}
|
|
228
246
|
aria-label={f.placeholder ?? f.id}
|
|
229
|
-
variant=
|
|
230
|
-
size=
|
|
247
|
+
variant={float ? 'float' : 'outline'}
|
|
248
|
+
size={float ? 'md' : 'sm'}
|
|
231
249
|
value={fieldVals[f.id]}
|
|
232
250
|
onChange={(e) => setFieldVals((v) => ({ ...v, [f.id]: e.target.value }))}
|
|
233
251
|
className="w-full"
|
|
@@ -240,18 +258,27 @@ function ModalView({ state, closeWith, variant }) {
|
|
|
240
258
|
key={o.id}
|
|
241
259
|
label={o.label}
|
|
242
260
|
hint={o.hint}
|
|
261
|
+
variant={float ? 'float' : undefined}
|
|
243
262
|
checked={values[o.id]}
|
|
244
263
|
onChange={(next) => setValues((v) => ({ ...v, [o.id]: next }))}
|
|
245
264
|
/>
|
|
246
265
|
))}
|
|
247
266
|
</div>
|
|
248
267
|
)}
|
|
268
|
+
{float ? (
|
|
269
|
+
/* the float's actions sit apart: recovery quiet at the left, the next step at the right */
|
|
270
|
+
<div className="flex items-center justify-between gap-3">
|
|
271
|
+
{state.kind !== 'alert' ? <Button variant="float" tone="ghost" size="md" onClick={cancel}>{state.cancelLabel ?? 'Cancel'}</Button> : <span />}
|
|
272
|
+
<Button variant="float" tone={state.tone === 'danger' ? 'danger' : 'inverted'} size="md" onClick={submit} data-modal-ok>{state.okLabel ?? 'OK'}</Button>
|
|
273
|
+
</div>
|
|
274
|
+
) : (
|
|
249
275
|
<div className="flex gap-2 justify-end">
|
|
250
276
|
{state.kind !== 'alert' && <Button size="sm" onClick={cancel}>{state.cancelLabel ?? 'Cancel'}</Button>}
|
|
251
277
|
{/* inverted, not primary: since tone-is-the-ground-axis (2026-09-03) primary is the
|
|
252
278
|
* dark ground, so OK drew the same as Cancel and nothing showed what Enter does */}
|
|
253
279
|
<Button tone="inverted" size="sm" onClick={submit} data-modal-ok>{state.okLabel ?? 'OK'}</Button>
|
|
254
280
|
</div>
|
|
281
|
+
)}
|
|
255
282
|
</div>
|
|
256
283
|
</div>
|
|
257
284
|
)
|
|
@@ -296,9 +323,20 @@ export function useModal() {
|
|
|
296
323
|
* portal). Esc and a press on the scrim close it; Esc is left to an open float inside first.
|
|
297
324
|
*
|
|
298
325
|
* <Dialog open={open} onClose={() => setOpen(false)} title="Filter by page" width={560}>…</Dialog>
|
|
326
|
+
*
|
|
327
|
+
* `variant="float"` (float-everything W6 rows 83 · 84 · 89, 2026-11-04 — kol-float--style 46:2655): the float window —
|
|
328
|
+
* `kol-float-solid` on `--kol-float-window-r`, 24 in, 18 between its parts, the title drawn as `QuickLookHeader
|
|
329
|
+
* variant="float"` (`icon` · title · − when `onMinimise` · ×) over the children. `blocking` (default true) keeps the
|
|
330
|
+
* scrim: a blocking task dims the scene, a utility window does not (row 89) — `blocking={false}` drops the scrim and the
|
|
331
|
+
* press-outside close and leaves the scene live (QuickLookFrame float is the utility window proper).
|
|
332
|
+
* @param {'lift'|'bordered'|'float'} [variant='lift']
|
|
333
|
+
* @param {string} [icon] float: the header's glyph
|
|
334
|
+
* @param {Function} [onMinimise] float: the − control
|
|
335
|
+
* @param {boolean} [blocking=true]
|
|
299
336
|
*/
|
|
300
|
-
export function Dialog({ open, onClose, title, width = 560, variant = 'lift', children }) {
|
|
337
|
+
export function Dialog({ open, onClose, title, width = 560, variant = 'lift', icon, onMinimise, blocking = true, children }) {
|
|
301
338
|
const look = modalVariant(variant, 'lift')
|
|
339
|
+
const float = variant === 'float'
|
|
302
340
|
useEffect(() => {
|
|
303
341
|
if (!open) return undefined
|
|
304
342
|
const onKey = (e) => { if (e.key === 'Escape' && !document.querySelector('.kol-popover-float')) onClose() }
|
|
@@ -308,22 +346,23 @@ export function Dialog({ open, onClose, title, width = 560, variant = 'lift', ch
|
|
|
308
346
|
if (!open || typeof document === 'undefined') return null
|
|
309
347
|
return createPortal(
|
|
310
348
|
<div
|
|
311
|
-
onMouseDown={onClose}
|
|
312
|
-
className=
|
|
349
|
+
onMouseDown={blocking ? onClose : undefined}
|
|
350
|
+
className={blocking ? 'kol-overlay-scrim' : 'pointer-events-none'}
|
|
313
351
|
style={{ position: 'fixed', inset: 0, zIndex: 150, display: 'flex', alignItems: 'center', justifyContent: 'center' }}
|
|
314
352
|
>
|
|
315
353
|
<div
|
|
316
354
|
role="dialog"
|
|
317
|
-
aria-modal=
|
|
355
|
+
aria-modal={blocking ? 'true' : undefined}
|
|
318
356
|
aria-label={title}
|
|
319
357
|
data-dialog
|
|
320
358
|
onMouseDown={(e) => e.stopPropagation()}
|
|
321
359
|
/* THE OVERLAY PANEL (MetricRebuild, 2026-10-31 — user: the filter dialog read as "a borderless box floating
|
|
322
360
|
* mid-page"): it painted the page's own surface behind an fg-08 hairline, so on a dark page it was the page.
|
|
323
361
|
* `.kol-overlay-panel` is the lift every KOL overlay wears (oq-04, no border — the scrim is the edge). */
|
|
324
|
-
className={`kol-modal flex flex-col rounded max-h-[85vh] ${look.className}`}
|
|
362
|
+
className={float ? `kol-modal pointer-events-auto flex flex-col gap-[18px] p-6 max-h-[85vh] overflow-auto ${look.className}` : `kol-modal flex flex-col rounded max-h-[85vh] ${look.className}${blocking ? '' : ' pointer-events-auto'}`}
|
|
325
363
|
style={{ ...look.style, width: `min(${width}px, calc(100vw - 32px))` }}
|
|
326
364
|
>
|
|
365
|
+
{float && title && <QuickLookHeader variant="float" icon={icon} title={title} onMinimise={onMinimise} onClose={onClose} />}
|
|
327
366
|
{children}
|
|
328
367
|
</div>
|
|
329
368
|
</div>,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Button from '../atoms/Button.jsx'
|
|
2
|
+
|
|
3
|
+
/* taxonomy-ok: molecule — nests Button (atom). */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* NoticeBanner — Something needs attention, and the one thing that fixes it. `Calendar needs attention · Reconnect`
|
|
7
|
+
* (float-everything W6 row 93, 2026-11-04 — kol-float--style 46:3097). A full-width float strip on the sheet radius
|
|
8
|
+
* (`--kol-float-menu-r`), `kol-float-solid`'s ground without its shadow (it sits in the page, not over it), 16 in: the
|
|
9
|
+
* title in `kol-float-hint` on the emphasis ink over the detail in `kol-float-label` on fg-64, the action at the right
|
|
10
|
+
* as a float button in the secondary tone. No icon and no tint — the words carry it; no hairline edge.
|
|
11
|
+
*
|
|
12
|
+
* @param {ReactNode} title
|
|
13
|
+
* @param {ReactNode} [body]
|
|
14
|
+
* @param {string} [action] the button's label (`Reconnect`)
|
|
15
|
+
* @param {Function} [onAction]
|
|
16
|
+
* @param {string} [className]
|
|
17
|
+
*/
|
|
18
|
+
export default function NoticeBanner({ title, body, action, onAction, className = '' }) {
|
|
19
|
+
return (
|
|
20
|
+
<div role="status" className={`flex w-full items-center gap-4 rounded-[var(--kol-float-menu-r)] bg-surface-secondary py-2.5 pl-4 pr-2.5 ${className}`.trim()}>
|
|
21
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
22
|
+
<span className="kol-float-hint truncate text-fg-emphasis">{title}</span>
|
|
23
|
+
{body && <span className="kol-float-label truncate text-fg-64">{body}</span>}
|
|
24
|
+
</span>
|
|
25
|
+
{action && <Button variant="float" tone="secondary" size="md" className="shrink-0" onClick={onAction}>{action}</Button>}
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -21,6 +21,8 @@ import { useEffect, useState } from 'react'
|
|
|
21
21
|
* @param {string} size 'sm' | 'md' | 'lg' — pins the responsive size
|
|
22
22
|
* @param {'float'} variant the float stepper (float-everything W2 row 24, 2026-11-04): a 36 capsule on the float
|
|
23
23
|
* well, − value + in Inter 500 (the glyphs oq, 40% at a bound), the float heights by `size`
|
|
24
|
+
* @param {string} unit FLOAT: a word after the value (`22 px` — the reader's text size, W11 row 151, 2026-11-04)
|
|
25
|
+
* @param {string} ariaLabel FLOAT: what the value is; the − + read `Decrease <it>` / `Increase <it>` (default quantity)
|
|
24
26
|
* @param {string} className extra classes on the root
|
|
25
27
|
*/
|
|
26
28
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
@@ -40,6 +42,8 @@ const QuantityInput = ({
|
|
|
40
42
|
controls = 'chevron',
|
|
41
43
|
size,
|
|
42
44
|
variant,
|
|
45
|
+
unit,
|
|
46
|
+
ariaLabel = 'quantity',
|
|
43
47
|
className = '',
|
|
44
48
|
}) => {
|
|
45
49
|
const [resolvedSize, setResolvedSize] = useState('md')
|
|
@@ -79,9 +83,9 @@ const QuantityInput = ({
|
|
|
79
83
|
const btn = 'inline-flex h-full w-8 shrink-0 items-center justify-center rounded-full text-oq-64 hover:text-oq-96 disabled:opacity-40 disabled:hover:text-oq-64 cursor-pointer disabled:cursor-not-allowed outline-none focus-visible:[box-shadow:var(--kol-float-focus)] transition-colors'
|
|
80
84
|
return (
|
|
81
85
|
<div className={`inline-flex items-center rounded-full bg-[var(--kol-float-well)] px-1 kol-float-panel text-fg-emphasis ${FLOAT_H[size] ?? FLOAT_H.md} ${className}`.trim()}>
|
|
82
|
-
<button type="button" onClick={decrement} disabled={value <= min} className={btn} aria-label=
|
|
83
|
-
<span className="min-w-6 text-center tabular-nums">{value}</span>
|
|
84
|
-
<button type="button" onClick={increment} disabled={value >= max} className={btn} aria-label=
|
|
86
|
+
<button type="button" onClick={decrement} disabled={value <= min} className={btn} aria-label={`Decrease ${ariaLabel}`}><Icon name="minus" size={14} /></button>
|
|
87
|
+
<span className="min-w-6 flex-1 text-center tabular-nums">{value}{unit ? ` ${unit}` : ''}</span>
|
|
88
|
+
<button type="button" onClick={increment} disabled={value >= max} className={btn} aria-label={`Increase ${ariaLabel}`}><Icon name="plus" size={14} /></button>
|
|
85
89
|
</div>
|
|
86
90
|
)
|
|
87
91
|
}
|