@namroodinc/liquid-editorial 0.14.0 → 0.15.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 (198) hide show
  1. package/README.md +1 -1
  2. package/UPGRADING.md +47 -0
  3. package/dist/chunks/{Avatar-Dw7EWd_-.cjs → Avatar-BZGFSE6C.cjs} +2 -2
  4. package/dist/chunks/{Avatar-Dw7EWd_-.cjs.map → Avatar-BZGFSE6C.cjs.map} +1 -1
  5. package/dist/chunks/{Avatar-BToMaTdL.js → Avatar-C4W-g8nU.js} +2 -2
  6. package/dist/chunks/{Avatar-BToMaTdL.js.map → Avatar-C4W-g8nU.js.map} +1 -1
  7. package/dist/chunks/{Board-XeDG9nWP.js → Board-Cbi5FMW-.js} +2 -2
  8. package/dist/chunks/{Board-XeDG9nWP.js.map → Board-Cbi5FMW-.js.map} +1 -1
  9. package/dist/chunks/{Board-DeXtaWNO.cjs → Board-_agEjTy8.cjs} +2 -2
  10. package/dist/chunks/{Board-DeXtaWNO.cjs.map → Board-_agEjTy8.cjs.map} +1 -1
  11. package/dist/chunks/{CollectionView-Dbg4d_tA.cjs → CollectionView-BfX2Lxre.cjs} +2 -2
  12. package/dist/chunks/{CollectionView-Dbg4d_tA.cjs.map → CollectionView-BfX2Lxre.cjs.map} +1 -1
  13. package/dist/chunks/{CollectionView-C0_bTO2v.js → CollectionView-DPJGtSP5.js} +2 -2
  14. package/dist/chunks/{CollectionView-C0_bTO2v.js.map → CollectionView-DPJGtSP5.js.map} +1 -1
  15. package/dist/chunks/{ColourField-DAFzOIOq.cjs → ColourField-BVGnW8Wh.cjs} +2 -2
  16. package/dist/chunks/{ColourField-DAFzOIOq.cjs.map → ColourField-BVGnW8Wh.cjs.map} +1 -1
  17. package/dist/chunks/{ColourField-Bb8H87fg.js → ColourField-BcuARZY4.js} +6 -6
  18. package/dist/chunks/{ColourField-Bb8H87fg.js.map → ColourField-BcuARZY4.js.map} +1 -1
  19. package/dist/chunks/{DatePicker-COm1giw8.js → DatePicker-VQUsbYdo.js} +3 -3
  20. package/dist/chunks/{DatePicker-COm1giw8.js.map → DatePicker-VQUsbYdo.js.map} +1 -1
  21. package/dist/chunks/{DatePicker-DOg3iQYy.cjs → DatePicker-zA0bWVBp.cjs} +2 -2
  22. package/dist/chunks/{DatePicker-DOg3iQYy.cjs.map → DatePicker-zA0bWVBp.cjs.map} +1 -1
  23. package/dist/chunks/{Drawer-nUTJtwX_.js → Drawer-2cf0SaG4.js} +3 -3
  24. package/dist/chunks/{Drawer-nUTJtwX_.js.map → Drawer-2cf0SaG4.js.map} +1 -1
  25. package/dist/chunks/{Drawer-B2dcTh5l.cjs → Drawer-BzvSfkCL.cjs} +2 -2
  26. package/dist/chunks/{Drawer-B2dcTh5l.cjs.map → Drawer-BzvSfkCL.cjs.map} +1 -1
  27. package/dist/chunks/{EntryPicker-Ie9T47hA.js → EntryPicker-BGWxiLJ_.js} +7 -7
  28. package/dist/chunks/{EntryPicker-Ie9T47hA.js.map → EntryPicker-BGWxiLJ_.js.map} +1 -1
  29. package/dist/chunks/{EntryPicker-BwEYRtQl.cjs → EntryPicker-wVjzdlAO.cjs} +2 -2
  30. package/dist/chunks/{EntryPicker-BwEYRtQl.cjs.map → EntryPicker-wVjzdlAO.cjs.map} +1 -1
  31. package/dist/chunks/{FormEditor-DgDV5aeR.js → FormEditor-BHVJG23r.js} +2 -2
  32. package/dist/chunks/{FormEditor-DgDV5aeR.js.map → FormEditor-BHVJG23r.js.map} +1 -1
  33. package/dist/chunks/{FormEditor-D1HUnjMI.cjs → FormEditor-DjUz7qQo.cjs} +2 -2
  34. package/dist/chunks/{FormEditor-D1HUnjMI.cjs.map → FormEditor-DjUz7qQo.cjs.map} +1 -1
  35. package/dist/chunks/Icon-QLZH31JA.cjs +2 -0
  36. package/dist/chunks/Icon-QLZH31JA.cjs.map +1 -0
  37. package/dist/chunks/Icon-kLLQC54Z.js +107 -0
  38. package/dist/chunks/Icon-kLLQC54Z.js.map +1 -0
  39. package/dist/chunks/{Message-VJTPhId7.js → Message-DM6pTq7N.js} +2 -2
  40. package/dist/chunks/{Message-VJTPhId7.js.map → Message-DM6pTq7N.js.map} +1 -1
  41. package/dist/chunks/{Message-B0A5bz8V.cjs → Message-yZJDVzb8.cjs} +2 -2
  42. package/dist/chunks/{Message-B0A5bz8V.cjs.map → Message-yZJDVzb8.cjs.map} +1 -1
  43. package/dist/chunks/RichTextEditor-BgfeOrEe.cjs +2 -0
  44. package/dist/chunks/RichTextEditor-BgfeOrEe.cjs.map +1 -0
  45. package/dist/chunks/RichTextEditor-CS2ED0HP.js +2702 -0
  46. package/dist/chunks/RichTextEditor-CS2ED0HP.js.map +1 -0
  47. package/dist/chunks/dialogLabel-Dx-WEEzI.cjs +2 -0
  48. package/dist/chunks/dialogLabel-Dx-WEEzI.cjs.map +1 -0
  49. package/dist/chunks/dialogLabel-nB1gwKz0.js +157 -0
  50. package/dist/chunks/dialogLabel-nB1gwKz0.js.map +1 -0
  51. package/dist/chunks/overlayLayer-CPd3zj_u.cjs +2 -0
  52. package/dist/chunks/overlayLayer-CPd3zj_u.cjs.map +1 -0
  53. package/dist/chunks/overlayLayer-Dv1vmfaI.js +199 -0
  54. package/dist/chunks/overlayLayer-Dv1vmfaI.js.map +1 -0
  55. package/dist/chunks/{useTooltip-Du8PutGX.js → useTooltip-COyAcujL.js} +2 -2
  56. package/dist/chunks/{useTooltip-Du8PutGX.js.map → useTooltip-COyAcujL.js.map} +1 -1
  57. package/dist/chunks/{useTooltip-ekdwMJFz.cjs → useTooltip-nEDN0ObI.cjs} +2 -2
  58. package/dist/chunks/{useTooltip-ekdwMJFz.cjs.map → useTooltip-nEDN0ObI.cjs.map} +1 -1
  59. package/dist/components/AppShell/index.cjs +1 -1
  60. package/dist/components/AppShell/index.js +1 -1
  61. package/dist/components/AssetCard/index.cjs +1 -1
  62. package/dist/components/AssetCard/index.js +1 -1
  63. package/dist/components/AssetGrid/index.cjs +1 -1
  64. package/dist/components/AssetGrid/index.js +1 -1
  65. package/dist/components/Avatar/index.cjs +1 -1
  66. package/dist/components/Avatar/index.js +1 -1
  67. package/dist/components/Banner/index.cjs +1 -1
  68. package/dist/components/Banner/index.js +1 -1
  69. package/dist/components/Board/index.cjs +1 -1
  70. package/dist/components/Board/index.js +1 -1
  71. package/dist/components/Button/index.cjs +1 -1
  72. package/dist/components/Button/index.js +1 -1
  73. package/dist/components/CollectionView/index.cjs +1 -1
  74. package/dist/components/CollectionView/index.js +1 -1
  75. package/dist/components/ColourField/index.cjs +1 -1
  76. package/dist/components/ColourField/index.js +1 -1
  77. package/dist/components/DatePicker/index.cjs +1 -1
  78. package/dist/components/DatePicker/index.js +1 -1
  79. package/dist/components/Drawer/index.cjs +1 -1
  80. package/dist/components/Drawer/index.js +1 -1
  81. package/dist/components/EditLayout/index.cjs +1 -1
  82. package/dist/components/EditLayout/index.cjs.map +1 -1
  83. package/dist/components/EditLayout/index.js +6 -7
  84. package/dist/components/EditLayout/index.js.map +1 -1
  85. package/dist/components/EntryPicker/index.cjs +1 -1
  86. package/dist/components/EntryPicker/index.js +1 -1
  87. package/dist/components/EntryPicker/style.css +1 -1
  88. package/dist/components/FormEditor/README.md +72 -34
  89. package/dist/components/FormEditor/index.cjs +1 -1
  90. package/dist/components/FormEditor/index.js +2 -2
  91. package/dist/components/Icon/icons.d.cts +5 -0
  92. package/dist/components/Icon/icons.d.cts.map +1 -1
  93. package/dist/components/Icon/icons.d.ts +5 -0
  94. package/dist/components/Icon/icons.d.ts.map +1 -1
  95. package/dist/components/Icon/index.cjs +1 -1
  96. package/dist/components/Icon/index.js +1 -1
  97. package/dist/components/Menu/index.cjs +1 -1
  98. package/dist/components/Menu/index.js +9 -9
  99. package/dist/components/Menu/index.js.map +1 -1
  100. package/dist/components/Modal/index.cjs +1 -1
  101. package/dist/components/Modal/index.js +2 -2
  102. package/dist/components/Popover/index.cjs +1 -1
  103. package/dist/components/Popover/index.cjs.map +1 -1
  104. package/dist/components/Popover/index.d.cts.map +1 -1
  105. package/dist/components/Popover/index.d.ts.map +1 -1
  106. package/dist/components/Popover/index.js +67 -64
  107. package/dist/components/Popover/index.js.map +1 -1
  108. package/dist/components/RichTextEditor/content-block-frame.d.cts +32 -0
  109. package/dist/components/RichTextEditor/content-block-frame.d.cts.map +1 -0
  110. package/dist/components/RichTextEditor/content-block-frame.d.ts +32 -0
  111. package/dist/components/RichTextEditor/content-block-frame.d.ts.map +1 -0
  112. package/dist/components/RichTextEditor/content-block-view.d.cts +3 -0
  113. package/dist/components/RichTextEditor/content-block-view.d.cts.map +1 -0
  114. package/dist/components/RichTextEditor/content-block-view.d.ts +3 -0
  115. package/dist/components/RichTextEditor/content-block-view.d.ts.map +1 -0
  116. package/dist/components/RichTextEditor/content-block.d.cts +24 -0
  117. package/dist/components/RichTextEditor/content-block.d.cts.map +1 -0
  118. package/dist/components/RichTextEditor/content-block.d.ts +24 -0
  119. package/dist/components/RichTextEditor/content-block.d.ts.map +1 -0
  120. package/dist/components/RichTextEditor/document.d.cts +10 -7
  121. package/dist/components/RichTextEditor/document.d.cts.map +1 -1
  122. package/dist/components/RichTextEditor/document.d.ts +10 -7
  123. package/dist/components/RichTextEditor/document.d.ts.map +1 -1
  124. package/dist/components/RichTextEditor/index.cjs +1 -1
  125. package/dist/components/RichTextEditor/index.d.cts +1 -1
  126. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  127. package/dist/components/RichTextEditor/index.d.ts +1 -1
  128. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  129. package/dist/components/RichTextEditor/index.js +1 -1
  130. package/dist/components/RichTextEditor/style.css +126 -49
  131. package/dist/components/RichTextEditor/table-actions.d.cts +11 -0
  132. package/dist/components/RichTextEditor/table-actions.d.cts.map +1 -0
  133. package/dist/components/RichTextEditor/table-actions.d.ts +11 -0
  134. package/dist/components/RichTextEditor/table-actions.d.ts.map +1 -0
  135. package/dist/components/RichTextEditor/table-bands.d.cts +19 -0
  136. package/dist/components/RichTextEditor/table-bands.d.cts.map +1 -0
  137. package/dist/components/RichTextEditor/table-bands.d.ts +19 -0
  138. package/dist/components/RichTextEditor/table-bands.d.ts.map +1 -0
  139. package/dist/components/RichTextEditor/table-view.d.cts +4 -0
  140. package/dist/components/RichTextEditor/table-view.d.cts.map +1 -0
  141. package/dist/components/RichTextEditor/table-view.d.ts +4 -0
  142. package/dist/components/RichTextEditor/table-view.d.ts.map +1 -0
  143. package/dist/components/RichTextEditor/tables.d.cts.map +1 -1
  144. package/dist/components/RichTextEditor/tables.d.ts.map +1 -1
  145. package/dist/components/RichTextEditor/use-embeds.d.cts.map +1 -1
  146. package/dist/components/RichTextEditor/use-embeds.d.ts.map +1 -1
  147. package/dist/components/SearchField/index.cjs +1 -1
  148. package/dist/components/SearchField/index.js +1 -1
  149. package/dist/components/Select/index.cjs +1 -1
  150. package/dist/components/Select/index.js +2 -2
  151. package/dist/components/SideNav/index.cjs +1 -1
  152. package/dist/components/SideNav/index.js +1 -1
  153. package/dist/components/SortableList/index.cjs +1 -1
  154. package/dist/components/SortableList/index.js +1 -1
  155. package/dist/components/Stepper/index.cjs +1 -1
  156. package/dist/components/Stepper/index.js +1 -1
  157. package/dist/components/SubNav/index.cjs +1 -1
  158. package/dist/components/SubNav/index.js +1 -1
  159. package/dist/components/Switch/style.css +2 -6
  160. package/dist/components/Table/index.cjs +1 -1
  161. package/dist/components/Table/index.js +1 -1
  162. package/dist/components/Time/index.cjs +1 -1
  163. package/dist/components/Time/index.js +1 -1
  164. package/dist/components/Toast/index.cjs +1 -1
  165. package/dist/components/Toast/index.js +1 -1
  166. package/dist/components/TopNav/index.cjs +1 -1
  167. package/dist/components/TopNav/index.js +1 -1
  168. package/dist/index.cjs +1 -1
  169. package/dist/index.d.cts +1 -1
  170. package/dist/index.d.cts.map +1 -1
  171. package/dist/index.d.ts +1 -1
  172. package/dist/index.d.ts.map +1 -1
  173. package/dist/index.js +17 -17
  174. package/package.json +1 -1
  175. package/dist/chunks/Icon-Bxvp1-td.js +0 -102
  176. package/dist/chunks/Icon-Bxvp1-td.js.map +0 -1
  177. package/dist/chunks/Icon-CnnTrtNb.cjs +0 -2
  178. package/dist/chunks/Icon-CnnTrtNb.cjs.map +0 -1
  179. package/dist/chunks/RichTextEditor-DPhEkDxi.js +0 -2108
  180. package/dist/chunks/RichTextEditor-DPhEkDxi.js.map +0 -1
  181. package/dist/chunks/RichTextEditor-DV7NZp_k.cjs +0 -2
  182. package/dist/chunks/RichTextEditor-DV7NZp_k.cjs.map +0 -1
  183. package/dist/chunks/dialogLabel-C153NosD.js +0 -176
  184. package/dist/chunks/dialogLabel-C153NosD.js.map +0 -1
  185. package/dist/chunks/dialogLabel-CNNQbtob.cjs +0 -2
  186. package/dist/chunks/dialogLabel-CNNQbtob.cjs.map +0 -1
  187. package/dist/chunks/overlayLayer-CtOTt1xB.cjs +0 -2
  188. package/dist/chunks/overlayLayer-CtOTt1xB.cjs.map +0 -1
  189. package/dist/chunks/overlayLayer-Og07sIyl.js +0 -180
  190. package/dist/chunks/overlayLayer-Og07sIyl.js.map +0 -1
  191. package/dist/components/RichTextEditor/storyblock-view.d.cts +0 -3
  192. package/dist/components/RichTextEditor/storyblock-view.d.cts.map +0 -1
  193. package/dist/components/RichTextEditor/storyblock-view.d.ts +0 -3
  194. package/dist/components/RichTextEditor/storyblock-view.d.ts.map +0 -1
  195. package/dist/components/RichTextEditor/storyblock.d.cts +0 -19
  196. package/dist/components/RichTextEditor/storyblock.d.cts.map +0 -1
  197. package/dist/components/RichTextEditor/storyblock.d.ts +0 -19
  198. package/dist/components/RichTextEditor/storyblock.d.ts.map +0 -1
