@namroodinc/liquid-editorial 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/README.md +17 -7
  2. package/UPGRADING.md +217 -0
  3. package/dist/chunks/{Board-BaQ04nWg.cjs → Board-BPA6mVhf.cjs} +2 -2
  4. package/dist/chunks/{Board-BaQ04nWg.cjs.map → Board-BPA6mVhf.cjs.map} +1 -1
  5. package/dist/chunks/{Board-CUhF8pTX.js → Board-CcIF7jS0.js} +2 -2
  6. package/dist/chunks/{Board-CUhF8pTX.js.map → Board-CcIF7jS0.js.map} +1 -1
  7. package/dist/chunks/{ColourField-CJicr3OT.cjs → ColourField-BQ4a5tAV.cjs} +2 -2
  8. package/dist/chunks/{ColourField-CJicr3OT.cjs.map → ColourField-BQ4a5tAV.cjs.map} +1 -1
  9. package/dist/chunks/{ColourField-DjHRiFDU.js → ColourField-Doew1hLw.js} +3 -3
  10. package/dist/chunks/{ColourField-DjHRiFDU.js.map → ColourField-Doew1hLw.js.map} +1 -1
  11. package/dist/chunks/{DatePicker-aSlYLjtW.cjs → DatePicker-C0-609Zx.cjs} +2 -2
  12. package/dist/chunks/{DatePicker-aSlYLjtW.cjs.map → DatePicker-C0-609Zx.cjs.map} +1 -1
  13. package/dist/chunks/{DatePicker-D_6CQpUd.js → DatePicker-DmeWUsOS.js} +2 -2
  14. package/dist/chunks/{DatePicker-D_6CQpUd.js.map → DatePicker-DmeWUsOS.js.map} +1 -1
  15. package/dist/chunks/{FormEditor-CaskinQ1.js → FormEditor-DTnFO4oS.js} +170 -154
  16. package/dist/chunks/FormEditor-DTnFO4oS.js.map +1 -0
  17. package/dist/chunks/FormEditor-DfQLJnsO.cjs +2 -0
  18. package/dist/chunks/FormEditor-DfQLJnsO.cjs.map +1 -0
  19. package/dist/chunks/Icon-D1kx7-1c.js +81 -0
  20. package/dist/chunks/Icon-D1kx7-1c.js.map +1 -0
  21. package/dist/chunks/Icon-D38lQXNe.cjs +2 -0
  22. package/dist/chunks/Icon-D38lQXNe.cjs.map +1 -0
  23. package/dist/chunks/RichTextEditor-DEJ-u-ZR.js +483 -0
  24. package/dist/chunks/RichTextEditor-DEJ-u-ZR.js.map +1 -0
  25. package/dist/chunks/RichTextEditor-Ddk7qaqg.cjs +2 -0
  26. package/dist/chunks/RichTextEditor-Ddk7qaqg.cjs.map +1 -0
  27. package/dist/chunks/movableHost-CajG9_5Z.cjs +2 -0
  28. package/dist/chunks/movableHost-CajG9_5Z.cjs.map +1 -0
  29. package/dist/chunks/movableHost-NJj_FsAu.js +23 -0
  30. package/dist/chunks/movableHost-NJj_FsAu.js.map +1 -0
  31. package/dist/chunks/portalScope-AzzPM54i.js +105 -0
  32. package/dist/chunks/portalScope-AzzPM54i.js.map +1 -0
  33. package/dist/chunks/portalScope-BVA1-Ypu.cjs +2 -0
  34. package/dist/chunks/portalScope-BVA1-Ypu.cjs.map +1 -0
  35. package/dist/chunks/useModalDialog-BVaG--b3.js +87 -0
  36. package/dist/chunks/useModalDialog-BVaG--b3.js.map +1 -0
  37. package/dist/chunks/useModalDialog-Ctu270Dp.cjs +2 -0
  38. package/dist/chunks/useModalDialog-Ctu270Dp.cjs.map +1 -0
  39. package/dist/components/AssetCard/index.cjs +1 -1
  40. package/dist/components/AssetCard/index.js +1 -1
  41. package/dist/components/AssetGrid/index.cjs +1 -1
  42. package/dist/components/AssetGrid/index.js +1 -1
  43. package/dist/components/Board/index.cjs +1 -1
  44. package/dist/components/Board/index.js +1 -1
  45. package/dist/components/Button/index.cjs +1 -1
  46. package/dist/components/Button/index.cjs.map +1 -1
  47. package/dist/components/Button/index.d.cts +5 -0
  48. package/dist/components/Button/index.d.cts.map +1 -1
  49. package/dist/components/Button/index.d.ts +5 -0
  50. package/dist/components/Button/index.d.ts.map +1 -1
  51. package/dist/components/Button/index.js +14 -12
  52. package/dist/components/Button/index.js.map +1 -1
  53. package/dist/components/Button/style.css +43 -11
  54. package/dist/components/ColourField/index.cjs +1 -1
  55. package/dist/components/ColourField/index.js +1 -1
  56. package/dist/components/DatePicker/index.cjs +1 -1
  57. package/dist/components/DatePicker/index.js +1 -1
  58. package/dist/components/Drawer/index.cjs +1 -1
  59. package/dist/components/Drawer/index.cjs.map +1 -1
  60. package/dist/components/Drawer/index.d.cts.map +1 -1
  61. package/dist/components/Drawer/index.d.ts.map +1 -1
  62. package/dist/components/Drawer/index.js +59 -75
  63. package/dist/components/Drawer/index.js.map +1 -1
  64. package/dist/components/Drawer/style.css +3 -0
  65. package/dist/components/EditLayout/index.cjs +1 -1
  66. package/dist/components/EditLayout/index.cjs.map +1 -1
  67. package/dist/components/EditLayout/index.d.cts.map +1 -1
  68. package/dist/components/EditLayout/index.d.ts.map +1 -1
  69. package/dist/components/EditLayout/index.js +107 -121
  70. package/dist/components/EditLayout/index.js.map +1 -1
  71. package/dist/components/EntryPicker/index.cjs +1 -1
  72. package/dist/components/EntryPicker/index.cjs.map +1 -1
  73. package/dist/components/EntryPicker/index.d.cts.map +1 -1
  74. package/dist/components/EntryPicker/index.d.ts.map +1 -1
  75. package/dist/components/EntryPicker/index.js +3 -9
  76. package/dist/components/EntryPicker/index.js.map +1 -1
  77. package/dist/components/FormEditor/README.md +79 -3
  78. package/dist/components/FormEditor/control.d.cts.map +1 -1
  79. package/dist/components/FormEditor/control.d.ts.map +1 -1
  80. package/dist/components/FormEditor/index.cjs +1 -1
  81. package/dist/components/FormEditor/index.d.cts.map +1 -1
  82. package/dist/components/FormEditor/index.d.ts.map +1 -1
  83. package/dist/components/FormEditor/index.js +2 -1
  84. package/dist/components/FormEditor/model.d.cts +6 -0
  85. package/dist/components/FormEditor/model.d.cts.map +1 -1
  86. package/dist/components/FormEditor/model.d.ts +6 -0
  87. package/dist/components/FormEditor/model.d.ts.map +1 -1
  88. package/dist/components/FormEditor/style.css +7 -0
  89. package/dist/components/Icon/icons.d.cts +2 -0
  90. package/dist/components/Icon/icons.d.cts.map +1 -1
  91. package/dist/components/Icon/icons.d.ts +2 -0
  92. package/dist/components/Icon/icons.d.ts.map +1 -1
  93. package/dist/components/Icon/index.cjs +1 -1
  94. package/dist/components/Icon/index.js +1 -1
  95. package/dist/components/Modal/index.cjs +1 -1
  96. package/dist/components/Modal/index.cjs.map +1 -1
  97. package/dist/components/Modal/index.d.cts +9 -1
  98. package/dist/components/Modal/index.d.cts.map +1 -1
  99. package/dist/components/Modal/index.d.ts +9 -1
  100. package/dist/components/Modal/index.d.ts.map +1 -1
  101. package/dist/components/Modal/index.js +37 -45
  102. package/dist/components/Modal/index.js.map +1 -1
  103. package/dist/components/Modal/style.css +8 -1
  104. package/dist/components/Popover/index.cjs +1 -1
  105. package/dist/components/Popover/index.cjs.map +1 -1
  106. package/dist/components/Popover/index.d.cts.map +1 -1
  107. package/dist/components/Popover/index.d.ts.map +1 -1
  108. package/dist/components/Popover/index.js +44 -37
  109. package/dist/components/Popover/index.js.map +1 -1
  110. package/dist/components/Popover/style.css +3 -0
  111. package/dist/components/RichTextEditor/expanded-width.d.cts +4 -0
  112. package/dist/components/RichTextEditor/expanded-width.d.cts.map +1 -0
  113. package/dist/components/RichTextEditor/expanded-width.d.ts +4 -0
  114. package/dist/components/RichTextEditor/expanded-width.d.ts.map +1 -0
  115. package/dist/components/RichTextEditor/expansion.d.cts +28 -0
  116. package/dist/components/RichTextEditor/expansion.d.cts.map +1 -0
  117. package/dist/components/RichTextEditor/expansion.d.ts +28 -0
  118. package/dist/components/RichTextEditor/expansion.d.ts.map +1 -0
  119. package/dist/components/RichTextEditor/index.cjs +1 -1
  120. package/dist/components/RichTextEditor/index.d.cts +4 -4
  121. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  122. package/dist/components/RichTextEditor/index.d.ts +4 -4
  123. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  124. package/dist/components/RichTextEditor/index.js +1 -1
  125. package/dist/components/RichTextEditor/style.css +85 -4
  126. package/dist/components/SearchField/index.cjs +1 -1
  127. package/dist/components/SearchField/index.js +1 -1
  128. package/dist/components/Select/index.cjs +1 -1
  129. package/dist/components/Select/index.js +1 -1
  130. package/dist/components/SideNav/index.cjs +1 -1
  131. package/dist/components/SideNav/index.js +1 -1
  132. package/dist/components/SortableList/index.cjs +1 -1
  133. package/dist/components/SortableList/index.cjs.map +1 -1
  134. package/dist/components/SortableList/index.d.cts +12 -2
  135. package/dist/components/SortableList/index.d.cts.map +1 -1
  136. package/dist/components/SortableList/index.d.ts +12 -2
  137. package/dist/components/SortableList/index.d.ts.map +1 -1
  138. package/dist/components/SortableList/index.js +126 -66
  139. package/dist/components/SortableList/index.js.map +1 -1
  140. package/dist/components/SortableList/style.css +19 -5
  141. package/dist/components/Stepper/index.cjs +1 -1
  142. package/dist/components/Stepper/index.js +1 -1
  143. package/dist/components/SubNav/index.cjs +1 -1
  144. package/dist/components/SubNav/index.js +1 -1
  145. package/dist/components/Table/index.cjs +1 -1
  146. package/dist/components/Table/index.js +1 -1
  147. package/dist/components/Toast/index.cjs +1 -1
  148. package/dist/components/Toast/index.js +1 -1
  149. package/dist/components/TopNav/index.cjs +1 -1
  150. package/dist/components/TopNav/index.js +1 -1
  151. package/dist/index.cjs +1 -1
  152. package/dist/index.d.cts +1 -1
  153. package/dist/index.d.cts.map +1 -1
  154. package/dist/index.d.ts +1 -1
  155. package/dist/index.d.ts.map +1 -1
  156. package/dist/index.js +30 -30
  157. package/dist/internal/dialogFocus.d.cts +8 -0
  158. package/dist/internal/dialogFocus.d.cts.map +1 -1
  159. package/dist/internal/dialogFocus.d.ts +8 -0
  160. package/dist/internal/dialogFocus.d.ts.map +1 -1
  161. package/dist/internal/movableHost.d.cts +20 -0
  162. package/dist/internal/movableHost.d.cts.map +1 -0
  163. package/dist/internal/movableHost.d.ts +20 -0
  164. package/dist/internal/movableHost.d.ts.map +1 -0
  165. package/dist/internal/portalScope.d.cts +23 -0
  166. package/dist/internal/portalScope.d.cts.map +1 -0
  167. package/dist/internal/portalScope.d.ts +23 -0
  168. package/dist/internal/portalScope.d.ts.map +1 -0
  169. package/dist/internal/useModalDialog.d.cts +22 -0
  170. package/dist/internal/useModalDialog.d.cts.map +1 -0
  171. package/dist/internal/useModalDialog.d.ts +22 -0
  172. package/dist/internal/useModalDialog.d.ts.map +1 -0
  173. package/package.json +1 -1
  174. package/dist/chunks/FormEditor-CaskinQ1.js.map +0 -1
  175. package/dist/chunks/FormEditor-DDylpJ9O.cjs +0 -2
  176. package/dist/chunks/FormEditor-DDylpJ9O.cjs.map +0 -1
  177. package/dist/chunks/Icon-BBoWP_Y6.cjs +0 -2
  178. package/dist/chunks/Icon-BBoWP_Y6.cjs.map +0 -1
  179. package/dist/chunks/Icon-XNismJDm.js +0 -79
  180. package/dist/chunks/Icon-XNismJDm.js.map +0 -1
  181. package/dist/chunks/RichTextEditor-C7nMfDmE.cjs +0 -2
  182. package/dist/chunks/RichTextEditor-C7nMfDmE.cjs.map +0 -1
  183. package/dist/chunks/RichTextEditor-DjR10XJ-.js +0 -370
  184. package/dist/chunks/RichTextEditor-DjR10XJ-.js.map +0 -1
  185. package/dist/chunks/dialogFocus-B9iqKl3I.cjs +0 -2
  186. package/dist/chunks/dialogFocus-B9iqKl3I.cjs.map +0 -1
  187. package/dist/chunks/dialogFocus-BFoyeTpA.js +0 -48
  188. package/dist/chunks/dialogFocus-BFoyeTpA.js.map +0 -1
  189. package/dist/chunks/dialogStack-6yv3NXFD.js +0 -43
  190. package/dist/chunks/dialogStack-6yv3NXFD.js.map +0 -1
  191. package/dist/chunks/dialogStack-C9SLVu6Q.cjs +0 -2
  192. package/dist/chunks/dialogStack-C9SLVu6Q.cjs.map +0 -1
package/README.md CHANGED
@@ -178,7 +178,7 @@ import { Avatar, Button } from "@namroodinc/liquid-editorial";
178
178
  </>;
