@hjmds/react 1.26.1 → 1.27.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 (273) hide show
  1. package/THIRD_PARTY_NOTICES.md +7 -0
  2. package/dist/advanced-display.d.ts +1 -0
  3. package/dist/advanced-display.d.ts.map +1 -1
  4. package/dist/advanced-display.js +3 -2
  5. package/dist/advanced-display.js.map +1 -1
  6. package/dist/agreement.d.ts.map +1 -1
  7. package/dist/agreement.js +2 -1
  8. package/dist/agreement.js.map +1 -1
  9. package/dist/bottom-cta.d.ts.map +1 -1
  10. package/dist/bottom-cta.js +5 -2
  11. package/dist/bottom-cta.js.map +1 -1
  12. package/dist/bottom-navigation.d.ts.map +1 -1
  13. package/dist/bottom-navigation.js +3 -0
  14. package/dist/bottom-navigation.js.map +1 -1
  15. package/dist/calendar.js +1 -1
  16. package/dist/calendar.js.map +1 -1
  17. package/dist/carousel-motion.d.ts.map +1 -1
  18. package/dist/carousel-motion.js +4 -3
  19. package/dist/carousel-motion.js.map +1 -1
  20. package/dist/carousel.d.ts.map +1 -1
  21. package/dist/carousel.js +3 -2
  22. package/dist/carousel.js.map +1 -1
  23. package/dist/chart.d.ts +3 -1
  24. package/dist/chart.d.ts.map +1 -1
  25. package/dist/chart.js +9 -4
  26. package/dist/chart.js.map +1 -1
  27. package/dist/clipboard.d.ts +27 -1
  28. package/dist/clipboard.d.ts.map +1 -1
  29. package/dist/clipboard.js +26 -12
  30. package/dist/clipboard.js.map +1 -1
  31. package/dist/collapsible.d.ts +9 -0
  32. package/dist/collapsible.d.ts.map +1 -1
  33. package/dist/collapsible.js +9 -2
  34. package/dist/collapsible.js.map +1 -1
  35. package/dist/collection-editing.d.ts.map +1 -1
  36. package/dist/collection-editing.js +15 -10
  37. package/dist/collection-editing.js.map +1 -1
  38. package/dist/collection-rail.d.ts.map +1 -1
  39. package/dist/collection-rail.js +3 -2
  40. package/dist/collection-rail.js.map +1 -1
  41. package/dist/communication.d.ts.map +1 -1
  42. package/dist/communication.js +5 -2
  43. package/dist/communication.js.map +1 -1
  44. package/dist/context-menu.d.ts +9 -1
  45. package/dist/context-menu.d.ts.map +1 -1
  46. package/dist/context-menu.js +1 -1
  47. package/dist/context-menu.js.map +1 -1
  48. package/dist/conversation-row.js +1 -1
  49. package/dist/conversation-row.js.map +1 -1
  50. package/dist/data-workflows.d.ts.map +1 -1
  51. package/dist/data-workflows.js +4 -3
  52. package/dist/data-workflows.js.map +1 -1
  53. package/dist/date-picker.d.ts.map +1 -1
  54. package/dist/date-picker.js +5 -3
  55. package/dist/date-picker.js.map +1 -1
  56. package/dist/design-profile.d.ts.map +1 -1
  57. package/dist/design-profile.js +4 -2
  58. package/dist/design-profile.js.map +1 -1
  59. package/dist/effect-surface.d.ts +9 -3
  60. package/dist/effect-surface.d.ts.map +1 -1
  61. package/dist/effect-surface.js +3 -2
  62. package/dist/effect-surface.js.map +1 -1
  63. package/dist/evidence.d.ts +1 -1
  64. package/dist/evidence.js +1 -1
  65. package/dist/evidence.js.map +1 -1
  66. package/dist/feedback.d.ts +8 -19
  67. package/dist/feedback.d.ts.map +1 -1
  68. package/dist/feedback.js +7 -3
  69. package/dist/feedback.js.map +1 -1
  70. package/dist/field-group.d.ts.map +1 -1
  71. package/dist/field-group.js +15 -8
  72. package/dist/field-group.js.map +1 -1
  73. package/dist/file-picker.d.ts +14 -2
  74. package/dist/file-picker.d.ts.map +1 -1
  75. package/dist/file-picker.js +5 -2
  76. package/dist/file-picker.js.map +1 -1
  77. package/dist/folder-preview.d.ts.map +1 -1
  78. package/dist/folder-preview.js +2 -2
  79. package/dist/folder-preview.js.map +1 -1
  80. package/dist/forms.d.ts.map +1 -1
  81. package/dist/forms.js +2 -1
  82. package/dist/forms.js.map +1 -1
  83. package/dist/image-choice.d.ts +30 -0
  84. package/dist/image-choice.d.ts.map +1 -0
  85. package/dist/image-choice.js +24 -0
  86. package/dist/image-choice.js.map +1 -0
  87. package/dist/image-comparison.d.ts.map +1 -1
  88. package/dist/image-comparison.js +2 -1
  89. package/dist/image-comparison.js.map +1 -1
  90. package/dist/index.d.ts +3 -3
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +2 -2
  93. package/dist/index.js.map +1 -1
  94. package/dist/internal/message-reactions.d.ts +28 -2
  95. package/dist/internal/message-reactions.d.ts.map +1 -1
  96. package/dist/internal/message-reactions.js +11 -4
  97. package/dist/internal/message-reactions.js.map +1 -1
  98. package/dist/internal/screen-exit.d.ts +11 -0
  99. package/dist/internal/screen-exit.d.ts.map +1 -0
  100. package/dist/internal/screen-exit.js +10 -0
  101. package/dist/internal/screen-exit.js.map +1 -0
  102. package/dist/internal/screen-footer.d.ts +7 -0
  103. package/dist/internal/screen-footer.d.ts.map +1 -0
  104. package/dist/internal/screen-footer.js +8 -0
  105. package/dist/internal/screen-footer.js.map +1 -0
  106. package/dist/layout.d.ts.map +1 -1
  107. package/dist/layout.js +8 -4
  108. package/dist/layout.js.map +1 -1
  109. package/dist/masonry.d.ts +5 -3
  110. package/dist/masonry.d.ts.map +1 -1
  111. package/dist/masonry.js +25 -3
  112. package/dist/masonry.js.map +1 -1
  113. package/dist/menu-morph.d.ts.map +1 -1
  114. package/dist/menu-morph.js +30 -7
  115. package/dist/menu-morph.js.map +1 -1
  116. package/dist/overlays.d.ts +2 -0
  117. package/dist/overlays.d.ts.map +1 -1
  118. package/dist/overlays.js +48 -11
  119. package/dist/overlays.js.map +1 -1
  120. package/dist/popover.d.ts +6 -0
  121. package/dist/popover.d.ts.map +1 -1
  122. package/dist/popover.js +3 -3
  123. package/dist/popover.js.map +1 -1
  124. package/dist/qr-code.js +1 -1
  125. package/dist/qr-code.js.map +1 -1
  126. package/dist/reaction-picker.d.ts.map +1 -1
  127. package/dist/reaction-picker.js +14 -1
  128. package/dist/reaction-picker.js.map +1 -1
  129. package/dist/saved-items.d.ts +8 -2
  130. package/dist/saved-items.d.ts.map +1 -1
  131. package/dist/saved-items.js +4 -4
  132. package/dist/saved-items.js.map +1 -1
  133. package/dist/screen-flows.d.ts +52 -6
  134. package/dist/screen-flows.d.ts.map +1 -1
  135. package/dist/screen-flows.js +48 -19
  136. package/dist/screen-flows.js.map +1 -1
  137. package/dist/screens.d.ts +56 -8
  138. package/dist/screens.d.ts.map +1 -1
  139. package/dist/screens.js +41 -15
  140. package/dist/screens.js.map +1 -1
  141. package/dist/selection.d.ts.map +1 -1
  142. package/dist/selection.js +4 -4
  143. package/dist/selection.js.map +1 -1
  144. package/dist/social-compositions.d.ts.map +1 -1
  145. package/dist/social-compositions.js +3 -2
  146. package/dist/social-compositions.js.map +1 -1
  147. package/dist/sortable.d.ts.map +1 -1
  148. package/dist/sortable.js +9 -3
  149. package/dist/sortable.js.map +1 -1
  150. package/dist/status-text.d.ts.map +1 -1
  151. package/dist/status-text.js +5 -2
  152. package/dist/status-text.js.map +1 -1
  153. package/dist/styles.css +219 -126
  154. package/dist/styles.layered.css +219 -126
  155. package/dist/table-family.d.ts +1 -1
  156. package/dist/table-family.d.ts.map +1 -1
  157. package/dist/table-family.js +24 -7
  158. package/dist/table-family.js.map +1 -1
  159. package/dist/task-controls.d.ts.map +1 -1
  160. package/dist/task-controls.js +9 -4
  161. package/dist/task-controls.js.map +1 -1
  162. package/dist/task-list.d.ts +1 -1
  163. package/dist/task-list.d.ts.map +1 -1
  164. package/dist/task-list.js +4 -3
  165. package/dist/task-list.js.map +1 -1
  166. package/dist/theme.d.ts.map +1 -1
  167. package/dist/theme.js +4 -0
  168. package/dist/theme.js.map +1 -1
  169. package/dist/top-bar.d.ts +5 -0
  170. package/dist/top-bar.d.ts.map +1 -1
  171. package/dist/top-bar.js +6 -1
  172. package/dist/top-bar.js.map +1 -1
  173. package/dist/transfer-list.d.ts.map +1 -1
  174. package/dist/transfer-list.js +13 -3
  175. package/dist/transfer-list.js.map +1 -1
  176. package/dist/upload-item.d.ts.map +1 -1
  177. package/dist/upload-item.js +3 -1
  178. package/dist/upload-item.js.map +1 -1
  179. package/fonts/pretendard/LICENSE.txt +94 -0
  180. package/fonts/pretendard/pretendard.css +927 -0
  181. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.0.woff2 +0 -0
  182. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.1.woff2 +0 -0
  183. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.10.woff2 +0 -0
  184. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.11.woff2 +0 -0
  185. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.12.woff2 +0 -0
  186. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.13.woff2 +0 -0
  187. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.14.woff2 +0 -0
  188. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.15.woff2 +0 -0
  189. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.16.woff2 +0 -0
  190. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.17.woff2 +0 -0
  191. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.18.woff2 +0 -0
  192. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.19.woff2 +0 -0
  193. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.2.woff2 +0 -0
  194. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.20.woff2 +0 -0
  195. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.21.woff2 +0 -0
  196. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.22.woff2 +0 -0
  197. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.23.woff2 +0 -0
  198. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.24.woff2 +0 -0
  199. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.25.woff2 +0 -0
  200. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.26.woff2 +0 -0
  201. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.27.woff2 +0 -0
  202. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.28.woff2 +0 -0
  203. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.29.woff2 +0 -0
  204. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.3.woff2 +0 -0
  205. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.30.woff2 +0 -0
  206. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.31.woff2 +0 -0
  207. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.32.woff2 +0 -0
  208. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.33.woff2 +0 -0
  209. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.34.woff2 +0 -0
  210. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.35.woff2 +0 -0
  211. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.36.woff2 +0 -0
  212. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.37.woff2 +0 -0
  213. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.38.woff2 +0 -0
  214. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.39.woff2 +0 -0
  215. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.4.woff2 +0 -0
  216. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.40.woff2 +0 -0
  217. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.41.woff2 +0 -0
  218. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.42.woff2 +0 -0
  219. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.43.woff2 +0 -0
  220. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.44.woff2 +0 -0
  221. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.45.woff2 +0 -0
  222. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.46.woff2 +0 -0
  223. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.47.woff2 +0 -0
  224. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.48.woff2 +0 -0
  225. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.49.woff2 +0 -0
  226. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.5.woff2 +0 -0
  227. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.50.woff2 +0 -0
  228. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.51.woff2 +0 -0
  229. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.52.woff2 +0 -0
  230. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.53.woff2 +0 -0
  231. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.54.woff2 +0 -0
  232. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.55.woff2 +0 -0
  233. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.56.woff2 +0 -0
  234. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.57.woff2 +0 -0
  235. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.58.woff2 +0 -0
  236. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.59.woff2 +0 -0
  237. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.6.woff2 +0 -0
  238. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.60.woff2 +0 -0
  239. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.61.woff2 +0 -0
  240. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.62.woff2 +0 -0
  241. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.63.woff2 +0 -0
  242. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.64.woff2 +0 -0
  243. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.65.woff2 +0 -0
  244. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.66.woff2 +0 -0
  245. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.67.woff2 +0 -0
  246. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.68.woff2 +0 -0
  247. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.69.woff2 +0 -0
  248. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.7.woff2 +0 -0
  249. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.70.woff2 +0 -0
  250. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.71.woff2 +0 -0
  251. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.72.woff2 +0 -0
  252. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.73.woff2 +0 -0
  253. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.74.woff2 +0 -0
  254. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.75.woff2 +0 -0
  255. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.76.woff2 +0 -0
  256. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.77.woff2 +0 -0
  257. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.78.woff2 +0 -0
  258. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.79.woff2 +0 -0
  259. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.8.woff2 +0 -0
  260. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.80.woff2 +0 -0
  261. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.81.woff2 +0 -0
  262. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.82.woff2 +0 -0
  263. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.83.woff2 +0 -0
  264. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.84.woff2 +0 -0
  265. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.85.woff2 +0 -0
  266. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.86.woff2 +0 -0
  267. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.87.woff2 +0 -0
  268. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.88.woff2 +0 -0
  269. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.89.woff2 +0 -0
  270. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.9.woff2 +0 -0
  271. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.90.woff2 +0 -0
  272. package/fonts/pretendard/woff2-dynamic-subset/PretendardVariable.subset.91.woff2 +0 -0
  273. package/package.json +10 -3