@@ -68,7 +68,7 @@
68
68
  border: 0;
69
69
  border-radius: var(--field-radius);
70
70
 
71
- /* Steps from the row, result or storyblock it sits in, hovered or not. */
71
+ /* Steps from the row, result or content block it sits in, hovered or not. */
72
72
  background: var(--fill-control);
73
73
  color: var(--color-text-muted);
74
74
  }
@@ -317,29 +317,46 @@ stored document. Expansion is local UI state, so applications do not persist it.
317
317
 
318
318
  ### Rich-text tables
319
319
 
320
- Rich-text editors have one table control in the toolbar by default. Outside a
321
- table it is Insert table (`table` icon); while the caret is in a table it
322
- becomes Table actions (`grid-2x2-plus` icon), which opens the actions menu.
323
- Insert table opens a FormEditor form: Rows and Columns number fields (1–50 of each at
324
- insertion, with steppers) and an Include header row switch. The defaults are
325
- 3 × 3 with a header. FormEditor reports requiredness and bounds; the dialog adds
326
- "Enter a whole number." for a fractional count. A table inserted while a block such as a
327
- storyblock or rule is selected follows that block instead of replacing it, and
328
- the caret lands in the first cell. Insertion is one undo step, separate from
329
- typing that follows. Use Table actions from a cell to add or delete rows or
330
- columns, merge cells, toggle the header row, or delete the table. Row, column,
331
- cell and delete actions are separated, each with a lucide glyph: Add row above
332
- and below `rows-2-plus-top` and `rows-2-plus-bottom`, Add column before and
333
- after `columns-2-plus-left` and `columns-2-plus-right` (mirrored with
334
- right-to-left text), Delete row and column `table-rows-split` and
335
- `table-columns-split`, Merge cells `table-cells-merge`, Toggle header row
336
- `panel-top` and Delete table `grid-2x2-x`. Merge cells joins a selection of
337
- two or more cells, made by dragging or Shift-clicking across them, into one
338
- spanning cell. Actions that can't run, such as merging without a cell selection
339
- or deleting a table's only row or column, are disabled. Tab and Shift+Tab move
340
- between cells. Wide tables scroll inside the editor. Cells rest on the canvas,
341
- as storyblocks do, so a table stands apart from the editor's fill: lighter in
342
- the light theme, deeper in the dark one. The header row takes a stronger step.
320
+ The toolbar's Insert table button uses the `table` icon and is disabled when
321
+ the caret or selection is in a table or the whole table is selected. Outside
322
+ a table it opens a grid for up to 6 rows and 8 columns, initially focused at
323
+ 3 × 3. Hover or use the arrow keys to preview a size. While the grid has
324
+ focus, hovering a size also focuses it, so Enter inserts the size shown;
325
+ leaving the grid shows the focused size again. Pick a size by clicking or
326
+ pressing Enter or Space. Include header row is on by default.
327
+
328
+ Custom size opens a FormEditor form with Rows and Columns number fields
329
+ (1–50 each, with steppers) and carries over Include header row. FormEditor
330
+ reports requiredness and bounds. The dialog adds "Enter a whole number." for
331
+ a fractional count. With a content block or another standalone block selected,
332
+ Insert table places the table after it. The caret lands in the first cell.
333
+ Typing there starts a separate undo step.
334
+
335
+ Each table is a Content Block. Select a cell and open **⋯ Table actions**
336
+ in the block's title bar to add, delete, or move its row or column. Column
337
+ moves follow the visible left and right directions in LTR and RTL. Cells
338
+ joined by a span move together, header formatting stays at the edge, and
339
+ Undo reverts one move. Delete row and Delete column remove every row or
340
+ column the selected cells cover, and are disabled when that would remove all
341
+ of them.
342
+ Add row above is disabled when it would insert before a complete first-row
343
+ header. Rows can still be inserted below the header and columns on either side.
344
+
345
+ The same menu toggles the first-row and first-column headers, merges the
346
+ selected cells, splits a merged cell, and deletes the table. Moves and inserts
347
+ for a cell range use the cell where the selection ends. **Cell alignment**
348
+ applies left, centre, or right to the active cell or all cells in the selected
349
+ range in one undo step. Left is the default in both LTR and RTL. Choosing an
350
+ alignment returns focus to the editor. When the whole table is selected
351
+ without a cell, for example by clicking its title bar first, row, column,
352
+ merge and split commands are disabled with "Select a cell first", and Cell
353
+ alignment applies to every cell.
354
+
355
+ Tab and Shift+Tab move between cells while editing. Press Shift+F10 or
356
+ the Menu key from a cell to open **Table actions**; the browser's own context
357
+ menu for that key stays closed. Escape selects the whole
358
+ table and remembers the cell selection, and Tab then reaches the menu.
359
+ Click or drag the title-bar grip to select or move the whole table.
343
360
 
344
361
  A table is part of the existing TipTap JSON document, using `table`, `tableRow`,
345
362
  `tableHeader` and `tableCell` nodes. Cells can contain formatted content.
@@ -352,6 +369,16 @@ formatting without carrying over column widths. Content cut, copied or dragged
352
369
  within the same editor keeps its stored widths, and cells pasted into a table
353
370
  take that table's column widths.
354
371
 
372
+ Regular and header cells store alignment in `attrs.align` as `left`, `center`,
373
+ or `right`. An omitted or null value displays as left. HTML reads inline
374
+ `text-align` and the legacy `align` attribute. Saved alignment uses inline
375
+ `text-align` on `<td>` and `<th>`, so keep that property in HTML sanitizers.
376
+ Set the same left default in the delivery renderer.
377
+
378
+ Pasting or dropping a selection that contains an entry or asset Content Block
379
+ into a cell rejects the entire operation, including mixed selections with text.
380
+ Previously saved embeds inside a cell still load.
381
+
355
382
  Tables without stored widths save as a `<table>` with a `<tbody>` and no inline
356
383
  sizing. A table with any stored column width saves with its sizing:
357
384
 
@@ -712,16 +739,20 @@ See the packaged UPGRADING.md for removed styling APIs.
712
739
  Translate clear events and Field bindings here. Rich text is the one adapter
713
740
  `control.tsx` does not import: `rich-text-control.tsx` renders RichTextEditor,
714
741
  forwarding `expandedWidth` and `tables`, and `index.tsx` supplies it through
715
- `RichTextControlContext`. RichTextEditor's `tables.tsx` renders its Insert
716
- table form with `FormEditorCore` from `form.tsx`, so the two components
742
+ `RichTextControlContext`. RichTextEditor's `tables.tsx` handles the quick
743
+ grid and renders the custom size form with `FormEditorCore` from `form.tsx`,
744
+ so the two components
717
745
  never import each other in a cycle. RichTextEditor's `expansion.tsx` moves one
718
746
  rendering host into a headerless Modal; Modal and the shared `src/internal`
719
747
  helpers own the dialog behaviour and portal scope. RichTextEditor's
720
748
  `document.ts` builds the schema with or without tables for both the editor
721
749
  and `validateFormValues`. It also strips widths from cells pasted or dropped
722
750
  from outside the editor, and renders tables without stored widths as
723
- semantic HTML. `tables.tsx` owns the table
724
- dialog and actions.
751
+ semantic HTML. `table-view.tsx` extends TableView to mount the shared
752
+ `content-block-frame.tsx` and its grouped table actions. Its clipboard guard
753
+ rejects embeds before TableKit can paste content into selected cells.
754
+ `table-actions.ts` supplies the menus and uses `table-bands.ts` to move
755
+ spans and widths together.
725
756
  Do not copy control styling.
726
757
  3. **State/frame:** `form.tsx` (`FormEditorCore`) asserts the schema, owns controlled/uncontrolled
727
758
  wiring and changed-field tracking, and wraps each Field in Container with
