@kolkrabbi/kol-component 0.332.0 → 0.333.1

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.332.0",
3
+ "version": "0.333.1",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,6 +9,9 @@
9
9
  "exports": {
10
10
  ".": "./src/index.js",
11
11
  "./atoms/RotaryDial": "./src/molecules/Knob.jsx",
12
+ "./molecules/Rail": "./src/organisms/Rail.jsx",
13
+ "./molecules/ShellDrawer": "./src/organisms/ShellDrawer.jsx",
14
+ "./utilities/ButtonGroup": "./src/molecules/ButtonGroup.jsx",
12
15
  "./atoms/*": "./src/atoms/*.jsx",
13
16
  "./molecules/*": "./src/molecules/*.jsx",
14
17
  "./organisms/*": "./src/organisms/*.jsx",
package/src/index.js CHANGED
@@ -105,7 +105,7 @@ export { pathD, pathBounds, shiftNode, normalizePath, scalePathNodes, normalizeP
105
105
 
106
106
  // molecules
107
107
  export { Accordion, AccordionPanel } from './molecules/Accordion.jsx'
108
- export { default as ButtonGroup } from './utilities/ButtonGroup.jsx'
108
+ export { default as ButtonGroup } from './molecules/ButtonGroup.jsx'
109
109
  /* monorepo sets (P6–P10) — molecule members */
110
110
  export { default as AlignmentGrid } from './molecules/AlignmentGrid.jsx'
111
111
  export { default as ImageBlock } from './molecules/ImageBlock.jsx'
@@ -141,9 +141,9 @@ export { default as Combobox } from './molecules/Combobox.jsx'
141
141
  export { default as PaletteHarmonyWheel } from './molecules/PaletteHarmonyWheel.jsx'
142
142
  export { default as PropertyInput } from './molecules/PropertyInput.jsx'
143
143
  export { default as ShapeDropdown } from './molecules/ShapeDropdown.jsx'
144
- export { default as Rail, RAIL_ROLES, useRailKey } from './molecules/Rail.jsx'
144
+ export { default as Rail, RAIL_ROLES, useRailKey } from './organisms/Rail.jsx'
145
145
  /** @deprecated 2026-10-17 — alias of Rail */
146
- export { default as ShellDrawer } from './molecules/ShellDrawer.jsx'
146
+ export { default as ShellDrawer } from './organisms/ShellDrawer.jsx'
147
147
  export { default as CommandOverlay } from './organisms/CommandOverlay.jsx'
148
148
  /** @deprecated 2026-10-17 — alias of CommandOverlay */
149
149
  export { default as ShellSearchOverlay } from './organisms/ShellSearchOverlay.jsx'
@@ -75,7 +75,10 @@ import { floatSurfaceClass } from '../utilities/tone.js'
75
75
  * @param {boolean} [labels=false] the tab bar with labels: 66 tall, items 58 tall and 84 wide, 4 in, a 24 glyph over an 11 label
76
76
  * @param {boolean} [foldable=false] a sideways swipe (> 40px) folds the pill into a 28×72 edge tab; a tap restores it
77
77
  * @param {boolean} [folded] · {Function} [onFoldChange] the folded state, controlled (else the pill holds it)
78
- * @param {'left'|'right'} [foldSide='left'] the screen edge the tab sits on
78
+ * @param {'left'|'right'|'swipe'} [foldSide='left'] the screen edge the tab sits on; `swipe` — the edge the swipe went toward
79
+ * (FloatFoldBothSidesGrey, kol-fxr 2026-11-03)
80
+ * @param {'ground'|'handle'} [foldTone='ground'] the edge tab's look: `ground` is the pill's own; `handle` is the grey edge
81
+ * handle (iOS's), `--kol-oq-24` with an `--kol-oq-96` chevron, whatever the pill's `surface`
79
82
  * Tabs are `{ id, label }` or `{ value, label }` (either key), plus `icon` for stacked; a stacked tab's `selected`
80
83
  * lights it whatever `value` is — action slots (the transport) light more than one.
81
84
  */
@@ -103,7 +106,7 @@ export const tabbarPillSlot = (at, { count, labels = false, split = false } = {}
103
106
  /* the collapse's motion — one duration for the width and the glyph swap (300, user 2026-10-23: 180 read as abrupt) */
104
107
  const COLLAPSE_MS = 300
105
108
 
106
- export default function TabsRow({ tabs: raw = [], value, onChange, onClose, onMinimise, variant, look: lookLegacy, type = 'mono', filled = false, placement = 'inline', shape = 'bar', collapsed = false, onExpand, edge, border, shadow, dock, active, foldable, folded, onFoldChange, foldSide, surface, split, labels, size, tracked = false, overflow = 'scroll', ariaLabel, className, style }) {
109
+ export default function TabsRow({ tabs: raw = [], value, onChange, onClose, onMinimise, variant, look: lookLegacy, type = 'mono', filled = false, placement = 'inline', shape = 'bar', collapsed = false, onExpand, edge, border, shadow, dock, active, foldable, folded, onFoldChange, foldSide, foldTone, surface, split, labels, size, tracked = false, overflow = 'scroll', ariaLabel, className, style }) {
107
110
  const tabs = raw.map((t) => ({ ...t, id: t.id ?? t.value }))
108
111
  const look = variant ?? lookLegacy ?? 'underline'
109
112
  const wrap = overflow === 'wrap'
@@ -111,7 +114,7 @@ export default function TabsRow({ tabs: raw = [], value, onChange, onClose, onMi
111
114
  if (look === 'float') return <Overflow mode={overflow} value={value}><ChipTabs tabs={tabs} value={value} onChange={onChange} size={size ?? 'md'} float ariaLabel={ariaLabel} className={`${wrap ? 'flex-wrap ' : ''}${className ?? ''}`} /></Overflow>
112
115
  if (look === 'chip') return <Overflow mode={overflow} value={value}><ChipTabs tabs={tabs} value={value} onChange={onChange} size={size ?? 'sm'} filled={filled} ariaLabel={ariaLabel} className={`${wrap ? 'flex-wrap ' : ''}${className ?? ''}`} /></Overflow>
113
116
  if (look === 'text') return <Overflow mode={overflow} value={value}><TextTabs tabs={tabs} value={value} onChange={onChange} size={size ?? 14} tracked={tracked} className={`${wrap ? 'flex-wrap gap-y-2 ' : ''}${className ?? 'gap-6'}`} style={style} /></Overflow>
114
- if (look === 'stacked') return <StackedTabs tabs={tabs} value={value} onChange={onChange} placement={placement} shape={shape} collapsed={collapsed} onExpand={onExpand} edge={edge} border={border} shadow={shadow} dock={dock} active={active} foldable={foldable} folded={folded} onFoldChange={onFoldChange} foldSide={foldSide} surface={surface} split={split} labels={labels} ariaLabel={ariaLabel} className={className ?? ''} />
117
+ if (look === 'stacked') return <StackedTabs tabs={tabs} value={value} onChange={onChange} placement={placement} shape={shape} collapsed={collapsed} onExpand={onExpand} edge={edge} border={border} shadow={shadow} dock={dock} active={active} foldable={foldable} folded={folded} onFoldChange={onFoldChange} foldSide={foldSide} foldTone={foldTone} surface={surface} split={split} labels={labels} ariaLabel={ariaLabel} className={className ?? ''} />
115
118
  return <Overflow mode={overflow} value={value}><UnderlineTabs tabs={tabs} value={value} onChange={onChange} onClose={onClose} onMinimise={onMinimise} wrap={wrap} type={type} /></Overflow>
116
119
  }
117
120
 
@@ -174,9 +177,10 @@ function TextTabs({ tabs, value, onChange, size, tracked, className, style }) {
174
177
  /* the fold: a sideways swipe past this folds the pill, as frame E's prototype measures it */
175
178
  const FOLD_SWIPE = 40
176
179
 
177
- function StackedTabs({ tabs, value, onChange, placement, shape = 'bar', collapsed = false, onExpand, edge = 'bottom', border = true, shadow = false, dock = false, active: activeShape = 'fill', foldable = false, folded: foldedProp, onFoldChange, foldSide = 'left', surface = 'solid', split: splitProp = false, labels = false, ariaLabel = 'Sections', className }) {
180
+ function StackedTabs({ tabs, value, onChange, placement, shape = 'bar', collapsed = false, onExpand, edge = 'bottom', border = true, shadow = false, dock = false, active: activeShape = 'fill', foldable = false, folded: foldedProp, onFoldChange, foldSide: foldSideProp = 'left', foldTone = 'ground', surface = 'solid', split: splitProp = false, labels = false, ariaLabel = 'Sections', className }) {
178
181
  const [foldedOwn, setFoldedOwn] = useState(false)
179
182
  const swipe = useRef({ x: null, swiped: false })
183
+ const [swipeSide, setSwipeSide] = useState('left')
180
184
  if (tabs.length === 0) return null
181
185
  const phone = placement === 'phone'
182
186
  const pill = phone && shape === 'pill'
@@ -199,26 +203,28 @@ function StackedTabs({ tabs, value, onChange, placement, shape = 'bar', collapse
199
203
  onPointerUp: (e) => {
200
204
  const { x } = swipe.current
201
205
  swipe.current.x = null
202
- if (x != null && Math.abs(e.clientX - x) > FOLD_SWIPE) { swipe.current.swiped = true; setFolded(true) }
206
+ if (x != null && Math.abs(e.clientX - x) > FOLD_SWIPE) { swipe.current.swiped = true; setSwipeSide(e.clientX < x ? 'left' : 'right'); setFolded(true) }
203
207
  },
204
208
  /* a swipe that ended on a slot must not also press it */
205
209
  onClickCapture: (e) => { if (swipe.current.swiped) { swipe.current.swiped = false; e.stopPropagation(); e.preventDefault() } },
206
210
  style: { touchAction: 'pan-y' },
207
211
  } : {}
208
212
  if (isFolded) {
213
+ const foldSide = foldSideProp === 'swipe' ? swipeSide : foldSideProp
214
+ const handle = foldTone === 'handle'
209
215
  /* THE EDGE TAB (frame E): 28×72 flush to the screen edge, the pill's ground, no border, a chevron pointing back in */
210
216
  return (
211
217
  <button
212
218
  type="button"
213
219
  aria-label={`Show ${ariaLabel.toLowerCase()}`}
214
220
  onClick={() => setFolded(false)}
215
- className={`kol-mobile-tabbar-tab md:hidden fixed z-[calc(var(--kol-z-sticky)+1)] flex items-center justify-center cursor-pointer ${material}`.trim()}
221
+ className={`kol-mobile-tabbar-tab md:hidden fixed z-[calc(var(--kol-z-sticky)+1)] flex items-center justify-center cursor-pointer ${handle ? '' : material}`.trim()}
216
222
  style={{
217
223
  [foldSide]: 0,
218
224
  [top ? 'top' : 'bottom']: `calc(env(safe-area-inset-${top ? 'top' : 'bottom'}, 0px) + ${TABBAR_PILL_INSET + 8}px)`,
219
225
  width: 28, height: 72, padding: 0, border: 'none',
220
226
  borderRadius: foldSide === 'left' ? '0 16px 16px 0' : '16px 0 0 16px',
221
- ...(glass ? {} : { background: 'var(--kol-surface-secondary)' }), color: RAIL_ROW.rest,
227
+ ...(handle ? { background: 'var(--kol-oq-24)' } : glass ? {} : { background: 'var(--kol-surface-secondary)' }), color: handle ? RAIL_ROW.active : RAIL_ROW.rest,
222
228
  }}
223
229
  >
224
230
  <Icon name={foldSide === 'left' ? 'chevron-right' : 'chevron-left'} size={18} />
@@ -5,7 +5,7 @@ import Button from '../atoms/Button.jsx'
5
5
  import SearchInput from '../molecules/SearchInput.jsx'
6
6
  import ToggleCheckbox from '../atoms/ToggleCheckbox.jsx'
7
7
  import IconFrame from '../atoms/IconFrame.jsx'
8
- import Rail from '../molecules/Rail.jsx'
8
+ import Rail from './Rail.jsx'
9
9
  import FieldRow, { StatusChip } from '../molecules/FieldRow.jsx'
10
10
  import { Tooltip } from '../utilities/Popover.jsx'
11
11
  import Table from './Table.jsx'
@@ -5,7 +5,7 @@ import Divider from '../atoms/Divider.jsx'
5
5
  import IconFrame from '../atoms/IconFrame.jsx'
6
6
  import LabeledControl from '../molecules/LabeledControl.jsx'
7
7
  import ToggleSwitch from '../atoms/ToggleSwitch.jsx'
8
- import Rail from '../molecules/Rail.jsx'
8
+ import Rail from './Rail.jsx'
9
9
  import FullscreenOverlay from '../utilities/FullscreenOverlay.jsx'
10
10
  import { Tooltip } from '../utilities/Popover.jsx'
11
11
  import { RailHeader } from './RailKit.jsx'
File without changes
File without changes
File without changes