@particle-academy/react-fancy 6.6.0 → 6.7.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/README.md +1 -0
  3. package/dist/{chunk-L5AI4MGV.cjs → chunk-25HRO7HQ.cjs} +4 -4
  4. package/dist/{chunk-L5AI4MGV.cjs.map → chunk-25HRO7HQ.cjs.map} +1 -1
  5. package/dist/{chunk-MF2DCMOA.cjs → chunk-2TLAZ5MX.cjs} +7 -5
  6. package/dist/chunk-2TLAZ5MX.cjs.map +1 -0
  7. package/dist/{chunk-ARNFT23K.js → chunk-5IXOQGPX.js} +7 -5
  8. package/dist/chunk-5IXOQGPX.js.map +1 -0
  9. package/dist/chunk-5WMVBFBD.js +3 -0
  10. package/dist/{chunk-VXHFR5MV.js.map → chunk-5WMVBFBD.js.map} +1 -1
  11. package/dist/chunk-75PB3IMT.js +139 -0
  12. package/dist/chunk-75PB3IMT.js.map +1 -0
  13. package/dist/chunk-7STOB5MB.cjs +4 -0
  14. package/dist/{chunk-O5IO7TCO.cjs.map → chunk-7STOB5MB.cjs.map} +1 -1
  15. package/dist/chunk-GHTHPDKY.cjs +141 -0
  16. package/dist/chunk-GHTHPDKY.cjs.map +1 -0
  17. package/dist/{chunk-JEHV7PYP.js → chunk-SCGTO3PX.js} +21 -5
  18. package/dist/chunk-SCGTO3PX.js.map +1 -0
  19. package/dist/{chunk-AGO4AA3K.cjs → chunk-XHUV3VSM.cjs} +21 -5
  20. package/dist/chunk-XHUV3VSM.cjs.map +1 -0
  21. package/dist/{chunk-LYG2NLSV.js → chunk-ZPBKRJMH.js} +3 -3
  22. package/dist/{chunk-LYG2NLSV.js.map → chunk-ZPBKRJMH.js.map} +1 -1
  23. package/dist/file-upload.cjs +3 -3
  24. package/dist/file-upload.d.cts +17 -2
  25. package/dist/file-upload.d.ts +17 -2
  26. package/dist/file-upload.js +1 -1
  27. package/dist/index.cjs +14 -9
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +2 -1
  30. package/dist/index.d.ts +2 -1
  31. package/dist/index.js +5 -4
  32. package/dist/index.js.map +1 -1
  33. package/dist/inputs.cjs +6 -1
  34. package/dist/inputs.d.cts +1 -0
  35. package/dist/inputs.d.ts +1 -0
  36. package/dist/inputs.js +2 -1
  37. package/dist/number-field.cjs +30 -0
  38. package/dist/number-field.cjs.map +1 -0
  39. package/dist/number-field.d.cts +48 -0
  40. package/dist/number-field.d.ts +48 -0
  41. package/dist/number-field.js +21 -0
  42. package/dist/number-field.js.map +1 -0
  43. package/dist/tree-nav.cjs +4 -4
  44. package/dist/tree-nav.js +2 -2
  45. package/dist/virtual-list.cjs +2 -2
  46. package/dist/virtual-list.js +1 -1
  47. package/docs/FileUpload.md +32 -2
  48. package/docs/Input.md +2 -0
  49. package/docs/NumberField.md +85 -0
  50. package/package.json +11 -1
  51. package/dist/chunk-AGO4AA3K.cjs.map +0 -1
  52. package/dist/chunk-ARNFT23K.js.map +0 -1
  53. package/dist/chunk-JEHV7PYP.js.map +0 -1
  54. package/dist/chunk-MF2DCMOA.cjs.map +0 -1
  55. package/dist/chunk-O5IO7TCO.cjs +0 -4
  56. package/dist/chunk-VXHFR5MV.js +0 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TreeNav/TreeNav.context.ts","../src/components/TreeNav/tree-store.ts","../src/components/TreeNav/TreeNode.tsx","../src/components/TreeNav/TreeNav.tsx"],"names":["createContext","useContext","useRef","useCallback","jsx"],"mappings":";;;;;AAGO,IAAM,cAAA,GAAiB,cAA0C,IAAI,CAAA;AAErE,SAAS,UAAA,GAAkC;AAChD,EAAA,MAAM,GAAA,GAAM,WAAW,cAAc,CAAA;AACrC,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,MAAM,sDAAsD,CAAA;AAAA,EACxE;AACA,EAAA,OAAO,GAAA;AACT;ACKO,SAAS,gBAAgB,OA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AEjC,EAAA,uBACEC,GAAAA,CAAC,cAAA,CAAe,QAAA,EAAf,EAAwB,KAAA,EAAO,GAAA,EAC9B,QAAA,kBAAAA,GAAAA,CAAC,oBAAA,CAAqB,QAAA,EAArB,EAA8B,KAAA,EAAO,WACpC,QAAA,kBAAAA,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,2BAAA,EAA0B,EAAA;AAAA,MAC1B,mCAAA,EAAmC,aAAa,EAAA,GAAK,MAAA;AAAA,MACrD,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC7D,SAAA,EAAW,cAAc,aAAA,GAAgB,MAAA;AAAA,MAExC,uCACCA,GAAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,IAAA;AAAA,UACP,MAAA;AAAA,UACA,iBAAA,EAAmB,SAAA;AAAA,UACnB,SAAA,EAAW,CAAC,GAAA,qBAAQA,GAAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,GAAA,CAAI,IAAA,EAAM,KAAA,EAAO,GAAA,CAAI,KAAA,EAAO;AAAA;AAAA,OAClE,GAEA,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,qBAASA,GAAAA,CAAC,QAAA,EAAA,EAAuB,IAAA,EAAY,KAAA,EAAO,CAAA,EAAA,EAA5B,IAAA,CAAK,EAA0B,CAAE;AAAA;AAAA,KAG1E,CAAA,EACF,CAAA;AAEJ;AAEA,WAAA,CAAY,WAAA,GAAc,SAAA;AAEnB,IAAM,OAAA,GAAU,MAAA,CAAO,MAAA,CAAO,WAAA,EAAa;AAAA,EAChD,IAAA,EAAM;AACR,CAAC","file":"chunk-LYG2NLSV.js","sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { TreeNavContextValue } from \"./TreeNav.types\";\n\nexport const TreeNavContext = createContext<TreeNavContextValue | null>(null);\n\nexport function useTreeNav(): TreeNavContextValue {\n const ctx = useContext(TreeNavContext);\n if (!ctx) {\n throw new Error(\"useTreeNav must be used within a <TreeNav> component\");\n }\n return ctx;\n}\n","import { createContext, useContext, useSyncExternalStore } from \"react\";\nimport type { DragState, DropPosition, TreeNodeData } from \"./TreeNav.types\";\n\n/** What changes as someone clicks, toggles and drags — the state rows subscribe to. */\nexport interface TreeState {\n selectedId?: string;\n expanded: ReadonlySet<string>;\n dragState: DragState;\n}\n\nexport interface TreeStore {\n get(): TreeState;\n set(next: TreeState): void;\n subscribe(listener: () => void): () => void;\n}\n\nexport function createTreeStore(initial: TreeState): TreeStore {\n let state = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => state,\n set(next) {\n state = next;\n for (const listener of listeners) listener();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\n/**\n * Everything a row needs that does NOT change on a click. Handlers are stable\n * (they read the latest props and state when called), so this value only changes\n * when the tree's data or configuration does.\n *\n * Kept apart from the public `TreeNavContext` on purpose: that one still carries\n * live `selectedId` / `expandedIds` for `useTreeNav()` callers, and any component\n * reading it re-renders on every click. Rows no longer read it — which is the\n * whole fix: a click used to re-render every row in the tree.\n */\nexport interface TreeInternals {\n store: TreeStore;\n nodes: TreeNodeData[];\n select: (node: TreeNodeData) => void;\n toggle: (id: string) => void;\n expandNode: (id: string) => void;\n setDragState: (state: DragState) => void;\n contextMenu?: (e: React.MouseEvent, node: TreeNodeData) => void;\n moveNode?: (sourceId: string, targetId: string, position: DropPosition) => void;\n externalDrop?: (event: React.DragEvent, target: TreeNodeData, position: DropPosition) => void;\n indentSize: number;\n showIcons: boolean;\n draggable: boolean;\n dragCursor: \"grab\" | \"none\";\n acceptExternalDrops: boolean;\n /** Rows are rendered flat by a virtual list, so a row never renders its children. */\n flat: boolean;\n}\n\nexport const TreeInternalsContext = createContext<TreeInternals | null>(null);\n\nexport function useTreeInternals(): TreeInternals {\n const internals = useContext(TreeInternalsContext);\n if (!internals) throw new Error(\"TreeNav.Node must be used within a <TreeNav> component\");\n return internals;\n}\n\n/** Subscribe to ONE derived value; the row re-renders only when that value changes. */\nexport function useTreeSlice<T>(select: (state: TreeState) => T): T {\n const { store } = useTreeInternals();\n return useSyncExternalStore(\n store.subscribe,\n () => select(store.get()),\n () => select(store.get()),\n );\n}\n","import { memo, useRef, useEffect, useCallback } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useTreeInternals, useTreeSlice } from \"./tree-store\";\nimport type { TreeNodeProps, TreeNodeData, DropPosition } from \"./TreeNav.types\";\n\nconst EXT_COLORS: Record<string, string> = {\n ts: \"#3178c6\",\n tsx: \"#3178c6\",\n js: \"#f7df1e\",\n jsx: \"#f7df1e\",\n php: \"#777bb4\",\n html: \"#e34c26\",\n htm: \"#e34c26\",\n css: \"#264de4\",\n json: \"#a1a1aa\",\n md: \"#71717a\",\n yaml: \"#cb171e\",\n yml: \"#cb171e\",\n};\n\nfunction FileIcon({ ext }: { ext?: string }) {\n const color = (ext && EXT_COLORS[ext.toLowerCase()]) || \"#71717a\";\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className=\"shrink-0\">\n <path d=\"M4 1h5.5L13 4.5V14a1 1 0 01-1 1H4a1 1 0 01-1-1V2a1 1 0 011-1z\" stroke={color} strokeWidth=\"1.2\" />\n <path d=\"M9 1v4h4\" stroke={color} strokeWidth=\"1.2\" />\n </svg>\n );\n}\n\nfunction FolderIcon({ open }: { open: boolean }) {\n if (open) {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className=\"shrink-0\">\n <path d=\"M1.5 3.5a1 1 0 011-1h3l1.5 1.5H13a1 1 0 011 1V5H2.5V3.5z\" fill=\"#fbbf24\" />\n <path d=\"M1 6h13l-1.5 7.5H2.5L1 6z\" fill=\"#fbbf24\" opacity=\"0.7\" />\n </svg>\n );\n }\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className=\"shrink-0\">\n <path d=\"M1.5 3a1 1 0 011-1h3l1.5 1.5H13a1 1 0 011 1v8a1 1 0 01-1 1H2.5a1 1 0 01-1-1V3z\" fill=\"#fbbf24\" />\n </svg>\n );\n}\n\nfunction ChevronIcon({ open }: { open: boolean }) {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\"shrink-0 transition-transform duration-150\", open && \"rotate-90\")}\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Utilities\n// ---------------------------------------------------------------------------\n\nfunction isDescendantOf(\n nodes: TreeNodeData[],\n ancestorId: string,\n targetId: string,\n): boolean {\n function findNode(haystack: TreeNodeData[], id: string): TreeNodeData | undefined {\n for (const n of haystack) {\n if (n.id === id) return n;\n if (n.children) {\n const found = findNode(n.children, id);\n if (found) return found;\n }\n }\n return undefined;\n }\n\n function hasDescendant(node: TreeNodeData, id: string): boolean {\n if (!node.children) return false;\n for (const child of node.children) {\n if (child.id === id) return true;\n if (hasDescendant(child, id)) return true;\n }\n return false;\n }\n\n const ancestor = findNode(nodes, ancestorId);\n return ancestor ? hasDescendant(ancestor, targetId) : false;\n}\n\nfunction computeDropPosition(\n e: React.DragEvent,\n isFolder: boolean,\n): DropPosition {\n const rect = e.currentTarget.getBoundingClientRect();\n const offsetY = e.clientY - rect.top;\n const third = rect.height / 3;\n\n if (offsetY < third) return \"before\";\n if (offsetY > third * 2) return \"after\";\n return isFolder ? \"inside\" : \"after\";\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n\n/**\n * One row (and, when nested, its expanded children).\n *\n * Reads what changes on a click — selection, expansion, drag — as per-row slices\n * of a store, so a click re-renders only the rows whose slice changed. It used to\n * read one context holding all of it, so every click re-rendered every row:\n * 175-267 ms per click on a 5,000-node tree. `memo` keeps a parent's re-render\n * from reaching rows whose `node` and `depth` did not change.\n */\nfunction TreeNodeImpl({ node, depth }: TreeNodeProps) {\n const {\n store, nodes, select, toggle, expandNode, setDragState, contextMenu, moveNode, externalDrop,\n indentSize, showIcons, draggable, dragCursor, acceptExternalDrops, flat,\n } = useTreeInternals();\n\n const isFolder = node.type === \"folder\" || (node.children && node.children.length > 0);\n const isExpanded = useTreeSlice((s) => s.expanded.has(node.id));\n const isSelected = useTreeSlice((s) => s.selectedId === node.id);\n const isDragging = useTreeSlice((s) => s.dragState.draggedNodeId === node.id);\n const dropPosition = useTreeSlice((s) =>\n s.dragState.dropTargetId === node.id ? s.dragState.dropPosition : null,\n );\n const isDropTarget = dropPosition !== null;\n const paddingLeft = depth * indentSize + 4;\n\n // Auto-expand timer for folders during drag\n const autoExpandTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearAutoExpand = useCallback(() => {\n if (autoExpandTimer.current) {\n clearTimeout(autoExpandTimer.current);\n autoExpandTimer.current = null;\n }\n }, []);\n\n useEffect(() => clearAutoExpand, [clearAutoExpand]);\n\n // ---------------------------------------------------------------------------\n // Click handlers\n // ---------------------------------------------------------------------------\n\n const handleClick = () => {\n if (node.disabled) return;\n if (isFolder) {\n toggle(node.id);\n }\n select(node);\n };\n\n const handleContextMenu = (e: React.MouseEvent) => {\n if (contextMenu) {\n e.preventDefault();\n contextMenu(e, node);\n }\n };\n\n // ---------------------------------------------------------------------------\n // Drag source handlers\n // ---------------------------------------------------------------------------\n\n const handleDragStart = useCallback((e: React.DragEvent) => {\n e.dataTransfer.setData(\"text/plain\", node.id);\n e.dataTransfer.effectAllowed = \"move\";\n // Set state async so the browser captures the element for the drag ghost first\n requestAnimationFrame(() => {\n setDragState({ draggedNodeId: node.id, dropTargetId: null, dropPosition: null });\n });\n }, [node.id, setDragState]);\n\n const handleDragEnd = useCallback(() => {\n clearAutoExpand();\n setDragState({ draggedNodeId: null, dropTargetId: null, dropPosition: null });\n }, [clearAutoExpand, setDragState]);\n\n // ---------------------------------------------------------------------------\n // Drop target handlers (on outer div). Drag state is read from the store when\n // the event fires, so a row does not re-render as a drag moves elsewhere.\n // ---------------------------------------------------------------------------\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n const { dragState } = store.get();\n const isExternalDrag = !dragState.draggedNodeId;\n if (isExternalDrag) {\n // External drop accepted only when host opted in.\n if (!acceptExternalDrops) return;\n } else {\n const sourceId = dragState.draggedNodeId!;\n if (sourceId === node.id) return;\n if (isDescendantOf(nodes, sourceId, node.id)) return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = isExternalDrag ? \"copy\" : \"move\";\n\n const position = computeDropPosition(e, !!isFolder);\n\n // Auto-expand collapsed folders when hovering \"inside\"\n if (isFolder && !store.get().expanded.has(node.id) && position === \"inside\") {\n if (!autoExpandTimer.current) {\n autoExpandTimer.current = setTimeout(() => {\n expandNode(node.id);\n autoExpandTimer.current = null;\n }, 500);\n }\n } else {\n clearAutoExpand();\n }\n\n if (dragState.dropTargetId !== node.id || dragState.dropPosition !== position) {\n setDragState({ draggedNodeId: dragState.draggedNodeId, dropTargetId: node.id, dropPosition: position });\n }\n }, [store, acceptExternalDrops, node.id, isFolder, nodes, setDragState, expandNode, clearAutoExpand]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node)) {\n clearAutoExpand();\n const { dragState } = store.get();\n if (dragState.dropTargetId === node.id) {\n setDragState({ ...dragState, dropTargetId: null, dropPosition: null });\n }\n }\n }, [store, node.id, setDragState, clearAutoExpand]);\n\n const handleDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n clearAutoExpand();\n\n const { dragState } = store.get();\n const sourceId = dragState.draggedNodeId;\n const position = dragState.dropPosition ?? computeDropPosition(e, !!isFolder);\n\n if (sourceId) {\n // Internal node move.\n if (sourceId === node.id) return;\n if (isDescendantOf(nodes, sourceId, node.id)) return;\n moveNode?.(sourceId, node.id, position);\n } else if (acceptExternalDrops) {\n // External drop — files, items from other components, etc.\n externalDrop?.(e, node, position);\n }\n\n setDragState({ draggedNodeId: null, dropTargetId: null, dropPosition: null });\n }, [store, node, isFolder, nodes, moveNode, acceptExternalDrops, externalDrop, setDragState, clearAutoExpand]);\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n\n const canDrag = draggable && !node.disabled;\n const dropEnabled = draggable || acceptExternalDrops;\n\n return (\n <div\n data-react-fancy-tree-node=\"\"\n onDragOver={dropEnabled ? handleDragOver : undefined}\n onDragLeave={dropEnabled ? handleDragLeave : undefined}\n onDrop={dropEnabled ? handleDrop : undefined}\n >\n {/* Before drop indicator */}\n {isDropTarget && dropPosition === \"before\" && (\n <div\n data-react-fancy-tree-drop-indicator=\"before\"\n className=\"pointer-events-none h-0.5 rounded-full bg-blue-500\"\n style={{ marginLeft: paddingLeft }}\n />\n )}\n\n <button\n type=\"button\"\n draggable={canDrag}\n onDragStart={canDrag ? handleDragStart : undefined}\n onDragEnd={canDrag ? handleDragEnd : undefined}\n onClick={handleClick}\n onContextMenu={handleContextMenu}\n disabled={node.disabled}\n className={cn(\n \"flex w-full items-center gap-1 rounded-md py-0.5 text-left text-[13px] transition-colors\",\n isSelected\n ? \"bg-blue-500/15 text-blue-600 dark:text-blue-400\"\n : \"text-[color:var(--fancy-text-soft,var(--color-zinc-700))] hover:bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] dark:text-[color:var(--fancy-text-soft-dark,var(--color-zinc-300))] dark:hover:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))]\",\n node.disabled && \"pointer-events-none opacity-40\",\n isDragging && \"opacity-50\",\n // Grab affordance. By default (`dragCursor=\"none\"`) the row keeps its\n // normal click cursor on hover — no open-hand \"move me\" cursor before\n // any drag — and only shows the closed-hand `grabbing` cursor while a\n // drag is actually underway (mousedown/drag). `dragCursor=\"grab\"` opts\n // back into the always-on grab cursor for whole-row drag handles (#14).\n canDrag &&\n (dragCursor === \"grab\" ? \"cursor-grab active:cursor-grabbing\" : \"active:cursor-grabbing\"),\n isDropTarget && dropPosition === \"inside\" && \"bg-blue-500/10 ring-1 ring-blue-500/30 ring-inset\",\n )}\n style={{ paddingLeft }}\n >\n {isFolder && <ChevronIcon open={isExpanded} />}\n {!isFolder && <span className=\"w-3.5 shrink-0\" />}\n {showIcons && (\n node.icon ?? (isFolder\n ? <FolderIcon open={isExpanded} />\n : <FileIcon ext={node.ext ?? node.label.split(\".\").pop()} />)\n )}\n <span className=\"truncate\">{node.label}</span>\n </button>\n\n {/* After drop indicator */}\n {isDropTarget && dropPosition === \"after\" && (\n <div\n data-react-fancy-tree-drop-indicator=\"after\"\n className=\"pointer-events-none h-0.5 rounded-full bg-blue-500\"\n style={{ marginLeft: paddingLeft }}\n />\n )}\n\n {/* A virtual list renders rows flat, so a row never renders its own children there. */}\n {!flat && isFolder && isExpanded && node.children && (\n <div data-react-fancy-tree-node-children=\"\">\n {node.children.map((child) => (\n <TreeNode key={child.id} node={child} depth={depth + 1} />\n ))}\n </div>\n )}\n </div>\n );\n}\n\nexport const TreeNode = memo(TreeNodeImpl);\n\nTreeNode.displayName = \"TreeNode\";\n","import { useMemo, useCallback, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { VirtualList } from \"../VirtualList\";\nimport { TreeNavContext } from \"./TreeNav.context\";\nimport { TreeNode } from \"./TreeNode\";\nimport { createTreeStore, TreeInternalsContext, type TreeInternals } from \"./tree-store\";\nimport type { TreeNavProps, TreeNodeData, DragState } from \"./TreeNav.types\";\n\nfunction collectFolderIds(nodes: TreeNodeData[]): string[] {\n const ids: string[] = [];\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n ids.push(node.id);\n ids.push(...collectFolderIds(node.children));\n }\n }\n return ids;\n}\n\nconst EMPTY_DRAG_STATE: DragState = {\n draggedNodeId: null,\n dropTargetId: null,\n dropPosition: null,\n};\n\ninterface FlatRow {\n id: string;\n node: TreeNodeData;\n depth: number;\n}\n\n/** The rows currently visible — every node, descending only into expanded folders. */\nfunction flattenVisible(nodes: TreeNodeData[], expanded: ReadonlySet<string>): FlatRow[] {\n const rows: FlatRow[] = [];\n const walk = (list: TreeNodeData[], depth: number) => {\n for (const node of list) {\n rows.push({ id: node.id, node, depth });\n const isFolder = node.type === \"folder\" || (node.children && node.children.length > 0);\n if (isFolder && node.children && expanded.has(node.id)) walk(node.children, depth + 1);\n }\n };\n walk(nodes, 0);\n return rows;\n}\n\nfunction TreeNavRoot({\n nodes,\n selectedId,\n onSelect,\n onNodeContextMenu,\n draggable = false,\n onNodeMove,\n acceptExternalDrops = false,\n onExternalDrop,\n expandedIds: controlledExpanded,\n defaultExpandedIds,\n onExpandedChange,\n defaultExpandAll = false,\n indentSize = 16,\n showIcons = true,\n dragCursor = \"none\",\n virtualize = false,\n height = 400,\n rowHeight = 26,\n className,\n}: TreeNavProps) {\n const [internalExpanded, setInternalExpanded] = useState<string[]>(() => {\n if (defaultExpandedIds) return defaultExpandedIds;\n if (defaultExpandAll) return collectFolderIds(nodes);\n return [];\n });\n\n const isControlled = controlledExpanded !== undefined;\n const expandedIds = isControlled ? controlledExpanded : internalExpanded;\n // One Set per change, so a row's \"am I expanded?\" is a lookup, not a scan.\n const expanded = useMemo(() => new Set(expandedIds), [expandedIds]);\n\n const [dragState, setDragState] = useState<DragState>(EMPTY_DRAG_STATE);\n\n /*\n * The latest props and state, for handlers that must stay STABLE. A handler\n * whose identity changes on every click would change the context rows read,\n * and re-render every row — the exact cost this component is avoiding.\n */\n const latest = useRef({ expandedIds, isControlled, onExpandedChange, onSelect, onNodeContextMenu, onNodeMove, onExternalDrop });\n latest.current = { expandedIds, isControlled, onExpandedChange, onSelect, onNodeContextMenu, onNodeMove, onExternalDrop };\n\n const setExpanded = useCallback((next: string[]) => {\n if (!latest.current.isControlled) setInternalExpanded(next);\n latest.current.onExpandedChange?.(next);\n }, []);\n\n const toggle = useCallback(\n (id: string) => {\n const current = latest.current.expandedIds;\n setExpanded(current.includes(id) ? current.filter((v) => v !== id) : [...current, id]);\n },\n [setExpanded],\n );\n\n const expandNode = useCallback(\n (id: string) => {\n const current = latest.current.expandedIds;\n if (!current.includes(id)) setExpanded([...current, id]);\n },\n [setExpanded],\n );\n\n const select = useCallback((node: TreeNodeData) => latest.current.onSelect?.(node.id, node), []);\n const contextMenu = useCallback(\n (e: React.MouseEvent, node: TreeNodeData) => latest.current.onNodeContextMenu?.(e, node),\n [],\n );\n const moveNode = useCallback(\n (sourceId: string, targetId: string, position: Parameters<NonNullable<TreeNavProps[\"onNodeMove\"]>>[2]) =>\n latest.current.onNodeMove?.(sourceId, targetId, position),\n [],\n );\n const externalDrop = useCallback(\n (event: React.DragEvent, target: TreeNodeData, position: Parameters<NonNullable<TreeNavProps[\"onExternalDrop\"]>>[2]) =>\n latest.current.onExternalDrop?.(event, target, position),\n [],\n );\n\n // What rows subscribe to. Seeded with this render's values so the first paint\n // is right; kept current after each render that changes them.\n const [store] = useState(() => createTreeStore({ selectedId, expanded, dragState }));\n useLayoutEffect(() => {\n const current = store.get();\n if (current.selectedId !== selectedId || current.expanded !== expanded || current.dragState !== dragState) {\n store.set({ selectedId, expanded, dragState });\n }\n }, [store, selectedId, expanded, dragState]);\n\n const hasContextMenu = onNodeContextMenu !== undefined;\n const internals = useMemo<TreeInternals>(\n () => ({\n store,\n nodes,\n select,\n toggle,\n expandNode,\n setDragState,\n // Present only when the host gave one: a row then claims the right-click.\n contextMenu: hasContextMenu ? contextMenu : undefined,\n moveNode,\n externalDrop,\n indentSize,\n showIcons,\n draggable,\n dragCursor,\n acceptExternalDrops,\n flat: virtualize,\n }),\n [store, nodes, select, toggle, expandNode, hasContextMenu, contextMenu, moveNode, externalDrop,\n indentSize, showIcons, draggable, dragCursor, acceptExternalDrops, virtualize],\n );\n\n // Unchanged public context, still live for `useTreeNav()` callers. Rows no\n // longer read it, so its changing on a click re-renders only those callers.\n const ctx = useMemo(\n () => ({\n selectedId, onSelect, onNodeContextMenu, expandedIds, toggle, indentSize, showIcons,\n draggable, dragCursor, dragState, setDragState, onNodeMove, acceptExternalDrops, onExternalDrop, nodes, expandNode,\n }),\n [selectedId, onSelect, onNodeContextMenu, expandedIds, toggle, indentSize, showIcons,\n draggable, dragCursor, dragState, onNodeMove, acceptExternalDrops, onExternalDrop, nodes, expandNode],\n );\n\n const rows = useMemo(\n () => (virtualize ? flattenVisible(nodes, expanded) : []),\n [virtualize, nodes, expanded],\n );\n\n const handleDragEnd = useCallback(() => {\n setDragState(EMPTY_DRAG_STATE);\n }, []);\n\n const dropEnabled = draggable || acceptExternalDrops;\n\n return (\n <TreeNavContext.Provider value={ctx}>\n <TreeInternalsContext.Provider value={internals}>\n <nav\n data-react-fancy-tree-nav=\"\"\n data-react-fancy-tree-nav-virtual={virtualize ? \"\" : undefined}\n className={cn(\"flex flex-col gap-0.5 py-1 text-sm\", className)}\n onDragEnd={dropEnabled ? handleDragEnd : undefined}\n >\n {virtualize ? (\n <VirtualList\n items={rows}\n height={height}\n estimateRowHeight={rowHeight}\n renderRow={(row) => <TreeNode node={row.node} depth={row.depth} />}\n />\n ) : (\n nodes.map((node) => <TreeNode key={node.id} node={node} depth={0} />)\n )}\n </nav>\n </TreeInternalsContext.Provider>\n </TreeNavContext.Provider>\n );\n}\n\nTreeNavRoot.displayName = \"TreeNav\";\n\nexport const TreeNav = Object.assign(TreeNavRoot, {\n Node: TreeNode,\n});\n"]}