@@ -803,7 +834,7 @@ reads "Embed entry" or "Embed asset" and inserts the one item it creates, with
803
834
  Done to close. Use the results checkboxes to select or deselect items. The
804
835
  footer shows the count as text, since an insertion has no limit to draw a
805
836
  usage ring against. Insert selected commits the selected items as
806
- consecutive storyblocks in selection order, with one undo step. Closing the
837
+ consecutive content blocks in selection order, with one undo step. Closing the
807
838
  dialog discards the pending selection. Replace still chooses one item, and New
808
839
  creates and inserts one item when the selection is empty. While a creation is
809
840
  pending (`isCreating`), rows can't be selected, so staging and creation never
@@ -812,7 +843,7 @@ compete for the same insertion. Embed sources ignore EntryPicker's `mode` and
812
843
 
813
844
  Give a source with `loadPage` a `resolveItem`. After a `refreshKey` change,
814
845
  Insert selected waits for `resolveItem` to check each staged item, even when
815
- refreshed search results already list it. The inserted storyblock uses the
846
+ refreshed search results already list it. The inserted content block uses the
816
847
  confirmed copy from the current refresh immediately. The picker deselects items
817
848
  that `resolveItem` returns as null, removed, unavailable or disabled, and any
818
849
  that a results page at the current refresh shows as removed, unavailable,
@@ -884,14 +915,21 @@ reason also ends it for good: the picker never reopens on its own and its target
884
915
  refuses later commits. `commit` always returns a boolean. Each Embed or Replace
885
916
  starts a fresh picker.
886
917
 
