@adea-ai/ui 0.162.14 → 0.162.16

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 (200) hide show
  1. package/dist/components/composites/accent-picker/accent-picker.js +1 -1
  2. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  3. package/dist/components/composites/accent-picker/custom-color-popover.js +1 -1
  4. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  5. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
  6. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  7. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  8. package/dist/components/composites/appearance-editor/appearance-choices.js +2 -2
  9. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  10. package/dist/components/composites/confirmation/confirmation.js +1 -1
  11. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  12. package/dist/components/composites/icon-picker/icon-picker.js +1 -1
  13. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  14. package/dist/components/composites/list-row/list-row-control.js +1 -1
  15. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  16. package/dist/components/composites/settings/settings.js +1 -1
  17. package/dist/components/composites/settings/settings.js.map +1 -1
  18. package/dist/components/composites/stack-trace/stack-trace.js +1 -1
  19. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  20. package/dist/components/composites/tree/tree.js +1 -1
  21. package/dist/components/composites/tree/tree.js.map +1 -1
  22. package/dist/components/composites/workspace-mark/workspace-mark.js +1 -1
  23. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  24. package/dist/components/conversation/thread-panel.js +1 -1
  25. package/dist/components/conversation/thread-panel.js.map +1 -1
  26. package/dist/components/layout/app-shell/skip-link.js +1 -1
  27. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  28. package/dist/components/layout/side-rail/side-rail.js +1 -1
  29. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  30. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js +1 -1
  31. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js.map +1 -1
  32. package/dist/components/layout/sidebar-nav/sidebar-nav.js +1 -1
  33. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  34. package/dist/components/layout/top-bar/top-bar.js +2 -2
  35. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  36. package/dist/components/ui/accordion/accordion.js +1 -1
  37. package/dist/components/ui/accordion/accordion.js.map +1 -1
  38. package/dist/components/ui/annotation-surface/annotation-surface.js +1 -1
  39. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  40. package/dist/components/ui/attachment/attachment.js +2 -2
  41. package/dist/components/ui/attachment/attachment.js.map +1 -1
  42. package/dist/components/ui/board/board.js +2 -2
  43. package/dist/components/ui/board/board.js.map +1 -1
  44. package/dist/components/ui/breadcrumb/breadcrumb.js +1 -1
  45. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  46. package/dist/components/ui/button/button.js +1 -1
  47. package/dist/components/ui/button/button.js.map +1 -1
  48. package/dist/components/ui/checkbox/checkbox.js +1 -1
  49. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  50. package/dist/components/ui/collapsible/collapsible.js +1 -1
  51. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  52. package/dist/components/ui/combobox/combobox.js +3 -3
  53. package/dist/components/ui/combobox/combobox.js.map +1 -1
  54. package/dist/components/ui/field/field.js +2 -2
  55. package/dist/components/ui/field/field.js.map +1 -1
  56. package/dist/components/ui/input/input-control.js +1 -1
  57. package/dist/components/ui/input/input-control.js.map +1 -1
  58. package/dist/components/ui/input-group/input-group.js +1 -1
  59. package/dist/components/ui/input-group/input-group.js.map +1 -1
  60. package/dist/components/ui/input-otp/input-otp.js +1 -1
  61. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  62. package/dist/components/ui/menubar/menubar.js +1 -1
  63. package/dist/components/ui/menubar/menubar.js.map +1 -1
  64. package/dist/components/ui/native-select/native-select.js +1 -1
  65. package/dist/components/ui/native-select/native-select.js.map +1 -1
  66. package/dist/components/ui/pagination/pagination.js +1 -1
  67. package/dist/components/ui/pagination/pagination.js.map +1 -1
  68. package/dist/components/ui/questionnaire/questionnaire.js +1 -1
  69. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  70. package/dist/components/ui/radio-group/radio-group.js +2 -2
  71. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  72. package/dist/components/ui/scroll-area/scroll-area.js +1 -1
  73. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  74. package/dist/components/ui/select/select.js +1 -1
  75. package/dist/components/ui/select/select.js.map +1 -1
  76. package/dist/components/ui/slider/slider.js +1 -1
  77. package/dist/components/ui/slider/slider.js.map +1 -1
  78. package/dist/components/ui/switch/switch.js +1 -1
  79. package/dist/components/ui/switch/switch.js.map +1 -1
  80. package/dist/components/ui/tabs/tabs.js +1 -1
  81. package/dist/components/ui/tabs/tabs.js.map +1 -1
  82. package/dist/components/ui/text-link/text-link.js +1 -1
  83. package/dist/components/ui/text-link/text-link.js.map +1 -1
  84. package/dist/components/ui/textarea/textarea.js +1 -1
  85. package/dist/components/ui/textarea/textarea.js.map +1 -1
  86. package/dist/components/ui/toast/toast.js +1 -1
  87. package/dist/components/ui/toast/toast.js.map +1 -1
  88. package/dist/components/ui/trace/trace.js +1 -1
  89. package/dist/components/ui/trace/trace.js.map +1 -1
  90. package/dist/lib/overlay.d.ts.map +1 -1
  91. package/dist/lib/overlay.js +1 -1
  92. package/dist/lib/overlay.js.map +1 -1
  93. package/dist/lib/tokens.d.ts.map +1 -1
  94. package/dist/lib/tokens.js +2 -2
  95. package/dist/lib/tokens.js.map +1 -1
  96. package/dist/lib/variants.d.ts +1 -1
  97. package/dist/lib/variants.d.ts.map +1 -1
  98. package/dist/lib/variants.js +1 -1
  99. package/dist/lib/variants.js.map +1 -1
  100. package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +1 -1
  101. package/dist/r/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
  102. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
  103. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
  104. package/dist/r/src/components/composites/confirmation/confirmation.tsx +1 -1
  105. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
  106. package/dist/r/src/components/composites/list-row/list-row-control.tsx +1 -1
  107. package/dist/r/src/components/composites/settings/settings.tsx +1 -1
  108. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +1 -1
  109. package/dist/r/src/components/composites/tree/tree.tsx +1 -1
  110. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  111. package/dist/r/src/components/conversation/thread-panel.tsx +1 -1
  112. package/dist/r/src/components/layout/app-shell/skip-link.tsx +1 -1
  113. package/dist/r/src/components/layout/side-rail/side-rail.tsx +1 -1
  114. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
  115. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
  116. package/dist/r/src/components/layout/top-bar/top-bar.tsx +2 -2
  117. package/dist/r/src/components/ui/accordion/accordion.tsx +1 -1
  118. package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
  119. package/dist/r/src/components/ui/attachment/attachment.tsx +2 -2
  120. package/dist/r/src/components/ui/board/board.tsx +2 -2
  121. package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
  122. package/dist/r/src/components/ui/button/button.tsx +1 -1
  123. package/dist/r/src/components/ui/checkbox/checkbox.tsx +1 -1
  124. package/dist/r/src/components/ui/collapsible/collapsible.tsx +1 -1
  125. package/dist/r/src/components/ui/combobox/combobox.tsx +3 -3
  126. package/dist/r/src/components/ui/field/field.tsx +2 -2
  127. package/dist/r/src/components/ui/input/input-control.tsx +1 -1
  128. package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
  129. package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
  130. package/dist/r/src/components/ui/menubar/menubar.tsx +1 -1
  131. package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
  132. package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
  133. package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +1 -1
  134. package/dist/r/src/components/ui/radio-group/radio-group.tsx +2 -2
  135. package/dist/r/src/components/ui/scroll-area/scroll-area.tsx +1 -1
  136. package/dist/r/src/components/ui/select/select.tsx +1 -1
  137. package/dist/r/src/components/ui/slider/slider.tsx +1 -1
  138. package/dist/r/src/components/ui/switch/switch.tsx +1 -1
  139. package/dist/r/src/components/ui/tabs/tabs.tsx +1 -1
  140. package/dist/r/src/components/ui/text-link/text-link.tsx +1 -1
  141. package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
  142. package/dist/r/src/components/ui/toast/toast.tsx +1 -1
  143. package/dist/r/src/components/ui/trace/trace.tsx +1 -1
  144. package/dist/r/src/lib/overlay.ts +1 -1
  145. package/dist/r/src/lib/tokens.ts +4 -2
  146. package/dist/r/src/lib/variants.ts +1 -1
  147. package/dist/r/src/styles/base.css +35 -7
  148. package/dist/vite/tailwind-sources.d.ts.map +1 -1
  149. package/dist/vite/tailwind-sources.js +16 -5
  150. package/dist/vite/tailwind-sources.js.map +1 -1
  151. package/package.json +1 -1
  152. package/src/components/composites/accent-picker/accent-picker.tsx +1 -1
  153. package/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
  154. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
  155. package/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
  156. package/src/components/composites/confirmation/confirmation.tsx +1 -1
  157. package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
  158. package/src/components/composites/list-row/list-row-control.tsx +1 -1
  159. package/src/components/composites/settings/settings.tsx +1 -1
  160. package/src/components/composites/stack-trace/stack-trace.tsx +1 -1
  161. package/src/components/composites/tree/tree.tsx +1 -1
  162. package/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  163. package/src/components/conversation/thread-panel.tsx +1 -1
  164. package/src/components/layout/app-shell/skip-link.tsx +1 -1
  165. package/src/components/layout/side-rail/side-rail.tsx +1 -1
  166. package/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
  167. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
  168. package/src/components/layout/top-bar/top-bar.tsx +2 -2
  169. package/src/components/ui/accordion/accordion.tsx +1 -1
  170. package/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
  171. package/src/components/ui/attachment/attachment.tsx +2 -2
  172. package/src/components/ui/board/board.tsx +2 -2
  173. package/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
  174. package/src/components/ui/button/button.tsx +1 -1
  175. package/src/components/ui/checkbox/checkbox.tsx +1 -1
  176. package/src/components/ui/collapsible/collapsible.tsx +1 -1
  177. package/src/components/ui/combobox/combobox.tsx +3 -3
  178. package/src/components/ui/field/field.tsx +2 -2
  179. package/src/components/ui/input/input-control.tsx +1 -1
  180. package/src/components/ui/input-group/input-group.tsx +1 -1
  181. package/src/components/ui/input-otp/input-otp.tsx +1 -1
  182. package/src/components/ui/menubar/menubar.tsx +1 -1
  183. package/src/components/ui/native-select/native-select.tsx +1 -1
  184. package/src/components/ui/pagination/pagination.tsx +1 -1
  185. package/src/components/ui/questionnaire/questionnaire.tsx +1 -1
  186. package/src/components/ui/radio-group/radio-group.tsx +2 -2
  187. package/src/components/ui/scroll-area/scroll-area.tsx +1 -1
  188. package/src/components/ui/select/select.tsx +1 -1
  189. package/src/components/ui/slider/slider.tsx +1 -1
  190. package/src/components/ui/switch/switch.tsx +1 -1
  191. package/src/components/ui/tabs/tabs.tsx +1 -1
  192. package/src/components/ui/text-link/text-link.tsx +1 -1
  193. package/src/components/ui/textarea/textarea.tsx +1 -1
  194. package/src/components/ui/toast/toast.tsx +1 -1
  195. package/src/components/ui/trace/trace.tsx +1 -1
  196. package/src/lib/overlay.ts +1 -1
  197. package/src/lib/tokens.ts +4 -2
  198. package/src/lib/variants.ts +1 -1
  199. package/src/styles/base.css +35 -7
  200. package/src/vite/tailwind-sources.ts +20 -3