@@ -1 +1 @@
1
- {"version":3,"file":"communication.js","sourceRoot":"","sources":["../src/communication.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAC,MAAM,EAAC,QAAQ,EAAiB,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAuC,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAE,WAAW,EAAC,eAAe,EAAkD,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAC,IAAI,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAO5E,MAAM,UAAU,YAAY,CAAC,EAAC,SAAS,EAAC,OAAO,EAAC,UAAU,EAAC,aAAa,GAAC,KAAK,EAAC,WAAW,GAA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AE,CAAA,CAAC,CAAA,EAAC,UAAU,EAAC,KAAK,CAAC,UAAU,EAAC,CAAC,KAAM,CAAC,KAAK,CAAC,aAAa,CAAA,CAAC,CAAA,EAAC,aAAa,EAAC,KAAK,CAAC,aAAa,EAAC,CAAA,CAAC,CAAA,EAAE,CAAC,EACrI,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EACvG,WAAW,EAAE,EAAC,KAAK,EAAC,OAAO,EAAE,WAAW,IAAE,EAAE,EAAC,WAAW,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAC,UAAU,EAAC,KAAK,CAAC,MAAM,CAAC,eAAe,EAAC,YACpH,OAAO,CAAA,CAAC,CAAA,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA,CAAC,CAAA,IAAI,GACjC,EAAC,MAAM,CAAA,CAAC,CAAA,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAC,SAAS,EAAC,QAAQ,EAAC,YAAG,KAAK,CAAC,MAAM,CAAC,KAAK,GAAQ,CAAA,CAAC,CAAA,IAAI,IAAI,GAAS,GAAM,CAAC;AAC1I,CAAC","sourcesContent":["\"use client\";\nimport { useEffect,useRef,useState,type ReactNode } from \"react\";\nimport { resolveSearchCommit } from \"@hjmds/design-contracts/screen-patterns\";\nimport { validateReplyTarget,type ReplyTarget,type SearchResponse } from \"@hjmds/design-contracts/communication\";\nimport { ChatMessage,MessageComposer,type ChatMessageProps,type MessageComposerProps } from \"./screens.js\";\nimport { SearchScreen,type SearchRecentQueries } from \"./screen-flows.js\";\nimport { Button } from \"./actions.js\";\nimport { Stack,Text } from \"./layout.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\n\nexport type ReplyMessageProps = Omit<ChatMessageProps,\"replyAction\"|\"timestampPresentation\"> & Readonly<{\n messageId: string; onReply: (messageId:string)=>void; replyLabel: string; replyDisabled?: boolean;\n /** A drag has one owner: reply, or time reveal. Accessible reply stays available in either mode. */\n swipeAction?: \"reply\"|\"timestamp\";\n}>;\nexport function ReplyMessage({messageId,onReply,replyLabel,replyDisabled=false,swipeAction=\"reply\",...message}:ReplyMessageProps){\n if(!messageId.trim())throw new TypeError(\"Reply message requires the actual message ID\");\n return <ChatMessage {...message} timestampPresentation={swipeAction===\"timestamp\"?\"swipe\":\"always\"} replyAction={{label:replyLabel,onPress:()=>onReply(messageId),disabled:replyDisabled}}/>;\n}\nexport type ReplyComposerProps=Omit<MessageComposerProps,\"onSend\"|\"replyTo\"|\"pending\"|\"error\"> & Readonly<{\n replyTarget: ReplyTarget|null; onReplyCancel:()=>void; cancelReplyLabel:string; errorLabel:string;\n /** Resolve only after the actual send acknowledgement. The controlled draft is never cleared here. */\n onSend:(value:string,context:Readonly<{replyToId:string|null}>)=>void|Promise<void>;\n}>;\nexport function ReplyComposer({replyTarget,onReplyCancel,cancelReplyLabel,errorLabel,onSend,...composer}:ReplyComposerProps){\n validateReplyTarget(replyTarget);const action=useCompositionAction(composer.disabled);\n return <Stack gap=\"sm\"><MessageComposer {...composer} pending={action.pending}\n {...(replyTarget?{replyTo:{author:replyTarget.author,excerpt:replyTarget.excerpt,cancelLabel:cancelReplyLabel,onCancel:onReplyCancel}}:{})}\n onSend={value=>{const id=replyTarget?.id??null;void action.run(\"send\",()=>onSend(value,{replyToId:id}));}}/>\n {action.failed?<Text role=\"alert\" tone=\"danger\" style={{textAlign:\"center\"}}>{errorLabel}</Text>:null}</Stack>;\n}\nexport type ExpandableSearchProps<T>=Readonly<{\n expanded:boolean;onExpandedChange:(expanded:boolean)=>void;query:string;onQueryChange:(query:string)=>void;\n onSearch:(query:string,context:Readonly<{signal:AbortSignal}>)=>Promise<SearchResponse<T>>;\n renderResult:(result:T)=>ReactNode;onSubmit?:(query:string)=>void;recentQueries?:SearchRecentQueries;debounceMs?:number;disabled?:boolean;\n labels:Readonly<{title:string;open:string;cancel:string;query:string;clear:string;searching:string;error:string;commit:(query:string)=>string;suggestionCount:(count:number)=>string}>;\n}>;\nexport function ExpandableSearch<T>(props:ExpandableSearchProps<T>){\n const [snapshot,setSnapshot]=useState<Readonly<{query:string;response:SearchResponse<T>}>|null>(null),[pending,setPending]=useState(false),[failed,setFailed]=useState(false),[committed,setCommitted]=useState(\"\");\n const latest=useRef(props);latest.current=props;const generation=useRef(0),controller=useRef<AbortController|null>(null);\n const host=useRef<HTMLDivElement>(null),opener=useRef<HTMLButtonElement>(null),restore=useRef(false);\n useEffect(()=>{if(!props.expanded){controller.current?.abort();generation.current++;setPending(false);setCommitted(\"\");}},[props.expanded]);\n useEffect(()=>()=>{generation.current++;controller.current?.abort();},[]);\n useEffect(()=>{if(props.expanded)host.current?.querySelector(\"input\")?.focus();else if(restore.current){opener.current?.focus();restore.current=false;}},[props.expanded]);\n const search=(query:string,{signal}:Readonly<{signal:AbortSignal}>)=>{\n controller.current?.abort();const token=++generation.current,request=new AbortController();controller.current=request;\n const abort=()=>request.abort();signal.addEventListener(\"abort\",abort,{once:true});if(signal.aborted)request.abort();\n // Some adapters ignore abort; generation and current-query checks still prevent stale UI writes.\n const valid=()=>!request.signal.aborted&&token===generation.current&&latest.current.expanded&&latest.current.query===query;\n if(!query.trim()){setSnapshot(null);setPending(false);setFailed(false);signal.removeEventListener(\"abort\",abort);return;}\n setPending(true);setFailed(false);\n const execute=latest.current.onSearch;\n void Promise.resolve().then(()=>request.signal.aborted?null:execute(query,{signal:request.signal})).then(response=>{if(valid()&&response)setSnapshot({query,response});},()=>{if(valid())setFailed(true);}).finally(()=>{signal.removeEventListener(\"abort\",abort);if(valid())setPending(false);});\n };\n const cancel=()=>{controller.current?.abort();generation.current++;setPending(false);restore.current=true;props.onExpandedChange(false);};\n const commit=(query:string)=>{const normalized=resolveSearchCommit(query);if(normalized===null)return;setCommitted(normalized);props.onSubmit?.(normalized);};\n const current=snapshot?.query===props.query?snapshot.response:null;\n return <div ref={host}><Stack gap=\"sm\">{!props.expanded?<Button ref={opener} disabled={props.disabled===true} onClick={()=>props.onExpandedChange(true)}>{props.labels.open}</Button>:<>\n <Button tone=\"ghost\" onClick={cancel}>{props.labels.cancel}</Button>\n <SearchScreen title={props.labels.title} titleVisibility=\"hidden\" queryLabel={props.labels.query} queryClearLabel={props.labels.clear} query={props.query} onQueryChange={props.onQueryChange} onSearch={search}\n {...(props.debounceMs===undefined?{}:{debounceMs:props.debounceMs})} {...(props.recentQueries?{recentQueries:props.recentQueries}:{})}\n committedQuery={committed} onSubmit={commit} searching={pending} searchingLabel={props.labels.searching}\n suggestions={{items:current?.suggestions??[],commitLabel:props.labels.commit,countLabel:props.labels.suggestionCount}}>\n {current?props.renderResult(current.result):null}\n </SearchScreen>{failed?<Text role=\"alert\" tone=\"danger\" style={{textAlign:\"center\"}}>{props.labels.error}</Text>:null}</>}</Stack></div>;\n}\n"]}
1
+ {"version":3,"file":"communication.js","sourceRoot":"","sources":["../src/communication.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAC,MAAM,EAAC,QAAQ,EAAiB,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAuC,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAE,WAAW,EAAC,eAAe,EAAkD,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,KAAK,EAAC,IAAI,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAO5E,MAAM,UAAU,YAAY,CAA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U,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,KAC1Q,CAAC,KAAK,CAAC,UAAU,KAAG,SAAS,CAAA,CAAC,CAAA,EAAE,CAAA,CAAC,CAAA,EAAC,UAAU,EAAC,KAAK,CAAC,UAAU,EAAC,CAAC,KAAM,CAAC,KAAK,CAAC,aAAa,CAAA,CAAC,CAAA,EAAC,aAAa,EAAC,KAAK,CAAC,aAAa,EAAC,CAAA,CAAC,CAAA,EAAE,CAAC,EACrI,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EACvG,WAAW,EAAE,EAAC,KAAK,EAAC,OAAO,EAAE,WAAW,IAAE,EAAE,EAAC,WAAW,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAC,UAAU,EAAC,KAAK,CAAC,MAAM,CAAC,eAAe,EAAC,YACpH,OAAO,CAAA,CAAC,CAAA,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA,CAAC,CAAA,IAAI,GACjC,EAAC,MAAM,CAAA,CAAC,CAAA,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAC,SAAS,EAAC,QAAQ,EAAC,YAAG,KAAK,CAAC,MAAM,CAAC,KAAK,GAAQ,CAAA,CAAC,CAAA,IAAI,IAAI,GAAS,CAAC;AACpI,CAAC","sourcesContent":["\"use client\";\nimport { useEffect,useRef,useState,type ReactNode } from \"react\";\nimport { resolveSearchCommit } from \"@hjmds/design-contracts/screen-patterns\";\nimport { validateReplyTarget,type ReplyTarget,type SearchResponse } from \"@hjmds/design-contracts/communication\";\nimport { ChatMessage,MessageComposer,type ChatMessageProps,type MessageComposerProps } from \"./screens.js\";\nimport { SearchScreen,type SearchRecentQueries } from \"./screen-flows.js\";\nimport { IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { Stack,Text } from \"./layout.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\n\nexport type ReplyMessageProps = Omit<ChatMessageProps,\"replyAction\"|\"timestampPresentation\"> & Readonly<{\n messageId: string; onReply: (messageId:string)=>void; replyLabel: string; replyDisabled?: boolean;\n /** A drag has one owner: reply, or time reveal. Accessible reply stays available in either mode. */\n swipeAction?: \"reply\"|\"timestamp\";\n}>;\nexport function ReplyMessage({messageId,onReply,replyLabel,replyDisabled=false,swipeAction=\"reply\",...message}:ReplyMessageProps){\n if(!messageId.trim())throw new TypeError(\"Reply message requires the actual message ID\");\n return <ChatMessage {...message} timestampPresentation={swipeAction===\"timestamp\"?\"swipe\":\"always\"} replyAction={{label:replyLabel,onPress:()=>onReply(messageId),disabled:replyDisabled}}/>;\n}\nexport type ReplyComposerProps=Omit<MessageComposerProps,\"onSend\"|\"replyTo\"|\"pending\"|\"error\"> & Readonly<{\n replyTarget: ReplyTarget|null; onReplyCancel:()=>void; cancelReplyLabel:string; errorLabel:string;\n /** Resolve only after the actual send acknowledgement. The controlled draft is never cleared here. */\n onSend:(value:string,context:Readonly<{replyToId:string|null}>)=>void|Promise<void>;\n}>;\nexport function ReplyComposer({replyTarget,onReplyCancel,cancelReplyLabel,errorLabel,onSend,...composer}:ReplyComposerProps){\n validateReplyTarget(replyTarget);const action=useCompositionAction(composer.disabled);\n return <Stack gap=\"sm\"><MessageComposer {...composer} pending={action.pending}\n {...(replyTarget?{replyTo:{author:replyTarget.author,excerpt:replyTarget.excerpt,cancelLabel:cancelReplyLabel,onCancel:onReplyCancel}}:{})}\n onSend={value=>{const id=replyTarget?.id??null;void action.run(\"send\",()=>onSend(value,{replyToId:id}));}}/>\n {action.failed?<Text role=\"alert\" tone=\"danger\" style={{textAlign:\"center\"}}>{errorLabel}</Text>:null}</Stack>;\n}\nexport type ExpandableSearchProps<T>=Readonly<{\n expanded:boolean;onExpandedChange:(expanded:boolean)=>void;query:string;onQueryChange:(query:string)=>void;\n onSearch:(query:string,context:Readonly<{signal:AbortSignal}>)=>Promise<SearchResponse<T>>;\n renderResult:(result:T)=>ReactNode;onSubmit?:(query:string)=>void;recentQueries?:SearchRecentQueries;debounceMs?:number;disabled?:boolean;\n labels:Readonly<{title:string;open:string;cancel:string;query:string;clear:string;searching:string;error:string;commit:(query:string)=>string;suggestionCount:(count:number)=>string}>;\n}>;\nexport function ExpandableSearch<T>(props:ExpandableSearchProps<T>){\n const [snapshot,setSnapshot]=useState<Readonly<{query:string;response:SearchResponse<T>}>|null>(null),[pending,setPending]=useState(false),[failed,setFailed]=useState(false),[committed,setCommitted]=useState(\"\");\n const latest=useRef(props);latest.current=props;const generation=useRef(0),controller=useRef<AbortController|null>(null);\n const host=useRef<HTMLDivElement>(null),opener=useRef<HTMLButtonElement>(null),restore=useRef(false);\n useEffect(()=>{if(!props.expanded){controller.current?.abort();generation.current++;setPending(false);setCommitted(\"\");}},[props.expanded]);\n useEffect(()=>()=>{generation.current++;controller.current?.abort();},[]);\n useEffect(()=>{if(props.expanded)host.current?.querySelector(\"input\")?.focus();else if(restore.current){opener.current?.focus();restore.current=false;}},[props.expanded]);\n const search=(query:string,{signal}:Readonly<{signal:AbortSignal}>)=>{\n controller.current?.abort();const token=++generation.current,request=new AbortController();controller.current=request;\n const abort=()=>request.abort();signal.addEventListener(\"abort\",abort,{once:true});if(signal.aborted)request.abort();\n // Some adapters ignore abort; generation and current-query checks still prevent stale UI writes.\n const valid=()=>!request.signal.aborted&&token===generation.current&&latest.current.expanded&&latest.current.query===query;\n if(!query.trim()){setSnapshot(null);setPending(false);setFailed(false);signal.removeEventListener(\"abort\",abort);return;}\n setPending(true);setFailed(false);\n const execute=latest.current.onSearch;\n void Promise.resolve().then(()=>request.signal.aborted?null:execute(query,{signal:request.signal})).then(response=>{if(valid()&&response)setSnapshot({query,response});},()=>{if(valid())setFailed(true);}).finally(()=>{signal.removeEventListener(\"abort\",abort);if(valid())setPending(false);});\n };\n const cancel=()=>{controller.current?.abort();generation.current++;setPending(false);restore.current=true;props.onExpandedChange(false);};\n const commit=(query:string)=>{const normalized=resolveSearchCommit(query);if(normalized===null)return;setCommitted(normalized);props.onSubmit?.(normalized);};\n const current=snapshot?.query===props.query?snapshot.response:null;\n // Opening and closing are tool actions: a search icon at the area's end, and the search screen's own header-leading\n // close exit. A full-width primary \"펼치기\" button and a text \"닫기\" button read as product actions (2026-10-17 review).\n return <Stack ref={host} gap=\"sm\">{!props.expanded?<IconButton ref={opener} label={props.labels.open} tone=\"ghost\" disabled={props.disabled===true} layoutStyle={{alignSelf:\"flex-end\"}} onClick={()=>props.onExpandedChange(true)}><Icon name=\"search\" /></IconButton>:<>\n <SearchScreen title={props.labels.title} titleVisibility=\"hidden\" exit={{kind:\"close\",label:props.labels.cancel,onClick:cancel}} queryLabel={props.labels.query} queryClearLabel={props.labels.clear} query={props.query} onQueryChange={props.onQueryChange} onSearch={search}\n {...(props.debounceMs===undefined?{}:{debounceMs:props.debounceMs})} {...(props.recentQueries?{recentQueries:props.recentQueries}:{})}\n committedQuery={committed} onSubmit={commit} searching={pending} searchingLabel={props.labels.searching}\n suggestions={{items:current?.suggestions??[],commitLabel:props.labels.commit,countLabel:props.labels.suggestionCount}}>\n {current?props.renderResult(current.result):null}\n </SearchScreen>{failed?<Text role=\"alert\" tone=\"danger\" style={{textAlign:\"center\"}}>{props.labels.error}</Text>:null}</>}</Stack>;\n}\n"]}
@@ -1,10 +1,18 @@
1
1
  import { type ContextMenuItemDescriptor } from "@hjmds/design-contracts/components/context-menu";
2
2
  import { type ReactNode } from "react";
3
3
  import type { HjmCompositionStyleProp } from "./composition-style.js";
4
+ /**
5
+ * Platform-neutral item plus an optional decorative leading icon, matching Native
6
+ * `NativeCanonicalContextMenuItem.icon` so one product menu renders the same on both (2026-10-17 parity review).
7
+ * The icon inherits the item color (danger tone included) through `currentColor`.
8
+ */
9
+ export type ContextMenuItem<Key extends string = string> = ContextMenuItemDescriptor<Key> & Readonly<{
10
+ icon?: ReactNode;
11
+ }>;
4
12
  export type ContextMenuProps<Key extends string = string> = Readonly<{
5
13
  /** The region the menu belongs to; right-click and long-press are bound here. */
6
14
  children: ReactNode;
7
- items: readonly ContextMenuItemDescriptor<Key>[];
15
+ items: readonly ContextMenuItem<Key>[];
8
16
  accessibilityLabel: string;
9
17
  onAction: (id: Key) => void;
10
18
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,gBAAgB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACnE,iFAAiF;IACjF,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,yBAAyB,CAAC,GAAG,CAAC,EAAE,CAAC;IACjD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0GAA0G;IAC1G,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAIH,wBAAgB,WAAW,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,EACvD,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,EAAE,gBAAgB,CAAC,GAAG,CAAC,+BA+LvB"}
1
+ {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI,yBAAyB,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IAAE,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE3H,MAAM,MAAM,gBAAgB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACnE,iFAAiF;IACjF,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0GAA0G;IAC1G,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAIH,wBAAgB,WAAW,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,EACvD,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,EAAE,gBAAgB,CAAC,GAAG,CAAC,+BAgMvB"}
@@ -154,7 +154,7 @@ export function ContextMenu({ children, items, accessibilityLabel, onAction, cla
154
154
  onAction(item.id);
155
155
  setAnchor(null);
156
156
  returnFocusRef.current?.focus();
157
- }, children: [_jsx("span", { children: item.label }), item.shortcut ? _jsx("kbd", { className: "hjm-context-menu__shortcut", children: item.shortcut }) : null] }, item.id));
157
+ }, children: [item.icon ? _jsx("span", { className: "hjm-context-menu__icon", "aria-hidden": "true", children: item.icon }) : null, _jsx("span", { className: "hjm-context-menu__label", children: item.label }), item.shortcut ? _jsx("kbd", { className: "hjm-context-menu__shortcut", children: item.shortcut }) : null] }, item.id));
158
158
  }) }) })) : null] }));