887
- Entry nodes store `{ type: "storyblock", attrs: { type: "entry", id: "article",
918
+ Entry nodes store `{ type: "contentBlock", attrs: { type: "entry", id: "article",
888
919
  entryId: "<resource ID>", align: "full" } }`; asset nodes store
889
- `{ type: "storyblock", attrs: { type: "asset", assetId: "<resource ID>", align:
920
+ `{ type: "contentBlock", attrs: { type: "asset", assetId: "<resource ID>", align:
890
921
  "full" } }`. Model IDs and resource IDs have separate meanings. Identifiers are
891
922
  opaque strings in the library; applications validate UUIDs/model formats and own
892
923
  model restrictions. Entry model IDs can be refreshed by the application's delivery
893
924
  serializer without changing the saved parent document.
894
925
 
926
+ Documents saved by 0.14.0 and earlier store the same attributes under
927
+ `type: "storyblock"` and in `data-storyblock*` HTML attributes. RichTextEditor
928
+ and FormEditor validation read them as content blocks without reporting a
929
+ change; the writer's next edit saves the current names. Applications that
930
+ validate, render or sanitize stored rich text must accept both forms until they
931
+ migrate stored documents by renaming the node type or attribute prefix.
932
+
895
933
  Blocks are atomic, draggable and selectable. Insert follows the cursor's top-level
896
934
  block, including when the caret is in a table cell. Replacement stays within
897
935
  the same kind and retains alignment. Left and
@@ -899,7 +937,7 @@ right blocks occupy 62% of the writing width and let text wrap around them. Belo
899
937
  32rem they use the full writing width. Drag the grip and kind label to move a
900
938
  block. Select a block with the arrow keys in the editor and press Tab to reach its
901
939
  `Block actions for {item title}` button. It opens the shared Menu, named the
902
- same: an Alignment group of icon-only radio items (Align left, Full width, Align
940
+ same, with a visible Alignment label above the icon-only radio items (Align left, Full width, Align
903
941
  right), then Edit, Replace and Remove from field. Opening it focuses the current
904
942
  alignment and the arrow keys walk the items. Tab closes it and continues after the
905
943
  editor; Shift+Tab and Escape return focus to the trigger. Alignment changes keep
@@ -917,7 +955,7 @@ writers continue after a final block. Selecting a block leaves the document inta
917
955
 
918
956
  A block alone satisfies required rich text. Syntax errors are rejected by both
919
957
  RichTextEditor and FormEditor validation. Resolved row data is never serialized;
920
- HTML uses reference-only data-storyblock attributes and round-trips through the
958
+ HTML uses reference-only data-content-block attributes and round-trips through the
921
959
  same schema. Node views share the selected-item cache's loading, stale-refresh and
922
960
  retry behavior; null or removed-tone items, static ones included, show a missing
923
961
  state. A static item takes precedence over a cached lookup, so supplying one
@@ -931,7 +969,7 @@ sources through stable wrappers, so sources built on every render don't re-rende
931
969
  every block; keep static `items` arrays stable. Resolution,
932
970
  selection, expansion and linked-item edits emit no document change on their own.
933
971
 
934
- The architecture remains `FormEditor → RichTextEditor → storyblock node views`,
972
+ The architecture remains `FormEditor → RichTextEditor → content block node views`,
935
973
  with both ordinary pickers and editor dialogs using `usePickerSession` (search,
936
974
  paging, selection rules, edit dismissal and the shared PickerDialog props),
937
975
  PickerDialog, EntryRow and the selected-item reader. Remote embed batches that
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/RichTextEditor-DV7NZp_k.cjs"),t=require("../../chunks/FormEditor-D1HUnjMI.cjs");exports.FormEditor=t.t,exports.validateFormValues=e.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/RichTextEditor-BgfeOrEe.cjs"),t=require("../../chunks/FormEditor-DjUz7qQo.cjs");exports.FormEditor=t.t,exports.validateFormValues=e.i;
@@ -1,3 +1,3 @@
1
- import { i as e } from "../../chunks/RichTextEditor-DPhEkDxi.js";
2
- import { t } from "../../chunks/FormEditor-DgDV5aeR.js";
1
+ import { i as e } from "../../chunks/RichTextEditor-CS2ED0HP.js";
2
+ import { t } from "../../chunks/FormEditor-BHVJG23r.js";
3
3
  export { t as FormEditor, e as validateFormValues };
@@ -4,6 +4,7 @@
4
4
  */
5
5
  export declare const icons: {
6
6
  readonly "align-left": import("lucide-react").LucideIcon;
7
+ readonly "align-center": import("lucide-react").LucideIcon;
7
8
  readonly "align-justify": import("lucide-react").LucideIcon;
8
9
  readonly "align-right": import("lucide-react").LucideIcon;
9
10
  readonly "alert-triangle": import("lucide-react").LucideIcon;
@@ -23,8 +24,10 @@ export declare const icons: {
23
24
  readonly redo: import("lucide-react").LucideIcon;
24
25
  readonly strikethrough: import("lucide-react").LucideIcon;
25
26
  readonly undo: import("lucide-react").LucideIcon;
27
+ readonly "arrow-down": import("lucide-react").LucideIcon;
26
28
  readonly "arrow-left": import("lucide-react").LucideIcon;
27
29
  readonly "arrow-right": import("lucide-react").LucideIcon;
30
+ readonly "arrow-up": import("lucide-react").LucideIcon;
28
31
  readonly calendar: import("lucide-react").LucideIcon;
29
32
  readonly check: import("lucide-react").LucideIcon;
30
33
  readonly "chevron-down": import("lucide-react").LucideIcon;
@@ -75,11 +78,13 @@ export declare const icons: {
75
78
  readonly "columns-2-plus-right": import("lucide-react").LucideIcon;
76
79
  readonly "grid-2x2-plus": import("lucide-react").LucideIcon;
77
80
  readonly "grid-2x2-x": import("lucide-react").LucideIcon;
81
+ readonly "panel-left": import("lucide-react").LucideIcon;
78
82
  readonly "panel-top": import("lucide-react").LucideIcon;
79
83
  readonly "rows-2-plus-bottom": import("lucide-react").LucideIcon;
80
84
  readonly "rows-2-plus-top": import("lucide-react").LucideIcon;
81
85
  readonly table: import("lucide-react").LucideIcon;
82
86
  readonly "table-cells-merge": import("lucide-react").LucideIcon;
87
+ readonly "table-cells-split": import("lucide-react").LucideIcon;
83
88
  readonly "table-columns-split": import("lucide-react").LucideIcon;
84
89
  readonly "table-rows-split": import("lucide-react").LucideIcon;
85
90
  readonly x: import("lucide-react").LucideIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.cts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAmFA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFR,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"icons.d.cts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAwFA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFR,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  export declare const icons: {
6
6
  readonly "align-left": import("lucide-react").LucideIcon;
7
+ readonly "align-center": import("lucide-react").LucideIcon;
7
8
  readonly "align-justify": import("lucide-react").LucideIcon;
8
9
  readonly "align-right": import("lucide-react").LucideIcon;
9
10
  readonly "alert-triangle": import("lucide-react").LucideIcon;
@@ -23,8 +24,10 @@ export declare const icons: {
23
24
  readonly redo: import("lucide-react").LucideIcon;
24
25
  readonly strikethrough: import("lucide-react").LucideIcon;
25
26
  readonly undo: import("lucide-react").LucideIcon;
27
+ readonly "arrow-down": import("lucide-react").LucideIcon;
26
28
  readonly "arrow-left": import("lucide-react").LucideIcon;
27
29
  readonly "arrow-right": import("lucide-react").LucideIcon;
30
+ readonly "arrow-up": import("lucide-react").LucideIcon;
28
31
  readonly calendar: import("lucide-react").LucideIcon;
29
32
  readonly check: import("lucide-react").LucideIcon;
30
33
  readonly "chevron-down": import("lucide-react").LucideIcon;
@@ -75,11 +78,13 @@ export declare const icons: {
75
78
  readonly "columns-2-plus-right": import("lucide-react").LucideIcon;
76
79
  readonly "grid-2x2-plus": import("lucide-react").LucideIcon;
77
80
  readonly "grid-2x2-x": import("lucide-react").LucideIcon;
81
+ readonly "panel-left": import("lucide-react").LucideIcon;
78
82
  readonly "panel-top": import("lucide-react").LucideIcon;
79
83
  readonly "rows-2-plus-bottom": import("lucide-react").LucideIcon;
80
84
  readonly "rows-2-plus-top": import("lucide-react").LucideIcon;
81
85
  readonly table: import("lucide-react").LucideIcon;
82
86
  readonly "table-cells-merge": import("lucide-react").LucideIcon;
87
+ readonly "table-cells-split": import("lucide-react").LucideIcon;
83
88
  readonly "table-columns-split": import("lucide-react").LucideIcon;
84
89
  readonly "table-rows-split": import("lucide-react").LucideIcon;
85
90
  readonly x: import("lucide-react").LucideIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAmFA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFR,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAwFA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFR,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CnnTrtNb.cjs");exports.Icon=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-QLZH31JA.cjs");exports.Icon=e.t;
@@ -1 +1 @@
1
- export { t as Icon } from "../../chunks/Icon-Bxvp1-td.js";
1
+ export { t as Icon } from "../../chunks/Icon-kLLQC54Z.js";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/overlayLayer-CtOTt1xB.cjs"),n=require("../Popover/index.cjs");let r=require("react"),i=require("react/jsx-runtime");function a(...e){return e.filter(Boolean).join(` `)}var o=(0,r.forwardRef)(function({trigger:e,align:o=`start`,className:s,children:c,onClick:l,onKeyDown:u,"aria-label":d,"aria-labelledby":f,...p},m){let[h,g]=(0,r.useState)(!1),_=t.o(h),v=(0,r.useRef)(null),y=(0,r.useRef)(null),b=(0,r.useRef)(null),x=(0,r.useId)(),S=(0,r.useCallback)(()=>g(!1),[]),C=(0,r.useCallback)(()=>{(y.current?.querySelector(`button, [href], [tabindex]`)??y.current)?.focus()},[]);(0,r.useEffect)(()=>{let e=_?b.current:null;typeof m==`function`?m(e):m&&(m.current=e)},[_,m]),(0,r.useEffect)(()=>{if(!_)return;let e=e=>{let t=e.target;!v.current?.contains(t)&&!b.current?.contains(t)&&S()},t=e=>{e.key===`Escape`&&(e.preventDefault(),S(),C())};document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t);let n=b.current;return(n?.querySelector(`[aria-checked="true"]:not(:disabled)`)??n?.querySelector(`button:not(:disabled)`))?.focus(),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[_,S,C]);let w=e=>{if(e.key===`Tab`){e.preventDefault(),S(),e.shiftKey?C():v.current&&t.f(v.current);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let n=Array.from(b.current?.querySelectorAll(`button:not(:disabled)`)??[]);if(n.length===0)return;let r=n.indexOf(document.activeElement);(e.key===`ArrowDown`?n[(r+1)%n.length]:n[(r-1+n.length)%n.length])?.focus()};return(0,i.jsxs)(`div`,{className:`ds-menu-root`,ref:v,children:[(0,i.jsx)(`span`,{ref:y,className:`ds-menu-root`,children:e({"aria-haspopup":`menu`,"aria-expanded":_,"aria-controls":_?x:void 0,onClick:()=>g(e=>!e)})}),(0,i.jsx)(n.Popover,{anchorRef:y,isOpen:_,align:o,offset:8,id:x,role:`menu`,"aria-label":d,"aria-labelledby":f,className:a(`ds-surface-raised`,`ds-field-surface`,`ds-menu`,s),panelRef:b,children:(0,i.jsx)(`div`,{className:`ds-menu__list`,onKeyDown:e=>{u?.(e),e.defaultPrevented||w(e)},onClick:e=>{l?.(e);let n=e.target;if(e.defaultPrevented||!(n instanceof Element)||!n.closest(`button`))return;S();let r=document.activeElement;(t.d(r)||b.current?.contains(r))&&C()},...p,children:c})})]})}),s=(0,r.forwardRef)(function({icon:t,tone:n=`neutral`,shortcut:r,isDisabled:o=!1,className:s,children:c,...l},u){return(0,i.jsxs)(e.Button,{ref:u,variant:n===`danger`?`danger`:`simple`,size:`sm`,iconStart:t,role:`menuitem`,isDisabled:o,"data-tone":n===`danger`?`danger`:void 0,className:a(`ds-menu-item`,s),...l,children:[c,r&&(0,i.jsx)(`span`,{className:`ds-menu-item__shortcut`,children:r})]})});function c(){return(0,i.jsx)(`div`,{className:`ds-menu-separator`,role:`separator`})}function l({children:e}){return(0,i.jsx)(`div`,{className:`ds-menu-label`,children:e})}exports.Menu=o,exports.MenuItem=s,exports.MenuLabel=l,exports.MenuSeparator=c;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/overlayLayer-CPd3zj_u.cjs"),n=require("../Popover/index.cjs");let r=require("react"),i=require("react/jsx-runtime");function a(...e){return e.filter(Boolean).join(` `)}var o=(0,r.forwardRef)(function({trigger:e,align:o=`start`,className:s,children:c,onClick:l,onKeyDown:u,"aria-label":d,"aria-labelledby":f,...p},m){let[h,g]=(0,r.useState)(!1),_=t.o(h),v=(0,r.useRef)(null),y=(0,r.useRef)(null),b=(0,r.useRef)(null),x=(0,r.useId)(),S=(0,r.useCallback)(()=>g(!1),[]),C=(0,r.useCallback)(()=>{(y.current?.querySelector(`button, [href], [tabindex]`)??y.current)?.focus()},[]);(0,r.useEffect)(()=>{let e=_?b.current:null;typeof m==`function`?m(e):m&&(m.current=e)},[_,m]),(0,r.useEffect)(()=>{if(!_)return;let e=e=>{let t=e.target;!v.current?.contains(t)&&!b.current?.contains(t)&&S()},t=e=>{e.key===`Escape`&&(e.preventDefault(),S(),C())};document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t);let n=b.current;return(n?.querySelector(`[aria-checked="true"]:not(:disabled)`)??n?.querySelector(`button:not(:disabled)`))?.focus(),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[_,S,C]);let w=e=>{if(e.key===`Tab`){e.preventDefault(),S(),e.shiftKey?C():v.current&&t.g(v.current);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let n=Array.from(b.current?.querySelectorAll(`button:not(:disabled)`)??[]);if(n.length===0)return;let r=n.indexOf(document.activeElement);(e.key===`ArrowDown`?n[(r+1)%n.length]:n[(r-1+n.length)%n.length])?.focus()};return(0,i.jsxs)(`div`,{className:`ds-menu-root`,ref:v,children:[(0,i.jsx)(`span`,{ref:y,className:`ds-menu-root`,children:e({"aria-haspopup":`menu`,"aria-expanded":_,"aria-controls":_?x:void 0,onClick:()=>g(e=>!e)})}),(0,i.jsx)(n.Popover,{anchorRef:y,isOpen:_,align:o,offset:8,id:x,role:`menu`,"aria-label":d,"aria-labelledby":f,className:a(`ds-surface-raised`,`ds-field-surface`,`ds-menu`,s),panelRef:b,children:(0,i.jsx)(`div`,{className:`ds-menu__list`,onKeyDown:e=>{u?.(e),e.defaultPrevented||w(e)},onClick:e=>{l?.(e);let n=e.target;if(e.defaultPrevented||!(n instanceof Element)||!n.closest(`button`))return;S();let r=document.activeElement;(t.h(r)||b.current?.contains(r))&&C()},...p,children:c})})]})}),s=(0,r.forwardRef)(function({icon:t,tone:n=`neutral`,shortcut:r,isDisabled:o=!1,className:s,children:c,...l},u){return(0,i.jsxs)(e.Button,{ref:u,variant:n===`danger`?`danger`:`simple`,size:`sm`,iconStart:t,role:`menuitem`,isDisabled:o,"data-tone":n===`danger`?`danger`:void 0,className:a(`ds-menu-item`,s),...l,children:[c,r&&(0,i.jsx)(`span`,{className:`ds-menu-item__shortcut`,children:r})]})});function c(){return(0,i.jsx)(`div`,{className:`ds-menu-separator`,role:`separator`})}function l({children:e}){return(0,i.jsx)(`div`,{className:`ds-menu-label`,children:e})}exports.Menu=o,exports.MenuItem=s,exports.MenuLabel=l,exports.MenuSeparator=c;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { Button as e } from "../Button/index.js";
2
- import { d as t, f as n, o as r } from "../../chunks/overlayLayer-Og07sIyl.js";
2
+ import { g as t, h as n, o as r } from "../../chunks/overlayLayer-Dv1vmfaI.js";
3
3
  import { Popover as i } from "../Popover/index.js";
4
4
  import { forwardRef as a, useCallback as o, useEffect as s, useId as c, useRef as l, useState as u } from "react";
5
5
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -34,15 +34,15 @@ var m = a(function({ trigger: e, align: a = "start", className: m, children: h,
34
34
  ]);
35
35
  let j = (e) => {
36
36
  if (e.key === "Tab") {
37
- e.preventDefault(), k(), e.shiftKey ? A() : T.current && n(T.current);
37
+ e.preventDefault(), k(), e.shiftKey ? A() : T.current && t(T.current);
38
38
  return;
39
39
  }
40
40
  if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
41
41
  e.preventDefault();
42
- let t = Array.from(D.current?.querySelectorAll("button:not(:disabled)") ?? []);
43
- if (t.length === 0) return;
44
- let r = t.indexOf(document.activeElement);
45
- (e.key === "ArrowDown" ? t[(r + 1) % t.length] : t[(r - 1 + t.length) % t.length])?.focus();
42
+ let n = Array.from(D.current?.querySelectorAll("button:not(:disabled)") ?? []);
43
+ if (n.length === 0) return;
44
+ let r = n.indexOf(document.activeElement);
45
+ (e.key === "ArrowDown" ? n[(r + 1) % n.length] : n[(r - 1 + n.length) % n.length])?.focus();
46
46
  };
47
47
  return /* @__PURE__ */ f("div", {
48
48
  className: "ds-menu-root",
@@ -74,11 +74,11 @@ var m = a(function({ trigger: e, align: a = "start", className: m, children: h,
74
74
  },
75
75
  onClick: (e) => {
76
76
  g?.(e);
77
- let n = e.target;
78
- if (e.defaultPrevented || !(n instanceof Element) || !n.closest("button")) return;
77
+ let t = e.target;
78
+ if (e.defaultPrevented || !(t instanceof Element) || !t.closest("button")) return;
79
79
  k();
80
80
  let r = document.activeElement;
81
- (t(r) || D.current?.contains(r)) && A();
81
+ (n(r) || D.current?.contains(r)) && A();
82
82
  },
83
83
  ...b,
84
84
  children: h
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["cannotHoldFocus","focusAfterField","useOverlayOpen","cx","parts","Menu","forwardRef","ariaLabel","labelledBy","rest","open","setOpen","useState","isOpen","rootRef","useRef","triggerRef","listRef","menuId","useId","close","useCallback","restoreTriggerFocus","useEffect","node","ref","onPointerDown","target","event","onKeyDown","list","onListKeyDown","items","index","trigger","Popover","className","active","MenuItem","Button","tone","icon","children","shortcut","MenuSeparator","MenuLabel"],"sources":["../../../src/components/Menu/index.tsx"],"sourcesContent":["import { cannotHoldFocus, focusAfterField } from \"../../internal/dialogFocus\";\nimport { useOverlayOpen } from \"../../internal/overlayLayer\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Popover } from \"../Popover\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport type MenuAlign = \"start\" | \"end\";\n\nexport interface MenuProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Receives the props that open the menu — usually a `Button`. */\n trigger: (props: {\n \"aria-haspopup\": \"menu\";\n \"aria-expanded\": boolean;\n \"aria-controls\"?: string;\n onClick: () => void;\n }) => ReactElement;\n align?: MenuAlign;\n /** Menu items, labels and separators. */\n children: ReactNode;\n}\n\n/**\n * A short list of actions attached to a control. Opens on its checked item, if\n * any, else its first. Closes on Escape, on outside click, on Tab and after an\n * item is chosen; arrow keys walk the items. Its label names the menu.\n */\nexport const Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu(\n {\n trigger,\n align = \"start\",\n className,\n children,\n onClick,\n onKeyDown,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": labelledBy,\n ...rest\n },\n ref,\n) {\n const [open, setOpen] = useState(false);\n const isOpen = useOverlayOpen(open);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const menuId = useId();\n\n const close = useCallback(() => setOpen(false), []);\n const restoreTriggerFocus = useCallback(() => {\n const focusTarget =\n triggerRef.current?.querySelector<HTMLElement>(\"button, [href], [tabindex]\") ??\n triggerRef.current;\n focusTarget?.focus();\n }, []);\n\n useEffect(() => {\n // A closing panel stays mounted, inert, for its fade-out; the forwarded ref\n // follows the open menu only, so it is null whenever the menu is closed.\n const node = isOpen ? listRef.current : null;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }, [isOpen, ref]);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) {\n close();\n }\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n restoreTriggerFocus();\n }\n };\n\n document.addEventListener(\"mousedown\", onPointerDown);\n document.addEventListener(\"keydown\", onKeyDown);\n // A checked item, such as the current choice among radio items, takes focus first.\n const list = listRef.current;\n (\n list?.querySelector<HTMLElement>('[aria-checked=\"true\"]:not(:disabled)') ??\n list?.querySelector<HTMLButtonElement>(\"button:not(:disabled)\")\n )?.focus();\n\n return () => {\n document.removeEventListener(\"mousedown\", onPointerDown);\n document.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [isOpen, close, restoreTriggerFocus]);\n\n const onListKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n // Tab leaves the menu as it would leave the trigger: onward past it, or back to it.\n if (event.key === \"Tab\") {\n event.preventDefault();\n close();\n if (event.shiftKey) {\n restoreTriggerFocus();\n } else if (rootRef.current) {\n focusAfterField(rootRef.current);\n }\n return;\n }\n if (event.key !== \"ArrowDown\" && event.key !== \"ArrowUp\") {\n return;\n }\n event.preventDefault();\n const items = Array.from(\n listRef.current?.querySelectorAll<HTMLButtonElement>(\"button:not(:disabled)\") ?? [],\n );\n if (items.length === 0) {\n return;\n }\n const index = items.indexOf(document.activeElement as HTMLButtonElement);\n const next =\n event.key === \"ArrowDown\"\n ? items[(index + 1) % items.length]\n : items[(index - 1 + items.length) % items.length];\n next?.focus();\n };\n\n return (\n <div\n className=\"ds-menu-root\"\n ref={rootRef}\n >\n <span\n ref={triggerRef}\n className=\"ds-menu-root\"\n >\n {trigger({\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? menuId : undefined,\n onClick: () => setOpen((open) => !open),\n })}\n </span>\n <Popover\n anchorRef={triggerRef}\n isOpen={isOpen}\n align={align}\n offset={8}\n id={menuId}\n role=\"menu\"\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n className={cx(\"ds-surface-raised\", \"ds-field-surface\", \"ds-menu\", className)}\n panelRef={listRef}\n >\n <div\n className=\"ds-menu__list\"\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n onListKeyDown(event);\n }\n }}\n onClick={(event) => {\n onClick?.(event);\n // Only a chosen item closes the menu, not a click on a label, separator or gap.\n const target = event.target;\n if (\n event.defaultPrevented ||\n !(target instanceof Element) ||\n !target.closest(\"button\")\n ) {\n return;\n }\n close();\n // An item that moved focus, such as into the editor it changed, keeps it there.\n const active = document.activeElement;\n if (cannotHoldFocus(active) || listRef.current?.contains(active)) {\n restoreTriggerFocus();\n }\n }}\n {...rest}\n >\n {children}\n </div>\n </Popover>\n </div>\n );\n});\n\nexport type MenuItemTone = \"neutral\" | \"danger\";\n\nexport interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n icon?: IconName;\n tone?: MenuItemTone;\n /** Rendered right-aligned and muted, e.g. \"⌘K\". */\n shortcut?: string;\n isDisabled?: boolean;\n children?: ReactNode;\n}\n\nexport const MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(function MenuItem(\n { icon, tone = \"neutral\", shortcut, isDisabled = false, className, children, ...rest },\n ref,\n) {\n return (\n <Button\n ref={ref}\n variant={tone === \"danger\" ? \"danger\" : \"simple\"}\n size=\"sm\"\n iconStart={icon}\n role=\"menuitem\"\n isDisabled={isDisabled}\n data-tone={tone === \"danger\" ? \"danger\" : undefined}\n className={cx(\"ds-menu-item\", className)}\n {...rest}\n >\n {children}\n {shortcut && <span className=\"ds-menu-item__shortcut\">{shortcut}</span>}\n </Button>\n );\n});\n\nexport function MenuSeparator() {\n return (\n <div\n className=\"ds-menu-separator\"\n role=\"separator\"\n />\n );\n}\n\nexport function MenuLabel({ children }: { children: ReactNode }) {\n return <div className=\"ds-menu-label\">{children}</div>;\n}\n"],"mappings":";;;;;;AAmBA,SAASG,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAsBA,IAAaC,IAAOC,EAAsC,SACxD,EACE,YACA,WAAQ,SACR,cACA,aACA,YACA,cACA,cAAcC,GACd,mBAAmBC,GACnB,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAMC,KAAWC,EAAS,EAAK,GAChCC,IAASX,EAAeQ,CAAI,GAC5BI,IAAUC,EAA8B,IAAI,GAC5CC,IAAaD,EAA2B,IAAI,GAC5CE,IAAUF,EAA8B,IAAI,GAC5CG,IAASC,EAAM,GAEfC,IAAQC,QAAkBV,EAAQ,EAAK,GAAG,CAAC,CAAC,GAC5CW,IAAsBD,QAAkB;EAI5C,CAFEL,EAAW,SAAS,cAA2B,4BAA4B,KAC3EA,EAAW,QAAA,EACA,MAAM;CACrB,GAAG,CAAC,CAAC;CAaL,AAXAO,QAAgB;EAGd,IAAMC,IAAOX,IAASI,EAAQ,UAAU;EACxC,AAAI,OAAOQ,KAAQ,aACjBA,EAAID,CAAI,IACCC,MACT,EAAI,UAAUD;CAElB,GAAG,CAACX,GAAQY,CAAG,CAAC,GAEhBF,QAAgB;EACd,IAAI,CAACV,GACH;EAGF,IAAMa,KAAiB,MAAsB;GAC3C,IAAMC,IAASC,EAAM;GACrB,AAAI,CAACd,EAAQ,SAAS,SAASa,CAAM,KAAK,CAACV,EAAQ,SAAS,SAASU,CAAM,KACzEP,EAAM;EAEV,GACMS,KAAa,MAAyB;GAC1C,AAAID,EAAM,QAAQ,aAChBA,EAAM,eAAe,GACrBR,EAAM,GACNE,EAAoB;EAExB;E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,qBAAqB,oBAAoB,WAAWiC,CAAS;GAC3E,UAAUnB;GAEV,UAAA,kBAAC,OAAD;IACE,WAAU;IACV,YAAY,MAAU;KAEpB,AADAY,IAAYD,CAAK,GACZA,EAAM,oBACTG,EAAcH,CAAK;IAEvB;IACA,UAAU,MAAU;KAClB,IAAUA,CAAK;KAEf,IAAMD,IAASC,EAAM;KACrB,IACEA,EAAM,oBACN,EAAED,aAAkB,YACpB,CAACA,EAAO,QAAQ,QAAQ,GAExB;KAEF,EAAM;KAEN,IAAMU,IAAS,SAAS;KACxB,CAAIrC,EAAgBqC,CAAM,KAAKpB,EAAQ,SAAS,SAASoB,CAAM,MAC7Df,EAAoB;IAExB;IACA,GAAIb;IAEH;GACE,CAAA;EACE,CAAA,CACN;;AAET,CAAC,GAaY6B,IAAWhC,EAA6C,SACnE,EAAE,SAAM,UAAO,WAAW,aAAU,gBAAa,IAAO,cAAW,aAAU,GAAGG,KAChF,GACA;CACA,OACE,kBAAC8B,GAAD;EACO;EACL,SAASC,MAAS,WAAW,WAAW;EACxC,MAAK;EACL,WAAWC;EACX,MAAK;EACO;EACZ,aAAWD,MAAS,WAAW,WAAW,KAAA;EAC1C,WAAWrC,EAAG,gBAAgBiC,CAAS;EACvC,GAAI3B;EATN,UAAA,CAWGiC,GACAC,KAAY,kBAAC,QAAD;GAAM,WAAU;GAA0B,UAAAA;EAAe,CAAA,CAChE;;AAEZ,CAAC;AAED,SAAgBC,IAAgB;CAC9B,OACE,kBAAC,OAAD;EACE,WAAU;EACV,MAAK;CACN,CAAA;AAEL;AAEA,SAAgBC,EAAU,EAAE,eAAqC;CAC/D,OAAO,kBAAC,OAAD;EAAK,WAAU;EAAiB;CAAc,CAAA;AACvD"}
1
+ {"version":3,"file":"index.js","names":["focusAfterField","cannotHoldFocus","useOverlayOpen","cx","parts","Menu","forwardRef","ariaLabel","labelledBy","rest","open","setOpen","useState","isOpen","rootRef","useRef","triggerRef","listRef","menuId","useId","close","useCallback","restoreTriggerFocus","useEffect","node","ref","onPointerDown","target","event","onKeyDown","list","onListKeyDown","items","index","trigger","Popover","className","active","MenuItem","Button","tone","icon","children","shortcut","MenuSeparator","MenuLabel"],"sources":["../../../src/components/Menu/index.tsx"],"sourcesContent":["import { cannotHoldFocus, focusAfterField } from \"../../internal/dialogFocus\";\nimport { useOverlayOpen } from \"../../internal/overlayLayer\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Popover } from \"../Popover\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport type MenuAlign = \"start\" | \"end\";\n\nexport interface MenuProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Receives the props that open the menu — usually a `Button`. */\n trigger: (props: {\n \"aria-haspopup\": \"menu\";\n \"aria-expanded\": boolean;\n \"aria-controls\"?: string;\n onClick: () => void;\n }) => ReactElement;\n align?: MenuAlign;\n /** Menu items, labels and separators. */\n children: ReactNode;\n}\n\n/**\n * A short list of actions attached to a control. Opens on its checked item, if\n * any, else its first. Closes on Escape, on outside click, on Tab and after an\n * item is chosen; arrow keys walk the items. Its label names the menu.\n */\nexport const Menu = forwardRef<HTMLDivElement, MenuProps>(function Menu(\n {\n trigger,\n align = \"start\",\n className,\n children,\n onClick,\n onKeyDown,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": labelledBy,\n ...rest\n },\n ref,\n) {\n const [open, setOpen] = useState(false);\n const isOpen = useOverlayOpen(open);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const menuId = useId();\n\n const close = useCallback(() => setOpen(false), []);\n const restoreTriggerFocus = useCallback(() => {\n const focusTarget =\n triggerRef.current?.querySelector<HTMLElement>(\"button, [href], [tabindex]\") ??\n triggerRef.current;\n focusTarget?.focus();\n }, []);\n\n useEffect(() => {\n // A closing panel stays mounted, inert, for its fade-out; the forwarded ref\n // follows the open menu only, so it is null whenever the menu is closed.\n const node = isOpen ? listRef.current : null;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }, [isOpen, ref]);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) {\n close();\n }\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n restoreTriggerFocus();\n }\n };\n\n document.addEventListener(\"mousedown\", onPointerDown);\n document.addEventListener(\"keydown\", onKeyDown);\n // A checked item, such as the current choice among radio items, takes focus first.\n const list = listRef.current;\n (\n list?.querySelector<HTMLElement>('[aria-checked=\"true\"]:not(:disabled)') ??\n list?.querySelector<HTMLButtonElement>(\"button:not(:disabled)\")\n )?.focus();\n\n return () => {\n document.removeEventListener(\"mousedown\", onPointerDown);\n document.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [isOpen, close, restoreTriggerFocus]);\n\n const onListKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n // Tab leaves the menu as it would leave the trigger: onward past it, or back to it.\n if (event.key === \"Tab\") {\n event.preventDefault();\n close();\n if (event.shiftKey) {\n restoreTriggerFocus();\n } else if (rootRef.current) {\n focusAfterField(rootRef.current);\n }\n return;\n }\n if (event.key !== \"ArrowDown\" && event.key !== \"ArrowUp\") {\n return;\n }\n event.preventDefault();\n const items = Array.from(\n listRef.current?.querySelectorAll<HTMLButtonElement>(\"button:not(:disabled)\") ?? [],\n );\n if (items.length === 0) {\n return;\n }\n const index = items.indexOf(document.activeElement as HTMLButtonElement);\n const next =\n event.key === \"ArrowDown\"\n ? items[(index + 1) % items.length]\n : items[(index - 1 + items.length) % items.length];\n next?.focus();\n };\n\n return (\n <div\n className=\"ds-menu-root\"\n ref={rootRef}\n >\n <span\n ref={triggerRef}\n className=\"ds-menu-root\"\n >\n {trigger({\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? menuId : undefined,\n onClick: () => setOpen((open) => !open),\n })}\n </span>\n <Popover\n anchorRef={triggerRef}\n isOpen={isOpen}\n align={align}\n offset={8}\n id={menuId}\n role=\"menu\"\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n className={cx(\"ds-surface-raised\", \"ds-field-surface\", \"ds-menu\", className)}\n panelRef={listRef}\n >\n <div\n className=\"ds-menu__list\"\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n onListKeyDown(event);\n }\n }}\n onClick={(event) => {\n onClick?.(event);\n // Only a chosen item closes the menu, not a click on a label, separator or gap.\n const target = event.target;\n if (\n event.defaultPrevented ||\n !(target instanceof Element) ||\n !target.closest(\"button\")\n ) {\n return;\n }\n close();\n // An item that moved focus, such as into the editor it changed, keeps it there.\n const active = document.activeElement;\n if (cannotHoldFocus(active) || listRef.current?.contains(active)) {\n restoreTriggerFocus();\n }\n }}\n {...rest}\n >\n {children}\n </div>\n </Popover>\n </div>\n );\n});\n\nexport type MenuItemTone = \"neutral\" | \"danger\";\n\nexport interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n icon?: IconName;\n tone?: MenuItemTone;\n /** Rendered right-aligned and muted, e.g. \"⌘K\". */\n shortcut?: string;\n isDisabled?: boolean;\n children?: ReactNode;\n}\n\nexport const MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(function MenuItem(\n { icon, tone = \"neutral\", shortcut, isDisabled = false, className, children, ...rest },\n ref,\n) {\n return (\n <Button\n ref={ref}\n variant={tone === \"danger\" ? \"danger\" : \"simple\"}\n size=\"sm\"\n iconStart={icon}\n role=\"menuitem\"\n isDisabled={isDisabled}\n data-tone={tone === \"danger\" ? \"danger\" : undefined}\n className={cx(\"ds-menu-item\", className)}\n {...rest}\n >\n {children}\n {shortcut && <span className=\"ds-menu-item__shortcut\">{shortcut}</span>}\n </Button>\n );\n});\n\nexport function MenuSeparator() {\n return (\n <div\n className=\"ds-menu-separator\"\n role=\"separator\"\n />\n );\n}\n\nexport function MenuLabel({ children }: { children: ReactNode }) {\n return <div className=\"ds-menu-label\">{children}</div>;\n}\n"],"mappings":";;;;;;AAmBA,SAASG,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAsBA,IAAaC,IAAOC,EAAsC,SACxD,EACE,YACA,WAAQ,SACR,cACA,aACA,YACA,cACA,cAAcC,GACd,mBAAmBC,GACnB,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAMC,KAAWC,EAAS,EAAK,GAChCC,IAASX,EAAeQ,CAAI,GAC5BI,IAAUC,EAA8B,IAAI,GAC5CC,IAAaD,EAA2B,IAAI,GAC5CE,IAAUF,EAA8B,IAAI,GAC5CG,IAASC,EAAM,GAEfC,IAAQC,QAAkBV,EAAQ,EAAK,GAAG,CAAC,CAAC,GAC5CW,IAAsBD,QAAkB;EAI5C,CAFEL,EAAW,SAAS,cAA2B,4BAA4B,KAC3EA,EAAW,QAAA,EACA,MAAM;CACrB,GAAG,CAAC,CAAC;CAaL,AAXAO,QAAgB;EAGd,IAAMC,IAAOX,IAASI,EAAQ,UAAU;EACxC,AAAI,OAAOQ,KAAQ,aACjBA,EAAID,CAAI,IACCC,MACT,EAAI,UAAUD;CAElB,GAAG,CAACX,GAAQY,CAAG,CAAC,GAEhBF,QAAgB;EACd,IAAI,CAACV,GACH;EAGF,IAAMa,KAAiB,MAAsB;GAC3C,IAAMC,IAASC,EAAM;GACrB,AAAI,CAACd,EAAQ,SAAS,SAASa,CAAM,KAAK,CAACV,EAAQ,SAAS,SAASU,CAAM,KACzEP,EAAM;EAEV,GAC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index.cjs"),t=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),n=require("../../chunks/overlayLayer-CtOTt1xB.cjs"),r=require("../../chunks/dialogLabel-CNNQbtob.cjs");let i=require("react"),a=require("react-dom"),o=require("react/jsx-runtime");var s=(0,i.forwardRef)(function({isOpen:s,isHidden:c=!1,onClose:l,title:u,description:d,size:f=`md`,hasHeader:p=!0,overlayLayer:m,footer:h,className:g,children:_,...v},y){let{layer:b,isVisible:x,isResumed:S}=n.r(s,c,m),C=(0,i.useRef)(null),w=(0,i.useRef)(null),T=(0,i.useId)(),E=(0,i.useId)(),{onScrimMouseDown:D,order:O}=r.n({isOpen:s,isActive:x,panelRef:C,onClose:l,layer:b}),k=r.r(O,s);return n.c(w,s),!s||!k?null:(0,a.createPortal)((0,o.jsx)(n.t,{layer:b,isSuspended:!x,children:(0,o.jsx)(`div`,{ref:e=>{w.current=e,e&&(e.inert=!x)},className:`ds-scrim`,hidden:!x,"data-resumed":S||void 0,"aria-hidden":!x||void 0,style:{zIndex:b},onMouseDown:D,children:(0,o.jsxs)(`div`,{...v,ref:t.t(C,y),...r.t(v,T,E,!!d,x),tabIndex:-1,"data-size":f,className:[`ds-modal`,`ds-field-surface`,g].filter(Boolean).join(` `),children:[(0,o.jsxs)(`header`,{className:`ds-modal__head`,hidden:!p,children:[(0,o.jsxs)(`div`,{className:`ds-modal__titles`,children:[(0,o.jsx)(`h2`,{id:T,className:`ds-modal__title`,children:u}),d&&(0,o.jsx)(`p`,{id:E,className:`ds-modal__description`,children:d})]}),p&&(0,o.jsx)(e.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`x`,"aria-label":`Close`,className:`ds-modal__close`,onClick:l})]}),(0,o.jsx)(`div`,{className:`ds-modal__body`,children:_}),h&&(0,o.jsx)(`footer`,{className:`ds-modal__footer ds-field-surface`,children:h})]})})}),k)});exports.Modal=s,exports.OverlayLayer=n.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs"),t=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),n=require("../../chunks/overlayLayer-CPd3zj_u.cjs"),r=require("../../chunks/dialogLabel-Dx-WEEzI.cjs");let i=require("react"),a=require("react-dom"),o=require("react/jsx-runtime");var s=(0,i.forwardRef)(function({isOpen:s,isHidden:c=!1,onClose:l,title:u,description:d,size:f=`md`,hasHeader:p=!0,overlayLayer:m,footer:h,className:g,children:_,...v},y){let{layer:b,isVisible:x,isResumed:S}=n.r(s,c,m),C=(0,i.useRef)(null),w=(0,i.useRef)(null),T=(0,i.useId)(),E=(0,i.useId)(),{onScrimMouseDown:D,order:O}=r.n({isOpen:s,isActive:x,panelRef:C,onClose:l,layer:b}),k=r.r(O,s);return n.c(w,s),!s||!k?null:(0,a.createPortal)((0,o.jsx)(n.t,{layer:b,isSuspended:!x,children:(0,o.jsx)(`div`,{ref:e=>{w.current=e,e&&(e.inert=!x)},className:`ds-scrim`,hidden:!x,"data-resumed":S||void 0,"aria-hidden":!x||void 0,style:{zIndex:b},onMouseDown:D,children:(0,o.jsxs)(`div`,{...v,ref:t.t(C,y),...r.t(v,T,E,!!d,x),tabIndex:-1,"data-size":f,className:[`ds-modal`,`ds-field-surface`,g].filter(Boolean).join(` `),children:[(0,o.jsxs)(`header`,{className:`ds-modal__head`,hidden:!p,children:[(0,o.jsxs)(`div`,{className:`ds-modal__titles`,children:[(0,o.jsx)(`h2`,{id:T,className:`ds-modal__title`,children:u}),d&&(0,o.jsx)(`p`,{id:E,className:`ds-modal__description`,children:d})]}),p&&(0,o.jsx)(e.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`x`,"aria-label":`Close`,className:`ds-modal__close`,onClick:l})]}),(0,o.jsx)(`div`,{className:`ds-modal__body`,children:_}),h&&(0,o.jsx)(`footer`,{className:`ds-modal__footer ds-field-surface`,children:h})]})})}),k)});exports.Modal=s,exports.OverlayLayer=n.n;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  import { Button as e } from "../Button/index.js";
2
2
  import { t } from "../../chunks/mergeRefs-C6_5pADN.js";
3
- import { c as n, n as r, r as i, t as a } from "../../chunks/overlayLayer-Og07sIyl.js";
4
- import { n as o, r as s, t as c } from "../../chunks/dialogLabel-C153NosD.js";
3
+ import { c as n, n as r, r as i, t as a } from "../../chunks/overlayLayer-Dv1vmfaI.js";
4
+ import { n as o, r as s, t as c } from "../../chunks/dialogLabel-nB1gwKz0.js";
5
5
  import { forwardRef as l, useId as u, useRef as d } from "react";
6
6
  import { createPortal as f } from "react-dom";
7
7
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/transitionDuration-B4UnScFc.cjs"),t=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),n=require("../../chunks/overlayLayer-CtOTt1xB.cjs"),r=require("../../chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs");let i=require("react"),a=require("react-dom"),o=require("react/jsx-runtime");function s(...e){return e.filter(Boolean).join(` `)}var c=8;function l({anchorRef:l,anchorId:u,isOpen:d,align:f=`center`,placement:p=`bottom`,matchAnchorWidth:m=!1,offset:h=4,className:g,children:_,role:v,id:y,panelRef:b,...x}){let S=n.o(d),C=n.i(),w=n.a(),T=(0,i.useRef)(null),[E,D]=(0,i.useState)(S),[O,k]=(0,i.useState)(!1);E!==S&&(D(S),k(!S));let A=(0,i.useId)(),j=y??A,M=(0,i.useMemo)(()=>({get current(){return l.current??(u?document.getElementById(u):null)}}),[u,l]);n.l(T,S||O,()=>M.current);let N=(0,i.useCallback)(()=>{let e=l.current??(u?document.getElementById(u):null),t=T.current;if(!e||!t)return;let n=e.getBoundingClientRect();m&&(t.style.width=`${n.width}px`);let r=t.getBoundingClientRect(),i=r.height+Math.max(0,t.scrollHeight-t.clientHeight),a={width:r.width,height:i},o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,d=Math.max(0,s-16),g=Math.max(0,Math.min(d,s-n.bottom-h-c)),_=Math.max(0,Math.min(d,n.top-h-c)),v=p===`top`?_>=a.height||_>g:g<a.height&&_>g,y=v?_:g,b=Math.min(a.height,y),x=v?n.top-h-b:n.bottom+h,S=Math.max(c,Math.min(x,s-c-b)),C=f===`center`?n.left+(n.width-a.width)/2:f===`end`?n.right-a.width:n.left,w=Math.max(c,Math.min(C,o-a.width-c));t.style.left=`${Math.round(w)}px`,t.style.top=`${Math.round(S)}px`,t.style.setProperty(`--popover-max-block-size`,`${Math.round(y)}px`),t.style.visibility=`visible`},[f,u,l,m,h,p]);if(r.t(()=>{S&&N()}),(0,i.useEffect)(()=>{let t=T.current;if(!S){if(!O||!t)return;let n=e.t(t),r=window.setTimeout(()=>k(!1),n);return()=>window.clearTimeout(r)}let r=l.current??(u?document.getElementById(u):null),i=t&&r?n.h(t,r):void 0;N();let a=()=>N(),o=({target:e})=>{e instanceof Node&&t?.contains(e)||N()},s=typeof ResizeObserver>`u`?void 0:new ResizeObserver(a);r&&s?.observe(r);let c=()=>{if(t&&s){s.observe(t);for(let e of t.children)s.observe(e)}};c();let d=new MutationObserver(c);return t&&d.observe(t,{childList:!0}),window.addEventListener(`resize`,a),window.addEventListener(`scroll`,o,!0),()=>{window.removeEventListener(`resize`,a),window.removeEventListener(`scroll`,o,!0),s?.disconnect(),d.disconnect(),i?.()}},[u,l,S,O,N]),!S&&!O||typeof document>`u`)return null;let P=(0,o.jsx)(`div`,{ref:e=>{t.t(T,b)(e),e?.toggleAttribute(`inert`,!S)},hidden:C,style:{zIndex:w},id:j,role:v,className:s(`ds-popover`,g),...x,"data-state":S?`open`:`closed`,"aria-hidden":!S||void 0,onTransitionEnd:e=>{e.target===e.currentTarget&&e.propertyName===`opacity`&&!S&&k(!1)},children:(0,o.jsx)(n.s.Provider,{value:M,children:_})});return(0,a.createPortal)(P,document.body)}exports.Popover=l;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/transitionDuration-B4UnScFc.cjs"),t=require("../../chunks/mergeRefs-CZ-SArlE.cjs"),n=require("../../chunks/overlayLayer-CPd3zj_u.cjs"),r=require("../../chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs");let i=require("react"),a=require("react-dom"),o=require("react/jsx-runtime");function s(...e){return e.filter(Boolean).join(` `)}var c=8;function l({anchorRef:l,anchorId:u,isOpen:d,align:f=`center`,placement:p=`bottom`,matchAnchorWidth:m=!1,offset:h=4,className:g,children:_,role:v,id:y,panelRef:b,...x}){let S=n.o(d),C=n.i(),w=n.a(),T=(0,i.useRef)(null),[E,D]=(0,i.useState)(S),[O,k]=(0,i.useState)(!1);E!==S&&(D(S),k(!S));let A=(0,i.useId)(),j=y??A,M=(0,i.useMemo)(()=>({get current(){return l.current??(u?document.getElementById(u):null)}}),[u,l]);n.l(T,S,()=>M.current);let N=(0,i.useCallback)(()=>{let e=l.current??(u?document.getElementById(u):null),t=T.current;if(!e||!t)return;let n=e.getBoundingClientRect();m&&(t.style.width=`${n.width}px`);let r=t.getBoundingClientRect(),i=r.height+Math.max(0,t.scrollHeight-t.clientHeight),a={width:r.width,height:i},o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,d=Math.max(0,s-16),g=Math.max(0,Math.min(d,s-n.bottom-h-c)),_=Math.max(0,Math.min(d,n.top-h-c)),v=p===`top`?_>=a.height||_>g:g<a.height&&_>g,y=v?_:g,b=Math.min(a.height,y),x=v?n.top-h-b:n.bottom+h,S=Math.max(c,Math.min(x,s-c-b)),C=f===`center`?n.left+(n.width-a.width)/2:f===`end`?n.right-a.width:n.left,w=Math.max(c,Math.min(C,o-a.width-c));t.style.left=`${Math.round(w)}px`,t.style.top=`${Math.round(S)}px`,t.style.setProperty(`--popover-max-block-size`,`${Math.round(y)}px`),t.style.visibility=`visible`},[f,u,l,m,h,p]);if(r.t(()=>{let e=T.current;S&&e?.nextElementSibling&&e.parentElement===document.body&&n.f(e,document.body,null)},[S]),r.t(()=>{S&&N()}),(0,i.useEffect)(()=>{let t=T.current;if(!S){if(!O||!t)return;let n=e.t(t),r=window.setTimeout(()=>k(!1),n);return()=>window.clearTimeout(r)}let r=l.current??(u?document.getElementById(u):null),i=t&&r?n.y(t,r):void 0;N();let a=()=>N(),o=({target:e})=>{e instanceof Node&&t?.contains(e)||N()},s=typeof ResizeObserver>`u`?void 0:new ResizeObserver(a);r&&s?.observe(r);let c=()=>{if(t&&s){s.observe(t);for(let e of t.children)s.observe(e)}};c();let d=new MutationObserver(c);return t&&d.observe(t,{childList:!0}),window.addEventListener(`resize`,a),window.addEventListener(`scroll`,o,!0),()=>{window.removeEventListener(`resize`,a),window.removeEventListener(`scroll`,o,!0),s?.disconnect(),d.disconnect(),i?.()}},[u,l,S,O,N]),!S&&!O||typeof document>`u`)return null;let P=(0,o.jsx)(`div`,{ref:e=>{t.t(T,b)(e),e?.toggleAttribute(`inert`,!S)},hidden:C,style:{zIndex:w},id:j,role:v,className:s(`ds-popover`,g),...x,"data-state":S?`open`:`closed`,"aria-hidden":!S||void 0,onTransitionEnd:e=>{e.target===e.currentTarget&&e.propertyName===`opacity`&&!S&&k(!1)},children:(0,o.jsx)(n.s.Provider,{value:M,children:_})});return(0,a.createPortal)(P,document.body)}exports.Popover=l;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useOverlayOpen","useOverlayHidden","useOverlayLayer","useRef","useState","useId","useMemo","useCallback","transitionDurationMs","registerPopup","PortalScopeContext","createPortal","require_transitionDuration","require_mergeRefs","require_overlayLayer","require_useIsomorphicLayoutEffect","react","react_dom","react_jsx_runtime","cx","parts","VIEWPORT_MARGIN","Popover","requestedOpen","rest","isOpen","hidden","layer","floatingRef","previousOpen","setPreviousOpen","exiting","setExiting","generatedId","panelId","id","scopeAnchor","anchorRef","anchorId","place","reference","floating","anchor","matchAnchorWidth","box","naturalHeight","panel","viewportWidth","viewportHeight","viewportRoom","roomBelow","offset","roomAbove","placeAbove","placement","availableHeight","visibleHeight","preferredTop","top","preferredLeft","align","left","duration","timeout","unregister","update","scroll","target","observer","observeContent","child","mutations","panelRef","node","className","event"],"sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { transitionDurationMs } from \"../../internal/transitionDuration\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { registerPopup } from \"../../internal/dialogFocus\";\nimport { useIsomorphicLayoutEffect } from \"../../internal/useIsomorphicLayoutEffect\";\nimport { PortalScopeContext, usePortalScope } from \"../../internal/portalScope\";\nimport { useOverlayHidden, useOverlayLayer, useOverlayOpen } from \"../../internal/overlayLayer\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst VIEWPORT_MARGIN = 8;\n\nexport type PopoverAlign = \"start\" | \"center\" | \"end\";\nexport type PopoverPlacement = \"top\" | \"bottom\";\n\nexport interface PopoverProps {\n /** The control the panel hangs off. */\n anchorRef: RefObject<HTMLElement | null>;\n /** Optional DOM id fallback for composed controls whose refs are consumed by a field wrapper. */\n anchorId?: string;\n isOpen: boolean;\n /** Horizontal alignment; centred by default and clamped inside the viewport. */\n align?: PopoverAlign;\n /** Preferred side of the anchor. Flips when the other side has more room. */\n placement?: PopoverPlacement;\n /** Match the anchor's width — for listboxes that read as one field. */\n matchAnchorWidth?: boolean;\n /** Gap between anchor and panel. */\n offset?: number;\n className?: string;\n children: ReactNode;\n role?: string;\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n /** `-1` lets a dialog panel hold focus when a click lands on its non-interactive content. */\n tabIndex?: number;\n panelRef?: RefObject<HTMLDivElement | null>;\n}\n\n/**\n * A panel anchored to a control. It is positioned against the viewport, so it\n * flips above the anchor when the space below runs out and slides inward\n * rather than being cut off at any edge.\n */\nexport function Popover({\n anchorRef,\n anchorId,\n isOpen: requestedOpen,\n align = \"center\",\n placement = \"bottom\",\n matchAnchorWidth = false,\n offset = 4,\n className,\n children,\n role,\n id,\n panelRef,\n ...rest\n}: PopoverProps) {\n const isOpen = useOverlayOpen(requestedOpen);\n const hidden = useOverlayHidden();\n // Above the dialog it was opened from, which may sit on a raised layer.\n const layer = useOverlayLayer();\n const floatingRef = useRef<HTMLDivElement | null>(null);\n const [previousOpen, setPreviousOpen] = useState(isOpen);\n const [exiting, setExiting] = useState(false);\n if (previousOpen !== isOpen) {\n setPreviousOpen(isOpen);\n setExiting(!isOpen);\n }\n const generatedId = useId();\n const panelId = id ?? generatedId;\n // The panel, and overlays opened from it, carry the anchor's theme, direction\n // and language to the body.\n const scopeAnchor = useMemo<RefObject<Element | null>>(\n () => ({\n get current() {\n return anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n },\n }),\n [anchorId, anchorRef],\n );\n usePortalScope(floatingRef, isOpen || exiting, () => scopeAnchor.current);\n\n const place = useCallback(() => {\n const reference = anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n const floating = floatingRef.current;\n if (!reference || !floating) {\n return;\n }\n\n const anchor = reference.getBoundingClientRect();\n if (matchAnchorWidth) {\n floating.style.width = `${anchor.width}px`;\n }\n // Natural height is the capped box plus whatever it scrolls. Lifting the cap\n // to measure would clamp the panel's scroll position back to the top.\n const box = floating.getBoundingClientRect();\n const naturalHeight = box.height + Math.max(0, floating.scrollHeight - floating.clientHeight);\n const panel = { width: box.width, height: naturalHeight };\n const viewportWidth = document.documentElement.clientWidth;\n const viewportHeight = document.documentElement.clientHeight;\n const viewportRoom = Math.max(0, viewportHeight - VIEWPORT_MARGIN * 2);\n const roomBelow = Math.max(\n 0,\n Math.min(viewportRoom, viewportHeight - anchor.bottom - offset - VIEWPORT_MARGIN),\n );\n const roomAbove = Math.max(0, Math.min(viewportRoom, anchor.top - offset - VIEWPORT_MARGIN));\n const placeAbove =\n placement === \"top\"\n ? roomAbove >= panel.height || roomAbove > roomBelow\n : roomBelow < panel.height && roomAbove > roomBelow;\n const availableHeight = placeAbove ? roomAbove : roomBelow;\n const visibleHeight = Math.min(panel.height, availableHeight);\n const preferredTop = placeAbove ? anchor.top - offset - visibleHeight : anchor.bottom + offset;\n const top = Math.max(\n VIEWPORT_MARGIN,\n Math.min(preferredTop, viewportHeight - VIEWPORT_MARGIN - visibleHeight),\n );\n const preferredLeft =\n align === \"center\"\n ? anchor.left + (anchor.width - panel.width) / 2\n : align === \"end\"\n ? anchor.right - panel.width\n : anchor.left;\n const left = Math.max(\n VIEWPORT_MARGIN,\n Math.min(preferredLeft, viewportWidth - panel.width - VIEWPORT_MARGIN),\n );\n\n floating.style.left = `${Math.round(left)}px`;\n floating.style.top = `${Math.round(top)}px`;\n floating.style.setProperty(\"--popover-max-block-size\", `${Math.round(availableHeight)}px`);\n floating.style.visibility = \"visible\";\n }, [align, anchorId, anchorRef, matchAnchorWidth, offset, placement]);\n\n // The update that re-renders an open panel can move its anchor without\n // resizing it, as a storyblock's alignment buttons do, so no observer or\n // event reports the move. Re-place after every render while open.\n useIsomorphicLayoutEffect(() => {\n if (isOpen) {\n place();\n }\n });\n\n useEffect(() => {\n const floating = floatingRef.current;\n if (!isOpen) {\n if (!exiting || !floating) {\n return;\n }\n // Use the resolved CSS duration so token overrides and reduced motion agree\n // with the time we keep the inert panel mounted for its fade-out.\n const duration = transitionDurationMs(floating);\n const timeout = window.setTimeout(() => setExiting(false), duration);\n return () => window.clearTimeout(timeout);\n }\n const reference = anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n // A dialog around the anchor leaves Tab in this portalled panel to the panel.\n const unregister = floating && reference ? registerPopup(floating, reference) : undefined;\n place();\n const update = () => place();\n // The panel's own scrolling never moves its anchor.\n const scroll = ({ target }: Event) => {\n if (target instanceof Node && floating?.contains(target)) {\n return;\n }\n place();\n };\n const observer = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(update);\n if (reference) {\n observer?.observe(reference);\n }\n // Children can grow while the outer panel stays capped and scrollable. Size\n // changes arrive through the observer; new children only need observing.\n const observeContent = () => {\n if (!floating || !observer) {\n return;\n }\n observer.observe(floating);\n for (const child of floating.children) {\n observer.observe(child);\n }\n };\n observeContent();\n const mutations = new MutationObserver(observeContent);\n if (floating) {\n mutations.observe(floating, { childList: true });\n }\n window.addEventListener(\"resize\", update);\n window.addEventListener(\"scroll\", scroll, true);\n return () => {\n window.removeEventListener(\"resize\", update);\n window.removeEventListener(\"scroll\", scroll, true);\n observer?.disconnect();\n mutations.disconnect();\n unregister?.();\n };\n }, [anchorId, anchorRef, isOpen, exiting, place]);\n\n if ((!isOpen && !exiting) || typeof document === \"undefined\") {\n return null;\n }\n\n const panel = (\n <div\n ref={(node) => {\n mergeRefs(floatingRef, panelRef)(node);\n // Set the native attribute directly for React 18 as well as React 19.\n node?.toggleAttribute(\"inert\", !isOpen);\n }}\n hidden={hidden}\n style={{ zIndex: layer }}\n id={panelId}\n role={role}\n className={cx(\"ds-popover\", className)}\n {...rest}\n data-state={isOpen ? \"open\" : \"closed\"}\n aria-hidden={!isOpen || undefined}\n onTransitionEnd={(event) => {\n if (event.target === event.currentTarget && event.propertyName === \"opacity\" && !isOpen) {\n setExiting(false);\n }\n }}\n >\n <PortalScopeContext.Provider value={scopeAnchor}>{children}</PortalScopeContext.Provider>\n </div>\n );\n\n return createPortal(panel, document.body);\n}\n"],"mappings":"A,sXAmBA,SAASmB,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAEA,IAAMC,EAAkB,EAmCxB,SAAgBC,EAAQ,CACtB,YACA,WACA,OAAQC,EACR,QAAQ,SACR,YAAY,SACZ,mBAAmB,GACnB,SAAS,EACT,YACA,WACA,OACA,KACA,WACA,GAAGC,GACY,CACf,IAAMC,EAASzB,EAAAA,EAAeuB,CAAa,EACrCG,EAASzB,EAAAA,EAAiB,EAE1B0B,EA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AAkB,GAAU,CACtBkD,EAAM,SAAWA,EAAM,eAAiBA,EAAM,eAAiB,WAAa,CAAClD,GAC/EO,EAAW,EAAK,CAEpB,EAEA,UAAA,EAAAd,EAAA,IAAA,CAACR,EAAAA,EAAmB,SAApB,CAA6B,MAAO0B,EAAc,UAAsC,CAAA,CACrF,CAAA,EAGP,OAAA,EAAOzB,EAAAA,aAAAA,CAAamC,EAAO,SAAS,IAAI,CAC1C,C"}
1
+ {"version":3,"file":"index.cjs","names":["useOverlayOpen","useOverlayHidden","useOverlayLayer","useRef","useState","useId","useMemo","useCallback","transitionDurationMs","registerPopup","PortalScopeContext","createPortal","require_transitionDuration","require_mergeRefs","require_overlayLayer","require_useIsomorphicLayoutEffect","react","react_dom","react_jsx_runtime","cx","parts","VIEWPORT_MARGIN","Popover","requestedOpen","rest","isOpen","hidden","layer","floatingRef","previousOpen","setPreviousOpen","exiting","setExiting","generatedId","panelId","id","scopeAnchor","anchorRef","anchorId","place","reference","floating","anchor","matchAnchorWidth","box","naturalHeight","panel","viewportWidth","viewportHeight","viewportRoom","roomBelow","offset","roomAbove","placeAbove","placement","availableHeight","visibleHeight","preferredTop","top","preferredLeft","align","left","duration","timeout","unregister","update","scroll","target","observer","observeContent","child","mutations","panelRef","node","className","event"],"sources":["../../../src/components/Popover/index.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { transitionDurationMs } from \"../../internal/transitionDuration\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { registerPopup } from \"../../internal/dialogFocus\";\nimport { insertHost } from \"../../internal/movableHost\";\nimport { useIsomorphicLayoutEffect } from \"../../internal/useIsomorphicLayoutEffect\";\nimport { PortalScopeContext, usePortalScope } from \"../../internal/portalScope\";\nimport { useOverlayHidden, useOverlayLayer, useOverlayOpen } from \"../../internal/overlayLayer\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst VIEWPORT_MARGIN = 8;\n\nexport type PopoverAlign = \"start\" | \"center\" | \"end\";\nexport type PopoverPlacement = \"top\" | \"bottom\";\n\nexport interface PopoverProps {\n /** The control the panel hangs off. */\n anchorRef: RefObject<HTMLElement | null>;\n /** Optional DOM id fallback for composed controls whose refs are consumed by a field wrapper. */\n anchorId?: string;\n isOpen: boolean;\n /** Horizontal alignment; centred by default and clamped inside the viewport. */\n align?: PopoverAlign;\n /** Preferred side of the anchor. Flips when the other side has more room. */\n placement?: PopoverPlacement;\n /** Match the anchor's width — for listboxes that read as one field. */\n matchAnchorWidth?: boolean;\n /** Gap between anchor and panel. */\n offset?: number;\n className?: string;\n children: ReactNode;\n role?: string;\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n /** `-1` lets a dialog panel hold focus when a click lands on its non-interactive content. */\n tabIndex?: number;\n panelRef?: RefObject<HTMLDivElement | null>;\n}\n\n/**\n * A panel anchored to a control. It is positioned against the viewport, so it\n * flips above the anchor when the space below runs out and slides inward\n * rather than being cut off at any edge.\n */\nexport function Popover({\n anchorRef,\n anchorId,\n isOpen: requestedOpen,\n align = \"center\",\n placement = \"bottom\",\n matchAnchorWidth = false,\n offset = 4,\n className,\n children,\n role,\n id,\n panelRef,\n ...rest\n}: PopoverProps) {\n const isOpen = useOverlayOpen(requestedOpen);\n const hidden = useOverlayHidden();\n // Above the dialog it was opened from, which may sit on a raised layer.\n const layer = useOverlayLayer();\n const floatingRef = useRef<HTMLDivElement | null>(null);\n const [previousOpen, setPreviousOpen] = useState(isOpen);\n const [exiting, setExiting] = useState(false);\n if (previousOpen !== isOpen) {\n setPreviousOpen(isOpen);\n setExiting(!isOpen);\n }\n const generatedId = useId();\n const panelId = id ?? generatedId;\n // The panel, and overlays opened from it, carry the anchor's theme, direction\n // and language to the body.\n const scopeAnchor = useMemo<RefObject<Element | null>>(\n () => ({\n get current() {\n return anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n },\n }),\n [anchorId, anchorRef],\n );\n // The last scope stays on the fading panel. Reopening must read the anchor\n // again because it may now be inside a different dialog or theme.\n usePortalScope(floatingRef, isOpen, () => scopeAnchor.current);\n\n const place = useCallback(() => {\n const reference = anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n const floating = floatingRef.current;\n if (!reference || !floating) {\n return;\n }\n\n const anchor = reference.getBoundingClientRect();\n if (matchAnchorWidth) {\n floating.style.width = `${anchor.width}px`;\n }\n // Natural height is the capped box plus whatever it scrolls. Lifting the cap\n // to measure would clamp the panel's scroll position back to the top.\n const box = floating.getBoundingClientRect();\n const naturalHeight = box.height + Math.max(0, floating.scrollHeight - floating.clientHeight);\n const panel = { width: box.width, height: naturalHeight };\n const viewportWidth = document.documentElement.clientWidth;\n const viewportHeight = document.documentElement.clientHeight;\n const viewportRoom = Math.max(0, viewportHeight - VIEWPORT_MARGIN * 2);\n const roomBelow = Math.max(\n 0,\n Math.min(viewportRoom, viewportHeight - anchor.bottom - offset - VIEWPORT_MARGIN),\n );\n const roomAbove = Math.max(0, Math.min(viewportRoom, anchor.top - offset - VIEWPORT_MARGIN));\n const placeAbove =\n placement === \"top\"\n ? roomAbove >= panel.height || roomAbove > roomBelow\n : roomBelow < panel.height && roomAbove > roomBelow;\n const availableHeight = placeAbove ? roomAbove : roomBelow;\n const visibleHeight = Math.min(panel.height, availableHeight);\n const preferredTop = placeAbove ? anchor.top - offset - visibleHeight : anchor.bottom + offset;\n const top = Math.max(\n VIEWPORT_MARGIN,\n Math.min(preferredTop, viewportHeight - VIEWPORT_MARGIN - visibleHeight),\n );\n const preferredLeft =\n align === \"center\"\n ? anchor.left + (anchor.width - panel.width) / 2\n : align === \"end\"\n ? anchor.right - panel.width\n : anchor.left;\n const left = Math.max(\n VIEWPORT_MARGIN,\n Math.min(preferredLeft, viewportWidth - panel.width - VIEWPORT_MARGIN),\n );\n\n floating.style.left = `${Math.round(left)}px`;\n floating.style.top = `${Math.round(top)}px`;\n floating.style.setProperty(\"--popover-max-block-size\", `${Math.round(availableHeight)}px`);\n floating.style.visibility = \"visible\";\n }, [align, anchorId, anchorRef, matchAnchorWidth, offset, placement]);\n\n useIsomorphicLayoutEffect(() => {\n const panel = floatingRef.current;\n // A panel reopening during its fade can still sit behind a dialog that\n // opened after it. Give it the same portal order as a newly opened panel.\n if (isOpen && panel?.nextElementSibling && panel.parentElement === document.body) {\n insertHost(panel, document.body, null);\n }\n }, [isOpen]);\n\n // The update that re-renders an open panel can move its anchor without\n // resizing it, as a content block's alignment buttons do, so no observer or\n // event reports the move. Re-place after every render while open.\n useIsomorphicLayoutEffect(() => {\n if (isOpen) {\n place();\n }\n });\n\n useEffect(() => {\n const floating = floatingRef.current;\n if (!isOpen) {\n if (!exiting || !floating) {\n return;\n }\n // Use the resolved CSS duration so token overrides and reduced motion agree\n // with the time we keep the inert panel mounted for its fade-out.\n const duration = transitionDurationMs(floating);\n const timeout = window.setTimeout(() => setExiting(false), duration);\n return () => window.clearTimeout(timeout);\n }\n const reference = anchorRef.current ?? (anchorId ? document.getElementById(anchorId) : null);\n // A dialog around the anchor leaves Tab in this portalled panel to the panel.\n const unregister = floating && reference ? registerPopup(floating, reference) : undefined;\n place();\n const update = () => place();\n // The panel's own scrolling never moves its anchor.\n const scroll = ({ target }: Event) => {\n if (target instanceof Node && floating?.contains(target)) {\n return;\n }\n place();\n };\n const observer = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(update);\n if (reference) {\n observer?.observe(reference);\n }\n // Children can grow while the outer panel stays capped and scrollable. Size\n // changes arrive through the observer; new children only need observing.\n const observeContent = () => {\n if (!floating || !observer) {\n return;\n }\n observer.observe(floating);\n for (const child of floating.children) {\n observer.observe(child);\n }\n };\n observeContent();\n const mutations = new MutationObserver(observeContent);\n if (floating) {\n mutations.observe(floating, { childList: true });\n }\n window.addEventListener(\"resize\", update);\n window.addEventListener(\"scroll\", scroll, true);\n return () => {\n window.removeEventListener(\"resize\", update);\n window.removeEventListener(\"scroll\", scroll, true);\n observer?.disconnect();\n mutations.disconnect();\n unregister?.();\n };\n }, [anchorId, anchorRef, isOpen, exiting, place]);\n\n if ((!isOpen && !exiting) || typeof document === \"undefined\") {\n return null;\n }\n\n const panel = (\n <div\n ref={(node) => {\n mergeRefs(floatingRef, panelRef)(node);\n // Set the native attribute directly for React 18 as well as React 19.\n node?.toggleAttribute(\"inert\", !isOpen);\n }}\n hidden={hidden}\n style={{ zIndex: layer }}\n id={panelId}\n role={role}\n className={cx(\"ds-popover\", className)}\n {...rest}\n data-state={isOpen ? \"open\" : \"closed\"}\n aria-hidden={!isOpen || undefined}\n onTransitionEnd={(event) => {\n if (event.target === event.currentTarget && event.propertyName === \"opacity\" && !isOpen) {\n setExiting(false);\n }\n }}\n >\n <PortalScopeContext.Provider value={scopeAnchor}>{children}</PortalScopeContext.Provider>\n </div>\n );\n\n return createPortal(panel, document.body);\n}\n"],"mappings":"A,sXAoBA,SAASmB,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAEA,IAAMC,EAAkB,EAmCxB,SAAgBC,EAAQ,CACtB,YACA,WACA,OAAQC,EACR,QAAQ,SACR,YAAY,SACZ,mBAAmB,GACnB,SAAS,EACT,YACA,WACA,OACA,KACA,WACA,GAAGC,GACY,CACf,IAAMC,EAASzB,EAAAA,EAAeuB,CAAa,EACrCG,EAASzB,EAAAA,EAAiB,EAE1B0B,EAAQzB,EAAAA,EAAgB,EACxB0B,GAAA,EAAczB,EAAAA,OAAAA,CAA8B,IAAI,EAChD,CAAC0B,EAAcC,IAAA,EAAmB1B,EAAAA,SAAAA,CAASqB,CAAM,EACjD,CAACM,EAASC,IAAA,EAAc5B,EAAAA,SAAAA,CAAS,EAAK,EACxCyB,IAAiBJ,IACnBK,EAAgBL,CAAM,EACtBO,EAAW,CAACP,CAAM,GAEpB,IAAMQ,GAAA,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