179
179
  ```
180
180
 
181
- `isDisabled` and `isPending` block presses. Pending buttons show the shared spinner. Name icon-only controls with `aria-label` or `aria-labelledby`. Use `xs` for compact clear/remove actions; a custom glyph goes in children with `iconStart` omitted.
181
+ `isDisabled` and `isPending` block presses. Pending buttons show the shared spinner. Add `isFocusableWhenDisabled` when a blocked button must keep focus, such as a reorder grip while a save runs: it is marked `aria-disabled` instead of native `disabled`, keeps the standard disabled look, and still blocks clicks and form submission. Name icon-only controls with `aria-label` or `aria-labelledby`. Use `xs` for compact clear/remove actions; a custom glyph goes in children with `iconStart` omitted.
182
182
 
183
183
  ### ButtonGroup
184
184
 
@@ -251,7 +251,7 @@ export function ArticleMenu({ onEdit, onDelete }: { onEdit: () => void; onDelete
251
251
 
252
252
  ### Modal
253
253
 
254
- A controlled dialog for a focused task. Supply `isOpen`, `onClose`, and a string `title`. Size defaults to `"md"`; `"dialog"` and `"wide"` are also available.
254
+ A controlled dialog for a focused task. Supply `isOpen`, `onClose`, and a string `title`. Size defaults to `"md"`; `"dialog"`, `"wide"` and `"full"` (the viewport inside the scrim's gutters) are also available.
255
255
 
256
256
  ```tsx
257
257
  import { useState } from "react";
@@ -286,7 +286,9 @@ export function ConfirmPublish({ onPublish }: { onPublish: () => void }) {
286
286
  }
287
287
  ```
288
288
 
289
- Modal portals to the body, traps Tab, locks scrolling, and restores the opener on close. Tab wraps between the first and last rendered controls, counting a radio group as one stop, and focus that leaves the panel returns on the next Tab. Escape, the scrim, and Close request dismissal; the app updates `isOpen`. Nested dialogs share the dialog stack and scroll lock.
289
+ Modal portals to the body, traps Tab and locks scrolling. Opening focuses the first control unless focus is already inside the panel (for example through `autoFocus`). Closing returns focus to the opener only when closing dropped it, and falls back to the opener's nearest focusable container, such as an enclosing Drawer, when the opener can no longer take focus. Tab wraps between the first and last rendered controls, counting a radio group as one stop, and focus that leaves the panel returns on the next Tab. Escape, the scrim, and Close request dismissal; the app updates `isOpen`. A popup inside the panel (Menu, Select, DateField) handles Escape first, and Escape that ends an IME composition never closes the dialog. Nested dialogs share the dialog stack and scroll lock.
290
+
291
+ `hasHeader={false}` removes the title band and its Close button. The title (and description) still name and describe the dialog, so provide another visible way to close it. `aria-label` or `aria-labelledby` replace the title as the dialog's name, as on Drawer. Modal and Drawer share one dialog hook, so their focus, Escape and Tab behaviour match.
290
292
 
291
293
  ### Drawer
292
294
 
@@ -324,7 +326,7 @@ export function MetadataDrawer() {
324
326
 
325
327
  Use `variant="navigation"` for compact navigation, `closeLabel` for contextual dismissal copy, and a React-node `title` for a brand. Supply `aria-label` for an independent dialog name. `portalContainer` can keep a navigation drawer inside a positioned element; the default covers the viewport from `document.body`.
326
328
 
327
- Keep Drawer mounted while changing `isOpen`: closing immediately makes the exiting panel inert and accessibility-hidden, restores focus without scrolling, and releases its scroll lock; DOM removal follows the transition. Tests should await removal. Tab follows Modal's rules. Only the topmost dialog handles Tab/Escape, and an open popup inside Drawer can handle Escape first. Nested dialogs keep body scrolling locked until the last one closes; scrollbar compensation preserves layout widths.
329
+ Keep Drawer mounted while changing `isOpen`: closing immediately makes the exiting panel inert and accessibility-hidden, restores focus without scrolling, and releases its scroll lock; DOM removal follows the transition. Tests should await removal. Focus and Tab follow Modal's rules. Only the topmost dialog handles Tab/Escape, and an open popup inside Drawer can handle Escape first. Nested dialogs keep body scrolling locked until the last one closes; scrollbar compensation preserves layout widths.
328
330
 
329
331
  ### Popover
330
332
 
@@ -1066,7 +1068,13 @@ export function ArticleBody() {
1066
1068
  }
1067
1069
  ```
1068
1070
 
1069
- Use `value`/`onChange` for controlled content or `defaultValue` for local content. Sizes are `sm`, `md` (default), and `lg`; `isDisabled` prevents editing. `toolbarExtra` appends app controls. Unsupported JSON produces an error and remains uneditable until corrected.
1071
+ Use `value`/`onChange` for controlled content or `defaultValue` for local content. Sizes are `sm`, `md` (default), and `lg`; `isDisabled` prevents editing. `toolbarExtra` appends app controls before the expand button. Unsupported JSON produces an error and remains uneditable until corrected.
1072
+
1073
+ Every editor includes Expand editor / Collapse editor controls. The expanded writing view is a headerless `Modal` (`hasHeader={false}`), so it shares Modal's scrim, frame, motion, focus trap, scroll lock and Escape handling. Set `expandedWidth="wide"` (default, Modal's 920px `wide` size) or `expandedWidth="full"` (Modal's `full` size: viewport width with 24px gutters). The existing `size` prop controls inline height. The same mounted TipTap editor, toolbar, `toolbarExtra` controls, selection, undo history and HTML/JSON callbacks remain in use; toggling alone does not emit changes. Both transitions bring the caret into view. Escape, the collapse control or a direct scrim press returns the editor inline. A nested link dialog closes first on Escape. Disabling the editor or loading unsupported content closes expansion and keeps focus in the nearest focusable container around the editor.
1074
+
1075
+ Escape typed in the editor is no longer swallowed: it closes the expanded view, or an enclosing Modal or Drawer when inline. Escape bound by an editor extension, or ending an IME composition, stays with the editor.
1076
+
1077
+ `.ds-rte` remains the outermost element, so `className`, the forwarded ref and grid or flex placement keep working. While expanded, it keeps its height and shows a placeholder; the toolbar and content (`.ds-rte__surface`) move into the Modal (`.ds-rte__modal`) and back without remounting. Style the toolbar and content through `.ds-rte__surface` rather than descendant selectors under `.ds-rte`. Overlays opened from the editor carry its `data-theme`, `lang` and `dir`. Server-rendered editors hydrate inline markup first and move it into the expandable host once, straight after hydration. Expansion is local UI state and is not saved with content.
1070
1078
 
1071
1079
  Links open a URL modal from the toolbar or an existing body link. Saving preserves selected text/formatting; with no selection, the URL becomes linked text. Existing links offer Remove link. The application owns storage and any server-side processing of editor output.
1072
1080
 
@@ -1606,7 +1614,9 @@ export function ReadingOrder() {
1606
1614
  }
1607
1615
  ```
1608
1616
 
1609
- Use stable unique IDs in render order. SortableListItem accepts an `action` slot for a Button/Menu; `renderDragOverlay` overrides the default row-content preview. Name each item for keyboard drag announcements.
1617
+ Use stable unique IDs in render order. SortableListItem accepts an `action` slot for a Button/Menu. By default the dragged row itself moves, lifted with a shadow, keeping its current input values, focus, actions and styling; nothing is copied. `renderDragOverlay` instead shows inert custom content in a floating preview sized to that content, leaving the row behind as a faded placeholder. Name each item for keyboard drag announcements.
1618
+
1619
+ Set `isDisabled` on SortableList while saving: the same handles stay visible and focusable, marked `aria-disabled`, and cannot start a drag. A drop after disabling cannot change order. Row content is yours to disable. Set `isDisabled` on an individual SortableListItem to disable only its handle. `onDragStart(id)`, `onDragEnd(id)` and `onDragCancel(id)` report pointer and keyboard drags; use the start callback to collapse details, and rows are measured again when the dragged row changes size. Escape during a drag cancels only the drag; an enclosing Modal or Drawer stays open until the next Escape. The forwarded ref and native list attributes target the `ul`.
1610
1620
 
1611
1621
  ### AssetCard
1612
1622
 
@@ -1761,7 +1771,7 @@ Set `data-theme` on the document root to `light` (the default), `dark`, `cherry-
1761
1771
  }