1
+ {"version":3,"sources":["../src/components/TreeNav/TreeNav.context.ts","../src/components/TreeNav/tree-store.ts","../src/components/TreeNav/TreeNode.tsx","../src/components/TreeNav/TreeNav.tsx"],"names":["createContext","useContext","useRef","useCallback","jsx"],"mappings":";;;;;AAGO,IAAM,cAAA,GAAiB,cAA0C,IAAI,CAAA;AAErE,SAAS,UAAA,GAAkC;AAChD,EAAA,MAAM,GAAA,GAAM,WAAW,cAAc,CAAA;AACrC,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAA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AA;AAAA,EAC/B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,MAAM,cAAc,SAAA,IAAa,mBAAA;AAEjC,EAAA,uBACEC,GAAAA,CAAC,cAAA,CAAe,QAAA,EAAf,EAAwB,KAAA,EAAO,GAAA,EAC9B,QAAA,kBAAAA,GAAAA,CAAC,oBAAA,CAAqB,QAAA,EAArB,EAA8B,KAAA,EAAO,WACpC,QAAA,kBAAAA,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,2BAAA,EAA0B,EAAA;AAAA,MAC1B,mCAAA,EAAmC,aAAa,EAAA,GAAK,MAAA;AAAA,MACrD,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC7D,SAAA,EAAW,cAAc,aAAA,GAAgB,MAAA;AAAA,MAExC,uCACCA,GAAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,IAAA;AAAA,UACP,MAAA;AAAA,UACA,iBAAA,EAAmB,SAAA;AAAA,UACnB,SAAA,EAAW,CAAC,GAAA,qBAAQA,GAAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,GAAA,CAAI,IAAA,EAAM,KAAA,EAAO,GAAA,CAAI,KAAA,EAAO;AAAA;AAAA,OAClE,GAEA,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,qBAASA,GAAAA,CAAC,QAAA,EAAA,EAAuB,IAAA,EAAY,KAAA,EAAO,CAAA,EAAA,EAA5B,IAAA,CAAK,EAA0B,CAAE;AAAA;AAAA,KAG1E,CAAA,EACF,CAAA;AAEJ;AAEA,WAAA,CAAY,WAAA,GAAc,SAAA;AAEnB,IAAM,OAAA,GAAU,MAAA,CAAO,MAAA,CAAO,WAAA,EAAa;AAAA,EAChD,IAAA,EAAM;AACR,CAAC","file":"chunk-ZPBKRJMH.js","sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { TreeNavContextValue } from \"./TreeNav.types\";\n\nexport const TreeNavContext = createContext<TreeNavContextValue | null>(null);\n\nexport function useTreeNav(): TreeNavContextValue {\n const ctx = useContext(TreeNavContext);\n if (!ctx) {\n throw new Error(\"useTreeNav must be used within a <TreeNav> component\");\n }\n return ctx;\n}\n","import { createContext, useContext, useSyncExternalStore } from \"react\";\nimport type { DragState, DropPosition, TreeNodeData } from \"./TreeNav.types\";\n\n/** What changes as someone clicks, toggles and drags — the state rows subscribe to. */\nexport interface TreeState {\n selectedId?: string;\n expanded: ReadonlySet<string>;\n dragState: DragState;\n}\n\nexport interface TreeStore {\n get(): TreeState;\n set(next: TreeState): void;\n subscribe(listener: () => void): () => void;\n}\n\nexport function createTreeStore(initial: TreeState): TreeStore {\n let state = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => state,\n set(next) {\n state = next;\n for (const listener of listeners) listener();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\n/**\n * Everything a row needs that does NOT change on a click. Handlers are stable\n * (they read the latest props and state when called), so this value only changes\n * when the tree's data or configuration does.\n *\n * Kept apart from the public `TreeNavContext` on purpose: that one still carries\n * live `selectedId` / `expandedIds` for `useTreeNav()` callers, and any component\n * reading it re-renders on every click. Rows no longer read it — which is the\n * whole fix: a click used to re-render every row in the tree.\n */\nexport interface TreeInternals {\n store: TreeStore;\n nodes: TreeNodeData[];\n select: (node: TreeNodeData) => void;\n toggle: (id: string) => void;\n expandNode: (id: string) => void;\n setDragState: (state: DragState) => void;\n contextMenu?: (e: React.MouseEvent, node: TreeNodeData) => void;\n moveNode?: (sourceId: string, targetId: string, position: DropPosition) => void;\n externalDrop?: (event: React.DragEvent, target: TreeNodeData, position: DropPosition) => void;\n indentSize: number;\n showIcons: boolean;\n draggable: boolean;\n dragCursor: \"grab\" | \"none\";\n acceptExternalDrops: boolean;\n /** Rows are rendered flat by a virtual list, so a row never renders its children. */\n flat: boolean;\n}\n\nexport const TreeInternalsContext = createContext<TreeInternals | null>(null);\n\nexport function useTreeInternals(): TreeInternals {\n const internals = useContext(TreeInternalsContext);\n if (!internals) throw new Error(\"TreeNav.Node must be used within a <TreeNav> component\");\n return internals;\n}\n\n/** Subscribe to ONE derived value; the row re-renders only when that value changes. */\nexport function useTreeSlice<T>(select: (state: TreeState) => T): T {\n const { store } = useTreeInternals();\n return useSyncExternalStore(\n store.subscribe,\n () => select(store.get()),\n () => select(store.get()),\n );\n}\n","import { memo, useRef, useEffect, useCallback } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useTreeInternals, useTreeSlice } from \"./tree-store\";\nimport type { TreeNodeProps, TreeNodeData, DropPosition } from \"./TreeNav.types\";\n\nconst EXT_COLORS: Record<string, string> = {\n ts: \"#3178c6\",\n tsx: \"#3178c6\",\n js: \"#f7df1e\",\n jsx: \"#f7df1e\",\n php: \"#777bb4\",\n html: \"#e34c26\",\n htm: \"#e34c26\",\n css: \"#264de4\",\n json: \"#a1a1aa\",\n md: \"#71717a\",\n yaml: \"#cb171e\",\n yml: \"#cb171e\",\n};\n\nfunction FileIcon({ ext }: { ext?: string }) {\n const color = (ext && EXT_COLORS[ext.toLowerCase()]) || \"#71717a\";\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className=\"shrink-0\">\n <path d=\"M4 1h5.5L13 4.5V14a1 1 0 01-1 1H4a1 1 0 01-1-1V2a1 1 0 011-1z\" stroke={color} strokeWidth=\"1.2\" />\n <path d=\"M9 1v4h4\" stroke={color} strokeWidth=\"1.2\" />\n </svg>\n );\n}\n\nfunction FolderIcon({ open }: { open: boolean }) {\n if (open) {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className=\"shrink-0\">\n <path d=\"M1.5 3.5a1 1 0 011-1h3l1.5 1.5H13a1 1 0 011 1V5H2.5V3.5z\" fill=\"#fbbf24\" />\n <path d=\"M1 6h13l-1.5 7.5H2.5L1 6z\" fill=\"#fbbf24\" opacity=\"0.7\" />\n </svg>\n );\n }\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className=\"shrink-0\">\n <path d=\"M1.5 3a1 1 0 011-1h3l1.5 1.5H13a1 1 0 011 1v8a1 1 0 01-1 1H2.5a1 1 0 01-1-1V3z\" fill=\"#fbbf24\" />\n </svg>\n );\n}\n\nfunction ChevronIcon({ open }: { open: boolean }) {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\"shrink-0 transition-transform duration-150\", open && \"rotate-90\")}\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Utilities\n// ---------------------------------------------------------------------------\n\nfunction isDescendantOf(\n nodes: TreeNodeData[],\n ancestorId: string,\n targetId: string,\n): boolean {\n function findNode(haystack: TreeNodeData[], id: string): TreeNodeData | undefined {\n for (const n of haystack) {\n if (n.id === id) return n;\n if (n.children) {\n const found = findNode(n.children, id);\n if (found) return found;\n }\n }\n return undefined;\n }\n\n function hasDescendant(node: TreeNodeData, id: string): boolean {\n if (!node.children) return false;\n for (const child of node.children) {\n if (child.id === id) return true;\n if (hasDescendant(child, id)) return true;\n }\n return false;\n }\n\n const ancestor = findNode(nodes, ancestorId);\n return ancestor ? hasDescendant(ancestor, targetId) : false;\n}\n\nfunction computeDropPosition(\n e: React.DragEvent,\n isFolder: boolean,\n): DropPosition {\n const rect = e.currentTarget.getBoundingClientRect();\n const offsetY = e.clientY - rect.top;\n const third = rect.height / 3;\n\n if (offsetY < third) return \"before\";\n if (offsetY > third * 2) return \"after\";\n return isFolder ? \"inside\" : \"after\";\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n\n/**\n * One row (and, when nested, its expanded children).\n *\n * Reads what changes on a click — selection, expansion, drag — as per-row slices\n * of a store, so a click re-renders only the rows whose slice changed. It used to\n * read one context holding all of it, so every click re-rendered every row:\n * 175-267 ms per click on a 5,000-node tree. `memo` keeps a parent's re-render\n * from reaching rows whose `node` and `depth` did not change.\n */\nfunction TreeNodeImpl({ node, depth }: TreeNodeProps) {\n const {\n store, nodes, select, toggle, expandNode, setDragState, contextMenu, moveNode, externalDrop,\n indentSize, showIcons, draggable, dragCursor, acceptExternalDrops, flat,\n } = useTreeInternals();\n\n const isFolder = node.type === \"folder\" || (node.children && node.children.length > 0);\n const isExpanded = useTreeSlice((s) => s.expanded.has(node.id));\n const isSelected = useTreeSlice((s) => s.selectedId === node.id);\n const isDragging = useTreeSlice((s) => s.dragState.draggedNodeId === node.id);\n const dropPosition = useTreeSlice((s) =>\n s.dragState.dropTargetId === node.id ? s.dragState.dropPosition : null,\n );\n const isDropTarget = dropPosition !== null;\n const paddingLeft = depth * indentSize + 4;\n\n // Auto-expand timer for folders during drag\n const autoExpandTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearAutoExpand = useCallback(() => {\n if (autoExpandTimer.current) {\n clearTimeout(autoExpandTimer.current);\n autoExpandTimer.current = null;\n }\n }, []);\n\n useEffect(() => clearAutoExpand, [clearAutoExpand]);\n\n // ---------------------------------------------------------------------------\n // Click handlers\n // ---------------------------------------------------------------------------\n\n const handleClick = () => {\n if (node.disabled) return;\n if (isFolder) {\n toggle(node.id);\n }\n select(node);\n };\n\n const handleContextMenu = (e: React.MouseEvent) => {\n if (contextMenu) {\n e.preventDefault();\n contextMenu(e, node);\n }\n };\n\n // ---------------------------------------------------------------------------\n // Drag source handlers\n // ---------------------------------------------------------------------------\n\n const handleDragStart = useCallback((e: React.DragEvent) => {\n e.dataTransfer.setData(\"text/plain\", node.id);\n e.dataTransfer.effectAllowed = \"move\";\n // Set state async so the browser captures the element for the drag ghost first\n requestAnimationFrame(() => {\n setDragState({ draggedNodeId: node.id, dropTargetId: null, dropPosition: null });\n });\n }, [node.id, setDragState]);\n\n const handleDragEnd = useCallback(() => {\n clearAutoExpand();\n setDragState({ draggedNodeId: null, dropTargetId: null, dropPosition: null });\n }, [clearAutoExpand, setDragState]);\n\n // ---------------------------------------------------------------------------\n // Drop target handlers (on outer div). Drag state is read from the store when\n // the event fires, so a row does not re-render as a drag moves elsewhere.\n // ---------------------------------------------------------------------------\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n const { dragState } = store.get();\n const isExternalDrag = !dragState.draggedNodeId;\n if (isExternalDrag) {\n // External drop accepted only when host opted in.\n if (!acceptExternalDrops) return;\n } else {\n const sourceId = dragState.draggedNodeId!;\n if (sourceId === node.id) return;\n if (isDescendantOf(nodes, sourceId, node.id)) return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = isExternalDrag ? \"copy\" : \"move\";\n\n const position = computeDropPosition(e, !!isFolder);\n\n // Auto-expand collapsed folders when hovering \"inside\"\n if (isFolder && !store.get().expanded.has(node.id) && position === \"inside\") {\n if (!autoExpandTimer.current) {\n autoExpandTimer.current = setTimeout(() => {\n expandNode(node.id);\n autoExpandTimer.current = null;\n }, 500);\n }\n } else {\n clearAutoExpand();\n }\n\n if (dragState.dropTargetId !== node.id || dragState.dropPosition !== position) {\n setDragState({ draggedNodeId: dragState.draggedNodeId, dropTargetId: node.id, dropPosition: position });\n }\n }, [store, acceptExternalDrops, node.id, isFolder, nodes, setDragState, expandNode, clearAutoExpand]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node)) {\n clearAutoExpand();\n const { dragState } = store.get();\n if (dragState.dropTargetId === node.id) {\n setDragState({ ...dragState, dropTargetId: null, dropPosition: null });\n }\n }\n }, [store, node.id, setDragState, clearAutoExpand]);\n\n const handleDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n clearAutoExpand();\n\n const { dragState } = store.get();\n const sourceId = dragState.draggedNodeId;\n const position = dragState.dropPosition ?? computeDropPosition(e, !!isFolder);\n\n if (sourceId) {\n // Internal node move.\n if (sourceId === node.id) return;\n if (isDescendantOf(nodes, sourceId, node.id)) return;\n moveNode?.(sourceId, node.id, position);\n } else if (acceptExternalDrops) {\n // External drop — files, items from other components, etc.\n externalDrop?.(e, node, position);\n }\n\n setDragState({ draggedNodeId: null, dropTargetId: null, dropPosition: null });\n }, [store, node, isFolder, nodes, moveNode, acceptExternalDrops, externalDrop, setDragState, clearAutoExpand]);\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n\n const canDrag = draggable && !node.disabled;\n const dropEnabled = draggable || acceptExternalDrops;\n\n return (\n <div\n data-react-fancy-tree-node=\"\"\n onDragOver={dropEnabled ? handleDragOver : undefined}\n onDragLeave={dropEnabled ? handleDragLeave : undefined}\n onDrop={dropEnabled ? handleDrop : undefined}\n >\n {/* Before drop indicator */}\n {isDropTarget && dropPosition === \"before\" && (\n <div\n data-react-fancy-tree-drop-indicator=\"before\"\n className=\"pointer-events-none h-0.5 rounded-full bg-blue-500\"\n style={{ marginLeft: paddingLeft }}\n />\n )}\n\n <button\n type=\"button\"\n draggable={canDrag}\n onDragStart={canDrag ? handleDragStart : undefined}\n onDragEnd={canDrag ? handleDragEnd : undefined}\n onClick={handleClick}\n onContextMenu={handleContextMenu}\n disabled={node.disabled}\n className={cn(\n \"flex w-full items-center gap-1 rounded-md py-0.5 text-left text-[13px] transition-colors\",\n isSelected\n ? \"bg-blue-500/15 text-blue-600 dark:text-blue-400\"\n : \"text-[color:var(--fancy-text-soft,var(--color-zinc-700))] hover:bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] dark:text-[color:var(--fancy-text-soft-dark,var(--color-zinc-300))] dark:hover:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))]\",\n node.disabled && \"pointer-events-none opacity-40\",\n isDragging && \"opacity-50\",\n // Grab affordance. By default (`dragCursor=\"none\"`) the row keeps its\n // normal click cursor on hover — no open-hand \"move me\" cursor before\n // any drag — and only shows the closed-hand `grabbing` cursor while a\n // drag is actually underway (mousedown/drag). `dragCursor=\"grab\"` opts\n // back into the always-on grab cursor for whole-row drag handles (#14).\n canDrag &&\n (dragCursor === \"grab\" ? \"cursor-grab active:cursor-grabbing\" : \"active:cursor-grabbing\"),\n isDropTarget && dropPosition === \"inside\" && \"bg-blue-500/10 ring-1 ring-blue-500/30 ring-inset\",\n )}\n style={{ paddingLeft }}\n >\n {isFolder && <ChevronIcon open={isExpanded} />}\n {!isFolder && <span className=\"w-3.5 shrink-0\" />}\n {showIcons && (\n node.icon ?? (isFolder\n ? <FolderIcon open={isExpanded} />\n : <FileIcon ext={node.ext ?? node.label.split(\".\").pop()} />)\n )}\n <span className=\"truncate\">{node.label}</span>\n </button>\n\n {/* After drop indicator */}\n {isDropTarget && dropPosition === \"after\" && (\n <div\n data-react-fancy-tree-drop-indicator=\"after\"\n className=\"pointer-events-none h-0.5 rounded-full bg-blue-500\"\n style={{ marginLeft: paddingLeft }}\n />\n )}\n\n {/* A virtual list renders rows flat, so a row never renders its own children there. */}\n {!flat && isFolder && isExpanded && node.children && (\n <div data-react-fancy-tree-node-children=\"\">\n {node.children.map((child) => (\n <TreeNode key={child.id} node={child} depth={depth + 1} />\n ))}\n </div>\n )}\n </div>\n );\n}\n\nexport const TreeNode = memo(TreeNodeImpl);\n\nTreeNode.displayName = \"TreeNode\";\n","import { useMemo, useCallback, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { VirtualList } from \"../VirtualList\";\nimport { TreeNavContext } from \"./TreeNav.context\";\nimport { TreeNode } from \"./TreeNode\";\nimport { createTreeStore, TreeInternalsContext, type TreeInternals } from \"./tree-store\";\nimport type { TreeNavProps, TreeNodeData, DragState } from \"./TreeNav.types\";\n\nfunction collectFolderIds(nodes: TreeNodeData[]): string[] {\n const ids: string[] = [];\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n ids.push(node.id);\n ids.push(...collectFolderIds(node.children));\n }\n }\n return ids;\n}\n\nconst EMPTY_DRAG_STATE: DragState = {\n draggedNodeId: null,\n dropTargetId: null,\n dropPosition: null,\n};\n\ninterface FlatRow {\n id: string;\n node: TreeNodeData;\n depth: number;\n}\n\n/** The rows currently visible — every node, descending only into expanded folders. */\nfunction flattenVisible(nodes: TreeNodeData[], expanded: ReadonlySet<string>): FlatRow[] {\n const rows: FlatRow[] = [];\n const walk = (list: TreeNodeData[], depth: number) => {\n for (const node of list) {\n rows.push({ id: node.id, node, depth });\n const isFolder = node.type === \"folder\" || (node.children && node.children.length > 0);\n if (isFolder && node.children && expanded.has(node.id)) walk(node.children, depth + 1);\n }\n };\n walk(nodes, 0);\n return rows;\n}\n\nfunction TreeNavRoot({\n nodes,\n selectedId,\n onSelect,\n onNodeContextMenu,\n draggable = false,\n onNodeMove,\n acceptExternalDrops = false,\n onExternalDrop,\n expandedIds: controlledExpanded,\n defaultExpandedIds,\n onExpandedChange,\n defaultExpandAll = false,\n indentSize = 16,\n showIcons = true,\n dragCursor = \"none\",\n virtualize = false,\n height = 400,\n rowHeight = 26,\n className,\n}: TreeNavProps) {\n const [internalExpanded, setInternalExpanded] = useState<string[]>(() => {\n if (defaultExpandedIds) return defaultExpandedIds;\n if (defaultExpandAll) return collectFolderIds(nodes);\n return [];\n });\n\n const isControlled = controlledExpanded !== undefined;\n const expandedIds = isControlled ? controlledExpanded : internalExpanded;\n // One Set per change, so a row's \"am I expanded?\" is a lookup, not a scan.\n const expanded = useMemo(() => new Set(expandedIds), [expandedIds]);\n\n const [dragState, setDragState] = useState<DragState>(EMPTY_DRAG_STATE);\n\n /*\n * The latest props and state, for handlers that must stay STABLE. A handler\n * whose identity changes on every click would change the context rows read,\n * and re-render every row — the exact cost this component is avoiding.\n */\n const latest = useRef({ expandedIds, isControlled, onExpandedChange, onSelect, onNodeContextMenu, onNodeMove, onExternalDrop });\n latest.current = { expandedIds, isControlled, onExpandedChange, onSelect, onNodeContextMenu, onNodeMove, onExternalDrop };\n\n const setExpanded = useCallback((next: string[]) => {\n if (!latest.current.isControlled) setInternalExpanded(next);\n latest.current.onExpandedChange?.(next);\n }, []);\n\n const toggle = useCallback(\n (id: string) => {\n const current = latest.current.expandedIds;\n setExpanded(current.includes(id) ? current.filter((v) => v !== id) : [...current, id]);\n },\n [setExpanded],\n );\n\n const expandNode = useCallback(\n (id: string) => {\n const current = latest.current.expandedIds;\n if (!current.includes(id)) setExpanded([...current, id]);\n },\n [setExpanded],\n );\n\n const select = useCallback((node: TreeNodeData) => latest.current.onSelect?.(node.id, node), []);\n const contextMenu = useCallback(\n (e: React.MouseEvent, node: TreeNodeData) => latest.current.onNodeContextMenu?.(e, node),\n [],\n );\n const moveNode = useCallback(\n (sourceId: string, targetId: string, position: Parameters<NonNullable<TreeNavProps[\"onNodeMove\"]>>[2]) =>\n latest.current.onNodeMove?.(sourceId, targetId, position),\n [],\n );\n const externalDrop = useCallback(\n (event: React.DragEvent, target: TreeNodeData, position: Parameters<NonNullable<TreeNavProps[\"onExternalDrop\"]>>[2]) =>\n latest.current.onExternalDrop?.(event, target, position),\n [],\n );\n\n // What rows subscribe to. Seeded with this render's values so the first paint\n // is right; kept current after each render that changes them.\n const [store] = useState(() => createTreeStore({ selectedId, expanded, dragState }));\n useLayoutEffect(() => {\n const current = store.get();\n if (current.selectedId !== selectedId || current.expanded !== expanded || current.dragState !== dragState) {\n store.set({ selectedId, expanded, dragState });\n }\n }, [store, selectedId, expanded, dragState]);\n\n const hasContextMenu = onNodeContextMenu !== undefined;\n const internals = useMemo<TreeInternals>(\n () => ({\n store,\n nodes,\n select,\n toggle,\n expandNode,\n setDragState,\n // Present only when the host gave one: a row then claims the right-click.\n contextMenu: hasContextMenu ? contextMenu : undefined,\n moveNode,\n externalDrop,\n indentSize,\n showIcons,\n draggable,\n dragCursor,\n acceptExternalDrops,\n flat: virtualize,\n }),\n [store, nodes, select, toggle, expandNode, hasContextMenu, contextMenu, moveNode, externalDrop,\n indentSize, showIcons, draggable, dragCursor, acceptExternalDrops, virtualize],\n );\n\n // Unchanged public context, still live for `useTreeNav()` callers. Rows no\n // longer read it, so its changing on a click re-renders only those callers.\n const ctx = useMemo(\n () => ({\n selectedId, onSelect, onNodeContextMenu, expandedIds, toggle, indentSize, showIcons,\n draggable, dragCursor, dragState, setDragState, onNodeMove, acceptExternalDrops, onExternalDrop, nodes, expandNode,\n }),\n [selectedId, onSelect, onNodeContextMenu, expandedIds, toggle, indentSize, showIcons,\n draggable, dragCursor, dragState, onNodeMove, acceptExternalDrops, onExternalDrop, nodes, expandNode],\n );\n\n const rows = useMemo(\n () => (virtualize ? flattenVisible(nodes, expanded) : []),\n [virtualize, nodes, expanded],\n );\n\n const handleDragEnd = useCallback(() => {\n setDragState(EMPTY_DRAG_STATE);\n }, []);\n\n const dropEnabled = draggable || acceptExternalDrops;\n\n return (\n <TreeNavContext.Provider value={ctx}>\n <TreeInternalsContext.Provider value={internals}>\n <nav\n data-react-fancy-tree-nav=\"\"\n data-react-fancy-tree-nav-virtual={virtualize ? \"\" : undefined}\n className={cn(\"flex flex-col gap-0.5 py-1 text-sm\", className)}\n onDragEnd={dropEnabled ? handleDragEnd : undefined}\n >\n {virtualize ? (\n <VirtualList\n items={rows}\n height={height}\n estimateRowHeight={rowHeight}\n renderRow={(row) => <TreeNode node={row.node} depth={row.depth} />}\n />\n ) : (\n nodes.map((node) => <TreeNode key={node.id} node={node} depth={0} />)\n )}\n </nav>\n </TreeInternalsContext.Provider>\n </TreeNavContext.Provider>\n );\n}\n\nTreeNavRoot.displayName = \"TreeNav\";\n\nexport const TreeNav = Object.assign(TreeNavRoot, {\n Node: TreeNode,\n});\n"]}
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkAGO4AA3K_cjs = require('./chunk-AGO4AA3K.cjs');
3
+ var chunkXHUV3VSM_cjs = require('./chunk-XHUV3VSM.cjs');
4
4
  require('./chunk-ZU5Q77OT.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "FileUpload", {
9
9
  enumerable: true,
10
- get: function () { return chunkAGO4AA3K_cjs.FileUpload; }
10
+ get: function () { return chunkXHUV3VSM_cjs.FileUpload; }
11
11
  });