159
159
  }
160
160
  //# sourceMappingURL=context-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,wBAAwB,GAIzB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAc3C,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,MAAM,UAAU,WAAW,CAA8B,EACvD,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,GACW;IACtB,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,cAAc,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IACvB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA2B,IAAI,CAAC,CAAC;IACrE,MAAM,CAAC,WAAW,EA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BAClC,CAAC,aAED,yBAAO,IAAI,CAAC,KAAK,GAAQ,EACxB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,4BAA4B,YAAE,IAAI,CAAC,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,KAhBpF,IAAI,CAAC,EAAE,CAiBR,CACP,CAAC;oBACJ,CAAC,CAAC,GACE,GACS,CAClB,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { resolveMenuTypeahead } from \"./menu-typeahead.js\";\nimport {\n resolveContextMenuAnchor,\n type ContextMenuAnchor,\n type ContextMenuItemDescriptor,\n type ContextMenuOpenReason,\n} from \"@hjmds/design-contracts/components/context-menu\";\nimport { menuRecipe } from \"@hjmds/design-contracts/recipes\";\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { AnchoredPortal } from \"./portal.js\";\nimport { getModalLayer } from \"./modal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type ContextMenuProps<Key extends string = string> = Readonly<{\n /** The region the menu belongs to; right-click and long-press are bound here. */\n children: ReactNode;\n items: readonly ContextMenuItemDescriptor<Key>[];\n accessibilityLabel: string;\n onAction: (id: Key) => void;\n className?: string;\n /** Canonical layout-only placement on the in-flow host; the menu popup itself is anchored, not placed. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nconst longPressDelay = 500;\n\nexport function ContextMenu<Key extends string = string>({\n children,\n items,\n accessibilityLabel,\n onAction,\n className,\n layoutStyle,\n}: ContextMenuProps<Key>) {\n const hostRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const [menuMounted, setMenuMounted] = useState(false);\n const returnFocusRef = useRef<HTMLElement | null>(null);\n const menuId = useId();\n const [anchor, setAnchor] = useState<ContextMenuAnchor | null>(null);\n const [activeIndex, setActiveIndex] = useState(0);\n const longPress = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const pressOrigin = useRef<ContextMenuAnchor | null>(null);\n const cancelLongPress = useCallback(() => {\n if (longPress.current !== undefined) clearTimeout(longPress.current);\n longPress.current = undefined;\n pressOrigin.current = null;\n }, []);\n useEffect(() => cancelLongPress, [cancelLongPress]);\n const typeahead = useRef({ value: \"\", time: 0 });\n const enabled = items.filter((item) => !item.disabled);\n const resolvedActiveIndex = Math.min(activeIndex, Math.max(0, enabled.length - 1));\n useLayoutEffect(() => {\n if (activeIndex !== resolvedActiveIndex) setActiveIndex(resolvedActiveIndex);\n }, [activeIndex, resolvedActiveIndex]);\n\n const open = useCallback((reason: ContextMenuOpenReason, pointer: ContextMenuAnchor | null) => {\n cancelLongPress();\n const activeElement = document.activeElement;\n returnFocusRef.current = activeElement instanceof HTMLElement && hostRef.current?.contains(activeElement)\n ? activeElement\n : hostRef.current;\n const rect = hostRef.current?.getBoundingClientRect() ?? null;\n setAnchor(resolveContextMenuAnchor(\n reason,\n pointer,\n rect === null ? null : { left: rect.left, bottom: rect.bottom },\n ));\n setActiveIndex(0);\n typeahead.current = { value: \"\", time: 0 };\n }, [cancelLongPress]);\n\n const setMenuRef = useCallback((node: HTMLDivElement | null) => {\n menuRef.current = node;\n setMenuMounted(node !== null);\n }, []);\n\n useLayoutEffect(() => {\n if (anchor === null || !menuMounted || menuRef.current === null) return;\n menuRef.current.focus();\n const rect = menuRef.current.getBoundingClientRect();\n const x = Math.min(Math.max(anchor.x, 0), Math.max(window.innerWidth - rect.width, 0));\n const y = Math.min(Math.max(anchor.y, 0), Math.max(window.innerHeight - rect.height, 0));\n // The contract promises viewport coordinates; post-render measurement keeps long labels onscreen, where guessed dimensions could not account for wrapping.\n if (x !== anchor.x || y !== anchor.y) setAnchor({ x, y });\n }, [anchor, menuMounted]);\n\n useEffect(() => {\n if (anchor === null) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n setAnchor(null);\n // Focus goes back where the menu was opened from, not to the body.\n returnFocusRef.current?.focus();\n return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n setActiveIndex((previous) => {\n const next = event.key === \"ArrowDown\" ? previous + 1 : previous - 1;\n return (next + enabled.length) % Math.max(enabled.length, 1);\n });\n return;\n }\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setActiveIndex(event.key === \"Home\" ? 0 : Math.max(enabled.length - 1, 0));\n return;\n }\n if (event.key.length === 1 && event.key !== \" \" && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const result = resolveMenuTypeahead(enabled, resolvedActiveIndex, event.key, typeahead.current, Date.now());\n typeahead.current = result.state;\n if (result.index !== undefined) {\n event.preventDefault();\n setActiveIndex(result.index);\n }\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n const item = enabled[resolvedActiveIndex];\n if (item) { onAction(item.id as Key); setAnchor(null); returnFocusRef.current?.focus(); }\n return;\n }\n if (event.key === \"Tab\") {\n setAnchor(null);\n }\n };\n const onPointerDown = (event: PointerEvent) => {\n if (!(event.target instanceof Node) || !menuRef.current?.contains(event.target)) {\n setAnchor(null);\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"pointerdown\", onPointerDown);\n };\n }, [anchor, resolvedActiveIndex, enabled, onAction]);\n\n return (\n <div\n ref={hostRef}\n tabIndex={0}\n className={classNames(\"hjm-context-menu-host\", className)}\n style={layoutStyle}\n onContextMenu={(event) => {\n event.preventDefault();\n open(\"pointer\", { x: event.clientX, y: event.clientY });\n }}\n onKeyDown={(event) => {\n // Shift+F10 and the Menu key are how a keyboard opens a context menu;\n // without them the feature does not exist without a pointer.\n if ((event.shiftKey && event.key === \"F10\") || event.key === \"ContextMenu\") {\n event.preventDefault();\n open(\"keyboard\", null);\n }\n }}\n onPointerDown={(event) => {\n if (event.pointerType !== \"touch\") return;\n cancelLongPress();\n const origin = { x: event.clientX, y: event.clientY };\n pressOrigin.current = origin;\n longPress.current = setTimeout(() => open(\"longPress\", origin), longPressDelay);\n }}\n onPointerMove={(event) => {\n const origin = pressOrigin.current;\n // Treat a 10px move as scrolling, while tolerating small touch jitter.\n if (origin && Math.hypot(event.clientX - origin.x, event.clientY - origin.y) >= 10) cancelLongPress();\n }}\n onPointerUp={cancelLongPress}\n onPointerCancel={cancelLongPress}\n >\n {children}\n {anchor !== null ? (\n <AnchoredPortal anchorRef={hostRef}>\n <div\n role=\"menu\"\n id={menuId}\n ref={setMenuRef}\n tabIndex={-1}\n aria-activedescendant={enabled[resolvedActiveIndex] ? `${menuId}-item-${resolvedActiveIndex}` : undefined}\n aria-label={accessibilityLabel}\n className=\"hjm-context-menu\"\n style={{\n top: anchor.y,\n left: anchor.x,\n zIndex: getModalLayer(0),\n minInlineSize: menuRecipe.minWidth,\n } as CSSProperties}\n >\n {items.map((item) => {\n // A newly positioned menu can enter a stationary cursor; that\n // boundary event must not undo the user's keyboard selection.\n const index = enabled.findIndex((candidate) => candidate.id === item.id);\n return (\n <div\n key={item.id}\n id={index >= 0 ? `${menuId}-item-${index}` : undefined}\n role=\"menuitem\"\n aria-disabled={item.disabled || undefined}\n data-active={index === resolvedActiveIndex && !item.disabled ? \"\" : undefined}\n data-tone={item.tone}\n className=\"hjm-context-menu__item\"\n onMouseMove={() => { if (index >= 0) setActiveIndex(index); }}\n onClick={() => {\n if (item.disabled) return;\n onAction(item.id as Key);\n setAnchor(null);\n returnFocusRef.current?.focus();\n }}\n >\n <span>{item.label}</span>\n {item.shortcut ? <kbd className=\"hjm-context-menu__shortcut\">{item.shortcut}</kbd> : null}\n </div>\n );\n })}\n </div>\n </AnchoredPortal>\n ) : null}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../src/context-menu.t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,SAAS,EAAC,4BAA4B,YAAE,IAAI,CAAC,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,KAjBpF,IAAI,CAAC,EAAE,CAkBR,CACP,CAAC;oBACJ,CAAC,CAAC,GACE,GACS,CAClB,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { resolveMenuTypeahead } from \"./menu-typeahead.js\";\nimport {\n resolveContextMenuAnchor,\n type ContextMenuAnchor,\n type ContextMenuItemDescriptor,\n type ContextMenuOpenReason,\n} from \"@hjmds/design-contracts/components/context-menu\";\nimport { menuRecipe } from \"@hjmds/design-contracts/recipes\";\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { AnchoredPortal } from \"./portal.js\";\nimport { getModalLayer } from \"./modal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\n/**\n * Platform-neutral item plus an optional decorative leading icon, matching Native\n * `NativeCanonicalContextMenuItem.icon` so one product menu renders the same on both (2026-10-17 parity review).\n * The icon inherits the item color (danger tone included) through `currentColor`.\n */\nexport type ContextMenuItem<Key extends string = string> = ContextMenuItemDescriptor<Key> & Readonly<{ icon?: ReactNode }>;\n\nexport type ContextMenuProps<Key extends string = string> = Readonly<{\n /** The region the menu belongs to; right-click and long-press are bound here. */\n children: ReactNode;\n items: readonly ContextMenuItem<Key>[];\n accessibilityLabel: string;\n onAction: (id: Key) => void;\n className?: string;\n /** Canonical layout-only placement on the in-flow host; the menu popup itself is anchored, not placed. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nconst longPressDelay = 500;\n\nexport function ContextMenu<Key extends string = string>({\n children,\n items,\n accessibilityLabel,\n onAction,\n className,\n layoutStyle,\n}: ContextMenuProps<Key>) {\n const hostRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const [menuMounted, setMenuMounted] = useState(false);\n const returnFocusRef = useRef<HTMLElement | null>(null);\n const menuId = useId();\n const [anchor, setAnchor] = useState<ContextMenuAnchor | null>(null);\n const [activeIndex, setActiveIndex] = useState(0);\n const longPress = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const pressOrigin = useRef<ContextMenuAnchor | null>(null);\n const cancelLongPress = useCallback(() => {\n if (longPress.current !== undefined) clearTimeout(longPress.current);\n longPress.current = undefined;\n pressOrigin.current = null;\n }, []);\n useEffect(() => cancelLongPress, [cancelLongPress]);\n const typeahead = useRef({ value: \"\", time: 0 });\n const enabled = items.filter((item) => !item.disabled);\n const resolvedActiveIndex = Math.min(activeIndex, Math.max(0, enabled.length - 1));\n useLayoutEffect(() => {\n if (activeIndex !== resolvedActiveIndex) setActiveIndex(resolvedActiveIndex);\n }, [activeIndex, resolvedActiveIndex]);\n\n const open = useCallback((reason: ContextMenuOpenReason, pointer: ContextMenuAnchor | null) => {\n cancelLongPress();\n const activeElement = document.activeElement;\n returnFocusRef.current = activeElement instanceof HTMLElement && hostRef.current?.contains(activeElement)\n ? activeElement\n : hostRef.current;\n const rect = hostRef.current?.getBoundingClientRect() ?? null;\n setAnchor(resolveContextMenuAnchor(\n reason,\n pointer,\n rect === null ? null : { left: rect.left, bottom: rect.bottom },\n ));\n setActiveIndex(0);\n typeahead.current = { value: \"\", time: 0 };\n }, [cancelLongPress]);\n\n const setMenuRef = useCallback((node: HTMLDivElement | null) => {\n menuRef.current = node;\n setMenuMounted(node !== null);\n }, []);\n\n useLayoutEffect(() => {\n if (anchor === null || !menuMounted || menuRef.current === null) return;\n menuRef.current.focus();\n const rect = menuRef.current.getBoundingClientRect();\n const x = Math.min(Math.max(anchor.x, 0), Math.max(window.innerWidth - rect.width, 0));\n const y = Math.min(Math.max(anchor.y, 0), Math.max(window.innerHeight - rect.height, 0));\n // The contract promises viewport coordinates; post-render measurement keeps long labels onscreen, where guessed dimensions could not account for wrapping.\n if (x !== anchor.x || y !== anchor.y) setAnchor({ x, y });\n }, [anchor, menuMounted]);\n\n useEffect(() => {\n if (anchor === null) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n setAnchor(null);\n // Focus goes back where the menu was opened from, not to the body.\n returnFocusRef.current?.focus();\n return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n setActiveIndex((previous) => {\n const next = event.key === \"ArrowDown\" ? previous + 1 : previous - 1;\n return (next + enabled.length) % Math.max(enabled.length, 1);\n });\n return;\n }\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setActiveIndex(event.key === \"Home\" ? 0 : Math.max(enabled.length - 1, 0));\n return;\n }\n if (event.key.length === 1 && event.key !== \" \" && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const result = resolveMenuTypeahead(enabled, resolvedActiveIndex, event.key, typeahead.current, Date.now());\n typeahead.current = result.state;\n if (result.index !== undefined) {\n event.preventDefault();\n setActiveIndex(result.index);\n }\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n const item = enabled[resolvedActiveIndex];\n if (item) { onAction(item.id as Key); setAnchor(null); returnFocusRef.current?.focus(); }\n return;\n }\n if (event.key === \"Tab\") {\n setAnchor(null);\n }\n };\n const onPointerDown = (event: PointerEvent) => {\n if (!(event.target instanceof Node) || !menuRef.current?.contains(event.target)) {\n setAnchor(null);\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"pointerdown\", onPointerDown);\n };\n }, [anchor, resolvedActiveIndex, enabled, onAction]);\n\n return (\n <div\n ref={hostRef}\n tabIndex={0}\n className={classNames(\"hjm-context-menu-host\", className)}\n style={layoutStyle}\n onContextMenu={(event) => {\n event.preventDefault();\n open(\"pointer\", { x: event.clientX, y: event.clientY });\n }}\n onKeyDown={(event) => {\n // Shift+F10 and the Menu key are how a keyboard opens a context menu;\n // without them the feature does not exist without a pointer.\n if ((event.shiftKey && event.key === \"F10\") || event.key === \"ContextMenu\") {\n event.preventDefault();\n open(\"keyboard\", null);\n }\n }}\n onPointerDown={(event) => {\n if (event.pointerType !== \"touch\") return;\n cancelLongPress();\n const origin = { x: event.clientX, y: event.clientY };\n pressOrigin.current = origin;\n longPress.current = setTimeout(() => open(\"longPress\", origin), longPressDelay);\n }}\n onPointerMove={(event) => {\n const origin = pressOrigin.current;\n // Treat a 10px move as scrolling, while tolerating small touch jitter.\n if (origin && Math.hypot(event.clientX - origin.x, event.clientY - origin.y) >= 10) cancelLongPress();\n }}\n onPointerUp={cancelLongPress}\n onPointerCancel={cancelLongPress}\n >\n {children}\n {anchor !== null ? (\n <AnchoredPortal anchorRef={hostRef}>\n <div\n role=\"menu\"\n id={menuId}\n ref={setMenuRef}\n tabIndex={-1}\n aria-activedescendant={enabled[resolvedActiveIndex] ? `${menuId}-item-${resolvedActiveIndex}` : undefined}\n aria-label={accessibilityLabel}\n className=\"hjm-context-menu\"\n style={{\n top: anchor.y,\n left: anchor.x,\n zIndex: getModalLayer(0),\n minInlineSize: menuRecipe.minWidth,\n } as CSSProperties}\n >\n {items.map((item) => {\n // A newly positioned menu can enter a stationary cursor; that\n // boundary event must not undo the user's keyboard selection.\n const index = enabled.findIndex((candidate) => candidate.id === item.id);\n return (\n <div\n key={item.id}\n id={index >= 0 ? `${menuId}-item-${index}` : undefined}\n role=\"menuitem\"\n aria-disabled={item.disabled || undefined}\n data-active={index === resolvedActiveIndex && !item.disabled ? \"\" : undefined}\n data-tone={item.tone}\n className=\"hjm-context-menu__item\"\n onMouseMove={() => { if (index >= 0) setActiveIndex(index); }}\n onClick={() => {\n if (item.disabled) return;\n onAction(item.id as Key);\n setAnchor(null);\n returnFocusRef.current?.focus();\n }}\n >\n {item.icon ? <span className=\"hjm-context-menu__icon\" aria-hidden=\"true\">{item.icon}</span> : null}\n <span className=\"hjm-context-menu__label\">{item.label}</span>\n {item.shortcut ? <kbd className=\"hjm-context-menu__shortcut\">{item.shortcut}</kbd> : null}\n </div>\n );\n })}\n </div>\n </AnchoredPortal>\n ) : null}\n </div>\n );\n}\n"]}