@@ -209,7 +209,7 @@ function AnnotationSurface(props) {
209
209
  o: isInteractive() ? void 0 : "true",
210
210
  i: local.tool,
211
211
  n: dragging() ? "true" : "false",
212
- s: readShallow(cn("dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", local.class))
212
+ s: readShallow(cn("dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:focus-outline", local.class))
213
213
  };
214
214
  }, ({ e, t, a, o, i, n, s }, _p$) => {
215
215
  e !== _p$?.e && setAttribute(_el$, "id", e);
@@ -1 +1 @@
1
- {"version":3,"file":"annotation-surface.js","names":["ref={(element) => local.ref?.(element)}","<Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>","y={region().y * 10_000}","width={region().width * 10_000}","height={region().height * 10_000}","<div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>","aria-describedby={describedBy()}","aria-label={local.label}","aria-disabled={isInteractive() ? undefined : 'true'}","data-tool={local.tool}","data-dragging={dragging() ? 'true' : 'false'}","class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}","_$ref","_$insert","_$effect","_$setAttribute","_$className"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import { children, createEffect, createSignal, createUniqueId, onCleanup, Show } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const local = props\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n // The hint is JSX: read once, or every check of it builds another copy.\n const hint = children(() => local.hint)\n let activeDrag: ActiveDrag | undefined\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n // A host reset, a tool switch or the surface turning inert ends a drag in flight.\n createEffect(\n () => ({ resetKey: local.resetKey, tool: local.tool, interactive: isInteractive() }),\n (next, previous) => {\n if (!activeDrag) return\n if (\n !next.interactive ||\n (previous && (next.resetKey !== previous.resetKey || next.tool !== previous.tool))\n )\n cancelDrag()\n }\n )\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], hint() && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\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EAC5CC,UAAA,MAAA,GAAA,KAAA,CAGC;CAZW,CAAA;CAFhB,OACEX;AAoDJ"}
1
+ {"version":3,"file":"annotation-surface.js","names":["ref={(element) => local.ref?.(element)}","<Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>","y={region().y * 10_000}","width={region().width * 10_000}","height={region().height * 10_000}","<div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:focus-outline',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>","aria-describedby={describedBy()}","aria-label={local.label}","aria-disabled={isInteractive() ? undefined : 'true'}","data-tool={local.tool}","data-dragging={dragging() ? 'true' : 'false'}","class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:focus-outline',\n local.class\n )}","_$ref","_$insert","_$effect","_$setAttribute","_$className"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import { children, createEffect, createSignal, createUniqueId, onCleanup, Show } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const local = props\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n // The hint is JSX: read once, or every check of it builds another copy.\n const hint = children(() => local.hint)\n let activeDrag: ActiveDrag | undefined\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n // A host reset, a tool switch or the surface turning inert ends a drag in flight.\n createEffect(\n () => ({ resetKey: local.resetKey, tool: local.tool, interactive: isInteractive() }),\n (next, previous) => {\n if (!activeDrag) return\n if (\n !next.interactive ||\n (previous && (next.resetKey !== previous.resetKey || next.tool !== previous.tool))\n )\n cancelDrag()\n }\n )\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], hint() && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:focus-outline',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAkEA,SAAS,UAAU,OAAqB,QAAgD;CACtF,MAAM,SAAS,OAAO,sBAAsB;CAC5C,OAAO,uBAAuB,MAAM,SAAS,MAAM,SAAS,MAAM;AACpE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBAAkB,OAA+B;CAC/D,MAAM,QAAQ;CAEd,MAAM,CAAC,UAAU,eAAe,aAAa,KAAK;CAClD,MAAM,SAAS,eAAe;CAE9B,MAAM,OAAO,eAAe,MAAM,IAAI;CACtC,IAAI;CAEJ,MAAM,sBAAsB,MAAM,eAAe;CAEjD,SAAS,eAAe,MAAwB;EAC9C,IAAI;GACF,IAAI,KAAK,OAAO,kBAAkB,KAAK,SAAS,GAC9C,KAAK,OAAO,sBAAsB,KAAK,SAAS;EACpD,QAAQ,CAER;CACF;CAEA,SAAS,WAAW,OAAqC,UAAU,MAAY;EAC7E,MAAM,OAAO;EACb,IAAI,CAAC,MAAM;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AC,EAAA,CAAD,GAjDRR,KAkDK;CAjDHS,aAAA;;GAAI,GAAA,MAAM;GACVR,GAAkB,YAAY;GAG9BC,GAAY,MAAM;GAClBC,GAAe,cAAc,IAAI,KAAA,IAAY;GAE7CC,GAAW,MAAM;GACjBC,GAAe,SAAS,IAAI,SAAS;GACrCC,GAAAA,YAAO,GACL,sOACA,MAAM,KACR,CAAC;EAZW;CAAZ,IAAA,EAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,KAAA,QAAA;EAAY,MAAA,KAAA,KAAAI,aAAA,MAAA,MAAA,CAAA;EACZ,MAAA,KAAA,KAAAA,aAAA,MAAA,oBAAA,CAA+B;EAG/B,MAAA,KAAA,KAAAA,aAAA,MAAA,cAAA,CAAuB;EACvB,MAAA,KAAA,KAAAA,aAAA,MAAA,iBAAA,CAAmD;EAEnD,MAAA,KAAA,KAAAA,aAAA,MAAA,aAAA,CAAqB;EACrB,MAAA,KAAA,KAAAA,aAAA,MAAA,iBAAA,CAA4C;EAC5CC,UAAA,MAAA,GAAA,KAAA,CAGC;CAZW,CAAA;CAFhB,OACEX;AAoDJ"}
@@ -8,8 +8,8 @@ import { Button } from "../button/button.js";
8
8
  import { fastIcon } from "../../../lib/fast-icon.js";
9
9
  // src/components/ui/attachment/attachment.tsx
10
10
  var _tmpl$ = /* @__PURE__ */ template(`<span class="min-w-0 truncate font-medium">`);
11
- var _tmpl$2 = /* @__PURE__ */ template(`<a target=_blank rel="noreferrer noopener"class="min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle">`);
12
- var _tmpl$3 = /* @__PURE__ */ template(`<button type=button class="min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle">`);
11
+ var _tmpl$2 = /* @__PURE__ */ template(`<a target=_blank rel="noreferrer noopener"class="min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:focus-outline">`);
12
+ var _tmpl$3 = /* @__PURE__ */ template(`<button type=button class="min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:focus-outline">`);
13
13
  var _tmpl$4 = /* @__PURE__ */ template(`<span>`);
14
14
  var _tmpl$5 = /* @__PURE__ */ template(`<div>`);
15
15
  var _tmpl$6 = /* @__PURE__ */ template(`<span class="relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&amp;_svg]:size-6">`);
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.js","names":["<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","<TriangleAlert aria-hidden=\"true\" />","<Glyph aria-hidden=\"true\" />","<Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>","<Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>","title={local.name}","<Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>","{status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}","role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}","<Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","class=\"shrink-0\"","onClick={() => local.onRemove?.()}","<X aria-hidden=\"true\" />","<span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>","{detail()}","<span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>","{remove()}","<div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>","role=\"list\"","<ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>","LucideArchive","LucideFileIcon","LucideFileCode","LucideFileText","LucideImageIcon","LucideLoaderCircle","LucideTriangleAlert","LucideX","_$insert","_$effect","_$setAttribute","_$readShallow","_$className","_$spread"],"sources":["../../../../src/components/ui/attachment/attachment.tsx"],"sourcesContent":["import {\n Archive as LucideArchive,\n File as LucideFileIcon,\n FileCode as LucideFileCode,\n FileText as LucideFileText,\n Image as LucideImageIcon,\n LoaderCircle as LucideLoaderCircle,\n TriangleAlert as LucideTriangleAlert,\n X as LucideX,\n} from '@lucide/solid'\nimport { Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { formatByteSize } from '#lib/bytes'\nimport { FETCH_SCHEMES, urlWithScheme } from '#lib/url'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Archive = fastIcon(LucideArchive)\nconst FileIcon = fastIcon(LucideFileIcon)\nconst FileCode = fastIcon(LucideFileCode)\nconst FileText = fastIcon(LucideFileText)\nconst ImageIcon = fastIcon(LucideImageIcon)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\nconst X = fastIcon(LucideX)\n\n/**\n * Attachment.\n *\n * A file that travels with a message or sits in the composer. Three\n * presentations of one thing: a `chip` (a line, for the composer and for a list\n * of many), a `card` (name, type and size, for a message's attachments), and a\n * `tile` (a preview image with the name beneath, for pictures).\n *\n * ## It only offers what works\n *\n * An attachment is a *claim that a file exists and can be handled*. This\n * component therefore draws an action only when the caller supplied the\n * handler: no `onOpen`/`href` and the name is plain text, not a dead button; no\n * `onRemove` and there is no ✕. A host whose attachments cannot be reopened (a\n * name the runtime echoed back, a file that was never stored) renders honest,\n * static chips instead of controls that do nothing.\n *\n * ## Untrusted metadata\n *\n * Name, type and size come from whoever sent the file. They are rendered as\n * text, the name is never used as a path or URL, and a preview is shown only\n * for `blob:`, `https:`/`http:` or a `data:image/*` raster source (no SVG, which\n * can carry script when opened on its own).\n *\n * `status` states the truth about the file's lifecycle in words (`uploading`,\n * `error`, `unavailable`), not by colour alone.\n */\nexport type AttachmentKind = 'image' | 'document' | 'code' | 'text' | 'archive' | 'other'\nexport type AttachmentStatus = 'ready' | 'uploading' | 'error' | 'unavailable'\nexport type AttachmentVariant = 'chip' | 'card' | 'tile'\n\nconst KIND_ICON = {\n image: ImageIcon,\n document: FileText,\n code: FileCode,\n text: FileText,\n archive: Archive,\n other: FileIcon,\n} as const\n\n/** The figure as written: whole numbers from 10 up, one decimal below. */\nconst shown = (amount: number) => (amount >= 10 ? Math.round(amount) : Math.round(amount * 10) / 10)\n\n/** `1536` → `1.5 KB`. Returns nothing for a value that is not a finite size. */\nexport function formatAttachmentSize(bytes: number | undefined): string | undefined {\n if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0) return undefined\n return formatByteSize(bytes, ['KB', 'MB', 'GB', 'TB'], (value) => String(shown(value)))\n}\n\n/** The only sources a preview may use. */\nexport function safePreviewSrc(value: string | undefined): string | undefined {\n if (!value) return undefined\n if (value.startsWith('blob:')) return value\n if (/^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[A-Za-z0-9+/=]+$/.test(value)) return value\n return urlWithScheme(value, FETCH_SCHEMES) ? value : undefined\n}\n\nexport type AttachmentProps = Omit<ComponentProps<'div'>, 'children'> & {\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n variant?: AttachmentVariant\n status?: AttachmentStatus\n /** 0–100 while `uploading`; omit for indeterminate. */\n progress?: number\n /** Why it failed or is unavailable, in words. */\n statusLabel?: string\n previewSrc?: string\n /** Open the file in the host. Omit and the name is not a control. */\n onOpen?: () => void\n /** Open the file by address. Omit and the name is not a link. */\n href?: string\n /** Detach it. Omit and there is no remove control. */\n onRemove?: () => void\n removeLabel?: string\n}\n\nexport function Attachment(props: AttachmentProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'name',\n 'kind',\n 'size',\n 'variant',\n 'status',\n 'progress',\n 'statusLabel',\n 'previewSrc',\n 'onOpen',\n 'href',\n 'onRemove',\n 'removeLabel'\n )\n const variant = () => local.variant ?? 'chip'\n const status = () => local.status ?? 'ready'\n const preview = () => (local.kind === 'image' ? safePreviewSrc(local.previewSrc) : undefined)\n const Icon = () => KIND_ICON[local.kind ?? 'other']\n const size = () => formatAttachmentSize(local.size)\n const actionable = () => status() === 'ready' || status() === 'error'\n\n const mark = (): JSX.Element => {\n if (status() === 'uploading')\n return <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n if (status() === 'error') return <TriangleAlert aria-hidden=\"true\" />\n const Glyph = Icon()\n return <Glyph aria-hidden=\"true\" />\n }\n\n const label = (): JSX.Element => (\n <span class=\"min-w-0 truncate font-medium\" title={local.name}>\n {local.name}\n </span>\n )\n\n const name = (): JSX.Element => (\n <Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>\n )\n\n const detail = (): JSX.Element => (\n <Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>\n )\n\n const remove = (): JSX.Element => (\n <Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>\n )\n\n return (\n <div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>\n )\n}\n\nexport function AttachmentList(props: ComponentProps<'ul'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,IAAM,UAAU,SAASyB,SAAa;AACtC,IAAM,WAAW,SAASC,IAAc;AACxC,IAAM,WAAW,SAASC,UAAc;AACxC,IAAM,WAAW,SAASC,UAAc;AACxC,IAAM,YAAY,SAASC,KAAe;AAC1C,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,gBAAgB,SAASC,eAAmB;AAClD,IAAM,IAAI,SAASC,GAAO;AAiC1B,IAAM,YAAY;CAChB,OAAO;CACP,UAAU;CACV,MAAM;CACN,MAAM;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,OAAA;IASM,EAAA,CAAA;WACN;KAGM,IAAA,SAAA,QAAA;KAHN,IAAA,SAAA,OAAA;;KACGJ,OAAA,QAAA,MADHb,MAGM;KAHNa,OAAA,QAEG,QAFHb,MAGM;KAHN,OAAA;IAGM,EAAA,CAAA;IACNC,KAAC,MAAQ;GAdV;EA4BC;CAAC,EAAA,CAAD,CACH;CArDP,OACEC;AAsDJ;AAEA,SAAgB,eAAe,OAA6B;CAC1D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE1C,IAAA,SAAA,SAOI;CAHFgB,OAAA,QAAA,CAAA;EAHAf,MAAAA;EACA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,kDAAkD,MAAM,KAAK;EAAC;CAChE,GAAJ,IAAA,GAAA,IAAA;CAJNU,OAAA,cAME;EAAC,OAAA,MAAM;CAAQ,CACb;CARN,OACET;AASJ"}
1
+ {"version":3,"file":"attachment.js","names":["<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","<TriangleAlert aria-hidden=\"true\" />","<Glyph aria-hidden=\"true\" />","<Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:focus-outline\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:focus-outline\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>","<Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:focus-outline\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:focus-outline\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>","title={local.name}","<Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>","{status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}","role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}","<Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","class=\"shrink-0\"","onClick={() => local.onRemove?.()}","<X aria-hidden=\"true\" />","<span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>","{detail()}","<span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>","{remove()}","<div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>","role=\"list\"","<ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>","LucideArchive","LucideFileIcon","LucideFileCode","LucideFileText","LucideImageIcon","LucideLoaderCircle","LucideTriangleAlert","LucideX","_$insert","_$effect","_$setAttribute","_$readShallow","_$className","_$spread"],"sources":["../../../../src/components/ui/attachment/attachment.tsx"],"sourcesContent":["import {\n Archive as LucideArchive,\n File as LucideFileIcon,\n FileCode as LucideFileCode,\n FileText as LucideFileText,\n Image as LucideImageIcon,\n LoaderCircle as LucideLoaderCircle,\n TriangleAlert as LucideTriangleAlert,\n X as LucideX,\n} from '@lucide/solid'\nimport { Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { formatByteSize } from '#lib/bytes'\nimport { FETCH_SCHEMES, urlWithScheme } from '#lib/url'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Archive = fastIcon(LucideArchive)\nconst FileIcon = fastIcon(LucideFileIcon)\nconst FileCode = fastIcon(LucideFileCode)\nconst FileText = fastIcon(LucideFileText)\nconst ImageIcon = fastIcon(LucideImageIcon)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\nconst X = fastIcon(LucideX)\n\n/**\n * Attachment.\n *\n * A file that travels with a message or sits in the composer. Three\n * presentations of one thing: a `chip` (a line, for the composer and for a list\n * of many), a `card` (name, type and size, for a message's attachments), and a\n * `tile` (a preview image with the name beneath, for pictures).\n *\n * ## It only offers what works\n *\n * An attachment is a *claim that a file exists and can be handled*. This\n * component therefore draws an action only when the caller supplied the\n * handler: no `onOpen`/`href` and the name is plain text, not a dead button; no\n * `onRemove` and there is no ✕. A host whose attachments cannot be reopened (a\n * name the runtime echoed back, a file that was never stored) renders honest,\n * static chips instead of controls that do nothing.\n *\n * ## Untrusted metadata\n *\n * Name, type and size come from whoever sent the file. They are rendered as\n * text, the name is never used as a path or URL, and a preview is shown only\n * for `blob:`, `https:`/`http:` or a `data:image/*` raster source (no SVG, which\n * can carry script when opened on its own).\n *\n * `status` states the truth about the file's lifecycle in words (`uploading`,\n * `error`, `unavailable`), not by colour alone.\n */\nexport type AttachmentKind = 'image' | 'document' | 'code' | 'text' | 'archive' | 'other'\nexport type AttachmentStatus = 'ready' | 'uploading' | 'error' | 'unavailable'\nexport type AttachmentVariant = 'chip' | 'card' | 'tile'\n\nconst KIND_ICON = {\n image: ImageIcon,\n document: FileText,\n code: FileCode,\n text: FileText,\n archive: Archive,\n other: FileIcon,\n} as const\n\n/** The figure as written: whole numbers from 10 up, one decimal below. */\nconst shown = (amount: number) => (amount >= 10 ? Math.round(amount) : Math.round(amount * 10) / 10)\n\n/** `1536` → `1.5 KB`. Returns nothing for a value that is not a finite size. */\nexport function formatAttachmentSize(bytes: number | undefined): string | undefined {\n if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0) return undefined\n return formatByteSize(bytes, ['KB', 'MB', 'GB', 'TB'], (value) => String(shown(value)))\n}\n\n/** The only sources a preview may use. */\nexport function safePreviewSrc(value: string | undefined): string | undefined {\n if (!value) return undefined\n if (value.startsWith('blob:')) return value\n if (/^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[A-Za-z0-9+/=]+$/.test(value)) return value\n return urlWithScheme(value, FETCH_SCHEMES) ? value : undefined\n}\n\nexport type AttachmentProps = Omit<ComponentProps<'div'>, 'children'> & {\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n variant?: AttachmentVariant\n status?: AttachmentStatus\n /** 0–100 while `uploading`; omit for indeterminate. */\n progress?: number\n /** Why it failed or is unavailable, in words. */\n statusLabel?: string\n previewSrc?: string\n /** Open the file in the host. Omit and the name is not a control. */\n onOpen?: () => void\n /** Open the file by address. Omit and the name is not a link. */\n href?: string\n /** Detach it. Omit and there is no remove control. */\n onRemove?: () => void\n removeLabel?: string\n}\n\nexport function Attachment(props: AttachmentProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'name',\n 'kind',\n 'size',\n 'variant',\n 'status',\n 'progress',\n 'statusLabel',\n 'previewSrc',\n 'onOpen',\n 'href',\n 'onRemove',\n 'removeLabel'\n )\n const variant = () => local.variant ?? 'chip'\n const status = () => local.status ?? 'ready'\n const preview = () => (local.kind === 'image' ? safePreviewSrc(local.previewSrc) : undefined)\n const Icon = () => KIND_ICON[local.kind ?? 'other']\n const size = () => formatAttachmentSize(local.size)\n const actionable = () => status() === 'ready' || status() === 'error'\n\n const mark = (): JSX.Element => {\n if (status() === 'uploading')\n return <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n if (status() === 'error') return <TriangleAlert aria-hidden=\"true\" />\n const Glyph = Icon()\n return <Glyph aria-hidden=\"true\" />\n }\n\n const label = (): JSX.Element => (\n <span class=\"min-w-0 truncate font-medium\" title={local.name}>\n {local.name}\n </span>\n )\n\n const name = (): JSX.Element => (\n <Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:focus-outline\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:focus-outline\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>\n )\n\n const detail = (): JSX.Element => (\n <Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>\n )\n\n const remove = (): JSX.Element => (\n <Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>\n )\n\n return (\n <div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>\n )\n}\n\nexport function AttachmentList(props: ComponentProps<'ul'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,IAAM,UAAU,SAASyB,SAAa;AACtC,IAAM,WAAW,SAASC,IAAc;AACxC,IAAM,WAAW,SAASC,UAAc;AACxC,IAAM,WAAW,SAASC,UAAc;AACxC,IAAM,YAAY,S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AAD,CACF;KARJD,aAAAE,YAAO,GAAG,yEAAyE;MACjF,8CAA8C,QAAQ,MAAM;MAC5D,oBAAoB,OAAO,MAAM;KACnC,CAAC,CAAC,IAHF,KAAA,QAAA;MAGEC,UAAA,QAAA,KAAA,GAAA;;KAJJ,OAAA;IASM,EAAA,CAAA;WACN;KAGM,IAAA,SAAA,QAAA;KAHN,IAAA,SAAA,OAAA;;KACGJ,OAAA,QAAA,MADHb,MAGM;KAHNa,OAAA,QAEG,QAFHb,MAGM;KAHN,OAAA;IAGM,EAAA,CAAA;IACNC,KAAC,MAAQ;GAdV;EA4BC;CAAC,EAAA,CAAD,CACH;CArDP,OACEC;AAsDJ;AAEA,SAAgB,eAAe,OAA6B;CAC1D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE1C,IAAA,SAAA,SAOI;CAHFgB,OAAA,QAAA,CAAA;EAHAf,MAAAA;EACA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,kDAAkD,MAAM,KAAK;EAAC;CAChE,GAAJ,IAAA,GAAA,IAAA;CAJNU,OAAA,cAME;EAAC,OAAA,MAAM;CAAQ,CACb;CARN,OACET;AASJ"}
@@ -270,7 +270,7 @@ function Board(props) {
270
270
  const isItemDragging = isDragging();
271
271
  return untrack(() => local.children(item, { dragging: isItemDragging }));
272
272
  }));
273
- effect(() => readShallow(cn("relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing", cardDragState[isDragging() ? "dragging" : "idle"])), (_v$, _$p) => {
273
+ effect(() => readShallow(cn("relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing", cardDragState[isDragging() ? "dragging" : "idle"])), (_v$, _$p) => {
274
274
  className(_el$17, _v$, _$p);
275
275
  });
276
276
  return _el$17;
@@ -397,7 +397,7 @@ function BoardCardTrigger(props) {
397
397
  return cn(textVariants({
398
398
  variant: "label",
399
399
  tone: "foreground"
400
- }), "min-w-0 flex-1 truncate rounded-sm text-start outline-none", "after:absolute after:inset-0 after:rounded-md", "focus-visible:ring-3 focus-visible:ring-primary-subtle", local.class);
400
+ }), "min-w-0 flex-1 truncate rounded-sm text-start outline-none", "after:absolute after:inset-0 after:rounded-md", "focus-visible:focus-outline", local.class);
401
401
  }
402
402
  }, rest], false);