12
12
  Object.defineProperty(exports, "useFileUpload", {
13
13
  enumerable: true,
14
- get: function () { return chunkAGO4AA3K_cjs.useFileUpload; }
14
+ get: function () { return chunkXHUV3VSM_cjs.useFileUpload; }
15
15
  });
16
16
  //# sourceMappingURL=file-upload.cjs.map
17
17
  //# sourceMappingURL=file-upload.cjs.map
@@ -10,10 +10,25 @@ interface FileUploadContextValue {
10
10
  accept?: string;
11
11
  multiple: boolean;
12
12
  }
13
+ /** Stable code for why a file was refused. */
14
+ type FileRejectionReason = "accept" | "maxSize" | "maxFiles";
15
+ /** A refused file, as plain JSON so it can go to a log, a toast or an agent. */
16
+ interface FileRejection {
17
+ name: string;
18
+ size: number;
19
+ type: string;
20
+ reason: FileRejectionReason;
21
+ }
13
22
  interface FileUploadProps {
14
23
  children: ReactNode;
15
24
  value?: File[];
16
25
  onChange?: (files: File[]) => void;
26
+ /**
27
+ * Files this gesture refused, one entry per file under the first rule it
28
+ * failed. Not called when nothing was refused. Fires after `onChange`, for
29
+ * the picker, a drop, and `useFileUpload().addFiles` alike.
30
+ */
31
+ onReject?: (rejections: FileRejection[]) => void;
17
32
  accept?: string;
18
33
  multiple?: boolean;
19
34
  maxFiles?: number;
@@ -46,7 +61,7 @@ declare namespace FileUploadList {
46
61
  var displayName: string;
47
62
  }
48
63
 
49
- declare function FileUploadRoot({ children, value, onChange, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
64
+ declare function FileUploadRoot({ children, value, onChange, onReject, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
50
65
  declare const FileUpload: typeof FileUploadRoot & {
51
66
  Dropzone: typeof FileUploadDropzone;
52
67
  List: typeof FileUploadList;
@@ -54,4 +69,4 @@ declare const FileUpload: typeof FileUploadRoot & {
54
69
 
55
70
  declare function useFileUpload(): FileUploadContextValue;
56
71
 
57
- export { FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
72
+ export { type FileRejection, type FileRejectionReason, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
@@ -10,10 +10,25 @@ interface FileUploadContextValue {
10
10
  accept?: string;
11
11
  multiple: boolean;
12
12
  }
13
+ /** Stable code for why a file was refused. */
14
+ type FileRejectionReason = "accept" | "maxSize" | "maxFiles";
15
+ /** A refused file, as plain JSON so it can go to a log, a toast or an agent. */
16
+ interface FileRejection {
17
+ name: string;
18
+ size: number;
19
+ type: string;
20
+ reason: FileRejectionReason;
21
+ }
13
22
  interface FileUploadProps {
14
23
  children: ReactNode;
15
24
  value?: File[];
16
25
  onChange?: (files: File[]) => void;
26
+ /**
27
+ * Files this gesture refused, one entry per file under the first rule it
28
+ * failed. Not called when nothing was refused. Fires after `onChange`, for
29
+ * the picker, a drop, and `useFileUpload().addFiles` alike.
30
+ */
31
+ onReject?: (rejections: FileRejection[]) => void;
17
32
  accept?: string;
18
33
  multiple?: boolean;
19
34
  maxFiles?: number;
@@ -46,7 +61,7 @@ declare namespace FileUploadList {
46
61
  var displayName: string;
47
62
  }
48
63
 
49
- declare function FileUploadRoot({ children, value, onChange, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
64
+ declare function FileUploadRoot({ children, value, onChange, onReject, accept, multiple, maxFiles, maxSize, disabled, className, }: FileUploadProps): react.JSX.Element;
50
65
  declare const FileUpload: typeof FileUploadRoot & {
51
66
  Dropzone: typeof FileUploadDropzone;
52
67
  List: typeof FileUploadList;
@@ -54,4 +69,4 @@ declare const FileUpload: typeof FileUploadRoot & {
54
69
 
55
70
  declare function useFileUpload(): FileUploadContextValue;
56
71
 
57
- export { FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
72
+ export { type FileRejection, type FileRejectionReason, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, useFileUpload };
@@ -1,4 +1,4 @@
1
- export { FileUpload, useFileUpload } from './chunk-JEHV7PYP.js';
1
+ export { FileUpload, useFileUpload } from './chunk-SCGTO3PX.js';
2
2
  import './chunk-MMW2JGKZ.js';
3
3
  //# sourceMappingURL=file-upload.js.map
4
4
  //# sourceMappingURL=file-upload.js.map
package/dist/index.cjs CHANGED
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- require('./chunk-O5IO7TCO.cjs');
3
+ require('./chunk-7STOB5MB.cjs');
4
4
  var chunkKOAMRCSC_cjs = require('./chunk-KOAMRCSC.cjs');
5
+ var chunkGHTHPDKY_cjs = require('./chunk-GHTHPDKY.cjs');
5
6
  var chunkH7ELUIF6_cjs = require('./chunk-H7ELUIF6.cjs');
6
7
  require('./chunk-HXLSEBAL.cjs');
7
8
  var chunkZ4UXLQSK_cjs = require('./chunk-Z4UXLQSK.cjs');
@@ -18,8 +19,8 @@ var chunk4DL2U23D_cjs = require('./chunk-4DL2U23D.cjs');
18
19
  var chunkYH75G6SP_cjs = require('./chunk-YH75G6SP.cjs');
19
20
  var chunkUXYFM2XT_cjs = require('./chunk-UXYFM2XT.cjs');
20
21
  var chunkKFA7B6WP_cjs = require('./chunk-KFA7B6WP.cjs');
21
- var chunkL5AI4MGV_cjs = require('./chunk-L5AI4MGV.cjs');
22
- var chunkMF2DCMOA_cjs = require('./chunk-MF2DCMOA.cjs');
22
+ var chunk25HRO7HQ_cjs = require('./chunk-25HRO7HQ.cjs');
23
+ var chunk2TLAZ5MX_cjs = require('./chunk-2TLAZ5MX.cjs');
23
24
  var chunkY7RGUUTS_cjs = require('./chunk-Y7RGUUTS.cjs');
24
25
  var chunkKOTUFZJ6_cjs = require('./chunk-KOTUFZJ6.cjs');
25
26
  var chunkFNIHCNVD_cjs = require('./chunk-FNIHCNVD.cjs');
@@ -73,7 +74,7 @@ var chunkV5JTTLJP_cjs = require('./chunk-V5JTTLJP.cjs');
73
74
  var chunkLIVC3WUU_cjs = require('./chunk-LIVC3WUU.cjs');
74
75
  var chunkM5SEYDSS_cjs = require('./chunk-M5SEYDSS.cjs');
75
76
  var chunkO5ORO2RX_cjs = require('./chunk-O5ORO2RX.cjs');
76
- var chunkAGO4AA3K_cjs = require('./chunk-AGO4AA3K.cjs');
77
+ var chunkXHUV3VSM_cjs = require('./chunk-XHUV3VSM.cjs');
77
78
  var chunkWVSHAJKI_cjs = require('./chunk-WVSHAJKI.cjs');
78
79
  var chunkOOZCJLEF_cjs = require('./chunk-OOZCJLEF.cjs');
79
80
  var chunk3QCAOD2W_cjs = require('./chunk-3QCAOD2W.cjs');
@@ -231,6 +232,10 @@ Object.defineProperty(exports, "MultiSwitch", {
231
232
  enumerable: true,
232
233
  get: function () { return chunkKOAMRCSC_cjs.MultiSwitch; }
233
234
  });
235
+ Object.defineProperty(exports, "NumberField", {
236
+ enumerable: true,
237
+ get: function () { return chunkGHTHPDKY_cjs.NumberField; }
238
+ });
234
239
  Object.defineProperty(exports, "RadioGroup", {
235
240
  enumerable: true,
236
241
  get: function () { return chunkH7ELUIF6_cjs.RadioGroup; }
@@ -285,15 +290,15 @@ Object.defineProperty(exports, "useToast", {
285
290
  });
286
291
  Object.defineProperty(exports, "TreeNav", {
287
292
  enumerable: true,
288
- get: function () { return chunkL5AI4MGV_cjs.TreeNav; }
293
+ get: function () { return chunk25HRO7HQ_cjs.TreeNav; }
289
294
  });
290
295
  Object.defineProperty(exports, "useTreeNav", {
291
296
  enumerable: true,
292
- get: function () { return chunkL5AI4MGV_cjs.useTreeNav; }
297
+ get: function () { return chunk25HRO7HQ_cjs.useTreeNav; }
293
298
  });
294
299
  Object.defineProperty(exports, "VirtualList", {
295
300
  enumerable: true,
296
- get: function () { return chunkMF2DCMOA_cjs.VirtualList; }
301
+ get: function () { return chunk2TLAZ5MX_cjs.VirtualList; }
297
302
  });
298
303
  Object.defineProperty(exports, "Separator", {
299
304
  enumerable: true,
@@ -629,11 +634,11 @@ Object.defineProperty(exports, "validateFolderName", {
629
634
  });
630
635
  Object.defineProperty(exports, "FileUpload", {
631
636
  enumerable: true,
632
- get: function () { return chunkAGO4AA3K_cjs.FileUpload; }
637
+ get: function () { return chunkXHUV3VSM_cjs.FileUpload; }
633
638
  });
634
639
  Object.defineProperty(exports, "useFileUpload", {
635
640
  enumerable: true,
636
- get: function () { return chunkAGO4AA3K_cjs.useFileUpload; }
641
+ get: function () { return chunkXHUV3VSM_cjs.useFileUpload; }
637
642
  });
638
643
  Object.defineProperty(exports, "FullScreen", {
639
644
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU,gBAAA;AAAA,IACV,YAAA,EAAc,qBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBA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AU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA;AAAA,IAEP,IAAA,EAAM,6DAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB","file":"index.cjs","sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
1
+ {"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAA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IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,aAAA,EAAe;AAAA,IACb,QAAA,EAAU,qBAAA;AAAA,IACV,YAAA,EAAc,0BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA;AAAA,IAEP,IAAA,EAAM,6DAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB","file":"index.cjs","sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
package/dist/index.d.cts CHANGED
@@ -9,6 +9,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.cjs';
9
9
  export { RadioGroup, RadioGroupProps } from './radio-group.cjs';
10
10
  export { Switch, SwitchProps } from './switch.cjs';
11
11
  export { Slider, SliderProps } from './slider.cjs';
12
+ export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.cjs';
12
13
  export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.cjs';
13
14
  export { DatePicker, DatePickerProps } from './date-picker.cjs';
14
15
  export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-duxPKadC.cjs';
@@ -70,7 +71,7 @@ export { Pagination, PaginationProps } from './pagination.cjs';
70
71
  export { Autocomplete, AutocompleteOption, AutocompleteProps } from './autocomplete.cjs';
71
72
  export { Pillbox, PillboxProps } from './pillbox.cjs';
72
73
  export { OtpInput, OtpInputProps } from './otp-input.cjs';
73
- export { FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.cjs';
74
+ export { FileRejection, FileRejectionReason, FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.cjs';
74
75
  export { TimePicker, TimePickerProps } from './time-picker.cjs';
75
76
  export { Calendar, CalendarDayContext, CalendarMode, CalendarProps, DateRange } from './calendar.cjs';
76
77
  export { Composer, ComposerProps, ComposerSubmitExtras } from './composer.cjs';
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.js';
9
9
  export { RadioGroup, RadioGroupProps } from './radio-group.js';
10
10
  export { Switch, SwitchProps } from './switch.js';
11
11
  export { Slider, SliderProps } from './slider.js';
12
+ export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.js';
12
13
  export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.js';
13
14
  export { DatePicker, DatePickerProps } from './date-picker.js';
14
15
  export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-DzGcqcPf.js';
@@ -70,7 +71,7 @@ export { Pagination, PaginationProps } from './pagination.js';
70
71
  export { Autocomplete, AutocompleteOption, AutocompleteProps } from './autocomplete.js';
71
72
  export { Pillbox, PillboxProps } from './pillbox.js';
72
73
  export { OtpInput, OtpInputProps } from './otp-input.js';
73
- export { FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.js';
74
+ export { FileRejection, FileRejectionReason, FileUpload, FileUploadContextValue, FileUploadDropzoneProps, FileUploadListProps, FileUploadProps, useFileUpload } from './file-upload.js';
74
75
  export { TimePicker, TimePickerProps } from './time-picker.js';
75
76
  export { Calendar, CalendarDayContext, CalendarMode, CalendarProps, DateRange } from './calendar.js';
76
77
  export { Composer, ComposerProps, ComposerSubmitExtras } from './composer.js';
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
- import './chunk-VXHFR5MV.js';
1
+ import './chunk-5WMVBFBD.js';
2
2
  export { MultiSwitch } from './chunk-3S5ED522.js';
3
+ export { NumberField } from './chunk-75PB3IMT.js';
3
4
  export { RadioGroup } from './chunk-4FH2JHUY.js';
4
5
  import './chunk-GNHQVPZP.js';
5
6
  export { Slider } from './chunk-NVXTHTJI.js';
@@ -16,8 +17,8 @@ export { TimeGrid } from './chunk-MLZGGAXQ.js';
16
17
  export { TimePicker } from './chunk-AZQXPI5S.js';
17
18
  export { Timeline } from './chunk-QGY5FPVM.js';
18
19
  export { Toast, useToast } from './chunk-ESCIXKFT.js';
19
- export { TreeNav, useTreeNav } from './chunk-LYG2NLSV.js';
20
- export { VirtualList } from './chunk-ARNFT23K.js';
20
+ export { TreeNav, useTreeNav } from './chunk-ZPBKRJMH.js';
21
+ export { VirtualList } from './chunk-5IXOQGPX.js';
21
22
  export { Separator } from './chunk-JSD6IEBW.js';
22
23
  export { Sidebar, useSidebar } from './chunk-JY2RC6I4.js';
23
24
  export { Skeleton } from './chunk-X7VIIM2P.js';
@@ -71,7 +72,7 @@ export { EmojiSelect } from './chunk-WGRLNXNB.js';
71
72
  export { Eyebrow } from './chunk-EQ7G5F6K.js';
72
73
  export { FauxClient } from './chunk-GVMWJ4NI.js';
73
74
  export { FileBrowser, FileBrowserNewFolder, useFileBrowser, validateFolderName } from './chunk-WZAKEJDL.js';
74
- export { FileUpload, useFileUpload } from './chunk-JEHV7PYP.js';
75
+ export { FileUpload, useFileUpload } from './chunk-SCGTO3PX.js';
75
76
  export { FullScreen } from './chunk-GZ5Z56QK.js';
76
77
  export { Grid } from './chunk-TM3RTWKI.js';
77
78
  export { Command, useCommand } from './chunk-EZZKHMR4.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU,gBAAA;AAAA,IACV,YAAA,EAAc,qBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,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A;AAAA,IAEP,IAAA,EAAM,6DAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB","file":"index.js","sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
1
+ {"version":3,"sources":["../src/theme-tokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,iBAAA;AAAA,IACV,YAAA,EAAc,sBAAA;AAAA,IACd,KAAA,EAAO,oBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;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AA,GACf;AAAA,EACA,aAAA,EAAe;AAAA,IACb,QAAA,EAAU,qBAAA;AAAA,IACV,YAAA,EAAc,0BAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,QAAA,EAAU,uBAAA;AAAA,IACV,YAAA,EAAc,4BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA;AAAA,IAEP,IAAA,EAAM,6DAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,YAAA,EAAc,oBAAA;AAAA,IACd,KAAA,EAAO,uBAAA;AAAA,IACP,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa;AAAA;AAEjB","file":"index.js","sourcesContent":["/**\n * Semantic theme tokens — the small set of colours the kit's DOM components\n * read, so a host can repaint the whole kit with its own palette WITHOUT\n * remapping Tailwind's `zinc` or `violet`.\n *\n * Each role is two CSS custom properties, one per mode:\n *\n * --fancy-surface the light value\n * --fancy-surface-dark the dark value\n *\n * Components read them through their var() FALLBACK, which is the colour the\n * component used before these existed:\n *\n * bg-[color:var(--fancy-surface,var(--color-white))]\n * dark:bg-[color:var(--fancy-surface-dark,var(--color-zinc-900))]\n *\n * So:\n * - **Set nothing and nothing changes.** An unset custom property resolves to\n * its fallback, which is the exact declaration the old `bg-white` produced.\n * - **Set one and every surface follows**, wherever the variable is in scope:\n * `:root`, `body`, or any wrapper element. No selector to match, no layer or\n * specificity to win — a custom property is inherited, not cascaded against.\n * - **Both modes are stated, not derived.** The dark value is a separate\n * variable rather than a flip under `.dark`, so which one applies is decided\n * by the host's own `dark:` variant — the same switch that drives every\n * other `dark:` utility in the kit. (See `dark-variant.css` for a variant\n * that follows `[data-theme=\"dark\"]` as well as `.dark`.)\n *\n * NOT covered, deliberately: colours that ENCODE DATA — chart series,\n * file-type marks, mood and confidence scales, event kinds. Repainting those\n * with a host's neutral palette would erase what they mean. A component's\n * explicit `color` prop (Badge, Button, Callout …) is also untouched: that is\n * the host choosing a hue, not the kit choosing one for it.\n *\n * `light` / `dark` are the defaults exactly as components write them in their\n * fallbacks. `tests/theme-tokens.test.tsx` fails if a component's fallback\n * disagrees with this table, so the table is the contract rather than a\n * description of it.\n */\nexport const THEME_TOKENS = {\n surface: {\n variable: \"--fancy-surface\",\n darkVariable: \"--fancy-surface-dark\",\n light: \"var(--color-white)\",\n dark: \"var(--color-zinc-900)\",\n description: \"Panels, cards, overlays (menus, modals, popovers, toasts), sidebars and navbars.\",\n },\n \"surface-muted\": {\n variable: \"--fancy-surface-muted\",\n darkVariable: \"--fancy-surface-muted-dark\",\n light: \"var(--color-zinc-100)\",\n dark: \"var(--color-zinc-800)\",\n description: \"Hovered and selected rows, chips, inset wells, toolbar buttons.\",\n },\n border: {\n variable: \"--fancy-border\",\n darkVariable: \"--fancy-border-dark\",\n light: \"var(--color-zinc-200)\",\n dark: \"var(--color-zinc-700)\",\n description: \"Outlines, dividers, separators and tracks (skeletons, progress, sliders).\",\n },\n \"border-strong\": {\n variable: \"--fancy-border-strong\",\n darkVariable: \"--fancy-border-strong-dark\",\n light: \"var(--color-zinc-300)\",\n dark: \"var(--color-zinc-700)\",\n description: \"The firmer outline on form controls (inputs, checkboxes, radios) and keycaps.\",\n },\n input: {\n variable: \"--fancy-input\",\n darkVariable: \"--fancy-input-dark\",\n light: \"var(--color-white)\",\n dark: \"#1e1e24\",\n description: \"The field surface of text inputs, checkboxes, radios, OTP cells and pickers.\",\n },\n text: {\n variable: \"--fancy-text\",\n darkVariable: \"--fancy-text-dark\",\n light: \"var(--color-zinc-900)\",\n dark: \"var(--color-zinc-100)\",\n description: \"Strongest foreground: headings, values, field text, active items.\",\n },\n \"text-soft\": {\n variable: \"--fancy-text-soft\",\n darkVariable: \"--fancy-text-soft-dark\",\n light: \"var(--color-zinc-700)\",\n dark: \"var(--color-zinc-300)\",\n description: \"Body copy and menu items: readable, one step back from text.\",\n },\n \"text-muted\": {\n variable: \"--fancy-text-muted\",\n darkVariable: \"--fancy-text-muted-dark\",\n light: \"var(--color-zinc-500)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Descriptions, captions, secondary labels, axis labels.\",\n },\n \"text-faint\": {\n variable: \"--fancy-text-faint\",\n darkVariable: \"--fancy-text-faint-dark\",\n light: \"var(--color-zinc-400)\",\n dark: \"var(--color-zinc-500)\",\n description: \"Placeholders, disabled hints, decorative icons.\",\n },\n \"text-subtle\": {\n variable: \"--fancy-text-subtle\",\n darkVariable: \"--fancy-text-subtle-dark\",\n light: \"var(--color-zinc-600)\",\n dark: \"var(--color-zinc-400)\",\n description: \"Inactive nav labels (Sidebar, Menu, Navbar, MultiSwitch) and secondary prose. Added 5.53.1.\",\n },\n \"surface-hover\": {\n variable: \"--fancy-surface-hover\",\n darkVariable: \"--fancy-surface-hover-dark\",\n light: \"var(--color-zinc-50)\",\n // Tailwind's `bg-zinc-800/50`, written out so a host's value is used as-is.\n dark: \"color-mix(in oklab, var(--color-zinc-800) 50%, transparent)\",\n description: \"The hover fill on nav items, list options and table rows. Added 5.53.1.\",\n },\n focus: {\n variable: \"--fancy-focus\",\n darkVariable: \"--fancy-focus-dark\",\n light: \"var(--color-blue-500)\",\n dark: \"var(--color-blue-400)\",\n description: \"The focus border and ring on form controls.\",\n },\n} as const;\n\nexport type ThemeTokenRole = keyof typeof THEME_TOKENS;\n"]}
package/dist/inputs.cjs CHANGED
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- require('./chunk-O5IO7TCO.cjs');
3
+ require('./chunk-7STOB5MB.cjs');
4
4
  var chunkKOAMRCSC_cjs = require('./chunk-KOAMRCSC.cjs');
5
+ var chunkGHTHPDKY_cjs = require('./chunk-GHTHPDKY.cjs');
5
6
  var chunkH7ELUIF6_cjs = require('./chunk-H7ELUIF6.cjs');
6
7
  require('./chunk-HXLSEBAL.cjs');
7
8
  var chunkZ4UXLQSK_cjs = require('./chunk-Z4UXLQSK.cjs');
@@ -41,6 +42,10 @@ Object.defineProperty(exports, "MultiSwitch", {
41
42
  enumerable: true,
42
43
  get: function () { return chunkKOAMRCSC_cjs.MultiSwitch; }
43
44
  });
45
+ Object.defineProperty(exports, "NumberField", {
46
+ enumerable: true,
47
+ get: function () { return chunkGHTHPDKY_cjs.NumberField; }
48
+ });
44
49
  Object.defineProperty(exports, "RadioGroup", {
45
50
  enumerable: true,
46
51
  get: function () { return chunkH7ELUIF6_cjs.RadioGroup; }
package/dist/inputs.d.cts CHANGED
@@ -7,6 +7,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.cjs';
7
7
  export { RadioGroup, RadioGroupProps } from './radio-group.cjs';
8
8
  export { Switch, SwitchProps } from './switch.cjs';
9
9
  export { Slider, SliderProps, SliderRangeProps, SliderSingleProps } from './slider.cjs';
10
+ export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.cjs';
10
11
  export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.cjs';
11
12
  export { DatePicker, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps } from './date-picker.cjs';
12
13
  export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-duxPKadC.cjs';
package/dist/inputs.d.ts CHANGED
@@ -7,6 +7,7 @@ export { CheckboxGroup, CheckboxGroupProps } from './checkbox-group.js';
7
7
  export { RadioGroup, RadioGroupProps } from './radio-group.js';
8
8
  export { Switch, SwitchProps } from './switch.js';
9
9
  export { Slider, SliderProps, SliderRangeProps, SliderSingleProps } from './slider.js';
10
+ export { NumberField, NumberFieldMessages, NumberFieldProps } from './number-field.js';
10
11
  export { MultiSwitch, MultiSwitchOption, MultiSwitchProps } from './multi-switch.js';
11
12
  export { DatePicker, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps } from './date-picker.js';
12
13
  export { A as AffixPosition, F as FieldMode, I as InputAffixProps, a as InputBaseProps, b as InputOption, c as InputOptionGroup } from './inputs.types-DzGcqcPf.js';
package/dist/inputs.js CHANGED
@@ -1,5 +1,6 @@
1
- import './chunk-VXHFR5MV.js';
1
+ import './chunk-5WMVBFBD.js';
2
2
  export { MultiSwitch } from './chunk-3S5ED522.js';
3
+ export { NumberField } from './chunk-75PB3IMT.js';
3
4
  export { RadioGroup } from './chunk-4FH2JHUY.js';
4
5
  import './chunk-GNHQVPZP.js';
5
6
  export { Slider } from './chunk-NVXTHTJI.js';
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var chunkGHTHPDKY_cjs = require('./chunk-GHTHPDKY.cjs');
4
+ require('./chunk-QGPMVFZJ.cjs');
5
+ require('./chunk-HNJXBMHI.cjs');
6
+ require('./chunk-MRZXTL46.cjs');
7
+ require('./chunk-P53432AK.cjs');
8
+ require('./chunk-QF7CD4JH.cjs');
9
+ require('./chunk-O3F6DYWR.cjs');
10
+ require('./chunk-KKYILQTG.cjs');
11
+ require('./chunk-MKGWHSNV.cjs');
12
+ require('./chunk-6V44RRSB.cjs');
13
+ require('./chunk-MKHYENKR.cjs');
14
+ require('./chunk-J2DI6RMR.cjs');
15
+ require('./chunk-TI7D4QDM.cjs');
16
+ require('./chunk-KJ22KE56.cjs');
17
+ require('./chunk-L3V3BYVS.cjs');
18
+ require('./chunk-57FQGQJK.cjs');
19
+ require('./chunk-OUYC6EIL.cjs');
20
+ require('./chunk-SNHU2AI4.cjs');
21
+ require('./chunk-ZU5Q77OT.cjs');
22
+
23
+
24
+
25
+ Object.defineProperty(exports, "NumberField", {
26
+ enumerable: true,
27
+ get: function () { return chunkGHTHPDKY_cjs.NumberField; }
28
+ });
29
+ //# sourceMappingURL=number-field.cjs.map
30
+ //# sourceMappingURL=number-field.cjs.map