@@ -3,6 +3,6 @@ import { conversationRowRecipe as recipe } from "@hjmds/design-contracts/convers
3
3
  import { Text } from "./layout.js";
4
4
  /** Presentation inside a router-owned link: the host supplies its full accessible name. */
5
5
  export function ConversationRow({ title, preview, metadata, avatar, unread = false }) {
6
- return _jsxs("span", { "aria-hidden": "true", "data-hjm-conversation-row": "true", "data-unread": unread || undefined, style: { display: "flex", alignItems: "center", gap: recipe.gap, paddingInline: recipe.paddingInline, paddingBlock: recipe.paddingBlock, minWidth: 0, width: "100%", boxSizing: "border-box" }, children: [_jsx("span", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: recipe.avatarSize, height: recipe.avatarSize, flexShrink: 0, borderRadius: "50%", overflow: "hidden" }, children: avatar }), _jsxs("span", { style: { display: "flex", flexDirection: "column", gap: recipe.contentGap, flex: 1, minWidth: 0 }, children: [_jsx(Text, { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontWeight: unread ? recipe.unreadTitleWeight : recipe.titleWeight }, children: title }), _jsxs("span", { style: { display: "flex", minWidth: 0 }, children: [_jsx(Text, { variant: "label", tone: unread ? "primary" : "subtle", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontWeight: unread ? recipe.unreadPreviewWeight : recipe.titleWeight }, children: preview }), _jsx(Text, { variant: "label", tone: unread ? "primary" : "subtle", style: { flexShrink: 0, whiteSpace: "nowrap", fontWeight: unread ? recipe.unreadPreviewWeight : recipe.titleWeight }, children: ` · ${metadata}` })] })] }), unread ? _jsx("span", { "data-hjm-unread-dot": "true", style: { width: recipe.unreadSize, height: recipe.unreadSize, flexShrink: 0, borderRadius: "50%", background: "var(--hjm-color-content-brand)" } }) : null] });
6
+ return _jsxs("span", { "aria-hidden": "true", "data-hjm-conversation-row": "true", "data-unread": unread || undefined, style: { display: "flex", alignItems: "center", gap: recipe.gap, paddingInline: recipe.paddingInline, paddingBlock: recipe.paddingBlock, minWidth: 0, width: "100%", boxSizing: "border-box" }, children: [_jsx("span", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: recipe.avatarSize, height: recipe.avatarSize, flexShrink: 0, borderRadius: "50%", overflow: "hidden" }, children: avatar }), _jsxs("span", { style: { display: "flex", flexDirection: "column", gap: recipe.contentGap, flex: 1, minWidth: 0 }, children: [_jsx(Text, { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontWeight: unread ? recipe.unreadTitleWeight : recipe.titleWeight }, children: title }), _jsxs("span", { style: { display: "flex", minWidth: 0 }, children: [_jsx(Text, { variant: "label", tone: unread ? "primary" : "subtle", style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontWeight: unread ? recipe.unreadPreviewWeight : recipe.titleWeight }, children: preview }), _jsx(Text, { variant: "label", tone: unread ? "primary" : "subtle", style: { flexShrink: 0, /* "pre": flex items drop the leading space of " · " (2026-10-17 comparison); still no wrap. */ whiteSpace: "pre", fontWeight: unread ? recipe.unreadPreviewWeight : recipe.titleWeight }, children: ` · ${metadata}` })] })] }), unread ? _jsx("span", { "data-hjm-unread-dot": "true", style: { width: recipe.unreadSize, height: recipe.unreadSize, flexShrink: 0, borderRadius: "50%", background: "var(--hjm-color-content-brand)" } }) : null] });
7
7
  }
8
8
  //# sourceMappingURL=conversation-row.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-row.js","sourceRoot":"","sources":["../src/conversation-row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,IAAI,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMnC,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,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,EAAC,QAAQ,EAAC,QAAQ,EAAC,YAAY,EAAC,UAAU,EAAC,UAAU,EAAC,QAAQ,EAAC,UAAU,EAAC,MAAM,CAAA,CAAC,CAAA,MAAM,CAAC,mBAAmB,CAAA,CAAC,CAAA,MAAM,CAAC,WAAW,EAAC,YAAG,OAAO,GAAQ,EAC/M,KAAC,IAAI,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAE,MAAM,CAAA,CAAC,CAAA,SAAS,CAAA,CAAC,CAAA,QAAQ,EAAE,KAAK,EAAE,EAAC,UAAU,EAAC,CAAC,EAAC,UAAU,EAAC,QAAQ,EAAC,UAAU,EAAC,MAAM,CAAA,CAAC,CAAA,MAAM,CAAC,mBAAmB,CAAA,CAAC,CAAA,MAAM,CAAC,WAAW,EAAC,YAAG,MAAM,QAAQ,EAAE,GAAQ,IACtL,IACF,EACN,MAAM,CAAA,CAAC,CAAA,sCAA0B,MAAM,EAAC,KAAK,EAAE,EAAC,KAAK,EAAC,MAAM,CAAC,UAAU,EAAC,MAAM,EAAC,MAAM,CAAC,UAAU,EAAC,UAAU,EAAC,CAAC,EAAC,YAAY,EAAC,KAAK,EAAC,UAAU,EAAC,gCAAgC,EAAC,GAAG,CAAA,CAAC,CAAA,IAAI,IACjL,CAAC;AACV,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { conversationRowRecipe as recipe } from \"@hjmds/design-contracts/conversation-row\";\nimport { Text } from \"./layout.js\";\n\nexport type ConversationRowProps = Readonly<{\n title: string; preview: string; metadata: string; avatar: ReactNode; unread?: boolean;\n}>;\n\n/** Presentation inside a router-owned link: the host supplies its full accessible name. */\nexport function ConversationRow({ title, preview, metadata, avatar, unread = false }: ConversationRowProps) {\n return <span aria-hidden=\"true\" data-hjm-conversation-row=\"true\" data-unread={unread || undefined}\n style={{display:\"flex\",alignItems:\"center\",gap:recipe.gap,paddingInline:recipe.paddingInline,paddingBlock:recipe.paddingBlock,minWidth:0,width:\"100%\",boxSizing:\"border-box\"}}>\n <span style={{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:recipe.avatarSize,height:recipe.avatarSize,flexShrink:0,borderRadius:\"50%\",overflow:\"hidden\"}}>{avatar}</span>\n <span style={{display:\"flex\",flexDirection:\"column\",gap:recipe.contentGap,flex:1,minWidth:0}}>\n <Text style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadTitleWeight:recipe.titleWeight}}>{title}</Text>\n <span style={{display:\"flex\",minWidth:0}}>\n <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{preview}</Text>\n <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{flexShrink:0,whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{` · ${metadata}`}</Text>\n </span>\n </span>\n {unread?<span data-hjm-unread-dot=\"true\" style={{width:recipe.unreadSize,height:recipe.unreadSize,flexShrink:0,borderRadius:\"50%\",background:\"var(--hjm-color-content-brand)\"}}/>:null}\n </span>;\n}\n"]}
