@kolkrabbi/kol-component 0.317.7 → 0.318.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/atoms/Button.jsx +2 -2
- package/src/atoms/Input.jsx +2 -0
- package/src/molecules/TabsRow.jsx +9 -3
package/package.json
CHANGED
package/src/atoms/Button.jsx
CHANGED
|
@@ -12,7 +12,7 @@ import { glyphSize } from '../hooks/glyphLadders.js'
|
|
|
12
12
|
*
|
|
13
13
|
* @param {Object} props
|
|
14
14
|
* @param {ReactNode} props.children - Button content
|
|
15
|
-
* @param {'accent'|'danger'|'nav'|'tab'|'tab-filled'} props.variant - The intent; the GROUND is `tone`. `tab` is the tab chip (2026-10-02): quiet text at rest, a soft filled chip while `pressed`. `tab-filled` (2026-10-29) shows its chip at rest (oq-04), brighter on hover (oq-08) and brightest selected (oq-16). `primary · secondary · outline · ghost · grey · control` are deprecated aliases of tones (2026-10-01, on the retirement ledger): pass `tone` — `secondary` is `tone="inverted"`, `control` is `tone="ghost"`, the rest keep their name. Visual variant. UNSET (the default) inherits the tone of the nearest `kol-tone-*` wrapper, else renders primary; the five ground variants are aliases of `tone`. `danger` is the destructive treatment (--ui-error fill); `nav` is the chrome rung — transparent, oq-64 ink, one step brighter than `ghost`; `control` is an alias for `ghost` (legacy call-sites).
|
|
15
|
+
* @param {'accent'|'danger'|'nav'|'tab'|'tab-filled'} props.variant - The intent; the GROUND is `tone`. `tab` is the tab chip (2026-10-02): quiet text at rest, a soft filled chip while `pressed`. `tab-filled` (2026-10-29) shows its chip at rest (oq-04), brighter on hover (oq-08) and brightest selected (oq-16). `float` (2026-10-30, FloatingStyleAndSignInDemos — the floating style B) is the shape only: a 44 control (44×44 icon-only), an 18 radius; the ground stays the `tone`'s. A composed float component (AppFloatNav, AccountForm's box) passes it, a consumer never sets it by hand. `primary · secondary · outline · ghost · grey · control` are deprecated aliases of tones (2026-10-01, on the retirement ledger): pass `tone` — `secondary` is `tone="inverted"`, `control` is `tone="ghost"`, the rest keep their name. Visual variant. UNSET (the default) inherits the tone of the nearest `kol-tone-*` wrapper, else renders primary; the five ground variants are aliases of `tone`. `danger` is the destructive treatment (--ui-error fill); `nav` is the chrome rung — transparent, oq-64 ink, one step brighter than `ghost`; `control` is an alias for `ghost` (legacy call-sites).
|
|
16
16
|
* @param {'xs'|'sm'|'md'|'lg'} props.size - Button size (default: 'md'); xs is the panel rung (ControlsXsRung, 2026-09-01) — kol-mono-8 in a 22px shell (20 icon-only), opt-in by prop
|
|
17
17
|
* @param {string} props.iconLeft - Icon name to display on the left
|
|
18
18
|
* @param {string} props.iconRight - Icon name to display on the right
|
|
@@ -93,7 +93,7 @@ const Button = ({
|
|
|
93
93
|
warned.add(variant)
|
|
94
94
|
console.warn(`Button: variant="${variant}" is deprecated — use tone="${VARIANT_TONE[variant]}"`)
|
|
95
95
|
}
|
|
96
|
-
const KNOWN = ['primary', 'secondary', 'accent', 'outline', 'ghost', 'nav', 'tab', 'tab-filled', 'danger', 'grey']
|
|
96
|
+
const KNOWN = ['primary', 'secondary', 'accent', 'outline', 'ghost', 'nav', 'tab', 'tab-filled', 'danger', 'grey', 'float']
|
|
97
97
|
const known = !resolvedVariant || KNOWN.includes(resolvedVariant)
|
|
98
98
|
if (!known && import.meta.env.DEV) console.warn(`Button: unknown variant "${resolvedVariant}" — rendering the inherited tone (primary)`)
|
|
99
99
|
const variantClass = resolvedVariant && known ? `kol-btn-${resolvedVariant}` : ''
|
package/src/atoms/Input.jsx
CHANGED
|
@@ -11,6 +11,8 @@ import { glyphSize } from '../hooks/glyphLadders.js'
|
|
|
11
11
|
* variant="outline" — bordered, transparent bg — THE secondary
|
|
12
12
|
* treatment (2026-07-08 chrome law: one
|
|
13
13
|
* secondary, always subordinate to filled)
|
|
14
|
+
* variant="float" — the floating style B (2026-10-30): 44 tall, an 18 radius, on the page's ground
|
|
15
|
+
* (surface-primary) inside a float box; AccountForm's box passes it
|
|
14
16
|
* tone="inverse" — the dark chip (`fg-ab-24`) for a washed plane
|
|
15
17
|
* (ControlToneInverse, 2026-08-27); same prop on ViewToggle · Dropdown
|
|
16
18
|
* size="xs" — the panel rung (ControlsXsRung, 2026-09-01):
|
|
@@ -4,6 +4,7 @@ import CloseButton from '../atoms/CloseButton.jsx'
|
|
|
4
4
|
import Button from '../atoms/Button.jsx'
|
|
5
5
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
6
6
|
import { RAIL_ROW } from '../hooks/railRow.js'
|
|
7
|
+
import { Tooltip } from '../utilities/Popover.jsx'
|
|
7
8
|
|
|
8
9
|
/* taxonomy-ok: nests kol-icons's Icon */
|
|
9
10
|
|
|
@@ -59,7 +60,8 @@ import { RAIL_ROW } from '../hooks/railRow.js'
|
|
|
59
60
|
* that component shoudl probablyget its own variant"*): the pill on a DESK — shown from md up, hidden
|
|
60
61
|
* below (the phone has its own nav), placed at the content's bottom-left, 64 in from the rail's edge
|
|
61
62
|
* (`--kol-shell-rail-width`) and 64 up, not centred
|
|
62
|
-
* @param {boolean} [shadow=false]
|
|
63
|
+
* @param {boolean} [shadow=false] the KOL float shadow (`--kol-shadow-float`) — for a pill that floats over content (the transport,
|
|
64
|
+
* a nav over a clashing canvas). Every pill slot names itself on hover in the KOL `Tooltip`
|
|
63
65
|
* @param {'fill'|'circle'} [active='fill'] the lit slot: `fill` its whole 56 slot (today), `circle` a 44×44 1:1 circle
|
|
64
66
|
* @param {boolean} [foldable=false] a sideways swipe (> 40px) folds the pill into a 28×72 edge tab; a tap restores it
|
|
65
67
|
* @param {boolean} [folded] · {Function} [onFoldChange] the folded state, controlled (else the pill holds it)
|
|
@@ -207,7 +209,8 @@ function StackedTabs({ tabs, value, onChange, placement, shape = 'bar', collapse
|
|
|
207
209
|
background: 'var(--kol-surface-secondary)',
|
|
208
210
|
/* without the hairline the 1px it took stays, transparent, so the slots never move */
|
|
209
211
|
border: `1px solid ${border ? 'var(--kol-oq-08)' : 'transparent'}`,
|
|
210
|
-
|
|
212
|
+
/* the KOL float shadow (kol-theme `--kol-shadow-float`, FloatingStyleAndSignInDemos 2026-10-30) — was a local 40px blur */
|
|
213
|
+
boxShadow: shadow ? 'var(--kol-shadow-float)' : undefined,
|
|
211
214
|
transition: `width ${COLLAPSE_MS}ms ease`,
|
|
212
215
|
...swipeProps.style,
|
|
213
216
|
} : phone ? {
|
|
@@ -224,7 +227,9 @@ function StackedTabs({ tabs, value, onChange, placement, shape = 'bar', collapse
|
|
|
224
227
|
{tabs.map((t) => {
|
|
225
228
|
const active = t.selected ?? t.id === value
|
|
226
229
|
const circle = pill && activeShape === 'circle'
|
|
227
|
-
|
|
230
|
+
/* THE NAME ON HOVER IS THE KOL TOOLTIP (AppFloatNav, kol-fxr 2026-10-30 — the Round 3 board), on the pill's far side
|
|
231
|
+
* from its edge; a thumb never hovers, so the phone is unchanged */
|
|
232
|
+
const slot = (
|
|
228
233
|
<button
|
|
229
234
|
key={t.id}
|
|
230
235
|
type="button"
|
|
@@ -246,6 +251,7 @@ function StackedTabs({ tabs, value, onChange, placement, shape = 'bar', collapse
|
|
|
246
251
|
{!phone && <span className="kol-helper-10 truncate max-w-full px-1">{t.label}</span>}
|
|
247
252
|
</button>
|
|
248
253
|
)
|
|
254
|
+
return pill ? <Tooltip key={t.id} label={t.label} placement={top ? 'bottom' : 'top'} offset={10} asChild>{slot}</Tooltip> : slot
|
|
249
255
|
})}
|
|
250
256
|
</div>
|
|
251
257
|
{phone && (
|