1762
1772
  ```
1763
1773
 
1764
- Theme tokens are included in `styles.css`. Import `@namroodinc/liquid-editorial/tokens.css` when you only need the token system. Keep themes on the document root so body-portaled dialogs and popovers inherit them. Layouts support RTL and reduced-motion preferences where described in their guides.
1774
+ Theme tokens are included in `styles.css`. Import `@namroodinc/liquid-editorial/tokens.css` when you only need the token system. Keep themes on the document root so body-portaled dialogs and popovers inherit them. Overlays opened from inside a component that knows its place on the page carry that place's `data-theme`, `lang` and `dir` as attributes: a Popover takes them from its anchor, and RichTextEditor's expanded view, link dialog and anything opened from them take them from the editor. Other Modals and Drawers inherit from the document root; pass `dir` to Drawer explicitly where needed. Layouts support RTL and reduced-motion preferences where described in their guides.
1765
1775
 
1766
1776
  ## Upgrading
1767
1777
 
package/UPGRADING.md CHANGED
@@ -2,6 +2,223 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.6.0
6
+
7
+ ### Breaking changes
8
+
9
+ - `SortableList.onDragStart` is a sortable lifecycle callback receiving the item
10
+ ID, rather than an inherited native HTML drag event. Move any native drag
11
+ handler to another element.
12
+ - By default the dragged SortableList row itself moves, instead of a copy of its
13
+ content in a floating overlay. The default drag no longer renders
14
+ `[data-overlay]` or dims the source row. `data-dragging` is now `"lifted"`
15
+ for the moving row, or `"placeholder"` when `renderDragOverlay` supplies the
16
+ preview; selectors testing only for the attribute still match.
17
+
18
+ ### Sortable rows drag in place, with focusable disabled handles
19
+
20
+ Dragging moves the real row with everything it shows: grip, current form values,
21
+ selected radios and options, canvases and embeds, actions, badges and custom row
22
+ styling. Nothing is copied, so there are no duplicate controls, IDs or form
23
+ values while dragging. The row lifts above its neighbours with a shadow and a
24
+ grabbing cursor. If the dragged row changes size during the drag, for example
25
+ details collapsed through `onDragStart`, every row is measured again so drops
26
+ land where the row is seen. `renderDragOverlay` remains an explicit override: it
27
+ shows inert custom content in a floating preview sized to that content, while
28
+ the row stays behind as a faded placeholder.
29
+
30
+ Set `isDisabled` on SortableList while saving. Rows and handles stay mounted and
31
+ visible; handles stay focusable, are marked `aria-disabled` and cannot start a
32
+ drag, so a keyboard user keeps their place after a reorder triggers a save. A
33
+ drag dropped after the list becomes disabled cannot change its internal order or
34
+ call `onReorder`. SortableListItem also accepts `isDisabled` to disable just its
35
+ handle. Reorderable EntryPickers use these defaults, including when disabled.
36
+
37
+ `onDragStart(id)`, `onDragEnd(id)` and `onDragCancel(id)` expose pointer and
38
+ keyboard drag lifecycle events. Use `onDragStart` to collapse row details.
39
+ While dragging, Escape cancels only the drag and keeps enclosing Modals and
40
+ Drawers open; the next Escape can dismiss the dialog normally.
41
+
42
+ Button gains `isFocusableWhenDisabled`. While `isDisabled` or `isPending` blocks
43
+ presses, the button keeps focus and is marked `aria-disabled` instead of native
44
+ `disabled`; clicks and form submission stay blocked. Buttons with
45
+ `aria-disabled="true"` now share the standard disabled look, without hover or
46
+ pressed fills.
47
+
48
+ #### Adoption and compatibility
49
+
50
+ Remove full-row preview clones, sortable disabled wrappers and drag-specific
51
+ dialog holds from consuming applications. Import SortableList and
52
+ SortableListItem directly from the package. Remove compact `renderDragOverlay`
53
+ callbacks to drag complete rows. Keep application state updates in `onReorder`,
54
+ and choose application-specific collapse behavior through `onDragStart`.
55
+
56
+ SortableList's `isDisabled` disables reordering only. Disable row inputs and
57
+ actions in your own row content while saving, as EntryPicker and FormEditor
58
+ already do. Assertions on a disabled grip should check
59
+ `aria-disabled="true"`, not the native `disabled` state. The forwarded ref and
60
+ native list attributes still target the `ul`, with no extra wrapper.
61
+
62
+ A dragged row is transformed in place, so an ancestor with `overflow: hidden`
63
+ clips it at that ancestor's edges; scrolling ancestors auto-scroll as before.
64
+ Review custom styles on `[data-overlay]` and `[data-dragging]`. Review any
65
+ Button given `aria-disabled="true"` directly, which now looks disabled. No data
66
+ or dependency changes are required.
67
+
68
+ #### Verification
69
+
70
+ Test pointer and keyboard reordering and cancellation with complete rows,
71
+ including edited inputs, checked radios, selects, actions, badges and expanded
72
+ details. Verify one copy of each control and form value exists during a drag,
73
+ the grip keeps focus after a keyboard drop and while saving disables it, Escape
74
+ leaves enclosing dialogs open, and disabling during a drag prevents a late drop.
75
+ Collapse details in `onDragStart` and check drops land on the visible target.
76
+ Check the grabbing cursor, rows inside clipped or scrolling containers, narrow
77
+ layouts, EntryPicker disabled states, custom overlays and focusable disabled
78
+ Buttons, then run library and consumer lint, typecheck, tests and builds.
79
+
80
+ ## 0.5.0
81
+
82
+ ### Breaking changes
83
+
84
+ - FormEditor now wraps every value-bearing `.ds-field` in a shared Container.
85
+ Update direct-child CSS selectors to account for `.ds-form-editor__field`
86
+ between `.ds-form-editor` and `.ds-field`.
87
+ - Omitted field widths default to `"lg"`, capping existing fields at
88
+ `--width-lg` (60rem). Review forms with columns wider than that measure.
89
+ - RichTextEditor's toolbar and content now sit in
90
+ `.ds-rte__slot > .ds-rte__host > .ds-rte__surface` inside `.ds-rte`, and move
91
+ into a Modal (`.ds-rte__modal`) while expanded. Selectors through
92
+ `.ds-rte > div`, or descendant selectors under `.ds-rte`, no longer reach the
93
+ expanded toolbar and content; target `.ds-rte__surface` instead. `.ds-rte`
94
+ stays the outermost element, so `className`, the ref and layout are unchanged.
95
+ - Escape typed in an inline RichTextEditor now reaches an enclosing Drawer and
96
+ closes it, as it already closed an enclosing Modal. Escape bound by an editor
97
+ extension, or ending an IME composition, still stays with the editor.
98
+
99
+ ### RichTextEditor expanded writing view
100
+
101
+ Every RichTextEditor, including FormEditor rich-text fields, gains a right-aligned
102
+ Expand editor / Collapse editor button. The writing view is a headerless Modal,
103
+ so it shares Modal's scrim, frame, motion, dialog stack, focus trap, nested
104
+ scroll lock and Escape rules. The inline frame keeps its height and shows a
105
+ placeholder. Escape, the collapse button or a direct scrim press returns the
106
+ editor inline; a nested link dialog handles Escape first. Both transitions bring
107
+ the caret into view. Disabling the editor or loading unsupported content closes
108
+ expansion and keeps focus in the nearest focusable container around the editor.
109
+
110
+ Dialog focus trapping now treats links being edited as document content rather
111
+ than additional native Tab stops. Explicit tab stops and noneditable widget
112
+ links continue to participate normally.
113
+
114
+ #### Adoption and compatibility
115
+
116
+ No opt-in is required. Set `expandedWidth: "wide" | "full"` on a standalone
117
+ RichTextEditor or FormEditor's `richText` schema field. `"wide"` uses Modal's
118
+ 920px `wide` size; `"full"` uses Modal's new `full` size, the viewport width with
119
+ 24px gutters. Runtime schemas with any other `expandedWidth` now throw
120
+ `Rich text field <id> needs an expandedWidth of wide or full.` Inline height
121
+ still uses standalone `size: "sm" | "md" | "lg"` (`md`); there is no
122
+ `editorSize` alias. `RichTextEditorExpandedWidth` is exported from the root and
123
+ component entry points. `toolbarExtra` remains before the expand control.
124
+
125
+ The same mounted editor, toolbar and `toolbarExtra` controls preserve content,
126
+ selection, undo history and controlled updates, and the forwarded ref keeps one
127
+ `.ds-rte` node. Disabling and re-enabling no longer moves the editor, so its
128
+ scroll position and selection stay put; focus leaves a disabled editor as it
129
+ leaves a native disabled control. Server-rendered editors hydrate their inline
130
+ markup, then move it into the expandable host once. Toggling does not emit
131
+ HTML/JSON changes, and FormEditor stores the same document shape. The writing
132
+ view and link dialog carry the editor's `data-theme`, `lang` and `dir`.
133
+ Expansion is local UI state and does not require a content migration.
134
+
135
+ #### Verification
136
+
137
+ Typecheck new options and review selectors listed under breaking changes. Check
138
+ typing, formatting, selection and undo/redo before and after expansion,
139
+ including controlled HTML/JSON. Verify placeholder height, wide/full widths,
140
+ toolbar wrapping, content scrolling and that the caret is visible after each
141
+ transition. Check keyboard focus, Escape and link dialogs, Escape inside an
142
+ enclosing Modal or Drawer, IME input, disabled/error transitions, unmount
143
+ cleanup, scoped themes, language, direction and reduced motion.
144
+
145
+ ### Shared dialog behaviour and overlay scope
146
+
147
+ Modal and Drawer now share one internal dialog hook, so their focus, Escape and
148
+ Tab behaviour match:
149
+
150
+ - Modal leaves Escape to a popup inside it (Menu, Select, DateField), as Drawer
151
+ already did. Neither closes on an Escape that ends an IME composition.
152
+ - Opening keeps focus that `autoFocus` or the caller already placed inside the
153
+ panel; otherwise the first control is focused as before.
154
+ - Closing returns focus to the opener only when closing dropped it. When the
155
+ opener can no longer take focus, focus moves to its nearest focusable
156
+ container, such as an enclosing Drawer panel, instead of the page.
157
+ - A direct scrim press no longer moves focus before closing.
158
+
159
+ Modal gains `hasHeader={false}`, which removes the title band and Close button
160
+ while the title still names the dialog, and `size="full"`. Like Drawer, it takes
161
+ its name from `aria-label` or `aria-labelledby` when given. Modal's header
162
+ alignment is unchanged.
163
+
164
+ Popovers carry their anchor's `data-theme`, `lang` and `dir` to their
165
+ body-mounted panel and to overlays opened from it. RichTextEditor does the same
166
+ for its writing view and link dialog. Other Modals and Drawers still inherit
167
+ from the document root, and Drawer's explicit `dir` wins. Modal, Drawer and
168
+ Popover panels now set `color: var(--color-text)` themselves rather than
169
+ inheriting the page's text colour.
170
+
171
+ #### Adoption and compatibility
172
+
173
+ No changes are required. Review Modals that relied on Escape closing them while
174
+ a popup inside was open, and apps whose body text colour differs from
175
+ `--color-text` inside dialogs, drawers or popovers.
176
+
177
+ #### Verification
178
+
179
+ Open and close Modals and Drawers with keyboard and pointer, including nested
180
+ pickers and popups, `autoFocus` fields and openers that become disabled. Check
181
+ Escape with an IME. Check popovers inside a scoped `data-theme`, `lang` or `dir`
182
+ region, and dialog text colour in each theme.
183
+
184
+ ### FormEditor field widths
185
+
186
+ Every value-bearing schema field accepts an optional `width: "sm" | "md" | "lg"`.
187
+ FormEditor wraps the whole Field (label, control, hint and error) in Container
188
+ with `padded={false}`, `center={false}` and the field's width. Container owns
189
+ the `"lg"` default and the shared measures: `--width-sm` (30rem), `--width-md`
190
+ (40rem) and `--width-lg` (60rem). Fields shrink to a narrower grid column and
191
+ sit at the start of a wider one. Dividers keep spanning all columns.
192
+ Stored values, validation results and standalone Field props are unchanged.
193
+
194
+ #### Adoption
195
+
196
+ Set `width: "sm"` or `width: "md"` on fields that need a narrower measure;
197
+ omit it or use `"lg"` for the default. Adjust any direct-child selectors as
198
+ described above. Read the packaged FormEditor reference for examples and the
199
+ layout contract.
200
+
201
+ #### Compatibility
202
+
203
+ FormEditor disables size containment and the container name on its field
204
+ wrappers, without changing standalone Container. Forms in popovers, flex rows
205
+ or `auto` tracks keep their content width, picker drag overlays stay aligned
206
+ with the pointer, and container queries
207
+ inside fields resolve against the same ancestor as before. Schemas loaded at
208
+ runtime now fail fast if `width` is anything other than `"sm"`, `"md"` or
209
+ `"lg"`: FormEditor and `validateFormValues` throw
210
+ `Field <id> needs a width of sm, md or lg.`
211
+
212
+ #### Verification
213
+
214
+ Typecheck the consuming project with any new `width` options. Check explicit and
215
+ default widths in wide and narrow forms, multi-column layouts, modals, drawers
216
+ and any content-sized slot such as a popover. Confirm labels, hints, errors and
217
+ grouped controls stay together, dividers span the form, fields do not overflow,
218
+ and reordering a multiple asset or reference picker keeps the dragged row under
219
+ the pointer. Verify editing and clearing still preserve the expected values and
220
+ accessibility bindings.
221
+
5
222
  ## 0.4.1
6
223
 
7
224
  ### FormEditor number affixes
@@ -1,2 +1,2 @@
1
- const e=require("./Icon-BBoWP_Y6.cjs"),t=require("../components/Button/index.cjs"),n=require("./mergeRefs-Bc3qS0Tt.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("@dnd-kit/core"),o=require("@dnd-kit/sortable"),s=require("@dnd-kit/utilities");function c({active:e,over:t},n){if(!t)return;let r=t.data.current??{},i=r.type===`column`?String(t.id):String(r.columnId??``),a=n.indexOf(i);if(!(a<0||i===String(e.id)))return{columnId:String(e.id),toIndex:a}}function l({active:e,over:t}){if(!t)return;let n=String(e.data.current?.columnId??``),r=t.data.current??{},i=r.type===`card`,a=String(r.columnId??(i?``:t.id)),o=i?r.sortable?.index??0:(r.items??[]).length;if(a&&(n!==a||String(e.id)!==String(t.id)))return{cardId:String(e.id),fromColumnId:n,toColumnId:a,toIndex:o}}var u=(e,t)=>{let{currentCoordinates:n,context:r}=t;if(e.code===`ArrowLeft`||e.code===`ArrowRight`){let t=r.droppableContainers.getEnabled().filter(e=>e.data.current?.type===`column-body`).sort((e,t)=>(e.rect.current?.left??0)-(t.rect.current?.left??0)),i=r.active?.rect.current.translated;if(!i)return;let a=t[t.findIndex(e=>(e.rect.current?.left??0)<=i.left+1&&(e.rect.current?.right??0)>=i.left-1)+(e.code===`ArrowRight`?1:-1)]?.rect.current;return a?(e.preventDefault(),{x:a.left+a.width/2-i.width/2,y:n.y}):void 0}return(0,o.sortableKeyboardCoordinates)(e,t)},d=e=>{let t=e.active.data.current?.type===`column`,n=e.droppableContainers.filter(e=>{let n=e.data.current?.type;return t?n===`column`:n!==`column`}),r={...e,droppableContainers:n};if(t)return(0,a.closestCorners)(r);let i=(0,a.pointerWithin)(r);if(i.length>0){let e=e=>n.find(t=>t.id===e)?.data.current?.type===`card`?0:1;return[...i].sort((t,n)=>e(t.id)-e(n.id))}return(0,a.closestCorners)(r)},f=(0,r.createContext)({activeId:null,activeType:null,overColumnId:null}),p=(0,r.forwardRef)(function({columnIds:t,onMove:n,onColumnMove:s,renderDragOverlay:p,renderColumnDragOverlay:m,className:h,children:g,..._},v){let y=(0,r.useId)(),[b,x]=(0,r.useState)(null),[S,C]=(0,r.useState)(null),[w,T]=(0,r.useState)(null),E=(0,a.useSensors)((0,a.useSensor)(a.PointerSensor,{activationConstraint:{distance:4}}),(0,a.useSensor)(a.KeyboardSensor,{coordinateGetter:u})),D=(0,r.useCallback)(e=>{x(String(e.active.id)),C(e.active.data.current?.type===`column`?`column`:`card`)},[]),O=(0,r.useCallback)(e=>{let t=e.over;if(!t){T(null);return}let n=t.data.current??{},r=n.type===`column`?String(t.id):String(n.columnId??``);T(r||null)},[]),k=(0,r.useCallback)(()=>{x(null),C(null),T(null)},[]),A=(0,r.useCallback)(e=>{let{active:r,over:i}=e;if(k(),i){if(r.data.current?.type===`column`){let n=c(e,t??[]);n&&s?.(n)}else{let t=l(e);t&&n?.(t)}}},[t,s,n,k]),j=(0,r.useMemo)(()=>({activeId:b,activeType:S,overColumnId:w}),[b,S,w]),M=(0,i.jsx)(`div`,{ref:v,className:[`ds-board`,h].filter(Boolean).join(` `),..._,children:g});return(0,i.jsx)(f.Provider,{value:j,children:(0,i.jsxs)(a.DndContext,{id:`ds-board-${y}`,sensors:E,collisionDetection:d,measuring:{droppable:{strategy:a.MeasuringStrategy.Always}},onDragStart:D,onDragOver:O,onDragEnd:A,onDragCancel:k,children:[t?(0,i.jsx)(o.SortableContext,{items:t,strategy:o.horizontalListSortingStrategy,children:M}):M,(0,i.jsxs)(a.DragOverlay,{children:[b&&S===`card`?(0,i.jsxs)(`div`,{className:`ds-board-card`,"data-overlay":!0,children:[(0,i.jsx)(`span`,{className:`ds-board-card__handle`,"aria-hidden":`true`,children:(0,i.jsx)(e.t,{name:`grip-vertical`})}),(0,i.jsx)(`div`,{className:`ds-board-card__content`,children:p?.(b)})]}):null,b&&S===`column`?(0,i.jsx)(`div`,{className:`ds-board-column`,"data-overlay":!0,children:m?.(b)}):null]})]})})}),m=(0,r.forwardRef)(function({id:e,title:c,itemIds:l,count:u,action:d,isDraggable:p=!0,className:m,children:h,...g},_){let{activeType:v,overColumnId:y}=(0,r.useContext)(f),{setNodeRef:b}=(0,a.useDroppable)({id:`${e}::body`,data:{type:`column-body`,columnId:e,items:l}}),{attributes:x,listeners:S,setNodeRef:C,transform:w,transition:T,isDragging:E}=(0,o.useSortable)({id:e,disabled:!p,data:{type:`column`,columnId:e,items:l}});return(0,i.jsxs)(`section`,{ref:n.t(C,_),style:{transform:s.CSS.Translate.toString(w),transition:T},className:[`ds-board-column`,m].filter(Boolean).join(` `),"data-over":v===`card`&&y===e||void 0,"data-dragging":E||void 0,"aria-label":c,...g,children:[p&&(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,iconStart:`grip-horizontal`,className:`ds-board-column__grip`,"aria-label":`Reorder ${c}`,...x,...S}),(0,i.jsxs)(`header`,{className:`ds-board-column__head`,children:[(0,i.jsx)(`span`,{className:`ds-board-column__title`,children:c}),(0,i.jsx)(`span`,{className:`ds-board-column__count`,children:u??l.length}),d&&(0,i.jsx)(`span`,{className:`ds-board-column__action`,children:d})]}),(0,i.jsx)(`div`,{ref:b,className:`ds-board-column__body`,children:(0,i.jsx)(o.SortableContext,{items:l,strategy:o.verticalListSortingStrategy,children:h})})]})}),h=(0,r.forwardRef)(function({id:e,columnId:a,label:c,className:l,children:u,...d},p){let{attributes:m,listeners:h,setNodeRef:g,transform:_,transition:v,isDragging:y}=(0,o.useSortable)({id:e,data:{type:`card`,columnId:a}}),{activeId:b}=(0,r.useContext)(f);return(0,i.jsxs)(`div`,{ref:n.t(g,p),style:{transform:s.CSS.Translate.toString(_),transition:v},className:[`ds-board-card`,l].filter(Boolean).join(` `),"data-dragging":y||void 0,"data-idle":b&&b!==e?``:void 0,...d,children:[(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`grip-vertical`,className:`ds-board-card__handle`,"aria-label":c?`Move ${c}`:`Move card`,...m,...h}),(0,i.jsx)(`div`,{className:`ds-board-card__content`,children:u})]})});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
2
- //# sourceMappingURL=Board-BaQ04nWg.cjs.map
1
+ const e=require("./Icon-D38lQXNe.cjs"),t=require("../components/Button/index.cjs"),n=require("./mergeRefs-Bc3qS0Tt.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("@dnd-kit/core"),o=require("@dnd-kit/sortable"),s=require("@dnd-kit/utilities");function c({active:e,over:t},n){if(!t)return;let r=t.data.current??{},i=r.type===`column`?String(t.id):String(r.columnId??``),a=n.indexOf(i);if(!(a<0||i===String(e.id)))return{columnId:String(e.id),toIndex:a}}function l({active:e,over:t}){if(!t)return;let n=String(e.data.current?.columnId??``),r=t.data.current??{},i=r.type===`card`,a=String(r.columnId??(i?``:t.id)),o=i?r.sortable?.index??0:(r.items??[]).length;if(a&&(n!==a||String(e.id)!==String(t.id)))return{cardId:String(e.id),fromColumnId:n,toColumnId:a,toIndex:o}}var u=(e,t)=>{let{currentCoordinates:n,context:r}=t;if(e.code===`ArrowLeft`||e.code===`ArrowRight`){let t=r.droppableContainers.getEnabled().filter(e=>e.data.current?.type===`column-body`).sort((e,t)=>(e.rect.current?.left??0)-(t.rect.current?.left??0)),i=r.active?.rect.current.translated;if(!i)return;let a=t[t.findIndex(e=>(e.rect.current?.left??0)<=i.left+1&&(e.rect.current?.right??0)>=i.left-1)+(e.code===`ArrowRight`?1:-1)]?.rect.current;return a?(e.preventDefault(),{x:a.left+a.width/2-i.width/2,y:n.y}):void 0}return(0,o.sortableKeyboardCoordinates)(e,t)},d=e=>{let t=e.active.data.current?.type===`column`,n=e.droppableContainers.filter(e=>{let n=e.data.current?.type;return t?n===`column`:n!==`column`}),r={...e,droppableContainers:n};if(t)return(0,a.closestCorners)(r);let i=(0,a.pointerWithin)(r);if(i.length>0){let e=e=>n.find(t=>t.id===e)?.data.current?.type===`card`?0:1;return[...i].sort((t,n)=>e(t.id)-e(n.id))}return(0,a.closestCorners)(r)},f=(0,r.createContext)({activeId:null,activeType:null,overColumnId:null}),p=(0,r.forwardRef)(function({columnIds:t,onMove:n,onColumnMove:s,renderDragOverlay:p,renderColumnDragOverlay:m,className:h,children:g,..._},v){let y=(0,r.useId)(),[b,x]=(0,r.useState)(null),[S,C]=(0,r.useState)(null),[w,T]=(0,r.useState)(null),E=(0,a.useSensors)((0,a.useSensor)(a.PointerSensor,{activationConstraint:{distance:4}}),(0,a.useSensor)(a.KeyboardSensor,{coordinateGetter:u})),D=(0,r.useCallback)(e=>{x(String(e.active.id)),C(e.active.data.current?.type===`column`?`column`:`card`)},[]),O=(0,r.useCallback)(e=>{let t=e.over;if(!t){T(null);return}let n=t.data.current??{},r=n.type===`column`?String(t.id):String(n.columnId??``);T(r||null)},[]),k=(0,r.useCallback)(()=>{x(null),C(null),T(null)},[]),A=(0,r.useCallback)(e=>{let{active:r,over:i}=e;if(k(),i){if(r.data.current?.type===`column`){let n=c(e,t??[]);n&&s?.(n)}else{let t=l(e);t&&n?.(t)}}},[t,s,n,k]),j=(0,r.useMemo)(()=>({activeId:b,activeType:S,overColumnId:w}),[b,S,w]),M=(0,i.jsx)(`div`,{ref:v,className:[`ds-board`,h].filter(Boolean).join(` `),..._,children:g});return(0,i.jsx)(f.Provider,{value:j,children:(0,i.jsxs)(a.DndContext,{id:`ds-board-${y}`,sensors:E,collisionDetection:d,measuring:{droppable:{strategy:a.MeasuringStrategy.Always}},onDragStart:D,onDragOver:O,onDragEnd:A,onDragCancel:k,children:[t?(0,i.jsx)(o.SortableContext,{items:t,strategy:o.horizontalListSortingStrategy,children:M}):M,(0,i.jsxs)(a.DragOverlay,{children:[b&&S===`card`?(0,i.jsxs)(`div`,{className:`ds-board-card`,"data-overlay":!0,children:[(0,i.jsx)(`span`,{className:`ds-board-card__handle`,"aria-hidden":`true`,children:(0,i.jsx)(e.t,{name:`grip-vertical`})}),(0,i.jsx)(`div`,{className:`ds-board-card__content`,children:p?.(b)})]}):null,b&&S===`column`?(0,i.jsx)(`div`,{className:`ds-board-column`,"data-overlay":!0,children:m?.(b)}):null]})]})})}),m=(0,r.forwardRef)(function({id:e,title:c,itemIds:l,count:u,action:d,isDraggable:p=!0,className:m,children:h,...g},_){let{activeType:v,overColumnId:y}=(0,r.useContext)(f),{setNodeRef:b}=(0,a.useDroppable)({id:`${e}::body`,data:{type:`column-body`,columnId:e,items:l}}),{attributes:x,listeners:S,setNodeRef:C,transform:w,transition:T,isDragging:E}=(0,o.useSortable)({id:e,disabled:!p,data:{type:`column`,columnId:e,items:l}});return(0,i.jsxs)(`section`,{ref:n.t(C,_),style:{transform:s.CSS.Translate.toString(w),transition:T},className:[`ds-board-column`,m].filter(Boolean).join(` `),"data-over":v===`card`&&y===e||void 0,"data-dragging":E||void 0,"aria-label":c,...g,children:[p&&(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,iconStart:`grip-horizontal`,className:`ds-board-column__grip`,"aria-label":`Reorder ${c}`,...x,...S}),(0,i.jsxs)(`header`,{className:`ds-board-column__head`,children:[(0,i.jsx)(`span`,{className:`ds-board-column__title`,children:c}),(0,i.jsx)(`span`,{className:`ds-board-column__count`,children:u??l.length}),d&&(0,i.jsx)(`span`,{className:`ds-board-column__action`,children:d})]}),(0,i.jsx)(`div`,{ref:b,className:`ds-board-column__body`,children:(0,i.jsx)(o.SortableContext,{items:l,strategy:o.verticalListSortingStrategy,children:h})})]})}),h=(0,r.forwardRef)(function({id:e,columnId:a,label:c,className:l,children:u,...d},p){let{attributes:m,listeners:h,setNodeRef:g,transform:_,transition:v,isDragging:y}=(0,o.useSortable)({id:e,data:{type:`card`,columnId:a}}),{activeId:b}=(0,r.useContext)(f);return(0,i.jsxs)(`div`,{ref:n.t(g,p),style:{transform:s.CSS.Translate.toString(_),transition:v},className:[`ds-board-card`,l].filter(Boolean).join(` `),"data-dragging":y||void 0,"data-idle":b&&b!==e?``:void 0,...d,children:[(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`grip-vertical`,className:`ds-board-card__handle`,"aria-label":c?`Move ${c}`:`Move card`,...m,...h}),(0,i.jsx)(`div`,{className:`ds-board-card__content`,children:u})]})});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
2
+ //# sourceMappingURL=Board-BPA6mVhf.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Board-BaQ04nWg.cjs","names":["sortableKeyboardCoordinates","closestCorners","pointerWithin","createContext","forwardRef","useId","useState","useSensors","useSensor","PointerSensor","KeyboardSensor","useCallback","useMemo","DndContext","MeasuringStrategy","SortableContext","horizontalListSortingStrategy","DragOverlay","Icon","useContext","useDroppable","useSortable","mergeRefs","CSS","Button","verticalListSortingStrategy","require_Icon","require_components_Button_index","require_mergeRefs","react","react_jsx_runtime","_dnd_kit_core","_dnd_kit_sortable","_dnd_kit_utilities","columnMove","over","data","columnId","\"type\"","\"columnId\"","toIndex","columnIds","active","cardMove","fromColumnId","onCard","toColumnId","\"sortable\"","\"items\"","boardCoordinateGetter","args","event","containers","context","c","a","b","activeRect","rect","currentCoordinates","boardCollisionDetection","isColumn","type","container","scoped","within","rank","id","BoardContext","Board","rest","dndId","activeId","setActiveId","activeType","setActiveType","overColumnId","setOverColumnId","sensors","handleStart","handleOver","overData","reset","handleEnd","move","onColumnMove","onMove","value","board","className","renderDragOverlay","renderColumnDragOverlay","BoardColumn","setBodyRef","itemIds","setColumnRef","isDraggable","ref","transform","isDragging","title","attributes","listeners","count","action","BoardCard","setNodeRef","label"],"sources":["../../src/components/Board/moves.ts","../../src/components/Board/keyboard.ts","../../src/components/Board/index.tsx"],"sourcesContent":["import type { DragEndEvent } from \"@dnd-kit/core\";\nimport type { BoardColumnMove, BoardMove } from \".\";\n\nexport function columnMove(\n { active, over }: DragEndEvent,\n columnIds: string[],\n): BoardColumnMove | undefined {\n if (!over) {\n return;\n }\n const data = over.data.current ?? {};\n const columnId = data[\"type\"] === \"column\" ? String(over.id) : String(data[\"columnId\"] ?? \"\");\n const toIndex = columnIds.indexOf(columnId);\n if (toIndex < 0 || columnId === String(active.id)) {\n return;\n }\n return { columnId: String(active.id), toIndex };\n}\n\nexport function cardMove({ active, over }: DragEndEvent): BoardMove | undefined {\n if (!over) {\n return;\n }\n const fromColumnId = String(active.data.current?.[\"columnId\"] ?? \"\");\n const data = over.data.current ?? {};\n const onCard = data[\"type\"] === \"card\";\n const toColumnId = String(data[\"columnId\"] ?? (onCard ? \"\" : over.id));\n // A card occupies a precise slot; empty lane space appends to the lane.\n const toIndex = onCard\n ? ((data[\"sortable\"] as { index: number } | undefined)?.index ?? 0)\n : ((data[\"items\"] as string[] | undefined) ?? []).length;\n if (!toColumnId) {\n return;\n }\n if (fromColumnId === toColumnId && String(active.id) === String(over.id)) {\n return;\n }\n return { cardId: String(active.id), fromColumnId, toColumnId, toIndex };\n}\n","import type { KeyboardCoordinateGetter } from \"@dnd-kit/core\";\nimport { sortableKeyboardCoordinates } from \"@dnd-kit/sortable\";\n\n/**\n * Arrow up/down sorts inside a lane; left/right jumps lanes, which the stock\n * sortable getter does not do.\n */\nexport const boardCoordinateGetter: KeyboardCoordinateGetter = (event, args) => {\n const { currentCoordinates, context } = args;\n if (event.code === \"ArrowLeft\" || event.code === \"ArrowRight\") {\n const containers = context.droppableContainers\n .getEnabled()\n .filter((c) => c.data.current?.[\"type\"] === \"column-body\")\n .sort((a, b) => (a.rect.current?.left ?? 0) - (b.rect.current?.left ?? 0));\n const activeRect = context.active?.rect.current.translated;\n if (!activeRect) {\n return undefined;\n }\n const index = containers.findIndex(\n (c) =>\n (c.rect.current?.left ?? 0) <= activeRect.left + 1 &&\n (c.rect.current?.right ?? 0) >= activeRect.left - 1,\n );\n const next = containers[index + (event.code === \"ArrowRight\" ? 1 : -1)];\n const rect = next?.rect.current;\n if (!rect) {\n return undefined;\n }\n event.preventDefault();\n return { x: rect.left + rect.width / 2 - activeRect.width / 2, y: currentCoordinates.y };\n }\n return sortableKeyboardCoordinates(event, args);\n};\n","import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useId,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCorners,\n pointerWithin,\n MeasuringStrategy,\n useDroppable,\n useSensor,\n useSensors,\n type CollisionDetection,\n type DragEndEvent,\n type DragOverEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n horizontalListSortingStrategy,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { cardMove, columnMove } from \"./moves\";\nimport { boardCoordinateGetter } from \"./keyboard\";\nimport \"./style.css\";\n\nexport interface BoardMove {\n cardId: string;\n fromColumnId: string;\n toColumnId: string;\n /** Index the card lands on inside the destination column. */\n toIndex: number;\n}\n\nexport interface BoardColumnMove {\n columnId: string;\n toIndex: number;\n}\n\ninterface BoardContextValue {\n activeId: string | null;\n activeType: \"card\" | \"column\" | null;\n /** The lane the pointer is currently over, whatever it is actually over. */\n overColumnId: string | null;\n}\n\n/**\n * A lane's body sits inside the lane's frame, so a raw corner-distance\n * strategy lets the body steal the hit from the lane itself — most visibly at\n * the board ends, where the last lane then never shifts aside to open the\n * drop gap. Resolve by what is being dragged: a column only ever hits other\n * columns; a card hits the card under the pointer first, then the lane body\n * under it, then whatever is nearest.\n */\nconst boardCollisionDetection: CollisionDetection = (args) => {\n const isColumn = args.active.data.current?.[\"type\"] === \"column\";\n const containers = args.droppableContainers.filter((container) => {\n const type = container.data.current?.[\"type\"];\n return isColumn ? type === \"column\" : type !== \"column\";\n });\n const scoped = { ...args, droppableContainers: containers };\n if (isColumn) {\n return closestCorners(scoped);\n }\n const within = pointerWithin(scoped);\n if (within.length > 0) {\n const rank = (id: (typeof within)[number][\"id\"]) =>\n containers.find((c) => c.id === id)?.data.current?.[\"type\"] === \"card\" ? 0 : 1;\n return [...within].sort((a, b) => rank(a.id) - rank(b.id));\n }\n return closestCorners(scoped);\n};\n\nconst BoardContext = createContext<BoardContextValue>({\n activeId: null,\n activeType: null,\n overColumnId: null,\n});\n\nexport interface BoardProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onDragEnd\"> {\n /** Column ids in render order. Required for columns to be re-orderable. */\n columnIds?: string[];\n /** Fired once a card is dropped somewhere new. Apply it to your own state. */\n onMove?: (move: BoardMove) => void;\n /** Fired once a column is dropped in a new position. */\n onColumnMove?: (move: BoardColumnMove) => void;\n /** Rendered inside the drag overlay while a card is in the air. */\n renderDragOverlay?: (cardId: string) => ReactNode;\n /** Rendered inside the drag overlay while a column is in the air. */\n renderColumnDragOverlay?: (columnId: string) => ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A column board with pointer and keyboard dragging. The board owns the drag\n * mechanics only — the card data stays yours; react to `onMove`.\n */\nexport const Board = forwardRef<HTMLDivElement, BoardProps>(function Board(\n {\n columnIds,\n onMove,\n onColumnMove,\n renderDragOverlay,\n renderColumnDragOverlay,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [activeType, setActiveType] = useState<\"card\" | \"column\" | null>(null);\n const [overColumnId, setOverColumnId] = useState<string | null>(null);\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: boardCoordinateGetter }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n setActiveType(event.active.data.current?.[\"type\"] === \"column\" ? \"column\" : \"card\");\n }, []);\n\n /* Cards land on cards as often as on empty space, so the lane a drag is over\n * is always resolved back to a column id — one highlight, one meaning. */\n const handleOver = useCallback((event: DragOverEvent) => {\n const over = event.over;\n if (!over) {\n setOverColumnId(null);\n return;\n }\n const overData = over.data.current ?? {};\n const columnId =\n overData[\"type\"] === \"column\" ? String(over.id) : String(overData[\"columnId\"] ?? \"\");\n setOverColumnId(columnId || null);\n }, []);\n\n const reset = useCallback(() => {\n setActiveId(null);\n setActiveType(null);\n setOverColumnId(null);\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n reset();\n if (!over) {\n return;\n }\n\n /* Columns reorder among themselves; a column never lands inside a lane. */\n if (active.data.current?.[\"type\"] === \"column\") {\n const move = columnMove(event, columnIds ?? []);\n if (move) {\n onColumnMove?.(move);\n }\n } else {\n const move = cardMove(event);\n if (move) {\n onMove?.(move);\n }\n }\n },\n [columnIds, onColumnMove, onMove, reset],\n );\n\n const value = useMemo(\n () => ({ activeId, activeType, overColumnId }),\n [activeId, activeType, overColumnId],\n );\n\n const board = (\n <div\n ref={ref}\n className={[\"ds-board\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n\n return (\n <BoardContext.Provider value={value}>\n <DndContext\n id={`ds-board-${dndId}`}\n sensors={sensors}\n collisionDetection={boardCollisionDetection}\n /* Lanes scroll and change height mid-drag, so positions are re-read\n * continuously — without this the shift animation misfires. */\n measuring={{ droppable: { strategy: MeasuringStrategy.Always } }}\n\n onDragStart={handleStart}\n onDragOver={handleOver}\n onDragEnd={handleEnd}\n onDragCancel={reset}\n >\n {columnIds ? (\n <SortableContext\n items={columnIds}\n strategy={horizontalListSortingStrategy}\n >\n {board}\n </SortableContext>\n ) : (\n board\n )}\n <DragOverlay>\n {activeId && activeType === \"card\" ? (\n <div\n className=\"ds-board-card\"\n data-overlay\n >\n <span\n className=\"ds-board-card__handle\"\n aria-hidden=\"true\"\n >\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-board-card__content\">{renderDragOverlay?.(activeId)}</div>\n </div>\n ) : null}\n {activeId && activeType === \"column\" ? (\n <div\n className=\"ds-board-column\"\n data-overlay\n >\n {renderColumnDragOverlay?.(activeId)}\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n </BoardContext.Provider>\n );\n});\n\nexport interface BoardColumnProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n title: string;\n /** Card ids in render order — the sortable contract for this column. */\n itemIds: string[];\n /** Shown beside the title; defaults to the number of cards. */\n count?: number;\n /** A control in the column head, e.g. an add button or a menu. */\n action?: ReactNode;\n /** Set false to pin a lane in place. */\n isDraggable?: boolean;\n children?: ReactNode;\n}\n\n/**\n * One lane of the board. Heavy frame, hairline head rule, scrolling body, and\n * a grip on top of the head that drags the whole lane sideways.\n */\nexport const BoardColumn = forwardRef<HTMLElement, BoardColumnProps>(function BoardColumn(\n { id, title, itemIds, count, action, isDraggable = true, className, children, ...rest },\n ref,\n) {\n const { activeType, overColumnId } = useContext(BoardContext);\n const { setNodeRef: setBodyRef } = useDroppable({\n id: `${id}::body`,\n data: { type: \"column-body\", columnId: id, items: itemIds },\n });\n const {\n attributes,\n listeners,\n setNodeRef: setColumnRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id,\n disabled: !isDraggable,\n data: { type: \"column\", columnId: id, items: itemIds },\n });\n\n return (\n <section\n ref={mergeRefs(setColumnRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-column\", className].filter(Boolean).join(\" \")}\n data-over={(activeType === \"card\" && overColumnId === id) || undefined}\n data-dragging={isDragging || undefined}\n\n aria-label={title}\n {...rest}\n >\n {isDraggable && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n iconStart=\"grip-horizontal\"\n className=\"ds-board-column__grip\"\n aria-label={`Reorder ${title}`}\n {...attributes}\n {...listeners}\n />\n )}\n <header className=\"ds-board-column__head\">\n <span className=\"ds-board-column__title\">{title}</span>\n <span className=\"ds-board-column__count\">{count ?? itemIds.length}</span>\n {action && <span className=\"ds-board-column__action\">{action}</span>}\n </header>\n <div\n ref={setBodyRef}\n className=\"ds-board-column__body\"\n >\n <SortableContext\n items={itemIds}\n strategy={verticalListSortingStrategy}\n >\n {children}\n </SortableContext>\n </div>\n </section>\n );\n});\n\nexport interface BoardCardProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n columnId: string;\n /** Accessible name announced when the card is picked up. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * A draggable card. The grip on the left is the handle, so the card body can\n * hold links and buttons; the grip is a real button for keyboard users:\n * space to pick up, arrows to move, space to drop.\n */\nexport const BoardCard = forwardRef<HTMLDivElement, BoardCardProps>(function BoardCard(\n { id, columnId, label, className, children, ...rest },\n ref,\n) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n data: { type: \"card\", columnId },\n });\n const { activeId } = useContext(BoardContext);\n\n return (\n <div\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-card\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n data-idle={activeId && activeId !== id ? \"\" : undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-board-card__handle\"\n aria-label={label ? `Move ${label}` : \"Move card\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-board-card__content\">{children}</div>\n </div>\n );\n});\n"],"mappings":"A,yQAGA,SAAgBkC,EACd,CAAE,SAAQ,QACV,EAC6B,CAC7B,GAAI,CAACC,EACH,OAEF,IAAMC,EAAOD,EAAK,KAAK,SAAW,CAAC,EAC7BE,EAAWD,EAAKE,OAAY,SAAW,OAAOH,EAAK,EAAE,EAAI,OAAOC,EAAKG,UAAe,EAAE,EACtFC,EAAUC,EAAU,QAAQJ,CAAQ,EAC1C,GAAI,IAAU,GAAKA,IAAa,OAAOK,EAAO,EAAE,GAGhD,MAAO,CAAE,SAAU,OAAOA,EAAO,EAAE,EAAG,SAAQ,CAChD,CAEA,SAAgBC,EAAS,CAAE,SAAQ,QAA6C,CAC9E,GAAI,CAACR,EACH,OAEF,IAAMS,EAAe,OAAOF,EAAO,KAAK,SAAUH,UAAe,EAAE,EAC7DH,EAAOD,EAAK,KAAK,SAAW,CAAC,EAC7BU,EAAST,EAAKE,OAAY,OAC1BQ,EAAa,OAAOV,EAAKG,WAAgBM,EAAS,GAAKV,EAAK,GAAG,EAE/DK,EAAUK,EACVT,EAAKW,UAA+C,OAAS,GAC7DX,EAAKY,OAAqC,CAAC,EAAA,CAAG,OACpD,GAAKF,IAGD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SAClE,CAAE,KAAI,WAAU,QAAO,YAAW,WAAU,GAAGkE,GAC/C,EACA,CACA,GAAM,CAAE,aAAY,YAAW,aAAY,YAAW,aAAY,eAAA,EAAejD,EAAAA,YAAAA,CAAY,CAC3F,KACA,KAAM,CAAE,KAAM,OAAQ,UAAS,CACjC,CAAC,EACK,CAAE,aAAA,EAAaF,EAAAA,WAAAA,CAAWiD,CAAY,EAE5C,OACE,EAAAtC,EAAA,KAAA,CAAC,MAAD,CACE,IAAKR,EAAAA,EAAUoF,EAAYT,CAAG,EAC9B,MAAO,CAAE,UAAW1E,EAAAA,IAAI,UAAU,SAAS2E,CAAS,EAAG,YAAW,EAClE,UAAW,CAAC,gBAAiBT,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAChE,gBAAeU,GAAc,IAAA,GAC7B,YAAW3B,GAAYA,IAAaL,EAAK,GAAK,IAAA,GAC9C,GAAIG,EANN,SAAA,EAQE,EAAAxC,EAAA,IAAA,CAACN,EAAAA,OAAD,CACE,QAAQ,SACR,KAAK,KACL,WAAA,GACA,UAAU,gBACV,UAAU,wBACV,aAAYmF,EAAQ,QAAQA,IAAU,YACtC,GAAIN,EACJ,GAAIC,CACL,CAAA,GACD,EAAAxE,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,yBAA0B,UAAc,CAAA,CACpD,C,EAET,CAAC,E"}
1
+ {"version":3,"file":"Board-BPA6mVhf.cjs","names":["sortableKeyboardCoordinates","closestCorners","pointerWithin","createContext","forwardRef","useId","useState","useSensors","useSensor","PointerSensor","KeyboardSensor","useCallback","useMemo","DndContext","MeasuringStrategy","SortableContext","horizontalListSortingStrategy","DragOverlay","Icon","useContext","useDroppable","useSortable","mergeRefs","CSS","Button","verticalListSortingStrategy","require_Icon","require_components_Button_index","require_mergeRefs","react","react_jsx_runtime","_dnd_kit_core","_dnd_kit_sortable","_dnd_kit_utilities","columnMove","over","data","columnId","\"type\"","\"columnId\"","toIndex","columnIds","active","cardMove","fromColumnId","onCard","toColumnId","\"sortable\"","\"items\"","boardCoordinateGetter","args","event","containers","context","c","a","b","activeRect","rect","currentCoordinates","boardCollisionDetection","isColumn","type","container","scoped","within","rank","id","BoardContext","Board","rest","dndId","activeId","setActiveId","activeType","setActiveType","overColumnId","setOverColumnId","sensors","handleStart","handleOver","overData","reset","handleEnd","move","onColumnMove","onMove","value","board","className","renderDragOverlay","renderColumnDragOverlay","BoardColumn","setBodyRef","itemIds","setColumnRef","isDraggable","ref","transform","isDragging","title","attributes","listeners","count","action","BoardCard","setNodeRef","label"],"sources":["../../src/components/Board/moves.ts","../../src/components/Board/keyboard.ts","../../src/components/Board/index.tsx"],"sourcesContent":["import type { DragEndEvent } from \"@dnd-kit/core\";\nimport type { BoardColumnMove, BoardMove } from \".\";\n\nexport function columnMove(\n { active, over }: DragEndEvent,\n columnIds: string[],\n): BoardColumnMove | undefined {\n if (!over) {\n return;\n }\n const data = over.data.current ?? {};\n const columnId = data[\"type\"] === \"column\" ? String(over.id) : String(data[\"columnId\"] ?? \"\");\n const toIndex = columnIds.indexOf(columnId);\n if (toIndex < 0 || columnId === String(active.id)) {\n return;\n }\n return { columnId: String(active.id), toIndex };\n}\n\nexport function cardMove({ active, over }: DragEndEvent): BoardMove | undefined {\n if (!over) {\n return;\n }\n const fromColumnId = String(active.data.current?.[\"columnId\"] ?? \"\");\n const data = over.data.current ?? {};\n const onCard = data[\"type\"] === \"card\";\n const toColumnId = String(data[\"columnId\"] ?? (onCard ? \"\" : over.id));\n // A card occupies a precise slot; empty lane space appends to the lane.\n const toIndex = onCard\n ? ((data[\"sortable\"] as { index: number } | undefined)?.index ?? 0)\n : ((data[\"items\"] as string[] | undefined) ?? []).length;\n if (!toColumnId) {\n return;\n }\n if (fromColumnId === toColumnId && String(active.id) === String(over.id)) {\n return;\n }\n return { cardId: String(active.id), fromColumnId, toColumnId, toIndex };\n}\n","import type { KeyboardCoordinateGetter } from \"@dnd-kit/core\";\nimport { sortableKeyboardCoordinates } from \"@dnd-kit/sortable\";\n\n/**\n * Arrow up/down sorts inside a lane; left/right jumps lanes, which the stock\n * sortable getter does not do.\n */\nexport const boardCoordinateGetter: KeyboardCoordinateGetter = (event, args) => {\n const { currentCoordinates, context } = args;\n if (event.code === \"ArrowLeft\" || event.code === \"ArrowRight\") {\n const containers = context.droppableContainers\n .getEnabled()\n .filter((c) => c.data.current?.[\"type\"] === \"column-body\")\n .sort((a, b) => (a.rect.current?.left ?? 0) - (b.rect.current?.left ?? 0));\n const activeRect = context.active?.rect.current.translated;\n if (!activeRect) {\n return undefined;\n }\n const index = containers.findIndex(\n (c) =>\n (c.rect.current?.left ?? 0) <= activeRect.left + 1 &&\n (c.rect.current?.right ?? 0) >= activeRect.left - 1,\n );\n const next = containers[index + (event.code === \"ArrowRight\" ? 1 : -1)];\n const rect = next?.rect.current;\n if (!rect) {\n return undefined;\n }\n event.preventDefault();\n return { x: rect.left + rect.width / 2 - activeRect.width / 2, y: currentCoordinates.y };\n }\n return sortableKeyboardCoordinates(event, args);\n};\n","import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useId,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCorners,\n pointerWithin,\n MeasuringStrategy,\n useDroppable,\n useSensor,\n useSensors,\n type CollisionDetection,\n type DragEndEvent,\n type DragOverEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n horizontalListSortingStrategy,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { cardMove, columnMove } from \"./moves\";\nimport { boardCoordinateGetter } from \"./keyboard\";\nimport \"./style.css\";\n\nexport interface BoardMove {\n cardId: string;\n fromColumnId: string;\n toColumnId: string;\n /** Index the card lands on inside the destination column. */\n toIndex: number;\n}\n\nexport interface BoardColumnMove {\n columnId: string;\n toIndex: number;\n}\n\ninterface BoardContextValue {\n activeId: string | null;\n activeType: \"card\" | \"column\" | null;\n /** The lane the pointer is currently over, whatever it is actually over. */\n overColumnId: string | null;\n}\n\n/**\n * A lane's body sits inside the lane's frame, so a raw corner-distance\n * strategy lets the body steal the hit from the lane itself — most visibly at\n * the board ends, where the last lane then never shifts aside to open the\n * drop gap. Resolve by what is being dragged: a column only ever hits other\n * columns; a card hits the card under the pointer first, then the lane body\n * under it, then whatever is nearest.\n */\nconst boardCollisionDetection: CollisionDetection = (args) => {\n const isColumn = args.active.data.current?.[\"type\"] === \"column\";\n const containers = args.droppableContainers.filter((container) => {\n const type = container.data.current?.[\"type\"];\n return isColumn ? type === \"column\" : type !== \"column\";\n });\n const scoped = { ...args, droppableContainers: containers };\n if (isColumn) {\n return closestCorners(scoped);\n }\n const within = pointerWithin(scoped);\n if (within.length > 0) {\n const rank = (id: (typeof within)[number][\"id\"]) =>\n containers.find((c) => c.id === id)?.data.current?.[\"type\"] === \"card\" ? 0 : 1;\n return [...within].sort((a, b) => rank(a.id) - rank(b.id));\n }\n return closestCorners(scoped);\n};\n\nconst BoardContext = createContext<BoardContextValue>({\n activeId: null,\n activeType: null,\n overColumnId: null,\n});\n\nexport interface BoardProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onDragEnd\"> {\n /** Column ids in render order. Required for columns to be re-orderable. */\n columnIds?: string[];\n /** Fired once a card is dropped somewhere new. Apply it to your own state. */\n onMove?: (move: BoardMove) => void;\n /** Fired once a column is dropped in a new position. */\n onColumnMove?: (move: BoardColumnMove) => void;\n /** Rendered inside the drag overlay while a card is in the air. */\n renderDragOverlay?: (cardId: string) => ReactNode;\n /** Rendered inside the drag overlay while a column is in the air. */\n renderColumnDragOverlay?: (columnId: string) => ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A column board with pointer and keyboard dragging. The board owns the drag\n * mechanics only — the card data stays yours; react to `onMove`.\n */\nexport const Board = forwardRef<HTMLDivElement, BoardProps>(function Board(\n {\n columnIds,\n onMove,\n onColumnMove,\n renderDragOverlay,\n renderColumnDragOverlay,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [activeType, setActiveType] = useState<\"card\" | \"column\" | null>(null);\n const [overColumnId, setOverColumnId] = useState<string | null>(null);\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: boardCoordinateGetter }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n setActiveType(event.active.data.current?.[\"type\"] === \"column\" ? \"column\" : \"card\");\n }, []);\n\n /* Cards land on cards as often as on empty space, so the lane a drag is over\n * is always resolved back to a column id — one highlight, one meaning. */\n const handleOver = useCallback((event: DragOverEvent) => {\n const over = event.over;\n if (!over) {\n setOverColumnId(null);\n return;\n }\n const overData = over.data.current ?? {};\n const columnId =\n overData[\"type\"] === \"column\" ? String(over.id) : String(overData[\"columnId\"] ?? \"\");\n setOverColumnId(columnId || null);\n }, []);\n\n const reset = useCallback(() => {\n setActiveId(null);\n setActiveType(null);\n setOverColumnId(null);\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n reset();\n if (!over) {\n return;\n }\n\n /* Columns reorder among themselves; a column never lands inside a lane. */\n if (active.data.current?.[\"type\"] === \"column\") {\n const move = columnMove(event, columnIds ?? []);\n if (move) {\n onColumnMove?.(move);\n }\n } else {\n const move = cardMove(event);\n if (move) {\n onMove?.(move);\n }\n }\n },\n [columnIds, onColumnMove, onMove, reset],\n );\n\n const value = useMemo(\n () => ({ activeId, activeType, overColumnId }),\n [activeId, activeType, overColumnId],\n );\n\n const board = (\n <div\n ref={ref}\n className={[\"ds-board\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n\n return (\n <BoardContext.Provider value={value}>\n <DndContext\n id={`ds-board-${dndId}`}\n sensors={sensors}\n collisionDetection={boardCollisionDetection}\n /* Lanes scroll and change height mid-drag, so positions are re-read\n * continuously — without this the shift animation misfires. */\n measuring={{ droppable: { strategy: MeasuringStrategy.Always } }}\n\n onDragStart={handleStart}\n onDragOver={handleOver}\n onDragEnd={handleEnd}\n onDragCancel={reset}\n >\n {columnIds ? (\n <SortableContext\n items={columnIds}\n strategy={horizontalListSortingStrategy}\n >\n {board}\n </SortableContext>\n ) : (\n board\n )}\n <DragOverlay>\n {activeId && activeType === \"card\" ? (\n <div\n className=\"ds-board-card\"\n data-overlay\n >\n <span\n className=\"ds-board-card__handle\"\n aria-hidden=\"true\"\n >\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-board-card__content\">{renderDragOverlay?.(activeId)}</div>\n </div>\n ) : null}\n {activeId && activeType === \"column\" ? (\n <div\n className=\"ds-board-column\"\n data-overlay\n >\n {renderColumnDragOverlay?.(activeId)}\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n </BoardContext.Provider>\n );\n});\n\nexport interface BoardColumnProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n title: string;\n /** Card ids in render order — the sortable contract for this column. */\n itemIds: string[];\n /** Shown beside the title; defaults to the number of cards. */\n count?: number;\n /** A control in the column head, e.g. an add button or a menu. */\n action?: ReactNode;\n /** Set false to pin a lane in place. */\n isDraggable?: boolean;\n children?: ReactNode;\n}\n\n/**\n * One lane of the board. Heavy frame, hairline head rule, scrolling body, and\n * a grip on top of the head that drags the whole lane sideways.\n */\nexport const BoardColumn = forwardRef<HTMLElement, BoardColumnProps>(function BoardColumn(\n { id, title, itemIds, count, action, isDraggable = true, className, children, ...rest },\n ref,\n) {\n const { activeType, overColumnId } = useContext(BoardContext);\n const { setNodeRef: setBodyRef } = useDroppable({\n id: `${id}::body`,\n data: { type: \"column-body\", columnId: id, items: itemIds },\n });\n const {\n attributes,\n listeners,\n setNodeRef: setColumnRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id,\n disabled: !isDraggable,\n data: { type: \"column\", columnId: id, items: itemIds },\n });\n\n return (\n <section\n ref={mergeRefs(setColumnRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-column\", className].filter(Boolean).join(\" \")}\n data-over={(activeType === \"card\" && overColumnId === id) || undefined}\n data-dragging={isDragging || undefined}\n\n aria-label={title}\n {...rest}\n >\n {isDraggable && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n iconStart=\"grip-horizontal\"\n className=\"ds-board-column__grip\"\n aria-label={`Reorder ${title}`}\n {...attributes}\n {...listeners}\n />\n )}\n <header className=\"ds-board-column__head\">\n <span className=\"ds-board-column__title\">{title}</span>\n <span className=\"ds-board-column__count\">{count ?? itemIds.length}</span>\n {action && <span className=\"ds-board-column__action\">{action}</span>}\n </header>\n <div\n ref={setBodyRef}\n className=\"ds-board-column__body\"\n >\n <SortableContext\n items={itemIds}\n strategy={verticalListSortingStrategy}\n >\n {children}\n </SortableContext>\n </div>\n </section>\n );\n});\n\nexport interface BoardCardProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n columnId: string;\n /** Accessible name announced when the card is picked up. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * A draggable card. The grip on the left is the handle, so the card body can\n * hold links and buttons; the grip is a real button for keyboard users:\n * space to pick up, arrows to move, space to drop.\n */\nexport const BoardCard = forwardRef<HTMLDivElement, BoardCardProps>(function BoardCard(\n { id, columnId, label, className, children, ...rest },\n ref,\n) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n data: { type: \"card\", columnId },\n });\n const { activeId } = useContext(BoardContext);\n\n return (\n <div\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-card\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n data-idle={activeId && activeId !== id ? \"\" : undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-board-card__handle\"\n aria-label={label ? `Move ${label}` : \"Move card\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-board-card__content\">{children}</div>\n </div>\n );\n});\n"],"mappings":"A,yQAGA,SAAgBkC,EACd,CAAE,SAAQ,QACV,EAC6B,CAC7B,GAAI,CAACC,EACH,OAEF,IAAMC,EAAOD,EAAK,KAAK,SAAW,CAAC,EAC7BE,EAAWD,EAAKE,OAAY,SAAW,OAAOH,EAAK,EAAE,EAAI,OAAOC,EAAKG,UAAe,EAAE,EACtFC,EAAUC,EAAU,QAAQJ,CAAQ,EAC1C,GAAI,IAAU,GAAKA,IAAa,OAAOK,EAAO,EAAE,GAGhD,MAAO,CAAE,SAAU,OAAOA,EAAO,EAAE,EAAG,SAAQ,CAChD,CAEA,SAAgBC,EAAS,CAAE,SAAQ,QAA6C,CAC9E,GAAI,CAACR,EACH,OAEF,IAAMS,EAAe,OAAOF,EAAO,KAAK,SAAUH,UAAe,EAAE,EAC7DH,EAAOD,EAAK,KAAK,SAAW,CAAC,EAC7BU,EAAST,EAAKE,OAAY,OAC1BQ,EAAa,OAAOV,EAAKG,WAAgBM,EAAS,GAAKV,EAAK,GAAG,EAE/DK,EAAUK,EACVT,EAAKW,UAA+C,OAAS,GAC7DX,EAAKY,OAAqC,CAAC,EAAA,CAAG,OACpD,GAAKF,IAGDF,IAAiBE,GAAc,OAAOJ,EAAO,EAAE,IAAM,OAAOP,EAAK,EAAE,GAGvE,MAAO,CAAE,OAAQ,OAAOO,EAAO,EAAE,EAAG,eAAc,aAAY,SAAQ,CACxE,CC/BA,IAAaO,GAAmD,EAAO,IAAS,CAC9E,GAAM,CAAE,qBAAoB,WAAYC,EACxC,GAAIC,EAAM,OAAS,aAAeA,EAAM,OAAS,aAAc,CAC7D,IAAMC,EAAaC,EAAQ,oBACxB,WAAW,CAAC,CACZ,OAAQ,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oF,EAAYT,CAAG,EAC9B,MAAO,CAAE,UAAW1E,EAAAA,IAAI,UAAU,SAAS2E,CAAS,EAAG,YAAW,EAClE,UAAW,CAAC,gBAAiBT,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAChE,gBAAeU,GAAc,IAAA,GAC7B,YAAW3B,GAAYA,IAAaL,EAAK,GAAK,IAAA,GAC9C,GAAIG,EANN,SAAA,EAQE,EAAAxC,EAAA,IAAA,CAACN,EAAAA,OAAD,CACE,QAAQ,SACR,KAAK,KACL,WAAA,GACA,UAAU,gBACV,UAAU,wBACV,aAAYmF,EAAQ,QAAQA,IAAU,YACtC,GAAIN,EACJ,GAAIC,CACL,CAAA,GACD,EAAAxE,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,yBAA0B,UAAc,CAAA,CACpD,C,EAET,CAAC,E"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "./Icon-XNismJDm.js";
1
+ import { t as e } from "./Icon-D1kx7-1c.js";
2
2
  import { Button as t } from "../components/Button/index.js";
3
3
  import { t as n } from "./mergeRefs-DGM402mE.js";
4
4
  import { createContext as r, forwardRef as i, useCallback as a, useContext as o, useId as s, useMemo as c, useState as l } from "react";
@@ -236,4 +236,4 @@ var A = (e, t) => {
236
236
  //#endregion
237
237
  export { F as n, P as r, N as t };
238
238
 
239
- //# sourceMappingURL=Board-CUhF8pTX.js.map
239
+ //# sourceMappingURL=Board-CcIF7jS0.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Board-CUhF8pTX.js","names":["Icon","mergeRefs","columnMove","over","data","columnId","\"type\"","\"columnId\"","toIndex","columnIds","active","cardMove","fromColumnId","onCard","toColumnId","\"sortable\"","\"items\"","boardCoordinateGetter","args","event","containers","context","c","a","b","activeRect","rect","currentCoordinates","sortableKeyboardCoordinates","boardCollisionDetection","isColumn","type","container","scoped","closestCorners","within","pointerWithin","rank","id","BoardContext","createContext","Board","forwardRef","rest","dndId","useId","activeId","setActiveId","useState","activeType","setActiveType","overColumnId","setOverColumnId","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","handleStart","useCallback","handleOver","overData","reset","handleEnd","move","onColumnMove","onMove","value","useMemo","board","className","DndContext","MeasuringStrategy","SortableContext","horizontalListSortingStrategy","DragOverlay","renderDragOverlay","renderColumnDragOverlay","BoardColumn","useContext","setBodyRef","useDroppable","itemIds","setColumnRef","useSortable","isDraggable","ref","CSS","transform","isDragging","title","Button","attributes","listeners","count","action","verticalListSortingStrategy","BoardCard","setNodeRef","label"],"sources":["../../src/components/Board/moves.ts","../../src/components/Board/keyboard.ts","../../src/components/Board/index.tsx"],"sourcesContent":["import type { DragEndEvent } from \"@dnd-kit/core\";\nimport type { BoardColumnMove, BoardMove } from \".\";\n\nexport function columnMove(\n { active, over }: DragEndEvent,\n columnIds: string[],\n): BoardColumnMove | undefined {\n if (!over) {\n return;\n }\n const data = over.data.current ?? {};\n const columnId = data[\"type\"] === \"column\" ? String(over.id) : String(data[\"columnId\"] ?? \"\");\n const toIndex = columnIds.indexOf(columnId);\n if (toIndex < 0 || columnId === String(active.id)) {\n return;\n }\n return { columnId: String(active.id), toIndex };\n}\n\nexport function cardMove({ active, over }: DragEndEvent): BoardMove | undefined {\n if (!over) {\n return;\n }\n const fromColumnId = String(active.data.current?.[\"columnId\"] ?? \"\");\n const data = over.data.current ?? {};\n const onCard = data[\"type\"] === \"card\";\n const toColumnId = String(data[\"columnId\"] ?? (onCard ? \"\" : over.id));\n // A card occupies a precise slot; empty lane space appends to the lane.\n const toIndex = onCard\n ? ((data[\"sortable\"] as { index: number } | undefined)?.index ?? 0)\n : ((data[\"items\"] as string[] | undefined) ?? []).length;\n if (!toColumnId) {\n return;\n }\n if (fromColumnId === toColumnId && String(active.id) === String(over.id)) {\n return;\n }\n return { cardId: String(active.id), fromColumnId, toColumnId, toIndex };\n}\n","import type { KeyboardCoordinateGetter } from \"@dnd-kit/core\";\nimport { sortableKeyboardCoordinates } from \"@dnd-kit/sortable\";\n\n/**\n * Arrow up/down sorts inside a lane; left/right jumps lanes, which the stock\n * sortable getter does not do.\n */\nexport const boardCoordinateGetter: KeyboardCoordinateGetter = (event, args) => {\n const { currentCoordinates, context } = args;\n if (event.code === \"ArrowLeft\" || event.code === \"ArrowRight\") {\n const containers = context.droppableContainers\n .getEnabled()\n .filter((c) => c.data.current?.[\"type\"] === \"column-body\")\n .sort((a, b) => (a.rect.current?.left ?? 0) - (b.rect.current?.left ?? 0));\n const activeRect = context.active?.rect.current.translated;\n if (!activeRect) {\n return undefined;\n }\n const index = containers.findIndex(\n (c) =>\n (c.rect.current?.left ?? 0) <= activeRect.left + 1 &&\n (c.rect.current?.right ?? 0) >= activeRect.left - 1,\n );\n const next = containers[index + (event.code === \"ArrowRight\" ? 1 : -1)];\n const rect = next?.rect.current;\n if (!rect) {\n return undefined;\n }\n event.preventDefault();\n return { x: rect.left + rect.width / 2 - activeRect.width / 2, y: currentCoordinates.y };\n }\n return sortableKeyboardCoordinates(event, args);\n};\n","import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useId,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCorners,\n pointerWithin,\n MeasuringStrategy,\n useDroppable,\n useSensor,\n useSensors,\n type CollisionDetection,\n type DragEndEvent,\n type DragOverEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n horizontalListSortingStrategy,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { cardMove, columnMove } from \"./moves\";\nimport { boardCoordinateGetter } from \"./keyboard\";\nimport \"./style.css\";\n\nexport interface BoardMove {\n cardId: string;\n fromColumnId: string;\n toColumnId: string;\n /** Index the card lands on inside the destination column. */\n toIndex: number;\n}\n\nexport interface BoardColumnMove {\n columnId: string;\n toIndex: number;\n}\n\ninterface BoardContextValue {\n activeId: string | null;\n activeType: \"card\" | \"column\" | null;\n /** The lane the pointer is currently over, whatever it is actually over. */\n overColumnId: string | null;\n}\n\n/**\n * A lane's body sits inside the lane's frame, so a raw corner-distance\n * strategy lets the body steal the hit from the lane itself — most visibly at\n * the board ends, where the last lane then never shifts aside to open the\n * drop gap. Resolve by what is being dragged: a column only ever hits other\n * columns; a card hits the card under the pointer first, then the lane body\n * under it, then whatever is nearest.\n */\nconst boardCollisionDetection: CollisionDetection = (args) => {\n const isColumn = args.active.data.current?.[\"type\"] === \"column\";\n const containers = args.droppableContainers.filter((container) => {\n const type = container.data.current?.[\"type\"];\n return isColumn ? type === \"column\" : type !== \"column\";\n });\n const scoped = { ...args, droppableContainers: containers };\n if (isColumn) {\n return closestCorners(scoped);\n }\n const within = pointerWithin(scoped);\n if (within.length > 0) {\n const rank = (id: (typeof within)[number][\"id\"]) =>\n containers.find((c) => c.id === id)?.data.current?.[\"type\"] === \"card\" ? 0 : 1;\n return [...within].sort((a, b) => rank(a.id) - rank(b.id));\n }\n return closestCorners(scoped);\n};\n\nconst BoardContext = createContext<BoardContextValue>({\n activeId: null,\n activeType: null,\n overColumnId: null,\n});\n\nexport interface BoardProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onDragEnd\"> {\n /** Column ids in render order. Required for columns to be re-orderable. */\n columnIds?: string[];\n /** Fired once a card is dropped somewhere new. Apply it to your own state. */\n onMove?: (move: BoardMove) => void;\n /** Fired once a column is dropped in a new position. */\n onColumnMove?: (move: BoardColumnMove) => void;\n /** Rendered inside the drag overlay while a card is in the air. */\n renderDragOverlay?: (cardId: string) => ReactNode;\n /** Rendered inside the drag overlay while a column is in the air. */\n renderColumnDragOverlay?: (columnId: string) => ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A column board with pointer and keyboard dragging. The board owns the drag\n * mechanics only — the card data stays yours; react to `onMove`.\n */\nexport const Board = forwardRef<HTMLDivElement, BoardProps>(function Board(\n {\n columnIds,\n onMove,\n onColumnMove,\n renderDragOverlay,\n renderColumnDragOverlay,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [activeType, setActiveType] = useState<\"card\" | \"column\" | null>(null);\n const [overColumnId, setOverColumnId] = useState<string | null>(null);\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: boardCoordinateGetter }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n setActiveType(event.active.data.current?.[\"type\"] === \"column\" ? \"column\" : \"card\");\n }, []);\n\n /* Cards land on cards as often as on empty space, so the lane a drag is over\n * is always resolved back to a column id — one highlight, one meaning. */\n const handleOver = useCallback((event: DragOverEvent) => {\n const over = event.over;\n if (!over) {\n setOverColumnId(null);\n return;\n }\n const overData = over.data.current ?? {};\n const columnId =\n overData[\"type\"] === \"column\" ? String(over.id) : String(overData[\"columnId\"] ?? \"\");\n setOverColumnId(columnId || null);\n }, []);\n\n const reset = useCallback(() => {\n setActiveId(null);\n setActiveType(null);\n setOverColumnId(null);\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n reset();\n if (!over) {\n return;\n }\n\n /* Columns reorder among themselves; a column never lands inside a lane. */\n if (active.data.current?.[\"type\"] === \"column\") {\n const move = columnMove(event, columnIds ?? []);\n if (move) {\n onColumnMove?.(move);\n }\n } else {\n const move = cardMove(event);\n if (move) {\n onMove?.(move);\n }\n }\n },\n [columnIds, onColumnMove, onMove, reset],\n );\n\n const value = useMemo(\n () => ({ activeId, activeType, overColumnId }),\n [activeId, activeType, overColumnId],\n );\n\n const board = (\n <div\n ref={ref}\n className={[\"ds-board\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n\n return (\n <BoardContext.Provider value={value}>\n <DndContext\n id={`ds-board-${dndId}`}\n sensors={sensors}\n collisionDetection={boardCollisionDetection}\n /* Lanes scroll and change height mid-drag, so positions are re-read\n * continuously — without this the shift animation misfires. */\n measuring={{ droppable: { strategy: MeasuringStrategy.Always } }}\n\n onDragStart={handleStart}\n onDragOver={handleOver}\n onDragEnd={handleEnd}\n onDragCancel={reset}\n >\n {columnIds ? (\n <SortableContext\n items={columnIds}\n strategy={horizontalListSortingStrategy}\n >\n {board}\n </SortableContext>\n ) : (\n board\n )}\n <DragOverlay>\n {activeId && activeType === \"card\" ? (\n <div\n className=\"ds-board-card\"\n data-overlay\n >\n <span\n className=\"ds-board-card__handle\"\n aria-hidden=\"true\"\n >\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-board-card__content\">{renderDragOverlay?.(activeId)}</div>\n </div>\n ) : null}\n {activeId && activeType === \"column\" ? (\n <div\n className=\"ds-board-column\"\n data-overlay\n >\n {renderColumnDragOverlay?.(activeId)}\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n </BoardContext.Provider>\n );\n});\n\nexport interface BoardColumnProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n title: string;\n /** Card ids in render order — the sortable contract for this column. */\n itemIds: string[];\n /** Shown beside the title; defaults to the number of cards. */\n count?: number;\n /** A control in the column head, e.g. an add button or a menu. */\n action?: ReactNode;\n /** Set false to pin a lane in place. */\n isDraggable?: boolean;\n children?: ReactNode;\n}\n\n/**\n * One lane of the board. Heavy frame, hairline head rule, scrolling body, and\n * a grip on top of the head that drags the whole lane sideways.\n */\nexport const BoardColumn = forwardRef<HTMLElement, BoardColumnProps>(function BoardColumn(\n { id, title, itemIds, count, action, isDraggable = true, className, children, ...rest },\n ref,\n) {\n const { activeType, overColumnId } = useContext(BoardContext);\n const { setNodeRef: setBodyRef } = useDroppable({\n id: `${id}::body`,\n data: { type: \"column-body\", columnId: id, items: itemIds },\n });\n const {\n attributes,\n listeners,\n setNodeRef: setColumnRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id,\n disabled: !isDraggable,\n data: { type: \"column\", columnId: id, items: itemIds },\n });\n\n return (\n <section\n ref={mergeRefs(setColumnRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-column\", className].filter(Boolean).join(\" \")}\n data-over={(activeType === \"card\" && overColumnId === id) || undefined}\n data-dragging={isDragging || undefined}\n\n aria-label={title}\n {...rest}\n >\n {isDraggable && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n iconStart=\"grip-horizontal\"\n className=\"ds-board-column__grip\"\n aria-label={`Reorder ${title}`}\n {...attributes}\n {...listeners}\n />\n )}\n <header className=\"ds-board-column__head\">\n <span className=\"ds-board-column__title\">{title}</span>\n <span className=\"ds-board-column__count\">{count ?? itemIds.length}</span>\n {action && <span className=\"ds-board-column__action\">{action}</span>}\n </header>\n <div\n ref={setBodyRef}\n className=\"ds-board-column__body\"\n >\n <SortableContext\n items={itemIds}\n strategy={verticalListSortingStrategy}\n >\n {children}\n </SortableContext>\n </div>\n </section>\n );\n});\n\nexport interface BoardCardProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n columnId: string;\n /** Accessible name announced when the card is picked up. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * A draggable card. The grip on the left is the handle, so the card body can\n * hold links and buttons; the grip is a real button for keyboard users:\n * space to pick up, arrows to move, space to drop.\n */\nexport const BoardCard = forwardRef<HTMLDivElement, BoardCardProps>(function BoardCard(\n { id, columnId, label, className, children, ...rest },\n ref,\n) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n data: { type: \"card\", columnId },\n });\n const { activeId } = useContext(BoardContext);\n\n return (\n <div\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-card\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n data-idle={activeId && activeId !== id ? \"\" : undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-board-card__handle\"\n aria-label={label ? `Move ${label}` : \"Move card\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-board-card__content\">{children}</div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;AAGA,SAAgBE,EACd,EAAE,WAAQ,WACV,GAC6B;CAC7B,IAAI,CAACC,GACH;CAEF,IAAMC,IAAOD,EAAK,KAAK,WAAW,CAAC,GAC7BE,IAAWD,EAAKE,SAAY,WAAW,OAAOH,EAAK,EAAE,IAAI,OAAOC,EAAKG,YAAe,EAAE,GACtFC,IAAUC,EAAU,QAAQJ,CAAQ;CAC1C,IAAI,MAAU,KAAKA,MAAa,OAAOK,EAAO,EAAE,IAGhD,OAAO;EAAE,UAAU,OAAOA,EAAO,EAAE;EAAG;CAAQ;AAChD;AAEA,SAAgBC,EAAS,EAAE,WAAQ,WAA6C;CAC9E,IAAI,CAACR,GACH;CAEF,IAAMS,IAAe,OAAOF,EAAO,KAAK,SAAUH,YAAe,EAAE,GAC7DH,IAAOD,EAAK,KAAK,WAAW,CAAC,GAC7BU,IAAST,EAAKE,SAAY,QAC1BQ,IAAa,OAAOV,EAAKG,aAAgBM,IAAS,KAAKV,EAAK,GAAG,GAE/DK,IAAUK,IACVT,EAAKW,UAA+C,SAAS,KAC7DX,EAAKY,SAAqC,CAAC,EAAA,CAAG;CACpD,IAAKF,MAGDF,MAAiBE,KAAc,OAAOJ,EAAO,EAAE,MAAM,OAAOP,EAAK,EAAE,IAGvE,OAAO;EAAE,QAAQ,OAAOO,EAAO,EAAE;EAAG;EAAc;EAAY;CAAQ;AACxE;;;AC/BA,IAAaO,KAAmD,GAAO,MAAS;CAC9E,IAAM,EAAE,uBAAoB,eAAYC;CACxC,IAAIC,EAAM,SAAS,eAAeA,EAAM,SAAS,cAAc;EAC7D,IAAMC,IAAaC,EAAQ,oBACxB,WAAW,CAAC,CACZ,QAAQ,MAAMC,EAAE,KA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,GACA;CACA,IAAM,EAAE,eAAY,cAAW,eAAY,cAAW,eAAY,kBAAeyC,EAAY;EAC3F;EACA,MAAM;GAAE,MAAM;GAAQ;EAAS;CACjC,CAAC,GACK,EAAE,gBAAaL,EAAWxC,CAAY;CAE5C,OACE,kBAAC,OAAD;EACE,KAAKtC,EAAUiG,GAAYZ,CAAG;EAC9B,OAAO;GAAE,WAAWC,EAAI,UAAU,SAASC,CAAS;GAAG;EAAW;EAClE,WAAW,CAAC,iBAAiBlB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAChE,iBAAemB,KAAc,KAAA;EAC7B,aAAW3C,KAAYA,MAAaR,IAAK,KAAK,KAAA;EAC9C,GAAIK;EANN,UAAA,CAQE,kBAACgD,GAAD;GACE,SAAQ;GACR,MAAK;GACL,YAAA;GACA,WAAU;GACV,WAAU;GACV,cAAYQ,IAAQ,QAAQA,MAAU;GACtC,GAAIP;GACJ,GAAIC;EACL,CAAA,GACD,kBAAC,OAAD;GAAK,WAAU;GAA0B;EAAc,CAAA,CACpD;;AAET,CAAC"}
1
+ {"version":3,"file":"Board-CcIF7jS0.js","names":["Icon","mergeRefs","columnMove","over","data","columnId","\"type\"","\"columnId\"","toIndex","columnIds","active","cardMove","fromColumnId","onCard","toColumnId","\"sortable\"","\"items\"","boardCoordinateGetter","args","event","containers","context","c","a","b","activeRect","rect","currentCoordinates","sortableKeyboardCoordinates","boardCollisionDetection","isColumn","type","container","scoped","closestCorners","within","pointerWithin","rank","id","BoardContext","createContext","Board","forwardRef","rest","dndId","useId","activeId","setActiveId","useState","activeType","setActiveType","overColumnId","setOverColumnId","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","handleStart","useCallback","handleOver","overData","reset","handleEnd","move","onColumnMove","onMove","value","useMemo","board","className","DndContext","MeasuringStrategy","SortableContext","horizontalListSortingStrategy","DragOverlay","renderDragOverlay","renderColumnDragOverlay","BoardColumn","useContext","setBodyRef","useDroppable","itemIds","setColumnRef","useSortable","isDraggable","ref","CSS","transform","isDragging","title","Button","attributes","listeners","count","action","verticalListSortingStrategy","BoardCard","setNodeRef","label"],"sources":["../../src/components/Board/moves.ts","../../src/components/Board/keyboard.ts","../../src/components/Board/index.tsx"],"sourcesContent":["import type { DragEndEvent } from \"@dnd-kit/core\";\nimport type { BoardColumnMove, BoardMove } from \".\";\n\nexport function columnMove(\n { active, over }: DragEndEvent,\n columnIds: string[],\n): BoardColumnMove | undefined {\n if (!over) {\n return;\n }\n const data = over.data.current ?? {};\n const columnId = data[\"type\"] === \"column\" ? String(over.id) : String(data[\"columnId\"] ?? \"\");\n const toIndex = columnIds.indexOf(columnId);\n if (toIndex < 0 || columnId === String(active.id)) {\n return;\n }\n return { columnId: String(active.id), toIndex };\n}\n\nexport function cardMove({ active, over }: DragEndEvent): BoardMove | undefined {\n if (!over) {\n return;\n }\n const fromColumnId = String(active.data.current?.[\"columnId\"] ?? \"\");\n const data = over.data.current ?? {};\n const onCard = data[\"type\"] === \"card\";\n const toColumnId = String(data[\"columnId\"] ?? (onCard ? \"\" : over.id));\n // A card occupies a precise slot; empty lane space appends to the lane.\n const toIndex = onCard\n ? ((data[\"sortable\"] as { index: number } | undefined)?.index ?? 0)\n : ((data[\"items\"] as string[] | undefined) ?? []).length;\n if (!toColumnId) {\n return;\n }\n if (fromColumnId === toColumnId && String(active.id) === String(over.id)) {\n return;\n }\n return { cardId: String(active.id), fromColumnId, toColumnId, toIndex };\n}\n","import type { KeyboardCoordinateGetter } from \"@dnd-kit/core\";\nimport { sortableKeyboardCoordinates } from \"@dnd-kit/sortable\";\n\n/**\n * Arrow up/down sorts inside a lane; left/right jumps lanes, which the stock\n * sortable getter does not do.\n */\nexport const boardCoordinateGetter: KeyboardCoordinateGetter = (event, args) => {\n const { currentCoordinates, context } = args;\n if (event.code === \"ArrowLeft\" || event.code === \"ArrowRight\") {\n const containers = context.droppableContainers\n .getEnabled()\n .filter((c) => c.data.current?.[\"type\"] === \"column-body\")\n .sort((a, b) => (a.rect.current?.left ?? 0) - (b.rect.current?.left ?? 0));\n const activeRect = context.active?.rect.current.translated;\n if (!activeRect) {\n return undefined;\n }\n const index = containers.findIndex(\n (c) =>\n (c.rect.current?.left ?? 0) <= activeRect.left + 1 &&\n (c.rect.current?.right ?? 0) >= activeRect.left - 1,\n );\n const next = containers[index + (event.code === \"ArrowRight\" ? 1 : -1)];\n const rect = next?.rect.current;\n if (!rect) {\n return undefined;\n }\n event.preventDefault();\n return { x: rect.left + rect.width / 2 - activeRect.width / 2, y: currentCoordinates.y };\n }\n return sortableKeyboardCoordinates(event, args);\n};\n","import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useId,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCorners,\n pointerWithin,\n MeasuringStrategy,\n useDroppable,\n useSensor,\n useSensors,\n type CollisionDetection,\n type DragEndEvent,\n type DragOverEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n horizontalListSortingStrategy,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { cardMove, columnMove } from \"./moves\";\nimport { boardCoordinateGetter } from \"./keyboard\";\nimport \"./style.css\";\n\nexport interface BoardMove {\n cardId: string;\n fromColumnId: string;\n toColumnId: string;\n /** Index the card lands on inside the destination column. */\n toIndex: number;\n}\n\nexport interface BoardColumnMove {\n columnId: string;\n toIndex: number;\n}\n\ninterface BoardContextValue {\n activeId: string | null;\n activeType: \"card\" | \"column\" | null;\n /** The lane the pointer is currently over, whatever it is actually over. */\n overColumnId: string | null;\n}\n\n/**\n * A lane's body sits inside the lane's frame, so a raw corner-distance\n * strategy lets the body steal the hit from the lane itself — most visibly at\n * the board ends, where the last lane then never shifts aside to open the\n * drop gap. Resolve by what is being dragged: a column only ever hits other\n * columns; a card hits the card under the pointer first, then the lane body\n * under it, then whatever is nearest.\n */\nconst boardCollisionDetection: CollisionDetection = (args) => {\n const isColumn = args.active.data.current?.[\"type\"] === \"column\";\n const containers = args.droppableContainers.filter((container) => {\n const type = container.data.current?.[\"type\"];\n return isColumn ? type === \"column\" : type !== \"column\";\n });\n const scoped = { ...args, droppableContainers: containers };\n if (isColumn) {\n return closestCorners(scoped);\n }\n const within = pointerWithin(scoped);\n if (within.length > 0) {\n const rank = (id: (typeof within)[number][\"id\"]) =>\n containers.find((c) => c.id === id)?.data.current?.[\"type\"] === \"card\" ? 0 : 1;\n return [...within].sort((a, b) => rank(a.id) - rank(b.id));\n }\n return closestCorners(scoped);\n};\n\nconst BoardContext = createContext<BoardContextValue>({\n activeId: null,\n activeType: null,\n overColumnId: null,\n});\n\nexport interface BoardProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onDragEnd\"> {\n /** Column ids in render order. Required for columns to be re-orderable. */\n columnIds?: string[];\n /** Fired once a card is dropped somewhere new. Apply it to your own state. */\n onMove?: (move: BoardMove) => void;\n /** Fired once a column is dropped in a new position. */\n onColumnMove?: (move: BoardColumnMove) => void;\n /** Rendered inside the drag overlay while a card is in the air. */\n renderDragOverlay?: (cardId: string) => ReactNode;\n /** Rendered inside the drag overlay while a column is in the air. */\n renderColumnDragOverlay?: (columnId: string) => ReactNode;\n children?: ReactNode;\n}\n\n/**\n * A column board with pointer and keyboard dragging. The board owns the drag\n * mechanics only — the card data stays yours; react to `onMove`.\n */\nexport const Board = forwardRef<HTMLDivElement, BoardProps>(function Board(\n {\n columnIds,\n onMove,\n onColumnMove,\n renderDragOverlay,\n renderColumnDragOverlay,\n className,\n children,\n ...rest\n },\n ref,\n) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [activeType, setActiveType] = useState<\"card\" | \"column\" | null>(null);\n const [overColumnId, setOverColumnId] = useState<string | null>(null);\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: boardCoordinateGetter }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n setActiveType(event.active.data.current?.[\"type\"] === \"column\" ? \"column\" : \"card\");\n }, []);\n\n /* Cards land on cards as often as on empty space, so the lane a drag is over\n * is always resolved back to a column id — one highlight, one meaning. */\n const handleOver = useCallback((event: DragOverEvent) => {\n const over = event.over;\n if (!over) {\n setOverColumnId(null);\n return;\n }\n const overData = over.data.current ?? {};\n const columnId =\n overData[\"type\"] === \"column\" ? String(over.id) : String(overData[\"columnId\"] ?? \"\");\n setOverColumnId(columnId || null);\n }, []);\n\n const reset = useCallback(() => {\n setActiveId(null);\n setActiveType(null);\n setOverColumnId(null);\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n reset();\n if (!over) {\n return;\n }\n\n /* Columns reorder among themselves; a column never lands inside a lane. */\n if (active.data.current?.[\"type\"] === \"column\") {\n const move = columnMove(event, columnIds ?? []);\n if (move) {\n onColumnMove?.(move);\n }\n } else {\n const move = cardMove(event);\n if (move) {\n onMove?.(move);\n }\n }\n },\n [columnIds, onColumnMove, onMove, reset],\n );\n\n const value = useMemo(\n () => ({ activeId, activeType, overColumnId }),\n [activeId, activeType, overColumnId],\n );\n\n const board = (\n <div\n ref={ref}\n className={[\"ds-board\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n\n return (\n <BoardContext.Provider value={value}>\n <DndContext\n id={`ds-board-${dndId}`}\n sensors={sensors}\n collisionDetection={boardCollisionDetection}\n /* Lanes scroll and change height mid-drag, so positions are re-read\n * continuously — without this the shift animation misfires. */\n measuring={{ droppable: { strategy: MeasuringStrategy.Always } }}\n\n onDragStart={handleStart}\n onDragOver={handleOver}\n onDragEnd={handleEnd}\n onDragCancel={reset}\n >\n {columnIds ? (\n <SortableContext\n items={columnIds}\n strategy={horizontalListSortingStrategy}\n >\n {board}\n </SortableContext>\n ) : (\n board\n )}\n <DragOverlay>\n {activeId && activeType === \"card\" ? (\n <div\n className=\"ds-board-card\"\n data-overlay\n >\n <span\n className=\"ds-board-card__handle\"\n aria-hidden=\"true\"\n >\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-board-card__content\">{renderDragOverlay?.(activeId)}</div>\n </div>\n ) : null}\n {activeId && activeType === \"column\" ? (\n <div\n className=\"ds-board-column\"\n data-overlay\n >\n {renderColumnDragOverlay?.(activeId)}\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n </BoardContext.Provider>\n );\n});\n\nexport interface BoardColumnProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n title: string;\n /** Card ids in render order — the sortable contract for this column. */\n itemIds: string[];\n /** Shown beside the title; defaults to the number of cards. */\n count?: number;\n /** A control in the column head, e.g. an add button or a menu. */\n action?: ReactNode;\n /** Set false to pin a lane in place. */\n isDraggable?: boolean;\n children?: ReactNode;\n}\n\n/**\n * One lane of the board. Heavy frame, hairline head rule, scrolling body, and\n * a grip on top of the head that drags the whole lane sideways.\n */\nexport const BoardColumn = forwardRef<HTMLElement, BoardColumnProps>(function BoardColumn(\n { id, title, itemIds, count, action, isDraggable = true, className, children, ...rest },\n ref,\n) {\n const { activeType, overColumnId } = useContext(BoardContext);\n const { setNodeRef: setBodyRef } = useDroppable({\n id: `${id}::body`,\n data: { type: \"column-body\", columnId: id, items: itemIds },\n });\n const {\n attributes,\n listeners,\n setNodeRef: setColumnRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id,\n disabled: !isDraggable,\n data: { type: \"column\", columnId: id, items: itemIds },\n });\n\n return (\n <section\n ref={mergeRefs(setColumnRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-column\", className].filter(Boolean).join(\" \")}\n data-over={(activeType === \"card\" && overColumnId === id) || undefined}\n data-dragging={isDragging || undefined}\n\n aria-label={title}\n {...rest}\n >\n {isDraggable && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n iconStart=\"grip-horizontal\"\n className=\"ds-board-column__grip\"\n aria-label={`Reorder ${title}`}\n {...attributes}\n {...listeners}\n />\n )}\n <header className=\"ds-board-column__head\">\n <span className=\"ds-board-column__title\">{title}</span>\n <span className=\"ds-board-column__count\">{count ?? itemIds.length}</span>\n {action && <span className=\"ds-board-column__action\">{action}</span>}\n </header>\n <div\n ref={setBodyRef}\n className=\"ds-board-column__body\"\n >\n <SortableContext\n items={itemIds}\n strategy={verticalListSortingStrategy}\n >\n {children}\n </SortableContext>\n </div>\n </section>\n );\n});\n\nexport interface BoardCardProps extends HTMLAttributes<HTMLDivElement> {\n id: string;\n columnId: string;\n /** Accessible name announced when the card is picked up. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * A draggable card. The grip on the left is the handle, so the card body can\n * hold links and buttons; the grip is a real button for keyboard users:\n * space to pick up, arrows to move, space to drop.\n */\nexport const BoardCard = forwardRef<HTMLDivElement, BoardCardProps>(function BoardCard(\n { id, columnId, label, className, children, ...rest },\n ref,\n) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n data: { type: \"card\", columnId },\n });\n const { activeId } = useContext(BoardContext);\n\n return (\n <div\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-board-card\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n data-idle={activeId && activeId !== id ? \"\" : undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-board-card__handle\"\n aria-label={label ? `Move ${label}` : \"Move card\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-board-card__content\">{children}</div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;AAGA,SAAgBE,EACd,EAAE,WAAQ,WACV,GAC6B;CAC7B,IAA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