+ )
+}
+
+/**
+ * A toggle filter in a toolbar: a state, a status… with an optional coloured dot and a count.
+ * tone: 'success' | 'info' | 'accent' | 'warning' | 'danger' | 'neutral' (the dot and the "on" look).
+ */
+export function FilterChip({ pressed = false, tone = 'neutral', count, size = 'md', className, children, ...rest }) {
+ return (
+
+ )
+}
+
+/**
+ * A few mutually exclusive views (List / Map). options: [{ value, label, icon? }].
+ *
+ */
+export function Segmented({ options = [], value, onChange, size = 'md', className, ...rest }) {
+ return (
+
+ {options.map(o => (
+
+ ))}
+
+ )
+}
+
+/**
+ * Tabs with an underline: a page's or a dialog's sections. Scrolls sideways when they don't fit,
+ * never up and down. tabs: [{ id, label, badge?, warn?, testId? }].
+ *
+ * end: an element at the right end of the strip (a refresh button…).
+ */
+export function Tabs({ tabs = [], value, onChange, size = 'md', end, className, ...rest }) {
+ return (
+
+
+ {tabs.map(tb => (
+
+ ))}
+
+ {end &&
{end}
}
+
+ )
+}
diff --git a/packages/ui/src/components/Dropdown.jsx b/packages/ui/src/components/Dropdown.jsx
new file mode 100644
index 0000000..23cdec2
--- /dev/null
+++ b/packages/ui/src/components/Dropdown.jsx
@@ -0,0 +1,183 @@
+import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react'
+import { cx } from '../internal/cx.js'
+import { Portal } from '../internal/Portal.jsx'
+import { useLabels } from './labels.js'
+
+const GAP = 6
+const MARGIN = 8
+
+const Chevron = () => (
+
+)
+const Tick = () => (
+
+)
+
+/**
+ * The one dropdown of the product (2026-11-20): single or multiple choice, a floating list
+ * (portal, flips above when there's no room), keyboard (↑ ↓ Enter Escape), a search box for long
+ * lists. Same heights as (size 'sm' | 'md' | 'lg'), so it lines up with a search bar.
+ *
+ *
+ *
+ *
+ * multiple: value is an array; an empty array means "all" (shown as allLabel) — the usual filter.
+ * options: [{ value, label, hint?, dot? (a colour the venue chose, e.g. a zone's), disabled? }].
+ * onChange receives the new value (not an event). searchable: default when > 8 options.
+ * icon: an element shown before the text (a filter icon…).
+ */
+export function Dropdown({
+ options = [], value, onChange, multiple = false, placeholder, allLabel, size = 'md',
+ searchable, icon, disabled = false, className, menuClassName, id, ...rest
+}) {
+ const labels = useLabels()
+ const [open, setOpen] = useState(false)
+ const [pos, setPos] = useState(null)
+ const [query, setQuery] = useState('')
+ const [active, setActive] = useState(0)
+ const button = useRef(null)
+ const menu = useRef(null)
+ const search = useRef(null)
+ const listId = useId()
+ const chosen = multiple ? (Array.isArray(value) ? value : []) : value
+ const isOn = v => (multiple ? chosen.includes(v) : chosen === v)
+ const withSearch = searchable ?? options.length > 8
+
+ const shown = useMemo(() => {
+ const q = query.trim().toLocaleLowerCase()
+ return q ? options.filter(o => String(o.label).toLocaleLowerCase().includes(q)) : options
+ }, [options, query])
+
+ const place = useCallback(() => {
+ const b = button.current?.getBoundingClientRect()
+ const m = menu.current?.getBoundingClientRect()
+ if (!b) return
+ const height = m?.height ?? 0
+ const below = window.innerHeight - b.bottom - GAP - MARGIN
+ const above = b.top - GAP - MARGIN
+ const up = height > below && above > below
+ const width = Math.max(b.width, m?.width ?? 0)
+ const left = Math.min(Math.max(MARGIN, b.left), window.innerWidth - MARGIN - width)
+ setPos({ left, minWidth: b.width, top: up ? undefined : b.bottom + GAP, bottom: up ? window.innerHeight - b.top + GAP : undefined, maxHeight: Math.max(160, up ? above : below) })
+ }, [])
+
+ useLayoutEffect(() => { if (open) place() }, [open, place, shown.length])
+
+ useEffect(() => {
+ if (!open) return
+ const onDown = e => {
+ if (button.current?.contains(e.target) || menu.current?.contains(e.target)) return
+ setOpen(false)
+ }
+ const onScroll = e => { if (!menu.current?.contains(e.target)) place() }
+ document.addEventListener('pointerdown', onDown)
+ window.addEventListener('resize', place)
+ window.addEventListener('scroll', onScroll, true)
+ return () => {
+ document.removeEventListener('pointerdown', onDown)
+ window.removeEventListener('resize', place)
+ window.removeEventListener('scroll', onScroll, true)
+ }
+ }, [open, place])
+
+ useEffect(() => {
+ if (!open) return
+ setQuery('')
+ const first = options.findIndex(o => isOn(o.value))
+ setActive(first >= 0 ? first : 0)
+ requestAnimationFrame(() => (search.current ?? menu.current)?.focus())
+ }, [open]) // eslint-disable-line react-hooks/exhaustive-deps
+
+ useEffect(() => {
+ menu.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView({ block: 'nearest' })
+ }, [active])
+
+ function pick(o) {
+ if (!o || o.disabled) return
+ if (multiple) {
+ onChange?.(isOn(o.value) ? chosen.filter(v => v !== o.value) : [...chosen, o.value])
+ } else {
+ onChange?.(o.value)
+ setOpen(false)
+ button.current?.focus()
+ }
+ }
+
+ function onKey(e) {
+ if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); setOpen(false); button.current?.focus() }
+ else if (e.key === 'Tab') setOpen(false)
+ else if (e.key === 'ArrowDown') { e.preventDefault(); setActive(i => Math.min(shown.length - 1, i + 1)) }
+ else if (e.key === 'ArrowUp') { e.preventDefault(); setActive(i => Math.max(0, i - 1)) }
+ else if (e.key === 'Enter' || (e.key === ' ' && e.target !== search.current)) { e.preventDefault(); pick(shown[active]) }
+ }
+
+ const label = (() => {
+ if (!multiple) return options.find(o => o.value === chosen)?.label
+ if (chosen.length === 0) return allLabel ?? placeholder
+ const names = options.filter(o => chosen.includes(o.value)).map(o => o.label)
+ return names.length === options.length && allLabel ? allLabel : names.join(', ')
+ })()
+ const empty = multiple ? chosen.length === 0 && !allLabel : label == null
+
+ return (
+ <>
+
+ {open && (
+
+