react-tiling-workspace 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +147 -2
- package/dist/components/LayoutPickerDialog-C-Sb3uOl.cjs +517 -0
- package/dist/components/LayoutPickerDialog-C-Sb3uOl.cjs.map +1 -0
- package/dist/components/LayoutPickerDialog-STglqYFI.mjs +500 -0
- package/dist/components/LayoutPickerDialog-STglqYFI.mjs.map +1 -0
- package/dist/components/icons-0kjsH_LJ.cjs +144 -0
- package/dist/components/icons-0kjsH_LJ.cjs.map +1 -0
- package/dist/components/icons-BgtEPXL8.mjs +97 -0
- package/dist/components/icons-BgtEPXL8.mjs.map +1 -0
- package/dist/components/layout-picker.cjs +5 -0
- package/dist/components/layout-picker.d.cts +22 -0
- package/dist/components/layout-picker.d.mts +22 -0
- package/dist/components/layout-picker.mjs +2 -0
- package/dist/components/mobile.cjs +575 -0
- package/dist/components/mobile.cjs.map +1 -0
- package/dist/components/mobile.d.cts +42 -0
- package/dist/components/mobile.d.mts +42 -0
- package/dist/components/mobile.mjs +574 -0
- package/dist/components/mobile.mjs.map +1 -0
- package/dist/components/topbar.cjs +94 -0
- package/dist/components/topbar.cjs.map +1 -0
- package/dist/components/topbar.d.cts +38 -0
- package/dist/components/topbar.d.mts +38 -0
- package/dist/components/topbar.mjs +93 -0
- package/dist/components/topbar.mjs.map +1 -0
- package/dist/components/types-DkwWFcD5.d.mts +32 -0
- package/dist/components/types-qsXC_48o.d.cts +32 -0
- package/dist/index.cjs +3336 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +243 -0
- package/dist/index.d.mts +243 -0
- package/dist/index.mjs +3320 -0
- package/dist/index.mjs.map +1 -0
- package/dist/server/server.cjs +104 -0
- package/dist/server/server.cjs.map +1 -0
- package/dist/server/server.d.cts +71 -0
- package/dist/server/server.d.mts +71 -0
- package/dist/server/server.mjs +95 -0
- package/dist/server/server.mjs.map +1 -0
- package/dist/server/shortcuts.cjs +32 -0
- package/dist/server/shortcuts.cjs.map +1 -0
- package/dist/server/shortcuts.d.cts +6 -0
- package/dist/server/shortcuts.d.mts +6 -0
- package/dist/server/shortcuts.mjs +31 -0
- package/dist/server/shortcuts.mjs.map +1 -0
- package/dist/theme.css +119 -0
- package/package.json +113 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile.cjs","names":["useRef","useId","useState","MenuIcon","useCallback","useEffect","useLayoutEffect","LoaderIcon","CloseIcon"],"sources":["../../src/components/MobileBottomBar.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from \"react\";\nimport { CloseIcon, LoaderIcon, MenuIcon } from \"./icons\";\n\nexport type MobileBottomBarSubItem = {\n id: string;\n label: string;\n icon: ReactNode;\n active?: boolean;\n onSelect: () => void;\n};\n\nexport type MobileBottomBarItem<T extends string = string> = {\n id: T;\n label: string;\n renderLabel?: () => ReactNode;\n icon: ReactNode;\n variant?: \"tab\" | \"action\" | \"submenu\" | \"accent\";\n active?: boolean;\n loading?: boolean;\n badge?: number | string;\n onClick?: () => void;\n subItems?: MobileBottomBarSubItem[];\n};\n\nexport type MobileBottomBarProps<T extends string = string> = {\n items: MobileBottomBarItem<T>[];\n activeId?: T | null;\n onSelect?: (id: T) => void;\n ariaLabel?: string;\n zIndexClassName?: string;\n};\n\n/* ------------------------------------------------------------------ layout */\n\nconst NAV_HEIGHT_PX = 64;\nconst NAV_BORDER_PX = 1; // `border-t` on the nav\nconst MAX_SLOTS = 5;\n\n// Submenu shape\nconst KNOB_RADIUS_PX = 18; // the circular trigger (36px) the submenu is fused to\nconst TAB_KNOB_START_PX = 9; // tabs grow their knob from here, accent is already full size\nconst FILLET_PX = 26; // horizontal reach of the concave fillets beside the knob\nconst PANEL_GAP_PX = 10; // distance from the bar to the bottom of the pill\nconst PANEL_PAD_X_PX = 6;\nconst PANEL_PAD_Y_PX = 4;\nconst PANEL_EDGE_PX = 10;\nconst PANEL_CORNER_PX = 18;\nconst ITEM_WIDTH_PX = 76;\nconst ITEM_HEIGHT_PX = 48;\nconst ITEM_GAP_PX = 4;\n\nconst EASE_OUT = \"ease-[cubic-bezier(0.22,1,0.36,1)]\";\n\n/* -------------------------------------------------------------------- math */\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), Math.max(min, max));\nconst clamp01 = (value: number) => Math.min(1, Math.max(0, value));\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\nconst roundHalf = (value: number) => Math.round(value * 2) / 2;\nconst f = (value: number) => Math.round(value * 100) / 100;\n\ntype MenuGeometry = {\n cx: number; // trigger centre x (SVG space == bar space)\n ky: number; // trigger centre y (SVG space)\n kr: number; // knob radius\n knobFrom: number; // radius the knob starts growing from\n left: number; // final pill edges\n right: number;\n pillH: number;\n corner: number;\n};\n\n/**\n * One continuous outline: a rounded pill, two concave fillets, and a circular knob.\n * `p` is the morph progress: at 0 the shape is only the knob, at 1 the pill has\n * been pushed up out of it with the neck stretched between the two. It can go a\n * touch past 1 (spring overshoot), which gives the liquid feel.\n */\nfunction buildMorphPath(g: MenuGeometry, rawP: number): string {\n const p = Math.max(0, rawP);\n const pw = Math.min(1, p * 1.08); // width leads height slightly\n const { cx, ky, kr, pillH } = g;\n\n const k = lerp(g.knobFrom, kr, clamp01(p * 4));\n const knobL = cx - k;\n const knobR = cx + k;\n\n const L = lerp(knobL, g.left, pw);\n const R = lerp(knobR, g.right, pw);\n const T = ky * (1 - p);\n const B = ky - (ky - pillH) * p;\n const h = B - T;\n\n const rt = Math.min(g.corner, h / 2, (R - L) / 2);\n const K = 0.5523; // quarter-ellipse cubic constant\n const reach = FILLET_PX * pw;\n const edgeThreshold = rt + 6;\n\n // Right side: either fan out along the bottom edge, or merge smoothly into the right border.\n const rightRoom = R - knobR;\n const mergeRight = rightRoom < edgeThreshold;\n let rightSideCmds: string[];\n if (mergeRight) {\n const joinY = Math.max(T + rt, B - (edgeThreshold - rightRoom) * 0.85 * pw);\n const midY = (joinY + ky) / 2;\n rightSideCmds = [\n `L ${f(R)} ${f(joinY)}`,\n `C ${f(R)} ${f(midY)} ${f(knobR)} ${f(midY)} ${f(knobR)} ${f(ky)}`,\n ];\n } else {\n const rbR = Math.min(rt, Math.max(rightRoom - 6, 4));\n const filletR = Math.min(R - rbR, knobR + reach);\n const neckY = ky - (ky - B) * K;\n rightSideCmds = [\n `L ${f(R)} ${f(B - rbR)}`,\n `Q ${f(R)} ${f(B)} ${f(R - rbR)} ${f(B)}`,\n `L ${f(filletR)} ${f(B)}`,\n `C ${f(filletR + (knobR - filletR) * K)} ${f(B)} ${f(knobR)} ${f(neckY)} ${f(knobR)} ${f(ky)}`,\n ];\n }\n\n // Left side: either fan out along the bottom edge, or merge smoothly into the left border.\n const leftRoom = knobL - L;\n const mergeLeft = leftRoom < edgeThreshold;\n let leftSideCmds: string[];\n if (mergeLeft) {\n const joinY = Math.max(T + rt, B - (edgeThreshold - leftRoom) * 0.85 * pw);\n const midY = (joinY + ky) / 2;\n leftSideCmds = [\n `C ${f(knobL)} ${f(midY)} ${f(L)} ${f(midY)} ${f(L)} ${f(joinY)}`,\n ];\n } else {\n const rbL = Math.min(rt, Math.max(leftRoom - 6, 4));\n const filletL = Math.max(L + rbL, knobL - reach);\n const neckY = ky - (ky - B) * K;\n leftSideCmds = [\n `C ${f(knobL)} ${f(neckY)} ${f(filletL + (knobL - filletL) * K)} ${f(B)} ${f(filletL)} ${f(B)}`,\n `L ${f(L + rbL)} ${f(B)}`,\n `Q ${f(L)} ${f(B)} ${f(L)} ${f(B - rbL)}`,\n ];\n }\n\n return [\n `M ${f(L + rt)} ${f(T)}`,\n `L ${f(R - rt)} ${f(T)}`,\n `Q ${f(R)} ${f(T)} ${f(R)} ${f(T + rt)}`,\n ...rightSideCmds,\n `A ${f(k)} ${f(k)} 0 1 1 ${f(knobL)} ${f(ky)}`,\n ...leftSideCmds,\n `L ${f(L)} ${f(T + rt)}`,\n `Q ${f(L)} ${f(T)} ${f(L + rt)} ${f(T)}`,\n \"Z\",\n ].join(\" \");\n}\n\n/**\n * Mobile bottom navigation.\n *\n * - A soft pill glides behind the active tab.\n * - A submenu pops out of whichever slot opens it: the trigger becomes a circular\n * knob, and the submenu is one fluid shape fused to it with smooth concave\n * curves, in the same colour. The shape is morphed on a spring, so it truly\n * stretches up out of the button instead of just scaling in.\n * - `action` slots get a quiet filled well, `accent` is a circular accent button.\n * Everything stays inside the bar.\n * - Colours come from `--rtw-*` CSS variables so the host theme stays in control.\n */\nexport function MobileBottomBar<T extends string = string>({\n items,\n activeId,\n onSelect,\n ariaLabel = \"Mobile navigation\",\n zIndexClassName = \"z-30\",\n}: MobileBottomBarProps<T>) {\n const navRef = useRef<HTMLElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const pathRef = useRef<SVGPathElement>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const geometryRef = useRef<MenuGeometry | null>(null);\n const lastDrawnGeometryRef = useRef<MenuGeometry | null>(null);\n const switchTweenRef = useRef<{\n from: MenuGeometry;\n startTime: number;\n duration: number;\n } | null>(null);\n const phaseRef = useRef<\"closed\" | \"open\" | \"closing\">(\"closed\");\n const menuIdRef = useRef<string | null>(null);\n const pendingRef = useRef<{ id: string; trigger: HTMLElement; viaKeyboard: boolean } | null>(null);\n const openedByKeyboardRef = useRef(false);\n\n const progressRef = useRef(0);\n const velocityRef = useRef(0);\n const targetRef = useRef(0);\n const rafRef = useRef<number | null>(null);\n const lastFrameRef = useRef(0);\n const finishCloseRef = useRef<() => void>(() => {});\n const closeMenuRef = useRef<(restoreFocus?: boolean) => void>(() => {});\n\n const submenuId = useId();\n const [mountedMenuId, setMountedMenuId] = useState<string | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n const [navWidth, setNavWidth] = useState(375);\n const [anchor, setAnchor] = useState({ x: 187, y: NAV_BORDER_PX + 24 });\n const [pill, setPill] = useState({ x: 0, width: 0, visible: false, instant: true });\n\n /* ---------------------------------------------------------------- slots */\n const accentItem = items.find((item) => item.variant === \"accent\") ?? null;\n const otherItems = items.filter((item) => item.variant !== \"accent\");\n\n const maxOthers = accentItem ? MAX_SLOTS - 1 : MAX_SLOTS;\n const needsOverflow = otherItems.length > maxOthers;\n const visibleItems = needsOverflow ? otherItems.slice(0, maxOthers - 1) : otherItems;\n const overflowItems = needsOverflow ? otherItems.slice(maxOthers - 1) : [];\n\n const moreItem: MobileBottomBarItem<T> | null = needsOverflow\n ? {\n id: \"__overflow__\" as T,\n label: \"More\",\n icon: <MenuIcon />,\n variant: \"submenu\",\n active: overflowItems.some((item) => activeId === item.id || item.active),\n subItems: overflowItems.map((item) => ({\n id: item.id,\n label: item.label,\n icon: item.icon,\n active: activeId === item.id || Boolean(item.active),\n onSelect: () => {\n if (item.onClick) item.onClick();\n else onSelect?.(item.id);\n },\n })),\n }\n : null;\n\n const row = moreItem ? [...visibleItems, moreItem] : visibleItems;\n const centerIndex = Math.ceil(row.length / 2);\n const slots = accentItem\n ? [...row.slice(0, centerIndex), accentItem, ...row.slice(centerIndex)]\n : row;\n\n const menuItem = slots.find((item) => item.id === mountedMenuId) ?? null;\n const subItems = menuItem?.subItems ?? [];\n const openMenuId = isOpen ? mountedMenuId : null;\n\n /* ------------------------------------------------------------- geometry */\n let geometry: MenuGeometry | null = null;\n let panel = { left: 0, width: 0, top: 0, height: 0, svgHeight: 0 };\n if (menuItem && subItems.length > 0) {\n const cols = Math.min(4, subItems.length);\n const rows = Math.ceil(subItems.length / cols);\n const pillH = rows * ITEM_HEIGHT_PX + (rows - 1) * ITEM_GAP_PX + PANEL_PAD_Y_PX * 2;\n const layoutCols = Math.max(cols, 2);\n const idealWidth =\n layoutCols * ITEM_WIDTH_PX + (layoutCols - 1) * ITEM_GAP_PX + PANEL_PAD_X_PX * 2;\n const width = Math.min(idealWidth, navWidth - PANEL_EDGE_PX * 2);\n const left = clamp(anchor.x - width / 2, PANEL_EDGE_PX, navWidth - width - PANEL_EDGE_PX);\n\n const ky = pillH + PANEL_GAP_PX + anchor.y;\n geometry = {\n cx: anchor.x,\n ky,\n kr: KNOB_RADIUS_PX,\n knobFrom: menuItem.variant === \"accent\" ? KNOB_RADIUS_PX : TAB_KNOB_START_PX,\n // Align pill edges cleanly with the knob when near the leftmost/rightmost bar edge.\n left: Math.min(left, anchor.x - KNOB_RADIUS_PX),\n right: Math.max(left + width, anchor.x + KNOB_RADIUS_PX),\n pillH,\n corner: PANEL_CORNER_PX,\n };\n panel = {\n left,\n width,\n // SVG/bar offset: SVG y=ky must land on the measured trigger centre\n top: anchor.y - NAV_BORDER_PX - ky,\n height: pillH,\n svgHeight: ky + KNOB_RADIUS_PX + 2,\n };\n }\n const gridCols = Math.min(4, Math.max(1, subItems.length));\n\n /* ------------------------------------------------------------ utilities */\n const prefersReducedMotion = useCallback(\n () =>\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,\n [],\n );\n\n const draw = useCallback((progress: number, now = performance.now()) => {\n const path = pathRef.current;\n const targetG = geometryRef.current;\n if (!path || !targetG) return;\n\n let g = targetG;\n const tween = switchTweenRef.current;\n if (tween) {\n const rawT = clamp01((now - tween.startTime) / tween.duration);\n const t = 1 - Math.pow(1 - rawT, 3);\n g = {\n cx: lerp(tween.from.cx, targetG.cx, t),\n ky: lerp(tween.from.ky, targetG.ky, t),\n kr: lerp(tween.from.kr, targetG.kr, t),\n knobFrom: lerp(tween.from.knobFrom, targetG.knobFrom, t),\n left: lerp(tween.from.left, targetG.left, t),\n right: lerp(tween.from.right, targetG.right, t),\n pillH: lerp(tween.from.pillH, targetG.pillH, t),\n corner: lerp(tween.from.corner, targetG.corner, t),\n };\n if (rawT >= 1) switchTweenRef.current = null;\n }\n\n lastDrawnGeometryRef.current = g;\n path.setAttribute(\"d\", buildMorphPath(g, progress));\n }, []);\n\n const tick = useCallback(\n (now: number) => {\n const dt = clamp((now - lastFrameRef.current) / 1000, 0.001, 0.032);\n lastFrameRef.current = now;\n\n const target = targetRef.current;\n const opening = target === 1;\n // opening: snappy under-damped spring; closing: fast, crisp retract\n const stiffness = opening ? 340 : 880;\n const damping = opening ? 26 : 58;\n\n let p = progressRef.current;\n let v = velocityRef.current;\n const h = dt / 2;\n for (let i = 0; i < 2; i += 1) {\n v += (stiffness * (target - p) - damping * v) * h;\n p += v * h;\n }\n if (!opening && p < 0) {\n p = 0;\n v = 0;\n }\n progressRef.current = p;\n velocityRef.current = v;\n draw(p, now);\n\n if (\n Math.abs(target - p) < 0.001 &&\n Math.abs(v) < 0.02 &&\n switchTweenRef.current === null\n ) {\n progressRef.current = target;\n velocityRef.current = 0;\n draw(target, now);\n rafRef.current = null;\n if (target === 0) finishCloseRef.current();\n return;\n }\n rafRef.current = window.requestAnimationFrame(tick);\n },\n [draw],\n );\n\n const animateTo = useCallback(\n (target: 0 | 1) => {\n targetRef.current = target;\n if (prefersReducedMotion()) {\n if (rafRef.current !== null) window.cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n progressRef.current = target;\n velocityRef.current = 0;\n draw(target);\n if (target === 0) finishCloseRef.current();\n return;\n }\n if (rafRef.current === null) {\n lastFrameRef.current = performance.now();\n rafRef.current = window.requestAnimationFrame(tick);\n }\n },\n [draw, prefersReducedMotion, tick],\n );\n\n useEffect(\n () => () => {\n if (rafRef.current !== null) window.cancelAnimationFrame(rafRef.current);\n },\n [],\n );\n\n // Reads layout and keeps the pill and the submenu anchor in sync with the DOM.\n // Every setter bails out when nothing changed, so running each render is safe.\n const measure = useCallback(() => {\n const nav = navRef.current;\n if (!nav) return;\n const navRect = nav.getBoundingClientRect();\n setNavWidth((prev) => (prev === navRect.width ? prev : navRect.width));\n\n const trigger = triggerRef.current;\n if (trigger?.isConnected && nav.contains(trigger)) {\n const target = trigger.querySelector<HTMLElement>(\"[data-anchor]\") ?? trigger;\n const rect = target.getBoundingClientRect();\n const x = roundHalf(rect.left - navRect.left + rect.width / 2);\n const y = roundHalf(rect.top - navRect.top + rect.height / 2);\n setAnchor((prev) => (prev.x === x && prev.y === y ? prev : { x, y }));\n }\n\n const pillTarget = nav.querySelector<HTMLElement>('[data-pill-target=\"true\"]');\n if (pillTarget) {\n const rect = pillTarget.getBoundingClientRect();\n const x = roundHalf(rect.left - navRect.left);\n const width = roundHalf(rect.width);\n setPill((prev) => {\n const next = { x, width, visible: true, instant: !prev.visible };\n return prev.x === next.x &&\n prev.width === next.width &&\n prev.visible === next.visible &&\n prev.instant === next.instant\n ? prev\n : next;\n });\n } else {\n setPill((prev) => (prev.visible ? { ...prev, visible: false, instant: false } : prev));\n }\n }, []);\n\n useLayoutEffect(() => {\n measure();\n geometryRef.current = geometry;\n if (geometry) draw(progressRef.current);\n });\n\n useLayoutEffect(() => {\n const nav = navRef.current;\n if (!nav) return;\n window.addEventListener(\"resize\", measure);\n window.addEventListener(\"orientationchange\", measure);\n const observer = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(measure);\n observer?.observe(nav);\n return () => {\n window.removeEventListener(\"resize\", measure);\n window.removeEventListener(\"orientationchange\", measure);\n observer?.disconnect();\n };\n }, [measure]);\n\n /* ----------------------------------------------------------- open/close */\n function openMenu(id: string, trigger: HTMLElement, viaKeyboard: boolean) {\n // Switching directly between two submenus: smoothly glide the stem & pill to the new button.\n const isSwitching = phaseRef.current !== \"closed\" && menuIdRef.current !== id;\n if (isSwitching && !prefersReducedMotion() && lastDrawnGeometryRef.current) {\n switchTweenRef.current = {\n from: lastDrawnGeometryRef.current,\n startTime: performance.now(),\n duration: 220,\n };\n } else if (!isSwitching) {\n switchTweenRef.current = null;\n }\n\n pendingRef.current = null;\n openedByKeyboardRef.current = viaKeyboard;\n triggerRef.current = trigger;\n measure();\n\n if (phaseRef.current === \"closed\") {\n progressRef.current = 0;\n velocityRef.current = 0;\n }\n phaseRef.current = \"open\";\n menuIdRef.current = id;\n setMountedMenuId(id);\n setIsOpen(true);\n animateTo(1);\n }\n\n function closeMenu(restoreFocus = false) {\n if (phaseRef.current === \"closed\") return;\n const trigger = triggerRef.current;\n\n if (restoreFocus && trigger?.isConnected) {\n trigger.focus({ preventScroll: true });\n } else if (panelRef.current?.contains(document.activeElement)) {\n (document.activeElement as HTMLElement).blur();\n }\n\n if (phaseRef.current === \"closing\") return;\n phaseRef.current = \"closing\";\n setIsOpen(false);\n animateTo(0);\n }\n\n function finishClose() {\n phaseRef.current = \"closed\";\n menuIdRef.current = null;\n triggerRef.current = null;\n setMountedMenuId(null);\n\n const pending = pendingRef.current;\n if (pending && pending.trigger.isConnected) {\n pendingRef.current = null;\n openMenu(pending.id, pending.trigger, pending.viaKeyboard);\n }\n pendingRef.current = null;\n }\n\n finishCloseRef.current = finishClose;\n closeMenuRef.current = closeMenu;\n\n useEffect(() => {\n if (!mountedMenuId) return;\n function onKeyDown(event: globalThis.KeyboardEvent) {\n if (event.key === \"Escape\") {\n event.preventDefault();\n closeMenuRef.current(true);\n }\n }\n window.addEventListener(\"keydown\", onKeyDown);\n return () => window.removeEventListener(\"keydown\", onKeyDown);\n }, [mountedMenuId]);\n\n // Keyboard users land on the first option as soon as the menu is open.\n useEffect(() => {\n if (!isOpen || !openedByKeyboardRef.current) return;\n openedByKeyboardRef.current = false;\n panelRef.current\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n }, [isOpen, mountedMenuId]);\n\n function handleSlotClick(item: MobileBottomBarItem<T>, event: MouseEvent<HTMLButtonElement>) {\n if (item.subItems && item.subItems.length > 0) {\n if (mountedMenuId === item.id && phaseRef.current === \"open\") {\n closeMenu();\n } else {\n openMenu(item.id, event.currentTarget, event.detail === 0);\n }\n return;\n }\n\n if (mountedMenuId) closeMenu();\n\n if (item.onClick) item.onClick();\n else onSelect?.(item.id);\n }\n\n function handleMenuKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (event.key === \"Tab\") {\n closeMenu();\n return;\n }\n const entries = Array.from(\n event.currentTarget.querySelectorAll<HTMLElement>('[role=\"menuitem\"]'),\n );\n const current = entries.indexOf(document.activeElement as HTMLElement);\n let next = -1;\n if (event.key === \"ArrowRight\") next = (current + 1) % entries.length;\n else if (event.key === \"ArrowLeft\") next = (current - 1 + entries.length) % entries.length;\n else if (event.key === \"Home\") next = 0;\n else if (event.key === \"End\") next = entries.length - 1;\n if (next >= 0) {\n event.preventDefault();\n entries[next]?.focus();\n }\n }\n\n /* --------------------------------------------------------------- render */\n function renderSlot(item: MobileBottomBarItem<T>) {\n const hasSubmenu = Boolean(item.subItems && item.subItems.length > 0);\n const isAccent = item.variant === \"accent\";\n const isAction = item.variant === \"action\";\n const isMenuMounted = mountedMenuId === item.id;\n const isMenuOpen = openMenuId === item.id;\n const isTabActive = !isAction && !isAccent && (activeId === item.id || Boolean(item.active));\n // the knob replaces the pill while this slot's menu is open\n const isPillTarget = isTabActive && !isMenuOpen;\n\n const wellShape = isAccent ? \"-my-1 size-9\" : \"h-7 w-12\";\n const wellTone = isAccent\n ? \"bg-[var(--rtw-accent,#6366f1)] text-[var(--rtw-accent-foreground,#ffffff)]\"\n : isMenuOpen\n ? \"text-[var(--rtw-accent-foreground,#ffffff)]\"\n : isAction\n ? \"bg-[var(--rtw-surface-subtle,#edf1f7)] text-[var(--rtw-text-strong,#0f172a)] group-hover/slot:bg-[var(--rtw-border,#dfe5ef)]\"\n : isTabActive\n ? \"text-[var(--rtw-accent,#6366f1)]\"\n : \"text-[var(--rtw-text-subtle,#64748b)] group-hover/slot:text-[var(--rtw-text-strong,#0f172a)]\";\n\n const labelTone =\n isAccent || isMenuOpen || isTabActive\n ? \"text-[var(--rtw-accent,#6366f1)]\"\n : isAction\n ? \"text-[var(--rtw-text-strong,#0f172a)]\"\n : \"text-[var(--rtw-text-subtle,#64748b)] group-hover/slot:text-[var(--rtw-text-strong,#0f172a)]\";\n\n const glyphMotion = `transition-[transform,opacity] duration-[280ms] ${EASE_OUT} motion-reduce:transition-none`;\n\n let glyph: ReactNode;\n if (item.loading) {\n glyph = <LoaderIcon className=\"size-5 animate-spin\" />;\n } else if (isAccent) {\n glyph = (\n <span\n aria-hidden=\"true\"\n style={{ transform: isMenuOpen ? \"rotate(135deg)\" : \"rotate(0deg)\" }}\n className={`flex size-[22px] items-center justify-center transition-transform duration-[260ms] ${EASE_OUT} motion-reduce:!transition-none [&>svg]:size-[22px]`}\n >\n {item.icon}\n </span>\n );\n } else if (hasSubmenu) {\n glyph = (\n <span className=\"relative flex size-5 items-center justify-center\">\n <span\n aria-hidden=\"true\"\n className={`absolute inset-0 flex items-center justify-center [&>svg]:size-5 ${glyphMotion} ${\n isMenuOpen ? \"scale-50 -rotate-90 opacity-0\" : \"scale-100 rotate-0 opacity-100\"\n }`}\n >\n {item.icon}\n </span>\n <CloseIcon\n aria-hidden=\"true\"\n className={`absolute size-[19px] ${glyphMotion} ${\n isMenuOpen ? \"scale-100 rotate-0 opacity-100\" : \"scale-50 rotate-90 opacity-0\"\n }`}\n />\n </span>\n );\n } else {\n glyph = (\n <span aria-hidden=\"true\" className=\"flex size-5 items-center justify-center [&>svg]:size-5\">\n {item.icon}\n </span>\n );\n }\n\n return (\n <button\n key={item.id}\n type=\"button\"\n data-pill-target={isPillTarget ? \"true\" : undefined}\n onClick={(event) => handleSlotClick(item, event)}\n aria-haspopup={hasSubmenu ? \"menu\" : undefined}\n aria-controls={hasSubmenu && isMenuMounted ? submenuId : undefined}\n aria-expanded={hasSubmenu ? isMenuOpen : undefined}\n aria-current={isTabActive ? \"page\" : undefined}\n className=\"group/slot relative flex min-w-0 flex-1 cursor-pointer select-none flex-col items-center gap-[5px] pt-2.5 outline-none [-webkit-tap-highlight-color:transparent]\"\n >\n <span\n data-anchor=\"true\"\n className={`relative flex items-center justify-center rounded-full transition-[background-color,color] duration-200 group-focus-visible/slot:ring-2 group-focus-visible/slot:ring-[var(--rtw-accent,#6366f1)]/60 motion-reduce:transition-none ${wellShape} ${wellTone}`}\n >\n <span className=\"flex items-center justify-center transition-transform duration-150 group-active/slot:scale-90 motion-reduce:transition-none\">\n {glyph}\n </span>\n {item.badge !== undefined && item.badge !== 0 && !isMenuOpen && (\n <span className=\"absolute left-1/2 top-0 ml-1 min-w-4 -translate-y-0.5 rounded-full bg-[var(--rtw-accent,#6366f1)] px-1 text-center text-[9px] font-semibold leading-4 text-[var(--rtw-accent-foreground,#ffffff)]\">\n {item.badge}\n </span>\n )}\n </span>\n <span\n className={`max-w-full truncate text-[10px] font-medium leading-[10px] transition-colors duration-200 motion-reduce:transition-none ${labelTone}`}\n >\n {item.renderLabel ? item.renderLabel() : item.label}\n </span>\n </button>\n );\n }\n\n return (\n <>\n {mountedMenuId && (\n <div\n aria-hidden=\"true\"\n onClick={() => closeMenu()}\n className={`fixed inset-0 bg-[var(--rtw-scrim,rgba(15,23,42,0.18))] transition-opacity motion-reduce:transition-none lg:hidden ${zIndexClassName} ${\n isOpen ? \"pointer-events-auto duration-200 opacity-100\" : \"pointer-events-none duration-120 opacity-0\"\n }`}\n />\n )}\n\n <nav\n ref={navRef}\n aria-label={ariaLabel}\n style={{ height: `calc(${NAV_HEIGHT_PX}px + env(safe-area-inset-bottom))` }}\n className={`fixed inset-x-0 bottom-0 flex items-stretch border-t border-[var(--rtw-border,#dfe5ef)] bg-[var(--rtw-surface,#ffffff)]/90 pb-[env(safe-area-inset-bottom)] backdrop-blur-xl lg:hidden ${zIndexClassName}`}\n >\n {/* Sliding top indicator line taking full width of the active tab */}\n <span\n aria-hidden=\"true\"\n style={{\n transform: `translateX(${pill.x}px)`,\n opacity: pill.visible ? 1 : 0,\n top: 0,\n width: pill.width,\n }}\n className={`pointer-events-none absolute left-0 z-10 h-[2.5px] rounded-b-full bg-[var(--rtw-accent,#6366f1)] motion-reduce:transition-none ${\n pill.instant\n ? \"transition-opacity duration-200\"\n : `transition-[transform,width,opacity] duration-[320ms] ${EASE_OUT}`\n }`}\n />\n\n {/* Submenu: one fluid shape (pill + fillets + knob), morphed from the trigger */}\n {geometry && (\n <>\n <svg\n aria-hidden=\"true\"\n width={navWidth}\n height={panel.svgHeight}\n viewBox={`0 0 ${navWidth} ${panel.svgHeight}`}\n style={{ top: panel.top }}\n className=\"pointer-events-none absolute left-0 z-[1] overflow-visible drop-shadow-[0_8px_20px_rgba(15,23,42,0.2)]\"\n >\n <path ref={pathRef} fill=\"var(--rtw-accent, #6366f1)\" />\n </svg>\n\n <div\n id={submenuId}\n ref={panelRef}\n role=\"menu\"\n aria-label={`${menuItem?.label ?? \"\"} options`}\n aria-hidden={!isOpen}\n onKeyDown={handleMenuKeyDown}\n style={{\n top: panel.top,\n left: panel.left,\n width: panel.width,\n height: panel.height,\n padding: `${PANEL_PAD_Y_PX}px ${PANEL_PAD_X_PX}px`,\n gap: ITEM_GAP_PX,\n gridTemplateColumns: `repeat(${gridCols}, minmax(0, 1fr))`,\n }}\n className={`absolute z-20 grid items-center transition-[left,width,top,height] duration-[220ms] ${EASE_OUT} motion-reduce:transition-none ${\n isOpen ? \"pointer-events-auto\" : \"pointer-events-none\"\n }`}\n >\n {subItems.map((sub, index) => (\n <button\n key={sub.id}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={isOpen ? 0 : -1}\n onClick={() => {\n closeMenu(true);\n sub.onSelect();\n }}\n className={`flex h-12 min-w-0 cursor-pointer items-center justify-center rounded-2xl px-1 text-[var(--rtw-accent-foreground,#ffffff)] outline-none transition-[background-color,transform] duration-150 [-webkit-tap-highlight-color:transparent] active:scale-95 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--rtw-accent-foreground,#ffffff)]/70 motion-reduce:transition-none ${\n sub.active\n ? \"bg-[var(--rtw-accent-foreground,#ffffff)]/18\"\n : \"hover:bg-[var(--rtw-accent-foreground,#ffffff)]/10\"\n }`}\n >\n <span\n style={{\n transitionDelay: isOpen ? `${65 + index * 22}ms` : \"0ms\",\n transitionDuration: isOpen ? \"200ms\" : \"50ms\",\n }}\n className={`flex min-w-0 flex-col items-center gap-1 transition-[opacity,transform] ${EASE_OUT} motion-reduce:transition-none ${\n isOpen ? \"translate-y-0 opacity-100\" : \"translate-y-2 opacity-0\"\n }`}\n >\n <span aria-hidden=\"true\" className=\"flex size-5 items-center justify-center [&>svg]:size-5\">\n {sub.icon}\n </span>\n <span className=\"max-w-full truncate text-[10px] font-medium leading-[10px]\">\n {sub.label}\n </span>\n </span>\n </button>\n ))}\n </div>\n </>\n )}\n\n <div className=\"relative z-10 flex min-w-0 flex-1 items-stretch\">{slots.map(renderSlot)}</div>\n </nav>\n </>\n );\n}"],"mappings":";;;;;;AA4CA,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AACtB,MAAM,YAAY;AAGlB,MAAM,iBAAiB;AACvB,MAAM,oBAAoB;AAC1B,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AACtB,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AACvB,MAAM,cAAc;AAEpB,MAAM,WAAW;AAIjB,MAAM,SAAS,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,KAAK,IAAI,KAAK,GAAG,CAAC;AACnD,MAAM,WAAW,UAAkB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC;AACjE,MAAM,QAAQ,GAAW,GAAW,MAAc,KAAK,IAAI,KAAK;AAChE,MAAM,aAAa,UAAkB,KAAK,MAAM,QAAQ,CAAC,IAAI;AAC7D,MAAM,KAAK,UAAkB,KAAK,MAAM,QAAQ,GAAG,IAAI;;;;;;;AAmBvD,SAAS,eAAe,GAAiB,MAAsB;CAC7D,MAAM,IAAI,KAAK,IAAI,GAAG,IAAI;CAC1B,MAAM,KAAK,KAAK,IAAI,GAAG,IAAI,IAAI;CAC/B,MAAM,EAAE,IAAI,IAAI,IAAI,UAAU;CAE9B,MAAM,IAAI,KAAK,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AAqB,UAAU,SAAS;IAC1C;IACA,WAAW,uFAAuF,SAAS,iCACzG,SAAS,wBAAwB;IAGlC,UAAA,SAAS,KAAK,KAAK,UAClB,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;KAEE,MAAK;KACL,MAAK;KACL,UAAU,SAAS,IAAI;KACvB,eAAe;MACb,UAAU,IAAI;MACd,IAAI,SAAS;KACf;KACA,WAAW,kYACT,IAAI,SACA,iDACA;KAGN,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;MACE,OAAO;OACL,iBAAiB,SAAS,GAAG,KAAK,QAAQ,GAAG,MAAM;OACnD,oBAAoB,SAAS,UAAU;MACzC;MACA,WAAW,2EAA2E,SAAS,iCAC7F,SAAS,8BAA8B;MAN3C,UAAA,CASE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;OAAM,eAAY;OAAO,WAAU;OAChC,UAAA,IAAI;MACD,CAAA,GACN,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;OAAM,WAAU;OACb,UAAA,IAAI;MACD,CAAA,CACF;;IACA,GA9BD,IAAI,EA8BH,CACT;GACE,CAAA,CACL,EAAA,CAAA;GAGJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAU;IAAmD,UAAA,MAAM,IAAI,UAAU;GAAO,CAAA;EAC1F;CACL,CAAA,CAAA,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type MobileBottomBarSubItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
onSelect: () => void;
|
|
9
|
+
};
|
|
10
|
+
type MobileBottomBarItem<T extends string = string> = {
|
|
11
|
+
id: T;
|
|
12
|
+
label: string;
|
|
13
|
+
renderLabel?: () => ReactNode;
|
|
14
|
+
icon: ReactNode;
|
|
15
|
+
variant?: "tab" | "action" | "submenu" | "accent";
|
|
16
|
+
active?: boolean;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
badge?: number | string;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
subItems?: MobileBottomBarSubItem[];
|
|
21
|
+
};
|
|
22
|
+
type MobileBottomBarProps<T extends string = string> = {
|
|
23
|
+
items: MobileBottomBarItem<T>[];
|
|
24
|
+
activeId?: T | null;
|
|
25
|
+
onSelect?: (id: T) => void;
|
|
26
|
+
ariaLabel?: string;
|
|
27
|
+
zIndexClassName?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Mobile bottom navigation.
|
|
31
|
+
*
|
|
32
|
+
* - A soft pill glides behind the active tab.
|
|
33
|
+
* - A submenu pops out of whichever slot opens it: the trigger becomes a circular
|
|
34
|
+
* knob, and the submenu is one fluid shape fused to it with smooth concave
|
|
35
|
+
* curves, in the same colour. The shape is morphed on a spring, so it truly
|
|
36
|
+
* stretches up out of the button instead of just scaling in.
|
|
37
|
+
* - `action` slots get a quiet filled well, `accent` is a circular accent button.
|
|
38
|
+
* Everything stays inside the bar.
|
|
39
|
+
* - Colours come from `--rtw-*` CSS variables so the host theme stays in control.
|
|
40
|
+
*/
|
|
41
|
+
export declare function MobileBottomBar<T extends string = string>({ items, activeId, onSelect, ariaLabel, zIndexClassName }: MobileBottomBarProps<T>): import("react").JSX.Element;
|
|
42
|
+
export type { MobileBottomBarItem, MobileBottomBarProps, MobileBottomBarSubItem };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type MobileBottomBarSubItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
onSelect: () => void;
|
|
9
|
+
};
|
|
10
|
+
type MobileBottomBarItem<T extends string = string> = {
|
|
11
|
+
id: T;
|
|
12
|
+
label: string;
|
|
13
|
+
renderLabel?: () => ReactNode;
|
|
14
|
+
icon: ReactNode;
|
|
15
|
+
variant?: "tab" | "action" | "submenu" | "accent";
|
|
16
|
+
active?: boolean;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
badge?: number | string;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
subItems?: MobileBottomBarSubItem[];
|
|
21
|
+
};
|
|
22
|
+
type MobileBottomBarProps<T extends string = string> = {
|
|
23
|
+
items: MobileBottomBarItem<T>[];
|
|
24
|
+
activeId?: T | null;
|
|
25
|
+
onSelect?: (id: T) => void;
|
|
26
|
+
ariaLabel?: string;
|
|
27
|
+
zIndexClassName?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Mobile bottom navigation.
|
|
31
|
+
*
|
|
32
|
+
* - A soft pill glides behind the active tab.
|
|
33
|
+
* - A submenu pops out of whichever slot opens it: the trigger becomes a circular
|
|
34
|
+
* knob, and the submenu is one fluid shape fused to it with smooth concave
|
|
35
|
+
* curves, in the same colour. The shape is morphed on a spring, so it truly
|
|
36
|
+
* stretches up out of the button instead of just scaling in.
|
|
37
|
+
* - `action` slots get a quiet filled well, `accent` is a circular accent button.
|
|
38
|
+
* Everything stays inside the bar.
|
|
39
|
+
* - Colours come from `--rtw-*` CSS variables so the host theme stays in control.
|
|
40
|
+
*/
|
|
41
|
+
export declare function MobileBottomBar<T extends string = string>({ items, activeId, onSelect, ariaLabel, zIndexClassName }: MobileBottomBarProps<T>): import("react").JSX.Element;
|
|
42
|
+
export type { MobileBottomBarItem, MobileBottomBarProps, MobileBottomBarSubItem };
|