1
+ {"version":3,"file":"conversation-row.js","sourceRoot":"","sources":["../src/conversation-row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,IAAI,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMnC,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,EAAwB;IACxG,OAAO,+BAAkB,MAAM,+BAA2B,MAAM,iBAAc,MAAM,IAAI,SAAS,EAC/F,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG,EAAC,MAAM,CAAC,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AG,OAAO,GAAQ,EAC/M,KAAC,IAAI,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAE,MAAM,CAAA,CAAC,CAAA,SAAS,CAAA,CAAC,CAAA,QAAQ,EAAE,KAAK,EAAE,EAAC,UAAU,EAAC,CAAC,EAAC,+FAA+F,CAAA,UAAU,EAAC,KAAK,EAAC,UAAU,EAAC,MAAM,CAAA,CAAC,CAAA,MAAM,CAAC,mBAAmB,CAAA,CAAC,CAAA,MAAM,CAAC,WAAW,EAAC,YAAG,MAAM,QAAQ,EAAE,GAAQ,IAClR,IACF,EACN,MAAM,CAAA,CAAC,CAAA,sCAA0B,MAAM,EAAC,KAAK,EAAE,EAAC,KAAK,EAAC,MAAM,CAAC,UAAU,EAAC,MAAM,EAAC,MAAM,CAAC,UAAU,EAAC,UAAU,EAAC,CAAC,EAAC,YAAY,EAAC,KAAK,EAAC,UAAU,EAAC,gCAAgC,EAAC,GAAG,CAAA,CAAC,CAAA,IAAI,IACjL,CAAC;AACV,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { conversationRowRecipe as recipe } from \"@hjmds/design-contracts/conversation-row\";\nimport { Text } from \"./layout.js\";\n\nexport type ConversationRowProps = Readonly<{\n title: string; preview: string; metadata: string; avatar: ReactNode; unread?: boolean;\n}>;\n\n/** Presentation inside a router-owned link: the host supplies its full accessible name. */\nexport function ConversationRow({ title, preview, metadata, avatar, unread = false }: ConversationRowProps) {\n return <span aria-hidden=\"true\" data-hjm-conversation-row=\"true\" data-unread={unread || undefined}\n style={{display:\"flex\",alignItems:\"center\",gap:recipe.gap,paddingInline:recipe.paddingInline,paddingBlock:recipe.paddingBlock,minWidth:0,width:\"100%\",boxSizing:\"border-box\"}}>\n <span style={{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:recipe.avatarSize,height:recipe.avatarSize,flexShrink:0,borderRadius:\"50%\",overflow:\"hidden\"}}>{avatar}</span>\n <span style={{display:\"flex\",flexDirection:\"column\",gap:recipe.contentGap,flex:1,minWidth:0}}>\n <Text style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadTitleWeight:recipe.titleWeight}}>{title}</Text>\n <span style={{display:\"flex\",minWidth:0}}>\n <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{preview}</Text>\n <Text variant=\"label\" tone={unread?\"primary\":\"subtle\"} style={{flexShrink:0,/* \"pre\": flex items drop the leading space of \" · \" (2026-10-17 comparison); still no wrap. */whiteSpace:\"pre\",fontWeight:unread?recipe.unreadPreviewWeight:recipe.titleWeight}}>{` · ${metadata}`}</Text>\n </span>\n </span>\n {unread?<span data-hjm-unread-dot=\"true\" style={{width:recipe.unreadSize,height:recipe.unreadSize,flexShrink:0,borderRadius:\"50%\",background:\"var(--hjm-color-content-brand)\"}}/>:null}\n </span>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"data-workflows.d.ts","sourceRoot":"","sources":["../src/data-workflows.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAkB,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAuB,KAAK,MAAM,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAgB/Q,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAAC,OAAO,EAAE,aAAa,CAAC;IAC5G,eAAe,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,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AAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,YAAY,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,KAAK,MAAM,CAAA;CAAE,CAAC,CAAC;AAC5M,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAMtD;AAED,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9I,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,CAAC;IAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACtH,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,KAAK,MAAM,CAAC;CACpI,CAAC,CAAC;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAW9D"}
@@ -5,6 +5,7 @@ import { binHistogram, resolveCohorts, resolveFunnel, resolveImportMapping, reso
5
5
  import { assertDistinctIds } from "@hjmds/design-contracts/collection-editing";
6
6
  import { resolveDatavizSeriesColor } from "@hjmds/design-contracts/dataviz";
7
7
  import { Button } from "./actions.js";
8
+ import { SegmentedControl } from "./selection.js";
8
9
  import { Select } from "./select.js";
9
10
  import { Stack, Text } from "./layout.js";
10
11
  import { DataTable } from "./data-table.js";
@@ -28,7 +29,7 @@ export function ConversionFunnel(props) {
28
29
  const stages = resolveFunnel(props.stages), [chosen, setChosen] = useState(null);
29
30
  const selected = Math.max(0, stages.findIndex(stage => stage.id === chosen));
30
31
  return _jsxs(Stack, { gap: "md", children: [_jsx(Text, { emphasis: "strong", children: props.label }), stages.length ? _jsxs(_Fragment, { children: [_jsx(BarChart, { categories: stages.map(stage => stage.label), series: [{ id: "count", label: props.label, values: stages.map(stage => stage.count) }], accessibilityLabel: props.label, formatValue: props.formatCount, missingLabel: props.missingLabel, orientation: "horizontal", focusIndex: selected, onFocusChange: index => { if (index !== null && stages[index])
31
- setChosen(stages[index].id); } }), _jsx(Stack, { axis: "inline", gap: "sm", wrap: true, children: stages.map(stage => _jsx(Button, { tone: "ghost", selected: stages[selected].id === stage.id, onClick: () => setChosen(stage.id), children: stage.label }, stage.id)) }), _jsx(Text, { role: "status", children: props.detailLabel(stages[selected]) })] }) : _jsx(Text, { style: { textAlign: "center" }, children: props.missingLabel })] });
32
+ setChosen(stages[index].id); } }), _jsx(SegmentedControl, { label: props.label, items: stages.map(stage => ({ value: stage.id, label: stage.label })), value: stages[selected].id, onValueChange: setChosen }), _jsx(Text, { role: "status", children: props.detailLabel(stages[selected]) })] }) : _jsx(Text, { style: { textAlign: "center" }, children: props.missingLabel })] });
32
33
  }
