@datatechsolutions/tympan 0.3.0 → 0.4.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 (1566) hide show
  1. package/README.md +22 -4
  2. package/dist/{Avatar-P14MVkK1.js → Avatar-CU7B1WsX.js} +61 -1
  3. package/dist/{Avatar-P14MVkK1.js.map → Avatar-CU7B1WsX.js.map} +1 -1
  4. package/dist/avatars.js +1 -1
  5. package/dist/elements-DCGBSGS8.js +14699 -0
  6. package/dist/elements-DCGBSGS8.js.map +1 -0
  7. package/dist/elements-react.d.ts +1378 -0
  8. package/dist/elements-react.js +3639 -0
  9. package/dist/elements-react.js.map +1 -0
  10. package/dist/elements.bundle.js +5 -0
  11. package/dist/elements.d.ts +13520 -0
  12. package/dist/elements.js +3 -0
  13. package/dist/flow.css +174 -3
  14. package/dist/flow.d.ts +86 -4
  15. package/dist/flow.js +200 -11
  16. package/dist/flow.js.map +1 -1
  17. package/dist/{index-C3WAwKdm.d.ts → index-J-7EBkCL.d.ts} +175 -7
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +3 -3
  20. package/dist/parse-Dq4x3Wet.js +345 -0
  21. package/dist/parse-Dq4x3Wet.js.map +1 -0
  22. package/dist/{src-Ds9ArSaP.js → src-uCyIE-Te.js} +859 -668
  23. package/dist/src-uCyIE-Te.js.map +1 -0
  24. package/dist/styles.css +6937 -2592
  25. package/docs/html-contract.md +644 -0
  26. package/package.json +25 -14
  27. package/src/avatars/GeneratedAvatar.tsx +41 -0
  28. package/src/avatars/avatarSvg.ts +252 -0
  29. package/src/avatars/avatars.test.tsx +268 -0
  30. package/src/avatars/index.ts +30 -0
  31. package/src/avatars/styles.ts +80 -0
  32. package/src/base.css +49 -0
  33. package/src/components/action-menu/ActionMenu.css +152 -0
  34. package/src/components/action-menu/ActionMenu.test.tsx +189 -0
  35. package/src/components/action-menu/ActionMenu.tsx +282 -0
  36. package/src/components/activity-feed/ActivityFeed.css +91 -0
  37. package/src/components/activity-feed/ActivityFeed.test.tsx +89 -0
  38. package/src/components/activity-feed/ActivityFeed.tsx +86 -0
  39. package/src/components/actor-chip/ActorChip.css +93 -0
  40. package/src/components/actor-chip/ActorChip.test.tsx +89 -0
  41. package/src/components/actor-chip/ActorChip.tsx +98 -0
  42. package/src/components/agent-output-card/AgentOutputCard.css +105 -0
  43. package/src/components/agent-output-card/AgentOutputCard.rtl.test.tsx +12 -0
  44. package/src/components/agent-output-card/AgentOutputCard.test.tsx +65 -0
  45. package/src/components/agent-output-card/AgentOutputCard.tsx +74 -0
  46. package/src/components/ambient-backdrop/AmbientBackdrop.css +45 -0
  47. package/src/components/ambient-backdrop/AmbientBackdrop.rtl.test.tsx +12 -0
  48. package/src/components/ambient-backdrop/AmbientBackdrop.test.tsx +60 -0
  49. package/src/components/ambient-backdrop/AmbientBackdrop.tsx +11 -0
  50. package/src/components/app-frame/AppFrame.css +285 -0
  51. package/src/components/app-frame/AppFrame.test.tsx +127 -0
  52. package/src/components/app-frame/AppFrame.tsx +231 -0
  53. package/src/components/app-frame/AppFrameRail.css +321 -0
  54. package/src/components/app-frame/RailFrame.test.tsx +159 -0
  55. package/src/components/app-frame/RailFrame.tsx +140 -0
  56. package/src/components/app-frame/RailNav.tsx +118 -0
  57. package/src/components/app-frame/frameContext.ts +22 -0
  58. package/src/components/app-launcher-grid/AppLauncherGrid.css +140 -0
  59. package/src/components/app-launcher-grid/AppLauncherGrid.test.tsx +103 -0
  60. package/src/components/app-launcher-grid/AppLauncherGrid.tsx +201 -0
  61. package/src/components/app-navigation/AppNavigation.css +354 -0
  62. package/src/components/app-navigation/AppNavigation.test.tsx +129 -0
  63. package/src/components/app-navigation/AppNavigation.tsx +372 -0
  64. package/src/components/app-navigation/builders.ts +117 -0
  65. package/src/components/attention-list/AttentionList.css +90 -0
  66. package/src/components/attention-list/AttentionList.test.tsx +84 -0
  67. package/src/components/attention-list/AttentionList.tsx +82 -0
  68. package/src/components/auth-frame/AuthFrame.css +85 -0
  69. package/src/components/auth-frame/AuthFrame.rtl.test.tsx +14 -0
  70. package/src/components/auth-frame/AuthFrame.test.tsx +89 -0
  71. package/src/components/auth-frame/AuthFrame.tsx +35 -0
  72. package/src/components/avatar/Avatar.css +134 -0
  73. package/src/components/avatar/Avatar.test.tsx +98 -0
  74. package/src/components/avatar/Avatar.tsx +114 -0
  75. package/src/components/brand-loader/BrandLoader.css +78 -0
  76. package/src/components/brand-loader/BrandLoader.rtl.test.tsx +13 -0
  77. package/src/components/brand-loader/BrandLoader.test.tsx +83 -0
  78. package/src/components/brand-loader/BrandLoader.tsx +34 -0
  79. package/src/components/brand-mark/BrandMark.css +60 -0
  80. package/src/components/brand-mark/BrandMark.rtl.test.tsx +16 -0
  81. package/src/components/brand-mark/BrandMark.test.tsx +60 -0
  82. package/src/components/brand-mark/BrandMark.tsx +76 -0
  83. package/src/components/brand-panel/BrandPanel.css +100 -0
  84. package/src/components/brand-panel/BrandPanel.rtl.test.tsx +13 -0
  85. package/src/components/brand-panel/BrandPanel.test.tsx +59 -0
  86. package/src/components/brand-panel/BrandPanel.tsx +61 -0
  87. package/src/components/brand-wordmark/BrandWordmark.css +37 -0
  88. package/src/components/breadcrumbs/Breadcrumbs.css +158 -0
  89. package/src/components/breadcrumbs/Breadcrumbs.test.tsx +104 -0
  90. package/src/components/breadcrumbs/Breadcrumbs.tsx +130 -0
  91. package/src/components/button/Button.css +214 -0
  92. package/src/components/button/Button.test.tsx +177 -0
  93. package/src/components/button/Button.tsx +205 -0
  94. package/src/components/calendar/Calendar.css +260 -0
  95. package/src/components/calendar/Calendar.test.tsx +178 -0
  96. package/src/components/calendar/Calendar.tsx +341 -0
  97. package/src/components/cascade-grid/CascadeGrid.css +31 -0
  98. package/src/components/cascade-grid/CascadeGrid.rtl.test.tsx +20 -0
  99. package/src/components/cascade-grid/CascadeGrid.test.tsx +126 -0
  100. package/src/components/cascade-grid/CascadeGrid.tsx +98 -0
  101. package/src/components/category-tabs/CategoryTabs.css +108 -0
  102. package/src/components/category-tabs/CategoryTabs.test.tsx +118 -0
  103. package/src/components/category-tabs/CategoryTabs.tsx +94 -0
  104. package/src/components/chart/Chart.css +215 -0
  105. package/src/components/chart/Chart.rtl.test.tsx +42 -0
  106. package/src/components/chart/Chart.test.tsx +187 -0
  107. package/src/components/chart/Chart.tsx +502 -0
  108. package/src/components/chart/chartMath.ts +73 -0
  109. package/src/components/chart/plot.ts +53 -0
  110. package/src/components/chart/types.ts +72 -0
  111. package/src/components/checkbox/Checkbox.css +168 -0
  112. package/src/components/checkbox/Checkbox.test.tsx +97 -0
  113. package/src/components/checkbox/Checkbox.tsx +168 -0
  114. package/src/components/chip-group/ChipGroup.css +182 -0
  115. package/src/components/chip-group/ChipGroup.test.tsx +135 -0
  116. package/src/components/chip-group/ChipGroup.tsx +169 -0
  117. package/src/components/choice-card/ChoiceCard.css +141 -0
  118. package/src/components/choice-card/ChoiceCard.test.tsx +111 -0
  119. package/src/components/choice-card/ChoiceCard.tsx +139 -0
  120. package/src/components/choice-grid/ChoiceGrid.css +110 -0
  121. package/src/components/choice-grid/ChoiceGrid.test.tsx +85 -0
  122. package/src/components/choice-grid/ChoiceGrid.tsx +85 -0
  123. package/src/components/choice-tile/ChoiceTile.css +79 -0
  124. package/src/components/choice-tile/ChoiceTile.test.tsx +118 -0
  125. package/src/components/choice-tile/ChoiceTile.tsx +57 -0
  126. package/src/components/command-palette/CommandPalette.css +296 -0
  127. package/src/components/command-palette/CommandPalette.test.tsx +190 -0
  128. package/src/components/command-palette/CommandPalette.tsx +340 -0
  129. package/src/components/command-palette/model.ts +156 -0
  130. package/src/components/compact-confirm/CompactConfirm.css +136 -0
  131. package/src/components/compact-confirm/CompactConfirm.test.tsx +119 -0
  132. package/src/components/compact-confirm/CompactConfirm.tsx +91 -0
  133. package/src/components/confirm-service/ConfirmService.test.tsx +121 -0
  134. package/src/components/confirm-service/ConfirmService.tsx +152 -0
  135. package/src/components/consent-banner/ConsentBanner.css +73 -0
  136. package/src/components/consent-banner/ConsentBanner.rtl.test.tsx +12 -0
  137. package/src/components/consent-banner/ConsentBanner.test.tsx +86 -0
  138. package/src/components/consent-banner/ConsentBanner.tsx +66 -0
  139. package/src/components/contact-card/ContactCard.css +105 -0
  140. package/src/components/contact-card/ContactCard.rtl.test.tsx +17 -0
  141. package/src/components/contact-card/ContactCard.test.tsx +58 -0
  142. package/src/components/contact-card/ContactCard.tsx +99 -0
  143. package/src/components/copy-identifier/CopyIdentifier.css +90 -0
  144. package/src/components/copy-identifier/CopyIdentifier.test.tsx +103 -0
  145. package/src/components/copy-identifier/CopyIdentifier.tsx +89 -0
  146. package/src/components/count-badge/CountBadge.css +54 -0
  147. package/src/components/count-badge/CountBadge.test.tsx +81 -0
  148. package/src/components/count-badge/CountBadge.tsx +68 -0
  149. package/src/components/currency-field/CurrencyField.css +88 -0
  150. package/src/components/currency-field/CurrencyField.test.tsx +147 -0
  151. package/src/components/currency-field/CurrencyField.tsx +219 -0
  152. package/src/components/data-table/DataTable.css +362 -0
  153. package/src/components/data-table/DataTable.test.tsx +214 -0
  154. package/src/components/data-table/DataTable.tsx +396 -0
  155. package/src/components/date-field/DateField.css +126 -0
  156. package/src/components/date-field/DateField.test.tsx +143 -0
  157. package/src/components/date-field/DateField.tsx +235 -0
  158. package/src/components/date-range-field/DateRangeField.css +140 -0
  159. package/src/components/date-range-field/DateRangeField.test.tsx +187 -0
  160. package/src/components/date-range-field/DateRangeField.tsx +231 -0
  161. package/src/components/delta-indicator/DeltaIndicator.css +58 -0
  162. package/src/components/delta-indicator/DeltaIndicator.rtl.test.tsx +19 -0
  163. package/src/components/delta-indicator/DeltaIndicator.test.tsx +69 -0
  164. package/src/components/delta-indicator/DeltaIndicator.tsx +88 -0
  165. package/src/components/details-popover/DetailsPopover.css +166 -0
  166. package/src/components/details-popover/DetailsPopover.test.tsx +92 -0
  167. package/src/components/details-popover/DetailsPopover.tsx +141 -0
  168. package/src/components/drawer/Drawer.css +188 -0
  169. package/src/components/drawer/Drawer.test.tsx +152 -0
  170. package/src/components/drawer/Drawer.tsx +121 -0
  171. package/src/components/edge-swipe-back/EdgeSwipeBack.css +66 -0
  172. package/src/components/edge-swipe-back/EdgeSwipeBack.rtl.test.tsx +17 -0
  173. package/src/components/edge-swipe-back/EdgeSwipeBack.test.tsx +86 -0
  174. package/src/components/edge-swipe-back/EdgeSwipeBack.tsx +104 -0
  175. package/src/components/empty-state/EmptyState.css +70 -0
  176. package/src/components/empty-state/EmptyState.test.tsx +77 -0
  177. package/src/components/empty-state/EmptyState.tsx +105 -0
  178. package/src/components/environment-banner/EnvironmentBanner.css +46 -0
  179. package/src/components/environment-banner/EnvironmentBanner.rtl.test.tsx +13 -0
  180. package/src/components/environment-banner/EnvironmentBanner.test.tsx +51 -0
  181. package/src/components/environment-banner/EnvironmentBanner.tsx +75 -0
  182. package/src/components/error-state/ErrorState.css +113 -0
  183. package/src/components/error-state/ErrorState.test.tsx +98 -0
  184. package/src/components/error-state/ErrorState.tsx +145 -0
  185. package/src/components/evidence-panel/EvidencePanel.css +126 -0
  186. package/src/components/evidence-panel/EvidencePanel.test.tsx +130 -0
  187. package/src/components/evidence-panel/EvidencePanel.tsx +120 -0
  188. package/src/components/feature-showcase-card/FeatureShowcaseCard.css +136 -0
  189. package/src/components/feature-showcase-card/FeatureShowcaseCard.rtl.test.tsx +13 -0
  190. package/src/components/feature-showcase-card/FeatureShowcaseCard.test.tsx +91 -0
  191. package/src/components/feature-showcase-card/FeatureShowcaseCard.tsx +76 -0
  192. package/src/components/feature-tile/FeatureTile.css +111 -0
  193. package/src/components/feature-tile/FeatureTile.rtl.test.tsx +14 -0
  194. package/src/components/feature-tile/FeatureTile.test.tsx +78 -0
  195. package/src/components/feature-tile/FeatureTile.tsx +52 -0
  196. package/src/components/federated-sign-in/FederatedSignIn.css +23 -0
  197. package/src/components/federated-sign-in/FederatedSignIn.rtl.test.tsx +12 -0
  198. package/src/components/federated-sign-in/FederatedSignIn.test.tsx +74 -0
  199. package/src/components/federated-sign-in/FederatedSignIn.tsx +68 -0
  200. package/src/components/field/Field.css +99 -0
  201. package/src/components/field/Field.test.tsx +134 -0
  202. package/src/components/field/Field.tsx +228 -0
  203. package/src/components/filter-chips/FilterChips.css +145 -0
  204. package/src/components/filter-chips/FilterChips.test.tsx +121 -0
  205. package/src/components/filter-chips/FilterChips.tsx +134 -0
  206. package/src/components/filter-field/FilterField.css +11 -0
  207. package/src/components/filter-field/FilterField.test.tsx +92 -0
  208. package/src/components/filter-field/FilterField.tsx +43 -0
  209. package/src/components/filter-tile/FilterTile.css +145 -0
  210. package/src/components/filter-tile/FilterTile.test.tsx +69 -0
  211. package/src/components/filter-tile/FilterTile.tsx +87 -0
  212. package/src/components/flag-set-picker/FlagSetPicker.css +32 -0
  213. package/src/components/flag-set-picker/FlagSetPicker.test.tsx +75 -0
  214. package/src/components/flag-set-picker/FlagSetPicker.tsx +92 -0
  215. package/src/components/floating-action-bar/FloatingActionBar.css +375 -0
  216. package/src/components/floating-action-bar/FloatingActionBar.test.tsx +309 -0
  217. package/src/components/floating-action-bar/FloatingActionBar.tsx +655 -0
  218. package/src/components/floating-action-bar/barModel.ts +147 -0
  219. package/src/components/floating-action-button/FloatingActionButton.css +54 -0
  220. package/src/components/floating-action-button/FloatingActionButton.test.tsx +87 -0
  221. package/src/components/floating-action-button/FloatingActionButton.tsx +87 -0
  222. package/src/components/form-actions/FormActions.css +34 -0
  223. package/src/components/form-actions/FormActions.test.tsx +96 -0
  224. package/src/components/form-actions/FormActions.tsx +83 -0
  225. package/src/components/form-layout/FormLayout.css +148 -0
  226. package/src/components/form-layout/FormLayout.test.tsx +137 -0
  227. package/src/components/form-layout/FormLayout.tsx +177 -0
  228. package/src/components/glass-check-toggle/GlassCheckToggle.css +92 -0
  229. package/src/components/glass-check-toggle/GlassCheckToggle.rtl.test.tsx +12 -0
  230. package/src/components/glass-check-toggle/GlassCheckToggle.test.tsx +70 -0
  231. package/src/components/glass-check-toggle/GlassCheckToggle.tsx +75 -0
  232. package/src/components/gradient-mark/GradientMark.css +45 -0
  233. package/src/components/grouped-disclosure-list/GroupedDisclosureList.css +80 -0
  234. package/src/components/grouped-disclosure-list/GroupedDisclosureList.test.tsx +92 -0
  235. package/src/components/grouped-disclosure-list/GroupedDisclosureList.tsx +105 -0
  236. package/src/components/heading/Heading.css +67 -0
  237. package/src/components/heading/Heading.test.tsx +93 -0
  238. package/src/components/heading/Heading.tsx +60 -0
  239. package/src/components/highlight-stat/HighlightStat.css +50 -0
  240. package/src/components/highlight-stat/HighlightStat.rtl.test.tsx +13 -0
  241. package/src/components/highlight-stat/HighlightStat.test.tsx +83 -0
  242. package/src/components/highlight-stat/HighlightStat.tsx +66 -0
  243. package/src/components/history-list/HistoryList.css +116 -0
  244. package/src/components/history-list/HistoryList.test.tsx +88 -0
  245. package/src/components/history-list/HistoryList.tsx +115 -0
  246. package/src/components/http-error-page/HttpErrorPage.css +70 -0
  247. package/src/components/http-error-page/HttpErrorPage.rtl.test.tsx +12 -0
  248. package/src/components/http-error-page/HttpErrorPage.test.tsx +51 -0
  249. package/src/components/http-error-page/HttpErrorPage.tsx +70 -0
  250. package/src/components/image-picker/ImagePicker.css +151 -0
  251. package/src/components/image-picker/ImagePicker.test.tsx +133 -0
  252. package/src/components/image-picker/ImagePicker.tsx +167 -0
  253. package/src/components/inline-notice/InlineNotice.css +101 -0
  254. package/src/components/inline-notice/InlineNotice.test.tsx +123 -0
  255. package/src/components/inline-notice/InlineNotice.tsx +98 -0
  256. package/src/components/insight-card/InsightCard.css +109 -0
  257. package/src/components/insight-card/InsightCard.rtl.test.tsx +14 -0
  258. package/src/components/insight-card/InsightCard.test.tsx +102 -0
  259. package/src/components/insight-card/InsightCard.tsx +185 -0
  260. package/src/components/legal-document-frame/LegalDocumentFrame.css +163 -0
  261. package/src/components/legal-document-frame/LegalDocumentFrame.rtl.test.tsx +13 -0
  262. package/src/components/legal-document-frame/LegalDocumentFrame.test.tsx +123 -0
  263. package/src/components/legal-document-frame/LegalDocumentFrame.tsx +167 -0
  264. package/src/components/link/Link.css +76 -0
  265. package/src/components/link/Link.test.tsx +103 -0
  266. package/src/components/link/Link.tsx +87 -0
  267. package/src/components/list-panel/ListPanel.css +95 -0
  268. package/src/components/list-panel/ListPanel.test.tsx +128 -0
  269. package/src/components/list-panel/ListPanel.tsx +137 -0
  270. package/src/components/list-row/ListRow.css +81 -0
  271. package/src/components/list-row/ListRow.test.tsx +87 -0
  272. package/src/components/list-row/ListRow.tsx +68 -0
  273. package/src/components/listbox-select/ListboxSelect.css +263 -0
  274. package/src/components/listbox-select/ListboxSelect.test.tsx +157 -0
  275. package/src/components/listbox-select/ListboxSelect.tsx +178 -0
  276. package/src/components/live-report-view/LiveReportView.css +111 -0
  277. package/src/components/live-report-view/LiveReportView.rtl.test.tsx +14 -0
  278. package/src/components/live-report-view/LiveReportView.test.tsx +185 -0
  279. package/src/components/live-report-view/LiveReportView.tsx +135 -0
  280. package/src/components/live-report-view/runEvents.ts +103 -0
  281. package/src/components/live-report-view/useRunEventStream.ts +134 -0
  282. package/src/components/loader-presets/LoaderPresets.test.tsx +22 -0
  283. package/src/components/loader-presets/LoaderPresets.tsx +80 -0
  284. package/src/components/locale-picker/LocalePicker.css +91 -0
  285. package/src/components/locale-picker/LocalePicker.test.tsx +99 -0
  286. package/src/components/locale-picker/LocalePicker.tsx +128 -0
  287. package/src/components/long-press-menu/LongPressMenu.css +97 -0
  288. package/src/components/long-press-menu/LongPressMenu.test.tsx +106 -0
  289. package/src/components/long-press-menu/LongPressMenu.tsx +100 -0
  290. package/src/components/markdown-view/MarkdownView.css +93 -0
  291. package/src/components/markdown-view/MarkdownView.test.tsx +107 -0
  292. package/src/components/markdown-view/MarkdownView.tsx +96 -0
  293. package/src/components/markdown-view/parse.ts +152 -0
  294. package/src/components/metric-tile/MetricTile.css +104 -0
  295. package/src/components/metric-tile/MetricTile.rtl.test.tsx +12 -0
  296. package/src/components/metric-tile/MetricTile.test.tsx +70 -0
  297. package/src/components/metric-tile/MetricTile.tsx +59 -0
  298. package/src/components/modal-dialog/ModalDialog.css +165 -0
  299. package/src/components/modal-dialog/ModalDialog.test.tsx +158 -0
  300. package/src/components/modal-dialog/ModalDialog.tsx +112 -0
  301. package/src/components/month-field/MonthField.css +11 -0
  302. package/src/components/month-field/MonthField.test.tsx +101 -0
  303. package/src/components/month-field/MonthField.tsx +124 -0
  304. package/src/components/native-select/NativeSelect.css +246 -0
  305. package/src/components/native-select/NativeSelect.test.tsx +160 -0
  306. package/src/components/native-select/NativeSelect.tsx +234 -0
  307. package/src/components/navigation-flyout/NavigationFlyout.css +181 -0
  308. package/src/components/navigation-flyout/NavigationFlyout.test.tsx +111 -0
  309. package/src/components/navigation-flyout/NavigationFlyout.tsx +196 -0
  310. package/src/components/notification-center/NotificationCenter.css +187 -0
  311. package/src/components/notification-center/NotificationCenter.test.tsx +140 -0
  312. package/src/components/notification-center/NotificationCenter.tsx +229 -0
  313. package/src/components/one-time-code-field/OneTimeCodeField.css +62 -0
  314. package/src/components/one-time-code-field/OneTimeCodeField.test.tsx +150 -0
  315. package/src/components/one-time-code-field/OneTimeCodeField.tsx +176 -0
  316. package/src/components/page-dots/PageDots.css +90 -0
  317. package/src/components/page-dots/PageDots.test.tsx +87 -0
  318. package/src/components/page-dots/PageDots.tsx +95 -0
  319. package/src/components/page-header/PageHeader.css +271 -0
  320. package/src/components/page-header/PageHeader.test.tsx +185 -0
  321. package/src/components/page-header/PageHeader.tsx +194 -0
  322. package/src/components/pagination/Pagination.css +139 -0
  323. package/src/components/pagination/Pagination.test.tsx +104 -0
  324. package/src/components/pagination/Pagination.tsx +160 -0
  325. package/src/components/password-strength/PasswordStrength.css +85 -0
  326. package/src/components/password-strength/PasswordStrength.test.tsx +90 -0
  327. package/src/components/password-strength/PasswordStrength.tsx +109 -0
  328. package/src/components/phase-bar/PhaseBar.css +95 -0
  329. package/src/components/phase-bar/PhaseBar.test.tsx +67 -0
  330. package/src/components/phase-bar/PhaseBar.tsx +66 -0
  331. package/src/components/popover/Popover.css +130 -0
  332. package/src/components/popover/Popover.test.tsx +153 -0
  333. package/src/components/popover/Popover.tsx +110 -0
  334. package/src/components/product-mark/ProductMark.css +24 -0
  335. package/src/components/product-mark/ProductMark.test.tsx +48 -0
  336. package/src/components/product-mark/ProductMark.tsx +95 -0
  337. package/src/components/product-mark/marks.ts +115 -0
  338. package/src/components/product-mark/plate.ts +42 -0
  339. package/src/components/profile-avatar/ProfileAvatar.css +51 -0
  340. package/src/components/profile-avatar/ProfileAvatar.test.tsx +78 -0
  341. package/src/components/profile-avatar/ProfileAvatar.tsx +58 -0
  342. package/src/components/profile-summary/ProfileSummary.css +43 -0
  343. package/src/components/profile-summary/ProfileSummary.rtl.test.tsx +12 -0
  344. package/src/components/profile-summary/ProfileSummary.test.tsx +52 -0
  345. package/src/components/profile-summary/ProfileSummary.tsx +52 -0
  346. package/src/components/progress-bar/ProgressBar.css +100 -0
  347. package/src/components/progress-bar/ProgressBar.test.tsx +68 -0
  348. package/src/components/progress-bar/ProgressBar.tsx +76 -0
  349. package/src/components/proof-badge/ProofBadge.css +178 -0
  350. package/src/components/proof-badge/ProofBadge.test.tsx +95 -0
  351. package/src/components/proof-badge/ProofBadge.tsx +113 -0
  352. package/src/components/pull-to-refresh/PullToRefresh.css +99 -0
  353. package/src/components/pull-to-refresh/PullToRefresh.rtl.test.tsx +16 -0
  354. package/src/components/pull-to-refresh/PullToRefresh.test.tsx +117 -0
  355. package/src/components/pull-to-refresh/PullToRefresh.tsx +181 -0
  356. package/src/components/record-card/RecordCard.css +151 -0
  357. package/src/components/record-card/RecordCard.rtl.test.tsx +16 -0
  358. package/src/components/record-card/RecordCard.test.tsx +105 -0
  359. package/src/components/record-card/RecordCard.tsx +159 -0
  360. package/src/components/recovery-code-list/RecoveryCodeList.css +66 -0
  361. package/src/components/recovery-code-list/RecoveryCodeList.test.tsx +108 -0
  362. package/src/components/recovery-code-list/RecoveryCodeList.tsx +105 -0
  363. package/src/components/region-map/RegionMap.css +229 -0
  364. package/src/components/region-map/RegionMap.test.tsx +200 -0
  365. package/src/components/region-map/RegionMap.tsx +400 -0
  366. package/src/components/region-map/useRegionMapState.ts +92 -0
  367. package/src/components/region-theme/countryProfile.ts +110 -0
  368. package/src/components/region-theme/data/br-profile.ts +41 -0
  369. package/src/components/region-theme/data/br.ts +80 -0
  370. package/src/components/region-theme/format.ts +120 -0
  371. package/src/components/region-theme/geometry.ts +67 -0
  372. package/src/components/region-theme/index.ts +7 -0
  373. package/src/components/region-theme/regionTheme.test.tsx +200 -0
  374. package/src/components/region-theme/registry.ts +163 -0
  375. package/src/components/report-view/ReportView.css +323 -0
  376. package/src/components/report-view/ReportView.rtl.test.tsx +25 -0
  377. package/src/components/report-view/ReportView.test.tsx +141 -0
  378. package/src/components/report-view/ReportView.tsx +201 -0
  379. package/src/components/report-view/sections.tsx +281 -0
  380. package/src/components/report-view/types.ts +72 -0
  381. package/src/components/report-view/validateReport.ts +51 -0
  382. package/src/components/resizable-split/ResizableSplit.css +56 -0
  383. package/src/components/resizable-split/ResizableSplit.test.tsx +108 -0
  384. package/src/components/resizable-split/ResizableSplit.tsx +76 -0
  385. package/src/components/resizable-split/useSplitter.ts +72 -0
  386. package/src/components/reveal-number/RevealNumber.css +17 -0
  387. package/src/components/reveal-number/RevealNumber.rtl.test.tsx +13 -0
  388. package/src/components/reveal-number/RevealNumber.test.tsx +136 -0
  389. package/src/components/reveal-number/RevealNumber.tsx +115 -0
  390. package/src/components/route-progress/RouteProgress.css +54 -0
  391. package/src/components/route-progress/RouteProgress.rtl.test.tsx +16 -0
  392. package/src/components/route-progress/RouteProgress.test.tsx +62 -0
  393. package/src/components/route-progress/RouteProgress.tsx +63 -0
  394. package/src/components/ruled-grid/RuledGrid.css +86 -0
  395. package/src/components/ruled-grid/RuledGrid.rtl.test.tsx +13 -0
  396. package/src/components/ruled-grid/RuledGrid.test.tsx +92 -0
  397. package/src/components/ruled-grid/RuledGrid.tsx +73 -0
  398. package/src/components/safe-area-inset/SafeAreaInset.css +65 -0
  399. package/src/components/safe-area-inset/SafeAreaInset.rtl.test.tsx +17 -0
  400. package/src/components/safe-area-inset/SafeAreaInset.test.tsx +99 -0
  401. package/src/components/safe-area-inset/SafeAreaInset.tsx +101 -0
  402. package/src/components/schema-request-form/SchemaRequestForm.css +75 -0
  403. package/src/components/schema-request-form/SchemaRequestForm.test.tsx +138 -0
  404. package/src/components/schema-request-form/SchemaRequestForm.tsx +231 -0
  405. package/src/components/search-bar/SearchBar.css +117 -0
  406. package/src/components/search-bar/SearchBar.test.tsx +134 -0
  407. package/src/components/search-bar/SearchBar.tsx +176 -0
  408. package/src/components/section-heading/SectionHeading.css +68 -0
  409. package/src/components/section-heading/SectionHeading.test.tsx +65 -0
  410. package/src/components/section-heading/SectionHeading.tsx +61 -0
  411. package/src/components/section-panel/SectionPanel.css +207 -0
  412. package/src/components/section-panel/SectionPanel.test.tsx +122 -0
  413. package/src/components/section-panel/SectionPanel.tsx +139 -0
  414. package/src/components/sectioned-modal/SectionedModal.css +325 -0
  415. package/src/components/sectioned-modal/SectionedModal.test.tsx +138 -0
  416. package/src/components/sectioned-modal/SectionedModal.tsx +258 -0
  417. package/src/components/segmented-control/SegmentedControl.css +123 -0
  418. package/src/components/segmented-control/SegmentedControl.test.tsx +109 -0
  419. package/src/components/segmented-control/SegmentedControl.tsx +85 -0
  420. package/src/components/separator/Separator.css +61 -0
  421. package/src/components/separator/Separator.test.tsx +65 -0
  422. package/src/components/separator/Separator.tsx +46 -0
  423. package/src/components/settings-dialog/SettingsDialog.css +151 -0
  424. package/src/components/settings-dialog/SettingsDialog.test.tsx +155 -0
  425. package/src/components/settings-dialog/SettingsDialog.tsx +126 -0
  426. package/src/components/settings-dialog/settingsModel.ts +63 -0
  427. package/src/components/settings-dialog/settingsParts.tsx +149 -0
  428. package/src/components/showcase-backdrop/ShowcaseBackdrop.css +78 -0
  429. package/src/components/showcase-backdrop/ShowcaseBackdrop.rtl.test.tsx +12 -0
  430. package/src/components/showcase-backdrop/ShowcaseBackdrop.test.tsx +91 -0
  431. package/src/components/showcase-backdrop/ShowcaseBackdrop.tsx +47 -0
  432. package/src/components/showcase-heading/ShowcaseHeading.css +65 -0
  433. package/src/components/showcase-heading/ShowcaseHeading.rtl.test.tsx +13 -0
  434. package/src/components/showcase-heading/ShowcaseHeading.test.tsx +79 -0
  435. package/src/components/showcase-heading/ShowcaseHeading.tsx +67 -0
  436. package/src/components/skeleton/Skeleton.css +120 -0
  437. package/src/components/skeleton/Skeleton.test.tsx +96 -0
  438. package/src/components/skeleton/Skeleton.tsx +168 -0
  439. package/src/components/skeleton-fill/SkeletonFill.css +67 -0
  440. package/src/components/skeleton-fill/SkeletonFill.rtl.test.tsx +12 -0
  441. package/src/components/skeleton-fill/SkeletonFill.test.tsx +61 -0
  442. package/src/components/skeleton-fill/SkeletonFill.tsx +48 -0
  443. package/src/components/skip-link/SkipLink.css +52 -0
  444. package/src/components/skip-link/SkipLink.test.tsx +90 -0
  445. package/src/components/skip-link/SkipLink.tsx +42 -0
  446. package/src/components/spinner/Spinner.css +134 -0
  447. package/src/components/spinner/Spinner.test.tsx +99 -0
  448. package/src/components/spinner/Spinner.tsx +100 -0
  449. package/src/components/stage-strip/StageStrip.css +126 -0
  450. package/src/components/stage-strip/StageStrip.test.tsx +82 -0
  451. package/src/components/stage-strip/StageStrip.tsx +100 -0
  452. package/src/components/stat-strip/StatStrip.css +90 -0
  453. package/src/components/stat-strip/StatStrip.test.tsx +75 -0
  454. package/src/components/stat-strip/StatStrip.tsx +62 -0
  455. package/src/components/stat-tile/StatTile.css +171 -0
  456. package/src/components/stat-tile/StatTile.rtl.test.tsx +14 -0
  457. package/src/components/stat-tile/StatTile.test.tsx +90 -0
  458. package/src/components/stat-tile/StatTile.tsx +129 -0
  459. package/src/components/state-switch/StateSwitch.css +113 -0
  460. package/src/components/state-switch/StateSwitch.test.tsx +102 -0
  461. package/src/components/state-switch/StateSwitch.tsx +73 -0
  462. package/src/components/status-pill/StatusPill.css +85 -0
  463. package/src/components/status-pill/StatusPill.test.tsx +91 -0
  464. package/src/components/status-pill/StatusPill.tsx +73 -0
  465. package/src/components/step-list/StepList.css +181 -0
  466. package/src/components/step-list/StepList.test.tsx +93 -0
  467. package/src/components/step-list/StepList.tsx +118 -0
  468. package/src/components/summary-row/SummaryRow.css +85 -0
  469. package/src/components/summary-row/SummaryRow.test.tsx +77 -0
  470. package/src/components/summary-row/SummaryRow.tsx +72 -0
  471. package/src/components/surface/Surface.css +157 -0
  472. package/src/components/surface/Surface.test.tsx +97 -0
  473. package/src/components/surface/Surface.tsx +124 -0
  474. package/src/components/swipe-row/SwipeRow.css +131 -0
  475. package/src/components/swipe-row/SwipeRow.rtl.test.tsx +31 -0
  476. package/src/components/swipe-row/SwipeRow.test.tsx +124 -0
  477. package/src/components/swipe-row/SwipeRow.tsx +219 -0
  478. package/src/components/switch/Switch.css +182 -0
  479. package/src/components/switch/Switch.test.tsx +112 -0
  480. package/src/components/switch/Switch.tsx +125 -0
  481. package/src/components/tabs/Tabs.css +137 -0
  482. package/src/components/tabs/Tabs.test.tsx +127 -0
  483. package/src/components/tabs/Tabs.tsx +94 -0
  484. package/src/components/tag/Tag.css +146 -0
  485. package/src/components/tag/Tag.test.tsx +129 -0
  486. package/src/components/tag/Tag.tsx +168 -0
  487. package/src/components/tag-field/TagField.css +274 -0
  488. package/src/components/tag-field/TagField.test.tsx +156 -0
  489. package/src/components/tag-field/TagField.tsx +270 -0
  490. package/src/components/text/Text.css +84 -0
  491. package/src/components/text/Text.test.tsx +91 -0
  492. package/src/components/text/Text.tsx +84 -0
  493. package/src/components/text-area/TextArea.css +125 -0
  494. package/src/components/text-area/TextArea.test.tsx +97 -0
  495. package/src/components/text-area/TextArea.tsx +145 -0
  496. package/src/components/text-field/TextField.css +197 -0
  497. package/src/components/text-field/TextField.test.tsx +136 -0
  498. package/src/components/text-field/TextField.tsx +208 -0
  499. package/src/components/theme-palette/ThemePalette.css +262 -0
  500. package/src/components/theme-palette/ThemePalette.test.tsx +62 -0
  501. package/src/components/theme-palette/ThemePalette.tsx +377 -0
  502. package/src/components/theme-switcher/ThemeSwitcher.css +159 -0
  503. package/src/components/theme-switcher/ThemeSwitcher.test.tsx +71 -0
  504. package/src/components/theme-switcher/ThemeSwitcher.tsx +72 -0
  505. package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.css +56 -0
  506. package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.rtl.test.tsx +13 -0
  507. package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.test.tsx +100 -0
  508. package/src/components/third-party-mark-slot/ThirdPartyMarkSlot.tsx +218 -0
  509. package/src/components/ticker-card/TickerCard.css +147 -0
  510. package/src/components/ticker-card/TickerCard.rtl.test.tsx +14 -0
  511. package/src/components/ticker-card/TickerCard.test.tsx +74 -0
  512. package/src/components/ticker-card/TickerCard.tsx +151 -0
  513. package/src/components/time-field/TimeField.css +69 -0
  514. package/src/components/time-field/TimeField.test.tsx +138 -0
  515. package/src/components/time-field/TimeField.tsx +205 -0
  516. package/src/components/toast/Toast.css +137 -0
  517. package/src/components/toast/Toast.test.tsx +269 -0
  518. package/src/components/toast/Toast.tsx +370 -0
  519. package/src/components/tone-tint/ToneTint.css +74 -0
  520. package/src/components/tone-tint/toneTint.test.tsx +74 -0
  521. package/src/components/tone-tint/toneTint.ts +57 -0
  522. package/src/components/toolbar-trigger/ToolbarTrigger.css +104 -0
  523. package/src/components/toolbar-trigger/ToolbarTrigger.test.tsx +75 -0
  524. package/src/components/toolbar-trigger/ToolbarTrigger.tsx +70 -0
  525. package/src/components/tooltip/Tooltip.css +70 -0
  526. package/src/components/tooltip/Tooltip.test.tsx +209 -0
  527. package/src/components/tooltip/Tooltip.tsx +102 -0
  528. package/src/components/tweened-number/TweenedNumber.css +7 -0
  529. package/src/components/tweened-number/TweenedNumber.rtl.test.tsx +19 -0
  530. package/src/components/tweened-number/TweenedNumber.test.tsx +97 -0
  531. package/src/components/tweened-number/TweenedNumber.tsx +70 -0
  532. package/src/components/upgrade-gate/UpgradeGate.css +94 -0
  533. package/src/components/upgrade-gate/UpgradeGate.rtl.test.tsx +12 -0
  534. package/src/components/upgrade-gate/UpgradeGate.test.tsx +56 -0
  535. package/src/components/upgrade-gate/UpgradeGate.tsx +56 -0
  536. package/src/components/wheel-picker/WheelPicker.css +149 -0
  537. package/src/components/wheel-picker/WheelPicker.test.tsx +150 -0
  538. package/src/components/wheel-picker/WheelPicker.tsx +228 -0
  539. package/src/components/wizard-page/WizardPage.css +114 -0
  540. package/src/components/wizard-page/WizardPage.test.tsx +117 -0
  541. package/src/components/wizard-page/WizardPage.tsx +123 -0
  542. package/src/elements/action-menu/definition.ts +123 -0
  543. package/src/elements/action-menu/element.ts +604 -0
  544. package/src/elements/anatomy.ts +55 -0
  545. package/src/elements/avatar/definition.ts +161 -0
  546. package/src/elements/avatar/element.ts +112 -0
  547. package/src/elements/base.ts +244 -0
  548. package/src/elements/brand-wordmark/definition.ts +37 -0
  549. package/src/elements/brand-wordmark/element.ts +13 -0
  550. package/src/elements/breadcrumbs/definition.ts +85 -0
  551. package/src/elements/breadcrumbs/element.ts +231 -0
  552. package/src/elements/button/definition.ts +74 -0
  553. package/src/elements/button/element.ts +25 -0
  554. package/src/elements/checkbox/definition.ts +132 -0
  555. package/src/elements/checkbox/element.ts +59 -0
  556. package/src/elements/command-palette/definition.ts +60 -0
  557. package/src/elements/command-palette/element.ts +706 -0
  558. package/src/elements/currency-field/definition.ts +159 -0
  559. package/src/elements/currency-field/element.ts +265 -0
  560. package/src/elements/data-table/definition.ts +54 -0
  561. package/src/elements/data-table/element.ts +440 -0
  562. package/src/elements/definition.ts +196 -0
  563. package/src/elements/drawer/definition.ts +156 -0
  564. package/src/elements/drawer/element.ts +304 -0
  565. package/src/elements/elements.css +156 -0
  566. package/src/elements/gradient-mark/definition.ts +41 -0
  567. package/src/elements/gradient-mark/element.ts +27 -0
  568. package/src/elements/heading/definition.ts +64 -0
  569. package/src/elements/heading/element.ts +14 -0
  570. package/src/elements/index.ts +146 -0
  571. package/src/elements/inline-notice/definition.ts +167 -0
  572. package/src/elements/inline-notice/element.ts +36 -0
  573. package/src/elements/link/definition.ts +70 -0
  574. package/src/elements/link/element.ts +40 -0
  575. package/src/elements/markdown-view/definition.ts +35 -0
  576. package/src/elements/markdown-view/element.ts +183 -0
  577. package/src/elements/modal/definition.ts +175 -0
  578. package/src/elements/modal/element.ts +226 -0
  579. package/src/elements/native-select/definition.ts +143 -0
  580. package/src/elements/native-select/element.ts +34 -0
  581. package/src/elements/notification-center/definition.ts +236 -0
  582. package/src/elements/notification-center/element.ts +527 -0
  583. package/src/elements/page-header/definition.ts +151 -0
  584. package/src/elements/page-header/element.ts +37 -0
  585. package/src/elements/popover/definition.ts +137 -0
  586. package/src/elements/popover/element.ts +196 -0
  587. package/src/elements/popover/model.ts +141 -0
  588. package/src/elements/progress-bar/definition.ts +84 -0
  589. package/src/elements/progress-bar/element.ts +82 -0
  590. package/src/elements/react/TyActionMenu.ts +79 -0
  591. package/src/elements/react/TyAvatar.ts +129 -0
  592. package/src/elements/react/TyBrandWordmark.ts +51 -0
  593. package/src/elements/react/TyBreadcrumbs.ts +82 -0
  594. package/src/elements/react/TyButton.ts +98 -0
  595. package/src/elements/react/TyCheckbox.ts +92 -0
  596. package/src/elements/react/TyCommandPalette.ts +120 -0
  597. package/src/elements/react/TyCurrencyField.ts +126 -0
  598. package/src/elements/react/TyDataTable.ts +105 -0
  599. package/src/elements/react/TyDrawer.ts +99 -0
  600. package/src/elements/react/TyGradientMark.ts +52 -0
  601. package/src/elements/react/TyHeading.ts +65 -0
  602. package/src/elements/react/TyInlineNotice.ts +191 -0
  603. package/src/elements/react/TyLink.ts +65 -0
  604. package/src/elements/react/TyMarkdownView.ts +46 -0
  605. package/src/elements/react/TyModal.ts +118 -0
  606. package/src/elements/react/TyNativeSelect.ts +96 -0
  607. package/src/elements/react/TyNotificationCenter.ts +153 -0
  608. package/src/elements/react/TyPageHeader.ts +126 -0
  609. package/src/elements/react/TyPopover.ts +95 -0
  610. package/src/elements/react/TyProgressBar.ts +72 -0
  611. package/src/elements/react/TySectionHeading.ts +78 -0
  612. package/src/elements/react/TySegmentedControl.ts +64 -0
  613. package/src/elements/react/TySeparator.ts +51 -0
  614. package/src/elements/react/TySkeleton.ts +61 -0
  615. package/src/elements/react/TySkipLink.ts +39 -0
  616. package/src/elements/react/TySpinner.ts +55 -0
  617. package/src/elements/react/TyStatusPill.ts +66 -0
  618. package/src/elements/react/TySurface.ts +104 -0
  619. package/src/elements/react/TySwitch.ts +77 -0
  620. package/src/elements/react/TyTabs.ts +66 -0
  621. package/src/elements/react/TyTag.ts +71 -0
  622. package/src/elements/react/TyTagField.ts +90 -0
  623. package/src/elements/react/TyTextArea.ts +124 -0
  624. package/src/elements/react/TyTextField.ts +186 -0
  625. package/src/elements/react/TyThemePalette.ts +126 -0
  626. package/src/elements/react/TyToast.ts +57 -0
  627. package/src/elements/react/TyWheelPicker.ts +60 -0
  628. package/src/elements/react/index.ts +39 -0
  629. package/src/elements/register.ts +7 -0
  630. package/src/elements/section-heading/definition.ts +81 -0
  631. package/src/elements/section-heading/element.ts +15 -0
  632. package/src/elements/segmented-control/definition.ts +72 -0
  633. package/src/elements/segmented-control/element.ts +253 -0
  634. package/src/elements/separator/definition.ts +44 -0
  635. package/src/elements/separator/element.ts +13 -0
  636. package/src/elements/skeleton/definition.ts +91 -0
  637. package/src/elements/skeleton/element.ts +175 -0
  638. package/src/elements/skip-link/definition.ts +26 -0
  639. package/src/elements/skip-link/element.ts +75 -0
  640. package/src/elements/spinner/definition.ts +52 -0
  641. package/src/elements/spinner/element.ts +58 -0
  642. package/src/elements/status-pill/definition.ts +48 -0
  643. package/src/elements/status-pill/element.ts +50 -0
  644. package/src/elements/surface/definition.ts +93 -0
  645. package/src/elements/surface/element.ts +42 -0
  646. package/src/elements/switch/definition.ts +72 -0
  647. package/src/elements/switch/element.ts +65 -0
  648. package/src/elements/tabs/definition.ts +60 -0
  649. package/src/elements/tabs/element.ts +319 -0
  650. package/src/elements/tag/definition.ts +69 -0
  651. package/src/elements/tag/element.ts +35 -0
  652. package/src/elements/tag-field/definition.ts +51 -0
  653. package/src/elements/tag-field/element.ts +461 -0
  654. package/src/elements/text-area/definition.ts +137 -0
  655. package/src/elements/text-area/element.ts +113 -0
  656. package/src/elements/text-field/definition.ts +236 -0
  657. package/src/elements/text-field/element.ts +151 -0
  658. package/src/elements/theme-palette/definition.ts +52 -0
  659. package/src/elements/theme-palette/element.ts +372 -0
  660. package/src/elements/theme-palette/model.ts +140 -0
  661. package/src/elements/toast/definition.ts +42 -0
  662. package/src/elements/toast/element.ts +479 -0
  663. package/src/elements/wheel-picker/definition.ts +39 -0
  664. package/src/elements/wheel-picker/element.ts +407 -0
  665. package/src/flags/Flag.css +58 -0
  666. package/src/flags/Flag.tsx +70 -0
  667. package/src/flags/art/1x1/ad.ts +2 -0
  668. package/src/flags/art/1x1/ae.ts +2 -0
  669. package/src/flags/art/1x1/af.ts +2 -0
  670. package/src/flags/art/1x1/ag.ts +2 -0
  671. package/src/flags/art/1x1/ai.ts +2 -0
  672. package/src/flags/art/1x1/al.ts +2 -0
  673. package/src/flags/art/1x1/am.ts +2 -0
  674. package/src/flags/art/1x1/ao.ts +2 -0
  675. package/src/flags/art/1x1/aq.ts +2 -0
  676. package/src/flags/art/1x1/ar.ts +2 -0
  677. package/src/flags/art/1x1/arab.ts +2 -0
  678. package/src/flags/art/1x1/as.ts +2 -0
  679. package/src/flags/art/1x1/asean.ts +2 -0
  680. package/src/flags/art/1x1/at.ts +2 -0
  681. package/src/flags/art/1x1/au.ts +2 -0
  682. package/src/flags/art/1x1/aw.ts +2 -0
  683. package/src/flags/art/1x1/ax.ts +2 -0
  684. package/src/flags/art/1x1/az.ts +2 -0
  685. package/src/flags/art/1x1/ba.ts +2 -0
  686. package/src/flags/art/1x1/bb.ts +2 -0
  687. package/src/flags/art/1x1/bd.ts +2 -0
  688. package/src/flags/art/1x1/be.ts +2 -0
  689. package/src/flags/art/1x1/bf.ts +2 -0
  690. package/src/flags/art/1x1/bg.ts +2 -0
  691. package/src/flags/art/1x1/bh.ts +2 -0
  692. package/src/flags/art/1x1/bi.ts +2 -0
  693. package/src/flags/art/1x1/bj.ts +2 -0
  694. package/src/flags/art/1x1/bl.ts +2 -0
  695. package/src/flags/art/1x1/bm.ts +2 -0
  696. package/src/flags/art/1x1/bn.ts +2 -0
  697. package/src/flags/art/1x1/bo.ts +2 -0
  698. package/src/flags/art/1x1/bq.ts +2 -0
  699. package/src/flags/art/1x1/br.ts +2 -0
  700. package/src/flags/art/1x1/bs.ts +2 -0
  701. package/src/flags/art/1x1/bt.ts +2 -0
  702. package/src/flags/art/1x1/bv.ts +2 -0
  703. package/src/flags/art/1x1/bw.ts +2 -0
  704. package/src/flags/art/1x1/by.ts +2 -0
  705. package/src/flags/art/1x1/bz.ts +2 -0
  706. package/src/flags/art/1x1/ca.ts +2 -0
  707. package/src/flags/art/1x1/cc.ts +2 -0
  708. package/src/flags/art/1x1/cd.ts +2 -0
  709. package/src/flags/art/1x1/cefta.ts +2 -0
  710. package/src/flags/art/1x1/cf.ts +2 -0
  711. package/src/flags/art/1x1/cg.ts +2 -0
  712. package/src/flags/art/1x1/ch.ts +2 -0
  713. package/src/flags/art/1x1/ci.ts +2 -0
  714. package/src/flags/art/1x1/ck.ts +2 -0
  715. package/src/flags/art/1x1/cl.ts +2 -0
  716. package/src/flags/art/1x1/cm.ts +2 -0
  717. package/src/flags/art/1x1/cn.ts +2 -0
  718. package/src/flags/art/1x1/co.ts +2 -0
  719. package/src/flags/art/1x1/cp.ts +2 -0
  720. package/src/flags/art/1x1/cr.ts +2 -0
  721. package/src/flags/art/1x1/cu.ts +2 -0
  722. package/src/flags/art/1x1/cv.ts +2 -0
  723. package/src/flags/art/1x1/cw.ts +2 -0
  724. package/src/flags/art/1x1/cx.ts +2 -0
  725. package/src/flags/art/1x1/cy.ts +2 -0
  726. package/src/flags/art/1x1/cz.ts +2 -0
  727. package/src/flags/art/1x1/de.ts +2 -0
  728. package/src/flags/art/1x1/dg.ts +2 -0
  729. package/src/flags/art/1x1/dj.ts +2 -0
  730. package/src/flags/art/1x1/dk.ts +2 -0
  731. package/src/flags/art/1x1/dm.ts +2 -0
  732. package/src/flags/art/1x1/do.ts +2 -0
  733. package/src/flags/art/1x1/dz.ts +2 -0
  734. package/src/flags/art/1x1/eac.ts +2 -0
  735. package/src/flags/art/1x1/ec.ts +2 -0
  736. package/src/flags/art/1x1/ee.ts +2 -0
  737. package/src/flags/art/1x1/eg.ts +2 -0
  738. package/src/flags/art/1x1/eh.ts +2 -0
  739. package/src/flags/art/1x1/er.ts +2 -0
  740. package/src/flags/art/1x1/es-ct.ts +2 -0
  741. package/src/flags/art/1x1/es-ga.ts +2 -0
  742. package/src/flags/art/1x1/es-pv.ts +2 -0
  743. package/src/flags/art/1x1/es.ts +2 -0
  744. package/src/flags/art/1x1/et.ts +2 -0
  745. package/src/flags/art/1x1/eu.ts +2 -0
  746. package/src/flags/art/1x1/fi.ts +2 -0
  747. package/src/flags/art/1x1/fj.ts +2 -0
  748. package/src/flags/art/1x1/fk.ts +2 -0
  749. package/src/flags/art/1x1/fm.ts +2 -0
  750. package/src/flags/art/1x1/fo.ts +2 -0
  751. package/src/flags/art/1x1/fr.ts +2 -0
  752. package/src/flags/art/1x1/ga.ts +2 -0
  753. package/src/flags/art/1x1/gb-eng.ts +2 -0
  754. package/src/flags/art/1x1/gb-nir.ts +2 -0
  755. package/src/flags/art/1x1/gb-sct.ts +2 -0
  756. package/src/flags/art/1x1/gb-wls.ts +2 -0
  757. package/src/flags/art/1x1/gb.ts +2 -0
  758. package/src/flags/art/1x1/gd.ts +2 -0
  759. package/src/flags/art/1x1/ge.ts +2 -0
  760. package/src/flags/art/1x1/gf.ts +2 -0
  761. package/src/flags/art/1x1/gg.ts +2 -0
  762. package/src/flags/art/1x1/gh.ts +2 -0
  763. package/src/flags/art/1x1/gi.ts +2 -0
  764. package/src/flags/art/1x1/gl.ts +2 -0
  765. package/src/flags/art/1x1/gm.ts +2 -0
  766. package/src/flags/art/1x1/gn.ts +2 -0
  767. package/src/flags/art/1x1/gp.ts +2 -0
  768. package/src/flags/art/1x1/gq.ts +2 -0
  769. package/src/flags/art/1x1/gr.ts +2 -0
  770. package/src/flags/art/1x1/gs.ts +2 -0
  771. package/src/flags/art/1x1/gt.ts +2 -0
  772. package/src/flags/art/1x1/gu.ts +2 -0
  773. package/src/flags/art/1x1/gw.ts +2 -0
  774. package/src/flags/art/1x1/gy.ts +2 -0
  775. package/src/flags/art/1x1/hk.ts +2 -0
  776. package/src/flags/art/1x1/hm.ts +2 -0
  777. package/src/flags/art/1x1/hn.ts +2 -0
  778. package/src/flags/art/1x1/hr.ts +2 -0
  779. package/src/flags/art/1x1/ht.ts +2 -0
  780. package/src/flags/art/1x1/hu.ts +2 -0
  781. package/src/flags/art/1x1/ic.ts +2 -0
  782. package/src/flags/art/1x1/id.ts +2 -0
  783. package/src/flags/art/1x1/ie.ts +2 -0
  784. package/src/flags/art/1x1/il.ts +2 -0
  785. package/src/flags/art/1x1/im.ts +2 -0
  786. package/src/flags/art/1x1/in.ts +2 -0
  787. package/src/flags/art/1x1/io.ts +2 -0
  788. package/src/flags/art/1x1/iq.ts +2 -0
  789. package/src/flags/art/1x1/ir.ts +2 -0
  790. package/src/flags/art/1x1/is.ts +2 -0
  791. package/src/flags/art/1x1/it.ts +2 -0
  792. package/src/flags/art/1x1/je.ts +2 -0
  793. package/src/flags/art/1x1/jm.ts +2 -0
  794. package/src/flags/art/1x1/jo.ts +2 -0
  795. package/src/flags/art/1x1/jp.ts +2 -0
  796. package/src/flags/art/1x1/ke.ts +2 -0
  797. package/src/flags/art/1x1/kg.ts +2 -0
  798. package/src/flags/art/1x1/kh.ts +2 -0
  799. package/src/flags/art/1x1/ki.ts +2 -0
  800. package/src/flags/art/1x1/km.ts +2 -0
  801. package/src/flags/art/1x1/kn.ts +2 -0
  802. package/src/flags/art/1x1/kp.ts +2 -0
  803. package/src/flags/art/1x1/kr.ts +2 -0
  804. package/src/flags/art/1x1/kw.ts +2 -0
  805. package/src/flags/art/1x1/ky.ts +2 -0
  806. package/src/flags/art/1x1/kz.ts +2 -0
  807. package/src/flags/art/1x1/la.ts +2 -0
  808. package/src/flags/art/1x1/lb.ts +2 -0
  809. package/src/flags/art/1x1/lc.ts +2 -0
  810. package/src/flags/art/1x1/li.ts +2 -0
  811. package/src/flags/art/1x1/lk.ts +2 -0
  812. package/src/flags/art/1x1/lr.ts +2 -0
  813. package/src/flags/art/1x1/ls.ts +2 -0
  814. package/src/flags/art/1x1/lt.ts +2 -0
  815. package/src/flags/art/1x1/lu.ts +2 -0
  816. package/src/flags/art/1x1/lv.ts +2 -0
  817. package/src/flags/art/1x1/ly.ts +2 -0
  818. package/src/flags/art/1x1/ma.ts +2 -0
  819. package/src/flags/art/1x1/mc.ts +2 -0
  820. package/src/flags/art/1x1/md.ts +2 -0
  821. package/src/flags/art/1x1/me.ts +2 -0
  822. package/src/flags/art/1x1/mf.ts +2 -0
  823. package/src/flags/art/1x1/mg.ts +2 -0
  824. package/src/flags/art/1x1/mh.ts +2 -0
  825. package/src/flags/art/1x1/mk.ts +2 -0
  826. package/src/flags/art/1x1/ml.ts +2 -0
  827. package/src/flags/art/1x1/mm.ts +2 -0
  828. package/src/flags/art/1x1/mn.ts +2 -0
  829. package/src/flags/art/1x1/mo.ts +2 -0
  830. package/src/flags/art/1x1/mp.ts +2 -0
  831. package/src/flags/art/1x1/mq.ts +2 -0
  832. package/src/flags/art/1x1/mr.ts +2 -0
  833. package/src/flags/art/1x1/ms.ts +2 -0
  834. package/src/flags/art/1x1/mt.ts +2 -0
  835. package/src/flags/art/1x1/mu.ts +2 -0
  836. package/src/flags/art/1x1/mv.ts +2 -0
  837. package/src/flags/art/1x1/mw.ts +2 -0
  838. package/src/flags/art/1x1/mx.ts +2 -0
  839. package/src/flags/art/1x1/my.ts +2 -0
  840. package/src/flags/art/1x1/mz.ts +2 -0
  841. package/src/flags/art/1x1/na.ts +2 -0
  842. package/src/flags/art/1x1/nc.ts +2 -0
  843. package/src/flags/art/1x1/ne.ts +2 -0
  844. package/src/flags/art/1x1/nf.ts +2 -0
  845. package/src/flags/art/1x1/ng.ts +2 -0
  846. package/src/flags/art/1x1/ni.ts +2 -0
  847. package/src/flags/art/1x1/nl.ts +2 -0
  848. package/src/flags/art/1x1/no.ts +2 -0
  849. package/src/flags/art/1x1/np.ts +2 -0
  850. package/src/flags/art/1x1/nr.ts +2 -0
  851. package/src/flags/art/1x1/nu.ts +2 -0
  852. package/src/flags/art/1x1/nz.ts +2 -0
  853. package/src/flags/art/1x1/om.ts +2 -0
  854. package/src/flags/art/1x1/pa.ts +2 -0
  855. package/src/flags/art/1x1/pc.ts +2 -0
  856. package/src/flags/art/1x1/pe.ts +2 -0
  857. package/src/flags/art/1x1/pf.ts +2 -0
  858. package/src/flags/art/1x1/pg.ts +2 -0
  859. package/src/flags/art/1x1/ph.ts +2 -0
  860. package/src/flags/art/1x1/pk.ts +2 -0
  861. package/src/flags/art/1x1/pl.ts +2 -0
  862. package/src/flags/art/1x1/pm.ts +2 -0
  863. package/src/flags/art/1x1/pn.ts +2 -0
  864. package/src/flags/art/1x1/pr.ts +2 -0
  865. package/src/flags/art/1x1/ps.ts +2 -0
  866. package/src/flags/art/1x1/pt.ts +2 -0
  867. package/src/flags/art/1x1/pw.ts +2 -0
  868. package/src/flags/art/1x1/py.ts +2 -0
  869. package/src/flags/art/1x1/qa.ts +2 -0
  870. package/src/flags/art/1x1/re.ts +2 -0
  871. package/src/flags/art/1x1/ro.ts +2 -0
  872. package/src/flags/art/1x1/rs.ts +2 -0
  873. package/src/flags/art/1x1/ru.ts +2 -0
  874. package/src/flags/art/1x1/rw.ts +2 -0
  875. package/src/flags/art/1x1/sa.ts +2 -0
  876. package/src/flags/art/1x1/sb.ts +2 -0
  877. package/src/flags/art/1x1/sc.ts +2 -0
  878. package/src/flags/art/1x1/sd.ts +2 -0
  879. package/src/flags/art/1x1/se.ts +2 -0
  880. package/src/flags/art/1x1/sg.ts +2 -0
  881. package/src/flags/art/1x1/sh-ac.ts +2 -0
  882. package/src/flags/art/1x1/sh-hl.ts +2 -0
  883. package/src/flags/art/1x1/sh-ta.ts +2 -0
  884. package/src/flags/art/1x1/sh.ts +2 -0
  885. package/src/flags/art/1x1/si.ts +2 -0
  886. package/src/flags/art/1x1/sj.ts +2 -0
  887. package/src/flags/art/1x1/sk.ts +2 -0
  888. package/src/flags/art/1x1/sl.ts +2 -0
  889. package/src/flags/art/1x1/sm.ts +2 -0
  890. package/src/flags/art/1x1/sn.ts +2 -0
  891. package/src/flags/art/1x1/so.ts +2 -0
  892. package/src/flags/art/1x1/sr.ts +2 -0
  893. package/src/flags/art/1x1/ss.ts +2 -0
  894. package/src/flags/art/1x1/st.ts +2 -0
  895. package/src/flags/art/1x1/sv.ts +2 -0
  896. package/src/flags/art/1x1/sx.ts +2 -0
  897. package/src/flags/art/1x1/sy.ts +2 -0
  898. package/src/flags/art/1x1/sz.ts +2 -0
  899. package/src/flags/art/1x1/tc.ts +2 -0
  900. package/src/flags/art/1x1/td.ts +2 -0
  901. package/src/flags/art/1x1/tf.ts +2 -0
  902. package/src/flags/art/1x1/tg.ts +2 -0
  903. package/src/flags/art/1x1/th.ts +2 -0
  904. package/src/flags/art/1x1/tj.ts +2 -0
  905. package/src/flags/art/1x1/tk.ts +2 -0
  906. package/src/flags/art/1x1/tl.ts +2 -0
  907. package/src/flags/art/1x1/tm.ts +2 -0
  908. package/src/flags/art/1x1/tn.ts +2 -0
  909. package/src/flags/art/1x1/to.ts +2 -0
  910. package/src/flags/art/1x1/tr.ts +2 -0
  911. package/src/flags/art/1x1/tt.ts +2 -0
  912. package/src/flags/art/1x1/tv.ts +2 -0
  913. package/src/flags/art/1x1/tw.ts +2 -0
  914. package/src/flags/art/1x1/tz.ts +2 -0
  915. package/src/flags/art/1x1/ua.ts +2 -0
  916. package/src/flags/art/1x1/ug.ts +2 -0
  917. package/src/flags/art/1x1/um.ts +2 -0
  918. package/src/flags/art/1x1/un.ts +2 -0
  919. package/src/flags/art/1x1/us.ts +2 -0
  920. package/src/flags/art/1x1/uy.ts +2 -0
  921. package/src/flags/art/1x1/uz.ts +2 -0
  922. package/src/flags/art/1x1/va.ts +2 -0
  923. package/src/flags/art/1x1/vc.ts +2 -0
  924. package/src/flags/art/1x1/ve.ts +2 -0
  925. package/src/flags/art/1x1/vg.ts +2 -0
  926. package/src/flags/art/1x1/vi.ts +2 -0
  927. package/src/flags/art/1x1/vn.ts +2 -0
  928. package/src/flags/art/1x1/vu.ts +2 -0
  929. package/src/flags/art/1x1/wf.ts +2 -0
  930. package/src/flags/art/1x1/ws.ts +2 -0
  931. package/src/flags/art/1x1/xk.ts +2 -0
  932. package/src/flags/art/1x1/xx.ts +2 -0
  933. package/src/flags/art/1x1/ye.ts +2 -0
  934. package/src/flags/art/1x1/yt.ts +2 -0
  935. package/src/flags/art/1x1/za.ts +2 -0
  936. package/src/flags/art/1x1/zm.ts +2 -0
  937. package/src/flags/art/1x1/zw.ts +2 -0
  938. package/src/flags/art/4x3/ad.ts +2 -0
  939. package/src/flags/art/4x3/ae.ts +2 -0
  940. package/src/flags/art/4x3/af.ts +2 -0
  941. package/src/flags/art/4x3/ag.ts +2 -0
  942. package/src/flags/art/4x3/ai.ts +2 -0
  943. package/src/flags/art/4x3/al.ts +2 -0
  944. package/src/flags/art/4x3/am.ts +2 -0
  945. package/src/flags/art/4x3/ao.ts +2 -0
  946. package/src/flags/art/4x3/aq.ts +2 -0
  947. package/src/flags/art/4x3/ar.ts +2 -0
  948. package/src/flags/art/4x3/arab.ts +2 -0
  949. package/src/flags/art/4x3/as.ts +2 -0
  950. package/src/flags/art/4x3/asean.ts +2 -0
  951. package/src/flags/art/4x3/at.ts +2 -0
  952. package/src/flags/art/4x3/au.ts +2 -0
  953. package/src/flags/art/4x3/aw.ts +2 -0
  954. package/src/flags/art/4x3/ax.ts +2 -0
  955. package/src/flags/art/4x3/az.ts +2 -0
  956. package/src/flags/art/4x3/ba.ts +2 -0
  957. package/src/flags/art/4x3/bb.ts +2 -0
  958. package/src/flags/art/4x3/bd.ts +2 -0
  959. package/src/flags/art/4x3/be.ts +2 -0
  960. package/src/flags/art/4x3/bf.ts +2 -0
  961. package/src/flags/art/4x3/bg.ts +2 -0
  962. package/src/flags/art/4x3/bh.ts +2 -0
  963. package/src/flags/art/4x3/bi.ts +2 -0
  964. package/src/flags/art/4x3/bj.ts +2 -0
  965. package/src/flags/art/4x3/bl.ts +2 -0
  966. package/src/flags/art/4x3/bm.ts +2 -0
  967. package/src/flags/art/4x3/bn.ts +2 -0
  968. package/src/flags/art/4x3/bo.ts +2 -0
  969. package/src/flags/art/4x3/bq.ts +2 -0
  970. package/src/flags/art/4x3/br.ts +2 -0
  971. package/src/flags/art/4x3/bs.ts +2 -0
  972. package/src/flags/art/4x3/bt.ts +2 -0
  973. package/src/flags/art/4x3/bv.ts +2 -0
  974. package/src/flags/art/4x3/bw.ts +2 -0
  975. package/src/flags/art/4x3/by.ts +2 -0
  976. package/src/flags/art/4x3/bz.ts +2 -0
  977. package/src/flags/art/4x3/ca.ts +2 -0
  978. package/src/flags/art/4x3/cc.ts +2 -0
  979. package/src/flags/art/4x3/cd.ts +2 -0
  980. package/src/flags/art/4x3/cefta.ts +2 -0
  981. package/src/flags/art/4x3/cf.ts +2 -0
  982. package/src/flags/art/4x3/cg.ts +2 -0
  983. package/src/flags/art/4x3/ch.ts +2 -0
  984. package/src/flags/art/4x3/ci.ts +2 -0
  985. package/src/flags/art/4x3/ck.ts +2 -0
  986. package/src/flags/art/4x3/cl.ts +2 -0
  987. package/src/flags/art/4x3/cm.ts +2 -0
  988. package/src/flags/art/4x3/cn.ts +2 -0
  989. package/src/flags/art/4x3/co.ts +2 -0
  990. package/src/flags/art/4x3/cp.ts +2 -0
  991. package/src/flags/art/4x3/cr.ts +2 -0
  992. package/src/flags/art/4x3/cu.ts +2 -0
  993. package/src/flags/art/4x3/cv.ts +2 -0
  994. package/src/flags/art/4x3/cw.ts +2 -0
  995. package/src/flags/art/4x3/cx.ts +2 -0
  996. package/src/flags/art/4x3/cy.ts +2 -0
  997. package/src/flags/art/4x3/cz.ts +2 -0
  998. package/src/flags/art/4x3/de.ts +2 -0
  999. package/src/flags/art/4x3/dg.ts +2 -0
  1000. package/src/flags/art/4x3/dj.ts +2 -0
  1001. package/src/flags/art/4x3/dk.ts +2 -0
  1002. package/src/flags/art/4x3/dm.ts +2 -0
  1003. package/src/flags/art/4x3/do.ts +2 -0
  1004. package/src/flags/art/4x3/dz.ts +2 -0
  1005. package/src/flags/art/4x3/eac.ts +2 -0
  1006. package/src/flags/art/4x3/ec.ts +2 -0
  1007. package/src/flags/art/4x3/ee.ts +2 -0
  1008. package/src/flags/art/4x3/eg.ts +2 -0
  1009. package/src/flags/art/4x3/eh.ts +2 -0
  1010. package/src/flags/art/4x3/er.ts +2 -0
  1011. package/src/flags/art/4x3/es-ct.ts +2 -0
  1012. package/src/flags/art/4x3/es-ga.ts +2 -0
  1013. package/src/flags/art/4x3/es-pv.ts +2 -0
  1014. package/src/flags/art/4x3/es.ts +2 -0
  1015. package/src/flags/art/4x3/et.ts +2 -0
  1016. package/src/flags/art/4x3/eu.ts +2 -0
  1017. package/src/flags/art/4x3/fi.ts +2 -0
  1018. package/src/flags/art/4x3/fj.ts +2 -0
  1019. package/src/flags/art/4x3/fk.ts +2 -0
  1020. package/src/flags/art/4x3/fm.ts +2 -0
  1021. package/src/flags/art/4x3/fo.ts +2 -0
  1022. package/src/flags/art/4x3/fr.ts +2 -0
  1023. package/src/flags/art/4x3/ga.ts +2 -0
  1024. package/src/flags/art/4x3/gb-eng.ts +2 -0
  1025. package/src/flags/art/4x3/gb-nir.ts +2 -0
  1026. package/src/flags/art/4x3/gb-sct.ts +2 -0
  1027. package/src/flags/art/4x3/gb-wls.ts +2 -0
  1028. package/src/flags/art/4x3/gb.ts +2 -0
  1029. package/src/flags/art/4x3/gd.ts +2 -0
  1030. package/src/flags/art/4x3/ge.ts +2 -0
  1031. package/src/flags/art/4x3/gf.ts +2 -0
  1032. package/src/flags/art/4x3/gg.ts +2 -0
  1033. package/src/flags/art/4x3/gh.ts +2 -0
  1034. package/src/flags/art/4x3/gi.ts +2 -0
  1035. package/src/flags/art/4x3/gl.ts +2 -0
  1036. package/src/flags/art/4x3/gm.ts +2 -0
  1037. package/src/flags/art/4x3/gn.ts +2 -0
  1038. package/src/flags/art/4x3/gp.ts +2 -0
  1039. package/src/flags/art/4x3/gq.ts +2 -0
  1040. package/src/flags/art/4x3/gr.ts +2 -0
  1041. package/src/flags/art/4x3/gs.ts +2 -0
  1042. package/src/flags/art/4x3/gt.ts +2 -0
  1043. package/src/flags/art/4x3/gu.ts +2 -0
  1044. package/src/flags/art/4x3/gw.ts +2 -0
  1045. package/src/flags/art/4x3/gy.ts +2 -0
  1046. package/src/flags/art/4x3/hk.ts +2 -0
  1047. package/src/flags/art/4x3/hm.ts +2 -0
  1048. package/src/flags/art/4x3/hn.ts +2 -0
  1049. package/src/flags/art/4x3/hr.ts +2 -0
  1050. package/src/flags/art/4x3/ht.ts +2 -0
  1051. package/src/flags/art/4x3/hu.ts +2 -0
  1052. package/src/flags/art/4x3/ic.ts +2 -0
  1053. package/src/flags/art/4x3/id.ts +2 -0
  1054. package/src/flags/art/4x3/ie.ts +2 -0
  1055. package/src/flags/art/4x3/il.ts +2 -0
  1056. package/src/flags/art/4x3/im.ts +2 -0
  1057. package/src/flags/art/4x3/in.ts +2 -0
  1058. package/src/flags/art/4x3/io.ts +2 -0
  1059. package/src/flags/art/4x3/iq.ts +2 -0
  1060. package/src/flags/art/4x3/ir.ts +2 -0
  1061. package/src/flags/art/4x3/is.ts +2 -0
  1062. package/src/flags/art/4x3/it.ts +2 -0
  1063. package/src/flags/art/4x3/je.ts +2 -0
  1064. package/src/flags/art/4x3/jm.ts +2 -0
  1065. package/src/flags/art/4x3/jo.ts +2 -0
  1066. package/src/flags/art/4x3/jp.ts +2 -0
  1067. package/src/flags/art/4x3/ke.ts +2 -0
  1068. package/src/flags/art/4x3/kg.ts +2 -0
  1069. package/src/flags/art/4x3/kh.ts +2 -0
  1070. package/src/flags/art/4x3/ki.ts +2 -0
  1071. package/src/flags/art/4x3/km.ts +2 -0
  1072. package/src/flags/art/4x3/kn.ts +2 -0
  1073. package/src/flags/art/4x3/kp.ts +2 -0
  1074. package/src/flags/art/4x3/kr.ts +2 -0
  1075. package/src/flags/art/4x3/kw.ts +2 -0
  1076. package/src/flags/art/4x3/ky.ts +2 -0
  1077. package/src/flags/art/4x3/kz.ts +2 -0
  1078. package/src/flags/art/4x3/la.ts +2 -0
  1079. package/src/flags/art/4x3/lb.ts +2 -0
  1080. package/src/flags/art/4x3/lc.ts +2 -0
  1081. package/src/flags/art/4x3/li.ts +2 -0
  1082. package/src/flags/art/4x3/lk.ts +2 -0
  1083. package/src/flags/art/4x3/lr.ts +2 -0
  1084. package/src/flags/art/4x3/ls.ts +2 -0
  1085. package/src/flags/art/4x3/lt.ts +2 -0
  1086. package/src/flags/art/4x3/lu.ts +2 -0
  1087. package/src/flags/art/4x3/lv.ts +2 -0
  1088. package/src/flags/art/4x3/ly.ts +2 -0
  1089. package/src/flags/art/4x3/ma.ts +2 -0
  1090. package/src/flags/art/4x3/mc.ts +2 -0
  1091. package/src/flags/art/4x3/md.ts +2 -0
  1092. package/src/flags/art/4x3/me.ts +2 -0
  1093. package/src/flags/art/4x3/mf.ts +2 -0
  1094. package/src/flags/art/4x3/mg.ts +2 -0
  1095. package/src/flags/art/4x3/mh.ts +2 -0
  1096. package/src/flags/art/4x3/mk.ts +2 -0
  1097. package/src/flags/art/4x3/ml.ts +2 -0
  1098. package/src/flags/art/4x3/mm.ts +2 -0
  1099. package/src/flags/art/4x3/mn.ts +2 -0
  1100. package/src/flags/art/4x3/mo.ts +2 -0
  1101. package/src/flags/art/4x3/mp.ts +2 -0
  1102. package/src/flags/art/4x3/mq.ts +2 -0
  1103. package/src/flags/art/4x3/mr.ts +2 -0
  1104. package/src/flags/art/4x3/ms.ts +2 -0
  1105. package/src/flags/art/4x3/mt.ts +2 -0
  1106. package/src/flags/art/4x3/mu.ts +2 -0
  1107. package/src/flags/art/4x3/mv.ts +2 -0
  1108. package/src/flags/art/4x3/mw.ts +2 -0
  1109. package/src/flags/art/4x3/mx.ts +2 -0
  1110. package/src/flags/art/4x3/my.ts +2 -0
  1111. package/src/flags/art/4x3/mz.ts +2 -0
  1112. package/src/flags/art/4x3/na.ts +2 -0
  1113. package/src/flags/art/4x3/nc.ts +2 -0
  1114. package/src/flags/art/4x3/ne.ts +2 -0
  1115. package/src/flags/art/4x3/nf.ts +2 -0
  1116. package/src/flags/art/4x3/ng.ts +2 -0
  1117. package/src/flags/art/4x3/ni.ts +2 -0
  1118. package/src/flags/art/4x3/nl.ts +2 -0
  1119. package/src/flags/art/4x3/no.ts +2 -0
  1120. package/src/flags/art/4x3/np.ts +2 -0
  1121. package/src/flags/art/4x3/nr.ts +2 -0
  1122. package/src/flags/art/4x3/nu.ts +2 -0
  1123. package/src/flags/art/4x3/nz.ts +2 -0
  1124. package/src/flags/art/4x3/om.ts +2 -0
  1125. package/src/flags/art/4x3/pa.ts +2 -0
  1126. package/src/flags/art/4x3/pc.ts +2 -0
  1127. package/src/flags/art/4x3/pe.ts +2 -0
  1128. package/src/flags/art/4x3/pf.ts +2 -0
  1129. package/src/flags/art/4x3/pg.ts +2 -0
  1130. package/src/flags/art/4x3/ph.ts +2 -0
  1131. package/src/flags/art/4x3/pk.ts +2 -0
  1132. package/src/flags/art/4x3/pl.ts +2 -0
  1133. package/src/flags/art/4x3/pm.ts +2 -0
  1134. package/src/flags/art/4x3/pn.ts +2 -0
  1135. package/src/flags/art/4x3/pr.ts +2 -0
  1136. package/src/flags/art/4x3/ps.ts +2 -0
  1137. package/src/flags/art/4x3/pt.ts +2 -0
  1138. package/src/flags/art/4x3/pw.ts +2 -0
  1139. package/src/flags/art/4x3/py.ts +2 -0
  1140. package/src/flags/art/4x3/qa.ts +2 -0
  1141. package/src/flags/art/4x3/re.ts +2 -0
  1142. package/src/flags/art/4x3/ro.ts +2 -0
  1143. package/src/flags/art/4x3/rs.ts +2 -0
  1144. package/src/flags/art/4x3/ru.ts +2 -0
  1145. package/src/flags/art/4x3/rw.ts +2 -0
  1146. package/src/flags/art/4x3/sa.ts +2 -0
  1147. package/src/flags/art/4x3/sb.ts +2 -0
  1148. package/src/flags/art/4x3/sc.ts +2 -0
  1149. package/src/flags/art/4x3/sd.ts +2 -0
  1150. package/src/flags/art/4x3/se.ts +2 -0
  1151. package/src/flags/art/4x3/sg.ts +2 -0
  1152. package/src/flags/art/4x3/sh-ac.ts +2 -0
  1153. package/src/flags/art/4x3/sh-hl.ts +2 -0
  1154. package/src/flags/art/4x3/sh-ta.ts +2 -0
  1155. package/src/flags/art/4x3/sh.ts +2 -0
  1156. package/src/flags/art/4x3/si.ts +2 -0
  1157. package/src/flags/art/4x3/sj.ts +2 -0
  1158. package/src/flags/art/4x3/sk.ts +2 -0
  1159. package/src/flags/art/4x3/sl.ts +2 -0
  1160. package/src/flags/art/4x3/sm.ts +2 -0
  1161. package/src/flags/art/4x3/sn.ts +2 -0
  1162. package/src/flags/art/4x3/so.ts +2 -0
  1163. package/src/flags/art/4x3/sr.ts +2 -0
  1164. package/src/flags/art/4x3/ss.ts +2 -0
  1165. package/src/flags/art/4x3/st.ts +2 -0
  1166. package/src/flags/art/4x3/sv.ts +2 -0
  1167. package/src/flags/art/4x3/sx.ts +2 -0
  1168. package/src/flags/art/4x3/sy.ts +2 -0
  1169. package/src/flags/art/4x3/sz.ts +2 -0
  1170. package/src/flags/art/4x3/tc.ts +2 -0
  1171. package/src/flags/art/4x3/td.ts +2 -0
  1172. package/src/flags/art/4x3/tf.ts +2 -0
  1173. package/src/flags/art/4x3/tg.ts +2 -0
  1174. package/src/flags/art/4x3/th.ts +2 -0
  1175. package/src/flags/art/4x3/tj.ts +2 -0
  1176. package/src/flags/art/4x3/tk.ts +2 -0
  1177. package/src/flags/art/4x3/tl.ts +2 -0
  1178. package/src/flags/art/4x3/tm.ts +2 -0
  1179. package/src/flags/art/4x3/tn.ts +2 -0
  1180. package/src/flags/art/4x3/to.ts +2 -0
  1181. package/src/flags/art/4x3/tr.ts +2 -0
  1182. package/src/flags/art/4x3/tt.ts +2 -0
  1183. package/src/flags/art/4x3/tv.ts +2 -0
  1184. package/src/flags/art/4x3/tw.ts +2 -0
  1185. package/src/flags/art/4x3/tz.ts +2 -0
  1186. package/src/flags/art/4x3/ua.ts +2 -0
  1187. package/src/flags/art/4x3/ug.ts +2 -0
  1188. package/src/flags/art/4x3/um.ts +2 -0
  1189. package/src/flags/art/4x3/un.ts +2 -0
  1190. package/src/flags/art/4x3/us.ts +2 -0
  1191. package/src/flags/art/4x3/uy.ts +2 -0
  1192. package/src/flags/art/4x3/uz.ts +2 -0
  1193. package/src/flags/art/4x3/va.ts +2 -0
  1194. package/src/flags/art/4x3/vc.ts +2 -0
  1195. package/src/flags/art/4x3/ve.ts +2 -0
  1196. package/src/flags/art/4x3/vg.ts +2 -0
  1197. package/src/flags/art/4x3/vi.ts +2 -0
  1198. package/src/flags/art/4x3/vn.ts +2 -0
  1199. package/src/flags/art/4x3/vu.ts +2 -0
  1200. package/src/flags/art/4x3/wf.ts +2 -0
  1201. package/src/flags/art/4x3/ws.ts +2 -0
  1202. package/src/flags/art/4x3/xk.ts +2 -0
  1203. package/src/flags/art/4x3/xx.ts +2 -0
  1204. package/src/flags/art/4x3/ye.ts +2 -0
  1205. package/src/flags/art/4x3/yt.ts +2 -0
  1206. package/src/flags/art/4x3/za.ts +2 -0
  1207. package/src/flags/art/4x3/zm.ts +2 -0
  1208. package/src/flags/art/4x3/zw.ts +2 -0
  1209. package/src/flags/art/index.ts +552 -0
  1210. package/src/flags/flags.test.tsx +140 -0
  1211. package/src/flags/index.ts +7 -0
  1212. package/src/flags/loadFlag.ts +29 -0
  1213. package/src/flags/names.ts +65 -0
  1214. package/src/flow/CLEAN-ROOM.md +110 -0
  1215. package/src/flow/PROVENANCE.md +169 -0
  1216. package/src/flow/README.md +117 -0
  1217. package/src/flow/agents/AgentCreationWizard.tsx +633 -0
  1218. package/src/flow/agents/AgentEditorDialog.tsx +751 -0
  1219. package/src/flow/agents/agents.css +563 -0
  1220. package/src/flow/agents/agents.test.tsx +207 -0
  1221. package/src/flow/agents/index.ts +4 -0
  1222. package/src/flow/agents/parts.tsx +171 -0
  1223. package/src/flow/assistant/AssistantConversation.tsx +388 -0
  1224. package/src/flow/assistant/AssistantVisualBlock.test.tsx +86 -0
  1225. package/src/flow/assistant/AssistantVisualBlock.tsx +75 -0
  1226. package/src/flow/assistant/ConversationShell.test.tsx +202 -0
  1227. package/src/flow/assistant/ConversationShell.tsx +160 -0
  1228. package/src/flow/assistant/LiveCanvasPanel.tsx +52 -0
  1229. package/src/flow/assistant/MarkdownView.tsx +162 -0
  1230. package/src/flow/assistant/ThreadHistory.tsx +156 -0
  1231. package/src/flow/assistant/assistant.css +567 -0
  1232. package/src/flow/assistant/index.ts +10 -0
  1233. package/src/flow/assistant/threadDays.ts +44 -0
  1234. package/src/flow/assistant/useAssistantSession.test.tsx +172 -0
  1235. package/src/flow/assistant/useAssistantSession.ts +457 -0
  1236. package/src/flow/assistant/visual.ts +205 -0
  1237. package/src/flow/catalog/RenderCatalog.tsx +98 -0
  1238. package/src/flow/catalog/catalog.test.tsx +162 -0
  1239. package/src/flow/catalog/icons.ts +116 -0
  1240. package/src/flow/catalog/kindCatalog.ts +175 -0
  1241. package/src/flow/catalog/nodeState.ts +46 -0
  1242. package/src/flow/catalog/palette.ts +116 -0
  1243. package/src/flow/connectors/ConditionalConnector.css +274 -0
  1244. package/src/flow/connectors/ConditionalConnector.tsx +288 -0
  1245. package/src/flow/connectors/ConnectionPreviewLine.tsx +31 -0
  1246. package/src/flow/connectors/ConnectorInsertMenu.tsx +103 -0
  1247. package/src/flow/connectors/connectors.css +2 -0
  1248. package/src/flow/connectors/connectors.test.tsx +218 -0
  1249. package/src/flow/connectors/index.ts +4 -0
  1250. package/src/flow/decision/DecisionNode.tsx +182 -0
  1251. package/src/flow/decision/decision.css +1 -0
  1252. package/src/flow/decision/index.ts +3 -0
  1253. package/src/flow/decision/types.ts +60 -0
  1254. package/src/flow/dialogs/DefinitionDialogs.test.tsx +177 -0
  1255. package/src/flow/dialogs/DefinitionExportDialog.tsx +234 -0
  1256. package/src/flow/dialogs/DefinitionImportDialog.tsx +303 -0
  1257. package/src/flow/dialogs/FlowSettingsDialog.test.tsx +95 -0
  1258. package/src/flow/dialogs/FlowSettingsDialog.tsx +242 -0
  1259. package/src/flow/dialogs/NodeConfigDialog.test.tsx +151 -0
  1260. package/src/flow/dialogs/NodeConfigDialog.tsx +208 -0
  1261. package/src/flow/dialogs/dialogs.css +134 -0
  1262. package/src/flow/dialogs/index.ts +5 -0
  1263. package/src/flow/editor/AutosaveController.tsx +25 -0
  1264. package/src/flow/editor/CanvasCommandBar.tsx +315 -0
  1265. package/src/flow/editor/CanvasContextMenus.tsx +287 -0
  1266. package/src/flow/editor/FlowEditor.test.tsx +282 -0
  1267. package/src/flow/editor/FlowEditor.tsx +1214 -0
  1268. package/src/flow/editor/FlowOutline.tsx +196 -0
  1269. package/src/flow/editor/FlowPreview.tsx +149 -0
  1270. package/src/flow/editor/FlowSwitcherBar.tsx +141 -0
  1271. package/src/flow/editor/NodePalette.tsx +447 -0
  1272. package/src/flow/editor/RunControls.tsx +85 -0
  1273. package/src/flow/editor/SaveStatus.tsx +45 -0
  1274. package/src/flow/editor/editor.css +573 -0
  1275. package/src/flow/editor/editorTools.ts +135 -0
  1276. package/src/flow/editor/focusOut.ts +23 -0
  1277. package/src/flow/editor/index.ts +16 -0
  1278. package/src/flow/editor/keyMap.ts +93 -0
  1279. package/src/flow/editor/nodeBridge.tsx +66 -0
  1280. package/src/flow/editor/parts.test.tsx +519 -0
  1281. package/src/flow/editor/useEditorShortcuts.ts +122 -0
  1282. package/src/flow/editor/useSelectionArrange.ts +135 -0
  1283. package/src/flow/expressions/ComputeInsertPanel.tsx +123 -0
  1284. package/src/flow/expressions/ComputeNodeForm.tsx +291 -0
  1285. package/src/flow/expressions/ComputeTrial.tsx +105 -0
  1286. package/src/flow/expressions/ExpressionBuilder.test.tsx +161 -0
  1287. package/src/flow/expressions/ExpressionBuilder.tsx +71 -0
  1288. package/src/flow/expressions/ExpressionField.tsx +157 -0
  1289. package/src/flow/expressions/RuleEditor.tsx +645 -0
  1290. package/src/flow/expressions/RuleNodeForm.tsx +165 -0
  1291. package/src/flow/expressions/SimulationNodeForm.tsx +175 -0
  1292. package/src/flow/expressions/TraceTree.test.tsx +120 -0
  1293. package/src/flow/expressions/TraceTree.tsx +210 -0
  1294. package/src/flow/expressions/builder/ItemList.tsx +72 -0
  1295. package/src/flow/expressions/builder/leaves.tsx +94 -0
  1296. package/src/flow/expressions/builder/shared.tsx +55 -0
  1297. package/src/flow/expressions/builder/tree.tsx +221 -0
  1298. package/src/flow/expressions/catalogContext.tsx +21 -0
  1299. package/src/flow/expressions/computeDraft.ts +105 -0
  1300. package/src/flow/expressions/exampleCatalog.ts +42 -0
  1301. package/src/flow/expressions/expressions.css +520 -0
  1302. package/src/flow/expressions/forms.test.tsx +325 -0
  1303. package/src/flow/expressions/index.ts +15 -0
  1304. package/src/flow/expressions/labels.ts +204 -0
  1305. package/src/flow/expressions/model.ts +194 -0
  1306. package/src/flow/expressions/ruleActions.ts +164 -0
  1307. package/src/flow/expressions/ruleCondition.ts +98 -0
  1308. package/src/flow/expressions/trace.ts +98 -0
  1309. package/src/flow/forms/AgentNodeForm.css +29 -0
  1310. package/src/flow/forms/AgentNodeForm.test.tsx +66 -0
  1311. package/src/flow/forms/AgentNodeForm.tsx +177 -0
  1312. package/src/flow/forms/DataSourceNodeForm.test.tsx +121 -0
  1313. package/src/flow/forms/DataSourceNodeForm.tsx +519 -0
  1314. package/src/flow/forms/DecisionNodeForm.test.tsx +72 -0
  1315. package/src/flow/forms/DecisionNodeForm.tsx +302 -0
  1316. package/src/flow/forms/GroupNodeForm.css +72 -0
  1317. package/src/flow/forms/GroupNodeForm.test.tsx +55 -0
  1318. package/src/flow/forms/GroupNodeForm.tsx +148 -0
  1319. package/src/flow/forms/NewForms.css +256 -0
  1320. package/src/flow/forms/NodeFormFooter.tsx +44 -0
  1321. package/src/flow/forms/OutputSchemaBuilder.test.tsx +83 -0
  1322. package/src/flow/forms/OutputSchemaBuilder.tsx +325 -0
  1323. package/src/flow/forms/ReportOutputNodeForm.test.tsx +63 -0
  1324. package/src/flow/forms/ReportOutputNodeForm.tsx +180 -0
  1325. package/src/flow/forms/SchemaConfigForm.css +7 -0
  1326. package/src/flow/forms/SchemaConfigForm.test.tsx +74 -0
  1327. package/src/flow/forms/SchemaConfigForm.tsx +214 -0
  1328. package/src/flow/forms/StartNodeForm.css +29 -0
  1329. package/src/flow/forms/StartNodeForm.test.tsx +66 -0
  1330. package/src/flow/forms/StartNodeForm.tsx +88 -0
  1331. package/src/flow/forms/ToolServerListField.css +58 -0
  1332. package/src/flow/forms/ToolServerListField.test.tsx +73 -0
  1333. package/src/flow/forms/ToolServerListField.tsx +242 -0
  1334. package/src/flow/forms/VariableListEditor.css +82 -0
  1335. package/src/flow/forms/VariableListEditor.test.tsx +79 -0
  1336. package/src/flow/forms/VariableListEditor.tsx +280 -0
  1337. package/src/flow/forms/forms-shared.css +53 -0
  1338. package/src/flow/forms/forms.css +9 -0
  1339. package/src/flow/forms/index.ts +12 -0
  1340. package/src/flow/forms/nameListModel.ts +61 -0
  1341. package/src/flow/geometry/arrange.ts +74 -0
  1342. package/src/flow/geometry/curve.ts +58 -0
  1343. package/src/flow/geometry/geometry.test.ts +97 -0
  1344. package/src/flow/geometry/guides.ts +49 -0
  1345. package/src/flow/geometry/rect.ts +101 -0
  1346. package/src/flow/geometry/viewport.ts +70 -0
  1347. package/src/flow/index.ts +58 -0
  1348. package/src/flow/internal/Announcer.tsx +63 -0
  1349. package/src/flow/internal/DockedPanel.tsx +95 -0
  1350. package/src/flow/internal/SectionedModal.tsx +117 -0
  1351. package/src/flow/internal/builtInLabels.test.ts +16 -0
  1352. package/src/flow/internal/confirm.tsx +73 -0
  1353. package/src/flow/internal/format.ts +47 -0
  1354. package/src/flow/internal/i18n.test.tsx +109 -0
  1355. package/src/flow/internal/ids.ts +9 -0
  1356. package/src/flow/internal/internal.css +152 -0
  1357. package/src/flow/internal/labels.ts +101 -0
  1358. package/src/flow/internal/messageFormat.ts +102 -0
  1359. package/src/flow/internal/useControllable.ts +17 -0
  1360. package/src/flow/layout/autoLayout.test.ts +56 -0
  1361. package/src/flow/layout/autoLayout.ts +93 -0
  1362. package/src/flow/layout/chainLayout.ts +66 -0
  1363. package/src/flow/model/graph.ts +123 -0
  1364. package/src/flow/model/types.ts +83 -0
  1365. package/src/flow/nodes/AgentIdentity.tsx +145 -0
  1366. package/src/flow/nodes/AgentNode.tsx +152 -0
  1367. package/src/flow/nodes/AlignmentGuides.tsx +108 -0
  1368. package/src/flow/nodes/ConnectionPorts.tsx +277 -0
  1369. package/src/flow/nodes/DataSourceNode.tsx +179 -0
  1370. package/src/flow/nodes/GenericNode.tsx +114 -0
  1371. package/src/flow/nodes/GraphNodeCard.css +314 -0
  1372. package/src/flow/nodes/GraphNodeCard.test.tsx +117 -0
  1373. package/src/flow/nodes/GraphNodeCard.tsx +329 -0
  1374. package/src/flow/nodes/GroupNode.tsx +231 -0
  1375. package/src/flow/nodes/NodeRunIndicator.tsx +139 -0
  1376. package/src/flow/nodes/NoteNode.tsx +134 -0
  1377. package/src/flow/nodes/RuleNode.tsx +162 -0
  1378. package/src/flow/nodes/flow-nodes.css +687 -0
  1379. package/src/flow/nodes/groupLayout.ts +66 -0
  1380. package/src/flow/nodes/index.ts +18 -0
  1381. package/src/flow/nodes/nodeChrome.tsx +113 -0
  1382. package/src/flow/nodes/nodes.css +3 -0
  1383. package/src/flow/nodes/nodes.test.tsx +529 -0
  1384. package/src/flow/nodes/ports.ts +127 -0
  1385. package/src/flow/nodes/registry.tsx +262 -0
  1386. package/src/flow/nodes/sourceMarks.tsx +52 -0
  1387. package/src/flow/nodes/types.ts +85 -0
  1388. package/src/flow/provenance/EditionCompare.tsx +292 -0
  1389. package/src/flow/provenance/NumberTrace.tsx +208 -0
  1390. package/src/flow/provenance/ProvenanceCertificate.tsx +263 -0
  1391. package/src/flow/provenance/ProvenanceFilters.tsx +137 -0
  1392. package/src/flow/provenance/ProvenanceGraph.css +1156 -0
  1393. package/src/flow/provenance/ProvenanceGraph.test.tsx +361 -0
  1394. package/src/flow/provenance/ProvenanceGraph.tsx +725 -0
  1395. package/src/flow/provenance/ProvenanceInspector.tsx +201 -0
  1396. package/src/flow/provenance/ProvenanceLegend.tsx +66 -0
  1397. package/src/flow/provenance/ProvenanceNode.tsx +171 -0
  1398. package/src/flow/provenance/ProvenanceShellParts.test.tsx +130 -0
  1399. package/src/flow/provenance/ProvenanceTimeline.tsx +342 -0
  1400. package/src/flow/provenance/ProvenanceTree.tsx +143 -0
  1401. package/src/flow/provenance/ProvenanceViews.css +828 -0
  1402. package/src/flow/provenance/ProvenanceViews.test.tsx +307 -0
  1403. package/src/flow/provenance/index.ts +14 -0
  1404. package/src/flow/provenance/labels.ts +418 -0
  1405. package/src/flow/provenance/model.ts +381 -0
  1406. package/src/flow/provenance/proofTypes.ts +93 -0
  1407. package/src/flow/provenance/provenance.css +3 -0
  1408. package/src/flow/report/ClaimTitle.tsx +15 -0
  1409. package/src/flow/report/ProvenanceTag.test.tsx +37 -0
  1410. package/src/flow/report/ProvenanceTag.tsx +58 -0
  1411. package/src/flow/report/ReportView.test.tsx +59 -0
  1412. package/src/flow/report/ReportView.tsx +359 -0
  1413. package/src/flow/report/index.ts +4 -0
  1414. package/src/flow/report/report.css +267 -0
  1415. package/src/flow/run/ExecutionTimeline.tsx +478 -0
  1416. package/src/flow/run/NumberInput.tsx +59 -0
  1417. package/src/flow/run/RunDrawer.tsx +485 -0
  1418. package/src/flow/run/RunInputDialog.tsx +149 -0
  1419. package/src/flow/run/RunPanel.tsx +136 -0
  1420. package/src/flow/run/RunPreviewPanel.tsx +269 -0
  1421. package/src/flow/run/RunReplayDialog.tsx +278 -0
  1422. package/src/flow/run/RunRewindDialog.tsx +197 -0
  1423. package/src/flow/run/RunStatusMark.tsx +79 -0
  1424. package/src/flow/run/RunTimePanel.test.tsx +55 -0
  1425. package/src/flow/run/RunTimePanel.tsx +143 -0
  1426. package/src/flow/run/RunViews.tsx +170 -0
  1427. package/src/flow/run/ShortId.tsx +15 -0
  1428. package/src/flow/run/VariableInspector.tsx +198 -0
  1429. package/src/flow/run/VersionHistoryPanel.tsx +178 -0
  1430. package/src/flow/run/execution.ts +187 -0
  1431. package/src/flow/run/index.ts +18 -0
  1432. package/src/flow/run/lineage.ts +123 -0
  1433. package/src/flow/run/rewindPlan.ts +79 -0
  1434. package/src/flow/run/run.css +749 -0
  1435. package/src/flow/run/run.test.tsx +533 -0
  1436. package/src/flow/run/runData.ts +124 -0
  1437. package/src/flow/run/types.ts +53 -0
  1438. package/src/flow/state/dialogStack.tsx +90 -0
  1439. package/src/flow/state/editorState.test.tsx +110 -0
  1440. package/src/flow/state/editorState.tsx +296 -0
  1441. package/src/flow/state/graphEdits.ts +107 -0
  1442. package/src/flow/state/store.ts +67 -0
  1443. package/src/flow/steps/AddStepPicker.tsx +108 -0
  1444. package/src/flow/steps/FlowSidePanel.tsx +318 -0
  1445. package/src/flow/steps/IssueBar.tsx +58 -0
  1446. package/src/flow/steps/ShapeChip.tsx +41 -0
  1447. package/src/flow/steps/StepCard.tsx +139 -0
  1448. package/src/flow/steps/StepListView.tsx +152 -0
  1449. package/src/flow/steps/StepPalette.tsx +194 -0
  1450. package/src/flow/steps/StepsContext.tsx +70 -0
  1451. package/src/flow/steps/index.ts +15 -0
  1452. package/src/flow/steps/researchSteps.ts +269 -0
  1453. package/src/flow/steps/shapes.ts +46 -0
  1454. package/src/flow/steps/stepLabels.ts +160 -0
  1455. package/src/flow/steps/stepTools.ts +37 -0
  1456. package/src/flow/steps/steps.css +962 -0
  1457. package/src/flow/steps/steps.test.tsx +351 -0
  1458. package/src/flow/steps/wiring.ts +123 -0
  1459. package/src/flow/styles.css +23 -0
  1460. package/src/flow/surface/CanvasSurface.test.tsx +148 -0
  1461. package/src/flow/surface/CanvasSurface.tsx +674 -0
  1462. package/src/flow/surface/OverviewMap.tsx +50 -0
  1463. package/src/flow/surface/SurfaceContext.tsx +28 -0
  1464. package/src/flow/surface/surface.css +200 -0
  1465. package/src/flow/surface/types.ts +97 -0
  1466. package/src/flow/surface/useElementSize.ts +29 -0
  1467. package/src/flow/surface/useNodeMeasurement.ts +71 -0
  1468. package/src/flow/toolbar/CanvasNodeSearch.tsx +110 -0
  1469. package/src/flow/toolbar/CanvasToolbar.test.tsx +101 -0
  1470. package/src/flow/toolbar/CanvasToolbar.tsx +114 -0
  1471. package/src/flow/toolbar/canvasTools.ts +114 -0
  1472. package/src/flow/toolbar/dockItems.test.tsx +47 -0
  1473. package/src/flow/toolbar/dockItems.tsx +51 -0
  1474. package/src/flow/toolbar/index.ts +5 -0
  1475. package/src/flow/toolbar/toolbar.css +217 -0
  1476. package/src/groups/auth-brand.css +18 -0
  1477. package/src/groups/auth-brand.ts +17 -0
  1478. package/src/groups/charts-geo.css +6 -0
  1479. package/src/groups/charts-geo.ts +98 -0
  1480. package/src/groups/data-a.css +13 -0
  1481. package/src/groups/data-a.ts +14 -0
  1482. package/src/groups/data-b.css +11 -0
  1483. package/src/groups/data-b.ts +11 -0
  1484. package/src/groups/forms-a.css +17 -0
  1485. package/src/groups/forms-a.ts +15 -0
  1486. package/src/groups/forms-b.css +14 -0
  1487. package/src/groups/forms-b.ts +13 -0
  1488. package/src/groups/overlays-nav.css +15 -0
  1489. package/src/groups/overlays-nav.ts +16 -0
  1490. package/src/groups/platform.css +7 -0
  1491. package/src/groups/platform.ts +101 -0
  1492. package/src/groups/shell.css +10 -0
  1493. package/src/groups/shell.ts +10 -0
  1494. package/src/groups/showcase.css +8 -0
  1495. package/src/groups/showcase.ts +9 -0
  1496. package/src/index.ts +68 -0
  1497. package/src/internal/ThemeScope.tsx +28 -0
  1498. package/src/internal/VisuallyHidden.tsx +10 -0
  1499. package/src/internal/cx.ts +4 -0
  1500. package/src/internal/data-a/announce.ts +38 -0
  1501. package/src/internal/data-a/clipboard.ts +11 -0
  1502. package/src/internal/data-b/signed.ts +34 -0
  1503. package/src/internal/data-b/tween.ts +67 -0
  1504. package/src/internal/dev.ts +12 -0
  1505. package/src/internal/dom.ts +42 -0
  1506. package/src/internal/forms-a/LiveNote.tsx +18 -0
  1507. package/src/internal/forms-a/SearchInput.css +125 -0
  1508. package/src/internal/forms-a/SearchInput.tsx +52 -0
  1509. package/src/internal/forms-a/marks.tsx +18 -0
  1510. package/src/internal/forms-a/shared.css +25 -0
  1511. package/src/internal/forms-b/digits.ts +33 -0
  1512. package/src/internal/forms-b/forms-b.css +341 -0
  1513. package/src/internal/forms-b/parts.tsx +151 -0
  1514. package/src/internal/haptics.ts +77 -0
  1515. package/src/internal/icuCatalogue.ts +60 -0
  1516. package/src/internal/inert.ts +15 -0
  1517. package/src/internal/media.ts +35 -0
  1518. package/src/internal/messages/auth-brand.ts +161 -0
  1519. package/src/internal/messages/charts-geo.ts +289 -0
  1520. package/src/internal/messages/core-es.ts +111 -0
  1521. package/src/internal/messages/data-a.ts +199 -0
  1522. package/src/internal/messages/data-b.ts +99 -0
  1523. package/src/internal/messages/forms-a.ts +309 -0
  1524. package/src/internal/messages/forms-b.ts +293 -0
  1525. package/src/internal/messages/overlays-nav.ts +367 -0
  1526. package/src/internal/messages/platform.ts +63 -0
  1527. package/src/internal/messages/plural.ts +24 -0
  1528. package/src/internal/messages/shell.ts +144 -0
  1529. package/src/internal/messages/showcase.ts +12 -0
  1530. package/src/internal/messages.ts +386 -0
  1531. package/src/internal/overlays-nav/fuzzy.ts +115 -0
  1532. package/src/internal/overlays-nav/hold.ts +53 -0
  1533. package/src/internal/overlays-nav/recent.ts +73 -0
  1534. package/src/internal/overlays-nav/state.ts +54 -0
  1535. package/src/internal/platform/touchTrack.ts +49 -0
  1536. package/src/internal/provider.tsx +64 -0
  1537. package/src/internal/speech.ts +24 -0
  1538. package/src/internal/theme.test.tsx +166 -0
  1539. package/src/internal/theme.tsx +181 -0
  1540. package/src/internal/types.ts +4 -0
  1541. package/src/internal/variants.test.ts +14 -0
  1542. package/src/internal/variants.ts +48 -0
  1543. package/src/native-states.css +364 -0
  1544. package/src/styles.css +59 -0
  1545. package/src/utilities/api-error-model/apiErrors.test.ts +74 -0
  1546. package/src/utilities/api-error-model/apiErrors.ts +192 -0
  1547. package/src/utilities/entity-list-loader/useEntityListLoader.test.tsx +72 -0
  1548. package/src/utilities/entity-list-loader/useEntityListLoader.ts +107 -0
  1549. package/src/utilities/formatters/formatters.locales.test.ts +30 -0
  1550. package/src/utilities/formatters/formatters.test.tsx +86 -0
  1551. package/src/utilities/formatters/formatters.ts +190 -0
  1552. package/src/utilities/haptics/haptics.test.tsx +96 -0
  1553. package/src/utilities/haptics/haptics.tsx +79 -0
  1554. package/src/utilities/i18n-adapter/I18nAdapter.test.tsx +70 -0
  1555. package/src/utilities/i18n-adapter/I18nAdapter.tsx +136 -0
  1556. package/src/utilities/i18n-adapter/icu.numeric.test.ts +39 -0
  1557. package/src/utilities/i18n-adapter/icu.ts +207 -0
  1558. package/src/utilities/legacy-alias-map/LEGACY-ALIASES.md +65 -0
  1559. package/src/utilities/legacy-alias-map/legacy-alias-map.test.ts +57 -0
  1560. package/src/utilities/motion-foundation/motion.test.tsx +76 -0
  1561. package/src/utilities/motion-foundation/motion.tsx +119 -0
  1562. package/src/utilities/router-adapter/Routing.test.tsx +68 -0
  1563. package/src/utilities/router-adapter/Routing.tsx +149 -0
  1564. package/src/utilities/view-transition/animatedChange.test.ts +72 -0
  1565. package/src/utilities/view-transition/animatedChange.ts +90 -0
  1566. package/dist/src-Ds9ArSaP.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-uCyIE-Te.js","names":["prefersReducedMotion","prefersReducedMotion","useIsoLayoutEffect","Button","AriaLink","AriaButton","GUTTER","Button","Button","MenuGlyph","Button","Menu","Link","AriaButton","AriaLink","Link","Button","FieldError","AriaButton","fromDate","toDate","Calendar","todayIn","AriaButton","AriaRangeCalendar","AriaCalendar","Checkbox","AriaCheckbox","CheckboxGroup","AriaCheckboxGroup","icons","Button","textOf","AriaTable","AriaCheckbox","AriaButton","fromDate","toDate","todayIn","Calendar","AriaButton","Button","Button","Button","Heading","AriaHeading","toneIcons","Button","Button","AriaButton","AriaLink","AriaButton","Popover","Button","AriaPopover","ProgressBar","AriaProgressBar","AriaHeading","Separator","AriaSeparator","AriaProgressBar","AriaLink","AriaButton","AriaHeading","Switch","AriaSwitch","Tabs","AriaTabs","TabPanel","AriaTabPanel","textOf","Tag","AriaLink","AriaButton","TagList","AriaTagGroup","AriaTagList","AriaTag","TextArea","AriaTextField","AriaTextArea","TextField","AriaButton","AriaTextField","Text","Code","Button","Tooltip","AriaTooltip","AriaButton","AriaSwitch","AriaSwitch","AriaButton","Marker","AriaButton","Button","AriaButton","Heading","AriaButton","CheckboxGroup","Checkbox","AriaButton","AriaTextField","toDate","todayIn","AriaButton","Button","Button","SectionHead","AriaButton","Button","AriaButton","Checkbox","TextArea","TextField","Button","AriaButton","AriaTextField","Button","AriaButton","prefersReducedMotion","AriaButton","AriaLink","Button","Separator","AriaLink","TextField","Button","Switch","AriaLink","Button","AriaButton","MenuIcon","AriaButton","Button","Button","AriaButton","Button","AriaLink","AriaButton","AriaButton","AriaButton","Button","TextField","TextArea","Button","Entry","Switch","Button","AriaLink","AriaButton","AriaButton","Button","TitleLine","ActionStrip","Button","Button","Button","Link","AriaButton","ProgressBar","Button","Link","Tag","AriaButton","Button","Popover","Heading","AriaButton","Link","prefersReducedMotion","useFormatters","Button","STEPS","Button","RegistryContext","RETRIEVED","register","Link","Button","Tag","Button","prefersReducedMotion","step","Button","queryReducedMotion","prefersReducedMotion","prefersReducedMotion","useLocale","useAriaLocale","STEPS","useLocale","Button","useBeforePaint","prefersReducedMotion","AriaHeading","prefersReducedMotion","AriaHeading","AriaLink","Link","AriaLink","AriaHeading","AriaLink","AriaLink","AriaButton","Button","AriaLink","Button","Glyph","Button","AriaLink","Cell","AriaLink"],"sources":["../src/internal/media.ts","../src/internal/theme.tsx","../src/internal/ThemeScope.tsx","../src/internal/VisuallyHidden.tsx","../src/internal/variants.ts","../src/internal/haptics.ts","../src/internal/dom.ts","../src/components/button/Button.tsx","../src/components/action-menu/ActionMenu.tsx","../src/components/actor-chip/ActorChip.tsx","../src/components/skeleton/Skeleton.tsx","../src/components/skip-link/SkipLink.tsx","../src/components/app-frame/frameContext.ts","../src/components/app-frame/RailFrame.tsx","../src/components/app-frame/AppFrame.tsx","../src/components/link/Link.tsx","../src/components/breadcrumbs/Breadcrumbs.tsx","../src/components/field/Field.tsx","../src/components/listbox-select/ListboxSelect.tsx","../src/components/calendar/Calendar.tsx","../src/components/checkbox/Checkbox.tsx","../src/components/empty-state/EmptyState.tsx","../src/components/data-table/DataTable.tsx","../src/internal/forms-b/parts.tsx","../src/components/date-range-field/DateRangeField.tsx","../src/components/drawer/Drawer.tsx","../src/components/error-state/ErrorState.tsx","../src/components/heading/Heading.tsx","../src/components/inline-notice/InlineNotice.tsx","../src/components/modal-dialog/ModalDialog.tsx","../src/components/native-select/NativeSelect.tsx","../src/components/page-header/PageHeader.tsx","../src/components/pagination/Pagination.tsx","../src/components/popover/Popover.tsx","../src/components/progress-bar/ProgressBar.tsx","../src/components/proof-badge/ProofBadge.tsx","../src/components/section-heading/SectionHeading.tsx","../src/components/segmented-control/SegmentedControl.tsx","../src/components/separator/Separator.tsx","../src/internal/inert.ts","../src/components/spinner/Spinner.tsx","../src/components/status-pill/StatusPill.tsx","../src/components/surface/Surface.tsx","../src/components/switch/Switch.tsx","../src/components/tabs/Tabs.tsx","../src/components/tag/Tag.tsx","../src/components/text-area/TextArea.tsx","../src/components/text-field/TextField.tsx","../src/components/text/Text.tsx","../src/components/toast/Toast.tsx","../src/components/tooltip/Tooltip.tsx","../src/components/theme-switcher/ThemeSwitcher.tsx","../src/components/state-switch/StateSwitch.tsx","../src/components/one-time-code-field/OneTimeCodeField.tsx","../src/internal/forms-a/LiveNote.tsx","../src/components/password-strength/PasswordStrength.tsx","../src/internal/forms-a/SearchInput.tsx","../src/internal/forms-a/marks.tsx","../src/components/filter-chips/FilterChips.tsx","../src/components/search-bar/SearchBar.tsx","../src/components/filter-field/FilterField.tsx","../src/components/filter-tile/FilterTile.tsx","../src/components/choice-card/ChoiceCard.tsx","../src/components/choice-tile/ChoiceTile.tsx","../src/components/choice-grid/ChoiceGrid.tsx","../src/components/chip-group/ChipGroup.tsx","../src/components/flag-set-picker/FlagSetPicker.tsx","../src/components/theme-palette/ThemePalette.tsx","../src/components/category-tabs/CategoryTabs.tsx","../src/components/currency-field/CurrencyField.tsx","../src/components/date-field/DateField.tsx","../src/components/form-actions/FormActions.tsx","../src/components/form-layout/FormLayout.tsx","../src/components/image-picker/ImagePicker.tsx","../src/components/locale-picker/LocalePicker.tsx","../src/components/month-field/MonthField.tsx","../src/components/schema-request-form/SchemaRequestForm.tsx","../src/components/tag-field/TagField.tsx","../src/components/time-field/TimeField.tsx","../src/components/wheel-picker/WheelPicker.tsx","../src/internal/overlays-nav/hold.ts","../src/internal/overlays-nav/state.ts","../src/components/app-launcher-grid/AppLauncherGrid.tsx","../src/components/navigation-flyout/NavigationFlyout.tsx","../src/components/app-navigation/builders.ts","../src/components/app-navigation/AppNavigation.tsx","../src/components/command-palette/model.ts","../src/components/command-palette/CommandPalette.tsx","../src/components/compact-confirm/CompactConfirm.tsx","../src/components/confirm-service/ConfirmService.tsx","../src/components/details-popover/DetailsPopover.tsx","../src/components/floating-action-button/FloatingActionButton.tsx","../src/components/long-press-menu/LongPressMenu.tsx","../src/components/page-dots/PageDots.tsx","../src/components/sectioned-modal/SectionedModal.tsx","../src/components/settings-dialog/settingsParts.tsx","../src/components/settings-dialog/SettingsDialog.tsx","../src/components/step-list/StepList.tsx","../src/components/toolbar-trigger/ToolbarTrigger.tsx","../src/components/wizard-page/WizardPage.tsx","../src/components/section-panel/SectionPanel.tsx","../src/components/list-panel/ListPanel.tsx","../src/components/summary-row/SummaryRow.tsx","../src/components/list-row/ListRow.tsx","../src/internal/data-a/announce.ts","../src/components/count-badge/CountBadge.tsx","../src/components/notification-center/NotificationCenter.tsx","../src/components/profile-avatar/ProfileAvatar.tsx","../src/internal/data-a/clipboard.ts","../src/components/copy-identifier/CopyIdentifier.tsx","../src/components/history-list/HistoryList.tsx","../src/components/grouped-disclosure-list/GroupedDisclosureList.tsx","../src/components/recovery-code-list/RecoveryCodeList.tsx","../src/components/markdown-view/MarkdownView.tsx","../src/components/agent-output-card/AgentOutputCard.tsx","../src/components/contact-card/ContactCard.tsx","../src/internal/data-b/signed.ts","../src/components/delta-indicator/DeltaIndicator.tsx","../src/components/insight-card/InsightCard.tsx","../src/components/metric-tile/MetricTile.tsx","../src/components/profile-summary/ProfileSummary.tsx","../src/components/record-card/RecordCard.tsx","../src/components/stat-tile/StatTile.tsx","../src/components/ticker-card/TickerCard.tsx","../src/internal/data-b/tween.ts","../src/components/tweened-number/TweenedNumber.tsx","../src/components/chart/chartMath.ts","../src/components/chart/plot.ts","../src/components/chart/Chart.tsx","../src/components/report-view/sections.tsx","../src/components/report-view/validateReport.ts","../src/components/report-view/ReportView.tsx","../src/components/live-report-view/runEvents.ts","../src/components/live-report-view/useRunEventStream.ts","../src/components/live-report-view/LiveReportView.tsx","../src/components/tone-tint/toneTint.ts","../src/components/region-map/useRegionMapState.ts","../src/components/region-map/RegionMap.tsx","../src/components/region-theme/format.ts","../src/components/region-theme/registry.ts","../src/components/region-theme/countryProfile.ts","../src/components/region-theme/geometry.ts","../src/components/region-theme/data/br.ts","../src/components/region-theme/data/br-profile.ts","../src/components/ambient-backdrop/AmbientBackdrop.tsx","../src/components/brand-panel/BrandPanel.tsx","../src/components/auth-frame/AuthFrame.tsx","../src/components/brand-mark/BrandMark.tsx","../src/components/loader-presets/LoaderPresets.tsx","../src/components/brand-loader/BrandLoader.tsx","../src/components/consent-banner/ConsentBanner.tsx","../src/components/environment-banner/EnvironmentBanner.tsx","../src/components/third-party-mark-slot/ThirdPartyMarkSlot.tsx","../src/components/federated-sign-in/FederatedSignIn.tsx","../src/components/http-error-page/HttpErrorPage.tsx","../src/components/legal-document-frame/LegalDocumentFrame.tsx","../src/components/route-progress/RouteProgress.tsx","../src/components/skeleton-fill/SkeletonFill.tsx","../src/components/upgrade-gate/UpgradeGate.tsx","../src/components/product-mark/marks.ts","../src/components/product-mark/plate.ts","../src/components/product-mark/ProductMark.tsx","../src/utilities/motion-foundation/motion.tsx","../src/utilities/haptics/haptics.tsx","../src/utilities/view-transition/animatedChange.ts","../src/utilities/router-adapter/Routing.tsx","../src/utilities/i18n-adapter/I18nAdapter.tsx","../src/utilities/entity-list-loader/useEntityListLoader.ts","../src/utilities/formatters/formatters.ts","../src/utilities/api-error-model/apiErrors.ts","../src/internal/platform/touchTrack.ts","../src/components/swipe-row/SwipeRow.tsx","../src/components/pull-to-refresh/PullToRefresh.tsx","../src/components/edge-swipe-back/EdgeSwipeBack.tsx","../src/components/safe-area-inset/SafeAreaInset.tsx","../src/components/glass-check-toggle/GlassCheckToggle.tsx","../src/components/cascade-grid/CascadeGrid.tsx","../src/components/showcase-heading/ShowcaseHeading.tsx","../src/components/reveal-number/RevealNumber.tsx","../src/components/showcase-backdrop/ShowcaseBackdrop.tsx","../src/components/feature-showcase-card/FeatureShowcaseCard.tsx","../src/components/ruled-grid/RuledGrid.tsx","../src/components/highlight-stat/HighlightStat.tsx","../src/components/feature-tile/FeatureTile.tsx","../src/components/activity-feed/ActivityFeed.tsx","../src/internal/speech.ts","../src/components/app-frame/RailNav.tsx","../src/components/attention-list/AttentionList.tsx","../src/components/resizable-split/useSplitter.ts","../src/components/evidence-panel/EvidencePanel.tsx","../src/components/floating-action-bar/barModel.ts","../src/components/floating-action-bar/FloatingActionBar.tsx","../src/components/phase-bar/PhaseBar.tsx","../src/components/resizable-split/ResizableSplit.tsx","../src/components/stage-strip/StageStrip.tsx","../src/components/stat-strip/StatStrip.tsx"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\n/** Breakpoints of design direction §2.8 (px). */\nexport const breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280, xxl: 1536 } as const\n\nfunction subscribe(query: string) {\n return (onChange: () => void) => {\n if (typeof window === 'undefined' || !window.matchMedia) return () => {}\n const mql = window.matchMedia(query)\n mql.addEventListener('change', onChange)\n return () => mql.removeEventListener('change', onChange)\n }\n}\n\n/** Live result of a media query; `serverValue` is used without a window. */\nexport function useMediaQuery(query: string, serverValue = false): boolean {\n return useSyncExternalStore(\n subscribe(query),\n () => (typeof window !== 'undefined' && window.matchMedia ? window.matchMedia(query).matches : serverValue),\n () => serverValue,\n )\n}\n\n/** True when the viewport is at least `px` wide (desktop-first layouts). */\nexport function useMinWidth(px: number, serverValue = true): boolean {\n return useMediaQuery(`(min-width: ${px}px)`, serverValue)\n}\n\nexport function useReducedMotion(): boolean {\n return useMediaQuery('(prefers-reduced-motion: reduce)')\n}\n\nexport function prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' && !!window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches\n}\n","import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'\nimport { PRINT_THEME_ALIASES, resolvePrintThemeName } from '@datatechsolutions/tympan-tokens/print-aliases'\nimport { useMediaQuery } from './media.ts'\n\nexport type ThemeMode = 'system' | 'light' | 'dark'\nexport type ThemeDensity = 'compact' | 'default' | 'comfortable'\n\nexport interface ThemeState {\n /** Token theme (`tympan`, `fakhir`, `astrlabe`, `neutral`, `high-contrast`, an opt-in `print-*` theme or a generated one). */\n theme: string\n mode: ThemeMode\n /** `mode` with `system` resolved through `prefers-color-scheme`. */\n resolvedMode: 'light' | 'dark'\n density: ThemeDensity\n setTheme: (theme: string) => void\n setMode: (mode: ThemeMode) => void\n setDensity: (density: ThemeDensity) => void\n}\n\nconst ThemeContext = createContext<ThemeState | null>(null)\n\nexport interface ThemeProviderProps {\n /** Controlled theme; pair with `onThemeChange`. */\n theme?: string\n defaultTheme?: string\n onThemeChange?: (theme: string) => void\n mode?: ThemeMode\n defaultMode?: ThemeMode\n onModeChange?: (mode: ThemeMode) => void\n density?: ThemeDensity\n defaultDensity?: ThemeDensity\n onDensityChange?: (density: ThemeDensity) => void\n /**\n * `document` writes the data attributes on `<html>` (one theme per app);\n * `scope` renders a wrapper element carrying them (previews, embeds).\n */\n target?: 'document' | 'scope'\n /**\n * Optional convenience persistence in localStorage under this key, in the\n * format read by `themeInitScript`. Hosts that persist elsewhere (a user\n * profile, a cookie) leave it unset and use the change callbacks.\n */\n storageKey?: string\n /**\n * Font stylesheet per theme name (for example `printThemeFontUrls` from\n * the tokens package). The URL of the current theme is added as a\n * `<link rel=\"stylesheet\">` (in `<head>` for `document`, inside the wrapper\n * for `scope`); themes without an entry load nothing.\n */\n fonts?: Readonly<Record<string, string>>\n className?: string\n children: ReactNode\n}\n\ninterface Stored {\n theme?: string\n mode?: ThemeMode\n density?: ThemeDensity\n}\n\nfunction readStored(key: string | undefined): Stored {\n if (!key || typeof window === 'undefined') return {}\n try {\n const raw = window.localStorage.getItem(key)\n return raw ? (JSON.parse(raw) as Stored) : {}\n } catch {\n return {}\n }\n}\n\nfunction writeStored(key: string | undefined, value: Stored): void {\n if (!key || typeof window === 'undefined') return\n try {\n window.localStorage.setItem(key, JSON.stringify(value))\n } catch {\n /* storage unavailable: the host callbacks still fire */\n }\n}\n\nfunction useControllable<T>(value: T | undefined, initial: T, onChange?: (v: T) => void): [T, (v: T) => void] {\n const [inner, setInner] = useState(initial)\n const current = value ?? inner\n const set = useCallback(\n (v: T) => {\n if (value === undefined) setInner(v)\n onChange?.(v)\n },\n [value, onChange],\n )\n return [current, set]\n}\n\n/**\n * Theming root. Sets `data-ty-theme`, `data-ty-mode` and `data-ty-density`,\n * which the token stylesheet reads; no styles are injected at runtime.\n */\nexport function ThemeProvider(props: ThemeProviderProps) {\n const { target = 'document', storageKey, fonts, className, children } = props\n const stored = useMemo(() => readStored(storageKey), [storageKey])\n const [storedTheme, setStoredTheme] = useControllable(props.theme, stored.theme ?? props.defaultTheme ?? 'tympan', props.onThemeChange)\n // A deprecated print theme name (`print-<old style id>`, see PRINT_THEME_ALIASES) is read as the renamed theme.\n const theme = resolvePrintThemeName(storedTheme)\n const setTheme = useCallback((t: string) => setStoredTheme(resolvePrintThemeName(t)), [setStoredTheme])\n const [mode, setMode] = useControllable<ThemeMode>(props.mode, stored.mode ?? props.defaultMode ?? 'system', props.onModeChange)\n const [density, setDensity] = useControllable<ThemeDensity>(\n props.density,\n stored.density ?? props.defaultDensity ?? 'default',\n props.onDensityChange,\n )\n const systemDark = useMediaQuery('(prefers-color-scheme: dark)')\n const resolvedMode = mode === 'system' ? (systemDark ? 'dark' : 'light') : mode\n\n useEffect(() => {\n writeStored(storageKey, { theme, mode, density })\n }, [storageKey, theme, mode, density])\n\n useEffect(() => {\n if (target !== 'document' || typeof document === 'undefined') return\n const el = document.documentElement\n el.setAttribute('data-ty-theme', theme)\n el.setAttribute('data-ty-mode', mode)\n el.setAttribute('data-ty-density', density)\n }, [target, theme, mode, density])\n\n const fontsHref = fonts?.[theme]\n useEffect(() => {\n if (target !== 'document' || typeof document === 'undefined') return\n const existing = document.head.querySelector<HTMLLinkElement>('link[data-ty-theme-fonts]')\n if (!fontsHref) {\n existing?.remove()\n return\n }\n const link = existing ?? document.createElement('link')\n link.rel = 'stylesheet'\n link.setAttribute('data-ty-theme-fonts', '')\n if (link.getAttribute('href') !== fontsHref) link.href = fontsHref\n if (!existing) document.head.appendChild(link)\n }, [target, fontsHref])\n\n const value = useMemo<ThemeState>(\n () => ({ theme, mode, resolvedMode, density, setTheme, setMode, setDensity }),\n [theme, mode, resolvedMode, density, setTheme, setMode, setDensity],\n )\n\n return (\n <ThemeContext.Provider value={value}>\n {target === 'scope' ? (\n <div className={className ? `ty-theme-scope ${className}` : 'ty-theme-scope'} data-ty-theme={theme} data-ty-mode={mode} data-ty-density={density}>\n {fontsHref ? <link rel=\"stylesheet\" href={fontsHref} data-ty-theme-fonts=\"\" /> : null}\n {children}\n </div>\n ) : (\n children\n )}\n </ThemeContext.Provider>\n )\n}\n\n/** Current theme state; throws outside a ThemeProvider. */\nexport function useTheme(): ThemeState {\n const ctx = useContext(ThemeContext)\n if (!ctx) throw new Error('useTheme must be used inside <ThemeProvider>.')\n return ctx\n}\n\n/**\n * Inline script for the SPA's index.html, placed in <head> before any\n * stylesheet, so the stored theme applies before first paint (no flash of the\n * wrong theme). It only sets attributes; it reads the same key as\n * `ThemeProvider storageKey`.\n */\nexport function themeInitScript(storageKey = 'ty-theme', defaults: Stored = {}, options: { fonts?: Readonly<Record<string, string>> } = {}): string {\n const d = JSON.stringify({ theme: defaults.theme ?? 'tympan', mode: defaults.mode ?? 'system', density: defaults.density ?? 'default' })\n // Optional: the font stylesheet of the stored theme, added before first paint (same link ThemeProvider `fonts` manages).\n const fonts = options.fonts && Object.keys(options.fonts).length\n ? `var f=${JSON.stringify(options.fonts).replace(/</g, '\\\\u003c')}[t];if(f){var l=document.createElement('link');l.rel='stylesheet';l.href=f;l.setAttribute('data-ty-theme-fonts','');document.head.appendChild(l);}`\n : ''\n // Deprecated print theme names map to the renamed theme (PRINT_THEME_ALIASES), as in ThemeProvider.\n const aliases = JSON.stringify(PRINT_THEME_ALIASES).replace(/</g, '\\\\u003c')\n return `(function(){try{var d=${d};var s=JSON.parse(localStorage.getItem(${JSON.stringify(storageKey)})||'{}');var e=document.documentElement;var t=s.theme||d.theme;var a=${aliases};if(Object.prototype.hasOwnProperty.call(a,t))t=a[t];e.setAttribute('data-ty-theme',t);e.setAttribute('data-ty-mode',s.mode||d.mode);e.setAttribute('data-ty-density',s.density||d.density);${fonts}}catch(_){}})();`\n}\n","import type { HTMLAttributes, ReactNode } from 'react'\nimport { cx } from './cx'\n\nexport interface ThemeScopeProps extends HTMLAttributes<HTMLDivElement> {\n /** Token theme; `tympan` is the default when omitted. */\n theme?: string\n /** Colour mode; follows the operating system when omitted or `system`. */\n mode?: 'system' | 'light' | 'dark'\n /** Alias of `mode`. */\n scheme?: 'light' | 'dark'\n density?: 'compact' | 'default' | 'comfortable'\n children?: ReactNode\n}\n\n/** Applies a theme, mode and density to a subtree through the data attributes read by the token stylesheet. */\nexport function ThemeScope({ theme, mode, scheme, density, className, children, ...rest }: ThemeScopeProps) {\n return (\n <div\n {...rest}\n className={cx('ty-theme-scope', className)}\n data-ty-theme={theme}\n data-ty-mode={mode ?? scheme}\n data-ty-density={density}\n >\n {children}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\n\n/** Text available to assistive technology but not drawn. */\nexport function VisuallyHidden({ children, id }: { children: ReactNode; id?: string }) {\n return (\n <span className=\"ty-visually-hidden\" id={id}>\n {children}\n </span>\n )\n}\n","// Variants declared as data. A component lists its variant axes and their\n// allowed values once; the returned function validates props, applies\n// defaults and yields `data-*` attributes that the component's CSS selects on\n// (`.ty-button[data-variant='primary']`). No class strings are generated.\n\nexport type VariantConfig = Record<string, readonly string[]>\n\ntype Selection<C extends VariantConfig> = { [K in keyof C]?: C[K][number] }\ntype Resolved<C extends VariantConfig> = { [K in keyof C]: C[K][number] }\ntype DataAttributes<C extends VariantConfig> = { [K in keyof C as `data-${K & string}`]: C[K][number] }\n\nexport interface Variants<C extends VariantConfig> {\n /** Resolved values with defaults applied. */\n resolve(selection: Selection<C>): Resolved<C>\n /** `data-*` attributes for the resolved values. */\n attributes(selection: Selection<C>): DataAttributes<C>\n /** The declared axes (for documentation, galleries and tests). */\n readonly axes: C\n readonly defaults: Resolved<C>\n}\n\nconst kebab = (s: string) => s.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)\n\nexport function variants<const C extends VariantConfig>(axes: C, defaults: Resolved<C>): Variants<C> {\n const resolve = (selection: Selection<C>): Resolved<C> => {\n const out = { ...defaults }\n for (const key of Object.keys(axes) as Array<keyof C>) {\n const value = selection[key]\n if (value === undefined) continue\n if (!axes[key]!.includes(value as string)) {\n throw new Error(`Unknown ${String(key)} \"${String(value)}\"; expected one of ${axes[key]!.join(', ')}.`)\n }\n out[key] = value as Resolved<C>[typeof key]\n }\n return out\n }\n return {\n axes,\n defaults,\n resolve,\n attributes(selection) {\n const resolved = resolve(selection)\n const attrs: Record<string, string> = {}\n for (const [k, v] of Object.entries(resolved)) attrs[`data-${kebab(k)}`] = v as string\n return attrs as DataAttributes<C>\n },\n }\n}\n","import { createContext, useContext } from 'react'\nimport { prefersReducedMotion } from './media'\n\nexport type HapticStrength = 'none' | 'light' | 'medium'\n\nconst pattern: Record<Exclude<HapticStrength, 'none'>, number> = { light: 8, medium: 16 }\n\n/* ------------------------------------------------------------------------ */\n/* User-gesture gate */\n/* ------------------------------------------------------------------------ */\n\n// Browsers ignore (and warn about) navigator.vibrate before the page has had a\n// user gesture, so nothing here calls it until one has happened. Where the\n// User Activation API exists it decides; elsewhere a first pointer, touch or\n// key press seen by this module opens the gate.\nlet gestureSeen = false\nconst GESTURES = ['pointerdown', 'touchstart', 'keydown', 'mousedown'] as const\n\nfunction onGesture() {\n gestureSeen = true\n for (const type of GESTURES) window.removeEventListener(type, onGesture, true)\n}\n\nif (typeof window !== 'undefined') {\n for (const type of GESTURES) window.addEventListener(type, onGesture, { capture: true, passive: true })\n}\n\n/** True once the person has interacted with the page (sticky user activation). */\nexport function hasUserGesture(): boolean {\n if (typeof navigator === 'undefined') return false\n const activation = (navigator as Navigator & { userActivation?: { hasBeenActive: boolean } }).userActivation\n if (activation && typeof activation.hasBeenActive === 'boolean') return activation.hasBeenActive || gestureSeen\n return gestureSeen\n}\n\n/** Test hook: forget any gesture seen so far. */\nexport function resetUserGestureForTests(): void {\n gestureSeen = false\n if (typeof window !== 'undefined') for (const type of GESTURES) window.addEventListener(type, onGesture, { capture: true, passive: true })\n}\n\n/* ------------------------------------------------------------------------ */\n/* The person's preference */\n/* ------------------------------------------------------------------------ */\n\n/** The person's \"haptics\" preference (HapticsPreference provides it; on by default). */\nexport const HapticsEnabledContext = createContext(true)\n\nexport function useHapticsEnabled(): boolean {\n return useContext(HapticsEnabledContext)\n}\n\n/* ------------------------------------------------------------------------ */\n\n/** The Vibration API, or null. Only callable after a user gesture. */\nexport function gatedVibrate(): ((p: number | number[]) => boolean) | null {\n if (typeof navigator === 'undefined' || !hasUserGesture()) return null\n const fn = (navigator as { vibrate?: unknown }).vibrate\n return typeof fn === 'function' ? (p) => (fn as (p: number | number[]) => boolean).call(navigator, p) : null\n}\n\n/**\n * Short feedback vibration for components: silent without the Vibration API,\n * under reduced motion, when the person turned haptics off (`enabled: false`)\n * and before any user gesture.\n */\nexport function requestHaptic(strength: HapticStrength, options: { enabled?: boolean } = {}): void {\n if (strength === 'none' || options.enabled === false) return\n if (prefersReducedMotion()) return\n const vibrate = gatedVibrate()\n if (!vibrate) return\n try {\n vibrate(pattern[strength])\n } catch {\n /* unsupported */\n }\n}\n","import { useCallback, useLayoutEffect, type Ref, type RefObject } from 'react'\n\nconst useIsoLayoutEffect = typeof window === 'undefined' ? () => {} : useLayoutEffect\n\n/**\n * Sets (or removes) DOM attributes that a React Aria primitive does not\n * forward, such as `aria-busy` on a button.\n */\nexport function useDomAttributes(ref: RefObject<Element | null>, attrs: Record<string, string | undefined | false>): void {\n const key = JSON.stringify(attrs)\n useIsoLayoutEffect(() => {\n const el = ref.current\n if (!el) return\n for (const [name, value] of Object.entries(attrs)) {\n if (value === undefined || value === false) el.removeAttribute(name)\n else el.setAttribute(name, value)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [ref, key])\n}\n\n/** Combines several refs into one callback ref. */\nexport function useMergedRefs<T>(...refs: Array<Ref<T> | undefined>): (value: T | null) => void {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback((value: T | null) => {\n for (const r of refs) {\n if (typeof r === 'function') r(value)\n else if (r && typeof r === 'object') (r as { current: T | null }).current = value\n }\n }, refs)\n}\n\n/** True for absolute http(s) URLs pointing to another origin. */\nexport function isExternalHref(href: string | undefined): boolean {\n if (!href || !/^https?:\\/\\//i.test(href)) return false\n try {\n const origin = typeof window !== 'undefined' ? window.location.origin : ''\n return new URL(href).origin !== origin\n } catch {\n return false\n }\n}\n","import { LoaderCircle } from 'lucide-react'\nimport { forwardRef, useLayoutEffect, useRef, useState, type ReactNode } from 'react'\nimport { Button as AriaButton, Link as AriaLink, type PressEvent } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useDomAttributes, useMergedRefs } from '../../internal/dom'\nimport { requestHaptic, type HapticStrength } from '../../internal/haptics'\nimport { variants } from '../../internal/variants'\nimport type { RouterNavigateOptions } from '../../internal/provider'\n\n/** Variant axes of the button, declared as data (CSS selects on the data attributes). */\nexport const buttonVariants = variants(\n {\n variant: ['primary', 'secondary', 'quiet', 'danger'],\n size: ['compact', 'regular', 'large'],\n shape: ['rounded', 'pill', 'circle'],\n } as const,\n { variant: 'secondary', size: 'regular', shape: 'rounded' },\n)\nexport type ButtonVariant = (typeof buttonVariants.axes.variant)[number]\nexport type ButtonSize = (typeof buttonVariants.axes.size)[number]\nexport type ButtonShape = (typeof buttonVariants.axes.shape)[number]\n\nexport interface ButtonProps {\n /** Visual weight (§2.10). At most one `primary` per view. */\n variant?: ButtonVariant\n /** Visible height step; `compact` only inside compact tables. */\n size?: ButtonSize\n /** `circle` only for icon-only buttons. */\n shape?: ButtonShape\n /** Hides the label; `accessibleLabel` is then required. */\n iconOnly?: boolean\n /** Accessible name when there is no visible label; also the tooltip text. */\n accessibleLabel?: string\n leadingIcon?: ReactNode\n trailingIcon?: ReactNode\n /** Renders a link through the router adapter; `onPress` still fires. */\n href?: string\n routerOptions?: RouterNavigateOptions\n target?: string\n rel?: string\n type?: 'button' | 'submit' | 'reset'\n /** Shows the busy indicator, blocks presses, keeps the width stable. */\n busy?: boolean\n /** Replaces the label while busy. */\n busyLabel?: string\n disabled?: boolean\n /** Keeps a disabled button in the tab order (reports `aria-disabled`). */\n focusableWhenDisabled?: boolean\n fullWidth?: boolean\n onPress?: (event: PressEvent) => void\n /** Haptic feedback on press start (`danger` defaults to medium). */\n haptic?: HapticStrength\n /** Link mode: marks the link as the current page. */\n current?: boolean\n children?: ReactNode\n className?: string\n id?: string\n form?: string\n name?: string\n value?: string\n autoFocus?: boolean\n 'aria-describedby'?: string\n 'aria-controls'?: string\n 'aria-expanded'?: boolean\n 'aria-haspopup'?: boolean | 'menu' | 'dialog' | 'listbox'\n 'aria-pressed'?: boolean\n slot?: string\n}\n\n/** Triggers one action or navigates to one destination (spec: wave-1/button.md). */\nexport const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(function Button(props, forwardedRef) {\n const {\n variant = 'secondary',\n size = 'regular',\n shape = 'rounded',\n iconOnly = false,\n accessibleLabel,\n leadingIcon,\n trailingIcon,\n href,\n routerOptions,\n target,\n rel,\n type = 'button',\n busy = false,\n busyLabel,\n disabled = false,\n focusableWhenDisabled = false,\n fullWidth = false,\n onPress,\n haptic,\n current = false,\n children,\n className,\n ...rest\n } = props\n\n devWarning(iconOnly && !accessibleLabel, 'Button: `iconOnly` requires `accessibleLabel`.')\n\n const innerRef = useRef<HTMLButtonElement | HTMLAnchorElement | null>(null)\n const ref = useMergedRefs(innerRef, forwardedRef)\n const softDisabled = disabled && focusableWhenDisabled\n const hardDisabled = disabled && !focusableWhenDisabled\n const strength: HapticStrength = haptic ?? (variant === 'danger' ? 'medium' : 'light')\n\n // Keep the width stable while busy: freeze the current width as a minimum.\n const [minWidth, setMinWidth] = useState<number | undefined>(undefined)\n useLayoutEffect(() => {\n if (busy && innerRef.current) setMinWidth(innerRef.current.getBoundingClientRect().width || undefined)\n if (!busy) setMinWidth(undefined)\n }, [busy])\n\n useDomAttributes(innerRef, {\n 'aria-busy': busy ? 'true' : undefined,\n 'aria-disabled': softDisabled || busy ? 'true' : undefined,\n 'aria-current': href && current ? 'page' : undefined,\n title: iconOnly && accessibleLabel ? accessibleLabel : undefined,\n })\n\n // React Aria forwards data-* attributes; CSS keys variants off them.\n const dataAttrs = {\n ...buttonVariants.attributes({ variant, size, shape }),\n 'data-icon-only': iconOnly || undefined,\n 'data-busy': busy || undefined,\n 'data-full-width': fullWidth || undefined,\n 'data-soft-disabled': softDisabled || undefined,\n 'data-current': (href && current) || undefined,\n }\n\n const blocked = busy || softDisabled\n const handlePress = (e: PressEvent) => {\n if (blocked) return\n onPress?.(e)\n }\n const handlePressStart = () => {\n if (!blocked && !hardDisabled) requestHaptic(strength)\n }\n\n const label = busy && busyLabel ? busyLabel : children\n const content = (\n <>\n {busy ? (\n <LoaderCircle className=\"ty-icon ty-button__busy\" aria-hidden=\"true\" focusable=\"false\" />\n ) : leadingIcon ? (\n <span className=\"ty-button__icon\" aria-hidden=\"true\">\n {leadingIcon}\n </span>\n ) : null}\n {iconOnly ? null : <span className=\"ty-button__label\">{label}</span>}\n {trailingIcon && !iconOnly ? (\n <span className=\"ty-button__icon\" aria-hidden=\"true\">\n {trailingIcon}\n </span>\n ) : null}\n </>\n )\n\n const classes = cx('ty-button', className)\n const style = minWidth ? { minInlineSize: `${minWidth}px` } : undefined\n const ariaLabel = iconOnly ? accessibleLabel : busy && busyLabel ? busyLabel : undefined\n\n if (href) {\n return (\n <AriaLink\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={blocked ? undefined : href}\n routerOptions={routerOptions}\n target={target}\n rel={rel}\n isDisabled={hardDisabled}\n onPress={handlePress}\n onPressStart={handlePressStart}\n className={classes}\n style={style}\n aria-label={ariaLabel}\n id={rest.id}\n aria-describedby={rest['aria-describedby']}\n autoFocus={rest.autoFocus}\n slot={rest.slot}\n {...dataAttrs}\n >\n {content}\n </AriaLink>\n )\n }\n\n return (\n <AriaButton\n {...rest}\n ref={ref as React.Ref<HTMLButtonElement>}\n type={type}\n isDisabled={hardDisabled}\n isPending={busy}\n onPress={handlePress}\n onPressStart={handlePressStart}\n className={classes}\n style={style}\n aria-label={ariaLabel}\n {...dataAttrs}\n >\n {content}\n </AriaButton>\n )\n})\n","import { Ellipsis } from 'lucide-react'\nimport {\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from 'react'\nimport {\n Header,\n Keyboard,\n Menu,\n MenuItem,\n MenuSection,\n MenuTrigger,\n Popover,\n Separator,\n Text,\n type Key,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\nimport { Button } from '../button/Button'\n\nexport interface ActionMenuItem {\n type?: 'item'\n id: string\n label: string\n icon?: IconComponent\n tone?: 'default' | 'danger'\n disabled?: boolean\n shortcut?: string\n /** Makes the item a link (navigates through the router adapter). */\n href?: string\n}\nexport interface ActionMenuSeparator {\n type: 'separator'\n id?: string\n}\nexport interface ActionMenuSection {\n type: 'section'\n id: string\n title: string\n items: ActionMenuItem[]\n}\nexport type ActionMenuEntry = ActionMenuItem | ActionMenuSeparator | ActionMenuSection\n\nexport interface ActionMenuPosition {\n x: number\n y: number\n}\n\nexport interface ActionMenuProps {\n items: ActionMenuEntry[]\n onAction: (id: string) => void\n /** Accessible name of the menu. */\n label: string\n /** `trigger`: opens from a button; `context`: opens at a pointer position over `trigger`. */\n mode?: 'trigger' | 'context'\n /** Trigger mode: the button. Context mode: the target that receives the context request. */\n trigger?: ReactNode\n /** Context mode: viewport point (controlled). */\n position?: ActionMenuPosition\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n className?: string\n}\n\nconst GUTTER = 8\nconst LONG_PRESS_MS = 500\n\nfunction collectDisabled(items: ActionMenuEntry[]): string[] {\n const out: string[] = []\n for (const e of items) {\n if (e.type === 'section') out.push(...collectDisabled(e.items))\n else if (e.type !== 'separator' && e.disabled) out.push(e.id)\n }\n return out\n}\n\nfunction renderItem(item: ActionMenuItem) {\n const Icon = item.icon\n return (\n <MenuItem\n key={item.id}\n id={item.id}\n textValue={item.label}\n href={item.href}\n className=\"ty-action-menu__item\"\n data-tone={item.tone ?? 'default'}\n >\n {Icon ? <Icon className=\"ty-icon ty-action-menu__icon\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n <Text slot=\"label\" className=\"ty-action-menu__label\">\n {item.label}\n </Text>\n {item.shortcut ? <Keyboard className=\"ty-action-menu__shortcut\">{item.shortcut}</Keyboard> : null}\n </MenuItem>\n )\n}\n\nfunction renderEntries(items: ActionMenuEntry[]) {\n return items.map((entry, i) => {\n if (entry.type === 'separator') return <Separator key={entry.id ?? `separator-${i}`} className=\"ty-action-menu__separator\" />\n if (entry.type === 'section') {\n return (\n <MenuSection key={entry.id} id={entry.id} className=\"ty-action-menu__section\">\n <Header className=\"ty-action-menu__section-title\">{entry.title}</Header>\n {entry.items.map(renderItem)}\n </MenuSection>\n )\n }\n return renderItem(entry)\n })\n}\n\n/** Clamps a point so a box of `width` x `height` stays inside the viewport. */\nexport function clampToViewport(point: ActionMenuPosition, width: number, height: number): ActionMenuPosition {\n const vw = typeof window !== 'undefined' ? window.innerWidth : width\n const vh = typeof window !== 'undefined' ? window.innerHeight : height\n return {\n x: Math.max(GUTTER, Math.min(point.x, vw - width - GUTTER)),\n y: Math.max(GUTTER, Math.min(point.y, vh - height - GUTTER)),\n }\n}\n\n/** Commands from a trigger button or at a pointer position (spec: wave-1/action-menu.md). */\nexport function ActionMenu(props: ActionMenuProps) {\n const { items, onAction, label, mode = 'trigger', trigger, className } = props\n const messages = useMessages()\n const [uncontrolledOpen, setUncontrolledOpen] = useState(props.defaultOpen ?? false)\n const isOpen = props.open ?? uncontrolledOpen\n const setOpen = (next: boolean) => {\n if (props.open === undefined) setUncontrolledOpen(next)\n props.onOpenChange?.(next)\n }\n const labelId = useId()\n const disabledKeys = collectDisabled(items)\n const handleAction = (key: Key) => {\n if (disabledKeys.includes(String(key))) return\n onAction(String(key))\n }\n\n const menu = (\n <Menu\n aria-labelledby={labelId}\n className=\"ty-action-menu__menu\"\n disabledKeys={disabledKeys}\n onAction={handleAction}\n shouldFocusWrap\n {...(mode === 'context' ? { autoFocus: 'first' as const, onClose: () => setOpen(false) } : {})}\n >\n {renderEntries(items)}\n </Menu>\n )\n\n if (mode === 'trigger') {\n return (\n <MenuTrigger isOpen={isOpen} onOpenChange={setOpen}>\n {trigger ?? <Button iconOnly accessibleLabel={messages.moreActions} leadingIcon={<Ellipsis />} variant=\"quiet\" />}\n <Popover className={cx('ty-action-menu', className)} placement=\"bottom end\" offset={8}>\n <span id={labelId} className=\"ty-visually-hidden\">\n {label}\n </span>\n {menu}\n </Popover>\n </MenuTrigger>\n )\n }\n\n return (\n <ContextActionMenu {...props} isOpen={isOpen} setOpen={setOpen} menu={menu} labelId={labelId} className={className}>\n {trigger}\n </ContextActionMenu>\n )\n}\n\ninterface ContextInternalProps extends ActionMenuProps {\n isOpen: boolean\n setOpen: (open: boolean) => void\n menu: ReactNode\n labelId: string\n children: ReactNode\n}\n\nfunction ContextActionMenu({ isOpen, setOpen, menu, labelId, label, children, className, position }: ContextInternalProps) {\n const targetRef = useRef<HTMLSpanElement>(null)\n const anchorRef = useRef<HTMLSpanElement>(null)\n const popoverRef = useRef<HTMLDivElement>(null)\n const originRef = useRef<HTMLElement | null>(null)\n const longPress = useRef<number | undefined>(undefined)\n const [point, setPoint] = useState<ActionMenuPosition>(position ?? { x: 0, y: 0 })\n const [clamped, setClamped] = useState<ActionMenuPosition>(point)\n const effective = position ?? point\n\n const openAt = (p: ActionMenuPosition) => {\n const active = document.activeElement\n originRef.current = active instanceof HTMLElement && active !== document.body ? active : targetRef.current\n setPoint(p)\n setOpen(true)\n }\n\n const onContextMenu = (e: ReactMouseEvent) => {\n e.preventDefault()\n openAt({ x: e.clientX, y: e.clientY })\n }\n const onKeyDown = (e: ReactKeyboardEvent) => {\n if ((e.shiftKey && e.key === 'F10') || e.key === 'ContextMenu') {\n e.preventDefault()\n const el = (e.target as HTMLElement) ?? targetRef.current\n const rect = el.getBoundingClientRect()\n openAt({ x: rect.left, y: rect.bottom })\n }\n }\n const onPointerDown = (e: ReactPointerEvent) => {\n if (e.pointerType !== 'touch') return\n const { clientX, clientY } = e\n window.clearTimeout(longPress.current)\n longPress.current = window.setTimeout(() => openAt({ x: clientX, y: clientY }), LONG_PRESS_MS)\n }\n const cancelLongPress = () => window.clearTimeout(longPress.current)\n\n useLayoutEffect(() => {\n if (!isOpen) return\n const el = popoverRef.current\n const rect = el?.getBoundingClientRect()\n setClamped(clampToViewport(effective, rect?.width ?? 0, rect?.height ?? 0))\n }, [isOpen, effective.x, effective.y])\n\n const handleOpenChange = (next: boolean) => {\n setOpen(next)\n if (!next) {\n const origin = originRef.current\n requestAnimationFrame(() => {\n if (origin && (document.activeElement === document.body || document.activeElement === null)) origin.focus()\n })\n }\n }\n\n return (\n <>\n <span\n ref={targetRef}\n className=\"ty-action-menu__target\"\n onContextMenu={onContextMenu}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onPointerUp={cancelLongPress}\n onPointerCancel={cancelLongPress}\n onPointerMove={cancelLongPress}\n >\n {children}\n </span>\n <span\n ref={anchorRef}\n aria-hidden=\"true\"\n className=\"ty-action-menu__anchor\"\n style={{ position: 'fixed', left: effective.x, top: effective.y, width: 0, height: 0 }}\n />\n <Popover\n ref={popoverRef}\n triggerRef={anchorRef}\n isOpen={isOpen}\n onOpenChange={handleOpenChange}\n placement=\"bottom start\"\n offset={0}\n className={cx('ty-action-menu', className)}\n data-mode=\"context\"\n style={{ position: 'fixed', left: clamped.x, top: clamped.y }}\n >\n <span id={labelId} className=\"ty-visually-hidden\">\n {label}\n </span>\n {menu}\n </Popover>\n </>\n )\n}\n","import { Server, User } from 'lucide-react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Avatar } from '../avatar/Avatar'\n\n/** Contract actor kinds (`user | agent | system`); `person` is accepted as an alias of `user`. */\nexport type ActorKind = 'user' | 'person' | 'agent' | 'system'\n\nexport interface ActorChipProps {\n kind: ActorKind\n /** Person name, agent name, or the rule/job name of a system actor. */\n name: string\n /** Person only: e-mail shown as meta. */\n email?: string\n /** Person only: avatar image. */\n avatarSrc?: string | null\n /** Person only: initials; derived from `name` when omitted. */\n initials?: string\n /** Person only: false shows the person icon instead of an avatar (lists without avatars). */\n avatar?: boolean\n /** Agent only: key identifier, shown in mono. */\n agentKey?: string\n /** Agent only: model, shown in mono. */\n model?: string\n /** Name and kind only: no e-mail, key or model. */\n compact?: boolean\n className?: string\n}\n\nfunction initialsOf(name: string): string {\n const words = name.trim().split(/\\s+/).filter(Boolean)\n if (words.length === 0) return ''\n const first = words[0]!.charAt(0)\n const last = words.length > 1 ? words[words.length - 1]!.charAt(0) : ''\n return (first + last).toUpperCase()\n}\n\n/**\n * Who did something: a person, an agent or the system (design direction\n * §2.11). An agent is never round and never has initials; a person is never\n * identified primarily by a mono id. Place it before the date in activity rows.\n */\nexport function ActorChip({ kind, name, email, avatarSrc, initials, avatar = true, agentKey, model, compact = false, className }: ActorChipProps) {\n const messages = useMessages()\n const k = kind === 'user' ? 'person' : kind\n\n if (k === 'agent') {\n const meta = [agentKey, model].filter(Boolean)\n return (\n <span className={cx('ty-actor-chip', className)} data-kind=\"agent\" data-compact={compact || undefined}>\n <Avatar actorKind=\"agent\" decorative size={compact ? 'xsmall' : 'small'} />\n <span className=\"ty-actor-chip__text\">\n <span className=\"ty-actor-chip__line\">\n <span className=\"ty-actor-chip__name\">{name}</span>{' '}\n <span className=\"ty-actor-chip__kind\">{messages.actor.agent}</span>\n </span>\n {!compact && meta.length > 0 ? (\n <span className=\"ty-actor-chip__meta\">\n {meta.map((m) => (\n <code key={m} className=\"ty-actor-chip__mono\">\n {m}\n </code>\n ))}\n </span>\n ) : null}\n </span>\n </span>\n )\n }\n\n if (k === 'system') {\n return (\n <span className={cx('ty-actor-chip', className)} data-kind=\"system\" data-compact={compact || undefined}>\n <Server className=\"ty-actor-chip__icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-actor-chip__text\">\n <span className=\"ty-actor-chip__line\">\n <span className=\"ty-actor-chip__kind\">{messages.actor.system}</span>{' '}\n <code className=\"ty-actor-chip__mono ty-actor-chip__rule\">{name}</code>\n </span>\n </span>\n </span>\n )\n }\n\n return (\n <span className={cx('ty-actor-chip', className)} data-kind=\"person\" data-compact={compact || undefined}>\n {avatar ? (\n <Avatar decorative src={avatarSrc ?? null} fallbackText={initials ?? initialsOf(name)} size={compact ? 'xsmall' : 'small'} />\n ) : (\n <User className=\"ty-actor-chip__icon\" aria-hidden=\"true\" focusable=\"false\" />\n )}\n <span className=\"ty-actor-chip__text\">\n <span className=\"ty-actor-chip__name\">{name}</span>\n {!compact && email ? <span className=\"ty-actor-chip__meta\">{email}</span> : null}\n </span>\n </span>\n )\n}\n","import type { CSSProperties, ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type SkeletonShape = 'line' | 'heading' | 'circle' | 'rect'\nexport type SkeletonWidth = 'short' | 'medium' | 'long' | 'full' | (string & {})\nexport type SkeletonPreset = 'stats' | 'cards' | 'section-heading' | 'filters' | 'analysis'\n\nexport interface SkeletonProps {\n shape?: SkeletonShape\n width?: SkeletonWidth\n /** Stacked text lines with automatically varied widths. */\n lines?: number\n /** Composed skeleton instead of a single block. */\n preset?: SkeletonPreset\n count?: number\n columns?: 1 | 2 | 3 | 4\n className?: string\n}\n\nconst namedWidths = new Set(['short', 'medium', 'long', 'full'])\nconst lineCycle: SkeletonWidth[] = ['long', 'full', 'medium']\n\nfunction Block({ shape = 'line', width = 'full', className }: { shape?: SkeletonShape; width?: SkeletonWidth; className?: string }) {\n const named = namedWidths.has(width)\n const style: CSSProperties | undefined = named ? undefined : { inlineSize: width }\n return (\n <span\n className={cx('ty-skeleton', className)}\n data-shape={shape}\n data-width={named ? width : 'custom'}\n style={style}\n />\n )\n}\n\nfunction Lines({ lines, width }: { lines: number; width?: SkeletonWidth }) {\n return (\n <span className=\"ty-skeleton-lines\">\n {Array.from({ length: lines }, (_, i) => {\n const w = lines === 1 ? (width ?? 'full') : i === lines - 1 ? 'short' : (lineCycle[i % lineCycle.length] ?? 'full')\n return <Block key={i} shape=\"line\" width={w} />\n })}\n </span>\n )\n}\n\nfunction Grid({ columns, children, kind }: { columns: number; children: ReactNode; kind: string }) {\n return (\n <span className=\"ty-skeleton-grid\" data-preset={kind} style={{ '--ty-skeleton-columns': columns } as CSSProperties}>\n {children}\n </span>\n )\n}\n\nfunction Preset({ preset, count, columns }: { preset: SkeletonPreset; count?: number; columns?: number }) {\n switch (preset) {\n case 'stats': {\n const n = count ?? 4\n return (\n <Grid columns={columns ?? n} kind=\"stats\">\n {Array.from({ length: n }, (_, i) => (\n <span key={i} className=\"ty-skeleton-tile\" data-part=\"stat\">\n <Block shape=\"circle\" />\n <Block shape=\"heading\" width=\"medium\" />\n <Block shape=\"line\" width=\"short\" />\n </span>\n ))}\n </Grid>\n )\n }\n case 'cards': {\n const n = count ?? 6\n return (\n <Grid columns={columns ?? 3} kind=\"cards\">\n {Array.from({ length: n }, (_, i) => (\n <span key={i} className=\"ty-skeleton-tile\" data-part=\"card\">\n <Block shape=\"heading\" width=\"long\" />\n <Lines lines={2} />\n <Block shape=\"line\" width=\"short\" />\n </span>\n ))}\n </Grid>\n )\n }\n case 'section-heading':\n return (\n <span className=\"ty-skeleton-row\" data-preset=\"section-heading\">\n <Block shape=\"circle\" />\n <span className=\"ty-skeleton-lines\">\n <Block shape=\"heading\" width=\"medium\" />\n <Block shape=\"line\" width=\"long\" />\n </span>\n </span>\n )\n case 'filters': {\n const n = count ?? 5\n return (\n <span className=\"ty-skeleton-row\" data-preset=\"filters\">\n {Array.from({ length: n }, (_, i) => (\n <span key={i} className=\"ty-skeleton ty-skeleton--pill\" data-shape=\"pill\" />\n ))}\n </span>\n )\n }\n case 'analysis': {\n const n = count ?? 3\n return (\n <span className=\"ty-skeleton-tile\" data-preset=\"analysis\">\n <Block shape=\"heading\" width=\"medium\" />\n {Array.from({ length: n }, (_, i) => (\n <span key={i} className=\"ty-skeleton-row\" data-part=\"item\">\n <Block shape=\"circle\" />\n <Lines lines={2} />\n </span>\n ))}\n </span>\n )\n }\n }\n}\n\n/** Content-shaped placeholder, hidden from assistive technology (spec: wave-1/skeleton.md). */\nexport function Skeleton({ shape = 'line', width, lines = 1, preset, count, columns, className }: SkeletonProps) {\n let body: ReactNode\n if (preset) body = <Preset preset={preset} count={count} columns={columns} />\n else if (lines > 1 && (shape === 'line' || shape === 'heading')) body = <Lines lines={lines} width={width} />\n else body = <Block shape={shape} width={width ?? (shape === 'circle' ? 'short' : 'full')} />\n return (\n <span className={cx('ty-skeleton-root', className)} aria-hidden=\"true\">\n {body}\n </span>\n )\n}\n\nexport interface PageLoadingStateProps {\n /** Sentence announced once in the status region, such as \"Loading the catalogue\". */\n label?: string\n /** Inside a section instead of a whole page. */\n compact?: boolean\n preset?: SkeletonPreset\n count?: number\n columns?: 1 | 2 | 3 | 4\n /** Custom skeleton instead of a preset. */\n children?: ReactNode\n className?: string\n}\n\n/** Page or section loading wrapper: skeleton plus one polite status (spec: wave-1/skeleton.md). */\nexport function PageLoadingState({ label, compact = false, preset, count, columns, children, className }: PageLoadingStateProps) {\n const messages = useMessages()\n const text = label ?? messages.loading\n return (\n <div className={cx('ty-page-loading', className)} data-compact={compact || undefined} aria-busy=\"true\">\n <span role=\"status\" className=\"ty-visually-hidden\">\n {text}\n </span>\n {children ? (\n <div aria-hidden=\"true\">{children}</div>\n ) : (\n <>\n {compact ? null : <Skeleton preset=\"section-heading\" />}\n <Skeleton preset={preset ?? 'cards'} count={count} columns={columns} />\n </>\n )}\n </div>\n )\n}\n","import type { MouseEvent } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport interface SkipLinkProps {\n /** Id of the main content element. */\n targetId?: string\n /** Link text (defaults to the I18n \"Skip to main content\"). */\n label?: string\n className?: string\n}\n\n/** Moves focus to `targetId`, making it programmatically focusable when needed. */\nexport function focusSkipTarget(targetId: string): boolean {\n const target = document.getElementById(targetId)\n if (!target) return false\n const needsTabIndex = !target.hasAttribute('tabindex') && target.tabIndex < 0\n if (needsTabIndex) {\n target.setAttribute('tabindex', '-1')\n target.addEventListener('blur', () => target.removeAttribute('tabindex'), { once: true })\n }\n target.focus({ preventScroll: true })\n // scroll-padding-top on the document keeps the target clear of the sticky top bar (§2.6).\n target.scrollIntoView?.({ block: 'start' })\n return true\n}\n\n/** First focusable element: jumps past navigation to the main content (spec: wave-1/skip-link.md). */\nexport function SkipLink({ targetId = 'main-content', label, className }: SkipLinkProps) {\n const messages = useMessages()\n const onClick = (e: MouseEvent<HTMLAnchorElement>) => {\n if (focusSkipTarget(targetId)) {\n e.preventDefault()\n if (typeof history !== 'undefined' && history.replaceState) history.replaceState(history.state, '', `#${targetId}`)\n }\n }\n return (\n <a href={`#${targetId}`} className={cx('ty-skip-link', className)} onClick={onClick}>\n {label ?? messages.skipLink}\n </a>\n )\n}\n","import { createContext, useContext } from 'react'\n\nexport interface FrameState {\n /** True when the navigation shows as the icon rail. */\n navCollapsed: boolean\n /** Where the navigation currently renders. */\n navPlacement: 'column' | 'drawer'\n /** Frame layout: wave-1 top bar or the wave-4 research rail. */\n layout?: AppFrameLayout\n /** Opens the navigation drawer (narrow screens), when the frame offers one. */\n openNavigation?: () => void\n}\n\nexport type AppFrameLayout = 'topbar' | 'rail'\n\nexport const FrameContext = createContext<FrameState>({ navCollapsed: false, navPlacement: 'column' })\n\n/** Navigation state for items rendered inside the frame (rail labels, tooltips). */\nexport function useAppFrame(): FrameState {\n return useContext(FrameContext)\n}\n\n","import { Menu as MenuGlyph, X } from 'lucide-react'\nimport { Suspense, useMemo, type ReactNode } from 'react'\nimport { Dialog, Modal, ModalOverlay } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { breakpoints, useMinWidth } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { PageLoadingState } from '../skeleton/Skeleton'\nimport { SkipLink } from '../skip-link/SkipLink'\nimport type { AppFrameProps } from './AppFrame'\nimport { FrameContext, type FrameState } from './frameContext'\n\n/*\n * Research shell (spec: wave-4/app-frame-rail.md): rail on the start side, the\n * page on one glass sheet with its own scroll, the dock floating at the bottom\n * of the sheet. There is no top bar and so no banner landmark.\n */\n\ntype Region = 'rail' | 'stage' | 'aside'\n\n/** Root property the dock publishes (FloatingActionBar); the sheet pads its end by it. */\nexport const RAIL_DOCK_INSET_PROPERTY = '--ty-action-bar-inset-bottom'\n\n/** The rail's stacked parts, in visual and DOM order. */\nfunction railParts(props: AppFrameProps, navigationLabel: string): Array<[string, ReactNode]> {\n return [\n ['brand', props.brand],\n ['context', props.context],\n [\n 'nav',\n <nav key=\"nav\" className=\"ty-app-frame__rail-nav\" aria-label={navigationLabel}>\n {props.navigation}\n </nav>,\n ],\n ['account', props.account],\n ]\n}\n\nfunction RailColumn({ parts }: { parts: Array<[string, ReactNode]> }) {\n return (\n <div className=\"ty-app-frame__rail\" data-region={'rail' satisfies Region}>\n {parts.map(([slot, node]) =>\n node == null || node === false ? null : slot === 'nav' ? (\n node\n ) : (\n <div key={slot} className=\"ty-app-frame__rail-slot\" data-slot={slot}>\n {node}\n </div>\n ),\n )}\n </div>\n )\n}\n\nexport function RailFrame(props: AppFrameProps) {\n const m = useMessages()\n const wide = useMinWidth(breakpoints.md)\n const mainId = props.mainId ?? 'main-content'\n const dockId = props.dockId ?? 'ty-action-bar'\n const setOpen = (open: boolean) => props.onNavOpenChange?.(open)\n const parts = railParts(props, m.rail.label)\n\n const state = useMemo<FrameState>(\n () => ({\n navCollapsed: false,\n navPlacement: wide ? 'column' : 'drawer',\n layout: 'rail',\n openNavigation: wide ? undefined : () => props.onNavOpenChange?.(true),\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [wide, props.onNavOpenChange],\n )\n\n const drawer = (\n <ModalOverlay className=\"ty-app-frame__overlay\" isOpen={!!props.navOpen} onOpenChange={setOpen} isDismissable>\n <Modal className=\"ty-app-frame__drawer\" data-placement=\"start\">\n <Dialog className=\"ty-app-frame__drawer-dialog\" aria-label={m.rail.label}>\n <div className=\"ty-app-frame__drawer-head\">\n <Button variant=\"quiet\" iconOnly accessibleLabel={m.rail.closeNavigation} leadingIcon={<X />} onPress={() => setOpen(false)} />\n </div>\n <RailColumn parts={parts} />\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n\n return (\n <FrameContext.Provider value={state}>\n {props.sessionGuard}\n {props.initializers}\n <div\n className={cx('ty-app-frame', props.className)}\n data-layout=\"rail\"\n data-nav={wide ? 'column' : 'drawer'}\n data-width={props.width ?? 'reading'}\n data-dock={props.dock ? '' : undefined}\n >\n <SkipLink targetId={mainId} />\n {props.dock ? <SkipLink targetId={dockId} label={m.actionBar.skipTo} /> : null}\n {props.ambient ? (\n <div className=\"ty-app-frame__ambient\" aria-hidden=\"true\">\n <span className=\"ty-app-frame__orb ty-app-frame__orb--top\" />\n <span className=\"ty-app-frame__orb ty-app-frame__orb--bottom\" />\n </div>\n ) : null}\n {props.progress ? <div className=\"ty-app-frame__progress\">{props.progress}</div> : null}\n\n {wide ? <RailColumn parts={parts} /> : drawer}\n\n <div className=\"ty-app-frame__stage\" data-region={'stage' satisfies Region}>\n <main id={mainId} tabIndex={-1} className=\"ty-app-frame__sheet\" aria-busy={props.busy || undefined}>\n <div className=\"ty-app-frame__content\">\n <Suspense fallback={<PageLoadingState label={props.loadingLabel ?? m.frame.loadingPage} />}>{props.children}</Suspense>\n </div>\n </main>\n {props.dock}\n {!wide && !props.dock ? (\n <Button\n className=\"ty-app-frame__rail-opener\"\n variant=\"secondary\"\n shape=\"circle\"\n iconOnly\n accessibleLabel={m.rail.openNavigation}\n leadingIcon={<MenuGlyph />}\n aria-expanded={!!props.navOpen}\n onPress={() => setOpen(true)}\n />\n ) : null}\n </div>\n\n {props.aside ? (\n <div className=\"ty-app-frame__aside-slot\" data-region={'aside' satisfies Region}>\n {props.aside}\n </div>\n ) : null}\n </div>\n {props.overlays}\n </FrameContext.Provider>\n )\n}\n","import { Menu, PanelLeftClose, PanelLeftOpen, X } from 'lucide-react'\nimport { Suspense, useId, type ReactNode } from 'react'\nimport { Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { breakpoints, useMinWidth } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { PageLoadingState } from '../skeleton/Skeleton'\nimport { SkipLink } from '../skip-link/SkipLink'\nimport { FrameContext, useAppFrame, type AppFrameLayout, type FrameState } from './frameContext'\nimport { RailFrame } from './RailFrame'\n\nexport { useAppFrame, type AppFrameLayout, type FrameState } from './frameContext'\n\nexport type AppFrameWidth = 'reading' | 'data' | 'full'\n\n/**\n * Label of a navigation item. In the collapsed rail it is visually hidden but\n * stays the item's accessible name (and the host may add a tooltip).\n */\nexport function FrameNavLabel({ children }: { children: ReactNode }) {\n const { navCollapsed, navPlacement } = useAppFrame()\n return <span className={navCollapsed && navPlacement === 'column' ? 'ty-visually-hidden' : 'ty-app-frame__nav-label'}>{children}</span>\n}\n\nexport interface AppFrameProps {\n /**\n * `rail` (the research shell: rail, glass sheet, bottom dock, no top bar) or\n * `topbar` (wave 1). Defaults to `topbar` when a `topBar` is given, else `rail`.\n */\n layout?: AppFrameLayout\n /** Rail layout: brand at the top of the rail. */\n brand?: ReactNode\n /** Rail layout: context switcher (organization → project). */\n context?: ReactNode\n /** Rail layout: account slot at the bottom of the rail. */\n account?: ReactNode\n /** Rail layout: the action dock (a FloatingActionBar with `anchor=\"container\"`). */\n dock?: ReactNode\n /** Rail layout: id of the dock landmark, for the second skip link. */\n dockId?: string\n navigation: ReactNode\n topBar?: ReactNode\n children: ReactNode\n width?: AppFrameWidth\n aside?: ReactNode\n /** Accessible name of the aside (its title). */\n asideLabel?: string\n asideOpen?: boolean\n onAsideOpenChange?: (open: boolean) => void\n navCollapsed?: boolean\n onNavCollapsedChange?: (collapsed: boolean) => void\n navOpen?: boolean\n onNavOpenChange?: (open: boolean) => void\n /** Text of the route-loading fallback. */\n loadingLabel?: string\n /** Slot for the route progress indicator (RouteProgress, wave 2). */\n progress?: ReactNode\n sessionGuard?: ReactNode\n initializers?: ReactNode\n overlays?: ReactNode\n /** Calm two-orb ambient backdrop behind the glass (§2.5). */\n ambient?: boolean\n mainId?: string\n /** Mark the main region busy (e.g. while a route loads outside Suspense). */\n busy?: boolean\n className?: string\n}\n\n/**\n * Outer frame of every authenticated screen (specs: wave-1/app-frame.md and\n * wave-4/app-frame-rail.md). Chooses the layout, then renders it.\n */\nexport function AppFrame(props: AppFrameProps) {\n const layout = props.layout ?? (props.topBar !== undefined ? 'topbar' : 'rail')\n return layout === 'rail' ? <RailFrame {...props} /> : <TopBarFrame {...props} />\n}\n\nfunction TopBarFrame({\n navigation,\n topBar,\n children,\n width = 'reading',\n aside,\n asideLabel,\n asideOpen = false,\n onAsideOpenChange,\n navCollapsed = false,\n onNavCollapsedChange,\n navOpen = false,\n onNavOpenChange,\n loadingLabel,\n progress,\n sessionGuard,\n initializers,\n overlays,\n ambient = false,\n mainId = 'main-content',\n busy = false,\n className,\n}: AppFrameProps) {\n const m = useMessages()\n const desktop = useMinWidth(breakpoints.lg)\n const wide = useMinWidth(breakpoints.xl)\n const navId = useId()\n const asideTitleId = useId()\n const label = loadingLabel ?? m.frame.loadingPage\n const collapsed = desktop && navCollapsed\n const state: FrameState = { navCollapsed: collapsed, navPlacement: desktop ? 'column' : 'drawer', layout: 'topbar' }\n\n const asidePlacement = !aside || !asideOpen ? 'closed' : wide ? 'column' : desktop ? 'overlay' : 'sheet'\n const closeAside = () => onAsideOpenChange?.(false)\n\n const navLandmark = (\n <nav id={navId} className=\"ty-app-frame__nav\" aria-label={m.frame.navigation}>\n {navigation}\n </nav>\n )\n\n return (\n <FrameContext.Provider value={state}>\n {sessionGuard}\n {initializers}\n <div\n className={cx('ty-app-frame', className)}\n data-nav={desktop ? (collapsed ? 'rail' : 'column') : 'drawer'}\n data-aside={asidePlacement}\n data-width={width}\n >\n <SkipLink targetId={mainId} />\n {ambient ? (\n <div className=\"ty-app-frame__ambient\" aria-hidden=\"true\">\n <span className=\"ty-app-frame__orb ty-app-frame__orb--top\" />\n <span className=\"ty-app-frame__orb ty-app-frame__orb--bottom\" />\n </div>\n ) : null}\n {progress ? <div className=\"ty-app-frame__progress\">{progress}</div> : null}\n\n {/* Desktop: the navigation column comes first, matching the visual order (left column, then top bar). */}\n {desktop ? (\n <div className=\"ty-app-frame__side\">\n {navLandmark}\n {onNavCollapsedChange ? (\n <div className=\"ty-app-frame__side-footer\">\n <Button\n variant=\"quiet\"\n iconOnly\n accessibleLabel={collapsed ? m.frame.expandNavigation : m.frame.collapseNavigation}\n leadingIcon={collapsed ? <PanelLeftOpen /> : <PanelLeftClose />}\n onPress={() => onNavCollapsedChange(!collapsed)}\n aria-expanded={!collapsed}\n aria-controls={navId}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n\n <header className=\"ty-app-frame__top\">\n {!desktop ? (\n <Button\n variant=\"quiet\"\n iconOnly\n accessibleLabel={m.frame.openNavigation}\n leadingIcon={<Menu />}\n onPress={() => onNavOpenChange?.(true)}\n aria-expanded={navOpen}\n aria-controls={navOpen ? navId : undefined}\n className=\"ty-app-frame__menu-button\"\n />\n ) : null}\n <div className=\"ty-app-frame__top-content\">{topBar}</div>\n </header>\n\n {!desktop ? (\n <ModalOverlay\n className=\"ty-app-frame__overlay\"\n isOpen={navOpen}\n onOpenChange={(open) => onNavOpenChange?.(open)}\n isDismissable\n >\n <Modal className=\"ty-app-frame__drawer\" data-placement=\"start\">\n <Dialog className=\"ty-app-frame__drawer-dialog\" aria-label={m.frame.navigation}>\n <div className=\"ty-app-frame__drawer-head\">\n <Button\n variant=\"quiet\"\n iconOnly\n accessibleLabel={m.frame.closeNavigation}\n leadingIcon={<X />}\n onPress={() => onNavOpenChange?.(false)}\n />\n </div>\n {navLandmark}\n </Dialog>\n </Modal>\n </ModalOverlay>\n ) : null}\n\n <main id={mainId} tabIndex={-1} className=\"ty-app-frame__main\" aria-busy={busy || undefined}>\n <div className=\"ty-app-frame__content\">\n <Suspense fallback={<PageLoadingState label={label} />}>{children}</Suspense>\n </div>\n </main>\n\n {asidePlacement === 'column' ? (\n <aside className=\"ty-app-frame__aside\" aria-label={asideLabel}>\n {aside}\n </aside>\n ) : null}\n {asidePlacement === 'overlay' || asidePlacement === 'sheet' ? (\n <ModalOverlay className=\"ty-app-frame__overlay\" isOpen onOpenChange={(open) => !open && closeAside()} isDismissable>\n <Modal className=\"ty-app-frame__aside-modal\" data-placement={asidePlacement === 'overlay' ? 'end' : 'bottom'}>\n <Dialog className=\"ty-app-frame__drawer-dialog\" aria-labelledby={asideLabel ? asideTitleId : undefined}>\n <div className=\"ty-app-frame__drawer-head\">\n {asideLabel ? (\n <Heading slot=\"title\" id={asideTitleId} className=\"ty-app-frame__aside-title\">\n {asideLabel}\n </Heading>\n ) : null}\n <Button variant=\"quiet\" iconOnly accessibleLabel={m.frame.closePanel} leadingIcon={<X />} onPress={closeAside} />\n </div>\n <div className=\"ty-app-frame__aside-body\">{aside}</div>\n </Dialog>\n </Modal>\n </ModalOverlay>\n ) : null}\n </div>\n {overlays}\n </FrameContext.Provider>\n )\n}\n","import { ExternalLink } from 'lucide-react'\nimport { forwardRef, type ReactNode } from 'react'\nimport { Button as AriaButton, Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { isExternalHref } from '../../internal/dom'\nimport { useMessages } from '../../internal/provider'\n\nexport type LinkEmphasis = 'underlined' | 'subtle'\n\nexport interface LinkProps {\n /** Destination. Without it the link is an inline action and needs `onPress`. */\n href?: string\n /** Inline action, or a side effect on navigation. */\n onPress?: () => void\n /** `subtle` hides the underline at rest (only where the context makes the link obvious). */\n emphasis?: LinkEmphasis\n /** Opens in a new context with safe `rel`; inferred from absolute URLs to another origin. */\n external?: boolean\n /** Marks the link as the current page. */\n current?: boolean\n /** Navigates by replacing the history entry (router adapter). */\n replace?: boolean\n /** Standalone links (lists, footers) get a 44 px tall hit area; inline prose links do not. */\n standalone?: boolean\n children: ReactNode\n className?: string\n id?: string\n 'aria-label'?: string\n 'aria-describedby'?: string\n}\n\n/** Moves to another location or performs an inline action (spec: wave-1/link.md). */\nexport const Link = forwardRef<HTMLAnchorElement | HTMLButtonElement, LinkProps>(function Link(props, ref) {\n const { href, onPress, emphasis = 'underlined', external, current = false, replace = false, standalone = false, children, className, ...rest } = props\n const messages = useMessages()\n devWarning(!href && !onPress, 'Link: provide `href` or `onPress`.')\n\n const classes = cx('ty-link', className)\n const data = {\n 'data-emphasis': emphasis,\n 'data-standalone': standalone || undefined,\n }\n\n if (!href) {\n return (\n <AriaButton\n ref={ref as React.Ref<HTMLButtonElement>}\n className={classes}\n onPress={() => onPress?.()}\n id={rest.id}\n aria-label={rest['aria-label']}\n aria-describedby={rest['aria-describedby']}\n data-action=\"\"\n {...data}\n >\n {children}\n </AriaButton>\n )\n }\n\n const isExternal = external ?? isExternalHref(href)\n return (\n <AriaLink\n ref={ref as React.Ref<HTMLAnchorElement>}\n className={classes}\n href={href}\n onPress={onPress ? () => onPress() : undefined}\n target={isExternal ? '_blank' : undefined}\n rel={isExternal ? 'noopener noreferrer' : undefined}\n routerOptions={replace ? { replace: true } : undefined}\n aria-current={current ? 'page' : undefined}\n id={rest.id}\n aria-label={rest['aria-label']}\n aria-describedby={rest['aria-describedby']}\n {...data}\n >\n {children}\n {isExternal ? (\n <>\n <ExternalLink className=\"ty-icon ty-mirror-rtl ty-link__external\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-visually-hidden\"> {messages.link.opensInNewTab}</span>\n </>\n ) : null}\n </AriaLink>\n )\n})\n","import { ArrowLeft, ChevronRight, Ellipsis } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { breakpoints, useMinWidth } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport { ActionMenu } from '../action-menu/ActionMenu'\nimport { Button } from '../button/Button'\nimport { Link } from '../link/Link'\n\nexport interface BreadcrumbItem {\n label: string\n href: string\n}\n\nexport interface BreadcrumbsProps {\n /** Ancestors then the current page (the last item is current). */\n items: BreadcrumbItem[]\n /** Accessible name of the navigation landmark. */\n label?: string\n /** `auto` shows the trail at 640 px and above, compact below. */\n mode?: 'trail' | 'compact' | 'auto'\n /** Parent used in compact mode when there is only one item. */\n rootHref?: string\n rootLabel?: string\n /** Collapses middle items into an overflow menu when exceeded. */\n maxVisible?: number\n /** Trailing slot of the compact bar. */\n actions?: ReactNode\n /** Replaces the centred title of the compact bar. */\n centerContent?: ReactNode\n className?: string\n}\n\ntype Entry = { kind: 'item'; item: BreadcrumbItem; index: number } | { kind: 'overflow'; items: BreadcrumbItem[] }\n\nfunction visibleEntries(items: BreadcrumbItem[], maxVisible?: number): Entry[] {\n const all: Entry[] = items.map((item, index) => ({ kind: 'item', item, index }))\n if (!maxVisible || items.length <= maxVisible || maxVisible < 2) return all\n const tail = maxVisible - 1\n return [all[0]!, { kind: 'overflow', items: items.slice(1, items.length - tail) }, ...all.slice(items.length - tail)]\n}\n\n/** Where the page sits in the hierarchy (spec: wave-1/breadcrumbs.md). */\nexport function Breadcrumbs(props: BreadcrumbsProps) {\n const { items, label, mode = 'auto', rootHref, rootLabel, maxVisible, actions, centerContent, className } = props\n const messages = useMessages()\n const wide = useMinWidth(breakpoints.sm)\n const navLabel = label ?? messages.breadcrumbs.label\n const compact = mode === 'compact' || (mode === 'auto' && !wide)\n const current = items[items.length - 1]\n\n if (compact) {\n const parent = items.length > 1 ? items[items.length - 2] : rootHref ? { href: rootHref, label: rootLabel ?? '' } : undefined\n return (\n <nav aria-label={navLabel} className={cx('ty-breadcrumbs', className)} data-mode=\"compact\">\n <div className=\"ty-breadcrumbs__bar\">\n <div className=\"ty-breadcrumbs__back\">\n {parent ? (\n <Link href={parent.href} emphasis=\"subtle\" standalone aria-label={messages.breadcrumbs.backTo(parent.label)}>\n <ArrowLeft className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-breadcrumbs__back-label\">{parent.label}</span>\n </Link>\n ) : null}\n </div>\n {centerContent !== undefined || actions ? (\n <div className=\"ty-breadcrumbs__center\">\n {centerContent ?? (\n <span className=\"ty-breadcrumbs__title\" aria-current=\"page\">\n {current?.label}\n </span>\n )}\n </div>\n ) : null}\n {actions ? <div className=\"ty-breadcrumbs__actions\">{actions}</div> : null}\n </div>\n </nav>\n )\n }\n\n const entries = visibleEntries(items, maxVisible)\n return (\n <nav aria-label={navLabel} className={cx('ty-breadcrumbs', className)} data-mode=\"trail\">\n <ol className=\"ty-breadcrumbs__list\">\n {entries.map((entry, i) => {\n const isLast = i === entries.length - 1\n const separator = isLast ? null : <ChevronRight className=\"ty-icon ty-mirror-rtl ty-breadcrumbs__separator\" aria-hidden=\"true\" focusable=\"false\" />\n if (entry.kind === 'overflow') {\n return (\n <li key=\"overflow\" className=\"ty-breadcrumbs__item\">\n <ActionMenu\n label={messages.breadcrumbs.overflow}\n items={entry.items.map((it, n) => ({ id: `${n}:${it.href}`, label: it.label, href: it.href }))}\n onAction={() => {}}\n trigger={\n <Button\n variant=\"quiet\"\n size=\"compact\"\n iconOnly\n accessibleLabel={messages.breadcrumbs.overflow}\n leadingIcon={<Ellipsis />}\n />\n }\n />\n {separator}\n </li>\n )\n }\n const { item } = entry\n const isCurrent = entry.index === items.length - 1\n return (\n <li key={`${entry.index}:${item.href}`} className=\"ty-breadcrumbs__item\">\n {isCurrent ? (\n <span className=\"ty-breadcrumbs__current\" aria-current=\"page\" title={item.label}>\n {item.label}\n </span>\n ) : (\n <Link href={item.href} emphasis=\"subtle\" className=\"ty-breadcrumbs__link\">\n <span className=\"ty-breadcrumbs__label\" title={item.label}>\n {item.label}\n </span>\n </Link>\n )}\n {separator}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n","import { CircleAlert } from 'lucide-react'\nimport {\n createContext,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type FieldsetHTMLAttributes,\n type HTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nconst useIsoLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect\n\n/** Wiring a Field shares with the control inside it. */\nexport interface FieldContextValue {\n /** Id the label targets (the registered explicit id wins over the generated one). */\n controlId: string\n labelId: string | undefined\n hintId: string | undefined\n errorId: string | undefined\n /** Hint then error ids, space separated, or undefined. */\n describedBy: string | undefined\n invalid: boolean\n required: boolean\n disabled: boolean\n /** Lets a control with an explicit id tell the label to target it. */\n registerControlId: (id: string | undefined) => void\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\nconst FieldsetDisabledContext = createContext(false)\n\n/** The surrounding Field's wiring, or null outside a Field. */\nexport function useField(): FieldContextValue | null {\n return useContext(FieldContext)\n}\n\nexport interface FieldControlWiring {\n id: string\n labelledBy: string | undefined\n describedBy: string | undefined\n invalid: boolean\n required: boolean\n disabled: boolean\n inField: boolean\n}\n\n/**\n * Resolves a control's id, description and state from its own props and the\n * surrounding Field (if any). An explicit id on the control wins.\n */\nexport function useFieldControl(own: {\n id?: string | undefined\n describedBy?: string | undefined\n invalid?: boolean | undefined\n required?: boolean | undefined\n disabled?: boolean | undefined\n}): FieldControlWiring {\n const field = useContext(FieldContext)\n const fieldsetDisabled = useContext(FieldsetDisabledContext)\n const generated = useId()\n const register = field?.registerControlId\n useIsoLayoutEffect(() => {\n if (!register) return\n register(own.id)\n return () => register(undefined)\n }, [register, own.id])\n const id = own.id ?? field?.controlId ?? generated\n const describedBy = [field?.describedBy, own.describedBy].filter(Boolean).join(' ') || undefined\n return {\n id,\n labelledBy: field?.labelId,\n describedBy,\n invalid: !!own.invalid || !!field?.invalid,\n required: !!own.required || !!field?.required,\n disabled: !!own.disabled || !!field?.disabled || fieldsetDisabled,\n inField: !!field,\n }\n}\n\n/** Tracks whether an error message appeared after the first render (announce once). */\nexport function useAppearedAfterMount(present: boolean): boolean {\n const mounted = useRef(false)\n const [appeared, setAppeared] = useState(false)\n useEffect(() => {\n if (mounted.current) setAppeared(present)\n mounted.current = true\n }, [present])\n return present && appeared\n}\n\nexport interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n label?: ReactNode\n hint?: ReactNode\n /** When set, the control is invalid and the hint is hidden in favour of the error. */\n errorMessage?: string | null\n required?: boolean\n /** Overrides the generated control id. */\n controlId?: string\n disabled?: boolean\n children: ReactNode\n}\n\n/** Label, hint, required marker and error wiring around one control (spec: wave-1/field.md). */\nexport function Field({ label, hint, errorMessage, required = false, controlId, disabled = false, className, children, ...rest }: FieldProps) {\n const base = useId()\n const [registered, setRegistered] = useState<string | undefined>(undefined)\n const fieldsetDisabled = useContext(FieldsetDisabledContext)\n const hasError = !!errorMessage\n const hasHint = hint != null && hint !== false && !hasError\n const labelId = label != null ? `${base}-label` : undefined\n const hintId = hasHint ? `${base}-hint` : undefined\n const errorId = hasError ? `${base}-error` : undefined\n const value = useMemo<FieldContextValue>(\n () => ({\n controlId: registered ?? controlId ?? `${base}-control`,\n labelId,\n hintId,\n errorId,\n describedBy: [hintId, errorId].filter(Boolean).join(' ') || undefined,\n invalid: hasError,\n required,\n disabled: disabled || fieldsetDisabled,\n registerControlId: setRegistered,\n }),\n [registered, controlId, base, labelId, hintId, errorId, hasError, required, disabled, fieldsetDisabled],\n )\n return (\n <FieldContext.Provider value={value}>\n <div {...rest} className={cx('ty-field', className)} data-invalid={hasError || undefined} data-disabled={value.disabled || undefined}>\n {label != null ? <FieldLabel>{label}</FieldLabel> : null}\n {hasHint ? <FieldHint>{hint}</FieldHint> : null}\n {children}\n {hasError ? <FieldError>{errorMessage}</FieldError> : null}\n </div>\n </FieldContext.Provider>\n )\n}\n\nexport interface FieldLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n children: ReactNode\n}\n\n/** The label part: targets the Field's control unless an explicit `htmlFor` is given. */\nexport function FieldLabel({ htmlFor, className, children, ...rest }: FieldLabelProps) {\n const field = useContext(FieldContext)\n const messages = useMessages()\n return (\n <label {...rest} id={rest.id ?? field?.labelId} htmlFor={htmlFor ?? field?.controlId} className={cx('ty-field__label', className)}>\n {children}\n {field?.required ? (\n <span className=\"ty-field__required\">\n {' '}\n ({messages.required})\n </span>\n ) : null}\n </label>\n )\n}\n\n/** Help text below the label. */\nexport function FieldHint({ className, children, ...rest }: HTMLAttributes<HTMLParagraphElement>) {\n const field = useContext(FieldContext)\n return (\n <p {...rest} id={rest.id ?? field?.hintId} className={cx('ty-field__hint', className)}>\n {children}\n </p>\n )\n}\n\n/** Error below the control, with an icon; announced politely only when it first appears. */\nexport function FieldError({ className, children, ...rest }: HTMLAttributes<HTMLParagraphElement>) {\n const field = useContext(FieldContext)\n const appeared = useAppearedAfterMount(true)\n return (\n <p {...rest} id={rest.id ?? field?.errorId} className={cx('ty-field__error', className)} aria-live={appeared ? 'polite' : undefined}>\n <CircleAlert className=\"ty-icon ty-field__error-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span>{children}</span>\n </p>\n )\n}\n\nexport interface FieldsetProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'children'> {\n legend: ReactNode\n description?: ReactNode\n disabled?: boolean\n children: ReactNode\n}\n\n/** Groups several Fields under a legend; `disabled` disables every nested control. */\nexport function Fieldset({ legend, description, disabled = false, className, children, ...rest }: FieldsetProps) {\n const descId = useId()\n const parentDisabled = useContext(FieldsetDisabledContext)\n return (\n <FieldsetDisabledContext.Provider value={disabled || parentDisabled}>\n <fieldset\n {...rest}\n disabled={disabled || undefined}\n aria-describedby={description != null ? descId : rest['aria-describedby']}\n className={cx('ty-fieldset', className)}\n >\n <legend className=\"ty-fieldset__legend\">{legend}</legend>\n {description != null ? (\n <p id={descId} className=\"ty-fieldset__description\">\n {description}\n </p>\n ) : null}\n <div className=\"ty-fieldset__body\">{children}</div>\n </fieldset>\n </FieldsetDisabledContext.Provider>\n )\n}\n\n/** Vertical rhythm container for several Fields (§2.1 \"between form fields\"). */\nexport function FieldStack({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div {...rest} className={cx('ty-field-stack', className)}>\n {children}\n </div>\n )\n}\n","import { Check, ChevronDown, CircleAlert } from 'lucide-react'\nimport { useId, type ReactNode } from 'react'\nimport {\n Button as AriaButton,\n Header,\n Label,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Popover,\n Select,\n SelectValue,\n Text,\n type Key,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useMediaQuery } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport { useAppearedAfterMount, useFieldControl } from '../field/Field'\n\nexport interface ListboxSelectOption {\n value: string\n label: string\n description?: string\n icon?: ReactNode\n disabled?: boolean\n}\n\nexport interface ListboxSelectSection {\n title: string\n options: ListboxSelectOption[]\n}\n\nexport interface ListboxSelectProps {\n label?: string\n accessibleLabel?: string\n options?: ListboxSelectOption[]\n sections?: ListboxSelectSection[]\n value?: string | null\n defaultValue?: string | null\n onChange?: (value: string) => void\n placeholder?: string\n errorMessage?: string\n hint?: ReactNode\n disabled?: boolean\n required?: boolean\n /** Renders a hidden input for form submission. */\n name?: string\n open?: boolean\n onOpenChange?: (open: boolean) => void\n id?: string\n className?: string\n}\n\nfunction Option({ option }: { option: ListboxSelectOption }) {\n return (\n <ListBoxItem id={option.value} textValue={option.label} isDisabled={option.disabled} className=\"ty-listbox-select__option\">\n {({ isSelected }) => (\n <>\n {option.icon ? (\n <span className=\"ty-listbox-select__option-icon\" aria-hidden=\"true\">\n {option.icon}\n </span>\n ) : null}\n <span className=\"ty-listbox-select__option-text\">\n <Text slot=\"label\" className=\"ty-listbox-select__option-label\">\n {option.label}\n </Text>\n {option.description ? (\n <Text slot=\"description\" className=\"ty-listbox-select__option-description\">\n {option.description}\n </Text>\n ) : null}\n </span>\n <span className=\"ty-listbox-select__check\" aria-hidden=\"true\">\n {isSelected ? <Check className=\"ty-icon\" focusable=\"false\" /> : null}\n </span>\n </>\n )}\n </ListBoxItem>\n )\n}\n\n/** One value from a custom listbox popover (spec: wave-1/listbox-select.md). */\nexport function ListboxSelect(props: ListboxSelectProps) {\n const {\n label,\n accessibleLabel,\n options = [],\n sections,\n value,\n defaultValue,\n onChange,\n placeholder,\n errorMessage,\n hint,\n disabled,\n required,\n name,\n open,\n onOpenChange,\n id,\n className,\n } = props\n const messages = useMessages()\n const base = useId()\n const hintId = hint != null ? `${base}-hint` : undefined\n const errorId = errorMessage ? `${base}-error` : undefined\n const wiring = useFieldControl({ id, describedBy: [hintId, errorId].filter(Boolean).join(' ') || undefined, invalid: !!errorMessage, required, disabled })\n const errorAppeared = useAppearedAfterMount(!!errorMessage)\n const narrow = useMediaQuery('(max-width: 639.98px)')\n devWarning(!label && !accessibleLabel && !wiring.labelledBy, 'ListboxSelect: provide `label`, `accessibleLabel` or a surrounding Field label.')\n\n const disabledKeys = [...options, ...(sections ?? []).flatMap((s) => s.options)].filter((o) => o.disabled).map((o) => o.value)\n\n const list = (\n <ListBox className=\"ty-listbox-select__list\">\n {options.map((o) => (\n <Option key={o.value} option={o} />\n ))}\n {sections?.map((s) => (\n <ListBoxSection key={s.title} id={s.title} className=\"ty-listbox-select__section\">\n <Header className=\"ty-listbox-select__section-title\">{s.title}</Header>\n {s.options.map((o) => (\n <Option key={o.value} option={o} />\n ))}\n </ListBoxSection>\n ))}\n </ListBox>\n )\n\n return (\n <Select\n id={wiring.id}\n className={cx('ty-listbox-select', className)}\n value={value === undefined ? undefined : value}\n defaultValue={defaultValue ?? undefined}\n onChange={(key: Key | null) => {\n if (key != null) onChange?.(String(key))\n }}\n placeholder={placeholder ?? messages.select.placeholder}\n isDisabled={wiring.disabled}\n isRequired={wiring.required}\n isInvalid={wiring.invalid}\n disabledKeys={disabledKeys}\n name={name}\n isOpen={open}\n onOpenChange={onOpenChange}\n aria-label={label ? undefined : accessibleLabel}\n aria-labelledby={!label && !accessibleLabel ? wiring.labelledBy : undefined}\n aria-describedby={wiring.describedBy}\n data-presentation={narrow ? 'tray' : 'popover'}\n >\n {label ? <Label className=\"ty-listbox-select__label\">{label}</Label> : null}\n {hint != null ? (\n <p id={hintId} className=\"ty-listbox-select__hint\">\n {hint}\n </p>\n ) : null}\n <AriaButton className=\"ty-listbox-select__trigger\" aria-describedby={wiring.describedBy}>\n <SelectValue className=\"ty-listbox-select__value\" />\n <ChevronDown className=\"ty-icon ty-listbox-select__chevron\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n {errorMessage ? (\n <p id={errorId} className=\"ty-listbox-select__error\" aria-live={errorAppeared ? 'polite' : undefined}>\n <CircleAlert className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span>{errorMessage}</span>\n </p>\n ) : null}\n {/* Narrow screens: the same popover (the collection must stay inside it)\n is laid out as a bottom tray by CSS. */}\n <Popover className={narrow ? 'ty-listbox-select__tray' : 'ty-listbox-select__popover'} offset={4} data-presentation={narrow ? 'tray' : 'popover'}>\n {list}\n </Popover>\n </Select>\n )\n}\n","import {\n CalendarDate,\n endOfMonth,\n getWeeksInMonth,\n startOfMonth,\n startOfWeek,\n today as todayIn,\n getLocalTimeZone,\n type DateValue,\n} from '@internationalized/date'\nimport { ChevronLeft, ChevronRight } from 'lucide-react'\nimport { useContext, useEffect, useId, useRef, useState, type ReactNode } from 'react'\nimport {\n Button as AriaButton,\n Calendar as AriaCalendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n RangeCalendar as AriaRangeCalendar,\n RangeCalendarStateContext,\n I18nProvider,\n useLocale,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { ListboxSelect } from '../listbox-select/ListboxSelect'\n\n/** A calendar date without time or time zone, exchanged as a local `Date`. */\nexport type CalendarDay = Date\n\nexport interface CalendarRangeValue {\n start: CalendarDay\n end: CalendarDay\n}\n\n/** State of one day cell, passed to `renderDay`. */\nexport interface CalendarDayState {\n isToday: boolean\n isSelected: boolean\n isSelectionStart: boolean\n isSelectionEnd: boolean\n isUnavailable: boolean\n isDisabled: boolean\n isOutsideMonth: boolean\n isFocused: boolean\n}\n\nexport interface CalendarProps {\n /** Accessible name of the calendar grid group. */\n label: string\n /** Single date or start-to-end range. */\n mode?: 'single' | 'range'\n value: CalendarDay | CalendarRangeValue | null\n defaultValue?: CalendarDay | CalendarRangeValue | null\n onChange: (value: CalendarDay | CalendarRangeValue | null) => void\n minValue?: CalendarDay\n maxValue?: CalendarDay\n /** Days that cannot be chosen (booked, holidays); they stay visible. */\n isDateUnavailable?: (date: CalendarDay) => boolean\n /** Range mode: allow a range spanning unavailable days (they are excluded, not selected). */\n allowsNonContiguousRanges?: boolean\n /** Months shown side by side; paging moves by the whole set. */\n visibleMonths?: 1 | 2 | 3\n /** Paging moves by the visible set or by one month. */\n pageBehavior?: 'visible' | 'single'\n /** Title text, or month and year pickers for far jumps. */\n headerMode?: 'title' | 'pickers'\n /** Adds an ISO week-number column. */\n showWeekNumbers?: boolean\n /** Overrides the first day of the week from the locale. */\n firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'\n /** Shows days of neighbouring months (not selectable with several visible months). */\n showOutsideDays?: boolean\n /** Which day holds focus and which month shows. */\n focusedValue?: CalendarDay\n onFocusChange?: (date: CalendarDay) => void\n /** Adds content under the day number (a price, a dot); never replaces it. */\n renderDay?: (date: CalendarDay, state: CalendarDayState) => ReactNode\n /** Footer slot: presets or a note. */\n footer?: ReactNode\n disabled?: boolean\n readOnly?: boolean\n /** Marks the selection invalid (for example a range over unavailable days). */\n isInvalid?: boolean\n /** Error text shown when the selection is invalid. */\n errorMessage?: string\n /** Overrides the locale from the provider. */\n locale?: string\n className?: string\n}\n\nconst fromDate = (d: Date) => new CalendarDate(d.getFullYear(), d.getMonth() + 1, d.getDate())\nconst toDate = (c: CalendarDate) => new Date(c.year, c.month - 1, c.day)\n\n/** ISO-8601 week number: week 1 is the week holding the year's first Thursday. */\nfunction isoWeekNumber(date: CalendarDate): number {\n const target = new Date(Date.UTC(date.year, date.month - 1, date.day))\n const weekday = target.getUTCDay() || 7\n target.setUTCDate(target.getUTCDate() + 4 - weekday)\n const yearStart = new Date(Date.UTC(target.getUTCFullYear(), 0, 1))\n return Math.ceil(((target.getTime() - yearStart.getTime()) / 86400000 + 1) / 7)\n}\n\n/**\n * Cancels a pending range start on Escape (spec: wave-5-general/calendar.md,\n * keyboard section). Listens on the calendar root so the key bubbles from the\n * focused day cell, and stops propagation so an enclosing popover stays open.\n */\nfunction RangeEscapeCancel() {\n const state = useContext(RangeCalendarStateContext)\n const ref = useRef<HTMLSpanElement>(null)\n useEffect(() => {\n const root = ref.current?.parentElement\n if (!root || !state) return\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || !state.anchorDate) return\n e.stopPropagation()\n state.setAnchorDate(null)\n }\n root.addEventListener('keydown', onKey)\n return () => root.removeEventListener('keydown', onKey)\n }, [state])\n return <span ref={ref} aria-hidden=\"true\" hidden />\n}\n\n/**\n * A month grid for picking a date or a date range directly on the page\n * (spec: wave-5-general/calendar.md). Single mode rides RAC Calendar, range\n * mode RAC RangeCalendar; both follow the APG Date Picker Dialog grid.\n */\nexport function Calendar(props: CalendarProps) {\n const t = useMessages().calendar\n const { locale: contextLocale } = useLocale()\n const locale = props.locale ?? contextLocale\n const mode = props.mode ?? 'single'\n const months = props.visibleMonths ?? 1\n const now = todayIn(getLocalTimeZone())\n\n const [innerValue, setInnerValue] = useState<CalendarDay | CalendarRangeValue | null>(\n () => props.value ?? props.defaultValue ?? null,\n )\n const value = props.value !== undefined ? props.value : innerValue\n const valueStart = value && 'start' in value ? value.start : (value as CalendarDay | null)\n const [innerFocused, setInnerFocused] = useState<CalendarDate>(() => (valueStart ? fromDate(valueStart) : now))\n const focused = props.focusedValue ? fromDate(props.focusedValue) : innerFocused\n const setFocused = (d: CalendarDate) => {\n if (!props.focusedValue) setInnerFocused(d)\n props.onFocusChange?.(toDate(d))\n }\n const report = (next: CalendarDay | CalendarRangeValue | null) => {\n if (props.value === undefined) setInnerValue(next)\n props.onChange(next)\n }\n\n const min = props.minValue ? fromDate(props.minValue) : undefined\n const max = props.maxValue ? fromDate(props.maxValue) : undefined\n const baseUnavailable = (d: DateValue) => (props.isDateUnavailable ? props.isDateUnavailable(toDate(d as CalendarDate)) : false)\n\n const monthYearFmt = new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' })\n const monthFmt = new Intl.DateTimeFormat(locale, { month: 'long' })\n const headings = Array.from({ length: months }, (_, i) => toDate(startOfMonth(focused).add({ months: i })))\n const heading = headings\n .map((d, i) => (i === 0 || d.getFullYear() !== headings[i - 1]!.getFullYear() ? monthYearFmt.format(d) : monthFmt.format(d)))\n .join(' – ')\n\n const step = props.pageBehavior === 'single' ? 1 : months\n const prevTarget = startOfMonth(focused).subtract({ months: step })\n const nextTarget = startOfMonth(focused).add({ months: step })\n const baseId = useId()\n const headingId = `${baseId}-heading`\n\n const pickerYears = (() => {\n const from = Math.max(focused.year - 30, min?.year ?? focused.year - 30)\n const to = Math.min(focused.year + 30, max?.year ?? focused.year + 30)\n const list: number[] = []\n for (let y = from; y <= to; y++) list.push(y)\n return list\n })()\n const monthAllowed = (monthIndex: number) => {\n const first = new CalendarDate(focused.year, monthIndex + 1, 1)\n const last = endOfMonth(first)\n return (!max || first.compare(max) <= 0) && (!min || last.compare(min) >= 0)\n }\n\n const invalid = !!props.isInvalid || !!props.errorMessage\n const errorId = invalid && props.errorMessage ? `${baseId}-error` : undefined\n\n const renderGrid = (offsetMonths: number) => {\n const anchor = startOfMonth(focused).add({ months: offsetMonths })\n const weeks = getWeeksInMonth(anchor, locale)\n const weekStarts = Array.from({ length: weeks }, (_, w) => startOfWeek(anchor.add({ weeks: w }), locale))\n return (\n <div className=\"ty-calendar__month\">\n {props.showWeekNumbers ? (\n <div className=\"ty-calendar__weeks\" aria-hidden=\"true\">\n {weekStarts.map((week) => (\n <span key={week.toString()} className=\"ty-calendar__week\">\n {isoWeekNumber(week)}\n </span>\n ))}\n </div>\n ) : null}\n <CalendarGrid className=\"ty-calendar__grid\" weekdayStyle=\"short\" offset={offsetMonths ? { months: offsetMonths } : undefined}>\n <CalendarGridHeader>\n {(day) => <CalendarHeaderCell className=\"ty-calendar__weekday\">{day}</CalendarHeaderCell>}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <CalendarCell date={date} className=\"ty-calendar__day\">\n {({ formattedDate, isToday, isSelected, isSelectionStart, isSelectionEnd, isUnavailable, isDisabled, isOutsideMonth, isFocused }) => (\n <span className=\"ty-calendar__day-box\" data-today={isToday || undefined}>\n <span className=\"ty-calendar__day-number\">{formattedDate}</span>\n {props.renderDay\n ? props.renderDay(toDate(date), {\n isToday,\n isSelected,\n isSelectionStart,\n isSelectionEnd,\n isUnavailable,\n isDisabled,\n isOutsideMonth,\n isFocused,\n })\n : null}\n </span>\n )}\n </CalendarCell>\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n )\n }\n\n const header =\n props.headerMode === 'pickers' ? (\n <div className=\"ty-calendar__pickers\">\n <ListboxSelect\n accessibleLabel={t.monthPicker}\n className=\"ty-calendar__picker\"\n value={String(focused.month)}\n onChange={(key) => setFocused(focused.set({ month: Number(key) }))}\n options={Array.from({ length: 12 }, (_, m) => ({\n value: String(m + 1),\n label: monthFmt.format(new Date(2020, m, 15)),\n disabled: !monthAllowed(m),\n }))}\n />\n <ListboxSelect\n accessibleLabel={t.yearPicker}\n className=\"ty-calendar__picker\"\n value={String(focused.year)}\n onChange={(key) => setFocused(focused.set({ year: Number(key), day: 1 }))}\n options={pickerYears.map((y) => ({ value: String(y), label: String(y) }))}\n />\n </div>\n ) : (\n <span className=\"ty-calendar__heading\" id={headingId} aria-live=\"polite\">\n {heading}\n </span>\n )\n\n const stepper = (\n // Lives inside the AriaCalendar/AriaRangeCalendar: the slot=\"previous\" and\n // slot=\"next\" buttons only receive their wiring from the calendar context.\n <div className=\"ty-calendar__stepper\">\n <AriaButton slot=\"previous\" className=\"ty-calendar__nav\" aria-label={t.previousMonth(monthYearFmt.format(toDate(prevTarget)))}>\n <ChevronLeft className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n {header}\n <AriaButton slot=\"next\" className=\"ty-calendar__nav\" aria-label={t.nextMonth(monthYearFmt.format(toDate(nextTarget)))}>\n <ChevronRight className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n </div>\n )\n\n const shared = {\n 'aria-label': props.label,\n minValue: min,\n maxValue: max,\n isDisabled: props.disabled,\n isReadOnly: props.readOnly,\n pageBehavior: props.pageBehavior ?? 'visible',\n firstDayOfWeek: props.firstDayOfWeek,\n visibleDuration: { months },\n focusedValue: focused,\n onFocusChange: setFocused,\n isInvalid: invalid || undefined,\n } as const\n\n return (\n <I18nProvider locale={locale}>\n <div\n className={cx('ty-calendar', props.className)}\n data-mode={mode}\n data-months={months}\n data-outside-days={props.showOutsideDays === false ? undefined : ''}\n data-invalid={invalid || undefined}\n >\n <div className=\"ty-calendar__body\">\n {mode === 'range' ? (\n <AriaRangeCalendar\n {...shared}\n className=\"ty-calendar__rac\"\n value={value && 'start' in value ? { start: fromDate(value.start), end: fromDate(value.end) } : null}\n onChange={(range) => {\n if (!range) return report(null)\n report({ start: toDate(range.start as CalendarDate), end: toDate(range.end as CalendarDate) })\n }}\n isDateUnavailable={baseUnavailable}\n allowsNonContiguousRanges={props.allowsNonContiguousRanges}\n >\n <RangeEscapeCancel />\n {stepper}\n {Array.from({ length: months }, (_, i) => renderGrid(i))}\n </AriaRangeCalendar>\n ) : (\n <AriaCalendar\n {...shared}\n className=\"ty-calendar__rac\"\n value={value && 'start' in value ? null : (value ? fromDate(value as CalendarDay) : null)}\n onChange={(d) => report(d ? toDate(d as CalendarDate) : null)}\n isDateUnavailable={baseUnavailable}\n >\n {stepper}\n {Array.from({ length: months }, (_, i) => renderGrid(i))}\n </AriaCalendar>\n )}\n </div>\n {errorId ? (\n <p className=\"ty-calendar__error\" id={errorId} role=\"alert\">\n {props.errorMessage}\n </p>\n ) : null}\n {props.footer ? <div className=\"ty-calendar__footer\">{props.footer}</div> : null}\n </div>\n </I18nProvider>\n )\n}\n","import { Check, CircleAlert, Minus } from 'lucide-react'\nimport { forwardRef, useId, type ReactNode } from 'react'\nimport { Checkbox as AriaCheckbox, CheckboxGroup as AriaCheckboxGroup, Label } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useAppearedAfterMount } from '../field/Field'\n\nexport interface CheckboxProps {\n isSelected?: boolean\n defaultSelected?: boolean\n /** Mixed state for \"select all\" rows. */\n isIndeterminate?: boolean\n onChange?: (isSelected: boolean) => void\n label?: string\n /** Name when the visible text lives elsewhere. */\n accessibleLabel?: string\n description?: ReactNode\n /** Tile draws a surface around the row; bare is indicator plus text. */\n appearance?: 'tile' | 'bare'\n disabled?: boolean\n errorMessage?: string\n name?: string\n /** Form value; also the item key inside a CheckboxGroup. */\n value?: string\n required?: boolean\n id?: string\n className?: string\n}\n\n/** Whole-row checkbox with label and description (spec: wave-1/checkbox.md). */\nexport const Checkbox = forwardRef<HTMLLabelElement, CheckboxProps>(function Checkbox(props, ref) {\n const {\n isSelected,\n defaultSelected,\n isIndeterminate,\n onChange,\n label,\n accessibleLabel,\n description,\n appearance = 'tile',\n disabled = false,\n errorMessage,\n name,\n value,\n required,\n id,\n className,\n } = props\n const base = useId()\n devWarning(!label && !accessibleLabel, 'Checkbox: provide `label` or `accessibleLabel`.')\n const labelId = label ? `${base}-label` : undefined\n const descId = description != null ? `${base}-desc` : undefined\n const errorId = errorMessage ? `${base}-error` : undefined\n const describedBy = [descId, errorId].filter(Boolean).join(' ') || undefined\n const appeared = useAppearedAfterMount(!!errorMessage)\n return (\n <div className={cx('ty-checkbox', className)} data-appearance={appearance}>\n <AriaCheckbox\n ref={ref}\n id={id}\n isSelected={isSelected}\n defaultSelected={defaultSelected}\n isIndeterminate={isIndeterminate}\n onChange={onChange}\n isDisabled={disabled}\n isInvalid={!!errorMessage}\n isRequired={required}\n name={name}\n value={value}\n aria-label={label ? undefined : accessibleLabel}\n aria-labelledby={labelId}\n aria-describedby={describedBy}\n className=\"ty-checkbox__row\"\n >\n {({ isSelected: checked, isIndeterminate: mixed }) => (\n <>\n <span className=\"ty-checkbox__indicator\" aria-hidden=\"true\">\n {mixed ? <Minus className=\"ty-icon\" focusable=\"false\" /> : checked ? <Check className=\"ty-icon\" focusable=\"false\" /> : null}\n </span>\n {label || description != null ? (\n <span className=\"ty-checkbox__text\">\n {label ? (\n <span id={labelId} className=\"ty-checkbox__label\">\n {label}\n </span>\n ) : null}\n {description != null ? (\n <span id={descId} className=\"ty-checkbox__description\">\n {description}\n </span>\n ) : null}\n </span>\n ) : null}\n </>\n )}\n </AriaCheckbox>\n {errorMessage ? (\n <p id={errorId} className=\"ty-checkbox__error\" aria-live={appeared ? 'polite' : undefined}>\n <CircleAlert className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span>{errorMessage}</span>\n </p>\n ) : null}\n </div>\n )\n})\n\nexport interface CheckboxGroupProps {\n label: string\n description?: ReactNode\n value?: string[]\n defaultValue?: string[]\n onChange?: (values: string[]) => void\n orientation?: 'vertical' | 'horizontal'\n errorMessage?: string\n disabled?: boolean\n required?: boolean\n name?: string\n children: ReactNode\n className?: string\n}\n\n/** A labelled set of checkbox rows. */\nexport function CheckboxGroup({\n label,\n description,\n value,\n defaultValue,\n onChange,\n orientation = 'vertical',\n errorMessage,\n disabled,\n required,\n name,\n children,\n className,\n}: CheckboxGroupProps) {\n const base = useId()\n const descId = description != null ? `${base}-desc` : undefined\n const errorId = errorMessage ? `${base}-error` : undefined\n return (\n <AriaCheckboxGroup\n className={cx('ty-checkbox-group', className)}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n isDisabled={disabled}\n isRequired={required}\n isInvalid={!!errorMessage}\n name={name}\n aria-describedby={[descId, errorId].filter(Boolean).join(' ') || undefined}\n data-orientation={orientation}\n >\n <Label className=\"ty-checkbox-group__label\">{label}</Label>\n {description != null ? (\n <p id={descId} className=\"ty-checkbox-group__description\">\n {description}\n </p>\n ) : null}\n <div className=\"ty-checkbox-group__items\">{children}</div>\n {errorMessage ? (\n <p id={errorId} className=\"ty-checkbox__error\">\n <CircleAlert className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span>{errorMessage}</span>\n </p>\n ) : null}\n </AriaCheckboxGroup>\n )\n}\n","import { Inbox, SearchX, WifiOff } from 'lucide-react'\nimport { useId } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\nimport { Button, type ButtonVariant } from '../button/Button'\n\nexport type EmptyStateReason = 'no-data' | 'no-results' | 'offline' | 'custom'\nexport type EmptyStateFraming = 'inline' | 'section' | 'page'\n\nexport interface EmptyStateAction {\n label: string\n onPress: () => void\n /** Defaults to `primary` for the main action; use `secondary` when the view already has a primary. */\n variant?: ButtonVariant\n}\n\nexport interface EmptyStateProps {\n reason?: EmptyStateReason\n title?: string\n description?: string\n icon?: IconComponent\n action?: EmptyStateAction\n secondaryAction?: EmptyStateAction\n /** Adds the \"Clear filters\" action for `no-results`. */\n onClearFilters?: () => void\n /** Adds the retry action for `offline`. */\n onRetry?: () => void\n framing?: EmptyStateFraming\n headingLevel?: 2 | 3 | 4\n /** Wrap the title in a polite status (when it replaces content after a user action). */\n announce?: boolean\n className?: string\n}\n\nconst icons: Record<Exclude<EmptyStateReason, 'custom'>, IconComponent> = {\n 'no-data': Inbox,\n 'no-results': SearchX,\n offline: WifiOff,\n}\n\n/** Explains that a region is empty and what to do next (spec: wave-1/empty-state.md). */\nexport function EmptyState({\n reason = 'no-data',\n title,\n description,\n icon,\n action,\n secondaryAction,\n onClearFilters,\n onRetry,\n framing = 'section',\n headingLevel = 3,\n announce = false,\n className,\n}: EmptyStateProps) {\n const messages = useMessages()\n const titleId = useId()\n const copy = reason === 'custom' ? undefined : messages.empty[reason]\n const Icon = icon ?? (reason === 'custom' ? Inbox : icons[reason])\n const heading = title ?? copy?.title ?? ''\n const text = description ?? copy?.description\n\n let secondary = secondaryAction\n if (!secondary && reason === 'no-results' && onClearFilters) {\n secondary = { label: messages.empty.clearFilters, onPress: onClearFilters }\n }\n if (!secondary && reason === 'offline' && onRetry) {\n secondary = { label: messages.empty.retry, onPress: onRetry }\n }\n\n const H = `h${headingLevel}` as 'h2' | 'h3' | 'h4'\n const titleNode = (\n <H id={titleId} className=\"ty-empty__title\">\n {heading}\n </H>\n )\n\n return (\n <div\n className={cx('ty-empty', className)}\n data-framing={framing}\n role={framing === 'page' ? 'region' : undefined}\n aria-labelledby={framing === 'page' ? titleId : undefined}\n >\n <Icon className=\"ty-empty__icon\" aria-hidden=\"true\" focusable=\"false\" />\n {announce ? <div role=\"status\">{titleNode}</div> : titleNode}\n {text ? <p className=\"ty-empty__description\">{text}</p> : null}\n {action || secondary ? (\n <div className=\"ty-empty__actions\">\n {action ? (\n <Button variant={action.variant ?? 'primary'} onPress={() => action.onPress()}>\n {action.label}\n </Button>\n ) : null}\n {secondary ? (\n <Button variant={secondary.variant ?? 'secondary'} onPress={() => secondary.onPress()}>\n {secondary.label}\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n )\n}\n","import { ArrowDown, ArrowUp, ArrowUpDown, Check, Minus } from 'lucide-react'\nimport { useId, useRef, type CSSProperties, type ReactNode } from 'react'\nimport {\n Cell,\n Checkbox as AriaCheckbox,\n Column,\n Row,\n Table as AriaTable,\n TableBody,\n TableHeader,\n type Key,\n type Selection,\n type SortDescriptor,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useDomAttributes } from '../../internal/dom'\nimport { useMessages } from '../../internal/provider'\nimport { EmptyState } from '../empty-state/EmptyState'\nimport { Skeleton } from '../skeleton/Skeleton'\n\nexport type DataTableDensity = 'comfortable' | 'standard' | 'compact'\nexport type SortDirection = 'ascending' | 'descending' | null\n\nexport interface DataTableColumn {\n id: string\n header: ReactNode\n sortable?: boolean\n align?: 'start' | 'end'\n /** End alignment and tabular figures. */\n numeric?: boolean\n}\n\nexport interface DataTableRow {\n id: string\n cells: Record<string, ReactNode>\n href?: string\n /** Names the row link. */\n label?: string\n}\n\nexport interface DataTableProps {\n /** Accessible name of the table. */\n caption: string\n /** Show the caption visually (it is always available to assistive technology). */\n captionVisible?: boolean\n columns: DataTableColumn[]\n rows: DataTableRow[]\n density?: DataTableDensity\n sortColumn?: string\n sortDirection?: SortDirection\n /** Sort cycle per column: none, ascending, descending, none. */\n onSortChange?: (column: string, direction: SortDirection) => void\n selectionMode?: 'none' | 'multiple'\n selectedKeys?: Set<string>\n onSelectionChange?: (keys: Set<string>) => void\n loading?: boolean\n loadingRowCount?: number\n /** Polite status while loading (defaults to the messages catalogue). */\n loadingLabel?: string\n emptyState?: ReactNode\n stickyFirstColumn?: boolean\n showColumnLines?: boolean\n onRowAction?: (id: string) => void\n /** Maximum height of the scroll container, enabling the sticky header. */\n maxBlockSize?: string\n className?: string\n}\n\nfunction textOf(node: ReactNode): string | undefined {\n if (typeof node === 'string' || typeof node === 'number') return String(node)\n return undefined\n}\n\nfunction nextDirection(current: SortDirection, sameColumn: boolean): SortDirection {\n if (!sameColumn || current === null) return 'ascending'\n return current === 'ascending' ? 'descending' : null\n}\n\nfunction SortIcon({ direction }: { direction: SortDirection }) {\n const Icon = direction === 'ascending' ? ArrowUp : direction === 'descending' ? ArrowDown : ArrowUpDown\n return <Icon className=\"ty-table__sort-icon\" aria-hidden=\"true\" focusable=\"false\" />\n}\n\nfunction CellContent({ value }: { value: ReactNode }) {\n const text = textOf(value)\n return (\n <span className=\"ty-table__clamp\" title={text}>\n {value}\n </span>\n )\n}\n\nfunction SelectionBox({ isSelected, isIndeterminate }: { isSelected: boolean; isIndeterminate: boolean }) {\n return (\n <span className=\"ty-table__checkbox-box\" aria-hidden=\"true\">\n {isIndeterminate ? <Minus /> : isSelected ? <Check /> : null}\n </span>\n )\n}\n\n/** Records as rows and attributes as columns (spec: wave-1/data-table.md). */\nexport function DataTable(props: DataTableProps) {\n const {\n caption,\n captionVisible = false,\n columns,\n rows,\n density = 'standard',\n sortColumn,\n sortDirection = null,\n onSortChange,\n selectionMode = 'none',\n loading = false,\n loadingRowCount = 10,\n loadingLabel,\n emptyState,\n stickyFirstColumn = true,\n showColumnLines = false,\n onRowAction,\n maxBlockSize,\n className,\n } = props\n const messages = useMessages()\n const captionId = useId()\n const interactive = selectionMode !== 'none' || !!onRowAction || rows.some((r) => r.href)\n\n const wrapperProps = {\n className: cx('ty-table-wrap', className),\n 'data-density': density,\n 'data-sticky-first': stickyFirstColumn || undefined,\n 'data-column-lines': showColumnLines || undefined,\n 'data-selectable': selectionMode !== 'none' || undefined,\n }\n const scrollStyle: CSSProperties | undefined = maxBlockSize ? { maxBlockSize } : undefined\n const captionNode = (\n <div id={captionId} className={captionVisible ? 'ty-table__caption' : 'ty-visually-hidden'}>\n {caption}\n </div>\n )\n const status = loading ? (\n <span role=\"status\" className=\"ty-visually-hidden\">\n {loadingLabel ?? messages.table.loading}\n </span>\n ) : null\n const empty = emptyState ?? <EmptyState framing=\"inline\" headingLevel={4} title={messages.table.empty} />\n const colSpan = columns.length + (selectionMode !== 'none' ? 1 : 0)\n\n const requestSort = (column: string) => {\n onSortChange?.(column, nextDirection(sortColumn === column ? sortDirection : null, sortColumn === column))\n }\n\n if (!interactive) {\n return (\n <div {...wrapperProps}>\n {captionVisible ? captionNode : null}\n {status}\n <div className=\"ty-table-scroll\" style={scrollStyle}>\n <table className=\"ty-table\" aria-labelledby={captionVisible ? captionId : undefined} aria-busy={loading || undefined}>\n {captionVisible ? null : <caption className=\"ty-visually-hidden\">{caption}</caption>}\n <thead className=\"ty-table__head\">\n <tr className=\"ty-table__row ty-table__row--head\">\n {columns.map((col) => {\n const dir = sortColumn === col.id ? sortDirection : null\n return (\n <th\n key={col.id}\n scope=\"col\"\n className=\"ty-table__column\"\n data-align={col.numeric || col.align === 'end' ? 'end' : 'start'}\n aria-sort={col.sortable ? (dir ?? 'none') : undefined}\n >\n {col.sortable ? (\n <button type=\"button\" className=\"ty-table__sort\" onClick={() => requestSort(col.id)}>\n <span>{col.header}</span>\n <SortIcon direction={dir} />\n </button>\n ) : (\n col.header\n )}\n </th>\n )\n })}\n </tr>\n </thead>\n <tbody className=\"ty-table__body\">\n {loading\n ? Array.from({ length: loadingRowCount }, (_, i) => (\n <tr key={`loading-${i}`} className=\"ty-table__row\" data-loading=\"true\" aria-hidden=\"true\">\n {columns.map((col) => (\n <td key={col.id} className=\"ty-table__cell\">\n <Skeleton width={col.numeric ? 'short' : 'long'} />\n </td>\n ))}\n </tr>\n ))\n : rows.length === 0\n ? (\n <tr className=\"ty-table__row ty-table__row--empty\">\n <td className=\"ty-table__cell ty-table__cell--empty\" colSpan={colSpan}>\n {empty}\n </td>\n </tr>\n )\n : rows.map((row) => (\n <tr key={row.id} className=\"ty-table__row\">\n {columns.map((col, i) => {\n const align = col.numeric || col.align === 'end' ? 'end' : 'start'\n const content = <CellContent value={row.cells[col.id]} />\n return i === 0 ? (\n <th key={col.id} scope=\"row\" className=\"ty-table__cell ty-table__cell--row-header\" data-align={align}>\n {content}\n </th>\n ) : (\n <td key={col.id} className=\"ty-table__cell\" data-align={align} data-numeric={col.numeric || undefined}>\n {content}\n </td>\n )\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n )\n }\n\n return (\n <InteractiveTable\n {...props}\n wrapperProps={wrapperProps}\n captionNode={captionVisible ? captionNode : null}\n captionId={captionVisible ? captionId : undefined}\n status={status}\n empty={empty}\n scrollStyle={scrollStyle}\n requestSort={requestSort}\n loadingRowCount={loadingRowCount}\n density={density}\n />\n )\n}\n\ninterface InteractiveProps extends DataTableProps {\n wrapperProps: Record<string, unknown>\n captionNode: ReactNode\n captionId?: string\n status: ReactNode\n empty: ReactNode\n scrollStyle?: CSSProperties\n requestSort: (column: string) => void\n loadingRowCount: number\n}\n\nconst NO_SORT: SortDescriptor = { column: '__ty-none__', direction: 'ascending' }\n\nfunction InteractiveTable({\n caption,\n columns,\n rows,\n sortColumn,\n sortDirection = null,\n selectionMode = 'none',\n selectedKeys,\n onSelectionChange,\n loading = false,\n loadingRowCount,\n onRowAction,\n wrapperProps,\n captionNode,\n captionId,\n status,\n empty,\n scrollStyle,\n requestSort,\n}: InteractiveProps) {\n const tableRef = useRef<HTMLTableElement>(null)\n useDomAttributes(tableRef, { 'aria-busy': loading ? 'true' : undefined })\n const selectable = selectionMode !== 'none'\n const sortDescriptor: SortDescriptor =\n sortColumn && sortDirection ? { column: sortColumn, direction: sortDirection } : NO_SORT\n\n const loadingKeys = Array.from({ length: loading ? loadingRowCount : 0 }, (_, i) => `__ty-loading-${i}`)\n const onSelection = (keys: Selection) => {\n if (!onSelectionChange) return\n if (keys === 'all') onSelectionChange(new Set(rows.map((r) => r.id)))\n else onSelectionChange(new Set(Array.from(keys, (k: Key) => String(k))))\n }\n\n return (\n <div {...wrapperProps}>\n {captionNode}\n {status}\n <div className=\"ty-table-scroll\" style={scrollStyle}>\n <AriaTable\n ref={tableRef}\n className=\"ty-table\"\n aria-label={captionId ? undefined : caption}\n aria-labelledby={captionId}\n sortDescriptor={sortDescriptor}\n onSortChange={(d) => requestSort(String(d.column))}\n selectionMode={selectable ? 'multiple' : 'none'}\n selectionBehavior=\"toggle\"\n selectedKeys={selectedKeys ?? new Set()}\n onSelectionChange={onSelection}\n disabledKeys={loadingKeys}\n onRowAction={onRowAction ? (key) => onRowAction(String(key)) : undefined}\n >\n <TableHeader className=\"ty-table__head\">\n {selectable ? (\n <Column className=\"ty-table__column ty-table__column--select\">\n <AriaCheckbox slot=\"selection\" className=\"ty-table__checkbox\" isDisabled={loading || rows.length === 0}>\n {({ isSelected, isIndeterminate }) => <SelectionBox isSelected={isSelected} isIndeterminate={isIndeterminate} />}\n </AriaCheckbox>\n </Column>\n ) : null}\n {columns.map((col, i) => {\n const dir = sortColumn === col.id ? sortDirection : null\n return (\n <Column\n key={col.id}\n id={col.id}\n isRowHeader={i === 0}\n allowsSorting={!!col.sortable}\n className=\"ty-table__column\"\n data-align={col.numeric || col.align === 'end' ? 'end' : 'start'}\n textValue={textOf(col.header)}\n >\n {col.sortable ? (\n <span className=\"ty-table__sort\">\n <span>{col.header}</span>\n <SortIcon direction={dir} />\n </span>\n ) : (\n col.header\n )}\n </Column>\n )\n })}\n </TableHeader>\n <TableBody\n className=\"ty-table__body\"\n renderEmptyState={() => <div className=\"ty-table__empty\">{empty}</div>}\n >\n {loading\n ? loadingKeys.map((key) => (\n <Row key={key} id={key} className=\"ty-table__row\" data-loading=\"true\" textValue=\"\">\n {selectable ? (\n <Cell className=\"ty-table__cell ty-table__cell--select\">\n <span aria-hidden=\"true\" className=\"ty-table__checkbox-box\" />\n </Cell>\n ) : null}\n {columns.map((col) => (\n <Cell key={col.id} className=\"ty-table__cell\">\n <Skeleton width={col.numeric ? 'short' : 'long'} />\n </Cell>\n ))}\n </Row>\n ))\n : rows.map((row) => (\n <Row\n key={row.id}\n id={row.id}\n href={row.href}\n textValue={row.label ?? textOf(row.cells[columns[0]?.id ?? '']) ?? row.id}\n className=\"ty-table__row\"\n data-actionable={row.href || onRowAction ? true : undefined}\n >\n {selectable ? (\n <Cell className=\"ty-table__cell ty-table__cell--select\">\n <AriaCheckbox slot=\"selection\" className=\"ty-table__checkbox\">\n {({ isSelected, isIndeterminate }) => (\n <SelectionBox isSelected={isSelected} isIndeterminate={isIndeterminate} />\n )}\n </AriaCheckbox>\n </Cell>\n ) : null}\n {columns.map((col) => (\n <Cell\n key={col.id}\n className=\"ty-table__cell\"\n data-align={col.numeric || col.align === 'end' ? 'end' : 'start'}\n data-numeric={col.numeric || undefined}\n textValue={textOf(row.cells[col.id])}\n >\n <CellContent value={row.cells[col.id]} />\n </Cell>\n ))}\n </Row>\n ))}\n </TableBody>\n </AriaTable>\n </div>\n </div>\n )\n}\n","// Shared pieces of the pickers and fields in the \"forms-b\" group: field text\n// lines, a floating surface that becomes a bottom tray on phones, a year\n// stepper and a twelve-month grid (used by DateField and MonthField).\nimport { ChevronLeft, ChevronRight, CircleAlert } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { Button as AriaButton, Dialog, GridList, GridListItem, Popover, type Key } from 'react-aria-components'\nimport { cx } from '../cx'\nimport { useMediaQuery } from '../media'\n\n/** Space-separated id list without empty entries (or undefined). */\nexport const joinIds = (...ids: Array<string | false | null | undefined>): string | undefined => ids.filter(Boolean).join(' ') || undefined\n\n/** True below 640 px, where floating pickers become a bottom tray. */\nexport function usePhoneWidth(): boolean {\n return useMediaQuery('(max-width: 639.98px)')\n}\n\ntype LineKind = 'label' | 'hint' | 'error'\n\n/** One text line of a field: label (above), hint (below the label) or error (below the control). */\nexport function FieldLine({ kind, id, htmlFor, children }: { kind: LineKind; id?: string; htmlFor?: string; children: ReactNode }) {\n if (kind === 'label') {\n return htmlFor ? (\n <label className=\"ty-fb-line\" data-line=\"label\" id={id} htmlFor={htmlFor}>\n {children}\n </label>\n ) : (\n <span className=\"ty-fb-line\" data-line=\"label\" id={id}>\n {children}\n </span>\n )\n }\n return (\n <p className=\"ty-fb-line\" data-line={kind} id={id}>\n {kind === 'error' ? <CircleAlert className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n <span>{children}</span>\n </p>\n )\n}\n\nexport type FloatSide = 'top' | 'bottom' | 'left' | 'right'\n\n/** Non-modal floating dialog; below 640 px the same popover is laid out as a bottom tray. */\nexport function FloatSurface(props: {\n label?: string\n labelledBy?: string\n side?: FloatSide\n className?: string\n children: ReactNode\n}) {\n const phone = usePhoneWidth()\n return (\n <Popover\n className={cx('ty-fb-float', props.className)}\n placement={props.side ?? 'bottom'}\n offset={6}\n data-presentation={phone ? 'tray' : 'popover'}\n >\n <Dialog className=\"ty-fb-float__dialog\" aria-label={props.labelledBy ? undefined : props.label} aria-labelledby={props.labelledBy}>\n {props.children}\n </Dialog>\n </Popover>\n )\n}\n\n/** Previous / heading / next row; the heading is a polite live region. */\nexport function StepperHeader(props: {\n heading: ReactNode\n previousLabel: string\n nextLabel: string\n onPrevious: () => void\n onNext: () => void\n previousDisabled?: boolean\n nextDisabled?: boolean\n headingId?: string\n}) {\n return (\n <div className=\"ty-fb-stepper\">\n <AriaButton className=\"ty-fb-nav\" aria-label={props.previousLabel} isDisabled={props.previousDisabled} onPress={props.onPrevious}>\n <ChevronLeft className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n <span className=\"ty-fb-stepper__heading\" id={props.headingId} aria-live=\"polite\">\n {props.heading}\n </span>\n <AriaButton className=\"ty-fb-nav\" aria-label={props.nextLabel} isDisabled={props.nextDisabled} onPress={props.onNext}>\n <ChevronRight className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n </div>\n )\n}\n\n/** Localised month names, January first. */\nexport function monthNames(locale: string, width: 'long' | 'short' = 'long'): string[] {\n const fmt = new Intl.DateTimeFormat(locale, { month: width, timeZone: 'UTC' })\n return Array.from({ length: 12 }, (_, m) => fmt.format(Date.UTC(2020, m, 15)))\n}\n\n/** \"YYYY-MM\" key of a year and a zero-based month. */\nexport const monthKey = (year: number, monthIndex: number) => `${year}-${String(monthIndex + 1).padStart(2, '0')}`\n\n/**\n * Twelve months of one year as a grid list (APG grid-like navigation);\n * unavailable months stay visible but disabled. PageUp/PageDown step years.\n */\nexport function MonthGrid(props: {\n year: number\n locale: string\n label: string\n isAvailable: (key: string) => boolean\n selected?: string | null\n onChoose: (key: string) => void\n onYearStep?: (delta: number) => void\n}) {\n const names = monthNames(props.locale, 'short')\n const longNames = monthNames(props.locale, 'long')\n const cells = names.map((short, m) => ({ key: monthKey(props.year, m), short, long: longNames[m]! }))\n const disabled = cells.filter((c) => !props.isAvailable(c.key)).map((c) => c.key)\n const pick = (keys: 'all' | Set<Key>) => {\n if (keys === 'all') return\n const [first] = [...keys]\n if (first != null) props.onChoose(String(first))\n }\n return (\n <div\n className=\"ty-fb-months\"\n onKeyDown={(e) => {\n if (!props.onYearStep || (e.key !== 'PageUp' && e.key !== 'PageDown')) return\n e.preventDefault()\n props.onYearStep(e.key === 'PageUp' ? -1 : 1)\n }}\n >\n <GridList\n aria-label={props.label}\n layout=\"grid\"\n className=\"ty-fb-months__grid\"\n items={cells}\n selectionMode=\"single\"\n disallowEmptySelection\n selectedKeys={props.selected ? [props.selected] : []}\n disabledKeys={disabled}\n onSelectionChange={pick}\n >\n {(cell) => (\n <GridListItem id={cell.key} textValue={`${cell.long} ${props.year}`} className=\"ty-fb-months__cell\">\n {cell.short}\n </GridListItem>\n )}\n </GridList>\n </div>\n )\n}\n","import { CalendarDate, today as todayIn, getLocalTimeZone } from '@internationalized/date'\nimport { CalendarDays } from 'lucide-react'\nimport { useId, useState, type ReactNode } from 'react'\nimport { Button as AriaButton, DateInput, DateRangePicker, DateSegment, Group, I18nProvider, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { FieldLine, FloatSurface, joinIds, usePhoneWidth } from '../../internal/forms-b/parts'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { Calendar } from '../calendar/Calendar'\n\n/** A start-to-end range of calendar dates without time, exchanged as local `Date`s. */\nexport interface DateRangeFieldValue {\n start: Date | null\n end: Date | null\n}\n\n/** One quick choice in the popover: `{ id, label, range }`. */\nexport interface DateRangePreset {\n id: string\n label: string\n range: DateRangeFieldValue\n}\n\nexport interface DateRangeFieldProps {\n label: string\n value: DateRangeFieldValue | null\n defaultValue?: DateRangeFieldValue | null\n onChange: (value: DateRangeFieldValue | null) => void\n minValue?: Date\n maxValue?: Date\n isDateUnavailable?: (date: Date) => boolean\n /** Longest allowed range in days; longer ranges are invalid. */\n maxDays?: number\n /** Quick choices shown beside or above the calendar. */\n presets?: DateRangePreset[]\n /** Immediate: the second pick commits and closes. Apply: picks are a draft until Apply. */\n confirmation?: 'immediate' | 'apply'\n /** Months in the popover (one on narrow screens whatever the value). */\n visibleMonths?: 1 | 2\n /** Form field names; both dates submit in ISO format. */\n startName?: string\n endName?: string\n required?: boolean\n disabled?: boolean\n readOnly?: boolean\n errorText?: string\n hint?: ReactNode\n /** Overrides the locale from the provider. */\n locale?: string\n className?: string\n}\n\nconst fromDate = (d: Date | null) => (d ? new CalendarDate(d.getFullYear(), d.getMonth() + 1, d.getDate()) : null)\nconst toDate = (c: CalendarDate | null) => (c ? new Date(c.year, c.month - 1, c.day) : null)\nconst daysBetween = (a: Date, b: Date) => Math.round((b.getTime() - a.getTime()) / 86400000)\n\n/**\n * Enter a start and end date by typing into segmented date inputs or by\n * picking in a Calendar popover (spec: wave-5-general/date-range-field.md).\n * Built on RAC DateRangePicker; APG Date Picker Dialog.\n */\nexport function DateRangeField(props: DateRangeFieldProps) {\n const t = useMessages().dateRangeField\n const { locale: contextLocale } = useLocale()\n const now = todayIn(getLocalTimeZone())\n\n const [innerValue, setInnerValue] = useState<DateRangeFieldValue | null>(() => props.value ?? props.defaultValue ?? null)\n const value = props.value !== undefined ? props.value : innerValue\n const [open, setOpen] = useState(false)\n const [draft, setDraft] = useState<DateRangeFieldValue | null>(null)\n const phone = usePhoneWidth()\n const months: 1 | 2 = phone ? 1 : (props.visibleMonths ?? 2)\n const confirmation = props.confirmation ?? 'immediate'\n\n const commit = (next: DateRangeFieldValue | null) => {\n if (props.value === undefined) setInnerValue(next)\n props.onChange(next)\n }\n\n const shown = open && confirmation === 'apply' ? draft : value\n const shownRange = shown && (shown.start || shown.end) ? { start: fromDate(shown.start), end: fromDate(shown.end) } : null\n const racValue = shownRange && shownRange.start && shownRange.end ? { start: shownRange.start, end: shownRange.end } : null\n\n // Validation: the host text wins, then the computed reasons.\n const computedInvalid = (() => {\n const start = value?.start\n const end = value?.end\n if (!start || !end) return null\n if (end.getTime() < start.getTime()) return t.endBeforeStart\n if (props.maxDays != null && daysBetween(start, end) + 1 > props.maxDays) return t.tooManyDays(props.maxDays)\n if (props.minValue && start.getTime() < props.minValue.getTime()) return t.outOfBounds\n if (props.maxValue && end.getTime() > props.maxValue.getTime()) return t.outOfBounds\n if (props.isDateUnavailable) {\n const cursor = new Date(start.getTime())\n while (cursor.getTime() <= end.getTime()) {\n if (props.isDateUnavailable(cursor)) return t.unavailableDay\n cursor.setDate(cursor.getDate() + 1)\n }\n }\n return null\n })()\n const errorMessage = props.errorText ?? computedInvalid ?? undefined\n const invalid = !!errorMessage\n\n const base = useId()\n const labelId = `${base}-label`\n const hintId = props.hint != null && !errorMessage ? `${base}-hint` : undefined\n const errorId = errorMessage ? `${base}-error` : undefined\n\n const openChange = (next: boolean) => {\n if (next) setDraft(value ? { ...value } : null)\n setOpen(next)\n }\n\n const pickFromCalendar = (range: { start: Date; end: Date } | null) => {\n if (confirmation === 'apply') {\n setDraft(range)\n return\n }\n commit(range)\n setOpen(false)\n }\n\n const typed = (range: { start: CalendarDate | null; end: CalendarDate | null } | null) => {\n const next: DateRangeFieldValue | null = range && (range.start || range.end) ? { start: toDate(range.start), end: toDate(range.end) } : null\n if (open && confirmation === 'apply') setDraft(next)\n else commit(next)\n }\n\n const applyPreset = (preset: DateRangePreset) => {\n if (confirmation === 'apply') {\n setDraft({ ...preset.range })\n return\n }\n commit({ ...preset.range })\n setOpen(false)\n }\n\n const calendar = (\n <Calendar\n label={props.label}\n mode=\"range\"\n value={draft && draft.start && draft.end ? { start: draft.start, end: draft.end } : null}\n onChange={(next) => pickFromCalendar(next as { start: Date; end: Date } | null)}\n minValue={props.minValue}\n maxValue={props.maxValue}\n isDateUnavailable={props.isDateUnavailable}\n visibleMonths={months}\n focusedValue={draft?.start ?? (value?.start ?? new Date(now.year, now.month - 1, now.day))}\n isInvalid={invalid}\n />\n )\n\n return (\n <I18nProvider locale={props.locale ?? contextLocale}>\n <div className={cx('ty-date-range-field', props.className)} data-invalid={invalid || undefined}>\n <FieldLine kind=\"label\" id={labelId}>\n <span>{props.label}</span>\n </FieldLine>\n {hintId ? (\n <FieldLine kind=\"hint\" id={hintId}>\n {props.hint}\n </FieldLine>\n ) : null}\n <DateRangePicker\n className=\"ty-date-range-field__picker\"\n value={racValue}\n onChange={typed}\n isOpen={open}\n onOpenChange={openChange}\n shouldCloseOnSelect={false}\n startName={props.startName}\n endName={props.endName}\n minValue={fromDate(props.minValue ?? null) ?? undefined}\n maxValue={fromDate(props.maxValue ?? null) ?? undefined}\n isDateUnavailable={(d) => (props.isDateUnavailable ? props.isDateUnavailable(toDate(d as CalendarDate)!) : false)}\n isDisabled={props.disabled}\n isReadOnly={props.readOnly}\n isRequired={props.required}\n isInvalid={invalid || undefined}\n aria-labelledby={labelId}\n aria-describedby={joinIds(hintId, errorId)}\n >\n <Group className=\"ty-date-range-field__group\">\n <DateInput slot=\"start\" className=\"ty-date-range-field__input\" aria-label={`${props.label}: ${t.start}`}>\n {(segment) => <DateSegment segment={segment} className=\"ty-date-range-field__segment\" />}\n </DateInput>\n <span className=\"ty-date-range-field__dash\" aria-hidden=\"true\">\n –\n </span>\n <DateInput slot=\"end\" className=\"ty-date-range-field__input\" aria-label={`${props.label}: ${t.end}`}>\n {(segment) => <DateSegment segment={segment} className=\"ty-date-range-field__segment\" />}\n </DateInput>\n <AriaButton className=\"ty-date-range-field__trigger\" aria-label={props.label}>\n <CalendarDays className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n </Group>\n <FloatSurface labelledBy={labelId} className=\"ty-date-range-field__surface\">\n <div className=\"ty-date-range-field__panel\">\n {props.presets?.length ? (\n <div className=\"ty-date-range-field__presets\" role=\"group\" aria-label={t.presets}>\n {props.presets.map((preset) => (\n <Button key={preset.id} variant=\"quiet\" size=\"compact\" onPress={() => applyPreset(preset)}>\n {preset.label}\n </Button>\n ))}\n </div>\n ) : null}\n {calendar}\n {confirmation === 'apply' ? (\n <div className=\"ty-date-range-field__actions\">\n <Button variant=\"quiet\" size=\"compact\" onPress={() => openChange(false)}>\n {t.cancel}\n </Button>\n <Button variant=\"primary\" size=\"compact\" onPress={() => { commit(draft); setOpen(false) }}>\n {t.apply}\n </Button>\n </div>\n ) : null}\n </div>\n </FloatSurface>\n </DateRangePicker>\n {errorId ? (\n <FieldLine kind=\"error\" id={errorId}>\n {errorMessage}\n </FieldLine>\n ) : null}\n </div>\n </I18nProvider>\n )\n}\n","import { X } from 'lucide-react'\nimport { useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent, type ReactNode } from 'react'\nimport { Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport type DrawerPlacement = 'bottom' | 'end'\nexport type DrawerWidth = 'medium' | 'large' | 'wide'\n\nexport interface DrawerProps {\n open: boolean\n /** Called with false on any dismissal: backdrop, Escape, close button, drag. */\n onOpenChange: (open: boolean) => void\n /** Visible heading and accessible name. */\n title: string\n placement?: DrawerPlacement\n /** Maximum width of an end-placed panel. */\n width?: DrawerWidth\n /** Maximum height of a bottom-placed panel (CSS length, e.g. '85dvh'). */\n maxHeight?: string\n /** Shows the grab handle (bottom placement only). */\n showHandle?: boolean\n /** When false, backdrop press and drag do not close (Escape and the close button still do). */\n dismissible?: boolean\n children?: ReactNode\n className?: string\n}\n\n/** Distance (px) or velocity (px/ms) past which a released drag closes the drawer. */\nexport const DRAWER_DRAG_DISTANCE = 120\nexport const DRAWER_DRAG_VELOCITY = 0.6\n\n/** Modal panel attached to the bottom or end edge (spec: wave-1/drawer.md). */\nexport function Drawer(props: DrawerProps) {\n const {\n open,\n onOpenChange,\n title,\n placement = 'bottom',\n width = 'medium',\n maxHeight,\n showHandle = true,\n dismissible = true,\n children,\n className,\n } = props\n const messages = useMessages()\n const [drag, setDrag] = useState(0)\n const start = useRef<{ y: number; t: number } | null>(null)\n const canDrag = placement === 'bottom' && dismissible\n\n const onPointerDown = (e: ReactPointerEvent<HTMLElement>) => {\n if (!canDrag || (e.button !== undefined && e.button > 0)) return\n if ((e.target as HTMLElement).closest('button')) return\n start.current = { y: e.clientY, t: e.timeStamp || performance.now() }\n e.currentTarget.setPointerCapture?.(e.pointerId)\n }\n const onPointerMove = (e: ReactPointerEvent<HTMLElement>) => {\n if (!start.current) return\n setDrag(Math.max(0, e.clientY - start.current.y))\n }\n const onPointerUp = (e: ReactPointerEvent<HTMLElement>) => {\n if (!start.current) return\n const distance = Math.max(0, e.clientY - start.current.y)\n const elapsed = Math.max(1, (e.timeStamp || performance.now()) - start.current.t)\n start.current = null\n setDrag(0)\n if (distance >= DRAWER_DRAG_DISTANCE || distance / elapsed >= DRAWER_DRAG_VELOCITY) onOpenChange(false)\n }\n\n const dragging = drag > 0\n const panelStyle: CSSProperties = {\n ...(maxHeight && placement === 'bottom' ? { maxBlockSize: maxHeight } : {}),\n ...(dragging ? { transform: `translateY(${drag}px)`, transition: 'none' } : {}),\n }\n const overlayStyle: CSSProperties | undefined = dragging ? { opacity: Math.max(0.2, 1 - drag / 400) } : undefined\n const dragHandlers = canDrag ? { onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp } : {}\n\n return (\n <ModalOverlay\n isOpen={open}\n onOpenChange={(o) => {\n if (!o) onOpenChange(false)\n }}\n isDismissable={dismissible}\n className=\"ty-drawer__backdrop\"\n data-placement={placement}\n style={overlayStyle}\n >\n <Modal\n className={cx('ty-drawer', className)}\n data-placement={placement}\n data-width={width}\n data-dragging={dragging || undefined}\n style={panelStyle}\n >\n <Dialog className=\"ty-drawer__dialog\">\n <header className=\"ty-drawer__header\" {...dragHandlers}>\n {placement === 'bottom' && showHandle ? <span className=\"ty-drawer__handle\" aria-hidden=\"true\" /> : null}\n <Heading slot=\"title\" level={2} className=\"ty-drawer__title\">\n {title}\n </Heading>\n <Button\n className=\"ty-drawer__close\"\n variant=\"quiet\"\n size=\"compact\"\n shape=\"circle\"\n iconOnly\n accessibleLabel={messages.close}\n leadingIcon={<X />}\n onPress={() => onOpenChange(false)}\n />\n </header>\n <div className=\"ty-drawer__body\">{children}</div>\n {placement === 'bottom' ? <div className=\"ty-drawer__inset\" aria-hidden=\"true\" /> : null}\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n}\n","import { ChevronDown, CircleAlert, FileQuestion, GitMerge, Lock, ServerCrash, WifiOff } from 'lucide-react'\nimport { useEffect, useId, useRef, useState } from 'react'\nimport { Disclosure, DisclosurePanel } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport type { ErrorKind } from '../../internal/messages'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\nimport { Button } from '../button/Button'\n\nexport type ErrorStateKind = ErrorKind\n\nexport interface ErrorStateProps {\n kind?: ErrorStateKind\n title?: string\n message?: string\n /** HTTP status shown as small metadata. */\n statusCode?: number\n /** problem+json `type`, shown in mono meta text. */\n problemType?: string\n /** Technical details inside a disclosure. */\n details?: string\n /** Shows \"Try again\"; while a returned promise is pending the button is busy. */\n onRetry?: () => void | Promise<void>\n secondaryAction?: { label: string; onPress?: () => void; href?: string }\n /** `page` fills the sheet; `block` replaces only the failed part. */\n scope?: 'page' | 'block'\n /**\n * The error appeared after the content was already shown: announce it with\n * `role=\"alert\"`. When false (first render) the page-scope title takes focus instead.\n */\n appearedAfterLoad?: boolean\n headingLevel?: 2 | 3 | 4\n labels?: { retry?: string; details?: string }\n className?: string\n}\n\nconst icons: Record<ErrorStateKind, IconComponent> = {\n generic: CircleAlert,\n network: WifiOff,\n server: ServerCrash,\n permission: Lock,\n 'not-found': FileQuestion,\n conflict: GitMerge,\n}\n\n/** Plain-language failure with retry and a way back (spec: wave-1/error-state.md). */\nexport function ErrorState({\n kind = 'generic',\n title,\n message,\n statusCode,\n problemType,\n details,\n onRetry,\n secondaryAction,\n scope = 'page',\n appearedAfterLoad = false,\n headingLevel,\n labels,\n className,\n}: ErrorStateProps) {\n const messages = useMessages()\n const copy = messages.error[kind]\n const titleId = useId()\n const titleRef = useRef<HTMLHeadingElement>(null)\n const [retrying, setRetrying] = useState(false)\n const mounted = useRef(true)\n const Icon = icons[kind]\n const level = headingLevel ?? (scope === 'page' ? 2 : 3)\n const H = `h${level}` as 'h2' | 'h3' | 'h4'\n\n useEffect(() => {\n mounted.current = true\n if (scope === 'page' && !appearedAfterLoad) titleRef.current?.focus()\n return () => {\n mounted.current = false\n }\n // Focus only on first render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const retry = () => {\n if (!onRetry || retrying) return\n const result = onRetry()\n if (result && typeof (result as Promise<void>).then === 'function') {\n setRetrying(true)\n ;(result as Promise<void>).then(\n () => mounted.current && setRetrying(false),\n () => mounted.current && setRetrying(false),\n )\n }\n }\n\n return (\n <div\n className={cx('ty-error', className)}\n data-scope={scope}\n data-kind={kind}\n role={appearedAfterLoad ? 'alert' : scope === 'block' ? 'region' : undefined}\n aria-labelledby={!appearedAfterLoad && scope === 'block' ? titleId : undefined}\n >\n <Icon className=\"ty-error__icon\" aria-hidden=\"true\" focusable=\"false\" />\n <H id={titleId} ref={titleRef} tabIndex={-1} className=\"ty-error__title\">\n {title ?? copy.title}\n </H>\n <p className=\"ty-error__message\">{message ?? copy.message}</p>\n {statusCode !== undefined || problemType ? (\n <p className=\"ty-error__meta\">\n {statusCode !== undefined ? <span>{messages.error.statusCode(statusCode)}</span> : null}\n {problemType ? <code className=\"ty-error__type\">{problemType}</code> : null}\n </p>\n ) : null}\n {details ? (\n <Disclosure className=\"ty-error__details\">\n <Button slot=\"trigger\" variant=\"quiet\" size=\"compact\" trailingIcon={<ChevronDown className=\"ty-error__chevron\" />}>\n {labels?.details ?? messages.error.details}\n </Button>\n <DisclosurePanel className=\"ty-error__details-panel\">\n <pre className=\"ty-error__details-text\">{details}</pre>\n </DisclosurePanel>\n </Disclosure>\n ) : null}\n {onRetry || secondaryAction ? (\n <div className=\"ty-error__actions\">\n {onRetry ? (\n <Button\n variant=\"secondary\"\n busy={retrying}\n disabled={retrying}\n focusableWhenDisabled\n onPress={retry}\n >\n {labels?.retry ?? messages.error.retry}\n </Button>\n ) : null}\n {secondaryAction ? (\n <Button variant=\"quiet\" href={secondaryAction.href} onPress={() => secondaryAction.onPress?.()}>\n {secondaryAction.label}\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n )\n}\n","import { forwardRef, useId, type ReactNode } from 'react'\nimport { Heading as AriaHeading } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6\nexport type HeadingAppearance = 'display' | 'h1' | 'h2' | 'h3' | 'label'\n\nexport interface HeadingProps {\n /** Document outline level. */\n level?: HeadingLevel\n /** Visual step of §2.2, decoupled from `level`. */\n appearance?: HeadingAppearance\n /** Small uppercase label rendered before, and outside, the heading element. */\n eyebrow?: string\n /** Stable id for `aria-labelledby`. Generated when omitted. */\n id?: string\n className?: string\n children: ReactNode\n}\n\nfunction appearanceFor(level: HeadingLevel): HeadingAppearance {\n return level === 1 ? 'h1' : level === 2 ? 'h2' : 'h3'\n}\n\n/** Section title with independent level and visual size (spec: wave-1/heading.md). */\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { level = 1, appearance, eyebrow, id, className, children },\n ref,\n) {\n const generated = useId()\n const headingId = id ?? `ty-heading-${generated.replace(/:/g, '')}`\n const heading = (\n <AriaHeading\n ref={ref}\n level={level}\n id={headingId}\n className={cx('ty-heading', !eyebrow && className)}\n data-appearance={appearance ?? appearanceFor(level)}\n >\n {children}\n </AriaHeading>\n )\n if (!eyebrow) return heading\n return (\n <div className={cx('ty-heading-group', className)}>\n <p className=\"ty-heading__eyebrow\">{eyebrow}</p>\n {heading}\n </div>\n )\n})\n\nexport type SubheadingProps = HeadingProps\n\n/** Heading with `level` 2 and `appearance` h3 by default. */\nexport const Subheading = forwardRef<HTMLHeadingElement, SubheadingProps>(function Subheading(\n { level = 2, appearance = 'h3', ...rest },\n ref,\n) {\n return <Heading ref={ref} level={level} appearance={appearance} {...rest} />\n})\n","import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from 'lucide-react'\nimport { useRef, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport type InlineNoticeTone = 'danger' | 'warning' | 'info' | 'success'\nexport type InlineNoticeUrgency = 'polite' | 'assertive' | 'none'\n\nexport interface InlineNoticeProps {\n tone?: InlineNoticeTone\n title?: string\n /** Element for the title; a plain strong paragraph unless configured. */\n titleAs?: 'p' | 'h2' | 'h3' | 'h4'\n children: ReactNode\n icon?: ReactNode\n actions?: ReactNode\n dismissible?: boolean\n onDismiss?: () => void\n align?: 'start' | 'centre'\n /** How the notice is announced when it appears; `none` for notices present on page load. */\n urgency?: InlineNoticeUrgency\n className?: string\n}\n\nconst toneIcons = { danger: CircleAlert, warning: TriangleAlert, info: Info, success: CircleCheck }\n\nconst focusableSelector =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\n/** Short message about the state of a form, section or page (spec: wave-1/inline-notice.md). */\nexport function InlineNotice({\n tone = 'info',\n title,\n titleAs = 'p',\n children,\n icon,\n actions,\n dismissible = false,\n onDismiss,\n align = 'start',\n urgency,\n className,\n}: InlineNoticeProps) {\n const messages = useMessages()\n const rootRef = useRef<HTMLDivElement>(null)\n const level = urgency ?? (tone === 'danger' || tone === 'warning' ? 'assertive' : 'polite')\n const role = level === 'assertive' ? 'alert' : level === 'polite' ? 'status' : undefined\n const Icon = toneIcons[tone]\n const TitleTag = titleAs\n\n const dismiss = () => {\n const root = rootRef.current\n // Focus moves to the next logical element, not the document body.\n let next: HTMLElement | null = null\n if (root) {\n const all = Array.from(document.querySelectorAll<HTMLElement>(focusableSelector))\n next =\n all.find((el) => !root.contains(el) && root.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING) ??\n [...all].reverse().find((el) => !root.contains(el)) ??\n null\n }\n onDismiss?.()\n if (next) setTimeout(() => next?.isConnected && next.focus(), 0)\n }\n\n return (\n <div ref={rootRef} className={cx('ty-notice', className)} data-tone={tone} data-align={align} role={role}>\n <span className=\"ty-notice__icon\" aria-hidden=\"true\">\n {icon ?? <Icon />}\n </span>\n <div className=\"ty-notice__body\">\n {title ? (\n <TitleTag className=\"ty-notice__title\">\n <span className=\"ty-visually-hidden\">{messages.notice.toneWord[tone]} </span>\n {title}\n </TitleTag>\n ) : null}\n <div className=\"ty-notice__message\">\n {title ? null : <span className=\"ty-visually-hidden\">{messages.notice.toneWord[tone]} </span>}\n {children}\n </div>\n {actions ? <div className=\"ty-notice__actions\">{actions}</div> : null}\n </div>\n {dismissible ? (\n <Button\n className=\"ty-notice__dismiss\"\n variant=\"quiet\"\n size=\"compact\"\n iconOnly\n accessibleLabel={messages.dismiss}\n leadingIcon={<X />}\n onPress={dismiss}\n />\n ) : null}\n </div>\n )\n}\n","import { X } from 'lucide-react'\nimport { useEffect, useId, useRef, type ReactNode, type RefObject } from 'react'\nimport { Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport type ModalDialogWidth = 'narrow' | 'regular' | 'wide' | 'xwide'\n\nexport interface ModalDialogProps {\n isOpen: boolean\n onOpenChange: (open: boolean) => void\n width?: ModalDialogWidth\n /** `alertdialog` for destructive or blocking confirmations. */\n role?: 'dialog' | 'alertdialog'\n /** Whether pressing outside closes (default: true for dialog, false for alertdialog). */\n dismissOnBackdrop?: boolean\n /** Visible close control (default: true for dialog, false for alertdialog). */\n showCloseButton?: boolean\n /** Where focus lands on open. For `alertdialog`, mark the least destructive action with `autoFocus`. */\n initialFocus?: 'first' | 'title' | RefObject<HTMLElement | null>\n title: ReactNode\n description?: ReactNode\n actions?: ReactNode\n /** Disables closing while an action is pending. */\n busy?: boolean\n children?: ReactNode\n className?: string\n}\n\n/** Focused modal window for a decision or a short form (spec: wave-1/modal-dialog.md). */\nexport function ModalDialog(props: ModalDialogProps) {\n const {\n isOpen,\n onOpenChange,\n width = 'regular',\n role = 'dialog',\n dismissOnBackdrop = role === 'dialog',\n showCloseButton = role === 'dialog',\n initialFocus = 'first',\n title,\n description,\n actions,\n busy = false,\n children,\n className,\n } = props\n const messages = useMessages()\n const descriptionId = useId()\n const titleRef = useRef<HTMLHeadingElement>(null)\n\n useEffect(() => {\n if (!isOpen) return\n const id = requestAnimationFrame(() => {\n if (initialFocus === 'title') titleRef.current?.focus()\n else if (typeof initialFocus === 'object') initialFocus.current?.focus()\n })\n return () => cancelAnimationFrame(id)\n }, [isOpen, initialFocus])\n\n const handleOpenChange = (open: boolean) => {\n if (!open && busy) return\n onOpenChange(open)\n }\n\n return (\n <ModalOverlay\n isOpen={isOpen}\n onOpenChange={handleOpenChange}\n isDismissable={dismissOnBackdrop && !busy}\n isKeyboardDismissDisabled={busy}\n className=\"ty-modal-dialog__backdrop\"\n >\n <Modal className={cx('ty-modal-dialog', className)} data-width={width}>\n <Dialog\n role={role}\n className=\"ty-modal-dialog__panel\"\n aria-describedby={description ? descriptionId : undefined}\n data-busy={busy || undefined}\n >\n <div className=\"ty-modal-dialog__inner\" aria-busy={busy || undefined}>\n <header className=\"ty-modal-dialog__header\">\n <Heading slot=\"title\" level={2} className=\"ty-modal-dialog__title\" ref={titleRef} tabIndex={-1}>\n {title}\n </Heading>\n {showCloseButton ? (\n <Button\n className=\"ty-modal-dialog__close\"\n variant=\"quiet\"\n size=\"compact\"\n shape=\"circle\"\n iconOnly\n accessibleLabel={messages.close}\n leadingIcon={<X />}\n disabled={busy}\n onPress={() => handleOpenChange(false)}\n />\n ) : null}\n </header>\n {description ? (\n <p id={descriptionId} className=\"ty-modal-dialog__description\">\n {description}\n </p>\n ) : null}\n {children ? <div className=\"ty-modal-dialog__body\">{children}</div> : null}\n {actions ? <footer className=\"ty-modal-dialog__actions\">{actions}</footer> : null}\n </div>\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n}\n","import { ChevronDown, CircleAlert } from 'lucide-react'\nimport { forwardRef, useId, useRef, useState, type ChangeEvent, type ReactNode } from 'react'\nimport {\n Button as AriaButton,\n Dialog,\n Heading,\n ListBox,\n ListBoxItem,\n Modal,\n ModalOverlay,\n type Key,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useMediaQuery } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport { useAppearedAfterMount, useFieldControl } from '../field/Field'\n\nexport type NativeSelectOption = string | { value: string; label: string; disabled?: boolean }\nexport interface NativeSelectGroup {\n label: string\n options: NativeSelectOption[]\n}\n\nexport interface NativeSelectProps {\n label?: string\n accessibleLabel?: string\n hint?: ReactNode\n errorMessage?: string\n options?: NativeSelectOption[]\n groups?: NativeSelectGroup[]\n value?: string\n defaultValue?: string\n onChange?: (value: string) => void\n /** Text of the empty, disabled first option. */\n placeholder?: string\n /** `wheel` opens a bottom drawer with a wheel on narrow touch screens. */\n touchPresentation?: 'native' | 'wheel'\n required?: boolean\n disabled?: boolean\n name?: string\n id?: string\n className?: string\n}\n\ninterface NormalOption {\n value: string\n label: string\n disabled: boolean\n}\n\nfunction normalise(o: NativeSelectOption): NormalOption {\n return typeof o === 'string' ? { value: o, label: o, disabled: false } : { value: o.value, label: o.label, disabled: !!o.disabled }\n}\n\n/** One value from a short list with the platform select (spec: wave-1/native-select.md). */\nexport const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(function NativeSelect(props, ref) {\n const {\n label,\n accessibleLabel,\n hint,\n errorMessage,\n options = [],\n groups,\n value,\n defaultValue,\n onChange,\n placeholder,\n touchPresentation = 'native',\n required,\n disabled,\n name,\n id,\n className,\n } = props\n const messages = useMessages()\n const base = useId()\n const [inner, setInner] = useState(defaultValue ?? '')\n const current = value ?? inner\n const setValue = (v: string) => {\n if (value === undefined) setInner(v)\n onChange?.(v)\n }\n const hintId = hint != null ? `${base}-hint` : undefined\n const errorId = errorMessage ? `${base}-error` : undefined\n const labelId = `${base}-label`\n const wiring = useFieldControl({ id, describedBy: [hintId, errorId].filter(Boolean).join(' ') || undefined, invalid: !!errorMessage, required, disabled })\n const errorAppeared = useAppearedAfterMount(!!errorMessage)\n devWarning(!label && !accessibleLabel && !wiring.labelledBy, 'NativeSelect: provide `label`, `accessibleLabel` or a surrounding Field label.')\n\n const narrowTouch = useMediaQuery('(max-width: 639.98px) and (pointer: coarse)')\n const wheel = touchPresentation === 'wheel' && narrowTouch\n const [open, setOpenState] = useState(false)\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const setOpen = (next: boolean) => {\n setOpenState(next)\n // Return focus to the trigger on every way of closing (Done, Escape, backdrop).\n if (!next) requestAnimationFrame(() => triggerRef.current?.focus())\n }\n\n const flat: NormalOption[] = [...options.map(normalise), ...(groups ?? []).flatMap((g) => g.options.map(normalise))]\n const currentLabel = flat.find((o) => o.value === current)?.label ?? ''\n const placeholderText = placeholder ?? messages.select.placeholder\n\n const renderOptions = (list: NativeSelectOption[]) =>\n list.map(normalise).map((o) => (\n <option key={o.value} value={o.value} disabled={o.disabled}>\n {o.label}\n </option>\n ))\n\n const selectEl = (hidden: boolean) => (\n <select\n ref={ref}\n id={hidden ? undefined : wiring.id}\n name={name}\n value={current}\n onChange={(e: ChangeEvent<HTMLSelectElement>) => setValue(e.target.value)}\n disabled={wiring.disabled}\n required={wiring.required}\n aria-invalid={wiring.invalid || undefined}\n aria-describedby={hidden ? undefined : wiring.describedBy}\n aria-label={hidden ? undefined : label ? undefined : accessibleLabel}\n aria-labelledby={hidden ? undefined : !label && !accessibleLabel ? wiring.labelledBy : undefined}\n aria-hidden={hidden || undefined}\n tabIndex={hidden ? -1 : undefined}\n hidden={hidden}\n className=\"ty-native-select__control\"\n >\n <option value=\"\" disabled>\n {placeholderText}\n </option>\n {renderOptions(options)}\n {groups?.map((g) => (\n <optgroup key={g.label} label={g.label}>\n {renderOptions(g.options)}\n </optgroup>\n ))}\n </select>\n )\n\n const labelText = label ?? accessibleLabel ?? ''\n\n return (\n <div\n className={cx('ty-native-select', className)}\n data-invalid={wiring.invalid || undefined}\n data-disabled={wiring.disabled || undefined}\n data-presentation={wheel ? 'wheel' : 'native'}\n >\n {label ? (\n wheel ? (\n <span id={labelId} className=\"ty-native-select__label\">\n {label}\n </span>\n ) : (\n <label htmlFor={wiring.id} className=\"ty-native-select__label\">\n {label}\n </label>\n )\n ) : null}\n {hint != null ? (\n <p id={hintId} className=\"ty-native-select__hint\">\n {hint}\n </p>\n ) : null}\n <div className=\"ty-native-select__frame\">\n {wheel ? (\n <>\n <AriaButton\n ref={triggerRef}\n id={wiring.id}\n className=\"ty-native-select__control ty-native-select__trigger\"\n aria-label={`${labelText}: ${currentLabel || placeholderText}`}\n aria-describedby={wiring.describedBy}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n isDisabled={wiring.disabled}\n onPress={() => setOpen(true)}\n >\n <span className=\"ty-native-select__value\" data-placeholder={!currentLabel || undefined}>\n {currentLabel || placeholderText}\n </span>\n </AriaButton>\n {selectEl(true)}\n </>\n ) : (\n selectEl(false)\n )}\n <ChevronDown className=\"ty-icon ty-native-select__chevron\" aria-hidden=\"true\" focusable=\"false\" />\n </div>\n {errorMessage ? (\n <p id={errorId} className=\"ty-native-select__error\" role={errorAppeared ? 'alert' : undefined}>\n <CircleAlert className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span>{errorMessage}</span>\n </p>\n ) : null}\n {wheel ? (\n <ModalOverlay isOpen={open} onOpenChange={setOpen} isDismissable className=\"ty-native-select__overlay\">\n <Modal className=\"ty-native-select__drawer\">\n <Dialog className=\"ty-native-select__dialog\">\n <Heading slot=\"title\" className=\"ty-native-select__drawer-title\">\n {labelText}\n </Heading>\n <ListBox\n aria-label={labelText}\n className=\"ty-native-select__wheel\"\n selectionMode=\"single\"\n disallowEmptySelection\n selectedKeys={current ? [current] : []}\n disabledKeys={flat.filter((o) => o.disabled).map((o) => o.value)}\n onSelectionChange={(keys) => {\n if (keys === 'all') return\n const [first] = [...keys] as Key[]\n if (first != null && String(first) !== current) setValue(String(first))\n }}\n autoFocus\n >\n {flat.map((o) => (\n <ListBoxItem key={o.value} id={o.value} textValue={o.label} className=\"ty-native-select__wheel-item\">\n {o.label}\n </ListBoxItem>\n ))}\n </ListBox>\n <AriaButton className=\"ty-native-select__done\" onPress={() => setOpen(false)}>\n {messages.select.done}\n </AriaButton>\n </Dialog>\n </Modal>\n </ModalOverlay>\n ) : null}\n </div>\n )\n})\n","import { useId, type ReactNode } from 'react'\nimport { Heading, Input, Label, Link as AriaLink, TextField } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { breakpoints, useMinWidth } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\nimport { VisuallyHidden } from '../../internal/VisuallyHidden'\nimport { Breadcrumbs } from '../breadcrumbs/Breadcrumbs'\n\nexport interface PageHeaderMetaItem {\n icon?: IconComponent\n text: string\n}\n\nexport interface PageHeaderEditableTitle {\n value: string\n onChange: (value: string) => void\n placeholder: string\n /** Accessible name of the title input. */\n label: string\n /** Host-provided validation message shown under the title. */\n errorMessage?: string\n}\n\nexport interface PageHeaderTrailLevel {\n label: string\n /** Omit on the last level (the current page). */\n href?: string\n}\n\nexport interface PageHeaderProps {\n title: string\n headingLevel?: 1 | 2 | 3\n /** `page` uses the h1 step, `display` the display step (login, public page), `section` the h3 step. */\n scale?: 'page' | 'display' | 'section'\n /**\n * `standard` (wave 1) or `editorial` (wave 4, the head of the research\n * sheet: mono trail line, serif title, lead, actions at the end, divider).\n */\n variant?: 'standard' | 'editorial'\n eyebrow?: string\n summary?: string\n /** Lead paragraph (body-lg, 68ch). */\n lead?: ReactNode\n /** Mono breadcrumb line; the last level is the current page. */\n trail?: PageHeaderTrailLevel[]\n /** Hairline under the block (default: true for `editorial`). */\n divider?: boolean\n icon?: IconComponent\n breadcrumbs?: Array<{ label: string; href: string }>\n meta?: PageHeaderMetaItem[]\n /** Page actions: at most one primary button (§2.10). */\n actions?: ReactNode\n /** Extra content below (tags, tabs, filters). */\n children?: ReactNode\n headingId?: string\n editableTitle?: PageHeaderEditableTitle\n className?: string\n}\n\ntype Part = readonly [slot: string, node: ReactNode]\n\n/** Keeps the parts that have content, in the given order. */\nfunction present(parts: Part[]): Part[] {\n return parts.filter(([, node]) => node !== null && node !== undefined && node !== false)\n}\n\nfunction TrailLine({ levels, label }: { levels: PageHeaderTrailLevel[]; label: string }) {\n const lastIndex = levels.length - 1\n return (\n <nav className=\"ty-page-header__trail\" aria-label={label}>\n <ol className=\"ty-page-header__trail-list\">\n {levels.map((level, index) => {\n const isHere = index === lastIndex\n return (\n <li key={`${index}:${level.label}`} className=\"ty-page-header__trail-level\" data-here={isHere || undefined}>\n {isHere || !level.href ? (\n <span aria-current={isHere ? 'page' : undefined} dir=\"auto\">{level.label}</span>\n ) : (\n <AriaLink className=\"ty-page-header__trail-link\" href={level.href} dir=\"auto\">\n {level.label}\n </AriaLink>\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n\nfunction MetaRow({ items }: { items: PageHeaderMetaItem[] }) {\n return (\n <ul className=\"ty-page-header__meta\">\n {items.map((entry, position) => {\n const Glyph = entry.icon\n return (\n <li key={position + entry.text} className=\"ty-page-header__meta-item\">\n {Glyph ? <Glyph className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n <span dir=\"auto\">{entry.text}</span>\n </li>\n )\n })}\n </ul>\n )\n}\n\nfunction EditableTitle({ level, id, edit }: { level: 1 | 2 | 3; id: string; edit: PageHeaderEditableTitle }) {\n const errorId = `${id}-error`\n const invalid = Boolean(edit.errorMessage)\n return (\n <>\n {/* The outline keeps one heading; the field carries its own name. */}\n <Heading level={level} id={id} className=\"ty-visually-hidden\">\n {edit.value || edit.placeholder}\n </Heading>\n <TextField className=\"ty-page-header__edit\" value={edit.value} onChange={edit.onChange} isInvalid={invalid} aria-describedby={invalid ? errorId : undefined}>\n <Label>\n <VisuallyHidden>{edit.label}</VisuallyHidden>\n </Label>\n <Input className=\"ty-page-header__title ty-page-header__title-input\" placeholder={edit.placeholder} />\n </TextField>\n {invalid ? (\n <p id={errorId} className=\"ty-page-header__error\">\n {edit.errorMessage}\n </p>\n ) : null}\n </>\n )\n}\n\n/** The top-of-page block naming the page (specs: wave-1/page-header.md, wave-4/page-header-editorial.md). */\nexport function PageHeader(props: PageHeaderProps) {\n const copy = useMessages()\n const autoId = useId()\n const roomy = useMinWidth(breakpoints.sm)\n const level = props.headingLevel ?? 1\n const editorial = props.variant === 'editorial'\n const titleId = props.headingId ?? `ty-page-header-${autoId.replace(/:/g, '')}`\n const Icon = props.icon\n\n const title = props.editableTitle ? (\n <EditableTitle level={level} id={titleId} edit={props.editableTitle} />\n ) : (\n <Heading level={level} id={titleId} className=\"ty-page-header__title\" dir=\"auto\">\n {props.title}\n </Heading>\n )\n\n const textParts = present([\n ['eyebrow', props.eyebrow ? <p className=\"ty-page-header__eyebrow\" dir=\"auto\">{props.eyebrow}</p> : null],\n ['title', title],\n ['summary', props.summary ? <p className=\"ty-page-header__summary\" dir=\"auto\">{props.summary}</p> : null],\n ['lead', props.lead ? <div className=\"ty-page-header__lead\" dir=\"auto\">{props.lead}</div> : null],\n ['meta', props.meta?.length ? <MetaRow items={props.meta} /> : null],\n ])\n\n const above = present([\n ['trail', props.trail?.length ? <TrailLine levels={props.trail} label={copy.pageTrail.label} /> : null],\n ['breadcrumbs', props.breadcrumbs?.length ? <Breadcrumbs items={props.breadcrumbs} className=\"ty-page-header__breadcrumbs\" /> : null],\n ])\n\n return (\n <div\n className={cx('ty-page-header', props.className)}\n data-scale={props.scale ?? 'page'}\n data-variant={editorial ? 'editorial' : undefined}\n data-divider={(props.divider ?? editorial) || undefined}\n data-layout={roomy ? 'inline' : 'stacked'}\n >\n {above.map(([slot, node]) => (\n <SlotFragment key={slot}>{node}</SlotFragment>\n ))}\n <div className=\"ty-page-header__row\">\n {Icon ? (\n <span className=\"ty-page-header__icon\" aria-hidden=\"true\">\n <Icon className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n </span>\n ) : null}\n <div className=\"ty-page-header__text\">\n {textParts.map(([slot, node]) => (\n <SlotFragment key={slot}>{node}</SlotFragment>\n ))}\n </div>\n {props.actions ? <div className=\"ty-page-header__actions\">{props.actions}</div> : null}\n </div>\n {props.children ? <div className=\"ty-page-header__extra\">{props.children}</div> : null}\n </div>\n )\n}\n\nfunction SlotFragment({ children }: { children: ReactNode }) {\n return <>{children}</>\n}\n","import { ChevronLeft, ChevronRight } from 'lucide-react'\nimport { useEffect, useId, useRef } from 'react'\nimport { Button as AriaButton, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { breakpoints, useMinWidth } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\n\nexport interface PaginationLabels {\n navigation: string\n previous: string\n next: string\n pageSize: string\n range: (from: number, to: number, total: number) => string\n page: (n: number) => string\n pageOf: (n: number, count: number) => string\n}\n\nexport interface PaginationProps {\n /** Current page, 1-based. */\n page: number\n pageCount: number\n totalItems: number\n pageSize: number\n onPageChange: (page: number) => void\n /** When present, shows the page size selector. */\n pageSizeOptions?: number[]\n /** The host resets to page 1. */\n onPageSizeChange?: (size: number) => void\n siblingCount?: number\n busy?: boolean\n labels?: Partial<PaginationLabels>\n hideWhenSinglePage?: boolean\n className?: string\n}\n\nexport type PageSlot = number | 'gap'\n\n/** Page numbers to show: first, last, current and its siblings, with gaps. */\nexport function pageSlots(page: number, pageCount: number, siblingCount = 1): PageSlot[] {\n const pages = new Set<number>([1, pageCount])\n for (let p = page - siblingCount; p <= page + siblingCount; p++) if (p >= 1 && p <= pageCount) pages.add(p)\n if (page <= 1 + siblingCount) pages.add(Math.min(pageCount, 2))\n const sorted = [...pages].filter((p) => p >= 1).sort((a, b) => a - b)\n const out: PageSlot[] = []\n sorted.forEach((p, i) => {\n const prev = sorted[i - 1]\n if (prev !== undefined && p - prev === 2) out.push(prev + 1)\n else if (prev !== undefined && p - prev > 2) out.push('gap')\n out.push(p)\n })\n return out\n}\n\n/** Moves through a paged collection (spec: wave-1/pagination.md). */\nexport function Pagination(props: PaginationProps) {\n const {\n page,\n pageCount,\n totalItems,\n pageSize,\n onPageChange,\n pageSizeOptions,\n onPageSizeChange,\n siblingCount = 1,\n busy = false,\n hideWhenSinglePage = true,\n className,\n } = props\n const messages = useMessages()\n const labels: PaginationLabels = { ...messages.pagination, ...props.labels }\n const wide = useMinWidth(breakpoints.sm)\n const { locale } = useLocale()\n const numeral = new Intl.NumberFormat(locale)\n const selectId = useId()\n const prevRef = useRef<HTMLButtonElement>(null)\n const nextRef = useRef<HTMLButtonElement>(null)\n\n const atStart = page <= 1\n const atEnd = page >= pageCount\n\n // If the focused arrow became disabled, move focus to the other arrow.\n useEffect(() => {\n const active = document.activeElement\n if (atStart && active === prevRef.current) nextRef.current?.focus()\n else if (atEnd && active === nextRef.current) prevRef.current?.focus()\n }, [atStart, atEnd])\n\n if (hideWhenSinglePage && pageCount <= 1 && !pageSizeOptions) return null\n\n const from = totalItems === 0 ? 0 : (page - 1) * pageSize + 1\n const to = Math.min(totalItems, page * pageSize)\n const go = (p: number) => {\n if (!busy && p >= 1 && p <= pageCount && p !== page) onPageChange(p)\n }\n\n return (\n <nav aria-label={labels.navigation} aria-busy={busy || undefined} className={cx('ty-pagination', className)}>\n <p className=\"ty-pagination__range\" role=\"status\">\n {labels.range(from, to, totalItems)}\n </p>\n <div className=\"ty-pagination__controls\">\n <AriaButton ref={prevRef} className=\"ty-pagination__button\" data-arrow=\"\" isDisabled={busy || atStart} onPress={() => go(page - 1)}>\n <ChevronLeft className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-pagination__arrow-label\">{labels.previous}</span>\n </AriaButton>\n {wide ? (\n <ul className=\"ty-pagination__pages\">\n {pageSlots(page, pageCount, siblingCount).map((slot, i) =>\n slot === 'gap' ? (\n <li key={`gap-${i}`} className=\"ty-pagination__gap\" aria-hidden=\"true\">\n …\n </li>\n ) : (\n <li key={slot}>\n <AriaButton\n className=\"ty-pagination__button\"\n data-page=\"\"\n aria-label={labels.page(slot)}\n aria-current={slot === page ? 'page' : undefined}\n data-current={slot === page || undefined}\n isDisabled={busy}\n onPress={() => go(slot)}\n >\n {numeral.format(slot)}\n </AriaButton>\n </li>\n ),\n )}\n </ul>\n ) : (\n <span className=\"ty-pagination__compact\">{labels.pageOf(page, pageCount)}</span>\n )}\n <AriaButton ref={nextRef} className=\"ty-pagination__button\" data-arrow=\"\" isDisabled={busy || atEnd} onPress={() => go(page + 1)}>\n <span className=\"ty-pagination__arrow-label\">{labels.next}</span>\n <ChevronRight className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n </div>\n {pageSizeOptions ? (\n <div className=\"ty-pagination__size\">\n <label htmlFor={selectId} className=\"ty-pagination__size-label\">\n {labels.pageSize}\n </label>\n <select\n id={selectId}\n className=\"ty-pagination__select\"\n value={pageSize}\n disabled={busy}\n onChange={(e) => onPageSizeChange?.(Number(e.target.value))}\n >\n {pageSizeOptions.map((n) => (\n <option key={n} value={n}>\n {n}\n </option>\n ))}\n </select>\n </div>\n ) : null}\n </nav>\n )\n}\n","import { Info } from 'lucide-react'\nimport { useRef, type FocusEvent, type ReactNode } from 'react'\nimport {\n Dialog,\n DialogTrigger,\n Heading,\n OverlayArrow,\n Popover as AriaPopover,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { Button } from '../button/Button'\n\nexport type PopoverPlacement = 'top' | 'end' | 'bottom' | 'start'\nexport type PopoverAlign = 'start' | 'center' | 'end'\n\nexport interface PopoverProps {\n /** Element that toggles the panel; must be a pressable (e.g. Button). Defaults to an info button. */\n trigger?: ReactNode\n /** Accessible name of the built-in info trigger (required when `trigger` is omitted). */\n triggerLabel?: string\n /** Heading at the top of the panel; labels the panel. */\n title?: string\n children: ReactNode\n placement?: PopoverPlacement\n align?: PopoverAlign\n /** Gap between trigger and panel as a step of the spacing scale (1 to 9). */\n offset?: number\n showArrow?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n className?: string\n}\n\nconst SPACE_STEPS = [0, 4, 8, 12, 16, 24, 32, 48, 64, 96]\n\nfunction toAriaPlacement(placement: PopoverPlacement, align: PopoverAlign) {\n const side = placement === 'end' ? 'end' : placement === 'start' ? 'start' : placement\n if (align === 'center') return side\n if (side === 'top' || side === 'bottom') return `${side} ${align}` as const\n return `${side} ${align === 'start' ? 'top' : 'bottom'}` as const\n}\n\n/** Non-modal floating panel anchored to a trigger (spec: wave-1/popover.md). */\nexport function Popover(props: PopoverProps) {\n const {\n trigger,\n triggerLabel,\n title,\n children,\n placement = 'bottom',\n align = 'center',\n offset = 2,\n showArrow = true,\n open,\n defaultOpen,\n onOpenChange,\n className,\n } = props\n devWarning(!trigger && !triggerLabel, 'Popover: the built-in info trigger needs `triggerLabel`.')\n const closeRef = useRef<() => void>(() => {})\n\n const handleBlur = (e: FocusEvent<HTMLElement>) => {\n const next = e.relatedTarget as Node | null\n if (next && !e.currentTarget.contains(next)) closeRef.current()\n }\n\n return (\n <DialogTrigger\n {...(open !== undefined ? { isOpen: open } : {})}\n {...(defaultOpen !== undefined ? { defaultOpen } : {})}\n onOpenChange={onOpenChange}\n >\n {trigger ?? (\n <Button iconOnly variant=\"quiet\" shape=\"circle\" size=\"compact\" accessibleLabel={triggerLabel ?? ''} leadingIcon={<Info />} />\n )}\n <AriaPopover\n className={cx('ty-popover', className)}\n placement={toAriaPlacement(placement, align)}\n offset={(SPACE_STEPS[offset] ?? 8) + (showArrow ? 6 : 0)}\n containerPadding={16}\n shouldFlip\n >\n {showArrow ? (\n <OverlayArrow className=\"ty-popover__arrow\">\n <svg width={12} height={12} viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n ) : null}\n <Dialog className=\"ty-popover__dialog\" aria-label={title ? undefined : triggerLabel}>\n {({ close }) => {\n closeRef.current = close\n return (\n <div className=\"ty-popover__body\" onBlur={handleBlur}>\n {title ? (\n <Heading slot=\"title\" level={3} className=\"ty-popover__title\">\n {title}\n </Heading>\n ) : null}\n <div className=\"ty-popover__content\">{children}</div>\n </div>\n )\n }}\n </Dialog>\n </AriaPopover>\n </DialogTrigger>\n )\n}\n","import { ProgressBar as AriaProgressBar, Label } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type ProgressBarTone = 'accent' | 'success' | 'warning' | 'danger'\n\nexport interface ProgressBarProps {\n value?: number\n minValue?: number\n maxValue?: number\n /** Visible and accessible name; required unless `aria-label` is given. */\n label?: string\n 'aria-label'?: string\n /** Custom value text such as \"3 of 8 steps\". */\n valueLabel?: string\n showValue?: boolean\n indeterminate?: boolean\n /** Semantic tone; pair it with value text or a status word. */\n tone?: ProgressBarTone\n size?: 'thin' | 'regular'\n className?: string\n}\n\n/** Determinate or indeterminate task progress (spec: wave-1/progress-bar.md). */\nexport function ProgressBar({\n value = 0,\n minValue = 0,\n maxValue = 100,\n label,\n valueLabel,\n showValue = true,\n indeterminate = false,\n tone = 'accent',\n size = 'regular',\n className,\n ...rest\n}: ProgressBarProps) {\n const messages = useMessages()\n const clamped = Math.min(Math.max(value, minValue), maxValue)\n return (\n <AriaProgressBar\n value={clamped}\n minValue={minValue}\n maxValue={maxValue}\n isIndeterminate={indeterminate}\n valueLabel={valueLabel}\n aria-label={label ? undefined : rest['aria-label']}\n className={cx('ty-progress', className)}\n data-tone={tone}\n data-size={size}\n data-indeterminate={indeterminate || undefined}\n data-complete={!indeterminate && clamped >= maxValue ? true : undefined}\n >\n {({ percentage, valueText }) => (\n <>\n {label || (showValue && !indeterminate) || indeterminate ? (\n <div className=\"ty-progress__header\">\n {label ? <Label className=\"ty-progress__label\">{label}</Label> : <span />}\n {indeterminate ? (\n <span className=\"ty-progress__value ty-progress__value--indeterminate\">{messages.inProgress}</span>\n ) : showValue ? (\n <span className=\"ty-progress__value\">{valueText}</span>\n ) : null}\n </div>\n ) : null}\n <div className=\"ty-progress__track\" aria-hidden=\"true\">\n <div\n className=\"ty-progress__fill\"\n style={indeterminate ? undefined : { inlineSize: `${percentage ?? 0}%` }}\n />\n </div>\n </>\n )}\n </AriaProgressBar>\n )\n}\n","import { BadgeCheck, CircleDashed, CircleX, Hourglass, Minus } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { Focusable, Tooltip, TooltipTrigger } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport type { ProofStateKey } from '../../internal/messages'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\n\n/** Proof states of the contract, plus `none` (\"no proof\"). */\nexport type ProofState = 'proved' | 'pending' | 'refuted' | 'not_disclosed'\nexport type ProofBadgeSize = 'inline' | 'compact' | 'block'\n\nexport interface ProofBadgeProps {\n /** Contract state; `null`/`undefined` renders the \"no proof\" state. */\n state?: ProofState | null\n /** inline: icon + word pill; compact: icon only (word for AT and tooltip); block: evidence-panel strip. */\n size?: ProofBadgeSize\n /** Overrides the state word. */\n label?: string\n /** Short visible detail after the word or icon, such as \"4/6\". */\n detail?: string\n /** Compact only: makes the badge focusable and shows the word in a tooltip. */\n interactive?: boolean\n /** Block only: who proved it (a name, or an ActorChip). */\n provedBy?: ReactNode\n /** Block only: when (host-formatted date). */\n at?: ReactNode\n /** Block only: verifier rule, shown in mono. */\n rule?: string\n className?: string\n}\n\nconst ICONS: Record<ProofStateKey, IconComponent> = {\n proved: BadgeCheck,\n pending: Hourglass,\n refuted: CircleX,\n not_disclosed: CircleDashed,\n none: Minus,\n}\n\n/** The shared proof-state language of design direction §2.11: icon, word and border style, never colour alone. */\nexport function ProofBadge({ state, size = 'inline', label, detail, interactive = false, provedBy, at, rule, className }: ProofBadgeProps) {\n const messages = useMessages()\n const key: ProofStateKey = state ?? 'none'\n const word = label ?? messages.proof[key]\n const Icon = ICONS[key]\n const common = {\n className: cx('ty-proof-badge', className),\n 'data-state': key.replace('_', '-'),\n 'data-size': size,\n }\n\n if (size === 'block') {\n return (\n <div {...common}>\n <div className=\"ty-proof-badge__head\">\n <Icon className=\"ty-proof-badge__icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-proof-badge__word\">{word}</span>\n {detail ? <span className=\"ty-proof-badge__detail\">{detail}</span> : null}\n </div>\n {provedBy != null || at != null || rule ? (\n <p className=\"ty-proof-badge__meta\">\n {provedBy != null ? (\n <span className=\"ty-proof-badge__by\">{typeof provedBy === 'string' ? messages.proof.provedBy(provedBy) : provedBy}</span>\n ) : null}\n {at != null ? <span className=\"ty-proof-badge__at\">{at}</span> : null}\n {rule ? <code className=\"ty-proof-badge__rule\">{messages.proof.rule(rule)}</code> : null}\n </p>\n ) : null}\n </div>\n )\n }\n\n if (size === 'compact') {\n const glyph = <Icon className=\"ty-proof-badge__icon\" aria-hidden=\"true\" focusable=\"false\" />\n const tail = detail ? (\n <span className=\"ty-proof-badge__detail\" aria-hidden={interactive ? true : undefined}>\n {detail}\n </span>\n ) : null\n if (interactive) {\n const name = detail ? `${word}, ${detail}` : word\n return (\n <TooltipTrigger delay={300}>\n <Focusable>\n <span {...common} role=\"img\" aria-label={name} tabIndex={0} data-interactive=\"true\">\n {glyph}\n {tail}\n </span>\n </Focusable>\n <Tooltip className=\"ty-proof-badge__tooltip\" offset={6}>\n {word}\n </Tooltip>\n </TooltipTrigger>\n )\n }\n return (\n <span {...common} title={word}>\n {glyph}\n <span className=\"ty-visually-hidden\">{word}</span>\n {tail}\n </span>\n )\n }\n\n return (\n <span {...common}>\n <Icon className=\"ty-proof-badge__icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-proof-badge__word\">{word}</span>\n {detail ? <span className=\"ty-proof-badge__detail\">{detail}</span> : null}\n </span>\n )\n}\n","import { useId, type ReactNode } from 'react'\nimport { Heading as AriaHeading } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport type { IconComponent } from '../../internal/types'\n\nexport interface SectionHeadingProps {\n title: string\n /** Heading level; level 2 uses the h2 style, 3 and 4 the h3 style. */\n level?: 2 | 3 | 4\n /** One line of meta text; not a heading. */\n subtitle?: string\n icon?: IconComponent\n /** Section actions, a count, a toggle or a link; follows the title in DOM order. */\n trailing?: ReactNode\n /** Extra content under the heading row. */\n children?: ReactNode\n /** Heading id, for `aria-labelledby` on the enclosing section. */\n id?: string\n /** Truncate the title to one line (full text as tooltip); wraps by default. */\n truncate?: boolean\n className?: string\n}\n\n/** Wraps an optional slot in its element, or renders nothing when the slot is empty. */\nfunction slot(content: ReactNode, part: string) {\n return content == null ? null : <div className={`ty-section-heading__${part}`}>{content}</div>\n}\n\nfunction TitleBlock(p: { id: string; level: 2 | 3 | 4; title: string; subtitle?: string; clip: boolean }) {\n return (\n <div className=\"ty-section-heading__text\">\n <AriaHeading level={p.level} id={p.id} className=\"ty-section-heading__title\" data-truncate={p.clip || undefined} title={p.clip ? p.title : undefined}>\n {p.title}\n </AriaHeading>\n {p.subtitle ? <p className=\"ty-section-heading__subtitle\">{p.subtitle}</p> : null}\n </div>\n )\n}\n\n/** Heads a section inside a page or a sheet (spec: wave-1/section-heading.md). */\nexport function SectionHeading(props: SectionHeadingProps) {\n const auto = useId()\n const level = props.level ?? 2\n const Glyph = props.icon\n return (\n <div className={cx('ty-section-heading', props.className)} data-level={level}>\n <div className=\"ty-section-heading__row\">\n {Glyph ? <Glyph className=\"ty-icon ty-section-heading__icon\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n <TitleBlock\n id={props.id ?? `ty-section-heading-${auto.replace(/:/g, '')}`}\n level={level}\n title={props.title}\n subtitle={props.subtitle}\n clip={props.truncate === true}\n />\n {slot(props.trailing, 'trailing')}\n </div>\n {slot(props.children, 'extra')}\n </div>\n )\n}\n","import { useState } from 'react'\nimport { Radio, RadioGroup } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { requestHaptic } from '../../internal/haptics'\nimport type { IconComponent } from '../../internal/types'\n\nexport type SegmentedOption = string | { value: string; label: string; icon?: IconComponent }\n\nexport interface SegmentedControlProps {\n /** Two to five segments; a string is both value and label. */\n options: SegmentedOption[]\n value?: string\n defaultValue?: string\n /** Called only when the value actually changes. */\n onChange: (value: string) => void\n /** Accessible name of the group. */\n label: string\n size?: 'compact' | 'regular' | 'large'\n fullWidth?: boolean\n disabled?: boolean\n /** Hide labels visually; labels remain the accessible names. */\n iconOnly?: boolean\n className?: string\n}\n\ninterface Segment {\n value: string\n label: string\n icon?: IconComponent\n}\n\nconst asSegment = (o: SegmentedOption): Segment => (typeof o === 'string' ? { value: o, label: o } : o)\n\n/**\n * Selection that may be controlled (`value`) or local. `commit` ignores a\n * re-selection of the current value, so hosts only hear real changes.\n */\nfunction useSelection(controlled: string | undefined, initial: string, notify: (v: string) => void) {\n const [local, setLocal] = useState(initial)\n const active = controlled === undefined ? local : controlled\n const commit = (next: string) => {\n if (next === active) return\n if (controlled === undefined) setLocal(next)\n requestHaptic('light')\n notify(next)\n }\n return [active, commit] as const\n}\n\nfunction SegmentButton({ segment, hideText, hint }: { segment: Segment; hideText: boolean; hint: boolean }) {\n const Glyph = segment.icon\n return (\n <Radio value={segment.value} className=\"ty-segmented-control__segment\" aria-label={hideText ? segment.label : undefined}>\n {Glyph && <Glyph className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />}\n <span className={hideText ? 'ty-visually-hidden' : 'ty-segmented-control__label'} title={hint ? segment.label : undefined}>\n {segment.label}\n </span>\n </Radio>\n )\n}\n\n/** Exactly one of a small set of options, changed in place (spec: wave-1/segmented-control.md). */\nexport function SegmentedControl(props: SegmentedControlProps) {\n const segments = props.options.map(asSegment)\n const [active, commit] = useSelection(props.value, props.defaultValue ?? segments[0]?.value ?? '', props.onChange)\n const stretched = props.fullWidth === true\n const iconOnly = props.iconOnly === true\n return (\n <RadioGroup\n className={cx('ty-segmented-control', props.className)}\n aria-label={props.label}\n orientation=\"horizontal\"\n isDisabled={props.disabled ?? false}\n value={active}\n onChange={commit}\n data-size={props.size ?? 'regular'}\n data-full-width={stretched || undefined}\n data-icon-only={iconOnly || undefined}\n >\n {segments.map((s) => (\n <SegmentButton key={s.value} segment={s} hideText={iconOnly} hint={stretched} />\n ))}\n </RadioGroup>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Separator as AriaSeparator } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport interface SeparatorProps {\n orientation?: 'horizontal' | 'vertical'\n /** Line strength: `--ty-line` or the fainter `--ty-line-soft`. */\n emphasis?: 'regular' | 'soft'\n /** Short text centred on the rule, such as \"or\". */\n caption?: ReactNode\n /** Exposes the separator role; decorative otherwise. */\n semantic?: boolean\n /** Margin step from the spacing scale. */\n spacing?: 'none' | 'regular' | 'roomy'\n className?: string\n}\n\nconst Stroke = () => <span className=\"ty-separator__line\" aria-hidden=\"true\" />\n\n/** Thin rule between groups of content (spec: wave-1/separator.md). */\nexport function Separator(props: SeparatorProps) {\n const orientation = props.orientation ?? 'horizontal'\n const shared = {\n 'data-orientation': orientation,\n 'data-emphasis': props.emphasis ?? 'regular',\n 'data-spacing': props.spacing ?? 'regular',\n }\n const captioned = props.caption !== undefined && props.caption !== null\n\n // Three renderings: captioned (text stays readable, strokes are decoration),\n // semantic (separator role) and purely decorative.\n if (captioned) {\n return (\n <div {...shared} className={cx('ty-separator', 'ty-separator--captioned', props.className)}>\n <Stroke />\n <span className=\"ty-separator__caption\">{props.caption}</span>\n <Stroke />\n </div>\n )\n }\n return props.semantic ? (\n <AriaSeparator {...shared} elementType=\"div\" orientation={orientation} className={cx('ty-separator', props.className)} />\n ) : (\n <div {...shared} className={cx('ty-separator', props.className)} aria-hidden=\"true\" />\n )\n}\n","import { version } from 'react'\n\nconst major = Number.parseInt(version, 10)\n\n/**\n * Props that set the HTML `inert` attribute on a host element, portable across\n * React 18.3 and 19. React 19 treats `inert` as a boolean attribute; React 18\n * does not know it, drops `true` with a warning and writes a string as is, so\n * there an empty string is the way to set it. Spread the result on the element:\n * `<div {...inertProps(hidden)} />`.\n */\nexport function inertProps(on: boolean | undefined): { inert?: boolean } {\n if (!on) return {}\n return (major >= 19 ? { inert: true } : { inert: '' }) as { inert?: boolean }\n}\n","import type { ReactNode } from 'react'\nimport { ProgressBar as AriaProgressBar } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { inertProps } from '../../internal/inert'\nimport { useReducedMotion } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\n\nexport type SpinnerSize = 'small' | 'medium' | 'large'\nexport type SpinnerShape = 'ring' | 'dots'\nexport type SpinnerTone = 'inherit' | 'accent' | 'on-accent' | 'neutral'\n\nexport interface SpinnerProps {\n /** Accessible name; visible when `showLabel` (or under reduced motion). */\n label?: string\n showLabel?: boolean\n size?: SpinnerSize\n shape?: SpinnerShape\n tone?: SpinnerTone\n /** Render as a blocking overlay over `children` (the covered region). */\n overlay?: boolean\n /** Overlay only: whether the overlay is shown. */\n visible?: boolean\n /** Overlay only: the region the overlay covers. */\n children?: ReactNode\n className?: string\n}\n\n/** Drawing of the indicator: a CSS ring (border arc) or three pulsing dots. Never announced. */\nconst glyphs: Record<SpinnerShape, () => ReactNode> = {\n ring: () => <span className=\"ty-spinner__ring\" aria-hidden=\"true\" />,\n dots: () => (\n <span className=\"ty-spinner__dots\" aria-hidden=\"true\">\n {[0, 1, 2].map((n) => (\n <span key={n} className=\"ty-spinner__dot\" />\n ))}\n </span>\n ),\n}\n\ninterface Look {\n 'data-size': SpinnerSize\n 'data-shape': SpinnerShape\n 'data-tone': SpinnerTone\n}\n\nfunction Covered(p: { look: Look; name: string; shown: boolean; reduced: boolean; className?: string; children?: ReactNode }) {\n const busy = p.shown || undefined\n return (\n <div className={cx('ty-spinner-region', p.className)} aria-busy={busy}>\n <div className=\"ty-spinner-region__content\" {...inertProps(busy)}>\n {p.children}\n </div>\n {p.shown && (\n <div className=\"ty-spinner-overlay\" data-reduced-motion={p.reduced || undefined}>\n <div className=\"ty-spinner-overlay__card\">\n <span className=\"ty-spinner\" aria-hidden=\"true\" {...p.look}>\n {glyphs[p.look['data-shape']]()}\n </span>\n <span className=\"ty-spinner__label\" role=\"status\" aria-live=\"polite\">\n {p.name}\n </span>\n </div>\n </div>\n )}\n </div>\n )\n}\n\n/** Indeterminate work indicator, inline or as a region overlay (spec: wave-1/spinner.md). */\nexport function Spinner(props: SpinnerProps) {\n const catalogue = useMessages()\n const reduced = useReducedMotion()\n const name = props.label ?? catalogue.loading\n const look: Look = {\n 'data-size': props.size ?? 'medium',\n 'data-shape': props.shape ?? 'ring',\n 'data-tone': props.tone ?? 'inherit',\n }\n\n if (props.overlay) {\n return (\n <Covered look={look} name={name} shown={props.visible ?? true} reduced={reduced} className={props.className}>\n {props.children}\n </Covered>\n )\n }\n\n // A static indicator says nothing by itself, so reduced motion reveals the label.\n const caption = (props.showLabel ?? false) || reduced\n return (\n <AriaProgressBar isIndeterminate aria-label={name} className={cx('ty-spinner', props.className)} data-reduced-motion={reduced || undefined} {...look}>\n {glyphs[look['data-shape']]()}\n {caption && (\n <span className=\"ty-spinner__label\" aria-hidden=\"true\">\n {name}\n </span>\n )}\n </AriaProgressBar>\n )\n}\n","import { CircleAlert, CircleCheck, CircleHelp, CircleMinus, CircleX, Clock, LoaderCircle } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport type { Messages } from '../../internal/messages'\nimport { useMessages } from '../../internal/provider'\n\nexport type StatusTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral'\n\nexport interface StatusDefinition {\n label: string\n tone: StatusTone\n icon?: ReactNode\n /** In-progress status: the icon rotates (static under reduced motion). */\n busy?: boolean\n}\n\nexport type StatusMap = Record<string, StatusDefinition>\n\nexport interface StatusPillProps {\n status: string\n statusMap?: StatusMap\n tone?: StatusTone\n label?: string\n size?: 'small' | 'regular'\n /** Announce changes politely (off by default: tables of pills create no live regions). */\n announce?: boolean\n className?: string\n}\n\n/** Built-in map; labels come from the messages catalogue. */\nexport function builtInStatusMap(messages: Messages): StatusMap {\n const s = messages.status\n return {\n pending: { label: s.pending, tone: 'warning', icon: <Clock /> },\n approved: { label: s.approved, tone: 'success', icon: <CircleCheck /> },\n rejected: { label: s.rejected, tone: 'danger', icon: <CircleX /> },\n active: { label: s.active, tone: 'success', icon: <CircleCheck /> },\n inactive: { label: s.inactive, tone: 'neutral', icon: <CircleMinus /> },\n processing: { label: s.processing, tone: 'info', icon: <LoaderCircle />, busy: true },\n error: { label: s.error, tone: 'danger', icon: <CircleAlert /> },\n success: { label: s.success, tone: 'success', icon: <CircleCheck /> },\n }\n}\n\n/** Current state of an item with icon, word and semantic tone (spec: wave-1/status-pill.md). */\nexport function StatusPill({ status, statusMap, tone, label, size = 'regular', announce = false, className }: StatusPillProps) {\n const messages = useMessages()\n const map = statusMap ?? builtInStatusMap(messages)\n const entry = map[status]\n devWarning(!entry && !label, `StatusPill: unknown status \"${status}\"; showing it as a neutral pill.`)\n const def: StatusDefinition = entry ?? { label: status, tone: 'neutral', icon: <CircleHelp /> }\n const pill = (\n <span\n className={cx('ty-status', className)}\n data-tone={tone ?? def.tone}\n data-size={size}\n data-busy={def.busy || undefined}\n data-status={status}\n >\n <span className=\"ty-status__icon\" aria-hidden=\"true\">\n {def.icon ?? <CircleHelp />}\n </span>\n <span className=\"ty-status__label\">{label ?? def.label}</span>\n </span>\n )\n if (!announce) return pill\n return (\n <span role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className=\"ty-status-live\">\n {pill}\n </span>\n )\n}\n","import { useId, useRef, type MouseEvent, type ReactNode } from 'react'\nimport { Button as AriaButton, Heading as AriaHeading, Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport type { RouterNavigateOptions } from '../../internal/provider'\n\nexport type SurfaceElevation = 'sheet' | 'raised' | 'floating' | 'flat'\n\nexport interface SurfaceProps {\n /** Level 1, 2, 3 or 0 of §2.5. */\n elevation?: SurfaceElevation\n /** Internal padding from §2.1. */\n padding?: 'none' | 'regular' | 'roomy'\n /** Semantics; a section with a title becomes a labelled region. */\n as?: 'section' | 'article' | 'div' | 'li'\n /** Header title (a heading). Required for pressable surfaces: it is the single primary control. */\n title?: ReactNode\n /** Header description. */\n description?: ReactNode\n /** Heading level of the title. */\n titleLevel?: 2 | 3 | 4\n /** Footer region, usually actions. */\n footer?: ReactNode\n /** Makes the whole surface a single press target. */\n onPress?: () => void\n /** Makes the whole surface a link (router adapter). */\n href?: string\n routerOptions?: RouterNavigateOptions\n /** Selectable surfaces: accent-soft state. */\n selected?: boolean\n /** Pressable surfaces only. */\n disabled?: boolean\n id?: string\n className?: string\n children?: ReactNode\n}\n\nconst INTERACTIVE = 'a[href],button,input,select,textarea,summary,[role=\"button\"],[role=\"link\"],[role=\"checkbox\"],[role=\"switch\"],[tabindex]:not([tabindex=\"-1\"])'\n\n/** Bounded container at a chosen elevation (spec: wave-1/surface.md). */\nexport function Surface({\n elevation = 'sheet',\n padding = 'regular',\n as: Element = 'section',\n title,\n description,\n titleLevel = 3,\n footer,\n onPress,\n href,\n routerOptions,\n selected = false,\n disabled = false,\n id,\n className,\n children,\n}: SurfaceProps) {\n const headingId = `ty-surface-title-${useId().replace(/:/g, '')}`\n const primaryRef = useRef<HTMLElement | null>(null)\n const pressable = !!(onPress || href)\n devWarning(pressable && title == null, 'Surface: a pressable surface needs a `title`, which becomes its primary control.')\n\n // \"Card with a single primary control\": presses anywhere on the surface,\n // outside nested controls, are forwarded to the title control.\n const handleClick = (e: MouseEvent<HTMLElement>) => {\n if (!pressable || disabled || !primaryRef.current) return\n const target = e.target as Element\n if (primaryRef.current.contains(target)) return\n const interactive = target.closest(INTERACTIVE)\n if (interactive && e.currentTarget.contains(interactive)) return\n const selection = typeof window !== 'undefined' ? window.getSelection?.()?.toString() : ''\n if (selection) return\n primaryRef.current.click()\n }\n\n let titleContent: ReactNode = title\n if (pressable && title != null) {\n titleContent = href ? (\n <AriaLink\n ref={primaryRef as React.Ref<HTMLAnchorElement>}\n href={href}\n routerOptions={routerOptions}\n isDisabled={disabled}\n onPress={onPress}\n className=\"ty-surface__primary\"\n >\n {title}\n </AriaLink>\n ) : (\n <AriaButton ref={primaryRef as React.Ref<HTMLButtonElement>} onPress={onPress} isDisabled={disabled} className=\"ty-surface__primary\">\n {title}\n </AriaButton>\n )\n }\n\n const labelled = title != null && (Element === 'section' || Element === 'article')\n\n return (\n <Element\n id={id}\n className={cx('ty-surface', className)}\n aria-labelledby={labelled ? headingId : undefined}\n data-elevation={elevation}\n data-padding={padding}\n data-pressable={pressable || undefined}\n data-selected={selected || undefined}\n data-disabled={(pressable && disabled) || undefined}\n onClick={pressable ? handleClick : undefined}\n >\n {title != null || description != null ? (\n <header className=\"ty-surface__header\">\n {title != null ? (\n <AriaHeading level={titleLevel} id={headingId} className=\"ty-surface__title\">\n {titleContent}\n </AriaHeading>\n ) : null}\n {description != null ? <div className=\"ty-surface__description\">{description}</div> : null}\n </header>\n ) : null}\n {children != null ? <div className=\"ty-surface__body\">{children}</div> : null}\n {footer != null ? <footer className=\"ty-surface__footer\">{footer}</footer> : null}\n </Element>\n )\n}\n","import { forwardRef, useId, useState, type ReactNode } from 'react'\nimport { Switch as AriaSwitch, type SwitchProps as AriaSwitchProps } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\n\nexport interface SwitchProps {\n isSelected?: boolean\n defaultSelected?: boolean\n onChange?: (isSelected: boolean) => void\n label?: string\n /** Name when there is no visible label. */\n accessibleLabel?: string\n description?: ReactNode\n /** Row (control then label) or setting tile (text start, control end). */\n layout?: 'inline' | 'tile'\n size?: 'small' | 'regular' | 'large'\n disabled?: boolean\n /** Focusable and announces its state, but cannot change. */\n readOnly?: boolean\n name?: string\n value?: string\n id?: string\n className?: string\n}\n\ntype KeyEvent = Parameters<NonNullable<AriaSwitchProps['onKeyDown']>>[0]\n\n/** On/off state that may be owned by the host (`isSelected`) or kept here. */\nfunction useOnOff(owned: boolean | undefined, start: boolean, report?: (on: boolean) => void) {\n const [kept, keep] = useState(start)\n const on = owned === undefined ? kept : owned\n function flip(next: boolean) {\n if (owned === undefined) keep(next)\n if (report) report(next)\n }\n return { on, flip }\n}\n\n/** Visible text of the switch: label and description, each with its own id. */\nfunction Caption(p: { labelId?: string; label?: string; descId?: string; description?: ReactNode }) {\n if (!p.label && p.description == null) return null\n return (\n <span className=\"ty-switch__text\">\n {p.label && (\n <span id={p.labelId} className=\"ty-switch__label\">\n {p.label}\n </span>\n )}\n {p.description != null && (\n <span id={p.descId} className=\"ty-switch__description\">\n {p.description}\n </span>\n )}\n </span>\n )\n}\n\n/** On/off setting with immediate effect (spec: wave-1/switch.md). */\nexport const Switch = forwardRef<HTMLLabelElement, SwitchProps>(function Switch(props, ref) {\n devWarning(!props.label && !props.accessibleLabel, 'Switch: provide `label` or `accessibleLabel`.')\n const stem = useId()\n const ids = {\n label: props.label ? `${stem}-label` : undefined,\n desc: props.description != null ? `${stem}-desc` : undefined,\n }\n const state = useOnOff(props.isSelected, props.defaultSelected ?? false, props.onChange)\n const locked = props.disabled === true || props.readOnly === true\n\n // Enter toggles as well as Space (the spec asks for parity with the previous library).\n function onKey(event: KeyEvent) {\n if (event.key !== 'Enter' || locked) {\n event.continuePropagation()\n return\n }\n event.preventDefault()\n state.flip(!state.on)\n }\n\n return (\n <AriaSwitch\n ref={ref}\n id={props.id}\n name={props.name}\n value={props.value}\n isSelected={state.on}\n isDisabled={props.disabled ?? false}\n isReadOnly={props.readOnly ?? false}\n onChange={state.flip}\n onKeyDown={onKey}\n aria-label={props.label ? undefined : props.accessibleLabel}\n aria-labelledby={ids.label}\n aria-describedby={ids.desc}\n className={cx('ty-switch', props.className)}\n data-layout={props.layout ?? 'inline'}\n data-size={props.size ?? 'regular'}\n >\n <span className=\"ty-switch__track\" aria-hidden=\"true\">\n <span className=\"ty-switch__thumb\" />\n </span>\n <Caption labelId={ids.label} label={props.label} descId={ids.desc} description={props.description} />\n </AriaSwitch>\n )\n})\n\nexport interface SwitchGroupProps {\n label?: string\n children: ReactNode\n className?: string\n}\n\n/** Vertical stack of switch rows with an optional group label. */\nexport function SwitchGroup(props: SwitchGroupProps) {\n const captionId = useId()\n const named = Boolean(props.label)\n return (\n <div className={cx('ty-switch-group', props.className)} role=\"group\" aria-labelledby={named ? captionId : undefined}>\n {named && (\n <span id={captionId} className=\"ty-switch-group__label\">\n {props.label}\n </span>\n )}\n {props.children}\n </div>\n )\n}\n","import { createContext, useContext, type ReactNode } from 'react'\nimport { Tab, TabList, TabPanel as AriaTabPanel, Tabs as AriaTabs, type Key } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport type { IconComponent } from '../../internal/types'\n\nexport interface TabItem {\n id: string\n label: ReactNode\n icon?: IconComponent\n /** Count after the label, included in the accessible name. */\n count?: number\n disabled?: boolean\n}\n\nexport interface TabsProps {\n /** Accessible name of the tab list. */\n label: string\n tabs: TabItem[]\n selectedKey?: string\n defaultSelectedKey?: string\n onSelectionChange?: (key: string) => void\n orientation?: 'horizontal' | 'vertical'\n /** Automatic selects on focus; manual needs Enter or Space. */\n activation?: 'automatic' | 'manual'\n /** Keeps inactive panels in the DOM (hidden) to preserve their state. */\n keepMounted?: boolean\n /** TabPanel elements. */\n children: ReactNode\n className?: string\n}\n\n/** Panel policy shared with every TabPanel below one Tabs. */\nconst PanelPolicy = createContext({ forceMount: false })\n\nfunction TabLabel({ item }: { item: TabItem }) {\n const Glyph = item.icon\n const counted = typeof item.count === 'number'\n return (\n <Tab id={item.id} className=\"ty-tabs__tab\">\n {Glyph && <Glyph className=\"ty-icon ty-tabs__icon\" aria-hidden=\"true\" focusable=\"false\" />}\n <span className=\"ty-tabs__label\">{item.label}</span>\n {counted && ' '}\n {counted && <span className=\"ty-tabs__count\">{item.count}</span>}\n </Tab>\n )\n}\n\n/** Only the selection props the host actually set are forwarded (RAC treats `undefined` as controlled). */\nfunction selectionOf(p: TabsProps): { selectedKey?: string; defaultSelectedKey?: string } {\n const out: { selectedKey?: string; defaultSelectedKey?: string } = {}\n if (p.selectedKey !== undefined) out.selectedKey = p.selectedKey\n if (p.defaultSelectedKey !== undefined) out.defaultSelectedKey = p.defaultSelectedKey\n return out\n}\n\n/** Sibling views of one object, one panel at a time (spec: wave-1/tabs.md). */\nexport function Tabs(props: TabsProps) {\n const blocked = props.tabs.reduce<string[]>((acc, t) => (t.disabled ? [...acc, t.id] : acc), [])\n const report = (key: Key) => props.onSelectionChange?.(`${key}`)\n return (\n <AriaTabs\n {...selectionOf(props)}\n className={cx('ty-tabs', props.className)}\n orientation={props.orientation ?? 'horizontal'}\n keyboardActivation={props.activation ?? 'automatic'}\n disabledKeys={blocked}\n onSelectionChange={report}\n >\n <TabList aria-label={props.label} className=\"ty-tabs__list\">\n {props.tabs.map((item) => (\n <TabLabel key={item.id} item={item} />\n ))}\n </TabList>\n <PanelPolicy.Provider value={{ forceMount: props.keepMounted === true }}>{props.children}</PanelPolicy.Provider>\n </AriaTabs>\n )\n}\n\nexport interface TabPanelProps {\n /** Matches a tab id. */\n id: string\n children: ReactNode\n className?: string\n}\n\n/** Content of one tab. */\nexport function TabPanel(props: TabPanelProps) {\n const policy = useContext(PanelPolicy)\n return (\n <AriaTabPanel id={props.id} shouldForceMount={policy.forceMount} className={cx('ty-tabs__panel', props.className)}>\n {props.children}\n </AriaTabPanel>\n )\n}\n","import { X } from 'lucide-react'\nimport type { CSSProperties, ReactNode } from 'react'\nimport {\n Button as AriaButton,\n Link as AriaLink,\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagList as AriaTagList,\n type Key,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useMessages } from '../../internal/provider'\n\nexport type TagTone = 'neutral' | 'accent' | 'category'\nexport type TagSize = 'small' | 'regular' | 'large'\n\nexport interface TagProps {\n tone?: TagTone\n /** Categorical token (1 to 8) for `tone=\"category\"`; shown as a small square only. */\n categoryIndex?: number\n size?: TagSize\n icon?: ReactNode\n onPress?: () => void\n href?: string\n removable?: boolean\n onRemove?: () => void\n /** Accessible name of the remove button; must include the tag text. */\n removeLabel?: string\n children: ReactNode\n className?: string\n}\n\nfunction categoryStyle(index: number | undefined): CSSProperties | undefined {\n if (!index) return undefined\n const n = ((Math.max(1, Math.round(index)) - 1) % 8) + 1\n return { '--ty-tag-category': `var(--ty-chart-${n})` } as CSSProperties\n}\n\nfunction Leading({ tone, categoryIndex, icon }: Pick<TagProps, 'tone' | 'categoryIndex' | 'icon'>) {\n if (icon) {\n return (\n <span className=\"ty-tag__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n )\n }\n if (tone === 'category') return <span className=\"ty-tag__swatch\" aria-hidden=\"true\" style={categoryStyle(categoryIndex)} />\n return null\n}\n\nfunction textOf(node: ReactNode): string {\n if (typeof node === 'string' || typeof node === 'number') return String(node)\n if (Array.isArray(node)) return node.map(textOf).join('')\n return ''\n}\n\n/** Small label for static metadata, optionally pressable or removable (spec: wave-1/tag.md). */\nexport function Tag({\n tone = 'neutral',\n categoryIndex,\n size = 'regular',\n icon,\n onPress,\n href,\n removable = false,\n onRemove,\n removeLabel,\n children,\n className,\n}: TagProps) {\n const messages = useMessages()\n const text = textOf(children)\n devWarning(removable && !onRemove, 'Tag: `removable` requires `onRemove`.')\n const common = {\n 'data-tone': tone,\n 'data-size': size,\n 'data-interactive': onPress || href ? true : undefined,\n }\n const inner = (\n <>\n <Leading tone={tone} categoryIndex={categoryIndex} icon={icon} />\n <span className=\"ty-tag__text\" title={text || undefined}>\n {children}\n </span>\n </>\n )\n\n let body: ReactNode\n if (href) {\n body = (\n <AriaLink href={href} onPress={onPress} className={cx('ty-tag', className)} {...common}>\n {inner}\n </AriaLink>\n )\n } else if (onPress) {\n body = (\n <AriaButton onPress={onPress} className={cx('ty-tag', className)} {...common}>\n {inner}\n </AriaButton>\n )\n } else {\n body = (\n <span className={cx('ty-tag', className)} {...common} data-removable={removable || undefined}>\n {inner}\n {removable ? (\n <AriaButton className=\"ty-tag__remove\" aria-label={removeLabel ?? messages.tag.remove(text)} onPress={() => onRemove?.()}>\n <X aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n ) : null}\n </span>\n )\n }\n return body\n}\n\nexport interface TagListItem {\n id: string\n label: string\n tone?: TagTone\n categoryIndex?: number\n icon?: ReactNode\n}\n\nexport interface TagListProps {\n /** Accessible name of the tag group. */\n label: string\n items: TagListItem[]\n /** Called for a removed tag (remove button, Delete or Backspace). */\n onRemove?: (id: string) => void\n size?: TagSize\n className?: string\n}\n\n/** A set of tags; removable sets follow the grid-like tag group pattern (RAC TagGroup). */\nexport function TagList({ label, items, onRemove, size = 'regular', className }: TagListProps) {\n const messages = useMessages()\n return (\n <AriaTagGroup\n aria-label={label}\n className={cx('ty-tag-list', className)}\n onRemove={onRemove ? (keys: Set<Key>) => keys.forEach((k) => onRemove(String(k))) : undefined}\n >\n <AriaTagList className=\"ty-tag-list__items\" items={items}>\n {(item) => (\n <AriaTag\n id={item.id}\n textValue={item.label}\n className=\"ty-tag\"\n data-tone={item.tone ?? 'neutral'}\n data-size={size}\n data-removable={onRemove ? true : undefined}\n >\n <Leading tone={item.tone} categoryIndex={item.categoryIndex} icon={item.icon} />\n <span className=\"ty-tag__text\" title={item.label}>\n {item.label}\n </span>\n {onRemove ? (\n <AriaButton slot=\"remove\" className=\"ty-tag__remove\" aria-label={messages.tag.remove(item.label)}>\n <X aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n ) : null}\n </AriaTag>\n )}\n </AriaTagList>\n </AriaTagGroup>\n )\n}\n","import { CircleAlert } from 'lucide-react'\nimport { forwardRef, useEffect, useId, useRef, useState, type ReactNode } from 'react'\nimport { Label, TextArea as AriaTextArea, TextField as AriaTextField } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useMergedRefs } from '../../internal/dom'\nimport { useMessages } from '../../internal/provider'\nimport { useAppearedAfterMount, useFieldControl } from '../field/Field'\n\nexport interface TextAreaProps {\n label?: string\n accessibleLabel?: string\n hint?: ReactNode\n errorMessage?: string\n value?: string\n defaultValue?: string\n onChange?: (value: string) => void\n /** Initial visible lines. */\n rows?: number\n /** Grows with content up to `maxRows`, then scrolls. */\n autoGrow?: boolean\n maxRows?: number\n resize?: 'none' | 'vertical'\n maxLength?: number\n showCounter?: boolean\n /** Mono family for code, keys or JSON. */\n monospace?: boolean\n required?: boolean\n disabled?: boolean\n readOnly?: boolean\n name?: string\n placeholder?: string\n id?: string\n className?: string\n}\n\n/** Multi-line text entry (spec: wave-1/text-area.md). */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(props, forwardedRef) {\n const {\n label,\n accessibleLabel,\n hint,\n errorMessage,\n value,\n defaultValue,\n onChange,\n rows = 3,\n autoGrow = false,\n maxRows,\n resize = 'vertical',\n maxLength,\n showCounter = false,\n monospace = false,\n required,\n disabled,\n readOnly = false,\n name,\n placeholder,\n id,\n className,\n } = props\n const messages = useMessages()\n const base = useId()\n const areaRef = useRef<HTMLTextAreaElement | null>(null)\n const ref = useMergedRefs(areaRef, forwardedRef)\n const [inner, setInner] = useState(defaultValue ?? '')\n const current = value ?? inner\n const setValue = (v: string) => {\n if (value === undefined) setInner(v)\n onChange?.(v)\n }\n\n const overLimit = maxLength != null && current.length > maxLength\n const hintId = hint != null ? `${base}-hint` : undefined\n const errorId = errorMessage ? `${base}-error` : undefined\n const counterId = showCounter && maxLength != null ? `${base}-counter` : undefined\n const wiring = useFieldControl({\n id,\n describedBy: [hintId, errorId, counterId].filter(Boolean).join(' ') || undefined,\n invalid: !!errorMessage || overLimit,\n required,\n disabled,\n })\n const errorAppeared = useAppearedAfterMount(!!errorMessage)\n devWarning(!label && !accessibleLabel && !wiring.labelledBy, 'TextArea: provide `label`, `accessibleLabel` or a surrounding Field label.')\n\n // Auto-grow: count hard lines, and in a real browser also soft-wrapped lines\n // measured from scrollHeight. No animation (spec).\n const lineCount = current.split('\\n').length\n const [measured, setMeasured] = useState(0)\n useEffect(() => {\n const el = areaRef.current\n if (!autoGrow || !el) return\n const lineHeight = parseFloat(getComputedStyle(el).lineHeight)\n if (!lineHeight || Number.isNaN(lineHeight)) return\n const previous = el.rows\n el.rows = 1\n const needed = Math.ceil((el.scrollHeight - 0.5) / lineHeight)\n el.rows = previous\n setMeasured(needed)\n }, [autoGrow, current])\n const wanted = Math.max(rows, lineCount, measured)\n const visibleRows = autoGrow ? (maxRows ? Math.min(wanted, maxRows) : wanted) : rows\n const scrolling = autoGrow && maxRows != null && wanted > maxRows\n\n return (\n <AriaTextField\n id={wiring.id}\n value={current}\n onChange={setValue}\n isDisabled={wiring.disabled}\n isReadOnly={readOnly}\n isRequired={wiring.required}\n isInvalid={wiring.invalid}\n name={name}\n aria-label={label ? undefined : accessibleLabel}\n aria-labelledby={!label && !accessibleLabel ? wiring.labelledBy : undefined}\n aria-describedby={wiring.describedBy}\n className={cx('ty-text-area', className)}\n data-monospace={monospace || undefined}\n data-resize={resize}\n data-auto-grow={autoGrow || undefined}\n data-scrolling={scrolling || undefined}\n >\n {label ? <Label className=\"ty-text-area__label\">{label}</Label> : null}\n {hint != null ? (\n <p id={hintId} className=\"ty-text-area__hint\">\n {hint}\n </p>\n ) : null}\n <AriaTextArea ref={ref} className=\"ty-text-area__input\" rows={visibleRows} placeholder={placeholder} />\n {errorMessage ? (\n <p id={errorId} className=\"ty-text-area__error\" aria-live={errorAppeared ? 'polite' : undefined}>\n <CircleAlert className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span>{errorMessage}</span>\n </p>\n ) : null}\n {counterId && maxLength != null ? (\n <p id={counterId} className=\"ty-text-area__counter\" data-over-limit={overLimit || undefined}>\n {overLimit ? messages.textField.overLimit(current.length, maxLength) : messages.textField.counter(current.length, maxLength)}\n </p>\n ) : null}\n </AriaTextField>\n )\n})\n","import { CircleAlert, CircleCheck, Eye, EyeOff, Search, X } from 'lucide-react'\nimport { forwardRef, useId, useRef, useState, type FocusEvent, type ReactNode } from 'react'\nimport { Button as AriaButton, Input, Label, SearchField, TextField as AriaTextField } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useMergedRefs } from '../../internal/dom'\nimport { useMessages } from '../../internal/provider'\nimport { useAppearedAfterMount, useFieldControl } from '../field/Field'\n\nexport type TextFieldMode = 'text' | 'search' | 'password'\n\nexport interface TextFieldProps {\n /** Search adds the magnifier and clear action; password adds the reveal action. */\n mode?: TextFieldMode\n /** Native type for `mode=\"text\"`. */\n inputType?: 'text' | 'email' | 'url' | 'tel' | 'number'\n label?: string\n accessibleLabel?: string\n hint?: ReactNode\n errorMessage?: string\n successMessage?: string\n value?: string\n defaultValue?: string\n onChange?: (value: string) => void\n /** Shows the clear action when non-empty (default true in search mode). */\n clearable?: boolean\n onClear?: () => void\n /** Shows the reveal action (default true in password mode). */\n revealable?: boolean\n maxLength?: number\n showCounter?: boolean\n appearance?: 'outlined' | 'filled'\n leadingIcon?: ReactNode\n required?: boolean\n disabled?: boolean\n readOnly?: boolean\n autoComplete?: string\n name?: string\n placeholder?: string\n id?: string\n className?: string\n autoFocus?: boolean\n onFocus?: (e: FocusEvent<HTMLInputElement>) => void\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void\n}\n\n/** Single-line text entry: plain, search and password (spec: wave-1/text-field.md). */\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextField(props, forwardedRef) {\n const {\n mode = 'text',\n inputType = 'text',\n label,\n accessibleLabel,\n hint,\n errorMessage,\n successMessage,\n value,\n defaultValue,\n onChange,\n clearable = mode === 'search',\n onClear,\n revealable = mode === 'password',\n maxLength,\n showCounter = false,\n appearance = 'outlined',\n leadingIcon,\n required,\n disabled,\n readOnly = false,\n autoComplete,\n name,\n placeholder,\n id,\n className,\n autoFocus,\n onFocus,\n onBlur,\n } = props\n const messages = useMessages()\n const base = useId()\n const inputRef = useRef<HTMLInputElement | null>(null)\n const ref = useMergedRefs(inputRef, forwardedRef)\n\n const [inner, setInner] = useState(defaultValue ?? '')\n const current = value ?? inner\n const setValue = (v: string) => {\n if (value === undefined) setInner(v)\n onChange?.(v)\n }\n const [revealed, setRevealed] = useState(false)\n\n const overLimit = maxLength != null && current.length > maxLength\n const ownError = !!errorMessage\n const hintId = hint != null ? `${base}-hint` : undefined\n const errorId = ownError ? `${base}-error` : undefined\n const successId = successMessage && !ownError && !overLimit ? `${base}-success` : undefined\n const counterId = showCounter && maxLength != null ? `${base}-counter` : undefined\n const wiring = useFieldControl({\n id,\n describedBy: [hintId, errorId, successId, counterId].filter(Boolean).join(' ') || undefined,\n invalid: ownError || overLimit,\n required,\n disabled,\n })\n const errorAppeared = useAppearedAfterMount(ownError)\n\n devWarning(!label && !accessibleLabel && !wiring.labelledBy, 'TextField: provide `label`, `accessibleLabel` or a surrounding Field label.')\n\n const clear = () => {\n setValue('')\n onClear?.()\n inputRef.current?.focus()\n }\n\n const type = mode === 'password' ? (revealed ? 'text' : 'password') : mode === 'search' ? 'search' : inputType\n const icon = leadingIcon ?? (mode === 'search' ? <Search /> : null)\n const showClear = clearable && current.length > 0 && !readOnly && !wiring.disabled\n\n const shared = {\n id: wiring.id,\n value: current,\n onChange: setValue,\n isDisabled: wiring.disabled,\n isReadOnly: readOnly,\n isRequired: wiring.required,\n isInvalid: wiring.invalid,\n name,\n autoComplete,\n autoFocus,\n 'aria-label': label ? undefined : accessibleLabel,\n 'aria-labelledby': !label && !accessibleLabel ? wiring.labelledBy : undefined,\n 'aria-describedby': wiring.describedBy,\n className: cx('ty-text-field', className),\n 'data-appearance': appearance,\n 'data-mode': mode,\n onFocus,\n onBlur,\n }\n\n const inner_ = (\n <>\n {label ? <Label className=\"ty-text-field__label\">{label}</Label> : null}\n {hint != null ? (\n <p id={hintId} className=\"ty-text-field__hint\">\n {hint}\n </p>\n ) : null}\n <div className=\"ty-text-field__group\">\n {icon ? (\n <span className=\"ty-text-field__leading\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <Input ref={ref} className=\"ty-text-field__input\" type={type} placeholder={placeholder} />\n {showClear && mode === 'search' ? (\n <AriaButton className=\"ty-text-field__action\" aria-label={messages.textField.clear}>\n <X className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n ) : null}\n {showClear && mode !== 'search' ? (\n <AriaButton className=\"ty-text-field__action\" aria-label={messages.textField.clear} onPress={clear}>\n <X className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n ) : null}\n {mode === 'password' && revealable ? (\n <AriaButton\n className=\"ty-text-field__action\"\n aria-label={revealed ? messages.textField.hidePassword : messages.textField.showPassword}\n aria-pressed={revealed}\n isDisabled={wiring.disabled}\n onPress={() => setRevealed((r) => !r)}\n >\n {revealed ? <EyeOff className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" /> : <Eye className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />}\n </AriaButton>\n ) : null}\n {successId ? <CircleCheck className=\"ty-icon ty-text-field__success-mark\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n </div>\n {ownError ? (\n <p id={errorId} className=\"ty-text-field__error\" aria-live={errorAppeared ? 'polite' : undefined}>\n <CircleAlert className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span>{errorMessage}</span>\n </p>\n ) : null}\n {successId ? (\n <p id={successId} className=\"ty-text-field__success\">\n {successMessage}\n </p>\n ) : null}\n {counterId && maxLength != null ? (\n <p id={counterId} className=\"ty-text-field__counter\" data-over-limit={overLimit || undefined}>\n {overLimit ? messages.textField.overLimit(current.length, maxLength) : messages.textField.counter(current.length, maxLength)}\n </p>\n ) : null}\n </>\n )\n\n if (mode === 'search') {\n return (\n <SearchField {...shared} onClear={() => {\n if (value === undefined) setInner('')\n onClear?.()\n }}>\n {inner_}\n </SearchField>\n )\n }\n return <AriaTextField {...shared} type={type}>{inner_}</AriaTextField>\n})\n","import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\n\nexport type TextSize = 'body-lg' | 'body' | 'meta'\nexport type TextTone = 'default' | 'muted' | 'danger' | 'success'\nexport type TextMeasure = 'none' | 'prose' | 'summary'\n\nexport interface TextProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {\n /** Text token of §2.2. */\n size?: TextSize\n /** Ink level or semantic colour; semantic tones need a word or icon nearby. */\n tone?: TextTone\n /** Element semantics. */\n as?: 'p' | 'span' | 'div'\n /** Maximum line length (prose 68ch, summary 60ch). */\n measure?: TextMeasure\n /** Single-line ellipsis (`true`) or clamp to N lines; full text stays in the tree and as title. */\n truncate?: boolean | number\n /** Tabular figures for numbers. */\n numeric?: boolean\n children: ReactNode\n}\n\ntype OwnKeys = 'size' | 'tone' | 'as' | 'measure' | 'truncate' | 'numeric' | 'children' | 'className' | 'style' | 'title'\n\n/** Number of visible lines requested by `truncate` (0 = no truncation). */\nfunction lineBudget(truncate: TextProps['truncate']): number {\n if (typeof truncate === 'number') return truncate\n return truncate === true ? 1 : 0\n}\n\n/** Everything the element carries besides its children, derived from the props in one place. */\nfunction presentation(props: TextProps) {\n const lines = lineBudget(props.truncate)\n const plain = ['string', 'number'].includes(typeof props.children) ? String(props.children) : undefined\n const style: CSSProperties | undefined = lines < 2 ? props.style : { ...props.style, ['--ty-text-lines' as string]: `${lines}` }\n const truncation = lines === 0 ? undefined : lines === 1 ? 'line' : 'clamp'\n return {\n className: cx('ty-text', props.className),\n style,\n title: props.title ?? (truncation ? plain : undefined),\n 'data-size': props.size ?? 'body',\n 'data-tone': props.tone ?? 'default',\n 'data-measure': props.measure && props.measure !== 'none' ? props.measure : undefined,\n 'data-truncate': truncation,\n 'data-numeric': props.numeric ? true : undefined,\n }\n}\n\nfunction passthrough(props: TextProps): Omit<TextProps, OwnKeys> {\n const out: Record<string, unknown> = { ...props }\n for (const key of ['size', 'tone', 'as', 'measure', 'truncate', 'numeric', 'children', 'className', 'style', 'title'] satisfies OwnKeys[]) delete out[key]\n return out\n}\n\n/** Running text in the type scale (spec: wave-1/text.md). */\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text(props, ref) {\n const Tag = props.as ?? 'p'\n return (\n <Tag {...passthrough(props)} {...presentation(props)} ref={ref as never}>\n {props.children}\n </Tag>\n )\n})\n\n/** Inline emphasis with semantic importance. */\nexport function Strong(props: { children: ReactNode; className?: string }) {\n return <strong className={cx('ty-strong', props.className)}>{props.children}</strong>\n}\n\nexport interface CodeProps {\n children: ReactNode\n className?: string\n /**\n * Reserved: delegates to the Copy Identifier behaviour of wave 2. Accepted\n * now so call sites do not change later; it has no effect in wave 1.\n */\n copyable?: boolean\n}\n\n/** Inline monospace fragment for identifiers, keys and hashes. */\nexport function Code(props: CodeProps) {\n return <code className={cx('ty-code', props.className)}>{props.children}</code>\n}\n","import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from 'lucide-react'\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n} from 'react'\nimport { cx } from '../../internal/cx'\nimport { requestHaptic, useHapticsEnabled } from '../../internal/haptics'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport type ToastTone = 'success' | 'error' | 'warning' | 'info'\nexport type ToastPlacement = 'top-end' | 'top-center' | 'bottom-center'\n\nexport interface ToastOptions {\n tone?: ToastTone\n title: string\n message?: string\n action?: { label: string; onPress: () => void }\n /** Auto-dismiss time in ms, or persistent. Errors and toasts with actions default to persistent. */\n duration?: number | 'persistent'\n /** A later call with the same id replaces this toast in place. */\n id?: string\n}\n\nexport interface ToastRecord extends Required<Pick<ToastOptions, 'tone' | 'title'>> {\n id: string\n message?: string\n action?: { label: string; onPress: () => void }\n duration: number | 'persistent'\n createdAt: number\n}\n\ntype ShortcutOptions = Omit<ToastOptions, 'title' | 'tone'>\n\nexport interface ToastApi {\n show: (options: ToastOptions) => string\n success: (title: string, options?: ShortcutOptions) => string\n error: (title: string, options?: ShortcutOptions) => string\n warning: (title: string, options?: ShortcutOptions) => string\n info: (title: string, options?: ShortcutOptions) => string\n dismiss: (id: string) => void\n /** Past toasts, newest first (feeds the notification history). */\n history: ToastRecord[]\n}\n\nexport interface ToastProviderProps {\n maxVisible?: number\n historyLimit?: number\n placement?: ToastPlacement\n onDismiss?: (id: string) => void\n children?: ReactNode\n}\n\n/** Default auto-dismiss times (ms) per tone; errors never auto-dismiss. */\nexport const toastDurations: Record<ToastTone, number | 'persistent'> = {\n success: 5000,\n info: 5000,\n warning: 8000,\n error: 'persistent',\n}\n\nconst ToastContext = createContext<ToastApi | null>(null)\n\nlet counter = 0\nconst newId = () => `ty-toast-${++counter}`\n\ninterface TimerEntry {\n handle?: ReturnType<typeof setTimeout>\n remaining: number\n startedAt: number\n}\n\n/** Owns the toast queue and history and renders the region (spec: wave-1/toast.md). */\nexport function ToastProvider({ maxVisible = 3, historyLimit = 50, placement = 'top-end', onDismiss, children }: ToastProviderProps) {\n const [queue, setQueue] = useState<ToastRecord[]>([])\n const [history, setHistory] = useState<ToastRecord[]>([])\n const timers = useRef(new Map<string, TimerEntry>())\n const pauseReasons = useRef(new Set<string>())\n const onDismissRef = useRef(onDismiss)\n onDismissRef.current = onDismiss\n // The person's haptics preference, read when a toast is shown.\n const hapticsOn = useRef(true)\n hapticsOn.current = useHapticsEnabled()\n\n const clearTimer = (id: string) => {\n const t = timers.current.get(id)\n if (t?.handle) clearTimeout(t.handle)\n timers.current.delete(id)\n }\n\n const dismiss = useCallback((id: string) => {\n clearTimer(id)\n setQueue((q) => {\n if (!q.some((t) => t.id === id)) return q\n onDismissRef.current?.(id)\n return q.filter((t) => t.id !== id)\n })\n }, [])\n\n const arm = useCallback(\n (id: string, ms: number) => {\n const entry: TimerEntry = { remaining: ms, startedAt: Date.now() }\n if (pauseReasons.current.size === 0) entry.handle = setTimeout(() => dismiss(id), ms)\n timers.current.set(id, entry)\n },\n [dismiss],\n )\n\n const pause = useCallback((reason: string) => {\n const wasRunning = pauseReasons.current.size === 0\n pauseReasons.current.add(reason)\n if (!wasRunning) return\n for (const entry of timers.current.values()) {\n if (entry.handle) {\n clearTimeout(entry.handle)\n entry.handle = undefined\n entry.remaining = Math.max(0, entry.remaining - (Date.now() - entry.startedAt))\n }\n }\n }, [])\n\n const resume = useCallback(\n (reason: string) => {\n if (!pauseReasons.current.delete(reason) || pauseReasons.current.size > 0) return\n for (const [id, entry] of timers.current) {\n entry.startedAt = Date.now()\n entry.handle = setTimeout(() => dismiss(id), entry.remaining)\n }\n },\n [dismiss],\n )\n\n const show = useCallback(\n (options: ToastOptions) => {\n const tone = options.tone ?? 'info'\n const id = options.id ?? newId()\n const duration = options.duration ?? (options.action ? 'persistent' : toastDurations[tone])\n const record: ToastRecord = {\n id,\n tone,\n title: options.title,\n message: options.message,\n action: options.action,\n duration,\n createdAt: Date.now(),\n }\n clearTimer(id)\n setQueue((q) => (q.some((t) => t.id === id) ? q.map((t) => (t.id === id ? record : t)) : [...q, record]))\n setHistory((h) => [record, ...h.filter((t) => t.id !== id)].slice(0, historyLimit))\n // Silent before any user gesture (a toast can appear on its own).\n requestHaptic('light', { enabled: hapticsOn.current })\n return id\n },\n [historyLimit],\n )\n\n const visible = queue.slice(0, maxVisible)\n\n // Start timers for newly visible, non-persistent toasts.\n useEffect(() => {\n for (const t of visible) {\n if (t.duration !== 'persistent' && !timers.current.has(t.id)) arm(t.id, t.duration)\n }\n })\n\n // Pause while the window is hidden.\n useEffect(() => {\n const onVisibility = () => (document.hidden ? pause('hidden') : resume('hidden'))\n document.addEventListener('visibilitychange', onVisibility)\n return () => document.removeEventListener('visibilitychange', onVisibility)\n }, [pause, resume])\n\n useEffect(\n () => () => {\n for (const t of timers.current.values()) if (t.handle) clearTimeout(t.handle)\n },\n [],\n )\n\n const api = useMemo<ToastApi>(\n () => ({\n show,\n success: (title, o) => show({ ...o, title, tone: 'success' }),\n error: (title, o) => show({ ...o, title, tone: 'error' }),\n warning: (title, o) => show({ ...o, title, tone: 'warning' }),\n info: (title, o) => show({ ...o, title, tone: 'info' }),\n dismiss,\n history,\n }),\n [show, dismiss, history],\n )\n\n return (\n <ToastContext.Provider value={api}>\n {children}\n <ToastRegion toasts={visible} placement={placement} onDismiss={dismiss} onPause={pause} onResume={resume} />\n </ToastContext.Provider>\n )\n}\n\n/** Access the toast API; throws outside a ToastProvider. */\nexport function useToast(): ToastApi {\n const ctx = useContext(ToastContext)\n if (!ctx) throw new Error('useToast() must be used inside <ToastProvider>. Wrap the app (or the test) in <ToastProvider>.')\n return ctx\n}\n\nconst toneIcons = { success: CircleCheck, error: CircleAlert, warning: TriangleAlert, info: Info }\n\ninterface RegionProps {\n toasts: ToastRecord[]\n placement: ToastPlacement\n onDismiss: (id: string) => void\n onPause: (reason: string) => void\n onResume: (reason: string) => void\n}\n\nfunction ToastRegion({ toasts, placement, onDismiss, onPause, onResume }: RegionProps) {\n const messages = useMessages()\n const regionRef = useRef<HTMLElement>(null)\n const returnFocus = useRef<HTMLElement | null>(null)\n\n // F6 moves focus to the region (and back out of it).\n useEffect(() => {\n const onKey = (e: globalThis.KeyboardEvent) => {\n if (e.key !== 'F6' || !regionRef.current) return\n const region = regionRef.current\n if (region.contains(document.activeElement)) {\n returnFocus.current?.focus()\n } else if (region.querySelector('.ty-toast')) {\n e.preventDefault()\n returnFocus.current = document.activeElement as HTMLElement | null\n region.querySelector<HTMLElement>('.ty-toast')?.focus()\n }\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n }, [])\n\n const handleDismiss = (id: string) => {\n const region = regionRef.current\n const focusedInside = !!region && region.contains(document.activeElement)\n const last = toasts.length === 1\n onDismiss(id)\n if (focusedInside && last) {\n const target = returnFocus.current\n setTimeout(() => (target?.isConnected ? target.focus() : undefined), 0)\n }\n }\n\n const polite = toasts.filter((t) => t.tone !== 'error')\n const assertive = toasts.filter((t) => t.tone === 'error')\n\n return (\n <section\n ref={regionRef}\n className=\"ty-toast-region\"\n data-placement={placement}\n aria-label={messages.toast.region}\n onPointerEnter={() => onPause('hover')}\n onPointerLeave={() => onResume('hover')}\n onFocus={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) {\n if (e.relatedTarget instanceof HTMLElement) returnFocus.current = e.relatedTarget\n onPause('focus')\n }\n }}\n onBlur={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) onResume('focus')\n }}\n >\n <div className=\"ty-toast-region__list\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"false\">\n {assertive.map((t) => (\n <ToastItem key={t.id} toast={t} onDismiss={handleDismiss} />\n ))}\n </div>\n <div className=\"ty-toast-region__list\" role=\"status\" aria-live=\"polite\" aria-atomic=\"false\">\n {polite.map((t) => (\n <ToastItem key={t.id} toast={t} onDismiss={handleDismiss} />\n ))}\n </div>\n </section>\n )\n}\n\nfunction ToastItem({ toast, onDismiss }: { toast: ToastRecord; onDismiss: (id: string) => void }) {\n const messages = useMessages()\n const Icon = toneIcons[toast.tone]\n const swipe = useRef<{ x: number; id: number } | null>(null)\n const [offset, setOffset] = useState(0)\n\n const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape') {\n e.stopPropagation()\n onDismiss(toast.id)\n }\n }\n // Touch swipe toward the edge dismisses (never the only way).\n const onPointerDown = (e: PointerEvent<HTMLDivElement>) => {\n if (e.pointerType === 'touch') swipe.current = { x: e.clientX, id: e.pointerId }\n }\n const onPointerMove = (e: PointerEvent<HTMLDivElement>) => {\n if (swipe.current && swipe.current.id === e.pointerId) setOffset(Math.max(0, e.clientX - swipe.current.x))\n }\n const onPointerUp = () => {\n if (swipe.current && offset > 80) onDismiss(toast.id)\n swipe.current = null\n setOffset(0)\n }\n\n return (\n <div\n className=\"ty-toast\"\n data-tone={toast.tone}\n tabIndex={0}\n aria-labelledby={`${toast.id}-title`}\n aria-describedby={toast.message ? `${toast.id}-message` : undefined}\n role=\"group\"\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n style={offset ? { transform: `translateX(${offset}px)` } : undefined}\n >\n <Icon className=\"ty-toast__icon\" aria-hidden=\"true\" focusable=\"false\" />\n <div className=\"ty-toast__body\">\n <p className=\"ty-toast__title\" id={`${toast.id}-title`}>\n {toast.title}\n </p>\n {toast.message ? (\n <p className=\"ty-toast__message\" id={`${toast.id}-message`}>\n {toast.message}\n </p>\n ) : null}\n {toast.action ? (\n <div className=\"ty-toast__actions\">\n <Button\n size=\"compact\"\n variant=\"secondary\"\n onPress={() => {\n toast.action?.onPress()\n onDismiss(toast.id)\n }}\n >\n {toast.action.label}\n </Button>\n </div>\n ) : null}\n </div>\n <Button\n className={cx('ty-toast__dismiss')}\n variant=\"quiet\"\n size=\"compact\"\n iconOnly\n accessibleLabel={messages.toast.dismiss}\n leadingIcon={<X />}\n onPress={() => onDismiss(toast.id)}\n />\n </div>\n )\n}\n","import { cloneElement, isValidElement, useId, type ReactElement, type ReactNode } from 'react'\nimport { OverlayArrow, Tooltip as AriaTooltip, TooltipTrigger } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { VisuallyHidden } from '../../internal/VisuallyHidden'\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'start' | 'end'\nexport type TooltipRole = 'label' | 'description'\n\nexport interface TooltipProps {\n /** Hint text; plain text only, never interactive content. */\n content: ReactNode\n /** The focusable trigger (usually an icon-only Button). */\n children: ReactElement\n /** Preferred side; flips when there is no room. */\n placement?: TooltipPlacement\n /** Shows the arrow (default true). */\n showArrow?: boolean\n /** `default` keeps the warm-up delay; `immediate` opens without it. */\n delay?: 'default' | 'immediate'\n /** Never opens (for example when a visible label shows the same text). */\n disabled?: boolean\n /** Controlled open state; rare, for tours and tests. */\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /**\n * `description` (default): the bubble describes an already-named trigger\n * through `aria-describedby`. `label`: the tooltip text is the trigger's\n * accessible name (icon-only triggers), through a persistent hidden label.\n */\n role?: TooltipRole\n className?: string\n}\n\n/** Warm-up (and cool-down) of the shared tooltip timing, in ms. */\nconst WARM_UP_MS = 300\n\n/**\n * Short, non-interactive hint for a control, on hover or keyboard focus\n * (spec: wave-5-general/tooltip.md).\n */\nexport function Tooltip(props: TooltipProps) {\n const {\n content,\n children,\n placement = 'top',\n showArrow = true,\n delay = 'default',\n disabled = false,\n open,\n defaultOpen,\n onOpenChange,\n role = 'description',\n className,\n } = props\n devWarning(!isValidElement(children), 'Tooltip: `children` must be one focusable element.')\n\n const labelId = useId()\n const asLabel = role === 'label'\n // With role=\"label\" the name must exist while the bubble is closed, so it\n // comes from a persistent hidden label; the trigger keeps any description it\n // brought itself, and RAC's open-state description is suppressed so the text\n // is never spoken twice.\n const child = children as ReactElement<Record<string, unknown>>\n const trigger =\n asLabel && isValidElement(child)\n ? cloneElement(child, {\n 'aria-labelledby': labelId,\n ...(child.props['aria-describedby'] === undefined ? { 'aria-describedby': undefined } : {}),\n })\n : children\n\n return (\n <TooltipTrigger\n delay={delay === 'immediate' ? 0 : WARM_UP_MS}\n closeDelay={delay === 'immediate' ? 0 : WARM_UP_MS}\n isDisabled={disabled}\n {...(open !== undefined ? { isOpen: open } : {})}\n {...(defaultOpen !== undefined ? { defaultOpen } : {})}\n onOpenChange={onOpenChange}\n >\n {trigger}\n {asLabel ? <VisuallyHidden id={labelId}>{content}</VisuallyHidden> : null}\n <AriaTooltip\n className={cx('ty-tooltip', className)}\n placement={placement}\n offset={showArrow ? 8 : 6}\n containerPadding={12}\n >\n {showArrow ? (\n <OverlayArrow className=\"ty-tooltip__arrow\">\n <svg width={10} height={6} viewBox=\"0 0 10 6\" aria-hidden=\"true\">\n <path d=\"M0 0 L5 6 L10 0\" />\n </svg>\n </OverlayArrow>\n ) : null}\n <span className=\"ty-tooltip__content\">{content}</span>\n </AriaTooltip>\n </TooltipTrigger>\n )\n}\n","import { Check, Moon, Sun } from 'lucide-react'\nimport { Button as AriaButton, Switch as AriaSwitch } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type ThemeSwitcherMode = 'light' | 'dark'\n\nexport interface ThemeSwitcherProps {\n /** Appearance in use; the host applies and persists it. */\n mode: ThemeSwitcherMode\n onModeChange: (mode: ThemeSwitcherMode) => void\n variant?: 'full' | 'compact'\n /** Constant name of the full switch. */\n label?: string\n toLightLabel?: string\n toDarkLabel?: string\n disabled?: boolean\n className?: string\n}\n\nconst flip = (m: ThemeSwitcherMode): ThemeSwitcherMode => (m === 'dark' ? 'light' : 'dark')\n\nfunction Glyph({ of, active }: { of: ThemeSwitcherMode; active?: boolean }) {\n const Icon = of === 'dark' ? Moon : Sun\n return (\n <span className=\"ty-theme-switcher__glyph\" data-glyph={of} data-active={active || undefined} aria-hidden=\"true\">\n <Icon focusable=\"false\" />\n </span>\n )\n}\n\n/** Light/dark appearance control, as a switch or a compact button (spec: wave-2/theme-switcher.md). */\nexport function ThemeSwitcher(props: ThemeSwitcherProps) {\n const copy = useMessages().themeSwitcher\n const next = flip(props.mode)\n const shared = { 'data-mode': props.mode, isDisabled: props.disabled }\n\n if (props.variant === 'compact') {\n const name = next === 'light' ? (props.toLightLabel ?? copy.toLight) : (props.toDarkLabel ?? copy.toDark)\n return (\n <AriaButton\n {...shared}\n className={cx('ty-theme-switcher', props.className)}\n data-variant=\"compact\"\n aria-label={name}\n onPress={() => props.onModeChange(next)}\n >\n <Glyph of={next} active />\n </AriaButton>\n )\n }\n\n const name = props.label ?? copy.label\n return (\n <AriaSwitch\n {...shared}\n className={cx('ty-theme-switcher', props.className)}\n data-variant=\"full\"\n isSelected={props.mode === 'dark'}\n onChange={(on) => props.onModeChange(on ? 'dark' : 'light')}\n >\n <Glyph of=\"light\" active={props.mode === 'light'} />\n <span className=\"ty-theme-switcher__track\" aria-hidden=\"true\">\n <span className=\"ty-theme-switcher__knob\">\n <Check className=\"ty-theme-switcher__knob-check\" focusable=\"false\" />\n </span>\n </span>\n <Glyph of=\"dark\" active={props.mode === 'dark'} />\n <span className=\"ty-theme-switcher__name\">{name}</span>\n </AriaSwitch>\n )\n}\n","import { Check, X } from 'lucide-react'\nimport { useId, useRef, type ReactNode, type SyntheticEvent } from 'react'\nimport { Switch as AriaSwitch } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useDomAttributes } from '../../internal/dom'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\n\nexport interface StateSwitchProps {\n /** True is the \"on\" state. */\n checked: boolean\n onCheckedChange: (checked: boolean) => void\n /** What is switched, e.g. \"Agent status\"; the stable accessible name. */\n label: string\n offLabel?: string\n onLabel?: string\n offIcon?: IconComponent\n onIcon?: IconComponent\n disabled?: boolean\n /** The host is saving: disabled and busy. */\n pending?: boolean\n className?: string\n}\n\ntype Side = { key: 'off' | 'on'; text: string; Icon: IconComponent }\n\nfunction SideLabel({ side, current, id }: { side: Side; current: boolean; id: string }): ReactNode {\n const { Icon } = side\n return (\n <span id={id} className=\"ty-state-switch__side\" data-side={side.key} data-current={current || undefined}>\n <Icon className=\"ty-state-switch__side-icon\" aria-hidden=\"true\" focusable=\"false\" />\n {side.text}\n </span>\n )\n}\n\n/** Keeps activation inside the control (e.g. a clickable table row around it). */\nconst contain = (e: SyntheticEvent) => e.stopPropagation()\n\n/** Switch framed by the names of its two states (spec: wave-2/state-switch.md). */\nexport function StateSwitch(props: StateSwitchProps) {\n const copy = useMessages().stateSwitch\n const base = useId()\n const inputRef = useRef<HTMLInputElement>(null)\n const blocked = Boolean(props.disabled || props.pending)\n const sides: [Side, Side] = [\n { key: 'off', text: props.offLabel ?? copy.off, Icon: props.offIcon ?? X },\n { key: 'on', text: props.onLabel ?? copy.on, Icon: props.onIcon ?? Check },\n ]\n const currentId = `${base}-${props.checked ? 'on' : 'off'}`\n useDomAttributes(inputRef, { 'aria-busy': props.pending ? 'true' : undefined })\n\n return (\n <span className={cx('ty-state-switch', props.className)} onClick={contain} onKeyDown={contain} onPointerDown={contain}>\n <AriaSwitch\n inputRef={inputRef}\n className=\"ty-state-switch__control\"\n isSelected={props.checked}\n isDisabled={blocked}\n onChange={props.onCheckedChange}\n aria-label={props.label}\n aria-describedby={currentId}\n data-pending={props.pending || undefined}\n >\n <SideLabel side={sides[0]} current={!props.checked} id={`${base}-off`} />\n <span className=\"ty-state-switch__track\" aria-hidden=\"true\">\n <span className=\"ty-state-switch__thumb\" />\n </span>\n <SideLabel side={sides[1]} current={props.checked} id={`${base}-on`} />\n </AriaSwitch>\n </span>\n )\n}\n","import { useEffect, useId, useRef, useState, type ClipboardEvent, type KeyboardEvent } from 'react'\nimport { Group, Input, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { requestHaptic } from '../../internal/haptics'\nimport { useMessages } from '../../internal/provider'\n\nexport type CodeCharacters = 'digits' | 'alphanumeric'\n\nexport interface OneTimeCodeFieldProps {\n length?: number\n value: string\n onChange: (value: string) => void\n onComplete?: (code: string) => void\n characters?: CodeCharacters\n label?: string\n boxLabel?: (position: number, total: number) => string\n errorText?: string\n disabled?: boolean\n autoFocus?: boolean\n className?: string\n}\n\n/* ---------------------------------------------------------- characters -- */\n\nconst ALLOWED: Record<CodeCharacters, RegExp> = { digits: /^\\p{Nd}$/u, alphanumeric: /^(?:\\p{Nd}|[a-z])$/iu }\n\n/**\n * Any script's decimal digit as its ASCII digit (codes are issued in ASCII).\n * Unicode decimal digits come in runs of ten starting at a zero, so the digit\n * is the distance to the start of its run.\n */\nfunction westernDigit(glyph: string): string {\n if (/^[0-9]$/.test(glyph) || !/^\\p{Nd}$/u.test(glyph)) return glyph\n const point = glyph.codePointAt(0)!\n let runStart = point\n while (point - runStart < 9 && /^\\p{Nd}$/u.test(String.fromCodePoint(runStart - 1))) runStart--\n return String(point - runStart)\n}\n\n/** The accepted characters of a text, in order, digits in ASCII. */\nconst cleaned = (text: string, kind: CodeCharacters) => [...text].filter((g) => ALLOWED[kind].test(g)).map(westernDigit)\n\n/* --------------------------------------------------------------- cells -- */\n\n/** A code as one cell per box ('' when empty), and where focus should go after an edit. */\ntype Edit = { cells: string[]; focus: number }\n\nconst blank = (size: number) => Array.from({ length: size }, () => '')\nconst cellsOf = (code: string, size: number) => blank(size).map((_, k) => code[k] ?? '')\n\n/** Writes characters from `at` onwards (a start at 0 replaces the whole code); focus the first gap. */\nfunction write(cells: string[], at: number, glyphs: string[]): Edit {\n const out = at === 0 ? blank(cells.length) : cells.slice()\n glyphs.slice(0, cells.length - at).forEach((g, k) => (out[at + k] = g))\n const gap = out.indexOf('')\n return { cells: out, focus: gap < 0 ? cells.length - 1 : gap }\n}\n\n/** Backspace: clears this cell, or the previous one when this is already empty. */\nfunction erase(cells: string[], at: number): Edit | null {\n const target = cells[at] ? at : at - 1\n if (target < 0) return null\n const out = cells.slice()\n out[target] = ''\n return { cells: out, focus: target }\n}\n\n/** What an input event added to a cell that held `before`. */\nfunction added(before: string, now: string): string {\n if (before && now.startsWith(before)) return now.slice(before.length)\n return now.replace(before, '')\n}\n\n/* ----------------------------------------------------------- component -- */\n\n/** One character per box, with paste and autofill (spec: wave-2/one-time-code-field.md). */\nexport function OneTimeCodeField(props: OneTimeCodeFieldProps) {\n const size = props.length ?? 6\n const kind = props.characters ?? 'digits'\n const off = props.disabled ?? false\n const copy = useMessages().oneTimeCode\n const forward = useLocale().direction === 'rtl' ? -1 : 1\n const faultId = useId()\n const refs = useRef<Array<HTMLInputElement | null>>([])\n const [cells, setCells] = useState(() => cellsOf(props.value, size))\n\n // Follow the controlled value when the host changes it from outside.\n useEffect(() => {\n setCells((mine) => (mine.length === size && mine.join('') === props.value ? mine : cellsOf(props.value, size)))\n }, [props.value, size])\n\n useEffect(() => {\n if (props.autoFocus) refs.current[0]?.focus()\n }, [props.autoFocus])\n\n const focusCell = (k: number) => refs.current[Math.min(size - 1, Math.max(0, k))]?.focus()\n\n /** Applies an edit: state, host callbacks, haptics, focus. */\n const apply = (edit: Edit, feel: 'light' | 'none') => {\n if (feel !== 'none') requestHaptic(feel)\n setCells(edit.cells)\n const code = edit.cells.join('')\n props.onChange(code)\n if (edit.cells.every((c) => c !== '')) {\n requestHaptic('medium')\n props.onComplete?.(code)\n }\n focusCell(edit.focus)\n }\n\n const onInput = (k: number, now: string) => {\n const glyphs = cleaned(added(cells[k] ?? '', now), kind)\n if (glyphs.length === 0) return\n // Several characters at once (autofill) are handled like a paste from the start.\n if (glyphs.length > 1) return apply(write(cells, 0, glyphs), 'light')\n const next = cells.slice()\n next[k] = glyphs[0]!\n apply({ cells: next, focus: k < size - 1 ? k + 1 : k }, 'light')\n }\n\n const keys: Record<string, (k: number) => void> = {\n Backspace: (k) => {\n const edit = erase(cells, k)\n if (edit) apply(edit, 'none')\n },\n ArrowLeft: (k) => focusCell(k - forward),\n ArrowRight: (k) => focusCell(k + forward),\n }\n\n const onKeyDown = (k: number, event: KeyboardEvent<HTMLInputElement>) => {\n const act = keys[event.key]\n if (!act) return\n event.preventDefault()\n act(k)\n }\n\n const onPaste = (event: ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault()\n const glyphs = cleaned(event.clipboardData.getData('text'), kind)\n if (glyphs.length) apply(write(cells, 0, glyphs), 'light')\n }\n\n const naming = props.boxLabel ?? copy.box\n const fault = props.errorText\n\n return (\n <div className={cx('ty-otc', props.className)} data-invalid={fault ? true : undefined}>\n <Group className=\"ty-otc__group\" aria-label={props.label ?? copy.label} aria-describedby={fault ? faultId : undefined} isDisabled={off} isInvalid={!!fault}>\n {cells.map((glyph, k) => (\n <Input\n key={k}\n ref={(node) => void (refs.current[k] = node)}\n className=\"ty-otc__box\"\n value={glyph}\n aria-label={naming(k + 1, size)}\n aria-invalid={fault ? true : undefined}\n disabled={off}\n inputMode={kind === 'digits' ? 'numeric' : 'text'}\n autoComplete={k === 0 ? 'one-time-code' : 'off'}\n autoCapitalize=\"off\"\n spellCheck={false}\n onFocus={(event) => event.target.select()}\n onChange={(event) => onInput(k, event.target.value)}\n onKeyDown={(event) => onKeyDown(k, event)}\n onPaste={onPaste}\n />\n ))}\n </Group>\n {fault ? (\n <p id={faultId} className=\"ty-otc__error\" role=\"alert\">\n {fault}\n </p>\n ) : null}\n </div>\n )\n}\n","import { useEffect, useState } from 'react'\n\n/**\n * Polite live region whose text settles `delay` ms after the last change, so\n * a value that moves on every keystroke is announced once typing pauses.\n */\nexport function LiveNote({ text, delay = 500, id }: { text: string | undefined; delay?: number; id?: string }) {\n const [settled, setSettled] = useState('')\n useEffect(() => {\n const handle = setTimeout(() => setSettled(text ?? ''), delay)\n return () => clearTimeout(handle)\n }, [text, delay])\n return (\n <span id={id} className=\"ty-visually-hidden\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {settled}\n </span>\n )\n}\n","import { CircleCheck, CircleDashed } from 'lucide-react'\nimport { cx } from '../../internal/cx'\nimport { LiveNote } from '../../internal/forms-a/LiveNote'\nimport { useMessages } from '../../internal/provider'\n\nexport interface PasswordPolicy {\n minLength?: number\n uppercase?: boolean\n lowercase?: boolean\n digit?: boolean\n symbol?: boolean\n}\n\ntype RuleKey = 'minLength' | 'uppercase' | 'lowercase' | 'digit' | 'symbol'\n\nexport interface PasswordStrengthProps {\n password: string\n policy?: PasswordPolicy\n showRequirements?: boolean\n levelLabels?: [string, string, string, string]\n /** Checklist text per rule; the length rule receives the minimum. */\n ruleLabels?: Partial<{ minLength: (count: number) => string; uppercase: string; lowercase: string; digit: string; symbol: string }>\n /** Id for the host's `aria-describedby` on the password field. */\n id?: string\n className?: string\n}\n\nexport const defaultPasswordPolicy: Required<PasswordPolicy> = { minLength: 8, uppercase: true, lowercase: true, digit: true, symbol: false }\n\nconst TESTS: Record<Exclude<RuleKey, 'minLength'>, RegExp> = {\n uppercase: /\\p{Lu}/u,\n lowercase: /\\p{Ll}/u,\n digit: /\\p{Nd}/u,\n symbol: /[^\\p{L}\\p{Nd}\\s]/u,\n}\n\nexport interface PasswordRuleResult {\n key: RuleKey\n met: boolean\n}\n\n/** Pure evaluation: which rules hold, and the level 1 to 4 (0 for an empty password). */\nexport function evaluatePassword(password: string, policy: PasswordPolicy = defaultPasswordPolicy) {\n const p = { ...defaultPasswordPolicy, ...policy }\n const rules: PasswordRuleResult[] = [{ key: 'minLength', met: password.length >= p.minLength }]\n for (const key of Object.keys(TESTS) as Array<keyof typeof TESTS>) {\n if (p[key]) rules.push({ key, met: TESTS[key].test(password) })\n }\n if (!password) return { rules, level: 0 as const }\n const share = rules.filter((r) => r.met).length / rules.length\n const long = password.length >= Math.max(12, p.minLength + 4)\n // Mostly the share of rules met, plus a smaller bonus for length; only a\n // password meeting every rule and reasonably long reaches the top level.\n const points = share * 3 + (long ? 0.75 : 0)\n const level = share === 1 && long ? 4 : Math.min(3, 1 + Math.floor(points))\n return { rules, level: level as 1 | 2 | 3 | 4 }\n}\n\nconst TONE = ['danger', 'danger', 'pending', 'success', 'success'] as const\n\n/** Advisory strength meter under a new-password field (spec: wave-2/password-strength.md). */\nexport function PasswordStrength({ password, policy, showRequirements = false, levelLabels, ruleLabels, id, className }: PasswordStrengthProps) {\n const copy = useMessages().passwordStrength\n const { rules, level } = evaluatePassword(password, policy)\n if (level === 0) return null\n const words = levelLabels ?? copy.levels\n const word = words[level - 1]!\n const min = { ...defaultPasswordPolicy, ...policy }.minLength\n const textOf = (key: RuleKey) => {\n if (key === 'minLength') return (ruleLabels?.minLength ?? copy.rules.minLength)(min)\n return ruleLabels?.[key] ?? copy.rules[key]\n }\n\n return (\n <div id={id} className={cx('ty-password-strength', className)} data-level={level} data-tone={TONE[level]}>\n <div\n className=\"ty-password-strength__meter\"\n role=\"meter\"\n aria-label={copy.label}\n aria-valuemin={0}\n aria-valuemax={4}\n aria-valuenow={level}\n aria-valuetext={word}\n >\n <span className=\"ty-password-strength__bar\" aria-hidden=\"true\">\n {[1, 2, 3, 4].map((n) => (\n <span key={n} className=\"ty-password-strength__segment\" data-filled={n <= level || undefined} />\n ))}\n </span>\n <span className=\"ty-password-strength__word\">{word}</span>\n </div>\n <LiveNote text={copy.announce(word)} delay={700} />\n {showRequirements ? (\n <ul className=\"ty-password-strength__rules\">\n {rules.map((r) => {\n const Glyph = r.met ? CircleCheck : CircleDashed\n return (\n <li key={r.key} className=\"ty-password-strength__rule\" data-met={r.met || undefined}>\n <Glyph className=\"ty-password-strength__glyph\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-visually-hidden\">{r.met ? copy.met : copy.notMet} </span>\n {textOf(r.key)}\n </li>\n )\n })}\n </ul>\n ) : null}\n </div>\n )\n}\n","import { Search, X } from 'lucide-react'\nimport type { FocusEvent, ReactNode } from 'react'\nimport { Button as AriaButton, Input, Label, SearchField } from 'react-aria-components'\n\nexport interface SearchInputProps {\n value: string\n onChange: (value: string) => void\n /** Visible label above the well (design direction §2.10). */\n label?: string\n ariaLabel?: string\n placeholder?: string\n clearLabel: string\n disabled?: boolean\n readOnly?: boolean\n /** Extra content at the end of the well, before the clear control. */\n end?: ReactNode\n onFocus?: (e: FocusEvent<HTMLInputElement>) => void\n describedBy?: string\n className?: string\n}\n\n/**\n * The search well shared by FilterField and SearchBar: leading glyph, input,\n * clear control only while there is text. RAC SearchField gives Escape to clear\n * (and lets a second Escape through to an enclosing overlay).\n */\nexport function SearchInput(p: SearchInputProps) {\n const filled = p.value.length > 0\n return (\n <SearchField\n className={p.className ?? 'ty-search-input'}\n value={p.value}\n onChange={p.onChange}\n isDisabled={p.disabled}\n isReadOnly={p.readOnly}\n aria-label={p.label ? undefined : p.ariaLabel}\n aria-describedby={p.describedBy}\n >\n {p.label ? <Label className=\"ty-search-input__label\">{p.label}</Label> : null}\n <div className=\"ty-search-input__well\" data-filled={filled || undefined}>\n <Search className=\"ty-search-input__glyph\" aria-hidden=\"true\" focusable=\"false\" />\n <Input className=\"ty-search-input__input\" placeholder={p.placeholder} onFocus={p.onFocus} />\n {p.end}\n {filled && !p.readOnly ? (\n <AriaButton className=\"ty-search-input__clear\" aria-label={p.clearLabel}>\n <X aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n ) : null}\n </div>\n </SearchField>\n )\n}\n","import { Check } from 'lucide-react'\nimport type { CSSProperties } from 'react'\n\n/** Decorative check glyph used by every selectable surface of the group. */\nexport function SelectedMark({ shown }: { shown: boolean }) {\n return shown ? (\n <span className=\"ty-selected-mark\" aria-hidden=\"true\">\n <Check focusable=\"false\" />\n </span>\n ) : null\n}\n\n/** Categorical token (1 to 8) as a component-local custom property. */\nexport function categoricalVar(name: string, index: number | undefined): CSSProperties | undefined {\n if (!index) return undefined\n const slot = ((Math.max(1, Math.round(index)) - 1) % 8) + 1\n return { [name]: `var(--ty-categorical-${slot})` } as CSSProperties\n}\n","import { ListFilter, X } from 'lucide-react'\nimport { useId, useLayoutEffect, useRef, useState, type ReactNode } from 'react'\nimport { Button as AriaButton, Tag, TagGroup, TagList, useLocale, type Key } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { categoricalVar } from '../../internal/forms-a/marks'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\n\n/** `neutral`, `accent`, or a categorical token index 1 to 8 (a small marker only, §2.3). */\nexport type FilterChipTone = 'neutral' | 'accent' | number\n\nexport interface ActiveFilter {\n kind: string\n value: string\n label: string\n tone?: FilterChipTone\n /** Own leading glyph, in place of the kind icon. */\n icon?: ReactNode\n}\n\nexport interface FilterChipsProps {\n filters: ActiveFilter[]\n onRemove?: (filter: ActiveFilter) => void\n onClearAll?: () => void\n /** Icon per filter kind; `default` (or a neutral filter glyph) for the rest. */\n kindIcons?: Record<string, IconComponent>\n removeLabel?: (label: string) => string\n groupLabel?: string\n className?: string\n}\n\nconst keyOf = (f: ActiveFilter) => `${encodeURIComponent(f.kind)}.${encodeURIComponent(f.value)}`\n\nconst FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])'\n\n/** First focusable element after `node` in document order. */\nfunction focusableAfter(node: Element): HTMLElement | null {\n const all = Array.from(document.querySelectorAll<HTMLElement>(FOCUSABLE))\n return all.find((el) => node.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING && !node.contains(el)) ?? null\n}\n\nfunction Marker({ tone }: { tone: FilterChipTone | undefined }) {\n if (typeof tone !== 'number') return null\n return <span className=\"ty-filter-chips__marker\" aria-hidden=\"true\" style={categoricalVar('--ty-filter-chip-marker', tone)} />\n}\n\n/** Removable chips of the filters in force (spec: wave-2/filter-chips.md). */\nexport function FilterChips({ filters, onRemove, onClearAll, kindIcons, removeLabel, groupLabel, className }: FilterChipsProps) {\n const copy = useMessages().filterChips\n const { locale } = useLocale()\n const root = useRef<HTMLDivElement>(null)\n const uid = useId()\n const anchor = useRef<HTMLSpanElement>(null)\n const [said, setSaid] = useState('')\n // After a removal: the key to focus next, or 'after' to leave the group.\n const pendingFocus = useRef<string | null>(null)\n\n const byKey = new Map(filters.map((f) => [keyOf(f), f]))\n const nameRemove = removeLabel ?? copy.remove\n\n const remove = (keys: Set<Key>) => {\n const order = filters.map(keyOf)\n const gone = [...keys].map(String)\n const firstIdx = Math.min(...gone.map((k) => order.indexOf(k)))\n const rest = order.filter((k) => !gone.includes(k))\n pendingFocus.current = rest[firstIdx] ?? rest[firstIdx - 1] ?? 'after'\n const removed = gone.map((k) => byKey.get(k)).filter((f): f is ActiveFilter => !!f)\n setSaid(new Intl.ListFormat(locale, { type: 'unit', style: 'long' }).format(removed.map((f) => copy.removed(f.label))))\n removed.forEach((f) => onRemove?.(f))\n }\n\n useLayoutEffect(() => {\n const target = pendingFocus.current\n if (!target) return\n pendingFocus.current = null\n if (target === 'after') {\n if (anchor.current) focusableAfter(anchor.current)?.focus()\n return\n }\n const row = root.current?.querySelector<HTMLElement>(`[data-key=\"${CSS.escape(target)}\"]`)\n row?.focus()\n })\n\n const live = (\n <span ref={anchor} className=\"ty-visually-hidden\" role=\"status\" aria-live=\"polite\">\n {said}\n </span>\n )\n if (filters.length === 0) return said ? live : null\n\n return (\n <div ref={root} className={cx('ty-filter-chips', className)}>\n <TagGroup aria-label={groupLabel ?? copy.group} onRemove={onRemove ? remove : undefined} className=\"ty-filter-chips__group\">\n <TagList className=\"ty-filter-chips__list\">\n {filters.map((f) => {\n const Icon = kindIcons?.[f.kind] ?? kindIcons?.default ?? ListFilter\n const k = keyOf(f)\n return (\n <Tag key={k} id={k} data-key={k} textValue={f.label} className=\"ty-filter-chips__chip\" data-tone={typeof f.tone === 'number' ? 'category' : (f.tone ?? 'neutral')}>\n {f.icon ? (\n <span className=\"ty-filter-chips__icon\" aria-hidden=\"true\">\n {f.icon}\n </span>\n ) : (\n <Icon className=\"ty-filter-chips__icon\" data-kind-icon={kindIcons?.[f.kind] ? f.kind : 'default'} aria-hidden=\"true\" focusable=\"false\" />\n )}\n <Marker tone={f.tone} />\n <span className=\"ty-filter-chips__text\">{f.label}</span>\n {onRemove ? (\n <AriaButton\n slot=\"remove\"\n id={`${uid}-x-${k}`}\n // Self-reference: the name is exactly the remove label, not joined with the row's.\n aria-labelledby={`${uid}-x-${k}`}\n className=\"ty-filter-chips__remove\"\n aria-label={nameRemove(f.label)}\n >\n <X aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n ) : null}\n </Tag>\n )\n })}\n </TagList>\n </TagGroup>\n {onClearAll && filters.length >= 2 ? (\n <AriaButton className=\"ty-filter-chips__clear-all\" onPress={onClearAll}>\n {copy.clearAll}\n </AriaButton>\n ) : null}\n {live}\n </div>\n )\n}\n","import { SlidersHorizontal } from 'lucide-react'\nimport { useRef, useState, type FocusEvent, type ReactNode } from 'react'\nimport { Button as AriaButton, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { SearchInput } from '../../internal/forms-a/SearchInput'\nimport { useMediaQuery } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\nimport { Button } from '../button/Button'\nimport { Drawer } from '../drawer/Drawer'\nimport { FilterChips, type ActiveFilter } from '../filter-chips/FilterChips'\nimport { ModalDialog } from '../modal-dialog/ModalDialog'\n\nexport interface SearchBarFilterDialog {\n open: boolean\n onOpenChange: (open: boolean) => void\n title?: string\n activeCount?: number\n onClear?: () => void\n context?: { icon?: ReactNode; label: string; countText?: string }\n content: ReactNode\n}\n\nexport interface SearchBarProps {\n query: string\n onQueryChange: (value: string) => void\n placeholder?: string\n /** Name of the search landmark (defaults to the placeholder wording). */\n label?: string\n filters?: ActiveFilter[]\n onRemoveFilter?: (filter: ActiveFilter) => void\n /** Host map from filter kind to category icon. */\n kindIcons?: Record<string, IconComponent>\n onClearAll?: () => void\n cancelStyle?: boolean\n onCancel?: () => void\n filterDialog?: SearchBarFilterDialog\n /** Content inside the end of the field. */\n end?: ReactNode\n /** Trailing slot (create button, density switch). */\n actions?: ReactNode\n bordered?: boolean\n className?: string\n}\n\nfunction FiltersPanel({ dialog, narrow }: { dialog: SearchBarFilterDialog; narrow: boolean }) {\n const copy = useMessages().searchBar\n const count = dialog.activeCount ?? 0\n const close = () => dialog.onOpenChange(false)\n const footer = (\n <>\n {dialog.onClear && count > 0 ? (\n <Button variant=\"quiet\" onPress={dialog.onClear}>\n {copy.clear}\n </Button>\n ) : null}\n <Button variant=\"primary\" onPress={close}>\n {copy.done}\n </Button>\n </>\n )\n const context = dialog.context ? (\n <p className=\"ty-search-bar__context\">\n {dialog.context.icon ? <span aria-hidden=\"true\">{dialog.context.icon}</span> : null}\n <span className=\"ty-search-bar__context-label\">{dialog.context.label}</span>\n {dialog.context.countText ? <span className=\"ty-search-bar__context-count\">{dialog.context.countText}</span> : null}\n </p>\n ) : null\n const title = dialog.title ?? copy.filtersTitle\n if (narrow) {\n return (\n <Drawer open={dialog.open} onOpenChange={dialog.onOpenChange} title={title} placement=\"bottom\">\n {context}\n {dialog.content}\n <div className=\"ty-search-bar__drawer-actions\">{footer}</div>\n </Drawer>\n )\n }\n return (\n <ModalDialog isOpen={dialog.open} onOpenChange={dialog.onOpenChange} title={title} actions={footer}>\n {context}\n {dialog.content}\n </ModalDialog>\n )\n}\n\n/** Search field, active filters, bulk clear and a filters dialog above a list (spec: wave-2/search-bar.md). */\nexport function SearchBar(props: SearchBarProps) {\n const copy = useMessages().searchBar\n const narrow = useMediaQuery('(max-width: 639.98px)')\n const { locale } = useLocale()\n const bar = useRef<HTMLDivElement>(null)\n const [focusInside, setFocusInside] = useState(false)\n const filters = props.filters ?? []\n const hasFilters = filters.length > 0\n const dirty = props.query.length > 0 || hasFilters\n const cancelShown = Boolean(props.cancelStyle && focusInside)\n const count = props.filterDialog?.activeCount ?? 0\n const placeholder = props.placeholder ?? (hasFilters ? copy.refinePlaceholder : copy.placeholder)\n\n // Cancel stays reachable while focus is anywhere inside the bar.\n const onBlurCapture = (e: FocusEvent) => {\n if (!bar.current?.contains(e.relatedTarget as Node | null)) setFocusInside(false)\n }\n\n const trailing: ReactNode[] = []\n if (cancelShown) {\n trailing.push(\n <AriaButton\n key=\"cancel\"\n className=\"ty-search-bar__text-action\"\n onPress={() => {\n props.onQueryChange('')\n props.onCancel?.()\n setFocusInside(false)\n }}\n >\n {copy.cancel}\n </AriaButton>,\n )\n } else if (dirty && props.onClearAll) {\n trailing.push(\n <AriaButton key=\"clear\" className=\"ty-search-bar__text-action\" onPress={props.onClearAll}>\n {copy.clearAll}\n </AriaButton>,\n )\n }\n if (props.filterDialog) {\n trailing.push(\n <Button\n key=\"filters\"\n leadingIcon={<SlidersHorizontal />}\n aria-haspopup=\"dialog\"\n aria-expanded={props.filterDialog.open}\n onPress={() => props.filterDialog!.onOpenChange(true)}\n className=\"ty-search-bar__filters\"\n >\n <span aria-hidden=\"true\">{copy.filters}</span>\n {count > 0 ? (\n <span className=\"ty-search-bar__count\" aria-hidden=\"true\">\n {new Intl.NumberFormat(locale).format(count)}\n </span>\n ) : null}\n <span className=\"ty-visually-hidden\">{count > 0 ? copy.filtersActive(count) : copy.filters}</span>\n </Button>,\n )\n }\n\n return (\n <div\n ref={bar}\n role=\"search\"\n aria-label={props.label ?? placeholder}\n className={cx('ty-search-bar', props.className)}\n data-bordered={props.bordered === false ? undefined : true}\n onFocusCapture={() => setFocusInside(true)}\n onBlurCapture={onBlurCapture}\n >\n <div className=\"ty-search-bar__main\">\n <SearchInput\n className=\"ty-search-input ty-search-bar__field\"\n value={props.query}\n onChange={props.onQueryChange}\n ariaLabel={placeholder}\n placeholder={placeholder}\n clearLabel={copy.clearSearch}\n end={props.end}\n />\n {trailing}\n </div>\n {hasFilters ? <FilterChips filters={filters} onRemove={props.onRemoveFilter} kindIcons={props.kindIcons} className=\"ty-search-bar__chips\" /> : null}\n {props.actions ? <div className=\"ty-search-bar__actions\">{props.actions}</div> : null}\n {props.filterDialog ? <FiltersPanel dialog={props.filterDialog} narrow={narrow} /> : null}\n </div>\n )\n}\n","import { useId } from 'react'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { LiveNote } from '../../internal/forms-a/LiveNote'\nimport { SearchInput } from '../../internal/forms-a/SearchInput'\nimport { useMessages } from '../../internal/provider'\n\nexport interface FilterFieldProps {\n value: string\n onChange: (value: string) => void\n label?: string\n /** Name when there is no visible label; the placeholder is never the name. */\n ariaLabel?: string\n placeholder?: string\n clearLabel?: string\n /** For example \"12 results\"; announced politely once typing pauses. */\n resultCountText?: string\n disabled?: boolean\n readOnly?: boolean\n className?: string\n}\n\n/** Narrows a list on the same page while typing (spec: wave-2/filter-field.md). */\nexport function FilterField(props: FilterFieldProps) {\n const clear = props.clearLabel ?? useMessages().filterField.clear\n const noteId = useId()\n devWarning(!props.label && !props.ariaLabel, 'FilterField: provide `label` or `ariaLabel`; the placeholder is not a name.')\n return (\n <div className={cx('ty-filter-field', props.className)}>\n <SearchInput\n value={props.value}\n onChange={props.onChange}\n label={props.label}\n ariaLabel={props.ariaLabel}\n placeholder={props.placeholder}\n clearLabel={clear}\n disabled={props.disabled}\n readOnly={props.readOnly}\n />\n {props.resultCountText !== undefined ? <LiveNote id={noteId} text={props.resultCountText} /> : null}\n </div>\n )\n}\n","import { useId, type ReactNode } from 'react'\nimport { Heading, ToggleButton } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { categoricalVar, SelectedMark } from '../../internal/forms-a/marks'\n\nexport interface FilterTileProps {\n selected: boolean\n onToggle: () => void\n label: string\n /** Secondary line, e.g. \"42 records\"; also the accessible description. */\n detail?: string\n /** Glyph or logo (rendered decoratively). */\n icon: ReactNode\n /** `neutral` puts full-colour logos on a plain light well in both themes. */\n iconSurface?: 'tinted' | 'neutral'\n /** Categorical token index (1 to 8) tinting the icon well only. */\n tone?: number\n disabled?: boolean\n className?: string\n}\n\n/** Large tile turning one filter on or off (spec: wave-2/filter-tile.md). */\nexport function FilterTile(props: FilterTileProps) {\n const ids = useId()\n const detailId = `${ids}-detail`\n const labelId = `${ids}-label`\n const surface = props.iconSurface ?? 'tinted'\n return (\n <ToggleButton\n className={cx('ty-filter-tile', props.className)}\n isSelected={props.selected}\n isDisabled={props.disabled}\n onChange={() => props.onToggle()}\n aria-labelledby={labelId}\n aria-describedby={props.detail ? detailId : undefined}\n >\n <span\n className=\"ty-filter-tile__well\"\n data-surface={surface}\n data-toned={props.tone ? true : undefined}\n style={categoricalVar('--ty-filter-tile-tone', props.tone)}\n aria-hidden=\"true\"\n >\n {props.icon}\n </span>\n <span className=\"ty-filter-tile__text\">\n <span id={labelId} className=\"ty-filter-tile__label\">{props.label}</span>\n {props.detail ? (\n <span id={detailId} className=\"ty-filter-tile__detail\">\n {props.detail}\n </span>\n ) : null}\n </span>\n <SelectedMark shown={props.selected} />\n </ToggleButton>\n )\n}\n\nexport interface FilterTileGroupHeadingProps {\n label: string\n icon: ReactNode\n level?: 2 | 3 | 4\n className?: string\n}\n\n/** Small heading introducing a group of tiles. */\nexport function FilterTileGroupHeading({ label, icon, level = 3, className }: FilterTileGroupHeadingProps) {\n return (\n <div className={cx('ty-filter-tile-heading', className)}>\n <span className=\"ty-filter-tile-heading__well\" aria-hidden=\"true\">\n {icon}\n </span>\n <Heading level={level} className=\"ty-filter-tile-heading__text\">\n {label}\n </Heading>\n </div>\n )\n}\n\n/** Responsive grid for tiles: two columns on phones, more above 640. */\nexport function FilterTileGrid({ label, children, className }: { label: string; children: ReactNode; className?: string }) {\n return (\n <div role=\"group\" aria-label={label} className={cx('ty-filter-tile-grid', className)}>\n {children}\n </div>\n )\n}\n","import { createContext, useContext, useId, useRef, type ReactNode } from 'react'\nimport { Label, Radio, RadioGroup, ToggleButton } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useDomAttributes } from '../../internal/dom'\nimport { SelectedMark } from '../../internal/forms-a/marks'\n\nexport type ChoiceCardArrangement = 'stacked' | 'inline'\n\nexport interface ChoiceCardProps {\n /** Standalone or multi-choice use; inside a ChoiceCardGroup the group decides. */\n selected?: boolean\n onSelect?: () => void\n /** Key of the card inside a ChoiceCardGroup. */\n value?: string\n label: string\n description?: string\n icon?: ReactNode\n arrangement?: ChoiceCardArrangement\n available?: boolean\n unavailableReason?: string\n /** Small tag next to the name (e.g. \"recommended\"). */\n trailing?: ReactNode\n className?: string\n}\n\ninterface GroupShape {\n arrangement: ChoiceCardArrangement\n}\nconst InGroup = createContext<GroupShape | null>(null)\n\ninterface Parts {\n props: ChoiceCardProps\n checked: boolean\n labelId: string\n descId: string\n}\n\n/** Inner layout shared by the radio and toggle renderings. */\nfunction Face({ props, checked, labelId, descId }: Parts) {\n const blocked = props.available === false\n const text = blocked ? (props.unavailableReason ?? props.description) : props.description\n const arrangement = props.arrangement ?? 'stacked'\n return (\n <>\n {props.icon ? (\n <span className=\"ty-choice-card__well\" aria-hidden=\"true\">\n {props.icon}\n </span>\n ) : null}\n <span className=\"ty-choice-card__body\">\n <span className=\"ty-choice-card__title\">\n <span id={labelId} className=\"ty-choice-card__name\">\n {props.label}\n </span>\n {props.trailing ? <span className=\"ty-choice-card__trailing\">{props.trailing}</span> : null}\n </span>\n {text ? (\n <span id={descId} className={arrangement === 'inline' || blocked ? 'ty-choice-card__description' : 'ty-visually-hidden'}>\n {text}\n </span>\n ) : null}\n </span>\n <SelectedMark shown={checked} />\n </>\n )\n}\n\n/** Selectable card for pickers (spec: wave-2/choice-card.md). */\nexport function ChoiceCard(props: ChoiceCardProps) {\n const group = useContext(InGroup)\n const ids = useId()\n const labelId = `${ids}-l`\n const descId = `${ids}-d`\n const blocked = props.available === false\n const hasText = Boolean(blocked ? (props.unavailableReason ?? props.description) : props.description)\n const arrangement = props.arrangement ?? group?.arrangement ?? 'stacked'\n const common = {\n className: cx('ty-choice-card', props.className),\n 'data-arrangement': arrangement,\n 'data-unavailable': blocked || undefined,\n 'aria-labelledby': labelId,\n 'aria-describedby': hasText ? descId : undefined,\n }\n const faceProps = { ...props, arrangement }\n // Tooltip with the reason (RAC does not forward `title`).\n const buttonRef = useRef<HTMLButtonElement>(null)\n useDomAttributes(buttonRef, { title: !group && blocked ? props.unavailableReason : undefined })\n\n if (group) {\n return (\n <Radio {...common} value={props.value ?? props.label} isDisabled={blocked}>\n {({ isSelected }) => <Face props={faceProps} checked={isSelected} labelId={labelId} descId={descId} />}\n </Radio>\n )\n }\n\n const checked = Boolean(props.selected)\n return (\n <ToggleButton\n {...common}\n isSelected={checked}\n aria-disabled={blocked || undefined}\n ref={buttonRef}\n onChange={() => {\n if (!blocked) props.onSelect?.()\n }}\n >\n <Face props={faceProps} checked={checked} labelId={labelId} descId={descId} />\n </ToggleButton>\n )\n}\n\nexport interface ChoiceCardGroupProps {\n label: string\n value: string | null\n onChange: (value: string) => void\n arrangement?: ChoiceCardArrangement\n orientation?: 'horizontal' | 'vertical'\n children: ReactNode\n className?: string\n}\n\n/** Single-choice set of ChoiceCards (APG Radio Group). */\nexport function ChoiceCardGroup({ label, value, onChange, arrangement = 'stacked', orientation = 'vertical', children, className }: ChoiceCardGroupProps) {\n return (\n <RadioGroup\n className={cx('ty-choice-card-group', className)}\n value={value}\n onChange={onChange}\n orientation={orientation}\n data-arrangement={arrangement}\n >\n <Label className=\"ty-choice-card-group__label\">{label}</Label>\n <div className=\"ty-choice-card-group__cards\">\n <InGroup.Provider value={{ arrangement }}>{children}</InGroup.Provider>\n </div>\n </RadioGroup>\n )\n}\n","import { Children, isValidElement, type ReactNode } from 'react'\nimport { ToggleButton } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { requestHaptic } from '../../internal/haptics'\n\nexport type ChoiceTileShape = 'pill' | 'control' | 'card'\n\nexport interface ChoiceTileProps {\n selected: boolean\n onPress?: () => void\n /** Accessible name; required when the content is not text. */\n label?: string\n disabled?: boolean\n shape?: ChoiceTileShape\n haptic?: boolean\n /** The caller draws its own selected treatment (never colour alone). */\n customSelection?: boolean\n children: ReactNode\n className?: string\n /** Key within a ToggleButtonGroup. */\n id?: string\n}\n\n/** True when some text node is present in the content (then it can name the tile). */\nfunction carriesText(node: ReactNode): boolean {\n return Children.toArray(node).some((child) => {\n if (typeof child === 'string') return child.trim().length > 0\n if (typeof child === 'number') return true\n if (isValidElement<{ children?: ReactNode; 'aria-hidden'?: unknown }>(child)) {\n return child.props['aria-hidden'] ? false : carriesText(child.props.children)\n }\n return false\n })\n}\n\n/** Toggle primitive wrapping caller-drawn content (spec: wave-2/choice-tile.md). */\nexport function ChoiceTile({ selected, onPress, label, disabled, shape = 'control', haptic = true, customSelection, children, className, id }: ChoiceTileProps) {\n devWarning(!label && !carriesText(children), 'ChoiceTile: icon-only content needs `label`.')\n return (\n <ToggleButton\n id={id}\n className={cx('ty-choice-tile', className)}\n isSelected={selected}\n isDisabled={disabled}\n aria-label={label}\n data-shape={shape}\n data-own-selection={customSelection || undefined}\n onChange={() => {\n if (haptic) requestHaptic('light')\n onPress?.()\n }}\n >\n {children}\n </ToggleButton>\n )\n}\n","import { Check } from 'lucide-react'\nimport { useId, useRef, type CSSProperties, type ReactNode } from 'react'\nimport { Radio, RadioGroup, type RadioRenderProps } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useDomAttributes } from '../../internal/dom'\nimport type { IconComponent } from '../../internal/types'\n\nexport interface ChoiceGridOption {\n value: string\n /** Flag, emoji or glyph; decorative (the label carries the meaning). */\n symbol?: string\n label: string\n}\n\nexport interface ChoiceGridProps {\n title: string\n icon?: IconComponent\n options: ChoiceGridOption[]\n value: string\n onChange: (value: string) => void\n columns?: 2 | 3 | 4\n arrangement?: 'inline' | 'stacked'\n busy?: boolean\n className?: string\n}\n\n/** Body of one tile, as a function of the radio's render state. */\nconst tileBody =\n (option: ChoiceGridOption) =>\n (state: RadioRenderProps): ReactNode => [\n option.symbol ? (\n <span key=\"s\" className=\"ty-choice-grid__symbol\" aria-hidden=\"true\">\n {option.symbol}\n </span>\n ) : null,\n <span key=\"l\" className=\"ty-choice-grid__label\">\n {option.label}\n </span>,\n state.isSelected ? <Check key=\"c\" className=\"ty-choice-grid__check\" aria-hidden=\"true\" focusable=\"false\" /> : null,\n ]\n\nfunction Heading({ id, title, Icon }: { id: string; title: string; Icon?: IconComponent }) {\n return (\n <div className=\"ty-choice-grid__header\">\n {Icon && <Icon className=\"ty-choice-grid__icon\" aria-hidden=\"true\" focusable=\"false\" />}\n <span id={id} className=\"ty-choice-grid__title\">\n {title}\n </span>\n </div>\n )\n}\n\n/** Titled grid of mutually exclusive short options (spec: wave-2/choice-grid.md). */\nexport function ChoiceGrid(props: ChoiceGridProps) {\n const headingId = useId()\n const host = useRef<HTMLDivElement>(null)\n const locked = props.busy === true\n useDomAttributes(host, { 'aria-busy': locked ? 'true' : undefined })\n // Only real changes reach the host, and none while busy.\n const pick = (next: string) => void (!locked && next !== props.value && props.onChange(next))\n const layout = { '--ty-choice-grid-columns': String(props.columns ?? 2) } as CSSProperties\n\n return (\n <RadioGroup\n ref={host}\n className={cx('ty-choice-grid', props.className)}\n aria-labelledby={headingId}\n orientation=\"horizontal\"\n value={props.value}\n onChange={pick}\n isDisabled={locked}\n data-arrangement={props.arrangement ?? 'inline'}\n style={layout}\n >\n <Heading id={headingId} title={props.title} Icon={props.icon} />\n <div className=\"ty-choice-grid__cells\">\n {props.options.map((option) => (\n <Radio key={option.value} value={option.value} className=\"ty-choice-grid__cell\">\n {tileBody(option)}\n </Radio>\n ))}\n </div>\n </RadioGroup>\n )\n}\n","import { Check, X } from 'lucide-react'\nimport { useState, type KeyboardEvent } from 'react'\nimport { Button as AriaButton, Checkbox, CheckboxGroup, Input, Label, TextField } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { categoricalVar } from '../../internal/forms-a/marks'\nimport { useMessages } from '../../internal/provider'\n\nexport interface ChipItem {\n id: string\n name: string\n code?: string\n /** Categorical token index 1 to 8 (small marker). */\n marker?: number\n /** Created by the person; only these can be removed. */\n custom?: boolean\n}\n\nexport interface ChipGroupStrings {\n selected: (count: number) => string\n selectAll: string\n clear: string\n empty: string\n loading: string\n addPlaceholder: string\n addLabel: string\n remove: (name: string) => string\n}\n\nexport interface ChipGroupProps {\n items: ChipItem[]\n selectedIds: string[]\n onSelectionChange: (ids: string[]) => void\n allowCustom?: boolean\n onItemsChange?: (items: ChipItem[]) => void\n showSummary?: boolean\n loading?: boolean\n label: string\n strings?: Partial<ChipGroupStrings>\n disabled?: boolean\n className?: string\n}\n\n/**\n * Id derived from typed text: canonical composition, case-insensitive, runs\n * of white space as one dash. Combining marks are kept, since in many\n * scripts they distinguish words.\n */\nexport function chipIdFromText(text: string): string {\n return text.normalize('NFC').trim().toLowerCase().replace(/\\s+/gu, '-')\n}\n\ninterface Pending {\n items: ChipItem[]\n selected: string[]\n}\n\n/** Folds typed entries into the item list and the selection. */\nfunction absorb(entries: string[], state: Pending): Pending {\n let { items, selected } = state\n for (const raw of entries) {\n const name = raw.trim()\n if (!name) continue\n const id = chipIdFromText(name)\n if (!items.some((it) => it.id === id)) items = [...items, { id, name, custom: true }]\n if (!selected.includes(id)) selected = [...selected, id]\n }\n return { items, selected }\n}\n\nfunction ChipFace({ item }: { item: ChipItem }) {\n return (\n <>\n <span className=\"ty-chip-group__tick\" aria-hidden=\"true\">\n <Check focusable=\"false\" />\n </span>\n {item.marker ? <span className=\"ty-chip-group__marker\" aria-hidden=\"true\" style={categoricalVar('--ty-chip-marker', item.marker)} /> : null}\n {item.code ? <span className=\"ty-chip-group__code\">{item.code}</span> : null}\n <span className=\"ty-chip-group__name\">{item.name}</span>\n </>\n )\n}\n\n/** Multiple selection among chips, with bulk actions and custom entries (spec: wave-2/chip-group.md). */\nexport function ChipGroup(props: ChipGroupProps) {\n const base = useMessages().chipGroup\n const s: ChipGroupStrings = { ...base, ...props.strings }\n const [draft, setDraft] = useState('')\n const { items, selectedIds } = props\n\n const publish = (next: Pending) => {\n if (next.items !== items) props.onItemsChange?.(next.items)\n if (next.selected !== selectedIds) props.onSelectionChange(next.selected)\n }\n const commit = (text: string) => {\n publish(absorb(text.split(','), { items, selected: selectedIds }))\n }\n const onDraft = (value: string) => {\n const cut = value.lastIndexOf(',')\n if (cut === -1) return setDraft(value)\n commit(value.slice(0, cut))\n setDraft(value.slice(cut + 1))\n }\n const removeItem = (id: string) => {\n props.onItemsChange?.(items.filter((it) => it.id !== id))\n if (selectedIds.includes(id)) props.onSelectionChange(selectedIds.filter((x) => x !== id))\n }\n const onAddKey = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n e.preventDefault()\n commit(draft)\n setDraft('')\n } else if (e.key === 'Backspace' && draft === '') {\n const last = [...items].reverse().find((it) => it.custom)\n if (last) removeItem(last.id)\n }\n }\n\n let body\n if (props.loading) body = <p className=\"ty-chip-group__note\">{s.loading}</p>\n else if (!items.length && !props.allowCustom) body = <p className=\"ty-chip-group__note\">{s.empty}</p>\n else\n body = (\n <div className=\"ty-chip-group__row\">\n {items.map((item) => (\n <span key={item.id} className=\"ty-chip-group__slot\" data-custom={item.custom || undefined}>\n <Checkbox value={item.id} className=\"ty-chip-group__chip\">\n <ChipFace item={item} />\n </Checkbox>\n {item.custom ? (\n <AriaButton className=\"ty-chip-group__remove\" aria-label={s.remove(item.name)} onPress={() => removeItem(item.id)}>\n <X aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n ) : null}\n </span>\n ))}\n {props.allowCustom ? (\n <TextField className=\"ty-chip-group__add\" value={draft} onChange={onDraft} onBlur={() => (draft.trim() ? (commit(draft), setDraft('')) : undefined)} aria-label={s.addLabel}>\n <Input className=\"ty-chip-group__add-input\" placeholder={s.addPlaceholder} onKeyDown={onAddKey} />\n </TextField>\n ) : null}\n </div>\n )\n\n return (\n <CheckboxGroup\n className={cx('ty-chip-group', props.className)}\n value={selectedIds}\n onChange={props.onSelectionChange}\n isDisabled={props.disabled}\n data-loading={props.loading || undefined}\n >\n <Label className=\"ty-chip-group__label\">{props.label}</Label>\n {props.showSummary !== false && !props.loading ? (\n <div className=\"ty-chip-group__summary\">\n <span className=\"ty-chip-group__count\" role=\"status\" aria-live=\"polite\">\n {s.selected(selectedIds.length)}\n </span>\n <AriaButton className=\"ty-chip-group__bulk\" onPress={() => props.onSelectionChange(items.map((it) => it.id))}>\n {s.selectAll}\n </AriaButton>\n <AriaButton className=\"ty-chip-group__bulk\" onPress={() => props.onSelectionChange([])}>\n {s.clear}\n </AriaButton>\n </div>\n ) : null}\n {body}\n </CheckboxGroup>\n )\n}\n","import { useId } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Checkbox, CheckboxGroup } from '../checkbox/Checkbox'\nimport { ChoiceCard, ChoiceCardGroup } from '../choice-card/ChoiceCard'\n\nexport type FlagSet = Record<string, boolean>\n\nexport interface FlagSetPreset {\n id: string\n label: string\n description?: string\n values: FlagSet\n}\n\nexport interface FlagSetPickerProps {\n values: FlagSet\n onChange: (values: FlagSet) => void\n /** Visible label per key; also the order and the set of keys. */\n labels: Record<string, string>\n descriptions?: Record<string, string>\n presets?: FlagSetPreset[]\n presetId?: string | null\n onPresetChange?: (id: string | null) => void\n label: string\n presetsLabel?: string\n optionsLabel?: string\n className?: string\n}\n\n/** One option row derived from the labels (which also fix the order). */\ntype Row = { key: string; text: string; hint?: string; on: boolean }\n\nfunction rowsOf(props: FlagSetPickerProps): Row[] {\n return Object.entries(props.labels).map(([key, text]) => ({ key, text, hint: props.descriptions?.[key], on: Boolean(props.values[key]) }))\n}\n\n/**\n * Reconciles a new checked list with the rows: the single row whose state\n * differs is the edit (a group reports one toggle at a time).\n */\nfunction toggledRow(rows: Row[], checked: readonly string[]): Row | undefined {\n const now = new Set(checked)\n return rows.find((row) => row.on !== now.has(row.key))\n}\n\nfunction PresetChoices({ props, name }: { props: FlagSetPickerProps; name: string }) {\n const list = props.presets ?? []\n if (list.length === 0) return null\n const choose = (id: string) => {\n const preset = list.find((candidate) => candidate.id === id)\n if (!preset) return\n props.onChange({ ...preset.values })\n props.onPresetChange?.(preset.id)\n }\n return (\n <ChoiceCardGroup className=\"ty-flag-set__presets\" label={name} arrangement=\"inline\" value={props.presetId ?? null} onChange={choose}>\n {list.map((preset) => (\n <ChoiceCard key={preset.id} value={preset.id} label={preset.label} description={preset.description} />\n ))}\n </ChoiceCardGroup>\n )\n}\n\n/** Named on/off options with optional presets (spec: wave-2/flag-set-picker.md). */\nexport function FlagSetPicker(props: FlagSetPickerProps) {\n const words = useMessages().flagSetPicker\n const headId = useId()\n const rows = rowsOf(props)\n\n // A manual edit changes one key and leaves any preset.\n const edit = (checked: string[]) => {\n const row = toggledRow(rows, checked)\n if (!row) return\n props.onChange({ ...props.values, [row.key]: !row.on })\n props.onPresetChange?.(null)\n }\n\n return (\n <div className={cx('ty-flag-set', props.className)} role=\"group\" aria-labelledby={headId}>\n <span className=\"ty-flag-set__title\" id={headId}>\n {props.label}\n </span>\n <PresetChoices props={props} name={props.presetsLabel ?? words.presets} />\n <CheckboxGroup label={props.optionsLabel ?? words.options} value={rows.filter((r) => r.on).map((r) => r.key)} onChange={edit}>\n {rows.map((row) => (\n <Checkbox key={row.key} value={row.key} label={row.text} description={row.hint} />\n ))}\n </CheckboxGroup>\n </div>\n )\n}\n","import { Palette, Search } from 'lucide-react'\nimport { useEffect, useId, useMemo, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'\nimport { Button as AriaButton, Dialog, Modal, ModalOverlay } from 'react-aria-components'\nimport { presets, printThemePresets, type ThemeConfig } from '@datatechsolutions/tympan-tokens'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { useTheme, type ThemeDensity, type ThemeMode } from '../../internal/theme'\nimport { SegmentedControl } from '../segmented-control/SegmentedControl'\n\n/** One theme in the palette. `id` is the `data-ty-theme` value. */\nexport interface ThemePaletteTheme {\n id: string\n label: string\n /** Matched by the search but not shown. */\n keywords?: string[]\n}\n\nexport interface ThemePaletteGroup {\n id: string\n heading: string\n themes: ThemePaletteTheme[]\n}\n\nexport interface ThemePaletteProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n /** Theme groups; defaults to the built-in presets and every book style (`themePaletteGroups`). */\n groups?: ThemePaletteGroup[]\n /** Localised name of a theme id (defaults to the theme's own label). */\n labelFor?: (id: string) => string\n /** localStorage key of the recently applied themes; `null` turns the recent group off. */\n recentKey?: string | null\n className?: string\n}\n\nconst RECENT_DEFAULT = 'ty-theme-palette-recent'\n\n/** Groups of every theme the tokens package ships: the UI presets, then the book styles. */\nexport function themePaletteGroups(headings: { interface: string; print: string }): ThemePaletteGroup[] {\n const toTheme = (p: ThemeConfig): ThemePaletteTheme => ({ id: p.name, label: p.label ?? p.name, keywords: [p.name] })\n return [\n { id: 'interface', heading: headings.interface, themes: presets.map(toTheme) },\n { id: 'print', heading: headings.print, themes: printThemePresets.map(toTheme) },\n ]\n}\n\nconst fold = (s: string) => s.normalize('NFD').replace(/\\p{Diacritic}/gu, '').toLocaleLowerCase()\n\n/**\n * Fuzzy score of `text` for `query`: 0 when the query's characters do not all appear in order; higher\n * for a prefix, a word start, then contiguous runs.\n */\nexport function fuzzyScore(text: string, query: string): number {\n const t = fold(text)\n const q = fold(query.trim())\n if (!q) return 1\n if (t.startsWith(q)) return 1000 - t.length\n const at = t.indexOf(q)\n if (at >= 0) return (/[\\s\\-(]/.test(t[at - 1] ?? ' ') ? 800 : 600) - at\n let score = 0\n let run = 0\n let i = 0\n for (const ch of q) {\n const found = t.indexOf(ch, i)\n if (found < 0) return 0\n run = found === i ? run + 1 : 1\n score += run * 2 + (/[\\s\\-(]/.test(t[found - 1] ?? ' ') ? 3 : 0)\n i = found + 1\n }\n return score\n}\n\nfunction readRecent(key: string | null): string[] {\n if (!key) return []\n try {\n const v = JSON.parse(localStorage.getItem(key) ?? '[]')\n return Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : []\n } catch {\n return []\n }\n}\n\nfunction writeRecent(key: string | null, id: string) {\n if (!key) return\n try {\n localStorage.setItem(key, JSON.stringify([id, ...readRecent(key).filter((x) => x !== id)].slice(0, 5)))\n } catch {\n /* storage unavailable */\n }\n}\n\n/** Paper, ink and accent of a theme, drawn by the theme's own tokens (a tiny theme scope). */\nexport function ThemeSwatch({ theme, mode, className }: { theme: string; mode?: 'light' | 'dark'; className?: string }) {\n return (\n <span className={cx('ty-theme-swatch', className)} data-ty-theme={theme} data-ty-mode={mode} aria-hidden=\"true\">\n <span className=\"ty-theme-swatch__ink\" />\n <span className=\"ty-theme-swatch__accent\" />\n </span>\n )\n}\n\ninterface Row {\n key: string\n theme: ThemePaletteTheme\n group: string\n}\n\n/**\n * Command-palette theme picker (spec: this file). Moving the highlight previews the theme on the whole app;\n * Enter applies it, Escape restores the theme the palette opened with. Mode and density sit below the list.\n * Needs a ThemeProvider; book-style themes need `@datatechsolutions/tympan-tokens/print-themes.css`.\n */\nexport function ThemePalette(props: ThemePaletteProps) {\n const copy = useMessages().themePalette\n const th = useTheme()\n const listId = useId()\n const optionPrefix = useId()\n const inputRef = useRef<HTMLInputElement>(null)\n const recentKey = props.recentKey === undefined ? RECENT_DEFAULT : props.recentKey\n const groups = useMemo(\n () => props.groups ?? themePaletteGroups({ interface: copy.groupInterface, print: copy.groupPrint }),\n [props.groups, copy.groupInterface, copy.groupPrint],\n )\n const label = (t: ThemePaletteTheme) => props.labelFor?.(t.id) ?? t.label\n const [query, setQuery] = useState('')\n const [cursor, setCursor] = useState(0)\n const [recent, setRecent] = useState<string[]>([])\n const [announce, setAnnounce] = useState('')\n const initial = useRef<string | null>(null)\n const applied = useRef(false)\n\n // On open: remember the theme to restore, reset the search, put the highlight on the current theme.\n useEffect(() => {\n if (!props.open) return\n initial.current = th.theme\n applied.current = false\n setQuery('')\n setRecent(readRecent(recentKey))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.open])\n\n const sections = useMemo(() => {\n const all = groups.flatMap((g) => g.themes.map((theme) => ({ theme, group: g.id })))\n const q = query.trim()\n if (q) {\n const hits = all\n .map((r) => ({ ...r, score: Math.max(fuzzyScore(label(r.theme), q), ...(r.theme.keywords ?? []).map((k) => fuzzyScore(k, q) * 0.9)) }))\n .filter((r) => r.score > 0)\n .sort((a, b) => b.score - a.score)\n return [{ id: 'results', heading: copy.results(hits.length), rows: hits.map((r) => ({ key: `r-${r.theme.id}`, theme: r.theme, group: r.group })) }]\n }\n const out: Array<{ id: string; heading: string; count?: number; rows: Row[] }> = []\n const recents = recent.map((id) => all.find((r) => r.theme.id === id)).filter((r): r is (typeof all)[number] => !!r)\n if (recents.length) out.push({ id: 'recent', heading: copy.recent, rows: recents.map((r) => ({ key: `recent-${r.theme.id}`, ...r })) })\n for (const g of groups) out.push({ id: g.id, heading: g.heading, count: g.themes.length, rows: g.themes.map((theme) => ({ key: `${g.id}-${theme.id}`, theme, group: g.id })) })\n return out\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [groups, query, recent, copy, props.labelFor])\n\n const rows = sections.flatMap((s) => s.rows)\n const at = rows.length ? Math.min(cursor, rows.length - 1) : -1\n const current = rows[at]\n const optionId = (r: Row) => `${optionPrefix}-${r.key}`.replace(/[^\\w-]/g, '_')\n\n // When the list changes (open, typing), point at the current theme if it is listed, else the first row.\n useEffect(() => {\n if (!props.open) return\n const i = rows.findIndex((r) => r.theme.id === (initial.current ?? th.theme))\n setCursor(query.trim() ? 0 : Math.max(0, i))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.open, query, sections])\n\n useEffect(() => {\n if (current) document.getElementById(optionId(current))?.scrollIntoView({ block: 'nearest' })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current?.key])\n\n const preview = (i: number) => {\n const r = rows[i]\n setCursor(i)\n if (r && r.theme.id !== th.theme) th.setTheme(r.theme.id)\n }\n\n const apply = (r: Row | undefined) => {\n if (!r) return\n th.setTheme(r.theme.id)\n applied.current = true\n writeRecent(recentKey, r.theme.id)\n setAnnounce(copy.applied(label(r.theme)))\n props.onOpenChange(false)\n }\n\n const close = () => {\n // Closing without applying (Escape, backdrop) restores the theme the palette opened with.\n if (!applied.current && initial.current && th.theme !== initial.current) th.setTheme(initial.current)\n props.onOpenChange(false)\n }\n\n const onKey = (e: KeyboardEvent<HTMLInputElement>) => {\n const step = (to: number) => {\n e.preventDefault()\n if (rows.length) preview((to + rows.length) % rows.length)\n }\n switch (e.key) {\n case 'ArrowDown':\n return step(at + 1)\n case 'ArrowUp':\n return step(at - 1)\n case 'PageDown':\n return step(Math.min(rows.length - 1, at + 8))\n case 'PageUp':\n return step(Math.max(0, at - 8))\n case 'Home':\n if (e.ctrlKey || !query) return step(0)\n return\n case 'End':\n if (e.ctrlKey || !query) return step(rows.length - 1)\n return\n case 'Enter':\n e.preventDefault()\n return apply(current)\n case 'Escape':\n e.preventDefault()\n e.stopPropagation()\n return close()\n }\n }\n\n const modes: Array<{ value: ThemeMode; label: string }> = [\n { value: 'system', label: copy.modeSystem },\n { value: 'light', label: copy.modeLight },\n { value: 'dark', label: copy.modeDark },\n ]\n const densities: Array<{ value: ThemeDensity; label: string }> = [\n { value: 'compact', label: copy.densityCompact },\n { value: 'default', label: copy.densityDefault },\n { value: 'comfortable', label: copy.densityComfortable },\n ]\n const previewTheme = current?.theme.id ?? th.theme\n\n return (\n <>\n <ModalOverlay isOpen={props.open} onOpenChange={(o) => !o && close()} isDismissable isKeyboardDismissDisabled className=\"ty-theme-palette__backdrop\">\n <Modal className={cx('ty-theme-palette', props.className)}>\n <Dialog className=\"ty-theme-palette__dialog\" aria-label={copy.label}>\n <div className=\"ty-theme-palette__field\">\n <Search className=\"ty-theme-palette__icon\" aria-hidden=\"true\" />\n <input\n ref={inputRef}\n className=\"ty-theme-palette__input\"\n role=\"combobox\"\n aria-label={copy.label}\n aria-autocomplete=\"list\"\n aria-expanded={rows.length > 0}\n aria-controls={listId}\n aria-activedescendant={current ? optionId(current) : undefined}\n placeholder={copy.placeholder}\n value={query}\n autoFocus\n autoComplete=\"off\"\n spellCheck={false}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={onKey}\n />\n </div>\n <div className=\"ty-theme-palette__body\">\n <div id={listId} role=\"listbox\" aria-label={copy.label} className=\"ty-theme-palette__list\">\n {sections.map((s) => (\n <div key={s.id} role=\"group\" aria-labelledby={`${listId}-${s.id}`} className=\"ty-theme-palette__group\">\n <div id={`${listId}-${s.id}`} className=\"ty-theme-palette__heading\" role=\"presentation\">\n <span>{s.heading}</span>\n {s.count !== undefined ? <span className=\"ty-theme-palette__count\">{copy.count(s.count)}</span> : null}\n </div>\n {s.rows.map((r) => {\n const i = rows.indexOf(r)\n return (\n <div\n key={r.key}\n id={optionId(r)}\n role=\"option\"\n aria-selected={i === at}\n aria-current={r.theme.id === initial.current ? 'true' : undefined}\n className=\"ty-theme-palette__option\"\n onPointerMove={() => i !== at && preview(i)}\n onClick={() => apply(r)}\n >\n <ThemeSwatch theme={r.theme.id} mode={th.resolvedMode} />\n <span className=\"ty-theme-palette__name\">{label(r.theme)}</span>\n <code className=\"ty-theme-palette__id\">{r.theme.id}</code>\n </div>\n )\n })}\n </div>\n ))}\n {!rows.length ? <p className=\"ty-theme-palette__empty\">{copy.noResults(query.trim())}</p> : null}\n </div>\n <aside className=\"ty-theme-palette__preview\" aria-label={copy.preview} data-ty-theme={previewTheme} data-ty-mode={th.resolvedMode}>\n <span className=\"ty-theme-palette__preview-eyebrow\">{copy.preview}</span>\n <span className=\"ty-theme-palette__preview-title\">{current ? label(current.theme) : ''}</span>\n <span className=\"ty-theme-palette__preview-body\">{copy.sample}</span>\n <span className=\"ty-theme-palette__preview-bar\">\n <span />\n <span />\n <span />\n </span>\n <span className=\"ty-theme-palette__preview-button\">Aa</span>\n </aside>\n </div>\n <div className=\"ty-theme-palette__foot\">\n <SegmentedControl label={copy.mode} size=\"compact\" options={modes} value={th.mode} onChange={(m) => th.setMode(m as ThemeMode)} />\n <SegmentedControl label={copy.density} size=\"compact\" options={densities} value={th.density} onChange={(d) => th.setDensity(d as ThemeDensity)} />\n <span className=\"ty-theme-palette__hints\" aria-hidden=\"true\">\n <kbd>↑↓</kbd> {copy.hints.move} <kbd>↵</kbd> {copy.hints.apply} <kbd>esc</kbd> {copy.hints.revert}\n </span>\n </div>\n <div className=\"ty-visually-hidden\" aria-live=\"polite\">\n {query.trim() ? (rows.length ? copy.results(rows.length) : copy.noResults(query.trim())) : ''}\n </div>\n </Dialog>\n </Modal>\n </ModalOverlay>\n <div className=\"ty-visually-hidden\" role=\"status\" aria-live=\"polite\">\n {announce}\n </div>\n </>\n )\n}\n\nexport interface ThemePaletteTriggerProps extends Omit<ThemePaletteProps, 'open' | 'onOpenChange'> {\n /** Also open with ⌘/Ctrl+Shift+P and, outside text fields, the T key. Default true. */\n shortcut?: boolean\n /** Hide the theme name (swatch only); the name stays the accessible label. */\n compact?: boolean\n children?: ReactNode\n}\n\n/** Button showing the current theme's swatch and name; opens the ThemePalette. */\nexport function ThemePaletteTrigger({ shortcut = true, compact = false, className, ...rest }: ThemePaletteTriggerProps) {\n const copy = useMessages().themePalette\n const th = useTheme()\n const [open, setOpen] = useState(false)\n const all = useMemo(() => (rest.groups ?? themePaletteGroups({ interface: '', print: '' })).flatMap((g) => g.themes), [rest.groups])\n const found = all.find((t) => t.id === th.theme)\n const name = rest.labelFor?.(th.theme) ?? found?.label ?? th.theme\n\n useEffect(() => {\n if (!shortcut) return\n const on = (e: globalThis.KeyboardEvent) => {\n const typing = (e.target as HTMLElement | null)?.closest?.('input, textarea, select, [contenteditable=\"true\"], [role=\"combobox\"]')\n if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'p') {\n e.preventDefault()\n setOpen(true)\n } else if (!typing && !e.metaKey && !e.ctrlKey && !e.altKey && (e.key === 't' || e.key === 'T')) {\n setOpen(true)\n }\n }\n addEventListener('keydown', on)\n return () => removeEventListener('keydown', on)\n }, [shortcut])\n\n return (\n <>\n <AriaButton\n className={cx('ty-theme-palette-trigger', className)}\n data-compact={compact || undefined}\n aria-label={copy.trigger(name)}\n aria-keyshortcuts={shortcut ? 'Control+Shift+P Meta+Shift+P T' : undefined}\n aria-haspopup=\"dialog\"\n onPress={() => setOpen(true)}\n >\n <ThemeSwatch theme={th.theme} mode={th.resolvedMode} />\n {compact ? <Palette className=\"ty-icon\" aria-hidden=\"true\" /> : <span className=\"ty-theme-palette-trigger__name\">{name}</span>}\n </AriaButton>\n <ThemePalette {...rest} open={open} onOpenChange={setOpen} />\n </>\n )\n}\n","import type { CSSProperties } from 'react'\nimport { ToggleButton, ToggleButtonGroup, type Key } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\n/** Index into the categorical palette (`--ty-categorical-1` … `-8`), §2.3. */\nexport type CategoryMarker = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8\n\nexport interface CategoryItem {\n key: string\n /** Reported selection; defaults to `key`. */\n value?: string\n code: string\n name: string\n marker: CategoryMarker\n disabled?: boolean\n}\n\nexport interface CategoryTabsProps {\n items: CategoryItem[]\n selected: string | null\n /** Receives the item's value (or key); null when `allowNone` clears the filter. */\n onSelect: (value: string | null) => void\n label: string\n allowNone?: boolean\n className?: string\n}\n\nconst markerStyle = (marker: CategoryMarker) => ({ '--ty-category-marker': `var(--ty-categorical-${marker})` }) as CSSProperties\n\n/** Name without its leading code (\"PT Portugal\" → \"Portugal\"); the full name when nothing is left. */\nfunction nameWithoutCode(code: string, name: string): string {\n const trimmed = name.trim()\n const after = trimmed.slice(code.length)\n // Only a whole leading code counts: \"PT Portugal\" yes, \"Brasil\" for \"BR\" no.\n if (!trimmed.startsWith(code) || /^[\\p{L}\\p{N}]/u.test(after)) return trimmed\n return after.replace(/^[\\s:·,-]+/, '') || trimmed\n}\n\nconst reportedValue = (item: CategoryItem) => item.value ?? item.key\n\n/**\n * Filter chooser as a single-choice group of toggle buttons (APG Radio Group\n * semantics through RAC ToggleButtonGroup), spec: wave-2/category-tabs.md.\n */\nexport function CategoryTabs({ items, selected, onSelect, label, allowNone = false, className }: CategoryTabsProps) {\n const change = (keys: Set<Key>) => {\n const next = [...keys][0]\n if (next != null) {\n if (String(next) !== selected) onSelect(String(next))\n }\n else if (allowNone) onSelect(null)\n }\n return (\n // Activation stays inside the row: an enclosing clickable card never sees it.\n <div className={cx('ty-category-tabs', className)} onClick={(e) => e.stopPropagation()} onKeyDown={(e) => e.stopPropagation()}>\n <ToggleButtonGroup\n aria-label={label}\n className=\"ty-category-tabs__row\"\n selectionMode=\"single\"\n disallowEmptySelection={!allowNone}\n selectedKeys={selected == null ? [] : [selected]}\n onSelectionChange={change}\n >\n {items.map((item) => (\n <ToggleButton key={item.key} id={reportedValue(item)} isDisabled={item.disabled} className=\"ty-category-tabs__item\" style={markerStyle(item.marker)}>\n <span className=\"ty-category-tabs__marker\" aria-hidden=\"true\" />\n <strong className=\"ty-category-tabs__code\">{item.code}</strong>{\" \"}\n <span className=\"ty-category-tabs__name\">{nameWithoutCode(item.code, item.name)}</span>\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n </div>\n )\n}\n\nexport interface CategoryLabelProps {\n code: string\n /** Full name; becomes the accessible name. */\n name?: string\n marker: CategoryMarker\n size?: 'small' | 'medium'\n className?: string\n}\n\n/** Static colour marker plus code. */\nexport function CategoryLabel({ code, name, marker, size = 'medium', className }: CategoryLabelProps) {\n return (\n <span className={cx('ty-category-label', className)} data-size={size} style={markerStyle(marker)}>\n <span className=\"ty-category-tabs__marker\" aria-hidden=\"true\" />\n <span aria-hidden={name ? true : undefined}>{code}</span>\n {name ? <span className=\"ty-visually-hidden\">{name}</span> : null}\n </span>\n )\n}\n","import { useId, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { Input, TextField as AriaTextField, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { FieldLine, joinIds } from '../../internal/forms-b/parts'\nimport { asciiDigits, isDigit, localeDigits, withLocaleDigits } from '../../internal/forms-b/digits'\nimport { useMessages } from '../../internal/provider'\n\nexport type CurrencyFieldSize = 'small' | 'medium' | 'large' | 'display'\n\nexport interface CurrencyFieldProps {\n /** Canonical value: digits, optional dot and decimals, never grouped; \"\" when empty. */\n value: string\n onValueChange?: (value: string) => void\n label: string\n /** ISO 4217 code; omit for plain counts. */\n currency?: string\n decimals?: number\n locale?: string\n size?: CurrencyFieldSize\n hint?: ReactNode\n error?: string\n required?: boolean\n disabled?: boolean\n readOnly?: boolean\n placeholder?: string\n name?: string\n id?: string\n className?: string\n}\n\ninterface Separators {\n group: string\n decimal: string\n}\n\nfunction separatorsOf(locale: string): Separators {\n const parts = new Intl.NumberFormat(locale).formatToParts(1234567.5)\n return {\n group: parts.find((p) => p.type === 'group')?.value ?? ',',\n decimal: parts.find((p) => p.type === 'decimal')?.value ?? '.',\n }\n}\n\nfunction symbolOf(currency: string, locale: string): string {\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).formatToParts(0).find((p) => p.type === 'currency')?.value ?? currency\n } catch {\n return currency\n }\n}\n\nfunction currencyName(currency: string, locale: string): string {\n try {\n return new Intl.DisplayNames(locale, { type: 'currency' }).of(currency) ?? currency\n } catch {\n return currency\n }\n}\n\n/** Reading of typed text: integer digits, whether a decimal mark was typed, fraction digits. */\ninterface Reading {\n whole: string\n mark: boolean\n fraction: string\n}\n\n/** Keeps digits and the first locale decimal mark; drops extra fraction digits and leading zeros. */\nfunction readTyped(raw: string, decimal: string, decimals: number): Reading {\n const out: Reading = { whole: '', mark: false, fraction: '' }\n for (const ch of asciiDigits(raw)) {\n if (ch >= '0' && ch <= '9') {\n if (!out.mark) out.whole += ch\n else if (out.fraction.length < decimals) out.fraction += ch\n } else if (ch === decimal && decimals > 0 && !out.mark) {\n out.mark = true\n }\n }\n out.whole = out.whole.replace(/^0+(?=\\d)/, '')\n if (out.mark && !out.whole) out.whole = '0'\n return out\n}\n\n/** Canonical, machine-readable form of a reading (\"1500000.5\"). */\nconst canonicalOf = (r: Reading) => (r.whole === '' && !r.mark ? '' : r.fraction ? `${r.whole}.${r.fraction}` : r.whole)\n\n/** Parses a canonical value back into a reading. */\nfunction readCanonical(value: string, decimals: number): Reading {\n const [whole = '', fraction = ''] = value.split('.')\n return { whole: whole.replace(/\\D/g, ''), mark: value.includes('.') && decimals > 0, fraction: fraction.replace(/\\D/g, '').slice(0, decimals) }\n}\n\n/** Groups the integer part with the locale separator. */\nfunction display(r: Reading, sep: Separators, digits: string[]): string {\n const grouped = r.whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, sep.group)\n return withLocaleDigits(r.mark ? `${grouped}${sep.decimal}${r.fraction}` : grouped, digits)\n}\n\n/** Count of meaningful characters (digits and the decimal mark) before `pos`. */\nfunction meaningfulBefore(text: string, pos: number, decimal: string): number {\n let n = 0\n for (const ch of text.slice(0, pos)) if (isDigit(ch) || ch === decimal) n++\n return n\n}\n\n/** Position in `text` just after the `count`-th meaningful character. */\nfunction positionAfter(text: string, count: number, decimal: string): number {\n if (count <= 0) return 0\n let seen = 0\n for (let i = 0; i < text.length; i++) {\n const ch = text[i]!\n if (isDigit(ch) || ch === decimal) seen++\n if (seen === count) return i + 1\n }\n return text.length\n}\n\n/**\n * Money or count entry with live grouping in the locale's separators; reports\n * a plain canonical number (spec: wave-2/currency-field.md).\n */\nexport function CurrencyField(props: CurrencyFieldProps) {\n const m = useMessages()\n const { locale: contextLocale } = useLocale()\n const locale = props.locale ?? contextLocale\n const decimals = Math.max(0, props.decimals ?? 2)\n const sep = useMemo(() => separatorsOf(locale), [locale])\n const digits = useMemo(() => localeDigits(locale), [locale])\n const inputRef = useRef<HTMLInputElement>(null)\n const pendingCaret = useRef<number | null>(null)\n const lastReported = useRef<string | null>(null)\n const base = useId()\n\n // Local text keeps a trailing decimal mark the canonical value cannot carry.\n const [draft, setDraft] = useState<Reading>(() => readCanonical(props.value, decimals))\n const shown = props.value === lastReported.current ? draft : readCanonical(props.value, decimals)\n const text = display(shown, sep, digits)\n\n useLayoutEffect(() => {\n const el = inputRef.current\n if (el && pendingCaret.current != null && document.activeElement === el) {\n const at = positionAfter(el.value, pendingCaret.current, sep.decimal)\n el.setSelectionRange(at, at)\n }\n pendingCaret.current = null\n })\n\n const onTyped = (raw: string) => {\n const el = inputRef.current\n const caret = el?.selectionStart ?? raw.length\n pendingCaret.current = meaningfulBefore(raw, caret, sep.decimal)\n const reading = readTyped(raw, sep.decimal, decimals)\n // Leading zeros dropped before the caret shift it left.\n const typedWhole = raw.split(sep.decimal)[0]!.replace(/\\D/g, '')\n const dropped = typedWhole.length - reading.whole.length\n if (dropped > 0) pendingCaret.current = Math.max(0, pendingCaret.current - dropped)\n const canonical = canonicalOf(reading)\n setDraft(reading)\n lastReported.current = canonical\n props.onValueChange?.(canonical)\n }\n\n const ids = {\n label: `${base}-label`,\n hint: props.hint != null && !props.error ? `${base}-hint` : undefined,\n error: props.error ? `${base}-error` : undefined,\n currency: props.currency ? `${base}-currency` : undefined,\n }\n\n return (\n <div className={cx('ty-currency-field', props.className)} data-size={props.size ?? 'medium'} data-invalid={props.error ? true : undefined}>\n <AriaTextField\n value={text}\n onChange={onTyped}\n isDisabled={props.disabled}\n isReadOnly={props.readOnly}\n isRequired={props.required}\n isInvalid={!!props.error}\n name={props.name}\n id={props.id}\n aria-labelledby={ids.label}\n aria-describedby={joinIds(ids.hint, ids.currency, ids.error)}\n className=\"ty-currency-field__field\"\n >\n <FieldLine kind=\"label\" id={ids.label}>\n {props.label}\n </FieldLine>\n {ids.hint ? (\n <FieldLine kind=\"hint\" id={ids.hint}>\n {props.hint}\n </FieldLine>\n ) : null}\n <div className=\"ty-currency-field__box\">\n {props.currency ? (\n <span className=\"ty-currency-field__symbol\" aria-hidden=\"true\">\n {symbolOf(props.currency, locale)}\n </span>\n ) : null}\n <Input\n ref={inputRef}\n className=\"ty-currency-field__input\"\n inputMode={decimals === 0 ? 'numeric' : 'decimal'}\n autoComplete=\"off\"\n placeholder={props.placeholder}\n />\n </div>\n {ids.currency ? (\n <span id={ids.currency} className=\"ty-visually-hidden\">\n {m.currencyField.currency(currencyName(props.currency!, locale))}\n </span>\n ) : null}\n {ids.error ? (\n <FieldLine kind=\"error\" id={ids.error}>\n {props.error}\n </FieldLine>\n ) : null}\n </AriaTextField>\n </div>\n )\n}\n","import { CalendarDate, getLocalTimeZone, today as todayIn } from '@internationalized/date'\nimport { CalendarDays, ChevronLeft, ChevronRight } from 'lucide-react'\nimport { useId, useState, type ReactNode } from 'react'\nimport {\n Button as AriaButton,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DialogTrigger,\n useLocale,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { FieldLine, FloatSurface, MonthGrid, StepperHeader, joinIds, monthKey } from '../../internal/forms-b/parts'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport interface DateFieldProps {\n value: Date | null\n onChange: (date: Date | null) => void\n label: string\n /** Hides the visible label (it stays the accessible name). */\n hideLabel?: boolean\n placeholder?: string\n minValue?: Date\n maxValue?: Date\n disallowFuture?: boolean\n yearRange?: { from: number; to: number }\n locale?: string\n isInvalid?: boolean\n errorText?: string\n hint?: ReactNode\n disabled?: boolean\n className?: string\n}\n\ntype View = 'days' | 'months'\n\nconst fromDate = (d: Date) => new CalendarDate(d.getFullYear(), d.getMonth() + 1, d.getDate())\nconst toDate = (c: CalendarDate) => new Date(c.year, c.month - 1, c.day)\nconst earlier = (a?: CalendarDate, b?: CalendarDate) => (!a ? b : !b ? a : a.compare(b) <= 0 ? a : b)\n\n/** The allowed range as calendar dates (disallowFuture tightens the upper bound to today). */\nfunction useBounds(p: DateFieldProps) {\n const now = todayIn(getLocalTimeZone())\n const min = p.minValue ? fromDate(p.minValue) : undefined\n const max = earlier(p.maxValue ? fromDate(p.maxValue) : undefined, p.disallowFuture ? now : undefined)\n const within = (d: CalendarDate) => (!min || d.compare(min) >= 0) && (!max || d.compare(max) <= 0)\n return { now, min, max, within }\n}\n\n/**\n * A calendar date chosen from a trigger that opens a day grid, with a\n * month-and-year view for distant dates (spec: wave-2/date-field.md).\n */\nexport function DateField(props: DateFieldProps) {\n const m = useMessages()\n const { locale: contextLocale } = useLocale()\n const locale = props.locale ?? contextLocale\n const t = m.dateField\n const { now, min, max, within } = useBounds(props)\n const [open, setOpen] = useState(false)\n const [view, setView] = useState<View>('days')\n const [focused, setFocused] = useState<CalendarDate>(() => (props.value ? fromDate(props.value) : now))\n const base = useId()\n const labelId = `${base}-label`\n const textId = `${base}-text`\n const hintId = props.hint != null && !props.errorText ? `${base}-hint` : undefined\n const errorId = props.errorText ? `${base}-error` : undefined\n const invalid = !!props.isInvalid || !!props.errorText\n\n const openChange = (next: boolean) => {\n if (next) {\n // Every opening starts on the value's (or today's) month, in day view.\n setFocused(props.value ? fromDate(props.value) : now)\n setView('days')\n }\n setOpen(next)\n }\n const choose = (d: CalendarDate | null) => {\n props.onChange(d ? toDate(d) : null)\n setOpen(false)\n }\n\n const longDate = new Intl.DateTimeFormat(locale, { dateStyle: 'long' })\n const monthYear = new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' })\n const heading = monthYear.format(toDate(focused))\n\n const years = (() => {\n const from = Math.max(props.yearRange?.from ?? now.year - 10, min?.year ?? -Infinity)\n const to = Math.min(props.yearRange?.to ?? now.year + 3, max?.year ?? Infinity)\n const list: number[] = []\n for (let y = to; y >= from; y--) list.push(y)\n return list\n })()\n const monthAllowed = (key: string) => {\n const [y, mo] = key.split('-').map(Number) as [number, number]\n const first = new CalendarDate(y, mo, 1)\n const last = first.add({ months: 1 }).subtract({ days: 1 })\n return (!max || first.compare(max) <= 0) && (!min || last.compare(min) >= 0)\n }\n const setYear = (year: number) => setFocused((f) => f.set({ year }))\n\n const calendar = (\n <Calendar\n className=\"ty-date-field__calendar\"\n aria-label={props.label}\n value={props.value ? fromDate(props.value) : null}\n onChange={(d) => choose(d as CalendarDate)}\n focusedValue={focused}\n onFocusChange={(d) => setFocused(d as CalendarDate)}\n minValue={min}\n maxValue={max}\n autoFocus\n >\n <div className=\"ty-fb-stepper\">\n <AriaButton slot=\"previous\" className=\"ty-fb-nav\" aria-label={t.previousMonth}>\n <ChevronLeft className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n <AriaButton slot={null} className=\"ty-date-field__heading\" onPress={() => setView('months')} aria-label={t.chooseMonth(heading)}>\n <span aria-live=\"polite\">{heading}</span>\n </AriaButton>\n <AriaButton slot=\"next\" className=\"ty-fb-nav\" aria-label={t.nextMonth}>\n <ChevronRight className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n </div>\n <CalendarGrid className=\"ty-date-field__grid\" weekdayStyle=\"short\">\n <CalendarGridHeader>{(day) => <CalendarHeaderCell className=\"ty-date-field__weekday\">{day}</CalendarHeaderCell>}</CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <CalendarCell date={date} className=\"ty-date-field__day\">\n {({ formattedDate, isToday }) => (\n <span className=\"ty-date-field__day-number\" data-today={isToday || undefined}>\n {formattedDate}\n </span>\n )}\n </CalendarCell>\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </Calendar>\n )\n const todayRow = (\n <div className=\"ty-date-field__footer\">\n <Button variant=\"quiet\" size=\"compact\" disabled={!within(now)} onPress={() => choose(now)}>\n {t.today}\n </Button>\n </div>\n )\n\n const monthView = (\n <div className=\"ty-date-field__months\">\n <StepperHeader\n heading={focused.year}\n previousLabel={t.previousYear}\n nextLabel={t.nextYear}\n previousDisabled={!!min && focused.year <= min.year}\n nextDisabled={!!max && focused.year >= max.year}\n onPrevious={() => setYear(focused.year - 1)}\n onNext={() => setYear(focused.year + 1)}\n />\n <MonthGrid\n year={focused.year}\n locale={locale}\n label={t.months}\n isAvailable={monthAllowed}\n selected={props.value ? monthKey(props.value.getFullYear(), props.value.getMonth()) : null}\n onChoose={(key) => {\n const mo = Number(key.slice(5))\n setFocused((f) => f.set({ month: mo, day: 1 }))\n setView('days')\n }}\n onYearStep={(d) => setYear(focused.year + d)}\n />\n {years.length > 1 ? (\n <div className=\"ty-fb-chips\" role=\"group\" aria-label={t.years}>\n {years.map((y) => (\n <AriaButton key={y} className=\"ty-fb-chip\" aria-pressed={y === focused.year} onPress={() => setYear(y)}>\n {y}\n </AriaButton>\n ))}\n </div>\n ) : null}\n <Button variant=\"quiet\" size=\"compact\" onPress={() => setView('days')}>\n {t.backToDays}\n </Button>\n </div>\n )\n\n return (\n <div className={cx('ty-date-field', props.className)} data-invalid={invalid || undefined}>\n <FieldLine kind=\"label\" id={labelId}>\n <span className={props.hideLabel ? 'ty-visually-hidden' : undefined}>{props.label}</span>\n </FieldLine>\n {hintId ? (\n <FieldLine kind=\"hint\" id={hintId}>\n {props.hint}\n </FieldLine>\n ) : null}\n <DialogTrigger isOpen={open} onOpenChange={openChange}>\n <AriaButton\n className=\"ty-fb-trigger\"\n isDisabled={props.disabled}\n aria-labelledby={`${labelId} ${textId}`}\n aria-describedby={joinIds(hintId, errorId)}\n data-invalid={invalid || undefined}\n >\n <span className=\"ty-fb-trigger__glyph\" aria-hidden=\"true\">\n <CalendarDays />\n </span>\n <span id={textId} className=\"ty-fb-trigger__text\" data-placeholder={props.value ? undefined : true}>\n {props.value ? longDate.format(props.value) : (props.placeholder ?? t.placeholder)}\n </span>\n </AriaButton>\n <FloatSurface labelledBy={labelId} className=\"ty-date-field__surface\">\n {view === 'days' ? (\n <>\n {calendar}\n {todayRow}\n </>\n ) : (\n monthView\n )}\n </FloatSurface>\n </DialogTrigger>\n {errorId ? (\n <FieldLine kind=\"error\" id={errorId}>\n {props.errorText}\n </FieldLine>\n ) : null}\n </div>\n )\n}\n","import { TriangleAlert } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport type FormActionsAlign = 'end' | 'between' | 'start'\nexport type FormActionsEmphasis = 'default' | 'destructive'\n\nexport interface FormActionsProps {\n cancelLabel?: string\n saveLabel?: string\n onCancel?: () => void\n /** Without it the primary button submits the enclosing form. */\n onSave?: () => void\n saveDisabled?: boolean\n saving?: boolean\n emphasis?: FormActionsEmphasis\n align?: FormActionsAlign\n /** Optional name of the group. */\n label?: string\n /** Free row: replaces the preset buttons. */\n children?: ReactNode\n className?: string\n}\n\ninterface PresetSlots {\n secondary: ReactNode\n primary: ReactNode\n}\n\nfunction usePresetSlots(p: FormActionsProps): PresetSlots | null {\n const m = useMessages()\n if (p.children != null) return null\n const destructive = p.emphasis === 'destructive'\n const busy = !!p.saving\n return {\n secondary:\n p.cancelLabel != null ? (\n <Button variant=\"secondary\" disabled={busy} onPress={() => p.onCancel?.()}>\n {p.cancelLabel}\n </Button>\n ) : null,\n primary:\n p.saveLabel != null ? (\n <Button\n variant={destructive ? 'danger' : 'primary'}\n type={p.onSave ? 'button' : 'submit'}\n disabled={!!p.saveDisabled}\n busy={busy}\n busyLabel={m.formActions.saving}\n leadingIcon={destructive ? <TriangleAlert /> : undefined}\n onPress={p.onSave ? () => p.onSave?.() : undefined}\n className=\"ty-form-actions__primary\"\n >\n {p.saveLabel}\n </Button>\n ) : null,\n }\n}\n\n/** The closing row of a form or dialog (spec: wave-2/form-actions.md). DOM order: secondary, then primary. */\nexport function FormActions(props: FormActionsProps) {\n const slots = usePresetSlots(props)\n return (\n <div\n role=\"group\"\n aria-label={props.label}\n className={cx('ty-form-actions', props.className)}\n data-align={props.align ?? 'end'}\n data-emphasis={props.emphasis ?? 'default'}\n >\n {slots ? (\n <>\n {slots.secondary}\n {slots.primary}\n </>\n ) : (\n props.children\n )}\n </div>\n )\n}\n","import { useId, type FormEvent, type ReactNode } from 'react'\nimport { Form } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { FormActions } from '../form-actions/FormActions'\n\ntype SubmitHandler = (event: FormEvent<HTMLFormElement>) => void\ntype HeadingLevel = 2 | 3 | 4 | 5 | 6\n\n/** Wraps a submit handler so the browser never navigates when one is given. */\nconst withoutReload = (handler?: SubmitHandler): SubmitHandler | undefined =>\n handler &&\n ((event) => {\n event.preventDefault()\n handler(event)\n })\n\nexport interface FormContainerProps {\n onSubmit?: SubmitHandler\n children: ReactNode\n className?: string\n id?: string\n 'aria-label'?: string\n 'aria-labelledby'?: string\n}\n\n/** A real form with the vertical rhythm between fields (spec: wave-2/form-layout.md). */\nexport function FormContainer({ children, className, onSubmit, ...aria }: FormContainerProps) {\n return (\n <Form {...aria} className={cx('ty-form-layout', className)} data-part=\"container\" onSubmit={withoutReload(onSubmit)}>\n {children}\n </Form>\n )\n}\n\nexport interface FieldGridProps {\n /** Maximum columns on wide screens. */\n columns?: 1 | 2\n children: ReactNode\n className?: string\n}\n\n/** Two columns from 640 px, one below; children may span both with FieldGridItem. */\nexport function FieldGrid({ columns = 2, children, className }: FieldGridProps) {\n return (\n <div className={cx('ty-form-layout', className)} data-part=\"grid\" data-columns={columns}>\n {children}\n </div>\n )\n}\n\n/** A cell of FieldGrid; `full` spans both columns. */\nexport function FieldGridItem({ span = 'half', children }: { span?: 'full' | 'half'; children: ReactNode }) {\n return (\n <div className=\"ty-form-layout__cell\" data-span={span}>\n {children}\n </div>\n )\n}\n\n/** Fields and a button on one line; wraps on narrow screens. */\nexport function InlineRow({ children, className }: { children: ReactNode; className?: string }) {\n return (\n <div className={cx('ty-form-layout', className)} data-part=\"inline\">\n {children}\n </div>\n )\n}\n\nexport interface FormSectionProps {\n title?: ReactNode\n description?: ReactNode\n headingLevel?: HeadingLevel\n /** Render as fieldset/legend (a set of related choices). */\n asFieldset?: boolean\n children: ReactNode\n className?: string\n}\n\nfunction SectionHead({ level, id, title, description }: { level: HeadingLevel; id: string; title?: ReactNode; description?: ReactNode }) {\n const Tag = `h${level}` as const\n return (\n <>\n {title != null ? (\n <Tag id={id} className=\"ty-form-layout__title\">\n {title}\n </Tag>\n ) : null}\n {description != null ? <p className=\"ty-form-layout__description\">{description}</p> : null}\n </>\n )\n}\n\n/** Titled group of fields; sections are separated by dividers. */\nexport function FormSection({ title, description, headingLevel = 3, asFieldset = false, children, className }: FormSectionProps) {\n const titleId = useId()\n if (asFieldset) {\n return (\n <fieldset className={cx('ty-form-layout', className)} data-part=\"section\">\n {title != null ? <legend className=\"ty-form-layout__title\">{title}</legend> : null}\n {description != null ? <p className=\"ty-form-layout__description\">{description}</p> : null}\n <div className=\"ty-form-layout__body\">{children}</div>\n </fieldset>\n )\n }\n return (\n <div role=\"group\" aria-labelledby={title != null ? titleId : undefined} className={cx('ty-form-layout', className)} data-part=\"section\">\n <SectionHead level={headingLevel} id={titleId} title={title} description={description} />\n <div className=\"ty-form-layout__body\">{children}</div>\n </div>\n )\n}\n\nexport interface FramedFormProps {\n onSubmit: SubmitHandler\n title?: string\n subtitle?: string\n icon?: ReactNode\n submitLabel: string\n cancelLabel?: string\n onCancel?: () => void\n busy?: boolean\n submitDisabled?: boolean\n showHeader?: boolean\n showFooter?: boolean\n footerExtra?: ReactNode\n children: ReactNode\n className?: string\n}\n\n/** A sheet holding a form: header (icon, title, subtitle), body and footer actions. */\nexport function FramedForm(props: FramedFormProps) {\n const titleId = useId()\n const headerShown = props.showHeader !== false && !!props.title\n const cancelShown = props.cancelLabel != null && props.onCancel != null\n return (\n <Form\n className={cx('ty-form-layout', props.className)}\n data-part=\"framed\"\n aria-labelledby={props.title ? titleId : undefined}\n aria-busy={props.busy || undefined}\n onSubmit={withoutReload(props.onSubmit)}\n >\n {headerShown ? (\n <div className=\"ty-form-layout__header\">\n {props.icon ? (\n <span className=\"ty-form-layout__icon\" aria-hidden=\"true\">\n {props.icon}\n </span>\n ) : null}\n <div>\n <h2 id={titleId} className=\"ty-form-layout__framed-title\">\n {props.title}\n </h2>\n {props.subtitle ? <p className=\"ty-form-layout__description\">{props.subtitle}</p> : null}\n </div>\n </div>\n ) : props.title ? (\n <span id={titleId} className=\"ty-visually-hidden\">\n {props.title}\n </span>\n ) : null}\n <div className=\"ty-form-layout__framed-body\">{props.children}</div>\n {props.showFooter === false ? null : (\n <div className=\"ty-form-layout__footer\">\n {props.footerExtra ? <div className=\"ty-form-layout__extra\">{props.footerExtra}</div> : null}\n <FormActions\n saveLabel={props.submitLabel}\n cancelLabel={cancelShown ? props.cancelLabel : undefined}\n onCancel={props.onCancel}\n saving={props.busy}\n saveDisabled={props.submitDisabled}\n />\n </div>\n )}\n </Form>\n )\n}\n","import { Camera, Check, LoaderCircle } from 'lucide-react'\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react'\nimport { Button as AriaButton, DropZone, useLocale, type DropZoneProps } from 'react-aria-components'\n\ntype DropEvent = Parameters<NonNullable<DropZoneProps['onDrop']>>[0]\nimport { cx } from '../../internal/cx'\nimport { useDomAttributes } from '../../internal/dom'\nimport { useMessages } from '../../internal/provider'\n\nexport interface UploadResult {\n ok: boolean\n key?: string\n error?: string\n}\n\nexport interface ImagePickerProps {\n value?: string | null\n fallbackText?: string\n label?: string\n shape?: 'circle' | 'rounded'\n size?: 'md' | 'lg'\n accept?: string[]\n maxBytes?: number\n upload: (file: File) => Promise<UploadResult>\n onUploaded?: (key: string) => void\n hint?: ReactNode\n messages?: Partial<{ wrongType: string; tooLarge: string; failed: string }>\n /** Also accept a dropped file (the button path always exists). */\n droppable?: boolean\n disabled?: boolean\n className?: string\n}\n\nexport const DEFAULT_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/webp']\nconst MIB = 1024 * 1024\n\ntype Phase = { kind: 'idle' } | { kind: 'busy' } | { kind: 'done' } | { kind: 'error'; text: string }\n\n/** Size limit in the locale's unit wording and digits (binary multiples, shown with the SI unit names Intl knows). */\nfunction sizeText(bytes: number, locale: string): string {\n const whole = bytes % MIB === 0\n return new Intl.NumberFormat(locale, { style: 'unit', unit: whole ? 'megabyte' : 'kilobyte', unitDisplay: 'short', maximumFractionDigits: 0 }).format(\n whole ? bytes / MIB : Math.round(bytes / 1024),\n )\n}\n\nfunction previewOf(file: File): string | null {\n try {\n return typeof URL.createObjectURL === 'function' ? URL.createObjectURL(file) : null\n } catch {\n return null\n }\n}\n\n/**\n * Picture chooser with local checks, instant preview and host upload\n * (spec: wave-2/image-picker.md).\n */\nexport function ImagePicker(props: ImagePickerProps) {\n const m = useMessages().imagePicker\n const { locale } = useLocale()\n const accept = props.accept ?? DEFAULT_IMAGE_TYPES\n const maxBytes = props.maxBytes ?? 5 * MIB\n const fileRef = useRef<HTMLInputElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const [phase, setPhase] = useState<Phase>({ kind: 'idle' })\n const [preview, setPreview] = useState<string | null>(null)\n const base = useId()\n const hintId = props.hint != null ? `${base}-hint` : undefined\n const statusId = `${base}-status`\n const busy = phase.kind === 'busy'\n const shown = preview ?? props.value ?? null\n\n useEffect(() => () => {\n if (preview?.startsWith('blob:')) URL.revokeObjectURL?.(preview)\n }, [preview])\n\n useDomAttributes(triggerRef, { 'aria-busy': busy ? 'true' : undefined })\n\n const reject = (text: string) => setPhase({ kind: 'error', text })\n\n const take = async (file: File) => {\n if (!accept.includes(file.type)) return reject(props.messages?.wrongType ?? m.wrongType)\n if (file.size > maxBytes) return reject(props.messages?.tooLarge ?? m.tooLarge(sizeText(maxBytes, locale)))\n const before = preview\n setPreview(previewOf(file))\n setPhase({ kind: 'busy' })\n try {\n const result = await props.upload(file)\n if (result.ok) {\n setPhase({ kind: 'done' })\n if (result.key != null) props.onUploaded?.(result.key)\n } else {\n setPreview(before)\n reject(result.error || (props.messages?.failed ?? m.failed))\n }\n } catch (err) {\n setPreview(before)\n reject((err instanceof Error && err.message) || (props.messages?.failed ?? m.failed))\n }\n }\n\n const statusText = phase.kind === 'error' ? phase.text : phase.kind === 'busy' ? m.uploading : phase.kind === 'done' ? m.updated : ''\n const describedBy = [hintId, phase.kind === 'error' ? statusId : undefined].filter(Boolean).join(' ') || undefined\n\n const trigger = (\n <AriaButton\n ref={triggerRef}\n className=\"ty-image-picker__trigger\"\n aria-label={props.label ?? m.change}\n aria-describedby={describedBy}\n isDisabled={props.disabled || busy}\n onPress={() => fileRef.current?.click()}\n >\n <span className=\"ty-image-picker__frame\" aria-hidden=\"true\">\n {shown ? <img className=\"ty-image-picker__image\" src={shown} alt=\"\" /> : <span className=\"ty-image-picker__initials\">{props.fallbackText}</span>}\n </span>\n <span className=\"ty-image-picker__badge\" aria-hidden=\"true\">\n {busy ? <LoaderCircle className=\"ty-icon ty-image-picker__spin\" /> : phase.kind === 'done' ? <Check className=\"ty-icon\" /> : <Camera className=\"ty-icon\" />}\n </span>\n </AriaButton>\n )\n\n const onDrop = async (e: DropEvent) => {\n if (props.disabled || busy) return\n for (const item of e.items) {\n if (item.kind === 'file') {\n await take(await item.getFile())\n return\n }\n }\n }\n\n return (\n <div className={cx('ty-image-picker', props.className)} data-shape={props.shape ?? 'circle'} data-size={props.size ?? 'lg'} data-phase={phase.kind}>\n {props.droppable ? (\n <DropZone className=\"ty-image-picker__drop\" onDrop={onDrop} isDisabled={props.disabled} aria-label={props.label ?? m.change}>\n {trigger}\n </DropZone>\n ) : (\n trigger\n )}\n <input\n ref={fileRef}\n type=\"file\"\n className=\"ty-visually-hidden\"\n accept={accept.join(',')}\n tabIndex={-1}\n aria-hidden=\"true\"\n onChange={(e) => {\n const file = e.target.files?.[0]\n // Reset so choosing the same file again still fires a change.\n e.target.value = ''\n if (file) void take(file)\n }}\n />\n {props.hint != null ? (\n <p id={hintId} className=\"ty-image-picker__hint\">\n {props.hint}\n </p>\n ) : null}\n <p id={statusId} className=\"ty-image-picker__status\" role=\"status\" data-tone={phase.kind}>\n {statusText}\n </p>\n </div>\n )\n}\n","import { Check, Languages } from 'lucide-react'\nimport { useState } from 'react'\nimport { ListBox, ListBoxItem, type Key } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { Drawer } from '../drawer/Drawer'\nimport { ModalDialog } from '../modal-dialog/ModalDialog'\n\nexport interface LocaleEntry {\n code: string\n /** Name of the language in that language (\"Português\"). */\n nativeName: string\n shortCode?: string\n /** Decorative flag (emoji or short text). */\n flag?: string\n}\n\nexport interface LocalePickerProps {\n locales: LocaleEntry[]\n value: string\n /** Called with a different locale; the host applies it. */\n onChange: (code: string) => void\n presentation?: 'drawer' | 'dialog'\n open?: boolean\n onOpenChange?: (open: boolean) => void\n title?: string\n showTrigger?: boolean\n className?: string\n}\n\nconst shortOf = (l: LocaleEntry) => l.shortCode ?? l.code.split('-')[0]!.toUpperCase()\n\n/** The list of locales, each written in its own language. */\nfunction LocaleList(props: { locales: LocaleEntry[]; value: string; label: string; grid: boolean; onPick: (code: string) => void }) {\n const pick = (keys: 'all' | Set<Key>) => {\n if (keys === 'all') return\n // Re-activating the current locale empties the selection: treat it as \"keep\".\n const [key] = [...keys]\n props.onPick(key != null ? String(key) : props.value)\n }\n return (\n <ListBox\n aria-label={props.label}\n className=\"ty-locale-picker__list\"\n data-layout={props.grid ? 'grid' : 'list'}\n layout={props.grid ? 'grid' : 'stack'}\n items={props.locales.map((l) => ({ ...l, id: l.code }))}\n selectionMode=\"single\"\n selectedKeys={[props.value]}\n onSelectionChange={pick}\n autoFocus\n >\n {(entry) => (\n <ListBoxItem id={entry.code} textValue={entry.nativeName} className=\"ty-locale-picker__option\">\n {({ isSelected }) => (\n <>\n {entry.flag ? (\n <span className=\"ty-locale-picker__flag\" aria-hidden=\"true\">\n {entry.flag}\n </span>\n ) : null}\n <span className=\"ty-locale-picker__name\" lang={entry.code}>\n {entry.nativeName}\n </span>\n <span className=\"ty-locale-picker__code\" aria-hidden=\"true\">\n {shortOf(entry)}\n </span>\n <Check className=\"ty-icon ty-locale-picker__check\" aria-hidden=\"true\" focusable=\"false\" data-shown={isSelected || undefined} />\n </>\n )}\n </ListBoxItem>\n )}\n </ListBox>\n )\n}\n\n/** Interface language chooser (spec: wave-2/locale-picker.md). */\nexport function LocalePicker(props: LocalePickerProps) {\n const t = useMessages().localePicker\n const title = props.title ?? t.title\n const [innerOpen, setInnerOpen] = useState(false)\n const open = props.open ?? innerOpen\n const setOpen = (next: boolean) => {\n if (props.open === undefined) setInnerOpen(next)\n props.onOpenChange?.(next)\n }\n const current = props.locales.find((l) => l.code === props.value)\n const currentName = current?.nativeName ?? props.value\n const pick = (code: string) => {\n if (code !== props.value) props.onChange(code)\n setOpen(false)\n }\n const dialog = props.presentation === 'dialog'\n const body = (\n <div className=\"ty-locale-picker__body\">\n <LocaleList locales={props.locales} value={props.value} label={t.list} grid={dialog} onPick={pick} />\n <p className=\"ty-locale-picker__footer\">{t.current(currentName, current ? shortOf(current) : props.value)}</p>\n </div>\n )\n\n return (\n <span className={cx('ty-locale-picker', props.className)}>\n {props.showTrigger === false ? null : (\n <Button\n variant=\"quiet\"\n leadingIcon={<Languages />}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onPress={() => setOpen(true)}\n className=\"ty-locale-picker__trigger\"\n >\n <span className=\"ty-visually-hidden\">{t.trigger(title, currentName)}</span>\n <span aria-hidden=\"true\">{current?.flag ?? (current ? shortOf(current) : props.value)}</span>\n </Button>\n )}\n {dialog ? (\n <ModalDialog isOpen={open} onOpenChange={setOpen} title={title} width=\"regular\">\n {body}\n </ModalDialog>\n ) : (\n <Drawer open={open} onOpenChange={setOpen} title={title} placement=\"end\" width=\"medium\">\n {body}\n </Drawer>\n )}\n </span>\n )\n}\n","import { CalendarDays } from 'lucide-react'\nimport { useMemo, useState, type ReactNode } from 'react'\nimport { Button as AriaButton, DialogTrigger, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { FloatSurface, MonthGrid, StepperHeader, type FloatSide } from '../../internal/forms-b/parts'\nimport { useMessages } from '../../internal/provider'\n\nexport interface MonthFieldProps {\n /** \"YYYY-MM\", or \"\" for none. */\n value: string\n onChange: (value: string) => void\n /** Months with data, \"YYYY-MM\". */\n availableMonths: string[]\n label: string\n placeholder?: string\n /** Replaces the trigger content; the accessible name stays label plus value. */\n triggerContent?: ReactNode\n /** Borderless trigger for a composite bar. */\n embedded?: boolean\n placement?: FloatSide\n locale?: string\n disabled?: boolean\n className?: string\n}\n\n/** A \"YYYY-MM\" key split into numbers. */\nconst parts = (key: string) => ({ y: Number(key.slice(0, 4)), m: Number(key.slice(5, 7)) })\n\n/** What the month data allows: the years with data (newest first), their bounds and the lookup set. */\nfunction calendarOf(months: string[]) {\n const years = [...new Set(months.map((k) => parts(k).y))].filter(Number.isFinite).sort((a, b) => b - a)\n return {\n years,\n newest: years[0] as number | undefined,\n oldest: years.at(-1),\n has: new Set(months),\n }\n}\n\n/** Keeps a year inside the data years (free when there is no data). */\nconst clampYear = (year: number, low?: number, high?: number) => (low === undefined || high === undefined ? year : Math.min(high, Math.max(low, year)))\n\nfunction YearChips({ years, shown, label, onPick }: { years: number[]; shown: number; label: string; onPick: (y: number) => void }) {\n if (years.length < 2) return null\n return (\n <div className=\"ty-fb-chips\" role=\"group\" aria-label={label}>\n {years.map((y) => (\n <AriaButton key={y} className=\"ty-fb-chip\" aria-pressed={y === shown} onPress={() => onPick(y)}>\n {y}\n </AriaButton>\n ))}\n </div>\n )\n}\n\n/** One month with data, chosen from a year grid (spec: wave-2/month-field.md). */\nexport function MonthField(props: MonthFieldProps) {\n const copy = useMessages().monthField\n const ambient = useLocale().locale\n const lang = props.locale ?? ambient\n const cal = useMemo(() => calendarOf(props.availableMonths), [props.availableMonths])\n const home = props.value ? parts(props.value).y : (cal.newest ?? new Date().getFullYear())\n const [open, setOpen] = useState(false)\n const [shownYear, setShownYear] = useState(home)\n\n const caption = (() => {\n if (!props.value) return props.placeholder ?? copy.placeholder\n const { y, m } = parts(props.value)\n return new Intl.DateTimeFormat(lang, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(Date.UTC(y, m - 1, 15))\n })()\n const move = (by: number) => setShownYear((y) => clampYear(y + by, cal.oldest, cal.newest))\n const toggle = (next: boolean) => {\n if (next) setShownYear(home) // every opening starts on the value's year\n setOpen(next)\n }\n\n const face = props.triggerContent ?? (\n <>\n <span className=\"ty-fb-trigger__glyph\" aria-hidden=\"true\">\n <CalendarDays />\n </span>\n <span className=\"ty-fb-trigger__text\" data-placeholder={props.value ? undefined : true}>\n {caption}\n </span>\n </>\n )\n\n return (\n <DialogTrigger isOpen={open} onOpenChange={toggle}>\n <AriaButton\n className={cx('ty-fb-trigger', 'ty-month-field', props.className)}\n aria-label={`${props.label}, ${caption}`}\n isDisabled={props.disabled}\n data-embedded={props.embedded || undefined}\n >\n {face}\n </AriaButton>\n <FloatSurface label={props.label} side={props.placement ?? 'bottom'}>\n <StepperHeader\n heading={shownYear}\n previousLabel={copy.previousYear}\n nextLabel={copy.nextYear}\n previousDisabled={cal.oldest === undefined || shownYear <= cal.oldest}\n nextDisabled={cal.newest === undefined || shownYear >= cal.newest}\n onPrevious={() => move(-1)}\n onNext={() => move(1)}\n />\n <MonthGrid\n year={shownYear}\n locale={lang}\n label={copy.months}\n selected={props.value || null}\n isAvailable={(key) => cal.has.has(key)}\n onYearStep={move}\n onChoose={(key) => {\n props.onChange(key)\n setOpen(false)\n }}\n />\n <YearChips years={cal.years} shown={shownYear} label={copy.years} onPick={setShownYear} />\n </FloatSurface>\n </DialogTrigger>\n )\n}\n","import { useEffect, useId, useRef, useState, type ReactNode } from 'react'\nimport { Form } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport type { Messages } from '../../internal/messages'\nimport { Button } from '../button/Button'\nimport { Checkbox } from '../checkbox/Checkbox'\nimport { InlineNotice } from '../inline-notice/InlineNotice'\nimport { NativeSelect } from '../native-select/NativeSelect'\nimport { StatusPill } from '../status-pill/StatusPill'\nimport { TextArea } from '../text-area/TextArea'\nimport { TextField } from '../text-field/TextField'\n\ninterface FieldBase {\n key: string\n label: string\n required?: boolean\n help?: string\n}\nexport type RequestField =\n | (FieldBase & { kind: 'text'; placeholder?: string; default?: string })\n | (FieldBase & { kind: 'number'; min?: number; max?: number; step?: number; default?: number })\n | (FieldBase & { kind: 'longText'; rows?: number; default?: string })\n | (FieldBase & { kind: 'choice'; options: { value: string; label: string }[]; default?: string })\n | (FieldBase & { kind: 'boolean'; default?: boolean })\n\nexport interface InputRequest {\n stepId: string\n prompt: string\n description?: ReactNode\n fields: RequestField[]\n submitLabel?: string\n /** null hides the reject button. */\n rejectLabel?: string | null\n tone?: 'info' | 'warning' | 'success' | 'danger'\n}\n\nexport interface RequestDecision {\n approved: boolean\n payload?: Record<string, unknown>\n reason?: string\n}\n\nexport interface SchemaRequestFormProps {\n runId: string\n request: InputRequest\n submit: (runId: string, stepId: string, decision: RequestDecision) => Promise<void>\n onResolved?: (result: { approved: boolean; payload: Record<string, unknown> }) => void\n className?: string\n}\n\ntype Values = Record<string, string | boolean>\ntype Phase = { kind: 'editing' } | { kind: 'sending'; approved: boolean } | { kind: 'resolved'; approved: boolean } | { kind: 'failed'; message: string }\n\nfunction initialValues(fields: RequestField[]): Values {\n const out: Values = {}\n for (const f of fields) out[f.key] = f.kind === 'boolean' ? !!f.default : f.default != null ? String(f.default) : ''\n return out\n}\n\n/** Error text per invalid field (empty object when everything passes). */\nfunction check(fields: RequestField[], values: Values, t: Messages['requestForm']): Record<string, string> {\n const errors: Record<string, string> = {}\n for (const f of fields) {\n const v = values[f.key]\n if (f.kind === 'boolean') {\n if (f.required && v !== true) errors[f.key] = t.required\n continue\n }\n const text = typeof v === 'string' ? v.trim() : ''\n if (!text) {\n if (f.required) errors[f.key] = t.required\n continue\n }\n if (f.kind === 'number') {\n const n = Number(text)\n if (!Number.isFinite(n)) errors[f.key] = t.notNumber\n else if (f.min != null && n < f.min) errors[f.key] = t.atLeast(f.min)\n else if (f.max != null && n > f.max) errors[f.key] = t.atMost(f.max)\n }\n }\n return errors\n}\n\n/** Payload for an approval: typed values, empty strings dropped. */\nfunction payloadOf(fields: RequestField[], values: Values): Record<string, unknown> {\n const out: Record<string, unknown> = {}\n for (const f of fields) {\n const v = values[f.key]\n if (f.kind === 'boolean') out[f.key] = v === true\n else if (typeof v === 'string' && v.trim() !== '') out[f.key] = f.kind === 'number' ? Number(v) : v\n }\n return out\n}\n\n/** One control for one schema entry, chosen by kind. */\nfunction RequestControl(props: { field: RequestField; value: string | boolean; error?: string; locked: boolean; placeholder: string; onValue: (v: string | boolean) => void }) {\n const { field: f, error, locked } = props\n const text = typeof props.value === 'string' ? props.value : ''\n switch (f.kind) {\n case 'boolean':\n return <Checkbox label={f.label} description={f.help} isSelected={props.value === true} onChange={props.onValue} errorMessage={error} disabled={locked} required={f.required} />\n case 'longText':\n return <TextArea label={f.label} hint={f.help} rows={f.rows ?? 3} value={text} onChange={props.onValue} errorMessage={error} disabled={locked} required={f.required} />\n case 'choice':\n return <NativeSelect label={f.label} hint={f.help} options={f.options} placeholder={props.placeholder} value={text} onChange={props.onValue} errorMessage={error} disabled={locked} required={f.required} />\n default:\n return (\n <TextField\n label={f.label}\n hint={f.help}\n inputType={f.kind === 'number' ? 'number' : 'text'}\n placeholder={f.kind === 'text' ? f.placeholder : undefined}\n value={text}\n onChange={props.onValue}\n errorMessage={error}\n disabled={locked}\n required={f.required}\n />\n )\n }\n}\n\n/**\n * A form rendered from a small field schema that answers a paused run's\n * request for input (spec: wave-2/schema-request-form.md).\n */\nexport function SchemaRequestForm({ runId, request, submit, onResolved, className }: SchemaRequestFormProps) {\n const t = useMessages().requestForm\n const [values, setValues] = useState<Values>(() => initialValues(request.fields))\n const [errors, setErrors] = useState<Record<string, string>>({})\n const [phase, setPhase] = useState<Phase>({ kind: 'editing' })\n const inFlight = useRef(false)\n const bodyRef = useRef<HTMLDivElement>(null)\n const focusKey = useRef<string | null>(null)\n const titleId = useId()\n const locked = phase.kind === 'sending' || phase.kind === 'resolved'\n\n useEffect(() => {\n if (!focusKey.current) return\n const target = bodyRef.current?.querySelector<HTMLElement>(`[data-request-key=\"${CSS.escape(focusKey.current)}\"] :is(input, select, textarea)`)\n focusKey.current = null\n target?.focus()\n }, [errors])\n\n const send = async (decision: RequestDecision) => {\n if (inFlight.current || phase.kind === 'resolved') return\n inFlight.current = true\n setPhase({ kind: 'sending', approved: decision.approved })\n try {\n await submit(runId, request.stepId, decision)\n setPhase({ kind: 'resolved', approved: decision.approved })\n onResolved?.({ approved: decision.approved, payload: decision.payload ?? {} })\n } catch (err) {\n setPhase({ kind: 'failed', message: (err instanceof Error && err.message) || t.failed })\n } finally {\n inFlight.current = false\n }\n }\n\n const approve = () => {\n const found = check(request.fields, values, t)\n setErrors(found)\n const first = request.fields.find((f) => found[f.key])\n if (first) {\n focusKey.current = first.key\n return\n }\n void send({ approved: true, payload: payloadOf(request.fields, values) })\n }\n const reject = () => {\n const reason = typeof values.reason === 'string' && values.reason.trim() ? values.reason.trim() : t.defaultReason\n void send({ approved: false, reason })\n }\n\n const sending = phase.kind === 'sending'\n return (\n <section className={cx('ty-request-form', className)} data-tone={request.tone ?? 'info'} aria-labelledby={titleId}>\n <h3 id={titleId} className=\"ty-request-form__prompt\">\n {request.prompt}\n </h3>\n {request.description ? <div className=\"ty-request-form__description\">{request.description}</div> : null}\n {phase.kind === 'failed' ? (\n <InlineNotice tone=\"danger\" urgency=\"assertive\">\n {phase.message}\n </InlineNotice>\n ) : null}\n <Form\n className=\"ty-request-form__form\"\n validationBehavior=\"aria\"\n aria-labelledby={titleId}\n onSubmit={(e) => {\n e.preventDefault()\n approve()\n }}\n >\n <div ref={bodyRef} className=\"ty-request-form__fields\">\n {request.fields.map((field) => (\n <div key={field.key} data-request-key={field.key}>\n <RequestControl\n field={field}\n value={values[field.key] ?? ''}\n error={errors[field.key]}\n locked={locked}\n placeholder={t.choose}\n onValue={(v) => setValues((prev) => ({ ...prev, [field.key]: v }))}\n />\n </div>\n ))}\n </div>\n {phase.kind === 'resolved' ? (\n <p className=\"ty-request-form__resolution\" role=\"status\">\n <StatusPill status={phase.approved ? 'approved' : 'rejected'} label={phase.approved ? t.approved : t.rejected} tone={phase.approved ? 'success' : 'neutral'} />\n <span>{phase.approved ? t.approvedSentence : t.rejectedSentence}</span>\n </p>\n ) : (\n <div className=\"ty-request-form__actions\">\n {request.rejectLabel === null ? null : (\n <Button variant=\"secondary\" disabled={sending} busy={sending && phase.approved === false} busyLabel={t.sending} onPress={reject}>\n {request.rejectLabel ?? t.reject}\n </Button>\n )}\n <Button variant=\"primary\" type=\"submit\" busy={sending && phase.approved} disabled={sending && !phase.approved} busyLabel={t.sending}>\n {request.submitLabel ?? t.submit}\n </Button>\n </div>\n )}\n </Form>\n </section>\n )\n}\n","import { X } from 'lucide-react'\nimport { useContext, useId, useRef, useState, type CSSProperties, type KeyboardEvent, type ReactNode, type RefObject } from 'react'\nimport {\n Button as AriaButton,\n ComboBox,\n ComboBoxStateContext,\n Input,\n ListBox,\n ListBoxItem,\n Popover,\n Tag,\n TagGroup,\n TagList,\n TextField as AriaTextField,\n type Key,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type TagFieldTone = 'neutral' | 'accent' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8\n\nexport interface TagFieldProps {\n value: string[]\n onChange: (next: string[]) => void\n label?: string\n ariaLabel?: string\n placeholder?: string\n suggestions?: string[]\n suggestionLabels?: Record<string, string>\n allowFreeText?: boolean\n /** Normalises an entry (after trimming) or rejects it with null. */\n validate?: (raw: string) => string | null\n max?: number\n disabled?: boolean\n tone?: TagFieldTone\n helperText?: string\n errorText?: string\n removeLabel?: (display: string) => string\n className?: string\n}\n\n/* ---------------------------------------------------------------- gate -- */\n\n/** Why an entry was refused (kept for readability; the field just ignores refusals). */\ntype Verdict = { take: string } | { refuse: 'blank' | 'invalid' | 'duplicate' | 'full' | 'unlisted' }\n\nconst same = (a: string, b: string) => a.localeCompare(b, undefined, { sensitivity: 'accent' }) === 0\n\n/** The gate every entry passes: trim, normalise, then the four refusals in order. */\nfunction judge(raw: string, held: readonly string[], props: TagFieldProps): Verdict {\n const bare = raw.trim()\n if (bare === '') return { refuse: 'blank' }\n const shaped = props.validate ? props.validate(bare) : bare\n if (!shaped) return { refuse: 'invalid' }\n if (held.some((h) => same(h, shaped))) return { refuse: 'duplicate' }\n if (props.max !== undefined && held.length >= props.max) return { refuse: 'full' }\n const closed = props.suggestions && props.allowFreeText === false\n if (closed && !props.suggestions!.includes(shaped)) return { refuse: 'unlisted' }\n return { take: shaped }\n}\n\n/* --------------------------------------------------------------- typing -- */\n\n/**\n * The text being typed. After a commit, the combobox writes the chosen\n * option's text back into the input once; that echo is dropped.\n */\nfunction useTyping() {\n const [typed, setTyped] = useState('')\n const echo = useRef<string | null>(null)\n return {\n typed,\n expectEcho: (text: string) => {\n echo.current = text\n setTyped('')\n },\n receive: (text: string) => {\n const isEcho = echo.current !== null && text === echo.current\n echo.current = null\n setTyped(isEcho ? '' : text)\n },\n }\n}\n\ninterface KeyPlan {\n typed: string\n commitTyped: () => void\n commitOption: (id: string) => void\n dropLast: () => void\n}\n\n/** Input with the commit keys; reads the combobox (if any) to know whether an option is highlighted. */\nfunction TypingInput({ id, holder, plan, inputRef }: { id: string; holder?: string; plan: KeyPlan; inputRef: RefObject<HTMLInputElement | null> }) {\n const combo = useContext(ComboBoxStateContext)\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n const pointed = combo?.isOpen ? combo.selectionManager.focusedKey : null\n const commits = event.key === 'Enter' || event.key === ','\n if (event.key === 'Backspace' && plan.typed === '') return plan.dropLast()\n if (!commits || (event.key === 'Enter' && pointed != null)) return // Enter on an option is the combobox's own\n event.preventDefault()\n if (pointed == null) return plan.commitTyped()\n plan.commitOption(String(pointed))\n combo?.close()\n }\n return <Input id={id} ref={inputRef} className=\"ty-tag-field__typing\" placeholder={holder} onKeyDown={onKeyDown} />\n}\n\n/* ---------------------------------------------------------------- chips -- */\n\nfunction DropChip({ spoken, off }: { spoken: string; off?: boolean }) {\n const nameId = useId()\n return (\n <AriaButton slot=\"remove\" className=\"ty-tag-field__drop\" aria-labelledby={nameId} isDisabled={off}>\n <X className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span id={nameId} className=\"ty-visually-hidden\">\n {spoken}\n </span>\n </AriaButton>\n )\n}\n\nfunction ChipStrip(props: { name: string; chips: Array<{ id: string; text: string }>; off?: boolean; dropName: (text: string) => string; onDrop?: (keys: Set<Key>) => void }) {\n return (\n <TagGroup aria-label={props.name} onRemove={props.onDrop} className=\"ty-tag-field__chips\">\n <TagList items={props.chips} className=\"ty-tag-field__chip-list\">\n {(chip) => (\n <Tag id={chip.id} textValue={chip.text} className=\"ty-tag-field__chip\" isDisabled={props.off}>\n <span className=\"ty-tag-field__chip-text\">{chip.text}</span>\n <DropChip spoken={props.dropName(chip.text)} off={props.off} />\n </Tag>\n )}\n </TagList>\n </TagGroup>\n )\n}\n\n/* ------------------------------------------------------------ component -- */\n\nconst tint = (tone: TagFieldTone): CSSProperties | undefined =>\n typeof tone === 'number' ? ({ '--ty-tag-field-tint': `var(--ty-categorical-${tone})` } as CSSProperties) : undefined\n\n/**\n * Short values typed into removable chips, optionally assisted by (or\n * restricted to) suggestions (spec: wave-2/tag-field.md).\n */\nexport function TagField(props: TagFieldProps) {\n const copy = useMessages().tagField\n const held = props.value\n const tone = props.tone ?? 'neutral'\n const shown = (v: string) => props.suggestionLabels?.[v] ?? v\n const typing = useTyping()\n const inputRef = useRef<HTMLInputElement>(null)\n const wellRef = useRef<HTMLDivElement>(null)\n const root = useId()\n const ids = {\n input: `${root}-in`,\n caption: `${root}-cap`,\n note: props.helperText ? `${root}-note` : undefined,\n fault: props.errorText ? `${root}-fault` : undefined,\n }\n\n const admit = (raw: string) => {\n const verdict = judge(raw, held, props)\n if (!('take' in verdict)) return\n typing.expectEcho(shown(verdict.take))\n props.onChange([...held, verdict.take])\n }\n const plan: KeyPlan = {\n typed: typing.typed,\n commitTyped: () => admit(typing.typed),\n commitOption: admit,\n dropLast: () => {\n if (held.length && !props.disabled) props.onChange(held.slice(0, -1))\n },\n }\n\n const query = typing.typed.trim().toLocaleLowerCase()\n const offers = (props.suggestions ?? []).flatMap((s) => {\n if (held.some((h) => same(h, s))) return []\n const text = shown(s)\n const hit = !query || s.toLocaleLowerCase().includes(query) || text.toLocaleLowerCase().includes(query)\n return hit ? [{ id: s, text }] : []\n })\n\n // The chips sit beside (not inside) the text primitive so the two collections never share state.\n const hostProps = {\n className: 'ty-tag-field__typing-host',\n 'aria-label': props.label ? undefined : props.ariaLabel,\n 'aria-labelledby': props.label ? ids.caption : undefined,\n 'aria-describedby': [ids.note, ids.fault].filter(Boolean).join(' ') || undefined,\n isDisabled: props.disabled || (props.max !== undefined && held.length >= props.max),\n isInvalid: Boolean(props.errorText),\n }\n const input = <TypingInput id={ids.input} holder={props.placeholder} plan={plan} inputRef={inputRef} />\n\n const typingHost: ReactNode = props.suggestions ? (\n <ComboBox\n {...hostProps}\n allowsCustomValue={props.allowFreeText ?? true}\n shouldFocusWrap\n menuTrigger=\"input\"\n inputValue={typing.typed}\n onInputChange={typing.receive}\n items={offers}\n defaultFilter={() => true}\n selectedKey={null}\n onSelectionChange={(key) => key != null && admit(String(key))}\n >\n {input}\n <Popover className=\"ty-tag-field__menu-layer\" offset={4} triggerRef={wellRef}>\n <ListBox className=\"ty-tag-field__menu\" aria-label={copy.suggestions}>\n {(offer: { id: string; text: string }) => (\n <ListBoxItem id={offer.id} textValue={offer.text} className=\"ty-tag-field__choice\">\n {offer.text}\n </ListBoxItem>\n )}\n </ListBox>\n </Popover>\n </ComboBox>\n ) : (\n <AriaTextField {...hostProps} value={typing.typed} onChange={typing.receive}>\n {input}\n </AriaTextField>\n )\n\n const lines: Array<[string | undefined, string | undefined, string]> = [\n [ids.note, props.helperText, 'ty-tag-field__note'],\n [ids.fault, props.errorText, 'ty-tag-field__fault'],\n ]\n\n return (\n <div\n className={cx('ty-tag-field', props.className)}\n data-tone={typeof tone === 'number' ? 'category' : tone}\n data-invalid={props.errorText ? true : undefined}\n style={tint(tone)}\n >\n {props.label ? (\n <label id={ids.caption} htmlFor={ids.input} className=\"ty-tag-field__caption\">\n {props.label}\n </label>\n ) : null}\n <div ref={wellRef} className=\"ty-tag-field__well\" data-disabled={props.disabled || undefined}>\n <ChipStrip\n name={copy.chosen(props.label ?? props.ariaLabel ?? '')}\n chips={held.map((v) => ({ id: v, text: shown(v) }))}\n off={props.disabled}\n dropName={props.removeLabel ?? copy.remove}\n onDrop={\n props.disabled\n ? undefined\n : (keys) => {\n const gone = new Set([...keys].map(String))\n props.onChange(held.filter((v) => !gone.has(v)))\n inputRef.current?.focus()\n }\n }\n />\n {typingHost}\n </div>\n {lines.map(([id, text, className]) =>\n id ? (\n <p key={className} id={id} className={className}>\n {text}\n </p>\n ) : null,\n )}\n </div>\n )\n}\n","import { Clock } from 'lucide-react'\nimport { useEffect, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'\nimport { Button as AriaButton, DialogTrigger, Heading, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { FieldLine, FloatSurface, joinIds } from '../../internal/forms-b/parts'\nimport { asciiDigits } from '../../internal/forms-b/digits'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport interface TimeOfDay {\n hours: number\n minutes: number\n}\n\nexport interface TimeFieldProps {\n value: TimeOfDay | null\n /** Called only on confirm. */\n onChange: (time: TimeOfDay) => void\n label: string\n placeholder?: string\n /** The date this time belongs to. */\n referenceDate?: Date | null\n /** With a reference date of today, times after now cannot be confirmed. */\n disallowFuture?: boolean\n minuteStep?: number\n disabled?: boolean\n isInvalid?: boolean\n errorText?: string\n hint?: ReactNode\n className?: string\n}\n\nconst two = (n: number) => String(n).padStart(2, '0')\n/** \"HH:MM\" (24 h). Without a locale: ASCII machine form; with one: the locale's digits and separator. */\nexport function formatTimeOfDay(t: TimeOfDay, locale?: string): string {\n if (!locale) return `${two(t.hours)}:${two(t.minutes)}`\n // Display form: 24 h as the spec asks, with the locale's separator and digits.\n return new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23', timeZone: 'UTC' }).format(Date.UTC(2000, 0, 1, t.hours, t.minutes))\n}\n\n/** One spinbutton segment: digits only, clamped, arrows step and wrap. */\nconst SEGMENTS = {\n hours: { max: 23 },\n minutes: { max: 59 },\n} as const\ntype SegmentName = keyof typeof SEGMENTS\n\nfunction Segment(props: {\n name: SegmentName\n label: string\n value: number\n step: number\n onValue: (n: number) => void\n onConfirm: () => void\n inputRef?: React.Ref<HTMLInputElement>\n describedBy?: string\n}) {\n const { max } = SEGMENTS[props.name]\n const [text, setText] = useState(two(props.value))\n useEffect(() => setText(two(props.value)), [props.value])\n const typed = (raw: string) => {\n const digits = asciiDigits(raw).replace(/\\D/g, '').slice(-2)\n const n = digits === '' ? 0 : Math.min(max, Number(digits))\n setText(digits === '' ? '' : Number(digits) > max ? two(n) : digits)\n props.onValue(n)\n }\n const keys = (e: KeyboardEvent<HTMLInputElement>) => {\n const span = max + 1\n const move: Record<string, number> = { ArrowUp: props.step, ArrowDown: -props.step }\n if (e.key in move) {\n e.preventDefault()\n props.onValue((((props.value + move[e.key]!) % span) + span) % span)\n } else if (e.key === 'Enter') {\n e.preventDefault()\n props.onConfirm()\n }\n }\n return (\n <input\n ref={props.inputRef}\n className=\"ty-time-field__segment\"\n role=\"spinbutton\"\n aria-label={props.label}\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={props.value}\n aria-valuetext={two(props.value)}\n aria-describedby={props.describedBy}\n inputMode=\"numeric\"\n autoComplete=\"off\"\n maxLength={3}\n value={text}\n onChange={(e) => typed(e.target.value)}\n onKeyDown={keys}\n onFocus={(e) => e.target.select()}\n />\n )\n}\n\nfunction isSameDay(a: Date, b: Date) {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()\n}\n\n/** The editor inside the popover: hours, minutes, a message and confirm. */\nfunction Editor(props: { initial: TimeOfDay; title: string; blocked: (t: TimeOfDay) => boolean; step: number; onConfirm: (t: TimeOfDay) => void }) {\n const t = useMessages().timeField\n const [draft, setDraft] = useState(props.initial)\n const hoursRef = useRef<HTMLInputElement>(null)\n const messageId = useId()\n const titleId = useId()\n const isBlocked = props.blocked(draft)\n useEffect(() => {\n hoursRef.current?.focus()\n hoursRef.current?.select()\n }, [])\n const confirm = () => {\n if (!props.blocked(draft)) props.onConfirm(draft)\n }\n return (\n <div className=\"ty-time-field__editor\" role=\"group\" aria-labelledby={titleId}>\n <Heading slot=\"title\" id={titleId} className=\"ty-time-field__title\">\n {props.title}\n </Heading>\n <div className=\"ty-time-field__segments\">\n <Segment name=\"hours\" label={t.hours} value={draft.hours} step={1} inputRef={hoursRef} onValue={(hours) => setDraft((d) => ({ ...d, hours }))} onConfirm={confirm} />\n <span className=\"ty-time-field__colon\" aria-hidden=\"true\">\n :\n </span>\n <Segment name=\"minutes\" label={t.minutes} value={draft.minutes} step={props.step} onValue={(minutes) => setDraft((d) => ({ ...d, minutes }))} onConfirm={confirm} />\n </div>\n <p id={messageId} className=\"ty-time-field__message\" aria-live=\"polite\">\n {isBlocked ? t.future : null}\n </p>\n <Button variant=\"primary\" disabled={isBlocked} focusableWhenDisabled aria-describedby={isBlocked ? messageId : undefined} onPress={confirm}>\n {t.confirm}\n </Button>\n </div>\n )\n}\n\n/** A time of day (24 h) edited in a small popover and confirmed (spec: wave-2/time-field.md). */\nexport function TimeField(props: TimeFieldProps) {\n const t = useMessages().timeField\n const { locale } = useLocale()\n const [open, setOpen] = useState(false)\n const base = useId()\n const labelId = `${base}-label`\n const textId = `${base}-text`\n const hintId = props.hint != null && !props.errorText ? `${base}-hint` : undefined\n const errorId = props.errorText ? `${base}-error` : undefined\n const invalid = !!props.isInvalid || !!props.errorText\n\n const blocked = (draft: TimeOfDay) => {\n if (!props.disallowFuture || !props.referenceDate) return false\n const now = new Date()\n if (!isSameDay(props.referenceDate, now)) return false\n return draft.hours * 60 + draft.minutes > now.getHours() * 60 + now.getMinutes()\n }\n\n return (\n <div className={cx('ty-time-field', props.className)} data-invalid={invalid || undefined}>\n <FieldLine kind=\"label\" id={labelId}>\n {props.label}\n </FieldLine>\n {hintId ? (\n <FieldLine kind=\"hint\" id={hintId}>\n {props.hint}\n </FieldLine>\n ) : null}\n <DialogTrigger isOpen={open} onOpenChange={setOpen}>\n <AriaButton\n className=\"ty-fb-trigger\"\n isDisabled={props.disabled}\n aria-labelledby={`${labelId} ${textId}`}\n aria-describedby={joinIds(hintId, errorId)}\n data-invalid={invalid || undefined}\n >\n <span className=\"ty-fb-trigger__glyph\" aria-hidden=\"true\">\n <Clock />\n </span>\n <span id={textId} className=\"ty-fb-trigger__text\" data-placeholder={props.value ? undefined : true}>\n {props.value ? formatTimeOfDay(props.value, locale) : (props.placeholder ?? t.placeholder)}\n </span>\n </AriaButton>\n <FloatSurface labelledBy={labelId}>\n <Editor\n initial={props.value ?? { hours: 0, minutes: 0 }}\n title={props.label}\n blocked={blocked}\n step={Math.max(1, props.minuteStep ?? 1)}\n onConfirm={(time) => {\n props.onChange(time)\n setOpen(false)\n }}\n />\n </FloatSurface>\n </DialogTrigger>\n {errorId ? (\n <FieldLine kind=\"error\" id={errorId}>\n {props.errorText}\n </FieldLine>\n ) : null}\n </div>\n )\n}\n","import { useCallback, useEffect, useMemo, useRef, useState, type CSSProperties, type KeyboardEvent } from 'react'\nimport { ListBox, ListBoxItem, type Key } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { requestHaptic } from '../../internal/haptics'\nimport { prefersReducedMotion } from '../../internal/media'\n\nexport type WheelOption = string | { value: string; label: string }\n\nexport interface WheelPickerProps {\n options: WheelOption[]\n value: string\n onChange: (value: string) => void\n label: string\n /** Odd number of rows visible at once. */\n visibleRows?: number\n disabled?: boolean\n className?: string\n /** Relative width inside a WheelPickerGroup. */\n share?: number\n /** Shows the label as a caption above the wheel. */\n showLabel?: boolean\n}\n\ninterface Row {\n id: string\n text: string\n}\n\nconst toRows = (options: WheelOption[]): Row[] => options.map((o) => (typeof o === 'string' ? { id: o, text: o } : { id: o.value, text: o.label }))\nconst SETTLE_MS = 120\nconst DEFAULT_ROW = 44\n\n/** Pointer-drag scrolling for mouse and pen; touch scrolls natively. */\nfunction useDragScroll(list: React.RefObject<HTMLElement | null>) {\n const moved = useRef(false)\n useEffect(() => {\n const el = list.current\n if (!el) return\n let start: { y: number; top: number } | null = null\n const down = (e: PointerEvent) => {\n if (e.pointerType === 'touch') return\n start = { y: e.clientY, top: el.scrollTop }\n moved.current = false\n }\n const move = (e: PointerEvent) => {\n if (!start) return\n const dy = e.clientY - start.y\n if (Math.abs(dy) > 4) moved.current = true\n if (moved.current) el.scrollTop = start.top - dy\n }\n const up = () => {\n start = null\n }\n el.addEventListener('pointerdown', down)\n window.addEventListener('pointermove', move)\n window.addEventListener('pointerup', up)\n return () => {\n el.removeEventListener('pointerdown', down)\n window.removeEventListener('pointermove', move)\n window.removeEventListener('pointerup', up)\n }\n }, [list])\n /** True once, right after a drag ended (the following tap is ignored). */\n return () => {\n const was = moved.current\n moved.current = false\n return was\n }\n}\n\n/**\n * One wheel: a listbox whose selected option sits in the centre band\n * (spec: wave-2/wheel-picker.md).\n */\nexport function WheelPicker(props: WheelPickerProps) {\n const rows = useMemo(() => toRows(props.options), [props.options])\n const visible = Math.max(3, (props.visibleRows ?? 5) | 1)\n const listRef = useRef<HTMLDivElement>(null)\n const index = rows.findIndex((r) => r.id === props.value)\n const [centre, setCentre] = useState(Math.max(0, index))\n const programmatic = useRef(false)\n const settleTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const endedDrag = useDragScroll(listRef)\n const { onChange } = props\n\n const rowHeight = () => {\n const item = listRef.current?.querySelector<HTMLElement>('[role=\"option\"]')\n return item?.offsetHeight || DEFAULT_ROW\n }\n\n // Bring the value's row to the band whenever the value changes. React Aria\n // commits the option rows in a later pass than the ListBox itself (on\n // React 18 in particular), so on mount the list can still be empty here and\n // a scroll would be clamped to 0. Wait until the target row exists; the\n // first placement jumps, later moves animate.\n const placed = useRef(false)\n useEffect(() => {\n const el = listRef.current\n const target = Math.max(0, index)\n setCentre(target)\n if (!el) return\n const place = () => {\n const first = !placed.current\n placed.current = true\n programmatic.current = true\n const top = target * rowHeight()\n const behavior: ScrollBehavior = first || prefersReducedMotion() ? 'instant' : 'smooth'\n if (typeof el.scrollTo === 'function') el.scrollTo({ top, behavior })\n else el.scrollTop = top\n clearTimeout(settleTimer.current)\n settleTimer.current = setTimeout(() => {\n programmatic.current = false\n }, 400)\n }\n const ready = () => el.querySelectorAll('[role=\"option\"]').length > target\n if (ready() || typeof MutationObserver === 'undefined') {\n place()\n return\n }\n const observer = new MutationObserver(() => {\n if (!ready()) return\n observer.disconnect()\n place()\n })\n observer.observe(el, { childList: true, subtree: true })\n return () => observer.disconnect()\n }, [index])\n\n // User scrolling: tick on every row that crosses the band, report on settle.\n const onScroll = useCallback(() => {\n const el = listRef.current\n if (!el) return\n const at = Math.min(rows.length - 1, Math.max(0, Math.round(el.scrollTop / rowHeight())))\n setCentre((prev) => {\n if (prev !== at && !programmatic.current) requestHaptic('light')\n return at\n })\n if (programmatic.current) return\n clearTimeout(settleTimer.current)\n settleTimer.current = setTimeout(() => {\n const row = rows[at]\n if (row && row.id !== props.value) {\n requestHaptic('light')\n onChange(row.id)\n }\n }, SETTLE_MS)\n }, [rows, props.value, onChange])\n\n useEffect(() => {\n const el = listRef.current\n el?.addEventListener('scroll', onScroll, { passive: true })\n return () => el?.removeEventListener('scroll', onScroll)\n }, [onScroll])\n useEffect(() => () => clearTimeout(settleTimer.current), [])\n\n const choose = (keys: 'all' | Set<Key>) => {\n if (keys === 'all' || endedDrag()) return\n const [key] = [...keys]\n if (key != null && String(key) !== props.value) onChange(String(key))\n }\n\n // PageUp/PageDown move by the number of visible rows.\n const pageKeys = (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key !== 'PageUp' && e.key !== 'PageDown') return\n e.preventDefault()\n e.stopPropagation()\n const from = Math.max(0, index)\n const to = Math.min(rows.length - 1, Math.max(0, from + (e.key === 'PageUp' ? -visible : visible)))\n const row = rows[to]\n if (row && row.id !== props.value) onChange(row.id)\n requestAnimationFrame(() => listRef.current?.querySelector<HTMLElement>(`[data-key=\"${CSS.escape(String(row?.id ?? ''))}\"]`)?.focus())\n }\n\n const style = { '--ty-wheel-rows': visible, '--ty-wheel-share': props.share ?? 1 } as CSSProperties\n return (\n <div className={cx('ty-wheel', props.className)} style={style} data-disabled={props.disabled || undefined} onKeyDownCapture={pageKeys}>\n {props.showLabel ? (\n <span className=\"ty-wheel__caption\" aria-hidden=\"true\">\n {props.label}\n </span>\n ) : null}\n <div className=\"ty-wheel__viewport\">\n <span className=\"ty-wheel__band\" aria-hidden=\"true\" />\n <ListBox\n ref={listRef}\n aria-label={props.label}\n className=\"ty-wheel__list\"\n items={rows}\n selectionMode=\"single\"\n selectionBehavior=\"replace\"\n disallowEmptySelection\n shouldFocusWrap={false}\n selectedKeys={index >= 0 ? [props.value] : []}\n onSelectionChange={choose}\n disabledKeys={props.disabled ? rows.map((r) => r.id) : undefined}\n >\n {(row) => (\n <ListBoxItem id={row.id} textValue={row.text} className=\"ty-wheel__row\" data-distance={Math.min(3, Math.abs(rows.indexOf(row) - centre))}>\n {row.text}\n </ListBoxItem>\n )}\n </ListBox>\n </div>\n </div>\n )\n}\n\nexport type WheelColumn = Omit<WheelPickerProps, 'visibleRows' | 'disabled' | 'className' | 'showLabel'>\n\nexport interface WheelPickerGroupProps {\n columns: WheelColumn[]\n /** Name of the whole group. */\n label: string\n visibleRows?: number\n disabled?: boolean\n className?: string\n}\n\n/** Several wheels side by side for compound values (day, month, year). */\nexport function WheelPickerGroup({ columns, label, visibleRows, disabled, className }: WheelPickerGroupProps) {\n return (\n <div role=\"group\" aria-label={label} className={cx('ty-wheel-group', className)}>\n {columns.map((column) => (\n <WheelPicker key={column.label} {...column} visibleRows={visibleRows} disabled={disabled} showLabel />\n ))}\n </div>\n )\n}\n","import { useEffect, useRef, type KeyboardEvent, type MouseEvent, type PointerEvent } from 'react'\n\n/** Hold time before a press counts as long (the common platform value). */\nexport const LONG_PRESS_DELAY = 500\n\n/**\n * Handlers for a wrapper element that asks for a secondary menu: a press held\n * past the delay, a right click, Shift+F10 or the context-menu key. Uses\n * capture-phase pointer handlers because press primitives stop bubbling. The\n * click that ends a long press is swallowed so the primary action stays quiet.\n */\nexport function useMenuRequest(open: () => void, options: { touchOnly?: boolean } = {}) {\n const state = useRef<{ timer?: ReturnType<typeof setTimeout>; fired: boolean }>({ fired: false })\n const openRef = useRef(open)\n openRef.current = open\n const clear = () => clearTimeout(state.current.timer)\n useEffect(() => clear, [])\n\n return {\n /** True while the current press already opened the menu. */\n consumed: () => state.current.fired,\n props: {\n onPointerDownCapture: (e: PointerEvent) => {\n if (e.button !== 0 || (options.touchOnly && e.pointerType !== 'touch')) return\n state.current.fired = false\n clear()\n state.current.timer = setTimeout(() => {\n state.current.fired = true\n openRef.current()\n }, LONG_PRESS_DELAY)\n },\n onPointerUpCapture: clear,\n onPointerCancelCapture: clear,\n onPointerLeave: clear,\n onClickCapture: (e: MouseEvent) => {\n if (!state.current.fired) return\n state.current.fired = false\n e.preventDefault()\n e.stopPropagation()\n },\n onContextMenu: (e: MouseEvent) => {\n e.preventDefault()\n openRef.current()\n },\n onKeyDown: (e: KeyboardEvent) => {\n if (e.key === 'ContextMenu' || (e.key === 'F10' && e.shiftKey)) {\n e.preventDefault()\n openRef.current()\n }\n },\n },\n }\n}\n","import { useCallback, useRef, useState } from 'react'\n\n/**\n * Value that is either owned by the host (`held` defined) or kept here.\n * Returns a tuple of the effective value and a setter that informs the host.\n */\nexport function useHeldOrOwn<V>(held: V | undefined, seed: V, notify?: (next: V) => void): readonly [V, (next: V) => void] {\n const [own, setOwn] = useState<V>(seed)\n const notifyRef = useRef(notify)\n notifyRef.current = notify\n const isHeld = held !== undefined\n const put = useCallback(\n (next: V) => {\n if (!isHeld) setOwn(next)\n notifyRef.current?.(next)\n },\n [isHeld],\n )\n return [isHeld ? (held as V) : own, put] as const\n}\n\n/**\n * Location matching shared by the navigation pieces: the home path (\"/\")\n * only matches itself; any other href matches itself and its sub-paths.\n */\nexport function pathIsWithin(pathname: string | undefined, href: string): boolean {\n if (pathname === undefined || !href.startsWith('/')) return false\n const clean = (p: string) => (p.length > 1 && p.endsWith('/') ? p.slice(0, -1) : p)\n const here = clean(pathname.split(/[?#]/)[0] ?? '')\n const target = clean(href.split(/[?#]/)[0] ?? '')\n if (target === '/') return here === '/'\n return here === target || here.startsWith(`${target}/`)\n}\n\n/** Best (longest) href among `hrefs` that contains `pathname`, so nested entries win over parents. */\nexport function bestMatch(pathname: string | undefined, hrefs: readonly string[]): string | undefined {\n let found: string | undefined\n for (const h of hrefs) {\n if (pathIsWithin(pathname, h) && (found === undefined || h.length > found.length)) found = h\n }\n return found\n}\n\n/** Browser path, or undefined during server rendering. */\nexport function browserPath(): string | undefined {\n return typeof window === 'undefined' ? undefined : window.location.pathname\n}\n\n/** Caps a count for a corner badge: 150 → \"99+\". */\nexport function cappedCount(n: number, cap = 99, locale?: string): string {\n // Digits in the locale's script; the plus sign is a mathematical mark, kept after the number.\n const nf = new Intl.NumberFormat(locale)\n return n > cap ? `${nf.format(cap)}+` : nf.format(n)\n}\n","import { Ellipsis } from 'lucide-react'\nimport { useState, type MouseEvent, type ReactNode } from 'react'\nimport { Button as AriaButton, Link as AriaLink, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMenuRequest } from '../../internal/overlays-nav/hold'\nimport { cappedCount } from '../../internal/overlays-nav/state'\nimport { useMessages } from '../../internal/provider'\nimport { ActionMenu } from '../action-menu/ActionMenu'\nimport { Avatar } from '../avatar/Avatar'\nimport { Button } from '../button/Button'\nimport { Separator } from '../separator/Separator'\n\nexport interface LauncherShortcut {\n label: string\n href?: string\n onPress?: () => void\n icon?: ReactNode\n}\n\nexport interface LauncherTile {\n id: string\n label: string\n href: string\n icon: ReactNode\n description?: string\n count?: number\n alertCount?: number\n shortcuts?: LauncherShortcut[]\n onPress?: () => void\n}\n\nexport interface LauncherPerson {\n name?: string\n email?: string\n pictureUrl?: string\n roleLabel?: string\n}\n\nexport interface AppLauncherGridProps {\n pages: LauncherTile[]\n actions?: LauncherTile[]\n /** Preferred order of page ids; unknown ids go last. */\n order?: string[]\n actionsLabel?: string\n /** Data for the tile whose id is `profile`. */\n person?: LauncherPerson\n /** False shows a neutral placeholder in the profile tile. */\n ready?: boolean\n onOpen?: (tile: LauncherTile) => void\n onPrefetch?: (href: string) => void\n className?: string\n}\n\n/** Stable sort by the position of each id in `order`; unlisted ids keep their order after. */\nexport function orderTiles(tiles: LauncherTile[], order?: string[]): LauncherTile[] {\n if (!order?.length) return tiles\n const rank = new Map(order.map((id, i) => [id, i]))\n return tiles\n .map((tile, i) => ({ tile, key: rank.get(tile.id) ?? order.length + i }))\n .sort((a, b) => a.key - b.key)\n .map((x) => x.tile)\n}\n\nconst withModifier = (e: MouseEvent) => e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0\n\ninterface TileViewProps {\n tile: LauncherTile\n kind: 'page' | 'action'\n person?: LauncherPerson\n ready: boolean\n onOpen?: (tile: LauncherTile) => void\n onPrefetch?: (href: string) => void\n}\n\nfunction TileFace({ tile, person, ready }: Pick<TileViewProps, 'tile' | 'person' | 'ready'>) {\n const m = useMessages().appLauncher\n if (tile.id === 'profile' && person !== undefined) {\n if (!ready) {\n return (\n <span className=\"ty-launcher__face\" data-placeholder=\"true\">\n <span className=\"ty-launcher__icon ty-launcher__icon--ghost\" aria-hidden=\"true\" />\n <span className=\"ty-visually-hidden\">{m.profileLoading}</span>\n </span>\n )\n }\n const initial = (person.name ?? person.email ?? '?').trim().charAt(0).toLocaleUpperCase()\n return (\n <span className=\"ty-launcher__face\">\n <Avatar src={person.pictureUrl} fallbackText={initial} decorative size=\"large\" />\n {person.roleLabel ? <span className=\"ty-launcher__role\">{person.roleLabel}</span> : null}\n </span>\n )\n }\n return (\n <span className=\"ty-launcher__icon\" aria-hidden=\"true\">\n {tile.icon}\n </span>\n )\n}\n\nfunction Tile(props: TileViewProps) {\n const m = useMessages().appLauncher\n const { locale } = useLocale()\n const { tile } = props\n const [menuOpen, setMenuOpen] = useState(false)\n const shortcuts = tile.shortcuts ?? []\n const request = useMenuRequest(() => shortcuts.length && setMenuOpen(true), { touchOnly: true })\n let name = tile.label\n if (tile.count) name = m.withCount(name, tile.count)\n if (tile.alertCount) name = m.withAlerts(name, tile.alertCount)\n\n const body = (\n <>\n <TileFace tile={tile} person={props.person} ready={props.ready} />\n <span className=\"ty-launcher__text\" aria-hidden=\"true\">\n <span className=\"ty-launcher__name\">{tile.label}</span>\n {tile.description ? <span className=\"ty-launcher__description\">{tile.description}</span> : null}\n </span>\n {tile.count || tile.alertCount ? (\n <span className=\"ty-launcher__badge\" data-alert={tile.alertCount ? true : undefined} aria-hidden=\"true\">\n {cappedCount((tile.alertCount || tile.count) ?? 0, undefined, locale)}\n </span>\n ) : null}\n </>\n )\n\n const hover = props.onPrefetch ? () => props.onPrefetch?.(tile.href) : undefined\n let control: ReactNode\n if (props.kind === 'action') {\n control = (\n <AriaButton className=\"ty-launcher__tile\" aria-label={name} onPress={() => (tile.onPress ? tile.onPress() : props.onOpen?.(tile))} onHoverStart={hover} onFocus={hover}>\n {body}\n </AriaButton>\n )\n } else if (tile.onPress || props.onOpen) {\n // Host-decided opening: a real link (new tab still works) whose plain click is handed over.\n const hand = (e: MouseEvent<HTMLAnchorElement>) => {\n if (withModifier(e) || request.consumed()) return\n e.preventDefault()\n if (tile.onPress) tile.onPress()\n else props.onOpen?.(tile)\n }\n control = (\n <a className=\"ty-launcher__tile\" href={tile.href} aria-label={name} onClick={hand} onMouseEnter={hover} onFocus={hover}>\n {body}\n </a>\n )\n } else {\n control = (\n <AriaLink className=\"ty-launcher__tile\" href={tile.href} aria-label={name} onHoverStart={hover} onFocus={hover}>\n {body}\n </AriaLink>\n )\n }\n\n return (\n <li className=\"ty-launcher__cell\" {...(shortcuts.length ? request.props : {})}>\n {control}\n {shortcuts.length ? (\n <div className=\"ty-launcher__more\">\n <ActionMenu\n label={m.shortcuts(tile.label)}\n open={menuOpen}\n onOpenChange={setMenuOpen}\n items={shortcuts.map((s, i) => ({ id: String(i), label: s.label, href: s.href }))}\n onAction={(id) => shortcuts[Number(id)]?.onPress?.()}\n trigger={<Button variant=\"quiet\" size=\"compact\" shape=\"circle\" iconOnly accessibleLabel={m.more(tile.label)} leadingIcon={<Ellipsis />} />}\n />\n </div>\n ) : null}\n </li>\n )\n}\n\n/** Home-screen grid of areas and account actions (spec: wave-2/app-launcher-grid.md). */\nexport function AppLauncherGrid(props: AppLauncherGridProps) {\n const m = useMessages().appLauncher\n const ready = props.ready ?? true\n const pages = orderTiles(props.pages, props.order)\n const actions = props.actions ?? []\n const shared = { person: props.person, ready, onOpen: props.onOpen, onPrefetch: props.onPrefetch }\n return (\n <div className={cx('ty-launcher', props.className)}>\n <ul className=\"ty-launcher__grid\">\n {pages.map((t) => (\n <Tile key={t.id} tile={t} kind=\"page\" {...shared} />\n ))}\n </ul>\n {actions.length ? (\n <>\n <Separator caption={props.actionsLabel ?? m.actions} />\n <ul className=\"ty-launcher__grid\" data-group=\"actions\">\n {actions.map((t) => (\n <Tile key={t.id} tile={t} kind=\"action\" {...shared} />\n ))}\n </ul>\n </>\n ) : null}\n </div>\n )\n}\n","import { Bell, LogOut, UserRound } from 'lucide-react'\nimport { useEffect, useId, useMemo, useRef, useState, type MouseEvent, type ReactNode } from 'react'\nimport { Dialog, Heading, Link as AriaLink, Modal, ModalOverlay, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { bestMatch, browserPath, cappedCount } from '../../internal/overlays-nav/state'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { Switch } from '../switch/Switch'\nimport { TextField } from '../text-field/TextField'\n\nexport interface FlyoutDestination {\n id: string\n label: string\n subtitle?: string\n href: string\n icon: ReactNode\n onPress?: () => void\n}\n\nexport interface FlyoutQuickActions {\n theme: 'light' | 'dark'\n onThemeChange: (theme: 'light' | 'dark') => void\n onNotifications?: () => void\n unseenCount?: number\n onProfile: () => void\n personName?: string\n personInitial?: string\n onSignOut: () => void\n}\n\nexport interface NavigationFlyoutLabels {\n search?: string\n noResults?: string\n notifications?: string\n theme?: string\n profile?: string\n signOut?: string\n}\n\nexport interface NavigationFlyoutProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n title?: ReactNode\n destinations: FlyoutDestination[]\n currentPath?: string\n onNavigate?: (href: string) => void\n searchable?: boolean\n quickActions?: FlyoutQuickActions\n labels?: NavigationFlyoutLabels\n className?: string\n}\n\n/** Case- and accent-insensitive containment on label or subtitle. */\nexport function filterDestinations(list: FlyoutDestination[], query: string): FlyoutDestination[] {\n const fold = (s: string) => s.normalize('NFD').replace(/\\p{M}/gu, '').toLocaleLowerCase()\n const q = fold(query.trim())\n if (!q) return list\n return list.filter((d) => fold(d.label).includes(q) || (d.subtitle !== undefined && fold(d.subtitle).includes(q)))\n}\n\nconst plainClick = (e: MouseEvent) => !(e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) && e.button === 0\n\n/** \"All destinations\" panel dropped from the top bar (spec: wave-2/navigation-flyout.md). */\nexport function NavigationFlyout(props: NavigationFlyoutProps) {\n const copy = useMessages().navigationFlyout\n const t = { ...copy, ...props.labels }\n const { locale } = useLocale()\n const titleId = useId()\n const [query, setQuery] = useState('')\n const searchable = props.searchable ?? true\n const shown = useMemo(() => filterDestinations(props.destinations, query), [props.destinations, query])\n const here = props.currentPath ?? browserPath()\n const currentHref = bestMatch(here, props.destinations.map((d) => d.href))\n const currentRef = useRef<HTMLAnchorElement | null>(null)\n const close = () => props.onOpenChange(false)\n\n useEffect(() => {\n if (!props.open) {\n setQuery('')\n return\n }\n if (searchable) return\n const frame = requestAnimationFrame(() => currentRef.current?.focus())\n return () => cancelAnimationFrame(frame)\n }, [props.open, searchable])\n\n /** Close first, then act (the spec's order for every choice). */\n const thenClose = (act: () => void) => () => {\n close()\n act()\n }\n\n const tile = (d: FlyoutDestination) => {\n const current = d.href === currentHref\n const inner = (\n <>\n <span className=\"ty-flyout__tile-icon\" aria-hidden=\"true\">\n {d.icon}\n </span>\n <span className=\"ty-flyout__tile-text\">\n <span className=\"ty-flyout__tile-label\">{d.label}</span>\n {d.subtitle ? <span className=\"ty-flyout__tile-sub\">{d.subtitle}</span> : null}\n </span>\n </>\n )\n const common = {\n className: 'ty-flyout__tile',\n 'aria-current': current ? ('page' as const) : undefined,\n 'data-current': current || undefined,\n ref: current ? currentRef : undefined,\n }\n if (d.onPress || props.onNavigate) {\n const hand = (e: MouseEvent<HTMLAnchorElement>) => {\n if (!plainClick(e)) return\n e.preventDefault()\n close()\n if (d.onPress) d.onPress()\n else props.onNavigate?.(d.href)\n }\n return (\n <a {...common} href={d.href} onClick={hand}>\n {inner}\n </a>\n )\n }\n return (\n <AriaLink {...common} href={d.href} onPress={close}>\n {inner}\n </AriaLink>\n )\n }\n\n const qa = props.quickActions\n return (\n <ModalOverlay isOpen={props.open} onOpenChange={props.onOpenChange} isDismissable className=\"ty-flyout__backdrop\">\n <Modal className={cx('ty-flyout', props.className)}>\n <Dialog className=\"ty-flyout__dialog\" aria-labelledby={props.title ? titleId : undefined} aria-label={props.title ? undefined : copy.title}>\n {props.title ? (\n <Heading slot=\"title\" id={titleId} level={2} className=\"ty-flyout__title\">\n {props.title}\n </Heading>\n ) : null}\n {searchable ? (\n <div className=\"ty-flyout__search\">\n <TextField mode=\"search\" accessibleLabel={t.search} placeholder={t.search} value={query} onChange={setQuery} autoFocus />\n <span role=\"status\" className=\"ty-visually-hidden\">\n {query.trim() ? copy.count(shown.length) : ''}\n </span>\n </div>\n ) : null}\n <nav aria-label={copy.destinations} className=\"ty-flyout__nav\">\n {shown.length ? (\n <ul className=\"ty-flyout__grid\">\n {shown.map((d) => (\n <li key={d.id}>{tile(d)}</li>\n ))}\n </ul>\n ) : (\n <p className=\"ty-flyout__empty\">{t.noResults}</p>\n )}\n </nav>\n {qa ? (\n <div className=\"ty-flyout__quick\">\n {qa.onNotifications ? (\n <Button\n variant=\"quiet\"\n leadingIcon={<Bell />}\n onPress={thenClose(qa.onNotifications)}\n accessibleLabel={qa.unseenCount ? `${t.notifications}, ${copy.unseen(qa.unseenCount)}` : undefined}\n >\n {t.notifications}\n {qa.unseenCount ? (\n <span className=\"ty-flyout__count\" aria-hidden=\"true\">\n {cappedCount(qa.unseenCount, undefined, locale)}\n </span>\n ) : null}\n </Button>\n ) : null}\n <Switch label={t.theme ?? copy.darkTheme} isSelected={qa.theme === 'dark'} onChange={(dark) => qa.onThemeChange(dark ? 'dark' : 'light')} />\n <Button\n variant=\"quiet\"\n leadingIcon={qa.personInitial ? <span className=\"ty-flyout__initial\">{qa.personInitial}</span> : <UserRound />}\n onPress={thenClose(qa.onProfile)}\n >\n {qa.personName ?? t.profile}\n </Button>\n <Button variant=\"danger\" leadingIcon={<LogOut />} onPress={thenClose(qa.onSignOut)}>\n {t.signOut}\n </Button>\n </div>\n ) : null}\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n}\n","// Pure converters from one list of navigation entries to each presentation\n// the shell needs: floating-bar actions, launcher tiles, flyout destinations,\n// plus the permission filter every presentation applies first.\nimport type { ReactNode } from 'react'\nimport type { LauncherTile } from '../app-launcher-grid/AppLauncherGrid'\nimport type { FlyoutDestination } from '../navigation-flyout/NavigationFlyout'\nimport { bestMatch } from '../../internal/overlays-nav/state'\n\nexport interface NavMenuEntry {\n id: string\n label: string\n href?: string\n onPress?: () => void\n}\n\nexport interface NavEntry {\n id: string\n label: string\n href: string\n icon: ReactNode\n description?: string\n /** Group heading (for example a research stage). */\n group?: string\n /** Pending items for this person; shown only when > 0. */\n count?: number\n /** Entry is shown only when this permission is granted. */\n permission?: string\n menu?: NavMenuEntry[]\n onPress?: () => void\n}\n\n/**\n * Generic action item consumed by bar-like presentations (the shell's dock,\n * a mobile tab bar): plain data, no rendering decisions.\n */\nexport interface NavAction {\n id: string\n label: string\n icon?: ReactNode\n href?: string\n onPress?: () => void\n group?: string\n permission?: string\n /** Pending count for a badge. */\n badge?: number\n /** True for the entry matching the current location. */\n active?: boolean\n}\n\n/** Keeps entries without a permission and those whose permission is granted. `undefined` grants all. */\nexport function filterByPermission<T extends { permission?: string }>(items: readonly T[], permissions?: readonly string[]): T[] {\n if (permissions === undefined) return [...items]\n const granted = new Set(permissions)\n return items.filter((item) => item.permission === undefined || granted.has(item.permission))\n}\n\n/** The id of the entry that holds `pathname` (longest matching href wins). */\nexport function activeEntryId(entries: readonly NavEntry[], pathname: string | undefined): string | undefined {\n const href = bestMatch(pathname, entries.map((e) => e.href))\n return href === undefined ? undefined : entries.find((e) => e.href === href)?.id\n}\n\nexport interface FloatingActionOptions {\n pathname?: string\n permissions?: readonly string[]\n /** Leading home action. */\n home?: { label: string; href: string; icon?: ReactNode }\n /** Trailing account action. */\n account?: { label: string; icon?: ReactNode; onPress: () => void }\n}\n\nexport function buildFloatingActions(entries: readonly NavEntry[], options: FloatingActionOptions = {}): NavAction[] {\n const visible = filterByPermission(entries, options.permissions)\n const hrefs = [...visible.map((e) => e.href), ...(options.home ? [options.home.href] : [])]\n const current = bestMatch(options.pathname, hrefs)\n const out: NavAction[] = []\n if (options.home) out.push({ id: 'home', label: options.home.label, icon: options.home.icon, href: options.home.href, active: current === options.home.href })\n for (const e of visible) {\n out.push({\n id: e.id,\n label: e.label,\n icon: e.icon,\n href: e.href,\n onPress: e.onPress,\n group: e.group,\n permission: e.permission,\n badge: e.count && e.count > 0 ? e.count : undefined,\n active: current === e.href,\n })\n }\n if (options.account) out.push({ id: 'account', label: options.account.label, icon: options.account.icon, onPress: options.account.onPress, group: 'account' })\n return out\n}\n\nexport function buildLauncherTiles(entries: readonly NavEntry[], permissions?: readonly string[]): LauncherTile[] {\n return filterByPermission(entries, permissions).map((e) => ({\n id: e.id,\n label: e.label,\n href: e.href,\n icon: e.icon,\n description: e.description,\n count: e.count,\n onPress: e.onPress,\n shortcuts: e.menu?.map((s) => ({ label: s.label, href: s.href, onPress: s.onPress })),\n }))\n}\n\nexport function buildFlyoutDestinations(entries: readonly NavEntry[], permissions?: readonly string[]): FlyoutDestination[] {\n return filterByPermission(entries, permissions).map((e) => ({\n id: e.id,\n label: e.label,\n subtitle: e.description,\n href: e.href,\n icon: e.icon,\n onPress: e.onPress,\n }))\n}\n","import { ChevronDown, LogOut, Menu as MenuIcon, PanelLeftClose, PanelLeftOpen, UserRound, X } from 'lucide-react'\nimport { useId, useState, type MouseEvent, type ReactNode } from 'react'\nimport {\n Button as AriaButton,\n Dialog,\n Header,\n Link as AriaLink,\n Menu,\n MenuItem,\n MenuSection,\n MenuTrigger,\n Modal,\n ModalOverlay,\n Popover,\n Tooltip,\n TooltipTrigger,\n type Key,\n} from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { breakpoints, useMediaQuery } from '../../internal/media'\nimport { browserPath } from '../../internal/overlays-nav/state'\nimport { useMessages } from '../../internal/provider'\nimport { ActionMenu } from '../action-menu/ActionMenu'\nimport { AppLauncherGrid } from '../app-launcher-grid/AppLauncherGrid'\nimport { Avatar } from '../avatar/Avatar'\nimport { Button } from '../button/Button'\nimport { NavigationFlyout } from '../navigation-flyout/NavigationFlyout'\nimport { activeEntryId, buildFlyoutDestinations, buildLauncherTiles, filterByPermission, type NavEntry } from './builders'\n\nexport * from './builders'\n\nexport type AppNavigationLayout = 'sidebar' | 'rail' | 'topbar' | 'floating'\ntype Copy = ReturnType<typeof useMessages>['appNavigation']\n\nexport interface AppNavigationAccount {\n name?: string\n initial?: string\n pictureUrl?: string\n onProfile: () => void\n onSignOut: () => void\n theme: 'light' | 'dark'\n onThemeChange: (theme: 'light' | 'dark') => void\n locale?: string\n /** Choices for the language section (value is a BCP 47 tag). */\n locales?: Array<{ value: string; label: string }>\n onLocaleChange?: (locale: string) => void\n}\n\nexport interface AppNavigationProps {\n entries: NavEntry[]\n layout?: AppNavigationLayout\n collapsed?: boolean\n onCollapsedChange?: (collapsed: boolean) => void\n pathname?: string\n /** Hands navigation to the host; without it links use the router adapter. */\n onNavigate?: (href: string) => void\n onPrefetch?: (href: string) => void\n /** Granted permissions; `undefined` grants all. */\n permissions?: string[]\n brand?: ReactNode\n scopeSwitcher?: ReactNode\n footer?: ReactNode\n account?: AppNavigationAccount\n flyout?: { open: boolean; onOpenChange: (open: boolean) => void }\n launcher?: boolean\n /** Screen title of the compact mobile bar. */\n title?: ReactNode\n labels?: Partial<Omit<Copy, 'pending' | 'submenu'>>\n className?: string\n}\n\ninterface EntryContext {\n activeId?: string\n iconOnly: boolean\n copy: Copy\n onNavigate?: (href: string) => void\n onPrefetch?: (href: string) => void\n /** Called after an entry is chosen (closes the mobile drawer). */\n onChosen?: () => void\n}\n\nconst plain = (e: MouseEvent) => !(e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) && e.button === 0\n\nfunction EntryRow({ entry, ctx }: { entry: NavEntry; ctx: EntryContext }) {\n const active = entry.id === ctx.activeId\n const pending = entry.count && entry.count > 0 ? entry.count : 0\n const name = pending ? ctx.copy.pending(entry.label, pending) : entry.label\n const warm = ctx.onPrefetch ? () => ctx.onPrefetch?.(entry.href) : undefined\n const face = (\n <>\n <span className=\"ty-app-nav__icon\" aria-hidden=\"true\">\n {entry.icon}\n </span>\n {ctx.iconOnly ? null : (\n <span className=\"ty-app-nav__label\" aria-hidden={pending ? true : undefined}>\n {entry.label}\n </span>\n )}\n {pending && !ctx.iconOnly ? (\n <span className=\"ty-app-nav__count\" aria-hidden=\"true\">\n {pending}\n </span>\n ) : null}\n </>\n )\n const shared = {\n className: 'ty-app-nav__link',\n 'aria-current': active ? ('page' as const) : undefined,\n 'aria-label': ctx.iconOnly || pending ? name : undefined,\n 'data-active': active || undefined,\n }\n let link: ReactNode\n if (entry.onPress || ctx.onNavigate) {\n const hand = (e: MouseEvent<HTMLAnchorElement>) => {\n if (!plain(e)) return\n e.preventDefault()\n if (entry.onPress) entry.onPress()\n else ctx.onNavigate?.(entry.href)\n ctx.onChosen?.()\n }\n link = (\n <a {...shared} href={entry.href} onClick={hand} onMouseEnter={warm} onFocus={warm}>\n {face}\n </a>\n )\n } else {\n link = (\n <AriaLink {...shared} href={entry.href} onPress={ctx.onChosen} onHoverStart={warm} onFocus={warm}>\n {face}\n </AriaLink>\n )\n }\n if (ctx.iconOnly) {\n link = (\n <TooltipTrigger delay={300}>\n {link}\n <Tooltip className=\"ty-app-nav__tip\" placement=\"end\" offset={8}>\n {name}\n </Tooltip>\n </TooltipTrigger>\n )\n }\n return (\n <li className=\"ty-app-nav__row\">\n {link}\n {entry.menu?.length && !ctx.iconOnly ? (\n <ActionMenu\n label={ctx.copy.submenu(entry.label)}\n items={entry.menu.map((m) => ({ id: m.id, label: m.label, href: m.href }))}\n onAction={(id) => entry.menu?.find((m) => m.id === id)?.onPress?.()}\n trigger={<Button variant=\"quiet\" size=\"compact\" iconOnly accessibleLabel={ctx.copy.submenu(entry.label)} leadingIcon={<ChevronDown />} />}\n />\n ) : null}\n </li>\n )\n}\n\n/** Entries in their groups; group names label the lists (not interactive). */\nfunction EntryGroups({ entries, ctx }: { entries: NavEntry[]; ctx: EntryContext }) {\n const baseId = useId()\n const order: Array<string | undefined> = []\n for (const e of entries) if (!order.includes(e.group)) order.push(e.group)\n return (\n <>\n {order.map((group, i) => {\n const labelId = `${baseId}-g${i}`\n return (\n <div key={group ?? `ungrouped-${i}`} className=\"ty-app-nav__group\">\n {group ? (\n <p id={labelId} className=\"ty-app-nav__group-name\" data-hidden={ctx.iconOnly || undefined}>\n {group}\n </p>\n ) : null}\n <ul className=\"ty-app-nav__list\" aria-labelledby={group ? labelId : undefined}>\n {entries\n .filter((e) => e.group === group)\n .map((e) => (\n <EntryRow key={e.id} entry={e} ctx={ctx} />\n ))}\n </ul>\n </div>\n )\n })}\n </>\n )\n}\n\nfunction AccountMenu({ account, copy, iconOnly }: { account: AppNavigationAccount; copy: Copy; iconOnly?: boolean }) {\n const letter = account.initial ?? account.name?.trim().charAt(0).toLocaleUpperCase() ?? ''\n const pick = (key: Key) => {\n if (key === 'profile') account.onProfile()\n else if (key === 'sign-out') account.onSignOut()\n }\n return (\n <MenuTrigger>\n <AriaButton className=\"ty-app-nav__account\" aria-label={account.name ? `${copy.account}: ${account.name}` : copy.account}>\n {letter || account.pictureUrl ? <Avatar src={account.pictureUrl} fallbackText={letter} size=\"small\" decorative /> : <UserRound aria-hidden=\"true\" />}\n {iconOnly || !account.name ? null : (\n <span className=\"ty-app-nav__account-name\" aria-hidden=\"true\">\n {account.name}\n </span>\n )}\n </AriaButton>\n <Popover className=\"ty-app-nav__menu-popover\" placement=\"top start\" offset={8}>\n <Menu className=\"ty-app-nav__menu\" aria-label={copy.account} onAction={pick}>\n <MenuItem id=\"profile\" className=\"ty-app-nav__menu-item\" textValue={copy.profile}>\n <UserRound aria-hidden=\"true\" className=\"ty-app-nav__menu-icon\" />\n {copy.profile}\n </MenuItem>\n <MenuSection\n className=\"ty-app-nav__menu-section\"\n selectionMode=\"single\"\n selectedKeys={[account.theme]}\n onSelectionChange={(keys) => {\n const next = [...(keys as Set<Key>)][0]\n if (next === 'light' || next === 'dark') account.onThemeChange(next)\n }}\n >\n <Header className=\"ty-app-nav__menu-heading\">{copy.theme}</Header>\n <MenuItem id=\"light\" className=\"ty-app-nav__menu-item\" textValue={copy.themeLight}>\n <span className=\"ty-app-nav__radio\" aria-hidden=\"true\" />\n {copy.themeLight}\n </MenuItem>\n <MenuItem id=\"dark\" className=\"ty-app-nav__menu-item\" textValue={copy.themeDark}>\n <span className=\"ty-app-nav__radio\" aria-hidden=\"true\" />\n {copy.themeDark}\n </MenuItem>\n </MenuSection>\n {account.locales?.length ? (\n <MenuSection\n className=\"ty-app-nav__menu-section\"\n selectionMode=\"single\"\n selectedKeys={account.locale ? [account.locale] : []}\n onSelectionChange={(keys) => {\n const next = [...(keys as Set<Key>)][0]\n if (next !== undefined) account.onLocaleChange?.(String(next))\n }}\n >\n <Header className=\"ty-app-nav__menu-heading\">{copy.language}</Header>\n {account.locales.map((l) => (\n <MenuItem key={l.value} id={l.value} className=\"ty-app-nav__menu-item\" textValue={l.label}>\n <span className=\"ty-app-nav__radio\" aria-hidden=\"true\" />\n <span lang={l.value}>{l.label}</span>\n </MenuItem>\n ))}\n </MenuSection>\n ) : null}\n <MenuItem id=\"sign-out\" className=\"ty-app-nav__menu-item\" data-tone=\"danger\" textValue={copy.signOut}>\n <LogOut aria-hidden=\"true\" className=\"ty-app-nav__menu-icon\" />\n {copy.signOut}\n </MenuItem>\n </Menu>\n </Popover>\n </MenuTrigger>\n )\n}\n\n/**\n * Primary navigation from one list of entries, in the presentation the shell\n * needs (spec: wave-2/app-navigation.md).\n */\nexport function AppNavigation(props: AppNavigationProps) {\n const base = useMessages().appNavigation\n const copy: Copy = { ...base, ...props.labels }\n const desktop = useMediaQuery(`(min-width: ${breakpoints.lg}px)`, true)\n const [drawerOpen, setDrawerOpen] = useState(false)\n const navId = useId()\n const layout = props.layout ?? 'sidebar'\n const entries = filterByPermission(props.entries, props.permissions)\n const activeId = activeEntryId(entries, props.pathname ?? browserPath())\n const sideLike = layout === 'sidebar' || layout === 'rail'\n const collapsed = layout === 'rail' || (props.collapsed ?? false)\n const ctx: EntryContext = { activeId, iconOnly: false, copy, onNavigate: props.onNavigate, onPrefetch: props.onPrefetch }\n\n const extras = (\n <>\n {props.flyout ? (\n <NavigationFlyout\n open={props.flyout.open}\n onOpenChange={props.flyout.onOpenChange}\n destinations={buildFlyoutDestinations(entries)}\n currentPath={props.pathname}\n onNavigate={props.onNavigate}\n />\n ) : null}\n {props.launcher ? (\n <AppLauncherGrid pages={buildLauncherTiles(entries)} onOpen={props.onNavigate ? (t) => props.onNavigate?.(t.href) : undefined} onPrefetch={props.onPrefetch} />\n ) : null}\n </>\n )\n\n // Below 1024 the side presentations become a compact bar with a drawer.\n if (sideLike && !desktop) {\n return (\n <div className={cx('ty-app-nav', props.className)} data-layout=\"drawer\">\n <div className=\"ty-app-nav__bar\">\n <Button\n variant=\"quiet\"\n iconOnly\n accessibleLabel={copy.openMenu}\n leadingIcon={<MenuIcon />}\n aria-expanded={drawerOpen}\n aria-controls={drawerOpen ? navId : undefined}\n onPress={() => setDrawerOpen(true)}\n />\n {props.title ? <span className=\"ty-app-nav__screen\">{props.title}</span> : null}\n {props.account ? <AccountMenu account={props.account} copy={copy} iconOnly /> : null}\n </div>\n <ModalOverlay isOpen={drawerOpen} onOpenChange={setDrawerOpen} isDismissable className=\"ty-app-nav__scrim\">\n <Modal className=\"ty-app-nav__drawer\">\n <Dialog className=\"ty-app-nav__drawer-dialog\" aria-label={copy.landmark}>\n <div className=\"ty-app-nav__drawer-head\">\n {props.brand}\n <Button variant=\"quiet\" iconOnly accessibleLabel={copy.closeMenu} leadingIcon={<X />} onPress={() => setDrawerOpen(false)} />\n </div>\n {props.scopeSwitcher}\n <nav id={navId} aria-label={copy.landmark} className=\"ty-app-nav__nav\">\n <EntryGroups entries={entries} ctx={{ ...ctx, onChosen: () => setDrawerOpen(false) }} />\n </nav>\n {props.footer ? <div className=\"ty-app-nav__footer\">{props.footer}</div> : null}\n </Dialog>\n </Modal>\n </ModalOverlay>\n {extras}\n </div>\n )\n }\n\n if (layout === 'topbar' || layout === 'floating') {\n const iconOnly = layout === 'floating'\n return (\n <div className={cx('ty-app-nav', props.className)} data-layout={layout}>\n {layout === 'topbar' && props.brand ? <div className=\"ty-app-nav__brand\">{props.brand}</div> : null}\n <nav aria-label={copy.landmark} className=\"ty-app-nav__nav\">\n <ul className=\"ty-app-nav__list\">\n {entries.map((e) => (\n <EntryRow key={e.id} entry={e} ctx={{ ...ctx, iconOnly }} />\n ))}\n </ul>\n </nav>\n {props.account ? <AccountMenu account={props.account} copy={copy} iconOnly={iconOnly} /> : null}\n {extras}\n </div>\n )\n }\n\n return (\n <div className={cx('ty-app-nav', props.className)} data-layout=\"sidebar\" data-collapsed={collapsed || undefined}>\n {props.brand ? <div className=\"ty-app-nav__brand\">{props.brand}</div> : null}\n {props.scopeSwitcher && !collapsed ? <div className=\"ty-app-nav__scope\">{props.scopeSwitcher}</div> : null}\n <nav id={navId} aria-label={copy.landmark} className=\"ty-app-nav__nav\">\n <EntryGroups entries={entries} ctx={{ ...ctx, iconOnly: collapsed }} />\n </nav>\n {props.footer && !collapsed ? <div className=\"ty-app-nav__footer\">{props.footer}</div> : null}\n <div className=\"ty-app-nav__end\">\n {props.account ? <AccountMenu account={props.account} copy={copy} iconOnly={collapsed} /> : null}\n {props.onCollapsedChange && layout === 'sidebar' ? (\n <Button\n variant=\"quiet\"\n iconOnly\n accessibleLabel={collapsed ? copy.expand : copy.collapse}\n leadingIcon={collapsed ? <PanelLeftOpen /> : <PanelLeftClose />}\n aria-expanded={!collapsed}\n aria-controls={navId}\n onPress={() => props.onCollapsedChange?.(!collapsed)}\n />\n ) : null}\n </div>\n {extras}\n </div>\n )\n}\n","// Pure model of CommandPalette: turns groups, scope, query, the actions\n// sub-list and the recent store into a flat list of rows (for keyboard\n// movement) grouped into sections (for rendering).\nimport type { ReactNode } from 'react'\nimport { fuzzyHit } from '../../internal/overlays-nav/fuzzy'\nimport { orderChoices, type ChoiceStat } from '../../internal/overlays-nav/recent'\n\nexport interface CommandAction {\n id: string\n label: string\n icon?: ReactNode\n shortcut?: string\n onSelect: () => void\n}\n\nexport interface CommandItem {\n id: string\n label: string\n description?: string\n icon?: ReactNode\n /** Matched but not shown. */\n keywords?: string[]\n hint?: string\n shortcut?: string\n scopeId?: string\n actions?: CommandAction[]\n onSelect: () => void\n}\n\nexport interface CommandGroup {\n id: string\n heading: string\n scopeId?: string\n items: CommandItem[]\n}\n\nexport interface CommandScope {\n id: string\n label: string\n icon?: ReactNode\n}\n\nexport type RowKind = 'item' | 'action' | 'fallback'\n\nexport interface Row {\n /** DOM-safe option key, unique in the list. */\n key: string\n kind: RowKind\n label: string\n description?: string\n icon?: ReactNode\n hint?: string\n shortcut?: string\n /** Matched label indices to mark. */\n marks: number[]\n item?: CommandItem\n run: () => void\n}\n\nexport interface Section {\n key: string\n heading: string\n rows: Row[]\n}\n\nexport interface ViewInput {\n groups: CommandGroup[]\n scope: string | null\n query: string\n /** Item whose actions sub-list is open. */\n subItem: CommandItem | null\n fallbackActions: CommandAction[]\n recent: ChoiceStat[]\n recentVisible: number\n headings: { recent: string; actionsFor: (label: string) => string; fallback: string }\n /** Locale for case folding and word breaks in matching. */\n locale?: string\n}\n\nconst inScope = (scope: string | null, group: CommandGroup, item: CommandItem) =>\n scope === null || (item.scopeId ?? group.scopeId) === scope\n\nconst itemRow = (item: CommandItem, prefix: string, marks: number[] = []): Row => ({\n key: `${prefix}${item.id}`,\n kind: 'item',\n label: item.label,\n description: item.description,\n icon: item.icon,\n hint: item.hint,\n shortcut: item.shortcut,\n marks,\n item,\n run: item.onSelect,\n})\n\nconst actionRow = (a: CommandAction, kind: RowKind, label = a.label): Row => ({\n key: `${kind}-${a.id}`,\n kind,\n label,\n icon: a.icon,\n shortcut: a.shortcut,\n marks: [],\n run: a.onSelect,\n})\n\n/** Best score of an item over its label, description, keywords and group heading. */\nfunction scoreItem(query: string, item: CommandItem, heading: string, locale?: string): { score: number; marks: number[] } | null {\n const label = fuzzyHit(query, item.label, locale)\n let best = label ? label.score : -Infinity\n for (const other of [item.description, ...(item.keywords ?? []), heading]) {\n if (!other) continue\n const hit = fuzzyHit(query, other, locale)\n if (hit && hit.score - 1 > best) best = hit.score - 1\n }\n if (best === -Infinity) return null\n return { score: best, marks: label?.at ?? [] }\n}\n\nexport function buildView(v: ViewInput): Section[] {\n if (v.subItem) {\n return [{ key: 'sub', heading: v.headings.actionsFor(v.subItem.label), rows: (v.subItem.actions ?? []).map((a) => actionRow(a, 'action')) }]\n }\n const q = v.query.trim()\n const sections: Section[] = []\n if (!q) {\n const byId = new Map<string, CommandItem>()\n for (const g of v.groups) for (const it of g.items) if (inScope(v.scope, g, it)) byId.set(it.id, it)\n const recentRows = orderChoices(v.recent)\n .map((r) => byId.get(r.id))\n .filter((it): it is CommandItem => !!it)\n .slice(0, v.recentVisible)\n .map((it) => itemRow(it, 'recent-'))\n if (recentRows.length) sections.push({ key: 'recent', heading: v.headings.recent, rows: recentRows })\n for (const g of v.groups) {\n const rows = g.items.filter((it) => inScope(v.scope, g, it)).map((it) => itemRow(it, `${g.id}-`))\n if (rows.length) sections.push({ key: g.id, heading: g.heading, rows })\n }\n return sections\n }\n for (const g of v.groups) {\n const scored = g.items\n .filter((it) => inScope(v.scope, g, it))\n .map((it) => ({ it, hit: scoreItem(q, it, g.heading, v.locale) }))\n .filter((x): x is { it: CommandItem; hit: { score: number; marks: number[] } } => x.hit !== null)\n .sort((a, b) => b.hit.score - a.hit.score)\n if (scored.length) sections.push({ key: g.id, heading: g.heading, rows: scored.map((x) => itemRow(x.it, `${g.id}-`, x.hit.marks)) })\n }\n if (!sections.length && v.fallbackActions.length) {\n sections.push({\n key: 'fallback',\n heading: v.headings.fallback,\n rows: v.fallbackActions.map((a) => actionRow(a, 'fallback', a.label.split('{query}').join(q))),\n })\n }\n return sections\n}\n","import { ChevronRight, Search, X } from 'lucide-react'\nimport { useEffect, useId, useMemo, useReducer, useRef, type KeyboardEvent } from 'react'\nimport { Button as AriaButton, Dialog, Modal, ModalOverlay, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { markPieces } from '../../internal/overlays-nav/fuzzy'\nimport { readChoices, recordChoice, type ChoiceStat } from '../../internal/overlays-nav/recent'\nimport { useHeldOrOwn } from '../../internal/overlays-nav/state'\nimport { useMessages } from '../../internal/provider'\nimport { Skeleton } from '../skeleton/Skeleton'\nimport { buildView, type CommandAction, type CommandGroup, type CommandItem, type CommandScope, type Row } from './model'\n\nexport type { CommandAction, CommandGroup, CommandItem, CommandScope } from './model'\n\ntype Copy = ReturnType<typeof useMessages>['commandPalette']\n\nexport interface CommandPaletteProps {\n open: boolean\n onClose: () => void\n groups: CommandGroup[]\n scopes?: CommandScope[]\n activeScope?: string | null\n onScopeChange?: (id: string | null) => void\n loading?: boolean\n fallbackActions?: CommandAction[]\n labels?: Partial<Omit<Copy, 'hints'>> & { hints?: Partial<Copy['hints']> }\n /** Accessible name of the dialog and the field. */\n label?: string\n recent?: { storageKey: string; visible?: number; keep?: number }\n className?: string\n}\n\ninterface State {\n query: string\n cursor: number\n sub: CommandItem | null\n recent: ChoiceStat[]\n}\n\ntype Event =\n | { type: 'reset'; recent: ChoiceStat[] }\n | { type: 'type'; query: string }\n | { type: 'point'; cursor: number }\n | { type: 'open-sub'; item: CommandItem }\n | { type: 'close-sub' }\n\nfunction reduce(s: State, e: Event): State {\n switch (e.type) {\n case 'reset':\n return { query: '', cursor: 0, sub: null, recent: e.recent }\n case 'type':\n return { ...s, query: e.query, cursor: 0, sub: null }\n case 'point':\n return { ...s, cursor: e.cursor }\n case 'open-sub':\n return { ...s, sub: e.item, cursor: 0 }\n case 'close-sub':\n return { ...s, sub: null, cursor: 0 }\n }\n}\n\nfunction Marked({ text, marks }: { text: string; marks: number[] }) {\n if (!marks.length) return <>{text}</>\n return (\n <>\n {markPieces(text, marks).map((p, i) =>\n p.marked ? (\n <mark key={i} className=\"ty-palette__mark\">\n {p.text}\n </mark>\n ) : (\n <span key={i}>{p.text}</span>\n ),\n )}\n </>\n )\n}\n\n/** Global \"jump to anything\" dialog (spec: wave-2/command-palette.md). */\nexport function CommandPalette(props: CommandPaletteProps) {\n const base = useMessages().commandPalette\n const copy: Copy = { ...base, ...props.labels, hints: { ...base.hints, ...props.labels?.hints } }\n const name = props.label ?? copy.label\n const listId = useId()\n const optionPrefix = useId()\n const inputRef = useRef<HTMLInputElement>(null)\n const scopes = props.scopes ?? []\n const { locale, direction } = useLocale()\n const [scope, setScope] = useHeldOrOwn<string | null>(props.activeScope, null, props.onScopeChange)\n const [state, send] = useReducer(reduce, { query: '', cursor: 0, sub: null, recent: [] })\n const storageKey = props.recent?.storageKey\n\n useEffect(() => {\n if (props.open) send({ type: 'reset', recent: storageKey ? readChoices(storageKey) : [] })\n }, [props.open, storageKey])\n\n const sections = useMemo(\n () =>\n props.loading\n ? []\n : buildView({\n locale,\n groups: props.groups,\n scope,\n query: state.query,\n subItem: state.sub,\n fallbackActions: props.fallbackActions ?? [],\n recent: state.recent,\n recentVisible: props.recent?.visible ?? 5,\n headings: { recent: copy.recent, actionsFor: copy.actionsFor, fallback: copy.fallback },\n }),\n // copy functions are stable per catalogue\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.loading, props.groups, props.fallbackActions, scope, state.query, state.sub, state.recent, props.recent?.visible, locale],\n )\n const rows = sections.flatMap((s) => s.rows)\n const cursor = rows.length ? Math.min(state.cursor, rows.length - 1) : -1\n const current: Row | undefined = rows[cursor]\n const optionId = (row: Row) => `${optionPrefix}-${row.key}`\n const scopeLabel = scopes.find((s) => s.id === scope)?.label\n\n useEffect(() => {\n if (!current) return\n document.getElementById(optionId(current))?.scrollIntoView({ block: 'nearest' })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current?.key])\n\n const run = (row: Row) => {\n if (row.kind === 'item' && row.item && storageKey) recordChoice(storageKey, row.item.id, props.recent?.keep ?? 12)\n props.onClose()\n row.run()\n }\n\n const pickScope = (id: string) => {\n setScope(scope === id ? null : id)\n send({ type: 'type', query: '' })\n inputRef.current?.focus()\n }\n\n const onKey = (e: KeyboardEvent<HTMLInputElement>) => {\n const empty = state.query.length === 0\n const step = (to: number) => {\n e.preventDefault()\n if (rows.length) send({ type: 'point', cursor: (to + rows.length) % rows.length })\n }\n // Inline-axis keys follow the reading direction: \"into\" the sub-list is the inline end.\n const mirrored: Record<string, string> = { ArrowLeft: 'ArrowRight', ArrowRight: 'ArrowLeft' }\n switch (direction === 'rtl' ? (mirrored[e.key] ?? e.key) : e.key) {\n case 'ArrowDown':\n return step(cursor + 1)\n case 'ArrowUp':\n return step(cursor - 1)\n case 'Home':\n return step(0)\n case 'End':\n return step(rows.length - 1)\n case 'Enter':\n e.preventDefault()\n if (current) run(current)\n return\n case 'ArrowRight':\n if (!state.sub && current?.item?.actions?.length) {\n e.preventDefault()\n send({ type: 'open-sub', item: current.item })\n } else if (empty && !scope && scopes[0]) {\n e.preventDefault()\n pickScope(scopes[0].id)\n }\n return\n case 'ArrowLeft':\n if (state.sub) {\n e.preventDefault()\n send({ type: 'close-sub' })\n }\n return\n case 'Tab': {\n if (!scopes.length || e.shiftKey) return\n const typed = state.query.trim().toLocaleLowerCase()\n const target = empty ? (scope ? undefined : scopes[0]) : scopes.find((s) => s.label.toLocaleLowerCase().startsWith(typed))\n if (target) {\n e.preventDefault()\n setScope(target.id)\n send({ type: 'type', query: '' })\n }\n return\n }\n case 'Backspace':\n if (empty && scope) {\n e.preventDefault()\n setScope(null)\n }\n return\n case 'Escape':\n e.preventDefault()\n e.stopPropagation()\n if (state.sub) send({ type: 'close-sub' })\n else if (scope) setScope(null)\n else props.onClose()\n return\n }\n }\n\n const announcement = props.loading\n ? copy.loading\n : state.query.trim()\n ? rows.length\n ? copy.results(rows.length)\n : copy.noResults(state.query.trim())\n : ''\n\n return (\n <ModalOverlay isOpen={props.open} onOpenChange={(o) => !o && props.onClose()} isDismissable isKeyboardDismissDisabled className=\"ty-palette__backdrop\">\n <Modal className={cx('ty-palette', props.className)}>\n <Dialog className=\"ty-palette__dialog\" aria-label={name}>\n <div className=\"ty-palette__field\">\n <Search className=\"ty-palette__search-icon\" aria-hidden=\"true\" />\n {scopeLabel ? (\n <AriaButton className=\"ty-palette__chip\" aria-label={copy.removeScope(scopeLabel)} onPress={() => setScope(null)}>\n {scopeLabel}\n <X aria-hidden=\"true\" />\n </AriaButton>\n ) : null}\n <input\n ref={inputRef}\n className=\"ty-palette__input\"\n role=\"combobox\"\n aria-label={name}\n aria-autocomplete=\"list\"\n aria-expanded={rows.length > 0}\n aria-controls={listId}\n aria-activedescendant={current ? optionId(current) : undefined}\n placeholder={copy.placeholder}\n value={state.query}\n autoFocus\n autoComplete=\"off\"\n spellCheck={false}\n onChange={(e) => send({ type: 'type', query: e.target.value })}\n onKeyDown={onKey}\n />\n </div>\n <div className=\"ty-palette__main\">\n {scopes.length ? (\n <div className=\"ty-palette__scopes\" role=\"group\" aria-label={copy.scopes}>\n {scopes.map((s) => (\n <AriaButton key={s.id} className=\"ty-palette__scope\" aria-pressed={scope === s.id} excludeFromTabOrder onPress={() => pickScope(s.id)}>\n {s.icon ? <span aria-hidden=\"true\">{s.icon}</span> : null}\n {s.label}\n </AriaButton>\n ))}\n </div>\n ) : null}\n <div className=\"ty-palette__results\">\n {props.loading ? (\n <div className=\"ty-palette__loading\" aria-hidden=\"true\">\n {[0, 1, 2].map((i) => (\n <Skeleton key={i} shape=\"line\" />\n ))}\n </div>\n ) : null}\n <div id={listId} role=\"listbox\" aria-label={name} className=\"ty-palette__list\">\n {sections.map((section) => (\n <div key={section.key} role=\"group\" aria-labelledby={`${listId}-${section.key}`} className=\"ty-palette__group\">\n <div id={`${listId}-${section.key}`} role=\"presentation\" className=\"ty-palette__heading\">\n {section.heading}\n </div>\n {section.rows.map((row) => {\n const on = row === current\n return (\n <div\n key={row.key}\n id={optionId(row)}\n role=\"option\"\n aria-selected={on}\n data-highlighted={on || undefined}\n data-kind={row.kind}\n className=\"ty-palette__option\"\n onPointerMove={() => !on && send({ type: 'point', cursor: rows.indexOf(row) })}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => run(row)}\n >\n {row.icon ? (\n <span className=\"ty-palette__icon\" aria-hidden=\"true\">\n {row.icon}\n </span>\n ) : null}\n <span className=\"ty-palette__text\">\n <span className=\"ty-palette__label\">\n <Marked text={row.label} marks={row.marks} />\n </span>\n {row.description ? <span className=\"ty-palette__description\">{row.description}</span> : null}\n </span>\n {row.hint ? <span className=\"ty-palette__hint\">{row.hint}</span> : null}\n {row.shortcut ? <kbd className=\"ty-palette__kbd\">{row.shortcut}</kbd> : null}\n {row.item?.actions?.length && !state.sub ? (\n <span\n className=\"ty-palette__chevron\"\n aria-hidden=\"true\"\n onClick={(e) => {\n e.stopPropagation()\n if (row.item) send({ type: 'open-sub', item: row.item })\n }}\n >\n <ChevronRight className=\"ty-mirror-rtl\" />\n </span>\n ) : null}\n </div>\n )\n })}\n </div>\n ))}\n </div>\n {!props.loading && !rows.length ? (\n <p className=\"ty-palette__empty\">{state.query.trim() ? copy.noResults(state.query.trim()) : copy.empty}</p>\n ) : null}\n </div>\n </div>\n <div className=\"ty-palette__footer\" aria-hidden=\"true\">\n <span>\n <kbd className=\"ty-palette__kbd\">↑↓</kbd> {copy.hints.navigate}\n </span>\n <span>\n <kbd className=\"ty-palette__kbd\">↵</kbd> {copy.hints.select}\n </span>\n <span>\n <kbd className=\"ty-palette__kbd\">→</kbd> {copy.hints.actions}\n </span>\n <span>\n <kbd className=\"ty-palette__kbd\">←</kbd> {copy.hints.back}\n </span>\n <span>\n <kbd className=\"ty-palette__kbd\">esc</kbd> {copy.hints.close}\n </span>\n </div>\n <span role=\"status\" className=\"ty-visually-hidden\">\n {announcement}\n </span>\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n}\n","import { CircleHelp, TriangleAlert } from 'lucide-react'\nimport { useEffect, useId, type ReactNode } from 'react'\nimport { Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { requestHaptic, useHapticsEnabled } from '../../internal/haptics'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport type ConfirmTone = 'neutral' | 'danger'\n\nexport interface CompactConfirmProps {\n open: boolean\n title: string\n message?: string\n onConfirm: () => void\n onCancel: () => void\n confirmLabel?: string\n cancelLabel?: string\n tone?: ConfirmTone\n icon?: ReactNode\n /** App or module name shown above the question. */\n sourceLabel?: string\n /**\n * Warning haptic when it opens (where supported). Also needs the person's\n * haptics preference on and a user gesture on the page before.\n */\n haptic?: boolean\n className?: string\n}\n\nfunction ToneTile({ tone, icon, word }: { tone: ConfirmTone; icon?: ReactNode; word: string }) {\n const glyph = icon ?? (tone === 'danger' ? <TriangleAlert /> : <CircleHelp />)\n return (\n <div className=\"ty-compact-confirm__tone\">\n <span className=\"ty-compact-confirm__tile\" aria-hidden=\"true\">\n {glyph}\n </span>\n {tone === 'danger' ? <span className=\"ty-compact-confirm__word\">{word}</span> : null}\n </div>\n )\n}\n\n/** Small top-anchored confirmation card (spec: wave-2/compact-confirm.md). */\nexport function CompactConfirm(props: CompactConfirmProps) {\n const copy = useMessages().confirm\n const tone = props.tone ?? 'danger'\n const titleId = useId()\n const messageId = useId()\n const hapticsOn = useHapticsEnabled()\n const wantsHaptic = (props.haptic ?? true) && hapticsOn\n\n useEffect(() => {\n if (props.open && wantsHaptic) requestHaptic('medium')\n }, [props.open, wantsHaptic])\n\n return (\n <ModalOverlay\n isOpen={props.open}\n isDismissable\n onOpenChange={(next) => {\n if (!next) props.onCancel()\n }}\n className=\"ty-compact-confirm__scrim\"\n >\n <Modal className={cx('ty-compact-confirm', props.className)} data-tone={tone}>\n <Dialog role=\"alertdialog\" aria-labelledby={titleId} aria-describedby={props.message ? messageId : undefined} className=\"ty-compact-confirm__card\">\n <ToneTile tone={tone} icon={props.icon} word={copy.caution} />\n <div className=\"ty-compact-confirm__text\">\n {props.sourceLabel ? <p className=\"ty-compact-confirm__source\">{props.sourceLabel}</p> : null}\n <Heading id={titleId} level={2} className=\"ty-compact-confirm__question\">\n {props.title}\n </Heading>\n {props.message ? (\n <p id={messageId} className=\"ty-compact-confirm__message\">\n {props.message}\n </p>\n ) : null}\n </div>\n <div className=\"ty-compact-confirm__actions\">\n <Button autoFocus={tone === 'danger'} onPress={props.onCancel}>\n {props.cancelLabel ?? copy.cancel}\n </Button>\n <Button autoFocus={tone !== 'danger'} variant={tone === 'danger' ? 'danger' : 'primary'} onPress={props.onConfirm}>\n {props.confirmLabel ?? copy.confirm}\n </Button>\n </div>\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n}\n","// ConfirmService (spec: wave-2/confirm-service.md).\n//\n// Questions are held by a small first-in-first-out queue that lives outside\n// React. The provider subscribes to it and renders only the question at the\n// front, through one of two presenters (compact or dialog). Each question\n// resolves its own promise when answered.\nimport { createContext, useContext, useMemo, useState, useSyncExternalStore, type ReactNode } from 'react'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { CompactConfirm, type ConfirmTone } from '../compact-confirm/CompactConfirm'\nimport { ModalDialog } from '../modal-dialog/ModalDialog'\n\n/** Field names fixed by the spec. */\nexport interface ConfirmOptions {\n title: string\n message?: string\n confirmLabel?: string\n cancelLabel?: string\n tone?: ConfirmTone\n icon?: ReactNode\n}\n\nexport type AskToConfirm = (options: ConfirmOptions) => Promise<boolean>\n\ninterface Pending {\n serial: number\n question: ConfirmOptions\n reply: (yes: boolean) => void\n}\n\nclass QuestionQueue {\n private waiting: Pending[] = []\n private serial = 0\n private listeners = new Set<() => void>()\n\n enqueue = (question: ConfirmOptions): Promise<boolean> =>\n new Promise<boolean>((reply) => {\n this.waiting = [...this.waiting, { serial: ++this.serial, question, reply }]\n this.emit()\n })\n\n answerFront(yes: boolean): void {\n const [front, ...rest] = this.waiting\n if (!front) return\n this.waiting = rest\n front.reply(yes)\n this.emit()\n }\n\n front = (): Pending | undefined => this.waiting[0]\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener)\n return () => this.listeners.delete(listener)\n }\n\n private emit() {\n for (const listener of this.listeners) listener()\n }\n}\n\nconst QueueContext = createContext<QuestionQueue | null>(null)\n\n/** Without a provider: the browser's own prompt, or false where there is none. */\nfunction browserPrompt(options: ConfirmOptions): Promise<boolean> {\n const prompt = typeof window === 'undefined' ? undefined : window.confirm\n if (typeof prompt !== 'function') return Promise.resolve(false)\n try {\n return Promise.resolve(Boolean(prompt.call(window, options.title)))\n } catch {\n return Promise.resolve(false)\n }\n}\n\nexport interface ConfirmProviderProps {\n /** `compact` (CompactConfirm) or `dialog` (ModalDialog in alert form). */\n presentation?: 'compact' | 'dialog'\n children: ReactNode\n}\n\ninterface PresenterProps {\n question: ConfirmOptions | undefined\n onReply: (yes: boolean) => void\n}\n\nfunction DialogPresenter({ question, onReply }: PresenterProps) {\n const words = useMessages().confirm\n const risky = question?.tone === 'danger'\n return (\n <ModalDialog\n isOpen={question !== undefined}\n onOpenChange={(open) => {\n if (!open) onReply(false)\n }}\n role=\"alertdialog\"\n width=\"narrow\"\n title={question?.title ?? ''}\n description={question?.message}\n actions={\n <>\n <Button autoFocus={risky} onPress={() => onReply(false)}>\n {question?.cancelLabel ?? words.cancel}\n </Button>\n <Button autoFocus={!risky} variant={risky ? 'danger' : 'primary'} onPress={() => onReply(true)}>\n {question?.confirmLabel ?? words.confirm}\n </Button>\n </>\n }\n />\n )\n}\n\nfunction CompactPresenter({ question, onReply }: PresenterProps) {\n return (\n <CompactConfirm\n open={question !== undefined}\n title={question?.title ?? ''}\n message={question?.message}\n confirmLabel={question?.confirmLabel}\n cancelLabel={question?.cancelLabel}\n tone={question?.tone ?? 'neutral'}\n icon={question?.icon}\n onConfirm={() => onReply(true)}\n onCancel={() => onReply(false)}\n />\n )\n}\n\nconst PRESENTERS = { compact: CompactPresenter, dialog: DialogPresenter } as const\n\n/**\n * Mount once near the root; `useConfirm()` then returns an async question.\n * Questions asked while one is open wait and open in order.\n */\nexport function ConfirmProvider({ presentation = 'compact', children }: ConfirmProviderProps) {\n const [queue] = useState(() => new QuestionQueue())\n const front = useSyncExternalStore(queue.subscribe, queue.front, queue.front)\n const Presenter = PRESENTERS[presentation]\n return (\n <QueueContext.Provider value={queue}>\n {children}\n {/* A fresh presenter per question resets its focus and animation. */}\n <Presenter key={front ? front.serial : 'idle'} question={front?.question} onReply={(yes) => queue.answerFront(yes)} />\n </QueueContext.Provider>\n )\n}\n\n/** Async yes/no question rendered by the nearest ConfirmProvider. */\nexport function useConfirm(): AskToConfirm {\n const queue = useContext(QueueContext)\n return useMemo<AskToConfirm>(() => (queue ? queue.enqueue : browserPrompt), [queue])\n}\n","import { ArrowRight, CircleAlert, CircleCheck, Clock, Hourglass, Info } from 'lucide-react'\nimport { useId, type ReactNode } from 'react'\nimport { Button as AriaButton, Dialog, DialogTrigger, OverlayArrow, Popover, useLocale } from 'react-aria-components'\nimport { breakpoints, useMediaQuery } from '../../internal/media'\nimport { useHeldOrOwn } from '../../internal/overlays-nav/state'\nimport { useMessages } from '../../internal/provider'\nimport { ActorChip } from '../actor-chip/ActorChip'\nimport { Drawer } from '../drawer/Drawer'\n\nexport type DetailsTone = 'neutral' | 'success' | 'pending' | 'error'\n\nexport interface DetailsPopoverProps {\n triggerLabel: string\n title: string\n headerIcon?: ReactNode\n tone?: DetailsTone\n actor?: { kind: 'person' | 'agent' | 'system'; name: string; detail?: string; initials?: string }\n timestamp?: string | Date\n comparison?: { label: string; fromLabel: string; fromValue: string; toLabel: string; toValue: string }\n note?: { label: string; value: string }\n placement?: 'top' | 'bottom' | 'start' | 'end'\n open?: boolean\n onOpenChange?: (open: boolean) => void\n className?: string\n}\n\nconst toneGlyph = { success: CircleCheck, pending: Hourglass, error: CircleAlert } as const\n\nfunction formatWhen(value: string | Date, locale: string): string {\n const date = value instanceof Date ? value : new Date(value)\n if (Number.isNaN(date.getTime())) return String(value)\n return new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short' }).format(date)\n}\n\n/** The card body, shared by the popover and the narrow-screen drawer. */\nfunction ChangeCard({ p, titleId, withHeading }: { p: DetailsPopoverProps; titleId: string; withHeading: boolean }) {\n const words = useMessages().detailsPopover.tone\n const { locale } = useLocale()\n const tone = p.tone ?? 'neutral'\n const Glyph = tone === 'neutral' ? null : toneGlyph[tone]\n return (\n <div className=\"ty-details-popover__card-body\" data-tone={tone}>\n {withHeading ? (\n <div className=\"ty-details-popover__head\">\n {p.headerIcon ? <span aria-hidden=\"true\">{p.headerIcon}</span> : null}\n <h2 id={titleId} className=\"ty-details-popover__title\">\n {p.title}\n </h2>\n </div>\n ) : null}\n {Glyph ? (\n <p className=\"ty-details-popover__tone\">\n <Glyph aria-hidden=\"true\" focusable=\"false\" />\n {words[tone as Exclude<DetailsTone, 'neutral'>]}\n </p>\n ) : null}\n {p.actor ? (\n <div className=\"ty-details-popover__row\">\n <ActorChip\n kind={p.actor.kind}\n name={p.actor.name}\n initials={p.actor.initials}\n {...(p.actor.kind === 'person' ? { email: p.actor.detail } : { model: p.actor.detail })}\n />\n </div>\n ) : null}\n {p.timestamp !== undefined ? (\n <p className=\"ty-details-popover__when\">\n <Clock aria-hidden=\"true\" focusable=\"false\" />\n <time dateTime={p.timestamp instanceof Date ? p.timestamp.toISOString() : p.timestamp}>{formatWhen(p.timestamp, locale)}</time>\n </p>\n ) : null}\n {p.comparison ? (\n <p className=\"ty-details-popover__change\">\n <span className=\"ty-details-popover__label\">{p.comparison.label}:</span>{' '}\n <span className=\"ty-details-popover__side\">\n {p.comparison.fromLabel} <strong>{p.comparison.fromValue}</strong>\n </span>{' '}\n <ArrowRight className=\"ty-mirror-rtl ty-details-popover__arrow\" aria-hidden=\"true\" focusable=\"false\" />{' '}\n <span className=\"ty-details-popover__side\">\n {p.comparison.toLabel} <strong>{p.comparison.toValue}</strong>\n </span>\n </p>\n ) : null}\n {p.note ? (\n <div className=\"ty-details-popover__note\">\n <p className=\"ty-details-popover__label\">{p.note.label}</p>\n <p className=\"ty-details-popover__note-text\">{p.note.value}</p>\n </div>\n ) : null}\n </div>\n )\n}\n\n/** Information button explaining one recorded change (spec: wave-2/details-popover.md). */\nexport function DetailsPopover(props: DetailsPopoverProps) {\n const titleId = useId()\n const narrow = useMediaQuery(`(max-width: ${breakpoints.sm - 0.02}px)`)\n const [open, setOpen] = useHeldOrOwn(props.open, false, props.onOpenChange)\n\n const trigger = (\n <AriaButton className=\"ty-details-popover__trigger\" aria-label={props.triggerLabel} aria-haspopup=\"dialog\" aria-expanded={open}>\n <Info aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n )\n\n if (narrow) {\n return (\n <span className={props.className}>\n <AriaButton\n className=\"ty-details-popover__trigger\"\n aria-label={props.triggerLabel}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onPress={() => setOpen(true)}\n >\n <Info aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n <Drawer open={open} onOpenChange={setOpen} title={props.title} placement=\"bottom\">\n <ChangeCard p={props} titleId={titleId} withHeading={false} />\n </Drawer>\n </span>\n )\n }\n\n return (\n <DialogTrigger isOpen={open} onOpenChange={setOpen}>\n {trigger}\n <Popover className=\"ty-details-popover\" placement={props.placement ?? 'top'} offset={10}>\n <OverlayArrow className=\"ty-details-popover__arrow-tip\">\n <svg width={12} height={12} viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n <Dialog className=\"ty-details-popover__dialog\" aria-labelledby={titleId}>\n <ChangeCard p={props} titleId={titleId} withHeading />\n </Dialog>\n </Popover>\n </DialogTrigger>\n )\n}\n","import { useEffect, type ReactNode } from 'react'\nimport { createPortal } from 'react-dom'\nimport { cx } from '../../internal/cx'\nimport { requestHaptic } from '../../internal/haptics'\nimport { breakpoints, useMediaQuery } from '../../internal/media'\nimport { Button } from '../button/Button'\n\nexport type FabPlacement = 'end-bottom' | 'start-bottom' | 'center-bottom'\nexport type FabPresentation = 'responsive' | 'floating' | 'inline'\n\nexport interface FloatingActionButtonProps {\n label: string\n icon?: ReactNode\n onPress: () => void\n placement?: FabPlacement\n presentation?: FabPresentation\n /** Shows the label beside the icon while floating. */\n extended?: boolean\n size?: 'regular' | 'large'\n emphasis?: 'primary' | 'secondary'\n loading?: boolean\n disabled?: boolean\n /** Haptic tick on activation where supported. */\n haptic?: boolean\n className?: string\n}\n\n/** Page attribute that reserves room under the last row while a button floats. */\nconst RESERVE_ATTRIBUTE = 'data-ty-fab-reserve'\n\nfunction useReserveBottom(active: boolean) {\n useEffect(() => {\n if (!active || typeof document === 'undefined') return\n const body = document.body\n const depth = Number(body.getAttribute(RESERVE_ATTRIBUTE) ?? '0') + 1\n body.setAttribute(RESERVE_ATTRIBUTE, String(depth))\n return () => {\n const left = Number(body.getAttribute(RESERVE_ATTRIBUTE) ?? '1') - 1\n if (left > 0) body.setAttribute(RESERVE_ATTRIBUTE, String(left))\n else body.removeAttribute(RESERVE_ATTRIBUTE)\n }\n }, [active])\n}\n\n/**\n * The screen's main creation action (spec: wave-2/floating-action-button.md).\n * One element only: inline where it is placed on wide screens; on small\n * screens the same element moves (portal) to the end of the document so it\n * follows the main content in reading order and floats above the safe area.\n */\nexport function FloatingActionButton(props: FloatingActionButtonProps) {\n const wide = useMediaQuery(`(min-width: ${breakpoints.lg}px)`, true)\n const presentation = props.presentation ?? 'responsive'\n const floats = presentation === 'floating' || (presentation === 'responsive' && !wide)\n const showsText = !floats || (props.extended ?? false)\n useReserveBottom(floats)\n\n const press = () => {\n if (props.haptic) requestHaptic('light')\n props.onPress()\n }\n\n const control = (\n <Button\n className={cx('ty-fab', props.className)}\n variant={props.emphasis === 'secondary' ? 'secondary' : 'primary'}\n size={props.size === 'large' ? 'large' : 'regular'}\n shape={floats ? (showsText ? 'pill' : 'circle') : 'rounded'}\n iconOnly={!showsText}\n accessibleLabel={props.label}\n leadingIcon={props.icon}\n busy={props.loading}\n disabled={props.disabled}\n onPress={press}\n >\n {props.label}\n </Button>\n )\n\n if (!floats) return <span className=\"ty-fab-inline\">{control}</span>\n const floating = (\n <div className=\"ty-fab-dock\" data-placement={props.placement ?? 'end-bottom'} data-size={props.size ?? 'regular'}>\n {control}\n </div>\n )\n return typeof document === 'undefined' ? floating : createPortal(floating, document.body)\n}\n","import { useId, useState, type ReactNode } from 'react'\nimport { Button as AriaButton, Link as AriaLink, Menu, MenuItem, MenuTrigger, Popover, Text } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { requestHaptic } from '../../internal/haptics'\nimport { useMenuRequest } from '../../internal/overlays-nav/hold'\nimport { useMessages } from '../../internal/provider'\n\nexport interface LongPressMenuItem {\n label: string\n icon?: ReactNode\n href?: string\n onAction?: () => void\n tone?: 'neutral' | 'danger'\n}\n\nexport interface LongPressMenuProps {\n children: ReactNode\n items: LongPressMenuItem[]\n /** Primary navigation on tap. */\n href?: string\n /** Primary action on tap (wins over `href`). */\n onTap?: () => void\n /** A tap opens the menu instead of the primary action. */\n tapOpensMenu?: boolean\n /** Accessible name of the trigger. */\n label: string\n className?: string\n}\n\n\n/**\n * A tile whose tap runs its primary action while a long press, right click,\n * Shift+F10 or the context-menu key lists secondary actions\n * (spec: wave-2/long-press-menu.md).\n */\nexport function LongPressMenu(props: LongPressMenuProps) {\n const hint = useMessages().longPressMenu.hint\n const hintId = useId()\n const [open, setOpenState] = useState(false)\n const setOpen = (next: boolean) => {\n if (next && !open) requestHaptic('light')\n setOpenState(next)\n }\n\n const request = useMenuRequest(() => setOpen(true))\n\n const tap = () => {\n if (request.consumed()) return\n if (props.tapOpensMenu) setOpen(true)\n else props.onTap?.()\n }\n\n const triggerCommon = {\n className: 'ty-long-press-menu__trigger',\n 'aria-label': props.label,\n 'aria-describedby': hintId,\n 'aria-haspopup': 'menu' as const,\n }\n const asLink = !!props.href && !props.onTap && !props.tapOpensMenu\n const trigger = asLink ? (\n <AriaLink {...triggerCommon} href={props.href}>\n {props.children}\n </AriaLink>\n ) : (\n <AriaButton {...triggerCommon} onPress={tap}>\n {props.children}\n </AriaButton>\n )\n\n const run = (key: React.Key) => {\n const item = props.items[Number(key)]\n item?.onAction?.()\n }\n\n return (\n <span className={cx('ty-long-press-menu', props.className)} {...request.props}>\n {/* Presses reach the menu trigger too; only closing (or tapOpensMenu) is accepted from it. */}\n <MenuTrigger isOpen={open} onOpenChange={(next) => (!next || props.tapOpensMenu ? setOpen(next) : undefined)}>\n {trigger}\n <Popover className=\"ty-long-press-menu__popover\" placement=\"bottom start\" offset={6}>\n <Menu className=\"ty-long-press-menu__menu\" aria-label={props.label} autoFocus=\"first\" onAction={run}>\n {props.items.map((item, i) => (\n <MenuItem key={i} id={String(i)} href={item.href} textValue={item.label} className=\"ty-long-press-menu__item\" data-tone={item.tone ?? 'neutral'}>\n {item.icon ? (\n <span className=\"ty-long-press-menu__icon\" aria-hidden=\"true\">\n {item.icon}\n </span>\n ) : null}\n <Text slot=\"label\">{item.label}</Text>\n </MenuItem>\n ))}\n </Menu>\n </Popover>\n </MenuTrigger>\n <span id={hintId} className=\"ty-visually-hidden\">\n {hint}\n </span>\n </span>\n )\n}\n","import { useRef, type KeyboardEvent } from 'react'\nimport { Button as AriaButton, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type PageDotsAppearance = 'dot' | 'pill'\nexport type PageDotsSize = 'small' | 'medium' | 'large'\nexport type PageDotsContrast = 'onSurface' | 'onLight' | 'onDark'\n\nexport interface PageDotsProps {\n count: number\n /** Zero-based visible page. */\n currentIndex: number\n /** Makes the dots a picker (APG Carousel picker: buttons, `aria-current`). */\n onSelect?: (index: number) => void\n appearance?: PageDotsAppearance\n size?: PageDotsSize\n contrast?: PageDotsContrast\n label?: string\n dotLabel?: (n: number, total: number) => string\n /** Above this number of pages a counter replaces the dots. */\n maxDots?: number\n className?: string\n}\n\nconst ROVE: Record<string, number> = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 }\n\n/** Dots showing (and optionally choosing) the visible page (spec: wave-2/page-dots.md). */\nexport function PageDots(props: PageDotsProps) {\n const copy = useMessages().pageDots\n const { direction } = useLocale()\n const { count, currentIndex, onSelect } = props\n const total = Math.max(0, count)\n const current = Math.min(Math.max(0, currentIndex), Math.max(0, total - 1))\n const groupName = props.label ?? copy.label\n const nameOf = props.dotLabel ?? copy.dot\n const shell = {\n className: cx('ty-page-dots', props.className),\n 'data-appearance': props.appearance ?? 'dot',\n 'data-size': props.size ?? 'medium',\n 'data-contrast': props.contrast ?? 'onSurface',\n }\n const row = useRef<HTMLDivElement>(null)\n\n if (total > (props.maxDots ?? 9)) {\n return (\n <p {...shell} data-mode=\"counter\" aria-label={groupName}>\n <span className=\"ty-page-dots__counter\">{copy.counter(current + 1, total)}</span>\n </p>\n )\n }\n\n const pips = Array.from({ length: total }, (_, i) => i)\n\n if (!onSelect) {\n return (\n <div {...shell} data-mode=\"static\">\n <span className=\"ty-visually-hidden\">{nameOf(current + 1, total)}</span>\n {pips.map((i) => (\n <span key={i} className=\"ty-page-dots__pip\" data-on={i === current || undefined} aria-hidden=\"true\" />\n ))}\n </div>\n )\n }\n\n // Roving focus: only the current dot is in the tab order; arrows move.\n const move = (e: KeyboardEvent<HTMLDivElement>) => {\n // Left and Right follow the reading direction (dots run from the inline start).\n const inline = direction === 'rtl' && (e.key === 'ArrowLeft' || e.key === 'ArrowRight') ? -1 : 1\n const step = (ROVE[e.key] ?? 0) * inline || (e.key === 'Home' ? -Infinity : e.key === 'End' ? Infinity : 0)\n if (!step) return\n const buttons = Array.from(row.current?.querySelectorAll<HTMLButtonElement>('button') ?? [])\n const from = buttons.indexOf(document.activeElement as HTMLButtonElement)\n const to = Number.isFinite(step) ? (from + step + buttons.length) % buttons.length : step < 0 ? 0 : buttons.length - 1\n e.preventDefault()\n buttons[to]?.focus()\n }\n\n return (\n <div {...shell} data-mode=\"picker\" role=\"group\" aria-label={groupName} ref={row} onKeyDown={move}>\n {pips.map((i) => (\n <AriaButton\n key={i}\n className=\"ty-page-dots__hit\"\n aria-label={nameOf(i + 1, total)}\n aria-current={i === current ? 'true' : undefined}\n excludeFromTabOrder={i !== current}\n onPress={() => onSelect(i)}\n >\n <span className=\"ty-page-dots__pip\" data-on={i === current || undefined} aria-hidden=\"true\" />\n </AriaButton>\n ))}\n </div>\n )\n}\n","import { X } from 'lucide-react'\nimport { useEffect, useId, useRef, type FormEvent, type KeyboardEvent, type ReactNode } from 'react'\nimport { Button as AriaButton, Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useHeldOrOwn } from '../../internal/overlays-nav/state'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { InlineNotice } from '../inline-notice/InlineNotice'\n\nexport type SectionedModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'\n\nexport interface ModalSection {\n id: string\n label: string\n icon?: ReactNode\n group?: string\n count?: number\n content?: ReactNode\n}\n\nexport interface ModalFormFooter {\n cancelLabel?: string\n submitLabel?: string\n pending?: boolean\n submitDisabled?: boolean\n}\n\nexport interface SectionedModalProps {\n open: boolean\n onClose: () => void\n title?: string\n subtitle?: string\n eyebrow?: string\n icon?: ReactNode\n /** Name of the bare layout (no title). */\n ariaLabel?: string\n headerActions?: ReactNode\n size?: SectionedModalSize\n /** When false, Escape and the backdrop do nothing. */\n dismissible?: boolean\n /** Thin accent line on top of the header (decorative). */\n accent?: boolean\n error?: ReactNode\n footer?: ReactNode\n onSubmit?: (event: FormEvent<HTMLFormElement>) => void\n formFooter?: ModalFormFooter\n sections?: ModalSection[]\n activeSection?: string\n defaultSection?: string\n onSectionChange?: (id: string) => void\n identity?: ReactNode\n navigationHeader?: ReactNode\n navigationFooter?: ReactNode\n closeLabel?: string\n children?: ReactNode\n className?: string\n}\n\nconst FIELD = 'input:not([type=hidden]):not([disabled]), textarea:not([disabled]), select:not([disabled])'\n\n/** Groups sections in first-seen group order, keeping the section order inside each group. */\nfunction groupSections(list: ModalSection[]): Array<[string | undefined, ModalSection[]]> {\n const buckets = new Map<string | undefined, ModalSection[]>()\n for (const s of list) {\n const bucket = buckets.get(s.group)\n if (bucket) bucket.push(s)\n else buckets.set(s.group, [s])\n }\n return [...buckets.entries()]\n}\n\nfunction SectionRail(props: { label: string; sections: ModalSection[]; active: string; onPick: (id: string) => void; identity?: ReactNode; extras?: ReactNode; foot?: ReactNode }) {\n return (\n <div className=\"ty-sectioned-modal__rail\">\n {props.identity ? <div className=\"ty-sectioned-modal__identity\">{props.identity}</div> : null}\n {props.extras}\n <nav aria-label={props.label} className=\"ty-sectioned-modal__nav\">\n {groupSections(props.sections).map(([group, items]) => (\n <div key={group ?? '·'} className=\"ty-sectioned-modal__group\">\n {group ? <p className=\"ty-sectioned-modal__group-name\">{group}</p> : null}\n <ul className=\"ty-sectioned-modal__list\">\n {items.map((s) => (\n <li key={s.id}>\n <AriaButton\n className=\"ty-sectioned-modal__item\"\n aria-current={s.id === props.active ? 'page' : undefined}\n data-active={s.id === props.active || undefined}\n onPress={() => props.onPick(s.id)}\n >\n {s.icon ? (\n <span className=\"ty-sectioned-modal__item-icon\" aria-hidden=\"true\">\n {s.icon}\n </span>\n ) : null}\n <span className=\"ty-sectioned-modal__item-label\">{s.label}</span>\n {s.count !== undefined ? <span className=\"ty-sectioned-modal__count\">{s.count}</span> : null}\n </AriaButton>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n {props.foot ? <div className=\"ty-sectioned-modal__rail-foot\">{props.foot}</div> : null}\n </div>\n )\n}\n\n/** Large modal for editing and inspecting an item (spec: wave-2/sectioned-modal.md). */\nexport function SectionedModal(props: SectionedModalProps) {\n const copy = useMessages().sectionedModal\n const titleId = useId()\n const subtitleId = useId()\n const bodyRef = useRef<HTMLDivElement>(null)\n const headingRef = useRef<HTMLHeadingElement>(null)\n const dismissible = props.dismissible ?? true\n const sections = props.sections ?? []\n const layout = sections.length ? 'sectioned' : props.title ? 'structured' : 'bare'\n const [active, setActive] = useHeldOrOwn(props.activeSection, props.defaultSection ?? sections[0]?.id ?? '', props.onSectionChange)\n const shown = sections.find((s) => s.id === active) ?? sections[0]\n const pending = props.formFooter?.pending ?? false\n\n // Initial focus: first field of the body, else the heading.\n useEffect(() => {\n if (!props.open) return\n const frame = requestAnimationFrame(() => {\n // The person may already have moved into the body (a click before this\n // frame): never take focus away from them.\n if (bodyRef.current?.contains(document.activeElement)) return\n const field = bodyRef.current?.querySelector<HTMLElement>(FIELD)\n if (field) field.focus()\n else headingRef.current?.focus()\n })\n return () => cancelAnimationFrame(frame)\n }, [props.open])\n\n const submitShortcut = (e: KeyboardEvent<HTMLFormElement>) => {\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {\n e.preventDefault()\n e.currentTarget.requestSubmit()\n }\n }\n\n const header =\n layout === 'bare' ? null : (\n <div className=\"ty-sectioned-modal__head\" data-accent={props.accent || undefined}>\n {props.icon ? (\n <span className=\"ty-sectioned-modal__head-icon\" aria-hidden=\"true\">\n {props.icon}\n </span>\n ) : null}\n <div className=\"ty-sectioned-modal__titles\">\n {props.eyebrow ? <p className=\"ty-sectioned-modal__eyebrow\">{props.eyebrow}</p> : null}\n <Heading slot=\"title\" id={titleId} level={2} ref={headingRef} tabIndex={-1} className=\"ty-sectioned-modal__title\">\n {props.title}\n </Heading>\n {props.subtitle ? (\n <p id={subtitleId} className=\"ty-sectioned-modal__subtitle\">\n {props.subtitle}\n </p>\n ) : null}\n </div>\n <div className=\"ty-sectioned-modal__head-actions\">\n {props.headerActions}\n <Button variant=\"quiet\" shape=\"circle\" iconOnly accessibleLabel={props.closeLabel ?? copy.close} leadingIcon={<X />} onPress={props.onClose} disabled={pending} />\n </div>\n </div>\n )\n\n const bodyContent = (\n <>\n {props.error ? (\n <InlineNotice tone=\"danger\" urgency=\"assertive\">\n {props.error}\n </InlineNotice>\n ) : null}\n {layout === 'sectioned' && shown ? (\n <section aria-label={shown.label} className=\"ty-sectioned-modal__section\">\n {shown.content ?? props.children}\n </section>\n ) : (\n props.children\n )}\n </>\n )\n\n const footerContent = props.footer ?? (props.formFooter ? (\n <>\n <Button onPress={props.onClose} disabled={pending}>\n {props.formFooter.cancelLabel ?? copy.cancel}\n </Button>\n <Button type=\"submit\" variant=\"primary\" busy={pending} disabled={props.formFooter.submitDisabled}>\n {props.formFooter.submitLabel ?? copy.save}\n </Button>\n </>\n ) : null)\n\n const inner = (\n <>\n <div ref={bodyRef} className=\"ty-sectioned-modal__body\">\n {bodyContent}\n </div>\n {footerContent ? <div className=\"ty-sectioned-modal__foot\">{footerContent}</div> : null}\n </>\n )\n\n const main = props.onSubmit ? (\n <form\n className=\"ty-sectioned-modal__form\"\n noValidate\n onKeyDown={submitShortcut}\n onSubmit={(e) => {\n e.preventDefault()\n props.onSubmit?.(e)\n }}\n >\n {inner}\n </form>\n ) : (\n <div className=\"ty-sectioned-modal__form\">{inner}</div>\n )\n\n return (\n <ModalOverlay\n isOpen={props.open}\n isDismissable={dismissible && !pending}\n isKeyboardDismissDisabled={!dismissible || pending}\n onOpenChange={(next) => {\n if (!next) props.onClose()\n }}\n className=\"ty-sectioned-modal__backdrop\"\n >\n <Modal className={cx('ty-sectioned-modal', props.className)} data-size={props.size ?? 'lg'} data-layout={layout}>\n <Dialog\n className=\"ty-sectioned-modal__dialog\"\n aria-label={layout === 'bare' ? props.ariaLabel : undefined}\n aria-describedby={props.subtitle && layout !== 'bare' ? subtitleId : undefined}\n >\n {header}\n <div className=\"ty-sectioned-modal__frame\">\n {layout === 'sectioned' ? (\n <SectionRail\n label={props.title ?? props.ariaLabel ?? ''}\n sections={sections}\n active={shown?.id ?? ''}\n onPick={setActive}\n identity={props.identity}\n extras={props.navigationHeader}\n foot={props.navigationFooter}\n />\n ) : null}\n {main}\n </div>\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n}\n","// Controls of SettingsDialog, one per item type, plus the copy action and\n// the passphrase form.\nimport { Copy } from 'lucide-react'\nimport { useReducer, useState, type FormEvent, type ReactNode } from 'react'\nimport { Label, Radio, RadioGroup, Text } from 'react-aria-components'\nimport { useMessages } from '../../internal/provider'\nimport { Avatar } from '../avatar/Avatar'\nimport { Button } from '../button/Button'\nimport { NativeSelect } from '../native-select/NativeSelect'\nimport { Switch } from '../switch/Switch'\nimport { TextArea } from '../text-area/TextArea'\nimport { TextField } from '../text-field/TextField'\nimport type { EntryFormat, EntryItem, PassphraseItem, PickItem, SettingsItem } from './settingsModel'\n\ntype Wire = { label: string; hint?: string; value: string; onChange?: (v: string) => void; readOnly?: boolean; placeholder?: string; name: string }\n\nconst BY_FORMAT: { [F in EntryFormat]: (w: Wire) => ReactNode } = {\n plain: (w) => <TextField {...w} inputType=\"text\" />,\n mail: (w) => <TextField {...w} inputType=\"email\" />,\n link: (w) => <TextField {...w} inputType=\"url\" />,\n secret: (w) => <TextField {...w} mode=\"password\" />,\n paragraph: (w) => <TextArea {...w} rows={3} />,\n}\n\nfunction Copier({ caption, text }: { caption: string; text: string }) {\n const words = useMessages().settingsDialog\n const [said, setSaid] = useState('')\n const run = async () => {\n try {\n await navigator.clipboard.writeText(text)\n setSaid(words.copied)\n } catch {\n setSaid('')\n }\n }\n return (\n <>\n <Button size=\"compact\" iconOnly leadingIcon={<Copy />} accessibleLabel={words.copy(caption)} onPress={() => void run()} />\n <span role=\"status\" className=\"ty-visually-hidden\">\n {said}\n </span>\n </>\n )\n}\n\nfunction Entry({ item }: { item: EntryItem }) {\n const draw = BY_FORMAT[item.format ?? 'plain']\n return (\n <div className=\"ty-settings-dialog__field\" data-copyable={item.copy ? '' : undefined}>\n <div className=\"ty-settings-dialog__field-control\">\n {draw({ label: item.caption, hint: item.help, value: item.text, onChange: item.onText, readOnly: item.locked, placeholder: item.example, name: item.id })}\n </div>\n {item.copy ? <Copier caption={item.caption} text={item.text} /> : null}\n </div>\n )\n}\n\ntype Slot = 'old' | 'fresh' | 'again'\ntype Draft = Record<Slot, string> & { differ: boolean }\ntype Change = [Slot, string] | 'differ'\n\nconst draftAfter = (draft: Draft, change: Change): Draft =>\n change === 'differ'\n ? { ...draft, differ: true }\n : // Touching either new value clears the \"different\" notice.\n { ...draft, [change[0]]: change[1], differ: change[0] === 'old' && draft.differ }\n\nfunction Passphrase({ item }: { item: PassphraseItem }) {\n const words = useMessages().settingsDialog\n const [draft, apply] = useReducer(draftAfter, { old: '', fresh: '', again: '', differ: false })\n const caption = (slot: Slot | 'save') =>\n item.captions?.[slot] ?? { old: words.currentPassword, fresh: words.newPassword, again: words.confirmPassword, save: words.changePassword }[slot]\n const box = (slot: Slot, autoComplete: string) => (\n <TextField\n mode=\"password\"\n label={caption(slot)}\n value={draft[slot]}\n autoComplete={autoComplete}\n onChange={(text) => apply([slot, text])}\n errorMessage={slot === 'again' && draft.differ ? words.passwordMismatch : undefined}\n />\n )\n const send = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault()\n if (draft.fresh !== draft.again) return apply('differ')\n item.onSave(draft.old, draft.fresh, draft.again)\n }\n return (\n <form noValidate className=\"ty-settings-dialog__password\" onSubmit={send}>\n {box('old', 'current-password')}\n {box('fresh', 'new-password')}\n {box('again', 'new-password')}\n <div>\n <Button type=\"submit\">{caption('save')}</Button>\n </div>\n </form>\n )\n}\n\nfunction Pick({ item }: { item: PickItem }) {\n return (\n <RadioGroup className=\"ty-settings-dialog__choices\" data-cards={item.look === 'cards' ? '' : undefined} value={item.chosen} onChange={item.onPick}>\n <Label className=\"ty-settings-dialog__legend\">{item.caption}</Label>\n <div className=\"ty-settings-dialog__choice-grid\">\n {item.answers.map((answer) => (\n <Radio key={answer.id} value={answer.id} className=\"ty-settings-dialog__choice\">\n <span aria-hidden=\"true\" className=\"ty-settings-dialog__choice-mark\" />\n <span className=\"ty-settings-dialog__choice-text\">\n <span className=\"ty-settings-dialog__choice-label\">{answer.caption}</span>\n {answer.help ? (\n <Text slot=\"description\" className=\"ty-settings-dialog__choice-hint\">\n {answer.help}\n </Text>\n ) : null}\n </span>\n </Radio>\n ))}\n </div>\n </RadioGroup>\n )\n}\n\nfunction Portrait({ src, initials, onReplace }: { src?: string; initials: string; onReplace?: () => void }) {\n const words = useMessages().settingsDialog\n return (\n <div className=\"ty-settings-dialog__picture\">\n <Avatar decorative size=\"large\" src={src} fallbackText={initials} />\n {onReplace ? <Button onPress={onReplace}>{words.changePicture}</Button> : null}\n </div>\n )\n}\n\n/** Draws one item by its type. */\nexport function ItemControl({ item }: { item: SettingsItem }) {\n switch (item.type) {\n case 'entry':\n return <Entry item={item} />\n case 'toggle':\n return <Switch label={item.caption} description={item.help} isSelected={item.on} onChange={item.onFlip} />\n case 'pick':\n return <Pick item={item} />\n case 'language':\n return <NativeSelect label={item.caption} value={item.chosen} options={item.answers.map((a) => ({ value: a.id, label: a.caption }))} onChange={item.onPick} />\n case 'portrait':\n return <Portrait src={item.src} initials={item.initials} onReplace={item.onReplace} />\n case 'passphrase':\n return <Passphrase item={item} />\n }\n}\n","// SettingsDialog (spec: wave-2/settings-dialog.md; names renamed in\n// implementation, see the spec's note). Pages are drawn from `content`\n// (heading + typed items) inside a SectionedModal; a page without content\n// comes from `renderPage`, else a short sentence.\nimport { LockKeyhole } from 'lucide-react'\nimport { useId, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { SectionedModal, type ModalSection } from '../sectioned-modal/SectionedModal'\nimport type { LockedNotice, SettingsPage } from './settingsModel'\nimport { ItemControl } from './settingsParts'\n\nexport type * from './settingsModel'\n\nexport type SettingsOutlineEntry = Omit<ModalSection, 'content' | 'count'>\n\nexport interface SettingsDialogProps {\n open: boolean\n onClose: () => void\n title: string\n subtitle?: string\n /** Navigation entries, in order. */\n outline: SettingsOutlineEntry[]\n /** Page shown on open (the first one otherwise). */\n startAt?: string\n /** Who is signed in, at the top of the navigation. */\n whoCard?: ReactNode\n /** Content by page id. */\n content?: Record<string, SettingsPage>\n /** Host content for pages without `content`. */\n renderPage?: (id: string) => ReactNode | undefined\n /** Sentence for pages with nothing to show. */\n emptyText?: string\n /** Shown when `startAt` is not in `outline`. */\n locked?: LockedNotice\n /** Action at the foot of the navigation (for example \"sign out\"). */\n exit?: { label: string; icon?: ReactNode; onPress: () => void }\n}\n\nexport interface PreferenceGroupProps {\n title?: string\n icon?: ReactNode\n children: ReactNode\n className?: string\n}\n\n/** A titled block of settings (a group, not a landmark). */\nexport function PreferenceGroup(props: PreferenceGroupProps) {\n const headId = useId()\n return (\n <div role=\"group\" aria-labelledby={props.title ? headId : undefined} className={cx('ty-preference-group', props.className)}>\n {props.title ? (\n <h3 id={headId} className=\"ty-preference-group__title\">\n {props.icon ? (\n <span aria-hidden=\"true\" className=\"ty-preference-group__icon\">\n {props.icon}\n </span>\n ) : null}\n {props.title}\n </h3>\n ) : null}\n <div className=\"ty-preference-group__body\">{props.children}</div>\n </div>\n )\n}\n\nfunction PageBody({ page }: { page: SettingsPage }) {\n return (\n <PreferenceGroup title={page.heading}>\n {page.lead ? <p className=\"ty-settings-dialog__description\">{page.lead}</p> : null}\n {page.items.map((item) => (\n <ItemControl key={item.id} item={item} />\n ))}\n </PreferenceGroup>\n )\n}\n\nfunction Locked({ notice }: { notice: LockedNotice }) {\n return (\n <div className=\"ty-settings-dialog__denied\">\n <span aria-hidden=\"true\" className=\"ty-settings-dialog__denied-icon\">\n {notice.glyph ?? <LockKeyhole />}\n </span>\n <h3 className=\"ty-settings-dialog__denied-title\">{notice.heading}</h3>\n <p className=\"ty-settings-dialog__description\">{notice.reason}</p>\n </div>\n )\n}\n\nexport function SettingsDialog(props: SettingsDialogProps) {\n const words = useMessages().settingsDialog\n const shell = { open: props.open, onClose: props.onClose, title: props.title, subtitle: props.subtitle }\n const target = props.startAt\n const reachable = !target || props.outline.some((entry) => entry.id === target)\n\n if (!reachable && props.locked) {\n return (\n <SectionedModal {...shell} size=\"md\">\n <Locked notice={props.locked} />\n </SectionedModal>\n )\n }\n\n const drawPage = (id: string): ReactNode => {\n const page = props.content?.[id]\n if (page) return <PageBody page={page} />\n return props.renderPage?.(id) ?? <p className=\"ty-settings-dialog__placeholder\">{props.emptyText ?? words.placeholder}</p>\n }\n const foot = props.exit ? (\n <Button fullWidth variant=\"danger\" leadingIcon={props.exit.icon} onPress={props.exit.onPress}>\n {props.exit.label}\n </Button>\n ) : undefined\n return (\n <SectionedModal\n {...shell}\n size=\"xl\"\n className=\"ty-settings-dialog\"\n sections={props.outline.map((entry) => ({ ...entry, content: drawPage(entry.id) }))}\n defaultSection={target}\n identity={props.whoCard}\n navigationFooter={foot}\n />\n )\n}\n","import { Check } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { Button as AriaButton, Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type StepStatus = 'complete' | 'current' | 'upcoming'\n\nexport interface StepListStep {\n id: string\n name: string\n description?: string\n icon?: ReactNode\n href?: string\n status?: StepStatus\n}\n\nexport interface StepListProps {\n steps: StepListStep[]\n /** Zero-based current step; overrides per-step statuses. */\n currentIndex?: number\n /** Accessible name of the navigation. */\n label: string\n appearance?: 'markers' | 'bar'\n onStepSelect?: (index: number) => void\n /** Also lets people select upcoming steps. */\n allowForward?: boolean\n className?: string\n}\n\ninterface Resolved {\n step: StepListStep\n index: number\n status: StepStatus\n selectable: boolean\n}\n\n/** Works out every step's status once; `currentIndex` wins over declared statuses. */\nfunction resolveSteps(props: StepListProps): Resolved[] {\n const { steps, currentIndex, onStepSelect, allowForward = false } = props\n const declaredCurrent = steps.findIndex((s) => s.status === 'current')\n const pivot = currentIndex ?? (declaredCurrent >= 0 ? declaredCurrent : undefined)\n return steps.map((step, index) => {\n let status: StepStatus\n if (currentIndex !== undefined || step.status === undefined) {\n status = pivot === undefined ? 'upcoming' : index < pivot ? 'complete' : index === pivot ? 'current' : 'upcoming'\n } else status = step.status\n const selectable = !!onStepSelect && (status === 'complete' || (allowForward && status === 'upcoming'))\n return { step, index, status, selectable }\n })\n}\n\nfunction Marker({ entry }: { entry: Resolved }) {\n const face = entry.status === 'complete' ? <Check aria-hidden=\"true\" focusable=\"false\" /> : (entry.step.icon ?? entry.index + 1)\n return (\n <span className=\"ty-step-list__marker\" aria-hidden=\"true\">\n {face}\n </span>\n )\n}\n\n/** Progress through ordered steps, optionally navigable (spec: wave-2/step-list.md). */\nexport function StepList(props: StepListProps) {\n const m = useMessages().stepList\n const entries = resolveSteps(props)\n const total = entries.length\n const current = entries.find((e) => e.status === 'current')\n\n const describe = (e: Resolved) => `${m.position(e.index + 1, total)}, ${e.step.name}, ${m.status[e.status]}`\n\n const body = (e: Resolved) => (\n <>\n <Marker entry={e} />\n <span className=\"ty-step-list__text\" aria-hidden={e.selectable || undefined}>\n <span className=\"ty-step-list__eyebrow\">{m.position(e.index + 1, total)}</span>\n <span className=\"ty-step-list__name\">{e.step.name}</span>\n {e.step.description ? <span className=\"ty-step-list__description\">{e.step.description}</span> : null}\n </span>\n </>\n )\n\n const cell = (e: Resolved) => {\n const shared = { className: 'ty-step-list__target', 'aria-label': describe(e), onPress: () => props.onStepSelect?.(e.index) }\n if (e.selectable && e.step.href) return <AriaLink {...shared} href={e.step.href}>{body(e)}</AriaLink>\n if (e.selectable) return <AriaButton {...shared}>{body(e)}</AriaButton>\n return (\n <span className=\"ty-step-list__target\" data-static=\"true\">\n <span className=\"ty-visually-hidden\">{describe(e)}</span>\n <span aria-hidden=\"true\" className=\"ty-step-list__static\">\n {body(e)}\n </span>\n </span>\n )\n }\n\n return (\n <nav className={cx('ty-step-list', props.className)} aria-label={props.label} data-appearance={props.appearance ?? 'markers'}>\n <ol className=\"ty-step-list__list\">\n {entries.map((e) => (\n <li\n key={e.step.id}\n className=\"ty-step-list__step\"\n data-status={e.status}\n data-selectable={e.selectable || undefined}\n aria-current={e.status === 'current' ? 'step' : undefined}\n >\n {cell(e)}\n </li>\n ))}\n </ol>\n {current ? (\n <p className=\"ty-step-list__now\" aria-hidden=\"true\">\n {current.step.name}\n </p>\n ) : null}\n </nav>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Button as AriaButton, Tooltip, TooltipTrigger } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport type ToolbarTriggerControls = 'menu' | 'dialog' | 'none'\n\nexport interface ToolbarTriggerProps {\n /** Decorative glyph. */\n icon: ReactNode\n /** Accessible name. When a caption is visible the name also carries it (WCAG 2.5.3). */\n label: string\n /** Very short visible text after the icon (a locale code, a word). */\n caption?: string\n onPress?: () => void\n /** Kind of surface the trigger opens; sets `aria-haspopup`. */\n controls?: ToolbarTriggerControls\n expanded?: boolean\n /** Toggle state for switch-like triggers (for example a focus mode). */\n pressed?: boolean\n disabled?: boolean\n className?: string\n id?: string\n}\n\n/** Label-in-name: keep the visible caption inside the accessible name. */\nfunction nameWithCaption(label: string, caption?: string): string {\n if (!caption) return label\n return label.toLocaleLowerCase().includes(caption.toLocaleLowerCase()) ? label : `${label}, ${caption}`\n}\n\nconst popupFor: Record<ToolbarTriggerControls, 'menu' | 'dialog' | undefined> = { menu: 'menu', dialog: 'dialog', none: undefined }\n\n/** Compact bar button that opens a menu, drawer or flyout (spec: wave-2/toolbar-trigger.md). */\nexport function ToolbarTrigger(props: ToolbarTriggerProps) {\n const name = nameWithCaption(props.label, props.caption)\n const control = (\n <AriaButton\n id={props.id}\n className={cx('ty-toolbar-trigger', props.className)}\n aria-label={name}\n aria-haspopup={popupFor[props.controls ?? 'none']}\n aria-expanded={props.expanded}\n aria-pressed={props.pressed}\n isDisabled={props.disabled}\n onPress={() => props.onPress?.()}\n data-captioned={props.caption ? true : undefined}\n data-expanded-state={props.expanded ? true : undefined}\n data-toggled={props.pressed ? true : undefined}\n >\n <span className=\"ty-toolbar-trigger__glyph\" aria-hidden=\"true\">\n {props.icon}\n </span>\n {props.caption ? (\n <span className=\"ty-toolbar-trigger__caption\" aria-hidden=\"true\">\n {props.caption}\n </span>\n ) : null}\n </AriaButton>\n )\n // Icon-only triggers show their name as a tooltip on hover and focus.\n if (props.caption) return control\n return (\n <TooltipTrigger delay={400}>\n {control}\n <Tooltip className=\"ty-toolbar-trigger__tip\" offset={6}>\n {props.label}\n </Tooltip>\n </TooltipTrigger>\n )\n}\n","import { X } from 'lucide-react'\nimport { useEffect, useRef, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { StepList } from '../step-list/StepList'\n\nexport interface WizardStep {\n id: string\n title: string\n description?: string\n icon?: ReactNode\n}\n\nexport interface WizardPageProps {\n /** Flow title; also names the StepList. */\n title: string\n subtitle?: string\n eyebrow: string\n icon: ReactNode\n steps: WizardStep[]\n currentIndex: number\n onStepChange: (index: number) => void\n onSubmit: () => void\n onCancel: () => void\n canAdvance?: boolean\n submitting?: boolean\n submitLabel?: string\n aside?: ReactNode\n /** When the step body is a form, the primary submits it (`form` = its id). */\n form?: string\n children?: ReactNode\n className?: string\n}\n\n/** Moves focus to the heading whenever the step index changes after mount. */\nfunction useAnnounceStep(index: number, heading: React.RefObject<HTMLHeadingElement | null>) {\n const shown = useRef(index)\n useEffect(() => {\n if (shown.current === index) return\n shown.current = index\n heading.current?.focus()\n }, [index, heading])\n}\n\n/** Keeps the document title in step with the flow; restores it on unmount. */\nfunction useStepDocumentTitle(text: string) {\n useEffect(() => {\n if (typeof document === 'undefined') return\n const before = document.title\n document.title = text\n return () => {\n document.title = before\n }\n }, [text])\n}\n\n/** Full-page frame for a multi-step creation flow (spec: wave-2/wizard-page.md). */\nexport function WizardPage(props: WizardPageProps) {\n const copy = useMessages().wizardPage\n const heading = useRef<HTMLHeadingElement>(null)\n const last = props.steps.length - 1\n const at = Math.min(Math.max(0, props.currentIndex), Math.max(0, last))\n const step = props.steps[at]\n const busy = props.submitting ?? false\n const onFinal = at === last\n\n useAnnounceStep(at, heading)\n useStepDocumentTitle(step ? copy.documentTitle(step.title, props.title) : props.title)\n\n const goBack = () => (at === 0 ? props.onCancel() : props.onStepChange(at - 1))\n const goOn = () => (onFinal ? props.onSubmit() : props.onStepChange(at + 1))\n const primaryText = onFinal ? (props.submitLabel ?? copy.submit) : copy.next\n\n return (\n <div className={cx('ty-wizard-page', props.className)} aria-busy={busy || undefined}>\n <div className=\"ty-wizard-page__head\">\n <div className=\"ty-wizard-page__top\">\n <p className=\"ty-wizard-page__eyebrow\">\n <span aria-hidden=\"true\" className=\"ty-wizard-page__eyebrow-icon\">\n {props.icon}\n </span>\n {props.eyebrow}\n </p>\n <Button variant=\"quiet\" iconOnly shape=\"circle\" accessibleLabel={copy.close} leadingIcon={<X />} onPress={props.onCancel} />\n </div>\n <h1 ref={heading} tabIndex={-1} className=\"ty-wizard-page__title\">\n {step?.title ?? props.title}\n </h1>\n {(step?.description ?? props.subtitle) ? <p className=\"ty-wizard-page__lead\">{step?.description ?? props.subtitle}</p> : null}\n {props.aside ? <div className=\"ty-wizard-page__aside\">{props.aside}</div> : null}\n <StepList\n label={props.title}\n currentIndex={at}\n steps={props.steps.map((s) => ({ id: s.id, name: s.title, icon: s.icon }))}\n onStepSelect={busy ? undefined : props.onStepChange}\n />\n </div>\n <div className=\"ty-wizard-page__body\" key={step?.id}>\n {props.children}\n </div>\n <div className=\"ty-wizard-page__nav\" role=\"group\" aria-label={copy.actions}>\n <Button onPress={goBack} disabled={busy}>\n {at === 0 ? copy.cancel : copy.previous}\n </Button>\n <Button\n variant=\"primary\"\n type={props.form ? 'submit' : 'button'}\n form={props.form}\n onPress={props.form ? undefined : goOn}\n disabled={!(props.canAdvance ?? true) && !busy}\n busy={busy}\n busyLabel={copy.submitting}\n >\n {primaryText}\n </Button>\n </div>\n <span role=\"status\" className=\"ty-visually-hidden\">\n {busy ? copy.submitting : ''}\n </span>\n </div>\n )\n}\n","import { ChevronDown } from 'lucide-react'\nimport { createElement, useId, type ReactNode } from 'react'\nimport { Button, Disclosure, DisclosurePanel } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport type SectionPanelScale = 'section' | 'surface' | 'banner' | 'display'\nexport type SectionPanelElevation = 'sheet' | 'raised' | 'flat'\n\nexport interface SectionPanelProps {\n title: string\n eyebrow?: string\n eyebrowAside?: ReactNode\n subtitle?: ReactNode\n icon?: ReactNode\n scale?: SectionPanelScale\n headingLevel?: 1 | 2 | 3\n actions?: ReactNode\n aside?: ReactNode\n toolbar?: ReactNode\n tags?: ReactNode\n elevation?: SectionPanelElevation\n accentStripe?: boolean\n padded?: boolean\n collapsible?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n children?: ReactNode\n className?: string\n}\n\ninterface HeadParts {\n titleId: string\n props: SectionPanelProps\n /** Wraps the icon, title and chevron in the disclosure trigger when collapsible. */\n trigger: boolean\n}\n\n/** Title line: a heading, whose content becomes the trigger button when collapsible. */\nfunction TitleLine({ titleId, props, trigger }: HeadParts) {\n const words = (\n <>\n {props.icon ? (\n <span className=\"ty-section-panel__icon\" aria-hidden=\"true\">\n {props.icon}\n </span>\n ) : null}\n <span id={titleId} className=\"ty-section-panel__title-text\">\n {props.title}\n </span>\n </>\n )\n const inner = trigger ? (\n <Button slot=\"trigger\" className=\"ty-section-panel__trigger\">\n {words}\n <ChevronDown className=\"ty-icon ty-section-panel__chevron\" aria-hidden=\"true\" focusable=\"false\" />\n </Button>\n ) : (\n words\n )\n return createElement(`h${props.headingLevel ?? 2}`, { className: 'ty-section-panel__title' }, inner)\n}\n\nfunction Head(parts: HeadParts) {\n const { props } = parts\n const trailing = props.aside || props.actions\n return (\n <div className=\"ty-section-panel__head\">\n <div className=\"ty-section-panel__lead\">\n {props.eyebrow || props.eyebrowAside ? (\n <div className=\"ty-section-panel__eyebrow\">\n {props.eyebrow ? <span>{props.eyebrow}</span> : null}\n {props.eyebrowAside}\n </div>\n ) : null}\n <TitleLine {...parts} />\n {props.subtitle ? <p className=\"ty-section-panel__subtitle\">{props.subtitle}</p> : null}\n </div>\n {/* Actions stay outside the trigger: each is its own tab stop. */}\n {trailing ? (\n <div className=\"ty-section-panel__trailing\">\n {props.aside}\n {props.actions}\n </div>\n ) : null}\n </div>\n )\n}\n\nfunction Content({ props }: { props: SectionPanelProps }) {\n return (\n <>\n {props.toolbar ? <div className=\"ty-section-panel__toolbar\">{props.toolbar}</div> : null}\n {props.tags ? <div className=\"ty-section-panel__tags\">{props.tags}</div> : null}\n <div className=\"ty-section-panel__body\" data-padded={props.padded === false ? 'false' : 'true'}>\n {props.children}\n </div>\n </>\n )\n}\n\n/** A titled block (sheet) of a page, optionally collapsible (spec: wave-2/section-panel.md). */\nexport function SectionPanel(props: SectionPanelProps) {\n const titleId = useId()\n const shell = {\n className: cx('ty-section-panel', props.className),\n 'data-scale': props.scale ?? 'section',\n 'data-elevation': props.elevation ?? 'sheet',\n 'aria-labelledby': titleId,\n }\n const stripe = props.accentStripe ? <span className=\"ty-section-panel__stripe\" aria-hidden=\"true\" /> : null\n\n if (!props.collapsible) {\n return (\n <section {...shell}>\n {stripe}\n <Head titleId={titleId} props={props} trigger={false} />\n <Content props={props} />\n </section>\n )\n }\n\n const controlled = props.open !== undefined\n return (\n <section {...shell}>\n {stripe}\n <Disclosure\n className=\"ty-section-panel__disclosure\"\n {...(controlled ? { isExpanded: props.open } : { defaultExpanded: props.defaultOpen ?? true })}\n onExpandedChange={props.onOpenChange}\n >\n <Head titleId={titleId} props={props} trigger />\n <DisclosurePanel className=\"ty-section-panel__panel\" role=\"region\" aria-labelledby={titleId}>\n <Content props={props} />\n </DisclosurePanel>\n </Disclosure>\n </section>\n )\n}\n","import { ChevronRight } from 'lucide-react'\nimport { Children, isValidElement, useRef, type KeyboardEvent, type ReactElement, type ReactNode } from 'react'\nimport { GridList, GridListItem } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\n\nexport interface ListPanelRowProps {\n id?: string\n leading?: ReactNode\n trailing?: ReactNode\n /** Makes the row activatable. */\n onAction?: () => void\n /** Makes the row a link through the router adapter. */\n href?: string\n disabled?: boolean\n /** Plain text of the row for type-ahead (defaults to the text children). */\n textValue?: string\n children: ReactNode\n}\n\n/**\n * One row of a ListPanel. It renders nothing by itself: the panel reads the\n * rows and draws them in the list, grid or feed form.\n */\nexport function ListPanelRow(_props: ListPanelRowProps): null {\n return null\n}\n\nexport interface ListPanelProps {\n children: ReactNode\n elevation?: 'sheet' | 'raised'\n /** Accessible name of the list (required for activatable rows and feeds). */\n label?: string\n /** `feed`: APG Feed for long, streaming lists. */\n as?: 'list' | 'feed'\n className?: string\n}\n\ninterface RowSpec extends ListPanelRowProps {\n key: string\n}\n\n/** Reads the declarative rows into plain data. */\nfunction collectRows(children: ReactNode): RowSpec[] {\n const rows: RowSpec[] = []\n Children.forEach(children, (child, index) => {\n if (!isValidElement(child) || child.type !== ListPanelRow) return\n const props = (child as ReactElement<ListPanelRowProps>).props\n rows.push({ ...props, key: props.id ?? String(child.key ?? index) })\n })\n return rows\n}\n\nfunction RowBody({ row, chevron }: { row: RowSpec; chevron?: boolean }) {\n return (\n <>\n {row.leading ? <span className=\"ty-list-panel__leading\">{row.leading}</span> : null}\n <span className=\"ty-list-panel__main\">{row.children}</span>\n {row.trailing ? <span className=\"ty-list-panel__trailing\">{row.trailing}</span> : null}\n {chevron ? <ChevronRight className=\"ty-icon ty-mirror-rtl ty-list-panel__chevron\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n </>\n )\n}\n\nconst textOf = (row: RowSpec) => row.textValue ?? (typeof row.children === 'string' ? row.children : undefined)\n\n/** Page Down / Page Up move between feed articles (APG Feed). */\nfunction feedKeys(event: KeyboardEvent<HTMLDivElement>) {\n const step = event.key === 'PageDown' ? 1 : event.key === 'PageUp' ? -1 : 0\n if (!step) return\n const articles = Array.from(event.currentTarget.querySelectorAll<HTMLElement>(':scope > article'))\n const current = articles.findIndex((a) => a.contains(document.activeElement))\n const next = articles[Math.min(articles.length - 1, Math.max(0, current + step))]\n if (!next) return\n event.preventDefault()\n next.focus()\n}\n\nfunction FeedForm({ rows, label }: { rows: RowSpec[]; label?: string }) {\n const feedRef = useRef<HTMLDivElement>(null)\n return (\n <div ref={feedRef} role=\"feed\" aria-label={label} className=\"ty-list-panel__rows\" onKeyDown={feedKeys}>\n {rows.map((row, i) => (\n <article key={row.key} className=\"ty-list-panel__row\" tabIndex={0} aria-posinset={i + 1} aria-setsize={rows.length}>\n <RowBody row={row} />\n </article>\n ))}\n </div>\n )\n}\n\nfunction GridForm({ rows, label }: { rows: RowSpec[]; label?: string }) {\n return (\n <GridList aria-label={label} className=\"ty-list-panel__rows\" data-form=\"grid\">\n {rows.map((row) => (\n <GridListItem\n key={row.key}\n id={row.key}\n textValue={textOf(row)}\n onAction={row.onAction}\n href={row.href}\n isDisabled={row.disabled}\n className=\"ty-list-panel__row\"\n data-actionable={row.onAction || row.href ? '' : undefined}\n >\n <RowBody row={row} chevron={!!(row.onAction || row.href) && !row.trailing} />\n </GridListItem>\n ))}\n </GridList>\n )\n}\n\nfunction StaticForm({ rows, label }: { rows: RowSpec[]; label?: string }) {\n return (\n <ul className=\"ty-list-panel__rows\" aria-label={label}>\n {rows.map((row) => (\n <li key={row.key} className=\"ty-list-panel__row\">\n <RowBody row={row} />\n </li>\n ))}\n </ul>\n )\n}\n\n/** A surface of divided rows for short lists (spec: wave-2/list-panel.md). */\nexport function ListPanel({ children, elevation = 'sheet', label, as = 'list', className }: ListPanelProps) {\n const rows = collectRows(children)\n const actionable = rows.some((r) => r.onAction || r.href)\n const form = as === 'feed' ? 'feed' : actionable ? 'grid' : 'static'\n devWarning(form !== 'static' && !label, 'ListPanel: activatable rows and feeds need `label`.')\n const Form = form === 'feed' ? FeedForm : form === 'grid' ? GridForm : StaticForm\n return (\n <div className={cx('ty-list-panel', className)} data-elevation={elevation} data-form={form}>\n <Form rows={rows} label={label} />\n </div>\n )\n}\n","import { createElement, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\n\nexport interface SummaryPair {\n label: string\n value: ReactNode\n}\n\nexport interface SummaryRowProps {\n title: ReactNode\n subtitle?: ReactNode\n /** Decorative icon; no tile is drawn without it. */\n icon?: ReactNode\n metadata?: SummaryPair[]\n /** Renders the title as a heading when the row opens a section. */\n titleLevel?: 'none' | 3 | 4\n iconTone?: 'accent' | 'neutral'\n className?: string\n}\n\n/** Plain text of a node, used as the tooltip of truncated lines. */\nfunction plainText(node: ReactNode): string | undefined {\n if (typeof node === 'string') return node\n if (typeof node === 'number') return String(node)\n return undefined\n}\n\nfunction TitleLine({ level, children }: { level: SummaryRowProps['titleLevel']; children: ReactNode }) {\n const tag = level === 3 || level === 4 ? `h${level}` : 'p'\n return createElement(tag, { className: 'ty-summary-row__title', title: plainText(children) }, children)\n}\n\nfunction PairList({ pairs }: { pairs: SummaryPair[] }) {\n if (pairs.length === 0) return null\n return (\n <dl className=\"ty-summary-row__pairs\">\n {pairs.map((pair, index) => (\n <div className=\"ty-summary-row__pair\" key={`${pair.label}:${index}`}>\n <dt>{pair.label}</dt>\n <dd>{pair.value}</dd>\n </div>\n ))}\n </dl>\n )\n}\n\n/**\n * Presentational core of rows and cards: icon tile, title, subtitle and a\n * wrapping line of label/value pairs (spec: wave-2/summary-row.md).\n */\nexport function SummaryRow(props: SummaryRowProps) {\n const pairs = props.metadata ?? []\n const tile = props.icon ? (\n <span className=\"ty-summary-row__tile\" data-tone={props.iconTone ?? 'neutral'} aria-hidden=\"true\">\n {props.icon}\n </span>\n ) : null\n return (\n <div className={cx('ty-summary-row', props.className)}>\n {tile}\n <div className=\"ty-summary-row__text\">\n <TitleLine level={props.titleLevel}>{props.title}</TitleLine>\n {props.subtitle ? (\n <p className=\"ty-summary-row__subtitle\" title={plainText(props.subtitle)}>\n {props.subtitle}\n </p>\n ) : null}\n <PairList pairs={pairs} />\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { SummaryRow, type SummaryPair } from '../summary-row/SummaryRow'\n\nexport interface ListRowAction {\n label: string\n onPress: () => void\n tone?: 'neutral' | 'danger'\n disabled?: boolean\n}\n\nexport type ListRowVariant = 'surface' | 'compact' | 'card' | 'emphasised'\n\nexport interface ListRowProps {\n title: ReactNode\n subtitle?: ReactNode\n icon?: ReactNode\n metadata?: SummaryPair[]\n actions?: ListRowAction[]\n variant?: ListRowVariant\n /**\n * Item name appended (visually hidden) to every action name so repeated\n * labels stay distinct (\"Edit, Survey A\"). Defaults to `title` when it is text.\n */\n itemLabel?: string\n /** Text marker of the emphasised variant; defaults to the localised \"Current\". */\n emphasisLabel?: string\n className?: string\n}\n\nfunction ActionStrip({ actions, suffix }: { actions: ListRowAction[]; suffix?: string }) {\n if (actions.length === 0) return null\n return (\n <div className=\"ty-list-row__actions\">\n {actions.map((action, i) => (\n <Button\n key={`${action.label}-${i}`}\n variant={action.tone === 'danger' ? 'danger' : 'quiet'}\n size=\"compact\"\n disabled={action.disabled}\n onPress={action.onPress}\n className=\"ty-list-row__action\"\n >\n {action.label}\n {suffix ? <span className=\"ty-visually-hidden\">, {suffix}</span> : null}\n </Button>\n ))}\n </div>\n )\n}\n\n/** One item: summary on the leading side, text actions on the trailing side (spec: wave-2/list-row.md). */\nexport function ListRow({ variant = 'surface', actions = [], itemLabel, emphasisLabel, className, ...summary }: ListRowProps) {\n const copy = useMessages().listRow\n const suffix = itemLabel ?? (typeof summary.title === 'string' ? summary.title : undefined)\n const marked = variant === 'emphasised'\n return (\n <div className={cx('ty-list-row', className)} data-variant={variant}>\n <div className=\"ty-list-row__summary\">\n <SummaryRow {...summary} iconTone={marked ? 'accent' : 'neutral'} />\n {marked ? <span className=\"ty-list-row__marker\">{emphasisLabel ?? copy.current}</span> : null}\n </div>\n <ActionStrip actions={actions} suffix={suffix} />\n </div>\n )\n}\n","// One polite live region for the whole document. Components that need to\n// report a change (a counter went up, a list was cleared) write into it\n// instead of each owning its own live region.\n\nconst REGION_ATTR = 'data-ty-polite-announcer'\n\nfunction region(): HTMLElement | null {\n if (typeof document === 'undefined') return null\n let node = document.querySelector<HTMLElement>(`[${REGION_ATTR}]`)\n if (!node) {\n node = document.createElement('div')\n node.setAttribute(REGION_ATTR, '')\n node.setAttribute('role', 'status')\n node.setAttribute('aria-live', 'polite')\n node.className = 'ty-visually-hidden'\n document.body.appendChild(node)\n }\n return node\n}\n\nlet generation = 0\n\n/** Sends `text` to the shared polite region. Repeating the same text re-announces it. */\nexport function announcePolitely(text: string): void {\n const node = region()\n if (!node) return\n const mine = ++generation\n node.textContent = ''\n // A fresh text node after clearing makes screen readers repeat identical messages.\n queueMicrotask(() => {\n if (mine === generation) node.textContent = text\n })\n}\n\n/** Test helper: the text currently in the shared region. */\nexport function politeAnnouncement(): string {\n return region()?.textContent ?? ''\n}\n","import { useEffect, useId, useRef, useState } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { announcePolitely } from '../../internal/data-a/announce'\nimport type { PluralNoun } from '../../internal/messages/data-a'\nimport { useMessages } from '../../internal/provider'\n\nexport interface CountBadgeProps {\n count: number\n /** Noun of the counted items, singular and plural. */\n itemNoun?: PluralNoun\n /** Above this the counter reads \"max+\"; the accessible text keeps the exact number. */\n max?: number\n tone?: 'attention' | 'neutral'\n /** Announce increases in the shared polite region. */\n announce?: boolean\n /**\n * Id of the accessible description. Point the host button's\n * `aria-describedby` at it, or place the badge inside the host button.\n */\n id?: string\n className?: string\n}\n\n/** The accessible sentence of a count (\"3 notifications\"). */\nexport function describeCount(count: number, noun: PluralNoun, phrase: (n: number, word: string) => string, locale?: string): string {\n // Plural category from CLDR rules (the \"one\" form is not only the number 1 in every language).\n return phrase(count, new Intl.PluralRules(locale).select(count) === 'one' ? noun.one : noun.other)\n}\n\n/** Remembers the last count and reports whether the latest render raised it. */\nfunction useRise(count: number): boolean {\n const last = useRef(count)\n const [rose, setRose] = useState(false)\n useEffect(() => {\n setRose(count > last.current)\n last.current = count\n }, [count])\n return rose\n}\n\n/** Counter pinned to the corner of an icon button (spec: wave-2/count-badge.md). */\nexport function CountBadge({ count, itemNoun, max = 99, tone = 'attention', announce = false, id, className }: CountBadgeProps) {\n const copy = useMessages().countBadge\n const { locale } = useLocale()\n const autoId = useId()\n const sentence = describeCount(count, itemNoun ?? copy.item, copy.describe, locale)\n const rose = useRise(count)\n\n useEffect(() => {\n if (announce && rose) announcePolitely(sentence)\n }, [announce, rose, sentence])\n\n if (count <= 0) return null\n // Locale digits; the plus sign marks the cap.\n const digits = new Intl.NumberFormat(locale)\n const shown = count > max ? `${digits.format(max)}+` : digits.format(count)\n return (\n <span className={cx('ty-count-badge', className)} data-tone={tone} data-changed={rose || undefined}>\n <span className=\"ty-count-badge__value\" aria-hidden=\"true\">\n {shown}\n </span>\n <span className=\"ty-visually-hidden\" id={id ?? autoId}>\n {sentence}\n </span>\n </span>\n )\n}\n","import { Bell, BellOff, CircleAlert, CircleCheck, Info, TriangleAlert, X } from 'lucide-react'\nimport { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { announcePolitely } from '../../internal/data-a/announce'\nimport type { DataAMessages } from '../../internal/messages/data-a'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { CountBadge } from '../count-badge/CountBadge'\nimport { useToast, type ToastTone } from '../toast/Toast'\n\nexport interface Notice {\n id: string\n tone: ToastTone\n title: string\n message?: string\n createdAt: number\n}\n\nexport interface NotificationCenterApi {\n /** Newest first, capped at `historyLimit`. */\n history: Notice[]\n isOpen: boolean\n open: () => void\n close: () => void\n remove: (id: string) => void\n clear: () => void\n /** Entries added since the drawer was last opened. */\n unseenCount: number\n}\n\nexport interface NotificationCenterProviderProps {\n historyLimit?: number\n onOpenChange?: (open: boolean) => void\n children: ReactNode\n}\n\nconst CenterContext = createContext<NotificationCenterApi | null>(null)\n\ninterface Ledger {\n removed: ReadonlySet<string>\n clearedAt: number\n seenAt: number\n}\n\n/**\n * Session history of the messages raised through the Toast service. Place it\n * inside `ToastProvider`: it reads the toast history, it never raises toasts.\n */\nexport function NotificationCenterProvider({ historyLimit = 50, onOpenChange, children }: NotificationCenterProviderProps) {\n const toast = useToast()\n const [isOpen, setOpen] = useState(false)\n const [ledger, setLedger] = useState<Ledger>({ removed: new Set(), clearedAt: -Infinity, seenAt: -Infinity })\n\n const history = useMemo(\n () =>\n toast.history\n .filter((t) => t.createdAt > ledger.clearedAt && !ledger.removed.has(t.id))\n .slice(0, historyLimit)\n .map(({ id, tone, title, message, createdAt }): Notice => ({ id, tone, title, message, createdAt })),\n [toast.history, ledger, historyLimit],\n )\n\n const toggle = useCallback(\n (next: boolean) => {\n setOpen(next)\n setLedger((l) => ({ ...l, seenAt: Date.now() }))\n onOpenChange?.(next)\n },\n [onOpenChange],\n )\n\n const api = useMemo<NotificationCenterApi>(\n () => ({\n history,\n isOpen,\n open: () => toggle(true),\n close: () => toggle(false),\n remove: (id) => setLedger((l) => ({ ...l, removed: new Set([...l.removed, id]) })),\n clear: () => setLedger((l) => ({ ...l, clearedAt: Date.now(), removed: new Set() })),\n unseenCount: isOpen ? 0 : history.filter((n) => n.createdAt > ledger.seenAt).length,\n }),\n [history, isOpen, toggle, ledger.seenAt],\n )\n\n return <CenterContext.Provider value={api}>{children}</CenterContext.Provider>\n}\n\nexport function useNotificationCenter(): NotificationCenterApi {\n const ctx = useContext(CenterContext)\n if (!ctx) throw new Error('useNotificationCenter() must be used inside <NotificationCenterProvider>.')\n return ctx\n}\n\ntype TimeCopy = DataAMessages['notificationCenter']['time']\n\n/** Localised \"5 minutes ago\" style phrase. */\nexport function relativeNoticeTime(createdAt: number, now: number, copy: TimeCopy): string {\n const minutes = Math.floor(Math.max(0, now - createdAt) / 60000)\n if (minutes < 1) return copy.justNow\n if (minutes < 60) return copy.minutes(minutes)\n const hours = Math.floor(minutes / 60)\n return hours < 24 ? copy.hours(hours) : copy.days(Math.floor(hours / 24))\n}\n\nconst TONE_GLYPH = { success: CircleCheck, error: CircleAlert, warning: TriangleAlert, info: Info } as const\n\nfunction Entry({ notice, now, onDismiss, buttonRef }: { notice: Notice; now: number; onDismiss: () => void; buttonRef: (el: HTMLElement | null) => void }) {\n const copy = useMessages().notificationCenter\n const Glyph = TONE_GLYPH[notice.tone]\n return (\n <li className=\"ty-notification-center__entry\" data-tone={notice.tone}>\n <Glyph className=\"ty-icon ty-notification-center__glyph\" aria-hidden=\"true\" focusable=\"false\" />\n <div className=\"ty-notification-center__text\">\n <p className=\"ty-notification-center__tone\">{copy.tone[notice.tone]}</p>\n <p className=\"ty-notification-center__title\">{notice.title}</p>\n {notice.message ? <p className=\"ty-notification-center__message\">{notice.message}</p> : null}\n <p className=\"ty-notification-center__time\">{relativeNoticeTime(notice.createdAt, now, copy.time)}</p>\n </div>\n <Button\n ref={buttonRef}\n variant=\"quiet\"\n size=\"compact\"\n shape=\"circle\"\n iconOnly\n accessibleLabel={copy.dismiss(notice.title)}\n leadingIcon={<X />}\n onPress={onDismiss}\n />\n </li>\n )\n}\n\n/** Where focus goes after an entry leaves: next, else previous, else the title. */\nfunction useFocusAfterRemoval(ids: string[]) {\n const buttons = useRef(new Map<string, HTMLElement>())\n const titleRef = useRef<HTMLHeadingElement>(null)\n const pending = useRef<number | null>(null)\n useEffect(() => {\n if (pending.current === null) return\n const index = Math.min(pending.current, ids.length - 1)\n pending.current = null\n const target = index >= 0 ? buttons.current.get(ids[index]!) : titleRef.current\n target?.focus()\n }, [ids])\n const bind = (id: string) => (el: HTMLElement | null) => {\n if (el) buttons.current.set(id, el)\n else buttons.current.delete(id)\n }\n return { bind, titleRef, markRemoved: (index: number) => (pending.current = index) }\n}\n\nexport interface NotificationCenterProps {\n className?: string\n}\n\n/** Bell button with unseen count and the history drawer (spec: wave-2/notification-center.md). */\nexport function NotificationCenter({ className }: NotificationCenterProps) {\n const center = useNotificationCenter()\n const messages = useMessages()\n const copy = messages.notificationCenter\n const closeLabel = messages.close\n const ids = useMemo(() => center.history.map((n) => n.id), [center.history])\n const focus = useFocusAfterRemoval(ids)\n const now = Date.now()\n\n const bellName = center.unseenCount > 0 ? copy.bellUnseen(copy.bell, center.unseenCount) : copy.bell\n const clearAll = () => {\n center.clear()\n announcePolitely(copy.cleared)\n focus.markRemoved(-1)\n }\n\n return (\n <span className={cx('ty-notification-center', className)}>\n <span className=\"ty-notification-center__bell\">\n <Button\n variant=\"quiet\"\n iconOnly\n accessibleLabel={bellName}\n leadingIcon={<Bell />}\n aria-haspopup=\"dialog\"\n aria-expanded={center.isOpen}\n onPress={center.open}\n />\n <CountBadge count={center.unseenCount} />\n </span>\n <ModalOverlay className=\"ty-notification-center__backdrop\" isOpen={center.isOpen} onOpenChange={(o) => !o && center.close()} isDismissable>\n <Modal className=\"ty-notification-center__drawer\">\n <Dialog className=\"ty-notification-center__dialog\">\n <header className=\"ty-notification-center__head\">\n <Bell className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <Heading slot=\"title\" level={2} ref={focus.titleRef} tabIndex={-1} className=\"ty-notification-center__heading\">\n {copy.title}\n </Heading>\n {center.history.length > 0 ? (\n <Button variant=\"quiet\" size=\"compact\" onPress={clearAll}>\n {copy.clearAll}\n </Button>\n ) : null}\n <Button variant=\"quiet\" size=\"compact\" shape=\"circle\" iconOnly accessibleLabel={closeLabel} leadingIcon={<X />} onPress={center.close} />\n </header>\n {center.history.length === 0 ? (\n <div className=\"ty-notification-center__empty\">\n <BellOff className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <p>{copy.empty}</p>\n </div>\n ) : (\n <ul className=\"ty-notification-center__list\">\n {center.history.map((notice, index) => (\n <Entry\n key={notice.id}\n notice={notice}\n now={now}\n buttonRef={focus.bind(notice.id)}\n onDismiss={() => {\n focus.markRemoved(index)\n center.remove(notice.id)\n }}\n />\n ))}\n </ul>\n )}\n </Dialog>\n </Modal>\n </ModalOverlay>\n </span>\n )\n}\n","import { UserRound } from 'lucide-react'\nimport { useEffect, useState } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type ProfileAvatarSize = 'sm' | 'md' | 'lg' | 'fill'\n\nexport interface ProfileAvatarProps {\n name?: string | null\n email?: string | null\n pictureUrl?: string | null\n /** Accessible name; defaults to name, then e-mail, then \"Profile\". */\n label?: string\n size?: ProfileAvatarSize\n /** Hide from assistive technology when the name is already visible beside it. */\n decorative?: boolean\n className?: string\n}\n\ntype Face = { kind: 'picture'; url: string } | { kind: 'letter'; letter: string } | { kind: 'glyph' }\n\n/** Chooses what the disc shows, in order: picture, initial, neutral glyph. */\nfunction pickFace(name: string | null | undefined, email: string | null | undefined, url: string | null | undefined, broken: boolean, locale?: string): Face {\n if (url && !broken) return { kind: 'picture', url }\n const source = [name, email].map((s) => s?.trim()).find(Boolean)\n // The first grapheme cluster (so marks and emoji stay whole), upper-cased with the locale's rules.\n const Seg = (Intl as { Segmenter?: typeof Intl.Segmenter }).Segmenter\n const first = source ? (Seg ? new Seg(locale, { granularity: 'grapheme' }).segment(source)[Symbol.iterator]().next().value?.segment : Array.from(source)[0]) : undefined\n return first ? { kind: 'letter', letter: first.toLocaleUpperCase(locale) } : { kind: 'glyph' }\n}\n\n/** The signed-in person as picture or initial on a disc (spec: wave-2/profile-avatar.md). */\nexport function ProfileAvatar(props: ProfileAvatarProps) {\n const fallbackLabel = useMessages().profileAvatar.profile\n const [broken, setBroken] = useState(false)\n useEffect(() => setBroken(false), [props.pictureUrl])\n\n const { locale } = useLocale()\n const face = pickFace(props.name, props.email, props.pictureUrl, broken, locale)\n const label = props.label ?? (props.name?.trim() || props.email?.trim() || fallbackLabel)\n const hidden = props.decorative === true\n const a11y = hidden ? { 'aria-hidden': true as const } : face.kind === 'picture' ? {} : { role: 'img', 'aria-label': label }\n\n return (\n <span className={cx('ty-profile-avatar', props.className)} data-size={props.size ?? 'fill'} data-face={face.kind} {...a11y}>\n {face.kind === 'picture' ? (\n <img className=\"ty-profile-avatar__picture\" src={face.url} alt={hidden ? '' : label} onError={() => setBroken(true)} />\n ) : face.kind === 'letter' ? (\n <span className=\"ty-profile-avatar__letter\" aria-hidden=\"true\">\n {face.letter}\n </span>\n ) : (\n <UserRound className=\"ty-profile-avatar__glyph\" aria-hidden=\"true\" focusable=\"false\" />\n )}\n </span>\n )\n}\n","// Clipboard write that never throws: resolves true when the platform accepted it.\nexport async function writeClipboard(text: string): Promise<boolean> {\n const api = typeof navigator === 'undefined' ? undefined : navigator.clipboard\n if (!api || typeof api.writeText !== 'function') return false\n try {\n await api.writeText(text)\n return true\n } catch {\n return false\n }\n}\n","import { Check, Copy } from 'lucide-react'\nimport { useEffect, useReducer, useRef, type SyntheticEvent, type CSSProperties } from 'react'\nimport { Button, Tooltip, TooltipTrigger } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { writeClipboard } from '../../internal/data-a/clipboard'\nimport { useMessages } from '../../internal/provider'\n\nexport interface CopyIdentifierProps {\n /** Identifier shown (shortened). */\n value: string\n /** Text placed on the clipboard; defaults to `value`. */\n copyValue?: string\n /** Verb before the value in the accessible name (\"Copy: …\"). */\n label?: string\n /** Characters shown before the ellipsis. */\n visibleLength?: number\n onCopy?: (ok: boolean) => void\n className?: string\n}\n\n/** Time the confirmation stays visible, in ms. */\nexport const COPY_CONFIRMATION_MS = 2000\n\ntype Phase = 'idle' | 'copied' | 'failed'\ntype PhaseEvent = { type: 'result'; ok: boolean } | { type: 'reset' }\n\nfunction phaseReducer(_: Phase, event: PhaseEvent): Phase {\n if (event.type === 'reset') return 'idle'\n return event.ok ? 'copied' : 'failed'\n}\n\n/**\n * First `n` grapheme clusters and an ellipsis, for plain-text contexts (file\n * names, logs). The component itself never cuts text: it shows the whole\n * value and lets CSS elide it at `visibleLength` character widths.\n */\nexport function shortenIdentifier(value: string, n: number): string {\n const Seg = (Intl as { Segmenter?: typeof Intl.Segmenter }).Segmenter\n const units = Seg ? Array.from(new Seg(undefined, { granularity: 'grapheme' }).segment(value), (g) => g.segment) : Array.from(value)\n return units.length <= n ? value : `${units.slice(0, n).join('')}…`\n}\n\nconst stop = (e: SyntheticEvent) => e.stopPropagation()\n\n/** Shortened identifier that copies its full value (spec: wave-2/copy-identifier.md). */\nexport function CopyIdentifier({ value, copyValue, label, visibleLength = 8, onCopy, className }: CopyIdentifierProps) {\n const copy = useMessages().copyIdentifier\n const [phase, send] = useReducer(phaseReducer, 'idle')\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n\n useEffect(() => () => clearTimeout(timer.current), [])\n\n const run = async () => {\n const ok = await writeClipboard(copyValue ?? value)\n send({ type: 'result', ok })\n onCopy?.(ok)\n clearTimeout(timer.current)\n if (ok) timer.current = setTimeout(() => send({ type: 'reset' }), COPY_CONFIRMATION_MS)\n }\n\n const Icon = phase === 'copied' ? Check : Copy\n const status = phase === 'copied' ? copy.copiedStatus(value) : phase === 'failed' ? copy.failed : ''\n\n return (\n // The wrapper keeps clicks from reaching a clickable parent row or card.\n <span className={cx('ty-copy-identifier', className)} data-phase={phase} onClick={stop} onPointerDown={stop} onKeyDown={stop}>\n <TooltipTrigger delay={300}>\n <Button className=\"ty-copy-identifier__trigger\" aria-label={`${label ?? copy.copy}: ${value}`} onPress={() => void run()}>\n <Icon className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span\n className=\"ty-copy-identifier__text\"\n aria-hidden=\"true\"\n dir={phase === 'copied' ? undefined : 'ltr'}\n data-elided={phase === 'copied' ? undefined : ''}\n style={{ '--ty-copy-visible': visibleLength } as CSSProperties}\n >\n {phase === 'copied' ? copy.copied : value}\n </span>\n </Button>\n <Tooltip className=\"ty-copy-identifier__tooltip\" offset={6}>\n {value}\n </Tooltip>\n </TooltipTrigger>\n <span className=\"ty-visually-hidden\" role=\"status\">\n {status}\n </span>\n </span>\n )\n}\n","import { ChevronRight } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { Button, Disclosure, DisclosureGroup, DisclosurePanel, type Key } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { Skeleton } from '../skeleton/Skeleton'\n\nexport interface HistoryEntry {\n id: string\n /** Leading part of the header: ActorChip, then the date (§2.11). */\n start: ReactNode\n end?: ReactNode\n summary?: ReactNode\n details?: ReactNode\n}\n\nexport interface HistoryListProps {\n items: HistoryEntry[]\n loading?: boolean\n loadingLabel: string\n emptyLabel: string\n expansion?: 'single' | 'multiple'\n expandedIds?: string[]\n defaultExpandedIds?: string[]\n onExpandedChange?: (ids: string[]) => void\n /** Number of skeleton rows while loading. */\n skeletonRows?: number\n className?: string\n}\n\nfunction HeaderText({ entry }: { entry: HistoryEntry }) {\n return (\n <span className=\"ty-history-list__header-text\">\n <span className=\"ty-history-list__line\">\n <span className=\"ty-history-list__start\">{entry.start}</span>\n {entry.end ? <span className=\"ty-history-list__end\">{entry.end}</span> : null}\n </span>\n {entry.summary ? <span className=\"ty-history-list__summary\">{entry.summary}</span> : null}\n </span>\n )\n}\n\n/** An entry with details: a disclosure whose header is the trigger. */\nfunction OpenableEntry({ entry }: { entry: HistoryEntry }) {\n return (\n <Disclosure id={entry.id} className=\"ty-history-list__entry\" data-openable=\"\">\n <Button slot=\"trigger\" className=\"ty-history-list__header\">\n <ChevronRight className=\"ty-icon ty-mirror-rtl ty-history-list__chevron\" aria-hidden=\"true\" focusable=\"false\" />\n <HeaderText entry={entry} />\n </Button>\n <DisclosurePanel className=\"ty-history-list__details\">{entry.details}</DisclosurePanel>\n </Disclosure>\n )\n}\n\n/** An entry without details: a static header, no button, no chevron. */\nfunction StaticEntry({ entry }: { entry: HistoryEntry }) {\n return (\n <div className=\"ty-history-list__entry\">\n <div className=\"ty-history-list__header\" data-static=\"\">\n <HeaderText entry={entry} />\n </div>\n </div>\n )\n}\n\nconst toIds = (keys: Set<Key>) => [...keys].map(String)\n\n/** Past entries whose headers expand to details (spec: wave-2/history-list.md). */\nexport function HistoryList(props: HistoryListProps) {\n const { items, loading = false, expansion = 'single', skeletonRows = 3 } = props\n\n if (loading) {\n return (\n <div className={cx('ty-history-list', props.className)} aria-busy=\"true\" data-state=\"loading\">\n <span role=\"status\" className=\"ty-visually-hidden\">\n {props.loadingLabel}\n </span>\n {Array.from({ length: skeletonRows }, (_, i) => (\n <div className=\"ty-history-list__ghost\" key={i} aria-hidden=\"true\">\n <Skeleton width=\"medium\" />\n <Skeleton width=\"short\" />\n </div>\n ))}\n </div>\n )\n }\n\n if (items.length === 0) {\n return (\n <p className={cx('ty-history-list', 'ty-history-list__empty', props.className)} data-state=\"empty\">\n {props.emptyLabel}\n </p>\n )\n }\n\n const selection =\n props.expandedIds !== undefined ? { expandedKeys: props.expandedIds } : { defaultExpandedKeys: props.defaultExpandedIds ?? [] }\n\n return (\n <DisclosureGroup\n className={cx('ty-history-list', props.className)}\n allowsMultipleExpanded={expansion === 'multiple'}\n onExpandedChange={(keys) => props.onExpandedChange?.(toIds(keys))}\n {...selection}\n >\n <ol className=\"ty-history-list__items\">\n {items.map((entry) => (\n <li key={entry.id} className=\"ty-history-list__item\">\n {entry.details == null ? <StaticEntry entry={entry} /> : <OpenableEntry entry={entry} />}\n </li>\n ))}\n </ol>\n </DisclosureGroup>\n )\n}\n","// GroupedDisclosureList (spec: wave-2/grouped-disclosure-list.md).\n//\n// Items in named sections whose bodies open and close independently. The\n// public API speaks in collapsed keys (all open by default); React Aria's\n// DisclosureGroup speaks in expanded keys; `complement` turns one into the other.\nimport { ChevronDown } from 'lucide-react'\nimport { useMemo, type KeyboardEvent, type ReactNode } from 'react'\nimport { Button, Disclosure, DisclosureGroup, DisclosurePanel } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport interface ItemSection<T, M = unknown> {\n key: string\n header: ReactNode\n items: T[]\n meta?: M\n}\n\nexport interface GroupedDisclosureListProps<T, M = unknown> {\n groups: ItemSection<T, M>[]\n renderItem: (item: T, group: ItemSection<T, M>) => ReactNode\n getItemKey: (item: T) => string\n collapsedKeys?: string[]\n defaultCollapsedKeys?: string[]\n onCollapsedChange?: (keys: string[]) => void\n headingLevel?: 2 | 3 | 4 | 5 | 6\n className?: string\n}\n\ntype Level = NonNullable<GroupedDisclosureListProps<unknown>['headingLevel']>\nconst HEADING_TAG = { 2: 'h2', 3: 'h3', 4: 'h4', 5: 'h5', 6: 'h6' } as const satisfies Record<Level, string>\n\nconst TOGGLE_ATTR = 'data-ty-section-toggle'\n\n/** Where each optional accordion key sends focus, given the current index and the count. */\nconst HOPS: Record<string, (i: number, n: number) => number> = {\n ArrowDown: (i, n) => (i + 1) % n,\n ArrowUp: (i, n) => (i + n - 1) % n,\n Home: () => 0,\n End: (_i, n) => n - 1,\n}\n\n/** APG accordion's optional keys, handled in the capture phase (RAC buttons stop bubbling). */\nfunction hopBetweenToggles(event: KeyboardEvent<HTMLElement>) {\n const hop = HOPS[event.key]\n const from = event.target as HTMLElement\n if (!hop || !from.hasAttribute(TOGGLE_ATTR)) return\n const toggles = [...event.currentTarget.querySelectorAll<HTMLElement>(`[${TOGGLE_ATTR}]`)]\n event.preventDefault()\n toggles[hop(toggles.indexOf(from), toggles.length)]?.focus()\n}\n\nfunction SectionBody<T, M>(props: { section: ItemSection<T, M>; draw: GroupedDisclosureListProps<T, M>['renderItem']; idOf: (item: T) => string }) {\n return (\n <ul className=\"ty-grouped-list__items\">\n {props.section.items.map((entry) => (\n <li key={props.idOf(entry)} className=\"ty-grouped-list__item\">\n {props.draw(entry, props.section)}\n </li>\n ))}\n </ul>\n )\n}\n\nfunction SectionHead({ level, children }: { level: Level; children: ReactNode }) {\n const Tag = HEADING_TAG[level]\n return (\n <Tag className=\"ty-grouped-list__heading\">\n <Button slot=\"trigger\" className=\"ty-grouped-list__trigger\" {...{ [TOGGLE_ATTR]: '' }}>\n <span className=\"ty-grouped-list__header\">{children}</span>\n <ChevronDown className=\"ty-icon ty-grouped-list__chevron\" aria-hidden=\"true\" focusable=\"false\" />\n </Button>\n </Tag>\n )\n}\n\nexport function GroupedDisclosureList<T, M = unknown>(props: GroupedDisclosureListProps<T, M>) {\n const every = useMemo(() => props.groups.map((section) => section.key), [props.groups])\n const complement = (closed: Iterable<string>) => {\n const outside = new Set(closed)\n return every.filter((key) => !outside.has(key))\n }\n const openness =\n props.collapsedKeys === undefined ? { defaultExpandedKeys: complement(props.defaultCollapsedKeys ?? []) } : { expandedKeys: complement(props.collapsedKeys) }\n const report = (open: Set<unknown>) => props.onCollapsedChange?.(complement(Array.from(open, String)))\n\n return (\n <div className={cx('ty-grouped-list', props.className)} onKeyDownCapture={hopBetweenToggles}>\n <DisclosureGroup className=\"ty-grouped-list__groups\" allowsMultipleExpanded onExpandedChange={report} {...openness}>\n {props.groups.map((section) => (\n <Disclosure key={section.key} id={section.key} className=\"ty-grouped-list__group\">\n {({ isExpanded }) => (\n <>\n <SectionHead level={props.headingLevel ?? 3}>{section.header}</SectionHead>\n {/* A closed body is not rendered: out of the tree and the tab order. */}\n <DisclosurePanel className=\"ty-grouped-list__body\">\n {isExpanded && <SectionBody section={section} draw={props.renderItem} idOf={props.getItemKey} />}\n </DisclosurePanel>\n </>\n )}\n </Disclosure>\n ))}\n </DisclosureGroup>\n </div>\n )\n}\n","import { Copy, Download, Eye } from 'lucide-react'\nimport { useEffect, useRef, useState } from 'react'\nimport { cx } from '../../internal/cx'\nimport { writeClipboard } from '../../internal/data-a/clipboard'\nimport { requestHaptic } from '../../internal/haptics'\nimport type { DataAMessages } from '../../internal/messages/data-a'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\n\nexport type RecoveryCodeStrings = DataAMessages['recoveryCodes']\n\nexport interface RecoveryCodeListProps {\n codes: string[]\n revealed?: boolean\n onReveal?: () => void\n onCopyAll?: () => void\n allowDownload?: boolean\n fileName?: string\n /** Overrides of any text, including the lines of the downloaded file. */\n strings?: Partial<RecoveryCodeStrings>\n /** Generation time written into the file; defaults to the moment of download. */\n generatedAt?: Date\n className?: string\n}\n\n/** Body of the downloaded file: title, ISO time, keep-safe sentence, then numbered codes. */\nexport function recoveryCodesFile(codes: string[], strings: Pick<RecoveryCodeStrings, 'fileTitle' | 'generatedAt' | 'keepSafe'>, at: Date): string {\n const header = [strings.fileTitle, strings.generatedAt(at.toISOString()), strings.keepSafe, '']\n const body = codes.map((code, i) => `${i + 1}. ${code}`)\n return [...header, ...body, ''].join('\\n')\n}\n\nfunction saveText(name: string, text: string) {\n const url = URL.createObjectURL(new Blob([text], { type: 'text/plain;charset=utf-8' }))\n const anchor = document.createElement('a')\n anchor.href = url\n anchor.download = name\n anchor.rel = 'noopener'\n anchor.click()\n URL.revokeObjectURL(url)\n}\n\ntype Feedback = '' | 'copied' | 'failed'\n\n/** One-use recovery codes with copy and download (spec: wave-2/recovery-code-list.md). */\nexport function RecoveryCodeList(props: RecoveryCodeListProps) {\n const { codes, revealed = true, allowDownload = true } = props\n const text: RecoveryCodeStrings = { ...useMessages().recoveryCodes, ...props.strings }\n const [feedback, setFeedback] = useState<Feedback>('')\n const clear = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n useEffect(() => () => clearTimeout(clear.current), [])\n\n const copyAll = async () => {\n const ok = await writeClipboard(codes.join('\\n'))\n setFeedback(ok ? 'copied' : 'failed')\n clearTimeout(clear.current)\n if (!ok) return\n requestHaptic('medium')\n props.onCopyAll?.()\n clear.current = setTimeout(() => setFeedback(''), 2500)\n }\n\n const status = feedback === 'copied' ? text.copied : feedback === 'failed' ? text.copyFailed : ''\n\n if (!revealed) {\n return (\n <div className={cx('ty-recovery-codes', props.className)} data-revealed=\"false\">\n <p className=\"ty-recovery-codes__hidden\">{text.hidden}</p>\n {props.onReveal ? (\n <Button leadingIcon={<Eye />} onPress={props.onReveal}>\n {text.reveal}\n </Button>\n ) : null}\n </div>\n )\n }\n\n return (\n <div className={cx('ty-recovery-codes', props.className)} data-revealed=\"true\">\n <ol className=\"ty-recovery-codes__list\" aria-label={text.listLabel}>\n {codes.map((code, i) => (\n <li key={`${i}-${code}`} className=\"ty-recovery-codes__code\">\n {code}\n </li>\n ))}\n </ol>\n <div className=\"ty-recovery-codes__actions\">\n <Button leadingIcon={<Copy />} onPress={() => void copyAll()}>\n {text.copyAll}\n </Button>\n {allowDownload ? (\n <Button\n leadingIcon={<Download />}\n onPress={() => saveText(props.fileName ?? text.fileName, recoveryCodesFile(codes, text, props.generatedAt ?? new Date()))}\n >\n {text.download}\n </Button>\n ) : null}\n </div>\n <p className=\"ty-recovery-codes__status\" role=\"status\">\n {status}\n </p>\n </div>\n )\n}\n","import { createElement, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Link } from '../link/Link'\nimport { readBlocks, type Block, type Inline } from './parse'\n\nexport interface MarkdownViewProps {\n text: string\n /** Level of a Markdown level-1 heading; deeper levels follow, capped at 6. */\n headingBase?: 2 | 3 | 4 | 5 | 6\n density?: 'regular' | 'compact'\n className?: string\n}\n\nfunction drawInline(nodes: Inline[]): ReactNode[] {\n return nodes.map((node, i) => {\n switch (node.kind) {\n case 'text':\n return node.value\n case 'code':\n return (\n <code key={i} className=\"ty-markdown__code-span\">\n {node.value}\n </code>\n )\n case 'strong':\n return <strong key={i}>{drawInline(node.children)}</strong>\n case 'em':\n return <em key={i}>{drawInline(node.children)}</em>\n case 'link':\n return (\n <Link key={i} href={node.href} external>\n {drawInline(node.children)}\n </Link>\n )\n }\n })\n}\n\n/** Code block: a scroll region that becomes focusable (and labelled) only when it overflows. */\nfunction CodeBlock({ language, value }: { language?: string; value: string }) {\n const label = useMessages().markdown.codeBlock(language)\n const preRef = useRef<HTMLPreElement>(null)\n const [overflows, setOverflows] = useState(false)\n useLayoutEffect(() => {\n const pre = preRef.current\n if (pre) setOverflows(pre.scrollWidth > pre.clientWidth)\n }, [value])\n return (\n <div className=\"ty-markdown__code-block\">\n {language ? (\n <span className=\"ty-markdown__language\" aria-hidden=\"true\">\n {language}\n </span>\n ) : null}\n <pre ref={preRef} dir=\"ltr\" className=\"ty-markdown__pre\" data-language={language} {...(overflows ? { tabIndex: 0, role: 'region', 'aria-label': label } : {})}>\n <code>{value}</code>\n </pre>\n </div>\n )\n}\n\nfunction drawBlock(block: Block, key: number, base: number): ReactNode {\n if (block.kind === 'heading') {\n const level = Math.min(6, base + block.depth - 1)\n return createElement(`h${level}`, { key, className: 'ty-markdown__heading', 'data-depth': block.depth, dir: 'auto' }, drawInline(block.content))\n }\n if (block.kind === 'list') {\n return createElement(\n block.ordered ? 'ol' : 'ul',\n { key, className: 'ty-markdown__list' },\n block.items.map((item, i) => (\n <li key={i} dir=\"auto\">\n {drawInline(item)}\n </li>\n )),\n )\n }\n if (block.kind === 'code') return <CodeBlock key={key} language={block.language} value={block.value} />\n return (\n <p key={key} className=\"ty-markdown__paragraph\" dir=\"auto\">\n {drawInline(block.content)}\n </p>\n )\n}\n\n/** Safe renderer for a small Markdown subset (spec: wave-2/markdown-view.md). */\nexport function MarkdownView({ text, headingBase = 3, density = 'regular', className }: MarkdownViewProps) {\n const blocks = useMemo(() => readBlocks(text), [text])\n if (blocks.length === 0) return null\n return (\n <div className={cx('ty-markdown', className)} data-density={density}>\n {blocks.map((block, i) => drawBlock(block, i, headingBase))}\n </div>\n )\n}\n","import { CircleCheck, CircleX, Hourglass } from 'lucide-react'\nimport type { CSSProperties } from 'react'\nimport { Button as AriaButton } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\nimport { ActorChip } from '../actor-chip/ActorChip'\n\nexport type AgentOutcome = 'completed' | 'failed' | 'pending'\n\nexport interface AgentOutputCardProps {\n agentName: string\n /** Machine key, shown in mono. */\n agentKey?: string\n /**\n * Accepted for hosts that keep agent pictures; design direction §2.11 draws\n * every agent as the square bot mark, so the picture is not shown.\n */\n avatarUrl?: string\n /** Human-readable duration, formatted by the host. */\n duration: string\n outcome?: AgentOutcome\n output: string\n /** Clamp of the excerpt; the full text is reached through `onOpen`. */\n maxLines?: number\n onOpen?: () => void\n className?: string\n}\n\nconst OUTCOME_ICON: Record<AgentOutcome, IconComponent> = {\n completed: CircleCheck,\n failed: CircleX,\n pending: Hourglass,\n}\n\nfunction OutcomeMark({ outcome }: { outcome: AgentOutcome }) {\n const word = useMessages().agentOutput.outcome[outcome]\n const Icon = OUTCOME_ICON[outcome]\n return (\n <span className=\"ty-agent-output__outcome\" data-outcome={outcome}>\n <Icon aria-hidden=\"true\" focusable=\"false\" />\n {word}\n </span>\n )\n}\n\n/** What one agent produced in a run (spec: wave-2/agent-output-card.md). */\nexport function AgentOutputCard(props: AgentOutputCardProps) {\n const m = useMessages().agentOutput\n const outcome = props.outcome ?? 'completed'\n const chip = <ActorChip kind=\"agent\" name={props.agentName} agentKey={props.agentKey} compact={!props.agentKey} />\n const clamp = { '--ty-agent-output-lines': String(props.maxLines ?? 4) } as CSSProperties\n\n return (\n <article className={cx('ty-agent-output', props.className)} aria-label={props.agentName} data-interactive={props.onOpen ? '' : undefined}>\n <header className=\"ty-agent-output__head\">\n {props.onOpen ? (\n <AriaButton className=\"ty-agent-output__open\" onPress={props.onOpen}>\n {chip}\n </AriaButton>\n ) : (\n chip\n )}\n <span className=\"ty-agent-output__meta\">\n <span className=\"ty-agent-output__duration\">{m.duration(props.duration)}</span>\n <OutcomeMark outcome={outcome} />\n </span>\n </header>\n <p className=\"ty-agent-output__excerpt\" style={clamp} title={props.onOpen ? undefined : props.output}>\n {props.output}\n </p>\n </article>\n )\n}\n","import { useId, type ReactNode } from 'react'\nimport { Heading } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\n\nexport type ContactHeadingLevel = 2 | 3 | 4 | 5\n\n/** The tel: target dials digits and a leading plus only. */\nconst telTarget = (shown: string) => `tel:${shown.replace(/[^\\d+]/g, '')}`\n\n/** Frame shared by both card kinds: a heading, then a body. */\nfunction CardFrame(props: { kind: 'channel' | 'office'; level: ContactHeadingLevel; heading: string; extra?: string; children: ReactNode }) {\n return (\n <div className={cx('ty-contact-card', props.extra)} data-kind={props.kind}>\n <Heading level={props.level} className=\"ty-contact-card__title\">\n {props.heading}\n </Heading>\n {props.children}\n </div>\n )\n}\n\nexport interface ContactChannelCardProps {\n /** Heading, translated by the host (press, partnerships, support…). */\n purposeLabel: string\n email: string\n phone?: string\n headingLevel?: ContactHeadingLevel\n className?: string\n}\n\n/** One contact channel: purpose, e-mail and phone (spec: wave-2/contact-card.md). */\nexport function ContactChannelCard(props: ContactChannelCardProps) {\n const words = useMessages().contact\n // Each way to reach the channel: [term, target, visible text].\n const ways: Array<[string, string, string]> = [[words.email, `mailto:${props.email}`, props.email]]\n if (props.phone) ways.push([words.phone, telTarget(props.phone), props.phone])\n return (\n <CardFrame kind=\"channel\" level={props.headingLevel ?? 3} heading={props.purposeLabel} extra={props.className}>\n <dl className=\"ty-contact-card__pairs\">\n {ways.map(([term, target, text]) => (\n <div key={term} className=\"ty-contact-card__pair\">\n <dt>{term}</dt>\n <dd>\n {/* Native anchors keep mailto: and tel: away from the router adapter. */}\n <a className=\"ty-contact-card__link\" href={target}>\n {text}\n </a>\n </dd>\n </div>\n ))}\n </dl>\n </CardFrame>\n )\n}\n\nexport interface ContactOfficeCardProps {\n city: string\n addressLines: string[]\n headingLevel?: ContactHeadingLevel\n className?: string\n}\n\n/** An office: city heading and postal address. */\nexport function ContactOfficeCard(props: ContactOfficeCardProps) {\n return (\n <CardFrame kind=\"office\" level={props.headingLevel ?? 3} heading={props.city} extra={props.className}>\n <address className=\"ty-contact-card__address\">\n {props.addressLines.map((text, row) => (\n <span key={row} className=\"ty-contact-card__line\">\n {text}\n </span>\n ))}\n </address>\n </CardFrame>\n )\n}\n\nexport interface ContactSectionProps {\n title: string\n subtitle: string\n headingLevel?: ContactHeadingLevel\n children: ReactNode\n className?: string\n}\n\n/** Section of contact cards with a heading and lead. */\nexport function ContactSection(props: ContactSectionProps) {\n const headingId = useId()\n return (\n <section aria-labelledby={headingId} className={cx('ty-contact-section', props.className)}>\n <Heading level={props.headingLevel ?? 2} id={headingId} className=\"ty-contact-section__title\">\n {props.title}\n </Heading>\n <p className=\"ty-contact-section__lead\">{props.subtitle}</p>\n <div className=\"ty-contact-section__grid\">{props.children}</div>\n </section>\n )\n}\n","// Signed figures for change indicators: always a sign except for zero, and a\n// true minus sign (U+2212) so a negative change never reads as a hyphen.\n\nexport type ChangeUnit = 'percent' | 'number'\n\nconst MINUS = '−'\n\nconst cache = new Map<string, Intl.NumberFormat>()\n\nfunction formatterFor(locale: string, unit: ChangeUnit): Intl.NumberFormat {\n const key = `${locale}|${unit}`\n let nf = cache.get(key)\n if (!nf) {\n nf =\n unit === 'percent'\n ? new Intl.NumberFormat(locale, { style: 'percent', signDisplay: 'exceptZero', minimumFractionDigits: 1, maximumFractionDigits: 1 })\n : new Intl.NumberFormat(locale, { signDisplay: 'exceptZero', maximumFractionDigits: 2 })\n cache.set(key, nf)\n }\n return nf\n}\n\n/** `12.34` percent points → \"+12.3%\"; `-3` number → \"−3\". */\nexport function signedFigure(value: number, unit: ChangeUnit, locale: string): string {\n const input = unit === 'percent' ? value / 100 : value\n return formatterFor(locale, unit).format(input).replace(/-/g, MINUS)\n}\n\n/** Direction of a change: 1 up, -1 down, 0 flat. */\nexport function directionOf(value: number): -1 | 0 | 1 {\n if (value > 0) return 1\n if (value < 0) return -1\n return 0\n}\n","import { ArrowDownRight, ArrowRight, ArrowUpRight } from 'lucide-react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { directionOf, signedFigure, type ChangeUnit } from '../../internal/data-b/signed'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\n\nexport type DeltaPolarity = 'higher-is-better' | 'lower-is-better' | 'neutral'\nexport type DeltaAppearance = 'inline' | 'pill'\nexport type DeltaSize = 'small' | 'medium'\nexport type DeltaSentiment = 'positive' | 'negative' | 'neutral'\n\nexport interface DeltaIndicatorProps {\n /** The change; `null` renders nothing. */\n value: number | null | undefined\n unit?: ChangeUnit\n /** Custom text for the value (the sign and glyph are still added by direction). */\n format?: (value: number, unit: ChangeUnit) => string\n showValue?: boolean\n /** With `showValue` false, a zero change renders nothing. */\n hideWhenZero?: boolean\n appearance?: DeltaAppearance\n size?: DeltaSize\n polarity?: DeltaPolarity\n className?: string\n}\n\ntype Direction = -1 | 0 | 1\n\nconst GLYPH: Record<Direction, IconComponent> = { [-1]: ArrowDownRight, 0: ArrowRight, 1: ArrowUpRight }\nconst TREND: Record<Direction, 'down' | 'flat' | 'up'> = { [-1]: 'down', 0: 'flat', 1: 'up' }\n\n/** Maps a direction to a sentiment under a polarity; zero is always neutral. */\nexport function deltaSentiment(direction: Direction, polarity: DeltaPolarity): DeltaSentiment {\n if (direction === 0 || polarity === 'neutral') return 'neutral'\n const good = polarity === 'higher-is-better' ? direction > 0 : direction < 0\n return good ? 'positive' : 'negative'\n}\n\n/** Presentational part shared with cards that already know direction and sentiment. */\nexport function DeltaMark(props: {\n trend: 'up' | 'down' | 'flat'\n sentiment: DeltaSentiment\n text?: string\n appearance?: DeltaAppearance\n size?: DeltaSize\n className?: string\n}) {\n const words = useMessages().delta\n const dir: Direction = props.trend === 'up' ? 1 : props.trend === 'down' ? -1 : 0\n const Glyph = GLYPH[dir]\n return (\n <span\n className={cx('ty-delta', props.className)}\n data-trend={props.trend}\n data-sentiment={props.sentiment}\n data-appearance={props.appearance ?? 'inline'}\n data-size={props.size ?? 'small'}\n >\n {/* Diagonal and flat arrows point along the reading direction: mirrored in RTL (up stays up). */}\n <Glyph className=\"ty-delta__glyph ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-visually-hidden\">{words[props.trend]} </span>\n {props.text ? <span className=\"ty-delta__value\">{props.text}</span> : null}\n </span>\n )\n}\n\n/** Direction and size of a change (spec: wave-2/delta-indicator.md). */\nexport function DeltaIndicator(props: DeltaIndicatorProps) {\n const { locale } = useLocale()\n const value = props.value\n if (value === null || value === undefined || Number.isNaN(value)) return null\n const shown = props.showValue ?? true\n const dir = directionOf(value)\n if (dir === 0 && !shown && props.hideWhenZero) return null\n const unit = props.unit ?? 'percent'\n const text = shown ? (props.format ? props.format(value, unit) : signedFigure(value, unit, locale)) : undefined\n return (\n <DeltaMark\n trend={TREND[dir]}\n sentiment={deltaSentiment(dir, props.polarity ?? 'higher-is-better')}\n text={text}\n appearance={props.appearance}\n size={props.size}\n className={props.className}\n />\n )\n}\n","import { useEffect, useId, useRef, useState, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { devWarning } from '../../internal/dev'\nimport { useMessages } from '../../internal/provider'\nimport { ActorChip, type ActorKind } from '../actor-chip/ActorChip'\nimport { Button } from '../button/Button'\nimport { DeltaIndicator, type DeltaIndicatorProps } from '../delta-indicator/DeltaIndicator'\nimport { InlineNotice } from '../inline-notice/InlineNotice'\nimport { Link } from '../link/Link'\nimport { ProgressBar } from '../progress-bar/ProgressBar'\nimport { ProofBadge, type ProofState } from '../proof-badge/ProofBadge'\n\n/** Who proposed: rendered with ActorChip (§2.11). */\nexport interface ActorRef {\n kind: ActorKind\n name: string\n agentKey?: string\n model?: string\n email?: string\n}\n\nexport interface InsightMeasure {\n id: string\n label: string\n value: string\n /** 0 to 1: draws a determinate bar whose value text is `value`. */\n meter?: number\n}\n\nexport interface InsightAction {\n id: string\n label: string\n icon?: ReactNode\n emphasis?: 'primary' | 'secondary' | 'quiet'\n tone?: 'neutral' | 'danger'\n}\n\nexport interface InsightCardProps {\n actor: ActorRef\n title: string\n value: ReactNode\n delta?: DeltaIndicatorProps\n measures?: InsightMeasure[]\n actions?: InsightAction[]\n /** A returned promise keeps the card pending until it settles; a rejection shows its message. */\n onAction?: (id: string) => void | Promise<void>\n footnote?: { text: string; href?: string }\n /** Replaces the actions once the proposal is resolved. */\n outcome?: { text: string }\n proofState?: ProofState\n labels?: { actions?: string; pending?: string; failed?: string }\n className?: string\n}\n\ntype Phase = { kind: 'idle' } | { kind: 'pending'; id: string } | { kind: 'failed'; message: string }\n\n/** Keeps at most one primary button (§2.3): the first one asked for. */\nfunction useButtonVariants(actions: InsightAction[]) {\n let primaryTaken = false\n let demoted = false\n const out = actions.map((a) => {\n if (a.tone === 'danger') return 'danger' as const\n if (a.emphasis === 'primary') {\n if (primaryTaken) {\n demoted = true\n return 'secondary' as const\n }\n primaryTaken = true\n return 'primary' as const\n }\n return a.emphasis ?? 'secondary'\n })\n devWarning(demoted, 'InsightCard: only one action may use the primary emphasis; later ones were shown as secondary.')\n return out\n}\n\nfunction Measures({ items }: { items: InsightMeasure[] }) {\n return (\n <dl className=\"ty-insight-card__measures\">\n {items.map((it) => (\n <div key={it.id} className=\"ty-insight-card__measure\">\n <dt>{it.label}</dt>\n <dd>{it.value}</dd>\n {typeof it.meter === 'number' ? (\n <dd className=\"ty-insight-card__meter\">\n <ProgressBar aria-label={it.label} value={it.meter * 100} valueLabel={it.value} showValue={false} size=\"thin\" />\n </dd>\n ) : null}\n </div>\n ))}\n </dl>\n )\n}\n\n/** A proposed value by an agent or rule, with its measures and actions (spec: wave-4/insight-card.md). */\nexport function InsightCard(props: InsightCardProps) {\n const all = useMessages()\n const m = all.insight\n const kindWord = all.actor[props.actor.kind === 'user' ? 'person' : props.actor.kind]\n const titleId = useId()\n const byId = useId()\n const [phase, setPhase] = useState<Phase>({ kind: 'idle' })\n const outcomeRef = useRef<HTMLParagraphElement>(null)\n const actions = props.actions ?? []\n const variantsFor = useButtonVariants(actions)\n const alive = useRef(true)\n useEffect(\n () => () => {\n alive.current = false\n },\n [],\n )\n\n useEffect(() => {\n if (props.outcome) outcomeRef.current?.focus()\n }, [props.outcome?.text])\n\n const trigger = (id: string) => {\n const result = props.onAction?.(id)\n if (!result || typeof (result as Promise<void>).then !== 'function') return\n setPhase({ kind: 'pending', id })\n ;(result as Promise<void>).then(\n () => alive.current && setPhase({ kind: 'idle' }),\n (err: unknown) =>\n alive.current &&\n setPhase({ kind: 'failed', message: err instanceof Error && err.message ? err.message : (props.labels?.failed ?? m.failed) }),\n )\n }\n\n const pendingId = phase.kind === 'pending' ? phase.id : null\n\n return (\n <article className={cx('ty-insight-card', props.className)} aria-labelledby={titleId} aria-describedby={byId} data-phase={phase.kind}>\n <header className=\"ty-insight-card__head\">\n <span className=\"ty-insight-card__by\">\n <span id={byId} className=\"ty-visually-hidden\">{`${m.proposedBy} ${props.actor.name}, ${kindWord}`}</span>\n <ActorChip kind={props.actor.kind} name={props.actor.name} agentKey={props.actor.agentKey} model={props.actor.model} email={props.actor.email} compact />\n </span>\n {props.proofState ? <ProofBadge state={props.proofState} /> : null}\n </header>\n <h3 id={titleId} className=\"ty-insight-card__title\">\n {props.title}\n </h3>\n <p className=\"ty-insight-card__value\">\n <span className=\"ty-insight-card__figure\">{props.value}</span>\n {props.delta ? <DeltaIndicator {...props.delta} /> : null}\n </p>\n {props.measures?.length ? <Measures items={props.measures} /> : null}\n\n {phase.kind === 'failed' ? (\n <InlineNotice tone=\"danger\" urgency=\"assertive\">\n {phase.message}\n </InlineNotice>\n ) : null}\n\n {props.outcome ? (\n <p ref={outcomeRef} tabIndex={-1} role=\"status\" className=\"ty-insight-card__outcome\">\n {props.outcome.text}\n </p>\n ) : actions.length ? (\n <div role=\"group\" aria-label={props.labels?.actions ?? m.actions} className=\"ty-insight-card__actions\">\n {actions.map((a, i) => (\n <Button\n key={a.id}\n variant={variantsFor[i]}\n leadingIcon={a.icon}\n disabled={pendingId !== null && pendingId !== a.id}\n busy={pendingId === a.id}\n busyLabel={props.labels?.pending ?? m.pending}\n onPress={() => trigger(a.id)}\n >\n {a.label}\n </Button>\n ))}\n </div>\n ) : null}\n\n {props.footnote ? (\n <p className=\"ty-insight-card__footnote\">\n {props.footnote.href ? <Link href={props.footnote.href}>{props.footnote.text}</Link> : props.footnote.text}\n </p>\n ) : null}\n </article>\n )\n}\n","import { useId, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { DeltaIndicator } from '../delta-indicator/DeltaIndicator'\n\nexport type MetricTileTone = 'neutral' | 'success' | 'warning' | 'danger'\n\nexport interface MetricTrend {\n /** Change in percentage points unless `format` says otherwise. */\n value: number\n /** Comparison label, for example \"vs last month\". */\n label?: string\n format?: (n: number) => string\n}\n\nexport interface MetricTileProps {\n title: string\n value: ReactNode\n subtitle?: string\n icon?: ReactNode\n trend?: MetricTrend\n tone?: MetricTileTone\n /** `raised` is a level-2 card; `plain` sits flat inside a sheet (§2.5). */\n surface?: 'raised' | 'plain'\n className?: string\n}\n\n/** Read-only metric for report KPI rows (spec: wave-2/metric-tile.md). */\nexport function MetricTile(props: MetricTileProps) {\n const titleId = useId()\n const { trend } = props\n return (\n <div\n role=\"group\"\n aria-labelledby={titleId}\n className={cx('ty-metric-tile', props.className)}\n data-tone={props.tone ?? 'neutral'}\n data-surface={props.surface ?? 'raised'}\n >\n <div className=\"ty-metric-tile__head\">\n <span id={titleId} className=\"ty-metric-tile__title\">\n {props.title}\n </span>\n {props.icon ? (\n <span className=\"ty-metric-tile__badge\" aria-hidden=\"true\">\n {props.icon}\n </span>\n ) : null}\n </div>\n <div className=\"ty-metric-tile__value\">{props.value}</div>\n {props.subtitle ? <p className=\"ty-metric-tile__subtitle\">{props.subtitle}</p> : null}\n {trend ? (\n <p className=\"ty-metric-tile__trend\">\n <DeltaIndicator value={trend.value} unit=\"percent\" format={trend.format ? (n) => trend.format!(n) : undefined} />\n {trend.label ? <span className=\"ty-metric-tile__trend-label\">{trend.label}</span> : null}\n </p>\n ) : null}\n </div>\n )\n}\n","import { cx } from '../../internal/cx'\nimport { Avatar } from '../avatar/Avatar'\nimport { Tag } from '../tag/Tag'\n\nexport interface ProfileSummaryProps {\n name: string\n /** Avatar fallback; derived from the name when omitted. */\n initials?: string\n pictureUrl?: string\n email?: string\n /** Privacy switch: the e-mail is rendered only when true. */\n showEmail?: boolean\n role?: string\n className?: string\n}\n\n/** First grapheme (not code unit) of a word, so combining marks and surrogate pairs stay whole. */\nfunction firstGrapheme(word: string): string {\n const Segmenter = (Intl as { Segmenter?: new (l?: string, o?: { granularity: 'grapheme' }) => { segment: (s: string) => Iterable<{ segment: string }> } }).Segmenter\n if (Segmenter) for (const piece of new Segmenter(undefined, { granularity: 'grapheme' }).segment(word)) return piece.segment\n return Array.from(word)[0] ?? ''\n}\n\n/** First letter of the first and last words (by space; names in scripts without spaces keep their first grapheme). */\nfunction deriveInitials(name: string): string {\n const parts = name.split(/\\s+/).filter((w) => w.length > 0)\n const picked = parts.length > 1 ? [parts[0]!, parts[parts.length - 1]!] : parts\n return picked.map((w) => firstGrapheme(w).toLocaleUpperCase()).join('')\n}\n\n/** Identity block of the signed-in person (spec: wave-2/profile-summary.md). */\nexport function ProfileSummary({ role, email, showEmail = false, pictureUrl, initials, name, className }: ProfileSummaryProps) {\n const lines: Array<[string, string]> = [['name', name]]\n if (showEmail && email) lines.push(['email', email])\n return (\n <div className={cx('ty-profile-summary', className)}>\n <Avatar decorative src={pictureUrl} fallbackText={initials ?? deriveInitials(name)} size=\"regular\" />\n <div className=\"ty-profile-summary__text\">\n {role ? (\n <span className=\"ty-profile-summary__role\">\n <Tag size=\"small\">{role}</Tag>\n </span>\n ) : null}\n {lines.map(([kind, text]) => (\n <span key={kind} className=\"ty-profile-summary__line\" data-line={kind} title={text}>\n {text}\n </span>\n ))}\n </div>\n </div>\n )\n}\n","import { Pencil, Trash2 } from 'lucide-react'\nimport { useState, type CSSProperties, type DragEventHandler, type ReactNode } from 'react'\nimport { Button as AriaButton } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { ModalDialog } from '../modal-dialog/ModalDialog'\nimport { StatusPill } from '../status-pill/StatusPill'\n\nexport interface RecordCardDragHandlers {\n draggable?: boolean\n onDragStart?: DragEventHandler<HTMLElement>\n onDragEnd?: DragEventHandler<HTMLElement>\n onDragOver?: DragEventHandler<HTMLElement>\n onDragEnter?: DragEventHandler<HTMLElement>\n onDragLeave?: DragEventHandler<HTMLElement>\n onDrop?: DragEventHandler<HTMLElement>\n}\n\nexport interface RecordCardProps {\n title: ReactNode\n /** Plain-text title for tooltips and accessible names when `title` is a node. */\n titleText?: string\n secondary?: ReactNode\n leading?: ReactNode\n /** `true`/`false` shows the active/inactive StatusPill; a node renders as given. */\n state?: boolean | ReactNode\n /** Categorical token index (1 to 8) for the decorative strip (§2.3). */\n accent?: number\n children?: ReactNode\n footer?: ReactNode\n onOpen?: () => void\n /** Without a list parent: no list-item semantics. */\n standalone?: boolean\n dragHandlers?: RecordCardDragHandlers\n /** Host-driven dragging state (reduced opacity and outline). */\n dragging?: boolean\n className?: string\n}\n\nfunction StateMark({ state }: { state: RecordCardProps['state'] }) {\n if (state === undefined || state === null) return null\n if (typeof state === 'boolean') return <StatusPill status={state ? 'active' : 'inactive'} size=\"small\" />\n return <>{state}</>\n}\n\n/** Summary card of one record in a grid or list (spec: wave-2/record-card.md). */\nexport function RecordCard(props: RecordCardProps) {\n const Tag = props.standalone ? 'article' : 'li'\n const plainTitle = props.titleText ?? (typeof props.title === 'string' ? props.title : undefined)\n const strip = props.accent ? ({ '--ty-record-accent': `var(--ty-categorical-${props.accent})` } as CSSProperties) : undefined\n\n const titleRun = (\n <span className=\"ty-record-card__title\" title={plainTitle}>\n {props.title}\n </span>\n )\n\n return (\n <Tag\n className={cx('ty-record-card', props.className)}\n style={strip}\n data-accent={props.accent ? '' : undefined}\n data-interactive={props.onOpen ? '' : undefined}\n data-dragging={props.dragging ? '' : undefined}\n aria-label={props.standalone ? plainTitle : undefined}\n {...props.dragHandlers}\n >\n <div className=\"ty-record-card__head\">\n {props.leading ? <span className=\"ty-record-card__leading\">{props.leading}</span> : null}\n <div className=\"ty-record-card__names\">\n {props.onOpen ? (\n <AriaButton className=\"ty-record-card__open\" onPress={props.onOpen}>\n {titleRun}\n </AriaButton>\n ) : (\n titleRun\n )}\n {props.secondary ? <span className=\"ty-record-card__secondary\">{props.secondary}</span> : null}\n </div>\n <span className=\"ty-record-card__state\">\n <StateMark state={props.state} />\n </span>\n </div>\n {props.children ? <div className=\"ty-record-card__body\">{props.children}</div> : null}\n {props.footer ? <div className=\"ty-record-card__footer\">{props.footer}</div> : null}\n </Tag>\n )\n}\n\nexport interface RecordActionsProps {\n /** Record name, appended to the accessible names (\"Delete <title>\"). */\n recordTitle: string\n editLabel: string\n deleteLabel: string\n onEdit: () => void\n onDelete: () => void | Promise<void>\n /** When set, deletion asks first in an alert dialog with this title. */\n confirmDeleteTitle?: string\n confirmDeleteDescription?: ReactNode\n}\n\n/** Edit and delete pair for a RecordCard footer. */\nexport function RecordActions(props: RecordActionsProps) {\n const m = useMessages().recordCard\n const [asking, setAsking] = useState(false)\n const [busy, setBusy] = useState(false)\n\n const remove = async () => {\n setBusy(true)\n try {\n await props.onDelete()\n } finally {\n setBusy(false)\n setAsking(false)\n }\n }\n const requestDelete = () => (props.confirmDeleteTitle ? setAsking(true) : void remove())\n\n const named = (label: string) => (\n <>\n {`${label} `}\n <span className=\"ty-visually-hidden\">{props.recordTitle}</span>\n </>\n )\n\n return (\n <div className=\"ty-record-actions\">\n <Button variant=\"quiet\" size=\"compact\" leadingIcon={<Pencil />} onPress={props.onEdit} disabled={busy}>\n {named(props.editLabel)}\n </Button>\n <Button variant=\"quiet\" size=\"compact\" leadingIcon={<Trash2 />} onPress={requestDelete} busy={busy && !asking} busyLabel={m.working}>\n {named(props.deleteLabel)}\n </Button>\n {props.confirmDeleteTitle ? (\n <ModalDialog\n isOpen={asking}\n onOpenChange={(open) => !open && setAsking(false)}\n role=\"alertdialog\"\n width=\"narrow\"\n busy={busy}\n title={props.confirmDeleteTitle}\n actions={\n <>\n <Button autoFocus onPress={() => setAsking(false)} disabled={busy}>\n {m.cancel}\n </Button>\n <Button variant=\"danger\" busy={busy} onPress={() => void remove()}>\n {props.deleteLabel}\n </Button>\n </>\n }\n >\n {props.confirmDeleteDescription}\n </ModalDialog>\n ) : null}\n </div>\n )\n}\n","import { Check, CircleAlert, Filter } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { ToggleButton } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Popover } from '../popover/Popover'\n\nexport type StatTileTone = 'neutral' | 'attention'\n\nexport interface StatTileExplanation {\n title?: string\n body?: string\n /** Rendered in mono (query, source identifiers). */\n blocks?: { label: string; text: string }[]\n}\n\nexport interface StatTileProps {\n /** Already formatted figure. */\n value: string | number\n label: string\n icon?: ReactNode\n /** Period or scope pill. */\n qualifier?: string\n explanation?: StatTileExplanation\n tone?: StatTileTone\n filtered?: boolean\n /** Pressed state when the tile toggles a filter. */\n selected?: boolean\n /** Turns the tile into a toggle button. */\n onPress?: () => void\n /** Announce value changes politely. */\n live?: boolean\n className?: string\n}\n\nfunction Figure({ value, live }: { value: string | number; live: boolean }) {\n return (\n <span className=\"ty-stat-tile__value\" {...(live ? { 'aria-live': 'polite' as const, 'aria-atomic': true } : {})}>\n {value}\n </span>\n )\n}\n\nfunction Explain({ label, explanation }: { label: string; explanation: StatTileExplanation }) {\n const m = useMessages().statTile\n return (\n <Popover triggerLabel={m.explain(label)} title={explanation.title} placement=\"bottom\" align=\"end\">\n {explanation.body ? <p className=\"ty-stat-tile__explain-body\">{explanation.body}</p> : null}\n {explanation.blocks?.length ? (\n <dl className=\"ty-stat-tile__blocks\">\n {explanation.blocks.map((b, i) => (\n <div key={`${b.label}-${i}`} className=\"ty-stat-tile__block\">\n <dt>{b.label}</dt>\n <dd>\n <code>{b.text}</code>\n </dd>\n </div>\n ))}\n </dl>\n ) : null}\n </Popover>\n )\n}\n\n/**\n * One headline figure with its label; optionally a filter toggle (spec:\n * wave-2/stat-tile.md). The explain trigger sits beside the toggle, never\n * inside it.\n */\nexport function StatTile(props: StatTileProps) {\n const m = useMessages().statTile\n const { value, label, tone = 'neutral', filtered = false, selected = false, live = false } = props\n const toggles = typeof props.onPress === 'function'\n\n const face = (\n <>\n <span className=\"ty-stat-tile__top\">\n {props.icon ? (\n <span className=\"ty-stat-tile__icon\" aria-hidden=\"true\">\n {props.icon}\n </span>\n ) : null}\n {props.qualifier ? <span className=\"ty-stat-tile__qualifier\">{props.qualifier}</span> : null}\n {toggles && selected ? <Check className=\"ty-stat-tile__check\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n </span>\n <Figure value={value} live={live} />\n <span className=\"ty-stat-tile__label\">{label}</span>\n {tone === 'attention' || filtered ? (\n <span className=\"ty-stat-tile__marks\">\n {tone === 'attention' ? (\n <span className=\"ty-stat-tile__mark\" data-mark=\"attention\">\n <CircleAlert aria-hidden=\"true\" focusable=\"false\" />\n {m.attention}\n </span>\n ) : null}\n {filtered ? (\n <span className=\"ty-stat-tile__mark\" data-mark=\"filtered\">\n <Filter aria-hidden=\"true\" focusable=\"false\" />\n {m.filtered}\n </span>\n ) : null}\n </span>\n ) : null}\n </>\n )\n\n const name = [label, String(value), props.qualifier, tone === 'attention' ? m.attention : undefined, filtered ? m.filtered : undefined]\n .filter(Boolean)\n .join(', ')\n\n return (\n <div className={cx('ty-stat-tile', props.className)} data-tone={tone} data-interactive={toggles || undefined}>\n {toggles ? (\n <ToggleButton className=\"ty-stat-tile__face\" isSelected={selected} onChange={() => props.onPress?.()} aria-label={name}>\n {face}\n </ToggleButton>\n ) : (\n <div className=\"ty-stat-tile__face\" role=\"group\" aria-label={name}>\n {face}\n </div>\n )}\n {props.explanation ? (\n <span className=\"ty-stat-tile__explain\">\n <Explain label={label} explanation={props.explanation} />\n </span>\n ) : null}\n </div>\n )\n}\n","import { useId, type ReactNode } from 'react'\nimport { Button as AriaButton } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\nimport { DeltaMark, type DeltaSentiment } from '../delta-indicator/DeltaIndicator'\nimport { Link } from '../link/Link'\nimport { Skeleton } from '../skeleton/Skeleton'\n\nexport interface TickerChange {\n value: string\n direction: 'up' | 'down' | 'flat'\n /** Independent of direction: a rise can be bad. */\n sentiment?: DeltaSentiment\n}\n\nexport interface TickerEntry {\n id: string\n name: string\n qualifier?: string\n value: string\n change?: TickerChange\n}\n\nexport interface TickerCardProps {\n title: string\n icon?: IconComponent\n entries: TickerEntry[]\n asOf?: string\n seeAll?: { label: string; href: string }\n maxEntries?: number\n onEntryPress?: (id: string) => void\n loading?: boolean\n /** Rows drawn while loading. */\n loadingRows?: number\n headingLevel?: 2 | 3 | 4\n labels?: { value?: string; change?: string; empty?: string; loading?: string }\n className?: string\n}\n\ninterface RowWords {\n value: string\n change: string\n}\n\nfunction RowCells({ entry, words }: { entry: TickerEntry; words: RowWords }) {\n return (\n <>\n <span className=\"ty-ticker-card__who\">\n <span className=\"ty-ticker-card__name\" title={entry.name}>\n {entry.name}\n </span>\n {entry.qualifier ? (\n <span className=\"ty-ticker-card__qualifier\">\n <span className=\"ty-visually-hidden\">, </span>\n {entry.qualifier}\n </span>\n ) : null}\n </span>\n <span className=\"ty-ticker-card__figures\">\n <span className=\"ty-ticker-card__value\">\n <span className=\"ty-visually-hidden\">{`, ${words.value} `}</span>\n {entry.value}\n </span>\n {entry.change ? (\n <span className=\"ty-ticker-card__change\">\n <span className=\"ty-visually-hidden\">{`, ${words.change} `}</span>\n <DeltaMark trend={entry.change.direction} sentiment={entry.change.sentiment ?? 'neutral'} text={entry.change.value} />\n </span>\n ) : null}\n </span>\n </>\n )\n}\n\nfunction Heading({ level, id, children }: { level: 2 | 3 | 4; id: string; children: ReactNode }) {\n const H = `h${level}` as 'h2' | 'h3' | 'h4'\n return (\n <H id={id} className=\"ty-ticker-card__title\">\n {children}\n </H>\n )\n}\n\n/** A short comparison of one quantity across named entries (spec: wave-4/ticker-card.md). */\nexport function TickerCard(props: TickerCardProps) {\n const m = useMessages().ticker\n const titleId = useId()\n const words: RowWords = { value: props.labels?.value ?? m.value, change: props.labels?.change ?? m.change }\n const shown = typeof props.maxEntries === 'number' ? props.entries.slice(0, props.maxEntries) : props.entries\n const Icon = props.icon\n\n let body: ReactNode\n if (props.loading) {\n body = (\n <div className=\"ty-ticker-card__loading\" aria-busy=\"true\">\n <span role=\"status\" className=\"ty-visually-hidden\">\n {props.labels?.loading ?? m.loading}\n </span>\n {Array.from({ length: props.loadingRows ?? 3 }, (_, i) => (\n <div key={i} className=\"ty-ticker-card__ghost\">\n <Skeleton width=\"medium\" />\n <Skeleton width=\"short\" />\n </div>\n ))}\n </div>\n )\n } else if (shown.length === 0) {\n body = <p className=\"ty-ticker-card__empty\">{props.labels?.empty ?? m.empty}</p>\n } else {\n body = (\n <ul className=\"ty-ticker-card__rows\" aria-labelledby={titleId}>\n {shown.map((entry) => (\n <li key={entry.id} className=\"ty-ticker-card__row-item\" data-sentiment={entry.change?.sentiment}>\n {props.onEntryPress ? (\n <AriaButton className=\"ty-ticker-card__row\" onPress={() => props.onEntryPress?.(entry.id)}>\n <RowCells entry={entry} words={words} />\n </AriaButton>\n ) : (\n <div className=\"ty-ticker-card__row\">\n <RowCells entry={entry} words={words} />\n </div>\n )}\n </li>\n ))}\n </ul>\n )\n }\n\n return (\n <section className={cx('ty-ticker-card', props.className)} aria-labelledby={titleId} data-interactive={props.onEntryPress ? '' : undefined}>\n <div className=\"ty-ticker-card__head\">\n {Icon ? <Icon className=\"ty-ticker-card__icon\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n <Heading level={props.headingLevel ?? 3} id={titleId}>\n {props.title}\n </Heading>\n </div>\n {body}\n {props.asOf || props.seeAll ? (\n <div className=\"ty-ticker-card__foot\">\n {props.asOf ? <span className=\"ty-ticker-card__asof\">{props.asOf}</span> : null}\n {props.seeAll ? (\n <Link href={props.seeAll.href} standalone>\n {props.seeAll.label}\n </Link>\n ) : null}\n </div>\n ) : null}\n </section>\n )\n}\n","// Frame-driven numeric tween used by TweenedNumber. Deliberately tiny: one\n// running animation per driver, eased by the design-direction entry curve\n// (§2.7, cubic-bezier(.2, 0, 0, 1)), cancellable at any frame.\n\ntype Frame = (value: number) => void\n\n/** Solves a CSS cubic-bezier timing curve for progress `t` in [0, 1]. */\nexport function bezierAt(t: number, x1: number, y1: number, x2: number, y2: number): number {\n if (t <= 0) return 0\n if (t >= 1) return 1\n const coord = (s: number, a: number, b: number) => 3 * a * s * (1 - s) ** 2 + 3 * b * s * s * (1 - s) + s ** 3\n // Bisection on x(s) = t, then read y(s): robust and plenty precise for a number display.\n let lo = 0\n let hi = 1\n let s = t\n for (let i = 0; i < 24; i++) {\n s = (lo + hi) / 2\n if (coord(s, x1, x2) < t) lo = s\n else hi = s\n }\n return coord(s, y1, y2)\n}\n\nexport const enterCurve = (t: number) => bezierAt(t, 0.2, 0, 0, 1)\n\nexport class TweenDriver {\n private handle = 0\n private startAt: number | null = null\n current = 0\n\n constructor(private readonly onFrame: Frame) {}\n\n /** Jumps straight to `value` (reduced motion, zero duration, hidden tab). */\n set(value: number): void {\n this.stop()\n this.current = value\n this.onFrame(value)\n }\n\n run(to: number, durationMs: number): void {\n this.stop()\n const from = this.current\n if (durationMs <= 0 || from === to || typeof requestAnimationFrame !== 'function') {\n this.set(to)\n return\n }\n const step = (now: number) => {\n if (this.startAt === null) this.startAt = now\n const progress = Math.min(1, (now - this.startAt) / durationMs)\n this.current = progress >= 1 ? to : from + (to - from) * enterCurve(progress)\n this.onFrame(this.current)\n if (progress < 1) this.handle = requestAnimationFrame(step)\n else this.handle = 0\n }\n this.handle = requestAnimationFrame(step)\n }\n\n get running(): boolean {\n return this.handle !== 0\n }\n\n stop(): void {\n if (this.handle && typeof cancelAnimationFrame === 'function') cancelAnimationFrame(this.handle)\n this.handle = 0\n this.startAt = null\n }\n}\n","import { useEffect, useMemo, useRef, useState } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { TweenDriver } from '../../internal/data-b/tween'\nimport { prefersReducedMotion } from '../../internal/media'\n\n/** `--ty-dur-base` of design direction §2.7, in milliseconds. */\nexport const TWEEN_BASE_MS = 240\n\nexport interface TweenedNumberProps {\n value: number\n /** One tween's length; 0 shows every value at once. */\n durationMs?: number\n /** Fixed decimals of the default formatter (Intl, in the provider's locale and numbering system). */\n decimals?: number\n /** Applied to every intermediate frame (currency, grouping). */\n format?: (n: number) => string\n className?: string\n}\n\n/** No movement for zero-length tweens or under reduced motion. */\nconst jumps = (ms: number) => ms <= 0 || prefersReducedMotion()\n\n/**\n * The figure on screen, easing towards `target`. One driver lives for the\n * component's life; a hidden document lands it on the target at once.\n */\nfunction useEasedFigure(target: number, ms: number): number {\n const [figure, setFigure] = useState(() => (jumps(ms) ? target : 0))\n const engine = useRef<TweenDriver>(null as unknown as TweenDriver)\n if (!engine.current) {\n engine.current = new TweenDriver(setFigure)\n engine.current.current = figure\n }\n\n useEffect(() => {\n const drive = engine.current\n jumps(ms) ? drive.set(target) : drive.run(target, ms)\n const onVisibility = () => {\n if (document.visibilityState === 'hidden' && drive.running) drive.set(target)\n }\n document.addEventListener('visibilitychange', onVisibility)\n return () => document.removeEventListener('visibilitychange', onVisibility)\n }, [target, ms])\n\n useEffect(() => () => engine.current.stop(), [])\n return figure\n}\n\n/**\n * A figure that eases from what is on screen to a new value (spec:\n * wave-2/tweened-number.md). Not a live region: hosts announce the final\n * value from the surrounding tile when they need to.\n */\nexport function TweenedNumber(props: TweenedNumberProps) {\n const places = props.decimals ?? 0\n const { locale } = useLocale()\n const figure = useEasedFigure(props.value, props.durationMs ?? TWEEN_BASE_MS)\n const writer = useMemo(() => {\n if (props.format) return props.format\n const nf = new Intl.NumberFormat(locale, { minimumFractionDigits: places, maximumFractionDigits: places })\n return (n: number) => nf.format(Number(n.toFixed(places)))\n }, [props.format, locale, places])\n\n return (\n <span className={cx('ty-tweened-number', props.className)} data-settled={figure === props.value || undefined}>\n {writer(figure)}\n </span>\n )\n}\n","// Pure geometry for Chart: value extraction, domain, ticks and label thinning.\n/** A datum value as a number, or null when it is missing or not numeric. */\nexport function toNumber(raw: unknown): number | null {\n if (typeof raw === 'number') return Number.isFinite(raw) ? raw : null\n if (typeof raw === 'string' && raw.trim() !== '') {\n const n = Number(raw)\n return Number.isFinite(n) ? n : null\n }\n return null\n}\n\n/**\n * Value span: an explicit pair wins when ordered; otherwise the readings'\n * extent with a 5 % margin (a floor at zero when `floorAtZero` and every\n * reading is non-negative); a flat extent gets a symmetric margin; no\n * readings give [0, 1].\n */\nexport function spanOf(readings: readonly number[], explicit: readonly number[] | undefined, floorAtZero: boolean): [number, number] {\n if (explicit?.length === 2 && explicit[0]! < explicit[1]!) return [explicit[0]!, explicit[1]!]\n if (readings.length === 0) return [0, 1]\n const low = Math.min(...readings)\n const high = Math.max(...readings)\n if (low === high) {\n const room = Math.abs(low) * 0.1 || 1\n return [low - room, high + room]\n }\n const room = (high - low) * 0.05\n return [floorAtZero && low >= 0 ? 0 : low - room, high + room]\n}\n\n/** About `count` evenly spaced ticks on 1-2-5 steps covering the domain. */\nexport function niceTicks([lo, hi]: [number, number], count = 5): number[] {\n const span = hi - lo\n if (!(span > 0)) return [lo]\n const raw = span / Math.max(1, count - 1)\n const magnitude = 10 ** Math.floor(Math.log10(raw))\n const step = [1, 2, 2.5, 5, 10].map((f) => f * magnitude).find((s) => s >= raw) ?? raw\n const first = Math.ceil(lo / step) * step\n const ticks: number[] = []\n for (let t = first; t <= hi + step * 1e-9; t += step) ticks.push(Number(t.toPrecision(12)))\n return ticks\n}\n\n/** Maps [d0, d1] to [r0, r1]. */\nexport function linear(domain: [number, number], range: [number, number]): (v: number) => number {\n const [d0, d1] = domain\n const [r0, r1] = range\n const k = (r1 - r0) / (d1 - d0 || 1)\n return (v) => r0 + (v - d0) * k\n}\n\n/** Indices of category labels to draw so neighbours never overlap. */\nexport function visibleLabelIndices(count: number, plotWidth: number, minGap = 56): number[] {\n if (count <= 0) return []\n const every = Math.max(1, Math.ceil((count * minGap) / Math.max(plotWidth, 1)))\n const keep: number[] = []\n for (let i = 0; i < count; i += every) keep.push(i)\n return keep\n}\n\n/** Runs of consecutive defined points; a missing value breaks the line. */\nexport function segments<T>(points: Array<T | null>): T[][] {\n const runs: T[][] = []\n let current: T[] = []\n for (const p of points) {\n if (p === null) {\n if (current.length) runs.push(current)\n current = []\n } else current.push(p)\n }\n if (current.length) runs.push(current)\n return runs\n}\n","// Crosses from the input description to the drawing model (see types.ts).\nimport { spanOf, toNumber } from './chartMath'\nimport type { ChartFigure, ChartForm, ChartLayer, ChartRecord, Glyph, Plot, Stroke, Track } from './types'\n\nconst GLYPH_CYCLE: readonly Glyph[] = ['dot', 'box', 'wedge', 'rhomb']\nconst DASH_CYCLE: readonly string[] = ['6 4', '2 3', '10 3 2 3', '4 4']\nconst PAINT = /^(?:--ty-)?(chart|categorical)-([1-8])$/\n\n/** Drawing mode per kind: bars and histograms stand on the floor, histogram bins touch. */\nconst STROKES: Record<ChartForm, Stroke> = {\n trend: { mode: 'path', fill: false },\n band: { mode: 'path', fill: true },\n columns: { mode: 'block', flush: false },\n bins: { mode: 'block', flush: true },\n}\n\n/** Resolved token colour; unknown tokens fall back to the chart cycle. */\nfunction hueFor(layer: ChartLayer, position: number): string {\n const hit = layer.tone ? PAINT.exec(layer.tone) : null\n return hit ? `var(--ty-${hit[1]}-${hit[2]})` : `var(--ty-chart-${(position % 8) + 1})`\n}\n\n/** Category text of a record. */\nexport function stopLabel(record: ChartRecord, field: string): string {\n const raw = record[field]\n return raw == null ? '' : String(raw)\n}\n\nexport function toPlot(figure: ChartFigure): Plot {\n const stops = figure.records.map((record) => stopLabel(record, figure.across.field))\n const tracks: Track[] = figure.layers.map((layer, position) => ({\n label: layer.field,\n hue: hueFor(layer, position),\n dash: layer.projected ? DASH_CYCLE[position % DASH_CYCLE.length] : undefined,\n glyph: GLYPH_CYCLE[position % GLYPH_CYCLE.length]!,\n readings: figure.records.map((record) => toNumber(record[layer.field])),\n }))\n const known = tracks.flatMap((t) => t.readings.filter((r): r is number => r !== null))\n const pins = (figure.notes ?? []).flatMap((note) => {\n const slot = stops.indexOf(String(note.at))\n return slot < 0 ? [] : [{ slot, text: note.text }]\n })\n return {\n kind: figure.form,\n stroke: STROKES[figure.form],\n stops,\n tracks,\n pins,\n span: spanOf(known, figure.up?.bounds, figure.form !== 'trend'),\n unit: figure.up?.unit,\n stopsHeader: figure.across.caption,\n }\n}\n","import {\n useId,\n useMemo,\n useReducer,\n useRef,\n useState,\n type KeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport type { ChartsGeoMessages } from '../../internal/messages/charts-geo'\nimport { useMessages } from '../../internal/provider'\nimport { DataTable } from '../data-table/DataTable'\nimport { EmptyState } from '../empty-state/EmptyState'\nimport { SegmentedControl } from '../segmented-control/SegmentedControl'\nimport { linear, niceTicks, segments, visibleLabelIndices } from './chartMath'\nimport { toPlot } from './plot'\nimport type { ChartFace, ChartFigure, Glyph, Plot, Track } from './types'\n\nexport type { ChartFace, ChartFigure, ChartForm, ChartLayer, ChartNote, ChartRecord } from './types'\n\nexport interface ChartProps {\n figure: ChartFigure\n face?: ChartFace\n defaultFace?: ChartFace\n onFaceChange?: (face: ChartFace) => void\n /** Width-to-height ratio of the plot; the chart always fills its container width. */\n aspect?: number\n /** Keyboard and pointer reading of points (default true). Static charts are one image. */\n interactive?: boolean\n /** Hide the chart/table switch (the table stays reachable through `face`). */\n hideViewSwitch?: boolean\n className?: string\n}\n\n/* ---------------------------------------------------------------- frame -- */\n\n/** viewBox width and the gutters around the plot, in viewBox units. */\nconst CANVAS = 640\nconst GUTTER = { head: 16, foot: 36, axisSide: 52, farSide: 20 }\n/** Tick label size (CSS 12px = 12 viewBox units) and the room kept beside it. */\nconst TICK_EM = 12\nconst TICK_GAP = 14\n/** Widest value gutter; a unit that would need more moves to a caption above the axis. */\nconst AXIS_MAX = 176\n/** Extra head room for that caption. */\nconst UNIT_CAPTION = 18\n\n/**\n * Estimated advance of a tick label in viewBox units: about 0.6 em per\n * grapheme, a full em for wide (CJK, fullwidth) ones. Deliberately generous,\n * so a label is never cut at the edge of the drawing.\n */\nexport function estimateTickWidth(text: string): number {\n const segmenter = typeof Intl.Segmenter === 'function' ? new Intl.Segmenter(undefined, { granularity: 'grapheme' }) : null\n const parts = segmenter ? Array.from(segmenter.segment(text), (s) => s.segment) : Array.from(text)\n return Math.ceil(parts.reduce((w, g) => w + ((g.codePointAt(0) ?? 0) >= 0x2e80 ? 1 : 0.62) * TICK_EM, 0))\n}\n\n/** Tick labels with and without the unit, for the gutter decision. */\nexport interface TickText {\n withUnit: (v: number) => string\n bare: (v: number) => string\n}\n\n/**\n * Value-axis layout: the gutter grows with the widest tick label. When the\n * unit would push it past AXIS_MAX, ticks show numbers only and the unit is\n * written once above the axis (never clipped).\n */\nexport function valueAxisLayout(ticks: number[], text: TickText, hasUnit: boolean) {\n const widest = (say: (v: number) => string) => Math.max(0, ...ticks.map((t) => estimateTickWidth(say(t))))\n const inline = widest(text.withUnit) + TICK_GAP\n if (!hasUnit || inline <= AXIS_MAX) return { gutter: Math.max(GUTTER.axisSide, inline), unitCaption: false, label: text.withUnit }\n return { gutter: Math.max(GUTTER.axisSide, Math.min(AXIS_MAX, widest(text.bare) + TICK_GAP)), unitCaption: true, label: text.bare }\n}\n\ninterface Frame {\n rtl: boolean\n tall: number\n /** Plot box in viewBox units (x0 always the physical left edge). */\n x0: number\n x1: number\n y0: number\n y1: number\n slotWidth: number\n slotX: (slot: number) => number\n valueY: (reading: number) => number\n floorY: number\n ticks: number[]\n /** Tick label text (with the unit unless it moved to the caption). */\n tickLabel: (v: number) => string\n /** The unit is written once above the value axis. */\n unitCaption: boolean\n}\n\nfunction frameFor(plot: Plot, aspect: number, rtl: boolean, text: TickText): Frame {\n const tall = Math.round(CANVAS / aspect)\n const ticks = niceTicks(plot.span, 5)\n const axis = valueAxisLayout(ticks, text, !!plot.unit)\n // The value axis sits on the inline start, so its wide gutter changes side in RTL.\n const x0 = rtl ? GUTTER.farSide : axis.gutter\n const x1 = CANVAS - (rtl ? axis.gutter : GUTTER.farSide)\n const y0 = GUTTER.head + (axis.unitCaption ? UNIT_CAPTION : 0)\n const y1 = tall - GUTTER.foot\n const slotWidth = (x1 - x0) / Math.max(plot.stops.length, 1)\n const valueY = linear(plot.span, [y1, y0])\n const [low, high] = plot.span\n return {\n rtl,\n tall,\n x0,\n x1,\n y0,\n y1,\n slotWidth,\n slotX: (slot) => (rtl ? x1 - slotWidth * (slot + 0.5) : x0 + slotWidth * (slot + 0.5)),\n valueY,\n floorY: valueY(Math.min(Math.max(0, low), high)),\n ticks,\n tickLabel: axis.label,\n unitCaption: axis.unitCaption,\n }\n}\n\n/* --------------------------------------------------------------- cursor -- */\n\n/** Focused reading: slot (category) and lane (series), or none. */\ntype Cursor = { slot: number; lane: number } | null\n\ntype CursorEvent = { type: 'key'; key: string; rtl: boolean; slots: number; lanes: number } | { type: 'set'; to: Cursor }\n\nfunction steer(cursor: Cursor, event: CursorEvent): Cursor {\n if (event.type === 'set') return event.to\n const at = cursor ?? { slot: 0, lane: 0 }\n const lastSlot = event.slots - 1\n const clampSlot = (s: number) => Math.min(lastSlot, Math.max(0, s))\n const forward = event.rtl ? 'ArrowLeft' : 'ArrowRight'\n const back = event.rtl ? 'ArrowRight' : 'ArrowLeft'\n switch (event.key) {\n case forward:\n return { ...at, slot: clampSlot(at.slot + 1) }\n case back:\n return { ...at, slot: clampSlot(at.slot - 1) }\n case 'ArrowDown':\n return { ...at, lane: Math.min(event.lanes - 1, at.lane + 1) }\n case 'ArrowUp':\n return { ...at, lane: Math.max(0, at.lane - 1) }\n case 'Home':\n return { ...at, slot: 0 }\n case 'End':\n return { ...at, slot: lastSlot }\n case 'Escape':\n return null\n default:\n return cursor\n }\n}\n\nconst STEERING_KEYS = new Set(['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End', 'Escape'])\n\n/* --------------------------------------------------------------- glyphs -- */\n\ntype GlyphDraw = (x: number, y: number, r: number, attrs: Record<string, unknown>) => ReactElement\n\nconst GLYPHS: Record<Glyph, GlyphDraw> = {\n dot: (x, y, r, attrs) => <circle {...attrs} cx={x} cy={y} r={r} />,\n box: (x, y, r, attrs) => <rect {...attrs} x={x - r} y={y - r} width={r * 2} height={r * 2} />,\n wedge: (x, y, r, attrs) => <polygon {...attrs} points={`${x},${y - r * 1.2} ${x + r * 1.1},${y + r * 0.9} ${x - r * 1.1},${y + r * 0.9}`} />,\n rhomb: (x, y, r, attrs) => <polygon {...attrs} points={`${x},${y - r * 1.3} ${x + r * 1.3},${y} ${x},${y + r * 1.3} ${x - r * 1.3},${y}`} />,\n}\n\n/* --------------------------------------------------------------- layers -- */\n\ninterface LayerProps {\n plot: Plot\n frame: Frame\n cursor: Cursor\n say: (reading: number) => string\n}\n\nfunction GridLayer({ plot, frame }: LayerProps) {\n const shown = visibleLabelIndices(plot.stops.length, frame.x1 - frame.x0)\n const tickX = frame.rtl ? frame.x1 + 8 : frame.x0 - 8\n return (\n <g className=\"ty-chart__axes\" aria-hidden=\"true\">\n {frame.ticks.map((t) => (\n <g key={t}>\n <line className=\"ty-chart__grid\" x1={frame.x0} x2={frame.x1} y1={frame.valueY(t)} y2={frame.valueY(t)} />\n <text className=\"ty-chart__tick\" x={tickX} y={frame.valueY(t)} textAnchor=\"end\" dominantBaseline=\"middle\">\n {frame.tickLabel(t)}\n </text>\n </g>\n ))}\n {frame.unitCaption && plot.unit ? (\n <text\n className=\"ty-chart__tick ty-chart__unit\"\n x={frame.rtl ? CANVAS - GUTTER.farSide : GUTTER.farSide}\n y={GUTTER.head}\n textAnchor={frame.rtl ? 'end' : 'start'}\n dominantBaseline=\"middle\"\n >\n {plot.unit}\n </text>\n ) : null}\n <line className=\"ty-chart__baseline\" x1={frame.x0} x2={frame.x1} y1={frame.y1} y2={frame.y1} />\n {shown.map((slot) => (\n <text key={slot} className=\"ty-chart__tick\" x={frame.slotX(slot)} y={frame.y1 + 20} textAnchor=\"middle\">\n {plot.stops[slot]}\n </text>\n ))}\n </g>\n )\n}\n\nfunction PinLayer({ plot, frame }: LayerProps) {\n const nudge = frame.rtl ? -4 : 4\n return (\n <g className=\"ty-chart__annotations\">\n {plot.pins.map((pin) => {\n const x = frame.slotX(pin.slot)\n return (\n <g key={`${pin.slot}:${pin.text}`} className=\"ty-chart__annotation\" data-category={plot.stops[pin.slot]}>\n <line x1={x} x2={x} y1={frame.y0} y2={frame.y1} />\n <text x={x + nudge} y={frame.y0 + 10}>\n {pin.text}\n </text>\n </g>\n )\n })}\n </g>\n )\n}\n\nfunction blockTrack(track: Track, lane: number, { plot, frame, cursor }: LayerProps) {\n const flush = plot.stroke.mode === 'block' && plot.stroke.flush\n const lanes = plot.tracks.length\n const group = flush ? frame.slotWidth : frame.slotWidth * 0.78\n const width = flush ? frame.slotWidth : group / lanes\n const leftOf = (slot: number) => {\n const middle = frame.slotX(slot)\n if (flush) return middle - frame.slotWidth / 2\n return frame.rtl ? middle + group / 2 - width * (lane + 1) : middle - group / 2 + width * lane\n }\n return track.readings.map((reading, slot) =>\n reading === null ? null : (\n <rect\n key={slot}\n className=\"ty-chart__mark ty-chart__bar\"\n data-active={(cursor?.slot === slot && cursor.lane === lane) || undefined}\n data-overlap={flush && lanes > 1 ? '' : undefined}\n x={leftOf(slot)}\n y={Math.min(frame.valueY(reading), frame.floorY)}\n width={width}\n height={Math.max(Math.abs(frame.floorY - frame.valueY(reading)), 0.5)}\n />\n ),\n )\n}\n\nfunction pathTrack(track: Track, lane: number, { plot, frame, cursor }: LayerProps) {\n const runs = segments(track.readings.map((reading, slot) => (reading === null ? null : { x: frame.slotX(slot), y: frame.valueY(reading), slot })))\n const fill = plot.stroke.mode === 'path' && plot.stroke.fill\n const draw = GLYPHS[track.glyph]\n const trace = (run: (typeof runs)[number]) => run.map((p, k) => `${k ? 'L' : 'M'}${p.x},${p.y}`).join(' ')\n return (\n <>\n {fill\n ? runs.map((run, k) => (\n <path key={`fill${k}`} className=\"ty-chart__area\" d={`M${run[0]!.x},${frame.floorY} ${trace(run).replace(/^M/, 'L')} L${run.at(-1)!.x},${frame.floorY} Z`} />\n ))\n : null}\n {runs.map((run, k) => (\n <path key={`stroke${k}`} className=\"ty-chart__line\" strokeDasharray={track.dash} d={trace(run)} />\n ))}\n {runs.flat().map((p) => {\n const lit = cursor?.slot === p.slot && cursor.lane === lane\n return <g key={p.slot}>{draw(p.x, p.y, lit ? 5.6 : 3.5, { className: 'ty-chart__mark', 'data-active': lit || undefined })}</g>\n })}\n </>\n )\n}\n\nfunction TrackLayer(props: LayerProps) {\n const drawTrack = props.plot.stroke.mode === 'block' ? blockTrack : pathTrack\n return (\n <g className=\"ty-chart__marks\">\n {props.plot.tracks.map((track, lane) => (\n <g key={track.label} data-series={track.label} data-index={lane} data-kind={props.plot.kind} style={{ color: track.hue }}>\n {drawTrack(track, lane, props)}\n </g>\n ))}\n </g>\n )\n}\n\n/** Drawing order: grid under pins under marks. */\nconst LAYERS = [GridLayer, PinLayer, TrackLayer]\n\nfunction Key({ plot, name }: { plot: Plot; name: string }) {\n return (\n <ul className=\"ty-chart__legend\" aria-label={name}>\n {plot.tracks.map((track) => (\n <li key={track.label} className=\"ty-chart__legend-item\" style={{ color: track.hue }} data-dashed={track.dash ? '' : undefined}>\n <svg className=\"ty-chart__swatch\" viewBox=\"0 0 24 12\" aria-hidden=\"true\" focusable=\"false\">\n <line x1=\"1\" x2=\"23\" y1=\"6\" y2=\"6\" strokeDasharray={track.dash ? '4 3' : undefined} />\n </svg>\n <span className=\"ty-chart__legend-name\">{track.label}</span>\n </li>\n ))}\n </ul>\n )\n}\n\nfunction TableView({ plot, caption, say, copy }: { plot: Plot; caption: string; say: (v: number) => string; copy: ChartsGeoMessages['chart'] }) {\n const columnOf = (lane: number) => `lane-${lane}`\n return (\n <DataTable\n caption={caption}\n columns={[\n { id: 'stop', header: plot.stopsHeader ?? copy.categoryColumn },\n ...plot.tracks.map((track, lane) => ({ id: columnOf(lane), header: track.label, numeric: true, align: 'end' as const })),\n ]}\n rows={plot.stops.map((stop, slot) => ({\n id: String(slot),\n cells: Object.fromEntries([\n ['stop', stop],\n ...plot.tracks.map((track, lane) => {\n const reading = track.readings[slot] ?? null\n return [columnOf(lane), reading === null ? <span className=\"ty-chart__missing\">{copy.missing}</span> : say(reading)]\n }),\n ]) as Record<string, ReactNode>,\n }))}\n />\n )\n}\n\n/* ------------------------------------------------------------ component -- */\n\n/** Accessible figure for a declarative chart, with a complete table view (spec: wave-2/chart.md). */\nexport function Chart(props: ChartProps) {\n const copy = useMessages().chart\n const { locale, direction } = useLocale()\n const rtl = direction === 'rtl'\n const base = useId()\n const live = props.interactive ?? true\n const plot = useMemo(() => toPlot(props.figure), [props.figure])\n const [ownFace, setOwnFace] = useState<ChartFace>(props.defaultFace ?? 'drawing')\n const view = props.face ?? ownFace\n const [cursor, dispatch] = useReducer(steer, null)\n const canvas = useRef<SVGSVGElement>(null)\n\n const say = useMemo(() => {\n const digits = new Intl.NumberFormat(locale, { maximumFractionDigits: 2 })\n const joiner = new Intl.ListFormat(locale, { type: 'unit', style: 'narrow' })\n const unit = plot.unit\n return (v: number) => (unit ? joiner.format([digits.format(v), unit]) : digits.format(v))\n }, [locale, plot.unit])\n const frame = useMemo(() => {\n const digits = new Intl.NumberFormat(locale, { maximumFractionDigits: 2 })\n return frameFor(plot, props.aspect ?? 16 / 9, rtl, { withUnit: say, bare: (v) => digits.format(v) })\n }, [plot, props.aspect, rtl, say, locale])\n\n const blank = plot.stops.length === 0 || plot.tracks.length === 0\n const ids = { title: `${base}-title`, hint: `${base}-hint` }\n\n const readoutText = (() => {\n if (!cursor) return ''\n const track = plot.tracks[cursor.lane]\n const stop = plot.stops[cursor.slot]\n if (!track || stop === undefined) return ''\n const reading = track.readings[cursor.slot] ?? null\n return copy.readout(stop, track.label, reading === null ? copy.missing : say(reading))\n })()\n\n const chooseView = (next: string) => {\n if (props.face === undefined) setOwnFace(next as ChartFace)\n props.onFaceChange?.(next as ChartFace)\n }\n\n const onKey = (event: KeyboardEvent<HTMLDivElement>) => {\n if (!STEERING_KEYS.has(event.key)) return\n event.preventDefault()\n dispatch({ type: 'key', key: event.key, rtl, slots: plot.stops.length, lanes: plot.tracks.length })\n }\n\n const aim = (event: ReactPointerEvent<SVGSVGElement>) => {\n const box = canvas.current?.getBoundingClientRect()\n if (!box?.width) return\n const vx = ((event.clientX - box.left) / box.width) * CANVAS\n const vy = ((event.clientY - box.top) / box.height) * frame.tall\n const along = rtl ? frame.x1 - vx : vx - frame.x0\n const slot = Math.max(0, Math.min(plot.stops.length - 1, Math.floor(along / frame.slotWidth)))\n const nearest = plot.tracks\n .map((track, lane) => ({ lane, reading: track.readings[slot] ?? null }))\n .filter((c): c is { lane: number; reading: number } => c.reading !== null)\n .sort((a, b) => Math.abs(frame.valueY(a.reading) - vy) - Math.abs(frame.valueY(b.reading) - vy))[0]\n dispatch({ type: 'set', to: { slot, lane: nearest?.lane ?? 0 } })\n }\n\n const layerProps: LayerProps = { plot, frame, cursor, say }\n\n const plotArea = (): ReactNode => {\n const drawing = (\n <svg\n ref={canvas}\n className=\"ty-chart__svg\"\n viewBox={`0 0 ${CANVAS} ${frame.tall}`}\n preserveAspectRatio=\"xMidYMid meet\"\n direction={rtl ? 'rtl' : 'ltr'}\n role={live ? undefined : 'img'}\n aria-label={live ? undefined : props.figure.heading}\n aria-hidden={live ? true : undefined}\n focusable=\"false\"\n {...(live ? { onPointerMove: aim, onPointerDown: aim, onPointerLeave: () => dispatch({ type: 'set', to: null }) } : {})}\n >\n {LAYERS.map((Layer, depth) => (\n <Layer key={depth} {...layerProps} />\n ))}\n </svg>\n )\n if (!live) {\n return (\n <div className=\"ty-chart__plot\" data-kind={plot.kind}>\n {drawing}\n </div>\n )\n }\n const bubbleAt = cursor ? (rtl ? CANVAS - frame.slotX(cursor.slot) : frame.slotX(cursor.slot)) / CANVAS : 0\n return (\n <div\n className=\"ty-chart__plot\"\n role=\"group\"\n tabIndex={0}\n aria-labelledby={ids.title}\n aria-describedby={ids.hint}\n onKeyDown={onKey}\n onFocus={() => dispatch({ type: 'set', to: cursor ?? { slot: 0, lane: 0 } })}\n onBlur={() => dispatch({ type: 'set', to: null })}\n data-kind={plot.kind}\n >\n {drawing}\n {cursor && readoutText ? (\n <div\n className=\"ty-chart__readout\"\n aria-hidden=\"true\"\n style={{ insetInlineStart: `${bubbleAt * 100}%` }}\n data-edge={cursor.slot > plot.stops.length / 2 ? 'end' : 'start'}\n >\n {readoutText}\n </div>\n ) : null}\n <span id={ids.hint} className=\"ty-visually-hidden\">\n {copy.plotHint(props.figure.heading)}\n </span>\n </div>\n )\n }\n\n const body: ReactNode = blank ? (\n <EmptyState reason=\"custom\" framing=\"inline\" title={copy.noData} description={copy.noDataHint} headingLevel={4} />\n ) : view === 'table' ? (\n <TableView plot={plot} caption={props.figure.heading} say={say} copy={copy} />\n ) : (\n plotArea()\n )\n\n const { heading: title, aside: subtitle, reading: finding } = props.figure\n return (\n <figure className={cx('ty-chart', props.className)} aria-labelledby={ids.title} data-view={view} data-kind={plot.kind} data-direction={direction}>\n <figcaption className=\"ty-chart__caption\">\n <span id={ids.title} className=\"ty-chart__title\">\n {title}\n </span>\n {subtitle ? <span className=\"ty-chart__subtitle\">{subtitle}</span> : null}\n {finding ? <span className=\"ty-chart__finding\">{finding}</span> : null}\n </figcaption>\n {blank || props.hideViewSwitch ? null : (\n <div className=\"ty-chart__tools\">\n <SegmentedControl\n size=\"compact\"\n label={copy.viewSwitch}\n options={[\n { value: 'drawing', label: copy.chartView },\n { value: 'table', label: copy.tableView },\n ]}\n value={view}\n onChange={chooseView}\n />\n </div>\n )}\n {!blank && view === 'drawing' ? <Key plot={plot} name={copy.legend} /> : null}\n {body}\n <div className=\"ty-visually-hidden\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {readoutText}\n </div>\n </figure>\n )\n}\n","// Renderers of the typed report sections, looked up by `kind`.\nimport type { ReactNode } from 'react'\nimport type { ChartsGeoMessages } from '../../internal/messages/charts-geo'\nimport { ActorChip, type ActorKind } from '../actor-chip/ActorChip'\nimport { InlineNotice } from '../inline-notice/InlineNotice'\nimport { StatusPill } from '../status-pill/StatusPill'\nimport type { ReportSection } from './types'\n\nexport interface SectionContext {\n copy: ChartsGeoMessages['report']\n number: (v: number) => string\n money: (v: number, currency?: string) => string\n renderMarkdown?: (source: string) => ReactNode\n renderInputRequest?: (data: ReportSection) => ReactNode\n renderRegionMap?: (data: ReportSection) => ReactNode\n}\n\ntype Renderer = (data: ReportSection, ctx: SectionContext) => ReactNode\n\nconst text = (v: unknown): string => (v === null || v === undefined ? '' : String(v))\nconst rows = (v: unknown): Array<Record<string, unknown>> => (Array.isArray(v) ? v.filter((x): x is Record<string, unknown> => !!x && typeof x === 'object') : [])\nconst num = (v: unknown): number | null => (typeof v === 'number' && Number.isFinite(v) ? v : null)\n\n/** Key/value list shared by several kinds. */\nfunction Pairs({ pairs }: { pairs: Array<[string, ReactNode]> }) {\n const shown = pairs.filter(([, v]) => v !== '' && v !== null && v !== undefined)\n if (!shown.length) return null\n return (\n <dl className=\"ty-report__pairs\">\n {shown.map(([k, v]) => (\n <div key={k} className=\"ty-report__pair\">\n <dt>{k}</dt>\n <dd>{v}</dd>\n </div>\n ))}\n </dl>\n )\n}\n\nfunction fieldPairs(fields: unknown): Array<[string, ReactNode]> {\n if (Array.isArray(fields)) return rows(fields).map((f) => [text(f.label), text(f.value)])\n if (fields && typeof fields === 'object') return Object.entries(fields as Record<string, unknown>).map(([k, v]) => [k, text(v)])\n return []\n}\n\nconst entity: Renderer = (d) => (\n <>\n {d.status ? <StatusPill status={text(d.status)} label={text(d.statusLabel ?? d.status)} tone=\"neutral\" size=\"small\" /> : null}\n {d.subtitle ? <p className=\"ty-report__muted\">{text(d.subtitle)}</p> : null}\n <Pairs pairs={fieldPairs(d.fields)} />\n </>\n)\n\nconst narrative: Renderer = (d, ctx) => {\n const actor = d.actor && typeof d.actor === 'object' ? (d.actor as { kind?: ActorKind; name?: string }) : null\n const seconds = num(d.durationSeconds)\n return (\n <>\n {actor?.name || seconds !== null ? (\n <div className=\"ty-report__byline\">\n {actor?.name ? <ActorChip kind={actor.kind ?? 'agent'} name={actor.name} compact /> : null}\n {seconds !== null ? <span className=\"ty-report__muted\">{ctx.copy.duration(seconds)}</span> : null}\n </div>\n ) : null}\n {text(d.text ?? d.body)\n .split(/\\n{2,}/)\n .filter(Boolean)\n .map((para, i) => (\n <p key={i} className=\"ty-report__prose\">\n {para}\n </p>\n ))}\n </>\n )\n}\n\nconst lifecycle: Renderer = (d, ctx) => (\n <ol className=\"ty-report__steps\">\n {rows(d.steps).map((step, i) => {\n const state = (['complete', 'current', 'upcoming'] as const).find((s) => s === step.state) ?? 'upcoming'\n return (\n <li key={i} className=\"ty-report__step\" data-state={state} aria-current={state === 'current' ? 'step' : undefined}>\n <span className=\"ty-report__step-label\">{text(step.label)}</span>\n <span className=\"ty-report__step-state\">{ctx.copy.lifecycle[state]}</span>\n </li>\n )\n })}\n </ol>\n)\n\nconst receipt: Renderer = (d, ctx) => {\n const c = ctx.copy.receipt\n const cur = typeof d.currency === 'string' ? d.currency : undefined\n const money = (v: unknown) => (num(v) === null ? '' : ctx.money(num(v)!, cur))\n const lines = rows(d.items)\n return (\n <>\n <table className=\"ty-report__receipt\">\n <thead>\n <tr>\n <th scope=\"col\">{c.description}</th>\n <th scope=\"col\" data-numeric=\"\">{c.quantity}</th>\n <th scope=\"col\" data-numeric=\"\">{c.unitPrice}</th>\n <th scope=\"col\" data-numeric=\"\">{c.total}</th>\n </tr>\n </thead>\n <tbody>\n {lines.map((l, i) => {\n const q = num(l.quantity)\n const unit = num(l.unitPrice)\n const total = num(l.total) ?? (q !== null && unit !== null ? q * unit : null)\n return (\n <tr key={i}>\n <td>{text(l.description)}</td>\n <td data-numeric=\"\">{q === null ? '' : ctx.number(q)}</td>\n <td data-numeric=\"\">{money(unit)}</td>\n <td data-numeric=\"\">{money(total)}</td>\n </tr>\n )\n })}\n </tbody>\n </table>\n <Pairs\n pairs={[\n [c.subtotal, money(d.subtotal)],\n [c.tax, money(d.tax)],\n [c.grandTotal, money(d.total)],\n ]}\n />\n </>\n )\n}\n\nconst approval: Renderer = (d, ctx) => {\n const a = ctx.copy.approval\n const decision = (['approved', 'rejected', 'pending'] as const).find((x) => x === d.decision) ?? 'pending'\n const tone = decision === 'approved' ? 'success' : decision === 'rejected' ? 'danger' : 'warning'\n return (\n <>\n <div className=\"ty-report__byline\">\n <StatusPill status={decision} tone={tone} label={a[decision]} />\n {d.by ? <span className=\"ty-report__muted\">{a.by(text(d.by))}</span> : null}\n {d.at ? <span className=\"ty-report__muted ty-report__mono\">{text(d.at)}</span> : null}\n </div>\n <Pairs\n pairs={[\n [a.reason, text(d.reason)],\n [a.prompt, text(d.prompt)],\n ]}\n />\n </>\n )\n}\n\nconst documentKind: Renderer = (d, ctx) => {\n const c = ctx.copy.document\n const mono = (v: unknown) => (v ? <span className=\"ty-report__mono\">{text(v)}</span> : '')\n return (\n <>\n <Pairs\n pairs={[\n [c.identifier, mono(d.identifier)],\n [c.accessKey, mono(d.accessKey)],\n [c.number, mono(d.number)],\n [c.series, mono(d.series)],\n [c.environment, text(d.environment)],\n ]}\n />\n {typeof d.href === 'string' ? (\n <a className=\"ty-report__link\" href={d.href}>\n {c.open}\n </a>\n ) : null}\n </>\n )\n}\n\nconst feed: Renderer = (d) => (\n <ul className=\"ty-report__feed\">\n {rows(d.entries).map((e, i) => (\n <li key={i} className=\"ty-report__feed-entry\" data-tone={text(e.tone) || 'default'}>\n <span className=\"ty-report__mono ty-report__muted\">{text(e.at)}</span>\n <span>{text(e.text)}</span>\n </li>\n ))}\n </ul>\n)\n\nconst score: Renderer = (d, ctx) => {\n const value = Math.max(0, Math.min(100, num(d.score) ?? 0))\n const label = text(d.label)\n return (\n <>\n <div className=\"ty-report__score\">\n <span className=\"ty-report__score-value\">{ctx.copy.score.outOf(value)}</span>\n {d.bucket ? <span className=\"ty-report__muted\">{text(d.bucket)}</span> : null}\n </div>\n <meter className=\"ty-report__meter\" min={0} max={100} value={value} aria-label={label || ctx.copy.score.outOf(value)} />\n {d.reasoning ? <Pairs pairs={[[ctx.copy.score.reasoning, text(d.reasoning)]]} /> : null}\n </>\n )\n}\n\nconst note: Renderer = (d) => {\n const tone = text(d.tone)\n const body = text(d.text ?? d.body)\n if (tone === 'danger' || tone === 'warning' || tone === 'info' || tone === 'success') return <InlineNotice tone={tone}>{body}</InlineNotice>\n return <p className=\"ty-report__note\">{body}</p>\n}\n\nconst markdown: Renderer = (d, ctx) => {\n const source = text(d.markdown ?? d.text)\n return ctx.renderMarkdown ? ctx.renderMarkdown(source) : narrative({ kind: 'narrative', text: source }, ctx)\n}\n\nconst regionMap: Renderer = (d, ctx) => {\n if (ctx.renderRegionMap) return ctx.renderRegionMap(d)\n return (\n <ul className=\"ty-report__feed\">\n {rows(d.items).map((item, i) => (\n <li key={i} className=\"ty-report__feed-entry\">\n <span className=\"ty-report__mono\">{text(item.code)}</span>\n <span>{text(item.label ?? item.name)}</span>\n </li>\n ))}\n </ul>\n )\n}\n\nconst inputRequest: Renderer = (d, ctx) => {\n if (ctx.renderInputRequest) return ctx.renderInputRequest(d)\n const fields = rows(d.fields)\n return (\n <div className=\"ty-report__request\" data-readonly=\"\">\n <p className=\"ty-report__muted\">{ctx.copy.inputRequestPending}</p>\n <p className=\"ty-report__prose\">{text(d.prompt)}</p>\n {fields.length ? (\n <ul className=\"ty-report__field-list\">\n {fields.map((f, i) => (\n <li key={i}>{text(f.label ?? f.name)}</li>\n ))}\n </ul>\n ) : null}\n </div>\n )\n}\n\nconst unknown: Renderer = (d, ctx) => {\n let raw = ''\n try {\n raw = JSON.stringify(d, null, 2)\n } catch {\n raw = String(d.kind)\n }\n return (\n <div className=\"ty-report__note\" data-unknown=\"\">\n <p>{ctx.copy.unknownSection(text(d.kind))}</p>\n <pre className=\"ty-report__raw\">{raw}</pre>\n </div>\n )\n}\n\nconst RENDERERS: Record<string, Renderer> = {\n entity,\n narrative,\n lifecycle,\n receipt,\n approval,\n document: documentKind,\n feed,\n score,\n note,\n markdown,\n regionMap,\n inputRequest,\n}\n\n/** The renderer for a section kind; unknown kinds get the neutral note. */\nexport function rendererFor(kind: unknown): Renderer {\n return (typeof kind === 'string' && Object.hasOwn(RENDERERS, kind) ? RENDERERS[kind] : undefined) ?? unknown\n}\n","// Pure validation of a report pasted by hand or produced by an agent.\n// Accepts anything and never throws.\nimport type { ReportIssue } from './types'\n\ntype Loose = Record<string, unknown>\nconst isObject = (v: unknown): v is Loose => typeof v === 'object' && v !== null && !Array.isArray(v)\nconst listOf = (v: unknown): unknown[] => (Array.isArray(v) ? v : [])\n\nfunction hasContent(r: Loose): boolean {\n const table = isObject(r.table) ? r.table : null\n const checks = [\n listOf(r.kpis).length > 0,\n listOf(r.charts).length > 0,\n !!table && listOf(table.rows).length > 0,\n typeof r.recommendation === 'string' && r.recommendation.trim() !== '',\n listOf(r.sections).length > 0,\n ]\n return checks.some(Boolean)\n}\n\nfunction chartIssues(charts: unknown[]): ReportIssue[] {\n const out: ReportIssue[] = []\n charts.forEach((chart, index) => {\n const layers = isObject(chart) ? chart.layers : undefined\n if (!Array.isArray(layers) || layers.length === 0) out.push({ code: 'chartLayersMissing', index })\n })\n return out\n}\n\nfunction tableIssues(table: Loose): ReportIssue[] {\n const declared = new Set(listOf(table.columns).flatMap((c) => (isObject(c) && typeof c.key === 'string' ? [c.key] : [])))\n const reported = new Set<string>()\n for (const row of listOf(table.rows)) {\n if (!isObject(row)) continue\n for (const key of Object.keys(row)) if (!declared.has(key)) reported.add(key)\n }\n return [...reported].map((key) => ({ code: 'tableColumnMissing' as const, key }))\n}\n\n/** Issues of a report; empty when it is valid. */\nexport function validateReport(input: unknown): ReportIssue[] {\n try {\n if (!isObject(input)) return [{ code: 'empty' }]\n const issues: ReportIssue[] = hasContent(input) ? [] : [{ code: 'empty' }]\n issues.push(...chartIssues(listOf(input.charts)))\n if (isObject(input.table)) issues.push(...tableIssues(input.table))\n return issues\n } catch {\n return [{ code: 'empty' }]\n }\n}\n","import { ArrowDownRight, ArrowRight, ArrowUpRight, Lightbulb } from 'lucide-react'\nimport { useId, useMemo, type ReactNode } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Chart } from '../chart/Chart'\nimport { DataTable } from '../data-table/DataTable'\nimport { EmptyState } from '../empty-state/EmptyState'\nimport { rendererFor, type SectionContext } from './sections'\nimport type { Report, ReportKpi, ReportSection, ReportTable } from './types'\nimport { validateReport } from './validateReport'\n\nexport type { Report, ReportColumnType, ReportIssue, ReportKpi, ReportSection, ReportTable, ReportTone } from './types'\nexport { validateReport } from './validateReport'\n\nexport interface ReportViewProps {\n report: Report\n /** Replaces the read-only summary of an `inputRequest` section (e.g. with SchemaRequestForm). */\n renderInputRequest?: (data: ReportSection) => ReactNode\n /** Replaces the default KPI tile (e.g. with MetricTile). */\n renderKpi?: (kpi: ReportKpi, index: number) => ReactNode\n /** Renders `markdown` sections (e.g. with MarkdownView); plain paragraphs otherwise. */\n renderMarkdown?: (source: string) => ReactNode\n /** Renders `regionMap` sections (e.g. with RegionMap); a list of codes otherwise. */\n renderRegionMap?: (data: ReportSection) => ReactNode\n /** Formatting locale; defaults to the provider locale. */\n locale?: string\n /** ISO 4217 code for currency columns and receipts without their own currency. */\n currency?: string\n className?: string\n}\n\ntype Formatters = { number: (v: number) => string; money: (v: number, currency?: string) => string; percent: (v: number) => string }\n\nfunction useFormatters(locale: string, currency?: string): Formatters {\n return useMemo(() => {\n const plain = new Intl.NumberFormat(locale, { maximumFractionDigits: 2 })\n const pct = new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 })\n const moneyCache = new Map<string, Intl.NumberFormat>()\n return {\n number: (v) => plain.format(v),\n percent: (v) => pct.format(v / 100),\n money: (v, code = currency) => {\n if (!code) return plain.format(v)\n let f = moneyCache.get(code)\n if (!f) {\n f = new Intl.NumberFormat(locale, { style: 'currency', currency: code })\n moneyCache.set(code, f)\n }\n return f.format(v)\n },\n }\n }, [locale, currency])\n}\n\nfunction DefaultKpi({ kpi, fmt }: { kpi: ReportKpi; fmt: Formatters }) {\n const value = typeof kpi.value === 'number' ? fmt.number(kpi.value) : kpi.value\n const d = kpi.delta\n const Trend = d === undefined || d === 0 ? ArrowRight : d > 0 ? ArrowUpRight : ArrowDownRight\n // Sideways parts of the trend arrow follow the reading direction (up stays up).\n return (\n <div className=\"ty-report__kpi\" data-tone={kpi.tone ?? 'neutral'}>\n <span className=\"ty-report__kpi-label\">{kpi.label}</span>\n <span className=\"ty-report__kpi-value\">\n {value}\n {kpi.unit ? <span className=\"ty-report__kpi-unit\"> {kpi.unit}</span> : null}\n </span>\n {d !== undefined ? (\n <span className=\"ty-report__kpi-delta\">\n <Trend className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n {`${d > 0 ? '+' : ''}${fmt.number(d)}${kpi.deltaUnit ?? ''}`}\n </span>\n ) : null}\n </div>\n )\n}\n\nfunction TableBlock({ table, fmt, noValue, fallbackCaption }: { table: ReportTable; fmt: Formatters; noValue: string; fallbackCaption: string }) {\n const cell = (raw: unknown, type: string | undefined): ReactNode => {\n if (raw === null || raw === undefined || raw === '') {\n return (\n // §2.13: no dash as decoration; the empty-value word is shown in the muted tone.\n <span className=\"ty-report__no-value\">{noValue}</span>\n )\n }\n if (typeof raw !== 'number') return String(raw)\n if (type === 'currency') return fmt.money(raw)\n if (type === 'percent') return fmt.percent(raw)\n return type === 'number' ? fmt.number(raw) : String(raw)\n }\n return (\n <DataTable\n caption={table.title ?? fallbackCaption}\n captionVisible={!!table.title}\n columns={table.columns.map((c) => {\n const numeric = c.type === 'number' || c.type === 'currency' || c.type === 'percent'\n return { id: c.key, header: c.label, numeric, align: c.align ?? (numeric ? 'end' : 'start') }\n })}\n rows={table.rows.map((row, i) => ({\n id: String(i),\n cells: Object.fromEntries(table.columns.map((c) => [c.key, cell(row[c.key], c.type)])),\n }))}\n />\n )\n}\n\nfunction metaPairs(meta: Report['meta']): Array<{ label: string; value: string }> {\n if (!meta) return []\n return Array.isArray(meta) ? meta : Object.entries(meta).map(([label, value]) => ({ label, value }))\n}\n\n/** Read-only renderer of a structured run report (spec: wave-2/report-view.md). */\nexport function ReportView(props: ReportViewProps) {\n const { report } = props\n const copy = useMessages().report\n const provided = useLocale().locale\n const fmt = useFormatters(props.locale ?? provided, props.currency)\n const titleId = useId()\n const isEmpty = validateReport(report).some((i) => i.code === 'empty')\n\n const ctx: SectionContext = {\n copy,\n number: fmt.number,\n money: fmt.money,\n renderMarkdown: props.renderMarkdown,\n renderInputRequest: props.renderInputRequest,\n renderRegionMap: props.renderRegionMap,\n }\n const kpis = report.kpis ?? []\n const charts = report.charts ?? []\n const sections = report.sections ?? []\n const footer = metaPairs(report.meta)\n\n return (\n <section className={cx('ty-report', props.className)} aria-labelledby={titleId} data-layout={report.layout ?? 'grid'}>\n <header className=\"ty-report__header\">\n <h2 id={titleId} className=\"ty-report__title\">\n {report.title}\n </h2>\n {report.subtitle ? <p className=\"ty-report__subtitle\">{report.subtitle}</p> : null}\n </header>\n\n {isEmpty ? <EmptyState reason=\"custom\" framing=\"section\" title={copy.empty} description={copy.emptyHint} headingLevel={3} /> : null}\n\n {kpis.length ? (\n <div className=\"ty-report__kpis\">\n {kpis.map((k, i) => (\n <div key={`${k.label}-${i}`} className=\"ty-report__kpi-cell\">\n {props.renderKpi ? props.renderKpi(k, i) : <DefaultKpi kpi={k} fmt={fmt} />}\n </div>\n ))}\n </div>\n ) : null}\n\n {charts.length ? (\n <div className=\"ty-report__charts\">\n {charts.map((c, i) =>\n Array.isArray(c.layers) && c.layers.length ? <Chart key={`${c.heading}-${i}`} figure={c} /> : null,\n )}\n </div>\n ) : null}\n\n {report.table && report.table.rows.length ? (\n <TableBlock table={report.table} fmt={fmt} noValue={copy.noValue} fallbackCaption={report.title} />\n ) : null}\n\n {report.recommendation && report.recommendation.trim() ? (\n <div className=\"ty-report__recommendation\" role=\"note\" aria-label={copy.recommendation}>\n <Lightbulb className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n <div>\n <p className=\"ty-report__recommendation-label\">{copy.recommendation}</p>\n <p className=\"ty-report__prose\">{report.recommendation}</p>\n </div>\n </div>\n ) : null}\n\n {sections.map((s, i) => {\n const render = rendererFor(s?.kind)\n return (\n <article key={s.id ?? i} className=\"ty-report__section\" data-kind={String(s?.kind)}>\n {s.title ? <h3 className=\"ty-report__section-title\">{s.title}</h3> : null}\n {render(s, ctx)}\n </article>\n )\n })}\n\n {footer.length ? (\n <footer className=\"ty-report__footer\">\n <dl className=\"ty-report__pairs\">\n {footer.map((p) => (\n <div key={p.label} className=\"ty-report__pair\">\n <dt>{p.label}</dt>\n <dd>{p.value}</dd>\n </div>\n ))}\n </dl>\n </footer>\n ) : null}\n </section>\n )\n}\n","// Run events and their reduction into what LiveReportView shows\n// (spec: wave-2/live-report-view.md, \"Event reduction\").\nimport type { RunPhase, RunStepState } from '../../internal/messages/charts-geo'\nimport type { Report, ReportSection } from '../report-view/types'\n\nexport type { RunPhase, RunStepState } from '../../internal/messages/charts-geo'\n\n/** One event of the run stream, as the host's transport delivers it. */\nexport type RunEvent =\n | { type: 'run.started'; id?: string }\n | { type: 'step.started'; stepId: string; stepKind?: string; id?: string }\n | { type: 'step.completed'; stepId: string; report?: Partial<Report>; id?: string }\n | { type: 'step.error'; stepId: string; message: string; id?: string }\n | { type: 'run.paused'; stepId: string; prompt: string; fields?: Array<{ name: string; label: string }>; id?: string }\n | { type: 'ui.section'; section: ReportSection; id?: string }\n | { type: 'run.completed'; id?: string }\n | { type: 'run.failed'; message: string; id?: string }\n\nexport interface RunStep {\n id: string\n kind?: string\n state: RunStepState\n error?: string\n}\n\nexport interface RunView {\n phase: RunPhase\n steps: RunStep[]\n report: Report | null\n error: string | null\n /** Step waiting for input while paused. */\n pausedStep: string | null\n}\n\nconst TERMINAL: ReadonlySet<string> = new Set(['completed', 'failed', 'cancelled'])\n\n/** Case-insensitive run status to a phase; unknown values count as pending. */\nexport function phaseOf(status: string | undefined | null): RunPhase {\n const s = (status ?? '').toLowerCase()\n if (s === 'canceled') return 'cancelled'\n const known: RunPhase[] = ['pending', 'running', 'paused', 'completed', 'failed', 'cancelled']\n return (known as string[]).includes(s) ? (s as RunPhase) : 'pending'\n}\n\nexport const isTerminal = (status: string | undefined | null) => TERMINAL.has(phaseOf(status))\n\n/** Adds a partial report onto an accumulated one: lists append, scalars replace. */\nexport function mergeReport(base: Report | null, part: Partial<Report> | undefined): Report | null {\n if (!part) return base\n const from = base ?? { title: part.title ?? '' }\n const join = <T,>(a: T[] | undefined, b: T[] | undefined) => (a || b ? [...(a ?? []), ...(b ?? [])] : undefined)\n const merged: Report = {\n ...from,\n ...Object.fromEntries(Object.entries(part).filter(([, v]) => v !== undefined)),\n title: part.title ?? from.title,\n }\n merged.kpis = join(from.kpis, part.kpis)\n merged.charts = join(from.charts, part.charts)\n merged.sections = join(from.sections, part.sections)\n return merged\n}\n\nfunction touchStep(steps: RunStep[], id: string, patch: Partial<RunStep>): RunStep[] {\n const at = steps.findIndex((s) => s.id === id)\n if (at < 0) return [...steps, { id, state: 'running', ...patch }]\n return steps.map((s, i) => (i === at ? { ...s, ...patch } : s))\n}\n\nexport function initialRunView(report: Report | null, status?: string | null): RunView {\n return { phase: phaseOf(status), steps: [], report, error: null, pausedStep: null }\n}\n\n/** Pure reducer from one event to the next view. */\nexport function reduceRunEvent(view: RunView, event: RunEvent): RunView {\n switch (event.type) {\n case 'run.started':\n return { ...view, phase: 'running' }\n case 'step.started':\n return { ...view, steps: touchStep(view.steps, event.stepId, { state: 'running', kind: event.stepKind }) }\n case 'step.completed':\n return { ...view, steps: touchStep(view.steps, event.stepId, { state: 'done' }), report: mergeReport(view.report, event.report) }\n case 'step.error':\n return { ...view, steps: touchStep(view.steps, event.stepId, { state: 'failed', error: event.message }) }\n case 'run.paused': {\n const request: ReportSection = { kind: 'inputRequest', id: `input-${event.stepId}`, stepId: event.stepId, prompt: event.prompt, fields: event.fields ?? [] }\n return {\n ...view,\n phase: 'paused',\n pausedStep: event.stepId,\n steps: touchStep(view.steps, event.stepId, { state: 'paused' }),\n report: mergeReport(view.report, { sections: [request] }),\n }\n }\n case 'ui.section':\n return { ...view, report: mergeReport(view.report, { sections: [event.section] }) }\n case 'run.completed':\n return { ...view, phase: 'completed', pausedStep: null }\n case 'run.failed':\n return { ...view, phase: 'failed', error: event.message, pausedStep: null }\n default:\n return view\n }\n}\n","// Run-event stream with resume, bounded retries and a circuit breaker\n// (spec: wave-2/live-report-view.md, \"Run-event stream\").\nimport { useEffect, useRef, useState } from 'react'\nimport type { RunEvent } from './runEvents'\n\nexport interface RunStreamCallbacks {\n connected: () => void\n event: (event: RunEvent) => void\n /** Last event id seen, used to resume after a reconnect. */\n cursor: (lastEventId: string) => void\n done: (outcome: 'completed' | 'failed') => void\n error: (error: unknown) => void\n}\n\n/** Host transport: opens one connection and returns the function that closes it. */\nexport type OpenRunStream = (flowId: string, runId: string, callbacks: RunStreamCallbacks, lastEventId: string | null) => () => void\n\nexport type RunStreamStatus = 'idle' | 'streaming' | 'completed' | 'failed' | 'error'\n\nexport interface RunStreamOptions {\n /** Consecutive retries before giving up (default 3). */\n maxRetries?: number\n /** First backoff in ms, doubled per retry (default 500). */\n backoffMs?: number\n /** Backoff cap in ms (default 4000). */\n maxBackoffMs?: number\n /** Connection attempts allowed inside `breakerWindowMs` (default 6). */\n breakerAttempts?: number\n breakerWindowMs?: number\n}\n\nexport interface RunStreamState {\n events: RunEvent[]\n status: RunStreamStatus\n error: unknown\n}\n\nconst IDLE: RunStreamState = { events: [], status: 'idle', error: null }\n\nexport function useRunEventStream(flowId: string | null, runId: string | null, openStream: OpenRunStream, options: RunStreamOptions = {}): RunStreamState {\n const [state, setState] = useState<RunStreamState>(IDLE)\n const opener = useRef(openStream)\n opener.current = openStream\n const opts = useRef(options)\n opts.current = options\n\n useEffect(() => {\n setState(IDLE)\n if (!flowId || !runId) return\n const cfg = { maxRetries: 3, backoffMs: 500, maxBackoffMs: 4000, breakerAttempts: 6, breakerWindowMs: 10_000, ...opts.current }\n let close: (() => void) | null = null\n let timer: ReturnType<typeof setTimeout> | null = null\n let cursor: string | null = null\n let retries = 0\n let finished = false\n const attempts: number[] = []\n\n const shutdown = () => {\n if (timer) clearTimeout(timer)\n timer = null\n const c = close\n close = null\n c?.()\n }\n\n const giveUp = (error: unknown) => {\n finished = true\n shutdown()\n setState((s) => ({ ...s, status: 'error', error }))\n }\n\n const connect = () => {\n const now = Date.now()\n attempts.push(now)\n while (attempts.length && now - attempts[0]! > cfg.breakerWindowMs) attempts.shift()\n if (attempts.length > cfg.breakerAttempts) return giveUp(new Error('run stream: too many connection attempts'))\n setState((s) => ({ ...s, status: 'streaming' }))\n let alive = true\n const guard =\n <A extends unknown[]>(fn: (...a: A) => void) =>\n (...a: A) => {\n if (alive && !finished) fn(...a)\n }\n close = opener.current(\n flowId,\n runId,\n {\n connected: guard(() => setState((s) => ({ ...s, status: 'streaming', error: null }))),\n event: guard((e: RunEvent) => {\n retries = 0\n setState((s) => ({ ...s, events: [...s.events, e] }))\n }),\n cursor: guard((id: string) => {\n cursor = id\n }),\n done: guard((outcome: 'completed' | 'failed') => {\n finished = true\n shutdown()\n setState((s) => ({ ...s, status: outcome }))\n }),\n error: guard((error: unknown) => {\n alive = false\n const c = close\n close = null\n c?.()\n if (retries >= cfg.maxRetries) return giveUp(error)\n const wait = Math.min(cfg.maxBackoffMs, cfg.backoffMs * 2 ** retries)\n retries += 1\n setState((s) => ({ ...s, error }))\n timer = setTimeout(() => {\n timer = null\n if (!finished) connect()\n }, wait)\n }),\n },\n cursor,\n )\n // A transport may report an error synchronously, before `close` was stored.\n if (!alive && close) {\n const c = close\n close = null\n c()\n }\n }\n\n connect()\n return () => {\n finished = true\n shutdown()\n }\n }, [flowId, runId])\n\n return state\n}\n","import { Check, CircleDashed, CirclePause, LoaderCircle, X } from 'lucide-react'\nimport { useMemo, useState, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { InlineNotice } from '../inline-notice/InlineNotice'\nimport { ReportView } from '../report-view/ReportView'\nimport type { Report, ReportSection } from '../report-view/types'\nimport { StatusPill, type StatusMap } from '../status-pill/StatusPill'\nimport { initialRunView, isTerminal, reduceRunEvent, type RunPhase, type RunStep, type RunStepState } from './runEvents'\nimport { useRunEventStream, type OpenRunStream, type RunStreamOptions } from './useRunEventStream'\n\nexport * from './runEvents'\nexport * from './useRunEventStream'\n\nexport interface LiveReportViewProps {\n flowId: string\n runId: string\n openStream: OpenRunStream\n initialReport?: Report | null\n /** Case-insensitive run status; a finished run is shown without subscribing. */\n initialStatus?: string\n /** Allow answering input requests in place (requires `submitInput`). */\n interactive?: boolean\n submitInput?: (runId: string, stepId: string, decision: unknown) => Promise<void>\n /** Host form for a pending input request (e.g. SchemaRequestForm); `submit` sends the decision. */\n renderInputRequest?: (data: ReportSection, submit: (decision: unknown) => Promise<void>) => ReactNode\n streamOptions?: RunStreamOptions\n className?: string\n}\n\nconst STEP_ICON: Record<RunStepState, ReactNode> = {\n running: <LoaderCircle />,\n done: <Check />,\n failed: <X />,\n paused: <CirclePause />,\n}\n\nfunction StepStrip({ steps, label, words }: { steps: RunStep[]; label: string; words: Record<RunStepState, string> }) {\n if (!steps.length) return null\n return (\n <ol className=\"ty-live-report__steps\" aria-label={label}>\n {steps.map((step) => (\n <li key={step.id} className=\"ty-live-report__step\" data-state={step.state} title={step.error}>\n <span className=\"ty-live-report__step-mark\" aria-hidden=\"true\">\n {STEP_ICON[step.state] ?? <CircleDashed />}\n </span>\n <span className=\"ty-live-report__step-id\">{step.id}</span>\n {step.kind ? <span className=\"ty-live-report__step-kind\">{step.kind}</span> : null}\n <span className=\"ty-live-report__step-state\">{words[step.state]}</span>\n {step.error ? <span className=\"ty-live-report__step-error\">{step.error}</span> : null}\n </li>\n ))}\n </ol>\n )\n}\n\n/** A run's report while it executes (spec: wave-2/live-report-view.md). */\nexport function LiveReportView(props: LiveReportViewProps) {\n const { flowId, runId, openStream, initialReport = null, initialStatus, interactive = false, submitInput } = props\n const copy = useMessages().liveReport\n const finishedAtMount = isTerminal(initialStatus)\n const stream = useRunEventStream(finishedAtMount ? null : flowId, finishedAtMount ? null : runId, openStream, props.streamOptions)\n const [answered, setAnswered] = useState<string | null>(null)\n\n const view = useMemo(\n () => stream.events.reduce(reduceRunEvent, initialRunView(initialReport, initialStatus)),\n [stream.events, initialReport, initialStatus],\n )\n // Optimistic: once the pending input is answered, show \"running\" until the stream moves on.\n const phase: RunPhase = view.phase === 'paused' && answered !== null && answered === view.pausedStep ? 'running' : view.phase\n\n const phaseMap: StatusMap = {\n pending: { label: copy.phase.pending, tone: 'neutral' },\n running: { label: copy.phase.running, tone: 'info', icon: <LoaderCircle />, busy: true },\n paused: { label: copy.phase.paused, tone: 'warning', icon: <CirclePause /> },\n completed: { label: copy.phase.completed, tone: 'success', icon: <Check /> },\n failed: { label: copy.phase.failed, tone: 'danger', icon: <X /> },\n cancelled: { label: copy.phase.cancelled, tone: 'neutral', icon: <CircleDashed /> },\n }\n\n const send = async (stepId: string, decision: unknown) => {\n if (!submitInput) return\n setAnswered(stepId)\n await submitInput(runId, stepId, decision)\n }\n\n const renderRequest = (data: ReportSection): ReactNode => {\n const stepId = typeof data.stepId === 'string' ? data.stepId : ''\n const open = interactive && !!submitInput && view.phase === 'paused' && stepId === view.pausedStep && answered !== stepId\n if (!open) {\n return (\n <div className=\"ty-live-report__request\">\n <p className=\"ty-live-report__prompt\">{String(data.prompt ?? '')}</p>\n </div>\n )\n }\n if (props.renderInputRequest) return props.renderInputRequest(data, (decision) => send(stepId, decision))\n return (\n <div className=\"ty-live-report__request\">\n <p className=\"ty-live-report__prompt\">{String(data.prompt ?? '')}</p>\n <div className=\"ty-live-report__actions\">\n <Button variant=\"primary\" onPress={() => void send(stepId, { approved: true })}>\n {copy.approve}\n </Button>\n <Button onPress={() => void send(stepId, { approved: false })}>{copy.reject}</Button>\n </div>\n </div>\n )\n }\n\n const streamError = stream.status === 'error' ? (stream.error instanceof Error ? stream.error.message : String(stream.error ?? '')) : null\n const failure = view.error ?? streamError\n\n return (\n <div className={cx('ty-live-report', props.className)} data-phase={phase}>\n <div className=\"ty-live-report__head\">\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className=\"ty-live-report__phase\">\n <StatusPill status={phase} statusMap={phaseMap} />\n </div>\n <StepStrip steps={view.steps} label={copy.steps} words={copy.step} />\n </div>\n {failure !== null ? (\n <InlineNotice tone=\"danger\" title={copy.failed}>\n {failure}\n </InlineNotice>\n ) : null}\n {view.report ? (\n <ReportView report={view.report} renderInputRequest={renderRequest} />\n ) : failure === null ? (\n <p className=\"ty-live-report__waiting\">{phase === 'paused' ? copy.pausedWaiting : copy.waiting}</p>\n ) : null}\n </div>\n )\n}\n","// ToneTint: a faint wash of a named tone on a glass surface, by token name\n// only (spec: wave-4/tone-tint-resolver.md). No colour value lives here.\nimport type { CSSProperties } from 'react'\nimport { devWarning } from '../../internal/dev'\n\nconst SEMANTIC = ['accent', 'success', 'pending', 'error', 'neutral'] as const\nconst CATEGORICAL = ['categorical-1', 'categorical-2', 'categorical-3', 'categorical-4', 'categorical-5', 'categorical-6', 'categorical-7', 'categorical-8'] as const\n\nexport type ToneName = (typeof SEMANTIC)[number] | (typeof CATEGORICAL)[number]\n\n/** Every tone, semantic first, in picker order. */\nexport const toneNames: readonly ToneName[] = Object.freeze([...SEMANTIC, ...CATEGORICAL])\n\nexport interface TintReferences {\n /** The tone itself (solid); alpha is applied with `color-mix()`. */\n rgb: string\n /** Surface wash. */\n soft: string\n /** Border and focus-adjacent glow. */\n ring: string\n}\n\n/** Where a tone is drawn; §2.3 allows categorical hues only in the first four. */\nexport type ToneContext = 'map' | 'chart' | 'legend' | 'graph-node' | 'surface' | 'table-cell' | 'record' | 'control'\nconst CATEGORY_CONTEXTS: ReadonlySet<ToneContext> = new Set(['map', 'chart', 'legend', 'graph-node'])\n\nexport function isToneName(value: unknown): value is ToneName {\n return typeof value === 'string' && (toneNames as readonly string[]).includes(value)\n}\n\nconst ref = (tone: ToneName, part: 'rgb' | 'soft' | 'ring') => `var(--ty-tint-${tone}-${part})`\n\n/** Token references for a tone; unknown input falls back to `fallback`, then to neutral. */\nexport function resolveTint(tone?: unknown, fallback?: ToneName): TintReferences {\n const chosen: ToneName = isToneName(tone) ? tone : isToneName(fallback) ? fallback : 'neutral'\n return { rgb: ref(chosen, 'rgb'), soft: ref(chosen, 'soft'), ring: ref(chosen, 'ring') }\n}\n\n/**\n * Inline style for a tinted surface root: sets the one property the glass\n * rule reads (`--ty-surface-tint`) plus its ring. Pair with `data-ty-tinted`.\n */\nexport function tintStyle(tone?: unknown, fallback?: ToneName): CSSProperties {\n const t = resolveTint(tone, fallback)\n return { ['--ty-surface-tint' as string]: t.soft, ['--ty-surface-tint-ring' as string]: t.ring } as CSSProperties\n}\n\n/**\n * Library usage check: a categorical tone outside maps, charts, legends and\n * graph nodes breaks §2.3. Returns the problem (and warns in development).\n */\nexport function checkToneUsage(tone: ToneName, context: ToneContext): string | null {\n const categorical = tone.startsWith('categorical-')\n const problem = categorical && !CATEGORY_CONTEXTS.has(context) ? `ToneTint: \"${tone}\" is a categorical tone and may not be used on a ${context} (design direction §2.3).` : null\n devWarning(problem !== null, problem ?? '')\n return problem\n}\n","// State of a RegionMap: items grouped by region, zoom, pan and hover\n// (spec: wave-2/region-map.md, \"State hook\").\nimport { useCallback, useMemo, useState } from 'react'\n\nexport interface RegionGroup<T> {\n code: string\n items: T[]\n count: number\n}\n\nexport interface RegionMapStateOptions<T> {\n items: readonly T[]\n getRegionCode: (item: T) => string\n /** Only regions listed here receive items; others are ignored. */\n regionCentres: Record<string, readonly [number, number]>\n minZoom?: number\n maxZoom?: number\n zoomStep?: number\n /** Zoom at mount (clamped). */\n initialZoom?: number\n}\n\nexport interface RegionMapState<T> {\n groups: RegionGroup<T>[]\n total: number\n zoom: number\n minZoom: number\n maxZoom: number\n canZoomIn: boolean\n canZoomOut: boolean\n zoomIn: () => void\n zoomOut: () => void\n setZoom: (z: number) => void\n pan: readonly [number, number]\n panBy: (dx: number, dy: number) => void\n resetView: () => void\n hovered: string | null\n setHovered: (code: string | null) => void\n /** Marker radius in map units: grows by count in four steps, shrinks as zoom grows. */\n markerRadius: (count: number) => number\n}\n\nconst STEPS: ReadonlyArray<[number, number]> = [\n [50, 22],\n [20, 18],\n [5, 15],\n [0, 12],\n]\n\nexport function useRegionMapState<T>(options: RegionMapStateOptions<T>): RegionMapState<T> {\n const { items, getRegionCode, regionCentres, minZoom = 1, maxZoom = 8, zoomStep = 0.5, initialZoom } = options\n const [zoom, setZoomRaw] = useState(() => Math.min(maxZoom, Math.max(minZoom, initialZoom ?? minZoom)))\n const [pan, setPan] = useState<readonly [number, number]>([0, 0])\n const [hovered, setHovered] = useState<string | null>(null)\n\n const groups = useMemo(() => {\n const byCode = new Map<string, T[]>()\n for (const item of items) {\n const code = getRegionCode(item)\n if (!Object.hasOwn(regionCentres, code)) continue\n const bucket = byCode.get(code)\n if (bucket) bucket.push(item)\n else byCode.set(code, [item])\n }\n return [...byCode].map(([code, list]) => ({ code, items: list, count: list.length })).sort((a, b) => b.count - a.count || a.code.localeCompare(b.code))\n }, [items, getRegionCode, regionCentres])\n\n const clamp = useCallback((z: number) => Math.min(maxZoom, Math.max(minZoom, Math.round(z * 100) / 100)), [minZoom, maxZoom])\n const setZoom = useCallback((z: number) => setZoomRaw(clamp(z)), [clamp])\n\n return {\n groups,\n total: groups.reduce((n, g) => n + g.count, 0),\n zoom,\n minZoom,\n maxZoom,\n canZoomIn: zoom < maxZoom,\n canZoomOut: zoom > minZoom,\n zoomIn: () => setZoomRaw((z) => clamp(z + zoomStep)),\n zoomOut: () => setZoomRaw((z) => clamp(z - zoomStep)),\n setZoom,\n pan,\n panBy: (dx, dy) => setPan(([x, y]) => [x + dx, y + dy]),\n resetView: () => {\n setZoomRaw(minZoom)\n setPan([0, 0])\n },\n hovered,\n setHovered,\n markerRadius: (count) => (STEPS.find(([min]) => count >= min)?.[1] ?? 12) / zoom,\n }\n}\n","import { geoEqualEarth, geoMercator, geoPath, type GeoProjection } from 'd3-geo'\nimport { Minus, Plus } from 'lucide-react'\nimport { useLocale } from 'react-aria-components'\nimport { useEffect, useId, useMemo, useRef, useState, type KeyboardEvent, type PointerEvent as ReactPointerEvent, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport type { ChartsGeoMessages } from '../../internal/messages/charts-geo'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { InlineNotice } from '../inline-notice/InlineNotice'\nimport { Skeleton } from '../skeleton/Skeleton'\nimport { resolveTint, type ToneName } from '../tone-tint/toneTint'\nimport { useRegionMapState, type RegionGroup } from './useRegionMapState'\n\nexport * from './useRegionMapState'\n\ntype RegionMapLabels = Pick<ChartsGeoMessages['regionMap'], 'map' | 'zoomIn' | 'zoomOut' | 'legendTitle' | 'more'>\n\nexport interface RegionMapTotals {\n items: number\n regions: number\n active: number\n}\n\nexport interface RegionMapProps<T> {\n items: readonly T[]\n getRegionCode: (item: T) => string\n /** Marker positions as [longitude, latitude]; items of other regions are ignored. */\n regionCentres: Record<string, readonly [number, number]>\n /** GeoJSON FeatureCollection with the subdivision shapes, served by the host. */\n shapesUrl: string\n /** Feature property holding the region code (default `code`). */\n regionProperty?: string\n projection?: 'mercator' | 'equal-area'\n getRegionName?: (code: string) => string\n /** Colour of a region; categorical tones follow the region order by default. */\n getRegionTone?: (code: string) => ToneName\n /** Flag image next to the name in the legend (alt text is the name). */\n getRegionFlag?: (code: string) => string | undefined\n isRegionActive?: (code: string) => boolean\n onRegionToggle?: (code: string) => void\n renderRegionDetail?: (code: string, items: T[]) => ReactNode\n /** Position of the detail panel (default: bottom-left). */\n detailPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n formatCounter?: (totals: RegionMapTotals) => string\n labels?: Partial<RegionMapLabels>\n /** Regions shown in the legend before \"+N more\" (default 5). */\n legendLimit?: number\n minZoom?: number\n maxZoom?: number\n initialZoom?: number\n className?: string\n}\n\ninterface Shape {\n code: string\n d: string\n}\n\ntype Load = { phase: 'loading' } | { phase: 'error' } | { phase: 'ready'; collection: GeoCollection }\ntype GeoCollection = { type: 'FeatureCollection'; features: Array<{ type: 'Feature'; properties: Record<string, unknown> | null; geometry: unknown }> }\n\nconst VIEW_W = 800\nconst VIEW_H = 560\nconst PAD = 20\nconst DRAG_THRESHOLD = 6\nconst PAN_STEP = 40\n\nfunction useShapes(url: string): Load {\n const [load, setLoad] = useState<Load>({ phase: 'loading' })\n useEffect(() => {\n let live = true\n setLoad({ phase: 'loading' })\n const ctrl = typeof AbortController === 'undefined' ? null : new AbortController()\n Promise.resolve()\n .then(() => fetch(url, ctrl ? { signal: ctrl.signal } : undefined))\n .then((res) => {\n if (!res.ok) throw new Error(`HTTP ${res.status}`)\n return res.json() as Promise<GeoCollection>\n })\n .then((collection) => {\n if (!live) return\n if (collection?.type !== 'FeatureCollection' || !Array.isArray(collection.features)) throw new Error('not a FeatureCollection')\n setLoad({ phase: 'ready', collection })\n })\n .catch(() => {\n if (live) setLoad({ phase: 'error' })\n })\n return () => {\n live = false\n ctrl?.abort()\n }\n }, [url])\n return load\n}\n\nfunction buildProjection(kind: 'mercator' | 'equal-area', collection: GeoCollection): GeoProjection {\n const base = kind === 'equal-area' ? geoEqualEarth() : geoMercator()\n return base.fitExtent(\n [\n [PAD, PAD],\n [VIEW_W - PAD, VIEW_H - PAD],\n ],\n collection as unknown as Parameters<GeoProjection['fitExtent']>[1],\n )\n}\n\n/** Count markers on a country's subdivisions, with keyboard access and a list alternative (spec: wave-2/region-map.md). */\nexport function RegionMap<T>(props: RegionMapProps<T>) {\n const { regionProperty = 'code', projection = 'mercator', legendLimit = 5 } = props\n const copy = useMessages().regionMap\n const { locale, direction } = useLocale()\n const figures = useMemo(() => new Intl.NumberFormat(locale), [locale])\n const labels = { ...copy, ...props.labels }\n const uid = useId()\n const state = useRegionMapState({\n items: props.items,\n getRegionCode: props.getRegionCode,\n regionCentres: props.regionCentres,\n minZoom: props.minZoom,\n maxZoom: props.maxZoom,\n initialZoom: props.initialZoom,\n })\n const load = useShapes(props.shapesUrl)\n const nameOf = (code: string) => props.getRegionName?.(code) ?? code\n const rank = useMemo(() => new Map(state.groups.map((g, i) => [g.code, i])), [state.groups])\n const toneOf = (code: string): string => {\n const chosen = props.getRegionTone?.(code)\n if (chosen) return resolveTint(chosen).rgb\n const i = rank.get(code)\n return i === undefined ? 'var(--ty-surface-sunken)' : `var(--ty-categorical-${(i % 8) + 1})`\n }\n const active = (code: string) => props.isRegionActive?.(code) ?? false\n\n const geo = useMemo(() => {\n if (load.phase !== 'ready') return null\n const proj = buildProjection(projection, load.collection)\n const path = geoPath(proj)\n const shapes: Shape[] = load.collection.features.flatMap((f) => {\n const raw = f.properties?.[regionProperty]\n const d = path(f as Parameters<typeof path>[0])\n return typeof raw === 'string' && d ? [{ code: raw, d }] : []\n })\n return { proj, shapes }\n }, [load, projection, regionProperty])\n\n const markers = useMemo(() => {\n if (!geo) return []\n return state.groups.flatMap((g) => {\n const p = geo.proj(props.regionCentres[g.code] as [number, number])\n return p ? [{ group: g, x: p[0], y: p[1] }] : []\n })\n }, [geo, state.groups, props.regionCentres])\n\n // Roving focus over markers, in count order.\n const [cursor, setCursor] = useState(0)\n const [detail, setDetail] = useState<string | null>(null)\n const markerRefs = useRef<Array<SVGGElement | null>>([])\n const zoomInRef = useRef<HTMLButtonElement | HTMLAnchorElement | null>(null)\n const safeCursor = Math.min(cursor, Math.max(markers.length - 1, 0))\n\n // Pointer gestures: drag pans, pinch zooms, a drag never counts as a tap.\n const svgRef = useRef<SVGSVGElement>(null)\n const pointers = useRef(new Map<number, { x: number; y: number }>())\n const gesture = useRef({ moved: false, startX: 0, startY: 0, pinch: 0, zoomAtPinch: 1 })\n const toView = () => {\n const w = svgRef.current?.getBoundingClientRect().width\n return w ? VIEW_W / w : 1\n }\n const onPointerDown = (e: ReactPointerEvent<SVGSVGElement>) => {\n pointers.current.set(e.pointerId, { x: e.clientX, y: e.clientY })\n const g = gesture.current\n if (pointers.current.size === 1) {\n g.moved = false\n g.startX = e.clientX\n g.startY = e.clientY\n } else if (pointers.current.size === 2) {\n const [a, b] = [...pointers.current.values()] as [{ x: number; y: number }, { x: number; y: number }]\n g.pinch = Math.hypot(a.x - b.x, a.y - b.y)\n g.zoomAtPinch = state.zoom\n g.moved = true\n }\n }\n const onPointerMove = (e: ReactPointerEvent<SVGSVGElement>) => {\n const prev = pointers.current.get(e.pointerId)\n if (!prev) return\n pointers.current.set(e.pointerId, { x: e.clientX, y: e.clientY })\n const g = gesture.current\n if (pointers.current.size >= 2 && g.pinch > 0) {\n const [a, b] = [...pointers.current.values()] as [{ x: number; y: number }, { x: number; y: number }]\n state.setZoom(g.zoomAtPinch * (Math.hypot(a.x - b.x, a.y - b.y) / g.pinch))\n return\n }\n if (!g.moved && Math.hypot(e.clientX - g.startX, e.clientY - g.startY) < DRAG_THRESHOLD) return\n g.moved = true\n const k = toView()\n state.panBy((e.clientX - prev.x) * k, (e.clientY - prev.y) * k)\n }\n const onPointerEnd = (e: ReactPointerEvent<SVGSVGElement>) => {\n pointers.current.delete(e.pointerId)\n if (pointers.current.size < 2) gesture.current.pinch = 0\n }\n\n const toggle = (code: string) => {\n if (gesture.current.moved) return\n props.onRegionToggle?.(code)\n }\n\n const focusMarker = (i: number) => {\n setCursor(i)\n markerRefs.current[i]?.focus()\n }\n\n const onMarkerKey = (e: KeyboardEvent<SVGGElement>, i: number, code: string) => {\n const last = markers.length - 1\n let handled = true\n if (e.shiftKey && e.key.startsWith('Arrow')) {\n const d: Record<string, [number, number]> = { ArrowLeft: [PAN_STEP, 0], ArrowRight: [-PAN_STEP, 0], ArrowUp: [0, PAN_STEP], ArrowDown: [0, -PAN_STEP] }\n const step = d[e.key]\n if (step) state.panBy(step[0], step[1])\n } else if (e.key === (direction === 'rtl' ? 'ArrowLeft' : 'ArrowRight') || e.key === 'ArrowDown') focusMarker(i >= last ? 0 : i + 1)\n else if (e.key === (direction === 'rtl' ? 'ArrowRight' : 'ArrowLeft') || e.key === 'ArrowUp') focusMarker(i <= 0 ? last : i - 1)\n // Shift+arrows pan the geography itself, which is never mirrored.\n else if (e.key === 'Home') focusMarker(0)\n else if (e.key === 'End') focusMarker(last)\n else if (e.key === 'Enter' || e.key === ' ') {\n gesture.current.moved = false\n toggle(code)\n } else if (e.key === '+' || e.key === '=') state.zoomIn()\n else if (e.key === '-' || e.key === '_') state.zoomOut()\n else if (e.key === 'Escape') {\n if (detail) setDetail(null)\n else zoomInRef.current?.focus()\n } else handled = false\n if (handled) e.preventDefault()\n }\n\n const detailGroup = detail ? state.groups.find((g) => g.code === detail) : undefined\n const legend = state.groups.slice(0, legendLimit)\n const hidden = Math.max(0, state.groups.length - legend.length)\n const activeCount = state.groups.filter((g) => active(g.code)).length\n const [panX, panY] = state.pan\n const transform = `translate(${VIEW_W / 2 + panX} ${VIEW_H / 2 + panY}) scale(${state.zoom}) translate(${-VIEW_W / 2} ${-VIEW_H / 2})`\n\n const regionLabel = (g: RegionGroup<T>) => copy.regionItems(nameOf(g.code), g.count)\n\n let canvas: ReactNode\n if (load.phase === 'loading') {\n canvas = (\n <div className=\"ty-region-map__placeholder\" role=\"status\" aria-label={copy.loading}>\n <Skeleton shape=\"rect\" />\n </div>\n )\n } else if (load.phase === 'error' || !geo) {\n canvas = (\n <div className=\"ty-region-map__placeholder\">\n <InlineNotice tone=\"danger\">{copy.loadError}</InlineNotice>\n </div>\n )\n } else {\n canvas = (\n <svg\n ref={svgRef}\n className=\"ty-region-map__svg\"\n viewBox={`0 0 ${VIEW_W} ${VIEW_H}`}\n role=\"group\"\n aria-label={labels.map}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n >\n <g transform={transform}>\n <g className=\"ty-region-map__shapes\" aria-hidden=\"true\">\n {geo.shapes.map((s) => (\n <path\n key={s.code}\n d={s.d}\n className=\"ty-region-map__shape\"\n style={{ fill: toneOf(s.code) }}\n data-has-items={rank.has(s.code) || undefined}\n data-active={active(s.code) || undefined}\n data-hovered={state.hovered === s.code || undefined}\n onPointerEnter={() => state.setHovered(s.code)}\n onPointerLeave={() => state.setHovered(null)}\n onClick={() => rank.has(s.code) && toggle(s.code)}\n />\n ))}\n </g>\n <g className=\"ty-region-map__markers\">\n {markers.map(({ group, x, y }, i) => {\n const r = state.markerRadius(group.count)\n const pressed = active(group.code)\n return (\n <g\n key={group.code}\n ref={(el) => {\n markerRefs.current[i] = el\n }}\n className=\"ty-region-map__marker\"\n role=\"button\"\n tabIndex={i === safeCursor ? 0 : -1}\n aria-pressed={props.onRegionToggle ? pressed : undefined}\n aria-label={regionLabel(group)}\n data-code={group.code}\n data-active={pressed || undefined}\n transform={`translate(${x} ${y})`}\n onFocus={() => {\n setCursor(i)\n setDetail(group.code)\n }}\n onKeyDown={(e) => onMarkerKey(e, i, group.code)}\n onClick={() => toggle(group.code)}\n onPointerEnter={() => state.setHovered(group.code)}\n onPointerLeave={() => state.setHovered(null)}\n >\n <circle className=\"ty-region-map__hit\" r={Math.max(r, 22 / state.zoom)} />\n <circle className=\"ty-region-map__dot\" r={r} style={{ color: toneOf(group.code) }} />\n <text className=\"ty-region-map__count\" textAnchor=\"middle\" dominantBaseline=\"central\" style={{ fontSize: `${12 / state.zoom}px` }}>\n {figures.format(group.count)}\n </text>\n </g>\n )\n })}\n </g>\n </g>\n </svg>\n )\n }\n\n const hoverCode = detail ?? state.hovered\n const panel = hoverCode && props.renderRegionDetail ? props.renderRegionDetail(hoverCode, (detailGroup ?? state.groups.find((g) => g.code === hoverCode))?.items ?? []) : null\n\n return (\n <div className={cx('ty-region-map', props.className)} data-phase={load.phase}>\n {props.formatCounter ? (\n <p className=\"ty-region-map__counter\">{props.formatCounter({ items: state.total, regions: state.groups.length, active: activeCount })}</p>\n ) : null}\n <div className=\"ty-region-map__stage\">\n {canvas}\n <div className=\"ty-region-map__zoom\">\n <Button ref={zoomInRef} iconOnly accessibleLabel={labels.zoomIn} leadingIcon={<Plus />} disabled={!state.canZoomIn} onPress={state.zoomIn} />\n <Button iconOnly accessibleLabel={labels.zoomOut} leadingIcon={<Minus />} disabled={!state.canZoomOut} onPress={state.zoomOut} />\n <output className=\"ty-region-map__zoom-value\" aria-live=\"polite\">\n {copy.zoomValue(Math.round(state.zoom * 100))}\n </output>\n </div>\n {panel ? (\n <div className=\"ty-region-map__detail\" id={`${uid}-detail`} data-position={props.detailPosition ?? 'bottom-left'}>\n {panel}\n </div>\n ) : null}\n </div>\n\n {legend.length ? (\n <div className=\"ty-region-map__legend\">\n <p className=\"ty-region-map__legend-title\" id={`${uid}-legend`}>\n {labels.legendTitle}\n </p>\n <ul aria-labelledby={`${uid}-legend`}>\n {legend.map((g) => {\n const flag = props.getRegionFlag?.(g.code)\n return (\n <li key={g.code} className=\"ty-region-map__legend-item\">\n {flag ? (\n <img className=\"ty-region-map__flag\" src={flag} alt={nameOf(g.code)} />\n ) : (\n <span className=\"ty-region-map__swatch\" style={{ background: toneOf(g.code) }} aria-hidden=\"true\" />\n )}\n <span>{flag ? null : nameOf(g.code)}</span>\n <span className=\"ty-region-map__legend-count\">{figures.format(g.count)}</span>\n </li>\n )\n })}\n {hidden ? <li className=\"ty-region-map__legend-more\">{labels.more(hidden)}</li> : null}\n </ul>\n </div>\n ) : null}\n\n <ul className=\"ty-region-map__list\" aria-label={copy.regionList}>\n {state.groups.map((g) => (\n <li key={g.code} className=\"ty-region-map__list-item\">\n {props.onRegionToggle ? (\n <Button\n variant=\"quiet\"\n size=\"compact\"\n aria-pressed={active(g.code)}\n onPress={() => props.onRegionToggle?.(g.code)}\n className=\"ty-region-map__list-toggle\"\n >\n {regionLabel(g)}\n </Button>\n ) : (\n <span>{regionLabel(g)}</span>\n )}\n </li>\n ))}\n </ul>\n </div>\n )\n}\n","// RegionThemeData format and its validation (spec: wave-4/region-theme-data.md).\n// Values in data modules are identity facts from public sources, never UI tokens.\nimport type { SubdivisionKind } from '../../internal/messages/charts-geo'\n\nexport type { SubdivisionKind } from '../../internal/messages/charts-geo'\n\nexport type LonLat = [longitude: number, latitude: number]\n\nexport interface SubdivisionRecord {\n /** Part after the hyphen of the ISO 3166-2 code, upper case. */\n code: string\n name: { local: string; en?: string }\n /** Two colours from the official flag or arms specification; absent when there is none. */\n identity?: { primary: string; secondary: string }\n /**\n * A point inside the polygon for a label. Optional in this library: modules\n * leave it out until it is computed from public boundary data with\n * `deriveGeometry()` (see ./geometry.ts); nothing is guessed.\n */\n labelPoint?: LonLat\n}\n\nexport interface SourceCitation {\n /** Field group the citation covers: `codes`, `names`, `macroRegions`, `identity`, `labelPoint`, `view`. */\n field: string\n citation: string\n url: string\n /** ISO date the source was consulted. */\n retrievedOn: string\n}\n\nexport interface RegionThemeEntry {\n country: string\n subdivisionKind: SubdivisionKind\n subdivisions: SubdivisionRecord[]\n /** Default map view; derived from boundary data like `labelPoint`. */\n view?: { centre: LonLat; zoomHint?: number }\n macroRegions?: Array<{ id: string; labelKey: string; codes: string[] }>\n flagUrlTemplate?: string\n sources: SourceCitation[]\n version: string\n}\n\nexport const SUBDIVISION_KINDS: readonly SubdivisionKind[] = [\n 'state',\n 'province',\n 'region',\n 'department',\n 'governorate',\n 'prefecture',\n 'county',\n 'voivodeship',\n 'district',\n 'nation',\n]\n\nconst HEX6 = /^#[0-9a-f]{6}$/i\nconst ALPHA2 = /^[A-Z]{2}$/\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}$/\nconst SUB_CODE = /^[A-Z0-9]{1,3}$/\n\nexport class RegionThemeError extends Error {\n constructor(\n readonly country: string,\n readonly field: string,\n readonly code: string | undefined,\n detail: string,\n ) {\n super(`RegionThemeData ${country || '??'}: ${field}${code ? ` (subdivision ${code})` : ''} ${detail}`)\n this.name = 'RegionThemeError'\n }\n}\n\nconst inLon = (v: unknown) => typeof v === 'number' && v >= -180 && v <= 180\nconst inLat = (v: unknown) => typeof v === 'number' && v >= -90 && v <= 90\nconst isLonLat = (p: unknown): p is LonLat => Array.isArray(p) && p.length === 2 && inLon(p[0]) && inLat(p[1])\n\n/** Throws a RegionThemeError naming the country, field and subdivision on the first problem. */\nexport function validateRegionThemeEntry(entry: RegionThemeEntry): void {\n const c = typeof entry?.country === 'string' ? entry.country : ''\n const fail = (field: string, detail: string, code?: string): never => {\n throw new RegionThemeError(c, field, code, detail)\n }\n if (!ALPHA2.test(c)) fail('country', 'must be an ISO 3166-1 alpha-2 code in upper case')\n if (!SUBDIVISION_KINDS.includes(entry.subdivisionKind)) fail('subdivisionKind', `must be one of ${SUBDIVISION_KINDS.join(', ')}`)\n if (!Array.isArray(entry.subdivisions) || entry.subdivisions.length === 0) fail('subdivisions', 'must list at least one subdivision')\n const seen = new Set<string>()\n for (const s of entry.subdivisions) {\n const code = typeof s?.code === 'string' ? s.code : ''\n if (!SUB_CODE.test(code)) fail('subdivisions[].code', 'must be the upper-case part after the hyphen of the ISO 3166-2 code', code || undefined)\n if (seen.has(code)) fail('subdivisions[].code', 'is duplicated', code)\n seen.add(code)\n if (typeof s.name?.local !== 'string' || !s.name.local.trim()) fail('subdivisions[].name.local', 'is required', code)\n if (s.identity !== undefined) {\n if (!HEX6.test(String(s.identity.primary))) fail('subdivisions[].identity.primary', 'must be a six-digit hex colour', code)\n if (!HEX6.test(String(s.identity.secondary))) fail('subdivisions[].identity.secondary', 'must be a six-digit hex colour', code)\n }\n if (s.labelPoint !== undefined && !isLonLat(s.labelPoint)) fail('subdivisions[].labelPoint', 'must be [longitude, latitude]', code)\n }\n if (entry.view !== undefined && !isLonLat(entry.view.centre)) fail('view.centre', 'must be [longitude, latitude]')\n for (const group of entry.macroRegions ?? []) {\n if (!group.id || !group.labelKey) fail('macroRegions', 'need an id and a labelKey')\n for (const code of group.codes ?? []) if (!seen.has(code)) fail('macroRegions[].codes', `lists an unknown subdivision in group ${group.id}`, code)\n }\n if (entry.flagUrlTemplate !== undefined && !entry.flagUrlTemplate.includes('{code}')) fail('flagUrlTemplate', 'must contain the {code} placeholder')\n if (!Array.isArray(entry.sources) || entry.sources.length === 0) fail('sources', 'must cite at least one source')\n for (const src of entry.sources) {\n if (!src.field || !src.citation || !/^https?:\\/\\//.test(String(src.url)) || !ISO_DATE.test(String(src.retrievedOn))) {\n fail('sources', `entry for \"${src?.field ?? '?'}\" needs field, citation, an http(s) url and an ISO retrievedOn date`)\n }\n }\n const cited = new Set(entry.sources.map((s) => s.field))\n const needs = ['codes', 'names']\n if (entry.macroRegions?.length) needs.push('macroRegions')\n if (entry.subdivisions.some((s) => s.identity)) needs.push('identity')\n if (entry.subdivisions.some((s) => s.labelPoint)) needs.push('labelPoint')\n if (entry.view) needs.push('view')\n for (const field of needs) if (!cited.has(field)) fail('sources', `has no citation for the \"${field}\" field group`)\n if (!ISO_DATE.test(entry.version)) fail('version', 'must be an ISO date')\n}\n","// RegionThemeRegistry: optional identity data of first-level subdivisions\n// (spec: wave-4/region-theme-registry.md). The registry holds no country data;\n// modules register at start-up.\nimport { createContext, createElement, useContext, type ReactNode } from 'react'\nimport { values } from '@datatechsolutions/tympan-tokens/values'\nimport { toneNames, type ToneName } from '../tone-tint/toneTint'\nimport { validateRegionThemeEntry, type LonLat, type RegionThemeEntry, type SubdivisionKind, type SubdivisionRecord } from './format'\n\nexport interface IdentityColours {\n primary: string\n secondary: string\n /** Text colour on `primary` reaching 4.5:1, computed here, never stored. */\n onPrimary: 'light' | 'dark'\n}\n\nexport interface Subdivision {\n code: string\n name: { local: string; en?: string }\n kind: SubdivisionKind\n}\n\nexport interface RegionThemeRegistry {\n register(entry: RegionThemeEntry): void\n unregister(country: string): void\n countries(): string[]\n getSubdivision(country: string, code: string): Subdivision | undefined\n listSubdivisions(country: string): Subdivision[] | undefined\n isKnownSubdivision(country: string, code: string): boolean\n getIdentityColours(country: string, code: string): IdentityColours | undefined\n getIdentityTone(country: string, code: string): ToneName | undefined\n getLabelPoint(country: string, code: string): LonLat | undefined\n getCountryView(country: string): { centre: LonLat; zoomHint?: number } | undefined\n getMacroRegions(country: string): Array<{ id: string; labelKey: string; codes: string[] }> | undefined\n getFlagUrl(country: string, code: string): string | undefined\n}\n\n// Light and dark text of the design direction (§2.3: no pure white or black).\nconst LIGHT_TEXT = '#fcfdfd'\nconst DARK_TEXT = '#0f172a'\n\n/** Categorical tones with their light-theme colour, to pick the nearest tone by hue. */\nconst CATEGORY_COLOURS: ReadonlyArray<[ToneName, string]> = toneNames\n .filter((t) => t.startsWith('categorical-'))\n .flatMap((t) => {\n const hex = values.themes.tympan.light?.[`--ty-${t}` as `--ty-categorical-1`]\n return hex && /^#[0-9a-f]{6}$/i.test(hex) ? [[t, hex] as [ToneName, string]] : []\n })\n\nfunction channels(hex: string): [number, number, number] {\n const n = Number.parseInt(hex.slice(1), 16)\n return [(n >> 16) & 255, (n >> 8) & 255, n & 255]\n}\n\nfunction luminance(hex: string): number {\n const lin = channels(hex).map((v) => {\n const c = v / 255\n return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4\n })\n return 0.2126 * lin[0]! + 0.7152 * lin[1]! + 0.0722 * lin[2]!\n}\n\n/** WCAG contrast ratio of two hex colours. */\nexport function contrastRatio(a: string, b: string): number {\n const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x) as [number, number]\n return (hi + 0.05) / (lo + 0.05)\n}\n\nfunction hueOf(hex: string): number {\n const [r, g, b] = channels(hex).map((v) => v / 255) as [number, number, number]\n const max = Math.max(r, g, b)\n const d = max - Math.min(r, g, b)\n if (d === 0) return -1\n const h = max === r ? ((g - b) / d) % 6 : max === g ? (b - r) / d + 2 : (r - g) / d + 4\n return (h * 60 + 360) % 360\n}\n\nconst key = (v: string) => v.trim().toUpperCase()\n\nexport function createRegionThemeRegistry(): RegionThemeRegistry {\n const store = new Map<string, RegionThemeEntry>()\n const record = (country: string, code: string): SubdivisionRecord | undefined =>\n store.get(key(country))?.subdivisions.find((s) => s.code === key(code))\n const asSubdivision = (entry: RegionThemeEntry, s: SubdivisionRecord): Subdivision => ({ code: s.code, name: { ...s.name }, kind: entry.subdivisionKind })\n\n return {\n register(entry) {\n validateRegionThemeEntry(entry)\n store.set(entry.country, entry)\n },\n unregister(country) {\n store.delete(key(country))\n },\n countries: () => [...store.keys()],\n getSubdivision(country, code) {\n const entry = store.get(key(country))\n const s = record(country, code)\n return entry && s ? asSubdivision(entry, s) : undefined\n },\n listSubdivisions(country) {\n const entry = store.get(key(country))\n return entry?.subdivisions.map((s) => asSubdivision(entry, s))\n },\n isKnownSubdivision: (country, code) => record(country, code) !== undefined,\n getIdentityColours(country, code) {\n const id = record(country, code)?.identity\n if (!id) return undefined\n const onPrimary = contrastRatio(id.primary, LIGHT_TEXT) >= contrastRatio(id.primary, DARK_TEXT) ? 'light' : 'dark'\n return { primary: id.primary.toLowerCase(), secondary: id.secondary.toLowerCase(), onPrimary }\n },\n getIdentityTone(country, code) {\n const id = record(country, code)?.identity\n if (!id) return undefined\n const h = hueOf(id.primary)\n if (h < 0) return 'neutral'\n let best: ToneName = 'neutral'\n let gap = 361\n for (const [tone, hex] of CATEGORY_COLOURS) {\n const hue = hueOf(hex)\n const d = Math.min(Math.abs(h - hue), 360 - Math.abs(h - hue))\n if (d < gap) {\n gap = d\n best = tone\n }\n }\n return best\n },\n getLabelPoint: (country, code) => record(country, code)?.labelPoint,\n getCountryView: (country) => store.get(key(country))?.view,\n getMacroRegions: (country) => store.get(key(country))?.macroRegions?.map((g) => ({ ...g, codes: [...g.codes] })),\n getFlagUrl(country, code) {\n const entry = store.get(key(country))\n const s = record(country, code)\n if (!entry?.flagUrlTemplate || !s) return undefined\n return entry.flagUrlTemplate.replaceAll('{code}', s.code)\n },\n }\n}\n\n/** Module-level default registry used by the free functions below. */\nexport const defaultRegionThemeRegistry = createRegionThemeRegistry()\n\nexport const registerRegionTheme = (entry: RegionThemeEntry) => defaultRegionThemeRegistry.register(entry)\nexport const unregisterRegionTheme = (country: string) => defaultRegionThemeRegistry.unregister(country)\nexport const getSubdivision = (country: string, code: string) => defaultRegionThemeRegistry.getSubdivision(country, code)\nexport const listSubdivisions = (country: string) => defaultRegionThemeRegistry.listSubdivisions(country)\nexport const isKnownSubdivision = (country: string, code: string) => defaultRegionThemeRegistry.isKnownSubdivision(country, code)\nexport const getIdentityColours = (country: string, code: string) => defaultRegionThemeRegistry.getIdentityColours(country, code)\nexport const getIdentityTone = (country: string, code: string) => defaultRegionThemeRegistry.getIdentityTone(country, code)\nexport const getLabelPoint = (country: string, code: string) => defaultRegionThemeRegistry.getLabelPoint(country, code)\nexport const getCountryView = (country: string) => defaultRegionThemeRegistry.getCountryView(country)\nexport const getMacroRegions = (country: string) => defaultRegionThemeRegistry.getMacroRegions(country)\nexport const getFlagUrl = (country: string, code: string) => defaultRegionThemeRegistry.getFlagUrl(country, code)\n\nconst RegistryContext = createContext<RegionThemeRegistry>(defaultRegionThemeRegistry)\n\n/** Supplies an isolated registry to a subtree (tests, embeds). */\nexport function RegionThemeProvider({ registry, children }: { registry: RegionThemeRegistry; children: ReactNode }) {\n return createElement(RegistryContext.Provider, { value: registry }, children)\n}\n\nexport function useRegionThemeRegistry(): RegionThemeRegistry {\n return useContext(RegistryContext)\n}\n","// CountryProfileData format, validation and a registry (spec:\n// wave-4/country-profile-data.md). Currency symbol, position, separators and\n// precision are never stored: they come from Intl for the profile's locale.\nimport type { SourceCitation } from './format'\n\nexport interface CountryProfile {\n code: string\n names: { en: string; local: string }\n languages: Array<{ tag: string; name: string; official: boolean }>\n locale: { default: string; dateStyle?: 'full' | 'long' | 'medium' | 'short' }\n currency: { code: string }\n address: {\n /** Ordered lines of field keys. */\n template: string[][]\n required: string[]\n postalCodePattern?: string\n }\n tax?: { consumptionTaxName?: string; businessIdName?: string; personalIdName?: string }\n map: { geometryKey: string; subdivisionProperty: string; projection: 'mercator' | 'equal-area-composite' }\n /** Country code of the matching RegionThemeData entry, when there is one. */\n regionTheme?: string\n sources: SourceCitation[]\n version: string\n}\n\n/** Emoji flag from the two regional-indicator letters of the code (computed, never stored). */\nexport function flagEmoji(code: string): string {\n const up = code.toUpperCase()\n if (!/^[A-Z]{2}$/.test(up)) return ''\n return String.fromCodePoint(...[...up].map((ch) => 0x1f1e6 + ch.charCodeAt(0) - 65))\n}\n\nfunction isLocale(tag: string): boolean {\n try {\n return Intl.getCanonicalLocales(tag).length === 1\n } catch {\n return false\n }\n}\n\nfunction isCurrency(code: string): boolean {\n if (!/^[A-Z]{3}$/.test(code)) return false\n const listed = (Intl as { supportedValuesOf?: (key: string) => string[] }).supportedValuesOf?.('currency')\n if (listed) return listed.includes(code)\n try {\n new Intl.NumberFormat('en', { style: 'currency', currency: code })\n return true\n } catch {\n return false\n }\n}\n\n/** Throws naming the field on the first problem. */\nexport function validateCountryProfile(p: CountryProfile): void {\n const at = typeof p?.code === 'string' ? p.code : '??'\n const fail = (field: string, detail: string): never => {\n throw new Error(`CountryProfileData ${at}: ${field} ${detail}`)\n }\n if (!/^[A-Z]{2}$/.test(p.code ?? '')) fail('code', 'must be an ISO 3166-1 alpha-2 code')\n if (!p.names?.en?.trim() || !p.names?.local?.trim()) fail('names', 'need en and local')\n if (!Array.isArray(p.languages) || !p.languages.length) fail('languages', 'must list at least one language')\n for (const l of p.languages) if (!isLocale(l.tag)) fail('languages[].tag', `\"${l.tag}\" is not a BCP 47 tag`)\n if (!isLocale(p.locale?.default ?? '')) fail('locale.default', 'must be a BCP 47 tag')\n if (!isCurrency(p.currency?.code ?? '')) fail('currency.code', 'must be an ISO 4217 code')\n if (!Array.isArray(p.address?.template) || !p.address.template.length) fail('address.template', 'must have at least one line')\n const keys = new Set(p.address.template.flat())\n for (const r of p.address.required ?? []) if (!keys.has(r)) fail('address.required', `\"${r}\" is not in the template`)\n if (p.address.postalCodePattern !== undefined) {\n try {\n new RegExp(p.address.postalCodePattern)\n } catch {\n fail('address.postalCodePattern', 'is not a valid pattern')\n }\n }\n if (!p.map?.geometryKey || !p.map.subdivisionProperty) fail('map', 'needs geometryKey and subdivisionProperty')\n if (!Array.isArray(p.sources) || !p.sources.length) fail('sources', 'must cite at least one source')\n const cited = new Set(p.sources.map((s) => s.field))\n const groups = ['code', 'names', 'languages', 'locale', 'currency', 'address', 'map']\n if (p.tax) groups.push('tax')\n for (const g of groups) if (!cited.has(g)) fail('sources', `has no citation for \"${g}\"`)\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(p.version ?? '')) fail('version', 'must be an ISO date')\n}\n\nconst profiles = new Map<string, CountryProfile>()\n\n/** Validates and stores a profile (replaces an earlier one with the same code). */\nexport function registerCountryProfile(profile: CountryProfile): void {\n validateCountryProfile(profile)\n profiles.set(profile.code, profile)\n}\nexport const getCountryProfile = (code: string) => profiles.get(code.trim().toUpperCase())\nexport const listCountryProfiles = () => [...profiles.values()]\nexport const unregisterCountryProfile = (code: string) => void profiles.delete(code.trim().toUpperCase())\n\n/** Money in the profile's default locale and currency, formatted by the platform. */\nexport function formatProfileMoney(value: number, profile: CountryProfile): string {\n return new Intl.NumberFormat(profile.locale.default, { style: 'currency', currency: profile.currency.code }).format(value)\n}\n\n/** Address lines following the profile template; empty fields leave no doubled separators. */\nexport function formatProfileAddress(fields: Record<string, string | undefined | null>, profile: CountryProfile, separator = ', '): string[] {\n return profile.address.template\n .map((line) =>\n line\n .map((k) => (fields[k] ?? '').trim())\n .filter(Boolean)\n .join(separator),\n )\n .filter(Boolean)\n}\n","// Documented loader for the geometry fields of RegionThemeData and\n// CountryProfileData. The library ships no boundaries and no coordinates:\n// the host serves a public-domain boundary file (for example Natural Earth\n// admin-1, https://www.naturalearthdata.com/downloads/10m-cultural-vectors/)\n// and this function computes label points and the country view from it, so no\n// value is typed by hand.\nimport { geoArea, geoBounds, geoCentroid, geoContains } from 'd3-geo'\nimport type { LonLat, RegionThemeEntry, SourceCitation } from './format'\n\nexport interface BoundaryFeature {\n type: 'Feature'\n properties: Record<string, unknown> | null\n geometry: { type: 'Polygon' | 'MultiPolygon'; coordinates: unknown } | null\n}\nexport interface BoundaryCollection {\n type: 'FeatureCollection'\n features: BoundaryFeature[]\n}\n\nexport interface DeriveOptions {\n /** Feature property holding the subdivision code (default `code`). */\n codeProperty?: string\n /** Accepts `BR-SP` or `SP` in the property (default: strip a `XX-` prefix). */\n normaliseCode?: (raw: string) => string\n /** Citation added to `sources` for the derived fields. */\n source: Omit<SourceCitation, 'field'>\n}\n\ntype Geo = Parameters<typeof geoContains>[0]\n\n/** A point inside the feature: its centroid when inside, else the centre of its largest part. */\nexport function labelPointOf(feature: BoundaryFeature): LonLat | undefined {\n if (!feature.geometry) return undefined\n const f = feature as unknown as Geo\n const centroid = geoCentroid(f) as LonLat\n if (geoContains(f, centroid)) return centroid\n if (feature.geometry.type !== 'MultiPolygon') return undefined\n const parts = (feature.geometry.coordinates as unknown[]).map((coordinates) => ({ type: 'Polygon', coordinates }) as unknown as Geo)\n const largest = parts.sort((a, b) => geoArea(b) - geoArea(a))[0]\n if (!largest) return undefined\n const c = geoCentroid(largest) as LonLat\n return geoContains(largest, c) ? c : undefined\n}\n\n/** Returns a copy of the entry with label points and the view computed from the boundaries. */\nexport function deriveGeometry(entry: RegionThemeEntry, boundaries: BoundaryCollection, options: DeriveOptions): RegionThemeEntry {\n const prop = options.codeProperty ?? 'code'\n const norm = options.normaliseCode ?? ((raw: string) => raw.replace(/^[A-Z]{2}-/, '').toUpperCase())\n const byCode = new Map<string, BoundaryFeature>()\n for (const f of boundaries.features) {\n const raw = f.properties?.[prop]\n if (typeof raw === 'string') byCode.set(norm(raw), f)\n }\n const subdivisions = entry.subdivisions.map((s) => {\n const f = byCode.get(s.code)\n const point = f ? labelPointOf(f) : undefined\n return point ? { ...s, labelPoint: point } : s\n })\n const [[w, south], [e, north]] = geoBounds(boundaries as unknown as Geo)\n const view = { centre: [(w + e) / 2, (south + north) / 2] as LonLat }\n return {\n ...entry,\n subdivisions,\n view,\n sources: [...entry.sources, { field: 'labelPoint', ...options.source }, { field: 'view', ...options.source }],\n }\n}\n","// Brazil (BR): first-level subdivisions, the 26 states and the Federal\n// District, and the five IBGE macro-regions. Regenerated from public sources\n// on 2026-09-26 (see `sources`); nothing here comes from any earlier library.\n//\n// Not shipped, on purpose: identity colours (the state flag laws give colour\n// names, not hex values, so any hex would be an invention), label points and\n// the map view (to be computed from public-domain boundaries with\n// `deriveGeometry()`; see ../geometry.ts). The registry works without them.\nimport { registerRegionTheme } from '../registry'\nimport type { RegionThemeEntry } from '../format'\n\nconst RETRIEVED = '2026-09-26'\n\nexport const brazilRegionTheme: RegionThemeEntry = {\n country: 'BR',\n subdivisionKind: 'state',\n // ISO 3166-2:BR order (alphabetical by name).\n subdivisions: [\n { code: 'AC', name: { local: 'Acre' } },\n { code: 'AL', name: { local: 'Alagoas' } },\n { code: 'AP', name: { local: 'Amapá' } },\n { code: 'AM', name: { local: 'Amazonas' } },\n { code: 'BA', name: { local: 'Bahia' } },\n { code: 'CE', name: { local: 'Ceará' } },\n { code: 'DF', name: { local: 'Distrito Federal', en: 'Federal District' } },\n { code: 'ES', name: { local: 'Espírito Santo' } },\n { code: 'GO', name: { local: 'Goiás' } },\n { code: 'MA', name: { local: 'Maranhão' } },\n { code: 'MT', name: { local: 'Mato Grosso' } },\n { code: 'MS', name: { local: 'Mato Grosso do Sul' } },\n { code: 'MG', name: { local: 'Minas Gerais' } },\n { code: 'PA', name: { local: 'Pará' } },\n { code: 'PB', name: { local: 'Paraíba' } },\n { code: 'PR', name: { local: 'Paraná' } },\n { code: 'PE', name: { local: 'Pernambuco' } },\n { code: 'PI', name: { local: 'Piauí' } },\n { code: 'RJ', name: { local: 'Rio de Janeiro' } },\n { code: 'RN', name: { local: 'Rio Grande do Norte' } },\n { code: 'RS', name: { local: 'Rio Grande do Sul' } },\n { code: 'RO', name: { local: 'Rondônia' } },\n { code: 'RR', name: { local: 'Roraima' } },\n { code: 'SC', name: { local: 'Santa Catarina' } },\n { code: 'SP', name: { local: 'São Paulo' } },\n { code: 'SE', name: { local: 'Sergipe' } },\n { code: 'TO', name: { local: 'Tocantins' } },\n ],\n macroRegions: [\n { id: 'north', labelKey: 'region.br.north', codes: ['AC', 'AP', 'AM', 'PA', 'RO', 'RR', 'TO'] },\n { id: 'northeast', labelKey: 'region.br.northeast', codes: ['AL', 'BA', 'CE', 'MA', 'PB', 'PE', 'PI', 'RN', 'SE'] },\n { id: 'central-west', labelKey: 'region.br.centralWest', codes: ['DF', 'GO', 'MT', 'MS'] },\n { id: 'southeast', labelKey: 'region.br.southeast', codes: ['ES', 'MG', 'RJ', 'SP'] },\n { id: 'south', labelKey: 'region.br.south', codes: ['PR', 'RS', 'SC'] },\n ],\n sources: [\n {\n field: 'codes',\n citation: 'ISO 3166-2:BR, subdivision codes of Brazil (ISO 3166 Maintenance Agency); consulted through the public ISO 3166-2:BR listing',\n url: 'https://www.iso.org/obp/ui/#iso:code:3166:BR',\n retrievedOn: RETRIEVED,\n },\n {\n field: 'names',\n citation: 'IBGE, Divisão Territorial Brasileira (official names of the federative units), matching the ISO 3166-2:BR names',\n url: 'https://www.ibge.gov.br/geociencias/organizacao-do-territorio/estrutura-territorial/23701-divisao-territorial-brasileira.html',\n retrievedOn: RETRIEVED,\n },\n {\n field: 'macroRegions',\n citation: 'IBGE, Divisões Regionais do Brasil: the five Grandes Regiões (Norte, Nordeste, Centro-Oeste, Sudeste, Sul); membership cross-checked on the public summary at https://en.wikipedia.org/wiki/Regions_of_Brazil',\n url: 'https://www.ibge.gov.br/geociencias/organizacao-do-territorio/divisao-regional/15778-divisoes-regionais-do-brasil.html',\n retrievedOn: RETRIEVED,\n },\n ],\n version: RETRIEVED,\n}\n\n/** Registers Brazil in the default registry (never on import). */\nexport function register(): void {\n registerRegionTheme(brazilRegionTheme)\n}\n","// Brazil (BR) country profile. Regenerated from public sources on 2026-09-26.\n// Currency presentation is not stored (derived from pt-BR through Intl).\nimport { registerCountryProfile, type CountryProfile } from '../countryProfile'\n\nconst RETRIEVED = '2026-09-26'\n\nexport const brazilProfile: CountryProfile = {\n code: 'BR',\n names: { en: 'Brazil', local: 'Brasil' },\n languages: [{ tag: 'pt-BR', name: 'português', official: true }],\n locale: { default: 'pt-BR' },\n currency: { code: 'BRL' },\n address: {\n // Logradouro, número e complemento / bairro / cidade e UF / CEP.\n template: [['street', 'number', 'complement'], ['district'], ['city', 'state'], ['postalCode']],\n required: ['street', 'city', 'state', 'postalCode'],\n postalCodePattern: '^\\\\d{5}-?\\\\d{3}$',\n },\n tax: { businessIdName: 'CNPJ', personalIdName: 'CPF' },\n map: { geometryKey: 'br-admin1', subdivisionProperty: 'code', projection: 'mercator' },\n regionTheme: 'BR',\n sources: [\n { field: 'code', citation: 'ISO 3166-1, country code BR', url: 'https://www.iso.org/obp/ui/#iso:code:3166:BR', retrievedOn: RETRIEVED },\n { field: 'names', citation: 'Unicode CLDR territory names (en: Brazil; pt: Brasil)', url: 'https://cldr.unicode.org/', retrievedOn: RETRIEVED },\n { field: 'languages', citation: 'Unicode CLDR territory information (official language of BR: Portuguese); Constituição Federal de 1988, art. 13', url: 'https://www.planalto.gov.br/ccivil_03/constituicao/constituicao.htm', retrievedOn: RETRIEVED },\n { field: 'locale', citation: 'Unicode CLDR locale pt-BR', url: 'https://cldr.unicode.org/', retrievedOn: RETRIEVED },\n { field: 'currency', citation: 'ISO 4217, currency code BRL (Brazilian real)', url: 'https://www.iso.org/iso-4217-currency-codes.html', retrievedOn: RETRIEVED },\n { field: 'address', citation: 'Correios, guidance on addressing (logradouro, número, complemento, bairro, cidade, UF, CEP of eight digits)', url: 'https://www.correios.com.br/', retrievedOn: RETRIEVED },\n { field: 'tax', citation: 'Receita Federal do Brasil: CNPJ (legal entities) and CPF (individuals)', url: 'https://www.gov.br/receitafederal/', retrievedOn: RETRIEVED },\n { field: 'map', citation: 'Host geometry from Natural Earth admin-1 boundaries (public domain); the library ships none', url: 'https://www.naturalearthdata.com/downloads/10m-cultural-vectors/', retrievedOn: RETRIEVED },\n ],\n version: RETRIEVED,\n}\n\n/**\n * Registers Brazil. Defaults to this module's profile registry; hosts wiring\n * the Formatters country registry pass its `registerCountry` instead.\n */\nexport function register(target: (profile: CountryProfile) => void = registerCountryProfile): void {\n target(brazilProfile)\n}\n","/** Two calm, fixed glows behind the glass (spec: wave-2/ambient-backdrop.md; design direction §2.5). */\nexport function AmbientBackdrop({ className }: { className?: string }) {\n const glows = ['upper', 'lower'] as const\n return (\n <div className={className ? `ty-ambient ${className}` : 'ty-ambient'} aria-hidden=\"true\">\n {glows.map((where) => (\n <span key={where} className=\"ty-ambient__glow\" data-glow={where} />\n ))}\n </div>\n )\n}\n","import { useId, type ReactNode } from 'react'\nimport { Heading } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport interface BrandFigure {\n value: string\n label: string\n}\n\nexport interface BrandPanelProps {\n mark: ReactNode\n title: string\n subtitle: string\n figures?: readonly BrandFigure[]\n footnote?: string\n /** Heading level of the title: one below the page h1. */\n titleLevel?: 2 | 3\n className?: string\n}\n\n/**\n * Informative half-screen panel beside an auth form (spec:\n * wave-2/brand-panel.md). Parts render in a fixed order; empty ones drop out.\n */\nexport function BrandPanel(props: BrandPanelProps) {\n const headId = `ty-brand-panel-${useId().replace(/:/g, '')}`\n const figures = props.figures ?? []\n\n const parts: Array<ReactNode> = [\n <div key=\"decor\" className=\"ty-brand-panel__decor\" aria-hidden=\"true\" />,\n <div key=\"mark\" className=\"ty-brand-panel__mark\">\n {props.mark}\n </div>,\n <div key=\"headline\" className=\"ty-brand-panel__headline\">\n <Heading level={props.titleLevel ?? 2} id={headId} className=\"ty-brand-panel__title\">\n {props.title}\n </Heading>\n <p className=\"ty-brand-panel__subtitle\">{props.subtitle}</p>\n </div>,\n figures.length > 0 && (\n <ul key=\"figures\" className=\"ty-brand-panel__figures\">\n {figures.map((figure, n) => (\n <li key={n + figure.label} className=\"ty-brand-panel__figure\">\n <span className=\"ty-brand-panel__value\">{figure.value}</span> <span className=\"ty-brand-panel__caption\">{figure.label}</span>\n </li>\n ))}\n </ul>\n ),\n props.footnote && (\n <p key=\"footnote\" className=\"ty-brand-panel__footnote\">\n {props.footnote}\n </p>\n ),\n ]\n\n return (\n <aside aria-labelledby={headId} className={cx('ty-brand-panel', props.className)}>\n {parts}\n </aside>\n )\n}\n","import type { ReactNode } from 'react'\nimport { breakpoints, useMinWidth } from '../../internal/media'\nimport { AmbientBackdrop } from '../ambient-backdrop/AmbientBackdrop'\nimport { BrandPanel, type BrandPanelProps } from '../brand-panel/BrandPanel'\n\nexport type AuthFrameWidth = 'narrow' | 'regular' | 'wide'\n\nexport interface AuthFrameProps {\n children: ReactNode\n /** Renders the brand side on wide screens (never below 1024 px). */\n brandPanel?: BrandPanelProps\n width?: AuthFrameWidth\n /** Product mark shown above the form surface. */\n mark?: ReactNode\n mainLabel?: string\n className?: string\n}\n\n/** Frame of sign-in and recovery screens (spec: wave-2/auth-frame.md). */\nexport function AuthFrame({ brandPanel, mark, mainLabel, width = 'regular', className, children }: AuthFrameProps) {\n const wide = useMinWidth(breakpoints.lg)\n const brandSide = brandPanel && wide ? <BrandPanel {...brandPanel} className=\"ty-auth-frame__brand\" /> : null\n return (\n <div className={className ? `ty-auth-frame ${className}` : 'ty-auth-frame'} data-split={brandSide ? '' : undefined}>\n <AmbientBackdrop />\n {brandSide}\n <main className=\"ty-auth-frame__form-side\" aria-label={mainLabel}>\n <div className=\"ty-auth-frame__column\" data-width={width}>\n {mark ? <div className=\"ty-auth-frame__mark\">{mark}</div> : null}\n <div className=\"ty-auth-frame__sheet\">{children}</div>\n </div>\n </main>\n </div>\n )\n}\n","import { useMediaQuery } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport type { ReactNode } from 'react'\n\n/**\n * Read-only default brand constants. Hosts serve the logo files from their\n * public folder and set their product name through the `brand.productName`\n * message.\n */\nexport const brand = Object.freeze({\n productId: 'tympan',\n productName: 'Tympan',\n logoFiles: Object.freeze({\n icon: '/brand/tympan-icon.svg',\n logo: '/brand/tympan-logo.svg',\n logoDark: '/brand/tympan-logo-dark.svg',\n }),\n})\n\nexport type BrandMarkSize = 'small' | 'medium' | 'large'\n\n/**\n * The badge artwork: an open book, two pages meeting at a spine, drawn for\n * this library. Stroke only, so it inherits the ink set by the badge.\n */\nfunction OpenBookArt() {\n return (\n <svg className=\"ty-brand-mark__art\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M12 7.2C10.1 5.7 7.4 5.2 4.5 5.6v11.6c2.9-.4 5.6.1 7.5 1.6\" />\n <path d=\"M12 7.2c1.9-1.5 4.6-2 7.5-1.6v11.6c-2.9-.4-5.6.1-7.5 1.6\" />\n <path d=\"M12 7.2v11.6\" />\n </svg>\n )\n}\n\nexport interface BrandMarkProps {\n size?: BrandMarkSize\n showWordmark?: boolean\n /** Custom wordmark node; defaults to the product name as text. */\n wordmark?: ReactNode\n /** Accessible name when icon-only (defaults to the product name). */\n label?: string\n className?: string\n}\n\n/** Product badge plus wordmark (spec: wave-2/brand-mark.md). */\nexport function BrandMark({ size = 'medium', showWordmark = true, wordmark, label, className }: BrandMarkProps) {\n const productName = useMessages().brand.productName\n const iconOnly = !showWordmark\n const badgeA11y = iconOnly ? { role: 'img', 'aria-label': label ?? productName } : { 'aria-hidden': true as const }\n return (\n <span className={className ? `ty-brand-mark ${className}` : 'ty-brand-mark'} data-size={size}>\n <span className=\"ty-brand-mark__badge\" {...badgeA11y}>\n <OpenBookArt />\n </span>\n {iconOnly ? null : <span className=\"ty-brand-mark__word\">{wordmark ?? productName}</span>}\n </span>\n )\n}\n\nexport interface BrandLogoProps {\n /** Colour mode of the surrounding theme; follows the operating system when omitted. */\n mode?: 'light' | 'dark'\n /** Overrides the files of `brand.logoFiles`. */\n files?: { logo: string; logoDark: string }\n label?: string\n className?: string\n}\n\n/** Image form of the logo: picks the dark file on dark themes. */\nexport function BrandLogo({ mode, files = brand.logoFiles, label, className }: BrandLogoProps) {\n const productName = useMessages().brand.productName\n const osDark = useMediaQuery('(prefers-color-scheme: dark)')\n const dark = (mode ?? (osDark ? 'dark' : 'light')) === 'dark'\n return <img className={className ? `ty-brand-logo ${className}` : 'ty-brand-logo'} src={dark ? files.logoDark : files.logo} alt={label ?? productName} data-mode={dark ? 'dark' : 'light'} />\n}\n","import { createContext, useContext, type ReactNode } from 'react'\nimport { devWarning } from '../../internal/dev'\nimport { BrandMark } from '../brand-mark/BrandMark'\n\n/**\n * Tone names accepted by presets: the closed set of wave-4/tone-tint-resolver\n * (accent, the four semantic tones, categorical-1…8).\n */\nexport const loaderToneNames = [\n 'accent',\n 'success',\n 'pending',\n 'error',\n 'neutral',\n ...Array.from({ length: 8 }, (_, i) => `categorical-${i + 1}` as const),\n] as const\nexport type LoaderTone = (typeof loaderToneNames)[number]\n\n/** Custom property holding the tone colour, read by the BrandLoader stylesheet. */\nexport function loaderToneColour(tone: LoaderTone): string {\n if (tone.startsWith('categorical-')) return `var(--ty-${tone})`\n const semantic: Record<string, string> = {\n accent: 'var(--ty-accent)',\n success: 'var(--ty-success)',\n pending: 'var(--ty-warning)',\n error: 'var(--ty-danger)',\n neutral: 'var(--ty-ink-3)',\n }\n return semantic[tone] ?? semantic.accent!\n}\n\nexport interface LoaderPreset {\n id: string\n /** Product name shown under the mark; the brand name when omitted. */\n name?: string\n mark: ReactNode\n tone: LoaderTone\n /** Default loading phrase (already translated by the host). */\n label?: string\n}\n\nexport interface LoaderPresetRegistry {\n resolve(id: string): LoaderPreset | undefined\n ids(): string[]\n}\n\n/** The only preset shipped: the product mark and the accent tone. */\nexport const defaultLoaderPreset: LoaderPreset = Object.freeze({\n id: 'default',\n mark: <BrandMark showWordmark={false} size=\"large\" />,\n tone: 'accent',\n})\n\nconst isTone = (value: unknown): value is LoaderTone => (loaderToneNames as readonly unknown[]).includes(value)\n\n/** Validates presets (unique ids, known tones) and returns a registry that always holds `default`. */\nexport function createLoaderPresets(presets: readonly LoaderPreset[]): LoaderPresetRegistry {\n const byId: Record<string, LoaderPreset> = Object.create(null)\n for (const p of presets) {\n if (p.id in byId) throw new Error(`createLoaderPresets: preset id \"${p.id}\" is used twice.`)\n if (!isTone(p.tone)) throw new Error(`createLoaderPresets: preset \"${p.id}\" has tone \"${String(p.tone)}\", which is not a tone name (${loaderToneNames.join(', ')}).`)\n byId[p.id] = p\n }\n if (!('default' in byId)) byId.default = defaultLoaderPreset\n return { resolve: (id) => byId[id], ids: () => Object.keys(byId) }\n}\n\nconst RegistryContext = createContext<LoaderPresetRegistry | null>(null)\n\nexport function LoaderPresetProvider({ registry, children }: { registry: LoaderPresetRegistry; children: ReactNode }) {\n return <RegistryContext.Provider value={registry}>{children}</RegistryContext.Provider>\n}\n\n/** Resolves a preset id; unknown ids fall back to `default` (with a development warning). */\nexport function useLoaderPreset(id = 'default'): LoaderPreset {\n const registry = useContext(RegistryContext)\n const found = registry ? registry.resolve(id) : id === 'default' ? defaultLoaderPreset : undefined\n devWarning(!found, `useLoaderPreset: no preset \"${id}\"; using \"default\".`)\n return found ?? registry?.resolve('default') ?? defaultLoaderPreset\n}\n","import type { CSSProperties, ReactNode } from 'react'\nimport { useMessages } from '../../internal/provider'\nimport { loaderToneColour, useLoaderPreset } from '../loader-presets/LoaderPresets'\n\nexport interface BrandLoaderProps {\n /** Product name; the preset's or the brand's when omitted. */\n name?: string\n mark?: ReactNode\n /** Loading phrase, announced politely; the localised \"Loading\" when absent. */\n label?: string\n layout?: 'fullscreen' | 'inline'\n /** Registered preset id (wave-4/loader-presets.md). */\n preset?: string\n className?: string\n}\n\n/** First-paint loading screen with the brand mark (spec: wave-2/brand-loader.md). */\nexport function BrandLoader(props: BrandLoaderProps) {\n const copy = useMessages()\n const chosen = useLoaderPreset(props.preset)\n const statusText = props.label ?? chosen.label ?? copy.loading\n const toneStyle = { '--ty-loader-tone': loaderToneColour(chosen.tone) } as CSSProperties\n const root = ['ty-brand-loader', props.className].filter(Boolean).join(' ')\n\n return (\n <div className={root} role=\"status\" data-layout={props.layout ?? 'fullscreen'} data-tone={chosen.tone} style={toneStyle}>\n <div className=\"ty-brand-loader__figure\" aria-hidden=\"true\">\n <span className=\"ty-brand-loader__pulse\">{props.mark ?? chosen.mark}</span>\n <span className=\"ty-brand-loader__name\">{props.name ?? chosen.name ?? copy.brand.productName}</span>\n </div>\n <p className=\"ty-brand-loader__label\">{statusText}</p>\n </div>\n )\n}\n","import { useId, useState } from 'react'\nimport type { AuthBrandMessages } from '../../internal/messages/auth-brand'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { Link } from '../link/Link'\n\nexport type ConsentAnswer = 'accepted' | 'rejected'\nexport type ConsentTexts = AuthBrandMessages['consent']\n\nexport const DEFAULT_CONSENT_KEY = 'ty-consent'\n\n/** Storage access that never throws (blocked storage behaves as \"no answer yet\"). */\nconst consentStore = {\n read(key: string): string | null {\n try {\n return window.localStorage.getItem(key)\n } catch {\n return null\n }\n },\n write(key: string, answer: ConsentAnswer): void {\n try {\n window.localStorage.setItem(key, answer)\n } catch {\n /* the choice still applies for this visit */\n }\n },\n}\n\nexport interface ConsentBannerProps {\n policyHref: string\n storageKey?: string\n onAccept?: () => void\n onReject?: () => void\n texts?: Partial<ConsentTexts>\n className?: string\n}\n\n/** Non-modal cookie consent region with an equal-weight choice (spec: wave-2/consent-banner.md). */\nexport function ConsentBanner({ policyHref, storageKey = DEFAULT_CONSENT_KEY, onAccept, onReject, texts, className }: ConsentBannerProps) {\n const t: ConsentTexts = { ...useMessages().consent, ...texts }\n const messageId = `ty-consent-${useId().replace(/:/g, '')}`\n const [answered, setAnswered] = useState(() => {\n const stored = typeof window === 'undefined' ? null : consentStore.read(storageKey)\n return stored === 'accepted' || stored === 'rejected'\n })\n if (answered) return null\n\n const choose = (answer: ConsentAnswer) => {\n consentStore.write(storageKey, answer)\n setAnswered(true)\n ;(answer === 'accepted' ? onAccept : onReject)?.()\n }\n\n return (\n <section className={className ? `ty-consent ${className}` : 'ty-consent'} aria-label={t.label} aria-describedby={messageId}>\n <p id={messageId} className=\"ty-consent__message\">\n {t.message} <Link href={policyHref}>{t.learnMore}</Link>\n </p>\n <div className=\"ty-consent__choices\">\n <Button onPress={() => choose('rejected')}>{t.reject}</Button>\n <Button onPress={() => choose('accepted')}>{t.accept}</Button>\n </div>\n </section>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { AuthBrandMessages } from '../../internal/messages/auth-brand'\nimport { useMessages } from '../../internal/provider'\nimport { Tag } from '../tag/Tag'\n\nexport interface EnvironmentFacts {\n appName?: string\n port?: string | number\n apiBase?: string\n}\n\nexport interface EnvironmentBannerProps {\n /**\n * Environment name from the host config, or a function reading it. `null`,\n * a production name, or a failing reader render nothing.\n */\n environment?: string | null | (() => string | null | undefined)\n /** Shows the banner whatever the environment (stories, visual tests). */\n forceShow?: boolean\n user?: { email?: string; role?: string }\n facts?: EnvironmentFacts\n /** Word shown in the tag; the environment name when omitted. */\n environmentWord?: string\n texts?: Partial<Pick<AuthBrandMessages['environment'], 'label' | 'message'>>\n /** Extra controls (for example a GlassCheckToggle). */\n children?: ReactNode\n className?: string\n}\n\nfunction readEnvironment(source: EnvironmentBannerProps['environment']): string | null {\n try {\n const value = typeof source === 'function' ? source() : source\n return value ? String(value) : null\n } catch {\n return null\n }\n}\n\nconst PRODUCTION = /^(prod|production|live)$/i\n\n/** Strip naming the non-production environment and its facts (spec: wave-2/environment-banner.md). */\nexport function EnvironmentBanner(props: EnvironmentBannerProps) {\n const copy = useMessages().environment\n const env = readEnvironment(props.environment)\n const show = props.forceShow || (env !== null && !PRODUCTION.test(env.trim()))\n if (!show) return null\n\n const t = { ...copy, ...props.texts }\n const rows: Array<[string, string | number | undefined]> = [\n [copy.appName, props.facts?.appName],\n [copy.port, props.facts?.port],\n [copy.apiBase, props.facts?.apiBase],\n [copy.email, props.user?.email],\n [copy.role, props.user?.role],\n ]\n const present = rows.filter((r): r is [string, string | number] => r[1] !== undefined && r[1] !== '')\n\n return (\n <section className={props.className ? `ty-env-banner ${props.className}` : 'ty-env-banner'} aria-label={t.label}>\n <Tag>{props.environmentWord ?? env ?? t.label}</Tag>\n <p className=\"ty-env-banner__message\">{t.message}</p>\n {present.length ? (\n <dl className=\"ty-env-banner__facts\">\n {present.map(([term, value]) => (\n <div key={term} className=\"ty-env-banner__fact\">\n <dt>{term}</dt>\n <dd>{value}</dd>\n </div>\n ))}\n </dl>\n ) : null}\n {props.children}\n </section>\n )\n}\n","import { Boxes, Cpu, Database } from 'lucide-react'\nimport { createContext, useContext, useState, type ReactNode } from 'react'\nimport { useMessages } from '../../internal/provider'\n\n/** Where a mark comes from. The library itself ships none. */\nexport type MarkSource =\n | { kind: 'icon-set'; setName: string; slug: string }\n | { kind: 'asset'; url: string }\n | { kind: 'component'; render: () => ReactNode }\n\nexport interface MarkEntry {\n key: string\n source: MarkSource\n /** Owner of the trademark, for the host's notices. */\n owner: string\n /** Licence of the mark data (for example \"CC0 1.0, Simple Icons 14.x\"). Required. */\n licence: string\n /** Official brand colour; used only when the host opts in. */\n brandColour?: string\n}\n\nexport interface MarkRegistry {\n readonly size: number\n get(key: string): MarkEntry | undefined\n keys(): string[]\n}\n\n/** Renders an icon-set source with the set's own path data (host-installed package). */\nexport type IconSetAdapter = (source: { setName: string; slug: string }, options: { brandColour?: string }) => ReactNode\n\n/** Validates and freezes mark entries: unique keys, a licence note on each. */\nexport function createMarkRegistry(entries: readonly MarkEntry[] = []): MarkRegistry {\n const table = new Map<string, MarkEntry>()\n entries.forEach((entry, position) => {\n if (!entry.key) throw new Error(`createMarkRegistry: entry ${position} has no key.`)\n if (table.has(entry.key)) throw new Error(`createMarkRegistry: the key \"${entry.key}\" is registered twice.`)\n if (!entry.licence || !entry.licence.trim()) {\n throw new Error(`createMarkRegistry: the mark \"${entry.key}\" has no licence note; list where the mark data comes from.`)\n }\n table.set(entry.key, Object.freeze({ ...entry }))\n })\n return {\n size: table.size,\n get: (key) => table.get(key),\n keys: () => [...table.keys()],\n }\n}\n\ninterface MarkEnvironment {\n registry: MarkRegistry\n adapter?: IconSetAdapter\n useBrandColours: boolean\n}\n\nconst EMPTY: MarkEnvironment = { registry: createMarkRegistry(), useBrandColours: false }\nconst MarkContext = createContext<MarkEnvironment>(EMPTY)\n\nexport interface MarkRegistryProviderProps {\n registry: MarkRegistry\n /** Turns `icon-set` sources into rendered marks. Without it they use the fallback glyph. */\n iconSetAdapter?: IconSetAdapter\n /** Opt in to official brand colours (dropped under forced colours). */\n brandColours?: boolean\n children: ReactNode\n}\n\nexport function MarkRegistryProvider({ registry, iconSetAdapter, brandColours = false, children }: MarkRegistryProviderProps) {\n const value: MarkEnvironment = { registry, adapter: iconSetAdapter, useBrandColours: brandColours }\n return <MarkContext.Provider value={value}>{children}</MarkContext.Provider>\n}\n\nexport type MarkCategory = 'model' | 'datasource' | 'service'\nexport type MarkSize = 'inline' | 'bubble'\n\nconst neutralGlyphs = { model: Cpu, datasource: Database, service: Boxes } satisfies Record<MarkCategory, unknown>\n\nfunction NeutralGlyph({ category }: { category: MarkCategory }) {\n const Glyph = neutralGlyphs[category]\n return <Glyph className=\"ty-mark__glyph\" data-fallback=\"\" aria-hidden=\"true\" focusable=\"false\" />\n}\n\nfunction AssetMark({ url, fallback }: { url: string; fallback: ReactNode }) {\n const [broken, setBroken] = useState(false)\n if (broken) return <>{fallback}</>\n return <img className=\"ty-mark__image\" src={url} alt=\"\" draggable={false} onError={() => setBroken(true)} />\n}\n\n/**\n * Only the mark (decorative, `aria-hidden` wrapper), for controls that carry\n * the product name in their own label.\n */\nexport function ThirdPartyMarkGlyph({ markKey, category = 'service' }: { markKey?: string; category?: MarkCategory }) {\n const env = useContext(MarkContext)\n const entry = markKey ? env.registry.get(markKey) : undefined\n const fallback = <NeutralGlyph category={category} />\n let drawn: ReactNode = fallback\n if (entry) {\n const source = entry.source\n if (source.kind === 'asset') drawn = <AssetMark url={source.url} fallback={fallback} />\n else if (source.kind === 'component') drawn = source.render()\n else if (env.adapter) drawn = env.adapter(source, { brandColour: env.useBrandColours ? entry.brandColour : undefined })\n }\n return (\n <span className=\"ty-mark__art\" aria-hidden=\"true\" data-registered={entry ? '' : undefined}>\n {drawn}\n </span>\n )\n}\n\nexport interface ThirdPartyMarkSlotProps {\n markKey: string\n /** Visible and accessible product name. */\n name: string\n category?: MarkCategory\n /** When false the name is visually hidden but stays the accessible name. */\n showName?: boolean\n size?: MarkSize\n className?: string\n}\n\n/** A third-party product's mark (host-registered) beside its name (spec: wave-4/third-party-mark-slot.md). */\nexport function ThirdPartyMarkSlot(props: ThirdPartyMarkSlotProps) {\n const nameClass = props.showName === false ? 'ty-visually-hidden' : 'ty-mark__name'\n return (\n <span className={props.className ? `ty-mark ${props.className}` : 'ty-mark'} data-size={props.size ?? 'inline'}>\n <ThirdPartyMarkGlyph markKey={props.markKey} category={props.category} />\n <span className={nameClass}>{props.name}</span>\n </span>\n )\n}\n\n/* ------------------------------------------------------------------ */\n/* ProviderMark: model identifier → provider key → slot */\n/* ------------------------------------------------------------------ */\n\nexport interface ProviderRule {\n match: (modelId: string) => boolean\n key: string\n name: string\n}\n\n// Public vendor names (text only; no mark data). Order matters: first hit wins.\nconst VENDORS: Array<[key: string, name: string, familyWords: string[]]> = [\n ['anthropic', 'Anthropic', ['claude']],\n ['openai', 'OpenAI', ['gpt', 'o1', 'o3', 'o4']],\n ['google', 'Google', ['gemini', 'gemma']],\n ['meta', 'Meta', ['llama']],\n ['amazon', 'Amazon', ['nova', 'titan']],\n ['mistral', 'Mistral AI', ['mistral', 'mixtral', 'codestral']],\n ['cohere', 'Cohere', ['command']],\n ['deepseek', 'DeepSeek', ['deepseek']],\n]\n\nconst ROUTING_PREFIX = /^(?:us|eu|apac|ap|ca|jp|au|us-gov|global)\\./i\n\n/** Removes a leading regional routing prefix (\"eu.\", \"us.\" …) from a model identifier. */\nexport function stripRoutingPrefix(modelId: string): string {\n return modelId.trim().replace(ROUTING_PREFIX, '')\n}\n\nfunction vendorOf(id: string): string {\n const dot = id.indexOf('.')\n return (dot > 0 ? id.slice(0, dot) : '').toLowerCase()\n}\n\n/** The built-in matching rules; hosts may replace or extend them. */\nexport const defaultProviderRules: readonly ProviderRule[] = VENDORS.flatMap(([key, name]) => [\n { key, name, match: (id: string) => vendorOf(stripRoutingPrefix(id)) === key },\n]).concat(\n VENDORS.map(([key, name, words]) => ({\n key,\n name,\n match: (id: string) => {\n const tokens = stripRoutingPrefix(id).toLowerCase().split(/[^a-z0-9]+/)\n return words.some((w) => tokens.includes(w))\n },\n })),\n)\n\nexport interface ResolvedProvider {\n key: string\n /** Display name; empty for `other` (the component shows the localised word). */\n name: string\n}\n\n/** Maps a model identifier to a provider; unknown identifiers resolve to `other`. */\nexport function resolveProvider(modelId: string, rules: readonly ProviderRule[] = defaultProviderRules): ResolvedProvider {\n const bare = stripRoutingPrefix(modelId)\n for (const rule of rules) {\n if (rule.match(modelId) || rule.match(bare)) return { key: rule.key, name: rule.name }\n }\n return { key: 'other', name: '' }\n}\n\nexport interface ProviderMarkProps {\n modelId: string\n rules?: readonly ProviderRule[]\n showName?: boolean\n size?: MarkSize\n className?: string\n}\n\n/** Model provider mark and name for a model identifier. Never shows a real mark for `other`. */\nexport function ProviderMark({ modelId, rules, showName, size, className }: ProviderMarkProps) {\n const copy = useMessages().providerMark\n const provider = resolveProvider(modelId, rules)\n const unknown = provider.key === 'other'\n return (\n <ThirdPartyMarkSlot\n markKey={unknown ? '' : provider.key}\n name={unknown ? copy.otherProvider : provider.name}\n category=\"model\"\n showName={showName}\n size={size}\n className={className}\n />\n )\n}\n","import { KeyRound } from 'lucide-react'\nimport type { IconComponent } from '../../internal/types'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { ThirdPartyMarkGlyph } from '../third-party-mark-slot/ThirdPartyMarkSlot'\n\nexport interface IdentityProvider {\n id: string\n name: string\n /** Neutral glyph supplied by the host. */\n glyph?: IconComponent\n /** Key of a host-registered mark (MarkRegistryProvider); preferred over `glyph`. */\n markKey?: string\n}\n\nexport interface FederatedSignInProps {\n providers: readonly IdentityProvider[]\n onSelect: (id: string) => void\n arrangement?: 'stack' | 'row'\n busyId?: string | null\n disabled?: boolean\n actionLabel?: (name: string) => string\n /** Name of the group (e.g. \"Other ways to sign in\"); ignored when `aria-labelledby` is given. */\n 'aria-label'?: string\n 'aria-labelledby'?: string\n className?: string\n}\n\nfunction leadingFor(p: IdentityProvider) {\n if (p.markKey) return <ThirdPartyMarkGlyph markKey={p.markKey} category=\"service\" />\n const Glyph = p.glyph ?? KeyRound\n return <Glyph aria-hidden=\"true\" focusable=\"false\" />\n}\n\n/** \"Continue with {provider}\" buttons (spec: wave-2/federated-sign-in.md). */\nexport function FederatedSignIn(props: FederatedSignInProps) {\n const copy = useMessages()\n const text = props.actionLabel ?? copy.federatedSignIn.continueWith\n const inFlight = props.busyId ?? null\n const labelledBy = props['aria-labelledby']\n return (\n <div\n role=\"group\"\n className={props.className ? `ty-federated ${props.className}` : 'ty-federated'}\n data-arrangement={props.arrangement ?? 'stack'}\n aria-labelledby={labelledBy}\n aria-label={labelledBy ? undefined : (props['aria-label'] ?? copy.federatedSignIn.groupLabel)}\n >\n {props.providers.map((p) => {\n const mine = inFlight === p.id\n return (\n <Button\n key={p.id}\n variant=\"secondary\"\n fullWidth\n leadingIcon={leadingFor(p)}\n busy={mine}\n disabled={props.disabled || (inFlight !== null && !mine)}\n onPress={() => props.onSelect(p.id)}\n className=\"ty-federated__button\"\n >\n {text(p.name)}\n </Button>\n )\n })}\n </div>\n )\n}\n","import { FileQuestion, ServerCrash, TriangleAlert } from 'lucide-react'\nimport { useEffect, useRef, type ReactNode, type RefObject } from 'react'\nimport { cx } from '../../internal/cx'\nimport type { HttpErrorKind } from '../../internal/messages/auth-brand'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\n\nexport type { HttpErrorKind }\n\nexport interface HttpErrorPageProps {\n kind: HttpErrorKind\n /** Exact code for 5xx variants (502, 503 …); the kind's code otherwise. */\n code?: number\n title?: string\n message?: string\n action?: ReactNode\n /** problem+json `type`, shown as monospace metadata. */\n problemType?: string\n /** Moves focus to the heading on mount (client-side navigation). */\n focusHeading?: boolean\n className?: string\n}\n\n/** Status family per kind: its default code and its glyph. */\nconst FAMILY: Record<HttpErrorKind, readonly [number, IconComponent]> = {\n 'bad-request': [400, TriangleAlert],\n 'not-found': [404, FileQuestion],\n 'server-error': [500, ServerCrash],\n}\n\n/** After a client-side navigation, the page title takes focus so the change is announced. */\nfunction useArrivalFocus(target: RefObject<HTMLElement | null>, enabled: boolean) {\n useEffect(() => {\n if (enabled) target.current?.focus()\n }, [target, enabled])\n}\n\n/** Whole-page 404, 400 and 5xx states (spec: wave-2/http-error-page.md). */\nexport function HttpErrorPage(props: HttpErrorPageProps) {\n const words = useMessages().httpError\n const titleRef = useRef<HTMLHeadingElement>(null)\n const [familyCode, Glyph] = FAMILY[props.kind]\n const status = props.code ?? familyCode\n const fallback = words[props.kind]\n useArrivalFocus(titleRef, props.focusHeading ?? true)\n\n return (\n <main className={cx('ty-http-error', props.className)} data-kind={props.kind}>\n <div className=\"ty-http-error__column\">\n <Glyph className=\"ty-http-error__icon\" aria-hidden=\"true\" focusable=\"false\" />\n {/* The big number is decoration; the heading says it in words. */}\n <p aria-hidden=\"true\" className=\"ty-http-error__code\">\n {status}\n </p>\n <h1 ref={titleRef} className=\"ty-http-error__title\" tabIndex={-1}>\n <span className=\"ty-visually-hidden\">{`${words.codeLabel(status)}: `}</span>\n {props.title ?? fallback.title}\n </h1>\n <p className=\"ty-http-error__message\">{props.message ?? fallback.message}</p>\n {props.problemType && (\n <p className=\"ty-http-error__problem\">\n <span className=\"ty-visually-hidden\">{`${words.problemType}: `}</span>\n <code>{props.problemType}</code>\n </p>\n )}\n {props.action && <div className=\"ty-http-error__actions\">{props.action}</div>}\n </div>\n </main>\n )\n}\n","import { ChevronDown } from 'lucide-react'\nimport { useEffect, useId, useRef, useState, type MouseEvent, type ReactNode } from 'react'\nimport { Button, Disclosure, DisclosurePanel, Heading } from 'react-aria-components'\nimport { breakpoints, prefersReducedMotion, useMinWidth } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\n\nexport interface ContentsEntry {\n id: string\n text: string\n}\n\n// Latin letters NFD cannot split into base + mark.\nconst TRANSLIT: Record<string, string> = { ß: 'ss', æ: 'ae', ø: 'o', œ: 'oe', ł: 'l', đ: 'd', ð: 'd', þ: 'th', ı: 'i' }\n\n/**\n * Stable slug for a heading text in any script. Latin accents are folded\n * (\"Ação\" → \"acao\"); letters, marks and digits of other scripts are kept as\n * they are (Arabic, Devanagari, CJK… are valid fragment identifiers); runs of\n * anything else become one dash. `fallback` only when nothing is left.\n */\nexport function slugForHeading(text: string, fallback: string): string {\n const folded = text\n .toLocaleLowerCase()\n .normalize('NFD')\n .replace(/(\\p{Script=Latin})\\p{M}+/gu, '$1')\n .replace(/[ßæøœłđðþı]/g, (ch) => TRANSLIT[ch] ?? ch)\n .normalize('NFC')\n const slug = folded.replace(/[^\\p{L}\\p{M}\\p{N}]+/gu, '-').replace(/^-+|-+$/g, '')\n return slug || fallback\n}\n\n/** Gives every second-level heading of `root` a unique id and returns the contents. */\nfunction indexHeadings(root: HTMLElement): ContentsEntry[] {\n const taken = new Set<string>()\n root.querySelectorAll('[id]').forEach((el) => {\n if (!(el instanceof HTMLHeadingElement && el.tagName === 'H2')) taken.add(el.id)\n })\n const out: ContentsEntry[] = []\n root.querySelectorAll('h2').forEach((h, n) => {\n let id = h.id || slugForHeading(h.textContent ?? '', `section-${n + 1}`)\n if (taken.has(id)) {\n let k = 2\n while (taken.has(`${id}-${k}`)) k++\n id = `${id}-${k}`\n }\n taken.add(id)\n h.id = id\n out.push({ id, text: (h.textContent ?? '').trim() })\n })\n return out\n}\n\nfunction useCurrentSection(entries: ContentsEntry[]): string | undefined {\n const [current, setCurrent] = useState<string | undefined>(entries[0]?.id)\n useEffect(() => {\n setCurrent(entries[0]?.id)\n if (typeof IntersectionObserver === 'undefined' || entries.length === 0) return undefined\n const seen = new IntersectionObserver(\n (records) => {\n const hit = records.filter((r) => r.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0]\n if (hit) setCurrent(hit.target.id)\n },\n { rootMargin: '0px 0px -70% 0px' },\n )\n for (const e of entries) {\n const el = document.getElementById(e.id)\n if (el) seen.observe(el)\n }\n return () => seen.disconnect()\n }, [entries])\n return current\n}\n\nfunction ContentsList({ entries, current, onFollow }: { entries: ContentsEntry[]; current?: string; onFollow: (id: string) => (e: MouseEvent) => void }) {\n return (\n <ol className=\"ty-legal__contents-list\">\n {entries.map((e) => (\n <li key={e.id}>\n <a className=\"ty-legal__contents-link\" href={`#${e.id}`} aria-current={e.id === current ? 'location' : undefined} onClick={onFollow(e.id)}>\n {e.text}\n </a>\n </li>\n ))}\n </ol>\n )\n}\n\nexport interface LegalDocumentFrameProps {\n title: string\n /** Pre-formatted \"last updated\" line. */\n updatedAt: string\n children: ReactNode\n topBar?: ReactNode\n footer?: ReactNode\n contentsLabel?: string\n className?: string\n}\n\n/** Reading layout for policies with a generated table of contents (spec: wave-2/legal-document-frame.md). */\nexport function LegalDocumentFrame({ title, updatedAt, children, topBar, footer, contentsLabel, className }: LegalDocumentFrameProps) {\n const copy = useMessages().legalDocument\n const label = contentsLabel ?? copy.contents\n const wide = useMinWidth(breakpoints.lg)\n const article = useRef<HTMLElement>(null)\n const navTitleId = `ty-legal-nav-${useId().replace(/:/g, '')}`\n const [entries, setEntries] = useState<ContentsEntry[]>([])\n const current = useCurrentSection(entries)\n\n useEffect(() => {\n if (article.current) setEntries(indexHeadings(article.current))\n }, [children])\n\n const follow = (id: string) => (event: MouseEvent) => {\n const target = document.getElementById(id)\n if (!target) return\n event.preventDefault()\n if (!target.hasAttribute('tabindex')) target.setAttribute('tabindex', '-1')\n target.scrollIntoView({ behavior: prefersReducedMotion() ? 'auto' : 'smooth', block: 'start' })\n target.focus({ preventScroll: true })\n if (typeof history !== 'undefined') history.replaceState(null, '', `#${id}`)\n }\n\n let contents: ReactNode = null\n if (entries.length > 0) {\n contents = wide ? (\n <nav className=\"ty-legal__contents\" aria-labelledby={navTitleId} data-placement=\"rail\">\n <p id={navTitleId} className=\"ty-legal__contents-title\">\n {label}\n </p>\n <ContentsList entries={entries} current={current} onFollow={follow} />\n </nav>\n ) : (\n <nav className=\"ty-legal__contents\" aria-label={label} data-placement=\"inline\">\n <Disclosure className=\"ty-legal__disclosure\">\n <Heading level={2} className=\"ty-legal__disclosure-heading\">\n <Button slot=\"trigger\" className=\"ty-legal__disclosure-trigger\">\n {label}\n <ChevronDown className=\"ty-legal__chevron\" aria-hidden=\"true\" focusable=\"false\" />\n </Button>\n </Heading>\n <DisclosurePanel className=\"ty-legal__disclosure-panel\">\n <ContentsList entries={entries} current={current} onFollow={follow} />\n </DisclosurePanel>\n </Disclosure>\n </nav>\n )\n }\n\n return (\n <div className={className ? `ty-legal ${className}` : 'ty-legal'} data-layout={wide ? 'columns' : 'single'}>\n {topBar ? <header className=\"ty-legal__top\">{topBar}</header> : null}\n <main className=\"ty-legal__main\">\n <div className=\"ty-legal__head\">\n <h1 className=\"ty-legal__title\">{title}</h1>\n <p className=\"ty-legal__updated\">{updatedAt}</p>\n </div>\n <div className=\"ty-legal__body\">\n {contents}\n <article ref={article} className=\"ty-legal__prose\">\n {children}\n </article>\n </div>\n </main>\n {footer ? <footer className=\"ty-legal__footer\">{footer}</footer> : null}\n </div>\n )\n}\n","import { useEffect, useReducer } from 'react'\nimport { useMessages } from '../../internal/provider'\n\ntype Phase = 'idle' | 'waiting' | 'shown' | 'finishing'\ntype Signal = 'start' | 'reveal' | 'settle' | 'done'\n\n// Transition table of the bar: waiting → shown after the delay; a navigation\n// that settles while still waiting never shows anything.\nconst NEXT: Record<Phase, Partial<Record<Signal, Phase>>> = {\n idle: { start: 'waiting' },\n waiting: { reveal: 'shown', settle: 'idle' },\n shown: { settle: 'finishing' },\n finishing: { done: 'idle', start: 'shown' },\n}\n\nfunction step(phase: Phase, signal: Signal): Phase {\n return NEXT[phase][signal] ?? phase\n}\n\n/** How long the completing bar lingers (matches --ty-dur-base). */\nconst FINISH_MS = 240\n\nexport interface RouteProgressProps {\n /** A client-side navigation is in flight. */\n pending: boolean\n /** Navigations shorter than this (ms) show nothing. */\n delay?: number\n label?: string\n className?: string\n}\n\n/** Thin top bar for pending client-side navigations (spec: wave-2/route-progress.md). */\nexport function RouteProgress({ pending, delay = 200, label, className }: RouteProgressProps) {\n const copy = useMessages().routeProgress\n const text = label ?? copy.label\n const [phase, send] = useReducer(step, 'idle')\n\n useEffect(() => {\n send(pending ? 'start' : 'settle')\n }, [pending])\n\n useEffect(() => {\n if (phase === 'waiting') {\n const t = setTimeout(() => send('reveal'), delay)\n return () => clearTimeout(t)\n }\n if (phase === 'finishing') {\n const t = setTimeout(() => send('done'), FINISH_MS)\n return () => clearTimeout(t)\n }\n return undefined\n }, [phase, delay])\n\n const visible = phase === 'shown' || phase === 'finishing'\n return (\n <div className={className ? `ty-route-progress ${className}` : 'ty-route-progress'}>\n {visible ? <div className=\"ty-route-progress__bar\" data-phase={phase} aria-hidden=\"true\" /> : null}\n <span className=\"ty-visually-hidden\" role=\"status\" aria-live=\"polite\">\n {phase === 'shown' ? text : ''}\n </span>\n </div>\n )\n}\n","import type { CSSProperties } from 'react'\n\nexport type SkeletonFillVariant = 'surface' | 'on-accent'\nexport type SkeletonBlockShape = 'line' | 'block' | 'circle' | 'pill'\n/** A spacing step of §2.1 (1–9), or any CSS length or percentage. */\nexport type SkeletonSize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | (string & {})\n\n/**\n * Style hook shared by every placeholder: spread the result on any element\n * to give it the skeleton fill and pulse (the stylesheet selects on it).\n */\nexport function skeletonFill(variant: SkeletonFillVariant = 'surface', animated = true): Record<string, string> {\n const hook: Record<string, string> = { 'data-ty-skeleton': variant }\n if (!animated) hook['data-ty-skeleton-static'] = ''\n return hook\n}\n\nfunction sizeValue(size: SkeletonSize | undefined): string | undefined {\n if (size === undefined) return undefined\n return typeof size === 'number' ? `var(--ty-space-${size})` : size\n}\n\nexport interface SkeletonBlockProps {\n shape?: SkeletonBlockShape\n variant?: SkeletonFillVariant\n width?: SkeletonSize\n height?: SkeletonSize\n animated?: boolean\n className?: string\n}\n\n/** One placeholder shape with the shared fill (spec: wave-4/skeleton-fill.md). Always hidden from assistive technology. */\nexport function SkeletonBlock({ shape = 'line', variant, width, height, animated = true, className }: SkeletonBlockProps) {\n const dims: Record<string, string> = {}\n const w = sizeValue(width)\n const h = sizeValue(height)\n if (w) dims['--ty-skeleton-w'] = w\n if (h) dims['--ty-skeleton-h'] = h\n return (\n <span\n aria-hidden=\"true\"\n className={className ? `ty-skeleton-block ${className}` : 'ty-skeleton-block'}\n data-shape={shape}\n style={dims as CSSProperties}\n {...skeletonFill(variant, animated)}\n />\n )\n}\n","import { useId, useRef } from 'react'\nimport { Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components'\nimport { useDomAttributes } from '../../internal/dom'\nimport { useMessages } from '../../internal/provider'\nimport type { AuthBrandMessages } from '../../internal/messages/auth-brand'\nimport { AmbientBackdrop } from '../ambient-backdrop/AmbientBackdrop'\nimport { Button } from '../button/Button'\nimport { InlineNotice } from '../inline-notice/InlineNotice'\n\nexport type UpgradeGateTexts = AuthBrandMessages['upgradeGate']\n\nexport interface UpgradeGateProps {\n onViewPlans: () => void\n onSignOut: () => void\n busy?: boolean\n texts?: Partial<UpgradeGateTexts>\n className?: string\n}\n\n/** Non-dismissable blocking screen for organisations without a plan (spec: wave-2/upgrade-gate.md). */\nexport function UpgradeGate({ onViewPlans, onSignOut, busy = false, texts, className }: UpgradeGateProps) {\n const t: UpgradeGateTexts = { ...useMessages().upgradeGate, ...texts }\n const ids = useId().replace(/:/g, '')\n const titleId = `ty-gate-title-${ids}`\n const descId = `ty-gate-desc-${ids}`\n const dialogRef = useRef<HTMLElement>(null)\n // RAC's Dialog does not forward aria-modal; the gate is modal, so say it.\n useDomAttributes(dialogRef, { 'aria-modal': 'true' })\n return (\n <ModalOverlay isOpen isDismissable={false} isKeyboardDismissDisabled className={className ? `ty-gate ${className}` : 'ty-gate'}>\n <AmbientBackdrop />\n <Modal className=\"ty-gate__modal\">\n <Dialog className=\"ty-gate__dialog\" ref={dialogRef} role=\"dialog\" aria-labelledby={titleId} aria-describedby={descId}>\n <p className=\"ty-gate__eyebrow\">{t.eyebrow}</p>\n <Heading slot=\"title\" level={1} id={titleId} className=\"ty-gate__title\">\n {t.title}\n </Heading>\n <p id={descId} className=\"ty-gate__description\">\n {t.description} <span className=\"ty-visually-hidden\">{t.cannotDismiss}</span>\n </p>\n <InlineNotice tone=\"warning\" title={t.noticeTitle} urgency=\"none\">\n {t.noticeBody}\n </InlineNotice>\n <div className=\"ty-gate__actions\">\n <Button variant=\"primary\" busy={busy} onPress={onViewPlans} autoFocus>\n {t.viewPlans}\n </Button>\n <Button variant=\"quiet\" onPress={onSignOut}>\n {t.signOut}\n </Button>\n </div>\n </Dialog>\n </Modal>\n </ModalOverlay>\n )\n}\n","// Product marks of the Datatech family (\"Instrumento\" direction; Tympan keeps its plate mark), generated from the author’s artwork\n// (Datatech; generator script in the brand redesign folder, wordmark type converted to outlines, Archivo, OFL).\n// Ink paths draw in currentColor, the accent dot in var(--ty-mark-accent). Do not edit by hand.\nexport type ProductMarkProduct = 'tympan' | 'fakhir' | 'astrlabe' | 'datatech'\nexport type ProductMarkVariant = 'symbol' | 'horizontal'\nexport interface MarkArt {\n viewBox: string\n paths: Array<{ tone: 'ink' | 'accent'; d: string }>\n}\nexport const PRODUCT_MARKS: Record<ProductMarkProduct, Record<ProductMarkVariant, MarkArt>> = {\n // Tympan's symbol is its astrolabe plate, drawn by ProductMark from plateGeometry; only the wordmark is here.\n tympan: {\n symbol: { viewBox: '0 0 400 400', paths: [] },\n horizontal: {\n viewBox: '0 0 111 52',\n paths: [{ tone: 'ink', d: 'M84.96 31.89V24.62H85.98L86.1 25.48H86.17Q86.55 24.95 87.08 24.72Q87.62 24.5 88.28 24.5Q89.13 24.5 89.74 24.81Q90.35 25.12 90.68 25.74Q91.02 26.37 91.02 27.31Q91.02 28.26 90.69 28.88Q90.36 29.51 89.77 29.82Q89.18 30.12 88.37 30.12Q87.93 30.12 87.55 30.03Q87.16 29.94 86.84 29.76Q86.53 29.57 86.3 29.3H86.23V31.89ZM72.69 30V24.62H73.71L73.81 25.55H73.9Q74.19 25.14 74.56 24.92Q74.92 24.69 75.34 24.6Q75.75 24.5 76.14 24.5Q76.89 24.5 77.39 24.75Q77.88 25 78.11 25.55H78.2Q78.49 25.14 78.87 24.92Q79.25 24.69 79.66 24.6Q80.08 24.5 80.46 24.5Q81.17 24.5 81.65 24.73Q82.13 24.96 82.37 25.43Q82.62 25.9 82.62 26.64V30H81.33V26.87Q81.33 26.49 81.23 26.24Q81.14 25.99 80.96 25.84Q80.79 25.69 80.54 25.64Q80.3 25.58 80 25.58Q79.57 25.58 79.17 25.77Q78.78 25.96 78.53 26.3Q78.28 26.64 78.28 27.11V30H77.01V26.87Q77.01 26.49 76.92 26.24Q76.82 25.99 76.64 25.84Q76.46 25.69 76.22 25.64Q75.98 25.58 75.68 25.58Q75.24 25.58 74.85 25.77Q74.45 25.96 74.21 26.3Q73.96 26.64 73.96 27.11V30ZM95.21 30.12Q94.74 30.12 94.33 30.05Q93.93 29.97 93.62 29.79Q93.3 29.61 93.14 29.31Q92.97 29.01 92.97 28.56Q92.97 27.91 93.32 27.54Q93.68 27.17 94.34 27.01Q95 26.85 95.87 26.81Q96.74 26.77 97.75 26.77V26.51Q97.75 26.13 97.58 25.91Q97.42 25.68 97.05 25.59Q96.68 25.5 96.07 25.5Q95.58 25.5 95.22 25.57Q94.87 25.64 94.67 25.78Q94.48 25.92 94.48 26.12V26.26H93.2Q93.19 26.21 93.19 26.17Q93.18 26.13 93.18 26.08Q93.18 25.6 93.52 25.24Q93.86 24.89 94.52 24.69Q95.19 24.5 96.19 24.5Q97.12 24.5 97.75 24.67Q98.39 24.85 98.71 25.24Q99.03 25.64 99.03 26.33V28.72Q99.03 28.92 99.11 29.02Q99.18 29.12 99.39 29.12H99.9V29.96Q99.78 30 99.52 30.06Q99.26 30.12 98.97 30.12Q98.54 30.12 98.3 30.01Q98.07 29.89 97.97 29.69Q97.88 29.49 97.83 29.24H97.75Q97.48 29.52 97.07 29.72Q96.67 29.92 96.2 30.02Q95.72 30.12 95.21 30.12ZM59.12 30V24.23H56V22.99H63.66V24.23H60.54V30ZM65.91 32Q65.64 32 65.42 31.96Q65.2 31.92 64.99 31.84V31H65.66Q66.14 31 66.43 30.89Q66.71 30.78 66.88 30.56Q67.05 30.34 67.22 30L64.58 24.62H65.98L67.2 27.29Q67.29 27.47 67.41 27.74Q67.53 28.02 67.66 28.31Q67.79 28.59 67.88 28.81H67.96Q67.97 28.78 68.03 28.61Q68.09 28.44 68.19 28.19Q68.29 27.95 68.39 27.69Q68.49 27.44 68.57 27.24L69.63 24.62H70.98L68.78 29.59Q68.51 30.17 68.26 30.62Q68.01 31.07 67.7 31.38Q67.39 31.68 66.96 31.84Q66.52 32 65.91 32ZM101.55 30V24.62H102.57L102.67 25.55H102.77Q103.06 25.14 103.44 24.92Q103.82 24.69 104.24 24.6Q104.66 24.5 105.06 24.5Q105.81 24.5 106.31 24.73Q106.81 24.96 107.06 25.43Q107.31 25.9 107.31 26.64V30H106.03V26.87Q106.03 26.49 105.93 26.24Q105.83 25.99 105.64 25.84Q105.46 25.69 105.2 25.64Q104.94 25.58 104.62 25.58Q104.16 25.58 103.76 25.77Q103.35 25.96 103.09 26.3Q102.83 26.64 102.83 27.11V30ZM88.01 29.04Q88.53 29.04 88.91 28.85Q89.29 28.66 89.5 28.3Q89.71 27.93 89.71 27.39V27.23Q89.71 26.68 89.5 26.32Q89.29 25.95 88.9 25.77Q88.51 25.58 87.98 25.58Q87.44 25.58 87.05 25.77Q86.65 25.96 86.43 26.33Q86.22 26.7 86.22 27.26V27.36Q86.22 27.78 86.35 28.09Q86.48 28.41 86.71 28.62Q86.94 28.83 87.27 28.93Q87.6 29.04 88.01 29.04ZM95.51 29.12Q95.87 29.12 96.25 29.04Q96.64 28.96 96.98 28.81Q97.32 28.66 97.54 28.44Q97.75 28.21 97.75 27.92V27.6Q96.57 27.6 95.79 27.68Q95.02 27.76 94.63 27.95Q94.24 28.15 94.24 28.52Q94.24 28.77 94.43 28.89Q94.62 29.02 94.91 29.07Q95.2 29.12 95.51 29.12Z' }],\n },\n },\n fakhir: {\n symbol: {\n viewBox: '0 0 48 52',\n paths: [\n {\n tone: 'ink',\n d: 'M28.82 8.6C37.26 10.74 43.5 18.39 43.5 27.5C43.5 38.27 34.77 47 24 47C13.23 47 4.5 38.27 4.5 27.5C4.5 18.39 10.74 10.74 19.18 8.6C20.03 7.39 20.44 5.49 21 5C21.7 4.35 22.4 4.2 24 4.2C25.6 4.2 26.3 4.35 27 5C27.56 5.49 27.97 7.39 28.82 8.6ZM24 11.3C15.05 11.3 7.8 18.55 7.8 27.5C7.8 28.77 7.95 30.01 8.22 31.2H39.78C40.05 30.01 40.2 28.77 40.2 27.5C40.2 18.55 32.95 11.3 24 11.3ZM33 40.97C35.73 39.14 37.88 36.5 39.09 33.4H33ZM8.91 33.4C10.12 36.5 12.27 39.14 15 40.97V33.4ZM24 34.7 18.62 39.7H29.38L24 34.7ZM16.02 41.6C18.37 42.94 21.1 43.7 24 43.7C26.9 43.7 29.63 42.94 31.98 41.6ZM31.1 33.4H25.4L31.1 38.7ZM22.6 33.4H16.9V38.7Z',\n },\n {\n tone: 'accent',\n d: 'M30 20.8C31.38 20.8 32.5 21.92 32.5 23.3C32.5 24.68 31.38 25.8 30 25.8C28.62 25.8 27.5 24.68 27.5 23.3C27.5 21.92 28.62 20.8 30 20.8Z',\n },\n ],\n },\n horizontal: {\n viewBox: '0 0 99 52',\n paths: [\n {\n tone: 'ink',\n d: 'M28.82 8.6C37.26 10.74 43.5 18.39 43.5 27.5C43.5 38.27 34.77 47 24 47C13.23 47 4.5 38.27 4.5 27.5C4.5 18.39 10.74 10.74 19.18 8.6C20.03 7.39 20.44 5.49 21 5C21.7 4.35 22.4 4.2 24 4.2C25.6 4.2 26.3 4.35 27 5C27.56 5.49 27.97 7.39 28.82 8.6ZM24 11.3C15.05 11.3 7.8 18.55 7.8 27.5C7.8 28.77 7.95 30.01 8.22 31.2H39.78C40.05 30.01 40.2 28.77 40.2 27.5C40.2 18.55 32.95 11.3 24 11.3ZM33 40.97C35.73 39.14 37.88 36.5 39.09 33.4H33ZM8.91 33.4C10.12 36.5 12.27 39.14 15 40.97V33.4ZM24 34.7 18.62 39.7H29.38L24 34.7ZM16.02 41.6C18.37 42.94 21.1 43.7 24 43.7C26.9 43.7 29.63 42.94 31.98 41.6ZM31.1 33.4H25.4L31.1 38.7ZM22.6 33.4H16.9V38.7Z',\n },\n {\n tone: 'accent',\n d: 'M30 20.8C31.38 20.8 32.5 21.92 32.5 23.3C32.5 24.68 31.38 25.8 30 25.8C28.62 25.8 27.5 24.68 27.5 23.3C27.5 21.92 28.62 20.8 30 20.8Z',\n },\n {\n tone: 'ink',\n d: 'M66.25 30.12Q65.78 30.12 65.37 30.05Q64.96 29.97 64.65 29.79Q64.34 29.61 64.17 29.31Q64 29.01 64 28.56Q64 27.91 64.36 27.54Q64.72 27.17 65.37 27.01Q66.03 26.85 66.91 26.81Q67.78 26.77 68.79 26.77V26.51Q68.79 26.13 68.62 25.91Q68.45 25.68 68.08 25.59Q67.72 25.5 67.1 25.5Q66.61 25.5 66.26 25.57Q65.9 25.64 65.71 25.78Q65.51 25.92 65.51 26.12V26.26H64.24Q64.23 26.21 64.22 26.17Q64.22 26.13 64.22 26.08Q64.22 25.6 64.55 25.24Q64.89 24.89 65.56 24.69Q66.23 24.5 67.23 24.5Q68.16 24.5 68.79 24.67Q69.42 24.85 69.74 25.24Q70.06 25.64 70.06 26.33V28.72Q70.06 28.92 70.14 29.02Q70.22 29.12 70.42 29.12H70.93V29.96Q70.82 30 70.56 30.06Q70.3 30.12 70 30.12Q69.57 30.12 69.34 30.01Q69.1 29.89 69.01 29.69Q68.91 29.49 68.87 29.24H68.79Q68.51 29.52 68.11 29.72Q67.71 29.92 67.23 30.02Q66.76 30.12 66.25 30.12ZM56 30V22.99H62.61V24.17H57.42V26H62.14V27.18H57.42V30ZM80.35 30V22.61H81.63V25.4H81.7Q81.99 25.04 82.35 24.85Q82.71 24.65 83.1 24.58Q83.5 24.5 83.86 24.5Q84.61 24.5 85.11 24.73Q85.61 24.96 85.86 25.43Q86.11 25.9 86.11 26.64V30H84.83V26.87Q84.83 26.49 84.73 26.24Q84.63 25.99 84.44 25.84Q84.26 25.69 84 25.64Q83.74 25.58 83.42 25.58Q82.97 25.58 82.56 25.77Q82.15 25.96 81.89 26.3Q81.63 26.64 81.63 27.11V30ZM72.59 30V22.61H73.86V27.16L76.8 24.62H78.4L76.1 26.74L78.49 30H76.96L75.13 27.52L73.86 28.48V30ZM92.11 30V24.62H93.13L93.23 25.59H93.31Q93.41 25.32 93.62 25.07Q93.83 24.82 94.15 24.66Q94.47 24.5 94.89 24.5Q95.06 24.5 95.24 24.53Q95.42 24.55 95.56 24.6V25.71H94.91Q94.48 25.71 94.19 25.86Q93.9 26.01 93.72 26.26Q93.55 26.51 93.47 26.8Q93.39 27.09 93.39 27.4V30ZM88.45 30V24.62H89.72V30ZM66.54 29.12Q66.9 29.12 67.29 29.04Q67.68 28.96 68.02 28.81Q68.36 28.66 68.57 28.44Q68.79 28.21 68.79 27.92V27.6Q67.6 27.6 66.83 27.68Q66.05 27.76 65.67 27.95Q65.28 28.15 65.28 28.52Q65.28 28.77 65.47 28.89Q65.66 29.02 65.95 29.07Q66.24 29.12 66.54 29.12ZM88.45 23.69V22.61H89.72V23.69Z',\n },\n ],\n },\n },\n astrlabe: {\n symbol: {\n viewBox: '0 0 48 52',\n paths: [\n {\n tone: 'ink',\n d: 'M28.82 8.6C37.26 10.74 43.5 18.39 43.5 27.5C43.5 38.27 34.77 47 24 47C13.23 47 4.5 38.27 4.5 27.5C4.5 18.39 10.74 10.74 19.18 8.6C20.03 7.39 20.44 5.49 21 5C21.7 4.35 22.4 4.2 24 4.2C25.6 4.2 26.3 4.35 27 5C27.56 5.49 27.97 7.39 28.82 8.6ZM24 11.3C15.05 11.3 7.8 18.55 7.8 27.5C7.8 28.77 7.95 30.01 8.22 31.2H18.53C17.31 29.55 16.6 27.51 16.6 25.3C16.6 19.78 21.08 15.3 26.6 15.3C32.12 15.3 36.6 19.78 36.6 25.3C36.6 27.51 35.89 29.55 34.67 31.2H39.78C40.05 30.01 40.2 28.77 40.2 27.5C40.2 18.55 32.95 11.3 24 11.3ZM8.91 33.4C11.27 39.43 17.13 43.7 24 43.7C30.87 43.7 36.73 39.43 39.09 33.4H32.47C30.82 34.6 28.79 35.3 26.6 35.3C24.41 35.3 22.38 34.6 20.73 33.4ZM26.6 17.4C22.24 17.4 18.7 20.94 18.7 25.3C18.7 27.65 19.72 29.75 21.35 31.2H31.85C33.48 29.75 34.5 27.65 34.5 25.3C34.5 20.94 30.96 17.4 26.6 17.4Z',\n },\n {\n tone: 'accent',\n d: 'M19.27 17.57C20.7 17.57 21.87 18.73 21.87 20.17C21.87 21.6 20.7 22.77 19.27 22.77C17.83 22.77 16.67 21.6 16.67 20.17C16.67 18.73 17.83 17.57 19.27 17.57Z',\n },\n ],\n },\n horizontal: {\n viewBox: '0 0 113 52',\n paths: [\n {\n tone: 'ink',\n d: 'M28.82 8.6C37.26 10.74 43.5 18.39 43.5 27.5C43.5 38.27 34.77 47 24 47C13.23 47 4.5 38.27 4.5 27.5C4.5 18.39 10.74 10.74 19.18 8.6C20.03 7.39 20.44 5.49 21 5C21.7 4.35 22.4 4.2 24 4.2C25.6 4.2 26.3 4.35 27 5C27.56 5.49 27.97 7.39 28.82 8.6ZM24 11.3C15.05 11.3 7.8 18.55 7.8 27.5C7.8 28.77 7.95 30.01 8.22 31.2H18.53C17.31 29.55 16.6 27.51 16.6 25.3C16.6 19.78 21.08 15.3 26.6 15.3C32.12 15.3 36.6 19.78 36.6 25.3C36.6 27.51 35.89 29.55 34.67 31.2H39.78C40.05 30.01 40.2 28.77 40.2 27.5C40.2 18.55 32.95 11.3 24 11.3ZM8.91 33.4C11.27 39.43 17.13 43.7 24 43.7C30.87 43.7 36.73 39.43 39.09 33.4H32.47C30.82 34.6 28.79 35.3 26.6 35.3C24.41 35.3 22.38 34.6 20.73 33.4ZM26.6 17.4C22.24 17.4 18.7 20.94 18.7 25.3C18.7 27.65 19.72 29.75 21.35 31.2H31.85C33.48 29.75 34.5 27.65 34.5 25.3C34.5 20.94 30.96 17.4 26.6 17.4Z',\n },\n {\n tone: 'accent',\n d: 'M19.27 17.57C20.7 17.57 21.87 18.73 21.87 20.17C21.87 21.6 20.7 22.77 19.27 22.77C17.83 22.77 16.67 21.6 16.67 20.17C16.67 18.73 17.83 17.57 19.27 17.57Z',\n },\n {\n tone: 'ink',\n d: 'M98.09 30.12Q97.43 30.12 96.89 29.9Q96.36 29.67 95.98 29.15H95.91L95.79 30H94.77V22.61H96.04V25.33H96.11Q96.34 25.05 96.66 24.87Q96.97 24.69 97.36 24.6Q97.75 24.5 98.19 24.5Q98.99 24.5 99.58 24.81Q100.18 25.12 100.5 25.74Q100.83 26.37 100.83 27.32Q100.83 28.26 100.5 28.88Q100.17 29.51 99.55 29.82Q98.94 30.12 98.09 30.12ZM58.24 30.12Q57.78 30.12 57.37 30.05Q56.96 29.97 56.65 29.79Q56.34 29.61 56.17 29.31Q56 29.01 56 28.56Q56 27.91 56.36 27.54Q56.71 27.17 57.37 27.01Q58.03 26.85 58.9 26.81Q59.78 26.77 60.79 26.77V26.51Q60.79 26.13 60.62 25.91Q60.45 25.68 60.08 25.59Q59.71 25.5 59.1 25.5Q58.61 25.5 58.26 25.57Q57.9 25.64 57.7 25.78Q57.51 25.92 57.51 26.12V26.26H56.23Q56.22 26.21 56.22 26.17Q56.21 26.13 56.21 26.08Q56.21 25.6 56.55 25.24Q56.89 24.89 57.56 24.69Q58.22 24.5 59.22 24.5Q60.15 24.5 60.79 24.67Q61.42 24.85 61.74 25.24Q62.06 25.64 62.06 26.33V28.72Q62.06 28.92 62.14 29.02Q62.21 29.12 62.42 29.12H62.93V29.96Q62.82 30 62.56 30.06Q62.3 30.12 62 30.12Q61.57 30.12 61.34 30.01Q61.1 29.89 61.01 29.69Q60.91 29.49 60.87 29.24H60.79Q60.51 29.52 60.11 29.72Q59.7 29.92 59.23 30.02Q58.76 30.12 58.24 30.12ZM88.43 30.12Q87.96 30.12 87.55 30.05Q87.14 29.97 86.83 29.79Q86.52 29.61 86.35 29.31Q86.18 29.01 86.18 28.56Q86.18 27.91 86.54 27.54Q86.9 27.17 87.56 27.01Q88.21 26.85 89.09 26.81Q89.96 26.77 90.97 26.77V26.51Q90.97 26.13 90.8 25.91Q90.63 25.68 90.27 25.59Q89.9 25.5 89.29 25.5Q88.8 25.5 88.44 25.57Q88.08 25.64 87.89 25.78Q87.69 25.92 87.69 26.12V26.26H86.42Q86.41 26.21 86.4 26.17Q86.4 26.13 86.4 26.08Q86.4 25.6 86.73 25.24Q87.07 24.89 87.74 24.69Q88.41 24.5 89.41 24.5Q90.34 24.5 90.97 24.67Q91.6 24.85 91.92 25.24Q92.24 25.64 92.24 26.33V28.72Q92.24 28.92 92.32 29.02Q92.4 29.12 92.6 29.12H93.11V29.96Q93 30 92.74 30.06Q92.48 30.12 92.18 30.12Q91.76 30.12 91.52 30.01Q91.29 29.89 91.19 29.69Q91.09 29.49 91.05 29.24H90.97Q90.69 29.52 90.29 29.72Q89.89 29.92 89.41 30.02Q88.94 30.12 88.43 30.12ZM106.09 30.12Q105.07 30.12 104.33 29.82Q103.6 29.52 103.2 28.9Q102.8 28.28 102.8 27.32Q102.8 26.38 103.19 25.75Q103.58 25.12 104.31 24.81Q105.03 24.5 106.04 24.5Q107.1 24.5 107.81 24.82Q108.52 25.13 108.88 25.72Q109.23 26.32 109.23 27.14V27.63H104.15Q104.18 28.18 104.43 28.51Q104.68 28.84 105.12 28.98Q105.56 29.12 106.13 29.12Q106.41 29.12 106.71 29.06Q107 28.99 107.26 28.87Q107.52 28.74 107.69 28.57Q107.86 28.39 107.89 28.15H109.19Q109.19 28.54 108.99 28.9Q108.79 29.26 108.4 29.53Q108 29.81 107.42 29.96Q106.84 30.12 106.09 30.12ZM67.16 30.12Q66.56 30.12 66.03 30.03Q65.5 29.93 65.1 29.73Q64.71 29.54 64.48 29.23Q64.25 28.93 64.25 28.5Q64.25 28.45 64.25 28.4Q64.26 28.36 64.27 28.32H65.57Q65.57 28.34 65.57 28.37Q65.56 28.4 65.56 28.42Q65.56 28.71 65.79 28.88Q66.02 29.04 66.39 29.11Q66.76 29.18 67.17 29.18Q67.58 29.18 67.96 29.13Q68.33 29.07 68.56 28.93Q68.79 28.8 68.79 28.52Q68.79 28.22 68.55 28.09Q68.31 27.96 67.85 27.89Q67.39 27.82 66.74 27.72Q66.24 27.65 65.82 27.54Q65.4 27.43 65.09 27.25Q64.79 27.07 64.62 26.8Q64.45 26.52 64.45 26.11Q64.45 25.69 64.64 25.39Q64.83 25.09 65.19 24.89Q65.54 24.69 66.06 24.6Q66.58 24.5 67.25 24.5Q67.84 24.5 68.32 24.6Q68.81 24.7 69.17 24.9Q69.52 25.09 69.72 25.38Q69.91 25.66 69.91 26.02V26.09Q69.91 26.12 69.9 26.17H68.59V26.13Q68.59 25.87 68.41 25.72Q68.22 25.57 67.91 25.51Q67.6 25.44 67.25 25.44Q67.09 25.44 66.84 25.45Q66.58 25.47 66.33 25.52Q66.08 25.57 65.91 25.68Q65.74 25.8 65.74 25.99Q65.74 26.23 65.99 26.36Q66.25 26.48 66.66 26.55Q67.07 26.61 67.55 26.68Q68.06 26.76 68.52 26.85Q68.98 26.94 69.33 27.11Q69.68 27.28 69.87 27.58Q70.07 27.88 70.07 28.36Q70.07 28.85 69.88 29.18Q69.69 29.52 69.31 29.73Q68.94 29.94 68.4 30.03Q67.86 30.12 67.16 30.12ZM74.23 30.12Q73.68 30.12 73.33 29.97Q72.98 29.82 72.83 29.45Q72.67 29.09 72.67 28.48V25.62H71.65V24.62H72.7L72.96 23.06H73.94V24.62H75.39V25.62H73.94V28.36Q73.94 28.73 74.08 28.93Q74.21 29.12 74.68 29.12H75.39V29.95Q75.25 30 75.04 30.04Q74.83 30.08 74.61 30.1Q74.39 30.12 74.23 30.12ZM97.79 29.04Q98.32 29.04 98.71 28.86Q99.1 28.67 99.31 28.31Q99.52 27.94 99.52 27.39V27.23Q99.52 26.68 99.31 26.32Q99.1 25.96 98.72 25.77Q98.34 25.58 97.82 25.58Q97.41 25.58 97.08 25.69Q96.76 25.8 96.52 26.01Q96.29 26.21 96.16 26.53Q96.03 26.85 96.03 27.27V27.37Q96.03 27.92 96.25 28.29Q96.46 28.66 96.86 28.85Q97.26 29.04 97.79 29.04ZM82.75 30V22.61H84.03V30ZM77.5 30V24.62H78.52L78.62 25.59H78.69Q78.79 25.32 79 25.07Q79.21 24.82 79.53 24.66Q79.85 24.5 80.27 24.5Q80.44 24.5 80.62 24.53Q80.8 24.55 80.94 24.6V25.71H80.29Q79.86 25.71 79.57 25.86Q79.28 26.01 79.11 26.26Q78.93 26.51 78.85 26.8Q78.77 27.09 78.77 27.4V30ZM88.72 29.12Q89.08 29.12 89.47 29.04Q89.86 28.96 90.2 28.81Q90.54 28.66 90.76 28.44Q90.97 28.21 90.97 27.92V27.6Q89.79 27.6 89.01 27.68Q88.23 27.76 87.85 27.95Q87.46 28.15 87.46 28.52Q87.46 28.77 87.65 28.89Q87.84 29.02 88.13 29.07Q88.42 29.12 88.72 29.12ZM58.54 29.12Q58.9 29.12 59.29 29.04Q59.67 28.96 60.02 28.81Q60.36 28.66 60.57 28.44Q60.79 28.21 60.79 27.92V27.6Q59.6 27.6 58.83 27.68Q58.05 27.76 57.66 27.95Q57.28 28.15 57.28 28.52Q57.28 28.77 57.46 28.89Q57.65 29.02 57.94 29.07Q58.23 29.12 58.54 29.12ZM104.15 26.77H107.88Q107.88 26.43 107.73 26.18Q107.59 25.94 107.33 25.79Q107.08 25.64 106.74 25.57Q106.41 25.5 106.04 25.5Q105.51 25.5 105.1 25.64Q104.69 25.78 104.44 26.06Q104.2 26.35 104.15 26.77Z',\n },\n ],\n },\n },\n datatech: {\n symbol: {\n viewBox: '0 0 48 52',\n paths: [\n {\n tone: 'ink',\n d: 'M28.82 8.6C37.26 10.74 43.5 18.39 43.5 27.5C43.5 38.27 34.77 47 24 47C13.23 47 4.5 38.27 4.5 27.5C4.5 18.39 10.74 10.74 19.18 8.6C20.03 7.39 20.44 5.49 21 5C21.7 4.35 22.4 4.2 24 4.2C25.6 4.2 26.3 4.35 27 5C27.56 5.49 27.97 7.39 28.82 8.6ZM24 11.3C15.05 11.3 7.8 18.55 7.8 27.5C7.8 36.45 15.05 43.7 24 43.7C32.95 43.7 40.2 36.45 40.2 27.5C40.2 18.55 32.95 11.3 24 11.3ZM24 12.85C30.85 12.85 36.4 18.4 36.4 25.25C36.4 26.97 36.05 28.61 35.42 30.1H33.2C33.97 28.65 34.4 27 34.4 25.25C34.4 19.51 29.74 14.85 24 14.85C18.26 14.85 13.6 19.51 13.6 25.25C13.6 27 14.03 28.65 14.8 30.1H12.58C11.95 28.61 11.6 26.97 11.6 25.25C11.6 18.4 17.15 12.85 24 12.85ZM24 16.1C28.64 16.1 32.4 19.86 32.4 24.5C32.4 26.65 31.59 28.61 30.26 30.1H27.1C29.07 29.01 30.4 26.91 30.4 24.5C30.4 20.97 27.53 18.1 24 18.1C20.47 18.1 17.6 20.97 17.6 24.5C17.6 26.91 18.93 29.01 20.9 30.1H17.74C16.41 28.61 15.6 26.65 15.6 24.5C15.6 19.86 19.36 16.1 24 16.1ZM24 19.15C26.54 19.15 28.6 21.21 28.6 23.75C28.6 26.29 26.54 28.35 24 28.35C21.46 28.35 19.4 26.29 19.4 23.75C19.4 21.21 21.46 19.15 24 19.15ZM24 21.15C22.56 21.15 21.4 22.31 21.4 23.75C21.4 25.19 22.56 26.35 24 26.35C25.44 26.35 26.6 25.19 26.6 23.75C26.6 22.31 25.44 21.15 24 21.15Z',\n },\n {\n tone: 'accent',\n d: 'M8.37 33.4C8.1 32.69 7.88 31.95 7.71 31.2H40.29C40.12 31.95 39.9 32.69 39.63 33.4H8.37Z',\n },\n ],\n },\n horizontal: {\n viewBox: '0 0 119 52',\n paths: [\n {\n tone: 'ink',\n d: 'M28.82 8.6C37.26 10.74 43.5 18.39 43.5 27.5C43.5 38.27 34.77 47 24 47C13.23 47 4.5 38.27 4.5 27.5C4.5 18.39 10.74 10.74 19.18 8.6C20.03 7.39 20.44 5.49 21 5C21.7 4.35 22.4 4.2 24 4.2C25.6 4.2 26.3 4.35 27 5C27.56 5.49 27.97 7.39 28.82 8.6ZM24 11.3C15.05 11.3 7.8 18.55 7.8 27.5C7.8 36.45 15.05 43.7 24 43.7C32.95 43.7 40.2 36.45 40.2 27.5C40.2 18.55 32.95 11.3 24 11.3ZM24 12.85C30.85 12.85 36.4 18.4 36.4 25.25C36.4 26.97 36.05 28.61 35.42 30.1H33.2C33.97 28.65 34.4 27 34.4 25.25C34.4 19.51 29.74 14.85 24 14.85C18.26 14.85 13.6 19.51 13.6 25.25C13.6 27 14.03 28.65 14.8 30.1H12.58C11.95 28.61 11.6 26.97 11.6 25.25C11.6 18.4 17.15 12.85 24 12.85ZM24 16.1C28.64 16.1 32.4 19.86 32.4 24.5C32.4 26.65 31.59 28.61 30.26 30.1H27.1C29.07 29.01 30.4 26.91 30.4 24.5C30.4 20.97 27.53 18.1 24 18.1C20.47 18.1 17.6 20.97 17.6 24.5C17.6 26.91 18.93 29.01 20.9 30.1H17.74C16.41 28.61 15.6 26.65 15.6 24.5C15.6 19.86 19.36 16.1 24 16.1ZM24 19.15C26.54 19.15 28.6 21.21 28.6 23.75C28.6 26.29 26.54 28.35 24 28.35C21.46 28.35 19.4 26.29 19.4 23.75C19.4 21.21 21.46 19.15 24 19.15ZM24 21.15C22.56 21.15 21.4 22.31 21.4 23.75C21.4 25.19 22.56 26.35 24 26.35C25.44 26.35 26.6 25.19 26.6 23.75C26.6 22.31 25.44 21.15 24 21.15Z',\n },\n {\n tone: 'accent',\n d: 'M8.37 33.4C8.1 32.69 7.88 31.95 7.71 31.2H40.29C40.12 31.95 39.9 32.69 39.63 33.4H8.37Z',\n },\n {\n tone: 'ink',\n d: 'M56 30V22.99H59.68Q60.97 22.99 61.89 23.39Q62.81 23.8 63.3 24.58Q63.8 25.36 63.8 26.5Q63.8 27.63 63.3 28.41Q62.81 29.19 61.89 29.6Q60.97 30 59.68 30ZM81.85 30.12Q81.38 30.12 80.98 30.05Q80.57 29.97 80.26 29.79Q79.94 29.61 79.78 29.31Q79.61 29.01 79.61 28.56Q79.61 27.91 79.97 27.54Q80.32 27.17 80.98 27.01Q81.64 26.85 82.51 26.81Q83.38 26.77 84.39 26.77V26.51Q84.39 26.13 84.23 25.91Q84.06 25.68 83.69 25.59Q83.32 25.5 82.71 25.5Q82.22 25.5 81.86 25.57Q81.51 25.64 81.31 25.78Q81.12 25.92 81.12 26.12V26.26H79.84Q79.83 26.21 79.83 26.17Q79.82 26.13 79.82 26.08Q79.82 25.6 80.16 25.24Q80.5 24.89 81.16 24.69Q81.83 24.5 82.83 24.5Q83.76 24.5 84.39 24.67Q85.03 24.85 85.35 25.24Q85.67 25.64 85.67 26.33V28.72Q85.67 28.92 85.75 29.02Q85.82 29.12 86.03 29.12H86.54V29.96Q86.42 30 86.16 30.06Q85.9 30.12 85.61 30.12Q85.18 30.12 84.94 30.01Q84.71 29.89 84.61 29.69Q84.52 29.49 84.48 29.24H84.39Q84.12 29.52 83.72 29.72Q83.31 29.92 82.84 30.02Q82.36 30.12 81.85 30.12ZM68.17 30.12Q67.7 30.12 67.29 30.05Q66.88 29.97 66.57 29.79Q66.26 29.61 66.09 29.31Q65.92 29.01 65.92 28.56Q65.92 27.91 66.28 27.54Q66.63 27.17 67.29 27.01Q67.95 26.85 68.82 26.81Q69.7 26.77 70.71 26.77V26.51Q70.71 26.13 70.54 25.91Q70.37 25.68 70 25.59Q69.63 25.5 69.02 25.5Q68.53 25.5 68.18 25.57Q67.82 25.64 67.62 25.78Q67.43 25.92 67.43 26.12V26.26H66.16Q66.14 26.21 66.14 26.17Q66.13 26.13 66.13 26.08Q66.13 25.6 66.47 25.24Q66.81 24.89 67.48 24.69Q68.14 24.5 69.14 24.5Q70.07 24.5 70.71 24.67Q71.34 24.85 71.66 25.24Q71.98 25.64 71.98 26.33V28.72Q71.98 28.92 72.06 29.02Q72.13 29.12 72.34 29.12H72.85V29.96Q72.74 30 72.48 30.06Q72.22 30.12 71.92 30.12Q71.49 30.12 71.26 30.01Q71.02 29.89 70.93 29.69Q70.83 29.49 70.79 29.24H70.71Q70.43 29.52 70.03 29.72Q69.62 29.92 69.15 30.02Q68.68 30.12 68.17 30.12ZM96.6 30.12Q95.58 30.12 94.85 29.82Q94.11 29.52 93.71 28.9Q93.32 28.28 93.32 27.32Q93.32 26.38 93.7 25.75Q94.09 25.12 94.82 24.81Q95.55 24.5 96.56 24.5Q97.61 24.5 98.33 24.82Q99.04 25.13 99.39 25.72Q99.74 26.32 99.74 27.14V27.63H94.66Q94.69 28.18 94.94 28.51Q95.19 28.84 95.63 28.98Q96.07 29.12 96.64 29.12Q96.93 29.12 97.22 29.06Q97.52 28.99 97.78 28.87Q98.04 28.74 98.21 28.57Q98.38 28.39 98.41 28.15H99.7Q99.7 28.54 99.51 28.9Q99.31 29.26 98.91 29.53Q98.52 29.81 97.94 29.96Q97.36 30.12 96.6 30.12ZM57.42 28.82H59.62Q60.2 28.82 60.7 28.68Q61.19 28.55 61.56 28.28Q61.93 28 62.13 27.59Q62.34 27.17 62.34 26.61V26.38Q62.34 25.82 62.13 25.4Q61.93 24.99 61.56 24.72Q61.19 24.45 60.7 24.31Q60.2 24.17 59.62 24.17H57.42ZM110.12 30V22.61H111.39V25.4H111.46Q111.75 25.04 112.11 24.85Q112.47 24.65 112.87 24.58Q113.26 24.5 113.63 24.5Q114.37 24.5 114.87 24.73Q115.37 24.96 115.62 25.43Q115.87 25.9 115.87 26.64V30H114.6V26.87Q114.6 26.49 114.49 26.24Q114.39 25.99 114.21 25.84Q114.02 25.69 113.76 25.64Q113.5 25.58 113.19 25.58Q112.73 25.58 112.32 25.77Q111.91 25.96 111.65 26.3Q111.39 26.64 111.39 27.11V30ZM104.94 30.12Q103.91 30.12 103.19 29.81Q102.47 29.5 102.09 28.87Q101.72 28.24 101.72 27.31Q101.72 26.37 102.09 25.74Q102.47 25.12 103.19 24.81Q103.91 24.5 104.94 24.5Q105.57 24.5 106.12 24.64Q106.67 24.78 107.07 25.06Q107.48 25.34 107.71 25.74Q107.94 26.15 107.94 26.69H106.66Q106.66 26.3 106.42 26.03Q106.18 25.77 105.79 25.63Q105.4 25.5 104.94 25.5Q104.36 25.5 103.94 25.69Q103.51 25.88 103.28 26.26Q103.04 26.63 103.04 27.2V27.41Q103.04 27.98 103.28 28.36Q103.51 28.73 103.95 28.93Q104.39 29.12 104.99 29.12Q105.43 29.12 105.82 28.98Q106.21 28.84 106.45 28.57Q106.7 28.3 106.7 27.92H107.94Q107.94 28.47 107.71 28.88Q107.47 29.3 107.07 29.57Q106.67 29.85 106.12 29.98Q105.57 30.12 104.94 30.12ZM90.26 30.12Q89.71 30.12 89.37 29.97Q89.02 29.82 88.86 29.45Q88.7 29.09 88.7 28.48V25.62H87.68V24.62H88.73L89 23.06H89.98V24.62H91.43V25.62H89.98V28.36Q89.98 28.73 90.11 28.93Q90.24 29.12 90.71 29.12H91.43V29.95Q91.28 30 91.07 30.04Q90.87 30.08 90.65 30.1Q90.43 30.12 90.26 30.12ZM76.58 30.12Q76.02 30.12 75.68 29.97Q75.33 29.82 75.17 29.45Q75.01 29.09 75.01 28.48V25.62H73.99V24.62H75.04L75.31 23.06H76.29V24.62H77.74V25.62H76.29V28.36Q76.29 28.73 76.42 28.93Q76.56 29.12 77.02 29.12H77.74V29.95Q77.6 30 77.39 30.04Q77.18 30.08 76.96 30.1Q76.74 30.12 76.58 30.12ZM68.46 29.12Q68.82 29.12 69.21 29.04Q69.59 28.96 69.94 28.81Q70.28 28.66 70.49 28.44Q70.71 28.21 70.71 27.92V27.6Q69.52 27.6 68.75 27.68Q67.97 27.76 67.58 27.95Q67.2 28.15 67.2 28.52Q67.2 28.77 67.38 28.89Q67.57 29.02 67.86 29.07Q68.16 29.12 68.46 29.12ZM82.15 29.12Q82.51 29.12 82.89 29.04Q83.28 28.96 83.62 28.81Q83.97 28.66 84.18 28.44Q84.39 28.21 84.39 27.92V27.6Q83.21 27.6 82.43 27.68Q81.66 27.76 81.27 27.95Q80.88 28.15 80.88 28.52Q80.88 28.77 81.07 28.89Q81.26 29.02 81.55 29.07Q81.84 29.12 82.15 29.12ZM94.66 26.77H98.4Q98.4 26.43 98.25 26.18Q98.1 25.94 97.85 25.79Q97.59 25.64 97.26 25.57Q96.93 25.5 96.56 25.5Q96.03 25.5 95.62 25.64Q95.2 25.78 94.96 26.06Q94.71 26.35 94.66 26.77Z',\n },\n ],\n },\n },\n}\n","// Geometry of Tympan's plate: the tympan of an astrolabe for a latitude (default 23°32′ S), in a 400-unit\n// box. Almucantars (circles of equal altitude) are stereographic circles centred on the meridian. The\n// same function draws the home page's hero plate and the Tympan mark, so they stay in sync.\n\nexport interface PlateCircle {\n cy: number\n r: number\n}\n\nexport interface PlateGeometry {\n /** Centre and radius of the plate rim. */\n c: number\n r: number\n /** Radius of the equator circle. */\n equator: number\n /** Almucantar of altitude `deg` (0 = horizon). */\n almucantar: (deg: number) => PlateCircle\n /** y of the zenith. */\n zenith: number\n /** Tick marks on the outer ring every `stepDeg`, `long` every `longEvery` ticks. */\n ticks: (stepDeg: number, longEvery?: number, ring?: number) => Array<{ x1: number; y1: number; x2: number; y2: number; long: boolean }>\n}\n\nexport function plateGeometry(latitudeDeg = -23.53, c = 200, r = 180): PlateGeometry {\n const phi = (latitudeDeg * Math.PI) / 180\n const k = r * Math.tan(Math.PI / 4 - (23.44 * Math.PI) / 180 / 2)\n const almucantar = (deg: number): PlateCircle => {\n const h = (deg * Math.PI) / 180\n const lat = Math.abs(phi)\n const y1 = k * Math.tan((Math.PI / 2 - (lat + (Math.PI / 2 - h))) / 2)\n const y2 = k * Math.tan((Math.PI / 2 - (lat - (Math.PI / 2 - h))) / 2)\n return { cy: c + (-y2 - y1) / 2, r: Math.abs(y1 - y2) / 2 }\n }\n const ticks = (stepDeg: number, longEvery = 6, ring = 12) =>\n Array.from({ length: Math.round(360 / stepDeg) }, (_, i) => {\n const a = (i * stepDeg * Math.PI) / 180\n const long = i % longEvery === 0\n const l = long ? 10 : 5\n return { x1: c + Math.cos(a) * (r + ring), y1: c + Math.sin(a) * (r + ring), x2: c + Math.cos(a) * (r + ring - l), y2: c + Math.sin(a) * (r + ring - l), long }\n })\n return { c, r, equator: k, almucantar, zenith: almucantar(89.9).cy, ticks }\n}\n","import { cx } from '../../internal/cx'\nimport { useId } from 'react'\nimport { PRODUCT_MARKS, type ProductMarkProduct, type ProductMarkVariant } from './marks'\nimport { plateGeometry } from './plate'\n\nexport type { ProductMarkProduct } from './marks'\nexport { plateGeometry, type PlateCircle, type PlateGeometry } from './plate'\n\n/** `symbol` (small sizes), `icon` (48 px and up: the fuller plate) or `horizontal` (symbol and wordmark). */\nexport type ProductMarkVariantName = ProductMarkVariant | 'icon'\n\nconst NAMES: Record<ProductMarkProduct, string> = { tympan: 'Tympan', fakhir: 'Fakhir', astrlabe: 'Astrlabe', datatech: 'Datatech' }\n\nexport interface ProductMarkProps {\n product: ProductMarkProduct\n /** `symbol` (the instrument alone), `icon` (fuller artwork for 48 px and up) or `horizontal` (with the wordmark). */\n variant?: ProductMarkVariantName\n /** Block size in CSS pixels (or any CSS length); the width follows the artwork. Default 32. */\n size?: number | string\n /**\n * Accessible name; defaults to the product name. Pass `decorative` when the product name is already\n * visible next to the mark.\n */\n label?: string\n decorative?: boolean\n className?: string\n}\n\n/**\n * Datatech family product mark. The ink follows `currentColor`, the accent dot `--ty-mark-accent`\n * (gold by default, set per theme), so marks follow every theme in light and dark. Tympan keeps its own\n * plate mark (stroked, no accent).\n */\nconst PLATE = plateGeometry()\n\n/** Tympan's plate mark, drawn from the same geometry as the home page plate (400-unit box at x, y, size). */\nfunction PlateMark({ full, x = 0, y = 0, size = 400 }: { full: boolean; x?: number; y?: number; size?: number }) {\n const clip = `ty-plate-${useId().replace(/[^\\w-]/g, '')}`\n const g = PLATE\n const soft = 'var(--ty-mark-soft, color-mix(in oklab, var(--ty-mark-accent) 45%, transparent))'\n const altitudes = full ? [10, 20, 30, 40, 50, 60, 70, 80] : [20, 40, 60, 80]\n return (\n <g transform={`translate(${x} ${y}) scale(${size / 400})`}>\n <defs>\n <clipPath id={clip}>\n <circle cx={g.c} cy={g.c} r={g.r} />\n </clipPath>\n </defs>\n {full ? <circle cx={g.c} cy={g.c} r={g.r + 12} fill=\"none\" stroke=\"var(--ty-mark-line, color-mix(in oklab, currentColor 45%, transparent))\" strokeWidth={6} /> : null}\n {g.ticks(full ? 15 : 30, full ? 2 : 1).map((t, i) => (\n <line key={i} x1={t.x1} y1={t.y1} x2={t.x2} y2={t.y2} stroke=\"currentColor\" strokeWidth={full ? (t.long ? 10 : 6) : 16} />\n ))}\n {altitudes.map((h) => {\n const a = g.almucantar(h)\n return <circle key={h} cx={g.c} cy={a.cy} r={a.r} fill=\"none\" stroke={soft} strokeWidth={full ? 8 : 16} clipPath={`url(#${clip})`} />\n })}\n {(() => {\n const hz = g.almucantar(0)\n return <circle cx={g.c} cy={hz.cy} r={hz.r} fill=\"none\" stroke=\"var(--ty-mark-accent)\" strokeWidth={full ? 18 : 30} clipPath={`url(#${clip})`} />\n })()}\n <circle cx={g.c} cy={g.c} r={g.r} fill=\"none\" stroke=\"currentColor\" strokeWidth={full ? 16 : 26} />\n <circle cx={g.c} cy={g.zenith} r={full ? 16 : 24} fill=\"var(--ty-mark-accent)\" />\n </g>\n )\n}\n\n/**\n * Datatech family product mark. The ink follows `currentColor`, the accent `--ty-mark-accent` (set per\n * theme), so marks follow every theme in light and dark. Tympan's mark is its astrolabe plate, generated\n * from `plateGeometry` (the home page plate); Fakhir, Astrlabe and Datatech use the \"Instrumento\" artwork.\n */\nexport function ProductMark({ product, variant = 'symbol', size = 32, label, decorative = false, className }: ProductMarkProps) {\n const blockSize = typeof size === 'number' ? `${size}px` : size\n const tympan = product === 'tympan'\n const art = PRODUCT_MARKS[product][variant === 'icon' ? 'symbol' : variant]\n const viewBox = tympan && variant !== 'horizontal' ? '0 0 400 400' : art.viewBox\n return (\n <svg\n className={cx('ty-product-mark', className)}\n data-product={product}\n data-variant={variant}\n viewBox={viewBox}\n style={{ blockSize, inlineSize: 'auto' }}\n role={decorative ? undefined : 'img'}\n aria-label={decorative ? undefined : (label ?? NAMES[product])}\n aria-hidden={decorative || undefined}\n focusable=\"false\"\n >\n {tympan ? variant === 'horizontal' ? <PlateMark full={false} x={4} y={6} size={40} /> : <PlateMark full={variant === 'icon'} /> : null}\n {art.paths.map((p, i) => (\n <path key={i} d={p.d} fill={p.tone === 'accent' ? 'var(--ty-mark-accent)' : 'currentColor'} />\n ))}\n </svg>\n )\n}\n","// MotionFoundation (spec: wave-2/motion-foundation.md; design direction §2.7).\n// The token values mirror the --ty-dur-* and --ty-ease* custom properties of\n// @datatechsolutions/tympan-tokens; a test keeps both in step. There are deliberately no spring\n// and no stagger tokens.\nimport { createContext, useContext, type ReactNode } from 'react'\nimport { prefersReducedMotion as queryReducedMotion } from '../../internal/media'\n\ntype Bezier = readonly [number, number, number, number]\n\nconst MS = { instant: 90, quick: 150, base: 240 } as const\nconst CURVES: { enter: Bezier; exit: Bezier } = { enter: [0.2, 0, 0, 1], exit: [0.4, 0, 1, 1] }\n\nexport type DurationStep = keyof typeof MS\nexport type EaseStep = keyof typeof CURVES\n\nconst bezierCss = (b: Bezier) => `cubic-bezier(${b.join(', ')})`\n\n/** Durations of §2.7 in milliseconds, seconds and as the CSS custom property. */\nexport const duration = {\n ms: MS,\n s: { instant: MS.instant / 1000, quick: MS.quick / 1000, base: MS.base / 1000 },\n cssVar: { instant: 'var(--ty-dur-instant)', quick: 'var(--ty-dur-quick)', base: 'var(--ty-dur-base)' },\n} as const\n\n/** Easing curves of §2.7 as control points, CSS strings and custom properties. */\nexport const ease = {\n points: CURVES,\n css: { enter: bezierCss(CURVES.enter), exit: bezierCss(CURVES.exit) },\n cssVar: { enter: 'var(--ty-ease)', exit: 'var(--ty-ease-out)' },\n} as const\n\n/** Transition description understood by the presets and `resolveTransition`. */\nexport interface MotionTransition {\n durationMs: number\n ease: Bezier\n delayMs?: number\n}\n\n/** A preset: start and end styles limited to opacity and translate. */\nexport interface MotionPreset {\n from: { opacity?: number; translate?: string }\n to: { opacity?: number; translate?: string }\n transition: MotionTransition\n}\n\n/** Safe on the server (returns false). */\nexport function prefersReducedMotion(): boolean {\n try {\n return queryReducedMotion()\n } catch {\n return false\n }\n}\n\n/** Collapses a transition to zero duration (and no delay) under reduced motion. */\nexport function resolveTransition<T extends MotionTransition>(transition: T, reduced: boolean = prefersReducedMotion()): T {\n return reduced ? { ...transition, durationMs: 0, delayMs: 0 } : transition\n}\n\nfunction preset(from: MotionPreset['from'], step: DurationStep, curve: EaseStep = 'enter'): MotionPreset {\n return { from, to: { opacity: 1, translate: from.translate ? '0 0' : undefined }, transition: { durationMs: MS[step], ease: CURVES[curve] } }\n}\n\nconst opacityOnly = (p: MotionPreset): MotionPreset => ({\n from: { opacity: p.from.opacity ?? 1 },\n to: { opacity: p.to.opacity ?? 1 },\n transition: { ...p.transition, durationMs: 0 },\n})\n\nconst fadeIn = preset({ opacity: 0 }, 'quick')\nconst slideFromBottom = preset({ opacity: 0, translate: '0 16px' }, 'base')\nconst slideFromEnd = preset({ opacity: 0, translate: 'var(--ty-motion-end-offset, 16px) 0' }, 'base')\nconst press: MotionPreset = { from: { opacity: 1 }, to: { opacity: 0.85 }, transition: { durationMs: MS.instant, ease: CURVES.enter } }\n\n/** Named presets; each `reduced` twin is opacity-only and instant. */\nexport const motionPresets = {\n fadeIn: { normal: fadeIn, reduced: opacityOnly(fadeIn) },\n slideFromBottom: { normal: slideFromBottom, reduced: opacityOnly(slideFromBottom) },\n slideFromEnd: { normal: slideFromEnd, reduced: opacityOnly(slideFromEnd) },\n press: { normal: press, reduced: { ...press, transition: { ...press.transition, durationMs: 0 } } },\n} as const\n\nexport type MotionPresetName = keyof typeof motionPresets\n\n/** The same preset seen from a right-to-left page: offsets along the inline axis change sign. */\nfunction mirrorInline(p: MotionPreset): MotionPreset {\n const flip = (t?: string) => {\n if (!t) return t\n const [inline, ...rest] = t.trim().split(/\\s+(?![^(]*\\))/)\n return inline === '0' ? t : [`calc(-1 * ${inline})`, ...rest].join(' ')\n }\n return { ...p, from: { ...p.from, translate: flip(p.from.translate) }, to: { ...p.to, translate: flip(p.to.translate) } }\n}\n\n/**\n * Picks the preset variant for the current (or given) reduced-motion state and\n * reading direction: `slideFromEnd` slides in from the inline end in both\n * left-to-right and right-to-left pages.\n */\nexport function getPreset(name: MotionPresetName, reduced: boolean = prefersReducedMotion(), direction: 'ltr' | 'rtl' = 'ltr'): MotionPreset {\n const entry = motionPresets[name]\n const chosen = reduced ? entry.reduced : entry.normal\n return direction === 'rtl' ? mirrorInline(chosen) : chosen\n}\n\n/* The decorativeMotion switch (wave 4): off unless a host opts in. */\nconst DecorativeMotionContext = createContext(false)\n\n/** Library default of the `decorativeMotion` flag. */\nexport const DECORATIVE_MOTION_DEFAULT = false\n\n/** Opts a subtree in (or out) of decorative motion such as CascadeGrid. */\nexport function DecorativeMotion({ enabled, children }: { enabled: boolean; children: ReactNode }) {\n return <DecorativeMotionContext.Provider value={enabled}>{children}</DecorativeMotionContext.Provider>\n}\n\nexport function useDecorativeMotion(): boolean {\n return useContext(DecorativeMotionContext)\n}\n","// Haptics (spec: wave-2/haptics.md). Named vibration patterns through the\n// Vibration API; silent (returns false) wherever it is missing.\nimport { useCallback, useContext, useMemo, type ReactNode } from 'react'\nimport { gatedVibrate, HapticsEnabledContext } from '../../internal/haptics'\nimport { prefersReducedMotion } from '../../internal/media'\n\nexport type HapticPattern = 'tap' | 'impact' | 'heavy' | 'success' | 'warning' | 'error' | 'selection'\n\n/** Durations in ms (vibrate, pause, vibrate …). All well under half a second. */\nconst TABLE: Record<HapticPattern, number | number[]> = {\n selection: 5,\n tap: 8,\n impact: 14,\n heavy: 24,\n success: [10, 40, 10],\n warning: [18, 60, 18],\n error: [24, 50, 24, 50, 24],\n}\n\n/** Patterns still played under reduced motion: they confirm an outcome. */\nconst OUTCOMES = new Set<HapticPattern>(['success', 'warning', 'error'])\n\ntype Vibrate = (pattern: number | number[]) => boolean\n\nfunction vibrator(): Vibrate | null {\n if (typeof navigator === 'undefined') return null\n const fn = (navigator as Navigator & { vibrate?: Vibrate }).vibrate\n return typeof fn === 'function' ? (p) => (fn as (p: number | number[]) => boolean).call(navigator, p) : null\n}\n\n/** True when the platform exposes the Vibration API. */\nexport function hapticsSupported(): boolean {\n return vibrator() !== null\n}\n\n/**\n * Plays a named pattern. Call it from a user gesture; never throws.\n * `enabled: false` (the person's app preference) makes it a no-op.\n */\nexport function playHaptic(pattern: HapticPattern = 'tap', options: { enabled?: boolean } = {}): boolean {\n if (options.enabled === false) return false\n // Nothing vibrates before the page has had a user gesture.\n const run = gatedVibrate()\n if (!run) return false\n if (prefersReducedMotion() && !OUTCOMES.has(pattern)) return false\n try {\n return run(TABLE[pattern]) !== false\n } catch {\n return false\n }\n}\n\n/** Stops a running vibration. */\nexport function cancelHaptic(): void {\n try {\n gatedVibrate()?.(0)\n } catch {\n /* ignore */\n }\n}\n\n/** Host switch: pass the person's \"haptics\" preference. */\nexport function HapticsPreference({ enabled, children }: { enabled: boolean; children: ReactNode }) {\n return <HapticsEnabledContext.Provider value={enabled}>{children}</HapticsEnabledContext.Provider>\n}\n\nexport interface HapticsApi {\n play: (pattern?: HapticPattern) => boolean\n cancel: () => void\n isSupported: boolean\n}\n\n/** Hook form: honours the nearest `HapticsPreference` (or an explicit `enabled`). */\nexport function useHaptics(enabled?: boolean): HapticsApi {\n const fromHost = useContext(HapticsEnabledContext)\n const on = enabled ?? fromHost\n const play = useCallback((pattern?: HapticPattern) => playHaptic(pattern, { enabled: on }), [on])\n return useMemo(() => ({ play, cancel: cancelHaptic, isSupported: hapticsSupported() }), [play])\n}\n","// Animated change (spec: wave-2/view-transition.md; names renamed in\n// implementation, see the spec's note).\n//\n// `animateChange` hands a state or route change to the browser's native view\n// transition when that is available, allowed by the person's motion setting\n// and not refused by the caller; otherwise it applies the change at once.\n// During a native run <html> carries `data-ty-change-style=\"<style>\"`.\nimport { useMemo, useRef } from 'react'\nimport { prefersReducedMotion } from '../../internal/media'\n\nexport type ChangeStyle = 'fade' | 'slide'\n\nexport interface AnimateOptions {\n style?: ChangeStyle\n /** Apply at once, without animation. */\n instant?: boolean\n}\n\nexport interface ChangeRun {\n /** Settles when the change (and any animation) is over. */\n done: Promise<void>\n /** Ends the animation early; the change itself still applies. */\n cancel: () => void\n}\n\nexport const CHANGE_STYLE_ATTRIBUTE = 'data-ty-change-style'\n\ntype Change = () => void | Promise<void>\ntype NativeRun = { finished: PromiseLike<unknown>; skipTransition(): void }\ntype Starter = (this: Document, change: Change) => NativeRun\n\nfunction nativeStarter(): Starter | null {\n if (typeof document === 'undefined') return null\n const candidate = (document as unknown as { startViewTransition?: unknown }).startViewTransition\n return typeof candidate === 'function' ? (candidate as Starter) : null\n}\n\n/** True where the browser offers native view transitions (false on the server). */\nexport function canAnimateChanges(): boolean {\n return nativeStarter() !== null\n}\n\nasync function applyNow(change: Change): Promise<void> {\n await change()\n}\n\nconst withoutAnimation = (change: Change): ChangeRun => {\n let done: Promise<void>\n try {\n const outcome = change()\n done = outcome instanceof Promise ? outcome.then(() => undefined) : Promise.resolve()\n } catch (reason) {\n done = Promise.reject(reason)\n }\n return { done, cancel: () => undefined }\n}\n\n/** Runs `change` inside a native view transition when allowed, else at once. */\nexport function animateChange(change: Change, options: AnimateOptions = {}): ChangeRun {\n const start = nativeStarter()\n if (!start || options.instant || prefersReducedMotion()) return withoutAnimation(change)\n\n const root = document.documentElement\n root.setAttribute(CHANGE_STYLE_ATTRIBUTE, options.style ?? 'fade')\n const clear = () => root.removeAttribute(CHANGE_STYLE_ATTRIBUTE)\n\n let native: NativeRun\n try {\n native = start.call(document, () => applyNow(change))\n } catch {\n clear()\n return withoutAnimation(change)\n }\n // Finished, failed or cut short: the flagged period ends either way.\n const done = Promise.resolve(native.finished).then(clear, clear)\n return {\n done,\n cancel() {\n clear()\n native.skipTransition()\n },\n }\n}\n\n/** Hook form: a stable `animateChange` and whether native transitions exist. */\nexport function useAnimatedChange(): { animateChange: typeof animateChange; available: boolean } {\n const fn = useRef(animateChange).current\n const available = canAnimateChanges()\n return useMemo(() => ({ animateChange: fn, available }), [fn, available])\n}\n","// Routing bridge (spec: wave-2/router-adapter.md; names renamed in\n// implementation, see the spec's note).\n//\n// A host plugs its router in once, as a `RouteHost`. Components ask a\n// `Routes` object for the current path, a visit key, an anchor component and\n// the moves (open, swap, back, on, reload, warm). Without a host, a browser\n// implementation answers from `location` and `history`. The host also drives\n// React Aria's RouterProvider, so RAC links and menu items route through it.\nimport {\n createContext,\n forwardRef,\n useContext,\n useMemo,\n type AnchorHTMLAttributes,\n type ForwardRefExoticComponent,\n type ReactNode,\n type RefAttributes,\n} from 'react'\nimport { RouterProvider } from 'react-aria-components'\n\nexport type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & { href: string; children?: ReactNode }\nexport type AnchorComponent = ForwardRefExoticComponent<AnchorProps & RefAttributes<HTMLAnchorElement>>\n\n/** What the host router provides. */\nexport interface RouteHost {\n /** Current path. */\n path: string\n /** Go to `href`; `swap` replaces the current history entry. */\n go: (href: string, how?: { swap?: boolean }) => void\n /** Move through history: -1 back, 1 forward. */\n step: (by: -1 | 1) => void\n /** Warm a route (may do nothing). */\n warm: (href: string) => void\n /** The router's link; must render a real `<a href>`. */\n Anchor: AnchorComponent\n /** Changes on every visit; the path when absent. */\n visit?: string\n}\n\n/** Moves available to components. */\nexport interface RouteMoves {\n open: (href: string) => void\n swap: (href: string) => void\n goBack: () => void\n goOn: () => void\n reload: () => void\n warm: (href: string) => void\n}\n\n/** Plain anchor, used without a host. */\nexport const PlainAnchor: AnchorComponent = forwardRef<HTMLAnchorElement, AnchorProps>(function PlainAnchor(props, ref) {\n return <a ref={ref} {...props} />\n})\n\nabstract class Routes {\n abstract readonly path: string\n abstract readonly visit: string\n abstract readonly Anchor: AnchorComponent\n protected abstract to(href: string, swap: boolean): void\n protected abstract walk(by: -1 | 1): void\n protected abstract again(): void\n protected abstract preload(href: string): void\n\n readonly moves: RouteMoves = {\n open: (href) => this.to(href, false),\n swap: (href) => this.to(href, true),\n goBack: () => this.walk(-1),\n goOn: () => this.walk(1),\n reload: () => this.again(),\n warm: (href) => this.preload(href),\n }\n}\n\nclass BrowserRoutes extends Routes {\n readonly Anchor = PlainAnchor\n get path() {\n return typeof window === 'undefined' ? '/' : window.location.pathname\n }\n get visit() {\n return this.path\n }\n protected to(href: string, swap: boolean) {\n if (typeof window === 'undefined') return\n if (swap) window.location.replace(href)\n else window.location.assign(href)\n }\n protected walk(by: -1 | 1) {\n if (typeof window !== 'undefined') window.history.go(by)\n }\n protected again() {\n if (typeof window !== 'undefined') window.location.reload()\n }\n protected preload() {}\n}\n\nclass HostRoutes extends Routes {\n constructor(private readonly host: RouteHost) {\n super()\n }\n get Anchor() {\n return this.host.Anchor\n }\n get path() {\n return this.host.path\n }\n get visit() {\n return this.host.visit ?? this.host.path\n }\n protected to(href: string, swap: boolean) {\n this.host.go(href, swap ? { swap: true } : undefined)\n }\n protected walk(by: -1 | 1) {\n this.host.step(by)\n }\n // Re-enter the current route through the host.\n protected again() {\n this.host.go(this.host.path, { swap: true })\n }\n protected preload(href: string) {\n this.host.warm(href)\n }\n}\n\nconst HostSlot = createContext<RouteHost | null>(null)\nconst browser = new BrowserRoutes()\n\nexport function RoutingProvider({ host, children }: { host: RouteHost; children: ReactNode }) {\n return (\n <HostSlot.Provider value={host}>\n <RouterProvider navigate={(href, options) => host.go(href, options?.replace ? { swap: true } : undefined)}>{children}</RouterProvider>\n </HostSlot.Provider>\n )\n}\n\n/** The installed host, or null. */\nexport function useRouteHost(): RouteHost | null {\n return useContext(HostSlot)\n}\n\nfunction useRoutes(): Routes {\n const host = useContext(HostSlot)\n return useMemo(() => (host ? new HostRoutes(host) : browser), [host])\n}\n\nexport const useRouting = (): RouteMoves => useRoutes().moves\nexport const useCurrentPath = (): string => useRoutes().path\nexport const useRouteAnchor = (): AnchorComponent => useRoutes().Anchor\n/** Changes on every visit: the host's visit key, else the path. */\nexport const useVisitKey = (): string => useRoutes().visit\n","// I18nAdapter (spec: wave-2/i18n-adapter.md). One context for translated\n// strings, locale and locale-aware formatting, independent of the host's i18n\n// library. It sits next to TympanProvider: the provider also feeds React\n// Aria's I18nProvider, and `useLocale()` falls back to the locale React Aria\n// already knows (for example TympanProvider's `locale`).\nimport { createContext, useContext, useMemo, type ReactNode } from 'react'\nimport { I18nProvider, useLocale as useAriaLocale } from 'react-aria-components'\nimport { formatMessage, substitute, type MessageParams } from './icu'\n\nexport interface TranslateFn {\n (key: string, params?: MessageParams & { _?: string }): string\n /** Structured value stored under `key` (arrays, objects), or undefined. */\n raw: (key: string) => unknown\n}\n\nexport type MessageTree = { [key: string]: string | MessageTree | unknown }\n\nexport interface I18nAdapterValue {\n locale: string\n translate: (namespace?: string) => TranslateFn\n messages?: MessageTree\n}\n\nconst AdapterContext = createContext<I18nAdapterValue | null>(null)\n\nfunction lookup(tree: MessageTree | undefined, path: string): unknown {\n if (!tree) return undefined\n let node: unknown = tree\n for (const segment of path.split('.')) {\n if (node === null || typeof node !== 'object') return undefined\n node = (node as Record<string, unknown>)[segment]\n }\n return node\n}\n\nconst qualify = (namespace: string | undefined, key: string) => (namespace ? `${namespace}.${key}` : key)\n\n/** Builds an adapter value from a nested catalogue and a locale. */\nexport function createI18nValue(messages: MessageTree, locale: string): I18nAdapterValue {\n const bound = new Map<string, TranslateFn>()\n return {\n locale,\n messages,\n translate(namespace) {\n const slot = namespace ?? ''\n let fn = bound.get(slot)\n if (!fn) {\n const t = ((key: string, params: MessageParams & { _?: string } = {}) => {\n const found = lookup(messages, qualify(namespace, key))\n if (typeof found === 'string') return formatMessage(found, params, locale)\n return fallbackText(namespace, key, params)\n }) as TranslateFn\n t.raw = (key) => lookup(messages, qualify(namespace, key))\n fn = t\n bound.set(slot, fn)\n }\n return fn\n },\n }\n}\n\nfunction fallbackText(namespace: string | undefined, key: string, params: MessageParams & { _?: string }): string {\n if (typeof params._ === 'string') return formatMessage(params._, params)\n return substitute(qualify(namespace, key), params)\n}\n\nexport function I18nAdapterProvider({ value, children }: { value: I18nAdapterValue; children: ReactNode }) {\n return (\n <AdapterContext.Provider value={value}>\n <I18nProvider locale={value.locale}>{children}</I18nProvider>\n </AdapterContext.Provider>\n )\n}\n\nconst detached = new Map<string, TranslateFn>()\n\nfunction detachedTranslator(namespace?: string): TranslateFn {\n const slot = namespace ?? ''\n let fn = detached.get(slot)\n if (!fn) {\n const t = ((key: string, params: MessageParams & { _?: string } = {}) => fallbackText(namespace, key, params)) as TranslateFn\n t.raw = () => undefined\n fn = t\n detached.set(slot, fn)\n }\n return fn\n}\n\n/** Namespace-bound translator; identity is stable while inputs are unchanged. */\nexport function useTranslations(namespace?: string): TranslateFn {\n const value = useContext(AdapterContext)\n return useMemo(() => (value ? value.translate(namespace) : detachedTranslator(namespace)), [value, namespace])\n}\n\n/** The BCP 47 locale: the adapter's, else React Aria's (TympanProvider or the browser). */\nexport function useLocale(): string {\n const value = useContext(AdapterContext)\n const aria = useAriaLocale().locale\n return value?.locale ?? aria\n}\n\nexport interface LocaleFormatter {\n dateTime: (value: Date | string | number, options?: Intl.DateTimeFormatOptions) => string\n number: (value: number, options?: Intl.NumberFormatOptions) => string\n /** Picks seconds, minutes, hours or days by magnitude. */\n relativeTime: (value: Date | string | number, now?: Date | number) => string\n}\n\nconst STEPS: Array<[Intl.RelativeTimeFormatUnit, number]> = [\n ['second', 60],\n ['minute', 60],\n ['hour', 24],\n ['day', Number.POSITIVE_INFINITY],\n]\n\nexport function createFormatter(locale: string): LocaleFormatter {\n return {\n dateTime: (value, options = { dateStyle: 'medium', timeStyle: 'short' }) => new Intl.DateTimeFormat(locale, options).format(new Date(value)),\n number: (value, options) => new Intl.NumberFormat(locale, options).format(value),\n relativeTime(value, now = Date.now()) {\n let amount = (new Date(value).getTime() - new Date(now).getTime()) / 1000\n let unit: Intl.RelativeTimeFormatUnit = 'second'\n for (const [name, size] of STEPS) {\n unit = name\n if (Math.abs(amount) < size) break\n amount /= size\n }\n return new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(Math.round(amount), unit)\n },\n }\n}\n\nexport function useFormatter(): LocaleFormatter {\n const locale = useLocale()\n return useMemo(() => createFormatter(locale), [locale])\n}\n","// EntityListLoader (spec: wave-2/entity-list-loader.md).\n//\n// State lives in one reducer. Requests are numbered by a small \"generation\"\n// counter kept outside React; a response only lands when its generation is\n// still the newest and the host component is still mounted.\nimport { useCallback, useEffect, useReducer, useRef, type Dispatch, type SetStateAction } from 'react'\nimport { useVisitKey } from '../router-adapter/Routing'\n\nexport interface ListLoaderOptions<T> {\n initial?: T[]\n /** Refetch trigger; `null` disables automatic fetching. Defaults to the location key. */\n revalidationKey?: string | number | null\n}\n\n/** Output names are fixed by the spec. */\nexport interface ListLoaderResult<T> {\n items: T[]\n loading: boolean\n error: Error | null\n refresh: () => Promise<void>\n setItems: Dispatch<SetStateAction<T[]>>\n}\n\ninterface Snapshot<T> {\n rows: T[]\n busy: boolean\n failure: Error | null\n}\n\ntype Event<T> =\n | { on: 'start' }\n | { on: 'rows'; rows: T[] }\n | { on: 'fail'; failure: Error }\n | { on: 'idle' }\n | { on: 'edit'; next: SetStateAction<T[]> }\n\nfunction step<T>(now: Snapshot<T>, event: Event<T>): Snapshot<T> {\n switch (event.on) {\n case 'start':\n return now.busy ? now : { ...now, busy: true }\n case 'rows':\n return { rows: event.rows, busy: false, failure: null }\n case 'fail':\n return { ...now, busy: false, failure: event.failure }\n case 'idle':\n return now.busy ? { ...now, busy: false } : now\n case 'edit':\n return { ...now, rows: typeof event.next === 'function' ? (event.next as (prev: T[]) => T[])(now.rows) : event.next }\n }\n}\n\nfunction asError(reason: unknown): Error {\n if (reason instanceof Error) return reason\n return new Error(typeof reason === 'string' ? reason : String(reason))\n}\n\n/** Numbered requests: `issue()` opens one, `current(n)` says whether n may still write. */\nfunction generations() {\n let newest = 0\n let mounted = true\n return {\n issue: () => ++newest,\n current: (n: number) => mounted && n === newest,\n detach: () => {\n mounted = false\n },\n attach: () => {\n mounted = true\n },\n }\n}\n\nexport function useEntityListLoader<T>(fetcher: () => Promise<T[] | null | undefined>, options: ListLoaderOptions<T> = {}): ListLoaderResult<T> {\n const routeStamp = useVisitKey()\n const trigger = options.revalidationKey === undefined ? routeStamp : options.revalidationKey\n const [snap, send] = useReducer(step<T>, undefined, () => ({ rows: options.initial ?? [], busy: trigger !== null, failure: null }))\n\n // The newest fetcher is read at call time, so inline functions never loop.\n const source = useRef(fetcher)\n source.current = fetcher\n const gen = useRef(generations()).current\n\n const refresh = useCallback(async () => {\n const mine = gen.issue()\n send({ on: 'start' })\n let outcome: Event<T>\n try {\n outcome = { on: 'rows', rows: (await source.current()) ?? [] }\n } catch (reason) {\n outcome = { on: 'fail', failure: asError(reason) }\n }\n if (gen.current(mine)) send(outcome)\n }, [gen])\n\n useEffect(() => {\n gen.attach()\n return gen.detach\n }, [gen])\n\n useEffect(() => {\n if (trigger === null) send({ on: 'idle' })\n else void refresh()\n }, [trigger, refresh])\n\n const setItems = useCallback<Dispatch<SetStateAction<T[]>>>((next) => send({ on: 'edit', next }), [])\n return { items: snap.rows, loading: snap.busy, error: snap.failure, refresh, setItems }\n}\n","// Formatters (spec: wave-2/formatters.md). Locale-aware money, percent, date\n// and address formatting; missing or invalid input yields a placeholder word\n// (never a dash, §2.13). Currency presentation always comes from Intl for the\n// locale; nothing about symbols or separators is stored.\nimport { useMemo } from 'react'\nimport { useMessages } from '../../internal/provider'\nimport { useLocale } from '../i18n-adapter/I18nAdapter'\n\n/** English default; hosts pass their own or use `useFormatters()` for the catalogue word. */\nexport const DEFAULT_PLACEHOLDER = 'not informed'\n\ntype Missing = null | undefined\nconst isMissingNumber = (v: number | Missing): v is Missing => v === null || v === undefined || !Number.isFinite(v)\n\nexport interface FormatOptions {\n placeholder?: string\n}\n\nexport function formatMoney(value: number | Missing, currency: string, locale = 'en-US', options: FormatOptions = {}): string {\n if (isMissingNumber(value)) return options.placeholder ?? DEFAULT_PLACEHOLDER\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)\n } catch {\n return options.placeholder ?? DEFAULT_PLACEHOLDER\n }\n}\n\n/** Input in percentage points: 12.5 means 12.5 %. */\nexport function formatPercent(\n value: number | Missing,\n locale = 'en-US',\n options: FormatOptions & { fractionDigits?: number; showSign?: boolean } = {},\n): string {\n if (isMissingNumber(value)) return options.placeholder ?? DEFAULT_PLACEHOLDER\n const digits = options.fractionDigits ?? 2\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n signDisplay: options.showSign === false ? 'auto' : 'exceptZero',\n }).format(value / 100)\n}\n\nexport type DateInput = string | Date | { value: string } | Missing\n\nfunction toDate(input: DateInput): Date | null {\n if (input === null || input === undefined) return null\n const raw = input instanceof Date ? input : typeof input === 'object' ? input.value : input\n const date = raw instanceof Date ? raw : new Date(raw)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\nexport function formatDateTime(input: DateInput, options: FormatOptions & { locale?: string; withTimeZone?: boolean; timeZone?: string } = {}): string {\n const date = toDate(input)\n if (!date) return options.placeholder ?? DEFAULT_PLACEHOLDER\n const parts: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n ...(options.withTimeZone ? { timeZoneName: 'short' as const } : {}),\n ...(options.timeZone ? { timeZone: options.timeZone } : {}),\n }\n return new Intl.DateTimeFormat(options.locale ?? 'en-US', parts).format(date)\n}\n\n/* Country registry (records are specified in wave-4/country-profile-data.md). */\n\nexport interface CountryConfig {\n /** ISO 3166-1 alpha-2. */\n code: string\n names?: { en: string; local: string }\n locale: { default: string; dateStyle?: string }\n /** ISO 4217 code only; presentation derives from the locale. */\n currency: { code: string }\n /**\n * Address template: one entry per line, each either a string with `{field}`\n * placeholders and literal separators (\"{street}, {number}\") or an array of\n * field keys joined with \", \".\n */\n address?: { template: Array<string | string[]>; required?: string[]; postalCodePattern?: string }\n languages?: Array<{ tag: string; name: string; official: boolean }>\n tax?: { consumptionTaxName?: string; businessIdName?: string; personalIdName?: string }\n [extra: string]: unknown\n}\n\nconst registry = new Map<string, CountryConfig>()\n\nexport function registerCountry(config: CountryConfig): void {\n if (!/^[A-Z]{2}$/.test(config.code ?? '')) throw new TypeError('registerCountry: \"code\" must be an ISO 3166-1 alpha-2 code.')\n if (!config.locale?.default) throw new TypeError(`registerCountry(${config.code}): \"locale.default\" is required.`)\n if (!/^[A-Z]{3}$/.test(config.currency?.code ?? '')) throw new TypeError(`registerCountry(${config.code}): \"currency.code\" must be ISO 4217.`)\n registry.set(config.code, config)\n}\n\nexport function getCountry(code: string): CountryConfig | undefined {\n return registry.get(code.toUpperCase())\n}\n\nexport function listCountries(): CountryConfig[] {\n return [...registry.values()]\n}\n\n/** Test helper: forget registered countries. */\nexport function resetCountries(): void {\n registry.clear()\n}\n\ntype AddressFields = Record<string, string | null | undefined>\n\nconst filled = (v: string | null | undefined) => typeof v === 'string' && v.trim() !== ''\n\nfunction renderLine(line: string | string[], fields: AddressFields): string {\n if (Array.isArray(line)) return line.map((k) => fields[k]).filter(filled).join(', ')\n // Split into literal/placeholder tokens, drop empty placeholders together\n // with the separator that would dangle next to them.\n const tokens = line.split(/(\\{\\w+\\})/).filter((t) => t !== '')\n const values = tokens.map((t) => {\n const m = /^\\{(\\w+)\\}$/.exec(t)\n return m ? { field: true, text: fields[m[1]!] ?? '' } : { field: false, text: t }\n })\n let out = ''\n let pendingSep = ''\n let seenValue = false\n let skipped = false\n for (const v of values) {\n if (!v.field) {\n // After an empty field, the separator already pending stands for both.\n if (!(skipped && pendingSep)) pendingSep += v.text\n continue\n }\n if (!filled(v.text)) {\n skipped = true\n continue\n }\n skipped = false\n out += (seenValue ? pendingSep : pendingSep.trimStart().replace(/^[,\\-–/;·]+\\s*/, '')) + v.text\n pendingSep = ''\n seenValue = true\n }\n return out.trim()\n}\n\n/** Fills the country's template; unknown countries join non-empty fields with commas. */\nexport function formatAddress(fields: AddressFields, countryCode: string, locale?: string): string {\n const template = getCountry(countryCode)?.address?.template\n // Unknown country: the filled parts in the given order, joined with the locale's list separator.\n if (!template) {\n const parts = Object.values(fields).filter(filled).map((v) => v!.trim())\n return locale ? new Intl.ListFormat(locale, { type: 'unit', style: 'short' }).format(parts) : parts.join(', ')\n }\n return template\n .map((line) => renderLine(line, fields))\n .filter((l) => l !== '')\n .join('\\n')\n}\n\nexport type StatusTone = 'positive' | 'pending' | 'negative' | 'neutral'\n\nconst TONE_WORDS: Record<Exclude<StatusTone, 'neutral'>, string[]> = {\n positive: ['approved', 'active', 'success', 'succeeded', 'completed', 'done', 'proved', 'published', 'verified', 'ok'],\n pending: ['pending', 'processing', 'running', 'queued', 'waiting', 'draft', 'in_review', 'review', 'scheduled'],\n negative: ['rejected', 'error', 'failed', 'failure', 'refuted', 'blocked', 'expired', 'invalid'],\n}\n\n/** Semantic tone for a status word; never a style class. */\nexport function toneForStatus(status: string | null | undefined): StatusTone {\n const s = (status ?? '').trim().toLowerCase().replace(/[\\s-]+/g, '_')\n for (const tone of ['positive', 'pending', 'negative'] as const) if (TONE_WORDS[tone].includes(s)) return tone\n return 'neutral'\n}\n\n/** Formatters bound to the adapter locale and the catalogue placeholder. */\nexport function useFormatters() {\n const locale = useLocale()\n const placeholder = useMessages().formatters.placeholder\n return useMemo(\n () => ({\n locale,\n placeholder,\n money: (value: number | Missing, currency: string) => formatMoney(value, currency, locale, { placeholder }),\n percent: (value: number | Missing, fractionDigits?: number) => formatPercent(value, locale, { placeholder, fractionDigits }),\n dateTime: (input: DateInput, withTimeZone?: boolean) => formatDateTime(input, { locale, withTimeZone, placeholder }),\n address: (fields: AddressFields, countryCode: string) => formatAddress(fields, countryCode, locale),\n toneForStatus,\n }),\n [locale, placeholder],\n )\n}\n","// ApiErrorModel (spec: wave-2/api-error-model.md): one error shape for API\n// failures, an RFC 9457 problem variant, and the run-domain types consumed by\n// live-run components. The run vocabulary is the library's; the functions at\n// the end translate the run enums of the host's OpenAPI workflows contract into\n// it (a test reads that contract, when present, so both stay in step).\n\nexport interface SerializedApiError {\n message: string\n code: string\n status: number\n}\n\nexport class ApiError extends Error {\n readonly status: number\n readonly code: string\n constructor(message: string, init: { status?: number; code?: string; cause?: unknown } = {}) {\n super(message, init.cause === undefined ? undefined : { cause: init.cause })\n this.name = 'ApiError'\n this.status = init.status ?? 500\n this.code = init.code ?? 'unknown'\n }\n toJSON(): SerializedApiError {\n return { message: this.message, code: this.code, status: this.status }\n }\n}\n\n/** A non-2xx HTTP response. */\nexport class HttpResponseError extends ApiError {\n static readonly CODE = 'http_response'\n constructor(message: string, status = 500) {\n super(message, { status, code: HttpResponseError.CODE })\n this.name = 'HttpResponseError'\n }\n}\n\nexport interface ProblemDocument {\n type?: string\n title?: string\n status?: number\n detail?: string\n instance?: string\n [extension: string]: unknown\n}\n\n/** An `application/problem+json` answer (RFC 9457); `type` is shown to people in meta (§2.12). */\nexport class ProblemError extends ApiError {\n readonly type: string\n readonly title: string\n readonly detail?: string\n readonly problem: ProblemDocument\n constructor(problem: ProblemDocument, fallbackStatus = 500) {\n const status = typeof problem.status === 'number' ? problem.status : fallbackStatus\n const type = problem.type ?? 'about:blank'\n super(problem.detail ?? problem.title ?? type, { status, code: type })\n this.name = 'ProblemError'\n this.type = type\n this.title = problem.title ?? ''\n this.detail = problem.detail\n this.problem = problem\n }\n override toJSON(): SerializedApiError & { type: string; title: string; detail?: string } {\n return { ...super.toJSON(), type: this.type, title: this.title, detail: this.detail }\n }\n}\n\nexport function isApiError(value: unknown): value is ApiError {\n return value instanceof ApiError\n}\n\n/** HTTP status of any thrown value; 500 when it has none. */\nexport function statusOf(value: unknown): number {\n if (isApiError(value)) return value.status\n const s = (value as { status?: unknown } | null)?.status\n return typeof s === 'number' && s >= 100 && s <= 599 ? s : 500\n}\n\n/** Machine code of any thrown value; \"unknown\" when it has none. */\nexport function codeOf(value: unknown): string {\n if (isApiError(value)) return value.code\n const c = (value as { code?: unknown } | null)?.code\n return typeof c === 'string' && c ? c : 'unknown'\n}\n\n/* ---- Run domain ---- */\n\nexport type NodeStatus = 'pending' | 'running' | 'success' | 'error' | 'skipped'\nexport type RunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled'\nexport type VariableValue = string | number | boolean | null | VariableValue[] | { [key: string]: VariableValue }\n\nexport const KNOWN_RUN_EVENT_TYPES = [\n 'run.started',\n 'node.started',\n 'node.completed',\n 'node.error',\n 'node.skipped',\n 'node.restored',\n 'node.retry',\n 'run.paused',\n 'run.completed',\n 'run.failed',\n 'model.generation',\n 'tool.execution',\n 'agent.stream',\n 'ui.render',\n] as const\nexport type KnownRunEventType = (typeof KNOWN_RUN_EVENT_TYPES)[number]\n\nexport interface ExecutionEvent {\n /** Open-ended: consumers ignore kinds they do not know. */\n type: KnownRunEventType | (string & {})\n runId: string\n nodeId?: string\n nodeType?: string\n status?: NodeStatus | RunStatus\n outputs?: Record<string, VariableValue>\n error?: string\n durationMs?: number\n timestamp: string\n}\n\nconst known = new Set<string>(KNOWN_RUN_EVENT_TYPES)\n\nexport function isKnownRunEvent(event: ExecutionEvent): event is ExecutionEvent & { type: KnownRunEventType } {\n return known.has(event.type)\n}\n\nexport type RunEventHandlers = Partial<Record<KnownRunEventType, (event: ExecutionEvent) => void>>\n\n/** Dispatches known events to handlers; unknown kinds return false and are skipped. */\nexport function createRunEventConsumer(handlers: RunEventHandlers): (event: ExecutionEvent) => boolean {\n return (event) => {\n if (!isKnownRunEvent(event)) return false\n handlers[event.type]?.(event)\n return true\n }\n}\n\n/* ---- Contract translation ---- */\n\nconst RUN_STATUS_FROM_CONTRACT: Record<string, RunStatus> = {\n queued: 'pending',\n running: 'running',\n waiting: 'running',\n succeeded: 'completed',\n failed: 'failed',\n cancelled: 'cancelled',\n}\n\nconst NODE_STATUS_FROM_CONTRACT: Record<string, NodeStatus> = {\n pending: 'pending',\n running: 'running',\n waiting: 'running',\n succeeded: 'success',\n failed: 'error',\n skipped: 'skipped',\n cancelled: 'skipped',\n}\n\nconst EVENT_FROM_CONTRACT: Record<string, string> = {\n 'step.started': 'node.started',\n 'step.succeeded': 'node.completed',\n 'step.failed': 'node.error',\n 'step.waiting': 'run.paused',\n // Logs and outputs have no library kind; they pass through as unknown.\n 'step.log': 'step.log',\n 'run.output': 'run.output',\n}\n\n/** Contract `RunStatus` → library run status (unknown values read as pending). */\nexport function runStatusFromContract(status: string): RunStatus {\n return RUN_STATUS_FROM_CONTRACT[status] ?? 'pending'\n}\n\n/** Contract `StepStatus` → library node status. */\nexport function nodeStatusFromContract(status: string): NodeStatus {\n return NODE_STATUS_FROM_CONTRACT[status] ?? 'pending'\n}\n\n/** Contract SSE event name (and run status for `run.status`) → library event type. */\nexport function eventTypeFromContract(event: string, runStatus?: string): string {\n if (event === 'run.status') {\n const s = runStatus ? runStatusFromContract(runStatus) : 'running'\n return s === 'completed' ? 'run.completed' : s === 'failed' ? 'run.failed' : runStatus === 'waiting' ? 'run.paused' : 'run.started'\n }\n return EVENT_FROM_CONTRACT[event] ?? event\n}\n\nexport const CONTRACT_MAPPINGS = {\n runStatus: RUN_STATUS_FROM_CONTRACT,\n stepStatus: NODE_STATUS_FROM_CONTRACT,\n events: EVENT_FROM_CONTRACT,\n} as const\n","// Small touch tracker shared by the gesture components (SwipeRow,\n// PullToRefresh, EdgeSwipeBack). It records where a single-finger touch\n// began, locks it to one axis after a short slop, and reports deltas. Touch\n// events only: gestures are enhancements for touch screens (WCAG 2.5.1), each\n// component keeps a pointer- and keyboard-operable path of its own.\n\nexport type Axis = 'x' | 'y'\n\nexport interface TouchSample {\n clientX: number\n clientY: number\n}\n\nexport interface Track {\n x0: number\n y0: number\n dx: number\n dy: number\n /** Null until the finger moved past the slop. */\n axis: Axis | null\n}\n\n/** Distance (CSS px) a finger must travel before the axis is decided. */\nexport const AXIS_SLOP = 8\n\nexport function firstTouch(list: { length: number; [index: number]: TouchSample } | undefined | null): TouchSample | null {\n return list && list.length > 0 ? list[0]! : null\n}\n\nexport function beginTrack(t: TouchSample): Track {\n return { x0: t.clientX, y0: t.clientY, dx: 0, dy: 0, axis: null }\n}\n\n/** Updates deltas; decides the axis once, favouring vertical on ties (scrolling wins). */\nexport function advanceTrack(track: Track, t: TouchSample): Track {\n const dx = t.clientX - track.x0\n const dy = t.clientY - track.y0\n let axis = track.axis\n if (!axis && Math.hypot(dx, dy) >= AXIS_SLOP) axis = Math.abs(dx) > Math.abs(dy) ? 'x' : 'y'\n return { ...track, dx, dy, axis }\n}\n\n/** Diminishing resistance: 1:1 up to `soft`, then easing towards `cap`. */\nexport function resist(distance: number, soft: number, cap: number): number {\n if (distance <= soft) return Math.max(0, distance)\n const extra = distance - soft\n const room = Math.max(1, cap - soft)\n return soft + room * (1 - Math.exp(-extra / room))\n}\n","// SwipeRow (spec: wave-2/swipe-row.md). A row whose actions are revealed by a\n// horizontal swipe on touch screens, and always reachable from an actions\n// menu button (WCAG 2.5.1: the gesture is only a shortcut).\nimport { Archive, Ellipsis, Pencil, Star, Trash2 } from 'lucide-react'\nimport { useMemo, useRef, useState, type KeyboardEvent, type ReactNode, type TouchEvent } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { inertProps } from '../../internal/inert'\nimport { useReducedMotion } from '../../internal/media'\nimport { beginTrack, advanceTrack, firstTouch, type Track } from '../../internal/platform/touchTrack'\nimport { useMessages } from '../../internal/provider'\nimport { playHaptic } from '../../utilities/haptics/haptics'\nimport { ActionMenu, type ActionMenuItem } from '../action-menu/ActionMenu'\nimport { Button } from '../button/Button'\n\nexport type SwipeTone = 'neutral' | 'danger' | 'pending' | 'positive'\nexport type SwipeSide = 'none' | 'leading' | 'trailing'\n\nexport interface SwipeAction {\n label: string\n icon?: ReactNode\n tone: SwipeTone\n onAction: () => void\n /** The host offers undo, so a destructive full swipe needs no confirmation. */\n undoable?: boolean\n}\n\nexport interface SwipeRowProps {\n children: ReactNode\n /** Name of the row, used in the actions button name (\"Actions for …\"). */\n label: string\n leadingActions?: SwipeAction[]\n trailingActions?: SwipeAction[]\n fullSwipe?: boolean\n /** Fraction of the row width past which the first action of a side fires. */\n fullSwipeFraction?: number\n /** Fraction of the row width the revealed actions occupy. */\n revealFraction?: number\n onRevealChange?: (side: SwipeSide) => void\n /**\n * Asked before a destructive full swipe fires (for example ConfirmService's\n * confirm). Without it, and without `undoable`, a destructive full swipe\n * only reveals the actions.\n */\n confirm?: (action: SwipeAction) => boolean | Promise<boolean>\n className?: string\n}\n\n/** Localised preset actions: delete (danger), archive (pending), edit and favourite (neutral). */\nexport function useSwipeActionPresets() {\n const w = useMessages().swipeRow\n return useMemo(\n () => ({\n delete: (onAction: () => void, extra: Partial<SwipeAction> = {}): SwipeAction => ({ label: w.delete, icon: <Trash2 />, tone: 'danger', onAction, ...extra }),\n archive: (onAction: () => void, extra: Partial<SwipeAction> = {}): SwipeAction => ({ label: w.archive, icon: <Archive />, tone: 'pending', onAction, ...extra }),\n edit: (onAction: () => void, extra: Partial<SwipeAction> = {}): SwipeAction => ({ label: w.edit, icon: <Pencil />, tone: 'neutral', onAction, ...extra }),\n favourite: (onAction: () => void, extra: Partial<SwipeAction> = {}): SwipeAction => ({ label: w.favourite, icon: <Star />, tone: 'neutral', onAction, ...extra }),\n }),\n [w],\n )\n}\n\nfunction ActionStrip({ side, actions, open, onPick }: { side: 'leading' | 'trailing'; actions: SwipeAction[]; open: boolean; onPick: (a: SwipeAction) => void }) {\n if (actions.length === 0) return null\n return (\n <div className=\"ty-swipe-row__actions\" data-side={side} aria-hidden={!open || undefined} {...inertProps(!open)}>\n {actions.map((action) => (\n <button key={action.label} type=\"button\" className=\"ty-swipe-row__action\" data-tone={action.tone} tabIndex={open ? undefined : -1} onClick={() => onPick(action)}>\n {action.icon ? (\n <span className=\"ty-swipe-row__action-icon\" aria-hidden=\"true\">\n {action.icon}\n </span>\n ) : null}\n <span className=\"ty-swipe-row__action-word\">{action.label}</span>\n </button>\n ))}\n </div>\n )\n}\n\nexport function SwipeRow(props: SwipeRowProps) {\n const { leadingActions = [], trailingActions = [], fullSwipe = true, fullSwipeFraction = 0.6, revealFraction = 0.4 } = props\n const copy = useMessages().swipeRow\n const rtl = useLocale().direction === 'rtl'\n const reduced = useReducedMotion()\n const [side, setSide] = useState<SwipeSide>('none')\n const [drag, setDragState] = useState<number | null>(null)\n const dragNow = useRef<number | null>(null)\n const setDrag = (v: number | null) => {\n dragNow.current = v\n setDragState(v)\n }\n const track = useRef<Track | null>(null)\n const width = useRef(0)\n const armed = useRef(false)\n const surface = useRef<HTMLDivElement>(null)\n\n const changeSide = (next: SwipeSide) => {\n setSide(next)\n if (next !== side) props.onRevealChange?.(next)\n }\n\n const commit = (action: SwipeAction) => {\n action.onAction()\n changeSide('none')\n }\n\n const fullSwipeFire = async (action: SwipeAction, towards: 'leading' | 'trailing') => {\n if (action.tone === 'danger' && !action.undoable) {\n if (!props.confirm) return changeSide(towards)\n const ok = await props.confirm(action)\n if (!ok) return changeSide('none')\n }\n commit(action)\n }\n\n // Positive distance along the reading direction reveals the leading side.\n const along = (dx: number) => (rtl ? -dx : dx)\n\n const onTouchStart = (e: TouchEvent) => {\n const t = firstTouch(e.touches)\n if (!t || e.touches.length > 1) return\n track.current = beginTrack(t)\n width.current = surface.current?.getBoundingClientRect().width || surface.current?.offsetWidth || 0\n armed.current = false\n }\n\n const onTouchMove = (e: TouchEvent) => {\n const t = firstTouch(e.touches)\n if (!t || !track.current) return\n const next = advanceTrack(track.current, t)\n track.current = next\n if (next.axis === 'y') {\n // Vertical intent: the list scrolls and the row stays put.\n track.current = null\n setDrag(null)\n return\n }\n if (next.axis !== 'x') return\n const base = side === 'leading' ? width.current * revealFraction : side === 'trailing' ? -width.current * revealFraction : 0\n let offset = base + along(next.dx)\n if (offset > 0 && leadingActions.length === 0) offset = 0\n if (offset < 0 && trailingActions.length === 0) offset = 0\n offset = Math.max(-width.current, Math.min(width.current, offset))\n const past = fullSwipe && width.current > 0 && Math.abs(offset) >= width.current * fullSwipeFraction\n if (past && !armed.current) playHaptic('impact')\n armed.current = past\n setDrag(offset)\n }\n\n const onTouchEnd = () => {\n const offset = dragNow.current\n track.current = null\n setDrag(null)\n if (offset === null) return\n const towards: 'leading' | 'trailing' = offset > 0 ? 'leading' : 'trailing'\n const pool = towards === 'leading' ? leadingActions : trailingActions\n const w = width.current\n if (armed.current && pool[0]) {\n armed.current = false\n void fullSwipeFire(pool[0], towards)\n return\n }\n const revealAt = (w * revealFraction) / Math.max(1, pool.length) / 2\n changeSide(Math.abs(offset) >= revealAt && pool.length > 0 ? towards : 'none')\n }\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && side !== 'none') {\n e.stopPropagation()\n changeSide('none')\n surface.current?.focus()\n }\n }\n\n const menuItems: ActionMenuItem[] = [...leadingActions, ...trailingActions].map((a, i) => ({\n id: String(i),\n label: a.label,\n tone: a.tone === 'danger' ? 'danger' : 'default',\n }))\n const everyAction = [...leadingActions, ...trailingActions]\n\n // The drag variable is physical (left/right), the offset logical.\n const offsetValue = drag !== null ? `${rtl ? -drag : drag}px` : undefined\n return (\n <div\n className={cx('ty-swipe-row', props.className)}\n data-reveal={side}\n data-dragging={drag !== null || undefined}\n data-reduced={reduced || undefined}\n data-dir={rtl ? 'rtl' : 'ltr'}\n data-armed={drag !== null && armed.current ? true : undefined}\n onKeyDown={onKeyDown}\n style={{ '--ty-swipe-reveal': `${revealFraction * 100}%`, ...(offsetValue ? { '--ty-swipe-drag': offsetValue } : {}) } as React.CSSProperties}\n >\n <ActionStrip side=\"leading\" actions={leadingActions} open={side === 'leading'} onPick={commit} />\n <ActionStrip side=\"trailing\" actions={trailingActions} open={side === 'trailing'} onPick={commit} />\n <div\n ref={surface}\n className=\"ty-swipe-row__surface\"\n tabIndex={-1}\n onTouchStart={onTouchStart}\n onTouchMove={onTouchMove}\n onTouchEnd={onTouchEnd}\n onTouchCancel={onTouchEnd}\n >\n <div className=\"ty-swipe-row__content\">{props.children}</div>\n {everyAction.length > 0 ? (\n <ActionMenu\n label={copy.actionsFor(props.label)}\n items={menuItems}\n onAction={(id) => everyAction[Number(id)]?.onAction()}\n trigger={<Button variant=\"quiet\" iconOnly accessibleLabel={copy.actionsFor(props.label)} leadingIcon={<Ellipsis />} className=\"ty-swipe-row__menu\" />}\n />\n ) : null}\n </div>\n </div>\n )\n}\n","// PullToRefresh (spec: wave-2/pull-to-refresh.md). A scroll container that\n// refreshes when pulled down from the very top on touch screens. The gesture\n// is an enhancement: the host must also offer a Refresh control, which calls\n// the same `refresh()` (exposed by the hook and by the component's ref).\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState, type ReactNode, type RefObject } from 'react'\nimport { ProgressBar } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useReducedMotion } from '../../internal/media'\nimport { advanceTrack, beginTrack, firstTouch, resist, type Track } from '../../internal/platform/touchTrack'\nimport { useMessages } from '../../internal/provider'\nimport { playHaptic } from '../../utilities/haptics/haptics'\n\n/** Pull distance (CSS px, 16 × 4 px steps) that arms a refresh. */\nexport const PULL_THRESHOLD = 64\n/** Resistance cap (CSS px). */\nexport const PULL_MAX = 120\n\nexport interface PullState {\n distance: number\n /** 0–1 towards the threshold. */\n progress: number\n armed: boolean\n refreshing: boolean\n}\n\nexport interface PullToRefreshOptions {\n onRefresh: () => Promise<void>\n enabled?: boolean\n threshold?: number\n maxPull?: number\n}\n\nexport interface PullToRefreshApi extends PullState {\n containerRef: RefObject<HTMLDivElement | null>\n refresh: () => Promise<void>\n}\n\nexport function usePullToRefresh({ onRefresh, enabled = true, threshold = PULL_THRESHOLD, maxPull = PULL_MAX }: PullToRefreshOptions): PullToRefreshApi {\n const containerRef = useRef<HTMLDivElement | null>(null)\n const [state, setState] = useState<PullState>({ distance: 0, progress: 0, armed: false, refreshing: false })\n const busy = useRef(false)\n const job = useRef(onRefresh)\n job.current = onRefresh\n\n const refresh = useCallback(async () => {\n if (busy.current) return\n busy.current = true\n setState({ distance: 0, progress: 1, armed: false, refreshing: true })\n try {\n await job.current()\n } catch {\n /* the host shows its own notice; the busy state still clears */\n } finally {\n busy.current = false\n setState({ distance: 0, progress: 0, armed: false, refreshing: false })\n }\n }, [])\n\n useEffect(() => {\n const el = containerRef.current\n if (!el || !enabled) return\n let track: Track | null = null\n let pulled = 0\n let armed = false\n\n const start = (e: TouchEvent) => {\n const t = firstTouch(e.touches)\n track = t && !busy.current && el.scrollTop <= 0 ? beginTrack(t) : null\n pulled = 0\n armed = false\n }\n const move = (e: TouchEvent) => {\n const t = firstTouch(e.touches)\n if (!track || !t) return\n track = advanceTrack(track, t)\n if (track.axis === 'x' || (track.axis === 'y' && track.dy < 0 && pulled === 0)) {\n track = null\n return\n }\n if (track.axis !== 'y') return\n if (e.cancelable) e.preventDefault()\n pulled = resist(track.dy, threshold, maxPull)\n const nowArmed = pulled >= threshold\n if (nowArmed && !armed) playHaptic('impact')\n armed = nowArmed\n setState({ distance: pulled, progress: Math.min(1, pulled / threshold), armed, refreshing: false })\n }\n const end = () => {\n const fire = track !== null && armed\n track = null\n pulled = 0\n armed = false\n if (fire) void refresh()\n else if (!busy.current) setState({ distance: 0, progress: 0, armed: false, refreshing: false })\n }\n\n el.addEventListener('touchstart', start, { passive: true })\n el.addEventListener('touchmove', move, { passive: false })\n el.addEventListener('touchend', end)\n el.addEventListener('touchcancel', end)\n return () => {\n el.removeEventListener('touchstart', start)\n el.removeEventListener('touchmove', move)\n el.removeEventListener('touchend', end)\n el.removeEventListener('touchcancel', end)\n }\n }, [enabled, threshold, maxPull, refresh])\n\n return { ...state, containerRef, refresh }\n}\n\nexport type PullIndicator = 'ring' | 'dots' | ((state: PullState) => ReactNode)\n\nexport interface PullToRefreshProps extends PullToRefreshOptions {\n indicator?: PullIndicator\n /** Announced while refreshing (defaults to the catalogue word). */\n label?: string\n children: ReactNode\n className?: string\n}\n\nexport interface PullToRefreshHandle {\n refresh: () => Promise<void>\n}\n\nfunction Ring({ state, label }: { state: PullState; label: string }) {\n return (\n <ProgressBar\n className=\"ty-pull__ring\"\n aria-label={label}\n isIndeterminate={state.refreshing}\n value={state.refreshing ? undefined : Math.round(state.progress * 100)}\n style={{ '--ty-pull-progress': String(state.progress) } as React.CSSProperties}\n >\n <span className=\"ty-pull__ring-track\" aria-hidden=\"true\" />\n </ProgressBar>\n )\n}\n\nexport const PullToRefresh = forwardRef<PullToRefreshHandle, PullToRefreshProps>(function PullToRefresh(props, handle) {\n const { indicator = 'ring', children, className, ...options } = props\n const words = useMessages().pullToRefresh\n const label = props.label ?? words.refreshing\n const pull = usePullToRefresh(options)\n const reduced = useReducedMotion()\n useImperativeHandle(handle, () => ({ refresh: pull.refresh }), [pull.refresh])\n\n const visible = pull.refreshing || pull.distance > 0\n const look =\n typeof indicator === 'function' ? (\n indicator(pull)\n ) : indicator === 'dots' ? (\n <span className=\"ty-pull__dots\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n </span>\n ) : (\n <Ring state={pull} label={label} />\n )\n\n return (\n <div\n ref={pull.containerRef}\n className={cx('ty-pull', className)}\n aria-busy={pull.refreshing || undefined}\n data-refreshing={pull.refreshing || undefined}\n data-armed={pull.armed || undefined}\n data-reduced={reduced || undefined}\n style={{ '--ty-pull-distance': `${reduced ? 0 : pull.distance}px` } as React.CSSProperties}\n >\n <div className=\"ty-pull__indicator\" data-visible={visible || undefined}>\n {visible ? look : null}\n </div>\n <span className=\"ty-visually-hidden\" role=\"status\">\n {pull.refreshing ? label : ''}\n </span>\n <div className=\"ty-pull__content\">{children}</div>\n </div>\n )\n})\n","// EdgeSwipeBack (spec: wave-2/edge-swipe-back.md). On touch screens, a swipe\n// that starts at the start edge goes back. Enhancement only: it adds no\n// focusable element, and the app keeps a visible back control. The host turns\n// it off while a modal, drawer or canvas owns the gesture.\nimport { ArrowLeft, ArrowRight } from 'lucide-react'\nimport { useEffect, useRef, useState, type ReactNode } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { advanceTrack, beginTrack, firstTouch, type Track } from '../../internal/platform/touchTrack'\nimport { playHaptic } from '../../utilities/haptics/haptics'\nimport { useRouting } from '../../utilities/router-adapter/Routing'\n\n/** Default width (CSS px) of the start-edge zone: one 24 px spacing step. */\nexport const EDGE_ZONE = 24\n/** Default horizontal distance (CSS px) that commits the back navigation. */\nexport const EDGE_COMMIT = 96\n\nexport interface EdgeSwipeBackProps {\n enabled?: boolean\n onBack?: () => void\n edgeZone?: number\n commitDistance?: number\n children?: ReactNode\n}\n\ntype Cue = { progress: number } | null\n\nfunction readRtl(ariaDirection: string): boolean {\n if (typeof document !== 'undefined' && document.documentElement.dir) return document.documentElement.dir === 'rtl'\n return ariaDirection === 'rtl'\n}\n\nexport function EdgeSwipeBack({ enabled = true, onBack, edgeZone = EDGE_ZONE, commitDistance = EDGE_COMMIT, children }: EdgeSwipeBackProps) {\n const router = useRouting()\n const rtl = readRtl(useLocale().direction)\n const [cue, setCue] = useState<Cue>(null)\n const back = useRef<() => void>(() => {})\n back.current = onBack ?? router.goBack\n\n useEffect(() => {\n if (!enabled || typeof window === 'undefined') return\n let track: Track | null = null\n let progress = 0\n\n const inZone = (x: number) => (rtl ? x >= window.innerWidth - edgeZone : x <= edgeZone)\n const start = (e: TouchEvent) => {\n const t = firstTouch(e.touches)\n track = t && e.touches.length === 1 && inZone(t.clientX) ? beginTrack(t) : null\n progress = 0\n }\n const move = (e: TouchEvent) => {\n const t = firstTouch(e.touches)\n if (!track || !t) return\n track = advanceTrack(track, t)\n if (track.axis === 'y') {\n track = null\n setCue(null)\n return\n }\n if (track.axis !== 'x') return\n const inward = rtl ? -track.dx : track.dx\n progress = Math.max(0, Math.min(1, inward / commitDistance))\n setCue({ progress })\n }\n const end = () => {\n const commit = track !== null && progress >= 1\n track = null\n progress = 0\n setCue(null)\n if (commit) {\n playHaptic('impact')\n back.current()\n }\n }\n\n window.addEventListener('touchstart', start, { passive: true })\n window.addEventListener('touchmove', move, { passive: true })\n window.addEventListener('touchend', end)\n window.addEventListener('touchcancel', end)\n return () => {\n window.removeEventListener('touchstart', start)\n window.removeEventListener('touchmove', move)\n window.removeEventListener('touchend', end)\n window.removeEventListener('touchcancel', end)\n }\n }, [enabled, edgeZone, commitDistance, rtl])\n\n const Arrow = rtl ? ArrowRight : ArrowLeft\n return (\n <>\n {children}\n {cue ? (\n <div\n className=\"ty-edge-back\"\n aria-hidden=\"true\"\n data-side={rtl ? 'right' : 'left'}\n data-ready={cue.progress >= 1 || undefined}\n style={{ '--ty-edge-progress': String(cue.progress) } as React.CSSProperties}\n >\n <Arrow className=\"ty-edge-back__arrow\" focusable=\"false\" />\n </div>\n ) : null}\n </>\n )\n}\n","// SafeAreaInset (spec: wave-2/safe-area-inset.md). Pads chosen edges by the\n// environment's safe-area insets. Logical edges (start/end) are resolved to\n// the physical side here, because env() insets are physical.\nimport { useEffect, useRef, type HTMLAttributes, type ReactNode } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport type SafeEdge = 'top' | 'bottom' | 'start' | 'end'\ntype Physical = 'top' | 'bottom' | 'left' | 'right'\n\nfunction useIsRtl(): boolean {\n const aria = useLocale().direction === 'rtl'\n const doc = typeof document !== 'undefined' && (document.documentElement.dir || document.dir) === 'rtl'\n return aria || doc\n}\n\nfunction physicalSides(edges: readonly SafeEdge[], rtl: boolean): Set<Physical> {\n const side = new Set<Physical>()\n for (const e of edges) {\n if (e === 'top' || e === 'bottom') side.add(e)\n else side.add((e === 'start') !== rtl ? 'left' : 'right')\n }\n return side\n}\n\nfunction padAttributes(sides: Set<Physical>) {\n const attrs: Record<string, true | undefined> = {}\n for (const s of ['top', 'bottom', 'left', 'right'] as const) attrs[`data-pad-${s}`] = sides.has(s) || undefined\n return attrs\n}\n\nexport interface SafeAreaInsetProps extends HTMLAttributes<HTMLDivElement> {\n edges?: SafeEdge[]\n layout?: 'block' | 'flex-column'\n children?: ReactNode\n}\n\n/** Wrapper that pads the selected edges by the device inset. */\nexport function SafeAreaInset({ edges = ['top', 'bottom'], layout = 'block', className, children, ...rest }: SafeAreaInsetProps) {\n const rtl = useIsRtl()\n return (\n <div {...rest} className={cx('ty-safe-area', className)} data-layout={layout} {...padAttributes(physicalSides(edges, rtl))}>\n {children}\n </div>\n )\n}\n\n/** Full-screen view: all four edges padded. */\nexport function SafeAreaScreen(props: Omit<SafeAreaInsetProps, 'edges'>) {\n return <SafeAreaInset {...props} edges={['top', 'bottom', 'start', 'end']} />\n}\n\n/** Empty block as tall as the top or bottom inset. */\nexport function SafeAreaSpacer({ position }: { position: 'top' | 'bottom' }) {\n return <div className=\"ty-safe-area-spacer\" data-position={position} aria-hidden=\"true\" />\n}\n\nexport interface SafeAreaBottomBarProps extends HTMLAttributes<HTMLDivElement> {\n surface?: 'glass' | 'none'\n children?: ReactNode\n}\n\nconst BAR_SIZE = '--ty-safe-bottom-bar-size'\n\n/**\n * Fixed bar at the bottom, padded by the bottom inset. While mounted it\n * publishes its height so the page keeps focused elements above it (§2.6).\n */\nexport function SafeAreaBottomBar({ surface = 'glass', className, children, ...rest }: SafeAreaBottomBarProps) {\n const bar = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const node = bar.current\n if (!node || typeof document === 'undefined') return\n const root = document.documentElement\n const publish = () => root.style.setProperty(BAR_SIZE, `${node.offsetHeight}px`)\n publish()\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(publish)\n observer?.observe(node)\n\n const keepVisible = (event: FocusEvent) => {\n const target = event.target\n if (!(target instanceof Element) || node.contains(target)) return\n const barTop = node.getBoundingClientRect().top\n const overlap = target.getBoundingClientRect().bottom - barTop\n if (barTop > 0 && overlap > 0) window.scrollBy({ top: overlap + 8, behavior: 'auto' })\n }\n document.addEventListener('focusin', keepVisible)\n return () => {\n observer?.disconnect()\n document.removeEventListener('focusin', keepVisible)\n root.style.removeProperty(BAR_SIZE)\n }\n }, [])\n\n return (\n <div {...rest} ref={bar} className={cx('ty-safe-bottom-bar', className)} data-surface={surface}>\n {children}\n </div>\n )\n}\n","// GlassCheckToggle (spec: wave-4/glass-check-toggle.md). Developer aid: paints\n// the page background a loud test colour so translucent surfaces visibly tint\n// and secretly opaque ones stand out. Renders nothing unless `enabled`, which\n// the host wires to its own development flag (the library reads no build\n// variables), so production bundles never show it.\nimport { Layers } from 'lucide-react'\nimport { useEffect, useState } from 'react'\nimport { ToggleButton, Tooltip, TooltipTrigger } from 'react-aria-components'\nimport { useMediaQuery } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\n\n/** Root attribute read by the stylesheet while the check is on. */\nexport const GLASS_CHECK_MARKER = 'data-ty-glass-check'\n\nexport interface GlassCheckToggleProps {\n /** Host development flag. False: nothing is rendered and the document is untouched. */\n enabled?: boolean\n defaultOn?: boolean\n onChange?: (on: boolean) => void\n /** Visible and accessible name (defaults to the catalogue word). */\n label?: string\n}\n\nfunction RootMarker({ on }: { on: boolean }) {\n useEffect(() => {\n const root = document.documentElement\n if (on) root.setAttribute(GLASS_CHECK_MARKER, '')\n else root.removeAttribute(GLASS_CHECK_MARKER)\n return () => root.removeAttribute(GLASS_CHECK_MARKER)\n }, [on])\n return null\n}\n\nfunction Toggle({ defaultOn = false, onChange, label }: Omit<GlassCheckToggleProps, 'enabled'>) {\n const copy = useMessages().glassCheck\n const [on, setOn] = useState(defaultOn)\n const opaque = useMediaQuery('(prefers-reduced-transparency: reduce)')\n const forced = useMediaQuery('(forced-colors: active)')\n const moot = opaque || forced\n\n const button = (\n <ToggleButton\n className=\"ty-glass-check\"\n isSelected={on}\n data-moot={moot || undefined}\n onChange={(next) => {\n setOn(next)\n onChange?.(next)\n }}\n >\n <Layers className=\"ty-glass-check__icon\" aria-hidden=\"true\" focusable=\"false\" />\n <span className=\"ty-glass-check__word\">{label ?? copy.label}</span>\n </ToggleButton>\n )\n\n return (\n <>\n <RootMarker on={on} />\n {moot ? (\n <TooltipTrigger delay={300}>\n {button}\n <Tooltip className=\"ty-glass-check__tip\" offset={6}>\n {copy.notApplicable}\n </Tooltip>\n </TooltipTrigger>\n ) : (\n button\n )}\n </>\n )\n}\n\nexport function GlassCheckToggle({ enabled = false, ...rest }: GlassCheckToggleProps) {\n return enabled ? <Toggle {...rest} /> : null\n}\n","// CascadeGrid (spec: wave-4/cascade-grid.md).\n//\n// A grid whose first children fade in one after another, once, on first\n// mount. Three switches must all agree: the instance's `cascade`, the global\n// `decorativeMotion` flag, and no reduced-motion preference. Otherwise the\n// component is a plain grid. Public pages only (§2.7).\nimport { Children, useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\nimport { prefersReducedMotion } from '../../internal/media'\nimport { duration, useDecorativeMotion } from '../../utilities/motion-foundation/motion'\n\nconst useBeforePaint = typeof window === 'undefined' ? useEffect : useLayoutEffect\n\nexport interface CascadeGridProps {\n children: ReactNode\n /** Per-instance opt-in; also needs the global decorativeMotion switch. */\n cascade?: boolean\n stepMs?: number\n maxTotalMs?: number\n distance?: 'none' | 'small'\n role?: string\n 'aria-label'?: string\n 'data-testid'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * Start offsets (ms) for `count` entrants: evenly spaced by `gap`, but\n * squeezed so the last one starts no later than `limit`.\n */\nexport function entranceSchedule(count: number, gap: number, limit: number): number[] {\n const offsets: number[] = []\n const spacing = count < 2 ? 0 : Math.min(gap, limit / (count - 1))\n for (let n = 0; n < count; n += 1) offsets.push(Math.round(n * spacing))\n return offsets\n}\n\n/**\n * Decides, once, whether this mount plays the entrance. Returns the schedule\n * while it plays and `null` otherwise. The entrant count is frozen at mount,\n * so children added later never replay it.\n */\nfunction useEntrance(enabled: boolean, count: number, gap: number, limit: number): number[] | null {\n const frozen = useRef<number[] | null>(null)\n const [playing, setPlaying] = useState(false)\n useBeforePaint(() => {\n if (!enabled || frozen.current) return\n frozen.current = entranceSchedule(count, gap, limit)\n if (prefersReducedMotion()) return\n setPlaying(true)\n const lastStart = frozen.current[frozen.current.length - 1] ?? 0\n const timer = window.setTimeout(() => setPlaying(false), lastStart + duration.ms.base * 2)\n return () => window.clearTimeout(timer)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n return playing ? frozen.current : null\n}\n\nfunction Entrant({ offset, children }: { offset: number | undefined; children: ReactNode }) {\n const moving = offset !== undefined\n return (\n <div\n role=\"none\"\n className=\"ty-cascade-grid__cell\"\n data-entering={moving || undefined}\n style={moving ? ({ '--ty-cascade-delay': `${offset}ms` } as CSSProperties) : undefined}\n >\n {children}\n </div>\n )\n}\n\nexport function CascadeGrid(props: CascadeGridProps) {\n const decorativeOn = useDecorativeMotion()\n const enabled = Boolean(props.cascade) && decorativeOn\n const kids = Children.toArray(props.children)\n const schedule = useEntrance(enabled, kids.length, props.stepMs ?? duration.ms.instant, props.maxTotalMs ?? duration.ms.base)\n\n const host = {\n role: props.role,\n 'aria-label': props['aria-label'],\n 'data-testid': props['data-testid'],\n className: cx('ty-cascade-grid', props.className),\n style: props.style,\n }\n if (!enabled) return <div {...host}>{props.children}</div>\n\n return (\n <div {...host} data-distance={props.distance ?? 'small'} data-cascading={schedule ? true : undefined}>\n {kids.map((kid, place) => (\n <Entrant key={(kid as { key?: string | null }).key ?? place} offset={schedule?.[place]}>\n {kid}\n </Entrant>\n ))}\n </div>\n )\n}\n","import { useId, type ReactNode } from 'react'\nimport { Heading as AriaHeading } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport type ShowcaseAlign = 'start' | 'center'\n\nexport interface ShowcaseHeadingProps {\n /** Document outline level of the title. */\n level?: 1 | 2 | 3\n /** Short topic line above the title (outside the heading element). */\n kicker?: string\n /** Reading paragraph under the title. */\n lead?: ReactNode\n align?: ShowcaseAlign\n /** Id of the title, for `aria-labelledby` on the enclosing section. */\n id?: string\n className?: string\n /** Title text. */\n children: ReactNode\n}\n\n/** Topic line of a public page block; eyebrow step in the accent colour (§2.2, §2.3). */\nexport function Kicker(props: { children: ReactNode; className?: string }) {\n return <p className={cx('ty-kicker', props.className)}>{props.children}</p>\n}\n\nexport interface LeadProps {\n children: ReactNode\n /** Element; a paragraph by default. */\n as?: 'p' | 'div'\n className?: string\n}\n\n/** Reading paragraph of a public page block, body-lg on the reading measure. */\nexport function Lead(props: LeadProps) {\n const Tag = props.as ?? 'p'\n return <Tag className={cx('ty-lead', props.className)}>{props.children}</Tag>\n}\n\n/**\n * Opening text block of a public page: kicker, display title, lead\n * (spec: wave-4/showcase-heading.md). Without kicker and lead only the\n * heading element is produced.\n */\nexport function ShowcaseHeading(props: ShowcaseHeadingProps) {\n const auto = useId()\n const align = props.align ?? 'start'\n const bare = props.kicker === undefined && props.lead == null\n const title = (\n <AriaHeading\n level={props.level ?? 1}\n id={props.id ?? `ty-showcase-${auto.replace(/:/g, '')}`}\n className={cx('ty-showcase-heading__title', bare && props.className)}\n data-align={bare ? align : undefined}\n >\n {props.children}\n </AriaHeading>\n )\n if (bare) return title\n return (\n <div className={cx('ty-showcase-heading', props.className)} data-align={align}>\n {props.kicker !== undefined && <Kicker>{props.kicker}</Kicker>}\n {title}\n {props.lead != null && <Lead>{props.lead}</Lead>}\n </div>\n )\n}\n","import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { prefersReducedMotion } from '../../internal/media'\n\nexport interface RevealNumberProps {\n /** Value shown before the element is seen. */\n from?: number\n /** Final value. */\n to: number\n /** Fixed decimals of the default formatter (Intl, in the provider's locale and numbering system). */\n decimals?: number\n /** Formatter for every intermediate value. */\n format?: (n: number) => string\n /** Portion of the element that must be in view to start (0 to 1). */\n visibleFraction?: number\n /** When false, the number resets on leaving the view and counts again on return. */\n once?: boolean\n /** Length of the count; defaults to the `--ty-dur-base` token. */\n durationMs?: number\n className?: string\n}\n\nconst useBeforePaint = typeof window === 'undefined' ? useEffect : useLayoutEffect\n\n/** Reads a duration token (`240ms` or `0.24s`) from the element; falls back to 240 ms. */\nfunction tokenDuration(el: Element | null): number {\n if (!el || typeof getComputedStyle !== 'function') return 240\n const raw = getComputedStyle(el).getPropertyValue('--ty-dur-base').trim()\n const n = parseFloat(raw)\n if (!raw || Number.isNaN(n)) return 240\n return raw.endsWith('ms') ? n : raw.endsWith('s') ? n * 1000 : n\n}\n\n/** Decelerating curve, close to the `enter` easing of §2.7. */\nconst decelerate = (t: number) => 1 - (1 - t) ** 3\n\n/**\n * A figure that counts to its final value the first time it scrolls into\n * view (spec: wave-4/reveal-number.md). Assistive technology only ever reads\n * the final value; server markup holds the final value too.\n */\nexport function RevealNumber(props: RevealNumberProps) {\n const start = props.from ?? 0\n const end = props.to\n const places = props.decimals ?? 0\n const { locale } = useLocale()\n const localeDigits = useMemo(() => new Intl.NumberFormat(locale, { minimumFractionDigits: places, maximumFractionDigits: places, useGrouping: false }), [locale, places])\n const show = props.format ?? ((n: number) => localeDigits.format(n))\n const repeat = props.once === false\n const host = useRef<HTMLSpanElement>(null)\n // null = not yet on the client: render the final value (server output, no-script pages).\n const [current, setCurrent] = useState<number | null>(null)\n\n useBeforePaint(() => {\n const el = host.current\n const canObserve = typeof IntersectionObserver === 'function'\n if (!el || !canObserve || prefersReducedMotion()) {\n setCurrent(end)\n return\n }\n setCurrent(start)\n let frame = 0\n let done = false\n const run = () => {\n const length = props.durationMs ?? tokenDuration(el)\n if (length <= 0) {\n setCurrent(end)\n return\n }\n const began = performance.now()\n const step = (now: number) => {\n const t = Math.min(1, (now - began) / length)\n setCurrent(t >= 1 ? end : start + (end - start) * decelerate(t))\n frame = t < 1 ? requestAnimationFrame(step) : 0\n }\n frame = requestAnimationFrame(step)\n }\n const watcher = new IntersectionObserver(\n (entries) => {\n const seen = entries.some((e) => e.isIntersecting)\n if (seen && !done) {\n done = true\n run()\n if (!repeat) watcher.disconnect()\n } else if (!seen && done && repeat) {\n cancelAnimationFrame(frame)\n done = false\n setCurrent(start)\n }\n },\n { threshold: props.visibleFraction ?? 0.5 },\n )\n watcher.observe(el)\n return () => {\n watcher.disconnect()\n cancelAnimationFrame(frame)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [start, end, repeat, props.visibleFraction, props.durationMs])\n\n const finalText = show(end)\n return (\n <span ref={host} className={cx('ty-reveal-number', props.className)}>\n {/* Reserves the width of the final value so the digits never jitter. */}\n <span className=\"ty-reveal-number__ghost\" aria-hidden=\"true\">\n {finalText}\n </span>\n <span className=\"ty-reveal-number__run\" aria-hidden=\"true\">\n {show(current ?? end)}\n </span>\n <span className=\"ty-visually-hidden\">{finalText}</span>\n </span>\n )\n}\n","import type { CSSProperties } from 'react'\nimport { cx } from '../../internal/cx'\n\nexport type BackdropPlacement = 'corners' | 'top' | 'bottom'\nexport type BackdropIntensity = 'calm' | 'faint'\n\nexport interface ShowcaseBackdropProps {\n /** Where the two glows sit. */\n placement?: BackdropPlacement\n /** `faint` halves the Ambient effect for dense sections. */\n intensity?: BackdropIntensity\n className?: string\n style?: CSSProperties\n}\n\n/**\n * Two soft glows behind one showcase section, in the Ambient hues of §2.5\n * (spec: wave-4/showcase-backdrop.md). Fills its positioned parent, clips\n * itself, is hidden from assistive technology and never takes pointer events.\n * Content placed after it with `position: relative` sits above it.\n */\nexport function ShowcaseBackdrop(props: ShowcaseBackdropProps) {\n return (\n <div\n aria-hidden=\"true\"\n className={cx('ty-showcase-backdrop', props.className)}\n style={props.style}\n data-placement={props.placement ?? 'corners'}\n data-intensity={props.intensity ?? 'calm'}\n >\n <span className=\"ty-showcase-backdrop__glow\" data-hue=\"1\" />\n <span className=\"ty-showcase-backdrop__glow\" data-hue=\"2\" />\n </div>\n )\n}\n\nexport interface AccentBandProps {\n /** Edge of the positioned parent the band sticks to. */\n edge?: 'top' | 'bottom'\n className?: string\n style?: CSSProperties\n}\n\n/** Thin strip of the brand accent marking the top (or bottom) of a showcase section. */\nexport function AccentBand(props: AccentBandProps) {\n return <div aria-hidden=\"true\" className={cx('ty-accent-band', props.className)} style={props.style} data-edge={props.edge ?? 'top'} />\n}\n","import { useId, type ReactNode } from 'react'\nimport { Heading as AriaHeading, Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\n\nexport type FeatureCardSpan = 'narrow' | 'wide'\nexport type FeatureCardFade = 'top' | 'bottom'\n\nexport interface FeatureShowcaseCardProps {\n /** Content of the media area (image, capture, small diagram). */\n media: ReactNode\n /** Text alternative when the media carries information; omit for decorative media. */\n mediaAlt?: string\n kicker: string\n title: string\n description: ReactNode\n /** Edges of the media that fade into the card surface. */\n fade?: FeatureCardFade[]\n /** Whole-card link target (through the router adapter). */\n href?: string\n headingLevel?: 2 | 3 | 4\n /** Columns taken in FeatureShowcaseMosaic from 1024 px. */\n span?: FeatureCardSpan\n className?: string\n}\n\nfunction Media(p: { media: ReactNode; alt?: string; fade: FeatureCardFade[] }) {\n const described = p.alt !== undefined && p.alt !== ''\n return (\n <div className=\"ty-feature-showcase-card__media\">\n <div className=\"ty-feature-showcase-card__frame\" {...(described ? { role: 'img', 'aria-label': p.alt } : { 'aria-hidden': true })}>\n {p.media}\n </div>\n {p.fade.map((edge) => (\n <span key={edge} className=\"ty-feature-showcase-card__fade\" data-edge={edge} aria-hidden=\"true\" />\n ))}\n </div>\n )\n}\n\n/**\n * Large card for public pages pairing media with kicker, title and text\n * (spec: wave-4/feature-showcase-card.md). With `href` the title holds the\n * only link, stretched over the card: one tab stop named by the title.\n */\nexport function FeatureShowcaseCard(props: FeatureShowcaseCardProps) {\n const titleId = `ty-fsc-${useId().replace(/:/g, '')}`\n const linked = typeof props.href === 'string'\n return (\n <article\n className={cx('ty-feature-showcase-card', props.className)}\n aria-labelledby={titleId}\n data-span={props.span ?? 'narrow'}\n data-linked={linked || undefined}\n >\n <Media media={props.media} alt={props.mediaAlt} fade={props.fade ?? []} />\n <div className=\"ty-feature-showcase-card__body\">\n <p className=\"ty-feature-showcase-card__kicker\">{props.kicker}</p>\n <AriaHeading level={props.headingLevel ?? 3} id={titleId} className=\"ty-feature-showcase-card__title\">\n {linked ? (\n <AriaLink href={props.href} className=\"ty-feature-showcase-card__link\">\n {props.title}\n </AriaLink>\n ) : (\n props.title\n )}\n </AriaHeading>\n <div className=\"ty-feature-showcase-card__description\">{props.description}</div>\n </div>\n </article>\n )\n}\n\n/** Uneven mosaic for FeatureShowcaseCards: wide = two thirds, narrow = one third from 1024 px. */\nexport function FeatureShowcaseMosaic(props: { children: ReactNode; className?: string }) {\n return <div className={cx('ty-feature-mosaic', props.className)}>{props.children}</div>\n}\n","import { createContext, useContext, type CSSProperties, type ReactNode } from 'react'\nimport { cx } from '../../internal/cx'\n\ntype RowTag = 'div' | 'ul' | 'ol'\ntype CellTag = 'div' | 'li'\n\nexport interface RuledGridProps {\n /** Small crosses where rules meet, and at the outer corners. */\n marks?: boolean\n /** Rules along the outer edges too. */\n outerRules?: boolean\n children: ReactNode\n className?: string\n}\n\nexport interface RuledGridRowProps {\n /** Column count or a full `grid-template-columns` value; auto-fit by default. */\n columns?: number | string\n /** `ul` / `ol` give the row list semantics (cells then use `li`). */\n as?: RowTag\n children: ReactNode\n className?: string\n}\n\nexport interface RuledGridCellProps {\n as?: CellTag\n children: ReactNode\n className?: string\n}\n\nconst MarksOn = createContext(false)\nconst CORNERS = ['start-start', 'start-end', 'end-start', 'end-end'] as const\n\n/** Hairline-ruled layout grid for public pages (spec: wave-4/ruled-grid.md). */\nexport function RuledGrid(props: RuledGridProps) {\n const marks = props.marks === true\n return (\n <MarksOn.Provider value={marks}>\n <div className={cx('ty-ruled-grid', props.className)} data-marks={marks || undefined} data-outer={props.outerRules === false ? undefined : true}>\n {props.children}\n </div>\n </MarksOn.Provider>\n )\n}\n\nfunction template(columns: RuledGridRowProps['columns']): string | undefined {\n if (columns === undefined) return undefined\n return typeof columns === 'number' ? `repeat(${columns}, minmax(0, 1fr))` : columns\n}\n\n/** One row of cells separated by vertical rules. */\nexport function RuledGridRow(props: RuledGridRowProps) {\n const Tag = props.as ?? 'div'\n const cols = template(props.columns)\n const style = cols ? ({ '--ty-ruled-columns': cols } as CSSProperties) : undefined\n return (\n <Tag className={cx('ty-ruled-grid__row', props.className)} style={style}>\n {props.children}\n </Tag>\n )\n}\n\n/** One cell; draws its four corner marks when the grid asks for them (decorative). */\nexport function RuledGridCell(props: RuledGridCellProps) {\n const Tag = props.as ?? 'div'\n const marks = useContext(MarksOn)\n return (\n <Tag className={cx('ty-ruled-grid__cell', props.className)}>\n {marks && CORNERS.map((c) => <span key={c} className=\"ty-ruled-grid__mark\" data-corner={c} aria-hidden=\"true\" />)}\n {props.children}\n </Tag>\n )\n}\n","import { useId } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { Link } from '../link/Link'\nimport { RevealNumber } from '../reveal-number/RevealNumber'\n\nexport interface HighlightStatSource {\n text: string\n href?: string\n}\n\nexport interface HighlightStatProps {\n /** The figure; a number may be revealed. */\n value: number | string\n /** What the figure counts. */\n label: string\n /** Count the value up through RevealNumber (numbers only). */\n reveal?: boolean\n /** Formatter for numbers; locale grouping by default. */\n format?: (n: number) => string\n /** Where the figure comes from (§3.5: every number is traceable). */\n source?: HighlightStatSource\n /** `raised` draws an elevation-2 card; `none` sits on the section. */\n surface?: 'none' | 'raised'\n className?: string\n}\n\n/**\n * One headline figure with its label on a public page\n * (spec: wave-4/highlight-stat.md). A group named by the label and described\n * by the value and source; only the source link is focusable.\n */\nexport function HighlightStat(props: HighlightStatProps) {\n const { locale } = useLocale()\n const stem = useId().replace(/:/g, '')\n const ids = { label: `ty-hs-${stem}-l`, value: `ty-hs-${stem}-v`, source: `ty-hs-${stem}-s` }\n const fmt = props.format ?? ((n: number) => new Intl.NumberFormat(locale).format(n))\n const numeric = typeof props.value === 'number'\n\n let figure\n if (numeric && props.reveal) figure = <RevealNumber to={props.value as number} format={fmt} />\n else figure = numeric ? fmt(props.value as number) : props.value\n\n const describedBy = props.source ? `${ids.value} ${ids.source}` : ids.value\n return (\n <div\n role=\"group\"\n aria-labelledby={ids.label}\n aria-describedby={describedBy}\n className={cx('ty-highlight-stat', props.className)}\n data-surface={props.surface ?? 'none'}\n >\n <p id={ids.value} className=\"ty-highlight-stat__value\">\n {figure}\n </p>\n <p id={ids.label} className=\"ty-highlight-stat__label\">\n {props.label}\n </p>\n {props.source && (\n <p id={ids.source} className=\"ty-highlight-stat__source\">\n {props.source.href ? <Link href={props.source.href}>{props.source.text}</Link> : props.source.text}\n </p>\n )}\n </div>\n )\n}\n","import { Children, type ReactNode } from 'react'\nimport { Heading as AriaHeading, Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport type { IconComponent } from '../../internal/types'\n\nexport interface FeatureTileProps {\n /** Lucide icon, drawn on the shared accent badge. */\n icon: IconComponent\n title: string\n description: ReactNode\n headingLevel?: 2 | 3 | 4\n surface?: 'none' | 'raised'\n /** Optional link; the title becomes the link and its hit area covers the tile. */\n href?: string\n className?: string\n}\n\n/** Compact capability block for public pages (spec: wave-4/feature-tile.md). */\nexport function FeatureTile(props: FeatureTileProps) {\n const Glyph = props.icon\n const heading = props.href ? (\n <AriaLink href={props.href} className=\"ty-feature-tile__link\">\n {props.title}\n </AriaLink>\n ) : (\n props.title\n )\n return (\n <div className={cx('ty-feature-tile', props.className)} data-surface={props.surface ?? 'none'} data-linked={props.href ? true : undefined}>\n <span className=\"ty-feature-tile__badge\" aria-hidden=\"true\">\n <Glyph className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n </span>\n <AriaHeading level={props.headingLevel ?? 3} className=\"ty-feature-tile__title\">\n {heading}\n </AriaHeading>\n <div className=\"ty-feature-tile__description\">{props.description}</div>\n </div>\n )\n}\n\n/** List of FeatureTiles: one column, two from 640 px, three from 1024 px. */\nexport function FeatureTileGrid(props: { children: ReactNode; className?: string }) {\n return (\n <ul className={cx('ty-feature-tile-grid', props.className)}>\n {Children.toArray(props.children).map((tile, i) => (\n <li key={i} className=\"ty-feature-tile-grid__item\">\n {tile}\n </li>\n ))}\n </ul>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Link as AriaLink, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { ActorChip, type ActorKind } from '../actor-chip/ActorChip'\n\nexport interface ActivityEntry {\n id: string\n actor: { kind: ActorKind; name: string; agentKey?: string; model?: string }\n text: ReactNode\n at: string | Date\n /** Mono meta (id, rule, hash). */\n meta?: string\n}\n\nexport interface ActivityFeedProps {\n entries: ActivityEntry[]\n label: string\n locale?: string\n /** Reference time for relative dates (tests, snapshots). */\n now?: Date\n moreHref?: string\n moreLabel?: string\n className?: string\n}\n\nconst STEPS: Array<[Intl.RelativeTimeFormatUnit, number]> = [\n ['second', 60],\n ['minute', 60],\n ['hour', 24],\n ['day', 7],\n ['week', 4.35],\n ['month', 12],\n ['year', Number.POSITIVE_INFINITY],\n]\n\n/** Relative phrase with the largest unit that keeps the number above one. */\nexport function relativePhrase(at: Date, now: Date, locale: string): string {\n let amount = (at.getTime() - now.getTime()) / 1000\n for (const [unit, size] of STEPS) {\n if (Math.abs(amount) < size) return new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(Math.round(amount), unit)\n amount /= size\n }\n return ''\n}\n\nfunction Stamp({ at, now, locale }: { at: Date; now: Date; locale: string }) {\n const absolute = new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short' }).format(at)\n return (\n <time className=\"ty-activity__time\" dateTime={at.toISOString()} title={absolute}>\n {relativePhrase(at, now, locale)}\n </time>\n )\n}\n\n/** Recent acts on the research, actor first (spec: wave-4/activity-feed.md; §2.11). */\nexport function ActivityFeed(props: ActivityFeedProps) {\n const words = useMessages().activityFeed\n const adapterLocale = useLocale().locale\n const locale = props.locale ?? adapterLocale\n const now = props.now ?? new Date()\n if (!props.entries.length) return <p className={cx('ty-activity__empty', props.className)}>{words.empty}</p>\n return (\n <div className={cx('ty-activity', props.className)}>\n <ol className=\"ty-activity__list\" aria-label={props.label}>\n {props.entries.map((entry) => (\n <li key={entry.id} className=\"ty-activity__entry\">\n <ActorChip compact kind={entry.actor.kind} name={entry.actor.name} agentKey={entry.actor.agentKey} model={entry.actor.model} />\n <div className=\"ty-activity__body\">\n <p className=\"ty-activity__text\" dir=\"auto\">{entry.text}</p>\n <p className=\"ty-activity__meta\">\n <Stamp at={typeof entry.at === 'string' ? new Date(entry.at) : entry.at} now={now} locale={locale} />\n {entry.meta ? <code className=\"ty-activity__code\">{entry.meta}</code> : null}\n </p>\n </div>\n </li>\n ))}\n </ol>\n {props.moreHref && props.moreLabel ? (\n <AriaLink className=\"ty-activity__more\" href={props.moreHref}>\n {props.moreLabel}\n </AriaLink>\n ) : null}\n </div>\n )\n}\n","import { useMemo } from 'react'\nimport { useLocale } from 'react-aria-components'\n\n/**\n * Locale-aware joining and numbers for accessible names built from parts\n * (\"Verification, 12 pending\" in English, with the Arabic comma in Arabic):\n * Intl.ListFormat unit lists instead of hard-coded separators.\n */\nexport function useLocaleText() {\n const { locale } = useLocale()\n return useMemo(() => {\n const list = new Intl.ListFormat(locale, { type: 'unit', style: 'short' })\n const tight = new Intl.ListFormat(locale, { type: 'unit', style: 'narrow' })\n const number = new Intl.NumberFormat(locale)\n return {\n locale,\n /** \"a, b\" in the locale's unit-list style. */\n join: (...parts: string[]) => list.format(parts.filter(Boolean)),\n /** \"a b\" (value and its unit or label) in the locale's narrow style. */\n pair: (...parts: string[]) => tight.format(parts.filter(Boolean)),\n number: (n: number) => number.format(n),\n }\n }, [locale])\n}\n","import { ChevronsUpDown } from 'lucide-react'\nimport { forwardRef, useId, type ReactNode } from 'react'\nimport { Button as AriaButton, Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { useLocaleText } from '../../internal/speech'\nimport type { IconComponent } from '../../internal/types'\n\n/*\n * Rail navigation parts for the research shell (spec: wave-4/app-frame-rail.md,\n * design direction §3.2): grouped sections with an eyebrow, items with an\n * icon and an optional count, and a two-level context button.\n */\n\nexport interface RailNavSectionProps {\n /** Eyebrow shown above the group; also names the list. Omit for the ungrouped top items. */\n label?: string\n children: ReactNode\n className?: string\n}\n\n/** A group of rail items (for example \"Coletar\"). */\nexport function RailNavSection({ label, children, className }: RailNavSectionProps) {\n const labelId = useId()\n return (\n <div className={cx('ty-rail-section', className)}>\n {label ? (\n <p className=\"ty-rail-section__label\" id={labelId} dir=\"auto\">\n {label}\n </p>\n ) : null}\n <ul className=\"ty-rail-section__list\" aria-labelledby={label ? labelId : undefined}>\n {children}\n </ul>\n </div>\n )\n}\n\nexport interface RailNavItemProps {\n label: string\n icon?: IconComponent\n href?: string\n onPress?: () => void\n /** Marks the current page: accent-soft fill, accent text, 3 px inset bar. */\n current?: boolean\n /** Pending count, shown only where there is action for the person (§3.2). */\n count?: number\n /** Count in words; defaults to the catalogue's \"n pending\". */\n countLabel?: string\n}\n\nfunction ItemBody({ icon: Glyph, label, count }: { icon?: IconComponent; label: string; count?: string }) {\n return (\n <>\n {Glyph ? <Glyph className=\"ty-icon ty-rail-item__icon\" aria-hidden=\"true\" focusable=\"false\" /> : null}\n <span className=\"ty-rail-item__label\" dir=\"auto\">{label}</span>\n {count ? (\n <span className=\"ty-rail-item__count\" aria-hidden=\"true\">\n {count}\n </span>\n ) : null}\n </>\n )\n}\n\n/** One rail destination (link) or action (button). */\nexport function RailNavItem(props: RailNavItemProps) {\n const words = useMessages().rail\n const speech = useLocaleText()\n const name = props.count ? speech.join(props.label, props.countLabel ?? words.count(props.count)) : undefined\n const shown = props.count ? (props.count > 999 ? words.capped(speech.number(999)) : speech.number(props.count)) : undefined\n const body = <ItemBody icon={props.icon} label={props.label} count={shown} />\n const shared = { className: 'ty-rail-item', 'aria-label': name, 'data-current': props.current || undefined }\n return (\n <li className=\"ty-rail-section__entry\">\n {props.href ? (\n <AriaLink {...shared} href={props.href} onPress={props.onPress} aria-current={props.current ? 'page' : undefined}>\n {body}\n </AriaLink>\n ) : (\n <AriaButton {...shared} onPress={props.onPress}>\n {body}\n </AriaButton>\n )}\n </li>\n )\n}\n\nexport interface RailContextButtonProps {\n /** Upper line (organization). */\n scope: string\n /** Lower line (research project). */\n name: string\n onPress?: () => void\n /** Accessible name; defaults to \"scope, name\". */\n accessibleLabel?: string\n className?: string\n}\n\n/**\n * The context switcher's trigger (organization → project in one button,\n * §3.2). Wrap it in an ActionMenu or Popover trigger to list the choices.\n */\nexport const RailContextButton = forwardRef<HTMLButtonElement, RailContextButtonProps>(function RailContextButton(\n { scope, name, onPress, accessibleLabel, className },\n ref,\n) {\n const speech = useLocaleText()\n return (\n <AriaButton ref={ref} className={cx('ty-rail-context', className)} onPress={onPress} aria-label={accessibleLabel ?? speech.join(scope, name)}>\n <span className=\"ty-rail-context__lines\">\n <span className=\"ty-rail-context__scope\" dir=\"auto\">{scope}</span>\n <span className=\"ty-rail-context__name\" dir=\"auto\">{name}</span>\n </span>\n <ChevronsUpDown className=\"ty-icon ty-rail-context__glyph\" aria-hidden=\"true\" focusable=\"false\" />\n </AriaButton>\n )\n})\n","import type { ReactNode } from 'react'\nimport { Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMessages } from '../../internal/provider'\nimport { VisuallyHidden } from '../../internal/VisuallyHidden'\nimport { Button } from '../button/Button'\nimport { ProofBadge, type ProofState } from '../proof-badge/ProofBadge'\n\nexport interface AttentionAction {\n label: string\n href?: string\n onPress?: () => void\n}\n\nexport interface AttentionItem {\n id: string\n proof: ProofState | 'none'\n title: string\n detail?: string\n action?: AttentionAction\n}\n\nexport interface AttentionListProps {\n items: AttentionItem[]\n /** Name of the list. */\n label: string\n /** Visible heading above the list. */\n heading?: ReactNode\n emptyText?: string\n maxRows?: number\n seeAllHref?: string\n seeAllLabel?: string\n className?: string\n}\n\nfunction RowAction({ action, title, suffix }: { action: AttentionAction; title: string; suffix: (title: string) => string }) {\n // Visible label stays short; the hidden suffix makes the name unique (\"Verify: TAMM\").\n const label = (\n <>\n {action.label}\n <VisuallyHidden>{suffix(title)}</VisuallyHidden>\n </>\n )\n return (\n <Button variant=\"quiet\" size=\"compact\" href={action.href} onPress={action.onPress} className=\"ty-attention__action\">\n {label}\n </Button>\n )\n}\n\n/** What needs the person now: proof state, title, detail, one action (spec: wave-4/attention-list.md). */\nexport function AttentionList(props: AttentionListProps) {\n const words = useMessages().attentionList\n const rows = props.maxRows !== undefined ? props.items.slice(0, props.maxRows) : props.items\n const truncated = rows.length < props.items.length\n return (\n <div className={cx('ty-attention', props.className)}>\n {props.heading ? <div className=\"ty-attention__heading\">{props.heading}</div> : null}\n {rows.length === 0 ? (\n <p className=\"ty-attention__empty\">{props.emptyText ?? words.empty}</p>\n ) : (\n <ul className=\"ty-attention__list\" aria-label={props.label}>\n {rows.map((row) => (\n <li key={row.id} className=\"ty-attention__row\">\n <ProofBadge state={row.proof === 'none' ? null : row.proof} className=\"ty-attention__proof\" />\n <div className=\"ty-attention__text\">\n <span className=\"ty-attention__title\" dir=\"auto\">{row.title}</span>\n {row.detail ? <span className=\"ty-attention__detail\" dir=\"auto\">{row.detail}</span> : null}\n </div>\n {row.action ? <RowAction action={row.action} title={row.title} suffix={words.actionTarget} /> : null}\n </li>\n ))}\n </ul>\n )}\n {props.seeAllHref && (truncated || props.maxRows === undefined) ? (\n <AriaLink className=\"ty-attention__more\" href={props.seeAllHref}>\n {props.seeAllLabel ?? words.seeAll}\n </AriaLink>\n ) : null}\n </div>\n )\n}\n","import { useRef, type KeyboardEvent, type PointerEvent } from 'react'\n\n/*\n * APG Window Splitter behaviour shared by ResizableSplit and the docked\n * EvidencePanel: the value is the size (px) of the pane the splitter sizes.\n * `grows` says which pointer/arrow direction makes that pane larger.\n */\n\nexport interface SplitterOptions {\n size: number\n min: number\n max: number\n step: number\n /** Direction (in screen terms) that enlarges the sized pane. */\n grows: 'left' | 'right'\n onSize: (px: number) => void\n}\n\nexport const clampSize = (value: number, min: number, max: number) => Math.min(max, Math.max(min, Math.round(value)))\n\nexport function useSplitter({ size, min, max, step, grows, onSize }: SplitterOptions) {\n const drag = useRef<{ x: number; from: number } | null>(null)\n const restore = useRef<number | null>(null)\n const sign = grows === 'left' ? -1 : 1\n const set = (px: number) => onSize(clampSize(px, min, max))\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const table: Record<string, () => void> = {\n ArrowLeft: () => set(size - sign * step),\n ArrowRight: () => set(size + sign * step),\n Home: () => set(min),\n End: () => set(max),\n Enter: () => {\n if (size > min) {\n restore.current = size\n set(min)\n } else set(restore.current ?? max)\n },\n }\n const run = table[event.key]\n if (!run) return\n event.preventDefault()\n run()\n }\n\n const onPointerDown = (event: PointerEvent<HTMLElement>) => {\n if (event.button > 0) return\n drag.current = { x: event.clientX, from: size }\n event.currentTarget.setPointerCapture?.(event.pointerId)\n }\n const onPointerMove = (event: PointerEvent<HTMLElement>) => {\n if (!drag.current) return\n set(drag.current.from + sign * (event.clientX - drag.current.x))\n }\n const finish = () => {\n drag.current = null\n }\n\n return {\n role: 'separator' as const,\n tabIndex: 0,\n 'aria-orientation': 'vertical' as const,\n 'aria-valuenow': size,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n onKeyDown,\n onPointerDown,\n onPointerMove,\n onPointerUp: finish,\n onPointerCancel: finish,\n }\n}\n","import { X } from 'lucide-react'\nimport { useId, type CSSProperties, type ReactNode, type RefObject } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { breakpoints, useMinWidth } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport { Button } from '../button/Button'\nimport { Drawer } from '../drawer/Drawer'\nimport { ProofBadge, type ProofBadgeProps } from '../proof-badge/ProofBadge'\nimport { clampSize, useSplitter } from '../resizable-split/useSplitter'\n\nexport type EvidencePlacement = 'auto' | 'docked' | 'overlay' | 'sheet'\n\nexport interface EvidencePanelProps {\n title: string\n subtitle?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n /** auto: docked ≥ 1280 px, overlay 1024–1279 px, bottom sheet below. */\n placement?: EvidencePlacement\n /** Docked width in px, clamped to 340–420. */\n width?: number\n /** Makes the docked panel resizable (APG Window Splitter). */\n onWidthChange?: (px: number) => void\n /** Proof band at the top of the body (ProofBadge `block`). */\n proof?: Omit<ProofBadgeProps, 'size'>\n footer?: ReactNode\n /** Where focus returns when the docked panel is closed. */\n returnFocusRef?: RefObject<HTMLElement | null>\n children: ReactNode\n className?: string\n}\n\nexport const EVIDENCE_WIDTH = { min: 340, max: 420 } as const\n\nfunction usePlacement(requested: EvidencePlacement): Exclude<EvidencePlacement, 'auto'> {\n const wide = useMinWidth(breakpoints.xl)\n const medium = useMinWidth(breakpoints.lg)\n if (requested !== 'auto') return requested\n return wide ? 'docked' : medium ? 'overlay' : 'sheet'\n}\n\nfunction Contents({ proof, footer, children }: Pick<EvidencePanelProps, 'proof' | 'footer' | 'children'>) {\n return (\n <>\n <div className=\"ty-evidence__body\">\n {proof ? <ProofBadge {...proof} size=\"block\" /> : null}\n {children}\n </div>\n {footer ? <div className=\"ty-evidence__footer\">{footer}</div> : null}\n </>\n )\n}\n\n/**\n * Side inspector of the selected item's evidence (spec: wave-4/evidence-panel.md):\n * a complementary column when docked, a modal drawer or bottom sheet otherwise.\n */\nexport function EvidencePanel(props: EvidencePanelProps) {\n const words = useMessages().evidencePanel\n const placement = usePlacement(props.placement ?? 'auto')\n const titleId = useId()\n const { direction } = useLocale()\n const width = clampSize(props.width ?? EVIDENCE_WIDTH.max, EVIDENCE_WIDTH.min, EVIDENCE_WIDTH.max)\n const splitter = useSplitter({\n size: width,\n ...EVIDENCE_WIDTH,\n step: 8,\n grows: direction === 'rtl' ? 'right' : 'left',\n onSize: (px) => props.onWidthChange?.(px),\n })\n\n if (!props.open) return null\n\n if (placement !== 'docked') {\n return (\n <Drawer\n open\n onOpenChange={props.onOpenChange}\n title={props.title}\n placement={placement === 'overlay' ? 'end' : 'bottom'}\n maxHeight={placement === 'sheet' ? '80dvh' : undefined}\n className={cx('ty-evidence-modal', props.className)}\n >\n {props.subtitle ? <p className=\"ty-evidence__subtitle\" dir=\"auto\">{props.subtitle}</p> : null}\n <Contents proof={props.proof} footer={props.footer}>\n {props.children}\n </Contents>\n </Drawer>\n )\n }\n\n const close = () => {\n props.onOpenChange(false)\n props.returnFocusRef?.current?.focus()\n }\n\n return (\n <aside\n className={cx('ty-evidence', props.className)}\n aria-labelledby={titleId}\n data-placement=\"docked\"\n style={{ '--ty-evidence-width': `${width}px` } as CSSProperties}\n >\n {props.onWidthChange ? <div {...splitter} aria-label={words.resize} className=\"ty-evidence__handle\" /> : null}\n <header className=\"ty-evidence__head\">\n <div className=\"ty-evidence__titles\">\n <h2 id={titleId} className=\"ty-evidence__title\" dir=\"auto\">\n {props.title}\n </h2>\n {props.subtitle ? <p className=\"ty-evidence__subtitle\" dir=\"auto\">{props.subtitle}</p> : null}\n </div>\n <Button variant=\"quiet\" iconOnly accessibleLabel={words.close} leadingIcon={<X />} onPress={close} />\n </header>\n <Contents proof={props.proof} footer={props.footer}>\n {props.children}\n </Contents>\n </aside>\n )\n}\n","// Pure rules of the action bar (wave-4/floating-action-bar.md): which edge it\n// uses, how many slots fit, which items overflow, how chords are matched and\n// how counts are shown. Kept free of React so every rule is unit-tested.\n\nexport type BarEdge = 'bottom' | 'start' | 'end' | 'top'\nexport type BarKind = 'destination' | 'contextual'\n\n/** Geometry (px) shared with FloatingActionBar.css. */\nexport const BAR_GEOMETRY = {\n item: 44,\n gap: 4,\n padding: 6,\n margin: 12,\n separator: 9,\n} as const\n\n/** Items a tab bar shows before its \"more\" slot. */\nexport const TAB_BAR_SLOTS = 5\n\nexport interface Placed<T> {\n item: T\n kind: BarKind\n}\n\nexport interface BarPlan<T> {\n shown: Placed<T>[]\n overflow: Placed<T>[]\n}\n\n/** Below 1024 px the bar always sits on the bottom edge. */\nexport function effectiveEdge(requested: BarEdge, wide: boolean): BarEdge {\n return wide ? requested : 'bottom'\n}\n\nexport function isHorizontal(edge: BarEdge): boolean {\n return edge === 'bottom' || edge === 'top'\n}\n\n/** How many item slots fit along `length` px of the edge. */\nexport function slotsAlong(length: number): number {\n const { item, gap, padding, margin, separator } = BAR_GEOMETRY\n if (!Number.isFinite(length) || length <= 0) return Number.POSITIVE_INFINITY\n const usable = length - 2 * margin - 2 * padding - separator\n return Math.max(2, Math.floor((usable + gap) / (item + gap)))\n}\n\n/**\n * Splits the items into the ones on the bar and the ones in \"more\". When they\n * do not fit, one slot goes to \"more\"; trailing contextual items leave first,\n * then trailing destinations; an active item never leaves.\n */\nexport function planBar<T extends { active?: boolean }>(destinations: T[], contextual: T[], slots: number): BarPlan<T> {\n const everything: Placed<T>[] = [\n ...destinations.map((item) => ({ item, kind: 'destination' as const })),\n ...contextual.map((item) => ({ item, kind: 'contextual' as const })),\n ]\n if (everything.length <= slots) return { shown: everything, overflow: [] }\n const excess = everything.length - Math.max(1, slots - 1)\n const leaving = new Set<Placed<T>>()\n const candidates = [\n ...everything.filter((p) => p.kind === 'contextual').reverse(),\n ...everything.filter((p) => p.kind === 'destination').reverse(),\n ]\n for (const candidate of candidates) {\n if (leaving.size >= excess) break\n if (!candidate.item.active) leaving.add(candidate)\n }\n return {\n shown: everything.filter((p) => !leaving.has(p)),\n overflow: everything.filter((p) => leaving.has(p)),\n }\n}\n\nexport interface Chord {\n alt: boolean\n ctrl: boolean\n meta: boolean\n shift: boolean\n key: string\n}\n\n/** Parses \"Alt+Shift+D\" (case-insensitive; Mod = Meta on Apple, Ctrl elsewhere is left to the host). */\nexport function parseChord(text: string): Chord {\n const parts = text.split('+').map((p) => p.trim().toLowerCase())\n const key = parts.pop() ?? ''\n const has = (name: string) => parts.includes(name)\n return { alt: has('alt') || has('option'), ctrl: has('ctrl') || has('control'), meta: has('meta') || has('cmd'), shift: has('shift'), key }\n}\n\ninterface KeyLike {\n altKey: boolean\n ctrlKey: boolean\n metaKey: boolean\n shiftKey: boolean\n key: string\n code?: string\n}\n\n/** Physical-key aware match: Alt on Apple keyboards changes `key`, so letters and digits also match on `code`. */\nexport function chordMatches(event: KeyLike, chord: Chord): boolean {\n if (event.altKey !== chord.alt || event.ctrlKey !== chord.ctrl || event.metaKey !== chord.meta || event.shiftKey !== chord.shift) return false\n if (event.key.toLowerCase() === chord.key) return true\n const code = event.code ?? ''\n return code === `Key${chord.key.toUpperCase()}` || code === `Digit${chord.key}`\n}\n\n/** `aria-keyshortcuts` form of a chord text (\"Alt+Shift+D\"). */\nexport function ariaShortcut(text: string): string {\n const c = parseChord(text)\n return [c.ctrl && 'Control', c.alt && 'Alt', c.meta && 'Meta', c.shift && 'Shift', c.key.length === 1 ? c.key.toUpperCase() : c.key]\n .filter(Boolean)\n .join('+')\n}\n\ntype Step = 'next' | 'previous' | 'first' | 'last' | 'menu' | null\n\n/** Maps a key to a roving step for the bar's orientation and reading direction. */\nexport function stepFor(key: string, edge: BarEdge, rtl: boolean): Step {\n if (key === 'Home') return 'first'\n if (key === 'End') return 'last'\n if (isHorizontal(edge)) {\n const forward = rtl ? 'ArrowLeft' : 'ArrowRight'\n const backward = rtl ? 'ArrowRight' : 'ArrowLeft'\n if (key === forward) return 'next'\n if (key === backward) return 'previous'\n return key === 'ArrowDown' ? 'menu' : null\n }\n if (key === 'ArrowDown') return 'next'\n if (key === 'ArrowUp') return 'previous'\n const opensMenu = (edge === 'start') !== rtl ? 'ArrowRight' : 'ArrowLeft'\n return key === opensMenu ? 'menu' : null\n}\n\n/** Wrapping index move. */\nexport function moveIndex(current: number, count: number, step: Exclude<Step, 'menu' | null>): number {\n if (count <= 0) return 0\n switch (step) {\n case 'first':\n return 0\n case 'last':\n return count - 1\n case 'next':\n return (current + 1) % count\n case 'previous':\n return (current - 1 + count) % count\n }\n}\n","import { ChevronDown, Ellipsis } from 'lucide-react'\nimport {\n isValidElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type ComponentType,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type RefObject,\n} from 'react'\nimport { mergeProps, useButton, useLink, useLongPress } from 'react-aria'\nimport { Menu, MenuItem, Popover, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { inertProps } from '../../internal/inert'\nimport { breakpoints, useMinWidth, useReducedMotion } from '../../internal/media'\nimport { useMessages } from '../../internal/provider'\nimport { useLocaleText } from '../../internal/speech'\nimport { useAppFrame } from '../app-frame/frameContext'\nimport { Button } from '../button/Button'\nimport { ModalDialog } from '../modal-dialog/ModalDialog'\nimport {\n ariaShortcut,\n chordMatches,\n effectiveEdge,\n isHorizontal,\n moveIndex,\n parseChord,\n planBar,\n slotsAlong,\n stepFor,\n TAB_BAR_SLOTS,\n type BarEdge,\n type BarKind,\n type Placed,\n} from './barModel'\n\nexport type { BarEdge } from './barModel'\n\nexport interface ActionBarConfirm {\n title: string\n message?: string\n confirmLabel?: string\n cancelLabel?: string\n}\n\nexport interface ActionBarMenuEntry {\n id: string\n label: string\n icon?: ComponentType<{ className?: string; 'aria-hidden'?: boolean | 'true' }>\n href?: string\n tone?: 'neutral' | 'danger'\n /** Asks before `onMenuAction` runs (destructive entries). */\n confirm?: ActionBarConfirm\n}\n\nexport interface ActionBarItem {\n id: string\n label: string\n /** Icon component or element, rendered decoratively. */\n icon: ComponentType<{ className?: string; 'aria-hidden'?: boolean | 'true' }> | ReactNode\n href?: string\n onPress?: () => void\n active?: boolean\n count?: number\n menu?: ActionBarMenuEntry[]\n /** Own shortcut (registered by the host), exposed with aria-keyshortcuts and in the tooltip. */\n shortcut?: string\n /** Contextual toggle state (aria-pressed), e.g. a canvas mode; destinations use `active`. */\n pressed?: boolean\n /** Contextual items of different groups are divided by a separator. */\n group?: string\n}\n\nexport interface FloatingActionBarProps {\n destinations: ActionBarItem[]\n contextual?: ActionBarItem[]\n /** Edge on wide screens; below 1024 px the bar is always at the bottom. */\n edge?: BarEdge\n /** `viewport` pins to the window; `container` to the nearest positioned ancestor (the research sheet). */\n anchor?: 'viewport' | 'container'\n /** Below 768 px: keep the floating bar or become a full-width bottom tab bar. */\n narrowVariant?: 'bar' | 'tabbar'\n autoHide?: boolean\n /** Inactivity (ms) before an auto-hiding bar fades out. */\n hideAfter?: number\n /** Defaults to true while both lists are empty. */\n loading?: boolean\n /** Chord that moves focus into the bar; null disables it. */\n focusShortcut?: string | null\n label?: string\n labels?: Partial<{ more: string; openMenu: (item: string) => string; count: (n: number) => string; loading: string }>\n onMenuAction?: (itemId: string, entryId: string) => void\n /** Confirmation service; defaults to a built-in alert dialog. */\n requestConfirm?: (options: ActionBarConfirm) => Promise<boolean>\n id?: string\n className?: string\n}\n\n/** Default focus chord, documented in the README. */\nexport const ACTION_BAR_SHORTCUT = 'Alt+Shift+D'\n\n/* ------------------------------------------------------------------------ */\n\nfunction renderGlyph(icon: ActionBarItem['icon'], className: string): ReactNode {\n if (icon == null) return null\n if (isValidElement(icon)) return <span className={className} aria-hidden=\"true\">{icon}</span>\n const Glyph = icon as ComponentType<{ className?: string; 'aria-hidden'?: boolean | 'true' }>\n return (\n <span className={className} aria-hidden=\"true\">\n <Glyph className=\"ty-icon\" aria-hidden=\"true\" />\n </span>\n )\n}\n\nfunction useWindowLength(horizontal: boolean): number {\n const read = () => (typeof window === 'undefined' ? 0 : horizontal ? window.innerWidth : window.innerHeight)\n const [length, setLength] = useState(read)\n // Breakpoint hooks re-render on media changes; the listener covers free resizing.\n useEffect(() => {\n const onResize = () => setLength(read())\n onResize()\n window.addEventListener('resize', onResize)\n return () => window.removeEventListener('resize', onResize)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [horizontal])\n return length\n}\n\n/** Publishes the bar thickness on the root so frames and pages pad their content. */\nfunction usePublishedInset(ref: RefObject<HTMLElement | null>, edge: BarEdge, tabBar: boolean, active: boolean) {\n useLayoutEffect(() => {\n if (!active || typeof document === 'undefined') return\n const root = document.documentElement\n const name = `--ty-action-bar-inset-${edge}`\n const rect = ref.current?.getBoundingClientRect()\n const measured = rect ? (isHorizontal(edge) ? rect.height : rect.width) : 0\n const thickness = Math.round((measured || 56) + (tabBar ? 0 : 24))\n root.style.setProperty(name, tabBar ? `calc(${thickness}px + env(safe-area-inset-bottom, 0px))` : `${thickness}px`)\n return () => {\n root.style.removeProperty(name)\n }\n }, [ref, edge, tabBar, active])\n}\n\n/* ------------------------------------------------------------------------ */\n\ninterface SlotProps {\n placed: Placed<ActionBarItem>\n index: number\n tabbable: boolean\n tabBar: boolean\n menuOpen: boolean\n onOpenMenu: (id: string, from: HTMLElement) => void\n onFocusIndex: (index: number) => void\n registerRef: (index: number, el: HTMLElement | null) => void\n nameOf: (item: ActionBarItem) => string\n numberText: (n: number) => string\n capText: string\n chevronName: (item: ActionBarItem) => string\n}\n\nfunction useItemSemantics(item: ActionBarItem, kind: BarKind, ref: RefObject<HTMLElement | null>) {\n // Destinations are links (router aware through RAC's RouterProvider); contextual items are buttons.\n const asLink = kind === 'destination' && !!item.href\n const link = useLink({ href: item.href ?? '#', onPress: item.onPress, elementType: 'a', isDisabled: !asLink }, ref as RefObject<HTMLAnchorElement>)\n const button = useButton({ onPress: item.onPress, elementType: 'button', isDisabled: asLink }, ref as RefObject<HTMLButtonElement>)\n return asLink ? { props: link.linkProps, as: 'a' as const } : { props: button.buttonProps, as: 'button' as const }\n}\n\nfunction BarSlot(props: SlotProps) {\n const { placed, index, tabbable, tabBar, menuOpen } = props\n const { item, kind } = placed\n const control = useRef<HTMLElement | null>(null)\n const [tip, setTip] = useState<'hidden' | 'shown' | 'dismissed'>('hidden')\n const semantics = useItemSemantics(item, kind, control)\n const hasMenu = !!item.menu?.length\n const { longPressProps } = useLongPress({\n isDisabled: !hasMenu,\n accessibilityDescription: undefined,\n onLongPress: () => control.current && props.onOpenMenu(item.id, control.current),\n })\n\n const attach = (el: HTMLElement | null) => {\n control.current = el\n props.registerRef(index, el)\n }\n const Tag = semantics.as\n const shortcutText = item.shortcut ? ariaShortcut(item.shortcut) : undefined\n const count = item.count && item.count > 0 ? item.count : 0\n\n return (\n <div\n className=\"ty-action-bar__slot\"\n data-kind={kind}\n onPointerEnter={() => setTip((t) => (t === 'dismissed' ? t : 'shown'))}\n onPointerLeave={() => setTip('hidden')}\n >\n <Tag\n {...mergeProps(semantics.props, hasMenu ? longPressProps : {}, {\n onFocus: (e: React.FocusEvent<HTMLElement>) => {\n props.onFocusIndex(index)\n if (e.currentTarget.matches(':focus-visible')) setTip((t) => (t === 'dismissed' ? t : 'shown'))\n },\n onBlur: () => setTip('hidden'),\n onKeyDownCapture: (e: ReactKeyboardEvent) => {\n if (e.key === 'Escape' && tip === 'shown') {\n setTip('dismissed')\n e.stopPropagation()\n }\n },\n onContextMenu: (e: React.MouseEvent) => {\n if (!hasMenu) return\n e.preventDefault()\n props.onOpenMenu(item.id, e.currentTarget as HTMLElement)\n },\n })}\n ref={attach as never}\n className=\"ty-action-bar__item\"\n tabIndex={tabbable ? 0 : -1}\n data-bar-index={index}\n data-active={item.active || (kind === 'contextual' && item.pressed) || undefined}\n aria-current={kind === 'destination' && item.active ? 'page' : undefined}\n aria-pressed={kind === 'contextual' && item.pressed !== undefined ? item.pressed : undefined}\n aria-label={props.nameOf(item)}\n aria-keyshortcuts={shortcutText}\n aria-haspopup={hasMenu ? 'menu' : undefined}\n aria-expanded={hasMenu ? menuOpen : undefined}\n >\n {renderGlyph(item.icon, 'ty-action-bar__glyph')}\n {tabBar ? <span className=\"ty-action-bar__caption\" aria-hidden=\"true\">{item.label}</span> : null}\n {count ? (\n <span className=\"ty-action-bar__count\" aria-hidden=\"true\">\n {count > 99 ? props.capText : props.numberText(count)}\n </span>\n ) : null}\n </Tag>\n {hasMenu && !tabBar ? (\n <button\n type=\"button\"\n tabIndex={-1}\n className=\"ty-action-bar__chevron\"\n aria-label={props.chevronName(item)}\n aria-haspopup=\"menu\"\n aria-expanded={menuOpen}\n onClick={() => control.current && props.onOpenMenu(item.id, control.current)}\n >\n <ChevronDown className=\"ty-icon ty-mirror-rtl\" aria-hidden=\"true\" />\n </button>\n ) : null}\n {tip === 'shown' && !tabBar ? (\n <span className=\"ty-action-bar__tip\" role=\"tooltip\">\n {item.label}\n {shortcutText ? <kbd className=\"ty-action-bar__kbd\">{item.shortcut}</kbd> : null}\n </span>\n ) : null}\n </div>\n )\n}\n\n/* ------------------------------------------------------------------------ */\n\ninterface OpenMenu {\n owner: string\n trigger: HTMLElement\n}\n\nfunction MenuLayer(props: {\n open: OpenMenu | null\n entries: Array<{ id: string; label: string; href?: string; tone?: string; icon?: ActionBarMenuEntry['icon'] }>\n placement: 'top' | 'bottom' | 'start' | 'end'\n label: string\n onAction: (entryId: string) => void\n onClose: () => void\n}) {\n const triggerRef = useRef<HTMLElement | null>(props.open?.trigger ?? null)\n triggerRef.current = props.open?.trigger ?? null\n if (!props.open) return null\n return (\n <Popover\n className=\"ty-action-bar__popover\"\n triggerRef={triggerRef}\n isOpen\n onOpenChange={(next) => !next && props.onClose()}\n placement={props.placement}\n offset={8}\n >\n <Menu className=\"ty-action-bar__menu\" aria-label={props.label} autoFocus=\"first\" onAction={(key) => props.onAction(String(key))}>\n {props.entries.map((entry) => (\n <MenuItem key={entry.id} id={entry.id} href={entry.href} className=\"ty-action-bar__entry\" data-tone={entry.tone ?? 'neutral'} textValue={entry.label}>\n {entry.icon ? renderGlyph(entry.icon, 'ty-action-bar__entry-glyph') : null}\n <span>{entry.label}</span>\n </MenuItem>\n ))}\n </Menu>\n </Popover>\n )\n}\n\nfunction useBuiltInConfirm() {\n const [pending, setPending] = useState<{ options: ActionBarConfirm; settle: (ok: boolean) => void } | null>(null)\n const ask = useCallback((options: ActionBarConfirm) => new Promise<boolean>((settle) => setPending({ options, settle })), [])\n const close = (ok: boolean) => {\n pending?.settle(ok)\n setPending(null)\n }\n return { ask, pending, close }\n}\n\n/* ------------------------------------------------------------------------ */\n\nconst MORE_ID = '__ty-more__'\nconst ALL_SECTIONS_ID = '__ty-all-sections__'\n\n/**\n * Floating bar of destinations and contextual actions with a full keyboard\n * path, item menus and overflow (spec: wave-4/floating-action-bar.md).\n */\nexport function FloatingActionBar(props: FloatingActionBarProps) {\n const m = useMessages().actionBar\n const text = { ...m, ...props.labels }\n // Inside the research shell, the tab bar's \"more\" menu can open the rail drawer.\n const host = useAppFrame()\n const { direction } = useLocale()\n const wide = useMinWidth(breakpoints.lg)\n const narrow = !useMinWidth(breakpoints.md)\n const reducedMotion = useReducedMotion()\n const barId = props.id ?? 'ty-action-bar'\n\n const destinations = props.destinations\n const contextual = props.contextual ?? []\n const loading = props.loading ?? (destinations.length === 0 && contextual.length === 0)\n const edge = effectiveEdge(props.edge ?? 'start', wide)\n const tabBar = narrow && props.narrowVariant === 'tabbar'\n const horizontal = isHorizontal(edge)\n const length = useWindowLength(horizontal)\n\n const plan = useMemo(() => {\n // A tab bar holds at most TAB_BAR_SLOTS items; the next slot is \"more\".\n const total = destinations.length + contextual.length\n const slots = tabBar ? (total <= TAB_BAR_SLOTS ? TAB_BAR_SLOTS : TAB_BAR_SLOTS + 1) : slotsAlong(length)\n return planBar(destinations, contextual, slots)\n }, [destinations, contextual, length, tabBar])\n const showMore = plan.overflow.length > 0 || (tabBar && !!host.openNavigation)\n\n // Roving focus over the visible items plus \"more\".\n const refs = useRef<Array<HTMLElement | null>>([])\n const count = plan.shown.length + (showMore ? 1 : 0)\n const activeIndex = Math.max(0, plan.shown.findIndex((p) => p.item.active))\n const [rover, setRover] = useState(activeIndex)\n const roverIndex = rover < count ? rover : activeIndex\n\n const barRef = useRef<HTMLElement | null>(null)\n const [openMenu, setOpenMenu] = useState<OpenMenu | null>(null)\n const returnTo = useRef<HTMLElement | null>(null)\n const [hidden, setHidden] = useState(false)\n const confirm = useBuiltInConfirm()\n const requestConfirm = props.requestConfirm ?? confirm.ask\n\n const focusAt = (index: number) => {\n setRover(index)\n refs.current[index]?.focus()\n }\n\n // Auto-hide: never with focus inside, a menu open, or reduced motion.\n const hideTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const canHide = !!props.autoHide && !reducedMotion\n const poke = useCallback(() => {\n setHidden(false)\n clearTimeout(hideTimer.current)\n if (!canHide) return\n hideTimer.current = setTimeout(() => {\n const bar = barRef.current\n if (bar && bar.contains(document.activeElement)) return\n setHidden(true)\n }, props.hideAfter ?? 4000)\n }, [canHide, props.hideAfter])\n useEffect(() => {\n poke()\n return () => clearTimeout(hideTimer.current)\n }, [poke])\n useEffect(() => {\n if (openMenu) {\n clearTimeout(hideTimer.current)\n setHidden(false)\n } else poke()\n }, [openMenu, poke])\n useEffect(() => {\n if (!canHide) return\n // Pointer near the bar's edge reveals it.\n const near = (e: PointerEvent) => {\n const w = window.innerWidth\n const h = window.innerHeight\n const distance = { bottom: h - e.clientY, top: e.clientY, start: direction === 'rtl' ? w - e.clientX : e.clientX, end: direction === 'rtl' ? e.clientX : w - e.clientX }[edge]\n if (distance < 72) poke()\n }\n window.addEventListener('pointermove', near)\n return () => window.removeEventListener('pointermove', near)\n }, [canHide, edge, direction, poke])\n\n // Focus shortcut: reveal, remember where focus was, land on the active item.\n useEffect(() => {\n if (props.focusShortcut === null) return\n const chord = parseChord(props.focusShortcut ?? ACTION_BAR_SHORTCUT)\n const onKey = (e: KeyboardEvent) => {\n if (!chordMatches(e, chord)) return\n e.preventDefault()\n const current = document.activeElement as HTMLElement | null\n if (current && !barRef.current?.contains(current)) returnTo.current = current\n setHidden(false)\n requestAnimationFrame(() => focusAt(activeIndex))\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.focusShortcut, activeIndex])\n\n usePublishedInset(barRef, edge, tabBar, !loading)\n\n const speech = useLocaleText()\n const nameOf = (item: ActionBarItem) => (item.count && item.count > 0 ? speech.join(item.label, text.count(item.count)) : item.label)\n const itemById = (id: string) => [...plan.shown, ...plan.overflow].find((p) => p.item.id === id)?.item\n\n const openMenuOf = (id: string, trigger: HTMLElement) => {\n if (id !== MORE_ID && !itemById(id)?.menu?.length) return\n setOpenMenu({ owner: id, trigger })\n }\n const closeMenu = () => {\n const trigger = openMenu?.trigger\n setOpenMenu(null)\n if (trigger) requestAnimationFrame(() => trigger.focus())\n }\n\n const onToolbarKey = (e: ReactKeyboardEvent<HTMLElement>) => {\n const origin = (e.target as HTMLElement).closest<HTMLElement>('[data-bar-index]')\n if (!origin) return\n const index = Number(origin.dataset.barIndex)\n if ((e.key === 'F10' && e.shiftKey) || e.key === 'ContextMenu') {\n e.preventDefault()\n const owner = index === plan.shown.length ? MORE_ID : plan.shown[index]?.item.id\n if (owner) openMenuOf(owner, origin)\n return\n }\n if (e.key === 'Escape') {\n if (returnTo.current) {\n e.preventDefault()\n const back = returnTo.current\n returnTo.current = null\n back.focus()\n }\n return\n }\n const step = stepFor(e.key, edge, direction === 'rtl')\n if (!step) return\n e.preventDefault()\n if (step === 'menu') {\n const owner = index === plan.shown.length ? MORE_ID : plan.shown[index]?.item.id\n if (owner) openMenuOf(owner, origin)\n return\n }\n focusAt(moveIndex(index, count, step))\n }\n\n const runEntry = async (owner: string, entryId: string) => {\n if (owner === MORE_ID) {\n setOpenMenu(null)\n if (entryId === ALL_SECTIONS_ID) return host.openNavigation?.()\n const target = plan.overflow.find((p) => p.item.id === entryId)?.item\n target?.onPress?.()\n return\n }\n const entry = itemById(owner)?.menu?.find((x) => x.id === entryId)\n closeMenu()\n if (!entry || entry.href) return\n if (entry.confirm && !(await requestConfirm(entry.confirm))) return\n props.onMenuAction?.(owner, entryId)\n }\n\n const menuEntries =\n openMenu?.owner === MORE_ID\n ? [\n ...plan.overflow.map((p) => ({ id: p.item.id, label: nameOf(p.item), href: p.item.href, icon: typeof p.item.icon === 'function' ? (p.item.icon as ActionBarMenuEntry['icon']) : undefined })),\n ...(tabBar && host.openNavigation ? [{ id: ALL_SECTIONS_ID, label: text.allSections }] : []),\n ]\n : (openMenu && itemById(openMenu.owner)?.menu) || []\n const menuOwnerLabel = openMenu?.owner === MORE_ID ? text.more : (openMenu && itemById(openMenu.owner)?.label) || ''\n\n const common = {\n id: barId,\n 'aria-label': props.label ?? text.label,\n 'data-edge': edge,\n 'data-anchor': props.anchor ?? 'viewport',\n 'data-variant': tabBar ? 'tabbar' : 'bar',\n 'data-orientation': horizontal ? 'horizontal' : 'vertical',\n }\n\n if (loading) {\n return (\n <nav {...common} className={cx('ty-action-bar', props.className)} aria-busy=\"true\" data-loading=\"\">\n <span role=\"status\" className=\"ty-visually-hidden\">\n {text.loading}\n </span>\n <span className=\"ty-action-bar__ghosts\" aria-hidden=\"true\">\n {Array.from({ length: 5 }, (_, i) => (\n <span key={i} className=\"ty-action-bar__ghost\" />\n ))}\n </span>\n </nav>\n )\n }\n\n const firstContextual = plan.shown.findIndex((p) => p.kind === 'contextual')\n /** A separator opens the contextual run and each new contextual group. */\n const startsGroup = (index: number) => {\n if (index === 0) return false\n if (index === firstContextual) return true\n const here = plan.shown[index]!\n const before = plan.shown[index - 1]!\n return here.kind === 'contextual' && before.kind === 'contextual' && here.item.group !== undefined && before.item.group !== undefined && here.item.group !== before.item.group\n }\n const placement = ({ bottom: 'top', top: 'bottom', start: 'end', end: 'start' } as const)[edge]\n\n return (\n <>\n <nav\n {...common}\n ref={barRef as RefObject<HTMLElement>}\n className={cx('ty-action-bar', props.className)}\n data-hidden={hidden || undefined}\n {...inertProps(hidden)}\n tabIndex={-1}\n onFocus={(e) => {\n // Skip-link arrival on the landmark forwards focus to the active item.\n if (e.target === e.currentTarget) focusAt(activeIndex)\n poke()\n }}\n onPointerMove={poke}\n >\n <div\n role=\"toolbar\"\n aria-label={props.label ?? text.label}\n aria-orientation={horizontal ? 'horizontal' : 'vertical'}\n className=\"ty-action-bar__track\"\n onKeyDown={onToolbarKey}\n >\n {plan.shown.map((placed, index) => (\n <FragmentWithSeparator key={placed.item.id} before={startsGroup(index)} horizontal={horizontal}>\n <BarSlot\n placed={placed}\n index={index}\n tabbable={index === roverIndex}\n tabBar={tabBar}\n menuOpen={openMenu?.owner === placed.item.id}\n onOpenMenu={openMenuOf}\n onFocusIndex={setRover}\n registerRef={(i, el) => (refs.current[i] = el)}\n nameOf={nameOf}\n numberText={speech.number}\n capText={text.capped(speech.number(99))}\n chevronName={(item) => text.openMenu(item.label)}\n />\n </FragmentWithSeparator>\n ))}\n {showMore ? (\n <MoreSlot\n index={plan.shown.length}\n tabbable={roverIndex === plan.shown.length}\n label={text.more}\n tabBar={tabBar}\n open={openMenu?.owner === MORE_ID}\n registerRef={(el) => (refs.current[plan.shown.length] = el)}\n onFocusIndex={setRover}\n onOpen={(el) => openMenuOf(MORE_ID, el)}\n />\n ) : null}\n </div>\n </nav>\n <MenuLayer\n open={openMenu}\n entries={menuEntries}\n placement={placement}\n label={menuOwnerLabel}\n onAction={(entryId) => openMenu && void runEntry(openMenu.owner, entryId)}\n onClose={closeMenu}\n />\n {confirm.pending ? (\n <ModalDialog\n isOpen\n role=\"alertdialog\"\n onOpenChange={(open) => !open && confirm.close(false)}\n title={confirm.pending.options.title}\n description={confirm.pending.options.message}\n actions={\n <>\n <Button autoFocus onPress={() => confirm.close(false)}>\n {confirm.pending.options.cancelLabel ?? text.cancel}\n </Button>\n <Button variant=\"danger\" onPress={() => confirm.close(true)}>\n {confirm.pending.options.confirmLabel ?? text.confirm}\n </Button>\n </>\n }\n />\n ) : null}\n </>\n )\n}\n\nfunction FragmentWithSeparator({ before, horizontal, children }: { before: boolean; horizontal: boolean; children: ReactNode }) {\n return (\n <>\n {before ? <span role=\"separator\" aria-orientation={horizontal ? 'vertical' : 'horizontal'} className=\"ty-action-bar__separator\" /> : null}\n {children}\n </>\n )\n}\n\nfunction MoreSlot(props: {\n index: number\n tabbable: boolean\n label: string\n tabBar: boolean\n open: boolean\n registerRef: (el: HTMLElement | null) => void\n onFocusIndex: (index: number) => void\n onOpen: (el: HTMLElement) => void\n}) {\n const ref = useRef<HTMLButtonElement | null>(null)\n const { buttonProps } = useButton({ onPress: () => ref.current && props.onOpen(ref.current), elementType: 'button' }, ref)\n return (\n <div className=\"ty-action-bar__slot\" data-kind=\"more\">\n <button\n {...mergeProps(buttonProps, { onFocus: () => props.onFocusIndex(props.index) })}\n ref={(el) => {\n ref.current = el\n props.registerRef(el)\n }}\n className=\"ty-action-bar__item\"\n tabIndex={props.tabbable ? 0 : -1}\n data-bar-index={props.index}\n aria-label={props.label}\n aria-haspopup=\"menu\"\n aria-expanded={props.open}\n >\n <span className=\"ty-action-bar__glyph\" aria-hidden=\"true\">\n <Ellipsis className=\"ty-icon\" aria-hidden=\"true\" />\n </span>\n {props.tabBar ? <span className=\"ty-action-bar__caption\" aria-hidden=\"true\">{props.label}</span> : null}\n </button>\n </div>\n )\n}\n","import type { CSSProperties, ReactNode } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useLocaleText } from '../../internal/speech'\nimport { useMessages } from '../../internal/provider'\nimport type { ProofState } from '../proof-badge/ProofBadge'\n\nexport type PhaseTone = ProofState | 'none' | 'accent' | 'neutral'\n\nexport interface PhaseSegment {\n id: string\n label: string\n value: number\n tone: PhaseTone\n}\n\nexport interface PhaseBarProps {\n segments: PhaseSegment[]\n label: string\n /** Reading sentence under the bar. */\n caption?: ReactNode\n locale?: string\n className?: string\n}\n\n/** Share (0–100) of each value in the total; zero total gives zeros. */\nexport function shares(values: number[]): number[] {\n const total = values.reduce((sum, v) => sum + Math.max(0, v), 0)\n return values.map((v) => (total > 0 ? (Math.max(0, v) / total) * 100 : 0))\n}\n\n/** One bar split by share, with a textual legend (spec: wave-4/phase-bar.md; §2.11 textures). */\nexport function PhaseBar({ segments, label, caption, locale, className }: PhaseBarProps) {\n const words = useMessages().phaseBar\n const adapter = useLocale().locale\n const fmt = new Intl.NumberFormat(locale ?? adapter)\n const percent = shares(segments.map((s) => s.value))\n const speech = useLocaleText()\n const spoken = segments.length ? speech.join(...segments.map((s) => words.part(s.label, fmt.format(s.value)))) : words.empty\n return (\n <figure className={cx('ty-phase-bar', className)}>\n <div className=\"ty-phase-bar__track\" role=\"img\" aria-label={words.named(label, spoken)}>\n {segments.map((segment, i) =>\n segment.value > 0 ? (\n <span\n key={segment.id}\n className=\"ty-phase-bar__segment\"\n data-tone={segment.tone}\n style={{ '--ty-phase-share': `${percent[i]}%` } as CSSProperties}\n />\n ) : null,\n )}\n </div>\n <ul className=\"ty-phase-bar__legend\">\n {segments.map((segment) => (\n <li key={segment.id} className=\"ty-phase-bar__key\" data-tone={segment.tone}>\n <span className=\"ty-phase-bar__swatch\" aria-hidden=\"true\" />\n <span className=\"ty-phase-bar__word\" dir=\"auto\">{segment.label}</span>\n <span className=\"ty-phase-bar__count\">{fmt.format(segment.value)}</span>\n </li>\n ))}\n </ul>\n {caption ? <figcaption className=\"ty-phase-bar__caption\" dir=\"auto\">{caption}</figcaption> : null}\n </figure>\n )\n}\n","import { useId, useState, type CSSProperties, type ReactNode } from 'react'\nimport { useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useMinWidth } from '../../internal/media'\nimport { clampSize, useSplitter } from './useSplitter'\n\nexport interface ResizableSplitProps {\n primary: ReactNode\n secondary: ReactNode\n /** Controlled size (px) of the secondary pane. */\n size?: number\n defaultSize?: number\n onSizeChange?: (px: number) => void\n min?: number\n max?: number\n /** Side of the sized pane. */\n secondarySide?: 'start' | 'end'\n /** Arrow-key step (px). */\n step?: number\n /** Accessible name of the splitter. */\n label: string\n /** Below this viewport width the panes stack and the splitter goes away. */\n stackBelow?: number\n className?: string\n}\n\n/** Two panes with a keyboard-operable divider (spec: wave-4/resizable-split.md, APG Window Splitter). */\nexport function ResizableSplit(props: ResizableSplitProps) {\n const min = props.min ?? 240\n const max = props.max ?? 640\n const [own, setOwn] = useState(() => clampSize(props.defaultSize ?? 360, min, max))\n const size = props.size ?? own\n const side = props.secondarySide ?? 'end'\n const { direction } = useLocale()\n const sideBySide = useMinWidth(props.stackBelow ?? 1024)\n const paneId = useId()\n // The sized pane grows towards the splitter, i.e. away from its own side.\n const growsLeft = (side === 'end') === (direction !== 'rtl')\n const splitter = useSplitter({\n size,\n min,\n max,\n step: props.step ?? 8,\n grows: growsLeft ? 'left' : 'right',\n onSize: (px) => {\n if (props.size === undefined) setOwn(px)\n props.onSizeChange?.(px)\n },\n })\n\n const panes = {\n primary: (\n <div key=\"primary\" className=\"ty-split__pane\" data-pane=\"primary\">\n {props.primary}\n </div>\n ),\n secondary: (\n <div key=\"secondary\" id={paneId} className=\"ty-split__pane\" data-pane=\"secondary\">\n {props.secondary}\n </div>\n ),\n handle: sideBySide ? <div key=\"handle\" {...splitter} aria-label={props.label} aria-controls={paneId} className=\"ty-split__handle\" /> : null,\n }\n const order = side === 'end' ? [panes.primary, panes.handle, panes.secondary] : [panes.secondary, panes.handle, panes.primary]\n\n return (\n <div\n className={cx('ty-split', props.className)}\n data-side={side}\n data-stacked={sideBySide ? undefined : ''}\n style={{ '--ty-split-size': `${size}px` } as CSSProperties}\n >\n {order}\n </div>\n )\n}\n","import { ArrowRight, CircleCheck, CircleDot, Circle, TriangleAlert } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { Link as AriaLink } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport type { StageStatus } from '../../internal/messages/shell'\nimport { useMessages } from '../../internal/provider'\nimport type { IconComponent } from '../../internal/types'\n\nexport type { StageStatus } from '../../internal/messages/shell'\n\n/** One step of the research pipeline (spec: wave-4/stage-strip.md). */\nexport interface Stage {\n id: string\n label: string\n href?: string\n status: StageStatus\n /** One or two short figures (\"14 sources\", \"2 sessions\"). */\n figures?: string[]\n}\n\nexport interface StageStripProps {\n stages: Stage[]\n /** Name of the list. */\n label: string\n /** Optional visible title above the strip. */\n title?: string\n className?: string\n}\n\n/** How each status looks and what it means for assistive technology. */\nconst LOOK: { [K in StageStatus]: { glyph: IconComponent; step?: 'step' } } = {\n done: { glyph: CircleCheck },\n current: { glyph: CircleDot, step: 'step' },\n upcoming: { glyph: Circle },\n attention: { glyph: TriangleAlert },\n}\n\nfunction Title({ to, children }: { to?: string; children: string }) {\n // Content text keeps its own direction inside a frame of the other direction.\n return to ? (\n <AriaLink className=\"ty-stage-strip__name\" href={to} dir=\"auto\">\n {children}\n </AriaLink>\n ) : (\n <span className=\"ty-stage-strip__name\" dir=\"auto\">\n {children}\n </span>\n )\n}\n\nfunction Connector() {\n return <ArrowRight className=\"ty-icon ty-stage-strip__arrow ty-mirror-rtl\" aria-hidden=\"true\" focusable=\"false\" />\n}\n\nfunction Cell({ stage, word }: { stage: Stage; word: string }) {\n const Glyph = LOOK[stage.status].glyph\n const numbers: ReactNode = stage.figures?.length ? (\n <span className=\"ty-stage-strip__figures\">\n {stage.figures.map((line, n) => (\n <span key={n} dir=\"auto\">\n {line}\n </span>\n ))}\n </span>\n ) : null\n return (\n <div className=\"ty-stage-strip__card\">\n <Title to={stage.href}>{stage.label}</Title>\n <span className=\"ty-stage-strip__status\">\n <Glyph className=\"ty-icon\" aria-hidden=\"true\" focusable=\"false\" />\n {word}\n </span>\n {numbers}\n </div>\n )\n}\n\n/** Research pipeline from search to manuscript, joined by arrows. */\nexport function StageStrip(props: StageStripProps) {\n const statusWords = useMessages().stageStrip.status\n const count = props.stages.length\n const items = props.stages.map((stage, position) => (\n <li key={stage.id} className=\"ty-stage-strip__stage\" data-status={stage.status} aria-current={LOOK[stage.status].step}>\n <Cell stage={stage} word={statusWords[stage.status]} />\n {position + 1 < count ? <Connector /> : null}\n </li>\n ))\n return (\n <div className={cx('ty-stage-strip', props.className)}>\n {props.title ? (\n <p className=\"ty-stage-strip__title\" dir=\"auto\">\n {props.title}\n </p>\n ) : null}\n <ol className=\"ty-stage-strip__list\" aria-label={props.label}>\n {items}\n </ol>\n </div>\n )\n}\n","import { Link as AriaLink, useLocale } from 'react-aria-components'\nimport { cx } from '../../internal/cx'\nimport { useLocaleText } from '../../internal/speech'\nimport { ProofBadge, type ProofState } from '../proof-badge/ProofBadge'\n\nexport interface StatStripItem {\n id: string\n value: number | string\n label: string\n detail?: string\n /** Every number links to the view that produces it (§3.5). */\n href?: string\n proof?: ProofState\n format?: Intl.NumberFormatOptions\n}\n\nexport interface StatStripProps {\n items: StatStripItem[]\n /** Name of the group. */\n label: string\n locale?: string\n className?: string\n}\n\nconst shown = (value: number | string, locale: string, format?: Intl.NumberFormatOptions) =>\n typeof value === 'number' ? new Intl.NumberFormat(locale, format).format(value) : value\n\n/** Headline numbers separated by hairlines, no cards (spec: wave-4/stat-strip.md). */\nexport function StatStrip({ items, label, locale, className }: StatStripProps) {\n const fromAdapter = useLocale().locale\n const lang = locale ?? fromAdapter\n const speech = useLocaleText()\n return (\n <div role=\"group\" aria-label={label} className={cx('ty-stat-strip', className)}>\n <dl className=\"ty-stat-strip__list\">\n {items.map((stat) => {\n const text = shown(stat.value, lang, stat.format)\n return (\n <div key={stat.id} className=\"ty-stat-strip__item\" data-linked={stat.href ? '' : undefined}>\n <dt className=\"ty-stat-strip__label\" dir=\"auto\">{stat.label}</dt>\n <dd className=\"ty-stat-strip__value\">\n {stat.href ? (\n <AriaLink className=\"ty-stat-strip__link\" href={stat.href} aria-label={speech.pair(text, stat.label)}>\n {text}\n </AriaLink>\n ) : (\n text\n )}\n </dd>\n {stat.detail || stat.proof ? (\n <dd className=\"ty-stat-strip__detail\">\n {stat.proof ? <ProofBadge state={stat.proof} /> : null}\n {stat.detail ? <span dir=\"auto\">{stat.detail}</span> : null}\n </dd>\n ) : null}\n </div>\n )\n })}\n </dl>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA,MAAa,cAAc;CAAE,IAAI;CAAK,IAAI;CAAK,IAAI;CAAM,IAAI;CAAM,KAAK;AAAK;AAE7E,SAAS,UAAU,OAAe;CAChC,QAAQ,aAAyB;EAC/B,IAAI,OAAO,WAAW,eAAe,CAAC,OAAO,YAAY,aAAa,CAAC;EACvE,MAAM,MAAM,OAAO,WAAW,KAAK;EACnC,IAAI,iBAAiB,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