@kolkrabbi/kol-component 0.32.0 → 0.32.2
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.2",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@floating-ui/react": "^0.27.19",
|
|
25
25
|
"embla-carousel-react": "^8.6.0",
|
|
26
26
|
"react-syntax-highlighter": "^16.1.1",
|
|
27
|
-
"@kolkrabbi/kol-icons": "0.12.1"
|
|
27
|
+
"@kolkrabbi/kol-icons": "^0.12.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"framer-motion": "^12.0.0",
|
package/src/atoms/Popover.jsx
CHANGED
|
@@ -74,14 +74,15 @@ export function usePopover({
|
|
|
74
74
|
* narrow case). The panel is never NARROWER than the trigger, and
|
|
75
75
|
* grows when its rows carry chrome the trigger doesn't (the
|
|
76
76
|
* selected row's check). Sole consumer is Dropdown. */
|
|
77
|
-
/* width
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
77
|
+
/* EXACT width — the one-piece fusion restored (2026-08-09 night).
|
|
78
|
+
* The truncation that briefly justified a floor is solved at the
|
|
79
|
+
* TRIGGER instead: the ghost stack reserves the panel row's check
|
|
80
|
+
* column (.kol-dd-ghost slack), so the one shared width fits every
|
|
81
|
+
* row. Letting the panel size itself was the broken middle: an
|
|
82
|
+
* abs-positioned float with auto width sizes against available
|
|
83
|
+
* space, not content. Sole consumer is Dropdown. */
|
|
82
84
|
Object.assign(elements.floating.style, {
|
|
83
|
-
|
|
84
|
-
width: 'max-content',
|
|
85
|
+
width: `${rects.reference.width}px`,
|
|
85
86
|
})
|
|
86
87
|
},
|
|
87
88
|
})
|
|
@@ -60,7 +60,7 @@ export function StatusChip({ value, options = [], onChange, size = 'sm' }) {
|
|
|
60
60
|
type="button"
|
|
61
61
|
disabled={!interactive || undefined}
|
|
62
62
|
aria-expanded={interactive ? open : undefined}
|
|
63
|
-
className={`kol-status-chip${toneCls} kol-mono-12 inline-flex items-center gap-1 rounded-full border-0 px-
|
|
63
|
+
className={`kol-status-chip${toneCls} kol-mono-12 inline-flex items-center gap-1 rounded-full border-0 px-2 py-1 leading-none${interactive ? ' cursor-pointer' : ''}`}
|
|
64
64
|
onClick={interactive ? () => setOpen((o) => !o) : undefined}
|
|
65
65
|
>
|
|
66
66
|
{activeOpt?.label ?? value}
|
|
@@ -129,32 +129,33 @@ export default function FieldRow({
|
|
|
129
129
|
placeholder,
|
|
130
130
|
disabled = false,
|
|
131
131
|
}) {
|
|
132
|
-
const dash = <span className="kol-helper-10 text-meta">—</span>
|
|
133
132
|
/* Empty MEDIA is a framed + slot, empty FILE is a Choose-file control —
|
|
134
|
-
* the reference panel's grammar (user frames 2026-08-09), not a bare
|
|
135
|
-
*
|
|
136
|
-
|
|
133
|
+
* the reference panel's grammar (user frames 2026-08-09), not a bare icon
|
|
134
|
+
* button and never a dash: the affordance renders with or without a
|
|
135
|
+
* picker (disabled when no onPick), because the reference shows the slot
|
|
136
|
+
* itself as the field's resting state. */
|
|
137
|
+
const mediaEmpty = (
|
|
137
138
|
<button
|
|
138
139
|
type="button"
|
|
139
140
|
aria-label={label}
|
|
140
|
-
disabled={disabled}
|
|
141
|
+
disabled={disabled || !onPick}
|
|
141
142
|
onClick={onPick}
|
|
142
|
-
className="flex h-16 w-28
|
|
143
|
+
className="flex h-16 w-28 items-center justify-center rounded-lg border border-fg-16 bg-fg-02 text-body transition-colors duration-150 enabled:cursor-pointer enabled:hover:text-emphasis disabled:opacity-60"
|
|
143
144
|
>
|
|
144
145
|
<Icon name="plus" size={16} />
|
|
145
146
|
</button>
|
|
146
|
-
)
|
|
147
|
-
const fileEmpty =
|
|
147
|
+
)
|
|
148
|
+
const fileEmpty = (
|
|
148
149
|
<button
|
|
149
150
|
type="button"
|
|
150
151
|
aria-label={label}
|
|
151
|
-
disabled={disabled}
|
|
152
|
+
disabled={disabled || !onPick}
|
|
152
153
|
onClick={onPick}
|
|
153
|
-
className="kol-control kol-control--filled kol-control-sm kol-mono-12 w-full
|
|
154
|
+
className="kol-control kol-control--filled kol-control-sm kol-mono-12 w-full text-left text-meta enabled:cursor-pointer disabled:opacity-60"
|
|
154
155
|
>
|
|
155
156
|
Choose file…
|
|
156
157
|
</button>
|
|
157
|
-
)
|
|
158
|
+
)
|
|
158
159
|
|
|
159
160
|
let control = null
|
|
160
161
|
if (type === 'text') {
|
|
@@ -202,7 +203,7 @@ export default function FieldRow({
|
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
return (
|
|
205
|
-
<div className="grid grid-cols-[minmax(0,10rem)_minmax(0,1fr)] items-center gap-x-6 py-
|
|
206
|
+
<div className="grid grid-cols-[minmax(0,10rem)_minmax(0,1fr)] items-center gap-x-6 py-4 border-b border-fg-08">
|
|
206
207
|
<div className="kol-mono-12 text-body">{label}</div>
|
|
207
208
|
<div className="min-w-0">{control}</div>
|
|
208
209
|
{hint != null && (
|
|
@@ -37,6 +37,7 @@ export default function ShellDrawer({
|
|
|
37
37
|
side = 'left',
|
|
38
38
|
width,
|
|
39
39
|
header,
|
|
40
|
+
closeSide = 'end',
|
|
40
41
|
children,
|
|
41
42
|
className = '',
|
|
42
43
|
}) {
|
|
@@ -149,6 +150,11 @@ export default function ShellDrawer({
|
|
|
149
150
|
style={width != null ? { width: typeof width === 'number' ? `${width}px` : width } : undefined}
|
|
150
151
|
>
|
|
151
152
|
<div className="mb-6 flex items-center gap-4">
|
|
153
|
+
{/* closeSide="start" — the record-surface anatomy (reference frame,
|
|
154
|
+
* 2026-08-09): × leads, the header's actions sit at the far end. */}
|
|
155
|
+
{closeSide === 'start' && (
|
|
156
|
+
<Button variant="nav" size="md" iconOnly="x" iconSize={14} onClick={onClose} aria-label="Close" className="shrink-0" />
|
|
157
|
+
)}
|
|
152
158
|
{header != null && <div className="min-w-0 flex-1">{header}</div>}
|
|
153
159
|
{/* The box has an owner (2026-08-01). This hand-wrote the icon-button
|
|
154
160
|
* square and its hover wash; `Button variant="nav"` IS that string.
|
|
@@ -156,15 +162,17 @@ export default function ShellDrawer({
|
|
|
156
162
|
* heavier than a drawer close wants, and Button documents iconSize
|
|
157
163
|
* for exactly the cases the ladder cannot serve. The SQUARE is what
|
|
158
164
|
* needed an owner, and it now has one. */}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
{closeSide !== 'start' && (
|
|
166
|
+
<Button
|
|
167
|
+
variant="nav"
|
|
168
|
+
size="md"
|
|
169
|
+
iconOnly="x"
|
|
170
|
+
iconSize={14}
|
|
171
|
+
onClick={onClose}
|
|
172
|
+
aria-label="Close"
|
|
173
|
+
className="ml-auto shrink-0"
|
|
174
|
+
/>
|
|
175
|
+
)}
|
|
168
176
|
</div>
|
|
169
177
|
<div className="flex-1 overflow-y-auto pr-1" style={{ overflowAnchor: 'none' }}>
|
|
170
178
|
{children}
|
|
@@ -317,17 +317,21 @@ export default function RecordManager({
|
|
|
317
317
|
onClose={() => setActive(null)}
|
|
318
318
|
side="right"
|
|
319
319
|
width="min(37.5rem, 92vw)"
|
|
320
|
+
closeSide="start"
|
|
320
321
|
header={
|
|
321
|
-
|
|
322
|
+
/* reference header anatomy (frame 45, 2026-08-09): × leads the row
|
|
323
|
+
* (closeSide above); every action clusters at the far end —
|
|
324
|
+
* … ▶ save-state Publish. */
|
|
325
|
+
<div className="flex items-center justify-end gap-2 min-w-0">
|
|
322
326
|
{onOverflow && (
|
|
323
327
|
<ToolbarIcon name="more" label="More" onClick={() => onOverflow(record)} />
|
|
324
328
|
)}
|
|
325
329
|
{onPreview && (
|
|
326
330
|
<ToolbarIcon name="play" label="Preview" onClick={() => onPreview(record)} />
|
|
327
331
|
)}
|
|
328
|
-
{saveState != null && <span className="kol-helper-10 text-meta
|
|
332
|
+
{saveState != null && <span className="kol-helper-10 text-meta truncate">{saveState}</span>}
|
|
329
333
|
{onPublish && (
|
|
330
|
-
<Button variant="primary" size="sm"
|
|
334
|
+
<Button variant="primary" size="sm" onClick={() => onPublish(record)}>
|
|
331
335
|
{publishLabel}
|
|
332
336
|
</Button>
|
|
333
337
|
)}
|