403
403
  return _el$21;
@@ -1 +1 @@
1
- {"version":3,"file":"board.js","names":["<Show when={props.tone}>\n {(tone) => (\n <span aria-hidden=\"true\" class={cn('size-2 shrink-0 rounded-full', toneDot[tone()])} />\n )}\n </Show>","<Show when={props.count !== undefined}>\n {/* The Badge's classes, not the component: Board stays plain markup. */}\n <span\n class={cn(badgeVariants({ variant: 'subtle', size: 'sm' }), 'tabular-nums')}\n data-slot=\"board-column-count\"\n >\n {/* A string: the renderer assigns a lone number through textContent, and\n some DOMs (happy-dom) drop a 0 there, leaving no node to update. */}\n {String(props.count)}\n </span>\n </Show>","<For keyed={false} each={local.columns}>\n {(column) => {\n const items = () => byColumn().get(column().id) ?? []\n const collapsed = () =>\n Boolean(local.collapseEmpty) && column().collapsible !== false && items().length === 0\n const over = () => overColumn() === column().id\n return (\n <section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>\n )\n }}\n </For>","keyed={false}","<BoardColumnDot tone={column().tone} />","<header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>","<BoardColumnCount count={column().count} />","<For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>","ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}","<article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>","<div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>","<header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>","aria-label={column().label}","data-collapsed={collapsed() ? '' : undefined}","<section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>","<div\n class={cn('flex min-h-0 gap-3 overflow-x-auto pb-2', local.class)}\n role=\"region\"\n aria-label={local.label ?? 'Board'}\n tabindex=\"0\"\n >\n {/*\n Index, not For: callers derive columns (a count, a tone) and hand over\n fresh objects whenever a card moves. Keyed by identity, every lane would\n remount on each move and take the moved card's restored focus with it.\n */}\n <For keyed={false} each={local.columns}>\n {(column) => {\n const items = () => byColumn().get(column().id) ?? []\n const collapsed = () =>\n Boolean(local.collapseEmpty) && column().collapsible !== false && items().length === 0\n const over = () => overColumn() === column().id\n return (\n <section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>\n )\n }}\n </For>\n {/*\n The keyboard move's result, announced. A drag speaks for itself — the card\n visibly moves — while a keyboard move happens with the focus elsewhere.\n */}\n <div class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">\n {announcement()}\n </div>\n </div>","aria-label={local.label ?? 'Board'}","<h4 class={cn(boardCardTitleVariants({ size: props.size }), props.class)}>{props.children}</h4>","<div class={cn('grid gap-1.5 p-2.5', props.class)}>{props.children}</div>","<button\n type={local.type ?? 'button'}\n data-slot=\"board-card-trigger\"\n class={cn(\n textVariants({ variant: 'label', tone: 'foreground' }),\n 'min-w-0 flex-1 truncate rounded-sm text-start outline-none',\n 'after:absolute after:inset-0 after:rounded-md',\n 'focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />","_$effect","_$readShallow","_$className","_$insert","_$ref","_$setAttribute","_$spread"],"sources":["../../../../src/components/ui/board/board.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createProjection,\n createSignal,\n For,\n onCleanup,\n Show,\n omit,\n untrack,\n} from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { badgeVariants } from '../badge'\nimport { headingVariants, textVariants } from '../typography'\n\n/**\n * Board.\n *\n * Columns of cards, with drag between them — the shape a task tracker, a CRM\n * pipeline, a support queue and a release plan all share. It is generic in the\n * one place that matters: the *column ids are the caller's*, and so is the rule\n * that decides which moves are legal. The component knows nothing about tasks.\n *\n * The transitions are a predicate rather than a derived table because the legal\n * moves in a real product are not \"any column to any column\". A task that is\n * `completed` may be archived but not re-queued; a lead may become a customer but\n * not a stranger again. A board that let you drop anything anywhere would encode\n * a state machine in the UI that the server rejects — so `canDrop` is required,\n * and a column that cannot receive the dragged card renders as unavailable rather\n * than silently accepting a drop that will fail.\n *\n * Three input methods, because a drag-only board is unusable by keyboard:\n * dragging with the pointer, `Ctrl`/`Cmd` + arrow keys to move a focused card\n * between columns, and whatever the caller wires into `actions`. The card is\n * focusable and its move is announced through a live region, so the board is\n * operable without a mouse.\n *\n * The card is rendered by the caller through `children`, given the item and a set\n * of drag props. That is deliberate: a card's contents are domain — a title, a\n * priority tag, an assignee — and a board that rendered them itself could only\n * ever serve one product.\n *\n * `collapseEmpty` folds a column with no cards to a strip one line of text wide,\n * its label turned on its side. A board of seven lanes where three are empty\n * otherwise spends half its width on nothing, and the lanes with work in them\n * are the ones that need the room. A folded lane is still a full-height drop\n * target and still accepts a keyboard move, so nothing about operating the\n * board changes; it does not unfold under a drag, because a lane that grows\n * under the pointer moves every lane after it and the drop lands somewhere else.\n *\n * Give the board a height (`class=\"h-full\"`) and each lane scrolls on its own;\n * leave it unconstrained and lanes grow with their cards and the page scrolls.\n */\n\n/**\n * A lane's identifying colour, drawn as a dot before its label. The chart hues,\n * in the order the token set gives them, because a lane colour tells lanes apart\n * like a series does; it carries no status. `neutral` is for a lane that should\n * not draw the eye — a backlog, an archive.\n */\nexport type BoardTone =\n | 'neutral'\n | 'chart-1'\n | 'chart-2'\n | 'chart-3'\n | 'chart-4'\n | 'chart-5'\n | 'chart-6'\n\nexport type BoardColumn = Readonly<{\n id: string\n label: string\n /** The number of cards, shown as an accent count beside the label. */\n count?: number\n /** A limit or any other note, shown after the count. */\n meta?: JSX.Element\n /** The lane's dot colour. Omitted, the header has no dot. */\n tone?: BoardTone\n /**\n * `false` keeps this lane open when it is empty under `collapseEmpty` — the\n * inbox lane new cards arrive in, which should always show where they land.\n */\n collapsible?: boolean\n /** Dim the column and refuse drops — a lane that is closed or read-only. */\n disabled?: boolean\n}>\n\nexport type BoardMove = Readonly<{\n itemId: string\n from: string\n to: string\n}>\n\nexport type BoardProps<T> = {\n columns: readonly BoardColumn[]\n items: readonly T[]\n itemId: (item: T) => string\n itemColumn: (item: T) => string\n /** Whether `item` may move from `from` to `to`. Required: see the note above. */\n canDrop: (item: T, from: string, to: string) => boolean\n onMove: (move: BoardMove) => void\n /** The card body. `dragging` is true while this card is the one being dragged. */\n children: (item: T, state: { dragging: boolean }) => JSX.Element\n emptyColumn?: (column: BoardColumn) => JSX.Element\n /** The board's accessible name. Defaults to \"Board\". */\n label?: string\n /** Fold columns with no cards to a narrow strip with a sideways label. */\n collapseEmpty?: boolean\n class?: string\n}\n\nconst cardDragState = {\n idle: '',\n dragging: 'opacity-40',\n} as const\n\nconst toneDot: Record<BoardTone, string> = {\n neutral: 'bg-muted-foreground',\n 'chart-1': 'bg-chart-1',\n 'chart-2': 'bg-chart-2',\n 'chart-3': 'bg-chart-3',\n 'chart-4': 'bg-chart-4',\n 'chart-5': 'bg-chart-5',\n 'chart-6': 'bg-chart-6',\n}\n\nfunction BoardColumnDot(props: { tone?: BoardTone }) {\n return (\n <Show when={props.tone}>\n {(tone) => (\n <span aria-hidden=\"true\" class={cn('size-2 shrink-0 rounded-full', toneDot[tone()])} />\n )}\n </Show>\n )\n}\n\nfunction BoardColumnCount(props: { count?: number }) {\n return (\n <Show when={props.count !== undefined}>\n {/* The Badge's classes, not the component: Board stays plain markup. */}\n <span\n class={cn(badgeVariants({ variant: 'subtle', size: 'sm' }), 'tabular-nums')}\n data-slot=\"board-column-count\"\n >\n {/* A string: the renderer assigns a lone number through textContent, and\n some DOMs (happy-dom) drop a 0 there, leaving no node to update. */}\n {String(props.count)}\n </span>\n </Show>\n )\n}\n\nexport function Board<T>(props: BoardProps<T>) {\n const local = props\n\n // The dragged item, not its id: `canDrop` takes the item itself, and the\n // pointer may leave the card before it is dropped.\n const [dragging, setDragging] = createSignal<T | null>(null)\n // Only the two cards whose answer flips update when a drag starts or ends.\n const draggingIds = createProjection<Record<string, true>>((draft) => {\n const current = dragging()\n const id = current ? local.itemId(current) : undefined\n for (const key of Object.keys(draft)) if (key !== id) delete draft[key]\n if (id !== undefined) draft[id] = true\n }, {})\n const isDraggingId = (id: string) => draggingIds[id] === true\n const [overColumn, setOverColumn] = createSignal<string | null>(null)\n const [announcement, setAnnouncement] = createSignal('')\n const cardElements = new Map<string, HTMLElement>()\n const [pendingFocus, setPendingFocus] = createSignal<{\n itemId: string\n columnId: string\n source: HTMLElement\n } | null>(null)\n const cancelOnPointer = () => setPendingFocus(null)\n\n // A controlled move can settle after a server response. Restore only the\n // focus that belonged to the moved card; another focus action cancels it.\n createEffect(pendingFocus, (pending) => {\n if (!pending) return\n const document = pending.source.ownerDocument\n const cancelOnFocus = (event: FocusEvent) => {\n if (!pending.source.contains(event.target as Node)) setPendingFocus(null)\n }\n document.addEventListener('focusin', cancelOnFocus)\n document.addEventListener('pointerdown', cancelOnPointer)\n return () => {\n document.removeEventListener('focusin', cancelOnFocus)\n document.removeEventListener('pointerdown', cancelOnPointer)\n }\n })\n\n // The compute answers \"has the pending card landed in its column\"; the apply\n // moves focus to it and clears the request.\n createEffect(\n () => {\n const pending = pendingFocus()\n if (!pending) return undefined\n const moved = local.items.find((item) => local.itemId(item) === pending.itemId)\n return moved && local.itemColumn(moved) === pending.columnId ? pending : undefined\n },\n (landed) => {\n if (!landed) return\n const target = cardElements.get(landed.itemId)\n setPendingFocus(null)\n if (target?.isConnected) target.focus()\n }\n )\n\n /**\n * `always` is for a pointer drop: dragging a card is a direct act on it, so it\n * ends focused wherever focus was. Chromium also blurs a focused control\n * inside a draggable once the native drag starts, so \"was focus in the card\"\n * cannot be read at drop time.\n */\n const prepareFocus = (item: T, columnId: string, source?: HTMLElement, always = false) => {\n const card = source ?? cardElements.get(local.itemId(item))\n if (card && (always || card.contains(card.ownerDocument.activeElement))) {\n setPendingFocus({ itemId: local.itemId(item), columnId, source: card })\n }\n }\n\n const byColumn = createMemo(() => {\n const grouped = new Map<string, T[]>()\n for (const column of local.columns) grouped.set(column.id, [])\n for (const item of local.items) grouped.get(local.itemColumn(item))?.push(item)\n return grouped\n })\n\n const accepts = (column: BoardColumn) => {\n const item = dragging()\n return Boolean(\n item && !column.disabled && local.canDrop(item, local.itemColumn(item), column.id)\n )\n }\n\n const drop = (column: BoardColumn) => {\n const item = dragging()\n const from = item ? local.itemColumn(item) : null\n const accepted = accepts(column)\n setDragging(null)\n setOverColumn(null)\n if (!item || !from || from === column.id || !accepted) return\n prepareFocus(item, column.id, undefined, true)\n local.onMove({ itemId: local.itemId(item), from, to: column.id })\n }\n\n /**\n * Keyboard move. `Ctrl`/`Cmd` plus an arrow is the convention for \"reorder this\n * thing within its container\" that does not collide with scrolling or with the\n * text caret, and it is the same chord a browser tab or a spreadsheet uses.\n */\n const moveByKeyboard = (item: T, direction: -1 | 1, source: HTMLElement) => {\n const from = local.itemColumn(item)\n const index = local.columns.findIndex((column) => column.id === from)\n if (index < 0) return\n const ordered =\n direction === 1 ? local.columns.slice(index + 1) : local.columns.slice(0, index).toReversed()\n const target = ordered.find(\n (column) => !column.disabled && local.canDrop(item, from, column.id)\n )\n if (!target) {\n setAnnouncement(`No column after ${from} accepts this item`)\n return\n }\n prepareFocus(item, target.id, source)\n local.onMove({ itemId: local.itemId(item), from, to: target.id })\n setAnnouncement(`Moved to ${target.label}`)\n }\n\n return (\n /*\n `role=\"region\"` + `tabindex=\"0\"` because the board scrolls horizontally and a\n keyboard user has to be able to scroll it — axe's `scrollable-region-focusable`.\n It is not enough that the cards are focusable: a board with empty columns, or\n with more columns than fit, has nothing focusable to scroll from.\n */\n <div\n class={cn('flex min-h-0 gap-3 overflow-x-auto pb-2', local.class)}\n role=\"region\"\n aria-label={local.label ?? 'Board'}\n tabindex=\"0\"\n >\n {/*\n Index, not For: callers derive columns (a count, a tone) and hand over\n fresh objects whenever a card moves. Keyed by identity, every lane would\n remount on each move and take the moved card's restored focus with it.\n */}\n <For keyed={false} each={local.columns}>\n {(column) => {\n const items = () => byColumn().get(column().id) ?? []\n const collapsed = () =>\n Boolean(local.collapseEmpty) && column().collapsible !== false && items().length === 0\n const over = () => overColumn() === column().id\n return (\n <section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>\n )\n }}\n </For>\n {/*\n The keyboard move's result, announced. A drag speaks for itself — the card\n visibly moves — while a keyboard move happens with the focus elsewhere.\n */}\n <div class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">\n {announcement()}\n </div>\n </div>\n )\n}\n\nexport const boardCardTitleVariants = cva('truncate font-medium text-foreground', {\n variants: { size: { sm: 'text-xs', md: 'text-sm' } },\n defaultVariants: { size: 'md' },\n})\n\nexport type BoardCardTitleProps = { class?: string; children: JSX.Element } & VariantProps<\n typeof boardCardTitleVariants\n>\n\n/** The card's title line, at the size a board card uses. */\nexport function BoardCardTitle(props: BoardCardTitleProps) {\n return (\n <h4 class={cn(boardCardTitleVariants({ size: props.size }), props.class)}>{props.children}</h4>\n )\n}\n\n/** A card's padding, so every card in an application is the same shape. */\nexport function BoardCardBody(props: { class?: string; children: JSX.Element }) {\n return <div class={cn('grid gap-1.5 p-2.5', props.class)}>{props.children}</div>\n}\n\n/**\n * The card's open action: its title, as a real button whose hit area stretches\n * over the whole card. A card is one target to a pointer — clicking anywhere on\n * it opens it — while assistive technology still meets a named button rather\n * than a clickable `article`. Other controls on the card sit above the stretched\n * area by being positioned (`class=\"relative\"`), so they keep their own click.\n */\nexport function BoardCardTrigger(props: ComponentProps<'button'>) {\n const local = props\n const rest = omit(props, 'class', 'type')\n return (\n <button\n type={local.type ?? 'button'}\n data-slot=\"board-card-trigger\"\n class={cn(\n textVariants({ variant: 'label', tone: 'foreground' }),\n 'min-w-0 flex-1 truncate rounded-sm text-start outline-none',\n 'after:absolute after:inset-0 after:rounded-md',\n 'focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiHA,IAAM,gBAAgB;CACpB,MAAM;CACN,UAAU;AACZ;AAEA,IAAM,UAAqC;CACzC,SAAS;CACT,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;AACb;AAEA,SAAS,eAAe,OAA6B;CACnD,OACEA,gBAAAA,MAAAA;EAAM,IAAA,OAAA;GAAM,OAAA,MAAM;EAAI;EAAtBA,WACI,gBACA;GAAsF,IAAA,OAAA,OAAA;GAA7DoB,aAAAC,YAAO,GAAG,gCAAgC,QAAQ,KAAK,EAAE,CAAC,IAA1D,KAAA,QAAA;IAA0DC,UAAA,MAAA,KAAA,GAAA;;GAAnF,OAAA;EAAsF,EAAA,CAAA;CAEpF,CAAA;AAEV;AAEA,SAAS,iBAAiB,OAA2B;CACnD,OACErB,WAAAA;;GAAY,OAAA,MAAM,UAAU,KAAA;EAUtB,CAAA,CAAC,CAAD,WARJ;GAOM,IAAA,QAAA,QAAA;GAPNsB,OAAA,aAME;IAAC,OAAA,OAAO,MAAM,KAAK;GAAC,CAChB;GANJH,aAAAC,YAAO,GAAG,cAAc;IAAE,SAAS;IAAU,MAAM;GAAK,CAAC,GAAG,cAAc,CAAC,IAA3E,KAAA,QAAA;IAA2EC,UAAA,OAAA,KAAA,GAAA;;GAD7E,OAAA;EAOM,EAAA,CAAA,IATR,KAAA;CAUM,CAAA;AAEV;AAEA,SAAgB,MAAS,OAAsB;CAC7C,MAAM,QAAQ;CAId,MAAM,CAAC,UAAU,eAAe,aAAuB,IAAI;CAE3D,MAAM,cAAc,kBAAwC,UAAU;EACpE,MAAM,UAAU,SAAS;EACzB,MAAM,KAAK,UAAU,MAAM,OAAO,OAAO,IAAI,KAAA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ink-0 rounded-full', toneDot[tone()])} />\n )}\n </Show>","<Show when={props.count !== undefined}>\n {/* The Badge's classes, not the component: Board stays plain markup. */}\n <span\n class={cn(badgeVariants({ variant: 'subtle', size: 'sm' }), 'tabular-nums')}\n data-slot=\"board-column-count\"\n >\n {/* A string: the renderer assigns a lone number through textContent, and\n some DOMs (happy-dom) drop a 0 there, leaving no node to update. */}\n {String(props.count)}\n </span>\n </Show>","<For keyed={false} each={local.columns}>\n {(column) => {\n const items = () => byColumn().get(column().id) ?? []\n const collapsed = () =>\n Boolean(local.collapseEmpty) && column().collapsible !== false && items().length === 0\n const over = () => overColumn() === column().id\n return (\n <section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>\n )\n }}\n </For>","keyed={false}","<BoardColumnDot tone={column().tone} />","<header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>","<BoardColumnCount count={column().count} />","<For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>","ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}","<article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>","<div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>","<header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>","aria-label={column().label}","data-collapsed={collapsed() ? '' : undefined}","<section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>","<div\n class={cn('flex min-h-0 gap-3 overflow-x-auto pb-2', local.class)}\n role=\"region\"\n aria-label={local.label ?? 'Board'}\n tabindex=\"0\"\n >\n {/*\n Index, not For: callers derive columns (a count, a tone) and hand over\n fresh objects whenever a card moves. Keyed by identity, every lane would\n remount on each move and take the moved card's restored focus with it.\n */}\n <For keyed={false} each={local.columns}>\n {(column) => {\n const items = () => byColumn().get(column().id) ?? []\n const collapsed = () =>\n Boolean(local.collapseEmpty) && column().collapsible !== false && items().length === 0\n const over = () => overColumn() === column().id\n return (\n <section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>\n )\n }}\n </For>\n {/*\n The keyboard move's result, announced. A drag speaks for itself — the card\n visibly moves — while a keyboard move happens with the focus elsewhere.\n */}\n <div class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">\n {announcement()}\n </div>\n </div>","aria-label={local.label ?? 'Board'}","<h4 class={cn(boardCardTitleVariants({ size: props.size }), props.class)}>{props.children}</h4>","<div class={cn('grid gap-1.5 p-2.5', props.class)}>{props.children}</div>","<button\n type={local.type ?? 'button'}\n data-slot=\"board-card-trigger\"\n class={cn(\n textVariants({ variant: 'label', tone: 'foreground' }),\n 'min-w-0 flex-1 truncate rounded-sm text-start outline-none',\n 'after:absolute after:inset-0 after:rounded-md',\n 'focus-visible:focus-outline',\n local.class\n )}\n {...rest}\n />","_$effect","_$readShallow","_$className","_$insert","_$ref","_$setAttribute","_$spread"],"sources":["../../../../src/components/ui/board/board.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createProjection,\n createSignal,\n For,\n onCleanup,\n Show,\n omit,\n untrack,\n} from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { badgeVariants } from '../badge'\nimport { headingVariants, textVariants } from '../typography'\n\n/**\n * Board.\n *\n * Columns of cards, with drag between them — the shape a task tracker, a CRM\n * pipeline, a support queue and a release plan all share. It is generic in the\n * one place that matters: the *column ids are the caller's*, and so is the rule\n * that decides which moves are legal. The component knows nothing about tasks.\n *\n * The transitions are a predicate rather than a derived table because the legal\n * moves in a real product are not \"any column to any column\". A task that is\n * `completed` may be archived but not re-queued; a lead may become a customer but\n * not a stranger again. A board that let you drop anything anywhere would encode\n * a state machine in the UI that the server rejects — so `canDrop` is required,\n * and a column that cannot receive the dragged card renders as unavailable rather\n * than silently accepting a drop that will fail.\n *\n * Three input methods, because a drag-only board is unusable by keyboard:\n * dragging with the pointer, `Ctrl`/`Cmd` + arrow keys to move a focused card\n * between columns, and whatever the caller wires into `actions`. The card is\n * focusable and its move is announced through a live region, so the board is\n * operable without a mouse.\n *\n * The card is rendered by the caller through `children`, given the item and a set\n * of drag props. That is deliberate: a card's contents are domain — a title, a\n * priority tag, an assignee — and a board that rendered them itself could only\n * ever serve one product.\n *\n * `collapseEmpty` folds a column with no cards to a strip one line of text wide,\n * its label turned on its side. A board of seven lanes where three are empty\n * otherwise spends half its width on nothing, and the lanes with work in them\n * are the ones that need the room. A folded lane is still a full-height drop\n * target and still accepts a keyboard move, so nothing about operating the\n * board changes; it does not unfold under a drag, because a lane that grows\n * under the pointer moves every lane after it and the drop lands somewhere else.\n *\n * Give the board a height (`class=\"h-full\"`) and each lane scrolls on its own;\n * leave it unconstrained and lanes grow with their cards and the page scrolls.\n */\n\n/**\n * A lane's identifying colour, drawn as a dot before its label. The chart hues,\n * in the order the token set gives them, because a lane colour tells lanes apart\n * like a series does; it carries no status. `neutral` is for a lane that should\n * not draw the eye — a backlog, an archive.\n */\nexport type BoardTone =\n | 'neutral'\n | 'chart-1'\n | 'chart-2'\n | 'chart-3'\n | 'chart-4'\n | 'chart-5'\n | 'chart-6'\n\nexport type BoardColumn = Readonly<{\n id: string\n label: string\n /** The number of cards, shown as an accent count beside the label. */\n count?: number\n /** A limit or any other note, shown after the count. */\n meta?: JSX.Element\n /** The lane's dot colour. Omitted, the header has no dot. */\n tone?: BoardTone\n /**\n * `false` keeps this lane open when it is empty under `collapseEmpty` — the\n * inbox lane new cards arrive in, which should always show where they land.\n */\n collapsible?: boolean\n /** Dim the column and refuse drops — a lane that is closed or read-only. */\n disabled?: boolean\n}>\n\nexport type BoardMove = Readonly<{\n itemId: string\n from: string\n to: string\n}>\n\nexport type BoardProps<T> = {\n columns: readonly BoardColumn[]\n items: readonly T[]\n itemId: (item: T) => string\n itemColumn: (item: T) => string\n /** Whether `item` may move from `from` to `to`. Required: see the note above. */\n canDrop: (item: T, from: string, to: string) => boolean\n onMove: (move: BoardMove) => void\n /** The card body. `dragging` is true while this card is the one being dragged. */\n children: (item: T, state: { dragging: boolean }) => JSX.Element\n emptyColumn?: (column: BoardColumn) => JSX.Element\n /** The board's accessible name. Defaults to \"Board\". */\n label?: string\n /** Fold columns with no cards to a narrow strip with a sideways label. */\n collapseEmpty?: boolean\n class?: string\n}\n\nconst cardDragState = {\n idle: '',\n dragging: 'opacity-40',\n} as const\n\nconst toneDot: Record<BoardTone, string> = {\n neutral: 'bg-muted-foreground',\n 'chart-1': 'bg-chart-1',\n 'chart-2': 'bg-chart-2',\n 'chart-3': 'bg-chart-3',\n 'chart-4': 'bg-chart-4',\n 'chart-5': 'bg-chart-5',\n 'chart-6': 'bg-chart-6',\n}\n\nfunction BoardColumnDot(props: { tone?: BoardTone }) {\n return (\n <Show when={props.tone}>\n {(tone) => (\n <span aria-hidden=\"true\" class={cn('size-2 shrink-0 rounded-full', toneDot[tone()])} />\n )}\n </Show>\n )\n}\n\nfunction BoardColumnCount(props: { count?: number }) {\n return (\n <Show when={props.count !== undefined}>\n {/* The Badge's classes, not the component: Board stays plain markup. */}\n <span\n class={cn(badgeVariants({ variant: 'subtle', size: 'sm' }), 'tabular-nums')}\n data-slot=\"board-column-count\"\n >\n {/* A string: the renderer assigns a lone number through textContent, and\n some DOMs (happy-dom) drop a 0 there, leaving no node to update. */}\n {String(props.count)}\n </span>\n </Show>\n )\n}\n\nexport function Board<T>(props: BoardProps<T>) {\n const local = props\n\n // The dragged item, not its id: `canDrop` takes the item itself, and the\n // pointer may leave the card before it is dropped.\n const [dragging, setDragging] = createSignal<T | null>(null)\n // Only the two cards whose answer flips update when a drag starts or ends.\n const draggingIds = createProjection<Record<string, true>>((draft) => {\n const current = dragging()\n const id = current ? local.itemId(current) : undefined\n for (const key of Object.keys(draft)) if (key !== id) delete draft[key]\n if (id !== undefined) draft[id] = true\n }, {})\n const isDraggingId = (id: string) => draggingIds[id] === true\n const [overColumn, setOverColumn] = createSignal<string | null>(null)\n const [announcement, setAnnouncement] = createSignal('')\n const cardElements = new Map<string, HTMLElement>()\n const [pendingFocus, setPendingFocus] = createSignal<{\n itemId: string\n columnId: string\n source: HTMLElement\n } | null>(null)\n const cancelOnPointer = () => setPendingFocus(null)\n\n // A controlled move can settle after a server response. Restore only the\n // focus that belonged to the moved card; another focus action cancels it.\n createEffect(pendingFocus, (pending) => {\n if (!pending) return\n const document = pending.source.ownerDocument\n const cancelOnFocus = (event: FocusEvent) => {\n if (!pending.source.contains(event.target as Node)) setPendingFocus(null)\n }\n document.addEventListener('focusin', cancelOnFocus)\n document.addEventListener('pointerdown', cancelOnPointer)\n return () => {\n document.removeEventListener('focusin', cancelOnFocus)\n document.removeEventListener('pointerdown', cancelOnPointer)\n }\n })\n\n // The compute answers \"has the pending card landed in its column\"; the apply\n // moves focus to it and clears the request.\n createEffect(\n () => {\n const pending = pendingFocus()\n if (!pending) return undefined\n const moved = local.items.find((item) => local.itemId(item) === pending.itemId)\n return moved && local.itemColumn(moved) === pending.columnId ? pending : undefined\n },\n (landed) => {\n if (!landed) return\n const target = cardElements.get(landed.itemId)\n setPendingFocus(null)\n if (target?.isConnected) target.focus()\n }\n )\n\n /**\n * `always` is for a pointer drop: dragging a card is a direct act on it, so it\n * ends focused wherever focus was. Chromium also blurs a focused control\n * inside a draggable once the native drag starts, so \"was focus in the card\"\n * cannot be read at drop time.\n */\n const prepareFocus = (item: T, columnId: string, source?: HTMLElement, always = false) => {\n const card = source ?? cardElements.get(local.itemId(item))\n if (card && (always || card.contains(card.ownerDocument.activeElement))) {\n setPendingFocus({ itemId: local.itemId(item), columnId, source: card })\n }\n }\n\n const byColumn = createMemo(() => {\n const grouped = new Map<string, T[]>()\n for (const column of local.columns) grouped.set(column.id, [])\n for (const item of local.items) grouped.get(local.itemColumn(item))?.push(item)\n return grouped\n })\n\n const accepts = (column: BoardColumn) => {\n const item = dragging()\n return Boolean(\n item && !column.disabled && local.canDrop(item, local.itemColumn(item), column.id)\n )\n }\n\n const drop = (column: BoardColumn) => {\n const item = dragging()\n const from = item ? local.itemColumn(item) : null\n const accepted = accepts(column)\n setDragging(null)\n setOverColumn(null)\n if (!item || !from || from === column.id || !accepted) return\n prepareFocus(item, column.id, undefined, true)\n local.onMove({ itemId: local.itemId(item), from, to: column.id })\n }\n\n /**\n * Keyboard move. `Ctrl`/`Cmd` plus an arrow is the convention for \"reorder this\n * thing within its container\" that does not collide with scrolling or with the\n * text caret, and it is the same chord a browser tab or a spreadsheet uses.\n */\n const moveByKeyboard = (item: T, direction: -1 | 1, source: HTMLElement) => {\n const from = local.itemColumn(item)\n const index = local.columns.findIndex((column) => column.id === from)\n if (index < 0) return\n const ordered =\n direction === 1 ? local.columns.slice(index + 1) : local.columns.slice(0, index).toReversed()\n const target = ordered.find(\n (column) => !column.disabled && local.canDrop(item, from, column.id)\n )\n if (!target) {\n setAnnouncement(`No column after ${from} accepts this item`)\n return\n }\n prepareFocus(item, target.id, source)\n local.onMove({ itemId: local.itemId(item), from, to: target.id })\n setAnnouncement(`Moved to ${target.label}`)\n }\n\n return (\n /*\n `role=\"region\"` + `tabindex=\"0\"` because the board scrolls horizontally and a\n keyboard user has to be able to scroll it — axe's `scrollable-region-focusable`.\n It is not enough that the cards are focusable: a board with empty columns, or\n with more columns than fit, has nothing focusable to scroll from.\n */\n <div\n class={cn('flex min-h-0 gap-3 overflow-x-auto pb-2', local.class)}\n role=\"region\"\n aria-label={local.label ?? 'Board'}\n tabindex=\"0\"\n >\n {/*\n Index, not For: callers derive columns (a count, a tone) and hand over\n fresh objects whenever a card moves. Keyed by identity, every lane would\n remount on each move and take the moved card's restored focus with it.\n */}\n <For keyed={false} each={local.columns}>\n {(column) => {\n const items = () => byColumn().get(column().id) ?? []\n const collapsed = () =>\n Boolean(local.collapseEmpty) && column().collapsible !== false && items().length === 0\n const over = () => overColumn() === column().id\n return (\n <section\n class={cn(\n 'flex shrink-0 flex-col rounded-lg border border-border bg-muted/40 transition-colors',\n {\n 'w-72': !collapsed(),\n 'w-10 items-center': collapsed(),\n 'border-dashed border-ring': accepts(column()) && !over(),\n 'border-ring bg-primary-subtle': accepts(column()) && over(),\n 'border-dashed opacity-60': over() && !accepts(column()),\n 'opacity-50': column().disabled,\n }\n )}\n aria-label={column().label}\n data-collapsed={collapsed() ? '' : undefined}\n onDragOver={(event) => {\n setOverColumn(column().id)\n if (accepts(column())) event.preventDefault()\n }}\n onDragLeave={(event) => {\n // Leaving for a child is not leaving the lane.\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setOverColumn((current) => (current === column().id ? null : current))\n }}\n onDrop={(event) => {\n event.preventDefault()\n drop(column())\n }}\n >\n <Show\n when={!collapsed()}\n fallback={\n <header class=\"flex flex-col items-center gap-2 py-3\">\n <BoardColumnDot tone={column().tone} />\n <BoardColumnCount count={column().count} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'muted' }),\n 'text-vertical'\n )}\n >\n {column().label}\n </h3>\n </header>\n }\n >\n <header class=\"flex h-10 shrink-0 items-center gap-2 px-3\">\n <BoardColumnDot tone={column().tone} />\n <h3\n class={cn(\n headingVariants({ size: 'subsection', leading: 'none', tone: 'foreground' }),\n 'truncate'\n )}\n >\n {column().label}\n </h3>\n <BoardColumnCount count={column().count} />\n <Show when={column().meta}>\n <span class=\"ms-auto text-2xs text-muted-foreground\">{column().meta}</span>\n </Show>\n </header>\n <div class=\"flex min-h-16 flex-1 flex-col gap-2 overflow-y-auto px-2 pb-2\">\n <For each={items()}>\n {(item) => {\n const isDragging = () => isDraggingId(local.itemId(item))\n // The row's owner unregisters the card: a ref callback cannot\n // own a cleanup.\n let card: HTMLElement | undefined\n let cardId: string | undefined\n onCleanup(() => {\n if (cardId !== undefined && cardElements.get(cardId) === card)\n cardElements.delete(cardId)\n })\n return (\n <article\n ref={(element: HTMLElement) => {\n card = element\n cardId = local.itemId(item)\n cardElements.set(cardId, element)\n }}\n class={cn(\n 'relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:focus-outline active:cursor-grabbing',\n cardDragState[isDragging() ? 'dragging' : 'idle']\n )}\n // A board card is a control that can be moved, so it is\n // focusable and carries the chord it responds to.\n tabindex=\"0\"\n aria-roledescription=\"Draggable card\"\n draggable=\"true\"\n onDragStart={(event) => {\n event.dataTransfer?.setData('text/plain', local.itemId(item))\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move'\n setDragging(() => item)\n }}\n onDragEnd={() => {\n setDragging(null)\n setOverColumn(null)\n }}\n onKeyDown={(event) => {\n if (!(event.ctrlKey || event.metaKey)) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n event.preventDefault()\n moveByKeyboard(\n item,\n event.key === 'ArrowRight' ? 1 : -1,\n event.currentTarget\n )\n }}\n >\n {/* The projection notifies only the card whose drag state\n changed, so a drag start or end re-runs that one card's\n render function (with a plain boolean, as the contract\n says) instead of every card's. The call itself is\n isolated with untrack, the same boundary a component\n call gets: reads inside the consumer's renderer belong\n to its own computations, and only the drag state\n re-runs this one. */}\n {(() => {\n const isItemDragging = isDragging()\n return untrack(() => local.children(item, { dragging: isItemDragging }))\n })()}\n </article>\n )\n }}\n </For>\n <Show when={items().length === 0}>\n <p class=\"rounded-md border border-dashed border-border px-2 py-4 text-center text-2xs text-muted-foreground\">\n {local.emptyColumn?.(column()) ?? 'Nothing here'}\n </p>\n </Show>\n </div>\n </Show>\n </section>\n )\n }}\n </For>\n {/*\n The keyboard move's result, announced. A drag speaks for itself — the card\n visibly moves — while a keyboard move happens with the focus elsewhere.\n */}\n <div class=\"visually-hidden\" role=\"status\" aria-live=\"polite\">\n {announcement()}\n </div>\n </div>\n )\n}\n\nexport const boardCardTitleVariants = cva('truncate font-medium text-foreground', {\n variants: { size: { sm: 'text-xs', md: 'text-sm' } },\n defaultVariants: { size: 'md' },\n})\n\nexport type BoardCardTitleProps = { class?: string; children: JSX.Element } & VariantProps<\n typeof boardCardTitleVariants\n>\n\n/** The card's title line, at the size a board card uses. */\nexport function BoardCardTitle(props: BoardCardTitleProps) {\n return (\n <h4 class={cn(boardCardTitleVariants({ size: props.size }), props.class)}>{props.children}</h4>\n )\n}\n\n/** A card's padding, so every card in an application is the same shape. */\nexport function BoardCardBody(props: { class?: string; children: JSX.Element }) {\n return <div class={cn('grid gap-1.5 p-2.5', props.class)}>{props.children}</div>\n}\n\n/**\n * The card's open action: its title, as a real button whose hit area stretches\n * over the whole card. A card is one target to a pointer — clicking anywhere on\n * it opens it — while assistive technology still meets a named button rather\n * than a clickable `article`. Other controls on the card sit above the stretched\n * area by being positioned (`class=\"relative\"`), so they keep their own click.\n */\nexport function BoardCardTrigger(props: ComponentProps<'button'>) {\n const local = props\n const rest = omit(props, 'class', 'type')\n return (\n <button\n type={local.type ?? 'button'}\n data-slot=\"board-card-trigger\"\n class={cn(\n textVariants({ variant: 'label', tone: 'foreground' }),\n 'min-w-0 flex-1 truncate rounded-sm text-start outline-none',\n 'after:absolute after:inset-0 after:rounded-md',\n 'focus-visible:focus-outline',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiHA,IAAM,gBAAgB;CACpB,MAAM;CACN,UAAU;AACZ;AAEA,IAAM,UAAqC;CACzC,SAAS;CACT,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;AACb;AAEA,SAAS,eAAe,OAA6B;CACnD,OACEA,gBAAAA,MAAAA;EAAM,IAAA,OAAA;GAAM,OAAA,MAAM;EAAI;EAAtBA,WACI,gBACA;GAAsF,IAAA,OAAA,OAAA;GAA7DoB,aAAAC,YAAO,GAAG,gCAAgC,QAAQ,KAAK,EAAE,CAAC,IAA1D,KAAA,QAAA;IAA0DC,UAAA,MAAA,KAAA,GAAA;;GAAnF,OAAA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