33
34
  export function CohortRetentionTable(props) {
34
35
  const rows = resolveCohorts(props.cohorts, props.periods.length);
@@ -47,7 +48,7 @@ export function CorrelationMatrix(props) {
47
48
  }
48
49
  export function TargetSummary(props) {
49
50
  const summary = resolveTarget(props.actual, props.target), label = props.summaryLabel(summary);
50
- return _jsxs(Stack, { gap: "sm", children: [_jsx(Statistic, { descriptor: { id: "target-summary", label: props.label, value: props.formatActual(summary.actual), hint: label } }), summary.progress === null ? null : _jsx(Progress, { label: props.label, value: summary.progress, max: 1, valueText: label })] });
51
+ return _jsxs(Stack, { gap: "sm", children: [_jsx(Statistic, { descriptor: { id: "target-summary", label: props.label, value: props.formatActual(summary.actual), hint: label } }), summary.progress === null ? null : _jsx(Progress, { "aria-label": props.label, value: summary.progress, max: 1, valueText: label })] });
51
52
  }
52
53
  export function HistogramExplorer(props) {
53
54
  if (!props.binCounts.length || !props.binCounts.includes(props.binCount) || new Set(props.binCounts).size !== props.binCounts.length)
@@ -55,6 +56,6 @@ export function HistogramExplorer(props) {
55
56
  const variants = props.binCounts.map(count => binHistogram(props.samples, count, props.domain)), histogram = variants[props.binCounts.indexOf(props.binCount)];
56
57
  // Hold the y domain across rebinning. Normalizing each set to its tallest bar changes the meaning.
57
58
  const maximum = Math.max(...variants.map(variant => variant.maxCount));
58
- return _jsxs(Stack, { gap: "md", children: [_jsx(Text, { emphasis: "strong", children: props.label }), _jsx(Stack, { axis: "inline", gap: "sm", wrap: true, children: props.binCounts.map(count => _jsx(Button, { tone: "secondary", selected: count === props.binCount, onClick: () => props.onBinCountChange(count), children: props.binCountLabel(count) }, count)) }), histogram.observed ? _jsx(BarChart, { categories: histogram.bins.map(props.binLabel), series: [{ id: "frequency", label: props.label, values: histogram.bins.map(bin => bin.count) }], accessibilityLabel: props.label, formatValue: props.formatCount, missingLabel: props.missingLabel, domain: [0, maximum], showValues: true }) : _jsx(Text, { style: { textAlign: "center" }, children: props.missingLabel }), _jsx(Text, { role: "status", children: props.summaryLabel(histogram) })] });
59
+ return _jsxs(Stack, { gap: "md", children: [_jsx(Text, { emphasis: "strong", children: props.label }), _jsx(SegmentedControl, { label: props.label, items: props.binCounts.map(count => ({ value: String(count), label: props.binCountLabel(count) })), value: String(props.binCount), onValueChange: value => props.onBinCountChange(Number(value)) }), histogram.observed ? _jsx(BarChart, { categories: histogram.bins.map(props.binLabel), series: [{ id: "frequency", label: props.label, values: histogram.bins.map(bin => bin.count) }], accessibilityLabel: props.label, formatValue: props.formatCount, missingLabel: props.missingLabel, domain: [0, maximum], showValues: true }) : _jsx(Text, { style: { textAlign: "center" }, children: props.missingLabel }), _jsx(Text, { role: "status", children: props.summaryLabel(histogram) })] });
59
60
  }
60
61
  //# sourceMappingURL=data-workflows.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-workflows.js","sourceRoot":"","sources":["../src/data-workflows.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,mBAAmB,EAAkH,MAAM,wCAAwC,CAAC;AAC/Q,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,yEAAyE;AACzE,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AASjJ,MAAM,UAAU,kBAAkB,CAAC,KAA8B;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C,GAAG,EAAC,IAAI,EAAC,IAAI,kBAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAC,MAAM,IAAa,IAAI,EAAC,WAAW,EAAC,QAAQ,EAAE,KAAK,KAAK,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,YAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAArI,KAAK,CAA0I,CAAC,GAAS,EACvS,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAC7K,kBAAkB,EAAE,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,SAAG,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAG,KAAK,CAAC,YAAY,GAAQ,EAC5M,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,YAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,GAAQ,IACpD,CAAC;AACX,CAAC","sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { binHistogram, resolveCohorts, resolveFunnel, resolveImportMapping, resolveTarget, validateCorrelation, type Cohort, type CorrelationData, type FunnelStage, type HistogramBin, type ImportMapping, type WorkflowField } from \"@hjmds/design-contracts/data-workflows\";\nimport { assertDistinctIds } from \"@hjmds/design-contracts/collection-editing\";\nimport { resolveDatavizSeriesColor } from \"@hjmds/design-contracts/dataviz\";\nimport { Button } from \"./actions.js\";\nimport { Select } from \"./select.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { DataTable } from \"./data-table.js\";\nimport { BarChart } from \"./chart.js\";\nimport { Statistic } from \"./advanced-display.js\";\nimport { Progress } from \"./feedback.js\";\nimport { useHjmTheme } from \"./provider.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\n\n// These read-only tables expose neither sort controls nor row selection.\nconst labelsFor = (label: string) => ({ table: label, selectAll: label, selectRow: (id: string) => id, sortColumn: (header: string) => header });\n\nexport type ImportFieldMappingProps = Readonly<{\n label: string; sources: readonly WorkflowField[]; targets: readonly WorkflowField[]; mapping: ImportMapping;\n onMappingChange: (mapping: ImportMapping) => void; onImport: (mapping: ImportMapping) => void | Promise<void>;\n importLabel: string; skipLabel: string; errorLabel: string; disabled?: boolean;\n validationLabel: (state: ReturnType<typeof resolveImportMapping>) => string;\n previewRows?: readonly Readonly<{ id: string; values: Readonly<Record<string, string>> }>[];\n}>;\nexport function ImportFieldMapping(props: ImportFieldMappingProps) {\n const action = useCompositionAction(props.disabled), resolved = resolveImportMapping(props.sources, props.targets, props.mapping);\n const locked = props.disabled === true || action.pending, rows = props.previewRows ?? [];\n assertDistinctIds(rows);\n const pairs = props.targets.flatMap(target => { const source = props.sources.find(source => props.mapping[source.id] === target.id); return source ? [{ source, target }] : []; });\n return <Stack gap=\"md\"><Text emphasis=\"strong\">{props.label}</Text>\n {props.sources.map(source => <Select key={source.id} label={source.label} placeholder={props.skipLabel} emptySelectionLabel={props.skipLabel} disabled={locked}\n items={[{ id: resolved.skipKey, label: props.skipLabel, textValue: props.skipLabel }, ...props.targets.map(target => ({ id: target.id, label: target.label, textValue: target.label }))]} selectedKey={props.mapping[source.id] ?? resolved.skipKey}\n onSelectionChange={key => { if (!locked) props.onMappingChange({ ...props.mapping, [source.id]: key === resolved.skipKey ? null : key }); }} />)}\n {!resolved.valid ? <Text role=\"status\" style={{ textAlign: \"center\" }}>{props.validationLabel(resolved)}</Text> : null}\n {resolved.valid && rows.length ? <DataTable columns={pairs.map(pair => ({ id: pair.target.id, header: pair.target.label }))} rows={rows.map(row => ({ id: row.id }))}\n labels={labelsFor(props.label)} renderCell={(id, column) => rows.find(row => row.id === id)?.values[pairs.find(pair => pair.target.id === column)!.source.id] ?? \"\"} /> : null}\n <Button loading={action.pending} disabled={props.disabled === true || !resolved.valid} onClick={() => { if (resolved.valid) void action.run(\"import\", () => props.onImport(resolved.mapping)); }}>{props.importLabel}</Button>\n {action.failed ? <Text role=\"alert\" tone=\"danger\" style={{ textAlign: \"center\" }}>{props.errorLabel}</Text> : null}\n </Stack>;\n}\n\nexport type ConversionFunnelProps = Readonly<{\n label: string; stages: readonly FunnelStage[]; formatCount: (count: number) => string; missingLabel: string;\n detailLabel: (stage: ReturnType<typeof resolveFunnel>[number]) => string;\n}>;\nexport function ConversionFunnel(props: ConversionFunnelProps) {\n const stages = resolveFunnel(props.stages), [chosen, setChosen] = useState<string | null>(null);\n const selected = Math.max(0, stages.findIndex(stage => stage.id === chosen));\n return <Stack gap=\"md\"><Text emphasis=\"strong\">{props.label}</Text>\n {stages.length ? <><BarChart categories={stages.map(stage => stage.label)} series={[{ id: \"count\", label: props.label, values: stages.map(stage => stage.count) }]}\n accessibilityLabel={props.label} formatValue={props.formatCount} missingLabel={props.missingLabel} orientation=\"horizontal\" focusIndex={selected}\n onFocusChange={index => { if (index !== null && stages[index]) setChosen(stages[index]!.id); }} />\n <Stack axis=\"inline\" gap=\"sm\" wrap>{stages.map(stage => <Button key={stage.id} tone=\"ghost\" selected={stages[selected]!.id === stage.id} onClick={() => setChosen(stage.id)}>{stage.label}</Button>)}</Stack>\n <Text role=\"status\">{props.detailLabel(stages[selected]!)}</Text></> : <Text style={{ textAlign: \"center\" }}>{props.missingLabel}</Text>}\n </Stack>;\n}\n\nexport type CohortRetentionTableProps = Readonly<{\n label: string; cohorts: readonly Cohort[]; periods: readonly string[]; cohortColumnLabel: string;\n formatRate: (rate: number, retained: number, size: number) => string; missingLabel: string;\n}>;\nexport function CohortRetentionTable(props: CohortRetentionTableProps) {\n const rows = resolveCohorts(props.cohorts, props.periods.length);\n const color = useHjmTheme().environment.theme;\n // MatrixTable intentionally suppresses its diagonal for head-to-head teams. Cohort data is rectangular.\n return <DataTable columns={[{ id: \"label\", header: props.cohortColumnLabel, pinned: \"start\" as const }, ...props.periods.map((header, index) => ({ id: `p-${index}`, header }))]}\n rows={rows.map(row => ({ id: row.id }))} labels={labelsFor(props.label)}\n heatColors={{ high: resolveDatavizSeriesColor(color, 0), low: resolveDatavizSeriesColor(color, 1) }}\n cellStyle={(rowId, column) => { const rate = rows.find(row => row.id === rowId)!.rates[Number(column.slice(2))]; return typeof rate === \"number\" && rate > 0 ? { heat: { side: \"high\", strength: rate >= .7 ? 3 : rate >= .35 ? 2 : 1 } } : null; }}\n renderCell={(rowId, column) => { const row = rows.find(row => row.id === rowId)!; if (column === \"label\") return row.label; const index = Number(column.slice(2)), rate = row.rates[index]; return rate === null || rate === undefined ? props.missingLabel : props.formatRate(rate, row.retained[index]!, row.size); }} />;\n}\n\nexport type CorrelationMatrixProps = Readonly<{ label: string; data: CorrelationData; variableColumnLabel: string; formatValue: (value: number) => string; missingLabel: string }>;\nexport function CorrelationMatrix(props: CorrelationMatrixProps) {\n validateCorrelation(props.data);\n const color = useHjmTheme().environment.theme;\n const valueOf = (row: string, column: string) => props.data.values[props.data.variables.findIndex(variable => variable.id === row)]![Number(column.slice(2))];\n return <DataTable columns={[{ id: \"label\", header: props.variableColumnLabel, pinned: \"start\" as const }, ...props.data.variables.map((variable, index) => ({ id: `v-${index}`, header: variable.label }))]}\n rows={props.data.variables.map(variable => ({ id: variable.id }))} labels={labelsFor(props.label)}\n heatColors={{ high: resolveDatavizSeriesColor(color, 0), low: resolveDatavizSeriesColor(color, 1) }}\n cellStyle={(row, column) => { if (column === \"label\") return null; const value = valueOf(row, column); return value === null || value === undefined || value === 0 ? null : { heat: { side: value > 0 ? \"high\" : \"low\", strength: Math.abs(value) >= .7 ? 3 : Math.abs(value) >= .35 ? 2 : 1 } }; }}\n renderCell={(row, column) => { if (column === \"label\") return props.data.variables.find(variable => variable.id === row)!.label; const value = valueOf(row, column); return value === null || value === undefined ? props.missingLabel : props.formatValue(value); }} />;\n}\n\nexport type TargetSummaryProps = Readonly<{ label: string; actual: number; target: number; formatActual: (actual: number) => string; summaryLabel: (summary: ReturnType<typeof resolveTarget>) => string }>;\nexport function TargetSummary(props: TargetSummaryProps) {\n const summary = resolveTarget(props.actual, props.target), label = props.summaryLabel(summary);\n return <Stack gap=\"sm\"><Statistic descriptor={{ id: \"target-summary\", label: props.label, value: props.formatActual(summary.actual), hint: label }} />\n {summary.progress === null ? null : <Progress label={props.label} value={summary.progress} max={1} valueText={label} />}\n </Stack>;\n}\n\nexport type HistogramExplorerProps = Readonly<{\n label: string; samples: readonly (number | null)[]; binCounts: readonly number[]; binCount: number; onBinCountChange: (count: number) => void;\n domain?: readonly [number, number]; binLabel: (bin: HistogramBin) => string; binCountLabel: (count: number) => string;\n formatCount: (count: number) => string; missingLabel: string; summaryLabel: (histogram: ReturnType<typeof binHistogram>) => string;\n}>;\nexport function HistogramExplorer(props: HistogramExplorerProps) {\n if (!props.binCounts.length || !props.binCounts.includes(props.binCount) || new Set(props.binCounts).size !== props.binCounts.length) throw new RangeError(\"Histogram requires distinct choices including the selected bin count\");\n const variants = props.binCounts.map(count => binHistogram(props.samples, count, props.domain)), histogram = variants[props.binCounts.indexOf(props.binCount)]!;\n // Hold the y domain across rebinning. Normalizing each set to its tallest bar changes the meaning.\n const maximum = Math.max(...variants.map(variant => variant.maxCount));\n return <Stack gap=\"md\"><Text emphasis=\"strong\">{props.label}</Text><Stack axis=\"inline\" gap=\"sm\" wrap>{props.binCounts.map(count => <Button key={count} tone=\"secondary\" selected={count === props.binCount} onClick={() => props.onBinCountChange(count)}>{props.binCountLabel(count)}</Button>)}</Stack>\n {histogram.observed ? <BarChart categories={histogram.bins.map(props.binLabel)} series={[{ id: \"frequency\", label: props.label, values: histogram.bins.map(bin => bin.count) }]}\n accessibilityLabel={props.label} formatValue={props.formatCount} missingLabel={props.missingLabel} domain={[0, maximum]} showValues /> : <Text style={{ textAlign: \"center\" }}>{props.missingLabel}</Text>}\n <Text role=\"status\">{props.summaryLabel(histogram)}</Text>\n </Stack>;\n}\n"]}
1
+ {"version":3,"file":"data-workflows.js","sourceRoot":"","sources":["../src/data-workflows.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,mBAAmB,EAAkH,MAAM,wCAAwC,CAAC;AAC/Q,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,yEAAyE;AACzE,M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AC,SAAS,CAAC,GAAQ,IACpD,CAAC;AACX,CAAC","sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { binHistogram, resolveCohorts, resolveFunnel, resolveImportMapping, resolveTarget, validateCorrelation, type Cohort, type CorrelationData, type FunnelStage, type HistogramBin, type ImportMapping, type WorkflowField } from \"@hjmds/design-contracts/data-workflows\";\nimport { assertDistinctIds } from \"@hjmds/design-contracts/collection-editing\";\nimport { resolveDatavizSeriesColor } from \"@hjmds/design-contracts/dataviz\";\nimport { Button } from \"./actions.js\";\nimport { SegmentedControl } from \"./selection.js\";\nimport { Select } from \"./select.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { DataTable } from \"./data-table.js\";\nimport { BarChart } from \"./chart.js\";\nimport { Statistic } from \"./advanced-display.js\";\nimport { Progress } from \"./feedback.js\";\nimport { useHjmTheme } from \"./provider.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\n\n// These read-only tables expose neither sort controls nor row selection.\nconst labelsFor = (label: string) => ({ table: label, selectAll: label, selectRow: (id: string) => id, sortColumn: (header: string) => header });\n\nexport type ImportFieldMappingProps = Readonly<{\n label: string; sources: readonly WorkflowField[]; targets: readonly WorkflowField[]; mapping: ImportMapping;\n onMappingChange: (mapping: ImportMapping) => void; onImport: (mapping: ImportMapping) => void | Promise<void>;\n importLabel: string; skipLabel: string; errorLabel: string; disabled?: boolean;\n validationLabel: (state: ReturnType<typeof resolveImportMapping>) => string;\n previewRows?: readonly Readonly<{ id: string; values: Readonly<Record<string, string>> }>[];\n}>;\nexport function ImportFieldMapping(props: ImportFieldMappingProps) {\n const action = useCompositionAction(props.disabled), resolved = resolveImportMapping(props.sources, props.targets, props.mapping);\n const locked = props.disabled === true || action.pending, rows = props.previewRows ?? [];\n assertDistinctIds(rows);\n const pairs = props.targets.flatMap(target => { const source = props.sources.find(source => props.mapping[source.id] === target.id); return source ? [{ source, target }] : []; });\n return <Stack gap=\"md\"><Text emphasis=\"strong\">{props.label}</Text>\n {props.sources.map(source => <Select key={source.id} label={source.label} placeholder={props.skipLabel} emptySelectionLabel={props.skipLabel} disabled={locked}\n items={[{ id: resolved.skipKey, label: props.skipLabel, textValue: props.skipLabel }, ...props.targets.map(target => ({ id: target.id, label: target.label, textValue: target.label }))]} selectedKey={props.mapping[source.id] ?? resolved.skipKey}\n onSelectionChange={key => { if (!locked) props.onMappingChange({ ...props.mapping, [source.id]: key === resolved.skipKey ? null : key }); }} />)}\n {!resolved.valid ? <Text role=\"status\" style={{ textAlign: \"center\" }}>{props.validationLabel(resolved)}</Text> : null}\n {resolved.valid && rows.length ? <DataTable columns={pairs.map(pair => ({ id: pair.target.id, header: pair.target.label }))} rows={rows.map(row => ({ id: row.id }))}\n labels={labelsFor(props.label)} renderCell={(id, column) => rows.find(row => row.id === id)?.values[pairs.find(pair => pair.target.id === column)!.source.id] ?? \"\"} /> : null}\n <Button loading={action.pending} disabled={props.disabled === true || !resolved.valid} onClick={() => { if (resolved.valid) void action.run(\"import\", () => props.onImport(resolved.mapping)); }}>{props.importLabel}</Button>\n {action.failed ? <Text role=\"alert\" tone=\"danger\" style={{ textAlign: \"center\" }}>{props.errorLabel}</Text> : null}\n </Stack>;\n}\n\nexport type ConversionFunnelProps = Readonly<{\n label: string; stages: readonly FunnelStage[]; formatCount: (count: number) => string; missingLabel: string;\n detailLabel: (stage: ReturnType<typeof resolveFunnel>[number]) => string;\n}>;\nexport function ConversionFunnel(props: ConversionFunnelProps) {\n const stages = resolveFunnel(props.stages), [chosen, setChosen] = useState<string | null>(null);\n const selected = Math.max(0, stages.findIndex(stage => stage.id === chosen));\n return <Stack gap=\"md\"><Text emphasis=\"strong\">{props.label}</Text>\n {stages.length ? <><BarChart categories={stages.map(stage => stage.label)} series={[{ id: \"count\", label: props.label, values: stages.map(stage => stage.count) }]}\n accessibilityLabel={props.label} formatValue={props.formatCount} missingLabel={props.missingLabel} orientation=\"horizontal\" focusIndex={selected}\n onFocusChange={index => { if (index !== null && stages[index]) setChosen(stages[index]!.id); }} />\n <SegmentedControl label={props.label} items={stages.map(stage => ({ value: stage.id, label: stage.label }))} value={stages[selected]!.id} onValueChange={setChosen} />\n <Text role=\"status\">{props.detailLabel(stages[selected]!)}</Text></> : <Text style={{ textAlign: \"center\" }}>{props.missingLabel}</Text>}\n </Stack>;\n}\n\nexport type CohortRetentionTableProps = Readonly<{\n label: string; cohorts: readonly Cohort[]; periods: readonly string[]; cohortColumnLabel: string;\n formatRate: (rate: number, retained: number, size: number) => string; missingLabel: string;\n}>;\nexport function CohortRetentionTable(props: CohortRetentionTableProps) {\n const rows = resolveCohorts(props.cohorts, props.periods.length);\n const color = useHjmTheme().environment.theme;\n // MatrixTable intentionally suppresses its diagonal for head-to-head teams. Cohort data is rectangular.\n return <DataTable columns={[{ id: \"label\", header: props.cohortColumnLabel, pinned: \"start\" as const }, ...props.periods.map((header, index) => ({ id: `p-${index}`, header }))]}\n rows={rows.map(row => ({ id: row.id }))} labels={labelsFor(props.label)}\n heatColors={{ high: resolveDatavizSeriesColor(color, 0), low: resolveDatavizSeriesColor(color, 1) }}\n cellStyle={(rowId, column) => { const rate = rows.find(row => row.id === rowId)!.rates[Number(column.slice(2))]; return typeof rate === \"number\" && rate > 0 ? { heat: { side: \"high\", strength: rate >= .7 ? 3 : rate >= .35 ? 2 : 1 } } : null; }}\n renderCell={(rowId, column) => { const row = rows.find(row => row.id === rowId)!; if (column === \"label\") return row.label; const index = Number(column.slice(2)), rate = row.rates[index]; return rate === null || rate === undefined ? props.missingLabel : props.formatRate(rate, row.retained[index]!, row.size); }} />;\n}\n\nexport type CorrelationMatrixProps = Readonly<{ label: string; data: CorrelationData; variableColumnLabel: string; formatValue: (value: number) => string; missingLabel: string }>;\nexport function CorrelationMatrix(props: CorrelationMatrixProps) {\n validateCorrelation(props.data);\n const color = useHjmTheme().environment.theme;\n const valueOf = (row: string, column: string) => props.data.values[props.data.variables.findIndex(variable => variable.id === row)]![Number(column.slice(2))];\n return <DataTable columns={[{ id: \"label\", header: props.variableColumnLabel, pinned: \"start\" as const }, ...props.data.variables.map((variable, index) => ({ id: `v-${index}`, header: variable.label }))]}\n rows={props.data.variables.map(variable => ({ id: variable.id }))} labels={labelsFor(props.label)}\n heatColors={{ high: resolveDatavizSeriesColor(color, 0), low: resolveDatavizSeriesColor(color, 1) }}\n cellStyle={(row, column) => { if (column === \"label\") return null; const value = valueOf(row, column); return value === null || value === undefined || value === 0 ? null : { heat: { side: value > 0 ? \"high\" : \"low\", strength: Math.abs(value) >= .7 ? 3 : Math.abs(value) >= .35 ? 2 : 1 } }; }}\n renderCell={(row, column) => { if (column === \"label\") return props.data.variables.find(variable => variable.id === row)!.label; const value = valueOf(row, column); return value === null || value === undefined ? props.missingLabel : props.formatValue(value); }} />;\n}\n\nexport type TargetSummaryProps = Readonly<{ label: string; actual: number; target: number; formatActual: (actual: number) => string; summaryLabel: (summary: ReturnType<typeof resolveTarget>) => string }>;\nexport function TargetSummary(props: TargetSummaryProps) {\n const summary = resolveTarget(props.actual, props.target), label = props.summaryLabel(summary);\n return <Stack gap=\"sm\"><Statistic descriptor={{ id: \"target-summary\", label: props.label, value: props.formatActual(summary.actual), hint: label }} />\n {/* Statistic already prints the label and summary; the bar carries them only as its accessible name and value. */}\n {summary.progress === null ? null : <Progress aria-label={props.label} value={summary.progress} max={1} valueText={label} />}\n </Stack>;\n}\n\nexport type HistogramExplorerProps = Readonly<{\n label: string; samples: readonly (number | null)[]; binCounts: readonly number[]; binCount: number; onBinCountChange: (count: number) => void;\n domain?: readonly [number, number]; binLabel: (bin: HistogramBin) => string; binCountLabel: (count: number) => string;\n formatCount: (count: number) => string; missingLabel: string; summaryLabel: (histogram: ReturnType<typeof binHistogram>) => string;\n}>;\nexport function HistogramExplorer(props: HistogramExplorerProps) {\n if (!props.binCounts.length || !props.binCounts.includes(props.binCount) || new Set(props.binCounts).size !== props.binCounts.length) throw new RangeError(\"Histogram requires distinct choices including the selected bin count\");\n const variants = props.binCounts.map(count => binHistogram(props.samples, count, props.domain)), histogram = variants[props.binCounts.indexOf(props.binCount)]!;\n // Hold the y domain across rebinning. Normalizing each set to its tallest bar changes the meaning.\n const maximum = Math.max(...variants.map(variant => variant.maxCount));\n return <Stack gap=\"md\"><Text emphasis=\"strong\">{props.label}</Text>\n <SegmentedControl label={props.label} items={props.binCounts.map(count => ({ value: String(count), label: props.binCountLabel(count) }))} value={String(props.binCount)} onValueChange={value => props.onBinCountChange(Number(value))} />\n {histogram.observed ? <BarChart categories={histogram.bins.map(props.binLabel)} series={[{ id: \"frequency\", label: props.label, values: histogram.bins.map(bin => bin.count) }]}\n accessibilityLabel={props.label} formatValue={props.formatCount} missingLabel={props.missingLabel} domain={[0, maximum]} showValues /> : <Text style={{ textAlign: \"center\" }}>{props.missingLabel}</Text>}\n <Text role=\"status\">{props.summaryLabel(histogram)}</Text>\n </Stack>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../src/date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC9B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACpB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAY,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAErF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE/E,MAAM,MAAM,eAAe,CAAC,OAAO,GAAG,OAAO,IAAI,QAAQ,CAAC;IACxD,UAAU,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC1C,UAAU,EAAE,MAAM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 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import {} from "@hjmds/design-contracts/components/calendar";
3
- import { resolveDatePickerTriggerText, validateDatePickerDescriptor, } from "@hjmds/design-contracts/components/date-picker";
3
+ import { datePickerRecipe, resolveDatePickerTriggerText, validateDatePickerDescriptor, } from "@hjmds/design-contracts/components/date-picker";
4
4
  import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, } from "react";
5
+ import { IconButton } from "./actions.js";
5
6
  import { Calendar } from "./calendar.js";
7
+ import { Icon } from "./supplemental-display.js";
6
8
  import { classNames } from "./internal.js";
7
9
  const popoverViewportInset = 16;
8
10
  /** Single-date field with an anchored, focus-bearing calendar dialog. */
@@ -112,9 +114,9 @@ export function DatePicker({ descriptor, monthLabel, composeAccessibleName, prev
112
114
  if (open && dialogRef.current && !field.contains(document.activeElement))
113
115
  requestOpen(false, "blur");
114
116
  });
115
- }, "data-disabled": descriptor.disabled || undefined, "data-invalid": descriptor.invalid || error !== undefined || undefined, "data-size": size, children: [descriptor.label === undefined ? null : _jsx("span", { className: "hjm-date-picker__label", children: descriptor.label }), _jsxs("div", { className: "hjm-date-picker__anchor", children: [_jsxs("button", { "aria-controls": open ? dialogId : undefined, "aria-expanded": open, "aria-haspopup": "dialog", "aria-label": descriptor.accessibilityLabel ?? `${label}, ${triggerText}`, className: "hjm-date-picker__trigger", disabled: descriptor.disabled, onClick: () => !descriptor.readOnly && requestOpen(!open, "trigger"), ref: triggerRef, type: "button", children: [_jsx("span", { "aria-hidden": "true", children: "\u25A3" }), _jsx("span", { "data-placeholder": descriptor.displayValue === null || undefined, children: triggerText })] }), selectedDate === null ? null : (_jsx("button", { "aria-label": clearLabel, className: "hjm-date-picker__clear", disabled: descriptor.disabled || descriptor.readOnly, onClick: () => commit(null, "clear"), type: "button", children: "\u00D7" })), open ? (_jsxs("div", { "aria-label": label, className: "hjm-date-picker__popover", id: dialogId, ref: dialogRef, role: "dialog", onKeyDown: (event) => { if (event.key === "Escape") {
117
+ }, "data-disabled": descriptor.disabled || undefined, "data-invalid": descriptor.invalid || error !== undefined || undefined, "data-size": size, children: [descriptor.label === undefined ? null : _jsx("span", { className: "hjm-date-picker__label", children: descriptor.label }), _jsxs("div", { className: "hjm-date-picker__anchor", children: [_jsxs("button", { "aria-controls": open ? dialogId : undefined, "aria-expanded": open, "aria-haspopup": "dialog", "aria-label": descriptor.accessibilityLabel ?? `${label}, ${triggerText}`, className: "hjm-date-picker__trigger", disabled: descriptor.disabled, onClick: () => !descriptor.readOnly && requestOpen(!open, "trigger"), ref: triggerRef, type: "button", children: [_jsx(Icon, { name: "calendar", size: datePickerRecipe.sizes[size].glyph }), _jsx("span", { "data-placeholder": descriptor.displayValue === null || undefined, children: triggerText })] }), selectedDate === null ? null : (_jsx(IconButton, { label: clearLabel, tone: "ghost", className: "hjm-date-picker__clear", disabled: descriptor.disabled || descriptor.readOnly, onClick: () => commit(null, "clear"), children: _jsx(Icon, { name: "close" }) })), open ? (_jsxs("div", { "aria-label": label, className: "hjm-date-picker__popover", id: dialogId, ref: dialogRef, role: "dialog", onKeyDown: (event) => { if (event.key === "Escape") {
116
118
  event.preventDefault();
117
119
  requestOpen(false, "escape");
118
- } }, children: [_jsx("button", { "aria-label": closeLabel, className: "hjm-date-picker__calendar-close", onClick: () => requestOpen(false, "trigger"), type: "button", children: "\u00D7" }), _jsx(Calendar, { descriptor: { ...calendarDescriptor, grid: calendarGrid, monthLabel, selectedDate, onSelectionChange: (date) => commit(date, "activate") }, composeAccessibleName: composeAccessibleName, size: size, autoFocus: true, ...(previousMonth ? { previousMonth } : {}), ...(nextMonth ? { nextMonth } : {}), ...(renderCellContent ? { renderCellContent } : {}), ...(onNavigateBeyondGrid ? { onNavigateBeyondGrid } : {}) })] })) : null] }), description === undefined ? null : _jsx("span", { className: "hjm-date-picker__description", children: description }), error === undefined ? null : _jsx("span", { className: "hjm-date-picker__error", role: "alert", children: error })] }));
120
+ } }, children: [_jsx(IconButton, { label: closeLabel, tone: "ghost", className: "hjm-date-picker__calendar-close", onClick: () => requestOpen(false, "trigger"), children: _jsx(Icon, { name: "close" }) }), _jsx(Calendar, { descriptor: { ...calendarDescriptor, grid: calendarGrid, monthLabel, selectedDate, onSelectionChange: (date) => commit(date, "activate") }, composeAccessibleName: composeAccessibleName, size: size, autoFocus: true, ...(previousMonth ? { previousMonth } : {}), ...(nextMonth ? { nextMonth } : {}), ...(renderCellContent ? { renderCellContent } : {}), ...(onNavigateBeyondGrid ? { onNavigateBeyondGrid } : {}) })] })) : null] }), description === undefined ? null : _jsx("span", { className: "hjm-date-picker__description", children: description }), error === undefined ? null : _jsx("span", { className: "hjm-date-picker__error", role: "alert", children: error })] }));
119
121
  }
120
122
  //# sourceMappingURL=date-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../src/date-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGN,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAI7B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAA8C,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAsBhC,yEAAyE;AACzE,MAAM,UAAU,UAAU,CAAU,EAClC,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,GAAG,QAAQ,EACf,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,WAAW,GACc;IACzB,4BAA4B,CAAC,UAAU,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC,UAAU,CAAC,G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AC,8BAA8B,YAAE,WAAW,GAAQ,EACtG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,wBAAwB,EAAC,IAAI,EAAC,OAAO,YAAE,KAAK,GAAQ,IAC9F,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ComposeCalendarAccessibleName,\n type ResolvedCalendarDateCell,\n} from \"@hjmds/design-contracts/components/calendar\";\nimport {\n resolveDatePickerTriggerText,\n validateDatePickerDescriptor,\n type DatePickerDescriptor,\n type DatePickerOpenChangeReason,\n type DatePickerSize,\n} from \"@hjmds/design-contracts/components/date-picker\";\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport { Calendar, type CalendarOverflow, type CalendarHandle } from \"./calendar.js\";\nimport { classNames } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nconst popoverViewportInset = 16;\n\nexport type DatePickerMonthAction = Readonly<{ month: string; label: string }>;\n\nexport type DatePickerProps<Content = unknown> = Readonly<{\n descriptor: DatePickerDescriptor<Content>;\n monthLabel: string;\n composeAccessibleName: ComposeCalendarAccessibleName<Content>;\n previousMonth?: DatePickerMonthAction;\n nextMonth?: DatePickerMonthAction;\n clearLabel: string;\n closeLabel: string;\n size?: DatePickerSize;\n description?: ReactNode;\n error?: ReactNode;\n onNavigateBeyondGrid?: (detail: CalendarOverflow, focusDate: CalendarHandle[\"focusDate\"]) => void;\n renderCellContent?: (cell: ResolvedCalendarDateCell<Content>) => ReactNode;\n className?: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Single-date field with an anchored, focus-bearing calendar dialog. */\nexport function DatePicker<Content>({\n descriptor,\n monthLabel,\n composeAccessibleName,\n previousMonth,\n nextMonth,\n clearLabel,\n closeLabel,\n size = \"medium\",\n description,\n error,\n renderCellContent,\n onNavigateBeyondGrid,\n className,\n layoutStyle,\n}: DatePickerProps<Content>) {\n validateDatePickerDescriptor(descriptor);\n const generatedId = useId().replaceAll(\":\", \"\");\n const dialogId = `hjm-date-picker-${generatedId}`;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dialogRef = useRef<HTMLDivElement>(null);\n const controlledOpen = descriptor.open !== undefined;\n const [internalOpen, setInternalOpen] = useState(descriptor.defaultOpen ?? false);\n const open = controlledOpen ? descriptor.open === true : internalOpen;\n const controlledSelection = descriptor.selectedDate !== undefined;\n const [internalSelection, setInternalSelection] = useState(\n descriptor.defaultSelectedDate ?? null,\n );\n const selectedDate = controlledSelection ? descriptor.selectedDate ?? null : internalSelection;\n\n const closeReasonRef = useRef<DatePickerOpenChangeReason>(\"programmatic\");\n const requestOpen = useCallback((next: boolean, reason: DatePickerOpenChangeReason) => {\n closeReasonRef.current = next ? \"programmatic\" : reason;\n if (!controlledOpen) setInternalOpen(next);\n descriptor.onOpenChange?.(next, reason);\n }, [controlledOpen, descriptor.onOpenChange]);\n useEffect(() => {\n if (open && (descriptor.disabled || descriptor.readOnly)) requestOpen(false, \"programmatic\");\n }, [descriptor.disabled, descriptor.readOnly, open, requestOpen]);\n const commit = (date: string | null, reason: \"activate\" | \"clear\") => {\n // A controlled open field can become read-only while its grid remains mounted.\n if (descriptor.disabled || descriptor.readOnly) return;\n if (!controlledSelection) setInternalSelection(date);\n descriptor.onSelectionChange?.(date, reason);\n requestOpen(false, reason === \"activate\" ? \"selection\" : \"clear\");\n // Clearing a closed field removes the focused clear button without an open transition.\n if (reason === \"clear\") triggerRef.current?.focus();\n };\n\n const wasOpenRef = useRef(open);\n useEffect(() => {\n const wasOpen = wasOpenRef.current;\n wasOpenRef.current = open;\n if (!open) {\n // Outside/Tab dismissal keeps the user's new target; confirmation/Escape returns here.\n if (wasOpen && closeReasonRef.current !== \"outside\" && closeReasonRef.current !== \"blur\") triggerRef.current?.focus();\n return;\n }\n const outside = (event: PointerEvent) => {\n const target = event.target as Node;\n if (!dialogRef.current?.contains(target) && !triggerRef.current?.contains(target)) {\n requestOpen(false, \"outside\");\n }\n };\n document.addEventListener(\"pointerdown\", outside);\n return () => {\n document.removeEventListener(\"pointerdown\", outside);\n };\n }, [open, requestOpen]);\n\n // Keep the popover inside the viewport (2026-09-30 audit WR-0930-3): shift inline, flip up\n // when short. Not portaled: Calendar autoFocus runs before a portal popup is measured.\n useLayoutEffect(() => {\n const popover = dialogRef.current;\n if (!open || !popover) return;\n const place = () => {\n const viewport = window.visualViewport;\n const left = (viewport?.offsetLeft ?? 0) + popoverViewportInset;\n const right = (viewport?.offsetLeft ?? 0) + (viewport?.width ?? document.documentElement.clientWidth) - popoverViewportInset;\n // Layout offset, not translate: mobile Chromium widened the page for a translated box.\n popover.style.insetInlineStart = \"\";\n popover.style.maxInlineSize = `${Math.max(0, right - left)}px`;\n const rect = popover.getBoundingClientRect();\n let shift = rect.right > right ? Math.floor(right - rect.right) : 0;\n if (rect.left + shift < left) shift = Math.ceil(left - rect.left);\n const logical = getComputedStyle(popover).direction === \"rtl\" ? -shift : shift;\n popover.style.insetInlineStart = shift === 0 ? \"\" : `${logical}px`;\n popover.style.insetBlockStart = \"\";\n popover.style.insetBlockEnd = \"\";\n const box = popover.getBoundingClientRect();\n const bottom = (viewport?.offsetTop ?? 0) + (viewport?.height ?? window.innerHeight) - popoverViewportInset;\n const anchor = popover.parentElement?.getBoundingClientRect();\n if (anchor && box.bottom > bottom && anchor.top - box.height - popoverViewportInset >= (viewport?.offsetTop ?? 0)) {\n popover.style.insetBlockStart = \"auto\";\n popover.style.insetBlockEnd = \"calc(100% + var(--hjm-space-xs))\";\n }\n };\n place();\n window.addEventListener(\"resize\", place);\n window.visualViewport?.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"resize\", place);\n window.visualViewport?.removeEventListener(\"resize\", place);\n };\n }, [open]);\n\n // The outer field owns selection; the shared grid receives only its resolved controlled value.\n const { defaultSelectedDate: _defaultSelectedDate, ...calendarDescriptor } = descriptor;\n const calendarGrid = descriptor.disabled || descriptor.readOnly\n ? { ...descriptor.grid, cells: descriptor.grid.cells.map((cell) => cell.date ? { ...cell, disabled: true } : cell) }\n : descriptor.grid;\n const label = descriptor.label ?? descriptor.accessibilityLabel;\n const triggerText = resolveDatePickerTriggerText(descriptor);\n return (\n <div style={layoutStyle} className={classNames(\"hjm-date-picker\", className)} onBlur={(event) => {\n const field = event.currentTarget;\n queueMicrotask(() => {\n if (open && dialogRef.current && !field.contains(document.activeElement)) requestOpen(false, \"blur\");\n });\n }} data-disabled={descriptor.disabled || undefined} data-invalid={descriptor.invalid || error !== undefined || undefined} data-size={size}>\n {descriptor.label === undefined ? null : <span className=\"hjm-date-picker__label\">{descriptor.label}</span>}\n <div className=\"hjm-date-picker__anchor\">\n <button\n aria-controls={open ? dialogId : undefined}\n aria-expanded={open}\n aria-haspopup=\"dialog\"\n aria-label={descriptor.accessibilityLabel ?? `${label}, ${triggerText}`}\n className=\"hjm-date-picker__trigger\"\n disabled={descriptor.disabled}\n onClick={() => !descriptor.readOnly && requestOpen(!open, \"trigger\")}\n ref={triggerRef}\n type=\"button\"\n >\n <span aria-hidden=\"true\">▣</span>\n <span data-placeholder={descriptor.displayValue === null || undefined}>{triggerText}</span>\n </button>\n {selectedDate === null ? null : (\n <button aria-label={clearLabel} className=\"hjm-date-picker__clear\" disabled={descriptor.disabled || descriptor.readOnly} onClick={() => commit(null, \"clear\")} type=\"button\">×</button>\n )}\n {open ? (\n <div aria-label={label} className=\"hjm-date-picker__popover\" id={dialogId} ref={dialogRef} role=\"dialog\" onKeyDown={(event) => { if (event.key === \"Escape\") { event.preventDefault(); requestOpen(false, \"escape\"); } }}>\n <button aria-label={closeLabel} className=\"hjm-date-picker__calendar-close\" onClick={() => requestOpen(false, \"trigger\")} type=\"button\">×</button>\n <Calendar descriptor={{ ...calendarDescriptor, grid: calendarGrid, monthLabel, selectedDate, onSelectionChange: (date) => commit(date, \"activate\") }}\n composeAccessibleName={composeAccessibleName} size={size} autoFocus\n {...(previousMonth ? { previousMonth } : {})} {...(nextMonth ? { nextMonth } : {})}\n {...(renderCellContent ? { renderCellContent } : {})} {...(onNavigateBeyondGrid ? { onNavigateBeyondGrid } : {})} />\n </div>\n ) : null}\n </div>\n {description === undefined ? null : <span className=\"hjm-date-picker__description\">{description}</span>}\n {error === undefined ? null : <span className=\"hjm-date-picker__error\" role=\"alert\">{error}</span>}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../src/date-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGN,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,GAI7B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAA8C,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAsBhC,yEAAyE;AACzE,MAAM,UAAU,UAAU,CAAU,EAClC,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,GAAG,QAAQ,EACf,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,WAAW,GACc;IACzB,4BAA4B,CAAC,UAAU,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,mBAAmB,WAAW,EAAE,CAAC;IACl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,EAAE,CAAC,GAAI,IAClH,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,8BAA8B,YAAE,WAAW,GAAQ,EACtG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,wBAAwB,EAAC,IAAI,EAAC,OAAO,YAAE,KAAK,GAAQ,IAC9F,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ComposeCalendarAccessibleName,\n type ResolvedCalendarDateCell,\n} from \"@hjmds/design-contracts/components/calendar\";\nimport {\n datePickerRecipe,\n resolveDatePickerTriggerText,\n validateDatePickerDescriptor,\n type DatePickerDescriptor,\n type DatePickerOpenChangeReason,\n type DatePickerSize,\n} from \"@hjmds/design-contracts/components/date-picker\";\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport { IconButton } from \"./actions.js\";\nimport { Calendar, type CalendarOverflow, type CalendarHandle } from \"./calendar.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { classNames } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nconst popoverViewportInset = 16;\n\nexport type DatePickerMonthAction = Readonly<{ month: string; label: string }>;\n\nexport type DatePickerProps<Content = unknown> = Readonly<{\n descriptor: DatePickerDescriptor<Content>;\n monthLabel: string;\n composeAccessibleName: ComposeCalendarAccessibleName<Content>;\n previousMonth?: DatePickerMonthAction;\n nextMonth?: DatePickerMonthAction;\n clearLabel: string;\n closeLabel: string;\n size?: DatePickerSize;\n description?: ReactNode;\n error?: ReactNode;\n onNavigateBeyondGrid?: (detail: CalendarOverflow, focusDate: CalendarHandle[\"focusDate\"]) => void;\n renderCellContent?: (cell: ResolvedCalendarDateCell<Content>) => ReactNode;\n className?: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Single-date field with an anchored, focus-bearing calendar dialog. */\nexport function DatePicker<Content>({\n descriptor,\n monthLabel,\n composeAccessibleName,\n previousMonth,\n nextMonth,\n clearLabel,\n closeLabel,\n size = \"medium\",\n description,\n error,\n renderCellContent,\n onNavigateBeyondGrid,\n className,\n layoutStyle,\n}: DatePickerProps<Content>) {\n validateDatePickerDescriptor(descriptor);\n const generatedId = useId().replaceAll(\":\", \"\");\n const dialogId = `hjm-date-picker-${generatedId}`;\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dialogRef = useRef<HTMLDivElement>(null);\n const controlledOpen = descriptor.open !== undefined;\n const [internalOpen, setInternalOpen] = useState(descriptor.defaultOpen ?? false);\n const open = controlledOpen ? descriptor.open === true : internalOpen;\n const controlledSelection = descriptor.selectedDate !== undefined;\n const [internalSelection, setInternalSelection] = useState(\n descriptor.defaultSelectedDate ?? null,\n );\n const selectedDate = controlledSelection ? descriptor.selectedDate ?? null : internalSelection;\n\n const closeReasonRef = useRef<DatePickerOpenChangeReason>(\"programmatic\");\n const requestOpen = useCallback((next: boolean, reason: DatePickerOpenChangeReason) => {\n closeReasonRef.current = next ? \"programmatic\" : reason;\n if (!controlledOpen) setInternalOpen(next);\n descriptor.onOpenChange?.(next, reason);\n }, [controlledOpen, descriptor.onOpenChange]);\n useEffect(() => {\n if (open && (descriptor.disabled || descriptor.readOnly)) requestOpen(false, \"programmatic\");\n }, [descriptor.disabled, descriptor.readOnly, open, requestOpen]);\n const commit = (date: string | null, reason: \"activate\" | \"clear\") => {\n // A controlled open field can become read-only while its grid remains mounted.\n if (descriptor.disabled || descriptor.readOnly) return;\n if (!controlledSelection) setInternalSelection(date);\n descriptor.onSelectionChange?.(date, reason);\n requestOpen(false, reason === \"activate\" ? \"selection\" : \"clear\");\n // Clearing a closed field removes the focused clear button without an open transition.\n if (reason === \"clear\") triggerRef.current?.focus();\n };\n\n const wasOpenRef = useRef(open);\n useEffect(() => {\n const wasOpen = wasOpenRef.current;\n wasOpenRef.current = open;\n if (!open) {\n // Outside/Tab dismissal keeps the user's new target; confirmation/Escape returns here.\n if (wasOpen && closeReasonRef.current !== \"outside\" && closeReasonRef.current !== \"blur\") triggerRef.current?.focus();\n return;\n }\n const outside = (event: PointerEvent) => {\n const target = event.target as Node;\n if (!dialogRef.current?.contains(target) && !triggerRef.current?.contains(target)) {\n requestOpen(false, \"outside\");\n }\n };\n document.addEventListener(\"pointerdown\", outside);\n return () => {\n document.removeEventListener(\"pointerdown\", outside);\n };\n }, [open, requestOpen]);\n\n // Keep the popover inside the viewport (2026-09-30 audit WR-0930-3): shift inline, flip up\n // when short. Not portaled: Calendar autoFocus runs before a portal popup is measured.\n useLayoutEffect(() => {\n const popover = dialogRef.current;\n if (!open || !popover) return;\n const place = () => {\n const viewport = window.visualViewport;\n const left = (viewport?.offsetLeft ?? 0) + popoverViewportInset;\n const right = (viewport?.offsetLeft ?? 0) + (viewport?.width ?? document.documentElement.clientWidth) - popoverViewportInset;\n // Layout offset, not translate: mobile Chromium widened the page for a translated box.\n popover.style.insetInlineStart = \"\";\n popover.style.maxInlineSize = `${Math.max(0, right - left)}px`;\n const rect = popover.getBoundingClientRect();\n let shift = rect.right > right ? Math.floor(right - rect.right) : 0;\n if (rect.left + shift < left) shift = Math.ceil(left - rect.left);\n const logical = getComputedStyle(popover).direction === \"rtl\" ? -shift : shift;\n popover.style.insetInlineStart = shift === 0 ? \"\" : `${logical}px`;\n popover.style.insetBlockStart = \"\";\n popover.style.insetBlockEnd = \"\";\n const box = popover.getBoundingClientRect();\n const bottom = (viewport?.offsetTop ?? 0) + (viewport?.height ?? window.innerHeight) - popoverViewportInset;\n const anchor = popover.parentElement?.getBoundingClientRect();\n if (anchor && box.bottom > bottom && anchor.top - box.height - popoverViewportInset >= (viewport?.offsetTop ?? 0)) {\n popover.style.insetBlockStart = \"auto\";\n popover.style.insetBlockEnd = \"calc(100% + var(--hjm-space-xs))\";\n }\n };\n place();\n window.addEventListener(\"resize\", place);\n window.visualViewport?.addEventListener(\"resize\", place);\n return () => {\n window.removeEventListener(\"resize\", place);\n window.visualViewport?.removeEventListener(\"resize\", place);\n };\n }, [open]);\n\n // The outer field owns selection; the shared grid receives only its resolved controlled value.\n const { defaultSelectedDate: _defaultSelectedDate, ...calendarDescriptor } = descriptor;\n const calendarGrid = descriptor.disabled || descriptor.readOnly\n ? { ...descriptor.grid, cells: descriptor.grid.cells.map((cell) => cell.date ? { ...cell, disabled: true } : cell) }\n : descriptor.grid;\n const label = descriptor.label ?? descriptor.accessibilityLabel;\n const triggerText = resolveDatePickerTriggerText(descriptor);\n return (\n <div style={layoutStyle} className={classNames(\"hjm-date-picker\", className)} onBlur={(event) => {\n const field = event.currentTarget;\n queueMicrotask(() => {\n if (open && dialogRef.current && !field.contains(document.activeElement)) requestOpen(false, \"blur\");\n });\n }} data-disabled={descriptor.disabled || undefined} data-invalid={descriptor.invalid || error !== undefined || undefined} data-size={size}>\n {descriptor.label === undefined ? null : <span className=\"hjm-date-picker__label\">{descriptor.label}</span>}\n <div className=\"hjm-date-picker__anchor\">\n <button\n aria-controls={open ? dialogId : undefined}\n aria-expanded={open}\n aria-haspopup=\"dialog\"\n aria-label={descriptor.accessibilityLabel ?? `${label}, ${triggerText}`}\n className=\"hjm-date-picker__trigger\"\n disabled={descriptor.disabled}\n onClick={() => !descriptor.readOnly && requestOpen(!open, \"trigger\")}\n ref={triggerRef}\n type=\"button\"\n >\n <Icon name=\"calendar\" size={datePickerRecipe.sizes[size].glyph} />\n <span data-placeholder={descriptor.displayValue === null || undefined}>{triggerText}</span>\n </button>\n {selectedDate === null ? null : (\n <IconButton label={clearLabel} tone=\"ghost\" className=\"hjm-date-picker__clear\" disabled={descriptor.disabled || descriptor.readOnly} onClick={() => commit(null, \"clear\")}><Icon name=\"close\" /></IconButton>\n )}\n {open ? (\n <div aria-label={label} className=\"hjm-date-picker__popover\" id={dialogId} ref={dialogRef} role=\"dialog\" onKeyDown={(event) => { if (event.key === \"Escape\") { event.preventDefault(); requestOpen(false, \"escape\"); } }}>\n <IconButton label={closeLabel} tone=\"ghost\" className=\"hjm-date-picker__calendar-close\" onClick={() => requestOpen(false, \"trigger\")}><Icon name=\"close\" /></IconButton>\n <Calendar descriptor={{ ...calendarDescriptor, grid: calendarGrid, monthLabel, selectedDate, onSelectionChange: (date) => commit(date, \"activate\") }}\n composeAccessibleName={composeAccessibleName} size={size} autoFocus\n {...(previousMonth ? { previousMonth } : {})} {...(nextMonth ? { nextMonth } : {})}\n {...(renderCellContent ? { renderCellContent } : {})} {...(onNavigateBeyondGrid ? { onNavigateBeyondGrid } : {})} />\n </div>\n ) : null}\n </div>\n {description === undefined ? null : <span className=\"hjm-date-picker__description\">{description}</span>}\n {error === undefined ? null : <span className=\"hjm-date-picker__error\" role=\"alert\">{error}</span>}\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"design-profile.d.ts","sourceRoot":"","sources":["../src/design-profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC;IAC/E,KAAK,EAAE,SAAS,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,EAAE,CAAC;IAChE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;CACnE,CAAC,CAAC;AAEH;;sFAEsF;AACtF,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,GAAG,MAAM,EAAE,EAAE,mBAAmB,+BAqBhL"}
1
+ {"version":3,"file":"design-profile.d.ts","sourceRoot":"","sources":["../src/design-profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAOpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC;IAC/E,KAAK,EAAE,SAAS,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,EAAE,CAAC;IAChE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;CACnE,CAAC,CAAC;AAEH;;sFAEsF;AACtF,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,GAAG,MAAM,EAAE,EAAE,mBAAmB,+BA8BhL"}
@@ -5,7 +5,8 @@ import { Collapsible } from "./collapsible.js";
5
5
  import { EffectSurface } from "./effect-surface.js";
6
6
  import { Grid, Stack, Surface } from "./layout.js";
7
7
  import { useHjmTheme } from "./provider.js";
8
- import { resolveDesignProfileCollection } from "@hjmds/design-contracts/design-profile-layout";
8
+ import { resolveDesignProfileCollection, resolveDesignProfileCollectionItem, overviewContentLayout } from "@hjmds/design-contracts/design-profile-layout";
9
+ import { Divider } from "./advanced-display.js";
9
10
  /** Optional collection screen; ScreenLayout still owns loading/error/scrolling.
10
11
  * Unlike settings/inbox it owns a profile-selected collection and persistent tools.
11
12
  * It never owns product mutations or chooses a different component for each theme. */
@@ -21,7 +22,8 @@ export function OverviewScreen({ items, toolbar, toolbarLabel, collection: suppl
21
22
  throw new TypeError("Overview items need unique stable ids");
22
23
  // Retain the same effect/grid/surface subtree when the profile changes: optional
23
24
  // decoration can disappear without remounting fields, focus or local state.
25
+ const itemLayout = resolveDesignProfileCollectionItem(collection);
24
26
  const canvas = designProfile?.material.canvas ?? { layers: ["mesh"], intensity: 0, active: false };
25
- return _jsx(EffectSurface, { descriptor: canvas, layoutStyle: { width: "100%" }, children: _jsx(ScreenLayout, { ...screen, children: _jsxs(Stack, { gap: "xl", children: [toolbar ? _jsx(Collapsible, { trigger: toolbarLabel, open: toolsOpen, onOpenChange: setToolsOpen, presentation: toolbarPresentation === "inline" ? "inline" : "disclosure", keepMounted: true, children: toolbar }) : null, _jsx(Grid, { ...resolveDesignProfileCollection(collection), children: items.map(item => _jsx(Surface, { padding: collection === "rows" ? "md" : "xl", tone: collection === "rows" ? "default" : "raised", bordered: true, radius: "lg", children: _jsx(EffectSurface, { descriptor: designProfile?.material.card ?? { layers: ["mesh"], intensity: 0, active: false }, className: "hjm-profile-card-effect", children: item.children }) }, item.id)) })] }) }) });
27
+ return _jsx(EffectSurface, { descriptor: canvas, radius: "none", layoutStyle: { width: "100%" }, children: _jsx(ScreenLayout, { ...screen, children: _jsxs(Stack, { gap: "xl", layoutStyle: { ...overviewContentLayout, marginInline: "auto" }, children: [toolbar ? _jsx(Collapsible, { trigger: toolbarLabel, open: toolsOpen, onOpenChange: setToolsOpen, presentation: toolbarPresentation === "inline" ? "inline" : "disclosure", keepMounted: true, children: toolbar }) : null, _jsx(Grid, { ...resolveDesignProfileCollection(collection), children: items.map((item, index) => _jsxs(Surface, { padding: itemLayout.padding, tone: itemLayout.tone, bordered: itemLayout.bordered, radius: "lg", children: [itemLayout.ruled && index > 0 ? _jsx(Divider, { decorative: true, layoutStyle: { marginBottom: itemLayout.ruleGap } }) : null, _jsx(EffectSurface, { radius: "none", descriptor: designProfile?.material.card ?? { layers: ["mesh"], intensity: 0, active: false }, className: "hjm-profile-card-effect", children: item.children })] }, item.id)) })] }) }) });
26
28
  }
27
29
  //# sourceMappingURL=design-profile.js.map